Package org.graalvm.word
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
IdentityHashMap
s with LocationIdentity
values as keys.
- Since:
- 19.0
-
Field Summary
Modifier and TypeFieldDescriptionstatic final LocationIdentity
Indicates that the given location is the union of all possible mutable locations.static final LocationIdentity
Location only allowed to be used for writes. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic LocationIdentity
any()
Indicates that the given location is the union of all possible mutable locations.static LocationIdentity
init()
Location only allowed to be used for writes.final boolean
isAny()
Returns true if this location identity isany()
.abstract boolean
Denotes a location is unchanging in all cases.final boolean
isInit()
Returns true if this location identity isinit()
.final boolean
The inversion ofisImmutable()
.final boolean
isSingle()
Returns true if this location identity is notany()
.final boolean
overlaps
(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(java.lang.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
public final boolean isMutable()The inversion ofisImmutable()
.- Since:
- 19.0
-
isAny
public final boolean isAny()Returns true if this location identity isany()
.- Since:
- 19.0
-
isInit
public final boolean isInit()Returns true if this location identity isinit()
.- Since:
- 19.0
-
isSingle
public final boolean isSingle()Returns true if this location identity is notany()
.- Since:
- 19.0
-
overlaps
Returns true if the memory slice denoted by this location identity may overlap with the provided other location identity.- Since:
- 19.0
-