Don't update PC on every instruction

This commit is contained in:
Sergey Pepyakin 2018-10-19 14:11:10 +02:00
parent 7509477a61
commit 08836c68dd
1 changed files with 2 additions and 5 deletions

View File

@ -237,12 +237,9 @@ impl Interpreter {
let instruction = iter.next().expect("instruction");
match self.run_instruction(function_context, instruction)? {
InstructionOutcome::RunNextInstruction => {
function_context.position = iter.position();
},
InstructionOutcome::RunNextInstruction => {},
InstructionOutcome::Branch(target) => {
function_context.position = target.dst_pc;
iter = instructions.iterate_from(function_context.position);
iter = instructions.iterate_from(target.dst_pc);
self.value_stack.drop_keep(target.drop_keep);
},
InstructionOutcome::ExecuteCall(func_ref) => {