Class ZeroBasedIntArray
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.AbstractIntArray
com.oracle.truffle.js.runtime.array.dyn.ZeroBasedIntArray
-
Nested Class Summary
Nested classes/interfaces inherited from class com.oracle.truffle.js.runtime.array.dyn.AbstractWritableArray
AbstractWritableArray.SetSupportedProfileAccessNested classes/interfaces inherited from class com.oracle.truffle.js.runtime.array.DynamicArray
DynamicArray.DynamicArrayCacheNested classes/interfaces inherited from class com.oracle.truffle.js.runtime.array.ScriptArray
ScriptArray.CreateWritableProfileAccess, ScriptArray.DefaultIterator, ScriptArray.SetLengthProfileAccess -
Field Summary
Fields inherited from class com.oracle.truffle.js.runtime.array.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 com.oracle.truffle.js.runtime.array.ScriptArray
EMPTY_OBJECT_ARRAY -
Method Summary
Modifier and TypeMethodDescriptionaddRangeImpl(JSDynamicObject object, long offset, int size) This method grows the array by adding more elements of a given size.static ZeroBasedIntArraylongfirstElementIndex(JSDynamicObject object) First element index (inclusive).intgetInBoundsFastInt(JSDynamicObject object, int index) booleanisSupported(JSDynamicObject object, long index) longlastElementIndex(JSDynamicObject object) Last element index (inclusive).static ZeroBasedIntArraymakeZeroBasedIntArray(JSDynamicObject object, int length, int usedLength, int[] array, int integrityLevel) longnextElementIndex(JSDynamicObject object, long index) Returns the next index.protected intprepareInBounds(JSDynamicObject object, int index, com.oracle.truffle.api.nodes.Node node, AbstractWritableArray.SetSupportedProfileAccess profile) protected intprepareInBoundsFast(JSDynamicObject object, long index) protected intprepareSupported(JSDynamicObject object, int index, com.oracle.truffle.api.nodes.Node node, AbstractWritableArray.SetSupportedProfileAccess profile) removeRangeImpl(JSDynamicObject object, long start, long end) This function deletes all elements in the range from [start..end[.voidsetInBoundsFast(JSDynamicObject object, int index, int value) protected voidsetLengthLess(JSDynamicObject object, long length, com.oracle.truffle.api.nodes.Node node, ScriptArray.SetLengthProfileAccess profile) shiftRangeImpl(JSDynamicObject object, long from) This function shifts all elements in the range from [0..limit[.toContiguous(JSDynamicObject object, long index, Object value) toDouble(JSDynamicObject object, long index, double value) toHoles(JSDynamicObject object, long index, Object value) toObject(JSDynamicObject object, long index, Object value) protected HolesObjectArraytoObjectHoles(JSDynamicObject object) protected ZeroBasedIntArraywithIntegrityLevel(int newIntegrityLevel) Methods inherited from class com.oracle.truffle.js.runtime.array.dyn.AbstractIntArray
allocateArray, cloneArray, containsHoleValue, convertToObject, deleteElementImpl, getArray, getArrayCapacity, getInBoundsFast, isHolePrepared, moveRangePrepared, resizeArray, setElementImpl, setHoleValue, setInBounds, setSupportedMethods inherited from class com.oracle.truffle.js.runtime.array.dyn.AbstractWritableArray
assertHoleCount, checkFillHoles, clearUnusedArea, containsHoles, countHoles, deleteElementHoles, fillHoles, getArrayOffset, getElement, getElementInBounds, getInBoundsFastDouble, getIndexOffset, getUsedLength, hasElement, hasHoles, hasHolesOrUnused, incrementHolesCount, isInBounds, isInBoundsFast, isSparse, isSupportedContiguous, isSupportedHoles, isSupportedZeroBased, length, lengthInt, nextElementIndexHoles, nextElementIndexZeroBased, prepareInBoundsContiguous, prepareInBoundsHoles, prepareInBoundsZeroBased, prepareSupportedContiguous, prepareSupportedHoles, prepareSupportedZeroBased, previousElementIndex, previousElementIndexHoles, removeRangeContiguous, removeRangeHoles, setArrayOffset, setArrayProperties, setArrayProperties, setIndexOffset, setLengthImpl, setLengthLessContiguous, setLengthLessZeroBased, toNonContiguous, toNonHoles, toSparse, traceWriteValue, unusedElementsAreHolesMethods inherited from class com.oracle.truffle.js.runtime.array.DynamicArray
createCache, freeze, isExtensible, isFrozen, isLengthNotWritable, isSealed, maybePreinitializeCache, preventExtensions, seal, setIntegrityLevel, setLengthNotWritable, toStringMethods inherited from class com.oracle.truffle.js.runtime.array.ScriptArray
addRange, asIterable, canDeleteElement, cast, createConstantArray, createConstantEmptyArray, deleteElement, isHolesType, isInstance, makeMultiRangeList, makeRangeList, nextPower, ownPropertyKeys, ownPropertyKeysContiguous, ownPropertyKeysHoles, removeRange, removeRange, setElement, setLength, setLength, shiftRange, toArray, traceArrayTransition, traceWrite, valueIsByte
-
Method Details
-
makeZeroBasedIntArray
public static ZeroBasedIntArray makeZeroBasedIntArray(JSDynamicObject object, int length, int usedLength, int[] array, int integrityLevel) -
createZeroBasedIntArray
-
isSupported
- Specified by:
isSupportedin classAbstractWritableArray
-
getInBoundsFastInt
- Specified by:
getInBoundsFastIntin classAbstractIntArray
-
setInBoundsFast
- Specified by:
setInBoundsFastin classAbstractIntArray
-
prepareInBoundsFast
- Specified by:
prepareInBoundsFastin classAbstractWritableArray
-
prepareInBounds
protected int prepareInBounds(JSDynamicObject object, int index, com.oracle.truffle.api.nodes.Node node, AbstractWritableArray.SetSupportedProfileAccess profile) - Specified by:
prepareInBoundsin classAbstractWritableArray
-
prepareSupported
protected int prepareSupported(JSDynamicObject object, int index, com.oracle.truffle.api.nodes.Node node, AbstractWritableArray.SetSupportedProfileAccess profile) - Specified by:
prepareSupportedin classAbstractWritableArray
-
setLengthLess
protected void setLengthLess(JSDynamicObject object, long length, com.oracle.truffle.api.nodes.Node node, ScriptArray.SetLengthProfileAccess profile) - Specified by:
setLengthLessin classAbstractWritableArray
-
toDouble
- Specified by:
toDoublein classAbstractWritableArray
-
toObject
- Specified by:
toObjectin classAbstractWritableArray
-
toContiguous
- Overrides:
toContiguousin classAbstractWritableArray
-
toHoles
- Specified by:
toHolesin classAbstractIntArray
-
toObjectHoles
- Specified by:
toObjectHolesin classAbstractIntArray
-
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
-
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
-
shiftRangeImpl
Description copied from class:ScriptArrayThis function shifts all elements in the range from [0..limit[. Depending on the underlying implementation, the shift operation might be zero-copy. Can be used by e.g. Array.prototype.shift;- Overrides:
shiftRangeImplin classAbstractWritableArray
-
addRangeImpl
Description copied from class:ScriptArrayThis method grows the array by adding more elements of a given size. An offset parameter can be used to specify where the new elements have to be added (starting from zero). The operation is equivalent to shifting (right) the whole array or its part as defined by the offset parameter.- Specified by:
addRangeImplin classScriptArray- Parameters:
offset- starting offset positionsize- size of the inserted empty array- Returns:
- a
ScriptArrayinstance with the new size
-
withIntegrityLevel
- Specified by:
withIntegrityLevelin classAbstractIntArray
-
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
-