WebKit Bugzilla
Attachment 341852 Details for
Bug 186238
: REGRESSION(r232439): It breaks gtk-linux-32-release (Requested by caiolima on #webkit).
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
ROLLOUT of r232439
bug-186238-20180602180521.patch (text/plain), 69.74 KB, created by
WebKit Commit Bot
on 2018-06-02 15:05:22 PDT
(
hide
)
Description:
ROLLOUT of r232439
Filename:
MIME Type:
Creator:
WebKit Commit Bot
Created:
2018-06-02 15:05:22 PDT
Size:
69.74 KB
patch
obsolete
>Subversion Revision: 232444 >diff --git a/Source/JavaScriptCore/ChangeLog b/Source/JavaScriptCore/ChangeLog >index 9fb98b5e0344af42517574926e147b21df9912f9..489de9ce48be347583018783365238c5c3f85637 100644 >--- a/Source/JavaScriptCore/ChangeLog >+++ b/Source/JavaScriptCore/ChangeLog >@@ -1,3 +1,17 @@ >+2018-06-02 Commit Queue <commit-queue@webkit.org> >+ >+ Unreviewed, rolling out r232439. >+ https://bugs.webkit.org/show_bug.cgi?id=186238 >+ >+ It breaks gtk-linux-32-release (Requested by caiolima on >+ #webkit). >+ >+ Reverted changeset: >+ >+ "[ESNext][BigInt] Implement support for addition operations" >+ https://bugs.webkit.org/show_bug.cgi?id=179002 >+ https://trac.webkit.org/changeset/232439 >+ > 2018-06-01 Yusuke Suzuki <utatane.tea@gmail.com> > > Baseline op_jtrue emits an insane amount of code >diff --git a/Source/JavaScriptCore/jit/JITOperations.cpp b/Source/JavaScriptCore/jit/JITOperations.cpp >index 4bfd122dc23a0bb504e3629eb0c6ea1c6a70507a..d381c1d2f41b9b0d13856eb425c4cd9b655a0b77 100644 >--- a/Source/JavaScriptCore/jit/JITOperations.cpp >+++ b/Source/JavaScriptCore/jit/JITOperations.cpp >@@ -2816,23 +2816,34 @@ EncodedJSValue JIT_OPERATION operationArithNegateOptimize(ExecState* exec, Encod > return JSValue::encode(jsNumber(-number)); > } > >-ALWAYS_INLINE static EncodedJSValue unprofiledSub(ExecState* exec, EncodedJSValue encodedOp1, EncodedJSValue encodedOp2) >+ALWAYS_INLINE static EncodedJSValue unprofiledSub(VM& vm, ExecState* exec, EncodedJSValue encodedOp1, EncodedJSValue encodedOp2) > { >+ auto scope = DECLARE_THROW_SCOPE(vm); > JSValue op1 = JSValue::decode(encodedOp1); > JSValue op2 = JSValue::decode(encodedOp2); >- >- return JSValue::encode(jsSub(exec, op1, op2)); >+ >+ double a = op1.toNumber(exec); >+ RETURN_IF_EXCEPTION(scope, encodedJSValue()); >+ scope.release(); >+ double b = op2.toNumber(exec); >+ return JSValue::encode(jsNumber(a - b)); > } > >-ALWAYS_INLINE static EncodedJSValue profiledSub(ExecState* exec, EncodedJSValue encodedOp1, EncodedJSValue encodedOp2, ArithProfile& arithProfile, bool shouldObserveLHSAndRHSTypes = true) >+ALWAYS_INLINE static EncodedJSValue profiledSub(VM& vm, ExecState* exec, EncodedJSValue encodedOp1, EncodedJSValue encodedOp2, ArithProfile& arithProfile, bool shouldObserveLHSAndRHSTypes = true) > { >+ auto scope = DECLARE_THROW_SCOPE(vm); > JSValue op1 = JSValue::decode(encodedOp1); > JSValue op2 = JSValue::decode(encodedOp2); > > if (shouldObserveLHSAndRHSTypes) > arithProfile.observeLHSAndRHS(op1, op2); > >- JSValue result = jsSub(exec, op1, op2); >+ double a = op1.toNumber(exec); >+ RETURN_IF_EXCEPTION(scope, encodedJSValue()); >+ double b = op2.toNumber(exec); >+ RETURN_IF_EXCEPTION(scope, encodedJSValue()); >+ >+ JSValue result = jsNumber(a - b); > arithProfile.observeResult(result); > return JSValue::encode(result); > } >@@ -2841,7 +2852,7 @@ EncodedJSValue JIT_OPERATION operationValueSub(ExecState* exec, EncodedJSValue e > { > VM* vm = &exec->vm(); > NativeCallFrameTracer tracer(vm, exec); >- return unprofiledSub(exec, encodedOp1, encodedOp2); >+ return unprofiledSub(*vm, exec, encodedOp1, encodedOp2); > } > > EncodedJSValue JIT_OPERATION operationValueSubProfiled(ExecState* exec, EncodedJSValue encodedOp1, EncodedJSValue encodedOp2, ArithProfile* arithProfile) >@@ -2851,7 +2862,7 @@ EncodedJSValue JIT_OPERATION operationValueSubProfiled(ExecState* exec, EncodedJ > VM* vm = &exec->vm(); > NativeCallFrameTracer tracer(vm, exec); > >- return profiledSub(exec, encodedOp1, encodedOp2, *arithProfile); >+ return profiledSub(*vm, exec, encodedOp1, encodedOp2, *arithProfile); > } > > EncodedJSValue JIT_OPERATION operationValueSubOptimize(ExecState* exec, EncodedJSValue encodedOp1, EncodedJSValue encodedOp2, JITSubIC* subIC) >@@ -2868,7 +2879,7 @@ EncodedJSValue JIT_OPERATION operationValueSubOptimize(ExecState* exec, EncodedJ > exec->codeBlock()->dumpMathICStats(); > #endif > >- return unprofiledSub(exec, encodedOp1, encodedOp2); >+ return unprofiledSub(*vm, exec, encodedOp1, encodedOp2); > } > > EncodedJSValue JIT_OPERATION operationValueSubNoOptimize(ExecState* exec, EncodedJSValue encodedOp1, EncodedJSValue encodedOp2, JITSubIC*) >@@ -2876,7 +2887,7 @@ EncodedJSValue JIT_OPERATION operationValueSubNoOptimize(ExecState* exec, Encode > VM* vm = &exec->vm(); > NativeCallFrameTracer tracer(vm, exec); > >- return unprofiledSub(exec, encodedOp1, encodedOp2); >+ return unprofiledSub(*vm, exec, encodedOp1, encodedOp2); > } > > EncodedJSValue JIT_OPERATION operationValueSubProfiledOptimize(ExecState* exec, EncodedJSValue encodedOp1, EncodedJSValue encodedOp2, JITSubIC* subIC) >@@ -2894,7 +2905,7 @@ EncodedJSValue JIT_OPERATION operationValueSubProfiledOptimize(ExecState* exec, > exec->codeBlock()->dumpMathICStats(); > #endif > >- return profiledSub(exec, encodedOp1, encodedOp2, *arithProfile, false); >+ return profiledSub(*vm, exec, encodedOp1, encodedOp2, *arithProfile, false); > } > > EncodedJSValue JIT_OPERATION operationValueSubProfiledNoOptimize(ExecState* exec, EncodedJSValue encodedOp1, EncodedJSValue encodedOp2, JITSubIC* subIC) >@@ -2904,7 +2915,7 @@ EncodedJSValue JIT_OPERATION operationValueSubProfiledNoOptimize(ExecState* exec > > ArithProfile* arithProfile = subIC->arithProfile(); > ASSERT(arithProfile); >- return profiledSub(exec, encodedOp1, encodedOp2, *arithProfile); >+ return profiledSub(*vm, exec, encodedOp1, encodedOp2, *arithProfile); > } > > void JIT_OPERATION operationProcessTypeProfilerLog(ExecState* exec) >diff --git a/Source/JavaScriptCore/runtime/CommonSlowPaths.cpp b/Source/JavaScriptCore/runtime/CommonSlowPaths.cpp >index 2b821708b19dabd1bf992c235100f54b209f9741..b7f093e19ab368214e40fa00b06edf94183ea537 100644 >--- a/Source/JavaScriptCore/runtime/CommonSlowPaths.cpp >+++ b/Source/JavaScriptCore/runtime/CommonSlowPaths.cpp >@@ -405,7 +405,7 @@ SLOW_PATH_DECL(slow_path_negate) > CHECK_EXCEPTION(); > > if (primValue.isBigInt()) { >- JSBigInt* result = JSBigInt::unaryMinus(vm, asBigInt(primValue)); >+ JSBigInt* result = JSBigInt::unaryMinus(exec->vm(), asBigInt(primValue)); > RETURN_WITH_PROFILING(result, { > updateArithProfileForUnaryArithOp(pc, result, operand); > }); >@@ -517,24 +517,10 @@ SLOW_PATH_DECL(slow_path_sub) > BEGIN(); > JSValue left = OP_C(2).jsValue(); > JSValue right = OP_C(3).jsValue(); >- auto leftNumeric = left.toNumeric(exec); >- CHECK_EXCEPTION(); >- auto rightNumeric = right.toNumeric(exec); >- CHECK_EXCEPTION(); >- >- if (WTF::holds_alternative<JSBigInt*>(leftNumeric) || WTF::holds_alternative<JSBigInt*>(rightNumeric)) { >- if (WTF::holds_alternative<JSBigInt*>(leftNumeric) && WTF::holds_alternative<JSBigInt*>(rightNumeric)) { >- JSBigInt* result = JSBigInt::sub(vm, WTF::get<JSBigInt*>(leftNumeric), WTF::get<JSBigInt*>(rightNumeric)); >- RETURN_WITH_PROFILING(result, { >- updateArithProfileForBinaryArithOp(exec, pc, result, left, right); >- }); >- } >- >- THROW(createTypeError(exec, "Invalid mix of BigInt and other type in subtraction.")); >- } >- >- double a = WTF::get<double>(leftNumeric); >- double b = WTF::get<double>(rightNumeric); >+ double a = left.toNumber(exec); >+ if (UNLIKELY(throwScope.exception())) >+ RETURN(JSValue()); >+ double b = right.toNumber(exec); > JSValue result = jsNumber(a - b); > RETURN_WITH_PROFILING(result, { > updateArithProfileForBinaryArithOp(exec, pc, result, left, right); >@@ -553,7 +539,7 @@ SLOW_PATH_DECL(slow_path_div) > > if (WTF::holds_alternative<JSBigInt*>(leftNumeric) || WTF::holds_alternative<JSBigInt*>(rightNumeric)) { > if (WTF::holds_alternative<JSBigInt*>(leftNumeric) && WTF::holds_alternative<JSBigInt*>(rightNumeric)) { >- JSBigInt* result = JSBigInt::divide(exec, WTF::get<JSBigInt*>(leftNumeric), WTF::get<JSBigInt*>(rightNumeric)); >+ JSValue result(JSBigInt::divide(exec, WTF::get<JSBigInt*>(leftNumeric), WTF::get<JSBigInt*>(rightNumeric))); > CHECK_EXCEPTION(); > RETURN_WITH_PROFILING(result, { > updateArithProfileForBinaryArithOp(exec, pc, result, left, right); >diff --git a/Source/JavaScriptCore/runtime/JSBigInt.cpp b/Source/JavaScriptCore/runtime/JSBigInt.cpp >index 4e89641560643e8abbfea0d1a46de9985166ad20..6742d9bc13a255b46b7fdc36b94d0efc35ffb660 100644 >--- a/Source/JavaScriptCore/runtime/JSBigInt.cpp >+++ b/Source/JavaScriptCore/runtime/JSBigInt.cpp >@@ -195,31 +195,31 @@ std::optional<uint8_t> JSBigInt::singleDigitValueForString() > return { }; > } > >-JSBigInt* JSBigInt::parseInt(ExecState* exec, StringView s, ErrorParseMode parserMode) >+JSBigInt* JSBigInt::parseInt(ExecState* state, StringView s, ErrorParseMode parserMode) > { > if (s.is8Bit()) >- return parseInt(exec, s.characters8(), s.length(), parserMode); >- return parseInt(exec, s.characters16(), s.length(), parserMode); >+ return parseInt(state, s.characters8(), s.length(), parserMode); >+ return parseInt(state, s.characters16(), s.length(), parserMode); > } > >-JSBigInt* JSBigInt::parseInt(ExecState* exec, VM& vm, StringView s, uint8_t radix, ErrorParseMode parserMode, ParseIntSign sign) >+JSBigInt* JSBigInt::parseInt(ExecState* state, VM& vm, StringView s, uint8_t radix, ErrorParseMode parserMode, ParseIntSign sign) > { > if (s.is8Bit()) >- return parseInt(exec, vm, s.characters8(), s.length(), 0, radix, parserMode, sign, ParseIntMode::DisallowEmptyString); >- return parseInt(exec, vm, s.characters16(), s.length(), 0, radix, parserMode, sign, ParseIntMode::DisallowEmptyString); >+ return parseInt(state, vm, s.characters8(), s.length(), 0, radix, parserMode, sign, ParseIntMode::DisallowEmptyString); >+ return parseInt(state, vm, s.characters16(), s.length(), 0, radix, parserMode, sign, ParseIntMode::DisallowEmptyString); > } > >-JSBigInt* JSBigInt::stringToBigInt(ExecState* exec, StringView s) >+JSBigInt* JSBigInt::stringToBigInt(ExecState* state, StringView s) > { >- return parseInt(exec, s, ErrorParseMode::IgnoreExceptions); >+ return parseInt(state, s, ErrorParseMode::IgnoreExceptions); > } > >-String JSBigInt::toString(ExecState* exec, unsigned radix) >+String JSBigInt::toString(ExecState* state, unsigned radix) > { > if (this->isZero()) >- return exec->vm().smallStrings.singleCharacterStringRep('0'); >+ return state->vm().smallStrings.singleCharacterStringRep('0'); > >- return toStringGeneric(exec, this, radix); >+ return toStringGeneric(state, this, radix); > } > > inline bool JSBigInt::isZero() >@@ -237,9 +237,9 @@ inline void JSBigInt::inplaceMultiplyAdd(uintptr_t factor, uintptr_t summand) > internalMultiplyAdd(this, factor, summand, length(), this); > } > >-JSBigInt* JSBigInt::multiply(ExecState* exec, JSBigInt* x, JSBigInt* y) >+JSBigInt* JSBigInt::multiply(ExecState* state, JSBigInt* x, JSBigInt* y) > { >- VM& vm = exec->vm(); >+ VM& vm = state->vm(); > > if (x->isZero()) > return x; >@@ -257,14 +257,14 @@ JSBigInt* JSBigInt::multiply(ExecState* exec, JSBigInt* x, JSBigInt* y) > return result->rightTrim(vm); > } > >-JSBigInt* JSBigInt::divide(ExecState* exec, JSBigInt* x, JSBigInt* y) >+JSBigInt* JSBigInt::divide(ExecState* state, JSBigInt* x, JSBigInt* y) > { > // 1. If y is 0n, throw a RangeError exception. >- VM& vm = exec->vm(); >+ VM& vm = state->vm(); > auto scope = DECLARE_THROW_SCOPE(vm); > > if (y->isZero()) { >- throwRangeError(exec, scope, ASCIILiteral("0 is an invalid divisor value.")); >+ throwRangeError(state, scope, ASCIILiteral("0 is an invalid divisor value.")); > return nullptr; > } > >@@ -310,14 +310,14 @@ JSBigInt* JSBigInt::unaryMinus(VM& vm, JSBigInt* x) > return result; > } > >-JSBigInt* JSBigInt::remainder(ExecState* exec, JSBigInt* x, JSBigInt* y) >+JSBigInt* JSBigInt::remainder(ExecState* state, JSBigInt* x, JSBigInt* y) > { > // 1. If y is 0n, throw a RangeError exception. >- VM& vm = exec->vm(); >+ VM& vm = state->vm(); > auto scope = DECLARE_THROW_SCOPE(vm); > > if (y->isZero()) { >- throwRangeError(exec, scope, ASCIILiteral("0 is an invalid divisor value.")); >+ throwRangeError(state, scope, ASCIILiteral("0 is an invalid divisor value.")); > return nullptr; > } > >@@ -346,40 +346,6 @@ JSBigInt* JSBigInt::remainder(ExecState* exec, JSBigInt* x, JSBigInt* y) > return remainder->rightTrim(vm); > } > >-JSBigInt* JSBigInt::add(VM& vm, JSBigInt* x, JSBigInt* y) >-{ >- bool xSign = x->sign(); >- >- // x + y == x + y >- // -x + -y == -(x + y) >- if (xSign == y->sign()) >- return absoluteAdd(vm, x, y, xSign); >- >- // x + -y == x - y == -(y - x) >- // -x + y == y - x == -(x - y) >- ComparisonResult comparisonResult = absoluteCompare(x, y); >- if (comparisonResult == ComparisonResult::GreaterThan || comparisonResult == ComparisonResult::Equal) >- return absoluteSub(vm, x, y, xSign); >- >- return absoluteSub(vm, y, x, !xSign); >-} >- >-JSBigInt* JSBigInt::sub(VM& vm, JSBigInt* x, JSBigInt* y) >-{ >- bool xSign = x->sign(); >- if (xSign != y->sign()) { >- // x - (-y) == x + y >- // (-x) - y == -(x + y) >- return absoluteAdd(vm, x, y, xSign); >- } >- // x - y == -(y - x) >- // (-x) - (-y) == y - x == -(x - y) >- ComparisonResult comparisonResult = absoluteCompare(x, y); >- if (comparisonResult == ComparisonResult::GreaterThan || comparisonResult == ComparisonResult::Equal) >- return absoluteSub(vm, x, y, xSign); >- >- return absoluteSub(vm, y, x, !xSign); >-} > > #if USE(JSVALUE32_64) > #define HAVE_TWO_DIGIT 1 >@@ -678,85 +644,6 @@ inline JSBigInt::ComparisonResult JSBigInt::absoluteCompare(JSBigInt* x, JSBigIn > return x->digit(i) > y->digit(i) ? ComparisonResult::GreaterThan : ComparisonResult::LessThan; > } > >-JSBigInt* JSBigInt::absoluteAdd(VM& vm, JSBigInt* x, JSBigInt* y, bool resultSign) >-{ >- if (x->length() < y->length()) >- return absoluteAdd(vm, y, x, resultSign); >- >- if (x->isZero()) { >- ASSERT(y->isZero()); >- return x; >- } >- >- if (y->isZero()) >- return resultSign == x->sign() ? x : unaryMinus(vm, x); >- >- JSBigInt* result = JSBigInt::createWithLength(vm, x->length() + 1); >- ASSERT(result); >- Digit carry = 0; >- unsigned i = 0; >- for (; i < y->length(); i++) { >- Digit newCarry = 0; >- Digit sum = digitAdd(x->digit(i), y->digit(i), newCarry); >- sum = digitAdd(sum, carry, newCarry); >- result->setDigit(i, sum); >- carry = newCarry; >- } >- >- for (; i < x->length(); i++) { >- Digit newCarry = 0; >- Digit sum = digitAdd(x->digit(i), carry, newCarry); >- result->setDigit(i, sum); >- carry = newCarry; >- } >- >- result->setDigit(i, carry); >- result->setSign(resultSign); >- >- return result->rightTrim(vm); >-} >- >-JSBigInt* JSBigInt::absoluteSub(VM& vm, JSBigInt* x, JSBigInt* y, bool resultSign) >-{ >- ComparisonResult comparisonResult = absoluteCompare(x, y); >- ASSERT(x->length() >= y->length()); >- ASSERT(comparisonResult == ComparisonResult::GreaterThan || comparisonResult == ComparisonResult::Equal); >- >- if (x->isZero()) { >- ASSERT(y->isZero()); >- return x; >- } >- >- if (y->isZero()) >- return resultSign == x->sign() ? x : unaryMinus(vm, x); >- >- if (comparisonResult == ComparisonResult::Equal) >- return JSBigInt::createZero(vm); >- >- JSBigInt* result = JSBigInt::createWithLength(vm, x->length()); >- Digit borrow = 0; >- unsigned i = 0; >- for (; i < y->length(); i++) { >- Digit newBorrow = 0; >- Digit difference = digitSub(x->digit(i), y->digit(i), newBorrow); >- difference = digitSub(difference, borrow, newBorrow); >- result->setDigit(i, difference); >- borrow = newBorrow; >- } >- >- for (; i < x->length(); i++) { >- Digit newBorrow = 0; >- Digit difference = digitSub(x->digit(i), borrow, newBorrow); >- result->setDigit(i, difference); >- borrow = newBorrow; >- } >- >- ASSERT(!borrow); >- result->setSign(resultSign); >- result->rightTrim(vm); >- return result; >-} >- > // Divides {x} by {divisor}, returning the result in {quotient} and {remainder}. > // Mathematically, the contract is: > // quotient = (x - remainder) / divisor, with 0 <= remainder < divisor. >@@ -1041,13 +928,13 @@ uint64_t JSBigInt::calculateMaximumCharactersRequired(unsigned length, unsigned > return maximumCharactersRequired; > } > >-String JSBigInt::toStringGeneric(ExecState* exec, JSBigInt* x, unsigned radix) >+String JSBigInt::toStringGeneric(ExecState* state, JSBigInt* x, unsigned radix) > { > // FIXME: [JSC] Revisit usage of Vector into JSBigInt::toString > // https://bugs.webkit.org/show_bug.cgi?id=18067 > Vector<LChar> resultString; > >- VM& vm = exec->vm(); >+ VM& vm = state->vm(); > > ASSERT(radix >= 2 && radix <= 36); > ASSERT(!x->isZero()); >@@ -1060,7 +947,7 @@ String JSBigInt::toStringGeneric(ExecState* exec, JSBigInt* x, unsigned radix) > > if (maximumCharactersRequired > JSString::MaxLength) { > auto scope = DECLARE_THROW_SCOPE(vm); >- throwOutOfMemoryError(exec, scope); >+ throwOutOfMemoryError(state, scope); > return String(); > } > >@@ -1155,7 +1042,7 @@ JSBigInt* JSBigInt::rightTrim(VM& vm) > return trimmedBigInt; > } > >-JSBigInt* JSBigInt::allocateFor(ExecState* exec, VM& vm, unsigned radix, unsigned charcount) >+JSBigInt* JSBigInt::allocateFor(ExecState* state, VM& vm, unsigned radix, unsigned charcount) > { > ASSERT(2 <= radix && radix <= 36); > >@@ -1177,9 +1064,9 @@ JSBigInt* JSBigInt::allocateFor(ExecState* exec, VM& vm, unsigned radix, unsigne > } > } > >- if (exec) { >+ if (state) { > auto scope = DECLARE_THROW_SCOPE(vm); >- throwOutOfMemoryError(exec, scope); >+ throwOutOfMemoryError(state, scope); > } > return nullptr; > } >@@ -1189,18 +1076,18 @@ size_t JSBigInt::estimatedSize(JSCell* cell) > return Base::estimatedSize(cell) + jsCast<JSBigInt*>(cell)->m_length * sizeof(Digit); > } > >-double JSBigInt::toNumber(ExecState* exec) const >+double JSBigInt::toNumber(ExecState* state) const > { >- VM& vm = exec->vm(); >+ VM& vm = state->vm(); > auto scope = DECLARE_THROW_SCOPE(vm); >- throwTypeError(exec, scope, ASCIILiteral("Conversion from 'BigInt' to 'number' is not allowed.")); >+ throwTypeError(state, scope, ASCIILiteral("Conversion from 'BigInt' to 'number' is not allowed.")); > return 0.0; > } > >-bool JSBigInt::getPrimitiveNumber(ExecState* exec, double& number, JSValue& result) const >+bool JSBigInt::getPrimitiveNumber(ExecState* state, double& number, JSValue& result) const > { > result = this; >- number = toNumber(exec); >+ number = toNumber(state); > return true; > } > >@@ -1210,9 +1097,9 @@ inline size_t JSBigInt::offsetOfData() > } > > template <typename CharType> >-JSBigInt* JSBigInt::parseInt(ExecState* exec, CharType* data, unsigned length, ErrorParseMode errorParseMode) >+JSBigInt* JSBigInt::parseInt(ExecState* state, CharType* data, unsigned length, ErrorParseMode errorParseMode) > { >- VM& vm = exec->vm(); >+ VM& vm = state->vm(); > > unsigned p = 0; > while (p < length && isStrWhiteSpace(data[p])) >@@ -1221,13 +1108,13 @@ JSBigInt* JSBigInt::parseInt(ExecState* exec, CharType* data, unsigned length, > // Check Radix from frist characters > if (static_cast<unsigned>(p) + 1 < static_cast<unsigned>(length) && data[p] == '0') { > if (isASCIIAlphaCaselessEqual(data[p + 1], 'b')) >- return parseInt(exec, vm, data, length, p + 2, 2, errorParseMode, ParseIntSign::Unsigned, ParseIntMode::DisallowEmptyString); >+ return parseInt(state, vm, data, length, p + 2, 2, errorParseMode, ParseIntSign::Unsigned, ParseIntMode::DisallowEmptyString); > > if (isASCIIAlphaCaselessEqual(data[p + 1], 'x')) >- return parseInt(exec, vm, data, length, p + 2, 16, errorParseMode, ParseIntSign::Unsigned, ParseIntMode::DisallowEmptyString); >+ return parseInt(state, vm, data, length, p + 2, 16, errorParseMode, ParseIntSign::Unsigned, ParseIntMode::DisallowEmptyString); > > if (isASCIIAlphaCaselessEqual(data[p + 1], 'o')) >- return parseInt(exec, vm, data, length, p + 2, 8, errorParseMode, ParseIntSign::Unsigned, ParseIntMode::DisallowEmptyString); >+ return parseInt(state, vm, data, length, p + 2, 8, errorParseMode, ParseIntSign::Unsigned, ParseIntMode::DisallowEmptyString); > } > > ParseIntSign sign = ParseIntSign::Unsigned; >@@ -1240,7 +1127,7 @@ JSBigInt* JSBigInt::parseInt(ExecState* exec, CharType* data, unsigned length, > } > } > >- JSBigInt* result = parseInt(exec, vm, data, length, p, 10, errorParseMode, sign); >+ JSBigInt* result = parseInt(state, vm, data, length, p, 10, errorParseMode, sign); > > if (result && !result->isZero()) > result->setSign(sign == ParseIntSign::Signed); >@@ -1249,7 +1136,7 @@ JSBigInt* JSBigInt::parseInt(ExecState* exec, CharType* data, unsigned length, > } > > template <typename CharType> >-JSBigInt* JSBigInt::parseInt(ExecState* exec, VM& vm, CharType* data, unsigned length, unsigned startIndex, unsigned radix, ErrorParseMode errorParseMode, ParseIntSign sign, ParseIntMode parseMode) >+JSBigInt* JSBigInt::parseInt(ExecState* state, VM& vm, CharType* data, unsigned length, unsigned startIndex, unsigned radix, ErrorParseMode errorParseMode, ParseIntSign sign, ParseIntMode parseMode) > { > ASSERT(length >= 0); > unsigned p = startIndex; >@@ -1257,9 +1144,9 @@ JSBigInt* JSBigInt::parseInt(ExecState* exec, VM& vm, CharType* data, unsigned l > auto scope = DECLARE_THROW_SCOPE(vm); > > if (parseMode != ParseIntMode::AllowEmptyString && startIndex == length) { >- ASSERT(exec); >+ ASSERT(state); > if (errorParseMode == ErrorParseMode::ThrowExceptions) >- throwVMError(exec, scope, createSyntaxError(exec, "Failed to parse String to BigInt")); >+ throwVMError(state, scope, createSyntaxError(state, "Failed to parse String to BigInt")); > return nullptr; > } > >@@ -1281,7 +1168,7 @@ JSBigInt* JSBigInt::parseInt(ExecState* exec, VM& vm, CharType* data, unsigned l > unsigned limita = 'a' + (radix - 10); > unsigned limitA = 'A' + (radix - 10); > >- JSBigInt* result = allocateFor(exec, vm, radix, length - p); >+ JSBigInt* result = allocateFor(state, vm, radix, length - p); > RETURN_IF_EXCEPTION(scope, nullptr); > > result->initialize(InitializationType::WithZero); >@@ -1304,9 +1191,9 @@ JSBigInt* JSBigInt::parseInt(ExecState* exec, VM& vm, CharType* data, unsigned l > if (p == length) > return result->rightTrim(vm); > >- ASSERT(exec); >+ ASSERT(state); > if (errorParseMode == ErrorParseMode::ThrowExceptions) >- throwVMError(exec, scope, createSyntaxError(exec, "Failed to parse String to BigInt")); >+ throwVMError(state, scope, createSyntaxError(state, "Failed to parse String to BigInt")); > > return nullptr; > } >diff --git a/Source/JavaScriptCore/runtime/JSBigInt.h b/Source/JavaScriptCore/runtime/JSBigInt.h >index 4af7a5f7f24366c37450c9642e412605b06043d5..fba5a6d2d6f386ca98897a8ec464c84439c84424 100644 >--- a/Source/JavaScriptCore/runtime/JSBigInt.h >+++ b/Source/JavaScriptCore/runtime/JSBigInt.h >@@ -107,8 +107,6 @@ public: > > ComparisonResult static compareToDouble(JSBigInt* x, double y); > >- static JSBigInt* add(VM&, JSBigInt* x, JSBigInt* y); >- static JSBigInt* sub(VM&, JSBigInt* x, JSBigInt* y); > static JSBigInt* divide(ExecState*, JSBigInt* x, JSBigInt* y); > static JSBigInt* remainder(ExecState*, JSBigInt* x, JSBigInt* y); > static JSBigInt* unaryMinus(VM&, JSBigInt* x); >@@ -171,8 +169,6 @@ private: > JSBigInt* rightTrim(VM&); > > void inplaceMultiplyAdd(Digit multiplier, Digit part); >- static JSBigInt* absoluteAdd(VM&, JSBigInt* x, JSBigInt* y, bool resultSign); >- static JSBigInt* absoluteSub(VM&, JSBigInt* x, JSBigInt* y, bool resultSign); > > static size_t allocationSize(unsigned length); > static size_t offsetOfData(); >diff --git a/Source/JavaScriptCore/runtime/JSCJSValueInlines.h b/Source/JavaScriptCore/runtime/JSCJSValueInlines.h >index 4ba9d507deb5fb5c566ee675b2cf11b10df49c11..f9dc308e704eb7e69f3fba9905dc040dd7ef1090 100644 >--- a/Source/JavaScriptCore/runtime/JSCJSValueInlines.h >+++ b/Source/JavaScriptCore/runtime/JSCJSValueInlines.h >@@ -25,7 +25,6 @@ > > #pragma once > >-#include "CatchScope.h" > #include "Error.h" > #include "ExceptionHelpers.h" > #include "Identifier.h" >diff --git a/Source/JavaScriptCore/runtime/Operations.cpp b/Source/JavaScriptCore/runtime/Operations.cpp >index 03856fa721ab0278a9b073f27f7f5877cb66e463..c11d905c8d67bed495fad34aa2983184d10c97e6 100644 >--- a/Source/JavaScriptCore/runtime/Operations.cpp >+++ b/Source/JavaScriptCore/runtime/Operations.cpp >@@ -23,7 +23,6 @@ > #include "Operations.h" > > #include "Error.h" >-#include "JSBigInt.h" > #include "JSCInlines.h" > #include "JSObject.h" > #include "JSString.h" >@@ -65,19 +64,10 @@ NEVER_INLINE JSValue jsAddSlowCase(CallFrame* callFrame, JSValue v1, JSValue v2) > return jsString(callFrame, p1String, asString(p2)); > } > >- auto leftNumeric = p1.toNumeric(callFrame); >+ double p1Number = p1.toNumber(callFrame); > RETURN_IF_EXCEPTION(scope, { }); >- auto rightNumeric = p2.toNumeric(callFrame); >- RETURN_IF_EXCEPTION(scope, { }); >- >- if (WTF::holds_alternative<JSBigInt*>(leftNumeric) || WTF::holds_alternative<JSBigInt*>(rightNumeric)) { >- if (WTF::holds_alternative<JSBigInt*>(leftNumeric) && WTF::holds_alternative<JSBigInt*>(rightNumeric)) >- return JSBigInt::add(vm, WTF::get<JSBigInt*>(leftNumeric), WTF::get<JSBigInt*>(rightNumeric)); >- >- return throwTypeError(callFrame, scope, ASCIILiteral("Invalid mix of BigInt and other type in addition.")); >- } >- >- return jsNumber(WTF::get<double>(leftNumeric) + WTF::get<double>(rightNumeric)); >+ scope.release(); >+ return jsNumber(p1Number + p2.toNumber(callFrame)); > } > > JSValue jsTypeStringForValue(VM& vm, JSGlobalObject* globalObject, JSValue v) >diff --git a/Source/JavaScriptCore/runtime/Operations.h b/Source/JavaScriptCore/runtime/Operations.h >index 2647c9730dabf4559ed5f62facac4ef0d9fce9ca..f95b9d0d24edfe284db962d150f1a6c782e39f37 100644 >--- a/Source/JavaScriptCore/runtime/Operations.h >+++ b/Source/JavaScriptCore/runtime/Operations.h >@@ -348,26 +348,6 @@ ALWAYS_INLINE JSValue jsAdd(CallFrame* callFrame, JSValue v1, JSValue v2) > return jsAddSlowCase(callFrame, v1, v2); > } > >-ALWAYS_INLINE JSValue jsSub(ExecState* state, JSValue v1, JSValue v2) >-{ >- VM& vm = state->vm(); >- auto scope = DECLARE_THROW_SCOPE(vm); >- >- auto leftNumeric = v1.toNumeric(state); >- RETURN_IF_EXCEPTION(scope, { }); >- auto rightNumeric = v2.toNumeric(state); >- RETURN_IF_EXCEPTION(scope, { }); >- >- if (WTF::holds_alternative<JSBigInt*>(leftNumeric) || WTF::holds_alternative<JSBigInt*>(rightNumeric)) { >- if (WTF::holds_alternative<JSBigInt*>(leftNumeric) && WTF::holds_alternative<JSBigInt*>(rightNumeric)) >- return JSBigInt::sub(vm, WTF::get<JSBigInt*>(leftNumeric), WTF::get<JSBigInt*>(rightNumeric)); >- >- return throwTypeError(state, scope, ASCIILiteral("Invalid mix of BigInt and other type in subtraction.")); >- } >- >- return jsNumber(WTF::get<double>(leftNumeric) - WTF::get<double>(rightNumeric)); >-} >- > ALWAYS_INLINE JSValue jsMul(ExecState* state, JSValue v1, JSValue v2) > { > VM& vm = state->vm(); >diff --git a/JSTests/ChangeLog b/JSTests/ChangeLog >index 8f732f4ae54966b8a67e15d4bdd68e4ddd780b35..7162cd13a402f6a5613af98cf0e7a7afa6305dc0 100644 >--- a/JSTests/ChangeLog >+++ b/JSTests/ChangeLog >@@ -1,3 +1,17 @@ >+2018-06-02 Commit Queue <commit-queue@webkit.org> >+ >+ Unreviewed, rolling out r232439. >+ https://bugs.webkit.org/show_bug.cgi?id=186238 >+ >+ It breaks gtk-linux-32-release (Requested by caiolima on >+ #webkit). >+ >+ Reverted changeset: >+ >+ "[ESNext][BigInt] Implement support for addition operations" >+ https://bugs.webkit.org/show_bug.cgi?id=179002 >+ https://trac.webkit.org/changeset/232439 >+ > 2018-06-01 Yusuke Suzuki <utatane.tea@gmail.com> > > Baseline op_jtrue emits an insane amount of code >diff --git a/JSTests/bigIntTests.yaml b/JSTests/bigIntTests.yaml >index 787834ae639f6a5c00b7c9facaff54c3762f096f..756e49b5c8abdc1320dfdb2bd6863c583084b17b 100644 >--- a/JSTests/bigIntTests.yaml >+++ b/JSTests/bigIntTests.yaml >@@ -187,38 +187,3 @@ > - path: stress/big-int-mod-jit.js > cmd: runBigIntEnabled > >-- path: stress/big-int-add-wrapped-value.js >- cmd: runBigIntEnabled >- >-- path: stress/big-int-addition-basic.js >- cmd: runBigIntEnabled >- >-- path: stress/big-int-addition-jit.js >- cmd: runBigIntEnabled >- >-- path: stress/big-int-addition-memory-stress.js >- cmd: runBigIntEnabled >- >-- path: stress/big-int-addition-string-coercion.js >- cmd: runBigIntEnabled >- >-- path: stress/big-int-addition-to-primitive-precedence.js >- cmd: runBigIntEnabled >- >-- path: stress/big-int-addition-to-primitive.js >- cmd: runBigIntEnabled >- >-- path: stress/big-int-addition-type-error.js >- cmd: runBigIntEnabled >- >-- path: stress/big-int-sub-wrapped-value.js >- cmd: runBigIntEnabled >- >-- path:stress/big-int-subtraction-basic.js >- cmd: runBigIntEnabled >- >-- path: stress/big-int-subtraction-jit.js >- cmd: runBigIntEnabled >- >-- path: stress/big-int-subtraction-type-error.js >- cmd: runBigIntEnabled >diff --git a/JSTests/stress/addition-order-evaluation.js b/JSTests/stress/addition-order-evaluation.js >deleted file mode 100644 >index d06f1aa70ca4242dc26c42a3a10cf6abe019751a..0000000000000000000000000000000000000000 >--- a/JSTests/stress/addition-order-evaluation.js >+++ /dev/null >@@ -1,23 +0,0 @@ >-function assert(a, message) { >- if (!a) >- throw new Error(message); >-} >- >-let o = { >- valueOf: function () { throw new Error("Oops"); } >-}; >- >-try { >- let n = Symbol("3") + o; >- assert(false, message + ": Should throw Error, but executed without exception"); >-} catch (e) { >- assert(e.message === "Oops","Expected Error('Oops'), got: " + e); >-} >- >-try { >- let n = o + Symbol("3"); >- assert(false, message + ": Should throw Error, but executed without exception"); >-} catch (e) { >- assert(e.message === "Oops","Expected Error('Oops'), got: " + e); >-} >- >diff --git a/JSTests/stress/big-int-add-wrapped-value.js b/JSTests/stress/big-int-add-wrapped-value.js >deleted file mode 100644 >index 8a378bfbce6e35ea69347993271c1b7890225756..0000000000000000000000000000000000000000 >--- a/JSTests/stress/big-int-add-wrapped-value.js >+++ /dev/null >@@ -1,37 +0,0 @@ >-//@ runBigIntEnabled >- >-assert = { >- sameValue: function (input, expected, message) { >- if (input !== expected) >- throw new Error(message); >- } >-}; >- >-function testAdd(x, y, z, message) { >- assert.sameValue(x + y, z, message); >- assert.sameValue(y + x, z, message); >-} >- >-testAdd(Object(2n), 1n, 3n, "ToPrimitive: unbox object with internal slot"); >- >-let o = { >- [Symbol.toPrimitive]: function() { >- return 2n; >- } >-}; >-testAdd(o, 1n, 3n, "ToPrimitive: @@toPrimitive"); >- >-o = { >- valueOf: function() { >- return 2n; >- } >-}; >-testAdd(o, 1n, 3n, "ToPrimitive: valueOf"); >- >-o = { >- toString: function() { >- return 2n; >- } >-} >-testAdd(o, 1n, 3n, "ToPrimitive: toString"); >- >diff --git a/JSTests/stress/big-int-addition-basic.js b/JSTests/stress/big-int-addition-basic.js >deleted file mode 100644 >index 9e57febe5e27c2152e54546b1b2b44caaf8f032f..0000000000000000000000000000000000000000 >--- a/JSTests/stress/big-int-addition-basic.js >+++ /dev/null >@@ -1,169 +0,0 @@ >-//@ runBigIntEnabled >- >-assert = { >- sameValue: function (input, expected, message) { >- if (input !== expected) >- throw new Error(message); >- } >-}; >- >-function testAdd(x, y, z) { >- assert.sameValue(x + y, z, x + " + " + y + " = " + z); >- assert.sameValue(y + x, z, y + " + " + x + " = " + z); >-} >- >-testAdd(10n, 239n, 249n); >-testAdd(0xFEDCBA9876543210n, 0xFEDCBA9876543210n, 0x1FDB97530ECA86420n); >-testAdd(0xFEDCBA9876543210n, 0xFEDCBA987654320Fn, 0x1FDB97530ECA8641Fn); >-testAdd(0xFEDCBA9876543210n, 0xFEDCBA98n, 0xFEDCBA997530ECA8n); >-testAdd(0xFEDCBA9876543210n, 0xFEDCBA97n, 0xFEDCBA997530ECA7n); >-testAdd(0xFEDCBA9876543210n, 0x1234n, 0xFEDCBA9876544444n); >-testAdd(0xFEDCBA9876543210n, 0x3n, 0xFEDCBA9876543213n); >-testAdd(0xFEDCBA9876543210n, 0x2n, 0xFEDCBA9876543212n); >-testAdd(0xFEDCBA9876543210n, 0x1n, 0xFEDCBA9876543211n); >-testAdd(0xFEDCBA9876543210n, 0x0n, 0xFEDCBA9876543210n); >-testAdd(0xFEDCBA9876543210n, -0x1n, 0xFEDCBA987654320Fn); >-testAdd(0xFEDCBA9876543210n, -0x2n, 0xFEDCBA987654320En); >-testAdd(0xFEDCBA9876543210n, -0x3n, 0xFEDCBA987654320Dn); >-testAdd(0xFEDCBA9876543210n, -0x1234n, 0xFEDCBA9876541FDCn); >-testAdd(0xFEDCBA9876543210n, -0xFEDCBA97n, 0xFEDCBA9777777779n); >-testAdd(0xFEDCBA9876543210n, -0xFEDCBA98n, 0xFEDCBA9777777778n); >-testAdd(0xFEDCBA9876543210n, -0xFEDCBA987654320Fn, 0x1n); >-testAdd(0xFEDCBA9876543210n, -0xFEDCBA9876543210n, 0x0n); >-testAdd(0xFEDCBA987654320Fn, 0xFEDCBA987654320Fn, 0x1FDB97530ECA8641En); >-testAdd(0xFEDCBA987654320Fn, 0xFEDCBA98n, 0xFEDCBA997530ECA7n); >-testAdd(0xFEDCBA987654320Fn, 0xFEDCBA97n, 0xFEDCBA997530ECA6n); >-testAdd(0xFEDCBA987654320Fn, 0x1234n, 0xFEDCBA9876544443n); >-testAdd(0xFEDCBA987654320Fn, 0x3n, 0xFEDCBA9876543212n); >-testAdd(0xFEDCBA987654320Fn, 0x2n, 0xFEDCBA9876543211n); >-testAdd(0xFEDCBA987654320Fn, 0x1n, 0xFEDCBA9876543210n); >-testAdd(0xFEDCBA987654320Fn, 0x0n, 0xFEDCBA987654320Fn); >-testAdd(0xFEDCBA987654320Fn, -0x1n, 0xFEDCBA987654320En); >-testAdd(0xFEDCBA987654320Fn, -0x2n, 0xFEDCBA987654320Dn); >-testAdd(0xFEDCBA987654320Fn, -0x3n, 0xFEDCBA987654320Cn); >-testAdd(0xFEDCBA987654320Fn, -0x1234n, 0xFEDCBA9876541FDBn); >-testAdd(0xFEDCBA987654320Fn, -0xFEDCBA97n, 0xFEDCBA9777777778n); >-testAdd(0xFEDCBA987654320Fn, -0xFEDCBA98n, 0xFEDCBA9777777777n); >-testAdd(0xFEDCBA987654320Fn, -0xFEDCBA987654320Fn, 0x0n); >-testAdd(0xFEDCBA987654320Fn, -0xFEDCBA9876543210n, -0x1n); >-testAdd(0xFEDCBA98n, 0xFEDCBA98n, 0x1FDB97530n); >-testAdd(0xFEDCBA98n, 0xFEDCBA97n, 0x1FDB9752Fn); >-testAdd(0xFEDCBA98n, 0x1234n, 0xFEDCCCCCn); >-testAdd(0xFEDCBA98n, 0x3n, 0xFEDCBA9Bn); >-testAdd(0xFEDCBA98n, 0x2n, 0xFEDCBA9An); >-testAdd(0xFEDCBA98n, 0x1n, 0xFEDCBA99n); >-testAdd(0xFEDCBA98n, 0x0n, 0xFEDCBA98n); >-testAdd(0xFEDCBA98n, -0x1n, 0xFEDCBA97n); >-testAdd(0xFEDCBA98n, -0x2n, 0xFEDCBA96n); >-testAdd(0xFEDCBA98n, -0x3n, 0xFEDCBA95n); >-testAdd(0xFEDCBA98n, -0x1234n, 0xFEDCA864n); >-testAdd(0xFEDCBA98n, -0xFEDCBA97n, 0x1n); >-testAdd(0xFEDCBA98n, -0xFEDCBA98n, 0x0n); >-testAdd(0xFEDCBA98n, -0xFEDCBA987654320Fn, -0xFEDCBA9777777777n); >-testAdd(0xFEDCBA98n, -0xFEDCBA9876543210n, -0xFEDCBA9777777778n); >-testAdd(0xFEDCBA97n, 0xFEDCBA97n, 0x1FDB9752En); >-testAdd(0xFEDCBA97n, 0x1234n, 0xFEDCCCCBn); >-testAdd(0xFEDCBA97n, 0x3n, 0xFEDCBA9An); >-testAdd(0xFEDCBA97n, 0x2n, 0xFEDCBA99n); >-testAdd(0xFEDCBA97n, 0x1n, 0xFEDCBA98n); >-testAdd(0xFEDCBA97n, 0x0n, 0xFEDCBA97n); >-testAdd(0xFEDCBA97n, -0x1n, 0xFEDCBA96n); >-testAdd(0xFEDCBA97n, -0x2n, 0xFEDCBA95n); >-testAdd(0xFEDCBA97n, -0x3n, 0xFEDCBA94n); >-testAdd(0xFEDCBA97n, -0x1234n, 0xFEDCA863n); >-testAdd(0xFEDCBA97n, -0xFEDCBA97n, 0x0n); >-testAdd(0xFEDCBA97n, -0xFEDCBA98n, -0x1n); >-testAdd(0xFEDCBA97n, -0xFEDCBA987654320Fn, -0xFEDCBA9777777778n); >-testAdd(0xFEDCBA97n, -0xFEDCBA9876543210n, -0xFEDCBA9777777779n); >-testAdd(0x1234n, 0x1234n, 0x2468n); >-testAdd(0x1234n, 0x3n, 0x1237n); >-testAdd(0x1234n, 0x2n, 0x1236n); >-testAdd(0x1234n, 0x1n, 0x1235n); >-testAdd(0x1234n, 0x0n, 0x1234n); >-testAdd(0x1234n, -0x1n, 0x1233n); >-testAdd(0x1234n, -0x2n, 0x1232n); >-testAdd(0x1234n, -0x3n, 0x1231n); >-testAdd(0x1234n, -0x1234n, 0x0n); >-testAdd(0x1234n, -0xFEDCBA97n, -0xFEDCA863n); >-testAdd(0x1234n, -0xFEDCBA98n, -0xFEDCA864n); >-testAdd(0x1234n, -0xFEDCBA987654320Fn, -0xFEDCBA9876541FDBn); >-testAdd(0x1234n, -0xFEDCBA9876543210n, -0xFEDCBA9876541FDCn); >-testAdd(0x3n, 0x3n, 0x6n); >-testAdd(0x3n, 0x2n, 0x5n); >-testAdd(0x3n, 0x1n, 0x4n); >-testAdd(0x3n, 0x0n, 0x3n); >-testAdd(0x3n, -0x1n, 0x2n); >-testAdd(0x3n, -0x2n, 0x1n); >-testAdd(0x3n, -0x3n, 0x0n); >-testAdd(0x3n, -0x1234n, -0x1231n); >-testAdd(0x3n, -0xFEDCBA97n, -0xFEDCBA94n); >-testAdd(0x3n, -0xFEDCBA98n, -0xFEDCBA95n); >-testAdd(0x3n, -0xFEDCBA987654320Fn, -0xFEDCBA987654320Cn); >-testAdd(0x3n, -0xFEDCBA9876543210n, -0xFEDCBA987654320Dn); >-testAdd(0x2n, 0x2n, 0x4n); >-testAdd(0x2n, 0x1n, 0x3n); >-testAdd(0x2n, 0x0n, 0x2n); >-testAdd(0x2n, -0x1n, 0x1n); >-testAdd(0x2n, -0x2n, 0x0n); >-testAdd(0x2n, -0x3n, -0x1n); >-testAdd(0x2n, -0x1234n, -0x1232n); >-testAdd(0x2n, -0xFEDCBA97n, -0xFEDCBA95n); >-testAdd(0x2n, -0xFEDCBA98n, -0xFEDCBA96n); >-testAdd(0x2n, -0xFEDCBA987654320Fn, -0xFEDCBA987654320Dn); >-testAdd(0x2n, -0xFEDCBA9876543210n, -0xFEDCBA987654320En); >-testAdd(0x1n, 0x1n, 0x2n); >-testAdd(0x1n, 0x0n, 0x1n); >-testAdd(0x1n, -0x1n, 0x0n); >-testAdd(0x1n, -0x2n, -0x1n); >-testAdd(0x1n, -0x3n, -0x2n); >-testAdd(0x1n, -0x1234n, -0x1233n); >-testAdd(0x1n, -0xFEDCBA97n, -0xFEDCBA96n); >-testAdd(0x1n, -0xFEDCBA98n, -0xFEDCBA97n); >-testAdd(0x1n, -0xFEDCBA987654320Fn, -0xFEDCBA987654320En); >-testAdd(0x1n, -0xFEDCBA9876543210n, -0xFEDCBA987654320Fn); >-testAdd(0x0n, 0x0n, 0x0n); >-testAdd(0x0n, -0x1n, -0x1n); >-testAdd(0x0n, -0x2n, -0x2n); >-testAdd(0x0n, -0x3n, -0x3n); >-testAdd(0x0n, -0x1234n, -0x1234n); >-testAdd(0x0n, -0xFEDCBA97n, -0xFEDCBA97n); >-testAdd(0x0n, -0xFEDCBA98n, -0xFEDCBA98n); >-testAdd(0x0n, -0xFEDCBA987654320Fn, -0xFEDCBA987654320Fn); >-testAdd(0x0n, -0xFEDCBA9876543210n, -0xFEDCBA9876543210n); >-testAdd(-0x1n, -0x1n, -0x2n); >-testAdd(-0x1n, -0x2n, -0x3n); >-testAdd(-0x1n, -0x3n, -0x4n); >-testAdd(-0x1n, -0x1234n, -0x1235n); >-testAdd(-0x1n, -0xFEDCBA97n, -0xFEDCBA98n); >-testAdd(-0x1n, -0xFEDCBA98n, -0xFEDCBA99n); >-testAdd(-0x1n, -0xFEDCBA987654320Fn, -0xFEDCBA9876543210n); >-testAdd(-0x1n, -0xFEDCBA9876543210n, -0xFEDCBA9876543211n); >-testAdd(-0x2n, -0x2n, -0x4n); >-testAdd(-0x2n, -0x3n, -0x5n); >-testAdd(-0x2n, -0x1234n, -0x1236n); >-testAdd(-0x2n, -0xFEDCBA97n, -0xFEDCBA99n); >-testAdd(-0x2n, -0xFEDCBA98n, -0xFEDCBA9An); >-testAdd(-0x2n, -0xFEDCBA987654320Fn, -0xFEDCBA9876543211n); >-testAdd(-0x2n, -0xFEDCBA9876543210n, -0xFEDCBA9876543212n); >-testAdd(-0x3n, -0x3n, -0x6n); >-testAdd(-0x3n, -0x1234n, -0x1237n); >-testAdd(-0x3n, -0xFEDCBA97n, -0xFEDCBA9An); >-testAdd(-0x3n, -0xFEDCBA98n, -0xFEDCBA9Bn); >-testAdd(-0x3n, -0xFEDCBA987654320Fn, -0xFEDCBA9876543212n); >-testAdd(-0x3n, -0xFEDCBA9876543210n, -0xFEDCBA9876543213n); >-testAdd(-0x1234n, -0x1234n, -0x2468n); >-testAdd(-0x1234n, -0xFEDCBA97n, -0xFEDCCCCBn); >-testAdd(-0x1234n, -0xFEDCBA98n, -0xFEDCCCCCn); >-testAdd(-0x1234n, -0xFEDCBA987654320Fn, -0xFEDCBA9876544443n); >-testAdd(-0x1234n, -0xFEDCBA9876543210n, -0xFEDCBA9876544444n); >-testAdd(-0xFEDCBA97n, -0xFEDCBA97n, -0x1FDB9752En); >-testAdd(-0xFEDCBA97n, -0xFEDCBA98n, -0x1FDB9752Fn); >-testAdd(-0xFEDCBA97n, -0xFEDCBA987654320Fn, -0xFEDCBA997530ECA6n); >-testAdd(-0xFEDCBA97n, -0xFEDCBA9876543210n, -0xFEDCBA997530ECA7n); >-testAdd(-0xFEDCBA98n, -0xFEDCBA98n, -0x1FDB97530n); >-testAdd(-0xFEDCBA98n, -0xFEDCBA987654320Fn, -0xFEDCBA997530ECA7n); >-testAdd(-0xFEDCBA98n, -0xFEDCBA9876543210n, -0xFEDCBA997530ECA8n); >-testAdd(-0xFEDCBA987654320Fn, -0xFEDCBA987654320Fn, -0x1FDB97530ECA8641En); >-testAdd(-0xFEDCBA987654320Fn, -0xFEDCBA9876543210n, -0x1FDB97530ECA8641Fn); >-testAdd(-0xFEDCBA9876543210n, -0xFEDCBA9876543210n, -0x1FDB97530ECA86420n); >- >diff --git a/JSTests/stress/big-int-addition-jit.js b/JSTests/stress/big-int-addition-jit.js >deleted file mode 100644 >index 1158e0a0c1241a6dfa3bbdd6a3da958d3326285f..0000000000000000000000000000000000000000 >--- a/JSTests/stress/big-int-addition-jit.js >+++ /dev/null >@@ -1,19 +0,0 @@ >-//@ runBigIntEnabled >- >-let assert = { >- sameValue: function(i, e, m) { >- if (i !== e) >- throw new Error(m); >- } >-} >- >-function bigIntAddition(x, y) { >- return x + y; >-} >-noInline(bigIntAddition); >- >-for (let i = 0; i < 10000; i++) { >- let r = bigIntAddition(3n, 10n); >- assert.sameValue(r, 13n, 3n + " + " + 10n + " = " + r); >-} >- >diff --git a/JSTests/stress/big-int-addition-memory-stress.js b/JSTests/stress/big-int-addition-memory-stress.js >deleted file mode 100644 >index 8b1aeb1975cb3e027814e65a633db513f506c39c..0000000000000000000000000000000000000000 >--- a/JSTests/stress/big-int-addition-memory-stress.js >+++ /dev/null >@@ -1,14 +0,0 @@ >-//@ runBigIntEnabled >- >-function assert(a) { >- if (!a) >- throw new Error("Bad assertion"); >-} >- >-let a = 0n; >-for (let i = 0; i < 1000000; i++) { >- a += 30n; >-} >- >-assert(a === 30000000n); >- >diff --git a/JSTests/stress/big-int-addition-string-coercion.js b/JSTests/stress/big-int-addition-string-coercion.js >deleted file mode 100644 >index bbde05a346ed71a9f3ae82599e375ab31bb09892..0000000000000000000000000000000000000000 >--- a/JSTests/stress/big-int-addition-string-coercion.js >+++ /dev/null >@@ -1,25 +0,0 @@ >-//@ runBigIntEnabled >- >-function assert(input, expected) { >- if (input !== expected) >- throw new Error("Bad!"); >-} >- >-assert(-1n + "", "-1"); >-assert("" + -1n, "-1"); >-assert(0n + "", "0"); >-assert("" + 0n, "0"); >-assert(1n + "", "1"); >-assert("" + 1n, "1"); >-assert(123456789000000000000000n + "", "123456789000000000000000"); >-assert("" + 123456789000000000000000n, "123456789000000000000000"); >-assert(-123456789000000000000000n + "", "-123456789000000000000000"); >-assert("" + -123456789000000000000000n, "-123456789000000000000000"); >- >-assert([] + -123456789000000000000000n, "-123456789000000000000000"); >-assert(-123456789000000000000000n + [], "-123456789000000000000000"); >- >-let a = {}; >-assert(a + 3n, "[object Object]3"); >-assert(3n + a, "3[object Object]"); >- >diff --git a/JSTests/stress/big-int-addition-to-primitive-precedence.js b/JSTests/stress/big-int-addition-to-primitive-precedence.js >deleted file mode 100644 >index cdedc142fc645c23f00b1e8c309246472ec12672..0000000000000000000000000000000000000000 >--- a/JSTests/stress/big-int-addition-to-primitive-precedence.js >+++ /dev/null >@@ -1,39 +0,0 @@ >-//@ runBigIntEnabled >- >-assert = { >- sameValue: function (input, expected, message) { >- if (input !== expected) >- throw new Error(message); >- } >-}; >- >-function testAdd(x, y, z, message) { >- assert.sameValue(x + y, z, message); >- assert.sameValue(y + x, z, message); >-} >- >-testAdd(Object(2n), 1n, 3n, "ToPrimitive: unbox object with internal slot"); >- >-let o = { >- [Symbol.toPrimitive]: function() { >- return 2n; >- }, >- valueOf: function () { >- throw new Error("Should never execute it"); >- }, >- toString: function () { >- throw new Error("Should never execute it"); >- } >-}; >-testAdd(o, 1n, 3n, "ToPrimitive: @@toPrimitive"); >- >-o = { >- valueOf: function() { >- return 2n; >- }, >- toString: function () { >- throw new Error("Should never execute it"); >- } >-}; >-testAdd(o, 1n, 3n, "ToPrimitive: valueOf"); >- >diff --git a/JSTests/stress/big-int-addition-to-primitive.js b/JSTests/stress/big-int-addition-to-primitive.js >deleted file mode 100644 >index 2f65f9c5396e517ca673f2e0e1f63b43da228f86..0000000000000000000000000000000000000000 >--- a/JSTests/stress/big-int-addition-to-primitive.js >+++ /dev/null >@@ -1,39 +0,0 @@ >-//@ runBigIntEnabled >- >-function assert(a) { >- if (!a) >- throw new Error("Bad assertion"); >-} >- >-assert.sameValue = function (input, expected, message) { >- if (input !== expected) >- throw new Error(message); >-} >- >-function testAdd(x, y, z) { >- assert.sameValue(x + y, z, x + " + " + y + " = " + z); >- assert.sameValue(y + x, z, y + " + " + x + " = " + z); >-} >- >-let o = { >- [Symbol.toPrimitive]: function () { return 300000000000000n; } >-} >- >-testAdd(500000000000438n, o, 800000000000438n); >- >-o.valueOf = function () { >- throw new Error("Should never execute it"); >-}; >- >-testAdd(700000000000438n, o, 1000000000000438n); >- >-o.toString = function () { >- throw new Error("Should never execute it"); >-}; >- >-testAdd(700000000000438n, o, 1000000000000438n); >- >-delete o.valueOf; >- >-testAdd(700000000000438n, o, 1000000000000438n); >- >diff --git a/JSTests/stress/big-int-addition-type-error.js b/JSTests/stress/big-int-addition-type-error.js >deleted file mode 100644 >index e2f824c0d9ff1ddc43a4cd60ab93f0f64124a480..0000000000000000000000000000000000000000 >--- a/JSTests/stress/big-int-addition-type-error.js >+++ /dev/null >@@ -1,104 +0,0 @@ >-//@ runBigIntEnabled >- >-function assert(a, message) { >- if (!a) >- throw new Error(message); >-} >- >-function assertThrowTypeError(a, b, message) { >- try { >- let n = a + b; >- assert(false, message + ": Should throw TypeError, but executed without exception"); >- } catch (e) { >- assert(e instanceof TypeError, message + ": expected TypeError, got: " + e); >- } >-} >- >-assertThrowTypeError(30n, Symbol("foo"), "BigInt + Symbol"); >-assertThrowTypeError(Symbol("bar"), 18757382984821n, "Symbol + BigInt"); >-assertThrowTypeError(30n, 3320, "BigInt + Int32"); >-assertThrowTypeError(33256, 18757382984821n, "Int32 + BigInt"); >-assertThrowTypeError(30n, 0.543, "BigInt + Double"); >-assertThrowTypeError(230.19293, 18757382984821n, "Double + BigInt"); >-assertThrowTypeError(30n, NaN, "BigInt + NaN"); >-assertThrowTypeError(NaN, 18757382984821n, "NaN + BigInt"); >-assertThrowTypeError(30n, NaN, "BigInt + NaN"); >-assertThrowTypeError(NaN, 18757382984821n, "NaN + BigInt"); >-assertThrowTypeError(30n, +Infinity, "BigInt + NaN"); >-assertThrowTypeError(+Infinity, 18757382984821n, "NaN + BigInt"); >-assertThrowTypeError(30n, -Infinity, "BigInt + -Infinity"); >-assertThrowTypeError(-Infinity, 18757382984821n, "-Infinity + BigInt"); >-assertThrowTypeError(30n, null, "BigInt + null"); >-assertThrowTypeError(null, 18757382984821n, "null + BigInt"); >-assertThrowTypeError(30n, undefined, "BigInt + undefined"); >-assertThrowTypeError(undefined, 18757382984821n, "undefined + BigInt"); >-assertThrowTypeError(30n, true, "BigInt + true"); >-assertThrowTypeError(true, 18757382984821n, "true + BigInt"); >-assertThrowTypeError(30n, false, "BigInt + false"); >-assertThrowTypeError(false, 18757382984821n, "false + BigInt"); >- >-// Error when returning from object >- >-let o = { >- valueOf: function () { return Symbol("Foo"); } >-}; >- >-assertThrowTypeError(30n, o, "BigInt + Object.valueOf returning Symbol"); >-assertThrowTypeError(o, 18757382984821n, "Object.valueOf returning Symbol + BigInt"); >- >-o = { >- valueOf: function () { return 33256; } >-}; >- >-assertThrowTypeError(30n, o, "BigInt + Object.valueOf returning Int32"); >-assertThrowTypeError(o, 18757382984821n, "Object.valueOf returning Int32 + BigInt"); >- >-o = { >- valueOf: function () { return 0.453; } >-}; >- >-assertThrowTypeError(30n, o, "BigInt + Object.valueOf returning Double"); >-assertThrowTypeError(o, 18757382984821n, "Object.valueOf returning Double + BigInt"); >- >-o = { >- toString: function () { return Symbol("Foo"); } >-}; >- >-assertThrowTypeError(30n, o, "BigInt + Object.toString returning Symbol"); >-assertThrowTypeError(o, 18757382984821n, "Object.toString returning Symbol + BigInt"); >- >-o = { >- toString: function () { return 33256; } >-}; >- >-assertThrowTypeError(30n, o, "BigInt + Object.toString returning Int32"); >-assertThrowTypeError(o, 18757382984821n, "Object.toString returning Int32 + BigInt"); >- >-o = { >- toString: function () { return 0.453; } >-}; >- >-assertThrowTypeError(30n, o, "BigInt + Object.toString returning Double"); >-assertThrowTypeError(o, 18757382984821n, "Object.toString returning Double + BigInt"); >- >-o = { >- [Symbol.toPrimitive]: function () { return Symbol("Foo"); } >-}; >- >-assertThrowTypeError(30n, o, "BigInt + Object.@@toPrimitive returning Symbol"); >-assertThrowTypeError(o, 18757382984821n, "Object.@@toPrimitive returning Symbol + BigInt"); >- >-o = { >- [Symbol.toPrimitive]: function () { return 33256; } >-}; >- >-assertThrowTypeError(30n, o, "BigInt + Object.@@toPrimitive returning Int32"); >-assertThrowTypeError(o, 18757382984821n, "Object.@@toPrimitive returning Int32 + BigInt"); >- >-o = { >- [Symbol.toPrimitive]: function () { return 0.453; } >-}; >- >-assertThrowTypeError(30n, o, "BigInt + Object.@@toPrimitive returning Double"); >-assertThrowTypeError(o, 18757382984821n, "Object.@@toPrimitive returning Double + BigInt"); >- >diff --git a/JSTests/stress/big-int-no-conversion-to-number.js b/JSTests/stress/big-int-no-conversion-to-number.js >index 1406128d1dea02b0827f196f5898d11f77dc3e0b..f380b5752267cea10c613ba14c37e3d7c2f511b0 100644 >--- a/JSTests/stress/big-int-no-conversion-to-number.js >+++ b/JSTests/stress/big-int-no-conversion-to-number.js >@@ -7,6 +7,6 @@ try { > message = error.message; > } > >-if (message !== "Invalid mix of BigInt and other type in addition.") { >+if (message !== "Conversion from 'BigInt' to 'number' is not allowed.") { > throw new Error("Error message has changed to something unexpected"); > } >diff --git a/JSTests/stress/big-int-sub-wrapped-value.js b/JSTests/stress/big-int-sub-wrapped-value.js >deleted file mode 100644 >index 5b18880f8a74a9cc1cd351da2d51c0f5fb9246da..0000000000000000000000000000000000000000 >--- a/JSTests/stress/big-int-sub-wrapped-value.js >+++ /dev/null >@@ -1,36 +0,0 @@ >-//@ runBigIntEnabled >- >-assert = { >- sameValue: function (input, expected, message) { >- if (input !== expected) >- throw new Error(message); >- } >-}; >- >-function testSub(x, y, z, message) { >- assert.sameValue(x - y, z, message); >-} >- >-testSub(Object(2n), 1n, 1n, "ToPrimitive: unbox object with internal slot"); >- >-let o = { >- [Symbol.toPrimitive]: function() { >- return 2n; >- } >-}; >-testSub(o, 1n, 1n, "ToPrimitive: @@toPrimitive"); >- >-o = { >- valueOf: function() { >- return 2n; >- } >-}; >-testSub(o, 1n, 1n, "ToPrimitive: valueOf"); >- >-o = { >- toString: function() { >- return 2n; >- } >-} >-testSub(o, 1n, 1n, "ToPrimitive: toString"); >- >diff --git a/JSTests/stress/big-int-subtraction-basic.js b/JSTests/stress/big-int-subtraction-basic.js >deleted file mode 100644 >index 90213242b76245e20e98ed5a19ab915ff061e8b9..0000000000000000000000000000000000000000 >--- a/JSTests/stress/big-int-subtraction-basic.js >+++ /dev/null >@@ -1,303 +0,0 @@ >-//@ runBigIntEnabled >- >-assert = { >- sameValue: function (input, expected, message) { >- if (input !== expected) >- throw new Error(message); >- } >-}; >- >-function testSub(x, y, z) { >- assert.sameValue(x - y, z, x + " - " + y + " = " + z); >-} >- >-testSub(0xFEDCBA9876543210n, 0xFEDCBA9876543210n, 0x0n); >-testSub(0xFEDCBA9876543210n, 0xFEDCBA987654320Fn, 0x1n); >-testSub(0xFEDCBA9876543210n, 0xFEDCBA98n, 0xFEDCBA9777777778n); >-testSub(0xFEDCBA9876543210n, 0xFEDCBA97n, 0xFEDCBA9777777779n); >-testSub(0xFEDCBA9876543210n, 0x1234n, 0xFEDCBA9876541FDCn); >-testSub(0xFEDCBA9876543210n, 0x3n, 0xFEDCBA987654320Dn); >-testSub(0xFEDCBA9876543210n, 0x2n, 0xFEDCBA987654320En); >-testSub(0xFEDCBA9876543210n, 0x1n, 0xFEDCBA987654320Fn); >-testSub(0xFEDCBA9876543210n, 0x0n, 0xFEDCBA9876543210n); >-testSub(0xFEDCBA9876543210n, -0x1n, 0xFEDCBA9876543211n); >-testSub(0xFEDCBA9876543210n, -0x2n, 0xFEDCBA9876543212n); >-testSub(0xFEDCBA9876543210n, -0x3n, 0xFEDCBA9876543213n); >-testSub(0xFEDCBA9876543210n, -0x1234n, 0xFEDCBA9876544444n); >-testSub(0xFEDCBA9876543210n, -0xFEDCBA97n, 0xFEDCBA997530ECA7n); >-testSub(0xFEDCBA9876543210n, -0xFEDCBA98n, 0xFEDCBA997530ECA8n); >-testSub(0xFEDCBA9876543210n, -0xFEDCBA987654320Fn, 0x1FDB97530ECA8641Fn); >-testSub(0xFEDCBA9876543210n, -0xFEDCBA9876543210n, 0x1FDB97530ECA86420n); >-testSub(0xFEDCBA987654320Fn, 0xFEDCBA9876543210n, -0x1n); >-testSub(0xFEDCBA987654320Fn, 0xFEDCBA987654320Fn, 0x0n); >-testSub(0xFEDCBA987654320Fn, 0xFEDCBA98n, 0xFEDCBA9777777777n); >-testSub(0xFEDCBA987654320Fn, 0xFEDCBA97n, 0xFEDCBA9777777778n); >-testSub(0xFEDCBA987654320Fn, 0x1234n, 0xFEDCBA9876541FDBn); >-testSub(0xFEDCBA987654320Fn, 0x3n, 0xFEDCBA987654320Cn); >-testSub(0xFEDCBA987654320Fn, 0x2n, 0xFEDCBA987654320Dn); >-testSub(0xFEDCBA987654320Fn, 0x1n, 0xFEDCBA987654320En); >-testSub(0xFEDCBA987654320Fn, 0x0n, 0xFEDCBA987654320Fn); >-testSub(0xFEDCBA987654320Fn, -0x1n, 0xFEDCBA9876543210n); >-testSub(0xFEDCBA987654320Fn, -0x2n, 0xFEDCBA9876543211n); >-testSub(0xFEDCBA987654320Fn, -0x3n, 0xFEDCBA9876543212n); >-testSub(0xFEDCBA987654320Fn, -0x1234n, 0xFEDCBA9876544443n); >-testSub(0xFEDCBA987654320Fn, -0xFEDCBA97n, 0xFEDCBA997530ECA6n); >-testSub(0xFEDCBA987654320Fn, -0xFEDCBA98n, 0xFEDCBA997530ECA7n); >-testSub(0xFEDCBA987654320Fn, -0xFEDCBA987654320Fn, 0x1FDB97530ECA8641En); >-testSub(0xFEDCBA987654320Fn, -0xFEDCBA9876543210n, 0x1FDB97530ECA8641Fn); >-testSub(0xFEDCBA98n, 0xFEDCBA9876543210n, -0xFEDCBA9777777778n); >-testSub(0xFEDCBA98n, 0xFEDCBA987654320Fn, -0xFEDCBA9777777777n); >-testSub(0xFEDCBA98n, 0xFEDCBA98n, 0x0n); >-testSub(0xFEDCBA98n, 0xFEDCBA97n, 0x1n); >-testSub(0xFEDCBA98n, 0x1234n, 0xFEDCA864n); >-testSub(0xFEDCBA98n, 0x3n, 0xFEDCBA95n); >-testSub(0xFEDCBA98n, 0x2n, 0xFEDCBA96n); >-testSub(0xFEDCBA98n, 0x1n, 0xFEDCBA97n); >-testSub(0xFEDCBA98n, 0x0n, 0xFEDCBA98n); >-testSub(0xFEDCBA98n, -0x1n, 0xFEDCBA99n); >-testSub(0xFEDCBA98n, -0x2n, 0xFEDCBA9An); >-testSub(0xFEDCBA98n, -0x3n, 0xFEDCBA9Bn); >-testSub(0xFEDCBA98n, -0x1234n, 0xFEDCCCCCn); >-testSub(0xFEDCBA98n, -0xFEDCBA97n, 0x1FDB9752Fn); >-testSub(0xFEDCBA98n, -0xFEDCBA98n, 0x1FDB97530n); >-testSub(0xFEDCBA98n, -0xFEDCBA987654320Fn, 0xFEDCBA997530ECA7n); >-testSub(0xFEDCBA98n, -0xFEDCBA9876543210n, 0xFEDCBA997530ECA8n); >-testSub(0xFEDCBA97n, 0xFEDCBA9876543210n, -0xFEDCBA9777777779n); >-testSub(0xFEDCBA97n, 0xFEDCBA987654320Fn, -0xFEDCBA9777777778n); >-testSub(0xFEDCBA97n, 0xFEDCBA98n, -0x1n); >-testSub(0xFEDCBA97n, 0xFEDCBA97n, 0x0n); >-testSub(0xFEDCBA97n, 0x1234n, 0xFEDCA863n); >-testSub(0xFEDCBA97n, 0x3n, 0xFEDCBA94n); >-testSub(0xFEDCBA97n, 0x2n, 0xFEDCBA95n); >-testSub(0xFEDCBA97n, 0x1n, 0xFEDCBA96n); >-testSub(0xFEDCBA97n, 0x0n, 0xFEDCBA97n); >-testSub(0xFEDCBA97n, -0x1n, 0xFEDCBA98n); >-testSub(0xFEDCBA97n, -0x2n, 0xFEDCBA99n); >-testSub(0xFEDCBA97n, -0x3n, 0xFEDCBA9An); >-testSub(0xFEDCBA97n, -0x1234n, 0xFEDCCCCBn); >-testSub(0xFEDCBA97n, -0xFEDCBA97n, 0x1FDB9752En); >-testSub(0xFEDCBA97n, -0xFEDCBA98n, 0x1FDB9752Fn); >-testSub(0xFEDCBA97n, -0xFEDCBA987654320Fn, 0xFEDCBA997530ECA6n); >-testSub(0xFEDCBA97n, -0xFEDCBA9876543210n, 0xFEDCBA997530ECA7n); >-testSub(0x1234n, 0xFEDCBA9876543210n, -0xFEDCBA9876541FDCn); >-testSub(0x1234n, 0xFEDCBA987654320Fn, -0xFEDCBA9876541FDBn); >-testSub(0x1234n, 0xFEDCBA98n, -0xFEDCA864n); >-testSub(0x1234n, 0xFEDCBA97n, -0xFEDCA863n); >-testSub(0x1234n, 0x1234n, 0x0n); >-testSub(0x1234n, 0x3n, 0x1231n); >-testSub(0x1234n, 0x2n, 0x1232n); >-testSub(0x1234n, 0x1n, 0x1233n); >-testSub(0x1234n, 0x0n, 0x1234n); >-testSub(0x1234n, -0x1n, 0x1235n); >-testSub(0x1234n, -0x2n, 0x1236n); >-testSub(0x1234n, -0x3n, 0x1237n); >-testSub(0x1234n, -0x1234n, 0x2468n); >-testSub(0x1234n, -0xFEDCBA97n, 0xFEDCCCCBn); >-testSub(0x1234n, -0xFEDCBA98n, 0xFEDCCCCCn); >-testSub(0x1234n, -0xFEDCBA987654320Fn, 0xFEDCBA9876544443n); >-testSub(0x1234n, -0xFEDCBA9876543210n, 0xFEDCBA9876544444n); >-testSub(0x3n, 0xFEDCBA9876543210n, -0xFEDCBA987654320Dn); >-testSub(0x3n, 0xFEDCBA987654320Fn, -0xFEDCBA987654320Cn); >-testSub(0x3n, 0xFEDCBA98n, -0xFEDCBA95n); >-testSub(0x3n, 0xFEDCBA97n, -0xFEDCBA94n); >-testSub(0x3n, 0x1234n, -0x1231n); >-testSub(0x3n, 0x3n, 0x0n); >-testSub(0x3n, 0x2n, 0x1n); >-testSub(0x3n, 0x1n, 0x2n); >-testSub(0x3n, 0x0n, 0x3n); >-testSub(0x3n, -0x1n, 0x4n); >-testSub(0x3n, -0x2n, 0x5n); >-testSub(0x3n, -0x3n, 0x6n); >-testSub(0x3n, -0x1234n, 0x1237n); >-testSub(0x3n, -0xFEDCBA97n, 0xFEDCBA9An); >-testSub(0x3n, -0xFEDCBA98n, 0xFEDCBA9Bn); >-testSub(0x3n, -0xFEDCBA987654320Fn, 0xFEDCBA9876543212n); >-testSub(0x3n, -0xFEDCBA9876543210n, 0xFEDCBA9876543213n); >-testSub(0x2n, 0xFEDCBA9876543210n, -0xFEDCBA987654320En); >-testSub(0x2n, 0xFEDCBA987654320Fn, -0xFEDCBA987654320Dn); >-testSub(0x2n, 0xFEDCBA98n, -0xFEDCBA96n); >-testSub(0x2n, 0xFEDCBA97n, -0xFEDCBA95n); >-testSub(0x2n, 0x1234n, -0x1232n); >-testSub(0x2n, 0x3n, -0x1n); >-testSub(0x2n, 0x2n, 0x0n); >-testSub(0x2n, 0x1n, 0x1n); >-testSub(0x2n, 0x0n, 0x2n); >-testSub(0x2n, -0x1n, 0x3n); >-testSub(0x2n, -0x2n, 0x4n); >-testSub(0x2n, -0x3n, 0x5n); >-testSub(0x2n, -0x1234n, 0x1236n); >-testSub(0x2n, -0xFEDCBA97n, 0xFEDCBA99n); >-testSub(0x2n, -0xFEDCBA98n, 0xFEDCBA9An); >-testSub(0x2n, -0xFEDCBA987654320Fn, 0xFEDCBA9876543211n); >-testSub(0x2n, -0xFEDCBA9876543210n, 0xFEDCBA9876543212n); >-testSub(0x1n, 0xFEDCBA9876543210n, -0xFEDCBA987654320Fn); >-testSub(0x1n, 0xFEDCBA987654320Fn, -0xFEDCBA987654320En); >-testSub(0x1n, 0xFEDCBA98n, -0xFEDCBA97n); >-testSub(0x1n, 0xFEDCBA97n, -0xFEDCBA96n); >-testSub(0x1n, 0x1234n, -0x1233n); >-testSub(0x1n, 0x3n, -0x2n); >-testSub(0x1n, 0x2n, -0x1n); >-testSub(0x1n, 0x1n, 0x0n); >-testSub(0x1n, 0x0n, 0x1n); >-testSub(0x1n, -0x1n, 0x2n); >-testSub(0x1n, -0x2n, 0x3n); >-testSub(0x1n, -0x3n, 0x4n); >-testSub(0x1n, -0x1234n, 0x1235n); >-testSub(0x1n, -0xFEDCBA97n, 0xFEDCBA98n); >-testSub(0x1n, -0xFEDCBA98n, 0xFEDCBA99n); >-testSub(0x1n, -0xFEDCBA987654320Fn, 0xFEDCBA9876543210n); >-testSub(0x1n, -0xFEDCBA9876543210n, 0xFEDCBA9876543211n); >-testSub(0x0n, 0xFEDCBA9876543210n, -0xFEDCBA9876543210n); >-testSub(0x0n, 0xFEDCBA987654320Fn, -0xFEDCBA987654320Fn); >-testSub(0x0n, 0xFEDCBA98n, -0xFEDCBA98n); >-testSub(0x0n, 0xFEDCBA97n, -0xFEDCBA97n); >-testSub(0x0n, 0x1234n, -0x1234n); >-testSub(0x0n, 0x3n, -0x3n); >-testSub(0x0n, 0x2n, -0x2n); >-testSub(0x0n, 0x1n, -0x1n); >-testSub(0x0n, 0x0n, 0x0n); >-testSub(0x0n, -0x1n, 0x1n); >-testSub(0x0n, -0x2n, 0x2n); >-testSub(0x0n, -0x3n, 0x3n); >-testSub(0x0n, -0x1234n, 0x1234n); >-testSub(0x0n, -0xFEDCBA97n, 0xFEDCBA97n); >-testSub(0x0n, -0xFEDCBA98n, 0xFEDCBA98n); >-testSub(0x0n, -0xFEDCBA987654320Fn, 0xFEDCBA987654320Fn); >-testSub(0x0n, -0xFEDCBA9876543210n, 0xFEDCBA9876543210n); >-testSub(-0x1n, 0xFEDCBA9876543210n, -0xFEDCBA9876543211n); >-testSub(-0x1n, 0xFEDCBA987654320Fn, -0xFEDCBA9876543210n); >-testSub(-0x1n, 0xFEDCBA98n, -0xFEDCBA99n); >-testSub(-0x1n, 0xFEDCBA97n, -0xFEDCBA98n); >-testSub(-0x1n, 0x1234n, -0x1235n); >-testSub(-0x1n, 0x3n, -0x4n); >-testSub(-0x1n, 0x2n, -0x3n); >-testSub(-0x1n, 0x1n, -0x2n); >-testSub(-0x1n, 0x0n, -0x1n); >-testSub(-0x1n, -0x1n, 0x0n); >-testSub(-0x1n, -0x2n, 0x1n); >-testSub(-0x1n, -0x3n, 0x2n); >-testSub(-0x1n, -0x1234n, 0x1233n); >-testSub(-0x1n, -0xFEDCBA97n, 0xFEDCBA96n); >-testSub(-0x1n, -0xFEDCBA98n, 0xFEDCBA97n); >-testSub(-0x1n, -0xFEDCBA987654320Fn, 0xFEDCBA987654320En); >-testSub(-0x1n, -0xFEDCBA9876543210n, 0xFEDCBA987654320Fn); >-testSub(-0x2n, 0xFEDCBA9876543210n, -0xFEDCBA9876543212n); >-testSub(-0x2n, 0xFEDCBA987654320Fn, -0xFEDCBA9876543211n); >-testSub(-0x2n, 0xFEDCBA98n, -0xFEDCBA9An); >-testSub(-0x2n, 0xFEDCBA97n, -0xFEDCBA99n); >-testSub(-0x2n, 0x1234n, -0x1236n); >-testSub(-0x2n, 0x3n, -0x5n); >-testSub(-0x2n, 0x2n, -0x4n); >-testSub(-0x2n, 0x1n, -0x3n); >-testSub(-0x2n, 0x0n, -0x2n); >-testSub(-0x2n, -0x1n, -0x1n); >-testSub(-0x2n, -0x2n, 0x0n); >-testSub(-0x2n, -0x3n, 0x1n); >-testSub(-0x2n, -0x1234n, 0x1232n); >-testSub(-0x2n, -0xFEDCBA97n, 0xFEDCBA95n); >-testSub(-0x2n, -0xFEDCBA98n, 0xFEDCBA96n); >-testSub(-0x2n, -0xFEDCBA987654320Fn, 0xFEDCBA987654320Dn); >-testSub(-0x2n, -0xFEDCBA9876543210n, 0xFEDCBA987654320En); >-testSub(-0x3n, 0xFEDCBA9876543210n, -0xFEDCBA9876543213n); >-testSub(-0x3n, 0xFEDCBA987654320Fn, -0xFEDCBA9876543212n); >-testSub(-0x3n, 0xFEDCBA98n, -0xFEDCBA9Bn); >-testSub(-0x3n, 0xFEDCBA97n, -0xFEDCBA9An); >-testSub(-0x3n, 0x1234n, -0x1237n); >-testSub(-0x3n, 0x3n, -0x6n); >-testSub(-0x3n, 0x2n, -0x5n); >-testSub(-0x3n, 0x1n, -0x4n); >-testSub(-0x3n, 0x0n, -0x3n); >-testSub(-0x3n, -0x1n, -0x2n); >-testSub(-0x3n, -0x2n, -0x1n); >-testSub(-0x3n, -0x3n, 0x0n); >-testSub(-0x3n, -0x1234n, 0x1231n); >-testSub(-0x3n, -0xFEDCBA97n, 0xFEDCBA94n); >-testSub(-0x3n, -0xFEDCBA98n, 0xFEDCBA95n); >-testSub(-0x3n, -0xFEDCBA987654320Fn, 0xFEDCBA987654320Cn); >-testSub(-0x3n, -0xFEDCBA9876543210n, 0xFEDCBA987654320Dn); >-testSub(-0x1234n, 0xFEDCBA9876543210n, -0xFEDCBA9876544444n); >-testSub(-0x1234n, 0xFEDCBA987654320Fn, -0xFEDCBA9876544443n); >-testSub(-0x1234n, 0xFEDCBA98n, -0xFEDCCCCCn); >-testSub(-0x1234n, 0xFEDCBA97n, -0xFEDCCCCBn); >-testSub(-0x1234n, 0x1234n, -0x2468n); >-testSub(-0x1234n, 0x3n, -0x1237n); >-testSub(-0x1234n, 0x2n, -0x1236n); >-testSub(-0x1234n, 0x1n, -0x1235n); >-testSub(-0x1234n, 0x0n, -0x1234n); >-testSub(-0x1234n, -0x1n, -0x1233n); >-testSub(-0x1234n, -0x2n, -0x1232n); >-testSub(-0x1234n, -0x3n, -0x1231n); >-testSub(-0x1234n, -0x1234n, 0x0n); >-testSub(-0x1234n, -0xFEDCBA97n, 0xFEDCA863n); >-testSub(-0x1234n, -0xFEDCBA98n, 0xFEDCA864n); >-testSub(-0x1234n, -0xFEDCBA987654320Fn, 0xFEDCBA9876541FDBn); >-testSub(-0x1234n, -0xFEDCBA9876543210n, 0xFEDCBA9876541FDCn); >-testSub(-0xFEDCBA97n, 0xFEDCBA9876543210n, -0xFEDCBA997530ECA7n); >-testSub(-0xFEDCBA97n, 0xFEDCBA987654320Fn, -0xFEDCBA997530ECA6n); >-testSub(-0xFEDCBA97n, 0xFEDCBA98n, -0x1FDB9752Fn); >-testSub(-0xFEDCBA97n, 0xFEDCBA97n, -0x1FDB9752En); >-testSub(-0xFEDCBA97n, 0x1234n, -0xFEDCCCCBn); >-testSub(-0xFEDCBA97n, 0x3n, -0xFEDCBA9An); >-testSub(-0xFEDCBA97n, 0x2n, -0xFEDCBA99n); >-testSub(-0xFEDCBA97n, 0x1n, -0xFEDCBA98n); >-testSub(-0xFEDCBA97n, 0x0n, -0xFEDCBA97n); >-testSub(-0xFEDCBA97n, -0x1n, -0xFEDCBA96n); >-testSub(-0xFEDCBA97n, -0x2n, -0xFEDCBA95n); >-testSub(-0xFEDCBA97n, -0x3n, -0xFEDCBA94n); >-testSub(-0xFEDCBA97n, -0x1234n, -0xFEDCA863n); >-testSub(-0xFEDCBA97n, -0xFEDCBA97n, 0x0n); >-testSub(-0xFEDCBA97n, -0xFEDCBA98n, 0x1n); >-testSub(-0xFEDCBA97n, -0xFEDCBA987654320Fn, 0xFEDCBA9777777778n); >-testSub(-0xFEDCBA97n, -0xFEDCBA9876543210n, 0xFEDCBA9777777779n); >-testSub(-0xFEDCBA98n, 0xFEDCBA9876543210n, -0xFEDCBA997530ECA8n); >-testSub(-0xFEDCBA98n, 0xFEDCBA987654320Fn, -0xFEDCBA997530ECA7n); >-testSub(-0xFEDCBA98n, 0xFEDCBA98n, -0x1FDB97530n); >-testSub(-0xFEDCBA98n, 0xFEDCBA97n, -0x1FDB9752Fn); >-testSub(-0xFEDCBA98n, 0x1234n, -0xFEDCCCCCn); >-testSub(-0xFEDCBA98n, 0x3n, -0xFEDCBA9Bn); >-testSub(-0xFEDCBA98n, 0x2n, -0xFEDCBA9An); >-testSub(-0xFEDCBA98n, 0x1n, -0xFEDCBA99n); >-testSub(-0xFEDCBA98n, 0x0n, -0xFEDCBA98n); >-testSub(-0xFEDCBA98n, -0x1n, -0xFEDCBA97n); >-testSub(-0xFEDCBA98n, -0x2n, -0xFEDCBA96n); >-testSub(-0xFEDCBA98n, -0x3n, -0xFEDCBA95n); >-testSub(-0xFEDCBA98n, -0x1234n, -0xFEDCA864n); >-testSub(-0xFEDCBA98n, -0xFEDCBA97n, -0x1n); >-testSub(-0xFEDCBA98n, -0xFEDCBA98n, 0x0n); >-testSub(-0xFEDCBA98n, -0xFEDCBA987654320Fn, 0xFEDCBA9777777777n); >-testSub(-0xFEDCBA98n, -0xFEDCBA9876543210n, 0xFEDCBA9777777778n); >-testSub(-0xFEDCBA987654320Fn, 0xFEDCBA9876543210n, -0x1FDB97530ECA8641Fn); >-testSub(-0xFEDCBA987654320Fn, 0xFEDCBA987654320Fn, -0x1FDB97530ECA8641En); >-testSub(-0xFEDCBA987654320Fn, 0xFEDCBA98n, -0xFEDCBA997530ECA7n); >-testSub(-0xFEDCBA987654320Fn, 0xFEDCBA97n, -0xFEDCBA997530ECA6n); >-testSub(-0xFEDCBA987654320Fn, 0x1234n, -0xFEDCBA9876544443n); >-testSub(-0xFEDCBA987654320Fn, 0x3n, -0xFEDCBA9876543212n); >-testSub(-0xFEDCBA987654320Fn, 0x2n, -0xFEDCBA9876543211n); >-testSub(-0xFEDCBA987654320Fn, 0x1n, -0xFEDCBA9876543210n); >-testSub(-0xFEDCBA987654320Fn, 0x0n, -0xFEDCBA987654320Fn); >-testSub(-0xFEDCBA987654320Fn, -0x1n, -0xFEDCBA987654320En); >-testSub(-0xFEDCBA987654320Fn, -0x2n, -0xFEDCBA987654320Dn); >-testSub(-0xFEDCBA987654320Fn, -0x3n, -0xFEDCBA987654320Cn); >-testSub(-0xFEDCBA987654320Fn, -0x1234n, -0xFEDCBA9876541FDBn); >-testSub(-0xFEDCBA987654320Fn, -0xFEDCBA97n, -0xFEDCBA9777777778n); >-testSub(-0xFEDCBA987654320Fn, -0xFEDCBA98n, -0xFEDCBA9777777777n); >-testSub(-0xFEDCBA987654320Fn, -0xFEDCBA987654320Fn, 0x0n); >-testSub(-0xFEDCBA987654320Fn, -0xFEDCBA9876543210n, 0x1n); >-testSub(-0xFEDCBA9876543210n, 0xFEDCBA9876543210n, -0x1FDB97530ECA86420n); >-testSub(-0xFEDCBA9876543210n, 0xFEDCBA987654320Fn, -0x1FDB97530ECA8641Fn); >-testSub(-0xFEDCBA9876543210n, 0xFEDCBA98n, -0xFEDCBA997530ECA8n); >-testSub(-0xFEDCBA9876543210n, 0xFEDCBA97n, -0xFEDCBA997530ECA7n); >-testSub(-0xFEDCBA9876543210n, 0x1234n, -0xFEDCBA9876544444n); >-testSub(-0xFEDCBA9876543210n, 0x3n, -0xFEDCBA9876543213n); >-testSub(-0xFEDCBA9876543210n, 0x2n, -0xFEDCBA9876543212n); >-testSub(-0xFEDCBA9876543210n, 0x1n, -0xFEDCBA9876543211n); >-testSub(-0xFEDCBA9876543210n, 0x0n, -0xFEDCBA9876543210n); >-testSub(-0xFEDCBA9876543210n, -0x1n, -0xFEDCBA987654320Fn); >-testSub(-0xFEDCBA9876543210n, -0x2n, -0xFEDCBA987654320En); >-testSub(-0xFEDCBA9876543210n, -0x3n, -0xFEDCBA987654320Dn); >-testSub(-0xFEDCBA9876543210n, -0x1234n, -0xFEDCBA9876541FDCn); >-testSub(-0xFEDCBA9876543210n, -0xFEDCBA97n, -0xFEDCBA9777777779n); >-testSub(-0xFEDCBA9876543210n, -0xFEDCBA98n, -0xFEDCBA9777777778n); >-testSub(-0xFEDCBA9876543210n, -0xFEDCBA987654320Fn, -0x1n); >-testSub(-0xFEDCBA9876543210n, -0xFEDCBA9876543210n, 0x0n); >- >diff --git a/JSTests/stress/big-int-subtraction-jit.js b/JSTests/stress/big-int-subtraction-jit.js >deleted file mode 100644 >index cb081aafb817bc39dfe56c23121c6781261c949b..0000000000000000000000000000000000000000 >--- a/JSTests/stress/big-int-subtraction-jit.js >+++ /dev/null >@@ -1,19 +0,0 @@ >-//@ runBigIntEnabled >- >-let assert = { >- sameValue: function(i, e, m) { >- if (i !== e) >- throw new Error(m); >- } >-} >- >-function bigIntAddition(x, y) { >- return x - y; >-} >-noInline(bigIntAddition); >- >-for (let i = 0; i < 10000; i++) { >- let r = bigIntAddition(3n, 10n); >- assert.sameValue(r, -7n, 3n + " - " + 10n + " = " + r); >-} >- >diff --git a/JSTests/stress/big-int-subtraction-type-error.js b/JSTests/stress/big-int-subtraction-type-error.js >deleted file mode 100644 >index 74ac48a589e3330c0c6c755032661740c4b06ce7..0000000000000000000000000000000000000000 >--- a/JSTests/stress/big-int-subtraction-type-error.js >+++ /dev/null >@@ -1,125 +0,0 @@ >-//@ runBigIntEnabled >- >-function assert(a, message) { >- if (!a) >- throw new Error(message); >-} >- >-function assertThrowTypeError(a, b, message) { >- try { >- let n = a - b; >- assert(false, message + ": Should throw TypeError, but executed without exception"); >- } catch (e) { >- assert(e instanceof TypeError, message + ": expected TypeError, got: " + e); >- } >-} >- >-assertThrowTypeError(30n, Symbol("foo"), "BingInt - Symbol"); >-assertThrowTypeError(Symbol("bar"), 18757382984821n, "Symbol - BigInt"); >-assertThrowTypeError(30n, 3320, "BingInt - Int32"); >-assertThrowTypeError(33256, 18757382984821n, "Int32 - BigInt"); >-assertThrowTypeError(30n, 0.543, "BingInt - Double"); >-assertThrowTypeError(230.19293, 18757382984821n, "Double - BigInt"); >-assertThrowTypeError(18757382984821n, "abc", "BigInt - String"); >-assertThrowTypeError("def", 18757382984821n, "String - BigInt"); >-assertThrowTypeError(18757382984821n, "", "BigInt - Empty String"); >-assertThrowTypeError("", 18757382984821n, "Empty - BigInt"); >-assertThrowTypeError(18757382984821n, NaN, "BigInt - NaN"); >-assertThrowTypeError(NaN, 18757382984821n, "NaN - BigInt"); >-assertThrowTypeError(18757382984821n, undefined, "BigInt - undefined"); >-assertThrowTypeError(undefined, 18757382984821n, "undefined - BigInt"); >-assertThrowTypeError(18757382984821n, true, "BigInt - true"); >-assertThrowTypeError(true, 18757382984821n, "true - BigInt"); >-assertThrowTypeError(18757382984821n, false, "BigInt - false"); >-assertThrowTypeError(false, 18757382984821n, "false - BigInt"); >-assertThrowTypeError(18757382984821n, +Infinity, "BigInt - Infinity"); >-assertThrowTypeError(+Infinity, 18757382984821n, "Infinity - BigInt"); >-assertThrowTypeError(18757382984821n, -Infinity, "BigInt - -Infinity"); >-assertThrowTypeError(-Infinity, 18757382984821n, "-Infinity - BigInt"); >- >-// Error when returning from object >- >-let o = { >- valueOf: function () { return Symbol("Foo"); } >-}; >- >-assertThrowTypeError(30n, o, "BingInt - Object.valueOf returning Symbol"); >-assertThrowTypeError(o, 18757382984821n, "Object.valueOf returning Symbol - BigInt"); >- >-o = { >- valueOf: function () { return 33256; } >-}; >- >-assertThrowTypeError(30n, o, "BingInt - Object.valueOf returning Int32"); >-assertThrowTypeError(o, 18757382984821n, "Object.valueOf returning Int32 - BigInt"); >- >-o = { >- valueOf: function () { return 0.453; } >-}; >- >-assertThrowTypeError(30n, o, "BingInt - Object.valueOf returning Double"); >-assertThrowTypeError(o, 18757382984821n, "Object.valueOf returning Double - BigInt"); >- >-o = { >- valueOf: function () { return ""; } >-}; >- >-assertThrowTypeError(30n, o, "BingInt - Object.valueOf returning String"); >-assertThrowTypeError(o, 18757382984821n, "Object.valueOf returning String - BigInt"); >- >-o = { >- toString: function () { return Symbol("Foo"); } >-}; >- >-assertThrowTypeError(30n, o, "BingInt - Object.toString returning Symbol"); >-assertThrowTypeError(o, 18757382984821n, "Object.toString returning Symbol - BigInt"); >- >-o = { >- toString: function () { return 33256; } >-}; >- >-assertThrowTypeError(30n, o, "BingInt - Object.toString returning Int32"); >-assertThrowTypeError(o, 18757382984821n, "Object.toString returning Int32 - BigInt"); >- >-o = { >- toString: function () { return 0.453; } >-}; >- >-assertThrowTypeError(30n, o, "BingInt - Object.toString returning Double"); >-assertThrowTypeError(o, 18757382984821n, "Object.toString returning Double - BigInt"); >- >-o = { >- toString: function () { return "abc"; } >-}; >- >-assertThrowTypeError(30n, o, "BingInt - Object.toString returning String"); >-assertThrowTypeError(o, 18757382984821n, "Object.toString returning String - BigInt"); >- >-o = { >- [Symbol.toPrimitive]: function () { return Symbol("Foo"); } >-}; >- >-assertThrowTypeError(30n, o, "BingInt - Object.@@toPrimitive returning Symbol"); >-assertThrowTypeError(o, 18757382984821n, "Object.@@toPrimitive returning Symbol - BigInt"); >- >-o = { >- [Symbol.toPrimitive]: function () { return 33256; } >-}; >- >-assertThrowTypeError(30n, o, "BingInt - Object.@@toPrimitive returning Int32"); >-assertThrowTypeError(o, 18757382984821n, "Object.@@toPrimitive returning Int32 - BigInt"); >- >-o = { >- [Symbol.toPrimitive]: function () { return 0.453; } >-}; >- >-assertThrowTypeError(30n, o, "BingInt - Object.@@toPrimitive returning Double"); >-assertThrowTypeError(o, 18757382984821n, "Object.@@toPrimitive returning Double - BigInt"); >- >-o = { >- [Symbol.toPrimitive]: function () { return "Abc"; } >-}; >- >-assertThrowTypeError(30n, o, "BingInt - Object.@@toPrimitive returning String"); >-assertThrowTypeError(o, 18757382984821n, "Object.@@toPrimitive returning String - BigInt"); >- >diff --git a/JSTests/stress/sub-order-evaluation.js b/JSTests/stress/sub-order-evaluation.js >deleted file mode 100644 >index 21f923431bb98f25021d1eddc278555412c43463..0000000000000000000000000000000000000000 >--- a/JSTests/stress/sub-order-evaluation.js >+++ /dev/null >@@ -1,27 +0,0 @@ >-function assert(a, message) { >- if (!a) >- throw new Error(message); >-} >- >-function assertThrowTypeError(a, b, message) { >- try { >- let n = a - b; >- assert(false, message + ": Should throw TypeError, but executed without exception"); >- } catch (e) { >- assert(e instanceof TypeError, message + ": expected TypeError, got: " + e); >- } >-} >- >-let o = { >- valueOf: function () { throw new Error("Oops"); } >-}; >- >-assertThrowTypeError(Symbol("3"), o, "Symbol + Object should throw TypeError"); >- >-try { >- let n = o - Symbol("3"); >- assert(false, message + ": Should throw Error, but executed without exception"); >-} catch (e) { >- assert(e.message === "Oops","Expected Error('Oops'), got: " + e); >-} >-
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 186238
: 341852