v8
V8 is Google’s open source high-performance JavaScript and WebAssembly engine, written in C++.
Loading...
Searching...
No Matches
v8::internal::BigInt Class Reference

#include <bigint.h>

Inheritance diagram for v8::internal::BigInt:
Collaboration diagram for v8::internal::BigInt:

Classes

class  BodyDescriptor
 

Public Member Functions

bool ToBoolean ()
 
uint32_t Hash ()
 
bool IsNegative () const
 
V8_EXPORT_PRIVATE int64_t AsInt64 (bool *lossless=nullptr)
 
uint64_t AsUint64 (bool *lossless=nullptr)
 
uint32_t Words64Count ()
 
void ToWordsArray64 (int *sign_bit, uint32_t *words64_count, uint64_t *words)
 
void BigIntShortPrint (std::ostream &os)
 
- Public Member Functions inherited from v8::internal::BigIntBase
uint32_t length () const
 
uint32_t length (AcquireLoadTag) const
 
bigint::Digits digits () const
 
- Public Member Functions inherited from v8::internal::HeapObjectLayout
 HeapObjectLayout ()=delete
 
Tagged< Mapmap () const
 
Tagged< Mapmap (AcquireLoadTag) const
 
MapWord map_word (RelaxedLoadTag) const
 
void set_map (Isolate *isolate, Tagged< Map > value)
 
template<typename IsolateT >
void set_map (IsolateT *isolate, Tagged< Map > value, ReleaseStoreTag)
 
template<typename IsolateT >
void set_map_safe_transition (IsolateT *isolate, Tagged< Map > value, ReleaseStoreTag)
 
void set_map_safe_transition_no_write_barrier (Isolate *isolate, Tagged< Map > value, RelaxedStoreTag=kRelaxedStore)
 
template<typename IsolateT >
void set_map_after_allocation (IsolateT *isolate, Tagged< Map > value, WriteBarrierMode mode=UPDATE_WRITE_BARRIER)
 
void set_map_no_write_barrier (Isolate *isolate, Tagged< Map > value, RelaxedStoreTag=kRelaxedStore)
 
void set_map_word_forwarded (Tagged< HeapObject > target_object, ReleaseStoreTag)
 
void set_map_word_forwarded (Tagged< HeapObject > target_object, RelaxedStoreTag)
 
Address ptr () const
 
Address address () const
 
ReadOnlyRoots EarlyGetReadOnlyRoots () const
 
int Size () const
 
V8_EXPORT_PRIVATE int SizeFromMap (Tagged< Map > map) const
 
WriteBarrierMode GetWriteBarrierMode (const DisallowGarbageCollection &promise)
 

Static Public Member Functions

static Handle< BigIntUnaryMinus (Isolate *isolate, DirectHandle< BigInt > x)
 
static MaybeDirectHandle< BigIntBitwiseNot (Isolate *isolate, DirectHandle< BigInt > x)
 
static MaybeDirectHandle< BigIntExponentiate (Isolate *isolate, DirectHandle< BigInt > base, DirectHandle< BigInt > exponent)
 
static MaybeHandle< BigIntMultiply (Isolate *isolate, DirectHandle< BigInt > x, DirectHandle< BigInt > y)
 
static MaybeHandle< BigIntDivide (Isolate *isolate, DirectHandle< BigInt > x, DirectHandle< BigInt > y)
 
static MaybeHandle< BigIntRemainder (Isolate *isolate, DirectHandle< BigInt > x, DirectHandle< BigInt > y)
 
static MaybeHandle< BigIntAdd (Isolate *isolate, DirectHandle< BigInt > x, DirectHandle< BigInt > y)
 
static MaybeHandle< BigIntSubtract (Isolate *isolate, DirectHandle< BigInt > x, DirectHandle< BigInt > y)
 
static ComparisonResult CompareToBigInt (DirectHandle< BigInt > x, DirectHandle< BigInt > y)
 
static bool EqualToBigInt (Tagged< BigInt > x, Tagged< BigInt > y)
 
static MaybeHandle< BigIntIncrement (Isolate *isolate, DirectHandle< BigInt > x)
 
static MaybeHandle< BigIntDecrement (Isolate *isolate, DirectHandle< BigInt > x)
 
static Maybe< boolEqualToString (Isolate *isolate, DirectHandle< BigInt > x, DirectHandle< String > y)
 
static bool EqualToNumber (DirectHandle< BigInt > x, DirectHandle< Object > y)
 
static Maybe< ComparisonResultCompareToString (Isolate *isolate, DirectHandle< BigInt > x, DirectHandle< String > y)
 
static ComparisonResult CompareToNumber (DirectHandle< BigInt > x, DirectHandle< Object > y)
 
static V8_EXPORT_PRIVATE ComparisonResult CompareToDouble (DirectHandle< BigInt > x, double y)
 
static DirectHandle< BigIntAsIntN (Isolate *isolate, uint64_t n, DirectHandle< BigInt > x)
 
static MaybeDirectHandle< BigIntAsUintN (Isolate *isolate, uint64_t n, DirectHandle< BigInt > x)
 
static V8_EXPORT_PRIVATE Handle< BigIntFromInt64 (Isolate *isolate, int64_t n)
 
static V8_EXPORT_PRIVATE Handle< BigIntFromUint64 (Isolate *isolate, uint64_t n)
 
static MaybeDirectHandle< BigIntFromWords64 (Isolate *isolate, int sign_bit, uint32_t words64_count, const uint64_t *words)
 
static uint32_t SizeFor (uint32_t length)
 
static MaybeHandle< StringToString (Isolate *isolate, DirectHandle< BigInt > bigint, int radix=10, ShouldThrow should_throw=kThrowOnError)
 
static DirectHandle< StringNoSideEffectsToString (Isolate *isolate, DirectHandle< BigInt > bigint)
 
static DirectHandle< NumberToNumber (Isolate *isolate, DirectHandle< BigInt > x)
 
static V8_EXPORT_PRIVATE MaybeHandle< BigIntFromNumber (Isolate *isolate, DirectHandle< Object > number)
 

Private Member Functions

uint32_t GetBitfieldForSerialization () const
 
void SerializeDigits (uint8_t *storage, size_t storage_length)
 

Static Private Member Functions

template<typename IsolateT >
static Handle< BigIntZero (IsolateT *isolate, AllocationType allocation=AllocationType::kYoung)
 
template<typename IsolateT >
static MaybeHandle< BigIntAllocate (IsolateT *isolate, bigint::FromStringAccumulator *accumulator, bool negative, AllocationType allocation)
 
static size_t DigitsByteLengthForBitfield (uint32_t bitfield)
 
static V8_WARN_UNUSED_RESULT MaybeDirectHandle< BigIntFromSerializedDigits (Isolate *isolate, uint32_t bitfield, base::Vector< const uint8_t > digits_storage)
 

Friends

template<typename IsolateT >
class StringToBigIntHelper
 
class ValueDeserializer
 
class ValueSerializer
 

Additional Inherited Members

- Public Types inherited from v8::internal::BigIntBase
using SignBits = base::BitField<bool, 0, 1>
 
using LengthBits = SignBits::Next<uint32_t, kLengthFieldBits>
 
- Static Public Attributes inherited from v8::internal::BigIntBase
static const uint32_t kMaxLengthBits = 1 << 30
 
static const uint32_t kMaxLength
 
static const uint32_t kLengthFieldBits = 30
 

Detailed Description

Definition at line 181 of file bigint.h.

Member Function Documentation

◆ Add()

MaybeHandle< BigInt > v8::internal::BigInt::Add ( Isolate * isolate,
DirectHandle< BigInt > x,
DirectHandle< BigInt > y )
static

Definition at line 516 of file bigint.cc.

Here is the call graph for this function:

◆ Allocate()

template<typename IsolateT >
template MaybeHandle< BigInt > v8::internal::BigInt::Allocate ( IsolateT * isolate,
bigint::FromStringAccumulator * accumulator,
bool negative,
AllocationType allocation )
staticprivate

Definition at line 1192 of file bigint.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ AsInt64()

int64_t v8::internal::BigInt::AsInt64 ( bool * lossless = nullptr)

Definition at line 1442 of file bigint.cc.

Here is the call graph for this function:

◆ AsIntN()

DirectHandle< BigInt > v8::internal::BigInt::AsIntN ( Isolate * isolate,
uint64_t n,
DirectHandle< BigInt > x )
static

Definition at line 1294 of file bigint.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ AsUint64()

uint64_t v8::internal::BigInt::AsUint64 ( bool * lossless = nullptr)

Definition at line 1449 of file bigint.cc.

Here is the call graph for this function:

◆ AsUintN()

MaybeDirectHandle< BigInt > v8::internal::BigInt::AsUintN ( Isolate * isolate,
uint64_t n,
DirectHandle< BigInt > x )
static

Definition at line 1309 of file bigint.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ BigIntShortPrint()

void v8::internal::BigInt::BigIntShortPrint ( std::ostream & os)

Definition at line 1124 of file bigint.cc.

Here is the call graph for this function:

◆ BitwiseNot()

MaybeDirectHandle< BigInt > v8::internal::BigInt::BitwiseNot ( Isolate * isolate,
DirectHandle< BigInt > x )
static

Definition at line 349 of file bigint.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ CompareToBigInt()

ComparisonResult v8::internal::BigInt::CompareToBigInt ( DirectHandle< BigInt > x,
DirectHandle< BigInt > y )
static

Definition at line 579 of file bigint.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ CompareToDouble()

ComparisonResult v8::internal::BigInt::CompareToDouble ( DirectHandle< BigInt > x,
double y )
static

Definition at line 708 of file bigint.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ CompareToNumber()

ComparisonResult v8::internal::BigInt::CompareToNumber ( DirectHandle< BigInt > x,
DirectHandle< Object > y )
static

Definition at line 679 of file bigint.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ CompareToString()

Maybe< ComparisonResult > v8::internal::BigInt::CompareToString ( Isolate * isolate,
DirectHandle< BigInt > x,
DirectHandle< String > y )
static

Definition at line 625 of file bigint.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Decrement()

MaybeHandle< BigInt > v8::internal::BigInt::Decrement ( Isolate * isolate,
DirectHandle< BigInt > x )
static

Definition at line 611 of file bigint.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ DigitsByteLengthForBitfield()

size_t v8::internal::BigInt::DigitsByteLengthForBitfield ( uint32_t bitfield)
staticprivate

Definition at line 1226 of file bigint.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Divide()

MaybeHandle< BigInt > v8::internal::BigInt::Divide ( Isolate * isolate,
DirectHandle< BigInt > x,
DirectHandle< BigInt > y )
static

Definition at line 454 of file bigint.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ EqualToBigInt()

bool v8::internal::BigInt::EqualToBigInt ( Tagged< BigInt > x,
Tagged< BigInt > y )
static

Definition at line 590 of file bigint.cc.

Here is the caller graph for this function:

◆ EqualToNumber()

bool v8::internal::BigInt::EqualToNumber ( DirectHandle< BigInt > x,
DirectHandle< Object > y )
static

Definition at line 660 of file bigint.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ EqualToString()

Maybe< bool > v8::internal::BigInt::EqualToString ( Isolate * isolate,
DirectHandle< BigInt > x,
DirectHandle< String > y )
static

Definition at line 643 of file bigint.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Exponentiate()

MaybeDirectHandle< BigInt > v8::internal::BigInt::Exponentiate ( Isolate * isolate,
DirectHandle< BigInt > base,
DirectHandle< BigInt > exponent )
static

Definition at line 362 of file bigint.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ FromInt64()

Handle< BigInt > v8::internal::BigInt::FromInt64 ( Isolate * isolate,
int64_t n )
static

Definition at line 1333 of file bigint.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ FromNumber()

MaybeHandle< BigInt > v8::internal::BigInt::FromNumber ( Isolate * isolate,
DirectHandle< Object > number )
static

Definition at line 954 of file bigint.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ FromSerializedDigits()

MaybeDirectHandle< BigInt > v8::internal::BigInt::FromSerializedDigits ( Isolate * isolate,
uint32_t bitfield,
base::Vector< const uint8_t > digits_storage )
staticprivate

Definition at line 1251 of file bigint.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ FromUint64()

Handle< BigInt > v8::internal::BigInt::FromUint64 ( Isolate * isolate,
uint64_t n )
static

Definition at line 1355 of file bigint.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ FromWords64()

MaybeDirectHandle< BigInt > v8::internal::BigInt::FromWords64 ( Isolate * isolate,
int sign_bit,
uint32_t words64_count,
const uint64_t * words )
static

Definition at line 1366 of file bigint.cc.

Here is the call graph for this function:

◆ GetBitfieldForSerialization()

uint32_t v8::internal::BigInt::GetBitfieldForSerialization ( ) const
private

Definition at line 1217 of file bigint.cc.

Here is the call graph for this function:

◆ Hash()

uint32_t v8::internal::BigInt::Hash ( )
inline

Definition at line 214 of file bigint.h.

Here is the call graph for this function:

◆ Increment()

MaybeHandle< BigInt > v8::internal::BigInt::Increment ( Isolate * isolate,
DirectHandle< BigInt > x )
static

Definition at line 599 of file bigint.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ IsNegative()

bool v8::internal::BigInt::IsNegative ( ) const
inline

Definition at line 219 of file bigint.h.

Here is the call graph for this function:

◆ Multiply()

MaybeHandle< BigInt > v8::internal::BigInt::Multiply ( Isolate * isolate,
DirectHandle< BigInt > x,
DirectHandle< BigInt > y )
static

Definition at line 432 of file bigint.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ NoSideEffectsToString()

DirectHandle< String > v8::internal::BigInt::NoSideEffectsToString ( Isolate * isolate,
DirectHandle< BigInt > bigint )
static

Definition at line 922 of file bigint.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Remainder()

MaybeHandle< BigInt > v8::internal::BigInt::Remainder ( Isolate * isolate,
DirectHandle< BigInt > x,
DirectHandle< BigInt > y )
static

Definition at line 488 of file bigint.cc.

Here is the call graph for this function:

◆ SerializeDigits()

void v8::internal::BigInt::SerializeDigits ( uint8_t * storage,
size_t storage_length )
private

Definition at line 1232 of file bigint.cc.

Here is the call graph for this function:

◆ SizeFor()

static uint32_t v8::internal::BigInt::SizeFor ( uint32_t length)
inlinestatic

Definition at line 252 of file bigint.h.

Here is the caller graph for this function:

◆ Subtract()

MaybeHandle< BigInt > v8::internal::BigInt::Subtract ( Isolate * isolate,
DirectHandle< BigInt > x,
DirectHandle< BigInt > y )
static

Definition at line 536 of file bigint.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ToBoolean()

bool v8::internal::BigInt::ToBoolean ( )
inline

Definition at line 213 of file bigint.h.

Here is the call graph for this function:

◆ ToNumber()

DirectHandle< Number > v8::internal::BigInt::ToNumber ( Isolate * isolate,
DirectHandle< BigInt > x )
static

Definition at line 1023 of file bigint.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ToString()

MaybeHandle< String > v8::internal::BigInt::ToString ( Isolate * isolate,
DirectHandle< BigInt > bigint,
int radix = 10,
ShouldThrow should_throw = kThrowOnError )
static

Definition at line 835 of file bigint.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ToWordsArray64()

void v8::internal::BigInt::ToWordsArray64 ( int * sign_bit,
uint32_t * words64_count,
uint64_t * words )

Definition at line 1404 of file bigint.cc.

Here is the call graph for this function:

◆ UnaryMinus()

Handle< BigInt > v8::internal::BigInt::UnaryMinus ( Isolate * isolate,
DirectHandle< BigInt > x )
static

Definition at line 341 of file bigint.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Words64Count()

uint32_t v8::internal::BigInt::Words64Count ( )

Definition at line 1398 of file bigint.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Zero()

template<typename IsolateT >
template Handle< BigInt > v8::internal::BigInt::Zero ( IsolateT * isolate,
AllocationType allocation = AllocationType::kYoung )
staticprivate

Definition at line 333 of file bigint.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

Friends And Related Symbol Documentation

◆ StringToBigIntHelper

template<typename IsolateT >
friend class StringToBigIntHelper
friend

Definition at line 287 of file bigint.h.

◆ ValueDeserializer

friend class ValueDeserializer
friend

Definition at line 288 of file bigint.h.

◆ ValueSerializer

friend class ValueSerializer
friend

Definition at line 289 of file bigint.h.


The documentation for this class was generated from the following files: