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) protected
PropertyImpl
(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 Property
copyWithFlags
(int newFlags) Create a copy of the property with the given flags.copyWithRelocatable
(boolean newRelocatable) boolean
final Object
get
(DynamicObject store, boolean condition) Gets the value of this property of the object.final Object
get
(DynamicObject store, Shape shape) Gets the value of this property of the object.int
getFlags()
Get property flags.final Object
getKey()
Get property identifier.final Location
Get the property location.int
hashCode()
final boolean
isHidden()
Is this property hidden from iteration.boolean
Returnstrue
if this property and some other property have the same key and flags.final boolean
isShadow()
Change the property's location.final void
set
(DynamicObject store, Object value, Shape shape) Assigns value to this property of the object.final void
set
(DynamicObject store, Object value, Shape oldShape, Shape newShape) Assigns value to this property of the object, changing the object's shape.final void
setGeneric
(DynamicObject store, Object value, Shape shape) Assigns value to this property of the object.final void
setGeneric
(DynamicObject store, Object value, Shape oldShape, Shape newShape) Assigns value to this property of the object, changing the object's shape.final void
setInternal
(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 void
setSafe
(DynamicObject store, Object value, Shape shape) LikeProperty.set(DynamicObject, Object, Shape)
, but throws anIllegalStateException
instead.final void
setSafe
(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:Property
Get property identifier. -
getFlags
public int getFlags()Description copied from class:Property
Get property flags. -
relocate
Description copied from class:Property
Change the property's location. -
get
Description copied from class:Property
Gets the value of this property of the object. -
get
Description copied from class:Property
Gets the value of this property of the object. -
setInternal
Description copied from class:Property
LikeProperty.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:
setInternal
in 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:Property
Assigns value to this property of the object. Throws an exception if the value cannot be assigned to the property's current location.- Specified by:
set
in 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:Property
LikeProperty.set(DynamicObject, Object, Shape)
, but throws anIllegalStateException
instead. -
setGeneric
Description copied from class:Property
Assigns value to this property of the object. Automatically relocates the property if the value cannot be assigned to its current location.- Specified by:
setGeneric
in classProperty
shape
- 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:Property
Assigns 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:
set
in 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:Property
Assigns 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:Property
Assigns 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:
setGeneric
in 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:Property
Returnstrue
if this property and some other property have the same key and flags. -
hashCode
public int hashCode() -
toString
-
getLocation
Description copied from class:Property
Get the property location.- Specified by:
getLocation
in classProperty
-
isHidden
public final boolean isHidden()Description copied from class:Property
Is this property hidden from iteration. -
isShadow
public final boolean isShadow() -
construct
-
copyWithFlags
Description copied from class:Property
Create a copy of the property with the given flags.- Specified by:
copyWithFlags
in classProperty
-
copyWithRelocatable
- Specified by:
copyWithRelocatable
in classProperty
-