From 479477a968d291457e5776acc0ff040507b26755 Mon Sep 17 00:00:00 2001 From: Stefan Marr Date: Wed, 31 Jul 2024 00:42:08 +0100 Subject: [PATCH] Add missing bytecodes in inline/adapt after inling handling Signed-off-by: Stefan Marr --- src/vmobjects/VMMethod.cpp | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/src/vmobjects/VMMethod.cpp b/src/vmobjects/VMMethod.cpp index 5248761f..99a1961f 100644 --- a/src/vmobjects/VMMethod.cpp +++ b/src/vmobjects/VMMethod.cpp @@ -230,6 +230,27 @@ void VMMethod::inlineInto(MethodGenerationContext& mgenc) { } break; } + + case BC_PUSH_LOCAL_0: + case BC_PUSH_LOCAL_1: + case BC_PUSH_LOCAL_2: { + uint8_t idx = bytecode - BC_PUSH_LOCAL_0; + auto* oldVar = lexicalScope->GetLocal(idx, 0); + uint8_t newIdx = mgenc.GetInlinedLocalIdx(oldVar); + EmitPUSHLOCAL(mgenc, newIdx, 0); + break; + } + + case BC_POP_LOCAL_0: + case BC_POP_LOCAL_1: + case BC_POP_LOCAL_2: { + uint8_t idx = bytecode - BC_POP_LOCAL_0; + auto* oldVar = lexicalScope->GetLocal(idx, 0); + uint8_t newIdx = mgenc.GetInlinedLocalIdx(oldVar); + EmitPOPLOCAL(mgenc, newIdx, 0); + break; + } + case BC_PUSH_BLOCK: { VMMethod* blockMethod = (VMMethod*) GetConstant(i); blockMethod->AdaptAfterOuterInlined(1, mgenc); @@ -468,6 +489,18 @@ void VMMethod::AdaptAfterOuterInlined(uint8_t removedCtxLevel, MethodGenerationC break; } + case BC_PUSH_SELF: + case BC_PUSH_ARG_1: + case BC_PUSH_ARG_2: + case BC_PUSH_LOCAL_0: + case BC_PUSH_LOCAL_1: + case BC_PUSH_LOCAL_2: + case BC_POP_LOCAL_0: + case BC_POP_LOCAL_1: + case BC_POP_LOCAL_2: { + break; + } + case BC_HALT: case BC_PUSH_FIELD_0: case BC_PUSH_FIELD_1: