inline and expand conditionals whenever possible

This commit is contained in:
Mark Thom
2018-01-23 21:01:53 -07:00
parent 677beedec3
commit 41dc8e8d6a
12 changed files with 250 additions and 166 deletions

View File

@@ -1672,8 +1672,8 @@ impl MachineState {
let val = self.try_functor();
self.p = self.cp;
val
}),
&ControlInstruction::Goto(p, arity) => {
}),
&ControlInstruction::GotoExecute(p, arity) => {
self.num_of_args = arity;
self.b0 = self.b;
self.p = CodePtr::DirEntry(p);
@@ -1692,6 +1692,17 @@ impl MachineState {
self.unify(a1, Addr::Con(Constant::Number(a2)));
self.p = self.cp;
},
&ControlInstruction::JmpByCall(arity, ref offset) => {
self.cp = self.p + 1;
self.num_of_args = arity;
self.b0 = self.b;
self.p += offset.get();
},
&ControlInstruction::JmpByExecute(arity, ref offset) => {
self.num_of_args = arity;
self.b0 = self.b;
self.p += offset.get();
},
&ControlInstruction::Proceed =>
self.p = self.cp,
&ControlInstruction::ThrowCall => {