Class LazyArray
LazyArray is a backing class for a JSArray that allows array elements to be supplied on demand
(i.e., lazily) from a list generator.
Whenever a lazy array is written to, the entire lazy array is enumerated and copied and loses its
lazy lookup property.
-
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
ConstructorsModifierConstructorDescriptionprotectedLazyArray(int integrityLevel, DynamicArray.DynamicArrayCache cache) -
Method Summary
Modifier and TypeMethodDescriptioncloneArray(JSDynamicObject object) static LazyArraycreateWriteableObject(JSDynamicObject object, long index, Object value, com.oracle.truffle.api.nodes.Node node, ScriptArray.CreateWritableProfileAccess profile) getElementInBounds(JSDynamicObject object, int index) getElementInBounds(JSDynamicObject object, int index, ListGetNode listGetNode) protected DynamicArraywithIntegrityLevel(int newIntegrityLevel) Methods inherited from class AbstractConstantLazyArray
addRangeImpl, createWriteableDouble, createWriteableInt, createWriteableJSObject, deleteElementImpl, hasElement, length, lengthInt, removeRangeImpl, setLengthImplMethods inherited from class AbstractConstantArray
firstElementIndex, getElement, getElementInBounds, hasHoles, isInBoundsFast, lastElementIndex, nextElementIndex, previousElementIndex, setElementImplMethods inherited from class DynamicArray
createCache, freeze, isExtensible, isFrozen, isLengthNotWritable, isSealed, maybePreinitializeCache, preventExtensions, seal, setIntegrityLevel, setLengthNotWritable, toStringMethods inherited from class ScriptArray
addRange, asIterable, canDeleteElement, cast, createConstantArray, createConstantEmptyArray, deleteElement, hasHolesOrUnused, isHolesType, isInstance, makeMultiRangeList, makeRangeList, nextPower, ownPropertyKeys, ownPropertyKeysContiguous, ownPropertyKeysHoles, removeRange, removeRange, setElement, setLength, setLength, shiftRange, shiftRangeImpl, toArray, traceArrayTransition, traceWrite, valueIsByte
-
Constructor Details
-
LazyArray
-
-
Method Details
-
createLazyArray
-
withIntegrityLevel
- Specified by:
withIntegrityLevelin classDynamicArray
-
getElementInBounds
- Specified by:
getElementInBoundsin classAbstractConstantArray
-
getElementInBounds
-
createWriteableObject
public AbstractWritableArray createWriteableObject(JSDynamicObject object, long index, Object value, com.oracle.truffle.api.nodes.Node node, ScriptArray.CreateWritableProfileAccess profile) - Specified by:
createWriteableObjectin classAbstractConstantArray
-
cloneArray
- Specified by:
cloneArrayin classDynamicArray
-