Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: jruby/jruby
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 781ebdd7fba1
Choose a base ref
...
head repository: jruby/jruby
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 6a34a207ebe7
Choose a head ref
  • 2 commits
  • 4 files changed
  • 2 contributors

Commits on Oct 20, 2014

  1. Copy the full SHA
    c141f0d View commit details
  2. Copy the full SHA
    6a34a20 View commit details
Original file line number Diff line number Diff line change
@@ -24,6 +24,8 @@
import org.jruby.util.log.Logger;
import org.jruby.util.log.LoggerFactory;

import static org.jruby.ir.IRFlags.HAS_EXPLICIT_CALL_PROTOCOL;

public class InterpretedIRMethod extends DynamicMethod implements IRMethodArgs, PositionAware {
private static final Logger LOG = LoggerFactory.getLogger("InterpretedIRMethod");

@@ -92,7 +94,7 @@ public IRubyObject call(ThreadContext context, IRubyObject self, RubyModule claz

if (IRRuntimeHelpers.isDebug()) doDebug();

if (method.hasExplicitCallProtocol()) return Interpreter.INTERPRET_METHOD(context, this, self, name, args, block);
if (ic.hasExplicitCallProtocol()) return Interpreter.INTERPRET_METHOD(context, this, self, name, args, block);

pre(ic, context, self, name, block);

2 changes: 1 addition & 1 deletion core/src/main/java/org/jruby/ir/IRClosure.java
Original file line number Diff line number Diff line change
@@ -117,7 +117,7 @@ public InterpreterContext prepareInterpreterContext(Operand self) {
Instr[] linearizedInstrArray = prepareInstructions();

interpreterContext = new ClosureInterpreterContext(getTemporaryVariablesCount(), getBooleanVariablesCount(),
getFixnumVariablesCount(), getFloatVariablesCount(),getFlags().clone(), linearizedInstrArray,
getFixnumVariablesCount(), getFloatVariablesCount(), getFlags(), linearizedInstrArray,
self, getStaticScope(), getBlockBody());

return interpreterContext;
2 changes: 1 addition & 1 deletion core/src/main/java/org/jruby/ir/IRScope.java
Original file line number Diff line number Diff line change
@@ -623,7 +623,7 @@ public synchronized InterpreterContext prepareForInterpretation() {
Instr[] linearizedInstrArray = prepareInstructions();

interpreterContext = new InterpreterContext(getTemporaryVariablesCount(), getBooleanVariablesCount(),
getFixnumVariablesCount(), getFloatVariablesCount(),getFlags().clone(), linearizedInstrArray);
getFixnumVariablesCount(), getFloatVariablesCount(), getFlags(), linearizedInstrArray);

return interpreterContext;
}
16 changes: 8 additions & 8 deletions core/src/main/java/org/jruby/ir/operands/InterpreterContext.java
Original file line number Diff line number Diff line change
@@ -16,11 +16,10 @@ public class InterpreterContext extends Operand {
private final int temporaryFixnumVariablecount;
private final int temporaryFloatVariablecount;

private final EnumSet<IRFlags> flags;

private final Instr[] instructions;

// Cached computed fields
private final boolean hasExplicitCallProtocol;
private final boolean pushNewDynScope;
private final boolean reuseParentDynScope;
private final boolean popDynScope;
@@ -34,8 +33,8 @@ public InterpreterContext(int temporaryVariablecount, int temporaryBooleanVariab
this.temporaryBooleanVariablecount = temporaryBooleanVariablecount;
this.temporaryFixnumVariablecount = temporaryFixnumVariablecount;
this.temporaryFloatVariablecount = temporaryFloatVariablecount;
this.flags = flags;
this.instructions = instructions;
this.hasExplicitCallProtocol = flags.contains(IRFlags.HAS_EXPLICIT_CALL_PROTOCOL);
this.reuseParentDynScope = flags.contains(IRFlags.REUSE_PARENT_DYNSCOPE);
this.pushNewDynScope = !flags.contains(IRFlags.DYNSCOPE_ELIMINATED) && !this.reuseParentDynScope;
this.popDynScope = this.pushNewDynScope || this.reuseParentDynScope;
@@ -45,7 +44,7 @@ public InterpreterContext(int temporaryVariablecount, int temporaryBooleanVariab
public void addUsedVariables(List<Variable> l) {}

@Override
public Operand cloneForInlining(CloneInfo ii) {
public Operand cloneForInlining(CloneInfo info) {
throw new IllegalStateException("Should not clone interp context");
}

@@ -66,14 +65,15 @@ public int getTemporaryFloatVariablecount() {
return temporaryFloatVariablecount;
}

public EnumSet<IRFlags> getFlags() {
return flags;
}

public Instr[] getInstructions() {
return instructions;
}


public boolean hasExplicitCallProtocol() {
return hasExplicitCallProtocol;
}

public boolean pushNewDynScope() {
return pushNewDynScope;
}