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

Commits on Sep 18, 2014

  1. Copy the full SHA
    5ed09db View commit details
  2. Copy the full SHA
    219902c View commit details
  3. Copy the full SHA
    c795b8f View commit details
Original file line number Diff line number Diff line change
@@ -565,11 +565,11 @@ public void end(Runnable locals) {
}

public void local(int index, String name, Class type) {
method.visitLocalVariable(name, ci(type), null, start, end, index);
getMethodVisitor().visitLocalVariable(name, ci(type), null, start, end, index);
}

public void local(int index, String name, Type type) {
method.visitLocalVariable(name, type.getDescriptor(), null, start, end, index);
getMethodVisitor().visitLocalVariable(name, type.getDescriptor(), null, start, end, index);
}

public void line(int line) {
2 changes: 2 additions & 0 deletions core/src/main/java/org/jruby/ir/targets/JVMVisitor.java
Original file line number Diff line number Diff line change
@@ -624,6 +624,8 @@ public void BreakInstr(BreakInstr breakInstr) {
visit(breakInstr.getReturnValue());
jvmMethod().loadBlockType();
jvmAdapter().invokestatic(p(IRRuntimeHelpers.class), "initiateBreak", sig(IRubyObject.class, ThreadContext.class, DynamicScope.class, IRubyObject.class, Block.Type.class));
jvmMethod().returnValue();

}

@Override
12 changes: 11 additions & 1 deletion core/src/main/java/org/jruby/runtime/CompiledIRBlockBody.java
Original file line number Diff line number Diff line change
@@ -31,13 +31,23 @@ protected IRubyObject commonYieldPath(ThreadContext context, IRubyObject[] args,
// used to tell dynamic-scope that it is a dynamic scope for a thread body. Anyway, to be revisited later!
Visibility oldVis = binding.getFrame().getVisibility();
Frame prevFrame = context.preYieldNoScope(binding);

// SSS FIXME: Why is self null in non-binding-eval contexts?
if (self == null || this.evalType.get() == EvalType.BINDING_EVAL) {
self = useBindingSelf(binding);
}

DynamicScope newScope = null;
DynamicScope prevScope = binding.getDynamicScope();
DynamicScope newScope = sharedScope ? prevScope : DynamicScope.newDynamicScope(getStaticScope(), prevScope);

// CON FIXME: This is copied from InterpretedIRBlockBody, and obviously means all blocks allocate a scope; we must fix that
// SSS FIXME: Maybe, we should allocate a NoVarsScope/DummyScope for for-loop bodies because the static-scope here
// probably points to the parent scope? To be verified and fixed if necessary. There is no harm as it is now. It
// is just wasteful allocation since the scope is not used at all.

// Pass on eval state info to the dynamic scope and clear it on the block-body
newScope = DynamicScope.newDynamicScope(getStaticScope(), prevScope, this.evalType.get());
this.evalType.set(EvalType.NONE);
context.pushScope(newScope);

try {