Don't update PC on every instruction (#130)
This commit is contained in:
parent
7509477a61
commit
ad4236263a
|
@ -237,12 +237,9 @@ impl Interpreter {
|
||||||
let instruction = iter.next().expect("instruction");
|
let instruction = iter.next().expect("instruction");
|
||||||
|
|
||||||
match self.run_instruction(function_context, instruction)? {
|
match self.run_instruction(function_context, instruction)? {
|
||||||
InstructionOutcome::RunNextInstruction => {
|
InstructionOutcome::RunNextInstruction => {},
|
||||||
function_context.position = iter.position();
|
|
||||||
},
|
|
||||||
InstructionOutcome::Branch(target) => {
|
InstructionOutcome::Branch(target) => {
|
||||||
function_context.position = target.dst_pc;
|
iter = instructions.iterate_from(target.dst_pc);
|
||||||
iter = instructions.iterate_from(function_context.position);
|
|
||||||
self.value_stack.drop_keep(target.drop_keep);
|
self.value_stack.drop_keep(target.drop_keep);
|
||||||
},
|
},
|
||||||
InstructionOutcome::ExecuteCall(func_ref) => {
|
InstructionOutcome::ExecuteCall(func_ref) => {
|
||||||
|
|
Loading…
Reference in New Issue