comparison graal/GraalCompiler/src/com/sun/c1x/graph/CriticalEdgeFinder.java @ 2805:c3f64b66fc78

Towards removing the next pointer from Constant and ArithmeticOp
author Thomas Wuerthinger <thomas@wuerthinger.net>
date Fri, 27 May 2011 19:57:56 +0200
parents 095162a84dcc
children
comparison
equal deleted inserted replaced
2804:095162a84dcc 2805:c3f64b66fc78
103 LIRBlock newSucc = new LIRBlock(lirBlocks.size()); 103 LIRBlock newSucc = new LIRBlock(lirBlocks.size());
104 lirBlocks.add(newSucc); 104 lirBlocks.add(newSucc);
105 105
106 // This goto is not a safepoint. 106 // This goto is not a safepoint.
107 Anchor e = new Anchor(null, graph); 107 Anchor e = new Anchor(null, graph);
108 Node sourceInstruction = source.getInstructions().get(source.getInstructions().size() - 1); 108 Node sourceInstruction = source.lastInstruction();
109 Node targetInstruction = target.getInstructions().get(0); 109 Node targetInstruction = target.firstInstruction();
110 int sourceInstructionPredIndex = targetInstruction.predecessors().indexOf(sourceInstruction); 110 int sourceInstructionPredIndex = targetInstruction.predecessors().indexOf(sourceInstruction);
111 assert sourceInstructionPredIndex != -1 : "must find source instruction " + sourceInstruction + " in predecessor array of target instruction " + targetInstruction; 111 assert sourceInstructionPredIndex != -1 : "must find source instruction " + sourceInstruction + " in predecessor array of target instruction " + targetInstruction;
112 int replacedIndex = targetInstruction.predecessorsIndex().get(sourceInstructionPredIndex); 112 int replacedIndex = targetInstruction.predecessorsIndex().get(sourceInstructionPredIndex);
113 assert replacedIndex != -1 && sourceInstruction.successors().get(replacedIndex) != null; 113 assert replacedIndex != -1 && sourceInstruction.successors().get(replacedIndex) != null;
114 e.successors().setAndClear(1, sourceInstruction, replacedIndex); 114 e.successors().setAndClear(1, sourceInstruction, replacedIndex);