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 TypeMethodDescriptionbooleancanSet(DynamicObject store, Object value) Returnstrueif the location can be set to the value.booleanReturnstrueif the location is compatible with the value.protected static booleancheckShape(DynamicObject store, Shape shape) abstract booleanprotected static FinalLocationExceptionget(DynamicObject store, boolean condition) Get object value as object at this location in store.final Objectget(DynamicObject store, Shape shape) Get object value as object at this location in store.protected abstract ObjectgetInternal(DynamicObject store) abstract inthashCode()protected static IncompatibleLocationExceptionbooleanReturnstrueif this is an immutable constant location.booleanisFinal()Returnstrueif this is a final location, i.e.final voidset(DynamicObject store, Object value) Set object value at this location in store.voidset(DynamicObject store, Object value, Shape shape) Set object value at this location in store.final voidset(DynamicObject store, Object value, Shape oldShape, Shape newShape) Set object value at this location in store and update shape.protected abstract voidsetInternal(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:BaseLocationGet object value as object at this location in store.- Specified by:
getin interfaceBaseLocationshape- the current shape of the object, which must contain this location
-
get
Description copied from interface:BaseLocationGet object value as object at this location in store. For internal use only and subject to change, useBaseLocation.get(DynamicObject, Shape)instead.- Specified by:
getin interfaceBaseLocationcondition- 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:BaseLocationSet object value at this location in store.- Specified by:
setin interfaceBaseLocationshape- 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:BaseLocationSet object value at this location in store and update shape.- Specified by:
setin interfaceBaseLocationoldShape- 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:BaseLocationSet object value at this location in store.- Specified by:
setin 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, useDynamicObjectFactoryto create objects with predefined properties.- Throws:
IncompatibleLocationException- if value is of non-assignable type
-
canSet
Returnstrueif the location can be set to the value.- Parameters:
store- the receiver objectvalue- the value in question
-
canStore
Returnstrueif 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()Returnstrueif this is a final location, i.e. readonly once set. -
isConstant
public boolean isConstant()Returnstrueif this is an immutable constant location. -
hashCode
public abstract int hashCode() -
equals
-
checkShape
-