transition to debray allocation

This commit is contained in:
Mark Thom
2017-04-30 13:53:15 -06:00
parent 1bdc539c25
commit 316e5c5c1a
11 changed files with 440 additions and 100 deletions

View File

@@ -16,6 +16,8 @@ pub trait CompilationTarget<'a> {
fn argument_to_variable(RegType, usize) -> Self;
fn argument_to_value(RegType, usize) -> Self;
fn move_to_register(RegType, usize) -> Self;
fn subterm_to_variable(RegType) -> Self;
fn subterm_to_value(RegType) -> Self;
@@ -53,6 +55,10 @@ impl<'a> CompilationTarget<'a> for FactInstruction {
FactInstruction::GetVariable(arg, val)
}
fn move_to_register(arg: RegType, val: usize) -> Self {
FactInstruction::GetVariable(arg, val)
}
fn argument_to_value(arg: RegType, val: usize) -> Self {
FactInstruction::GetValue(arg, val)
}
@@ -100,6 +106,10 @@ impl<'a> CompilationTarget<'a> for QueryInstruction {
fn argument_to_variable(arg: RegType, val: usize) -> Self {
QueryInstruction::PutVariable(arg, val)
}
fn move_to_register(arg: RegType, val: usize) -> Self {
QueryInstruction::GetVariable(arg, val)
}
fn argument_to_value(arg: RegType, val: usize) -> Self {
QueryInstruction::PutValue(arg, val)