From: Jérémie Astor Date: Sat, 23 Jan 2021 11:37:08 +0000 (+0100) Subject: :art: Optimize jumps to next pc X-Git-Tag: nightly~1027 X-Git-Url: http://10.10.0.4:5575/?a=commitdiff_plain;h=553990b36329ae93af7af330036b01ab7fa26897;p=gwion.git :art: Optimize jumps to next pc --- diff --git a/src/vm/vm_code.c b/src/vm/vm_code.c index d5ec5adf..30d38ff6 100644 --- a/src/vm/vm_code.c +++ b/src/vm/vm_code.c @@ -98,7 +98,10 @@ ANN static m_bit* tobytecode(MemPool p, const VM_Code code) { vector_add(&nop, i); continue; } - if(instr->opcode != eNoOp) + if(instr->opcode == eGoto && instr->m_val == i+1) { + instr->opcode = eNoOp; + vector_add(&nop, i); + } else if(instr->opcode != eNoOp) memcpy(data, instr, BYTECODE_SZ); else vector_add(&nop, i);