changeset 19844:426461951938

Convert LocationIdentity from an interface into an abstract class.
author Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
date Sat, 14 Mar 2015 01:09:21 +0100
parents c2124d859d91
children 3d0116ec99c5
files graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/LocationIdentity.java graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/NamedLocationIdentity.java graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/nodes/ObjectLocationIdentity.java
diffstat 3 files changed, 9 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/LocationIdentity.java	Sat Mar 14 01:02:08 2015 +0100
+++ b/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/LocationIdentity.java	Sat Mar 14 01:09:21 2015 +0100
@@ -33,34 +33,34 @@
  * comparing two {@link LocationIdentity} values for equality. Likewise, they must not use
  * {@link IdentityHashMap}s with {@link LocationIdentity} values as keys.
  */
-public interface LocationIdentity extends TrustedInterface {
+public abstract class LocationIdentity {
 
     /**
      * Denotes any location. A write to such a location kills all values in a memory map during an
      * analysis of memory accesses. A read from this location cannot be moved or coalesced with
      * other reads because its interaction with other reads is not known.
      */
-    LocationIdentity ANY_LOCATION = NamedLocationIdentity.mutable("ANY_LOCATION");
+    public static final LocationIdentity ANY_LOCATION = NamedLocationIdentity.mutable("ANY_LOCATION");
 
     /**
      * Denotes the location of a value that is guaranteed to be unchanging.
      */
-    LocationIdentity FINAL_LOCATION = NamedLocationIdentity.immutable("FINAL_LOCATION");
+    public static final LocationIdentity FINAL_LOCATION = NamedLocationIdentity.immutable("FINAL_LOCATION");
 
     /**
      * Denotes the location of the length field of a Java array.
      */
-    LocationIdentity ARRAY_LENGTH_LOCATION = NamedLocationIdentity.immutable("[].length");
+    public static final LocationIdentity ARRAY_LENGTH_LOCATION = NamedLocationIdentity.immutable("[].length");
 
     /**
      * 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() {
+    public boolean isImmutable() {
         return false;
     }
 
-    default boolean isMutable() {
+    public boolean isMutable() {
         return !isImmutable();
     }
 }
--- a/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/NamedLocationIdentity.java	Sat Mar 14 01:02:08 2015 +0100
+++ b/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/NamedLocationIdentity.java	Sat Mar 14 01:09:21 2015 +0100
@@ -29,7 +29,7 @@
 /**
  * A {@link LocationIdentity} with a name.
  */
-public final class NamedLocationIdentity implements LocationIdentity, FormatWithToString {
+public final class NamedLocationIdentity extends LocationIdentity implements FormatWithToString {
 
     /**
      * Map for asserting all {@link NamedLocationIdentity} instances have a unique name.
@@ -112,6 +112,7 @@
         return name + (immutable ? ":immutable" : ":mutable");
     }
 
+    @Override
     public boolean isImmutable() {
         return immutable;
     }
--- a/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/nodes/ObjectLocationIdentity.java	Sat Mar 14 01:02:08 2015 +0100
+++ b/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/nodes/ObjectLocationIdentity.java	Sat Mar 14 01:09:21 2015 +0100
@@ -29,7 +29,7 @@
 /**
  * A {@link LocationIdentity} wrapping an object.
  */
-public final class ObjectLocationIdentity implements LocationIdentity {
+public final class ObjectLocationIdentity extends LocationIdentity {
 
     private JavaConstant object;