Skip to content

Commit 3617d05

Browse files
committed
Add missing call instrs and re-order where result is read from
1 parent b173aca commit 3617d05

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

core/src/main/java/org/jruby/ir/persistence/InstrDecoderMap.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public Instr decodeInner(Operation operation) {
5050
case B_NIL: return createBNil();
5151
case B_TRUE: return createBTrue();
5252
case B_UNDEF: return createBUndef();
53-
case CALL: return decodeCall();
53+
case CALL_1F: case CALL_1D: case CALL_1O: case CALL_1OB: case CALL_0O: case CALL: return decodeCall();
5454
case CHECK_ARGS_ARRAY_ARITY: return new CheckArgsArrayArityInstr(d.decodeOperand(), d.decodeInt(), d.decodeInt(), d.decodeInt());
5555
case CHECK_ARITY: return new CheckArityInstr(d.decodeInt(), d.decodeInt(), d.decodeInt(), d.decodeBoolean(), d.decodeInt());
5656
case CLASS_VAR_MODULE: return new GetClassVarContainerModuleInstr(d.decodeVariable(), d.decodeOperand(), d.decodeVariable());
@@ -91,7 +91,7 @@ public Instr decodeInner(Operation operation) {
9191
case MATCH3: return new Match3Instr(d.decodeVariable(), d.decodeOperand(), d.decodeOperand());
9292
case NONLOCAL_RETURN: return new NonlocalReturnInstr(d.decodeOperand(), d.decodeString());
9393
case NOP: return NopInstr.NOP;
94-
case NORESULT_CALL: return decodeNoResultCall();
94+
case NORESULT_CALL: case NORESULT_CALL_1O: return decodeNoResultCall();
9595
case POP_BINDING: return new PopBindingInstr();
9696
case POP_FRAME: return new PopFrameInstr();
9797
case PROCESS_MODULE_BODY: return new ProcessModuleBodyInstr(d.decodeVariable(), d.decodeOperand(), d.decodeOperand());
@@ -164,8 +164,6 @@ private Instr decodeBuildDynRegExpInstr() {
164164

165165
private Instr decodeCall() {
166166
if (RubyInstanceConfig.IR_READING_DEBUG) System.out.println("decoding call");
167-
Variable result = d.decodeVariable();
168-
if (RubyInstanceConfig.IR_READING_DEBUG) System.out.println("decoding call, result: "+ result);
169167
int callTypeOrdinal = d.decodeInt();
170168
if (RubyInstanceConfig.IR_READING_DEBUG) System.out.println("decoding call, calltype(ord): "+ callTypeOrdinal);
171169
String methAddr = d.decodeString();
@@ -183,6 +181,9 @@ private Instr decodeCall() {
183181

184182
Operand closure = hasClosureArg ? d.decodeOperand() : null;
185183

184+
Variable result = d.decodeVariable();
185+
if (RubyInstanceConfig.IR_READING_DEBUG) System.out.println("decoding call, result: "+ result);
186+
186187
return CallInstr.create(d.getCurrentScope(), CallType.fromOrdinal(callTypeOrdinal), result, methAddr, receiver, args, closure);
187188
}
188189

0 commit comments

Comments
 (0)