Mercurial > hg > truffle
comparison graal/GraalCompiler/src/com/sun/c1x/ir/BlockBegin.java @ 2779:93ec3f067420
Changed CriticalEdgeFinder to use LIRBlock.
author | Thomas Wuerthinger <thomas@wuerthinger.net> |
---|---|
date | Wed, 25 May 2011 11:04:59 +0200 |
parents | 27512ea6bbcb |
children | 915456e4959e |
comparison
equal
deleted
inserted
replaced
2778:2ac7b30b7290 | 2779:93ec3f067420 |
---|---|
341 | 341 |
342 @Override | 342 @Override |
343 public String shortName() { | 343 public String shortName() { |
344 return "BlockBegin #" + blockID; | 344 return "BlockBegin #" + blockID; |
345 } | 345 } |
346 | |
347 /** | |
348 * Iterates over all successors of this block: successors of the end node and exception handler. | |
349 */ | |
350 public void allSuccessorsDo(boolean backwards, BlockClosure closure) { | |
351 BlockEnd end = end(); | |
352 if (backwards) { | |
353 for (int i = end.blockSuccessorCount() - 1; i >= 0; i--) { | |
354 closure.apply(end.blockSuccessor(i)); | |
355 } | |
356 } else { | |
357 for (int i = 0; i < end.blockSuccessorCount(); i++) { | |
358 closure.apply(end.blockSuccessor(i)); | |
359 } | |
360 } | |
361 for (Instruction x = next(); x != null; x = x.next()) { | |
362 if (x instanceof ExceptionEdgeInstruction && ((ExceptionEdgeInstruction) x).exceptionEdge() != null) { | |
363 closure.apply(((ExceptionEdgeInstruction) x).exceptionEdge()); | |
364 } | |
365 } | |
366 } | |
367 } | 346 } |