-
-
Save headius/02cd69a64c7d3068f5a5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/core/src/main/java/org/jruby/ir/dataflow/analyses/LoadLocalVarPlacementNode.java b/core/src/main/java/org/jruby/ir/dataflow/analyses/LoadLocalVarPlacementNode.java | |
index 7109b64..8af88b5 100644 | |
--- a/core/src/main/java/org/jruby/ir/dataflow/analyses/LoadLocalVarPlacementNode.java | |
+++ b/core/src/main/java/org/jruby/ir/dataflow/analyses/LoadLocalVarPlacementNode.java | |
@@ -181,41 +181,42 @@ public class LoadLocalVarPlacementNode extends FlowGraphNode<LoadLocalVarPlaceme | |
it.add(new LoadLocalVarInstr(scope, getLocalVarReplacement(v, scope, varRenameMap), v)); | |
it.previous(); | |
} | |
it.previous(); | |
reqdLoads.clear(); | |
} else { | |
// All variables not defined in the current scope have to be always loaded | |
// because of multi-threading scenarios where some other scope | |
// could update this variable concurrently. | |
it.next(); | |
for (Iterator<LocalVariable> iter = reqdLoads.iterator(); iter.hasNext();) { | |
LocalVariable v = iter.next(); | |
if (!scope.definesLocalVariable(v)) { | |
it.add(new LoadLocalVarInstr(scope, getLocalVarReplacement(v, scope, varRenameMap), v)); | |
it.previous(); | |
iter.remove(); | |
} | |
} | |
it.previous(); | |
} | |
- } else if (scopeBindingHasEscaped && (i.getOperation() == Operation.PUT_GLOBAL_VAR)) { | |
+ } else if (scopeBindingHasEscaped && (i.getOperation() == Operation.PUT_GLOBAL_VAR) | |
+ || i.getOperation() == Operation.THREAD_POLL) { | |
// global-var tracing can execute closures set up in previous trace-var calls | |
// in which case we would have the 'scopeBindingHasEscaped' flag set to true | |
it.next(); | |
for (LocalVariable v : reqdLoads) { | |
it.add(new LoadLocalVarInstr(scope, getLocalVarReplacement(v, scope, varRenameMap), v)); | |
it.previous(); | |
} | |
it.previous(); | |
reqdLoads.clear(); | |
} | |
if (i.getOperation() == Operation.BINDING_STORE) { | |
LocalVariable lv = ((StoreLocalVarInstr)i).getLocalVar(); | |
if (!lv.isSelf()) { | |
reqdLoads.add(lv); | |
// SSS FIXME: Why is this reqd again? Document with example | |
// Make sure there is a replacement var for all local vars | |
getLocalVarReplacement(lv, scope, varRenameMap); | |
} | |
} else { |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment