Mercurial > hg > truffle
changeset 21769:b6309a7d5a44
Fix the anchoring node in the lowering phase to not skip over loop exits.
author | Thomas Wuerthinger <thomas.wuerthinger@oracle.com> |
---|---|
date | Sun, 07 Jun 2015 16:59:03 +0200 |
parents | e9100cc156a9 |
children | c76742cc2c6f |
files | graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/LoweringPhase.java |
diffstat | 1 files changed, 8 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/LoweringPhase.java Sun Jun 07 16:21:00 2015 +0200 +++ b/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/LoweringPhase.java Sun Jun 07 16:59:03 2015 +0200 @@ -284,7 +284,13 @@ @Override public Frame<?> enterAlwaysReached(Block b) { - return new ProcessFrame(b, activeGuards, anchor, this); + AnchoringNode newAnchor = anchor; + if (parent != null && b.getLoop() != parent.block.getLoop() && !b.isLoopHeader()) { + // We are exiting a loop => cannot reuse the anchor without inserting loop + // proxies. + newAnchor = b.getBeginNode(); + } + return new ProcessFrame(b, activeGuards, newAnchor, this); } @Override @@ -401,7 +407,7 @@ * if (alwaysReachedBlock != null && alwaysReachedBlock.getDominator() == block) { * processBlock(alwaysReachedBlock); * } - * + * * // Now go for the other dominators. * for (Block dominated : block.getDominated()) { * if (dominated != alwaysReachedBlock) {