diff graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/GuardingPiNode.java @ 19962:9b669776bf8a

added null checking for the receiver when inlining or applying an InvocationPlugin during graph parsing
author Doug Simon <doug.simon@oracle.com>
date Thu, 19 Mar 2015 22:31:42 +0100
parents 14e703edb2ab
children 343021aacd2f
line wrap: on
line diff
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/GuardingPiNode.java	Thu Mar 19 19:27:25 2015 +0100
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/GuardingPiNode.java	Thu Mar 19 22:31:42 2015 +0100
@@ -22,10 +22,6 @@
  */
 package com.oracle.graal.nodes;
 
-import static com.oracle.graal.api.meta.DeoptimizationAction.*;
-import static com.oracle.graal.api.meta.DeoptimizationReason.*;
-import static com.oracle.graal.compiler.common.type.StampFactory.*;
-
 import com.oracle.graal.api.meta.*;
 import com.oracle.graal.compiler.common.type.*;
 import com.oracle.graal.graph.*;
@@ -70,21 +66,6 @@
         return action;
     }
 
-    /**
-     * Returns a node whose stamp is guaranteed to be {@linkplain StampTool#isPointerNonNull(Stamp)
-     * non-null}. If {@code value} already has such a stamp, then it is returned. Otherwise a fixed
-     * node guarding {@code value} is returned where the guard performs a null check.
-     */
-    public static ValueNode nullCheckedValue(ValueNode value) {
-        ObjectStamp receiverStamp = (ObjectStamp) value.stamp();
-        if (!StampTool.isPointerNonNull(receiverStamp)) {
-            IsNullNode condition = value.graph().unique(new IsNullNode(value));
-            Stamp stamp = receiverStamp.join(objectNonNull());
-            return new GuardingPiNode(value, condition, true, NullCheckException, InvalidateReprofile, stamp);
-        }
-        return value;
-    }
-
     public GuardingPiNode(ValueNode object) {
         this(object, object.graph().unique(new IsNullNode(object)), true, DeoptimizationReason.NullCheckException, DeoptimizationAction.None, object.stamp().join(StampFactory.objectNonNull()));
     }