5#ifndef V8_OBJECTS_BIGINT_H_
6#define V8_OBJECTS_BIGINT_H_
22class FromStringAccumulator;
74 uint32_t must_round_down);
77class ValueDeserializer;
80#if V8_HOST_ARCH_64_BIT && !V8_COMPRESS_POINTERS
83#define BIGINT_NEEDS_PADDING 1
121 friend class ::v8::internal::BigInt;
147 return raw_digits()[
n].value();
153#ifdef BIGINT_NEEDS_PADDING
174#ifdef BIGINT_NEEDS_PADDING
175 memset(padding_, 0,
arraysize(padding_));
243 uint32_t words64_count,
244 const uint64_t* words);
246 uint64_t
AsUint64(
bool* lossless =
nullptr);
248 void ToWordsArray64(
int* sign_bit, uint32_t* words64_count, uint64_t* words);
252 inline static uint32_t
SizeFor(uint32_t length) {
277 template <
template <
typename>
typename HandleType>
280 typename HandleType<BigInt>::MaybeType
281 FromObject(
Isolate* isolate, HandleType<Object> obj);
283 class BodyDescriptor;
286 template <
typename IsolateT>
292 template <
typename IsolateT>
295 template <
typename IsolateT>
307 Isolate* isolate, uint32_t bitfield,
#define SLOW_DCHECK(condition)
static constexpr int kLastUsedBit
static constexpr T decode(U value)
bigint::Digits digits() const
friend struct OffsetsForDebug
static const uint32_t kDigitBits
static const uint32_t kHalfDigitBits
static const uint32_t kDigitSize
static const uint32_t kLengthFieldBits
uint32_t length(AcquireLoadTag) const
digit_t digit(uint32_t n) const
std::atomic_uint32_t bitfield_
static const uint32_t kMaxLength
FLEXIBLE_ARRAY_MEMBER(UnalignedValueMember< digit_t >, raw_digits)
static const uint32_t kMaxLengthBits
static const digit_t kHalfDigitMask
friend class ::v8::internal::BigInt
V8_EXPORT_PRIVATE int64_t AsInt64(bool *lossless=nullptr)
uint32_t GetBitfieldForSerialization() const
static Maybe< ComparisonResult > CompareToString(Isolate *isolate, DirectHandle< BigInt > x, DirectHandle< String > y)
static MaybeHandle< BigInt > Remainder(Isolate *isolate, DirectHandle< BigInt > x, DirectHandle< BigInt > y)
static Maybe< bool > EqualToString(Isolate *isolate, DirectHandle< BigInt > x, DirectHandle< String > y)
static ComparisonResult CompareToBigInt(DirectHandle< BigInt > x, DirectHandle< BigInt > y)
static MaybeHandle< BigInt > Multiply(Isolate *isolate, DirectHandle< BigInt > x, DirectHandle< BigInt > y)
static uint32_t SizeFor(uint32_t length)
static DirectHandle< Number > ToNumber(Isolate *isolate, DirectHandle< BigInt > x)
void ToWordsArray64(int *sign_bit, uint32_t *words64_count, uint64_t *words)
static MaybeDirectHandle< BigInt > Exponentiate(Isolate *isolate, DirectHandle< BigInt > base, DirectHandle< BigInt > exponent)
void SerializeDigits(uint8_t *storage, size_t storage_length)
static MaybeDirectHandle< BigInt > AsUintN(Isolate *isolate, uint64_t n, DirectHandle< BigInt > x)
static MaybeHandle< BigInt > Divide(Isolate *isolate, DirectHandle< BigInt > x, DirectHandle< BigInt > y)
static MaybeHandle< String > ToString(Isolate *isolate, DirectHandle< BigInt > bigint, int radix=10, ShouldThrow should_throw=kThrowOnError)
static MaybeHandle< BigInt > Increment(Isolate *isolate, DirectHandle< BigInt > x)
static bool EqualToBigInt(Tagged< BigInt > x, Tagged< BigInt > y)
static Handle< BigInt > Zero(IsolateT *isolate, AllocationType allocation=AllocationType::kYoung)
static bool EqualToNumber(DirectHandle< BigInt > x, DirectHandle< Object > y)
static V8_EXPORT_PRIVATE Handle< BigInt > FromUint64(Isolate *isolate, uint64_t n)
static MaybeDirectHandle< BigInt > FromWords64(Isolate *isolate, int sign_bit, uint32_t words64_count, const uint64_t *words)
static MaybeHandle< BigInt > Decrement(Isolate *isolate, DirectHandle< BigInt > x)
static MaybeHandle< BigInt > Allocate(IsolateT *isolate, bigint::FromStringAccumulator *accumulator, bool negative, AllocationType allocation)
static Handle< BigInt > UnaryMinus(Isolate *isolate, DirectHandle< BigInt > x)
static DirectHandle< String > NoSideEffectsToString(Isolate *isolate, DirectHandle< BigInt > bigint)
static V8_EXPORT_PRIVATE ComparisonResult CompareToDouble(DirectHandle< BigInt > x, double y)
static V8_EXPORT_PRIVATE Handle< BigInt > FromInt64(Isolate *isolate, int64_t n)
void BigIntShortPrint(std::ostream &os)
static MaybeDirectHandle< BigInt > BitwiseNot(Isolate *isolate, DirectHandle< BigInt > x)
static MaybeHandle< BigInt > Add(Isolate *isolate, DirectHandle< BigInt > x, DirectHandle< BigInt > y)
static ComparisonResult CompareToNumber(DirectHandle< BigInt > x, DirectHandle< Object > y)
static DirectHandle< BigInt > AsIntN(Isolate *isolate, uint64_t n, DirectHandle< BigInt > x)
static size_t DigitsByteLengthForBitfield(uint32_t bitfield)
uint64_t AsUint64(bool *lossless=nullptr)
static MaybeHandle< BigInt > Subtract(Isolate *isolate, DirectHandle< BigInt > x, DirectHandle< BigInt > y)
static V8_WARN_UNUSED_RESULT MaybeDirectHandle< BigInt > FromSerializedDigits(Isolate *isolate, uint32_t bitfield, base::Vector< const uint8_t > digits_storage)
static V8_EXPORT_PRIVATE MaybeHandle< BigInt > FromNumber(Isolate *isolate, DirectHandle< Object > number)
#define EXPORT_TEMPLATE_DECLARE(export)
uint32_t RightShiftResultLength(Address x_addr, uint32_t x_sign, intptr_t shift)
void MutableBigInt_BitwiseAndNegNegAndCanonicalize(Address result_addr, Address x_addr, Address y_addr)
constexpr int kBitsPerByte
uint32_t ComputeLongHash(uint64_t key)
void MutableBigInt_BitwiseXorNegNegAndCanonicalize(Address result_addr, Address x_addr, Address y_addr)
void MutableBigInt_RightShiftAndCanonicalize(Address result_addr, Address x_addr, intptr_t shift, uint32_t must_round_down)
uint32_t ComputeUnseededHash(uint32_t key)
void MutableBigInt_BitwiseOrNegNegAndCanonicalize(Address result_addr, Address x_addr, Address y_addr)
int32_t MutableBigInt_AbsoluteMulAndCanonicalize(Address result_addr, Address x_addr, Address y_addr)
void MutableBigInt_BitwiseOrPosPosAndCanonicalize(Address result_addr, Address x_addr, Address y_addr)
v8::internal::LoadHandler V8_OBJECT_END
constexpr int kSystemPointerSize
int32_t MutableBigInt_AbsoluteCompare(Address x_addr, Address y_addr)
void MutableBigInt_BitwiseXorPosNegAndCanonicalize(Address result_addr, Address x_addr, Address y_addr)
void MutableBigInt_BitwiseAndPosNegAndCanonicalize(Address result_addr, Address x_addr, Address y_addr)
void MutableBigInt_BitwiseOrPosNegAndCanonicalize(Address result_addr, Address x_addr, Address y_addr)
void MutableBigInt_BitwiseAndPosPosAndCanonicalize(Address result_addr, Address x_addr, Address y_addr)
void MutableBigInt_AbsoluteSubAndCanonicalize(Address result_addr, Address x_addr, Address y_addr)
void MutableBigInt_AbsoluteAddAndCanonicalize(Address result_addr, Address x_addr, Address y_addr)
void MutableBigInt_LeftShiftAndCanonicalize(Address result_addr, Address x_addr, intptr_t shift)
int32_t MutableBigInt_AbsoluteModAndCanonicalize(Address result_addr, Address x_addr, Address y_addr)
int32_t MutableBigInt_AbsoluteDivAndCanonicalize(Address result_addr, Address x_addr, Address y_addr)
void MutableBigInt_BitwiseXorPosPosAndCanonicalize(Address result_addr, Address x_addr, Address y_addr)
#define DECL_VERIFIER(Name)
#define DECL_PRINTER(Name)
#define V8_EXPORT_PRIVATE
#define V8_WARN_UNUSED_RESULT