Mercurial > hg > truffle
changeset 21027:53b3a10e2515
Merge.
author | Thomas Wuerthinger <thomas.wuerthinger@oracle.com> |
---|---|
date | Mon, 20 Apr 2015 15:38:51 +0200 |
parents | 931b0acc8d2e (diff) 81e91799d6a1 (current diff) |
children | 37b516b9080c |
files | |
diffstat | 2 files changed, 22 insertions(+), 17 deletions(-) [+] |
line wrap: on
line diff
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/AbstractBeginNode.java Mon Apr 20 15:10:12 2015 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/AbstractBeginNode.java Mon Apr 20 15:38:51 2015 +0200 @@ -126,11 +126,24 @@ } public NodeIterable<Node> anchored() { - return usages().filter(isNotA(ProxyNode.class)); + return usages().filter(n -> { + if (n instanceof ProxyNode) { + ProxyNode proxyNode = (ProxyNode) n; + return proxyNode.proxyPoint() != this; + } + return true; + }); } + @SuppressWarnings({"unchecked", "rawtypes"}) public NodeIterable<ProxyNode> proxies() { - return usages().filter(ProxyNode.class); + return (NodeIterable) usages().filter(n -> { + if (n instanceof ProxyNode) { + ProxyNode proxyNode = (ProxyNode) n; + return proxyNode.proxyPoint() == this; + } + return false; + }); } public NodeIterable<FixedNode> getBlockNodes() {
--- a/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/ConvertDeoptimizeToGuardPhase.java Mon Apr 20 15:10:12 2015 +0200 +++ b/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/ConvertDeoptimizeToGuardPhase.java Mon Apr 20 15:38:51 2015 +0200 @@ -30,6 +30,7 @@ import com.oracle.graal.debug.*; import com.oracle.graal.graph.*; import com.oracle.graal.graph.spi.*; +import com.oracle.graal.nodeinfo.*; import com.oracle.graal.nodes.*; import com.oracle.graal.nodes.calc.*; import com.oracle.graal.nodes.util.*; @@ -159,22 +160,13 @@ survivingSuccessor = ifNode.trueSuccessor(); } graph.removeSplitPropagate(ifNode, survivingSuccessor); - ProxyNode proxyGuard = null; - for (Node n : survivingSuccessor.usages().snapshot()) { - if (n instanceof GuardNode || n instanceof ProxyNode) { - // Keep wired to the begin node. - } else { - // Rewire to the fixed guard. - if (survivingSuccessor instanceof LoopExitNode) { - if (proxyGuard == null) { - proxyGuard = ProxyNode.forGuard(guard, survivingSuccessor, graph); - } - n.replaceFirstInput(survivingSuccessor, proxyGuard); - } else { - n.replaceFirstInput(survivingSuccessor, guard); - } - } + + Node newGuard = guard; + if (survivingSuccessor instanceof LoopExitNode) { + newGuard = ProxyNode.forGuard(guard, survivingSuccessor, graph); } + survivingSuccessor.replaceAtUsages(InputType.Guard, newGuard); + Debug.log("Converting deopt on %-5s branch of %s to guard for remaining branch %s.", deoptBegin == ifNode.trueSuccessor() ? "true" : "false", ifNode, otherBegin); FixedNode next = pred.next(); pred.setNext(guard);