comparison 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
comparison
equal deleted inserted replaced
2775:3b73b230b86b 2776:398b8fa5dc81
29 import com.sun.c1x.*; 29 import com.sun.c1x.*;
30 import com.sun.c1x.debug.*; 30 import com.sun.c1x.debug.*;
31 import com.sun.c1x.ir.*; 31 import com.sun.c1x.ir.*;
32 import com.sun.c1x.lir.*; 32 import com.sun.c1x.lir.*;
33 import com.sun.c1x.observer.*; 33 import com.sun.c1x.observer.*;
34 import com.sun.c1x.value.*;
35 34
36 /** 35 /**
37 * This class implements the overall container for the HIR (high-level IR) graph 36 * This class implements the overall container for the HIR (high-level IR) graph
38 * and directs its construction, optimization, and finalization. 37 * and directs its construction, optimization, and finalization.
39 */ 38 */
220 int backEdgeIndex = target.predecessors().indexOf(source.end()); 219 int backEdgeIndex = target.predecessors().indexOf(source.end());
221 220
222 // create new successor and mark it for special block order treatment 221 // create new successor and mark it for special block order treatment
223 BlockBegin newSucc = new BlockBegin(bci, nextBlockNumber(), false, compilation.graph); 222 BlockBegin newSucc = new BlockBegin(bci, nextBlockNumber(), false, compilation.graph);
224 223
225 List<Integer> removePhiInputs = new ArrayList<Integer>(); 224 List<Integer> removePhiInputs = null;
226 for (int i = backEdgeIndex + 1; i < target.predecessors().size(); ++i) { 225 for (int i = backEdgeIndex + 1; i < target.predecessors().size(); ++i) {
227 if (target.predecessors().get(i) == source.end()) { 226 if (target.predecessors().get(i) == source.end()) {
227 if (removePhiInputs == null) {
228 removePhiInputs = new ArrayList<Integer>();
229 }
228 removePhiInputs.add(i); 230 removePhiInputs.add(i);
229 } 231 }
230 } 232 }
231 233
232 // This goto is not a safepoint. 234 // This goto is not a safepoint.
234 newSucc.appendNext(e); 236 newSucc.appendNext(e);
235 e.reorderSuccessor(0, backEdgeIndex); 237 e.reorderSuccessor(0, backEdgeIndex);
236 238
237 // link predecessor to new block 239 // link predecessor to new block
238 source.end().substituteSuccessor(target, newSucc); 240 source.end().substituteSuccessor(target, newSucc);
239 if (removePhiInputs.size() > 0) { 241 if (removePhiInputs != null && removePhiInputs.size() > 0) {
240 242
241 for (Node n : target.usages()) { 243 for (Node n : target.usages()) {
242 if (n instanceof Phi) { 244 if (n instanceof Phi) {
243 Phi phi = (Phi) n; 245 Phi phi = (Phi) n;
244 int correction = 0; 246 int correction = 0;