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

#include <backing-store.h>

Inheritance diagram for v8::internal::BackingStore:
Collaboration diagram for v8::internal::BackingStore:

Classes

union  TypeSpecificData
 

Public Types

enum  ResizeOrGrowResult { kSuccess , kFailure , kRace }
 

Public Member Functions

 ~BackingStore ()
 
void * buffer_start () const
 
size_t byte_length (std::memory_order memory_order=std::memory_order_relaxed) const
 
size_t max_byte_length () const
 
size_t byte_capacity () const
 
bool is_shared () const
 
bool is_resizable_by_js () const
 
bool is_wasm_memory () const
 
bool is_wasm_memory64 () const
 
bool has_guard_regions () const
 
bool IsEmpty () const
 
ResizeOrGrowResult ResizeInPlace (Isolate *isolate, size_t new_byte_length)
 
ResizeOrGrowResult GrowInPlace (Isolate *isolate, size_t new_byte_length)
 
size_t PerIsolateAccountingLength ()
 
uint32_t id () const
 

Static Public Member Functions

static std::unique_ptr< BackingStoreAllocate (Isolate *isolate, size_t byte_length, SharedFlag shared, InitializedFlag initialized)
 
static std::unique_ptr< BackingStoreTryAllocateAndPartiallyCommitMemory (Isolate *isolate, size_t byte_length, size_t max_byte_length, size_t page_size, size_t initial_pages, size_t maximum_pages, WasmMemoryFlag wasm_memory, SharedFlag shared, bool has_guard_regions=false)
 
static std::unique_ptr< BackingStoreWrapAllocation (void *allocation_base, size_t allocation_length, v8::BackingStore::DeleterCallback deleter, void *deleter_data, SharedFlag shared)
 
static std::unique_ptr< BackingStoreEmptyBackingStore (SharedFlag shared)
 

Private Types

enum  Flag {
  kIsShared , kIsResizableByJs , kIsWasmMemory , kIsWasmMemory64 ,
  kHoldsSharedPtrToAllocater , kHasGuardRegions , kGloballyRegistered , kCustomDeleter ,
  kEmptyDeleter
}
 

Private Member Functions

 BackingStore (PageAllocator *page_allocator, void *buffer_start, size_t byte_length, size_t max_byte_length, size_t byte_capacity, SharedFlag shared, ResizableFlag resizable, bool is_wasm_memory, bool is_wasm_memory64, bool has_guard_regions, bool custom_deleter, bool empty_deleter)
 
 BackingStore (const BackingStore &)=delete
 
BackingStoreoperator= (const BackingStore &)=delete
 
void SetAllocatorFromIsolate (Isolate *isolate)
 
v8::ArrayBuffer::Allocatorget_v8_api_array_buffer_allocator ()
 
SharedWasmMemoryDataget_shared_wasm_memory_data () const
 
bool has_flag (Flag flag) const
 
void set_flag (Flag flag)
 
void clear_flag (Flag flag)
 
bool holds_shared_ptr_to_allocator () const
 
bool custom_deleter () const
 
bool globally_registered () const
 

Private Attributes

void * buffer_start_ = nullptr
 
std::atomic< size_tbyte_length_
 
size_t max_byte_length_
 
size_t byte_capacity_
 
const uint32_t id_
 
v8::PageAllocatorpage_allocator_ = nullptr
 
union v8::internal::BackingStore::TypeSpecificData type_specific_data_
 
std::atomic< base::EnumSet< Flag, uint16_t > > flags_
 

Friends

class GlobalBackingStoreRegistry
 

Detailed Description

Definition at line 45 of file backing-store.h.

Member Enumeration Documentation

◆ Flag

Enumerator
kIsShared 
kIsResizableByJs 
kIsWasmMemory 
kIsWasmMemory64 
kHoldsSharedPtrToAllocater 
kHasGuardRegions 
kGloballyRegistered 
kCustomDeleter 
kEmptyDeleter 

Definition at line 189 of file backing-store.h.

◆ ResizeOrGrowResult

Enumerator
kSuccess 
kFailure 
kRace 

Definition at line 108 of file backing-store.h.

Constructor & Destructor Documentation

◆ ~BackingStore()

v8::internal::BackingStore::~BackingStore ( )

Definition at line 136 of file backing-store.cc.

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

◆ BackingStore() [1/2]

v8::internal::BackingStore::BackingStore ( PageAllocator * page_allocator,
void * buffer_start,
size_t byte_length,
size_t max_byte_length,
size_t byte_capacity,
SharedFlag shared,
ResizableFlag resizable,
bool is_wasm_memory,
bool is_wasm_memory64,
bool has_guard_regions,
bool custom_deleter,
bool empty_deleter )
private

Definition at line 97 of file backing-store.cc.

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

◆ BackingStore() [2/2]

v8::internal::BackingStore::BackingStore ( const BackingStore & )
privatedelete

Member Function Documentation

◆ Allocate()

std::unique_ptr< BackingStore > v8::internal::BackingStore::Allocate ( Isolate * isolate,
size_t byte_length,
SharedFlag shared,
InitializedFlag initialized )
static

Definition at line 201 of file backing-store.cc.

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

◆ buffer_start()

void * v8::internal::BackingStore::buffer_start ( ) const
inline

Definition at line 88 of file backing-store.h.

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

◆ byte_capacity()

size_t v8::internal::BackingStore::byte_capacity ( ) const
inline

Definition at line 96 of file backing-store.h.

Here is the caller graph for this function:

◆ byte_length()

size_t v8::internal::BackingStore::byte_length ( std::memory_order memory_order = std::memory_order_relaxed) const
inline

Definition at line 91 of file backing-store.h.

Here is the caller graph for this function:

◆ clear_flag()

void v8::internal::BackingStore::clear_flag ( Flag flag)
inlineprivate

Definition at line 225 of file backing-store.h.

Here is the caller graph for this function:

◆ custom_deleter()

bool v8::internal::BackingStore::custom_deleter ( ) const
inlineprivate

Definition at line 237 of file backing-store.h.

Here is the caller graph for this function:

◆ EmptyBackingStore()

std::unique_ptr< BackingStore > v8::internal::BackingStore::EmptyBackingStore ( SharedFlag shared)
static

Definition at line 719 of file backing-store.cc.

Here is the call graph for this function:

◆ get_shared_wasm_memory_data()

SharedWasmMemoryData * v8::internal::BackingStore::get_shared_wasm_memory_data ( ) const
private

Definition at line 747 of file backing-store.cc.

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

◆ get_v8_api_array_buffer_allocator()

v8::ArrayBuffer::Allocator * v8::internal::BackingStore::get_v8_api_array_buffer_allocator ( )
private

Definition at line 737 of file backing-store.cc.

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

◆ globally_registered()

bool v8::internal::BackingStore::globally_registered ( ) const
inlineprivate

Definition at line 238 of file backing-store.h.

Here is the caller graph for this function:

◆ GrowInPlace()

BackingStore::ResizeOrGrowResult v8::internal::BackingStore::GrowInPlace ( Isolate * isolate,
size_t new_byte_length )

Definition at line 647 of file backing-store.cc.

Here is the call graph for this function:

◆ has_flag()

bool v8::internal::BackingStore::has_flag ( Flag flag) const
inlineprivate

Definition at line 214 of file backing-store.h.

◆ has_guard_regions()

bool v8::internal::BackingStore::has_guard_regions ( ) const
inline

Definition at line 101 of file backing-store.h.

Here is the caller graph for this function:

◆ holds_shared_ptr_to_allocator()

bool v8::internal::BackingStore::holds_shared_ptr_to_allocator ( ) const
inlineprivate

Definition at line 234 of file backing-store.h.

Here is the caller graph for this function:

◆ id()

uint32_t v8::internal::BackingStore::id ( ) const
inline

Definition at line 184 of file backing-store.h.

◆ is_resizable_by_js()

bool v8::internal::BackingStore::is_resizable_by_js ( ) const
inline

Definition at line 98 of file backing-store.h.

Here is the caller graph for this function:

◆ is_shared()

bool v8::internal::BackingStore::is_shared ( ) const
inline

Definition at line 97 of file backing-store.h.

Here is the caller graph for this function:

◆ is_wasm_memory()

bool v8::internal::BackingStore::is_wasm_memory ( ) const
inline

Definition at line 99 of file backing-store.h.

Here is the caller graph for this function:

◆ is_wasm_memory64()

bool v8::internal::BackingStore::is_wasm_memory64 ( ) const
inline

Definition at line 100 of file backing-store.h.

Here is the caller graph for this function:

◆ IsEmpty()

bool v8::internal::BackingStore::IsEmpty ( ) const
inline

Definition at line 103 of file backing-store.h.

◆ max_byte_length()

size_t v8::internal::BackingStore::max_byte_length ( ) const
inline

Definition at line 95 of file backing-store.h.

Here is the caller graph for this function:

◆ operator=()

BackingStore & v8::internal::BackingStore::operator= ( const BackingStore & )
privatedelete

◆ PerIsolateAccountingLength()

size_t v8::internal::BackingStore::PerIsolateAccountingLength ( )
inline

Definition at line 167 of file backing-store.h.

◆ ResizeInPlace()

BackingStore::ResizeOrGrowResult v8::internal::BackingStore::ResizeInPlace ( Isolate * isolate,
size_t new_byte_length )

Definition at line 582 of file backing-store.cc.

Here is the call graph for this function:

◆ set_flag()

void v8::internal::BackingStore::set_flag ( Flag flag)
inlineprivate

Definition at line 217 of file backing-store.h.

Here is the caller graph for this function:

◆ SetAllocatorFromIsolate()

void v8::internal::BackingStore::SetAllocatorFromIsolate ( Isolate * isolate)
private

Definition at line 263 of file backing-store.cc.

Here is the call graph for this function:

◆ TryAllocateAndPartiallyCommitMemory()

std::unique_ptr< BackingStore > v8::internal::BackingStore::TryAllocateAndPartiallyCommitMemory ( Isolate * isolate,
size_t byte_length,
size_t max_byte_length,
size_t page_size,
size_t initial_pages,
size_t maximum_pages,
WasmMemoryFlag wasm_memory,
SharedFlag shared,
bool has_guard_regions = false )
static

Definition at line 275 of file backing-store.cc.

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

◆ WrapAllocation()

std::unique_ptr< BackingStore > v8::internal::BackingStore::WrapAllocation ( void * allocation_base,
size_t allocation_length,
v8::BackingStore::DeleterCallback deleter,
void * deleter_data,
SharedFlag shared )
static

Definition at line 696 of file backing-store.cc.

Here is the call graph for this function:

Friends And Related Symbol Documentation

◆ GlobalBackingStoreRegistry

friend class GlobalBackingStoreRegistry
friend

Definition at line 187 of file backing-store.h.

Member Data Documentation

◆ buffer_start_

void* v8::internal::BackingStore::buffer_start_ = nullptr
private

Definition at line 240 of file backing-store.h.

◆ byte_capacity_

size_t v8::internal::BackingStore::byte_capacity_
private

Definition at line 245 of file backing-store.h.

◆ byte_length_

std::atomic<size_t> v8::internal::BackingStore::byte_length_
private

Definition at line 241 of file backing-store.h.

◆ flags_

std::atomic<base::EnumSet<Flag, uint16_t> > v8::internal::BackingStore::flags_
private

Definition at line 280 of file backing-store.h.

◆ id_

const uint32_t v8::internal::BackingStore::id_
private

Definition at line 249 of file backing-store.h.

◆ max_byte_length_

size_t v8::internal::BackingStore::max_byte_length_
private

Definition at line 243 of file backing-store.h.

◆ page_allocator_

v8::PageAllocator* v8::internal::BackingStore::page_allocator_ = nullptr
private

Definition at line 251 of file backing-store.h.

◆ type_specific_data_

union v8::internal::BackingStore::TypeSpecificData v8::internal::BackingStore::type_specific_data_
private

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