# HG changeset patch # User Thomas Wuerthinger # Date 1429537131 -7200 # Node ID 53b3a10e2515cc0c6a4b9a997ea93f7f4f6ad346 # Parent 931b0acc8d2ed45f578417cd9b31206159e52446# Parent 81e91799d6a15c42fc323aed49e7ffb96e68542a Merge. diff -r 81e91799d6a1 -r 53b3a10e2515 graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/AbstractBeginNode.java --- 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 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 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 getBlockNodes() { diff -r 81e91799d6a1 -r 53b3a10e2515 graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/ConvertDeoptimizeToGuardPhase.java --- 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);