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

#include <string-forwarding-table.h>

Collaboration diagram for v8::internal::StringForwardingTable:

Classes

class  Block
 
class  BlockVector
 
class  Record
 

Public Member Functions

 StringForwardingTable (Isolate *isolate)
 
 ~StringForwardingTable ()
 
int size () const
 
bool empty () const
 
int AddForwardString (Tagged< String > string, Tagged< String > forward_to)
 
template<typename T >
int AddExternalResourceAndHash (Tagged< String > string, T *resource, uint32_t raw_hash)
 
void UpdateForwardString (int index, Tagged< String > forward_to)
 
template<typename T >
bool TryUpdateExternalResource (int index, T *resource)
 
Tagged< StringGetForwardString (PtrComprCageBase cage_base, int index) const
 
V8_EXPORT_PRIVATE uint32_t GetRawHash (PtrComprCageBase cage_base, int index) const
 
v8::String::ExternalStringResourceBaseGetExternalResource (int index, bool *is_one_byte) const
 
template<typename Func >
V8_INLINE void IterateElements (Func &&callback)
 
void TearDown ()
 
void Reset ()
 
void UpdateAfterYoungEvacuation ()
 
void UpdateAfterFullEvacuation ()
 
template<typename Func >
void IterateElements (Func &&callback)
 

Static Public Member Functions

static constexpr Tagged< Smiunused_element ()
 
static constexpr Tagged< Smideleted_element ()
 
static Address GetForwardStringAddress (Isolate *isolate, int index)
 
static uint32_t GetRawHashStatic (Isolate *isolate, int index)
 

Static Public Attributes

static constexpr int kInitialBlockSize = 16
 
static constexpr int kInitialBlockSizeHighestBit
 
static constexpr int kInitialBlockVectorCapacity = 4
 

Private Member Functions

void InitializeBlockVector ()
 
BlockVectorEnsureCapacity (uint32_t block)
 

Static Private Member Functions

static uint32_t BlockForIndex (int index, uint32_t *index_in_block_out)
 
static uint32_t IndexInBlock (int index, uint32_t block)
 
static uint32_t CapacityForBlock (uint32_t block)
 

Private Attributes

Isolateisolate_
 
std::atomic< BlockVector * > blocks_
 
std::vector< std::unique_ptr< BlockVector > > block_vector_storage_
 
std::atomic< int > next_free_index_
 
base::Mutex grow_mutex_
 

Detailed Description

Definition at line 26 of file string-forwarding-table.h.

Constructor & Destructor Documentation

◆ StringForwardingTable()

v8::internal::StringForwardingTable::StringForwardingTable ( Isolate * isolate)
explicit

Definition at line 160 of file string-forwarding-table.cc.

Here is the call graph for this function:

◆ ~StringForwardingTable()

v8::internal::StringForwardingTable::~StringForwardingTable ( )

Definition at line 165 of file string-forwarding-table.cc.

Here is the call graph for this function:

Member Function Documentation

◆ AddExternalResourceAndHash()

template<typename T >
int v8::internal::StringForwardingTable::AddExternalResourceAndHash ( Tagged< String > string,
T * resource,
uint32_t raw_hash )

Definition at line 234 of file string-forwarding-table.cc.

Here is the call graph for this function:

◆ AddForwardString()

int v8::internal::StringForwardingTable::AddForwardString ( Tagged< String > string,
Tagged< String > forward_to )

Definition at line 207 of file string-forwarding-table.cc.

Here is the call graph for this function:

◆ BlockForIndex()

uint32_t v8::internal::StringForwardingTable::BlockForIndex ( int index,
uint32_t * index_in_block_out )
inlinestaticprivate

Definition at line 303 of file string-forwarding-table-inl.h.

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

◆ CapacityForBlock()

uint32_t v8::internal::StringForwardingTable::CapacityForBlock ( uint32_t block)
inlinestaticprivate

Definition at line 328 of file string-forwarding-table-inl.h.

Here is the caller graph for this function:

◆ deleted_element()

static constexpr Tagged< Smi > v8::internal::StringForwardingTable::deleted_element ( )
inlinestaticconstexpr

Definition at line 36 of file string-forwarding-table.h.

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

◆ empty()

bool v8::internal::StringForwardingTable::empty ( ) const
inline

Definition at line 300 of file string-forwarding-table-inl.h.

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

◆ EnsureCapacity()

StringForwardingTable::BlockVector * v8::internal::StringForwardingTable::EnsureCapacity ( uint32_t block)
private

Definition at line 181 of file string-forwarding-table.cc.

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

◆ GetExternalResource()

v8::String::ExternalStringResourceBase * v8::internal::StringForwardingTable::GetExternalResource ( int index,
bool * is_one_byte ) const

Definition at line 317 of file string-forwarding-table.cc.

Here is the call graph for this function:

◆ GetForwardString()

Tagged< String > v8::internal::StringForwardingTable::GetForwardString ( PtrComprCageBase cage_base,
int index ) const

◆ GetForwardStringAddress()

Address v8::internal::StringForwardingTable::GetForwardStringAddress ( Isolate * isolate,
int index )
static

Definition at line 294 of file string-forwarding-table.cc.

◆ GetRawHash()

uint32_t v8::internal::StringForwardingTable::GetRawHash ( PtrComprCageBase cage_base,
int index ) const

Definition at line 301 of file string-forwarding-table.cc.

Here is the call graph for this function:

◆ GetRawHashStatic()

uint32_t v8::internal::StringForwardingTable::GetRawHashStatic ( Isolate * isolate,
int index )
static

Definition at line 312 of file string-forwarding-table.cc.

◆ IndexInBlock()

uint32_t v8::internal::StringForwardingTable::IndexInBlock ( int index,
uint32_t block )
inlinestaticprivate

Definition at line 319 of file string-forwarding-table-inl.h.

Here is the caller graph for this function:

◆ InitializeBlockVector()

void v8::internal::StringForwardingTable::InitializeBlockVector ( )
private

Definition at line 172 of file string-forwarding-table.cc.

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

◆ IterateElements() [1/2]

template<typename Func >
void v8::internal::StringForwardingTable::IterateElements ( Func && callback)

Definition at line 333 of file string-forwarding-table-inl.h.

Here is the call graph for this function:

◆ IterateElements() [2/2]

template<typename Func >
V8_INLINE void v8::internal::StringForwardingTable::IterateElements ( Func && callback)
Here is the caller graph for this function:

◆ Reset()

void v8::internal::StringForwardingTable::Reset ( )

Definition at line 340 of file string-forwarding-table.cc.

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

◆ size()

int v8::internal::StringForwardingTable::size ( ) const
inline

Definition at line 299 of file string-forwarding-table-inl.h.

Here is the caller graph for this function:

◆ TearDown()

void v8::internal::StringForwardingTable::TearDown ( )

Definition at line 326 of file string-forwarding-table.cc.

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

◆ TryUpdateExternalResource()

template<typename T >
bool v8::internal::StringForwardingTable::TryUpdateExternalResource ( int index,
T * resource )
Here is the caller graph for this function:

◆ unused_element()

static constexpr Tagged< Smi > v8::internal::StringForwardingTable::unused_element ( )
inlinestaticconstexpr

Definition at line 35 of file string-forwarding-table.h.

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

◆ UpdateAfterFullEvacuation()

void v8::internal::StringForwardingTable::UpdateAfterFullEvacuation ( )

Definition at line 375 of file string-forwarding-table.cc.

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

◆ UpdateAfterYoungEvacuation()

void v8::internal::StringForwardingTable::UpdateAfterYoungEvacuation ( )

Definition at line 354 of file string-forwarding-table.cc.

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

◆ UpdateForwardString()

void v8::internal::StringForwardingTable::UpdateForwardString ( int index,
Tagged< String > forward_to )

Definition at line 223 of file string-forwarding-table.cc.

Here is the call graph for this function:

Member Data Documentation

◆ block_vector_storage_

std::vector<std::unique_ptr<BlockVector> > v8::internal::StringForwardingTable::block_vector_storage_
private

Definition at line 98 of file string-forwarding-table.h.

◆ blocks_

std::atomic<BlockVector*> v8::internal::StringForwardingTable::blocks_
private

Definition at line 92 of file string-forwarding-table.h.

◆ grow_mutex_

base::Mutex v8::internal::StringForwardingTable::grow_mutex_
private

Definition at line 100 of file string-forwarding-table.h.

◆ isolate_

Isolate* v8::internal::StringForwardingTable::isolate_
private

Definition at line 91 of file string-forwarding-table.h.

◆ kInitialBlockSize

int v8::internal::StringForwardingTable::kInitialBlockSize = 16
staticconstexpr

Definition at line 29 of file string-forwarding-table.h.

◆ kInitialBlockSizeHighestBit

int v8::internal::StringForwardingTable::kInitialBlockSizeHighestBit
staticconstexpr
Initial value:
=
constexpr unsigned CountLeadingZeros32(uint32_t value)
Definition bits.h:122
constexpr int kBitsPerInt
Definition globals.h:687

Definition at line 31 of file string-forwarding-table.h.

◆ kInitialBlockVectorCapacity

int v8::internal::StringForwardingTable::kInitialBlockVectorCapacity = 4
staticconstexpr

Definition at line 34 of file string-forwarding-table.h.

◆ next_free_index_

std::atomic<int> v8::internal::StringForwardingTable::next_free_index_
private

Definition at line 99 of file string-forwarding-table.h.


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