diff graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/UnsafeLoadNode.java @ 5464:1d00c9a1f733

support @NodeIntrinsic based creation of a UnsafeLoadNode with a stamp indicating non-nullness
author Doug Simon <doug.simon@oracle.com>
date Fri, 01 Jun 2012 11:08:03 +0200
parents d42425beb1d1
children 438ab53efdd0
line wrap: on
line diff
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/UnsafeLoadNode.java	Fri Jun 01 11:05:24 2012 +0200
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/UnsafeLoadNode.java	Fri Jun 01 11:08:03 2012 +0200
@@ -22,11 +22,11 @@
  */
 package com.oracle.graal.nodes.extended;
 
-import com.oracle.max.cri.ci.*;
 import com.oracle.graal.cri.*;
 import com.oracle.graal.nodes.*;
 import com.oracle.graal.nodes.spi.*;
 import com.oracle.graal.nodes.type.*;
+import com.oracle.max.cri.ci.*;
 
 /**
  * Load of a value from a location specified as an offset relative to an object.
@@ -50,6 +50,14 @@
         return offset;
     }
 
+    public UnsafeLoadNode(ValueNode object, int displacement, ValueNode offset, boolean nonNull) {
+        super(nonNull ? StampFactory.objectNonNull() : StampFactory.object());
+        this.object = object;
+        this.displacement = displacement;
+        this.offset = offset;
+        this.loadKind = CiKind.Object;
+    }
+
     public UnsafeLoadNode(ValueNode object, int displacement, ValueNode offset, CiKind kind) {
         super(StampFactory.forKind(kind.stackKind()));
         this.object = object;
@@ -72,4 +80,10 @@
     public static <T> T load(Object object, @ConstantNodeParameter int displacement, long offset, @ConstantNodeParameter CiKind kind) {
         throw new UnsupportedOperationException("This method may only be compiled with the Graal compiler");
     }
+
+    @SuppressWarnings("unused")
+    @NodeIntrinsic
+    public static Object loadObject(Object object, @ConstantNodeParameter int displacement, long offset, @ConstantNodeParameter boolean nonNull) {
+        throw new UnsupportedOperationException("This method may only be compiled with the Graal compiler");
+    }
 }