Class LocationIdentity
java.lang.Object
org.graalvm.word.LocationIdentity
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 Summary
FieldsModifier and TypeFieldDescriptionstatic final LocationIdentityIndicates that the given location is the union of all possible mutable locations.static final LocationIdentityLocation only allowed to be used for writes. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic LocationIdentityany()Indicates that the given location is the union of all possible mutable locations.static LocationIdentityinit()Location only allowed to be used for writes.final booleanisAny()Returns true if this location identity isany().abstract booleanDenotes a location is unchanging in all cases.final booleanisInit()Returns true if this location identity isinit().final booleanThe inversion ofisImmutable().final booleanisSingle()Returns true if this location identity is notany().final booleanoverlaps(LocationIdentity other) Returns true if the memory slice denoted by this location identity may overlap with the provided other location identity.
-
Field Details
-
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
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
-
LocationIdentity
protected LocationIdentity()Creates a new location identity. Subclasses are responsible to provide proper implementations ofObject.equals(Object)andObject.hashCode().- Since:
- 19.0
-
-
Method Details
-
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
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
-
isAny
-
isInit
-
isSingle
-
overlaps
Returns true if the memory slice denoted by this location identity may overlap with the provided other location identity.- Since:
- 19.0
-