Class AbstractConstantArray
java.lang.Object
com.oracle.truffle.js.runtime.array.ScriptArray
com.oracle.truffle.js.runtime.array.DynamicArray
com.oracle.truffle.js.runtime.array.dyn.AbstractConstantArray
- Direct Known Subclasses:
AbstractConstantEmptyArray, AbstractConstantLazyArray, ConstantByteArray, ConstantDoubleArray, ConstantIntArray, ConstantObjectArray
-
Nested Class Summary
Nested classes/interfaces inherited from class DynamicArray
DynamicArray.DynamicArrayCacheNested classes/interfaces inherited from class ScriptArray
ScriptArray.CreateWritableProfileAccess, ScriptArray.DefaultIterator, ScriptArray.SetLengthProfileAccess -
Field Summary
Fields inherited from class DynamicArray
cache, INTEGRITY_LEVEL_FROZEN, INTEGRITY_LEVEL_FROZEN_LENGTH_READONLY, INTEGRITY_LEVEL_MASK, INTEGRITY_LEVEL_NONE, INTEGRITY_LEVEL_NONE_LENGTH_READONLY, INTEGRITY_LEVEL_NOT_EXTENSIBLE, INTEGRITY_LEVEL_NOT_EXTENSIBLE_LENGTH_READONLY, INTEGRITY_LEVEL_SEALED, INTEGRITY_LEVEL_SEALED_LENGTH_READONLY, INTEGRITY_LEVELS, integrityLevel, LENGTH_NOT_WRITABLE, LENGTH_WRITABLE_MASKFields inherited from class ScriptArray
EMPTY_OBJECT_ARRAY -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractConstantArray(int integrityLevel, DynamicArray.DynamicArrayCache cache) -
Method Summary
Modifier and TypeMethodDescriptionabstract AbstractWritableArraycreateWriteableDouble(JSDynamicObject object, long index, double value, com.oracle.truffle.api.nodes.Node node, ScriptArray.CreateWritableProfileAccess profile) abstract AbstractWritableArraycreateWriteableInt(JSDynamicObject object, long index, int value, com.oracle.truffle.api.nodes.Node node, ScriptArray.CreateWritableProfileAccess profile) abstract AbstractWritableArraycreateWriteableJSObject(JSDynamicObject object, long index, JSDynamicObject value, com.oracle.truffle.api.nodes.Node node, ScriptArray.CreateWritableProfileAccess profile) abstract AbstractWritableArraycreateWriteableObject(JSDynamicObject object, long index, Object value, com.oracle.truffle.api.nodes.Node node, ScriptArray.CreateWritableProfileAccess profile) longfirstElementIndex(JSDynamicObject object) First element index (inclusive).final ObjectgetElement(JSDynamicObject object, long index) abstract ObjectgetElementInBounds(JSDynamicObject object, int index) final ObjectgetElementInBounds(JSDynamicObject object, long index) booleanhasHoles(JSDynamicObject object) Returns true when this array actually has holes betweenScriptArray.firstElementIndex(JSDynamicObject)andScriptArray.lastElementIndex(JSDynamicObject).final booleanisInBoundsFast(JSDynamicObject object, long index) Returns true if the index can be written using inBoundsFast access mode.longlastElementIndex(JSDynamicObject object) Last element index (inclusive).longnextElementIndex(JSDynamicObject object, long index) Returns the next index.longpreviousElementIndex(JSDynamicObject object, long index) Returns the previous index.final ScriptArraysetElementImpl(JSDynamicObject object, long index, Object value, boolean strict) Methods inherited from class DynamicArray
cloneArray, createCache, freeze, isExtensible, isFrozen, isLengthNotWritable, isSealed, maybePreinitializeCache, preventExtensions, seal, setIntegrityLevel, setLengthNotWritable, toString, withIntegrityLevelMethods inherited from class ScriptArray
addRange, addRangeImpl, asIterable, canDeleteElement, cast, createConstantArray, createConstantEmptyArray, deleteElement, deleteElementImpl, hasElement, hasHolesOrUnused, isHolesType, isInstance, length, lengthInt, makeMultiRangeList, makeRangeList, nextPower, ownPropertyKeys, ownPropertyKeysContiguous, ownPropertyKeysHoles, removeRange, removeRange, removeRangeImpl, setElement, setLength, setLength, setLengthImpl, shiftRange, shiftRangeImpl, toArray, traceArrayTransition, traceWrite, valueIsByte
-
Constructor Details
-
AbstractConstantArray
-
-
Method Details
-
setElementImpl
public final ScriptArray setElementImpl(JSDynamicObject object, long index, Object value, boolean strict) - Specified by:
setElementImplin classScriptArray
-
getElement
- Specified by:
getElementin classScriptArray
-
getElementInBounds
- Specified by:
getElementInBoundsin classScriptArray
-
getElementInBounds
-
firstElementIndex
Description copied from class:ScriptArrayFirst element index (inclusive).- Specified by:
firstElementIndexin classScriptArray
-
lastElementIndex
Description copied from class:ScriptArrayLast element index (inclusive).- Specified by:
lastElementIndexin classScriptArray
-
nextElementIndex
Description copied from class:ScriptArrayReturns the next index. The index is guaranteed either to exist, or be MAX_SAFE_INTEGER. Reason for MAX_SAFE_INTEGER is: this array could be the prototype of another one; returning the length() of this array would be wrong, if the inheriting array is longer, but has a hole at length().- Specified by:
nextElementIndexin classScriptArray
-
previousElementIndex
Description copied from class:ScriptArrayReturns the previous index. The index is guaranteed either to exist, or be smaller than firstElementIndex().- Specified by:
previousElementIndexin classScriptArray
-
isInBoundsFast
Returns true if the index can be written using inBoundsFast access mode.- Overrides:
isInBoundsFastin classScriptArray
-
createWriteableDouble
public abstract AbstractWritableArray createWriteableDouble(JSDynamicObject object, long index, double value, com.oracle.truffle.api.nodes.Node node, ScriptArray.CreateWritableProfileAccess profile) -
createWriteableInt
public abstract AbstractWritableArray createWriteableInt(JSDynamicObject object, long index, int value, com.oracle.truffle.api.nodes.Node node, ScriptArray.CreateWritableProfileAccess profile) -
createWriteableObject
public abstract AbstractWritableArray createWriteableObject(JSDynamicObject object, long index, Object value, com.oracle.truffle.api.nodes.Node node, ScriptArray.CreateWritableProfileAccess profile) -
createWriteableJSObject
public abstract AbstractWritableArray createWriteableJSObject(JSDynamicObject object, long index, JSDynamicObject value, com.oracle.truffle.api.nodes.Node node, ScriptArray.CreateWritableProfileAccess profile) -
hasHoles
Description copied from class:ScriptArrayReturns true when this array actually has holes betweenScriptArray.firstElementIndex(JSDynamicObject)andScriptArray.lastElementIndex(JSDynamicObject). ImpliesScriptArray.isHolesType().- Specified by:
hasHolesin classScriptArray- See Also:
-