# HG changeset patch # User Thomas Wuerthinger # Date 1426291761 -3600 # Node ID 4264619519389fbdd0a4ab144fc522924468aafb # Parent c2124d859d91779606fa631138fb6edc7bca7c76 Convert LocationIdentity from an interface into an abstract class. diff -r c2124d859d91 -r 426461951938 graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/LocationIdentity.java --- 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(); } } diff -r c2124d859d91 -r 426461951938 graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/NamedLocationIdentity.java --- 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; } diff -r c2124d859d91 -r 426461951938 graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/nodes/ObjectLocationIdentity.java --- 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;