src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/FixedGuardNode.java
changeset 48861 47f19ff9903c
parent 47216 71c04702a3d5
child 49451 e06f9607f370
equal deleted inserted replaced
48860:5bce1b7e7800 48861:47f19ff9903c
    81     }
    81     }
    82 
    82 
    83     @Override
    83     @Override
    84     public void lower(LoweringTool tool) {
    84     public void lower(LoweringTool tool) {
    85         if (graph().getGuardsStage().allowsFloatingGuards()) {
    85         if (graph().getGuardsStage().allowsFloatingGuards()) {
    86             /*
    86             if (getAction() != DeoptimizationAction.None) {
    87              * Don't allow guards with action None and reason RuntimeConstraint to float. In cases
       
    88              * where 2 guards are testing equivalent conditions they might be lowered at the same
       
    89              * location. If the guard with the None action is lowered before the other guard then
       
    90              * the code will be stuck repeatedly deoptimizing without invalidating the code.
       
    91              * Conditional elimination will eliminate the guard if it's truly redundant in this
       
    92              * case.
       
    93              */
       
    94             if (getAction() != DeoptimizationAction.None || getReason() != DeoptimizationReason.RuntimeConstraint) {
       
    95                 ValueNode guard = tool.createGuard(this, getCondition(), getReason(), getAction(), getSpeculation(), isNegated()).asNode();
    87                 ValueNode guard = tool.createGuard(this, getCondition(), getReason(), getAction(), getSpeculation(), isNegated()).asNode();
    96                 this.replaceAtUsages(guard);
    88                 this.replaceAtUsages(guard);
    97                 graph().removeFixed(this);
    89                 graph().removeFixed(this);
    98             }
    90             }
    99         } else {
    91         } else {