Package com.oracle.truffle.object
Class PropertyImpl
java.lang.Object
com.oracle.truffle.api.object.Property
com.oracle.truffle.object.PropertyImpl
Property objects represent the mapping between low-level stores and high-level data. The simplest
Property could be nothing more than a map of one index to one property's value, but abstracting
the interface allows for getter/setter methods, type-checked properties, and other such
specialized and language-specific behavior. ECMAScript[8.6.1]
-
Constructor Summary
ConstructorsModifierConstructorDescriptionPropertyImpl(Object name, Location location, int flags) protectedPropertyImpl(Object key, Location location, int flags, boolean shadow, boolean relocatable) Generic, usual-case constructor for properties storing at least a name. -
Method Summary
Modifier and TypeMethodDescriptionprotected PropertycopyWithFlags(int newFlags) Create a copy of the property with the given flags.copyWithRelocatable(boolean newRelocatable) booleanfinal Objectget(DynamicObject store, boolean condition) Gets the value of this property of the object.final Objectget(DynamicObject store, Shape shape) Gets the value of this property of the object.intgetFlags()Get property flags.final ObjectgetKey()Get property identifier.final LocationGet the property location.inthashCode()final booleanisHidden()Is this property hidden from iteration.booleanReturnstrueif this property and some other property have the same key and flags.final booleanisShadow()Change the property's location.final voidset(DynamicObject store, Object value, Shape shape) Assigns value to this property of the object.final voidset(DynamicObject store, Object value, Shape oldShape, Shape newShape) Assigns value to this property of the object, changing the object's shape.final voidsetGeneric(DynamicObject store, Object value, Shape shape) Assigns value to this property of the object.final voidsetGeneric(DynamicObject store, Object value, Shape oldShape, Shape newShape) Assigns value to this property of the object, changing the object's shape.final voidsetInternal(DynamicObject store, Object value) LikeProperty.setSafe(com.oracle.truffle.api.object.DynamicObject, java.lang.Object, com.oracle.truffle.api.object.Shape), but ignores the finalness of the property.final voidsetSafe(DynamicObject store, Object value, Shape shape) LikeProperty.set(DynamicObject, Object, Shape), but throws anIllegalStateExceptioninstead.final voidsetSafe(DynamicObject store, Object value, Shape oldShape, Shape newShape) Assigns value to this property of the object, changing the object's shape.toString()
-
Constructor Details
-
Method Details
-
getKey
Description copied from class:PropertyGet property identifier. -
getFlags
public int getFlags()Description copied from class:PropertyGet property flags. -
relocate
Description copied from class:PropertyChange the property's location. -
get
Description copied from class:PropertyGets the value of this property of the object. -
get
Description copied from class:PropertyGets the value of this property of the object. -
setInternal
Description copied from class:PropertyLikeProperty.setSafe(com.oracle.truffle.api.object.DynamicObject, java.lang.Object, com.oracle.truffle.api.object.Shape), but ignores the finalness of the property. For internal use only.- Specified by:
setInternalin classProperty- Parameters:
store- the store that this property resides invalue- the value to assign
-
set
public final void set(DynamicObject store, Object value, Shape shape) throws IncompatibleLocationException, FinalLocationException Description copied from class:PropertyAssigns value to this property of the object. Throws an exception if the value cannot be assigned to the property's current location.- Specified by:
setin classProperty- Parameters:
store- the store that this property resides invalue- the value to assignshape- the current shape of the object ornull- Throws:
IncompatibleLocationException- if the value is incompatible with the property locationFinalLocationException- if the location is final and values differ- See Also:
-
setSafe
Description copied from class:PropertyLikeProperty.set(DynamicObject, Object, Shape), but throws anIllegalStateExceptioninstead. -
setGeneric
Description copied from class:PropertyAssigns value to this property of the object. Automatically relocates the property if the value cannot be assigned to its current location.- Specified by:
setGenericin classPropertyshape- the current shape of the object ornull
-
set
public final void set(DynamicObject store, Object value, Shape oldShape, Shape newShape) throws IncompatibleLocationException Description copied from class:PropertyAssigns value to this property of the object, changing the object's shape. CombinesDynamicObject.setShapeAndGrow(Shape, Shape)andProperty.set(DynamicObject, Object, Shape)to an atomic operation.- Specified by:
setin classProperty- Parameters:
store- the store that this property resides invalue- the value to assignoldShape- the shape before the transitionnewShape- the shape after the transition- Throws:
IncompatibleLocationException- if the value is incompatible with the property location
-
setSafe
Description copied from class:PropertyAssigns value to this property of the object, changing the object's shape. CombinesDynamicObject.setShapeAndGrow(Shape, Shape)andProperty.setSafe(DynamicObject, Object, Shape)to an atomic operation. -
setGeneric
Description copied from class:PropertyAssigns value to this property of the object, changing the object's shape. CombinesDynamicObject.setShapeAndGrow(Shape, Shape)andProperty.setGeneric(DynamicObject, Object, Shape)to an atomic operation.- Specified by:
setGenericin classProperty- Parameters:
store- the store that this property resides invalue- the value to assignoldShape- the shape before the transitionnewShape- the shape after the transition
-
equals
-
isSame
Description copied from class:PropertyReturnstrueif this property and some other property have the same key and flags. -
hashCode
public int hashCode() -
toString
-
getLocation
Description copied from class:PropertyGet the property location.- Specified by:
getLocationin classProperty
-
isHidden
public final boolean isHidden()Description copied from class:PropertyIs this property hidden from iteration. -
isShadow
public final boolean isShadow() -
construct
-
copyWithFlags
Description copied from class:PropertyCreate a copy of the property with the given flags.- Specified by:
copyWithFlagsin classProperty
-
copyWithRelocatable
- Specified by:
copyWithRelocatablein classProperty
-