Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 070591535aa45c45d3bb8a2d89f078250d9e5500
      
https://github.com/WebKit/WebKit/commit/070591535aa45c45d3bb8a2d89f078250d9e5500
  Author: Devin Rousso <[email protected]>
  Date:   2026-06-27 (Sat, 27 Jun 2026)

  Changed paths:
    A JSTests/stress/bigint-abs.js
    A JSTests/stress/bigint-cbrt.js
    A JSTests/stress/bigint-max.js
    A JSTests/stress/bigint-min.js
    A JSTests/stress/bigint-pow.js
    A JSTests/stress/bigint-sign.js
    A JSTests/stress/bigint-sqrt.js
    M Source/JavaScriptCore/runtime/BigIntConstructor.cpp
    M Source/JavaScriptCore/runtime/JSBigInt.cpp
    M Source/JavaScriptCore/runtime/JSBigInt.h
    M Source/JavaScriptCore/runtime/OptionsList.h

  Log Message:
  -----------
  [JSC] implement BigInt math proposal
https://bugs.webkit.org/show_bug.cgi?id=293604
<rdar://problem/152472996>

Reviewed by Yusuke Suzuki.

These methods provide some parity with `Math`, thereby making `BigInt` more 
easily usable for complex logic.

Spec: <https://tc39.es/proposal-bigint-math/>
Proposal: <https://github.com/tc39/proposal-bigint-math>

* Source/JavaScriptCore/runtime/BigIntConstructor.cpp:
(JSC::BigIntConstructor::finishCreation):
(JSC::bigIntConstructorAbs): Added.
(JSC::bigIntConstructorCbrt): Added.
(JSC::bigIntConstructorMax): Added.
(JSC::bigIntConstructorMin): Added.
(JSC::bigIntConstructorPow): Added.
(JSC::bigIntConstructorSign): Added.
(JSC::bigIntConstructorSqrt): Added.

* Source/JavaScriptCore/runtime/JSBigInt.h:
(JSC::JSBigInt::digit const):
(JSC::JSBigInt::digit): Deleted.
* Source/JavaScriptCore/runtime/JSBigInt.cpp:
(JSC::JSBigInt::bitLength const): Added.
(JSC::JSBigInt::compareDigits): Added.
(JSC::JSBigInt::multiplyDigits): Added.
(JSC::JSBigInt::divideDigits): Added.
(JSC::JSBigInt::addDigits): Added.
(JSC::JSBigInt::oneShiftedLeft): Added.
(JSC::JSBigInt::sqrt): Added.
(JSC::JSBigInt::cbrt): Added.
Add digit-array helpers shared by `BigInt.sqrt` and `BigInt.cbrt`.

* Source/JavaScriptCore/runtime/OptionsList.h:
Add feature flag for these new methods.

* JSTests/stress/bigint-abs.js: Added.
* JSTests/stress/bigint-cbrt.js: Added.
* JSTests/stress/bigint-max.js: Added.
* JSTests/stress/bigint-min.js: Added.
* JSTests/stress/bigint-pow.js: Added.
* JSTests/stress/bigint-sign.js: Added.
* JSTests/stress/bigint-sqrt.js: Added.

Canonical link: https://commits.webkit.org/315974@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to