# HG changeset patch # User Bernhard Urban # Date 1377790102 -7200 # Node ID 2da44804f720bdaffd84a1eed47131e8ce680c79 # Parent ac2bddbe3b5176abf13fb04ed8298788f00a6adc LoweringPhase: move detection of first lastFixedNode out of the loop, add comment diff -r ac2bddbe3b51 -r 2da44804f720 graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/LoweringPhase.java --- 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 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();