Skip to content

Commit

Permalink
Restore LocalOptimizationPass
Browse files Browse the repository at this point in the history
* While this doesn't do a while lot right now, it does opt
  some scenarios (some forms of multiple-assignment).
* During refactorings and cleanup work between pre1 and pre2,
  we lost the code that actually ran it. Restoring it here.
  • Loading branch information
subbuss committed May 1, 2015
1 parent c09c4e5 commit 52520e3
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import org.jruby.ir.instructions.ResultInstr;
import org.jruby.ir.operands.Operand;
import org.jruby.ir.operands.Variable;
import org.jruby.ir.representations.BasicBlock;

import java.util.*;

Expand All @@ -18,6 +19,10 @@ public String getLabel() {

@Override
public Object execute(IRScope s, Object... data) {
for (BasicBlock b: s.getCFG().getBasicBlocks()) {
runLocalOptsOnInstrList(s, b.getInstrs().listIterator(), false);
}

// SSS FIXME: What is this about?
// Why 'Only after running local opts'? Figure out and document.
//
Expand Down

0 comments on commit 52520e3

Please sign in to comment.