# HG changeset patch # User Tom Rodriguez # Date 1422475753 28800 # Node ID 4f3c6cc1794a4c4df6a0c180113fab6e7648eef5 # Parent 9c2396ef02db1ebadc37af739ac84fc08573d485 Only keep RuntimeConstraint action None guards fixed in the control flow diff -r 9c2396ef02db -r 4f3c6cc1794a 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 28 15:01:21 2015 +0100 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/FixedGuardNode.java Wed Jan 28 12:09:13 2015 -0800 @@ -70,13 +70,13 @@ @Override public void lower(LoweringTool tool) { /* - * 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. + * Don't allow guards with action None and reason RuntimeConstraint 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().allowsFloatingGuards() && getAction() != DeoptimizationAction.None) { + if (graph().getGuardsStage().allowsFloatingGuards() && (getAction() != DeoptimizationAction.None || getReason() != DeoptimizationReason.RuntimeConstraint)) { ValueNode guard = tool.createGuard(this, condition(), getReason(), getAction(), isNegated()).asNode(); this.replaceAtUsages(guard); ValueAnchorNode newAnchor = graph().add(new ValueAnchorNode(guard.asNode()));