# HG changeset patch # User Gilles Duboscq # Date 1379076424 -7200 # Node ID 340e67bf17582439d4d901a9ab0d9d2eb08982b8 # Parent 94a28e1b2c861cd4d04681de0e22e599f6863c0a Rename GuardsPhase to GuardsStage to avoid confusion with existing Phases diff -r 94a28e1b2c86 -r 340e67bf1758 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotRuntime.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotRuntime.java Wed Sep 11 15:19:58 2013 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotRuntime.java Fri Sep 13 14:47:04 2013 +0200 @@ -636,7 +636,7 @@ graph.replaceFixedWithFixed(storeIndexed, memoryWrite); } else if (n instanceof UnsafeLoadNode) { - if (graph.getGuardsPhase().ordinal() > StructuredGraph.GuardsPhase.FLOATING_GUARDS.ordinal()) { + if (graph.getGuardsPhase().ordinal() > StructuredGraph.GuardsStage.FLOATING_GUARDS.ordinal()) { UnsafeLoadNode load = (UnsafeLoadNode) n; assert load.kind() != Kind.Illegal; boolean compressible = (!load.object().isNullConstant() && load.accessKind() == Kind.Object); @@ -676,7 +676,7 @@ WriteNode hub = createWriteHub(graph, wordKind, storeHub.getObject(), storeHub.getValue()); graph.replaceFixed(storeHub, hub); } else if (n instanceof CommitAllocationNode) { - if (graph.getGuardsPhase() == StructuredGraph.GuardsPhase.FIXED_DEOPTS) { + if (graph.getGuardsPhase() == StructuredGraph.GuardsStage.FIXED_DEOPTS) { CommitAllocationNode commit = (CommitAllocationNode) n; ValueNode[] allocations = new ValueNode[commit.getVirtualObjects().size()]; @@ -752,7 +752,7 @@ graph.removeFixed(commit); } } else if (n instanceof OSRStartNode) { - if (graph.getGuardsPhase() == StructuredGraph.GuardsPhase.FIXED_DEOPTS) { + if (graph.getGuardsPhase() == StructuredGraph.GuardsStage.FIXED_DEOPTS) { OSRStartNode osrStart = (OSRStartNode) n; StartNode newStart = graph.add(new StartNode()); LocalNode buffer = graph.unique(new LocalNode(0, StampFactory.forKind(wordKind()))); @@ -781,31 +781,31 @@ } else if (n instanceof CheckCastDynamicNode) { checkcastDynamicSnippets.lower((CheckCastDynamicNode) n); } else if (n instanceof InstanceOfNode) { - if (graph.getGuardsPhase() == StructuredGraph.GuardsPhase.FIXED_DEOPTS) { + if (graph.getGuardsPhase() == StructuredGraph.GuardsStage.FIXED_DEOPTS) { instanceofSnippets.lower((InstanceOfNode) n, tool); } } else if (n instanceof InstanceOfDynamicNode) { - if (graph.getGuardsPhase() == StructuredGraph.GuardsPhase.FIXED_DEOPTS) { + if (graph.getGuardsPhase() == StructuredGraph.GuardsStage.FIXED_DEOPTS) { instanceofSnippets.lower((InstanceOfDynamicNode) n, tool); } } else if (n instanceof NewInstanceNode) { - if (graph.getGuardsPhase() == StructuredGraph.GuardsPhase.AFTER_FSA) { + if (graph.getGuardsPhase() == StructuredGraph.GuardsStage.AFTER_FSA) { newObjectSnippets.lower((NewInstanceNode) n); } } else if (n instanceof NewArrayNode) { - if (graph.getGuardsPhase() == StructuredGraph.GuardsPhase.AFTER_FSA) { + if (graph.getGuardsPhase() == StructuredGraph.GuardsStage.AFTER_FSA) { newObjectSnippets.lower((NewArrayNode) n); } } else if (n instanceof DynamicNewArrayNode) { - if (graph.getGuardsPhase() == StructuredGraph.GuardsPhase.AFTER_FSA) { + if (graph.getGuardsPhase() == StructuredGraph.GuardsStage.AFTER_FSA) { newObjectSnippets.lower((DynamicNewArrayNode) n); } } else if (n instanceof MonitorEnterNode) { - if (graph.getGuardsPhase() == StructuredGraph.GuardsPhase.FIXED_DEOPTS) { + if (graph.getGuardsPhase() == StructuredGraph.GuardsStage.FIXED_DEOPTS) { monitorSnippets.lower((MonitorEnterNode) n, tool); } } else if (n instanceof MonitorExitNode) { - if (graph.getGuardsPhase() == StructuredGraph.GuardsPhase.FIXED_DEOPTS) { + if (graph.getGuardsPhase() == StructuredGraph.GuardsStage.FIXED_DEOPTS) { monitorSnippets.lower((MonitorExitNode) n, tool); } } else if (n instanceof G1PreWriteBarrier) { @@ -823,7 +823,7 @@ } else if (n instanceof G1ArrayRangePostWriteBarrier) { writeBarrierSnippets.lower((G1ArrayRangePostWriteBarrier) n, tool); } else if (n instanceof NewMultiArrayNode) { - if (graph.getGuardsPhase() == StructuredGraph.GuardsPhase.AFTER_FSA) { + if (graph.getGuardsPhase() == StructuredGraph.GuardsStage.AFTER_FSA) { newObjectSnippets.lower((NewMultiArrayNode) n); } } else if (n instanceof LoadExceptionObjectNode) { @@ -844,7 +844,7 @@ } private static boolean addReadBarrier(UnsafeLoadNode load) { - if (useG1GC() && load.graph().getGuardsPhase() == StructuredGraph.GuardsPhase.FIXED_DEOPTS && load.object().kind() == Kind.Object && load.accessKind() == Kind.Object && + if (useG1GC() && load.graph().getGuardsPhase() == StructuredGraph.GuardsStage.FIXED_DEOPTS && load.object().kind() == Kind.Object && load.accessKind() == Kind.Object && !ObjectStamp.isObjectAlwaysNull(load.object())) { ResolvedJavaType type = ObjectStamp.typeOrNull(load.object()); if (type != null && !type.isArray()) { diff -r 94a28e1b2c86 -r 340e67bf1758 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/UnsafeArrayCopyNode.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/UnsafeArrayCopyNode.java Wed Sep 11 15:19:58 2013 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/UnsafeArrayCopyNode.java Fri Sep 13 14:47:04 2013 +0200 @@ -93,7 +93,7 @@ @Override public void lower(LoweringTool tool) { - if (graph().getGuardsPhase() == StructuredGraph.GuardsPhase.AFTER_FSA) { + if (graph().getGuardsPhase() == StructuredGraph.GuardsStage.AFTER_FSA) { UnsafeArrayCopySnippets.Templates templates = tool.getReplacements().getSnippetTemplateCache(UnsafeArrayCopySnippets.Templates.class); templates.lower(this); } diff -r 94a28e1b2c86 -r 340e67bf1758 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 Sep 11 15:19:58 2013 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/FixedGuardNode.java Fri Sep 13 14:47:04 2013 +0200 @@ -107,7 +107,7 @@ @Override public void lower(LoweringTool tool) { - if (graph().getGuardsPhase() == StructuredGraph.GuardsPhase.FLOATING_GUARDS) { + if (graph().getGuardsPhase() == StructuredGraph.GuardsStage.FLOATING_GUARDS) { GuardingNode guard = tool.createGuard(condition(), getReason(), getAction(), isNegated()); ValueAnchorNode newAnchor = graph().add(new ValueAnchorNode(guard.asNode())); this.replaceAtUsages(guard.asNode()); diff -r 94a28e1b2c86 -r 340e67bf1758 graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/GuardingPiNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/GuardingPiNode.java Wed Sep 11 15:19:58 2013 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/GuardingPiNode.java Fri Sep 13 14:47:04 2013 +0200 @@ -77,7 +77,7 @@ @Override public void lower(LoweringTool tool) { - if (graph().getGuardsPhase() == StructuredGraph.GuardsPhase.FIXED_DEOPTS) { + if (graph().getGuardsPhase() == StructuredGraph.GuardsStage.FIXED_DEOPTS) { throw new GraalInternalError("Cannot create guards in after-guard lowering"); } FixedGuardNode guard = graph().add(new FixedGuardNode(condition, reason, action, negated)); diff -r 94a28e1b2c86 -r 340e67bf1758 graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/StructuredGraph.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/StructuredGraph.java Wed Sep 11 15:19:58 2013 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/StructuredGraph.java Fri Sep 13 14:47:04 2013 +0200 @@ -37,7 +37,7 @@ */ public class StructuredGraph extends Graph { - public static enum GuardsPhase { + public static enum GuardsStage { FLOATING_GUARDS, FIXED_DEOPTS, AFTER_FSA } @@ -52,7 +52,7 @@ private final ResolvedJavaMethod method; private final long graphId; private final int entryBCI; - private GuardsPhase guardsPhase = GuardsPhase.FLOATING_GUARDS; + private GuardsStage guardsPhase = GuardsStage.FLOATING_GUARDS; /** * Creates a new Graph containing a single {@link AbstractBeginNode} as the {@link #start() @@ -392,11 +392,11 @@ } } - public GuardsPhase getGuardsPhase() { + public GuardsStage getGuardsPhase() { return guardsPhase; } - public void setGuardsPhase(GuardsPhase guardsPhase) { + public void setGuardsPhase(GuardsStage guardsPhase) { assert guardsPhase.ordinal() >= this.guardsPhase.ordinal(); this.guardsPhase = guardsPhase; } diff -r 94a28e1b2c86 -r 340e67bf1758 graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/WriteBarrier.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/WriteBarrier.java Wed Sep 11 15:19:58 2013 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/WriteBarrier.java Fri Sep 13 14:47:04 2013 +0200 @@ -54,7 +54,7 @@ @Override public void lower(LoweringTool generator) { - assert graph().getGuardsPhase() == StructuredGraph.GuardsPhase.AFTER_FSA; + assert graph().getGuardsPhase() == StructuredGraph.GuardsStage.AFTER_FSA; generator.getRuntime().lower(this, generator); } } diff -r 94a28e1b2c86 -r 340e67bf1758 graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/LoadHubNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/LoadHubNode.java Wed Sep 11 15:19:58 2013 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/LoadHubNode.java Fri Sep 13 14:47:04 2013 +0200 @@ -59,7 +59,7 @@ @Override public void lower(LoweringTool tool) { - if (graph().getGuardsPhase() == StructuredGraph.GuardsPhase.FIXED_DEOPTS) { + if (graph().getGuardsPhase() == StructuredGraph.GuardsStage.FIXED_DEOPTS) { tool.getRuntime().lower(this, tool); } } diff -r 94a28e1b2c86 -r 340e67bf1758 graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/FrameStateAssignmentPhase.java --- a/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/FrameStateAssignmentPhase.java Wed Sep 11 15:19:58 2013 +0200 +++ b/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/FrameStateAssignmentPhase.java Fri Sep 13 14:47:04 2013 +0200 @@ -27,7 +27,7 @@ import com.oracle.graal.graph.*; import com.oracle.graal.graph.iterators.*; import com.oracle.graal.nodes.*; -import com.oracle.graal.nodes.StructuredGraph.GuardsPhase; +import com.oracle.graal.nodes.StructuredGraph.GuardsStage; import com.oracle.graal.nodes.util.*; import com.oracle.graal.phases.*; import com.oracle.graal.phases.graph.*; @@ -79,7 +79,7 @@ assert checkFixedDeopts(graph); ReentrantNodeIterator.apply(new FrameStateAssignmentClosure(), graph.start(), null, null); - graph.setGuardsPhase(GuardsPhase.AFTER_FSA); + graph.setGuardsPhase(GuardsStage.AFTER_FSA); } private static boolean checkFixedDeopts(StructuredGraph graph) { diff -r 94a28e1b2c86 -r 340e67bf1758 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 Wed Sep 11 15:19:58 2013 +0200 +++ b/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/GuardLoweringPhase.java Fri Sep 13 14:47:04 2013 +0200 @@ -29,7 +29,7 @@ import com.oracle.graal.graph.*; import com.oracle.graal.nodes.*; -import com.oracle.graal.nodes.StructuredGraph.GuardsPhase; +import com.oracle.graal.nodes.StructuredGraph.GuardsStage; import com.oracle.graal.nodes.calc.*; import com.oracle.graal.nodes.cfg.*; import com.oracle.graal.nodes.extended.*; @@ -189,7 +189,7 @@ processBlock(block, schedule, context.getTarget().implicitNullCheckLimit); } - graph.setGuardsPhase(GuardsPhase.FIXED_DEOPTS); + graph.setGuardsPhase(GuardsStage.FIXED_DEOPTS); } private static void processBlock(Block block, SchedulePhase schedule, int implicitNullCheckLimit) { diff -r 94a28e1b2c86 -r 340e67bf1758 graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/LoweringPhase.java --- a/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/LoweringPhase.java Wed Sep 11 15:19:58 2013 +0200 +++ b/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/LoweringPhase.java Fri Sep 13 14:47:04 2013 +0200 @@ -95,7 +95,7 @@ @Override public GuardingNode createGuard(LogicNode condition, DeoptimizationReason deoptReason, DeoptimizationAction action, boolean negated) { - if (condition.graph().getGuardsPhase().ordinal() > StructuredGraph.GuardsPhase.FLOATING_GUARDS.ordinal()) { + if (condition.graph().getGuardsPhase().ordinal() > StructuredGraph.GuardsStage.FLOATING_GUARDS.ordinal()) { throw new GraalInternalError("Cannot create guards after guard lowering"); } if (OptEliminateGuards.getValue()) { diff -r 94a28e1b2c86 -r 340e67bf1758 graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/nodes/arithmetic/IntegerExactArithmeticSplitNode.java --- a/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/nodes/arithmetic/IntegerExactArithmeticSplitNode.java Wed Sep 11 15:19:58 2013 +0200 +++ b/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/nodes/arithmetic/IntegerExactArithmeticSplitNode.java Fri Sep 13 14:47:04 2013 +0200 @@ -81,7 +81,7 @@ protected abstract Value generateArithmetic(LIRGeneratorTool generator); static void lower(LoweringTool tool, IntegerExactArithmeticNode node) { - if (node.asNode().graph().getGuardsPhase() == StructuredGraph.GuardsPhase.FIXED_DEOPTS) { + if (node.asNode().graph().getGuardsPhase() == StructuredGraph.GuardsStage.FIXED_DEOPTS) { FloatingNode floatingNode = (FloatingNode) node; FixedWithNextNode previous = tool.lastFixedNode(); FixedNode next = previous.next(); diff -r 94a28e1b2c86 -r 340e67bf1758 graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/nodes/typesystem/CustomTypeCheckNode.java --- a/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/nodes/typesystem/CustomTypeCheckNode.java Wed Sep 11 15:19:58 2013 +0200 +++ b/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/nodes/typesystem/CustomTypeCheckNode.java Fri Sep 13 14:47:04 2013 +0200 @@ -51,7 +51,7 @@ } public void lower(LoweringTool tool) { - if (graph().getGuardsPhase() == StructuredGraph.GuardsPhase.FLOATING_GUARDS) { + if (graph().getGuardsPhase() == StructuredGraph.GuardsStage.FLOATING_GUARDS) { this.replaceAtUsages(graph().unique(new IntegerEqualsNode(condition, ConstantNode.forInt(1, graph())))); this.safeDelete(); } diff -r 94a28e1b2c86 -r 340e67bf1758 graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/nodes/typesystem/TypeCastNode.java --- a/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/nodes/typesystem/TypeCastNode.java Wed Sep 11 15:19:58 2013 +0200 +++ b/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/nodes/typesystem/TypeCastNode.java Fri Sep 13 14:47:04 2013 +0200 @@ -60,7 +60,7 @@ } public void lower(LoweringTool tool) { - if (graph().getGuardsPhase() == StructuredGraph.GuardsPhase.FLOATING_GUARDS) { + if (graph().getGuardsPhase() == StructuredGraph.GuardsStage.FLOATING_GUARDS) { ValueAnchorNode valueAnchorNode = graph().add(new ValueAnchorNode()); UnsafeCastNode unsafeCast = graph().unique(new UnsafeCastNode(object, this.stamp(), (GuardingNode) valueAnchorNode)); this.replaceAtUsages(unsafeCast);