changeset 10692:bebc9672f45e

stamp for GuardingPiNode is determined by caller of constructor, not within constructor
author Doug Simon <doug.simon@oracle.com>
date Wed, 10 Jul 2013 17:46:03 +0200
parents 77b83e903703
children f8adf47cc05e
files graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/GuardingPiNode.java graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/InliningUtil.java
diffstat 2 files changed, 16 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- 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;
--- 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;