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

#include <read-only-spaces.h>

Inheritance diagram for v8::internal::ReadOnlySpace:
Collaboration diagram for v8::internal::ReadOnlySpace:

Public Types

enum class  SealMode { kDetachFromHeap , kDetachFromHeapAndUnregisterMemory , kDoNotDetachFromHeap }
 

Public Member Functions

V8_EXPORT_PRIVATE ReadOnlySpace (Heap *heap)
 
void DetachPagesAndAddToArtifacts (ReadOnlyArtifacts *artifacts)
 
V8_EXPORT_PRIVATE ~ReadOnlySpace () override
 
virtual V8_EXPORT_PRIVATE void TearDown (MemoryAllocator *memory_allocator)
 
bool IsDetached () const
 
bool writable () const
 
bool Contains (Address a)=delete
 
bool Contains (Tagged< Object > o)=delete
 
V8_EXPORT_PRIVATE AllocationResult AllocateRaw (int size_in_bytes, AllocationAlignment alignment)
 
V8_EXPORT_PRIVATE void ClearStringPaddingIfNeeded ()
 
V8_EXPORT_PRIVATE void Seal (SealMode ro_mode)
 
void RepairFreeSpacesAfterDeserialization ()
 
size_t Size () const override
 
V8_EXPORT_PRIVATE size_t CommittedPhysicalMemory () const override
 
const std::vector< ReadOnlyPageMetadata * > & pages () const
 
Address top () const
 
Address limit () const
 
size_t Capacity () const
 
size_t IndexOf (const MemoryChunkMetadata *chunk) const
 
bool ContainsSlow (Address addr) const
 
V8_EXPORT_PRIVATE void ShrinkPages ()
 
Address FirstPageAddress () const
 
void EnsurePage ()
 
- Public Member Functions inherited from v8::internal::BaseSpace
 BaseSpace (const BaseSpace &)=delete
 
BaseSpaceoperator= (const BaseSpace &)=delete
 
Heapheap () const
 
AllocationSpace identity () const
 
virtual size_t CommittedMemory () const
 
virtual size_t MaximumCommittedMemory () const
 

Protected Member Functions

void SetPermissionsForPages (MemoryAllocator *memory_allocator, PageAllocator::Permission access)
 
- Protected Member Functions inherited from v8::internal::BaseSpace
 BaseSpace (Heap *heap, AllocationSpace id)
 
virtual ~BaseSpace ()=default
 
void AccountCommitted (size_t bytes)
 
void AccountUncommitted (size_t bytes)
 

Protected Attributes

bool is_marked_read_only_ = false
 
AllocationStats accounting_stats_
 
std::vector< ReadOnlyPageMetadata * > pages_
 
Address top_ = kNullAddress
 
Address limit_ = kNullAddress
 
- Protected Attributes inherited from v8::internal::BaseSpace
Heapheap_
 
AllocationSpace id_
 
std::atomic< size_tcommitted_ {0}
 
size_t max_committed_ = 0
 

Private Member Functions

AllocationResult AllocateRawUnaligned (int size_in_bytes)
 
AllocationResult AllocateRawAligned (int size_in_bytes, AllocationAlignment alignment)
 
Tagged< HeapObjectTryAllocateLinearlyAligned (int size_in_bytes, AllocationAlignment alignment)
 
size_t AllocateNextPage ()
 
size_t AllocateNextPageAt (Address pos)
 
void InitializePageForDeserialization (ReadOnlyPageMetadata *page, size_t area_size_in_bytes)
 
void FinalizeSpaceForDeserialization ()
 
void EnsureSpaceForAllocation (int size_in_bytes)
 
void FreeLinearAllocationArea ()
 

Private Attributes

size_t capacity_ = 0
 

Friends

class Heap
 
class ReadOnlyHeapImageDeserializer
 

Additional Inherited Members

- Static Public Member Functions inherited from v8::internal::Malloced
static void * operator new (size_t size)
 
static void operator delete (void *p)
 

Detailed Description

Definition at line 148 of file read-only-spaces.h.

Member Enumeration Documentation

◆ SealMode

Enumerator
kDetachFromHeap 
kDetachFromHeapAndUnregisterMemory 
kDoNotDetachFromHeap 

Definition at line 173 of file read-only-spaces.h.

Constructor & Destructor Documentation

◆ ReadOnlySpace()

v8::internal::ReadOnlySpace::ReadOnlySpace ( Heap * heap)
explicit

Definition at line 109 of file read-only-spaces.cc.

◆ ~ReadOnlySpace()

v8::internal::ReadOnlySpace::~ReadOnlySpace ( )
overridedefault

Member Function Documentation

◆ AllocateNextPage()

size_t v8::internal::ReadOnlySpace::AllocateNextPage ( )
private

Definition at line 526 of file read-only-spaces.cc.

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

◆ AllocateNextPageAt()

size_t v8::internal::ReadOnlySpace::AllocateNextPageAt ( Address pos)
private

Definition at line 535 of file read-only-spaces.cc.

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

◆ AllocateRaw()

AllocationResult v8::internal::ReadOnlySpace::AllocateRaw ( int size_in_bytes,
AllocationAlignment alignment )

Definition at line 460 of file read-only-spaces.cc.

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

◆ AllocateRawAligned()

AllocationResult v8::internal::ReadOnlySpace::AllocateRawAligned ( int size_in_bytes,
AllocationAlignment alignment )
private

Definition at line 417 of file read-only-spaces.cc.

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

◆ AllocateRawUnaligned()

AllocationResult v8::internal::ReadOnlySpace::AllocateRawUnaligned ( int size_in_bytes)
private

Definition at line 439 of file read-only-spaces.cc.

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

◆ Capacity()

size_t v8::internal::ReadOnlySpace::Capacity ( ) const
inline

Definition at line 194 of file read-only-spaces.h.

Here is the caller graph for this function:

◆ ClearStringPaddingIfNeeded()

V8_EXPORT_PRIVATE void v8::internal::ReadOnlySpace::ClearStringPaddingIfNeeded ( )

◆ CommittedPhysicalMemory()

size_t v8::internal::ReadOnlySpace::CommittedPhysicalMemory ( ) const
overridevirtual

Implements v8::internal::BaseSpace.

Definition at line 320 of file read-only-spaces.cc.

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

◆ Contains() [1/2]

bool v8::internal::ReadOnlySpace::Contains ( Address a)
delete

◆ Contains() [2/2]

bool v8::internal::ReadOnlySpace::Contains ( Tagged< Object > o)
delete

◆ ContainsSlow()

bool v8::internal::ReadOnlySpace::ContainsSlow ( Address addr) const

Definition at line 211 of file read-only-spaces.cc.

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

◆ DetachPagesAndAddToArtifacts()

void v8::internal::ReadOnlySpace::DetachPagesAndAddToArtifacts ( ReadOnlyArtifacts * artifacts)

Definition at line 130 of file read-only-spaces.cc.

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

◆ EnsurePage()

void v8::internal::ReadOnlySpace::EnsurePage ( )

Definition at line 347 of file read-only-spaces.cc.

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

◆ EnsureSpaceForAllocation()

void v8::internal::ReadOnlySpace::EnsureSpaceForAllocation ( int size_in_bytes)
private

Definition at line 367 of file read-only-spaces.cc.

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

◆ FinalizeSpaceForDeserialization()

void v8::internal::ReadOnlySpace::FinalizeSpaceForDeserialization ( )
private

Definition at line 559 of file read-only-spaces.cc.

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

◆ FirstPageAddress()

Address v8::internal::ReadOnlySpace::FirstPageAddress ( ) const
inline

Definition at line 209 of file read-only-spaces.h.

Here is the caller graph for this function:

◆ FreeLinearAllocationArea()

void v8::internal::ReadOnlySpace::FreeLinearAllocationArea ( )
private

Definition at line 331 of file read-only-spaces.cc.

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

◆ IndexOf()

size_t v8::internal::ReadOnlySpace::IndexOf ( const MemoryChunkMetadata * chunk) const

Definition at line 519 of file read-only-spaces.cc.

Here is the call graph for this function:

◆ InitializePageForDeserialization()

void v8::internal::ReadOnlySpace::InitializePageForDeserialization ( ReadOnlyPageMetadata * page,
size_t area_size_in_bytes )
private

Definition at line 552 of file read-only-spaces.cc.

Here is the caller graph for this function:

◆ IsDetached()

bool v8::internal::ReadOnlySpace::IsDetached ( ) const
inline

Definition at line 160 of file read-only-spaces.h.

Here is the caller graph for this function:

◆ limit()

Address v8::internal::ReadOnlySpace::limit ( ) const
inline

Definition at line 193 of file read-only-spaces.h.

◆ pages()

const std::vector< ReadOnlyPageMetadata * > & v8::internal::ReadOnlySpace::pages ( ) const
inline

Definition at line 191 of file read-only-spaces.h.

Here is the caller graph for this function:

◆ RepairFreeSpacesAfterDeserialization()

void v8::internal::ReadOnlySpace::RepairFreeSpacesAfterDeserialization ( )

Definition at line 175 of file read-only-spaces.cc.

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

◆ Seal()

void v8::internal::ReadOnlySpace::Seal ( SealMode ro_mode)

Definition at line 191 of file read-only-spaces.cc.

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

◆ SetPermissionsForPages()

void v8::internal::ReadOnlySpace::SetPermissionsForPages ( MemoryAllocator * memory_allocator,
PageAllocator::Permission access )
protected

Definition at line 159 of file read-only-spaces.cc.

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

◆ ShrinkPages()

void v8::internal::ReadOnlySpace::ShrinkPages ( )

Definition at line 498 of file read-only-spaces.cc.

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

◆ Size()

size_t v8::internal::ReadOnlySpace::Size ( ) const
inlineoverridevirtual

Implements v8::internal::BaseSpace.

Definition at line 188 of file read-only-spaces.h.

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

◆ TearDown()

void v8::internal::ReadOnlySpace::TearDown ( MemoryAllocator * memory_allocator)
virtual

Reimplemented in v8::internal::SharedReadOnlySpace.

Definition at line 122 of file read-only-spaces.cc.

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

◆ top()

Address v8::internal::ReadOnlySpace::top ( ) const
inline

Definition at line 192 of file read-only-spaces.h.

Here is the caller graph for this function:

◆ TryAllocateLinearlyAligned()

Tagged< HeapObject > v8::internal::ReadOnlySpace::TryAllocateLinearlyAligned ( int size_in_bytes,
AllocationAlignment alignment )
private

Definition at line 393 of file read-only-spaces.cc.

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

◆ writable()

bool v8::internal::ReadOnlySpace::writable ( ) const
inline

Definition at line 162 of file read-only-spaces.h.

Here is the caller graph for this function:

Friends And Related Symbol Documentation

◆ Heap

friend class Heap
friend

Definition at line 247 of file read-only-spaces.h.

◆ ReadOnlyHeapImageDeserializer

friend class ReadOnlyHeapImageDeserializer
friend

Definition at line 248 of file read-only-spaces.h.

Member Data Documentation

◆ accounting_stats_

AllocationStats v8::internal::ReadOnlySpace::accounting_stats_
protected

Definition at line 221 of file read-only-spaces.h.

◆ capacity_

size_t v8::internal::ReadOnlySpace::capacity_ = 0
private

Definition at line 245 of file read-only-spaces.h.

◆ is_marked_read_only_

bool v8::internal::ReadOnlySpace::is_marked_read_only_ = false
protected

Definition at line 218 of file read-only-spaces.h.

◆ limit_

Address v8::internal::ReadOnlySpace::limit_ = kNullAddress
protected

Definition at line 226 of file read-only-spaces.h.

◆ pages_

std::vector<ReadOnlyPageMetadata*> v8::internal::ReadOnlySpace::pages_
protected

Definition at line 223 of file read-only-spaces.h.

◆ top_

Address v8::internal::ReadOnlySpace::top_ = kNullAddress
protected

Definition at line 225 of file read-only-spaces.h.


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