Class HolesJSObjectArray
java.lang.Object
com.oracle.truffle.js.runtime.array.ScriptArray
com.oracle.truffle.js.runtime.array.DynamicArray
com.oracle.truffle.js.runtime.array.dyn.AbstractWritableArray
com.oracle.truffle.js.runtime.array.dyn.AbstractJSObjectArray
com.oracle.truffle.js.runtime.array.dyn.AbstractContiguousJSObjectArray
com.oracle.truffle.js.runtime.array.dyn.HolesJSObjectArray
-
Nested Class Summary
Nested classes/interfaces inherited from class AbstractWritableArray
AbstractWritableArray.SetSupportedProfileAccessNested 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 -
Method Summary
Modifier and TypeMethodDescriptionprotected JSDynamicObjectcastNonNull(JSDynamicObject value) booleancontainsHoles(JSDynamicObject object, long index) deleteElementImpl(JSDynamicObject object, long index, boolean strict) getInBoundsFast(JSDynamicObject object, int index) booleanhasElement(JSDynamicObject object, long index) booleanhasHoles(JSDynamicObject object) Returns true when this array actually has holes betweenScriptArray.firstElementIndex(JSDynamicObject)andScriptArray.lastElementIndex(JSDynamicObject).booleanisHoleFast(JSDynamicObject object, int index) booleanReturns true if this array type could have hole values in it.static booleanisHoleValue(JSDynamicObject value) booleanisSupported(JSDynamicObject object, long index) static HolesJSObjectArraymakeHolesJSObjectArray(JSDynamicObject object, int length, JSDynamicObject[] array, long indexOffset, int arrayOffset, int usedLength, int holeCount, int integrityLevel) longnextElementIndex(JSDynamicObject object, long index0) Returns the next index.ownPropertyKeys(JSDynamicObject object) intprepareInBounds(JSDynamicObject object, int index, com.oracle.truffle.api.nodes.Node node, AbstractWritableArray.SetSupportedProfileAccess profile) intprepareSupported(JSDynamicObject object, int index, com.oracle.truffle.api.nodes.Node node, AbstractWritableArray.SetSupportedProfileAccess profile) longpreviousElementIndex(JSDynamicObject object, long index0) Returns the previous index.removeRangeImpl(JSDynamicObject object, long start, long end) This function deletes all elements in the range from [start..end[.voidsetInBoundsFast(JSDynamicObject object, int index, JSDynamicObject value) voidsetInBoundsFastHole(JSDynamicObject object, int index, JSDynamicObject value) voidsetInBoundsFastNonHole(JSDynamicObject object, int index, JSDynamicObject value) toHoles(JSDynamicObject object, long index, Object value) toNonHoles(JSDynamicObject object, long index, Object value) toObject(JSDynamicObject object, long index, Object value) protected HolesJSObjectArraywithIntegrityLevel(int newIntegrityLevel) Methods inherited from class AbstractContiguousJSObjectArray
addRangeImpl, firstElementIndex, getArrayOffset, getInBoundsFastJSObject, getIndexOffset, lastElementIndex, prepareInBoundsFast, setArrayOffset, setIndexOffset, setLengthLessMethods inherited from class AbstractJSObjectArray
allocateArray, checkNonNull, cloneArray, fillHoles, getArray, getArrayCapacity, isHolePrepared, moveRangePrepared, resizeArray, setElementImpl, setHoleValue, setInBounds, setSupported, toDoubleMethods inherited from class AbstractWritableArray
assertHoleCount, checkFillHoles, clearUnusedArea, countHoles, deleteElementHoles, getElement, getElementInBounds, getInBoundsFastDouble, getInBoundsFastInt, getUsedLength, hasHolesOrUnused, incrementHolesCount, isInBounds, isInBoundsFast, isSparse, isSupportedContiguous, isSupportedHoles, isSupportedZeroBased, length, lengthInt, nextElementIndexHoles, nextElementIndexZeroBased, prepareInBoundsContiguous, prepareInBoundsHoles, prepareInBoundsZeroBased, prepareSupportedContiguous, prepareSupportedHoles, prepareSupportedZeroBased, previousElementIndexHoles, removeRangeContiguous, removeRangeHoles, setArrayProperties, setArrayProperties, setLengthImpl, setLengthLessContiguous, setLengthLessZeroBased, shiftRangeImpl, toContiguous, toNonContiguous, toSparse, traceWriteValue, unusedElementsAreHolesMethods 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, isInstance, makeMultiRangeList, makeRangeList, nextPower, ownPropertyKeysContiguous, ownPropertyKeysHoles, removeRange, removeRange, setElement, setLength, setLength, shiftRange, toArray, traceArrayTransition, traceWrite, valueIsByte
-
Method Details
-
makeHolesJSObjectArray
public static HolesJSObjectArray makeHolesJSObjectArray(JSDynamicObject object, int length, JSDynamicObject[] array, long indexOffset, int arrayOffset, int usedLength, int holeCount, int integrityLevel) -
setInBoundsFast
- Overrides:
setInBoundsFastin classAbstractContiguousJSObjectArray
-
isHoleFast
-
setInBoundsFastHole
-
setInBoundsFastNonHole
-
containsHoles
- Overrides:
containsHolesin classAbstractWritableArray
-
toNonHoles
- Overrides:
toNonHolesin classAbstractWritableArray
-
toObject
- Specified by:
toObjectin classAbstractJSObjectArray
-
prepareInBounds
public int prepareInBounds(JSDynamicObject object, int index, com.oracle.truffle.api.nodes.Node node, AbstractWritableArray.SetSupportedProfileAccess profile) - Specified by:
prepareInBoundsin classAbstractWritableArray
-
isSupported
- Specified by:
isSupportedin classAbstractWritableArray
-
prepareSupported
public int prepareSupported(JSDynamicObject object, int index, com.oracle.truffle.api.nodes.Node node, AbstractWritableArray.SetSupportedProfileAccess profile) - Specified by:
prepareSupportedin classAbstractWritableArray
-
getInBoundsFast
- Overrides:
getInBoundsFastin classAbstractJSObjectArray
-
toHoles
- Specified by:
toHolesin classAbstractJSObjectArray
-
isHoleValue
-
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().- Overrides:
nextElementIndexin classAbstractWritableArray
-
previousElementIndex
Description copied from class:ScriptArrayReturns the previous index. The index is guaranteed either to exist, or be smaller than firstElementIndex().- Overrides:
previousElementIndexin classAbstractWritableArray
-
hasElement
- Overrides:
hasElementin classAbstractWritableArray- Returns:
- true if array has an element (not a hole) at this index.
-
deleteElementImpl
- Overrides:
deleteElementImplin classAbstractJSObjectArray
-
isHolesType
public boolean isHolesType()Description copied from class:ScriptArrayReturns true if this array type could have hole values in it. Doesn't tell whether it actually HAS holes.- Overrides:
isHolesTypein classScriptArray
-
hasHoles
Description copied from class:ScriptArrayReturns true when this array actually has holes betweenScriptArray.firstElementIndex(JSDynamicObject)andScriptArray.lastElementIndex(JSDynamicObject). ImpliesScriptArray.isHolesType().- Overrides:
hasHolesin classAbstractWritableArray- See Also:
-
removeRangeImpl
Description copied from class:ScriptArrayThis function deletes all elements in the range from [start..end[. This is equivalent to shifting the whole array, starting with element index end, by end-start positions to the left. Can be used by e.g. Array.prototype.splice;- Specified by:
removeRangeImplin classScriptArray
-
castNonNull
- Overrides:
castNonNullin classAbstractJSObjectArray
-
withIntegrityLevel
- Specified by:
withIntegrityLevelin classAbstractJSObjectArray
-
ownPropertyKeys
- Overrides:
ownPropertyKeysin classScriptArray
-