diff --git a/dom/serviceworkers/test/test_serviceworker_interfaces.js b/dom/serviceworkers/test/test_serviceworker_interfaces.js index 229ba3610e8a..377db644d942 100644 --- a/dom/serviceworkers/test/test_serviceworker_interfaces.js +++ b/dom/serviceworkers/test/test_serviceworker_interfaces.js @@ -28,6 +28,8 @@ var ecmaGlobals = {name: "Atomics", disabled: true}, "Boolean", {name: "BigInt", nightly: true}, + {name: "BigInt64Array", nightly: true}, + {name: "BigUint64Array", nightly: true}, {name: "ByteLengthQueuingStrategy", optional: true}, {name: "CountQueuingStrategy", optional: true}, "DataView", diff --git a/dom/tests/mochitest/general/test_interfaces.js b/dom/tests/mochitest/general/test_interfaces.js index 56fb3122a449..ccbb432690a7 100644 --- a/dom/tests/mochitest/general/test_interfaces.js +++ b/dom/tests/mochitest/general/test_interfaces.js @@ -45,6 +45,8 @@ var ecmaGlobals = {name: "ArrayBuffer", insecureContext: true}, {name: "Atomics", insecureContext: true, disabled: true}, {name: "BigInt", insecureContext: true, nightly: true}, + {name: "BigInt64Array", insecureContext: true, nightly: true}, + {name: "BigUint64Array", insecureContext: true, nightly: true}, {name: "Boolean", insecureContext: true}, {name: "ByteLengthQueuingStrategy", insecureContext: true}, {name: "CountQueuingStrategy", insecureContext: true}, diff --git a/dom/workers/test/test_worker_interfaces.js b/dom/workers/test/test_worker_interfaces.js index a8dc17d40d98..ede2c5cc2791 100644 --- a/dom/workers/test/test_worker_interfaces.js +++ b/dom/workers/test/test_worker_interfaces.js @@ -33,6 +33,8 @@ var ecmaGlobals = {name: "ArrayBuffer", insecureContext: true}, {name: "Atomics", insecureContext: true, disabled: true}, {name: "BigInt", insecureContext: true, nightly: true}, + {name: "BigInt64Array", insecureContext: true, nightly: true}, + {name: "BigUint64Array", insecureContext: true, nightly: true}, {name: "Boolean", insecureContext: true}, {name: "ByteLengthQueuingStrategy", insecureContext: true}, {name: "CountQueuingStrategy", insecureContext: true}, diff --git a/js/public/ProtoKey.h b/js/public/ProtoKey.h index 3e3f77d23064..075f676e8cb1 100644 --- a/js/public/ProtoKey.h +++ b/js/public/ProtoKey.h @@ -90,6 +90,8 @@ REAL(Float32Array, InitViaClassSpec, TYPED_ARRAY_CLASP(Float32)) \ REAL(Float64Array, InitViaClassSpec, TYPED_ARRAY_CLASP(Float64)) \ REAL(Uint8ClampedArray, InitViaClassSpec, TYPED_ARRAY_CLASP(Uint8Clamped)) \ + REAL(BigInt64Array, InitViaClassSpec, TYPED_ARRAY_CLASP(BigInt64)) \ + REAL(BigUint64Array, InitViaClassSpec, TYPED_ARRAY_CLASP(BigUint64)) \ REAL(BigInt, InitViaClassSpec, OCLASP(BigInt)) \ REAL(Proxy, InitProxyClass, &js::ProxyClass) \ REAL(WeakMap, InitViaClassSpec, OCLASP(WeakMap)) \ diff --git a/js/src/builtin/Array.cpp b/js/src/builtin/Array.cpp index 8f93924ab69f..f954f137d0e5 100644 --- a/js/src/builtin/Array.cpp +++ b/js/src/builtin/Array.cpp @@ -450,10 +450,9 @@ bool js::GetElements(JSContext* cx, HandleObject aobj, uint32_t length, } if (aobj->is()) { - TypedArrayObject* typedArray = &aobj->as(); + Handle typedArray = aobj.as(); if (typedArray->length() == length) { - typedArray->getElements(vp); - return true; + return TypedArrayObject::getElements(cx, typedArray, vp); } } diff --git a/js/src/builtin/Object.cpp b/js/src/builtin/Object.cpp index a4039a51783a..6a5e9bb22d7d 100644 --- a/js/src/builtin/Object.cpp +++ b/js/src/builtin/Object.cpp @@ -1333,10 +1333,14 @@ static bool TryEnumerableOwnPropertiesNative(JSContext* cx, HandleObject obj, kind == EnumerableOwnPropertiesKind::Names) { value.setString(str); } else if (kind == EnumerableOwnPropertiesKind::Values) { - value.set(tobj->getElement(i)); + if (!tobj->getElement(cx, i, &value)) { + return false; + } } else { key.setString(str); - value.set(tobj->getElement(i)); + if (!tobj->getElement(cx, i, &value)) { + return false; + } if (!NewValuePair(cx, key, value, &value)) { return false; } @@ -1543,7 +1547,10 @@ static bool EnumerableOwnProperties(JSContext* cx, const JS::CallArgs& args) { if (obj->is()) { HandleNativeObject nobj = obj.as(); if (JSID_IS_INT(id) && nobj->containsDenseElement(JSID_TO_INT(id))) { - value = nobj->getDenseOrTypedArrayElement(JSID_TO_INT(id)); + if (!nobj->getDenseOrTypedArrayElement(cx, JSID_TO_INT(id), + &value)) { + return false; + } } else { shape = nobj->lookup(cx, id); if (!shape || !shape->enumerable()) { diff --git a/js/src/builtin/SelfHostingDefines.h b/js/src/builtin/SelfHostingDefines.h index abb79e83c53c..825c6848e978 100644 --- a/js/src/builtin/SelfHostingDefines.h +++ b/js/src/builtin/SelfHostingDefines.h @@ -152,5 +152,7 @@ #define TYPEDARRAY_KIND_FLOAT32 6 #define TYPEDARRAY_KIND_FLOAT64 7 #define TYPEDARRAY_KIND_UINT8CLAMPED 8 +#define TYPEDARRAY_KIND_BIGINT64 9 +#define TYPEDARRAY_KIND_BIGUINT64 10 #endif diff --git a/js/src/builtin/TypedArray.js b/js/src/builtin/TypedArray.js index 67c09142fb53..5098dbb5b3cf 100644 --- a/js/src/builtin/TypedArray.js +++ b/js/src/builtin/TypedArray.js @@ -351,7 +351,12 @@ function TypedArrayFill(value, start = 0, end = undefined) { var len = TypedArrayLength(O); // Step 4. - value = ToNumber(value); + var kind = GetTypedArrayKind(O); + if (kind === TYPEDARRAY_KIND_BIGINT64 || kind === TYPEDARRAY_KIND_BIGUINT64) { + value = ToBigInt(value); + } else { + value = ToNumber(value); + } // Step 5. var relativeStart = ToInteger(start); @@ -1142,8 +1147,9 @@ function TypedArraySome(callbackfn/*, thisArg*/) { // as opposed to the ordering in the spec. function TypedArrayCompare(x, y) { // Step 1. - assert(typeof x === "number" && typeof y === "number", - "x and y are not numbers."); + assert((typeof x === "number" && typeof y === "number") || + (typeof x === "bigint" && typeof y === "bigint"), + "x and y are not numbers of the same type."); // Step 2 (Implemented in TypedArraySort). @@ -1188,6 +1194,29 @@ function TypedArrayCompareInt(x, y) { return 0; } +// https://tc39.github.io/proposal-bigint/#sec-%typedarray%.prototype.sort +// TypedArray SortCompare specialization for BigInt values. +function TypedArrayCompareBigInt(x, y) { + // Step 1. + assert(typeof x === "bigint" && typeof y === "bigint", + "x and y are not BigInts."); + + // Step 2 (Implemented in TypedArraySort). + + // Step 6. + if (x < y) + return -1; + + // Step 7. + if (x > y) + return 1; + + // Steps 3-5, 8-9 (Not applicable when sorting BigInt values). + + // Step 10. + return 0; +} + // ES2019 draft rev 8a16cb8d18660a1106faae693f0f39b9f1a30748 // 22.2.3.26 %TypedArray%.prototype.sort ( comparefn ) function TypedArraySort(comparefn) { @@ -1248,6 +1277,9 @@ function TypedArraySort(comparefn) { return RadixSort(obj, len, buffer, 4 /* nbytes */, true /* signed */, false /* floating */, TypedArrayCompareInt); + case TYPEDARRAY_KIND_BIGINT64: + case TYPEDARRAY_KIND_BIGUINT64: + return QuickSort(obj, len, TypedArrayCompareBigInt); case TYPEDARRAY_KIND_FLOAT32: return RadixSort(obj, len, buffer, 4 /* nbytes */, true /* signed */, true /* floating */, diff --git a/js/src/builtin/TypedObject.h b/js/src/builtin/TypedObject.h index 599e91f5b5c4..7d8c168cc6c6 100644 --- a/js/src/builtin/TypedObject.h +++ b/js/src/builtin/TypedObject.h @@ -248,6 +248,12 @@ class ScalarTypeDescr : public SimpleTypeDescr { static_assert( Scalar::Uint32 == JS_SCALARTYPEREPR_UINT32, "TypedObjectConstants.h must be consistent with Scalar::Type"); + static_assert( + Scalar::BigInt64 == JS_SCALARTYPEREPR_BIGINT64, + "TypedObjectConstants.h must be consistent with Scalar::Type"); + static_assert( + Scalar::BigUint64 == JS_SCALARTYPEREPR_BIGUINT64, + "TypedObjectConstants.h must be consistent with Scalar::Type"); static_assert( Scalar::Float32 == JS_SCALARTYPEREPR_FLOAT32, "TypedObjectConstants.h must be consistent with Scalar::Type"); @@ -275,7 +281,9 @@ class ScalarTypeDescr : public SimpleTypeDescr { MACRO_(Scalar::Int32, int32_t, int32) \ MACRO_(Scalar::Uint32, uint32_t, uint32) \ MACRO_(Scalar::Float32, float, float32) \ - MACRO_(Scalar::Float64, double, float64) + MACRO_(Scalar::Float64, double, float64) \ + MACRO_(Scalar::BigInt64, int64_t, bigint64) \ + MACRO_(Scalar::BigUint64, uint64_t, biguint64) // Must be in same order as the enum ScalarTypeDescr::Type: #define JS_FOR_EACH_SCALAR_TYPE_REPR(MACRO_) \ diff --git a/js/src/builtin/TypedObjectConstants.h b/js/src/builtin/TypedObjectConstants.h index fa45d7b9ca1a..e4cfa7dc5bea 100644 --- a/js/src/builtin/TypedObjectConstants.h +++ b/js/src/builtin/TypedObjectConstants.h @@ -92,6 +92,8 @@ #define JS_SCALARTYPEREPR_FLOAT32 6 #define JS_SCALARTYPEREPR_FLOAT64 7 #define JS_SCALARTYPEREPR_UINT8_CLAMPED 8 +#define JS_SCALARTYPEREPR_BIGINT64 9 +#define JS_SCALARTYPEREPR_BIGUINT64 10 // These constants are for use exclusively in JS code. In C++ code, // prefer ReferenceTypeRepresentation::TYPE_ANY etc, which allows diff --git a/js/src/jit/BaselineIC.cpp b/js/src/jit/BaselineIC.cpp index 6aea77d6b763..effbb953b463 100644 --- a/js/src/jit/BaselineIC.cpp +++ b/js/src/jit/BaselineIC.cpp @@ -2405,6 +2405,9 @@ void StoreToTypedArray(JSContext* cx, MacroAssembler& masm, Scalar::Type type, masm.unboxDouble(value, FloatReg0); masm.clampDoubleToUint8(FloatReg0, scratch); masm.jump(&clamped); + } else if (type == Scalar::BigInt64 || type == Scalar::BigUint64) { + // FIXME: https://bugzil.la/1536703 + masm.jump(failure); } else { Label notInt32; masm.branchTestInt32(Assembler::NotEqual, value, ¬Int32); diff --git a/js/src/jit/CodeGenerator.cpp b/js/src/jit/CodeGenerator.cpp index 9809372e47e2..e72b235b0cc3 100644 --- a/js/src/jit/CodeGenerator.cpp +++ b/js/src/jit/CodeGenerator.cpp @@ -7586,11 +7586,11 @@ void CodeGenerator::visitTypedArrayElementShift(LTypedArrayElementShift* lir) { Register out = ToRegister(lir->output()); static_assert(Scalar::Int8 == 0, "Int8 is the first typed array class"); - static_assert((Scalar::Uint8Clamped - Scalar::Int8) == - Scalar::MaxTypedArrayViewType - 1, - "Uint8Clamped is the last typed array class"); + static_assert( + (Scalar::BigUint64 - Scalar::Int8) == Scalar::MaxTypedArrayViewType - 1, + "BigUint64 is the last typed array class"); - Label zero, one, two, done; + Label zero, one, two, three, done; masm.loadObjClassUnsafe(obj, out); @@ -7611,13 +7611,22 @@ void CodeGenerator::visitTypedArrayElementShift(LTypedArrayElementShift* lir) { static_assert(ValidateShiftRange(Scalar::Float64, Scalar::Uint8Clamped), "shift amount is three in [Float64, Uint8Clamped)"); - static_assert( - ValidateShiftRange(Scalar::Uint8Clamped, Scalar::MaxTypedArrayViewType), - "shift amount is zero in [Uint8Clamped, MaxTypedArrayViewType)"); - masm.branchPtr(Assembler::AboveOrEqual, out, + masm.branchPtr(Assembler::Below, out, ImmPtr(TypedArrayObject::classForType(Scalar::Uint8Clamped)), + &three); + + static_assert(ValidateShiftRange(Scalar::Uint8Clamped, Scalar::BigInt64), + "shift amount is zero in [Uint8Clamped, BigInt64)"); + masm.branchPtr(Assembler::Below, out, + ImmPtr(TypedArrayObject::classForType(Scalar::BigInt64)), &zero); + static_assert( + ValidateShiftRange(Scalar::BigInt64, Scalar::MaxTypedArrayViewType), + "shift amount is three in [BigInt64, MaxTypedArrayViewType)"); + // Fall through for BigInt64 and BigUint64 + + masm.bind(&three); masm.move32(Imm32(3), out); masm.jump(&done); @@ -12981,13 +12990,14 @@ void CodeGenerator::visitIsTypedArray(LIsTypedArray* lir) { Label done; static_assert(Scalar::Int8 == 0, "Int8 is the first typed array class"); - static_assert((Scalar::Uint8Clamped - Scalar::Int8) == - Scalar::MaxTypedArrayViewType - 1, - "Uint8Clamped is the last typed array class"); const Class* firstTypedArrayClass = TypedArrayObject::classForType(Scalar::Int8); + + static_assert( + (Scalar::BigUint64 - Scalar::Int8) == Scalar::MaxTypedArrayViewType - 1, + "BigUint64 is the last typed array class"); const Class* lastTypedArrayClass = - TypedArrayObject::classForType(Scalar::Uint8Clamped); + TypedArrayObject::classForType(Scalar::BigUint64); masm.loadObjClassUnsafe(object, output); masm.branchPtr(Assembler::Below, output, ImmPtr(firstTypedArrayClass), diff --git a/js/src/jit/IonTypes.h b/js/src/jit/IonTypes.h index fda878fee456..e7003400b773 100644 --- a/js/src/jit/IonTypes.h +++ b/js/src/jit/IonTypes.h @@ -693,25 +693,9 @@ static inline MIRType ScalarTypeToMIRType(Scalar::Type type) { return MIRType::Float32; case Scalar::Float64: return MIRType::Double; - case Scalar::MaxTypedArrayViewType: - break; - } - MOZ_CRASH("unexpected kind"); -} - -static inline unsigned ScalarTypeToLength(Scalar::Type type) { - switch (type) { - case Scalar::Int8: - case Scalar::Uint8: - case Scalar::Int16: - case Scalar::Uint16: - case Scalar::Int32: - case Scalar::Uint32: - case Scalar::Int64: - case Scalar::Float32: - case Scalar::Float64: - case Scalar::Uint8Clamped: - return 1; + case Scalar::BigInt64: + case Scalar::BigUint64: + MOZ_CRASH("NYI"); case Scalar::MaxTypedArrayViewType: break; } diff --git a/js/src/jit/MIR.cpp b/js/src/jit/MIR.cpp index d1ef9a0d6e50..0fc1c32d896e 100644 --- a/js/src/jit/MIR.cpp +++ b/js/src/jit/MIR.cpp @@ -5655,7 +5655,14 @@ bool jit::ElementAccessIsTypedArray(CompilerConstraintList* constraints, } *arrayType = types->getTypedArrayType(constraints); - return *arrayType != Scalar::MaxTypedArrayViewType; + + // FIXME: https://bugzil.la/1536699 + if (*arrayType == Scalar::MaxTypedArrayViewType || + Scalar::isBigIntType(*arrayType)) { + return false; + } + + return true; } bool jit::ElementAccessIsPacked(CompilerConstraintList* constraints, diff --git a/js/src/jit/MIR.h b/js/src/jit/MIR.h index 21a395d8b8b1..76f8fcbb849a 100644 --- a/js/src/jit/MIR.h +++ b/js/src/jit/MIR.h @@ -12216,6 +12216,9 @@ inline MIRType MIRTypeForTypedArrayRead(Scalar::Type arrayType, return MIRType::Float32; case Scalar::Float64: return MIRType::Double; + case Scalar::BigInt64: + case Scalar::BigUint64: + return MIRType::BigInt; default: break; } diff --git a/js/src/jit/MacroAssembler-inl.h b/js/src/jit/MacroAssembler-inl.h index c32fe4380d37..c24089dd57e6 100644 --- a/js/src/jit/MacroAssembler-inl.h +++ b/js/src/jit/MacroAssembler-inl.h @@ -704,7 +704,7 @@ void MacroAssembler::canonicalizeFloat(FloatRegister reg) { void MacroAssembler::canonicalizeFloatIfDeterministic(FloatRegister reg) { #ifdef JS_MORE_DETERMINISTIC - // See the comment in TypedArrayObjectTemplate::getIndexValue. + // See the comment in TypedArrayObjectTemplate::getElement. canonicalizeFloat(reg); #endif // JS_MORE_DETERMINISTIC } @@ -718,7 +718,7 @@ void MacroAssembler::canonicalizeDouble(FloatRegister reg) { void MacroAssembler::canonicalizeDoubleIfDeterministic(FloatRegister reg) { #ifdef JS_MORE_DETERMINISTIC - // See the comment in TypedArrayObjectTemplate::getIndexValue. + // See the comment in TypedArrayObjectTemplate::getElement. canonicalizeDouble(reg); #endif // JS_MORE_DETERMINISTIC } diff --git a/js/src/jit/MacroAssembler.cpp b/js/src/jit/MacroAssembler.cpp index 4790e6881f3c..04181de9f176 100644 --- a/js/src/jit/MacroAssembler.cpp +++ b/js/src/jit/MacroAssembler.cpp @@ -400,6 +400,11 @@ void MacroAssembler::loadFromTypedArray(Scalar::Type arrayType, const T& src, branchTest32(Assembler::Signed, dest.gpr(), dest.gpr(), fail); } break; + case Scalar::BigInt64: + case Scalar::BigUint64: + // FIXME: https://bugzil.la/1536702 + jump(fail); + break; case Scalar::Float32: loadFloat32(src, dest.fpu()); canonicalizeFloat(dest.fpu()); @@ -483,6 +488,12 @@ void MacroAssembler::loadFromTypedArray(Scalar::Type arrayType, const T& src, boxDouble(fpscratch, dest, fpscratch); break; } + // FIXME: https://bugzil.la/1536702 + case Scalar::BigInt64: + case Scalar::BigUint64: { + jump(fail); + break; + } default: MOZ_CRASH("Invalid typed array type"); } diff --git a/js/src/jit/RangeAnalysis.cpp b/js/src/jit/RangeAnalysis.cpp index 2900387a0bb9..56182ea30d03 100644 --- a/js/src/jit/RangeAnalysis.cpp +++ b/js/src/jit/RangeAnalysis.cpp @@ -1733,6 +1733,8 @@ static Range* GetTypedArrayRange(TempAllocator& alloc, Scalar::Type type) { case Scalar::Int32: return Range::NewInt32Range(alloc, INT32_MIN, INT32_MAX); + case Scalar::BigInt64: + case Scalar::BigUint64: case Scalar::Int64: case Scalar::Float32: case Scalar::Float64: diff --git a/js/src/jit/arm64/MacroAssembler-arm64.cpp b/js/src/jit/arm64/MacroAssembler-arm64.cpp index 83199c65d0d9..765d9048b2d4 100644 --- a/js/src/jit/arm64/MacroAssembler-arm64.cpp +++ b/js/src/jit/arm64/MacroAssembler-arm64.cpp @@ -349,6 +349,8 @@ void MacroAssemblerCompat::wasmLoadImpl(const wasm::MemoryAccessDesc& access, Ldr(SelectFPReg(outany, out64, 64), srcAddr); break; case Scalar::Uint8Clamped: + case Scalar::BigInt64: + case Scalar::BigUint64: case Scalar::MaxTypedArrayViewType: MOZ_CRASH("unexpected array type"); } @@ -405,6 +407,8 @@ void MacroAssemblerCompat::wasmStoreImpl(const wasm::MemoryAccessDesc& access, Str(SelectFPReg(valany, val64, 64), dstAddr); break; case Scalar::Uint8Clamped: + case Scalar::BigInt64: + case Scalar::BigUint64: case Scalar::MaxTypedArrayViewType: MOZ_CRASH("unexpected array type"); } diff --git a/js/src/jit/x64/CodeGenerator-x64.cpp b/js/src/jit/x64/CodeGenerator-x64.cpp index a42cda54c36d..d2aafc8c071a 100644 --- a/js/src/jit/x64/CodeGenerator-x64.cpp +++ b/js/src/jit/x64/CodeGenerator-x64.cpp @@ -383,6 +383,8 @@ void CodeGeneratorX64::wasmStore(const wasm::MemoryAccessDesc& access, case Scalar::Float32: case Scalar::Float64: case Scalar::Uint8Clamped: + case Scalar::BigInt64: + case Scalar::BigUint64: case Scalar::MaxTypedArrayViewType: MOZ_CRASH("unexpected array type"); } diff --git a/js/src/jit/x64/Lowering-x64.cpp b/js/src/jit/x64/Lowering-x64.cpp index 083ccef41c39..47b7392b3160 100644 --- a/js/src/jit/x64/Lowering-x64.cpp +++ b/js/src/jit/x64/Lowering-x64.cpp @@ -206,6 +206,8 @@ void LIRGenerator::visitWasmStore(MWasmStore* ins) { case Scalar::Float64: valueAlloc = useRegisterAtStart(value); break; + case Scalar::BigInt64: + case Scalar::BigUint64: case Scalar::Uint8Clamped: case Scalar::MaxTypedArrayViewType: MOZ_CRASH("unexpected array type"); diff --git a/js/src/jit/x64/MacroAssembler-x64.cpp b/js/src/jit/x64/MacroAssembler-x64.cpp index 3ad5f6e17af4..30ad955fa541 100644 --- a/js/src/jit/x64/MacroAssembler-x64.cpp +++ b/js/src/jit/x64/MacroAssembler-x64.cpp @@ -612,6 +612,8 @@ void MacroAssembler::wasmLoad(const wasm::MemoryAccessDesc& access, break; case Scalar::Int64: MOZ_CRASH("int64 loads must use load64"); + case Scalar::BigInt64: + case Scalar::BigUint64: case Scalar::Uint8Clamped: case Scalar::MaxTypedArrayViewType: MOZ_CRASH("unexpected array type"); @@ -652,6 +654,8 @@ void MacroAssembler::wasmLoadI64(const wasm::MemoryAccessDesc& access, case Scalar::Float64: MOZ_CRASH("non-int64 loads should use load()"); case Scalar::Uint8Clamped: + case Scalar::BigInt64: + case Scalar::BigUint64: case Scalar::MaxTypedArrayViewType: MOZ_CRASH("unexpected array type"); } @@ -687,6 +691,8 @@ void MacroAssembler::wasmStore(const wasm::MemoryAccessDesc& access, storeUncanonicalizedDouble(value.fpu(), dstAddr); break; case Scalar::Uint8Clamped: + case Scalar::BigInt64: + case Scalar::BigUint64: case Scalar::MaxTypedArrayViewType: MOZ_CRASH("unexpected array type"); } diff --git a/js/src/jit/x86-shared/CodeGenerator-x86-shared.cpp b/js/src/jit/x86-shared/CodeGenerator-x86-shared.cpp index 85aaf24cce31..0656b4b84932 100644 --- a/js/src/jit/x86-shared/CodeGenerator-x86-shared.cpp +++ b/js/src/jit/x86-shared/CodeGenerator-x86-shared.cpp @@ -413,6 +413,8 @@ void CodeGeneratorX86Shared::visitOutOfLineLoadTypedArrayOutOfBounds( OutOfLineLoadTypedArrayOutOfBounds* ool) { switch (ool->viewType()) { case Scalar::Int64: + case Scalar::BigInt64: + case Scalar::BigUint64: case Scalar::MaxTypedArrayViewType: MOZ_CRASH("unexpected array type"); case Scalar::Float32: diff --git a/js/src/jit/x86-shared/Lowering-x86-shared.cpp b/js/src/jit/x86-shared/Lowering-x86-shared.cpp index f615330a6dfe..26fd11989921 100644 --- a/js/src/jit/x86-shared/Lowering-x86-shared.cpp +++ b/js/src/jit/x86-shared/Lowering-x86-shared.cpp @@ -358,6 +358,8 @@ void LIRGenerator::visitAsmJSStoreHeap(MAsmJSStoreHeap* ins) { case Scalar::Int64: MOZ_CRASH("NYI"); case Scalar::Uint8Clamped: + case Scalar::BigInt64: + case Scalar::BigUint64: case Scalar::MaxTypedArrayViewType: MOZ_CRASH("unexpected array type"); } diff --git a/js/src/jit/x86/Lowering-x86.cpp b/js/src/jit/x86/Lowering-x86.cpp index 11fa135a7012..5234f22e6fc9 100644 --- a/js/src/jit/x86/Lowering-x86.cpp +++ b/js/src/jit/x86/Lowering-x86.cpp @@ -378,6 +378,8 @@ void LIRGenerator::visitWasmStore(MWasmStore* ins) { return; } case Scalar::Uint8Clamped: + case Scalar::BigInt64: + case Scalar::BigUint64: case Scalar::MaxTypedArrayViewType: MOZ_CRASH("unexpected array type"); } diff --git a/js/src/jit/x86/MacroAssembler-x86.cpp b/js/src/jit/x86/MacroAssembler-x86.cpp index bbaa5bd6dd31..28f9aaf794fa 100644 --- a/js/src/jit/x86/MacroAssembler-x86.cpp +++ b/js/src/jit/x86/MacroAssembler-x86.cpp @@ -629,6 +629,8 @@ void MacroAssembler::wasmLoad(const wasm::MemoryAccessDesc& access, break; case Scalar::Int64: case Scalar::Uint8Clamped: + case Scalar::BigInt64: + case Scalar::BigUint64: case Scalar::MaxTypedArrayViewType: MOZ_CRASH("unexpected type"); } @@ -700,6 +702,8 @@ void MacroAssembler::wasmLoadI64(const wasm::MemoryAccessDesc& access, case Scalar::Float64: MOZ_CRASH("non-int64 loads should use load()"); case Scalar::Uint8Clamped: + case Scalar::BigInt64: + case Scalar::BigUint64: case Scalar::MaxTypedArrayViewType: MOZ_CRASH("unexpected array type"); } @@ -738,6 +742,8 @@ void MacroAssembler::wasmStore(const wasm::MemoryAccessDesc& access, case Scalar::Int64: MOZ_CRASH("Should be handled in storeI64."); case Scalar::MaxTypedArrayViewType: + case Scalar::BigInt64: + case Scalar::BigUint64: MOZ_CRASH("unexpected type"); } diff --git a/js/src/jsfriendapi.h b/js/src/jsfriendapi.h index 64fa86f8bbed..053c1efd1597 100644 --- a/js/src/jsfriendapi.h +++ b/js/src/jsfriendapi.h @@ -1414,12 +1414,15 @@ extern JS_FRIEND_API uint64_t GetSCOffset(JSStructuredCloneWriter* writer); namespace Scalar { -/** - * Scalar types that can appear in typed arrays and typed objects. The enum - * values must to be kept in sync with the JS_SCALARTYPEREPR_ constants, as - * well as the TypedArrayObject::classes and TypedArrayObject::protoClasses - * definitions. - */ +// Scalar types that can appear in typed arrays and typed objects. +// The enum values must be kept in sync with: +// * the JS_SCALARTYPEREPR constants +// * the TYPEDARRAY_KIND constants +// * the SCTAG_TYPED_ARRAY constants +// * JS_FOR_EACH_TYPEDARRAY +// * JS_FOR_PROTOTYPES_ +// * JS_FOR_EACH_UNIQUE_SCALAR_TYPE_REPR_CTYPE +// * JIT compilation enum Type { Int8 = 0, Uint8, @@ -1436,6 +1439,9 @@ enum Type { */ Uint8Clamped, + BigInt64, + BigUint64, + /** * Types that don't have their own TypedArray equivalent, for now. */ @@ -1459,10 +1465,13 @@ static inline size_t byteSize(Type atype) { return 4; case Int64: case Float64: + case BigInt64: + case BigUint64: return 8; - default: - MOZ_CRASH("invalid scalar type"); + case MaxTypedArrayViewType: + break; } + MOZ_CRASH("invalid scalar type"); } static inline bool isSignedIntType(Type atype) { @@ -1471,6 +1480,7 @@ static inline bool isSignedIntType(Type atype) { case Int16: case Int32: case Int64: + case BigInt64: return true; case Uint8: case Uint8Clamped: @@ -1478,10 +1488,34 @@ static inline bool isSignedIntType(Type atype) { case Uint32: case Float32: case Float64: + case BigUint64: return false; - default: - MOZ_CRASH("invalid scalar type"); + case MaxTypedArrayViewType: + break; } + MOZ_CRASH("invalid scalar type"); +} + +static inline bool isBigIntType(Type atype) { + switch (atype) { + case BigInt64: + case BigUint64: + return true; + case Int8: + case Int16: + case Int32: + case Int64: + case Uint8: + case Uint8Clamped: + case Uint16: + case Uint32: + case Float32: + case Float64: + return false; + case MaxTypedArrayViewType: + break; + } + MOZ_CRASH("invalid scalar type"); } } /* namespace Scalar */ @@ -1568,6 +1602,12 @@ extern JS_FRIEND_API JSObject* JS_NewInt32ArrayWithBuffer( extern JS_FRIEND_API JSObject* JS_NewUint32ArrayWithBuffer( JSContext* cx, JS::HandleObject arrayBuffer, uint32_t byteOffset, int32_t length); +extern JS_FRIEND_API JSObject* JS_NewBigInt64ArrayWithBuffer( + JSContext* cx, JS::HandleObject arrayBuffer, uint32_t byteOffset, + int32_t length); +extern JS_FRIEND_API JSObject* JS_NewBigUint64ArrayWithBuffer( + JSContext* cx, JS::HandleObject arrayBuffer, uint32_t byteOffset, + int32_t length); extern JS_FRIEND_API JSObject* JS_NewFloat32ArrayWithBuffer( JSContext* cx, JS::HandleObject arrayBuffer, uint32_t byteOffset, int32_t length); @@ -1630,6 +1670,8 @@ extern JS_FRIEND_API JSObject* UnwrapInt16Array(JSObject* obj); extern JS_FRIEND_API JSObject* UnwrapUint16Array(JSObject* obj); extern JS_FRIEND_API JSObject* UnwrapInt32Array(JSObject* obj); extern JS_FRIEND_API JSObject* UnwrapUint32Array(JSObject* obj); +extern JS_FRIEND_API JSObject* UnwrapBigInt64Array(JSObject* obj); +extern JS_FRIEND_API JSObject* UnwrapBigUint64Array(JSObject* obj); extern JS_FRIEND_API JSObject* UnwrapFloat32Array(JSObject* obj); extern JS_FRIEND_API JSObject* UnwrapFloat64Array(JSObject* obj); @@ -1646,6 +1688,8 @@ extern JS_FRIEND_DATA const Class* const Int16ArrayClassPtr; extern JS_FRIEND_DATA const Class* const Uint16ArrayClassPtr; extern JS_FRIEND_DATA const Class* const Int32ArrayClassPtr; extern JS_FRIEND_DATA const Class* const Uint32ArrayClassPtr; +extern JS_FRIEND_DATA const Class* const BigInt64ArrayClassPtr; +extern JS_FRIEND_DATA const Class* const BigUint64ArrayClassPtr; extern JS_FRIEND_DATA const Class* const Float32ArrayClassPtr; extern JS_FRIEND_DATA const Class* const Float64ArrayClassPtr; diff --git a/js/src/tests/jstests.list b/js/src/tests/jstests.list index e441bda00c60..44e9eded238d 100644 --- a/js/src/tests/jstests.list +++ b/js/src/tests/jstests.list @@ -243,388 +243,7 @@ skip script test262/built-ins/TypedArrayConstructors/internals/Set/key-is-not-ca skip script test262/built-ins/TypedArrayConstructors/internals/Set/key-is-not-integer.js skip script test262/built-ins/TypedArrayConstructors/internals/Set/tonumber-value-throws.js -# https://bugzilla.mozilla.org/show_bug.cgi?id=1456569 -skip script test262/built-ins/TypedArray/prototype/reverse/BigInt/get-length-uses-internal-arraylength.js -skip script test262/built-ins/TypedArray/prototype/reverse/BigInt/returns-original-object.js -skip script test262/built-ins/TypedArray/prototype/reverse/BigInt/preserves-non-numeric-properties.js -skip script test262/built-ins/TypedArray/prototype/reverse/BigInt/reverts.js -skip script test262/built-ins/TypedArray/prototype/reverse/BigInt/detached-buffer.js -skip script test262/built-ins/TypedArray/prototype/indexOf/BigInt/get-length-uses-internal-arraylength.js -skip script test262/built-ins/TypedArray/prototype/indexOf/BigInt/fromIndex-minus-zero.js -skip script test262/built-ins/TypedArray/prototype/indexOf/BigInt/return-abrupt-tointeger-fromindex-symbol.js -skip script test262/built-ins/TypedArray/prototype/indexOf/BigInt/length-zero-returns-minus-one.js -skip script test262/built-ins/TypedArray/prototype/indexOf/BigInt/tointeger-fromindex.js -skip script test262/built-ins/TypedArray/prototype/indexOf/BigInt/detached-buffer.js -skip script test262/built-ins/TypedArray/prototype/indexOf/BigInt/return-abrupt-tointeger-fromindex.js -skip script test262/built-ins/TypedArray/prototype/indexOf/BigInt/fromIndex-infinity.js -skip script test262/built-ins/TypedArray/prototype/indexOf/BigInt/search-found-returns-index.js -skip script test262/built-ins/TypedArray/prototype/indexOf/BigInt/search-not-found-returns-minus-one.js -skip script test262/built-ins/TypedArray/prototype/indexOf/BigInt/fromIndex-equal-or-greater-length-returns-minus-one.js -skip script test262/built-ins/TypedArray/prototype/lastIndexOf/BigInt/get-length-uses-internal-arraylength.js -skip script test262/built-ins/TypedArray/prototype/lastIndexOf/BigInt/length-zero-returns-minus-one.js -skip script test262/built-ins/TypedArray/prototype/lastIndexOf/BigInt/fromIndex-minus-zero.js -skip script test262/built-ins/TypedArray/prototype/lastIndexOf/BigInt/return-abrupt-tointeger-fromindex-symbol.js -skip script test262/built-ins/TypedArray/prototype/lastIndexOf/BigInt/tointeger-fromindex.js -skip script test262/built-ins/TypedArray/prototype/lastIndexOf/BigInt/detached-buffer.js -skip script test262/built-ins/TypedArray/prototype/lastIndexOf/BigInt/return-abrupt-tointeger-fromindex.js -skip script test262/built-ins/TypedArray/prototype/lastIndexOf/BigInt/fromIndex-infinity.js -skip script test262/built-ins/TypedArray/prototype/lastIndexOf/BigInt/search-found-returns-index.js -skip script test262/built-ins/TypedArray/prototype/lastIndexOf/BigInt/search-not-found-returns-minus-one.js -skip script test262/built-ins/TypedArray/prototype/join/BigInt/get-length-uses-internal-arraylength.js -skip script test262/built-ins/TypedArray/prototype/join/BigInt/return-abrupt-from-separator.js -skip script test262/built-ins/TypedArray/prototype/join/BigInt/empty-instance-empty-string.js -skip script test262/built-ins/TypedArray/prototype/join/BigInt/detached-buffer.js -skip script test262/built-ins/TypedArray/prototype/join/BigInt/custom-separator-result-from-tostring-on-each-simple-value.js -skip script test262/built-ins/TypedArray/prototype/join/BigInt/result-from-tostring-on-each-simple-value.js -skip script test262/built-ins/TypedArray/prototype/join/BigInt/return-abrupt-from-separator-symbol.js -skip script test262/built-ins/TypedArray/prototype/byteLength/BigInt/detached-buffer.js -skip script test262/built-ins/TypedArray/prototype/byteLength/BigInt/return-bytelength.js -skip script test262/built-ins/TypedArray/prototype/findIndex/BigInt/predicate-call-parameters.js -skip script test262/built-ins/TypedArray/prototype/findIndex/BigInt/predicate-call-this-strict-strict.js -skip script test262/built-ins/TypedArray/prototype/findIndex/BigInt/return-negative-one-if-predicate-returns-false-value.js -skip script test262/built-ins/TypedArray/prototype/findIndex/BigInt/predicate-call-changes-value.js -skip script test262/built-ins/TypedArray/prototype/findIndex/BigInt/return-abrupt-from-predicate-call.js -skip script test262/built-ins/TypedArray/prototype/findIndex/BigInt/detached-buffer.js -skip script test262/built-ins/TypedArray/prototype/findIndex/BigInt/predicate-call-this-non-strict.js -skip script test262/built-ins/TypedArray/prototype/findIndex/BigInt/return-index-predicate-result-is-true.js -skip script test262/built-ins/TypedArray/prototype/findIndex/BigInt/predicate-is-not-callable-throws.js -skip script test262/built-ins/TypedArray/prototype/findIndex/BigInt/get-length-ignores-length-prop.js -skip script test262/built-ins/TypedArray/prototype/findIndex/BigInt/predicate-not-called-on-empty-array.js -skip script test262/built-ins/TypedArray/prototype/some/BigInt/get-length-uses-internal-arraylength.js -skip script test262/built-ins/TypedArray/prototype/some/BigInt/callbackfn-not-callable-throws.js -skip script test262/built-ins/TypedArray/prototype/some/BigInt/callbackfn-set-value-during-interaction.js -skip script test262/built-ins/TypedArray/prototype/some/BigInt/callbackfn-return-does-not-change-instance.js -skip script test262/built-ins/TypedArray/prototype/some/BigInt/callbackfn-returns-abrupt.js -skip script test262/built-ins/TypedArray/prototype/some/BigInt/returns-true-if-any-cb-returns-true.js -skip script test262/built-ins/TypedArray/prototype/some/BigInt/callbackfn-arguments-without-thisarg.js -skip script test262/built-ins/TypedArray/prototype/some/BigInt/detached-buffer.js -skip script test262/built-ins/TypedArray/prototype/some/BigInt/callbackfn-not-called-on-empty.js -skip script test262/built-ins/TypedArray/prototype/some/BigInt/values-are-not-cached.js -skip script test262/built-ins/TypedArray/prototype/some/BigInt/callbackfn-no-interaction-over-non-integer.js -skip script test262/built-ins/TypedArray/prototype/some/BigInt/callbackfn-this.js -skip script test262/built-ins/TypedArray/prototype/some/BigInt/callbackfn-arguments-with-thisarg.js -skip script test262/built-ins/TypedArray/prototype/some/BigInt/returns-false-if-every-cb-returns-false.js -skip script test262/built-ins/TypedArray/prototype/byteOffset/BigInt/return-byteoffset.js -skip script test262/built-ins/TypedArray/prototype/byteOffset/BigInt/detached-buffer.js -skip script test262/built-ins/TypedArray/prototype/forEach/BigInt/returns-undefined.js -skip script test262/built-ins/TypedArray/prototype/forEach/BigInt/callbackfn-set-value-during-interaction.js -skip script test262/built-ins/TypedArray/prototype/forEach/BigInt/callbackfn-return-does-not-change-instance.js -skip script test262/built-ins/TypedArray/prototype/forEach/BigInt/callbackfn-returns-abrupt.js -skip script test262/built-ins/TypedArray/prototype/forEach/BigInt/callbackfn-arguments-without-thisarg.js -skip script test262/built-ins/TypedArray/prototype/forEach/BigInt/detached-buffer.js -skip script test262/built-ins/TypedArray/prototype/forEach/BigInt/callbackfn-not-called-on-empty.js -skip script test262/built-ins/TypedArray/prototype/forEach/BigInt/callbackfn-no-interaction-over-non-integer.js -skip script test262/built-ins/TypedArray/prototype/forEach/BigInt/values-are-not-cached.js -skip script test262/built-ins/TypedArray/prototype/forEach/BigInt/callbackfn-is-not-callable.js -skip script test262/built-ins/TypedArray/prototype/forEach/BigInt/callbackfn-this.js -skip script test262/built-ins/TypedArray/prototype/forEach/BigInt/arraylength-internal.js -skip script test262/built-ins/TypedArray/prototype/forEach/BigInt/callbackfn-arguments-with-thisarg.js -skip script test262/built-ins/TypedArray/prototype/length/BigInt/return-length.js -skip script test262/built-ins/TypedArray/prototype/length/BigInt/detached-buffer.js -skip script test262/built-ins/TypedArray/prototype/entries/BigInt/return-itor.js -skip script test262/built-ins/TypedArray/prototype/entries/BigInt/detached-buffer.js -skip script test262/built-ins/TypedArray/prototype/entries/BigInt/iter-prototype.js -skip script test262/built-ins/TypedArray/prototype/find/BigInt/predicate-call-parameters.js -skip script test262/built-ins/TypedArray/prototype/find/BigInt/return-found-value-predicate-result-is-true.js -skip script test262/built-ins/TypedArray/prototype/find/BigInt/return-undefined-if-predicate-returns-false-value.js -skip script test262/built-ins/TypedArray/prototype/find/BigInt/predicate-call-this-strict-strict.js -skip script test262/built-ins/TypedArray/prototype/find/BigInt/predicate-call-changes-value.js -skip script test262/built-ins/TypedArray/prototype/find/BigInt/return-abrupt-from-predicate-call.js -skip script test262/built-ins/TypedArray/prototype/find/BigInt/detached-buffer.js -skip script test262/built-ins/TypedArray/prototype/find/BigInt/predicate-call-this-non-strict.js -skip script test262/built-ins/TypedArray/prototype/find/BigInt/predicate-is-not-callable-throws.js -skip script test262/built-ins/TypedArray/prototype/find/BigInt/get-length-ignores-length-prop.js -skip script test262/built-ins/TypedArray/prototype/find/BigInt/predicate-not-called-on-empty-array.js -skip script test262/built-ins/TypedArray/prototype/slice/BigInt/speciesctor-get-species-custom-ctor-returns-another-instance.js -skip script test262/built-ins/TypedArray/prototype/slice/BigInt/tointeger-end.js -skip script test262/built-ins/TypedArray/prototype/slice/BigInt/speciesctor-get-species-custom-ctor-throws.js -skip script test262/built-ins/TypedArray/prototype/slice/BigInt/infinity.js -skip script test262/built-ins/TypedArray/prototype/slice/BigInt/speciesctor-get-species-use-default-ctor.js -skip script test262/built-ins/TypedArray/prototype/slice/BigInt/set-values-from-different-ctor-type.js -skip script test262/built-ins/TypedArray/prototype/slice/BigInt/return-abrupt-from-start.js -skip script test262/built-ins/TypedArray/prototype/slice/BigInt/speciesctor-get-species-returns-throws.js -skip script test262/built-ins/TypedArray/prototype/slice/BigInt/speciesctor-get-ctor-returns-throws.js -skip script test262/built-ins/TypedArray/prototype/slice/BigInt/results-with-empty-length.js -skip script test262/built-ins/TypedArray/prototype/slice/BigInt/tointeger-start.js -skip script test262/built-ins/TypedArray/prototype/slice/BigInt/speciesctor-get-species.js -skip script test262/built-ins/TypedArray/prototype/slice/BigInt/detached-buffer-get-ctor.js -skip script test262/built-ins/TypedArray/prototype/slice/BigInt/result-does-not-copy-ordinary-properties.js -skip script test262/built-ins/TypedArray/prototype/slice/BigInt/speciesctor-get-ctor-inherited.js -skip script test262/built-ins/TypedArray/prototype/slice/BigInt/speciesctor-get-species-custom-ctor-length-throws.js -skip script test262/built-ins/TypedArray/prototype/slice/BigInt/return-abrupt-from-end-symbol.js -skip script test262/built-ins/TypedArray/prototype/slice/BigInt/speciesctor-get-species-custom-ctor-invocation.js -skip script test262/built-ins/TypedArray/prototype/slice/BigInt/results-with-different-length.js -skip script test262/built-ins/TypedArray/prototype/slice/BigInt/return-abrupt-from-start-symbol.js -skip script test262/built-ins/TypedArray/prototype/slice/BigInt/results-with-same-length.js -skip script test262/built-ins/TypedArray/prototype/slice/BigInt/return-abrupt-from-end.js -skip script test262/built-ins/TypedArray/prototype/slice/BigInt/detached-buffer-speciesctor-get-species-custom-ctor-throws.js -skip script test262/built-ins/TypedArray/prototype/slice/BigInt/detached-buffer.js -skip script test262/built-ins/TypedArray/prototype/slice/BigInt/speciesctor-get-ctor-abrupt.js -skip script test262/built-ins/TypedArray/prototype/slice/BigInt/speciesctor-get-species-custom-ctor-length.js -skip script test262/built-ins/TypedArray/prototype/slice/BigInt/speciesctor-get-ctor.js -skip script test262/built-ins/TypedArray/prototype/slice/BigInt/speciesctor-get-species-custom-ctor.js -skip script test262/built-ins/TypedArray/prototype/slice/BigInt/minus-zero.js -skip script test262/built-ins/TypedArray/prototype/slice/BigInt/detached-buffer-custom-ctor-same-targettype.js -skip script test262/built-ins/TypedArray/prototype/slice/BigInt/arraylength-internal.js -skip script test262/built-ins/TypedArray/prototype/slice/BigInt/speciesctor-get-species-abrupt.js -skip script test262/built-ins/TypedArray/prototype/slice/BigInt/detached-buffer-custom-ctor-other-targettype.js -skip script test262/built-ins/TypedArray/prototype/slice/BigInt/detached-buffer-zero-count-custom-ctor-other-targettype.js -skip script test262/built-ins/TypedArray/prototype/slice/BigInt/detached-buffer-zero-count-custom-ctor-same-targettype.js -skip script test262/built-ins/TypedArray/prototype/Symbol.toStringTag/BigInt/detached-buffer.js -skip script test262/built-ins/TypedArray/prototype/Symbol.toStringTag/BigInt/return-typedarrayname.js -skip script test262/built-ins/TypedArray/prototype/buffer/BigInt/return-buffer.js -skip script test262/built-ins/TypedArray/prototype/buffer/BigInt/detached-buffer.js -skip script test262/built-ins/TypedArray/prototype/keys/BigInt/return-itor.js -skip script test262/built-ins/TypedArray/prototype/keys/BigInt/detached-buffer.js -skip script test262/built-ins/TypedArray/prototype/keys/BigInt/iter-prototype.js -skip script test262/built-ins/TypedArray/prototype/filter/BigInt/speciesctor-get-species-custom-ctor-returns-another-instance.js -skip script test262/built-ins/TypedArray/prototype/filter/BigInt/speciesctor-get-species-custom-ctor-throws.js -skip script test262/built-ins/TypedArray/prototype/filter/BigInt/speciesctor-get-species-use-default-ctor.js -skip script test262/built-ins/TypedArray/prototype/filter/BigInt/speciesctor-get-species-returns-throws.js -skip script test262/built-ins/TypedArray/prototype/filter/BigInt/callbackfn-set-value-during-iteration.js -skip script test262/built-ins/TypedArray/prototype/filter/BigInt/speciesctor-get-ctor-returns-throws.js -skip script test262/built-ins/TypedArray/prototype/filter/BigInt/callbackfn-not-callable-throws.js -skip script test262/built-ins/TypedArray/prototype/filter/BigInt/speciesctor-get-species.js -skip script test262/built-ins/TypedArray/prototype/filter/BigInt/callbackfn-called-before-ctor.js -skip script test262/built-ins/TypedArray/prototype/filter/BigInt/callbackfn-return-does-not-change-instance.js -skip script test262/built-ins/TypedArray/prototype/filter/BigInt/speciesctor-get-ctor-inherited.js -skip script test262/built-ins/TypedArray/prototype/filter/BigInt/speciesctor-get-species-custom-ctor-length-throws.js -skip script test262/built-ins/TypedArray/prototype/filter/BigInt/callbackfn-no-iteration-over-non-integer.js -skip script test262/built-ins/TypedArray/prototype/filter/BigInt/speciesctor-get-species-custom-ctor-invocation.js -skip script test262/built-ins/TypedArray/prototype/filter/BigInt/result-full-callbackfn-returns-true.js -skip script test262/built-ins/TypedArray/prototype/filter/BigInt/callbackfn-returns-abrupt.js -skip script test262/built-ins/TypedArray/prototype/filter/BigInt/values-are-set.js -skip script test262/built-ins/TypedArray/prototype/filter/BigInt/callbackfn-arguments-without-thisarg.js -skip script test262/built-ins/TypedArray/prototype/filter/BigInt/detached-buffer.js -skip script test262/built-ins/TypedArray/prototype/filter/BigInt/speciesctor-get-ctor-abrupt.js -skip script test262/built-ins/TypedArray/prototype/filter/BigInt/speciesctor-get-species-custom-ctor-length.js -skip script test262/built-ins/TypedArray/prototype/filter/BigInt/result-does-not-share-buffer.js -skip script test262/built-ins/TypedArray/prototype/filter/BigInt/speciesctor-get-ctor.js -skip script test262/built-ins/TypedArray/prototype/filter/BigInt/callbackfn-not-called-on-empty.js -skip script test262/built-ins/TypedArray/prototype/filter/BigInt/values-are-not-cached.js -skip script test262/built-ins/TypedArray/prototype/filter/BigInt/speciesctor-get-species-custom-ctor.js -skip script test262/built-ins/TypedArray/prototype/filter/BigInt/callbackfn-this.js -skip script test262/built-ins/TypedArray/prototype/filter/BigInt/arraylength-internal.js -skip script test262/built-ins/TypedArray/prototype/filter/BigInt/speciesctor-get-species-abrupt.js -skip script test262/built-ins/TypedArray/prototype/filter/BigInt/callbackfn-called-before-species.js -skip script test262/built-ins/TypedArray/prototype/filter/BigInt/result-empty-callbackfn-returns-false.js -skip script test262/built-ins/TypedArray/prototype/filter/BigInt/callbackfn-arguments-with-thisarg.js -skip script test262/built-ins/TypedArray/prototype/subarray/BigInt/speciesctor-get-species-custom-ctor-returns-another-instance.js -skip script test262/built-ins/TypedArray/prototype/subarray/BigInt/tointeger-end.js -skip script test262/built-ins/TypedArray/prototype/subarray/BigInt/speciesctor-get-species-custom-ctor-throws.js -skip script test262/built-ins/TypedArray/prototype/subarray/BigInt/infinity.js -skip script test262/built-ins/TypedArray/prototype/subarray/BigInt/speciesctor-get-species-use-default-ctor.js -skip script test262/built-ins/TypedArray/prototype/subarray/BigInt/speciesctor-get-species-returns-throws.js -skip script test262/built-ins/TypedArray/prototype/subarray/BigInt/speciesctor-get-ctor-returns-throws.js -skip script test262/built-ins/TypedArray/prototype/subarray/BigInt/results-with-empty-length.js -skip script test262/built-ins/TypedArray/prototype/subarray/BigInt/speciesctor-get-species.js -skip script test262/built-ins/TypedArray/prototype/subarray/BigInt/result-does-not-copy-ordinary-properties.js -skip script test262/built-ins/TypedArray/prototype/subarray/BigInt/result-is-new-instance-from-same-ctor.js -skip script test262/built-ins/TypedArray/prototype/subarray/BigInt/speciesctor-get-ctor-inherited.js -skip script test262/built-ins/TypedArray/prototype/subarray/BigInt/return-abrupt-from-begin.js -skip script test262/built-ins/TypedArray/prototype/subarray/BigInt/return-abrupt-from-end-symbol.js -skip script test262/built-ins/TypedArray/prototype/subarray/BigInt/speciesctor-get-species-custom-ctor-invocation.js -skip script test262/built-ins/TypedArray/prototype/subarray/BigInt/results-with-different-length.js -skip script test262/built-ins/TypedArray/prototype/subarray/BigInt/results-with-same-length.js -skip script test262/built-ins/TypedArray/prototype/subarray/BigInt/return-abrupt-from-end.js -skip script test262/built-ins/TypedArray/prototype/subarray/BigInt/tointeger-begin.js -skip script test262/built-ins/TypedArray/prototype/subarray/BigInt/detached-buffer.js -skip script test262/built-ins/TypedArray/prototype/subarray/BigInt/speciesctor-get-ctor-abrupt.js -skip script test262/built-ins/TypedArray/prototype/subarray/BigInt/speciesctor-get-ctor.js -skip script test262/built-ins/TypedArray/prototype/subarray/BigInt/speciesctor-get-species-custom-ctor.js -skip script test262/built-ins/TypedArray/prototype/subarray/BigInt/minus-zero.js -skip script test262/built-ins/TypedArray/prototype/subarray/BigInt/result-is-new-instance-with-shared-buffer.js -skip script test262/built-ins/TypedArray/prototype/subarray/BigInt/speciesctor-get-species-abrupt.js -skip script test262/built-ins/TypedArray/prototype/subarray/BigInt/return-abrupt-from-begin-symbol.js -skip script test262/built-ins/TypedArray/prototype/values/BigInt/return-itor.js -skip script test262/built-ins/TypedArray/prototype/values/BigInt/detached-buffer.js -skip script test262/built-ins/TypedArray/prototype/values/BigInt/iter-prototype.js -skip script test262/built-ins/TypedArray/prototype/toLocaleString/BigInt/get-length-uses-internal-arraylength.js -skip script test262/built-ins/TypedArray/prototype/toLocaleString/BigInt/return-result.js -skip script test262/built-ins/TypedArray/prototype/toLocaleString/BigInt/calls-tolocalestring-from-each-value.js -skip script test262/built-ins/TypedArray/prototype/toLocaleString/BigInt/empty-instance-returns-empty-string.js -skip script test262/built-ins/TypedArray/prototype/toLocaleString/BigInt/calls-valueof-from-each-value.js -skip script test262/built-ins/TypedArray/prototype/toLocaleString/BigInt/return-abrupt-from-nextelement-tolocalestring.js -skip script test262/built-ins/TypedArray/prototype/toLocaleString/BigInt/detached-buffer.js -skip script test262/built-ins/TypedArray/prototype/toLocaleString/BigInt/return-abrupt-from-firstelement-valueof.js -skip script test262/built-ins/TypedArray/prototype/toLocaleString/BigInt/return-abrupt-from-nextelement-tostring.js -skip script test262/built-ins/TypedArray/prototype/toLocaleString/BigInt/calls-tostring-from-each-value.js -skip script test262/built-ins/TypedArray/prototype/toLocaleString/BigInt/return-abrupt-from-firstelement-tostring.js -skip script test262/built-ins/TypedArray/prototype/toLocaleString/BigInt/return-abrupt-from-firstelement-tolocalestring.js -skip script test262/built-ins/TypedArray/prototype/toLocaleString/BigInt/return-abrupt-from-nextelement-valueof.js -skip script test262/built-ins/TypedArray/prototype/toString/BigInt/detached-buffer.js -skip script test262/built-ins/TypedArray/prototype/includes/BigInt/search-not-found-returns-false.js -skip script test262/built-ins/TypedArray/prototype/includes/BigInt/get-length-uses-internal-arraylength.js -skip script test262/built-ins/TypedArray/prototype/includes/BigInt/fromIndex-minus-zero.js -skip script test262/built-ins/TypedArray/prototype/includes/BigInt/return-abrupt-tointeger-fromindex-symbol.js -skip script test262/built-ins/TypedArray/prototype/includes/BigInt/tointeger-fromindex.js -skip script test262/built-ins/TypedArray/prototype/includes/BigInt/detached-buffer.js -skip script test262/built-ins/TypedArray/prototype/includes/BigInt/fromIndex-equal-or-greater-length-returns-false.js -skip script test262/built-ins/TypedArray/prototype/includes/BigInt/return-abrupt-tointeger-fromindex.js -skip script test262/built-ins/TypedArray/prototype/includes/BigInt/fromIndex-infinity.js -skip script test262/built-ins/TypedArray/prototype/includes/BigInt/search-found-returns-true.js -skip script test262/built-ins/TypedArray/prototype/includes/BigInt/length-zero-returns-false.js -skip script test262/built-ins/TypedArray/prototype/every/BigInt/get-length-uses-internal-arraylength.js -skip script test262/built-ins/TypedArray/prototype/every/BigInt/callbackfn-not-callable-throws.js -skip script test262/built-ins/TypedArray/prototype/every/BigInt/callbackfn-set-value-during-interaction.js -skip script test262/built-ins/TypedArray/prototype/every/BigInt/callbackfn-return-does-not-change-instance.js -skip script test262/built-ins/TypedArray/prototype/every/BigInt/returns-false-if-any-cb-returns-false.js -skip script test262/built-ins/TypedArray/prototype/every/BigInt/returns-true-if-every-cb-returns-true.js -skip script test262/built-ins/TypedArray/prototype/every/BigInt/callbackfn-returns-abrupt.js -skip script test262/built-ins/TypedArray/prototype/every/BigInt/callbackfn-arguments-without-thisarg.js -skip script test262/built-ins/TypedArray/prototype/every/BigInt/detached-buffer.js -skip script test262/built-ins/TypedArray/prototype/every/BigInt/callbackfn-not-called-on-empty.js -skip script test262/built-ins/TypedArray/prototype/every/BigInt/values-are-not-cached.js -skip script test262/built-ins/TypedArray/prototype/every/BigInt/callbackfn-no-interaction-over-non-integer.js -skip script test262/built-ins/TypedArray/prototype/every/BigInt/callbackfn-this.js -skip script test262/built-ins/TypedArray/prototype/every/BigInt/callbackfn-arguments-with-thisarg.js -skip script test262/built-ins/TypedArray/prototype/reduce/BigInt/get-length-uses-internal-arraylength.js -skip script test262/built-ins/TypedArray/prototype/reduce/BigInt/callbackfn-set-value-during-iteration.js -skip script test262/built-ins/TypedArray/prototype/reduce/BigInt/callbackfn-arguments-default-accumulator.js -skip script test262/built-ins/TypedArray/prototype/reduce/BigInt/callbackfn-arguments-custom-accumulator.js -skip script test262/built-ins/TypedArray/prototype/reduce/BigInt/empty-instance-with-no-initialvalue-throws.js -skip script test262/built-ins/TypedArray/prototype/reduce/BigInt/empty-instance-return-initialvalue.js -skip script test262/built-ins/TypedArray/prototype/reduce/BigInt/callbackfn-return-does-not-change-instance.js -skip script test262/built-ins/TypedArray/prototype/reduce/BigInt/callbackfn-returns-abrupt.js -skip script test262/built-ins/TypedArray/prototype/reduce/BigInt/return-first-value-without-callbackfn.js -skip script test262/built-ins/TypedArray/prototype/reduce/BigInt/detached-buffer.js -skip script test262/built-ins/TypedArray/prototype/reduce/BigInt/result-is-last-callbackfn-return.js -skip script test262/built-ins/TypedArray/prototype/reduce/BigInt/callbackfn-is-not-callable-throws.js -skip script test262/built-ins/TypedArray/prototype/reduce/BigInt/callbackfn-not-called-on-empty.js -skip script test262/built-ins/TypedArray/prototype/reduce/BigInt/values-are-not-cached.js -skip script test262/built-ins/TypedArray/prototype/reduce/BigInt/result-of-any-type.js -skip script test262/built-ins/TypedArray/prototype/reduce/BigInt/callbackfn-this.js -skip script test262/built-ins/TypedArray/prototype/reduce/BigInt/callbackfn-no-iteration-over-non-integer-properties.js -skip script test262/built-ins/TypedArray/prototype/fill/BigInt/fill-values-non-numeric.js -skip script test262/built-ins/TypedArray/prototype/fill/BigInt/return-this.js -skip script test262/built-ins/TypedArray/prototype/fill/BigInt/fill-values-non-numeric-throw.js -skip script test262/built-ins/TypedArray/prototype/fill/BigInt/return-abrupt-from-start.js -skip script test262/built-ins/TypedArray/prototype/fill/BigInt/coerced-indexes.js -skip script test262/built-ins/TypedArray/prototype/fill/BigInt/return-abrupt-from-start-as-symbol.js -skip script test262/built-ins/TypedArray/prototype/fill/BigInt/fill-values-relative-end.js -skip script test262/built-ins/TypedArray/prototype/fill/BigInt/fill-values.js -skip script test262/built-ins/TypedArray/prototype/fill/BigInt/return-abrupt-from-end.js -skip script test262/built-ins/TypedArray/prototype/fill/BigInt/detached-buffer.js -skip script test262/built-ins/TypedArray/prototype/fill/BigInt/return-abrupt-from-set-value.js -skip script test262/built-ins/TypedArray/prototype/fill/BigInt/fill-values-custom-start-and-end.js -skip script test262/built-ins/TypedArray/prototype/fill/BigInt/fill-values-conversion-once.js -skip script test262/built-ins/TypedArray/prototype/fill/BigInt/return-abrupt-from-end-as-symbol.js -skip script test262/built-ins/TypedArray/prototype/fill/BigInt/fill-values-symbol-throws.js -skip script test262/built-ins/TypedArray/prototype/fill/BigInt/get-length-ignores-length-prop.js -skip script test262/built-ins/TypedArray/prototype/fill/BigInt/fill-values-relative-start.js -skip script test262/built-ins/TypedArray/prototype/reduceRight/BigInt/get-length-uses-internal-arraylength.js -skip script test262/built-ins/TypedArray/prototype/reduceRight/BigInt/callbackfn-set-value-during-iteration.js -skip script test262/built-ins/TypedArray/prototype/reduceRight/BigInt/callbackfn-arguments-default-accumulator.js -skip script test262/built-ins/TypedArray/prototype/reduceRight/BigInt/callbackfn-arguments-custom-accumulator.js -skip script test262/built-ins/TypedArray/prototype/reduceRight/BigInt/empty-instance-with-no-initialvalue-throws.js -skip script test262/built-ins/TypedArray/prototype/reduceRight/BigInt/empty-instance-return-initialvalue.js -skip script test262/built-ins/TypedArray/prototype/reduceRight/BigInt/callbackfn-return-does-not-change-instance.js -skip script test262/built-ins/TypedArray/prototype/reduceRight/BigInt/callbackfn-returns-abrupt.js -skip script test262/built-ins/TypedArray/prototype/reduceRight/BigInt/return-first-value-without-callbackfn.js -skip script test262/built-ins/TypedArray/prototype/reduceRight/BigInt/detached-buffer.js -skip script test262/built-ins/TypedArray/prototype/reduceRight/BigInt/result-is-last-callbackfn-return.js -skip script test262/built-ins/TypedArray/prototype/reduceRight/BigInt/callbackfn-is-not-callable-throws.js -skip script test262/built-ins/TypedArray/prototype/reduceRight/BigInt/callbackfn-not-called-on-empty.js -skip script test262/built-ins/TypedArray/prototype/reduceRight/BigInt/values-are-not-cached.js -skip script test262/built-ins/TypedArray/prototype/reduceRight/BigInt/result-of-any-type.js -skip script test262/built-ins/TypedArray/prototype/reduceRight/BigInt/callbackfn-this.js -skip script test262/built-ins/TypedArray/prototype/reduceRight/BigInt/callbackfn-no-iteration-over-non-integer-properties.js -skip script test262/built-ins/TypedArray/prototype/copyWithin/BigInt/negative-target.js -skip script test262/built-ins/TypedArray/prototype/copyWithin/BigInt/coerced-values-end.js -skip script test262/built-ins/TypedArray/prototype/copyWithin/BigInt/negative-end.js -skip script test262/built-ins/TypedArray/prototype/copyWithin/BigInt/return-this.js -skip script test262/built-ins/TypedArray/prototype/copyWithin/BigInt/return-abrupt-from-start.js -skip script test262/built-ins/TypedArray/prototype/copyWithin/BigInt/return-abrupt-from-target-is-symbol.js -skip script test262/built-ins/TypedArray/prototype/copyWithin/BigInt/coerced-values-start.js -skip script test262/built-ins/TypedArray/prototype/copyWithin/BigInt/non-negative-target-and-start.js -skip script test262/built-ins/TypedArray/prototype/copyWithin/BigInt/negative-start.js -skip script test262/built-ins/TypedArray/prototype/copyWithin/BigInt/negative-out-of-bounds-end.js -skip script test262/built-ins/TypedArray/prototype/copyWithin/BigInt/non-negative-out-of-bounds-target-and-start.js -skip script test262/built-ins/TypedArray/prototype/copyWithin/BigInt/return-abrupt-from-end.js -skip script test262/built-ins/TypedArray/prototype/copyWithin/BigInt/detached-buffer.js -skip script test262/built-ins/TypedArray/prototype/copyWithin/BigInt/coerced-values-target.js -skip script test262/built-ins/TypedArray/prototype/copyWithin/BigInt/negative-out-of-bounds-target.js -skip script test262/built-ins/TypedArray/prototype/copyWithin/BigInt/undefined-end.js -skip script test262/built-ins/TypedArray/prototype/copyWithin/BigInt/non-negative-target-start-and-end.js -skip script test262/built-ins/TypedArray/prototype/copyWithin/BigInt/negative-out-of-bounds-start.js -skip script test262/built-ins/TypedArray/prototype/copyWithin/BigInt/non-negative-out-of-bounds-end.js -skip script test262/built-ins/TypedArray/prototype/copyWithin/BigInt/return-abrupt-from-end-is-symbol.js -skip script test262/built-ins/TypedArray/prototype/copyWithin/BigInt/return-abrupt-from-start-is-symbol.js -skip script test262/built-ins/TypedArray/prototype/copyWithin/BigInt/get-length-ignores-length-prop.js -skip script test262/built-ins/TypedArray/prototype/copyWithin/BigInt/return-abrupt-from-target.js -skip script test262/built-ins/TypedArray/prototype/map/BigInt/callbackfn-return-affects-returned-object.js -skip script test262/built-ins/TypedArray/prototype/map/BigInt/callbackfn-return-does-not-copy-non-integer-properties.js -skip script test262/built-ins/TypedArray/prototype/map/BigInt/callbackfn-no-interaction-over-non-integer-properties.js -skip script test262/built-ins/TypedArray/prototype/map/BigInt/callbackfn-set-value-during-interaction.js -skip script test262/built-ins/TypedArray/prototype/map/BigInt/callbackfn-return-does-not-change-instance.js -skip script test262/built-ins/TypedArray/prototype/map/BigInt/callbackfn-returns-abrupt.js -skip script test262/built-ins/TypedArray/prototype/map/BigInt/return-new-typedarray-from-positive-length.js -skip script test262/built-ins/TypedArray/prototype/map/BigInt/callbackfn-arguments-without-thisarg.js -skip script test262/built-ins/TypedArray/prototype/map/BigInt/detached-buffer.js -skip script test262/built-ins/TypedArray/prototype/map/BigInt/callbackfn-not-called-on-empty.js -skip script test262/built-ins/TypedArray/prototype/map/BigInt/values-are-not-cached.js -skip script test262/built-ins/TypedArray/prototype/map/BigInt/callbackfn-is-not-callable.js -skip script test262/built-ins/TypedArray/prototype/map/BigInt/callbackfn-this.js -skip script test262/built-ins/TypedArray/prototype/map/BigInt/arraylength-internal.js -skip script test262/built-ins/TypedArray/prototype/map/BigInt/return-new-typedarray-from-empty-length.js -skip script test262/built-ins/TypedArray/prototype/map/BigInt/callbackfn-arguments-with-thisarg.js -skip script test262/built-ins/TypedArray/prototype/set/src-typedarray-big-throws.js -skip script test262/built-ins/TypedArray/prototype/set/BigInt/undefined-tobigint.js -skip script test262/built-ins/TypedArray/prototype/set/BigInt/typedarray-arg-offset-tointeger.js -skip script test262/built-ins/TypedArray/prototype/set/BigInt/typedarray-arg-target-byteoffset-internal.js -skip script test262/built-ins/TypedArray/prototype/set/BigInt/typedarray-arg-srcbuffer-detached-during-tointeger-offset-throws.js -skip script test262/built-ins/TypedArray/prototype/set/BigInt/string-tobigint.js -skip script test262/built-ins/TypedArray/prototype/set/BigInt/array-arg-return-abrupt-from-tointeger-offset.js -skip script test262/built-ins/TypedArray/prototype/set/BigInt/array-arg-targetbuffer-detached-on-tointeger-offset-throws.js -skip script test262/built-ins/TypedArray/prototype/set/BigInt/typedarray-arg-return-abrupt-from-tointeger-offset-symbol.js -skip script test262/built-ins/TypedArray/prototype/set/BigInt/typedarray-arg-set-values-diff-buffer-same-type.js -skip script test262/built-ins/TypedArray/prototype/set/BigInt/boolean-tobigint.js -skip script test262/built-ins/TypedArray/prototype/set/BigInt/bigint-tobigint64.js -skip script test262/built-ins/TypedArray/prototype/set/BigInt/typedarray-arg-src-arraylength-internal.js -skip script test262/built-ins/TypedArray/prototype/set/BigInt/typedarray-arg-set-values-same-buffer-same-type.js -skip script test262/built-ins/TypedArray/prototype/set/BigInt/typedarray-arg-negative-integer-offset-throws.js -skip script test262/built-ins/TypedArray/prototype/set/BigInt/typedarray-arg-target-arraylength-internal.js -skip script test262/built-ins/TypedArray/prototype/set/BigInt/typedarray-arg-set-values-diff-buffer-other-type-sab.js -skip script test262/built-ins/TypedArray/prototype/set/BigInt/array-arg-return-abrupt-from-src-tonumber-value-symbol.js -skip script test262/built-ins/TypedArray/prototype/set/BigInt/number-tobigint.js -skip script test262/built-ins/TypedArray/prototype/set/BigInt/typedarray-arg-targetbuffer-detached-during-tointeger-offset-throws.js -skip script test262/built-ins/TypedArray/prototype/set/BigInt/null-tobigint.js -skip script test262/built-ins/TypedArray/prototype/set/BigInt/array-arg-return-abrupt-from-src-get-value.js -skip script test262/built-ins/TypedArray/prototype/set/BigInt/array-arg-set-values-in-order.js -skip script test262/built-ins/TypedArray/prototype/set/BigInt/array-arg-set-values.js -skip script test262/built-ins/TypedArray/prototype/set/BigInt/array-arg-target-arraylength-internal.js -skip script test262/built-ins/TypedArray/prototype/set/BigInt/typedarray-arg-set-values-diff-buffer-other-type.js -skip script test262/built-ins/TypedArray/prototype/set/BigInt/symbol-tobigint.js -skip script test262/built-ins/TypedArray/prototype/set/BigInt/string-nan-tobigint.js -skip script test262/built-ins/TypedArray/prototype/set/BigInt/array-arg-src-values-are-not-cached.js -skip script test262/built-ins/TypedArray/prototype/set/BigInt/bigint-tobiguint64.js -skip script test262/built-ins/TypedArray/prototype/set/BigInt/src-typedarray-big.js -skip script test262/built-ins/TypedArray/prototype/set/BigInt/array-arg-offset-tointeger.js -skip script test262/built-ins/TypedArray/prototype/set/BigInt/typedarray-arg-set-values-same-buffer-same-type-sab.js -skip script test262/built-ins/TypedArray/prototype/set/BigInt/array-arg-return-abrupt-from-src-get-length.js -skip script test262/built-ins/TypedArray/prototype/set/BigInt/typedarray-arg-src-range-greather-than-target-throws-rangeerror.js -skip script test262/built-ins/TypedArray/prototype/set/BigInt/typedarray-arg-return-abrupt-from-tointeger-offset.js -skip script test262/built-ins/TypedArray/prototype/set/BigInt/array-arg-return-abrupt-from-src-length.js -skip script test262/built-ins/TypedArray/prototype/set/BigInt/src-typedarray-not-big-throws.js -skip script test262/built-ins/TypedArray/prototype/set/BigInt/array-arg-return-abrupt-from-src-length-symbol.js -skip script test262/built-ins/TypedArray/prototype/set/BigInt/array-arg-negative-integer-offset-throws.js -skip script test262/built-ins/TypedArray/prototype/set/BigInt/typedarray-arg-src-byteoffset-internal.js -skip script test262/built-ins/TypedArray/prototype/set/BigInt/array-arg-targetbuffer-detached-throws.js -skip script test262/built-ins/TypedArray/prototype/set/BigInt/array-arg-return-abrupt-from-toobject-offset.js -skip script test262/built-ins/TypedArray/prototype/set/BigInt/array-arg-return-abrupt-from-tointeger-offset-symbol.js -skip script test262/built-ins/TypedArray/prototype/set/BigInt/array-arg-src-tonumber-value-type-conversions.js -skip script test262/built-ins/TypedArray/prototype/set/BigInt/array-arg-return-abrupt-from-src-tonumber-value.js -skip script test262/built-ins/TypedArray/prototype/set/BigInt/array-arg-targetbuffer-detached-on-get-src-value-throws.js -skip script test262/built-ins/TypedArray/prototype/set/BigInt/typedarray-arg-set-values-diff-buffer-same-type-sab.js -skip script test262/built-ins/TypedArray/prototype/sort/BigInt/detached-buffer-comparefn.js -skip script test262/built-ins/TypedArray/prototype/sort/BigInt/comparefn-calls.js -skip script test262/built-ins/TypedArray/prototype/sort/BigInt/return-same-instance.js -skip script test262/built-ins/TypedArray/prototype/sort/BigInt/comparefn-nonfunction-call-throws.js -skip script test262/built-ins/TypedArray/prototype/sort/BigInt/sorted-values.js -skip script test262/built-ins/TypedArray/prototype/sort/BigInt/sortcompare-with-no-tostring.js -skip script test262/built-ins/TypedArray/prototype/sort/BigInt/detached-buffer.js -skip script test262/built-ins/TypedArray/prototype/sort/BigInt/arraylength-internal.js -skip script test262/built-ins/TypedArray/prototype/sort/BigInt/comparefn-call-throws.js +# https://bugzilla.mozilla.org/show_bug.cgi?id=1531647 skip script test262/built-ins/Atomics/store/bigint/bad-range.js skip script test262/built-ins/Atomics/store/bigint/nonshared-int-views.js skip script test262/built-ins/Atomics/store/bigint/good-views.js @@ -682,291 +301,6 @@ skip script test262/built-ins/Atomics/exchange/bigint/good-views.js skip script test262/built-ins/Atomics/sub/bigint/bad-range.js skip script test262/built-ins/Atomics/sub/bigint/nonshared-int-views.js skip script test262/built-ins/Atomics/sub/bigint/good-views.js -skip script test262/built-ins/TypedArrayConstructors/from/BigInt/iter-access-error.js -skip script test262/built-ins/TypedArrayConstructors/from/BigInt/source-value-is-symbol-throws.js -skip script test262/built-ins/TypedArrayConstructors/from/BigInt/iter-next-error.js -skip script test262/built-ins/TypedArrayConstructors/from/BigInt/mapfn-this-without-thisarg-non-strict.js -skip script test262/built-ins/TypedArrayConstructors/from/BigInt/inherited.js -skip script test262/built-ins/TypedArrayConstructors/from/BigInt/new-instance-empty.js -skip script test262/built-ins/TypedArrayConstructors/from/BigInt/custom-ctor-does-not-instantiate-ta-throws.js -skip script test262/built-ins/TypedArrayConstructors/from/BigInt/this-is-not-constructor.js -skip script test262/built-ins/TypedArrayConstructors/from/BigInt/arylk-get-length-error.js -skip script test262/built-ins/TypedArrayConstructors/from/BigInt/mapfn-arguments.js -skip script test262/built-ins/TypedArrayConstructors/from/BigInt/invoked-as-func.js -skip script test262/built-ins/TypedArrayConstructors/from/BigInt/arylk-to-length-error.js -skip script test262/built-ins/TypedArrayConstructors/from/BigInt/new-instance-from-ordinary-object.js -skip script test262/built-ins/TypedArrayConstructors/from/BigInt/new-instance-from-sparse-array.js -skip script test262/built-ins/TypedArrayConstructors/from/BigInt/iter-invoke-error.js -skip script test262/built-ins/TypedArrayConstructors/from/BigInt/custom-ctor-returns-other-instance.js -skip script test262/built-ins/TypedArrayConstructors/from/BigInt/set-value-abrupt-completion.js -skip script test262/built-ins/TypedArrayConstructors/from/BigInt/custom-ctor-returns-smaller-instance-throws.js -skip script test262/built-ins/TypedArrayConstructors/from/BigInt/mapfn-this-without-thisarg-strict-strict.js -skip script test262/built-ins/TypedArrayConstructors/from/BigInt/iter-next-value-error.js -skip script test262/built-ins/TypedArrayConstructors/from/BigInt/new-instance-with-mapfn.js -skip script test262/built-ins/TypedArrayConstructors/from/BigInt/new-instance-without-mapfn.js -skip script test262/built-ins/TypedArrayConstructors/from/BigInt/mapfn-is-not-callable.js -skip script test262/built-ins/TypedArrayConstructors/from/BigInt/new-instance-using-custom-ctor.js -skip script test262/built-ins/TypedArrayConstructors/from/BigInt/custom-ctor.js -skip script test262/built-ins/TypedArrayConstructors/from/BigInt/mapfn-abrupt-completion.js -skip script test262/built-ins/TypedArrayConstructors/from/BigInt/mapfn-this-with-thisarg.js -skip script test262/built-ins/TypedArrayConstructors/from/BigInt/property-abrupt-completion.js -skip script test262/built-ins/TypedArrayConstructors/BigInt64Array/prop-desc.js -skip script test262/built-ins/TypedArrayConstructors/BigInt64Array/BYTES_PER_ELEMENT.js -skip script test262/built-ins/TypedArrayConstructors/BigInt64Array/name.js -skip script test262/built-ins/TypedArrayConstructors/BigInt64Array/prototype.js -skip script test262/built-ins/TypedArrayConstructors/BigInt64Array/constructor.js -skip script test262/built-ins/TypedArrayConstructors/BigInt64Array/length.js -skip script test262/built-ins/TypedArrayConstructors/BigInt64Array/proto.js -skip script test262/built-ins/TypedArrayConstructors/BigInt64Array/prototype/not-typedarray-object.js -skip script test262/built-ins/TypedArrayConstructors/BigInt64Array/prototype/BYTES_PER_ELEMENT.js -skip script test262/built-ins/TypedArrayConstructors/BigInt64Array/prototype/constructor.js -skip script test262/built-ins/TypedArrayConstructors/BigInt64Array/prototype/proto.js -skip script test262/built-ins/TypedArrayConstructors/BigUint64Array/prop-desc.js -skip script test262/built-ins/TypedArrayConstructors/BigUint64Array/BYTES_PER_ELEMENT.js -skip script test262/built-ins/TypedArrayConstructors/BigUint64Array/name.js -skip script test262/built-ins/TypedArrayConstructors/BigUint64Array/prototype.js -skip script test262/built-ins/TypedArrayConstructors/BigUint64Array/constructor.js -skip script test262/built-ins/TypedArrayConstructors/BigUint64Array/length.js -skip script test262/built-ins/TypedArrayConstructors/BigUint64Array/proto.js -skip script test262/built-ins/TypedArrayConstructors/BigUint64Array/prototype/not-typedarray-object.js -skip script test262/built-ins/TypedArrayConstructors/BigUint64Array/prototype/BYTES_PER_ELEMENT.js -skip script test262/built-ins/TypedArrayConstructors/BigUint64Array/prototype/constructor.js -skip script test262/built-ins/TypedArrayConstructors/BigUint64Array/prototype/proto.js -skip script test262/built-ins/TypedArrayConstructors/ctors-bigint/no-args/use-custom-proto-if-object.js -skip script test262/built-ins/TypedArrayConstructors/ctors-bigint/no-args/returns-object.js -skip script test262/built-ins/TypedArrayConstructors/ctors-bigint/no-args/custom-proto-access-throws.js -skip script test262/built-ins/TypedArrayConstructors/ctors-bigint/no-args/proto-from-ctor-realm.js -skip script test262/built-ins/TypedArrayConstructors/ctors-bigint/no-args/undefined-newtarget-throws.js -skip script test262/built-ins/TypedArrayConstructors/ctors-bigint/no-args/use-default-proto-if-custom-proto-is-not-object.js -skip script test262/built-ins/TypedArrayConstructors/ctors-bigint/no-args/new-instance-extensibility.js -skip script test262/built-ins/TypedArrayConstructors/ctors-bigint/object-arg/undefined-tobigint.js -skip script test262/built-ins/TypedArrayConstructors/ctors-bigint/object-arg/throws-setting-obj-valueof.js -skip script test262/built-ins/TypedArrayConstructors/ctors-bigint/object-arg/string-tobigint.js -skip script test262/built-ins/TypedArrayConstructors/ctors-bigint/object-arg/length-throws.js -skip script test262/built-ins/TypedArrayConstructors/ctors-bigint/object-arg/iterating-throws.js -skip script test262/built-ins/TypedArrayConstructors/ctors-bigint/object-arg/boolean-tobigint.js -skip script test262/built-ins/TypedArrayConstructors/ctors-bigint/object-arg/bigint-tobigint64.js -skip script test262/built-ins/TypedArrayConstructors/ctors-bigint/object-arg/use-custom-proto-if-object.js -skip script test262/built-ins/TypedArrayConstructors/ctors-bigint/object-arg/custom-proto-access-throws.js -skip script test262/built-ins/TypedArrayConstructors/ctors-bigint/object-arg/iterator-not-callable-throws.js -skip script test262/built-ins/TypedArrayConstructors/ctors-bigint/object-arg/length-excessive-throws.js -skip script test262/built-ins/TypedArrayConstructors/ctors-bigint/object-arg/number-tobigint.js -skip script test262/built-ins/TypedArrayConstructors/ctors-bigint/object-arg/throws-setting-property.js -skip script test262/built-ins/TypedArrayConstructors/ctors-bigint/object-arg/null-tobigint.js -skip script test262/built-ins/TypedArrayConstructors/ctors-bigint/object-arg/throws-setting-obj-tostring.js -skip script test262/built-ins/TypedArrayConstructors/ctors-bigint/object-arg/throws-setting-obj-valueof-typeerror.js -skip script test262/built-ins/TypedArrayConstructors/ctors-bigint/object-arg/throws-setting-obj-to-primitive.js -skip script test262/built-ins/TypedArrayConstructors/ctors-bigint/object-arg/symbol-tobigint.js -skip script test262/built-ins/TypedArrayConstructors/ctors-bigint/object-arg/throws-from-property.js -skip script test262/built-ins/TypedArrayConstructors/ctors-bigint/object-arg/iterator-throws.js -skip script test262/built-ins/TypedArrayConstructors/ctors-bigint/object-arg/as-generator-iterable-returns.js -skip script test262/built-ins/TypedArrayConstructors/ctors-bigint/object-arg/proto-from-ctor-realm.js -skip script test262/built-ins/TypedArrayConstructors/ctors-bigint/object-arg/as-array-returns.js -skip script test262/built-ins/TypedArrayConstructors/ctors-bigint/object-arg/string-nan-tobigint.js -skip script test262/built-ins/TypedArrayConstructors/ctors-bigint/object-arg/bigint-tobiguint64.js -skip script test262/built-ins/TypedArrayConstructors/ctors-bigint/object-arg/length-is-symbol-throws.js -skip script test262/built-ins/TypedArrayConstructors/ctors-bigint/object-arg/throws-setting-obj-to-primitive-typeerror.js -skip script test262/built-ins/TypedArrayConstructors/ctors-bigint/object-arg/undefined-newtarget-throws.js -skip script test262/built-ins/TypedArrayConstructors/ctors-bigint/object-arg/throws-setting-symbol-property.js -skip script test262/built-ins/TypedArrayConstructors/ctors-bigint/object-arg/use-default-proto-if-custom-proto-is-not-object.js -skip script test262/built-ins/TypedArrayConstructors/ctors-bigint/object-arg/new-instance-extensibility.js -skip script test262/built-ins/TypedArrayConstructors/ctors-bigint/typedarray-arg/other-ctor-buffer-ctor-not-object-throws.js -skip script test262/built-ins/TypedArrayConstructors/ctors-bigint/typedarray-arg/other-ctor-buffer-ctor-access-throws.js -skip script test262/built-ins/TypedArrayConstructors/ctors-bigint/typedarray-arg/detached-when-species-retrieved-same-type.js -skip script test262/built-ins/TypedArrayConstructors/ctors-bigint/typedarray-arg/custom-proto-access-throws.js -skip script test262/built-ins/TypedArrayConstructors/ctors-bigint/typedarray-arg/other-ctor-buffer-ctor-species-prototype-throws.js -skip script test262/built-ins/TypedArrayConstructors/ctors-bigint/typedarray-arg/detached-when-species-retrieved-different-type.js -skip script test262/built-ins/TypedArrayConstructors/ctors-bigint/typedarray-arg/same-ctor-buffer-ctor-species-custom-proto-from-ctor-realm.js -skip script test262/built-ins/TypedArrayConstructors/ctors-bigint/typedarray-arg/other-ctor-returns-new-typedarray.js -skip script test262/built-ins/TypedArrayConstructors/ctors-bigint/typedarray-arg/same-ctor-buffer-ctor-species-not-ctor.js -skip script test262/built-ins/TypedArrayConstructors/ctors-bigint/typedarray-arg/same-ctor-buffer-ctor-species-throws.js -skip script test262/built-ins/TypedArrayConstructors/ctors-bigint/typedarray-arg/same-ctor-buffer-ctor-species-prototype-throws.js -skip script test262/built-ins/TypedArrayConstructors/ctors-bigint/typedarray-arg/same-ctor-returns-new-cloned-typedarray.js -skip script test262/built-ins/TypedArrayConstructors/ctors-bigint/typedarray-arg/other-ctor-buffer-ctor-species-null.js -skip script test262/built-ins/TypedArrayConstructors/ctors-bigint/typedarray-arg/proto-from-ctor-realm.js -skip script test262/built-ins/TypedArrayConstructors/ctors-bigint/typedarray-arg/same-ctor-buffer-ctor-species-null.js -skip script test262/built-ins/TypedArrayConstructors/ctors-bigint/typedarray-arg/same-ctor-buffer-ctor-value-not-obj-throws.js -skip script test262/built-ins/TypedArrayConstructors/ctors-bigint/typedarray-arg/other-ctor-buffer-ctor-custom-species.js -skip script test262/built-ins/TypedArrayConstructors/ctors-bigint/typedarray-arg/other-ctor-buffer-ctor-species-undefined.js -skip script test262/built-ins/TypedArrayConstructors/ctors-bigint/typedarray-arg/undefined-newtarget-throws.js -skip script test262/built-ins/TypedArrayConstructors/ctors-bigint/typedarray-arg/same-ctor-buffer-ctor-species-undefined.js -skip script test262/built-ins/TypedArrayConstructors/ctors-bigint/typedarray-arg/same-ctor-buffer-ctor-species-custom.js -skip script test262/built-ins/TypedArrayConstructors/ctors-bigint/typedarray-arg/src-typedarray-not-big-throws.js -skip script test262/built-ins/TypedArrayConstructors/ctors-bigint/typedarray-arg/other-ctor-buffer-ctor-species-access-throws.js -skip script test262/built-ins/TypedArrayConstructors/ctors-bigint/typedarray-arg/other-ctor-buffer-ctor-species-not-ctor-throws.js -skip script test262/built-ins/TypedArrayConstructors/ctors-bigint/typedarray-arg/same-ctor-buffer-ctor-access-throws.js -skip script test262/built-ins/TypedArrayConstructors/ctors-bigint/typedarray-arg/other-ctor-buffer-ctor-custom-species-proto-from-ctor-realm.js -skip script test262/built-ins/TypedArrayConstructors/ctors-bigint/typedarray-arg/new-instance-extensibility.js -skip script test262/built-ins/TypedArrayConstructors/ctors-bigint/buffer-arg/byteoffset-is-negative-throws-sab.js -skip script test262/built-ins/TypedArrayConstructors/ctors-bigint/buffer-arg/bufferbyteoffset-throws-from-modulo-element-size-sab.js -skip script test262/built-ins/TypedArrayConstructors/ctors-bigint/buffer-arg/use-default-proto-if-custom-proto-is-not-object-sab.js -skip script test262/built-ins/TypedArrayConstructors/ctors-bigint/buffer-arg/excessive-length-throws.js -skip script test262/built-ins/TypedArrayConstructors/ctors-bigint/buffer-arg/defined-length-and-offset-sab.js -skip script test262/built-ins/TypedArrayConstructors/ctors-bigint/buffer-arg/returns-new-instance-sab.js -skip script test262/built-ins/TypedArrayConstructors/ctors-bigint/buffer-arg/is-referenced-sab.js -skip script test262/built-ins/TypedArrayConstructors/ctors-bigint/buffer-arg/byteoffset-is-symbol-throws.js -skip script test262/built-ins/TypedArrayConstructors/ctors-bigint/buffer-arg/defined-offset-sab.js -skip script test262/built-ins/TypedArrayConstructors/ctors-bigint/buffer-arg/excessive-offset-throws.js -skip script test262/built-ins/TypedArrayConstructors/ctors-bigint/buffer-arg/use-custom-proto-if-object.js -skip script test262/built-ins/TypedArrayConstructors/ctors-bigint/buffer-arg/byteoffset-throws-from-modulo-element-size.js -skip script test262/built-ins/TypedArrayConstructors/ctors-bigint/buffer-arg/custom-proto-access-throws.js -skip script test262/built-ins/TypedArrayConstructors/ctors-bigint/buffer-arg/typedarray-backed-by-sharedarraybuffer.js -skip script test262/built-ins/TypedArrayConstructors/ctors-bigint/buffer-arg/toindex-byteoffset-sab.js -skip script test262/built-ins/TypedArrayConstructors/ctors-bigint/buffer-arg/toindex-bytelength-sab.js -skip script test262/built-ins/TypedArrayConstructors/ctors-bigint/buffer-arg/length-is-symbol-throws-sab.js -skip script test262/built-ins/TypedArrayConstructors/ctors-bigint/buffer-arg/invoked-with-undefined-newtarget-sab.js -skip script test262/built-ins/TypedArrayConstructors/ctors-bigint/buffer-arg/byteoffset-to-number-throws-sab.js -skip script test262/built-ins/TypedArrayConstructors/ctors-bigint/buffer-arg/use-custom-proto-if-object-sab.js -skip script test262/built-ins/TypedArrayConstructors/ctors-bigint/buffer-arg/length-access-throws-sab.js -skip script test262/built-ins/TypedArrayConstructors/ctors-bigint/buffer-arg/invoked-with-undefined-newtarget.js -skip script test262/built-ins/TypedArrayConstructors/ctors-bigint/buffer-arg/byteoffset-to-number-detachbuffer.js -skip script test262/built-ins/TypedArrayConstructors/ctors-bigint/buffer-arg/toindex-bytelength.js -skip script test262/built-ins/TypedArrayConstructors/ctors-bigint/buffer-arg/byteoffset-is-symbol-throws-sab.js -skip script test262/built-ins/TypedArrayConstructors/ctors-bigint/buffer-arg/byteoffset-is-negative-zero-sab.js -skip script test262/built-ins/TypedArrayConstructors/ctors-bigint/buffer-arg/new-instance-extensibility-sab.js -skip script test262/built-ins/TypedArrayConstructors/ctors-bigint/buffer-arg/excessive-length-throws-sab.js -skip script test262/built-ins/TypedArrayConstructors/ctors-bigint/buffer-arg/byteoffset-throws-from-modulo-element-size-sab.js -skip script test262/built-ins/TypedArrayConstructors/ctors-bigint/buffer-arg/defined-negative-length-sab.js -skip script test262/built-ins/TypedArrayConstructors/ctors-bigint/buffer-arg/length-to-number-detachbuffer.js -skip script test262/built-ins/TypedArrayConstructors/ctors-bigint/buffer-arg/returns-new-instance.js -skip script test262/built-ins/TypedArrayConstructors/ctors-bigint/buffer-arg/proto-from-ctor-realm.js -skip script test262/built-ins/TypedArrayConstructors/ctors-bigint/buffer-arg/toindex-byteoffset.js -skip script test262/built-ins/TypedArrayConstructors/ctors-bigint/buffer-arg/detachedbuffer.js -skip script test262/built-ins/TypedArrayConstructors/ctors-bigint/buffer-arg/defined-length-and-offset.js -skip script test262/built-ins/TypedArrayConstructors/ctors-bigint/buffer-arg/defined-offset.js -skip script test262/built-ins/TypedArrayConstructors/ctors-bigint/buffer-arg/is-referenced.js -skip script test262/built-ins/TypedArrayConstructors/ctors-bigint/buffer-arg/byteoffset-to-number-throws.js -skip script test262/built-ins/TypedArrayConstructors/ctors-bigint/buffer-arg/defined-length.js -skip script test262/built-ins/TypedArrayConstructors/ctors-bigint/buffer-arg/byteoffset-is-negative-zero.js -skip script test262/built-ins/TypedArrayConstructors/ctors-bigint/buffer-arg/length-is-symbol-throws.js -skip script test262/built-ins/TypedArrayConstructors/ctors-bigint/buffer-arg/bufferbyteoffset-throws-from-modulo-element-size.js -skip script test262/built-ins/TypedArrayConstructors/ctors-bigint/buffer-arg/defined-negative-length.js -skip script test262/built-ins/TypedArrayConstructors/ctors-bigint/buffer-arg/defined-length-sab.js -skip script test262/built-ins/TypedArrayConstructors/ctors-bigint/buffer-arg/length-access-throws.js -skip script test262/built-ins/TypedArrayConstructors/ctors-bigint/buffer-arg/excessive-offset-throws-sab.js -skip script test262/built-ins/TypedArrayConstructors/ctors-bigint/buffer-arg/proto-from-ctor-realm-sab.js -skip script test262/built-ins/TypedArrayConstructors/ctors-bigint/buffer-arg/byteoffset-is-negative-throws.js -skip script test262/built-ins/TypedArrayConstructors/ctors-bigint/buffer-arg/use-default-proto-if-custom-proto-is-not-object.js -skip script test262/built-ins/TypedArrayConstructors/ctors-bigint/buffer-arg/custom-proto-access-throws-sab.js -skip script test262/built-ins/TypedArrayConstructors/ctors-bigint/buffer-arg/new-instance-extensibility.js -skip script test262/built-ins/TypedArrayConstructors/ctors-bigint/length-arg/use-custom-proto-if-object.js -skip script test262/built-ins/TypedArrayConstructors/ctors-bigint/length-arg/returns-object.js -skip script test262/built-ins/TypedArrayConstructors/ctors-bigint/length-arg/custom-proto-access-throws.js -skip script test262/built-ins/TypedArrayConstructors/ctors-bigint/length-arg/is-symbol-throws.js -skip script test262/built-ins/TypedArrayConstructors/ctors-bigint/length-arg/toindex-length.js -skip script test262/built-ins/TypedArrayConstructors/ctors-bigint/length-arg/proto-from-ctor-realm.js -skip script test262/built-ins/TypedArrayConstructors/ctors-bigint/length-arg/init-zeros.js -skip script test262/built-ins/TypedArrayConstructors/ctors-bigint/length-arg/undefined-newtarget-throws.js -skip script test262/built-ins/TypedArrayConstructors/ctors-bigint/length-arg/is-infinity-throws-rangeerror.js -skip script test262/built-ins/TypedArrayConstructors/ctors-bigint/length-arg/is-negative-integer-throws-rangeerror.js -skip script test262/built-ins/TypedArrayConstructors/ctors-bigint/length-arg/use-default-proto-if-custom-proto-is-not-object.js -skip script test262/built-ins/TypedArrayConstructors/ctors-bigint/length-arg/new-instance-extensibility.js -skip script test262/built-ins/TypedArrayConstructors/of/BigInt/argument-number-value-throws.js -skip script test262/built-ins/TypedArrayConstructors/of/BigInt/new-instance.js -skip script test262/built-ins/TypedArrayConstructors/of/BigInt/argument-is-symbol-throws.js -skip script test262/built-ins/TypedArrayConstructors/of/BigInt/inherited.js -skip script test262/built-ins/TypedArrayConstructors/of/BigInt/new-instance-empty.js -skip script test262/built-ins/TypedArrayConstructors/of/BigInt/custom-ctor-does-not-instantiate-ta-throws.js -skip script test262/built-ins/TypedArrayConstructors/of/BigInt/this-is-not-constructor.js -skip script test262/built-ins/TypedArrayConstructors/of/BigInt/invoked-as-func.js -skip script test262/built-ins/TypedArrayConstructors/of/BigInt/custom-ctor-returns-other-instance.js -skip script test262/built-ins/TypedArrayConstructors/of/BigInt/custom-ctor-returns-smaller-instance-throws.js -skip script test262/built-ins/TypedArrayConstructors/of/BigInt/new-instance-using-custom-ctor.js -skip script test262/built-ins/TypedArrayConstructors/of/BigInt/custom-ctor.js -skip script test262/built-ins/TypedArrayConstructors/internals/Get/BigInt/key-is-not-numeric-index.js -skip script test262/built-ins/TypedArrayConstructors/internals/Get/BigInt/detached-buffer-key-is-symbol.js -skip script test262/built-ins/TypedArrayConstructors/internals/Get/BigInt/key-is-symbol.js -skip script test262/built-ins/TypedArrayConstructors/internals/Get/BigInt/key-is-not-minus-zero.js -skip script test262/built-ins/TypedArrayConstructors/internals/Get/BigInt/detached-buffer-key-is-not-numeric-index.js -skip script test262/built-ins/TypedArrayConstructors/internals/Get/BigInt/key-is-not-numeric-index-get-throws.js -skip script test262/built-ins/TypedArrayConstructors/internals/Get/BigInt/key-is-out-of-bounds.js -skip script test262/built-ins/TypedArrayConstructors/internals/Get/BigInt/indexed-value-sab.js -skip script test262/built-ins/TypedArrayConstructors/internals/Get/BigInt/indexed-value.js -skip script test262/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/BigInt/key-is-not-numeric-index.js -skip script test262/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/BigInt/key-is-lower-than-zero.js -skip script test262/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/BigInt/non-extensible-new-key.js -skip script test262/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/BigInt/key-is-numericindex-desc-not-enumerable.js -skip script test262/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/BigInt/key-is-numericindex.js -skip script test262/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/BigInt/key-is-symbol.js -skip script test262/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/BigInt/key-is-numericindex-desc-not-writable.js -skip script test262/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/BigInt/key-is-numericindex-desc-configurable.js -skip script test262/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/BigInt/desc-value-throws.js -skip script test262/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/BigInt/set-value.js -skip script test262/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/BigInt/key-is-numericindex-accessor-desc.js -skip script test262/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/BigInt/non-extensible-redefine-key.js -skip script test262/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/BigInt/key-is-greater-than-last-index.js -skip script test262/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/BigInt/key-is-minus-zero.js -skip script test262/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/BigInt/this-is-not-extensible.js -skip script test262/built-ins/TypedArrayConstructors/internals/Set/BigInt/undefined-tobigint.js -skip script test262/built-ins/TypedArrayConstructors/internals/Set/BigInt/key-is-not-numeric-index.js -skip script test262/built-ins/TypedArrayConstructors/internals/Set/BigInt/string-tobigint.js -skip script test262/built-ins/TypedArrayConstructors/internals/Set/BigInt/detached-buffer-key-is-symbol.js -skip script test262/built-ins/TypedArrayConstructors/internals/Set/BigInt/boolean-tobigint.js -skip script test262/built-ins/TypedArrayConstructors/internals/Set/BigInt/bigint-tobigint64.js -skip script test262/built-ins/TypedArrayConstructors/internals/Set/BigInt/key-is-symbol.js -skip script test262/built-ins/TypedArrayConstructors/internals/Set/BigInt/detached-buffer-key-is-not-numeric-index.js -skip script test262/built-ins/TypedArrayConstructors/internals/Set/BigInt/number-tobigint.js -skip script test262/built-ins/TypedArrayConstructors/internals/Set/BigInt/null-tobigint.js -skip script test262/built-ins/TypedArrayConstructors/internals/Set/BigInt/symbol-tobigint.js -skip script test262/built-ins/TypedArrayConstructors/internals/Set/BigInt/key-is-out-of-bounds.js -skip script test262/built-ins/TypedArrayConstructors/internals/Set/BigInt/string-nan-tobigint.js -skip script test262/built-ins/TypedArrayConstructors/internals/Set/BigInt/key-is-minus-zero.js -skip script test262/built-ins/TypedArrayConstructors/internals/Set/BigInt/bigint-tobiguint64.js -skip script test262/built-ins/TypedArrayConstructors/internals/Set/BigInt/key-is-not-numeric-index-set-throws.js -skip script test262/built-ins/TypedArrayConstructors/internals/Set/BigInt/indexed-value.js -skip script test262/built-ins/TypedArrayConstructors/internals/OwnPropertyKeys/BigInt/integer-indexes.js -skip script test262/built-ins/TypedArrayConstructors/internals/OwnPropertyKeys/BigInt/integer-indexes-and-string-keys.js -skip script test262/built-ins/TypedArrayConstructors/internals/OwnPropertyKeys/BigInt/not-enumerable-keys.js -skip script test262/built-ins/TypedArrayConstructors/internals/OwnPropertyKeys/BigInt/integer-indexes-and-string-and-symbol-keys-.js -skip script test262/built-ins/TypedArrayConstructors/internals/HasProperty/BigInt/detached-buffer-key-is-not-number.js -skip script test262/built-ins/TypedArrayConstructors/internals/HasProperty/BigInt/key-is-not-numeric-index.js -skip script test262/built-ins/TypedArrayConstructors/internals/HasProperty/BigInt/key-is-lower-than-zero.js -skip script test262/built-ins/TypedArrayConstructors/internals/HasProperty/BigInt/detached-buffer-key-is-symbol.js -skip script test262/built-ins/TypedArrayConstructors/internals/HasProperty/BigInt/key-is-symbol.js -skip script test262/built-ins/TypedArrayConstructors/internals/HasProperty/BigInt/abrupt-from-ordinary-has-parent-hasproperty.js -skip script test262/built-ins/TypedArrayConstructors/internals/HasProperty/BigInt/inherited-property.js -skip script test262/built-ins/TypedArrayConstructors/internals/HasProperty/BigInt/key-is-greater-than-last-index.js -skip script test262/built-ins/TypedArrayConstructors/internals/HasProperty/BigInt/key-is-minus-zero.js -skip script test262/built-ins/TypedArrayConstructors/internals/HasProperty/BigInt/indexed-value.js -skip script test262/built-ins/TypedArrayConstructors/internals/GetOwnProperty/BigInt/detached-buffer-key-is-not-number.js -skip script test262/built-ins/TypedArrayConstructors/internals/GetOwnProperty/BigInt/key-is-not-numeric-index.js -skip script test262/built-ins/TypedArrayConstructors/internals/GetOwnProperty/BigInt/detached-buffer-key-is-symbol.js -skip script test262/built-ins/TypedArrayConstructors/internals/GetOwnProperty/BigInt/index-prop-desc.js -skip script test262/built-ins/TypedArrayConstructors/internals/GetOwnProperty/BigInt/key-is-symbol.js -skip script test262/built-ins/TypedArrayConstructors/internals/GetOwnProperty/BigInt/key-is-out-of-bounds.js -skip script test262/built-ins/TypedArrayConstructors/internals/GetOwnProperty/BigInt/key-is-minus-zero.js -skip script test262/built-ins/TypedArrayConstructors/internals/GetOwnProperty/BigInt/key-is-not-integer.js -skip script test262/built-ins/TypedArrayConstructors/ctors/typedarray-arg/src-typedarray-big-throws.js -skip script test262/built-ins/TypedArrayConstructors/prototype/bigint-Symbol.iterator.js -skip script test262/built-ins/TypedArrayConstructors/prototype/reverse/bigint-inherited.js -skip script test262/built-ins/TypedArrayConstructors/prototype/indexOf/bigint-inherited.js -skip script test262/built-ins/TypedArrayConstructors/prototype/lastIndexOf/bigint-inherited.js -skip script test262/built-ins/TypedArrayConstructors/prototype/join/bigint-inherited.js -skip script test262/built-ins/TypedArrayConstructors/prototype/byteLength/bigint-inherited.js -skip script test262/built-ins/TypedArrayConstructors/prototype/findIndex/bigint-inherited.js -skip script test262/built-ins/TypedArrayConstructors/prototype/some/bigint-inherited.js -skip script test262/built-ins/TypedArrayConstructors/prototype/byteOffset/bigint-inherited.js -skip script test262/built-ins/TypedArrayConstructors/prototype/forEach/bigint-inherited.js -skip script test262/built-ins/TypedArrayConstructors/prototype/length/bigint-inherited.js -skip script test262/built-ins/TypedArrayConstructors/prototype/entries/bigint-inherited.js -skip script test262/built-ins/TypedArrayConstructors/prototype/find/bigint-inherited.js -skip script test262/built-ins/TypedArrayConstructors/prototype/slice/bigint-inherited.js -skip script test262/built-ins/TypedArrayConstructors/prototype/Symbol.toStringTag/bigint-inherited.js -skip script test262/built-ins/TypedArrayConstructors/prototype/buffer/bigint-inherited.js -skip script test262/built-ins/TypedArrayConstructors/prototype/keys/bigint-inherited.js -skip script test262/built-ins/TypedArrayConstructors/prototype/filter/bigint-inherited.js -skip script test262/built-ins/TypedArrayConstructors/prototype/subarray/bigint-inherited.js -skip script test262/built-ins/TypedArrayConstructors/prototype/values/bigint-inherited.js -skip script test262/built-ins/TypedArrayConstructors/prototype/toLocaleString/bigint-inherited.js -skip script test262/built-ins/TypedArrayConstructors/prototype/toString/bigint-inherited.js -skip script test262/built-ins/TypedArrayConstructors/prototype/every/bigint-inherited.js -skip script test262/built-ins/TypedArrayConstructors/prototype/reduce/bigint-inherited.js -skip script test262/built-ins/TypedArrayConstructors/prototype/fill/bigint-inherited.js -skip script test262/built-ins/TypedArrayConstructors/prototype/reduceRight/bigint-inherited.js -skip script test262/built-ins/TypedArrayConstructors/prototype/copyWithin/bigint-inherited.js -skip script test262/built-ins/TypedArrayConstructors/prototype/map/bigint-inherited.js -skip script test262/built-ins/TypedArrayConstructors/prototype/set/bigint-inherited.js -skip script test262/built-ins/TypedArrayConstructors/prototype/sort/bigint-inherited.js # https://bugzilla.mozilla.org/show_bug.cgi?id=1317405 skip script test262/language/computed-property-names/class/static/method-number.js diff --git a/js/src/vm/ArrayBufferObject.h b/js/src/vm/ArrayBufferObject.h index 64688824ae5e..30cf22e455fc 100644 --- a/js/src/vm/ArrayBufferObject.h +++ b/js/src/vm/ArrayBufferObject.h @@ -507,9 +507,11 @@ struct uint8_clamped { explicit uint8_clamped(uint8_t x) { *this = x; } explicit uint8_clamped(uint16_t x) { *this = x; } explicit uint8_clamped(uint32_t x) { *this = x; } + explicit uint8_clamped(uint64_t x) { *this = x; } explicit uint8_clamped(int8_t x) { *this = x; } explicit uint8_clamped(int16_t x) { *this = x; } explicit uint8_clamped(int32_t x) { *this = x; } + explicit uint8_clamped(int64_t x) { *this = x; } explicit uint8_clamped(double x) { *this = x; } uint8_clamped& operator=(const uint8_clamped& x) = default; @@ -529,6 +531,11 @@ struct uint8_clamped { return *this; } + uint8_clamped& operator=(uint64_t x) { + val = (x > 255) ? 255 : uint8_t(x); + return *this; + } + uint8_clamped& operator=(int8_t x) { val = (x >= 0) ? uint8_t(x) : 0; return *this; @@ -544,6 +551,11 @@ struct uint8_clamped { return *this; } + uint8_clamped& operator=(int64_t x) { + val = (x >= 0) ? ((x < 255) ? uint8_t(x) : 255) : 0; + return *this; + } + uint8_clamped& operator=(const double x) { val = uint8_t(ClampDoubleToUint8(x)); return *this; diff --git a/js/src/vm/BigIntType.cpp b/js/src/vm/BigIntType.cpp index 41a7c362fbeb..47d5a6f84951 100644 --- a/js/src/vm/BigIntType.cpp +++ b/js/src/vm/BigIntType.cpp @@ -2688,6 +2688,22 @@ BigInt* js::ToBigInt(JSContext* cx, HandleValue val) { return nullptr; } +JS::Result js::ToBigInt64(JSContext* cx, HandleValue v) { + BigInt* bi = ToBigInt(cx, v); + if (!bi) { + return cx->alreadyReportedError(); + } + return BigInt::toInt64(bi); +} + +JS::Result js::ToBigUint64(JSContext* cx, HandleValue v) { + BigInt* bi = ToBigInt(cx, v); + if (!bi) { + return cx->alreadyReportedError(); + } + return BigInt::toUint64(bi); +} + double BigInt::numberValue(BigInt* x) { if (x->isZero()) { return 0.0; diff --git a/js/src/vm/BigIntType.h b/js/src/vm/BigIntType.h index 0eec1fa7a1c6..793f4ba041ea 100644 --- a/js/src/vm/BigIntType.h +++ b/js/src/vm/BigIntType.h @@ -388,6 +388,8 @@ extern JS::BigInt* ParseBigIntLiteral( JSContext* cx, const mozilla::Range& chars); extern JS::BigInt* ToBigInt(JSContext* cx, JS::Handle v); +extern JS::Result ToBigInt64(JSContext* cx, JS::Handle v); +extern JS::Result ToBigUint64(JSContext* cx, JS::Handle v); } // namespace js diff --git a/js/src/vm/CommonPropertyNames.h b/js/src/vm/CommonPropertyNames.h index 41e59abbf883..0125f5c12f62 100644 --- a/js/src/vm/CommonPropertyNames.h +++ b/js/src/vm/CommonPropertyNames.h @@ -44,6 +44,8 @@ MACRO(async, async, "async") \ MACRO(autoAllocateChunkSize, autoAllocateChunkSize, "autoAllocateChunkSize") \ MACRO(await, await, "await") \ + MACRO(bigint64, bigint64, "bigint64") \ + MACRO(biguint64, biguint64, "biguint64") \ MACRO(Bool8x16, Bool8x16, "Bool8x16") \ MACRO(Bool16x8, Bool16x8, "Bool16x8") \ MACRO(Bool32x4, Bool32x4, "Bool32x4") \ diff --git a/js/src/vm/JSObject.cpp b/js/src/vm/JSObject.cpp index 2cba12712a2f..94f5a4262bd2 100644 --- a/js/src/vm/JSObject.cpp +++ b/js/src/vm/JSObject.cpp @@ -2560,15 +2560,15 @@ bool js::LookupOwnPropertyPure(JSContext* cx, JSObject* obj, jsid id, } static inline bool NativeGetPureInline(NativeObject* pobj, jsid id, - PropertyResult prop, Value* vp) { + PropertyResult prop, Value* vp, + JSContext* cx) { if (prop.isDenseOrTypedArrayElement()) { // For simplicity we ignore the TypedArray with string index case. if (!JSID_IS_INT(id)) { return false; } - *vp = pobj->getDenseOrTypedArrayElement(JSID_TO_INT(id)); - return true; + return pobj->getDenseOrTypedArrayElement(cx, JSID_TO_INT(id), vp); } // Fail if we have a custom getter. @@ -2594,7 +2594,7 @@ bool js::GetPropertyPure(JSContext* cx, JSObject* obj, jsid id, Value* vp) { return true; } - return NativeGetPureInline(&pobj->as(), id, prop, vp); + return NativeGetPureInline(&pobj->as(), id, prop, vp, cx); } bool js::GetOwnPropertyPure(JSContext* cx, JSObject* obj, jsid id, Value* vp, @@ -2611,7 +2611,7 @@ bool js::GetOwnPropertyPure(JSContext* cx, JSObject* obj, jsid id, Value* vp, } *found = true; - return NativeGetPureInline(&obj->as(), id, prop, vp); + return NativeGetPureInline(&obj->as(), id, prop, vp, cx); } static inline bool NativeGetGetterPureInline(PropertyResult prop, diff --git a/js/src/vm/NativeObject-inl.h b/js/src/vm/NativeObject-inl.h index 974808d1fec2..023374b1deeb 100644 --- a/js/src/vm/NativeObject-inl.h +++ b/js/src/vm/NativeObject-inl.h @@ -443,11 +443,15 @@ inline DenseElementResult NativeObject::setOrExtendDenseElements( return DenseElementResult::Success; } -inline Value NativeObject::getDenseOrTypedArrayElement(uint32_t idx) { +template +inline bool NativeObject::getDenseOrTypedArrayElement( + JSContext* cx, uint32_t idx, + typename MaybeRooted::MutableHandleType val) { if (is()) { - return as().getElement(idx); + return as().getElement(cx, idx, val); } - return getDenseElement(idx); + val.set(getDenseElement(idx)); + return true; } MOZ_ALWAYS_INLINE void NativeObject::setSlotWithType(JSContext* cx, diff --git a/js/src/vm/NativeObject.cpp b/js/src/vm/NativeObject.cpp index 463919bf5fb9..0123deba2e39 100644 --- a/js/src/vm/NativeObject.cpp +++ b/js/src/vm/NativeObject.cpp @@ -1525,8 +1525,7 @@ static bool GetExistingPropertyValue(JSContext* cx, HandleNativeObject obj, HandleId id, Handle prop, MutableHandleValue vp) { if (prop.isDenseOrTypedArrayElement()) { - vp.set(obj->getDenseOrTypedArrayElement(JSID_TO_INT(id))); - return true; + return obj->getDenseOrTypedArrayElement(cx, JSID_TO_INT(id), vp); } MOZ_ASSERT(!cx->helperThread()); @@ -1979,10 +1978,9 @@ static bool DefineNonexistentProperty(JSContext* cx, HandleNativeObject obj, // Steps 1-2 are enforced by the caller. // Step 3. - // We still need to call ToNumber, because of its possible side - // effects. - double d; - if (!ToNumber(cx, v, &d)) { + // We still need to call ToNumber or ToBigInt, because of its + // possible side effects. + if (!obj->as().convertForSideEffect(cx, v)) { return false; } @@ -2189,7 +2187,10 @@ bool js::NativeGetOwnPropertyDescriptor( desc.setSetter(nullptr); if (prop.isDenseOrTypedArrayElement()) { - desc.value().set(obj->getDenseOrTypedArrayElement(JSID_TO_INT(id))); + if (!obj->getDenseOrTypedArrayElement(cx, JSID_TO_INT(id), + desc.value())) { + return false; + } } else { RootedShape shape(cx, prop.shape()); if (!NativeGetExistingProperty(cx, obj, obj, shape, desc.value())) { @@ -2508,8 +2509,8 @@ static MOZ_ALWAYS_INLINE bool NativeGetPropertyInline( // Steps 5-8. Special case for dense elements because // GetExistingProperty doesn't support those. if (prop.isDenseOrTypedArrayElement()) { - vp.set(pobj->getDenseOrTypedArrayElement(JSID_TO_INT(id))); - return true; + return pobj->template getDenseOrTypedArrayElement( + cx, JSID_TO_INT(id), vp); } typename MaybeRooted::RootType shape(cx, prop.shape()); @@ -2794,42 +2795,6 @@ static bool SetNonexistentProperty(JSContext* cx, HandleNativeObject obj, return SetPropertyByDefining(cx, id, v, receiver, result); } -// ES2019 draft rev e7dc63fb5d1c26beada9ffc12dc78aa6548f1fb5 -// 9.4.5.9 IntegerIndexedElementSet -static bool SetTypedArrayElement(JSContext* cx, Handle obj, - uint64_t index, HandleValue v, - ObjectOpResult& result) { - // Steps 1-2. Are enforced by the caller. - - // Step 3. - double d; - if (!ToNumber(cx, v, &d)) { - return false; - } - - // Step 5. - if (obj->hasDetachedBuffer()) { - return result.failSoft(JSMSG_TYPED_ARRAY_DETACHED); - } - - // Step 6. Right now we only allow integer indexes. - // Step 7. - - // Step 8. - uint32_t length = obj->length(); - - // Step 9. - if (index >= length) { - return result.failSoft(JSMSG_BAD_INDEX); - } - - // Steps 4, 10-15. - TypedArrayObject::setElement(*obj, index, d); - - // Step 16. - return result.succeed(); -} - // Set an existing own property obj[index] that's a dense element. static bool SetDenseElement(JSContext* cx, HandleNativeObject obj, uint32_t index, HandleValue v, diff --git a/js/src/vm/NativeObject.h b/js/src/vm/NativeObject.h index ffb519dba857..6d0b5f18f1fd 100644 --- a/js/src/vm/NativeObject.h +++ b/js/src/vm/NativeObject.h @@ -1299,7 +1299,10 @@ class NativeObject : public JSObject { inline void setDenseElementHole(JSContext* cx, uint32_t index); inline void removeDenseElementForSparseIndex(JSContext* cx, uint32_t index); - inline Value getDenseOrTypedArrayElement(uint32_t idx); + template + inline bool getDenseOrTypedArrayElement( + JSContext* cx, uint32_t idx, + typename MaybeRooted::MutableHandleType val); inline void copyDenseElements(uint32_t dstStart, const Value* src, uint32_t count); diff --git a/js/src/vm/ObjectGroup.cpp b/js/src/vm/ObjectGroup.cpp index b8527b5e058d..ed77ef05c0ff 100644 --- a/js/src/vm/ObjectGroup.cpp +++ b/js/src/vm/ObjectGroup.cpp @@ -727,6 +727,8 @@ inline const Class* GetClassForProtoKey(JSProtoKey key) { case JSProto_Float32Array: case JSProto_Float64Array: case JSProto_Uint8ClampedArray: + case JSProto_BigInt64Array: + case JSProto_BigUint64Array: return &TypedArrayObject::classes[key - JSProto_Int8Array]; default: diff --git a/js/src/vm/SelfHosting.cpp b/js/src/vm/SelfHosting.cpp index 4a932554ee72..1c9f60840281 100644 --- a/js/src/vm/SelfHosting.cpp +++ b/js/src/vm/SelfHosting.cpp @@ -16,6 +16,7 @@ #include "selfhosted.out.h" #include "builtin/Array.h" +#include "builtin/BigInt.h" #include "builtin/intl/Collator.h" #include "builtin/intl/DateTimeFormat.h" #include "builtin/intl/IntlObject.h" @@ -45,6 +46,7 @@ #include "vm/ArgumentsObject.h" #include "vm/AsyncFunction.h" #include "vm/AsyncIteration.h" +#include "vm/BigIntType.h" #include "vm/Compression.h" #include "vm/GeneratorObject.h" #include "vm/Interpreter.h" @@ -1081,6 +1083,10 @@ static bool intrinsic_GetTypedArrayKind(JSContext* cx, unsigned argc, "TYPEDARRAY_KIND_FLOAT64 doesn't match the scalar type"); static_assert(TYPEDARRAY_KIND_UINT8CLAMPED == Scalar::Type::Uint8Clamped, "TYPEDARRAY_KIND_UINT8CLAMPED doesn't match the scalar type"); + static_assert(TYPEDARRAY_KIND_BIGINT64 == Scalar::Type::BigInt64, + "TYPEDARRAY_KIND_BIGINT64 doesn't match the scalar type"); + static_assert(TYPEDARRAY_KIND_BIGUINT64 == Scalar::Type::BigUint64, + "TYPEDARRAY_KIND_BIGUINT64 doesn't match the scalar type"); JSObject* obj = &args[0].toObject(); Scalar::Type type = JS_GetArrayBufferViewType(obj); @@ -1451,6 +1457,14 @@ struct DisjointElements { CopyValues(dest, src.cast(), count); return; + case Scalar::BigInt64: + CopyValues(dest, src.cast(), count); + return; + + case Scalar::BigUint64: + CopyValues(dest, src.cast(), count); + return; + default: MOZ_CRASH("NonoverlappingSet with bogus from-type"); } @@ -1643,6 +1657,10 @@ static bool IsTypedArrayBitwiseSlice(Scalar::Type sourceType, case Scalar::Float64: return targetType == Scalar::Float64; + case Scalar::BigInt64: + case Scalar::BigUint64: + return targetType == Scalar::BigInt64 || targetType == Scalar::BigUint64; + default: MOZ_CRASH("IsTypedArrayBitwiseSlice with a bogus typed array type"); } @@ -2345,6 +2363,17 @@ static bool intrinsic_CopyDataPropertiesOrGetOwnKeys(JSContext* cx, cx, from, JSITER_OWNONLY | JSITER_HIDDEN | JSITER_SYMBOLS, args.rval()); } +static bool intrinsic_ToBigInt(JSContext* cx, unsigned argc, Value* vp) { + CallArgs args = CallArgsFromVp(argc, vp); + MOZ_ASSERT(args.length() == 1); + BigInt* res = ToBigInt(cx, args[0]); + if (!res) { + return false; + } + args.rval().setBigInt(res); + return true; +} + // The self-hosting global isn't initialized with the normal set of builtins. // Instead, individual C++-implemented functions that're required by // self-hosted code are defined as global functions. Accessing these @@ -2832,6 +2861,8 @@ static const JSFunctionSpec intrinsic_functions[] = { JS_FN("PromiseResolve", intrinsic_PromiseResolve, 2, 0), + JS_FN("ToBigInt", intrinsic_ToBigInt, 1, 0), + JS_FS_END}; void js::FillSelfHostingCompileOptions(CompileOptions& options) { diff --git a/js/src/vm/StructuredClone.cpp b/js/src/vm/StructuredClone.cpp index 5950c762909e..85190e4ef2fd 100644 --- a/js/src/vm/StructuredClone.cpp +++ b/js/src/vm/StructuredClone.cpp @@ -134,8 +134,8 @@ enum StructuredDataType : uint32_t { SCTAG_TYPED_ARRAY_V1_FLOAT64 = SCTAG_TYPED_ARRAY_V1_MIN + Scalar::Float64, SCTAG_TYPED_ARRAY_V1_UINT8_CLAMPED = SCTAG_TYPED_ARRAY_V1_MIN + Scalar::Uint8Clamped, - SCTAG_TYPED_ARRAY_V1_MAX = - SCTAG_TYPED_ARRAY_V1_MIN + Scalar::MaxTypedArrayViewType - 1, + // BigInt64 and BigUint64 are not supported in the v1 format. + SCTAG_TYPED_ARRAY_V1_MAX = SCTAG_TYPED_ARRAY_V1_UINT8_CLAMPED, // Define a separate range of numbers for Transferable-only tags, since // they are not used for persistent clone buffers and therefore do not @@ -2082,7 +2082,7 @@ bool JSStructuredCloneReader::readTypedArray(uint32_t arrayType, uint32_t nelems, MutableHandleValue vp, bool v1Read) { - if (arrayType > Scalar::Uint8Clamped) { + if (arrayType > (v1Read ? Scalar::Uint8Clamped : Scalar::BigUint64)) { JS_ReportErrorNumberASCII(context(), GetErrorMessage, nullptr, JSMSG_SC_BAD_SERIALIZED_DATA, "unhandled typed array element type"); @@ -2153,6 +2153,14 @@ bool JSStructuredCloneReader::readTypedArray(uint32_t arrayType, obj = JS_NewUint8ClampedArrayWithBuffer(context(), buffer, byteOffset, nelems); break; + case Scalar::BigInt64: + obj = + JS_NewBigInt64ArrayWithBuffer(context(), buffer, byteOffset, nelems); + break; + case Scalar::BigUint64: + obj = + JS_NewBigUint64ArrayWithBuffer(context(), buffer, byteOffset, nelems); + break; default: MOZ_CRASH("Can't happen: arrayType range checked above"); } @@ -2349,6 +2357,8 @@ bool JSStructuredCloneReader::readV1ArrayBuffer(uint32_t arrayType, case Scalar::Float32: return in.readArray((uint32_t*)buffer.dataPointer(), nelems); case Scalar::Float64: + case Scalar::BigInt64: + case Scalar::BigUint64: return in.readArray((uint64_t*)buffer.dataPointer(), nelems); default: MOZ_CRASH("Can't happen: arrayType range checked by caller"); diff --git a/js/src/vm/TypedArrayObject-inl.h b/js/src/vm/TypedArrayObject-inl.h index 653f91f6d5ef..101922ad7294 100644 --- a/js/src/vm/TypedArrayObject-inl.h +++ b/js/src/vm/TypedArrayObject-inl.h @@ -70,6 +70,16 @@ inline uint32_t ConvertNumber(float src) { return JS::ToUint32(src); } +template <> +inline int64_t ConvertNumber(float src) { + return JS::ToInt64(src); +} + +template <> +inline uint64_t ConvertNumber(float src) { + return JS::ToUint64(src); +} + template <> inline int8_t ConvertNumber(double src) { return JS::ToInt8(src); @@ -105,6 +115,16 @@ inline uint32_t ConvertNumber(double src) { return JS::ToUint32(src); } +template <> +inline int64_t ConvertNumber(double src) { + return JS::ToInt64(src); +} + +template <> +inline uint64_t ConvertNumber(double src) { + return JS::ToUint64(src); +} + template inline To ConvertNumber(From src) { static_assert( @@ -149,6 +169,16 @@ struct TypeIDOfType { static const JSProtoKey protoKey = JSProto_Uint32Array; }; template <> +struct TypeIDOfType { + static const Scalar::Type id = Scalar::BigInt64; + static const JSProtoKey protoKey = JSProto_BigInt64Array; +}; +template <> +struct TypeIDOfType { + static const Scalar::Type id = Scalar::BigUint64; + static const JSProtoKey protoKey = JSProto_BigUint64Array; +}; +template <> struct TypeIDOfType { static const Scalar::Type id = Scalar::Float32; static const JSProtoKey protoKey = JSProto_Float32Array; @@ -331,6 +361,20 @@ class ElementSpecific { } break; } + case Scalar::BigInt64: { + SharedMem src = data.cast(); + for (uint32_t i = 0; i < count; ++i) { + Ops::store(dest++, ConvertNumber(Ops::load(src++))); + } + break; + } + case Scalar::BigUint64: { + SharedMem src = data.cast(); + for (uint32_t i = 0; i < count; ++i) { + Ops::store(dest++, ConvertNumber(Ops::load(src++))); + } + break; + } case Scalar::Float32: { SharedMem src = data.cast(); for (uint32_t i = 0; i < count; ++i) { @@ -377,12 +421,13 @@ class ElementSpecific { SharedMem dest = target->dataPointerEither().template cast() + offset; - MOZ_ASSERT(!canConvertInfallibly(MagicValue(JS_ELEMENTS_HOLE)), - "the following loop must abort on holes"); + MOZ_ASSERT( + !canConvertInfallibly(MagicValue(JS_ELEMENTS_HOLE), target->type()), + "the following loop must abort on holes"); const Value* srcValues = source->as().getDenseElements(); for (; i < bound; i++) { - if (!canConvertInfallibly(srcValues[i])) { + if (!canConvertInfallibly(srcValues[i], target->type())) { break; } Ops::store(dest + i, infallibleValueToNative(srcValues[i])); @@ -441,7 +486,7 @@ class ElementSpecific { const Value* srcValues = source->getDenseElements(); for (; i < len; i++) { - if (!canConvertInfallibly(srcValues[i])) { + if (!canConvertInfallibly(srcValues[i], target->type())) { break; } Ops::store(dest + i, infallibleValueToNative(srcValues[i])); @@ -560,6 +605,20 @@ class ElementSpecific { } break; } + case Scalar::BigInt64: { + int64_t* src = static_cast(data); + for (uint32_t i = 0; i < len; ++i) { + Ops::store(dest++, ConvertNumber(*src++)); + } + break; + } + case Scalar::BigUint64: { + uint64_t* src = static_cast(data); + for (uint32_t i = 0; i < len; ++i) { + Ops::store(dest++, ConvertNumber(*src++)); + } + break; + } case Scalar::Float32: { float* src = static_cast(data); for (uint32_t i = 0; i < len; ++i) { @@ -583,7 +642,10 @@ class ElementSpecific { return true; } - static bool canConvertInfallibly(const Value& v) { + static bool canConvertInfallibly(const Value& v, Scalar::Type type) { + if (type == Scalar::BigInt64 || type == Scalar::BigUint64) { + return false; + } return v.isNumber() || v.isBoolean() || v.isNull() || v.isUndefined(); } @@ -608,11 +670,21 @@ class ElementSpecific { static bool valueToNative(JSContext* cx, HandleValue v, T* result) { MOZ_ASSERT(!v.isMagic()); - if (MOZ_LIKELY(canConvertInfallibly(v))) { + if (MOZ_LIKELY(canConvertInfallibly(v, TypeIDOfType::id))) { *result = infallibleValueToNative(v); return true; } + if (std::is_same::value) { + JS_TRY_VAR_OR_RETURN_FALSE(cx, *result, ToBigInt64(cx, v)); + return true; + } + + if (std::is_same::value) { + JS_TRY_VAR_OR_RETURN_FALSE(cx, *result, ToBigUint64(cx, v)); + return true; + } + double d; MOZ_ASSERT(v.isString() || v.isObject() || v.isSymbol() || v.isBigInt()); if (!(v.isString() ? StringToNumber(cx, v.toString(), &d) diff --git a/js/src/vm/TypedArrayObject.cpp b/js/src/vm/TypedArrayObject.cpp index 2a74d419b583..893875aaaf6b 100644 --- a/js/src/vm/TypedArrayObject.cpp +++ b/js/src/vm/TypedArrayObject.cpp @@ -67,6 +67,33 @@ using mozilla::IsAsciiDigit; * the subclasses. */ +bool TypedArrayObject::convertForSideEffect(JSContext* cx, + HandleValue v) const { + switch (type()) { + case Scalar::BigInt64: + case Scalar::BigUint64: { + return ToBigInt(cx, v) != nullptr; + } + case Scalar::Int8: + case Scalar::Uint8: + case Scalar::Int16: + case Scalar::Uint16: + case Scalar::Int32: + case Scalar::Uint32: + case Scalar::Float32: + case Scalar::Float64: + case Scalar::Uint8Clamped: { + double ignore; + return ToNumber(cx, v, &ignore); + } + case Scalar::MaxTypedArrayViewType: + case Scalar::Int64: + MOZ_CRASH("Unsupported TypedArray type"); + } + MOZ_ASSERT_UNREACHABLE("Invalid scalar type"); + return false; +} + /* static */ bool TypedArrayObject::is(HandleValue v) { return v.isObject() && v.toObject().is(); @@ -341,29 +368,7 @@ class TypedArrayObjectTemplate : public TypedArrayObject { return v.isObject() && v.toObject().hasClass(instanceClass()); } - static void setIndexValue(TypedArrayObject& tarray, uint32_t index, - double d) { - // If the array is an integer array, we only handle up to - // 32-bit ints from this point on. if we want to handle - // 64-bit ints, we'll need some changes. - - // Assign based on characteristics of the destination type - if (ArrayTypeIsFloatingPoint()) { - setIndex(tarray, index, NativeType(d)); - } else if (ArrayTypeIsUnsigned()) { - MOZ_ASSERT(sizeof(NativeType) <= 4); - uint32_t n = ToUint32(d); - setIndex(tarray, index, NativeType(n)); - } else if (ArrayTypeID() == Scalar::Uint8Clamped) { - // The uint8_clamped type has a special rounding converter - // for doubles. - setIndex(tarray, index, NativeType(d)); - } else { - MOZ_ASSERT(sizeof(NativeType) <= 4); - int32_t n = ToInt32(d); - setIndex(tarray, index, NativeType(n)); - } - } + static bool convertValue(JSContext* cx, HandleValue v, NativeType* result); static TypedArrayObject* newBuiltinClassInstance(JSContext* cx, gc::AllocKind allocKind, @@ -970,9 +975,131 @@ class TypedArrayObjectTemplate : public TypedArrayObject { tarray.dataPointerEither().cast() + index, val); } - static Value getIndexValue(TypedArrayObject* tarray, uint32_t index); + static bool getElement(JSContext* cx, TypedArrayObject* tarray, + uint32_t index, MutableHandleValue val); + static bool getElementPure(TypedArrayObject* tarray, uint32_t index, + Value* vp); + + static bool setElement(JSContext* cx, Handle obj, + uint64_t index, HandleValue v, ObjectOpResult& result); + static bool defineElement(JSContext* cx, HandleObject obj, uint64_t index, + HandleValue v, ObjectOpResult& result); }; +template +bool TypedArrayObjectTemplate::convertValue(JSContext* cx, + HandleValue v, + NativeType* result) { + double d; + if (!ToNumber(cx, v, &d)) { + return false; + } + +#ifdef JS_MORE_DETERMINISTIC + // See the comment in ElementSpecific::doubleToNative. + d = JS::CanonicalizeNaN(d); +#endif + + // Assign based on characteristics of the destination type + if (ArrayTypeIsFloatingPoint()) { + *result = NativeType(d); + } else if (ArrayTypeIsUnsigned()) { + MOZ_ASSERT(sizeof(NativeType) <= 4); + uint32_t n = ToUint32(d); + *result = NativeType(n); + } else if (ArrayTypeID() == Scalar::Uint8Clamped) { + // The uint8_clamped type has a special rounding converter + // for doubles. + *result = NativeType(d); + } else { + MOZ_ASSERT(sizeof(NativeType) <= 4); + int32_t n = ToInt32(d); + *result = NativeType(n); + } + return true; +} + +template <> +bool TypedArrayObjectTemplate::convertValue(JSContext* cx, + HandleValue v, + int64_t* result) { + JS_TRY_VAR_OR_RETURN_FALSE(cx, *result, ToBigInt64(cx, v)); + return true; +} + +template <> +bool TypedArrayObjectTemplate::convertValue(JSContext* cx, + HandleValue v, + uint64_t* result) { + JS_TRY_VAR_OR_RETURN_FALSE(cx, *result, ToBigUint64(cx, v)); + return true; +} + +// https://tc39.github.io/proposal-bigint/#sec-integerindexedelementset +// 7.8 IntegerIndexedElementSet ( O, index, value ) +template +/* static */ bool TypedArrayObjectTemplate::setElement( + JSContext* cx, Handle obj, uint64_t index, HandleValue v, + ObjectOpResult& result) { + // Steps 1-2 are enforced by the caller. + + // Steps 3-6. + NativeType nativeValue; + if (!convertValue(cx, v, &nativeValue)) { + return false; + } + + // Step 8. + if (obj->hasDetachedBuffer()) { + return result.failSoft(JSMSG_TYPED_ARRAY_DETACHED); + } + + // Steps 9-10 are enforced by the caller. + + // Step 11. + uint32_t length = obj->length(); + + // Step 12. + if (index >= length) { + return result.failSoft(JSMSG_BAD_INDEX); + } + + // Steps 7, 13-16. + TypedArrayObjectTemplate::setIndex(*obj, index, nativeValue); + + // Step 17. + return result.succeed(); +} + +// Version of IntegerIndexedElementSet with no length check, used in +// [[DefineOwnProperty]] +template +/* static */ bool TypedArrayObjectTemplate::defineElement( + JSContext* cx, HandleObject obj, uint64_t index, HandleValue v, + ObjectOpResult& result) { + // Steps 1-2 are enforced by the caller. + + // Steps 3-6. + NativeType nativeValue; + if (!convertValue(cx, v, &nativeValue)) { + return false; + } + + // Step 8. + if (obj->as().hasDetachedBuffer()) { + return result.fail(JSMSG_TYPED_ARRAY_DETACHED); + } + + // Steps 9-12 are enforced by the caller. + + // Steps 7, 13-16. + TypedArrayObjectTemplate::setIndex(obj->as(), + index, nativeValue); + + // Step 17. + return result.succeed(); +} + #define CREATE_TYPE_FOR_TYPED_ARRAY(T, N) \ typedef TypedArrayObjectTemplate N##Array; JS_FOR_EACH_TYPED_ARRAY(CREATE_TYPE_FOR_TYPED_ARRAY) @@ -1222,6 +1349,13 @@ template return nullptr; } + // BigInt proposal 7.24, step 19.c. + if (Scalar::isBigIntType(ArrayTypeID()) != + Scalar::isBigIntType(srcArray->type())) { + JS_ReportErrorNumberASCII(cx, GetErrorMessage, nullptr, JSMSG_NOT_BIGINT); + return nullptr; + } + // Steps 3-4 (remaining part), 20-23. Rooted obj( cx, makeInstance(cx, buffer, CreateSingleton::No, 0, elementLength, proto, @@ -1629,6 +1763,12 @@ bool TypedArrayObject::set_impl(JSContext* cx, const CallArgs& args) { return false; } + if (Scalar::isBigIntType(target->type()) != + Scalar::isBigIntType(srcTypedArray->type())) { + JS_ReportErrorNumberASCII(cx, GetErrorMessage, nullptr, JSMSG_NOT_BIGINT); + return false; + } + // Steps 13-21, 23-28. switch (target->type()) { #define SET_FROM_TYPED_ARRAY(T, N) \ @@ -1790,35 +1930,40 @@ static const ClassSpec TypedArrayObjectSharedTypedArrayPrototypeClassSpec = { namespace { -// this default implementation is only valid for integer types -// less than 32-bits in size. +// This default implementation is only valid for integer types less +// than 32-bits in size. template -Value TypedArrayObjectTemplate::getIndexValue( - TypedArrayObject* tarray, uint32_t index) { +bool TypedArrayObjectTemplate::getElementPure( + TypedArrayObject* tarray, uint32_t index, Value* vp) { static_assert(sizeof(NativeType) < 4, "this method must only handle NativeType values that are " "always exact int32_t values"); - return Int32Value(getIndex(tarray, index)); + *vp = Int32Value(getIndex(tarray, index)); + return true; } -// and we need to specialize for 32-bit integers and floats +// We need to specialize for floats and other integer types. template <> -Value TypedArrayObjectTemplate::getIndexValue(TypedArrayObject* tarray, - uint32_t index) { - return Int32Value(getIndex(tarray, index)); +bool TypedArrayObjectTemplate::getElementPure(TypedArrayObject* tarray, + uint32_t index, + Value* vp) { + *vp = Int32Value(getIndex(tarray, index)); + return true; } template <> -Value TypedArrayObjectTemplate::getIndexValue( - TypedArrayObject* tarray, uint32_t index) { +bool TypedArrayObjectTemplate::getElementPure( + TypedArrayObject* tarray, uint32_t index, Value* vp) { uint32_t val = getIndex(tarray, index); - return NumberValue(val); + *vp = NumberValue(val); + return true; } template <> -Value TypedArrayObjectTemplate::getIndexValue(TypedArrayObject* tarray, - uint32_t index) { +bool TypedArrayObjectTemplate::getElementPure(TypedArrayObject* tarray, + uint32_t index, + Value* vp) { float val = getIndex(tarray, index); double dval = val; @@ -1832,12 +1977,14 @@ Value TypedArrayObjectTemplate::getIndexValue(TypedArrayObject* tarray, * This could be removed for platforms/compilers known to convert a 32-bit * non-canonical nan to a 64-bit canonical nan. */ - return DoubleValue(CanonicalizeNaN(dval)); + *vp = DoubleValue(CanonicalizeNaN(dval)); + return true; } template <> -Value TypedArrayObjectTemplate::getIndexValue(TypedArrayObject* tarray, - uint32_t index) { +bool TypedArrayObjectTemplate::getElementPure(TypedArrayObject* tarray, + uint32_t index, + Value* vp) { double val = getIndex(tarray, index); /* @@ -1847,99 +1994,130 @@ Value TypedArrayObjectTemplate::getIndexValue(TypedArrayObject* tarray, * confuse the engine into interpreting a double-typed jsval as an * object-typed jsval. */ - return DoubleValue(CanonicalizeNaN(val)); + *vp = DoubleValue(CanonicalizeNaN(val)); + return true; } +template <> +bool TypedArrayObjectTemplate::getElementPure(TypedArrayObject* tarray, + uint32_t index, + Value* vp) { + return false; +} + +template <> +bool TypedArrayObjectTemplate::getElementPure( + TypedArrayObject* tarray, uint32_t index, Value* vp) { + return false; +} } /* anonymous namespace */ -Value TypedArrayObject::getElement(uint32_t index) { +namespace { + +template +bool TypedArrayObjectTemplate::getElement(JSContext* cx, + TypedArrayObject* tarray, + uint32_t index, + MutableHandleValue val) { + MOZ_ALWAYS_TRUE(getElementPure(tarray, index, val.address())); + return true; +} + +template <> +bool TypedArrayObjectTemplate::getElement(JSContext* cx, + TypedArrayObject* tarray, + uint32_t index, + MutableHandleValue val) { + int64_t n = getIndex(tarray, index); + BigInt* res = BigInt::createFromInt64(cx, n); + if (!res) { + return false; + } + val.setBigInt(res); + return true; +} + +template <> +bool TypedArrayObjectTemplate::getElement(JSContext* cx, + TypedArrayObject* tarray, + uint32_t index, + MutableHandleValue val) { + uint64_t n = getIndex(tarray, index); + BigInt* res = BigInt::createFromUint64(cx, n); + if (!res) { + return false; + } + val.setBigInt(res); + return true; +} +} /* anonymous namespace */ + +namespace js { + +template <> +bool TypedArrayObject::getElement(JSContext* cx, uint32_t index, + MutableHandleValue val) { switch (type()) { - case Scalar::Int8: - return Int8Array::getIndexValue(this, index); - case Scalar::Uint8: - return Uint8Array::getIndexValue(this, index); - case Scalar::Int16: - return Int16Array::getIndexValue(this, index); - case Scalar::Uint16: - return Uint16Array::getIndexValue(this, index); - case Scalar::Int32: - return Int32Array::getIndexValue(this, index); - case Scalar::Uint32: - return Uint32Array::getIndexValue(this, index); - case Scalar::Float32: - return Float32Array::getIndexValue(this, index); - case Scalar::Float64: - return Float64Array::getIndexValue(this, index); - case Scalar::Uint8Clamped: - return Uint8ClampedArray::getIndexValue(this, index); - case Scalar::Int64: +#define GET_ELEMENT(T, N) \ + case Scalar::N: \ + return N##Array::getElement(cx, this, index, val); + JS_FOR_EACH_TYPED_ARRAY(GET_ELEMENT) +#undef GET_ELEMENT case Scalar::MaxTypedArrayViewType: + case Scalar::Int64: break; } MOZ_CRASH("Unknown TypedArray type"); } -void TypedArrayObject::setElement(TypedArrayObject& obj, uint32_t index, - double d) { - MOZ_ASSERT(index < obj.length()); +template <> +bool TypedArrayObject::getElement( + JSContext* cx, uint32_t index, + typename MaybeRooted::MutableHandleType vp) { + return getElementPure(index, vp.address()); +} -#ifdef JS_MORE_DETERMINISTIC - // See the comment in ElementSpecific::doubleToNative. - d = JS::CanonicalizeNaN(d); -#endif +} // namespace js - switch (obj.type()) { - case Scalar::Int8: - Int8Array::setIndexValue(obj, index, d); - return; - case Scalar::Uint8: - Uint8Array::setIndexValue(obj, index, d); - return; - case Scalar::Uint8Clamped: - Uint8ClampedArray::setIndexValue(obj, index, d); - return; - case Scalar::Int16: - Int16Array::setIndexValue(obj, index, d); - return; - case Scalar::Uint16: - Uint16Array::setIndexValue(obj, index, d); - return; - case Scalar::Int32: - Int32Array::setIndexValue(obj, index, d); - return; - case Scalar::Uint32: - Uint32Array::setIndexValue(obj, index, d); - return; - case Scalar::Float32: - Float32Array::setIndexValue(obj, index, d); - return; - case Scalar::Float64: - Float64Array::setIndexValue(obj, index, d); - return; - case Scalar::Int64: +bool TypedArrayObject::getElementPure(uint32_t index, Value* vp) { + switch (type()) { +#define GET_ELEMENT_PURE(T, N) \ + case Scalar::N: \ + return N##Array::getElementPure(this, index, vp); + JS_FOR_EACH_TYPED_ARRAY(GET_ELEMENT_PURE) +#undef GET_ELEMENT case Scalar::MaxTypedArrayViewType: + case Scalar::Int64: break; } MOZ_CRASH("Unknown TypedArray type"); } -void TypedArrayObject::getElements(Value* vp) { - uint32_t length = this->length(); - MOZ_ASSERT_IF(length > 0, !hasDetachedBuffer()); +/* static */ +bool TypedArrayObject::getElements(JSContext* cx, Handle tarray, Value* vp) { + uint32_t length = tarray->length(); + MOZ_ASSERT_IF(length > 0, !tarray->hasDetachedBuffer()); - switch (type()) { -#define GET_ELEMENTS(T, N) \ - case Scalar::N: \ - for (uint32_t i = 0; i < length; ++i, ++vp) \ - *vp = N##Array::getIndexValue(this, i); \ - break; + switch (tarray->type()) { +#define GET_ELEMENTS(T, N) \ + case Scalar::N: \ + for (uint32_t i = 0; i < length; ++i, ++vp) { \ + if (!N##Array::getElement(cx, tarray, i, \ + MutableHandleValue::fromMarkedLocation(vp))) { \ + return false; \ + } \ + } \ + return true; JS_FOR_EACH_TYPED_ARRAY(GET_ELEMENTS) #undef GET_ELEMENTS - default: - MOZ_CRASH("Unknown TypedArray type"); + case Scalar::MaxTypedArrayViewType: + case Scalar::Int64: + break; } + + MOZ_CRASH("Unknown TypedArray type"); } /*** @@ -2065,6 +2243,10 @@ bool js::IsTypedArrayConstructor(HandleValue v, uint32_t type) { return IsNativeFunction(v, Int32Array::class_constructor); case Scalar::Uint32: return IsNativeFunction(v, Uint32Array::class_constructor); + case Scalar::BigInt64: + return IsNativeFunction(v, BigInt64Array::class_constructor); + case Scalar::BigUint64: + return IsNativeFunction(v, BigUint64Array::class_constructor); case Scalar::Float32: return IsNativeFunction(v, Float32Array::class_constructor); case Scalar::Float64: @@ -2170,6 +2352,25 @@ template bool js::StringIsTypedArrayIndex(const char16_t* s, size_t length, template bool js::StringIsTypedArrayIndex(const Latin1Char* s, size_t length, uint64_t* indexp); +bool js::SetTypedArrayElement(JSContext* cx, Handle obj, + uint64_t index, HandleValue v, + ObjectOpResult& result) { + TypedArrayObject* tobj = &obj->as(); + + switch (tobj->type()) { +#define SET_TYPED_ARRAY_ELEMENT(T, N) \ + case Scalar::N: \ + return TypedArrayObjectTemplate::setElement(cx, obj, index, v, result); + JS_FOR_EACH_TYPED_ARRAY(SET_TYPED_ARRAY_ELEMENT) +#undef SET_TYPED_ARRAY_ELEMENT + case Scalar::MaxTypedArrayViewType: + case Scalar::Int64: + break; + } + + MOZ_CRASH("Unsupported TypedArray type"); +} + /* ES6 draft rev 34 (2015 Feb 20) 9.4.5.3 [[DefineOwnProperty]] step 3.c. */ bool js::DefineTypedArrayElement(JSContext* cx, HandleObject obj, uint64_t index, @@ -2213,24 +2414,20 @@ bool js::DefineTypedArrayElement(JSContext* cx, HandleObject obj, // Step x. if (desc.hasValue()) { - // The following step numbers refer to 9.4.5.9 - // IntegerIndexedElementSet. - - // Steps 1-2 are enforced by the caller. - - // Step 3. - double numValue; - if (!ToNumber(cx, desc.value(), &numValue)) { - return false; + TypedArrayObject* tobj = &obj->as(); + switch (tobj->type()) { +#define DEFINE_TYPED_ARRAY_ELEMENT(T, N) \ + case Scalar::N: \ + return TypedArrayObjectTemplate::defineElement(cx, obj, index, \ + desc.value(), result); + JS_FOR_EACH_TYPED_ARRAY(DEFINE_TYPED_ARRAY_ELEMENT) +#undef DEFINE_TYPED_ARRAY_ELEMENT + case Scalar::MaxTypedArrayViewType: + case Scalar::Int64: + break; } - // Steps 4-5, 8-9. - if (obj->as().hasDetachedBuffer()) { - return result.fail(JSMSG_TYPED_ARRAY_DETACHED); - } - - // Steps 10-16. - TypedArrayObject::setElement(obj->as(), index, numValue); + MOZ_CRASH("Unsupported TypedArray type"); } // Step xii. diff --git a/js/src/vm/TypedArrayObject.h b/js/src/vm/TypedArrayObject.h index ad38e45fb6b6..d72aac51b631 100644 --- a/js/src/vm/TypedArrayObject.h +++ b/js/src/vm/TypedArrayObject.h @@ -26,7 +26,9 @@ MACRO(uint32_t, Uint32) \ MACRO(float, Float32) \ MACRO(double, Float64) \ - MACRO(uint8_clamped, Uint8Clamped) + MACRO(uint8_clamped, Uint8Clamped) \ + MACRO(int64_t, BigInt64) \ + MACRO(uint64_t, BigUint64) namespace js { @@ -129,14 +131,16 @@ class TypedArrayObject : public ArrayBufferViewObject { void assertZeroLengthArrayData() const {}; #endif - Value getElement(uint32_t index); - static void setElement(TypedArrayObject& obj, uint32_t index, double d); + template + bool getElement(JSContext* cx, uint32_t index, + typename MaybeRooted::MutableHandleType val); + bool getElementPure(uint32_t index, Value* vp); /* * Copy all elements from this typed array to vp. vp must point to rooted * memory. */ - void getElements(Value* vp); + static bool getElements(JSContext* cx, Handle tarray, Value* vp); static bool GetTemplateObjectForNative(JSContext* cx, Native native, const JS::HandleValueArray args, @@ -186,6 +190,8 @@ class TypedArrayObject : public ArrayBufferViewObject { static bool set(JSContext* cx, unsigned argc, Value* vp); + bool convertForSideEffect(JSContext* cx, HandleValue v) const; + private: static bool set_impl(JSContext* cx, const CallArgs& args); }; @@ -267,6 +273,10 @@ inline bool IsTypedArrayIndex(jsid id, uint64_t* indexp) { return StringIsTypedArrayIndex(s, length, indexp); } +bool SetTypedArrayElement(JSContext* cx, Handle obj, + uint64_t index, HandleValue v, + ObjectOpResult& result); + /* * Implements [[DefineOwnProperty]] for TypedArrays when the property * key is a TypedArray index. @@ -288,6 +298,8 @@ static inline constexpr unsigned TypedArrayShift(Scalar::Type viewType) { case Scalar::Uint32: case Scalar::Float32: return 2; + case Scalar::BigInt64: + case Scalar::BigUint64: case Scalar::Int64: case Scalar::Float64: return 3; diff --git a/js/src/wasm/AsmJS.cpp b/js/src/wasm/AsmJS.cpp index dc7097d1c320..29ad0876aadd 100644 --- a/js/src/wasm/AsmJS.cpp +++ b/js/src/wasm/AsmJS.cpp @@ -6594,6 +6594,10 @@ static bool ValidateArrayView(JSContext* cx, const AsmJSGlobal& global, return true; } + if (Scalar::isBigIntType(global.viewType())) { + return LinkFail(cx, "bad typed array constructor"); + } + RootedValue v(cx); if (!GetDataProperty(cx, globalVal, global.field(), &v)) { return false;