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: a13e521a9379
Choose a base ref
...
head repository: jruby/jruby
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: b6aa96c11da1
Choose a head ref
  • 2 commits
  • 3 files changed
  • 1 contributor

Commits on Dec 7, 2015

  1. Some bug fixes in the block call protocol code.

    * A few benchmarks now run to completion in -X-C with this enabled
    
    * This requires tweaking some code in IRClosure.java to trigger
      full build for closures -- that code is not committed with this patch.
    subbuss committed Dec 7, 2015
    Copy the full SHA
    6fc2d5d View commit details
  2. Allocate InterpretedIRBlockBody in -X-C mode

    * This turns on full build for blocks in -X-C (which it wasn't
      so far).
    subbuss committed Dec 7, 2015
    Copy the full SHA
    b6aa96c View commit details
7 changes: 5 additions & 2 deletions core/src/main/java/org/jruby/ir/IRClosure.java
Original file line number Diff line number Diff line change
@@ -16,6 +16,7 @@
import org.jruby.runtime.BlockBody;
import org.jruby.runtime.IRBlockBody;
import org.jruby.runtime.MixedModeIRBlockBody;
import org.jruby.runtime.InterpretedIRBlockBody;
import org.jruby.runtime.Signature;
import org.objectweb.asm.Handle;

@@ -67,7 +68,8 @@ protected IRClosure(IRClosure c, IRScope lexicalParent, int closureId, String fu
if (getManager().isDryRun()) {
this.body = null;
} else {
this.body = new MixedModeIRBlockBody(c, c.getSignature());
boolean shouldJit = getManager().getInstanceConfig().getCompileMode().shouldJIT();
this.body = shouldJit ? new MixedModeIRBlockBody(c, c.getSignature()) : new InterpretedIRBlockBody(c, c.getSignature());
}

this.signature = c.signature;
@@ -90,7 +92,8 @@ public IRClosure(IRManager manager, IRScope lexicalParent, int lineNumber, Stati
if (getManager().isDryRun()) {
this.body = null;
} else {
this.body = new MixedModeIRBlockBody(this, signature);
boolean shouldJit = manager.getInstanceConfig().getCompileMode().shouldJIT();
this.body = shouldJit ? new MixedModeIRBlockBody(this, signature) : new InterpretedIRBlockBody(this, signature);
if (staticScope != null && !isBeginEndBlock) {
staticScope.setIRScope(this);
staticScope.setScopeType(this.getScopeType());
Original file line number Diff line number Diff line change
@@ -109,7 +109,8 @@ public IRubyObject interpret(ThreadContext context, Block block, IRubyObject sel
private DynamicScope getBlockScope(ThreadContext context, Block block, InterpreterContext interpreterContext) {
DynamicScope newScope = block.getBinding().getDynamicScope();
if (interpreterContext.pushNewDynScope()) {
context.pushScope(block.allocScope(newScope));
newScope = block.allocScope(newScope);
context.pushScope(newScope);
} else if (interpreterContext.reuseParentDynScope()) {
// Reuse! We can avoid the push only if surrounding vars aren't referenced!
context.pushScope(newScope);
Original file line number Diff line number Diff line change
@@ -42,6 +42,7 @@ public void setCallCount(int callCount) {
@Override
public void completeBuild(InterpreterContext interpreterContext) {
this.interpreterContext = interpreterContext;
hasCallProtocolIR = closure.getFlags().contains(IRFlags.HAS_EXPLICIT_CALL_PROTOCOL);
}

@Override
@@ -63,8 +64,8 @@ public InterpreterContext ensureInstrsReady() {

if (interpreterContext == null) {
interpreterContext = closure.getInterpreterContext();
hasCallProtocolIR = closure.getFlags().contains(IRFlags.HAS_EXPLICIT_CALL_PROTOCOL);
}
hasCallProtocolIR = closure.getFlags().contains(IRFlags.HAS_EXPLICIT_CALL_PROTOCOL);
return interpreterContext;
}