Package com.oracle.truffle.api.object
Class Location
java.lang.Object
com.oracle.truffle.api.object.Location
- All Implemented Interfaces:
BaseLocation
- Direct Known Subclasses:
LocationImpl
Property location.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
canSet
(DynamicObject store, Object value) Returnstrue
if the location can be set to the value.boolean
Returnstrue
if the location is compatible with the value.protected static boolean
checkShape
(DynamicObject store, Shape shape) abstract boolean
protected static FinalLocationException
get
(DynamicObject store, boolean condition) Get object value as object at this location in store.final Object
get
(DynamicObject store, Shape shape) Get object value as object at this location in store.protected abstract Object
getInternal
(DynamicObject store) abstract int
hashCode()
protected static IncompatibleLocationException
boolean
Returnstrue
if this is an immutable constant location.boolean
isFinal()
Returnstrue
if this is a final location, i.e.final void
set
(DynamicObject store, Object value) Set object value at this location in store.void
set
(DynamicObject store, Object value, Shape shape) Set object value at this location in store.final void
set
(DynamicObject store, Object value, Shape oldShape, Shape newShape) Set object value at this location in store and update shape.protected abstract void
setInternal
(DynamicObject store, Object value) Likeset(DynamicObject, Object, Shape)
, but does not invalidate final locations.
-
Constructor Details
-
Location
public Location()
-
-
Method Details
-
incompatibleLocation
protected static IncompatibleLocationException incompatibleLocation() throws IncompatibleLocationException- Throws:
IncompatibleLocationException
-
finalLocation
- Throws:
FinalLocationException
-
get
Description copied from interface:BaseLocation
Get object value as object at this location in store.- Specified by:
get
in interfaceBaseLocation
shape
- the current shape of the object, which must contain this location
-
get
Description copied from interface:BaseLocation
Get object value as object at this location in store. For internal use only and subject to change, useBaseLocation.get(DynamicObject, Shape)
instead.- Specified by:
get
in interfaceBaseLocation
condition
- the result of a shape check orfalse
- See Also:
-
set
public void set(DynamicObject store, Object value, Shape shape) throws IncompatibleLocationException, FinalLocationException Description copied from interface:BaseLocation
Set object value at this location in store.- Specified by:
set
in interfaceBaseLocation
shape
- the current shape of the storage object- Throws:
IncompatibleLocationException
- for storage type invalidationsFinalLocationException
- for effectively final fields
-
set
public final void set(DynamicObject store, Object value, Shape oldShape, Shape newShape) throws IncompatibleLocationException Description copied from interface:BaseLocation
Set object value at this location in store and update shape.- Specified by:
set
in interfaceBaseLocation
oldShape
- the shape before the transitionnewShape
- new shape after the transition- Throws:
IncompatibleLocationException
- if value is of non-assignable type
-
set
public final void set(DynamicObject store, Object value) throws IncompatibleLocationException, FinalLocationException Description copied from interface:BaseLocation
Set object value at this location in store.- Specified by:
set
in interfaceBaseLocation
- Throws:
IncompatibleLocationException
- for storage type invalidationsFinalLocationException
- for effectively final fields
-
getInternal
-
setInternal
protected abstract void setInternal(DynamicObject store, Object value) throws IncompatibleLocationException Likeset(DynamicObject, Object, Shape)
, but does not invalidate final locations. For internal use only and subject to change, useDynamicObjectFactory
to create objects with predefined properties.- Throws:
IncompatibleLocationException
- if value is of non-assignable type
-
canSet
Returnstrue
if the location can be set to the value.- Parameters:
store
- the receiver objectvalue
- the value in question
-
canStore
Returnstrue
if the location is compatible with the value. The value may still be rejected ifcanSet(DynamicObject, Object)
returns false.- Parameters:
value
- the value in question
-
isFinal
public boolean isFinal()Returnstrue
if this is a final location, i.e. readonly once set. -
isConstant
public boolean isConstant()Returnstrue
if this is an immutable constant location. -
hashCode
public abstract int hashCode() -
equals
-
checkShape
-