# HG changeset patch # User Doug Simon # Date 1373471163 -7200 # Node ID bebc9672f45eb0bce193f239d465bd9527c75c74 # Parent 77b83e903703993a1c3b1d95a163de3c3eba813b stamp for GuardingPiNode is determined by caller of constructor, not within constructor diff -r 77b83e903703 -r bebc9672f45e 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 Jul 10 17:44:23 2013 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/GuardingPiNode.java Wed Jul 10 17:46:03 2013 +0200 @@ -46,13 +46,24 @@ return object; } - public GuardingPiNode(ValueNode object) { + /** + * Constructor for {@link #guardingNonNull(Object)} node intrinsic. + */ + private GuardingPiNode(ValueNode object) { this(object, object.graph().unique(new IsNullNode(object)), true, DeoptimizationReason.NullCheckException, DeoptimizationAction.None, object.stamp().join(StampFactory.objectNonNull())); } + /** + * Creates a guarding pi node. + * + * @param object the object whose type is refined if this guard succeeds + * @param condition the condition to test + * @param negateCondition the guard succeeds if {@code condition != negateCondition} + * @param stamp the refined type of the object if the guard succeeds + */ public GuardingPiNode(ValueNode object, ValueNode condition, boolean negateCondition, DeoptimizationReason reason, DeoptimizationAction action, Stamp stamp) { - super(object.stamp().join(stamp)); - assert stamp() != null; + super(stamp); + assert stamp != null; this.object = object; this.condition = (LogicNode) condition; this.reason = reason; diff -r 77b83e903703 -r bebc9672f45e graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/InliningUtil.java --- a/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/InliningUtil.java Wed Jul 10 17:44:23 2013 +0200 +++ b/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/InliningUtil.java Wed Jul 10 17:46:03 2013 +0200 @@ -1441,7 +1441,8 @@ if (firstParam.kind() == Kind.Object && !firstParam.objectStamp().nonNull()) { assert !firstParam.objectStamp().alwaysNull(); IsNullNode condition = graph.unique(new IsNullNode(firstParam)); - GuardingPiNode nonNullReceiver = graph.add(new GuardingPiNode(firstParam, condition, true, NullCheckException, InvalidateReprofile, objectNonNull())); + Stamp stamp = firstParam.stamp().join(objectNonNull()); + GuardingPiNode nonNullReceiver = graph.add(new GuardingPiNode(firstParam, condition, true, NullCheckException, InvalidateReprofile, stamp)); graph.addBeforeFixed(invoke.asNode(), nonNullReceiver); callTarget.replaceFirstInput(firstParam, nonNullReceiver); return nonNullReceiver;