# HG changeset patch # User Tom Rodriguez # Date 1421864441 28800 # Node ID b7cb27a82d518dd2efce1f6fb48b0f133b209876 # Parent 06536c3846e7762d0cad3e4e1f35acfc64e6ff69 Don't allow guards with action == None to float diff -r 06536c3846e7 -r b7cb27a82d51 graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/FixedGuardNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/FixedGuardNode.java Wed Jan 21 10:19:33 2015 -0800 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/FixedGuardNode.java Wed Jan 21 10:20:41 2015 -0800 @@ -69,7 +69,14 @@ @Override public void lower(LoweringTool tool) { - if (graph().getGuardsStage() == StructuredGraph.GuardsStage.FLOATING_GUARDS) { + /* + * Don't allow guards with action None to float. In cases where 2 guards are testing + * equivalent conditions they might be lowered at the same location. If the guard with the + * None action is lowered before the the other guard then the code will be stuck repeatedly + * deoptimizing without invalidating the code. Conditional elimination will eliminate the + * guard if it's truly redundant in this case. + */ + if (graph().getGuardsStage() == StructuredGraph.GuardsStage.FLOATING_GUARDS && getAction() != DeoptimizationAction.None) { ValueNode guard = tool.createGuard(this, condition(), getReason(), getAction(), isNegated()).asNode(); this.replaceAtUsages(guard); ValueAnchorNode newAnchor = graph().add(new ValueAnchorNode(guard.asNode()));