Skip to content

Commit

Permalink
Add missing call instrs and re-order where result is read from
Browse files Browse the repository at this point in the history
  • Loading branch information
enebo committed Mar 11, 2015
1 parent b173aca commit 3617d05
Showing 1 changed file with 5 additions and 4 deletions.
Expand Up @@ -50,7 +50,7 @@ public Instr decodeInner(Operation operation) {
case B_NIL: return createBNil();
case B_TRUE: return createBTrue();
case B_UNDEF: return createBUndef();
case CALL: return decodeCall();
case CALL_1F: case CALL_1D: case CALL_1O: case CALL_1OB: case CALL_0O: case CALL: return decodeCall();
case CHECK_ARGS_ARRAY_ARITY: return new CheckArgsArrayArityInstr(d.decodeOperand(), d.decodeInt(), d.decodeInt(), d.decodeInt());
case CHECK_ARITY: return new CheckArityInstr(d.decodeInt(), d.decodeInt(), d.decodeInt(), d.decodeBoolean(), d.decodeInt());
case CLASS_VAR_MODULE: return new GetClassVarContainerModuleInstr(d.decodeVariable(), d.decodeOperand(), d.decodeVariable());
Expand Down Expand Up @@ -91,7 +91,7 @@ public Instr decodeInner(Operation operation) {
case MATCH3: return new Match3Instr(d.decodeVariable(), d.decodeOperand(), d.decodeOperand());
case NONLOCAL_RETURN: return new NonlocalReturnInstr(d.decodeOperand(), d.decodeString());
case NOP: return NopInstr.NOP;
case NORESULT_CALL: return decodeNoResultCall();
case NORESULT_CALL: case NORESULT_CALL_1O: return decodeNoResultCall();
case POP_BINDING: return new PopBindingInstr();
case POP_FRAME: return new PopFrameInstr();
case PROCESS_MODULE_BODY: return new ProcessModuleBodyInstr(d.decodeVariable(), d.decodeOperand(), d.decodeOperand());
Expand Down Expand Up @@ -164,8 +164,6 @@ private Instr decodeBuildDynRegExpInstr() {

private Instr decodeCall() {
if (RubyInstanceConfig.IR_READING_DEBUG) System.out.println("decoding call");
Variable result = d.decodeVariable();
if (RubyInstanceConfig.IR_READING_DEBUG) System.out.println("decoding call, result: "+ result);
int callTypeOrdinal = d.decodeInt();
if (RubyInstanceConfig.IR_READING_DEBUG) System.out.println("decoding call, calltype(ord): "+ callTypeOrdinal);
String methAddr = d.decodeString();
Expand All @@ -183,6 +181,9 @@ private Instr decodeCall() {

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

Variable result = d.decodeVariable();
if (RubyInstanceConfig.IR_READING_DEBUG) System.out.println("decoding call, result: "+ result);

return CallInstr.create(d.getCurrentScope(), CallType.fromOrdinal(callTypeOrdinal), result, methAddr, receiver, args, closure);
}

Expand Down

0 comments on commit 3617d05

Please sign in to comment.