# HG changeset patch # User Gilles Duboscq # Date 1370357603 -7200 # Node ID 30cab249529e58ae455148bec45778fb2b6c1e95 # Parent 538ac2cf3383d6149cd743e2c1845eda82c014da When lowering a fixed guard, the usages should be forwarded to the floating guard instead of the value anchor. FixedGuardNode should have a dependency stamp diff -r 538ac2cf3383 -r 30cab249529e 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 Tue Jun 04 15:22:43 2013 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotRuntime.java Tue Jun 04 16:53:23 2013 +0200 @@ -634,7 +634,9 @@ graph.replaceFixed(loadMethodNode, metaspaceMethod); } else if (n instanceof FixedGuardNode) { FixedGuardNode node = (FixedGuardNode) n; - ValueAnchorNode newAnchor = graph.add(new ValueAnchorNode(tool.createGuard(node.condition(), node.getReason(), node.getAction(), node.isNegated()).asNode())); + GuardingNode guard = tool.createGuard(node.condition(), node.getReason(), node.getAction(), node.isNegated()); + ValueAnchorNode newAnchor = graph.add(new ValueAnchorNode(guard.asNode())); + node.replaceAtUsages(guard.asNode()); graph.replaceFixedWithFixed(node, newAnchor); } else if (n instanceof CommitAllocationNode) { CommitAllocationNode commit = (CommitAllocationNode) n; diff -r 538ac2cf3383 -r 30cab249529e 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 Tue Jun 04 15:22:43 2013 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/FixedGuardNode.java Tue Jun 04 16:53:23 2013 +0200 @@ -25,12 +25,13 @@ import com.oracle.graal.api.code.*; import com.oracle.graal.api.meta.*; import com.oracle.graal.graph.*; +import com.oracle.graal.nodes.extended.*; import com.oracle.graal.nodes.spi.*; import com.oracle.graal.nodes.type.*; import com.oracle.graal.nodes.util.*; @NodeInfo(nameTemplate = "FixedGuard(!={p#negated}) {p#reason/s}") -public final class FixedGuardNode extends FixedWithNextNode implements Simplifiable, Lowerable, Node.IterableNodeType, Negatable { +public final class FixedGuardNode extends FixedWithNextNode implements Simplifiable, Lowerable, Node.IterableNodeType, Negatable, GuardingNode { @Input private LogicNode condition; private final DeoptimizationReason reason; @@ -51,7 +52,7 @@ } public FixedGuardNode(LogicNode condition, DeoptimizationReason deoptReason, DeoptimizationAction action, boolean negated) { - super(StampFactory.forVoid()); + super(StampFactory.dependency()); this.action = action; this.negated = negated; this.condition = condition; @@ -84,6 +85,7 @@ if (condition instanceof LogicConstantNode) { LogicConstantNode c = (LogicConstantNode) condition; if (c.getValue() != negated) { + this.replaceAtUsages(BeginNode.prevBegin(this)); graph().removeFixed(this); } else { FixedNode next = this.next(); @@ -121,4 +123,9 @@ negated = !negated; return this; } + + @Override + public FixedGuardNode asNode() { + return this; + } }