diff graal/GraalCompiler/src/com/sun/c1x/graph/IR.java @ 2776:398b8fa5dc81

Removed stateAfter from BlockEnd class. Clean up.
author Thomas Wuerthinger <thomas@wuerthinger.net>
date Tue, 24 May 2011 13:55:56 +0200
parents 93fd92c9f8b0
children 3e4d992fd312 bda5972a40a5
line wrap: on
line diff
--- a/graal/GraalCompiler/src/com/sun/c1x/graph/IR.java	Tue May 24 13:51:32 2011 +0200
+++ b/graal/GraalCompiler/src/com/sun/c1x/graph/IR.java	Tue May 24 13:55:56 2011 +0200
@@ -31,7 +31,6 @@
 import com.sun.c1x.ir.*;
 import com.sun.c1x.lir.*;
 import com.sun.c1x.observer.*;
-import com.sun.c1x.value.*;
 
 /**
  * This class implements the overall container for the HIR (high-level IR) graph
@@ -222,9 +221,12 @@
         // create new successor and mark it for special block order treatment
         BlockBegin newSucc = new BlockBegin(bci, nextBlockNumber(), false, compilation.graph);
 
-        List<Integer> removePhiInputs = new ArrayList<Integer>();
+        List<Integer> removePhiInputs = null;
         for (int i = backEdgeIndex + 1; i < target.predecessors().size(); ++i) {
             if (target.predecessors().get(i) == source.end()) {
+                if (removePhiInputs == null) {
+                    removePhiInputs = new ArrayList<Integer>();
+                }
                 removePhiInputs.add(i);
             }
         }
@@ -236,7 +238,7 @@
 
         // link predecessor to new block
         source.end().substituteSuccessor(target, newSucc);
-        if (removePhiInputs.size() > 0) {
+        if (removePhiInputs != null && removePhiInputs.size() > 0) {
 
             for (Node n : target.usages()) {
                 if (n instanceof Phi) {