[BigInt] BigInt.proptotype.toString is broken when radix is power of 2
https://bugs.webkit.org/show_bug.cgi?id=190033
Reviewed by Yusuke Suzuki.
JSTests:
* stress/big-int-to-string.js:
Source/JavaScriptCore:
The implementation of JSBigInt::toStringToGeneric doesn't handle power
of 2 radix when JSBigInt length is >= 2. To handle such cases, we
implemented JSBigInt::toStringBasePowerOfTwo that follows the
algorithm that groups bits using mask of (2 ^ n) - 1 to extract every
digit.
* runtime/JSBigInt.cpp:
(JSC::JSBigInt::toString):
(JSC::JSBigInt::toStringBasePowerOfTwo):
* runtime/JSBigInt.h:
Source/WTF:
* wtf/MathExtras.h:
(WTF::ctz32):
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@236647
268f45cc-cd09-0410-ab3c-
d52691b4dbfc