Class LocationIdentity

java.lang.Object
org.graalvm.word.LocationIdentity

public abstract class LocationIdentity extends Object
Marker interface for location identities. A different location identity of two memory accesses guarantees that the two accesses do not interfere.

Clients of LocationIdentity must use Object.equals(Object), not ==, when comparing two LocationIdentity values for equality. Likewise, they must not use IdentityHashMaps with LocationIdentity values as keys.

Since:
19.0
  • Field Details

    • ANY_LOCATION

      public static final LocationIdentity ANY_LOCATION
      Indicates that the given location is the union of all possible mutable locations. A write to such a location kill all reads from mutable locations and a read from this location is killed by any write (except for initialization writes).
      Since:
      19.0
    • INIT_LOCATION

      public static final LocationIdentity INIT_LOCATION
      Location only allowed to be used for writes. Indicates that a completely new memory location is written. Kills no read. The previous value at the given location must be either uninitialized or null. Writes to this location do not need a GC pre-barrier.
      Since:
      19.0
  • Constructor Details

  • Method Details

    • any

      public static LocationIdentity any()
      Indicates that the given location is the union of all possible mutable locations. A write to such a location kill all reads from mutable locations and a read from this location is killed by any write (except for initialization writes).
      Since:
      19.0
    • init

      public static LocationIdentity init()
      Location only allowed to be used for writes. Indicates that a completely new memory location is written. Kills no read. The previous value at the given location must be either uninitialized or null. Writes to this location do not need a GC pre-barrier.
      Since:
      19.0
    • isImmutable

      public abstract boolean isImmutable()
      Denotes a location is unchanging in all cases. Not that this is different than the Java notion of final which only requires definite assignment.
      Since:
      19.0
    • isMutable

      public final boolean isMutable()
      The inversion of isImmutable().
      Since:
      19.0
    • isAny

      public final boolean isAny()
      Returns true if this location identity is any().
      Since:
      19.0
    • isInit

      public final boolean isInit()
      Returns true if this location identity is init().
      Since:
      19.0
    • isSingle

      public final boolean isSingle()
      Returns true if this location identity is not any().
      Since:
      19.0
    • overlaps

      public final boolean overlaps(LocationIdentity other)
      Returns true if the memory slice denoted by this location identity may overlap with the provided other location identity.
      Since:
      19.0