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

#include <bignum.h>

Collaboration diagram for v8::base::Bignum:

Public Member Functions

 Bignum ()
 
 Bignum (const Bignum &)=delete
 
Bignumoperator= (const Bignum &)=delete
 
void AssignUInt16 (uint16_t value)
 
void AssignUInt64 (uint64_t value)
 
void AssignBignum (const Bignum &other)
 
void AssignDecimalString (Vector< const char > value)
 
void AssignHexString (Vector< const char > value)
 
void AssignPowerUInt16 (uint16_t base, int exponent)
 
void AddUInt16 (uint16_t operand)
 
void AddUInt64 (uint64_t operand)
 
void AddBignum (const Bignum &other)
 
void SubtractBignum (const Bignum &other)
 
void Square ()
 
void ShiftLeft (int shift_amount)
 
void MultiplyByUInt32 (uint32_t factor)
 
void MultiplyByUInt64 (uint64_t factor)
 
void MultiplyByPowerOfTen (int exponent)
 
void Times10 ()
 
uint16_t DivideModuloIntBignum (const Bignum &other)
 
bool ToHexString (char *buffer, int buffer_size) const
 

Static Public Member Functions

static int Compare (const Bignum &a, const Bignum &b)
 
static bool Equal (const Bignum &a, const Bignum &b)
 
static bool LessEqual (const Bignum &a, const Bignum &b)
 
static bool Less (const Bignum &a, const Bignum &b)
 
static int PlusCompare (const Bignum &a, const Bignum &b, const Bignum &c)
 
static bool PlusEqual (const Bignum &a, const Bignum &b, const Bignum &c)
 
static bool PlusLessEqual (const Bignum &a, const Bignum &b, const Bignum &c)
 
static bool PlusLess (const Bignum &a, const Bignum &b, const Bignum &c)
 

Static Public Attributes

static const int kMaxSignificantBits = 3584
 

Private Types

using Chunk = uint32_t
 
using DoubleChunk = uint64_t
 

Private Member Functions

void EnsureCapacity (int size)
 
void Align (const Bignum &other)
 
void Clamp ()
 
bool IsClamped () const
 
void Zero ()
 
void BigitsShiftLeft (int shift_amount)
 
int BigitLength () const
 
Chunk BigitAt (int index) const
 
void SubtractTimes (const Bignum &other, int factor)
 

Private Attributes

Chunk bigits_buffer_ [kBigitCapacity]
 
Vector< Chunkbigits_
 
int used_digits_
 
int exponent_
 

Static Private Attributes

static const int kChunkSize = sizeof(Chunk) * 8
 
static const int kDoubleChunkSize = sizeof(DoubleChunk) * 8
 
static const int kBigitSize = 28
 
static const Chunk kBigitMask = (1 << kBigitSize) - 1
 
static const int kBigitCapacity = kMaxSignificantBits / kBigitSize
 

Detailed Description

Definition at line 13 of file bignum.h.

Member Typedef Documentation

◆ Chunk

using v8::base::Bignum::Chunk = uint32_t
private

Definition at line 78 of file bignum.h.

◆ DoubleChunk

using v8::base::Bignum::DoubleChunk = uint64_t
private

Definition at line 79 of file bignum.h.

Constructor & Destructor Documentation

◆ Bignum() [1/2]

v8::base::Bignum::Bignum ( )

Definition at line 12 of file bignum.cc.

◆ Bignum() [2/2]

v8::base::Bignum::Bignum ( const Bignum & )
delete

Member Function Documentation

◆ AddBignum()

void v8::base::Bignum::AddBignum ( const Bignum & other)

Definition at line 139 of file bignum.cc.

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

◆ AddUInt16()

void v8::base::Bignum::AddUInt16 ( uint16_t operand)

◆ AddUInt64()

void v8::base::Bignum::AddUInt64 ( uint64_t operand)

Definition at line 132 of file bignum.cc.

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

◆ Align()

void v8::base::Bignum::Align ( const Bignum & other)
private

Definition at line 642 of file bignum.cc.

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

◆ AssignBignum()

void v8::base::Bignum::AssignBignum ( const Bignum & other)

Definition at line 51 of file bignum.cc.

Here is the caller graph for this function:

◆ AssignDecimalString()

void v8::base::Bignum::AssignDecimalString ( Vector< const char > value)

Definition at line 76 of file bignum.cc.

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

◆ AssignHexString()

void v8::base::Bignum::AssignHexString ( Vector< const char > value)

Definition at line 103 of file bignum.cc.

Here is the call graph for this function:

◆ AssignPowerUInt16()

void v8::base::Bignum::AssignPowerUInt16 ( uint16_t base,
int exponent )

Definition at line 375 of file bignum.cc.

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

◆ AssignUInt16()

void v8::base::Bignum::AssignUInt16 ( uint16_t value)

Definition at line 25 of file bignum.cc.

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

◆ AssignUInt64()

void v8::base::Bignum::AssignUInt64 ( uint64_t value)

Definition at line 35 of file bignum.cc.

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

◆ BigitAt()

Bignum::Chunk v8::base::Bignum::BigitAt ( int index) const
private

Definition at line 560 of file bignum.cc.

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

◆ BigitLength()

int v8::base::Bignum::BigitLength ( ) const
inlineprivate

Definition at line 105 of file bignum.h.

Here is the caller graph for this function:

◆ BigitsShiftLeft()

void v8::base::Bignum::BigitsShiftLeft ( int shift_amount)
private

Definition at line 665 of file bignum.cc.

Here is the caller graph for this function:

◆ Clamp()

void v8::base::Bignum::Clamp ( )
private

Definition at line 620 of file bignum.cc.

Here is the caller graph for this function:

◆ Compare()

int v8::base::Bignum::Compare ( const Bignum & a,
const Bignum & b )
static

Definition at line 566 of file bignum.cc.

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

◆ DivideModuloIntBignum()

uint16_t v8::base::Bignum::DivideModuloIntBignum ( const Bignum & other)

Definition at line 448 of file bignum.cc.

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

◆ EnsureCapacity()

void v8::base::Bignum::EnsureCapacity ( int size)
inlineprivate

Definition at line 91 of file bignum.h.

Here is the caller graph for this function:

◆ Equal()

static bool v8::base::Bignum::Equal ( const Bignum & a,
const Bignum & b )
inlinestatic

Definition at line 53 of file bignum.h.

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

◆ IsClamped()

bool v8::base::Bignum::IsClamped ( ) const
private

Definition at line 630 of file bignum.cc.

Here is the caller graph for this function:

◆ Less()

static bool v8::base::Bignum::Less ( const Bignum & a,
const Bignum & b )
inlinestatic

Definition at line 59 of file bignum.h.

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

◆ LessEqual()

static bool v8::base::Bignum::LessEqual ( const Bignum & a,
const Bignum & b )
inlinestatic

Definition at line 56 of file bignum.h.

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

◆ MultiplyByPowerOfTen()

void v8::base::Bignum::MultiplyByPowerOfTen ( int exponent)

Definition at line 265 of file bignum.cc.

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

◆ MultiplyByUInt32()

void v8::base::Bignum::MultiplyByUInt32 ( uint32_t factor)

Definition at line 214 of file bignum.cc.

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

◆ MultiplyByUInt64()

void v8::base::Bignum::MultiplyByUInt64 ( uint64_t factor)

Definition at line 239 of file bignum.cc.

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

◆ operator=()

Bignum & v8::base::Bignum::operator= ( const Bignum & )
delete

◆ PlusCompare()

int v8::base::Bignum::PlusCompare ( const Bignum & a,
const Bignum & b,
const Bignum & c )
static

Definition at line 584 of file bignum.cc.

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

◆ PlusEqual()

static bool v8::base::Bignum::PlusEqual ( const Bignum & a,
const Bignum & b,
const Bignum & c )
inlinestatic

Definition at line 65 of file bignum.h.

◆ PlusLess()

static bool v8::base::Bignum::PlusLess ( const Bignum & a,
const Bignum & b,
const Bignum & c )
inlinestatic

Definition at line 73 of file bignum.h.

◆ PlusLessEqual()

static bool v8::base::Bignum::PlusLessEqual ( const Bignum & a,
const Bignum & b,
const Bignum & c )
inlinestatic

Definition at line 69 of file bignum.h.

◆ ShiftLeft()

void v8::base::Bignum::ShiftLeft ( int shift_amount)

Definition at line 206 of file bignum.cc.

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

◆ Square()

void v8::base::Bignum::Square ( )

Definition at line 304 of file bignum.cc.

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

◆ SubtractBignum()

void v8::base::Bignum::SubtractBignum ( const Bignum & other)

Definition at line 180 of file bignum.cc.

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

◆ SubtractTimes()

void v8::base::Bignum::SubtractTimes ( const Bignum & other,
int factor )
private

Definition at line 680 of file bignum.cc.

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

◆ Times10()

void v8::base::Bignum::Times10 ( )
inline

Definition at line 43 of file bignum.h.

Here is the caller graph for this function:

◆ ToHexString()

bool v8::base::Bignum::ToHexString ( char * buffer,
int buffer_size ) const

Definition at line 521 of file bignum.cc.

Here is the call graph for this function:

◆ Zero()

void v8::base::Bignum::Zero ( )
private

Definition at line 634 of file bignum.cc.

Here is the caller graph for this function:

Member Data Documentation

◆ bigits_

Vector<Chunk> v8::base::Bignum::bigits_
private

Definition at line 112 of file bignum.h.

◆ bigits_buffer_

Chunk v8::base::Bignum::bigits_buffer_[kBigitCapacity]
private

Definition at line 109 of file bignum.h.

◆ exponent_

int v8::base::Bignum::exponent_
private

Definition at line 115 of file bignum.h.

◆ kBigitCapacity

const int v8::base::Bignum::kBigitCapacity = kMaxSignificantBits / kBigitSize
staticprivate

Definition at line 89 of file bignum.h.

◆ kBigitMask

const Chunk v8::base::Bignum::kBigitMask = (1 << kBigitSize) - 1
staticprivate

Definition at line 86 of file bignum.h.

◆ kBigitSize

const int v8::base::Bignum::kBigitSize = 28
staticprivate

Definition at line 85 of file bignum.h.

◆ kChunkSize

const int v8::base::Bignum::kChunkSize = sizeof(Chunk) * 8
staticprivate

Definition at line 81 of file bignum.h.

◆ kDoubleChunkSize

const int v8::base::Bignum::kDoubleChunkSize = sizeof(DoubleChunk) * 8
staticprivate

Definition at line 82 of file bignum.h.

◆ kMaxSignificantBits

const int v8::base::Bignum::kMaxSignificantBits = 3584
static

Definition at line 18 of file bignum.h.

◆ used_digits_

int v8::base::Bignum::used_digits_
private

Definition at line 113 of file bignum.h.


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