diff graal/com.oracle.graal.word/src/com/oracle/graal/word/Pointer.java @ 9526:ae5cd887e67c

Use a LocationIdentity interface instead of just Object for the location identity of a LocationNode
author Christian Wimmer <christian.wimmer@oracle.com>
date Thu, 02 May 2013 12:12:51 -0700
parents c8f2002d2194
children 06dc2d2324d6
line wrap: on
line diff
--- a/graal/com.oracle.graal.word/src/com/oracle/graal/word/Pointer.java	Thu May 02 10:38:48 2013 -0700
+++ b/graal/com.oracle.graal.word/src/com/oracle/graal/word/Pointer.java	Thu May 02 12:12:51 2013 -0700
@@ -23,6 +23,7 @@
 package com.oracle.graal.word;
 
 import com.oracle.graal.nodes.extended.*;
+import com.oracle.graal.nodes.extended.LocationNode.LocationIdentity;
 
 public interface Pointer extends Unsigned {
 
@@ -47,7 +48,7 @@
      * @param locationIdentity the identity of the read (see {@link LocationNode})
      * @return the result of the memory access
      */
-    byte readByte(WordBase offset, Object locationIdentity);
+    byte readByte(WordBase offset, LocationIdentity locationIdentity);
 
     /**
      * Reads the memory at address {@code (this + offset)}. Both the base address and offset are in
@@ -61,7 +62,7 @@
      * @param locationIdentity the identity of the read (see {@link LocationNode})
      * @return the result of the memory access
      */
-    char readChar(WordBase offset, Object locationIdentity);
+    char readChar(WordBase offset, LocationIdentity locationIdentity);
 
     /**
      * Reads the memory at address {@code (this + offset)}. Both the base address and offset are in
@@ -75,7 +76,7 @@
      * @param locationIdentity the identity of the read (see {@link LocationNode})
      * @return the result of the memory access
      */
-    short readShort(WordBase offset, Object locationIdentity);
+    short readShort(WordBase offset, LocationIdentity locationIdentity);
 
     /**
      * Reads the memory at address {@code (this + offset)}. Both the base address and offset are in
@@ -89,7 +90,7 @@
      * @param locationIdentity the identity of the read (see {@link LocationNode})
      * @return the result of the memory access
      */
-    int readInt(WordBase offset, Object locationIdentity);
+    int readInt(WordBase offset, LocationIdentity locationIdentity);
 
     /**
      * Reads the memory at address {@code (this + offset)}. Both the base address and offset are in
@@ -103,7 +104,7 @@
      * @param locationIdentity the identity of the read (see {@link LocationNode})
      * @return the result of the memory access
      */
-    long readLong(WordBase offset, Object locationIdentity);
+    long readLong(WordBase offset, LocationIdentity locationIdentity);
 
     /**
      * Reads the memory at address {@code (this + offset)}. Both the base address and offset are in
@@ -117,7 +118,7 @@
      * @param locationIdentity the identity of the read (see {@link LocationNode})
      * @return the result of the memory access
      */
-    float readFloat(WordBase offset, Object locationIdentity);
+    float readFloat(WordBase offset, LocationIdentity locationIdentity);
 
     /**
      * Reads the memory at address {@code (this + offset)}. Both the base address and offset are in
@@ -131,7 +132,7 @@
      * @param locationIdentity the identity of the read (see {@link LocationNode})
      * @return the result of the memory access
      */
-    double readDouble(WordBase offset, Object locationIdentity);
+    double readDouble(WordBase offset, LocationIdentity locationIdentity);
 
     /**
      * Reads the memory at address {@code (this + offset)}. Both the base address and offset are in
@@ -145,7 +146,7 @@
      * @param locationIdentity the identity of the read (see {@link LocationNode})
      * @return the result of the memory access
      */
-    Word readWord(WordBase offset, Object locationIdentity);
+    Word readWord(WordBase offset, LocationIdentity locationIdentity);
 
     /**
      * Reads the memory at address {@code (this + offset)}. Both the base address and offset are in
@@ -159,7 +160,7 @@
      * @param locationIdentity the identity of the read (see {@link LocationNode})
      * @return the result of the memory access
      */
-    Object readObject(WordBase offset, Object locationIdentity);
+    Object readObject(WordBase offset, LocationIdentity locationIdentity);
 
     /**
      * Reads the memory at address {@code (this + offset)}. Both the base address and offset are in
@@ -169,7 +170,7 @@
      * @param locationIdentity the identity of the read (see {@link LocationNode})
      * @return the result of the memory access
      */
-    byte readByte(int offset, Object locationIdentity);
+    byte readByte(int offset, LocationIdentity locationIdentity);
 
     /**
      * Reads the memory at address {@code (this + offset)}. Both the base address and offset are in
@@ -179,7 +180,7 @@
      * @param locationIdentity the identity of the read (see {@link LocationNode})
      * @return the result of the memory access
      */
-    char readChar(int offset, Object locationIdentity);
+    char readChar(int offset, LocationIdentity locationIdentity);
 
     /**
      * Reads the memory at address {@code (this + offset)}. Both the base address and offset are in
@@ -189,7 +190,7 @@
      * @param locationIdentity the identity of the read (see {@link LocationNode})
      * @return the result of the memory access
      */
-    short readShort(int offset, Object locationIdentity);
+    short readShort(int offset, LocationIdentity locationIdentity);
 
     /**
      * Reads the memory at address {@code (this + offset)}. Both the base address and offset are in
@@ -199,7 +200,7 @@
      * @param locationIdentity the identity of the read (see {@link LocationNode})
      * @return the result of the memory access
      */
-    int readInt(int offset, Object locationIdentity);
+    int readInt(int offset, LocationIdentity locationIdentity);
 
     /**
      * Reads the memory at address {@code (this + offset)}. Both the base address and offset are in
@@ -209,7 +210,7 @@
      * @param locationIdentity the identity of the read (see {@link LocationNode})
      * @return the result of the memory access
      */
-    long readLong(int offset, Object locationIdentity);
+    long readLong(int offset, LocationIdentity locationIdentity);
 
     /**
      * Reads the memory at address {@code (this + offset)}. Both the base address and offset are in
@@ -219,7 +220,7 @@
      * @param locationIdentity the identity of the read (see {@link LocationNode})
      * @return the result of the memory access
      */
-    float readFloat(int offset, Object locationIdentity);
+    float readFloat(int offset, LocationIdentity locationIdentity);
 
     /**
      * Reads the memory at address {@code (this + offset)}. Both the base address and offset are in
@@ -229,7 +230,7 @@
      * @param locationIdentity the identity of the read (see {@link LocationNode})
      * @return the result of the memory access
      */
-    double readDouble(int offset, Object locationIdentity);
+    double readDouble(int offset, LocationIdentity locationIdentity);
 
     /**
      * Reads the memory at address {@code (this + offset)}. Both the base address and offset are in
@@ -239,7 +240,7 @@
      * @param locationIdentity the identity of the read (see {@link LocationNode})
      * @return the result of the memory access
      */
-    Word readWord(int offset, Object locationIdentity);
+    Word readWord(int offset, LocationIdentity locationIdentity);
 
     /**
      * Reads the memory at address {@code (this + offset)}. Both the base address and offset are in
@@ -249,7 +250,7 @@
      * @param locationIdentity the identity of the read (see {@link LocationNode})
      * @return the result of the memory access
      */
-    Object readObject(int offset, Object locationIdentity);
+    Object readObject(int offset, LocationIdentity locationIdentity);
 
     /**
      * Writes the memory at address {@code (this + offset)}. Both the base address and offset are in
@@ -263,7 +264,7 @@
      * @param locationIdentity the identity of the write (see {@link LocationNode})
      * @param val the value to be written to memory
      */
-    void writeByte(WordBase offset, byte val, Object locationIdentity);
+    void writeByte(WordBase offset, byte val, LocationIdentity locationIdentity);
 
     /**
      * Writes the memory at address {@code (this + offset)}. Both the base address and offset are in
@@ -277,7 +278,7 @@
      * @param locationIdentity the identity of the write (see {@link LocationNode})
      * @param val the value to be written to memory
      */
-    void writeChar(WordBase offset, char val, Object locationIdentity);
+    void writeChar(WordBase offset, char val, LocationIdentity locationIdentity);
 
     /**
      * Writes the memory at address {@code (this + offset)}. Both the base address and offset are in
@@ -291,7 +292,7 @@
      * @param locationIdentity the identity of the write (see {@link LocationNode})
      * @param val the value to be written to memory
      */
-    void writeShort(WordBase offset, short val, Object locationIdentity);
+    void writeShort(WordBase offset, short val, LocationIdentity locationIdentity);
 
     /**
      * Writes the memory at address {@code (this + offset)}. Both the base address and offset are in
@@ -305,7 +306,7 @@
      * @param locationIdentity the identity of the write (see {@link LocationNode})
      * @param val the value to be written to memory
      */
-    void writeInt(WordBase offset, int val, Object locationIdentity);
+    void writeInt(WordBase offset, int val, LocationIdentity locationIdentity);
 
     /**
      * Writes the memory at address {@code (this + offset)}. Both the base address and offset are in
@@ -319,7 +320,7 @@
      * @param locationIdentity the identity of the write (see {@link LocationNode})
      * @param val the value to be written to memory
      */
-    void writeLong(WordBase offset, long val, Object locationIdentity);
+    void writeLong(WordBase offset, long val, LocationIdentity locationIdentity);
 
     /**
      * Writes the memory at address {@code (this + offset)}. Both the base address and offset are in
@@ -333,7 +334,7 @@
      * @param locationIdentity the identity of the write (see {@link LocationNode})
      * @param val the value to be written to memory
      */
-    void writeFloat(WordBase offset, float val, Object locationIdentity);
+    void writeFloat(WordBase offset, float val, LocationIdentity locationIdentity);
 
     /**
      * Writes the memory at address {@code (this + offset)}. Both the base address and offset are in
@@ -347,7 +348,7 @@
      * @param locationIdentity the identity of the write (see {@link LocationNode})
      * @param val the value to be written to memory
      */
-    void writeDouble(WordBase offset, double val, Object locationIdentity);
+    void writeDouble(WordBase offset, double val, LocationIdentity locationIdentity);
 
     /**
      * Writes the memory at address {@code (this + offset)}. Both the base address and offset are in
@@ -361,7 +362,7 @@
      * @param locationIdentity the identity of the write (see {@link LocationNode})
      * @param val the value to be written to memory
      */
-    void writeWord(WordBase offset, WordBase val, Object locationIdentity);
+    void writeWord(WordBase offset, WordBase val, LocationIdentity locationIdentity);
 
     /**
      * Writes the memory at address {@code (this + offset)}. Both the base address and offset are in
@@ -375,7 +376,7 @@
      * @param locationIdentity the identity of the write (see {@link LocationNode})
      * @param val the value to be written to memory
      */
-    void writeObject(WordBase offset, Object val, Object locationIdentity);
+    void writeObject(WordBase offset, Object val, LocationIdentity locationIdentity);
 
     /**
      * Writes the memory at address {@code (this + offset)}. Both the base address and offset are in
@@ -385,7 +386,7 @@
      * @param locationIdentity the identity of the write (see {@link LocationNode})
      * @param val the value to be written to memory
      */
-    void writeByte(int offset, byte val, Object locationIdentity);
+    void writeByte(int offset, byte val, LocationIdentity locationIdentity);
 
     /**
      * Writes the memory at address {@code (this + offset)}. Both the base address and offset are in
@@ -395,7 +396,7 @@
      * @param locationIdentity the identity of the write (see {@link LocationNode})
      * @param val the value to be written to memory
      */
-    void writeChar(int offset, char val, Object locationIdentity);
+    void writeChar(int offset, char val, LocationIdentity locationIdentity);
 
     /**
      * Writes the memory at address {@code (this + offset)}. Both the base address and offset are in
@@ -405,7 +406,7 @@
      * @param locationIdentity the identity of the write (see {@link LocationNode})
      * @param val the value to be written to memory
      */
-    void writeShort(int offset, short val, Object locationIdentity);
+    void writeShort(int offset, short val, LocationIdentity locationIdentity);
 
     /**
      * Writes the memory at address {@code (this + offset)}. Both the base address and offset are in
@@ -415,7 +416,7 @@
      * @param locationIdentity the identity of the write (see {@link LocationNode})
      * @param val the value to be written to memory
      */
-    void writeInt(int offset, int val, Object locationIdentity);
+    void writeInt(int offset, int val, LocationIdentity locationIdentity);
 
     /**
      * Writes the memory at address {@code (this + offset)}. Both the base address and offset are in
@@ -425,7 +426,7 @@
      * @param locationIdentity the identity of the write (see {@link LocationNode})
      * @param val the value to be written to memory
      */
-    void writeLong(int offset, long val, Object locationIdentity);
+    void writeLong(int offset, long val, LocationIdentity locationIdentity);
 
     /**
      * Writes the memory at address {@code (this + offset)}. Both the base address and offset are in
@@ -435,7 +436,7 @@
      * @param locationIdentity the identity of the write (see {@link LocationNode})
      * @param val the value to be written to memory
      */
-    void writeFloat(int offset, float val, Object locationIdentity);
+    void writeFloat(int offset, float val, LocationIdentity locationIdentity);
 
     /**
      * Writes the memory at address {@code (this + offset)}. Both the base address and offset are in
@@ -445,7 +446,7 @@
      * @param locationIdentity the identity of the write (see {@link LocationNode})
      * @param val the value to be written to memory
      */
-    void writeDouble(int offset, double val, Object locationIdentity);
+    void writeDouble(int offset, double val, LocationIdentity locationIdentity);
 
     /**
      * Writes the memory at address {@code (this + offset)}. Both the base address and offset are in
@@ -455,7 +456,7 @@
      * @param locationIdentity the identity of the write (see {@link LocationNode})
      * @param val the value to be written to memory
      */
-    void writeWord(int offset, WordBase val, Object locationIdentity);
+    void writeWord(int offset, WordBase val, LocationIdentity locationIdentity);
 
     /**
      * Writes the memory at address {@code (this + offset)}. Both the base address and offset are in
@@ -465,7 +466,7 @@
      * @param locationIdentity the identity of the write (see {@link LocationNode})
      * @param val the value to be written to memory
      */
-    void writeObject(int offset, Object val, Object locationIdentity);
+    void writeObject(int offset, Object val, LocationIdentity locationIdentity);
 
     /**
      * Reads the memory at address {@code (this + offset)}. Both the base address and offset are in