# HG changeset patch # User Christian Haeubl # Date 1331159722 28800 # Node ID c53115427ff9ade451ac97a6ce1ef92989cbe292 # Parent 7a019062451e0a1f65dbe465eec09d6f3e6b5a85 added assertion diff -r 7a019062451e -r c53115427ff9 graal/com.oracle.max.graal.java/src/com/oracle/max/graal/java/GraphBuilderPhase.java --- a/graal/com.oracle.max.graal.java/src/com/oracle/max/graal/java/GraphBuilderPhase.java Wed Mar 07 14:14:25 2012 -0800 +++ b/graal/com.oracle.max.graal.java/src/com/oracle/max/graal/java/GraphBuilderPhase.java Wed Mar 07 14:35:22 2012 -0800 @@ -1199,12 +1199,7 @@ private FixedNode createTarget(double probability, Block block, FrameStateBuilder stateAfter) { assert probability >= 0 && probability <= 1; if (probability == 0 && config.useBranchPrediction()) { - BeginNode begin = currentGraph.add(new BeginNode()); - DeoptimizeNode deopt = currentGraph.add(new DeoptimizeNode(DeoptAction.InvalidateReprofile)); - begin.setNext(deopt); - // Note: We are not allowed to set the stateAfter of the begin node, because we have to deoptimize to - // a bci _before_ the actual if, so that the interpreter can update the profiling information. - return begin; + return currentGraph.add(new DeoptimizeNode(DeoptAction.InvalidateReprofile)); } else { return createTarget(block, stateAfter); } @@ -1281,6 +1276,9 @@ assert !(target instanceof BeginNode); BeginNode begin = currentGraph.add(new BeginNode()); begin.setNext(target); + + assert !(target instanceof DeoptimizeNode && begin.stateAfter() != null) : + "We are not allowed to set the stateAfter of the begin node, because we have to deoptimize to a bci _before_ the actual if, so that the interpreter can update the profiling information."; return begin; }