Skip to content

Commit

Permalink
receivesKeywordArgs irscope -> interpretercontext
Browse files Browse the repository at this point in the history
  • Loading branch information
enebo committed Oct 20, 2014
1 parent 6a34a20 commit 4e3a4e2
Show file tree
Hide file tree
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
Expand Up @@ -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);

Expand Down Expand Up @@ -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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 4e3a4e2

Please sign in to comment.