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
public static class Locations.DualLocation extends LocationImpl implements TypedLocation
-
-
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
Fields Modifier and Type Field Description protected LayoutImpllayoutprotected ObjectLocationobjectLocationprotected LocationImpl.InternalLongLocationprimitiveLocation
-
Constructor Summary
Constructors Constructor Description DualLocation(LocationImpl.InternalLongLocation primitiveLocation, ObjectLocation objectLocation, LayoutImpl layout)DualLocation(LocationImpl.InternalLongLocation primitiveLocation, ObjectLocation objectLocation, LayoutImpl layout, java.lang.Class<?> type)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancanStore(java.lang.Object value)Returnstrueif the location is compatible with the value.Locations.DualLocationchangeType(java.lang.Class<?> newType)booleanequals(java.lang.Object obj)java.lang.Objectget(DynamicObject store, boolean condition)Get object value as object at this location in store.ObjectLocationgetObjectLocation()java.lang.Class<?>getType()The type of this location.inthashCode()booleanisNonNull()intobjectArrayCount()Get the number of object array elements this location requires.intobjectFieldCount()Get the number of in-objectObjectfields this location requires.intprimitiveArrayCount()Get the number of primitive array elements this location requires.intprimitiveFieldCount()Get the number of in-object primitive fields this location requires.voidsetInternal(DynamicObject store, java.lang.Object value)LikeLocation.set(DynamicObject, Object, Shape), but does not invalidate final locations.java.lang.StringtoString()-
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 Detail
-
primitiveLocation
protected final LocationImpl.InternalLongLocation primitiveLocation
-
objectLocation
protected final ObjectLocation objectLocation
-
layout
protected final LayoutImpl layout
-
-
Constructor Detail
-
DualLocation
public DualLocation(LocationImpl.InternalLongLocation primitiveLocation, ObjectLocation objectLocation, LayoutImpl layout)
-
DualLocation
public DualLocation(LocationImpl.InternalLongLocation primitiveLocation, ObjectLocation objectLocation, LayoutImpl layout, java.lang.Class<?> type)
-
-
Method Detail
-
get
public java.lang.Object get(DynamicObject store, boolean condition)
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 interfaceBaseLocation- Overrides:
getin classLocationcondition- the result of a shape check orfalse- See Also:
BaseLocation.get(DynamicObject, Shape)
-
setInternal
public void setInternal(DynamicObject store, java.lang.Object value) throws IncompatibleLocationException
Description copied from class:LocationLikeLocation.set(DynamicObject, Object, Shape), but does not invalidate final locations. For internal use only and subject to change, useDynamicObjectFactoryto create objects with predefined properties.- Specified by:
setInternalin classLocationImpl- Throws:
IncompatibleLocationException- if value is of non-assignable type
-
primitiveFieldCount
public int primitiveFieldCount()
Description copied from class:LocationImplGet the number of in-object primitive fields this location requires.- Overrides:
primitiveFieldCountin classLocationImpl
-
primitiveArrayCount
public int primitiveArrayCount()
Description copied from class:LocationImplGet the number of primitive array elements this location requires.- Overrides:
primitiveArrayCountin classLocationImpl
-
objectFieldCount
public int objectFieldCount()
Description copied from class:LocationImplGet the number of in-objectObjectfields this location requires.- Overrides:
objectFieldCountin classLocationImpl
-
objectArrayCount
public int objectArrayCount()
Description copied from class:LocationImplGet the number of object array elements this location requires.- Overrides:
objectArrayCountin classLocationImpl
-
toString
public java.lang.String toString()
- Overrides:
toStringin classLocationImpl
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classLocationImpl
-
hashCode
public int hashCode()
- Overrides:
hashCodein classLocationImpl
-
getObjectLocation
public ObjectLocation getObjectLocation()
-
changeType
public Locations.DualLocation changeType(java.lang.Class<?> newType)
-
getType
public java.lang.Class<?> getType()
Description copied from interface:TypedLocationThe type of this location.- Specified by:
getTypein interfaceTypedLocation
-
isNonNull
public boolean isNonNull()
-
canStore
public boolean canStore(java.lang.Object value)
Description copied from class:LocationReturnstrueif the location is compatible with the value. The value may still be rejected ifLocation.canSet(DynamicObject, Object)returns false.- Overrides:
canStorein classLocationImpl- Parameters:
value- the value in question
-
-