Skip to content

Commit

Permalink
Remove special fic check in getCFG. Partially brittle because I only …
Browse files Browse the repository at this point in the history
…guard in LOP pass for closures
  • Loading branch information
enebo committed Mar 4, 2015
1 parent 43f0463 commit 974016f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
13 changes: 4 additions & 9 deletions core/src/main/java/org/jruby/ir/IRScope.java
Expand Up @@ -387,15 +387,7 @@ public boolean canReceiveNonlocalReturns() {
return flags.contains(CAN_RECEIVE_NONLOCAL_RETURNS);
}

// FIXME: Should always be built but if not it wil
public CFG buildCFG() {
return getCFG();
}

public CFG getCFG() {
// Closure/nested scopes may not have been built and some passes process all child scopes
if (fullInterpreterContext == null) prepareFullBuild();

return fullInterpreterContext.getCFG();
}

Expand Down Expand Up @@ -459,7 +451,10 @@ private Instr[] cloneInstrs() {
return newInstructions;
}

protected void prepareFullBuildCommon() {
public void prepareFullBuildCommon() {
// We already made it.
if (fullInterpreterContext != null) return;

// Clone instrs from startup interpreter so we do not swap out instrs out from under the
// startup interpreter as we are building the full interpreter.
Instr[] instrs = cloneInstrs();
Expand Down
Expand Up @@ -23,6 +23,7 @@ public String getLabel() {
public Object execute(IRScope s, Object... data) {
// This let us compute execute scope flags for a method based on what all nested closures do
for (IRClosure c: s.getClosures()) {
if (c.getFullInterpreterContext() == null) c.prepareFullBuildCommon();
run(c, false, true);
}

Expand Down

0 comments on commit 974016f

Please sign in to comment.