changeset 7297:8b4940b9be00

Add constructor for node intrinsic
author Christian Wimmer <christian.wimmer@oracle.com>
date Wed, 26 Dec 2012 13:37:44 -0800
parents 8d9c7a109967
children 4d6d84714c17
files graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/ReadNode.java
diffstat 1 files changed, 7 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/ReadNode.java	Wed Dec 26 13:36:41 2012 -0800
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/ReadNode.java	Wed Dec 26 13:37:44 2012 -0800
@@ -34,7 +34,7 @@
  */
 public final class ReadNode extends AccessNode implements Node.IterableNodeType, LIRLowerable, Canonicalizable {
 
-    public ReadNode(ValueNode object, LocationNode location, Stamp stamp) {
+    public ReadNode(ValueNode object, ValueNode location, Stamp stamp) {
         super(object, location, stamp);
     }
 
@@ -42,6 +42,12 @@
         super(object, object.graph().add(new LocationNode(locationIdentity, kind, displacement)), StampFactory.forKind(kind));
     }
 
+    public ReadNode(ValueNode object, ValueNode location) {
+        // Used by node intrinsics. Since the initial value for location is a parameter, i.e., a LocalNode, the
+        // constructor cannot use the declared type LocationNode
+        this(object, location, StampFactory.forNodeIntrinsic());
+    }
+
     @Override
     public void generate(LIRGeneratorTool gen) {
         gen.setResult(this, gen.emitLoad(gen.makeAddress(location(), object()), getNullCheck()));