Package com.oracle.truffle.api.object
Class Location
java.lang.Object
com.oracle.truffle.api.object.Location
Property location.
Planned to be deprecated.
- Since:
- 0.8 or earlier
- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Deprecated.boolean
Returnstrue
if the location is compatible with the type of the value.abstract boolean
Abstract to force overriding.protected static FinalLocationException
Deprecated.final Object
get
(DynamicObject store) Deprecated.get
(DynamicObject store, boolean condition) Deprecated.final Object
get
(DynamicObject store, Shape shape) Deprecated.If this is a constant location, returns the constant value bound to this location.protected double
getDouble
(DynamicObject store, boolean guard) Gets this location's value as double.Returns the assumption that this location is final.protected int
getInt
(DynamicObject store, boolean guard) Gets this location's value as int.protected long
getLong
(DynamicObject store, boolean guard) Gets this location's value as long.abstract int
hashCode()
Abstract to force overriding.protected static IncompatibleLocationException
Deprecated.boolean
Returnstrue
if this location is assumed to be final.boolean
Returnstrue
if this is a constant value location.boolean
Deprecated.No longer needed.boolean
isFinal()
Returnstrue
if this is a final location, i.e.boolean
Returnstrue
if this location can only store primitive types and cannot contain any object references.boolean
isValue()
Returnstrue
if this is a value location.void
set
(DynamicObject store, Object value, Shape shape) Deprecated.void
set
(DynamicObject store, Object value, Shape oldShape, Shape newShape) Deprecated.
-
Constructor Details
-
Location
protected Location()Constructor for subclasses.- Since:
- 0.8 or earlier
-
-
Method Details
-
incompatibleLocation
@Deprecated(since="22.2") protected static IncompatibleLocationException incompatibleLocation() throws IncompatibleLocationExceptionDeprecated.- Throws:
IncompatibleLocationException
- Since:
- 0.8 or earlier
-
finalLocation
@Deprecated(since="22.2") protected static FinalLocationException finalLocation() throws FinalLocationExceptionDeprecated.- Throws:
FinalLocationException
- Since:
- 0.8 or earlier
-
get
Deprecated.Get object value as object at this location in store.- Parameters:
shape
- the current shape of the object, which must contain this location- Since:
- 0.8 or earlier
-
get
Deprecated.Get object value as object at this location in store. For internal use only and subject to change, useget(DynamicObject, Shape)
instead.- Parameters:
store
- storage objectcondition
- the result of a shape check orfalse
- Since:
- 0.8 or earlier
- See Also:
-
get
Deprecated.Get object value as object at this location in store.- Since:
- 0.8 or earlier
-
getInt
Gets this location's value as int.- Parameters:
store
- storage objectguard
- the result of a shape check orfalse
- Throws:
UnexpectedResultException
- if the location does not contain an int value.- Since:
- 22.2
-
getLong
Gets this location's value as long.- Parameters:
store
- storage objectguard
- the result of a shape check orfalse
- Throws:
UnexpectedResultException
- if the location does not contain a long value.- Since:
- 22.2
-
getDouble
Gets this location's value as double.- Parameters:
store
- storage objectguard
- the result of a shape check orfalse
- Throws:
UnexpectedResultException
- if the location does not contain a double value.- Since:
- 22.2
-
set
@Deprecated(since="22.2") public void set(DynamicObject store, Object value, Shape shape) throws IncompatibleLocationException, FinalLocationException Deprecated.Set object value at this location in store.- Parameters:
store
- storage objectvalue
- the value to setshape
- the current shape of the storage object- Throws:
IncompatibleLocationException
- for storage type invalidationsFinalLocationException
- for effectively final fields- Since:
- 0.8 or earlier
-
set
@Deprecated(since="22.2") public void set(DynamicObject store, Object value, Shape oldShape, Shape newShape) throws IncompatibleLocationException Deprecated.Set object value at this location in store and update shape.- Parameters:
oldShape
- the shape before the transitionnewShape
- new shape after the transition- Throws:
IncompatibleLocationException
- if value is of non-assignable type- Since:
- 0.8 or earlier
-
canSet
Deprecated.Equivalent tocanStore(Object)
.Returnstrue
if the location can be set to the value.- Parameters:
value
- the value in question- Since:
- 0.8 or earlier
-
canStore
Returnstrue
if the location is compatible with the type of the value.- Parameters:
value
- the value in question- Since:
- 0.8 or earlier
-
isFinal
public boolean isFinal()Returnstrue
if this is a final location, i.e. readonly once set.- Since:
- 0.8 or earlier
-
isConstant
public boolean isConstant()Returnstrue
if this is a constant value location.- Since:
- 0.8 or earlier
-
hashCode
public abstract int hashCode()Abstract to force overriding. -
equals
Abstract to force overriding. -
isDeclared
Deprecated.No longer needed. Declared locations can only be created with deprecated APIs.Returnstrue
if this is a declared value location.- Since:
- 0.18
-
isValue
public boolean isValue()Returnstrue
if this is a value location.- Since:
- 0.18
- See Also:
-
isAssumedFinal
public boolean isAssumedFinal()Returnstrue
if this location is assumed to be final.- Since:
- 0.18
- See Also:
-
getFinalAssumption
Returns the assumption that this location is final.- Since:
- 0.18
- See Also:
-
isPrimitive
public boolean isPrimitive()Returnstrue
if this location can only store primitive types and cannot contain any object references.- Since:
- 22.2
-
getConstantValue
If this is a constant location, returns the constant value bound to this location. Otherwise, returns null.- Since:
- 22.2
-
canStore(Object)
.