Skip to content

Commit

Permalink
This check appears to be enough to know when to load scope now.
Browse files Browse the repository at this point in the history
  • Loading branch information
headius committed Dec 22, 2014
1 parent ef0e585 commit d6810e9
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions core/src/main/java/org/jruby/ir/targets/JVMVisitor.java
Expand Up @@ -151,13 +151,11 @@ public void emitScope(IRScope scope, String name, Signature signature, boolean s

// Some scopes (closures, module/class bodies) do not have explicit call protocol yet.
// Unconditionally load current dynamic scope for those bodies.
// FIXME: If I don't load this there are some scopes that end up trying to use it before it is there
// Try uncommenting and running compiler specs.
// if (!scope.hasExplicitCallProtocol()) {
if (!scope.hasExplicitCallProtocol()) {
jvmMethod().loadContext();
jvmMethod().invokeVirtual(Type.getType(ThreadContext.class), Method.getMethod("org.jruby.runtime.DynamicScope getCurrentScope()"));
jvmStoreLocal(DYNAMIC_SCOPE);
// }
}

IRBytecodeAdapter m = jvmMethod();

Expand Down

0 comments on commit d6810e9

Please sign in to comment.