[ESNext][BigInt] Implement support for "*" operation
authorticaiolima@gmail.com <ticaiolima@gmail.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 12 May 2018 04:32:12 +0000 (04:32 +0000)
committerticaiolima@gmail.com <ticaiolima@gmail.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 12 May 2018 04:32:12 +0000 (04:32 +0000)
commitc02e46e06d75b6aec0b903fa3f177cf335435799
tree769b7d89a0b5874b7a375c917fdc23f04bb51ffe
parent1ded287ddc1c9092e587b6dca8c8280af0c92177
[ESNext][BigInt] Implement support for "*" operation
https://bugs.webkit.org/show_bug.cgi?id=183721

Reviewed by Yusuke Suzuki.

JSTests:

* bigIntTests.yaml:
* stress/big-int-mul-jit.js: Added.
* stress/big-int-mul-to-primitive-precedence.js: Added.
* stress/big-int-mul-to-primitive.js: Added.
* stress/big-int-mul-type-error.js: Added.
* stress/big-int-mul-wrapped-value.js: Added.
* stress/big-int-multiplication.js: Added.
* stress/big-int-multiply-memory-stress.js: Added.

Source/JavaScriptCore:

Added BigInt support into times binary operator into LLInt and on
JITOperations profiledMul and unprofiledMul. We are also replacing all
uses of int to unsigned when there is no negative values for
variables.

* dfg/DFGConstantFoldingPhase.cpp:
(JSC::DFG::ConstantFoldingPhase::foldConstants):
* jit/JITOperations.cpp:
* runtime/CommonSlowPaths.cpp:
(JSC::SLOW_PATH_DECL):
* runtime/JSBigInt.cpp:
(JSC::JSBigInt::JSBigInt):
(JSC::JSBigInt::allocationSize):
(JSC::JSBigInt::createWithLength):
(JSC::JSBigInt::toString):
(JSC::JSBigInt::multiply):
(JSC::JSBigInt::digitDiv):
(JSC::JSBigInt::internalMultiplyAdd):
(JSC::JSBigInt::multiplyAccumulate):
(JSC::JSBigInt::equals):
(JSC::JSBigInt::absoluteDivSmall):
(JSC::JSBigInt::calculateMaximumCharactersRequired):
(JSC::JSBigInt::toStringGeneric):
(JSC::JSBigInt::rightTrim):
(JSC::JSBigInt::allocateFor):
(JSC::JSBigInt::parseInt):
(JSC::JSBigInt::digit):
(JSC::JSBigInt::setDigit):
* runtime/JSBigInt.h:
* runtime/JSCJSValue.h:
* runtime/JSCJSValueInlines.h:
(JSC::JSValue::toNumeric const):
* runtime/Operations.h:
(JSC::jsMul):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@231733 268f45cc-cd09-0410-ab3c-d52691b4dbfc
18 files changed:
JSTests/ChangeLog
JSTests/bigIntTests.yaml
JSTests/stress/big-int-mul-jit.js [new file with mode: 0644]
JSTests/stress/big-int-mul-to-primitive-precedence.js [new file with mode: 0644]
JSTests/stress/big-int-mul-to-primitive.js [new file with mode: 0644]
JSTests/stress/big-int-mul-type-error.js [new file with mode: 0644]
JSTests/stress/big-int-mul-wrapped-value.js [new file with mode: 0644]
JSTests/stress/big-int-multiplication.js [new file with mode: 0644]
JSTests/stress/big-int-multiply-memory-stress.js [new file with mode: 0644]
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/dfg/DFGConstantFoldingPhase.cpp
Source/JavaScriptCore/jit/JITOperations.cpp
Source/JavaScriptCore/runtime/CommonSlowPaths.cpp
Source/JavaScriptCore/runtime/JSBigInt.cpp
Source/JavaScriptCore/runtime/JSBigInt.h
Source/JavaScriptCore/runtime/JSCJSValue.h
Source/JavaScriptCore/runtime/JSCJSValueInlines.h
Source/JavaScriptCore/runtime/Operations.h