mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-26 01:35:08 +02:00
LibJS+LibCrypto: Use a bitwise approach for BigInt's as*IntN methods
This speeds up expressions such as `BigInt.asIntN(0x4000000000000, 1n)` (#3615). And those involving very large bigints.
This commit is contained in:
Notes:
github-actions[bot]
2025-03-20 08:45:14 +00:00
Author: https://github.com/ttrssreal Commit: https://github.com/LadybirdBrowser/ladybird/commit/12cbefbee7b Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3994 Reviewed-by: https://github.com/gmta ✅
@@ -120,6 +120,7 @@ public:
|
||||
[[nodiscard]] SignedBigInteger multiplied_by(SignedBigInteger const& other) const;
|
||||
[[nodiscard]] SignedDivisionResult divided_by(SignedBigInteger const& divisor) const;
|
||||
|
||||
[[nodiscard]] ErrorOr<SignedBigInteger> mod_power_of_two(size_t power_of_two) const;
|
||||
[[nodiscard]] ErrorOr<SignedBigInteger> try_shift_left(size_t num_bits) const;
|
||||
|
||||
[[nodiscard]] SignedBigInteger plus(UnsignedBigInteger const& other) const;
|
||||
|
||||
Reference in New Issue
Block a user