Mercurial > hg > truffle
changeset 19836:6c1b2ae65d6c
Simplifications of SchedulePhase#processStack.
author | Thomas Wuerthinger <thomas.wuerthinger@oracle.com> |
---|---|
date | Fri, 13 Mar 2015 22:55:14 +0100 |
parents | f388e1591799 |
children | 80d48cc80222 |
files | graal/com.oracle.graal.phases/src/com/oracle/graal/phases/schedule/SchedulePhase.java |
diffstat | 1 files changed, 12 insertions(+), 15 deletions(-) [+] |
line wrap: on
line diff
--- a/graal/com.oracle.graal.phases/src/com/oracle/graal/phases/schedule/SchedulePhase.java Fri Mar 13 22:35:37 2015 +0100 +++ b/graal/com.oracle.graal.phases/src/com/oracle/graal/phases/schedule/SchedulePhase.java Fri Mar 13 22:55:14 2015 +0100 @@ -637,24 +637,21 @@ stack.pop(); if (nodeToBlock.get(current) == null) { - Node predecessor = current.predecessor(); - Block curBlock; - if (predecessor != null) { - // Predecessor determines block. - curBlock = nodeToBlock.get(predecessor); - } else { + Block curBlock = cfg.blockFor(current); + if (curBlock == null) { + assert current.predecessor() == null && !(current instanceof FixedNode) : "The assignment of blocks to fixed nodes is already done when constructing the cfg."; Block earliest = startBlock; for (Node input : current.inputs()) { - if (current instanceof FrameState && input instanceof StateSplit && ((StateSplit) input).stateAfter() == current) { - // ignore + Block inputEarliest; + if (input instanceof ControlSplitNode) { + inputEarliest = nodeToBlock.get(((ControlSplitNode) input).getPrimarySuccessor()); } else { - Block inputEarliest; - if (input instanceof ControlSplitNode) { - inputEarliest = nodeToBlock.get(((ControlSplitNode) input).getPrimarySuccessor()); - } else { - inputEarliest = nodeToBlock.get(input); - } - assert inputEarliest != null : current + " / " + input; + inputEarliest = nodeToBlock.get(input); + } + if (inputEarliest == null) { + assert current instanceof FrameState && input instanceof StateSplit && ((StateSplit) input).stateAfter() == current; + } else { + assert inputEarliest != null; if (earliest.getDominatorDepth() < inputEarliest.getDominatorDepth()) { earliest = inputEarliest; }