inline atomic and var.

This commit is contained in:
Mark Thom
2017-11-03 20:41:01 -06:00
parent 2abec91360
commit 57cc8ccac9
10 changed files with 105 additions and 45 deletions

View File

@@ -421,10 +421,14 @@ impl Machine {
self.query_stepper();
match self.ms.p {
CodePtr::TopLevel(_, p) if p > 0 => {},
CodePtr::TopLevel(_, p) if p > 0 => {},
_ => break
};
}
if let CodePtr::TopLevel(cn, _) = self.ms.p {
self.record_var_places(cn, alloc_locs, heap_locs);
}
}
fn fail<'a>(&mut self) -> EvalSession<'a>
@@ -1388,16 +1392,16 @@ impl MachineState {
self.b = self.block;
self.fail = true;
},
&BuiltInInstruction::IsAtomic => {
let d = self.deref(self[temp_v!(1)].clone());
&BuiltInInstruction::IsAtomic(r) => {
let d = self.deref(self[r].clone());
match d {
Addr::Con(_) => self.p += 1,
_ => self.fail = true
};
},
&BuiltInInstruction::IsVar => {
let d = self.deref(self[temp_v!(1)].clone());
&BuiltInInstruction::IsVar(r) => {
let d = self.deref(self[r].clone());
match d {
Addr::HeapCell(_) | Addr::StackCell(_,_) =>
@@ -1410,6 +1414,9 @@ impl MachineState {
&BuiltInInstruction::Fail => {
self.fail = true;
self.p += 1;
},
&BuiltInInstruction::Succeed => {
self.p += 1;
}
};
}