Skip to content

Commit

Permalink
Minor tweak: remove arg-receive flag from load-frame-closure
Browse files Browse the repository at this point in the history
* Strictly speaking, it is not an arg receive since the block
  doesn't come in as an arg, but is loaded from the stack.

* Doesn't affect any functionality or anything really, just me
  being particular.
  • Loading branch information
subbuss committed Jan 11, 2015
1 parent ad066eb commit a3ad247
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion core/src/main/java/org/jruby/ir/Operation.java
Expand Up @@ -52,10 +52,10 @@ public enum Operation {
RECV_RUBY_EXC(OpFlags.f_is_arg_receive),
RECV_JRUBY_EXC(OpFlags.f_is_arg_receive),
LOAD_IMPLICIT_CLOSURE(OpFlags.f_is_arg_receive),
LOAD_FRAME_CLOSURE(OpFlags.f_is_arg_receive),

/** Instruction to reify an passed-in block to a Proc for def foo(&b) */
REIFY_CLOSURE(0),
LOAD_FRAME_CLOSURE(0),

/* By default, call instructions cannot be deleted even if their results
* aren't used by anyone unless we know more about what the call is,
Expand Down
7 changes: 4 additions & 3 deletions core/src/main/java/org/jruby/ir/interpreter/Interpreter.java
Expand Up @@ -255,9 +255,6 @@ private static void receiveArg(ThreadContext context, Instr i, Operation operati
case LOAD_IMPLICIT_CLOSURE:
setResult(temp, currDynScope, instr.getResult(), block);
return;
case LOAD_FRAME_CLOSURE:
setResult(temp, currDynScope, instr.getResult(), context.getFrameBlock());
return;
default:
result = ((ReceiveArgBase)instr).receiveArg(context, args, acceptsKeywordArgument);
setResult(temp, currDynScope, instr.getResult(), result);
Expand Down Expand Up @@ -485,6 +482,10 @@ private static void processOtherOp(ThreadContext context, Instr instr, Operation
break;
}

case LOAD_FRAME_CLOSURE:
setResult(temp, currDynScope, instr, context.getFrameBlock());
return;

// ---------- All the rest ---------
default:
result = instr.interpret(context, currScope, currDynScope, self, temp);
Expand Down

0 comments on commit a3ad247

Please sign in to comment.