Mercurial > hg > graal-compiler
changeset 11461:2da44804f720
LoweringPhase: move detection of first lastFixedNode out of the loop, add comment
author | Bernhard Urban <bernhard.urban@jku.at> |
---|---|
date | Thu, 29 Aug 2013 17:28:22 +0200 |
parents | ac2bddbe3b51 |
children | ff122ed4b9fd |
files | graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/LoweringPhase.java |
diffstat | 1 files changed, 5 insertions(+), 15 deletions(-) [+] |
line wrap: on
line diff
--- a/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/LoweringPhase.java Thu Aug 29 17:28:21 2013 +0200 +++ b/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/LoweringPhase.java Thu Aug 29 17:28:22 2013 +0200 @@ -128,7 +128,7 @@ } private void setLastFixedNode(FixedWithNextNode n) { - assert n == null || n.isAlive() : n; + assert n.isAlive() : n; lastFixedNode = n; } } @@ -220,7 +220,7 @@ // Lower the instructions of this block. List<ScheduledNode> nodes = schedule.nodesFor(b); - loweringTool.setLastFixedNode(null); + loweringTool.setLastFixedNode(b.getBeginNode()); for (Node node : nodes) { if (node.isDeleted()) { @@ -228,23 +228,11 @@ continue; } - if (loweringTool.lastFixedNode() == null) { - AbstractBeginNode beginNode = b.getBeginNode(); - if (node == beginNode) { - loweringTool.setLastFixedNode(beginNode); - } else { - assert !(node instanceof Lowerable) : "SchedulingError: Lowerable " + node + " should not float before begin node " + beginNode; - assert node instanceof FloatingNode : "skipped node must be a FloatingNode: " + node; - continue; - } - } - // Cache the next node to be able to reconstruct the previous of the next node // after lowering. FixedNode nextNode = null; if (node instanceof FixedWithNextNode) { - FixedWithNextNode fixed = (FixedWithNextNode) node; - nextNode = fixed.next(); + nextNode = ((FixedWithNextNode) node).next(); } else { nextNode = loweringTool.lastFixedNode().next(); } @@ -255,6 +243,8 @@ } if (!nextNode.isAlive()) { + // can happen when the rest of the block is killed by lowering (e.g. by a + // unconditional deopt) break; } else { Node nextLastFixed = nextNode.predecessor();