Skip to content

Commit

Permalink
Showing 2 changed files with 8 additions and 4 deletions.
6 changes: 2 additions & 4 deletions core/src/main/java/org/jruby/ir/interpreter/Interpreter.java
Original file line number Diff line number Diff line change
@@ -85,9 +85,7 @@ public static IRubyObject interpretCommonEval(Ruby runtime, String file, int lin
ThreadContext context = runtime.getCurrentContext();

IRubyObject rv = null;
DynamicScope s = null;

s = rootNode.getScope();
DynamicScope s = rootNode.getScope();
s.setEvalType(evalType);
context.pushScope(s);

@@ -548,7 +546,7 @@ private static IRubyObject interpret(ThreadContext context, IRubyObject self,
boolean debug = IRRuntimeHelpers.isDebug();
boolean profile = IRRuntimeHelpers.inProfileMode();
Integer scopeVersion = profile ? Profiler.initProfiling(scope) : 0;
boolean acceptsKeywordArgument = scope.receivesKeywordArgs();
boolean acceptsKeywordArgument = interpreterContext.receivesKeywordArguments();

// Enter the looooop!
while (ipc < n) {
Original file line number Diff line number Diff line change
@@ -23,6 +23,7 @@ public class InterpreterContext extends Operand {
private final boolean pushNewDynScope;
private final boolean reuseParentDynScope;
private final boolean popDynScope;
private final boolean receivesKeywordArguments;

public InterpreterContext(int temporaryVariablecount, int temporaryBooleanVariablecount,
int temporaryFixnumVariablecount, int temporaryFloatVariablecount,
@@ -38,6 +39,7 @@ public InterpreterContext(int temporaryVariablecount, int temporaryBooleanVariab
this.reuseParentDynScope = flags.contains(IRFlags.REUSE_PARENT_DYNSCOPE);
this.pushNewDynScope = !flags.contains(IRFlags.DYNSCOPE_ELIMINATED) && !this.reuseParentDynScope;
this.popDynScope = this.pushNewDynScope || this.reuseParentDynScope;
this.receivesKeywordArguments = flags.contains(IRFlags.RECEIVES_KEYWORD_ARGS);
}

@Override
@@ -86,6 +88,10 @@ public boolean popDynScope() {
return popDynScope;
}

public boolean receivesKeywordArguments() {
return receivesKeywordArguments;
}

@Override
public Object retrieve(ThreadContext context, IRubyObject self, StaticScope currScope, DynamicScope currDynScope, Object[] temp) {
return super.retrieve(context, self, currScope, currDynScope, temp);

0 comments on commit 4e3a4e2

Please sign in to comment.