# HG changeset patch # User Thomas Wuerthinger # Date 1376679149 -7200 # Node ID a07d9113d1f6a6bdda38434e9b1ade2d84bf0bca # Parent e4a1593cc6e4001c400a0930d6c7546750976b2a Fix in ConvertDeoptimizeToGuardPhase for the case where we need to insert a ProxyNode. diff -r e4a1593cc6e4 -r a07d9113d1f6 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 Fri Aug 16 19:07:10 2013 +0200 +++ b/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/ConvertDeoptimizeToGuardPhase.java Fri Aug 16 20:52:29 2013 +0200 @@ -86,12 +86,20 @@ 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. - n.replaceFirstInput(survivingSuccessor, guard); + if (survivingSuccessor instanceof LoopExitNode) { + if (proxyGuard == null) { + proxyGuard = ProxyNode.forValue(guard, survivingSuccessor, graph); + } + n.replaceFirstInput(survivingSuccessor, proxyGuard); + } else { + n.replaceFirstInput(survivingSuccessor, guard); + } } } Debug.log("Converting %s on %-5s branch of %s to guard for remaining branch %s.", deopt, deoptBegin == ifNode.trueSuccessor() ? "true" : "false", ifNode, otherBegin);