Mercurial > hg > graal-compiler
comparison graal/GraalCompiler/src/com/sun/c1x/value/FrameState.java @ 2728:7e470e1cd3b6
Removed special casing for exception phis in LIRGenerator. Removed dependency between LIRBlock.blockID and BlockBegin.blockID.
author | Thomas Wuerthinger <thomas@wuerthinger.net> |
---|---|
date | Thu, 19 May 2011 17:13:30 +0200 |
parents | c1ce2a53d6c3 |
children | a2f62de90c76 |
comparison
equal
deleted
inserted
replaced
2727:1ddcbcd33325 | 2728:7e470e1cd3b6 |
---|---|
379 public static interface PhiProcedure { | 379 public static interface PhiProcedure { |
380 boolean doPhi(Phi phi); | 380 boolean doPhi(Phi phi); |
381 } | 381 } |
382 | 382 |
383 /** | 383 /** |
384 * Traverses all live {@linkplain Phi phis} of a given block in this frame state. | |
385 * | |
386 * @param block only phis {@linkplain Phi#block() associated} with this block are traversed | |
387 * @param proc the call back invoked for each live phi traversed | |
388 */ | |
389 public final boolean forEachLivePhi(int blockID, PhiProcedure proc) { | |
390 for (int i = 0; i < valuesSize(); i++) { | |
391 Value instr = valueAt(i); | |
392 if (instr instanceof Phi && !instr.isDeadPhi()) { | |
393 Phi phi = (Phi) instr; | |
394 if (phi.block().blockID == blockID) { | |
395 if (!proc.doPhi(phi)) { | |
396 return false; | |
397 } | |
398 } | |
399 } | |
400 } | |
401 return true; | |
402 } | |
403 | |
404 /** | |
405 * Checks whether this frame state has any {@linkplain Phi phi} statements. | 384 * Checks whether this frame state has any {@linkplain Phi phi} statements. |
406 */ | 385 */ |
407 public boolean hasPhis() { | 386 public boolean hasPhis() { |
408 for (int i = 0; i < valuesSize(); i++) { | 387 for (int i = 0; i < valuesSize(); i++) { |
409 Value value = valueAt(i); | 388 Value value = valueAt(i); |