diff graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/LocationIdentity.java @ 18231:70df63b02309

Use LocationIdentity.isImmutable instead of testing against FINAL_LOCATION
author Tom Rodriguez <tom.rodriguez@oracle.com>
date Mon, 03 Nov 2014 13:37:10 -0800
parents 9d864856336a
children e1b2489393f4
line wrap: on
line diff
--- a/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/LocationIdentity.java	Mon Nov 03 10:31:39 2014 -0800
+++ b/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/LocationIdentity.java	Mon Nov 03 13:37:10 2014 -0800
@@ -37,12 +37,20 @@
     LocationIdentity ANY_LOCATION = new NamedLocationIdentity("ANY_LOCATION");
 
     /**
-     * Denotes the location of a value that is guaranteed to be final.
+     * Denotes the location of a value that is guaranteed to be unchanging.
      */
-    LocationIdentity FINAL_LOCATION = new NamedLocationIdentity("FINAL_LOCATION");
+    LocationIdentity FINAL_LOCATION = new NamedLocationIdentity("FINAL_LOCATION", true);
 
     /**
      * Denotes the location of the length field of a Java array.
      */
-    LocationIdentity ARRAY_LENGTH_LOCATION = new NamedLocationIdentity("[].length");
+    LocationIdentity ARRAY_LENGTH_LOCATION = new NamedLocationIdentity("[].length", true);
+
+    /**
+     * Denotes a location is unchanging in all cases. Not that this is different than the Java
+     * notion of final which only requires definite assignment.
+     */
+    default boolean isImmutable() {
+        return false;
+    }
 }