Mercurial > hg > truffle
changeset 19014:4f3c6cc1794a
Only keep RuntimeConstraint action None guards fixed in the control flow
author | Tom Rodriguez <tom.rodriguez@oracle.com> |
---|---|
date | Wed, 28 Jan 2015 12:09:13 -0800 |
parents | 9c2396ef02db |
children | ea1351d22e55 |
files | graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/FixedGuardNode.java |
diffstat | 1 files changed, 6 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- 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()));