Mercurial > hg > graal-jvmci-8
comparison graal/GraalCompiler/src/com/sun/c1x/graph/GraphBuilder.java @ 2783:9bc0c2eb00d6
Made graph builder removal of BlockBegin work.
author | Thomas Wuerthinger <thomas@wuerthinger.net> |
---|---|
date | Wed, 25 May 2011 12:04:58 +0200 |
parents | bda5972a40a5 |
children | e62cfea1c134 |
comparison
equal
deleted
inserted
replaced
2782:915456e4959e | 2783:9bc0c2eb00d6 |
---|---|
219 | 219 |
220 for (Node n : graph.getNodes()) { | 220 for (Node n : graph.getNodes()) { |
221 if (n instanceof Placeholder) { | 221 if (n instanceof Placeholder) { |
222 Placeholder p = (Placeholder) n; | 222 Placeholder p = (Placeholder) n; |
223 | 223 |
224 if (p == graph.start().successors().get(0)) { | 224 /*if (p == graph.start().successors().get(0)) { |
225 // nothing to do... | 225 // nothing to do... |
226 } else if (p.blockPredecessors().size() == 0) { | 226 } else*/ if (p.blockPredecessors().size() == 0) { |
227 assert p.next() == null; | 227 assert p.next() == null; |
228 p.delete(); | 228 p.delete(); |
229 } else { | 229 } else { |
230 assert p.blockPredecessors().size() == 1; | 230 assert p.blockPredecessors().size() == 1; |
231 for (Node pred : new ArrayList<Node>(p.predecessors())) { | 231 for (Node pred : new ArrayList<Node>(p.predecessors())) { |
234 p.successors().clearAll(); | 234 p.successors().clearAll(); |
235 p.delete(); | 235 p.delete(); |
236 } | 236 } |
237 } | 237 } |
238 } | 238 } |
239 | |
240 for (Node n : graph.getNodes()) { | |
241 assert !(n instanceof Placeholder); | |
242 } | |
243 | |
244 | |
239 for (Node n : graph.getNodes()) { | 245 for (Node n : graph.getNodes()) { |
240 if (n instanceof FrameState) { | 246 if (n instanceof FrameState) { |
241 boolean delete = false; | 247 boolean delete = false; |
242 if (n.usages().size() == 0 && n.predecessors().size() == 0) { | 248 if (n.usages().size() == 0 && n.predecessors().size() == 0) { |
243 delete = true; | 249 delete = true; |
1087 lastInstr = syncHandler.firstInstruction; | 1093 lastInstr = syncHandler.firstInstruction; |
1088 while (lastInstr.next() != null) { | 1094 while (lastInstr.next() != null) { |
1089 // go forward to the end of the block | 1095 // go forward to the end of the block |
1090 lastInstr = lastInstr.next(); | 1096 lastInstr = lastInstr.next(); |
1091 } | 1097 } |
1092 frameState.initializeFrom(((BlockBegin) syncHandler.firstInstruction).stateBefore()); | 1098 |
1099 // TTY.println("first instruction: " + syncHandler.firstInstruction); | |
1100 frameState.initializeFrom(((StateSplit) syncHandler.firstInstruction).stateBefore()); | |
1093 | 1101 |
1094 int bci = Instruction.SYNCHRONIZATION_ENTRY_BCI; | 1102 int bci = Instruction.SYNCHRONIZATION_ENTRY_BCI; |
1095 | 1103 |
1096 assert lock != null; | 1104 assert lock != null; |
1097 assert frameState.locksSize() > 0 && frameState.lockAt(frameState.locksSize() - 1) == lock; | 1105 assert frameState.locksSize() > 0 && frameState.lockAt(frameState.locksSize() - 1) == lock; |