Package com.oracle.truffle.object
Class Locations.DualLocation
java.lang.Object
com.oracle.truffle.api.object.Location
com.oracle.truffle.object.LocationImpl
com.oracle.truffle.object.Locations.DualLocation
- All Implemented Interfaces:
BaseLocation
,TypedLocation
- Direct Known Subclasses:
Locations.DeclaredDualLocation
- Enclosing class:
- Locations
-
Nested Class Summary
Nested classes/interfaces inherited from class com.oracle.truffle.object.LocationImpl
LocationImpl.EffectivelyFinalLocation<T extends Location>, LocationImpl.InternalLongLocation, LocationImpl.TypedObjectLocation<T extends Location & ObjectLocation>
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final LayoutImpl
protected final ObjectLocation
protected final LocationImpl.InternalLongLocation
-
Constructor Summary
ConstructorsConstructorDescriptionDualLocation
(LocationImpl.InternalLongLocation primitiveLocation, ObjectLocation objectLocation, LayoutImpl layout) DualLocation
(LocationImpl.InternalLongLocation primitiveLocation, ObjectLocation objectLocation, LayoutImpl layout, Class<?> type) -
Method Summary
Modifier and TypeMethodDescriptionboolean
Returnstrue
if the location is compatible with the value.changeType
(Class<?> newType) boolean
get
(DynamicObject store, boolean condition) Get object value as object at this location in store.Class<?>
getType()
The type of this location.int
hashCode()
boolean
int
Get the number of object array elements this location requires.int
Get the number of in-objectObject
fields this location requires.int
Get the number of primitive array elements this location requires.int
Get the number of in-object primitive fields this location requires.void
setInternal
(DynamicObject store, Object value) LikeLocation.set(DynamicObject, Object, Shape)
, but does not invalidate final locations.toString()
Methods inherited from class com.oracle.truffle.object.LocationImpl
canSet, canStoreFinal, getInternal, getWhereString, isConstant, isFinal, set, valueEquals
Methods inherited from class com.oracle.truffle.api.object.Location
checkShape, finalLocation, get, incompatibleLocation, set, set
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface com.oracle.truffle.api.object.BaseLocation
get, set, set, set
-
Field Details
-
primitiveLocation
-
objectLocation
-
layout
-
-
Constructor Details
-
DualLocation
public DualLocation(LocationImpl.InternalLongLocation primitiveLocation, ObjectLocation objectLocation, LayoutImpl layout) -
DualLocation
public DualLocation(LocationImpl.InternalLongLocation primitiveLocation, ObjectLocation objectLocation, LayoutImpl layout, Class<?> type)
-
-
Method Details
-
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
- Overrides:
get
in classLocation
condition
- the result of a shape check orfalse
- See Also:
-
setInternal
Description copied from class:Location
LikeLocation.set(DynamicObject, Object, Shape)
, but does not invalidate final locations. For internal use only and subject to change, useDynamicObjectFactory
to create objects with predefined properties.- Specified by:
setInternal
in classLocationImpl
- Throws:
IncompatibleLocationException
- if value is of non-assignable type
-
primitiveFieldCount
public int primitiveFieldCount()Description copied from class:LocationImpl
Get the number of in-object primitive fields this location requires.- Overrides:
primitiveFieldCount
in classLocationImpl
-
primitiveArrayCount
public int primitiveArrayCount()Description copied from class:LocationImpl
Get the number of primitive array elements this location requires.- Overrides:
primitiveArrayCount
in classLocationImpl
-
objectFieldCount
public int objectFieldCount()Description copied from class:LocationImpl
Get the number of in-objectObject
fields this location requires.- Overrides:
objectFieldCount
in classLocationImpl
-
objectArrayCount
public int objectArrayCount()Description copied from class:LocationImpl
Get the number of object array elements this location requires.- Overrides:
objectArrayCount
in classLocationImpl
-
toString
- Overrides:
toString
in classLocationImpl
-
equals
- Overrides:
equals
in classLocationImpl
-
hashCode
public int hashCode()- Overrides:
hashCode
in classLocationImpl
-
getObjectLocation
-
changeType
-
getType
Description copied from interface:TypedLocation
The type of this location.- Specified by:
getType
in interfaceTypedLocation
-
isNonNull
public boolean isNonNull() -
canStore
Description copied from class:Location
Returnstrue
if the location is compatible with the value. The value may still be rejected ifLocation.canSet(DynamicObject, Object)
returns false.- Overrides:
canStore
in classLocationImpl
- Parameters:
value
- the value in question
-