Skip to content

Commit

Permalink
Add missing bytecodes in inline/adapt after inling handling
Browse files Browse the repository at this point in the history
Signed-off-by: Stefan Marr <[email protected]>
  • Loading branch information
smarr committed Jul 30, 2024
1 parent 08d9ecf commit 479477a
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions src/vmobjects/VMMethod.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit 479477a

Please sign in to comment.