Class JSArray
java.lang.Object
com.oracle.truffle.js.runtime.builtins.JSClass
com.oracle.truffle.js.runtime.builtins.JSNonProxy
com.oracle.truffle.js.runtime.builtins.JSAbstractArray
com.oracle.truffle.js.runtime.builtins.JSArray
- All Implemented Interfaces:
JSConstructorFactory, JSConstructorFactory.WithFunctions, JSConstructorFactory.WithFunctionsAndSpecies, PrototypeSupplier
public final class JSArray
extends JSAbstractArray
implements JSConstructorFactory.WithFunctionsAndSpecies, PrototypeSupplier
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface JSConstructorFactory
JSConstructorFactory.Default, JSConstructorFactory.WithFunctions, JSConstructorFactory.WithFunctionsAndSpecies -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.oracle.truffle.api.strings.TruffleStringstatic final JSArraystatic final com.oracle.truffle.api.strings.TruffleStringFields inherited from class JSAbstractArray
ARRAY_LENGTH_NOT_WRITABLE, ARRAY_PROTOTYPE_NO_ELEMENTS_INVALIDATION, CANNOT_REDEFINE_PROPERTY_LENGTH, DEFAULT_JSARRAY_COMPARATOR, DEFAULT_JSARRAY_DOUBLE_COMPARATOR, DEFAULT_JSARRAY_INTEGER_COMPARATOR, LAZY_REGEX_ORIGINAL_INPUT_ID, LAZY_REGEX_RESULT_ID, LENGTH, MAKE_SLOW_ARRAY_NEVER_PART_OF_COMPILATION_MESSAGEFields inherited from class JSNonProxy
GET_SYMBOL_SPECIES_NAME -
Method Summary
Modifier and TypeMethodDescriptionstatic JSArrayObjectcreate(JSContext context, JSRealm realm, DynamicArray arrayType, Object array, long length) static JSArrayObjectcreate(JSContext context, JSRealm realm, DynamicArray arrayType, Object array, long length, int usedLength) static JSArrayObjectcreate(JSContext context, JSRealm realm, DynamicArray arrayType, Object array, long length, int usedLength, int indexOffset, int arrayOffset) static JSArrayObjectcreate(JSContext context, JSRealm realm, DynamicArray arrayType, Object array, long length, int usedLength, int indexOffset, int arrayOffset, int holeCount) static JSArrayObjectcreate(JSContext context, JSRealm realm, JSDynamicObject proto, DynamicArray arrayType, Object array, long length) static JSArrayObjectcreate(JSContext context, JSRealm realm, JSDynamicObject proto, DynamicArray arrayType, Object array, long length, int usedLength) static JSArrayObjectcreate(JSContext context, JSRealm realm, JSDynamicObject proto, DynamicArray arrayType, Object array, long length, int usedLength, int indexOffset, int arrayOffset) static JSArrayObjectcreate(JSContext context, JSRealm realm, JSDynamicObject proto, DynamicArray arrayType, Object array, long length, int usedLength, int indexOffset, int arrayOffset, int holeCount) static JSArrayObjectcreateConstant(JSContext context, JSRealm realm, Object[] elements) static JSArrayObjectcreateConstantByteArray(JSContext context, JSRealm realm, byte[] byteArray) static JSArrayObjectcreateConstantDoubleArray(JSContext context, JSRealm realm, double[] doubleArray) static JSArrayObjectcreateConstantEmptyArray(JSContext context, JSRealm realm) static JSArrayObjectcreateConstantEmptyArray(JSContext context, JSRealm realm, int capacity) static JSArrayObjectcreateConstantEmptyArray(JSContext context, JSRealm realm, JSDynamicObject prototype, ArrayAllocationSite site) static JSArrayObjectcreateConstantEmptyArray(JSContext context, JSRealm realm, JSDynamicObject prototype, ArrayAllocationSite site, int capacity) static JSArrayObjectcreateConstantIntArray(JSContext context, JSRealm realm, int[] intArray) static JSArrayObjectcreateConstantObjectArray(JSContext context, JSRealm realm, Object[] objectArray) static JSConstructorcreateConstructor(JSRealm realm) static JSArrayObjectcreateDefaultProto(JSContext context, JSRealm realm, DynamicArray arrayType, Object array, ArrayAllocationSite site, long length, int usedLength, int indexOffset, int arrayOffset, int holeCount) static JSArrayObjectcreateEmpty(JSContext context, JSRealm realm, int length) static JSArrayObjectcreateEmptyChecked(JSContext context, JSRealm realm, long length) Creates an empty array of a certain size.static JSArrayObjectcreateEmptyChecked(JSContext context, JSRealm realm, JSDynamicObject proto, long length) static JSArrayObjectcreateEmptyZeroLength(JSContext context, JSRealm realm) static JSArrayObjectcreateLazyArray(JSContext context, JSRealm realm, List<?> list, int size) static JSArrayObjectcreateLazyRegexArray(JSContext context, JSRealm realm, int length) static JSArrayObjectcreateLazyRegexIndicesArray(JSContext context, JSRealm realm, int length) createPrototype(JSRealm realm, JSFunctionObject ctor) static JSArrayObjectcreateSparseArray(JSContext context, JSRealm realm, long length) static JSArrayObjectcreateSparseArray(JSContext context, JSRealm realm, JSDynamicObject proto, long length) static JSArrayObjectcreateWithProto(JSContext context, JSRealm realm, JSDynamicObject prototype, DynamicArray arrayType, Object array, ArrayAllocationSite site, long length, int usedLength, int indexOffset, int arrayOffset, int holeCount) static JSArrayObjectcreateZeroBasedDoubleArray(JSContext context, JSRealm realm, double[] doubleArray) static JSArrayObjectcreateZeroBasedDoubleArray(JSContext context, JSRealm realm, JSDynamicObject proto, double[] doubleArray) static JSArrayObjectcreateZeroBasedHolesObjectArray(JSContext context, JSRealm realm, Object[] objectArray, int usedLength, int arrayOffset, int holeCount) static JSArrayObjectcreateZeroBasedIntArray(JSContext context, JSRealm realm, int[] intArray) static JSArrayObjectcreateZeroBasedIntArray(JSContext context, JSRealm realm, JSDynamicObject proto, int[] intArray) static JSArrayObjectcreateZeroBasedJSObjectArray(JSContext context, JSRealm realm, JSDynamicObject[] objectArray) static JSArrayObjectcreateZeroBasedObjectArray(JSContext context, JSRealm realm, Object[] objectArray) com.oracle.truffle.api.strings.TruffleStringgetIntrinsicDefaultProto(JSRealm realm) Allows invokevirtual of this method instead of invokeinterface.getOwnPropertyKeys(JSDynamicObject thisObj, boolean strings, boolean symbols) GetOwnPropertyKeys (O, type).static booleanisArrayPrototype(JSDynamicObject object) static booleanstatic booleanstatic booleanisJSFastArray(Object obj) com.oracle.truffle.api.object.ShapemakeInitialShape(JSContext context, JSDynamicObject prototype) static booleansetLength(JSDynamicObject store, Object value, com.oracle.truffle.api.nodes.Node originatingNode) Methods inherited from class JSAbstractArray
arrayAccess, arrayGetAllocationSite, arrayGetArray, arrayGetArrayOffset, arrayGetArrayType, arrayGetHoleCount, arrayGetIndexOffset, arrayGetLength, arrayGetRegexResult, arrayGetRegexResultOriginalInput, arrayGetUsedLength, arraySetArray, arraySetArrayOffset, arraySetArrayType, arraySetHoleCount, arraySetIndexOffset, arraySetLength, arraySetLength, arraySetUsedLength, defineOwnProperty, defineOwnPropertyIndex, delete, delete, getLength, getOwnHelper, getOwnHelper, getOwnProperty, hasOwnProperty, hasOwnProperty, isSlowArray, makeSlowArray, ordinaryGetOwnPropertyArray, ownPropertyKeysFastArray, ownPropertyKeysSlowArray, preventExtensions, set, set, setLength, toArray, toArrayLengthOrRangeError, toArrayLengthOrRangeError, usesOrdinaryGetOwnPropertyMethods inherited from class JSNonProxy
checkProtoCycle, createSymbolSpeciesGetterFunction, deletePropertyDefault, getHelper, getHelper, getMethodHelper, getPrototypeOf, hasOnlyShapeProperties, hasProperty, hasProperty, invokeAccessorPropertySetter, isExtensible, ordinaryGetOwnProperty, ordinaryGetOwnPropertyIntl, ordinaryIsExtensible, ordinaryOwnPropertyKeys, ordinaryOwnPropertyKeys, ordinaryOwnPropertyKeysSlow, ordinaryPreventExtensions, ordinarySet, ordinarySetIndex, ordinarySetWithReceiver, performOrdinarySetWithOwnDescriptor, putConstructorSpeciesGetter, setIntegrityLevelFast, setPropertySlow, setPrototypeOf, testIntegrityLevelFast, usesOrdinaryIsExtensibleMethods inherited from class JSClass
filterOwnPropertyKeys, get, get, isInstance, isInstance, isInstance, isInstance, ownPropertyKeys, toStringMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface JSConstructorFactory
createConstructorObjectMethods inherited from interface JSConstructorFactory.WithFunctions
createConstructorAndPrototypeMethods inherited from interface JSConstructorFactory.WithFunctionsAndSpecies
fillConstructor
-
Field Details
-
CLASS_NAME
public static final com.oracle.truffle.api.strings.TruffleString CLASS_NAME -
PROTOTYPE_NAME
public static final com.oracle.truffle.api.strings.TruffleString PROTOTYPE_NAME -
INSTANCE
-
-
Method Details
-
createConstant
-
createEmpty
-
createEmptyChecked
Creates an empty array of a certain size. The size is expected to be within the valid range of JavaScript array sizes. -
createEmptyChecked
public static JSArrayObject createEmptyChecked(JSContext context, JSRealm realm, JSDynamicObject proto, long length) -
createEmptyZeroLength
-
create
public static JSArrayObject create(JSContext context, JSRealm realm, DynamicArray arrayType, Object array, long length) -
create
public static JSArrayObject create(JSContext context, JSRealm realm, DynamicArray arrayType, Object array, long length, int usedLength) -
create
public static JSArrayObject create(JSContext context, JSRealm realm, DynamicArray arrayType, Object array, long length, int usedLength, int indexOffset, int arrayOffset) -
create
public static JSArrayObject create(JSContext context, JSRealm realm, DynamicArray arrayType, Object array, long length, int usedLength, int indexOffset, int arrayOffset, int holeCount) -
create
public static JSArrayObject create(JSContext context, JSRealm realm, JSDynamicObject proto, DynamicArray arrayType, Object array, long length) -
create
public static JSArrayObject create(JSContext context, JSRealm realm, JSDynamicObject proto, DynamicArray arrayType, Object array, long length, int usedLength) -
create
public static JSArrayObject create(JSContext context, JSRealm realm, JSDynamicObject proto, DynamicArray arrayType, Object array, long length, int usedLength, int indexOffset, int arrayOffset) -
create
public static JSArrayObject create(JSContext context, JSRealm realm, JSDynamicObject proto, DynamicArray arrayType, Object array, long length, int usedLength, int indexOffset, int arrayOffset, int holeCount) -
createDefaultProto
public static JSArrayObject createDefaultProto(JSContext context, JSRealm realm, DynamicArray arrayType, Object array, ArrayAllocationSite site, long length, int usedLength, int indexOffset, int arrayOffset, int holeCount) -
createWithProto
public static JSArrayObject createWithProto(JSContext context, JSRealm realm, JSDynamicObject prototype, DynamicArray arrayType, Object array, ArrayAllocationSite site, long length, int usedLength, int indexOffset, int arrayOffset, int holeCount) -
isJSArray
-
isJSFastArray
-
isJSFastArray
-
getClassName
public com.oracle.truffle.api.strings.TruffleString getClassName()- Specified by:
getClassNamein interfaceJSConstructorFactory
-
createPrototype
- Specified by:
createPrototypein interfaceJSConstructorFactory
-
makeInitialShape
public com.oracle.truffle.api.object.Shape makeInitialShape(JSContext context, JSDynamicObject prototype) - Overrides:
makeInitialShapein classJSClass
-
getOwnPropertyKeys
Description copied from class:JSClassGetOwnPropertyKeys (O, type).- Overrides:
getOwnPropertyKeysin classJSAbstractArray- Returns:
- a List of the keys of all own properties of that object with the specified types
-
createConstructor
-
setLength
public static boolean setLength(JSDynamicObject store, Object value, com.oracle.truffle.api.nodes.Node originatingNode) -
createConstantEmptyArray
public static JSArrayObject createConstantEmptyArray(JSContext context, JSRealm realm, int capacity) -
createConstantEmptyArray
-
createConstantEmptyArray
public static JSArrayObject createConstantEmptyArray(JSContext context, JSRealm realm, JSDynamicObject prototype, ArrayAllocationSite site) -
createConstantEmptyArray
public static JSArrayObject createConstantEmptyArray(JSContext context, JSRealm realm, JSDynamicObject prototype, ArrayAllocationSite site, int capacity) -
createConstantByteArray
public static JSArrayObject createConstantByteArray(JSContext context, JSRealm realm, byte[] byteArray) -
createConstantIntArray
public static JSArrayObject createConstantIntArray(JSContext context, JSRealm realm, int[] intArray) -
createConstantDoubleArray
public static JSArrayObject createConstantDoubleArray(JSContext context, JSRealm realm, double[] doubleArray) -
createConstantObjectArray
public static JSArrayObject createConstantObjectArray(JSContext context, JSRealm realm, Object[] objectArray) -
createZeroBasedHolesObjectArray
public static JSArrayObject createZeroBasedHolesObjectArray(JSContext context, JSRealm realm, Object[] objectArray, int usedLength, int arrayOffset, int holeCount) -
createZeroBasedIntArray
public static JSArrayObject createZeroBasedIntArray(JSContext context, JSRealm realm, int[] intArray) -
createZeroBasedDoubleArray
public static JSArrayObject createZeroBasedDoubleArray(JSContext context, JSRealm realm, double[] doubleArray) -
createZeroBasedIntArray
public static JSArrayObject createZeroBasedIntArray(JSContext context, JSRealm realm, JSDynamicObject proto, int[] intArray) -
createZeroBasedDoubleArray
public static JSArrayObject createZeroBasedDoubleArray(JSContext context, JSRealm realm, JSDynamicObject proto, double[] doubleArray) -
createZeroBasedObjectArray
public static JSArrayObject createZeroBasedObjectArray(JSContext context, JSRealm realm, Object[] objectArray) -
createZeroBasedJSObjectArray
public static JSArrayObject createZeroBasedJSObjectArray(JSContext context, JSRealm realm, JSDynamicObject[] objectArray) -
createSparseArray
-
createSparseArray
public static JSArrayObject createSparseArray(JSContext context, JSRealm realm, JSDynamicObject proto, long length) -
createLazyRegexArray
-
createLazyRegexIndicesArray
public static JSArrayObject createLazyRegexIndicesArray(JSContext context, JSRealm realm, int length) -
createLazyArray
public static JSArrayObject createLazyArray(JSContext context, JSRealm realm, List<?> list, int size) -
getIntrinsicDefaultProto
Description copied from class:JSClassAllows invokevirtual of this method instead of invokeinterface. Classes overriding this method should implementPrototypeSupplier.- Specified by:
getIntrinsicDefaultProtoin interfacePrototypeSupplier- Overrides:
getIntrinsicDefaultProtoin classJSClass- See Also:
-
isArrayPrototype
-