# HG changeset patch # User Gilles Duboscq # Date 1383908675 -3600 # Node ID 605c69ce3b352fc75cf556637ae5f3e6ce7bf112 # Parent dd856c84a75c38edee5c0c3e17d146e1b80f2c9b Use option to enable guard-id-as-speculation-id rather than Debug.isEnabled() diff -r dd856c84a75c -r 605c69ce3b35 graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/GuardLoweringPhase.java --- a/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/GuardLoweringPhase.java Fri Nov 08 11:00:17 2013 +0100 +++ b/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/GuardLoweringPhase.java Fri Nov 08 12:04:35 2013 +0100 @@ -27,7 +27,6 @@ import java.util.*; import java.util.Map.Entry; -import com.oracle.graal.debug.*; import com.oracle.graal.graph.*; import com.oracle.graal.nodes.*; import com.oracle.graal.nodes.StructuredGraph.GuardsStage; @@ -35,6 +34,7 @@ import com.oracle.graal.nodes.cfg.*; import com.oracle.graal.nodes.extended.*; import com.oracle.graal.nodes.util.*; +import com.oracle.graal.options.*; import com.oracle.graal.phases.*; import com.oracle.graal.phases.graph.*; import com.oracle.graal.phases.schedule.*; @@ -54,6 +54,12 @@ * does the actual control-flow expansion of the remaining {@link GuardNode GuardNodes}. */ public class GuardLoweringPhase extends BasePhase { + static class Options { + //@formatter:off + @Option(help = "") + public static final OptionValue UseGuardIdAsSpeculationId = new OptionValue<>(false); + //@formatter:on + } private static class UseImplicitNullChecks extends ScheduledNodeIterator { @@ -125,9 +131,11 @@ private static class LowerGuards extends ScheduledNodeIterator { private final Block block; + private boolean useGuardIdAsSpeculationId; public LowerGuards(Block block) { this.block = block; + this.useGuardIdAsSpeculationId = Options.UseGuardIdAsSpeculationId.getValue(); } @Override @@ -146,7 +154,7 @@ StructuredGraph graph = guard.graph(); AbstractBeginNode fastPath = graph.add(new BeginNode()); @SuppressWarnings("deprecation") - DeoptimizeNode deopt = graph.add(new DeoptimizeNode(guard.action(), guard.reason(), (short) (Debug.isEnabled() ? guard.getId() : 0))); + DeoptimizeNode deopt = graph.add(new DeoptimizeNode(guard.action(), guard.reason(), (short) (useGuardIdAsSpeculationId ? guard.getId() : 0))); AbstractBeginNode deoptBranch = AbstractBeginNode.begin(deopt); AbstractBeginNode trueSuccessor; AbstractBeginNode falseSuccessor;