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

#include <new-spaces.h>

Inheritance diagram for v8::internal::SemiSpace:
Collaboration diagram for v8::internal::SemiSpace:

Public Types

using iterator = PageIterator
 
using const_iterator = ConstPageIterator
 

Public Member Functions

 SemiSpace (Heap *heap, SemiSpaceId semispace)
 
V8_EXPORT_PRIVATE ~SemiSpace ()
 
bool Contains (Tagged< HeapObject > o) const
 
bool Contains (Tagged< Object > o) const
 
template<typename T >
bool Contains (Tagged< T > o) const
 
bool ContainsSlow (Address a) const
 
void Uncommit ()
 
bool IsCommitted () const
 
Address space_start () const
 
PageMetadatacurrent_page () const
 
Address page_low () const
 
Address page_high () const
 
bool AdvancePage (size_t target_capacity)
 
void RemovePage (PageMetadata *page)
 
void MovePageToTheEnd (PageMetadata *page)
 
PageMetadataInitializePage (MutablePageMetadata *chunk) final
 
size_t current_capacity () const
 
size_t current_capacity_safe () const
 
SemiSpaceId id () const
 
size_t CommittedPhysicalMemory () const final
 
size_t Size () const final
 
size_t SizeOfObjects () const final
 
size_t Available () const final
 
PageMetadatafirst_page () final
 
PageMetadatalast_page () final
 
const PageMetadatafirst_page () const final
 
const PageMetadatalast_page () const final
 
iterator begin ()
 
iterator end ()
 
const_iterator begin () const
 
const_iterator end () const
 
std::unique_ptr< ObjectIteratorGetObjectIterator (Heap *heap) final
 
void AddRangeToActiveSystemPages (Address start, Address end)
 
void MoveQuarantinedPage (MemoryChunk *chunk)
 
- Public Member Functions inherited from v8::internal::Space
 Space (Heap *heap, AllocationSpace id, std::unique_ptr< FreeList > free_list)
 
 ~Space () override=default
 
 Space (const Space &)=delete
 
Spaceoperator= (const Space &)=delete
 
void IncrementExternalBackingStoreBytes (ExternalBackingStoreType type, size_t amount)
 
void DecrementExternalBackingStoreBytes (ExternalBackingStoreType type, size_t amount)
 
virtual size_t ExternalBackingStoreBytes (ExternalBackingStoreType type) const
 
virtual heap::List< MutablePageMetadata > & memory_chunk_list ()
 
virtual void NotifyBlackAreaCreated (size_t size)
 
virtual void NotifyBlackAreaDestroyed (size_t size)
 
FreeListfree_list ()
 
Address FirstPageAddress () const
 
- 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
 

Static Public Member Functions

static void Swap (SemiSpace *from, SemiSpace *to)
 
static void AssertValidRange (Address from, Address to)
 
- Static Public Member Functions inherited from v8::internal::Space
static void MoveExternalBackingStoreBytes (ExternalBackingStoreType type, Space *from, Space *to, size_t amount)
 
- Static Public Member Functions inherited from v8::internal::Malloced
static void * operator new (size_t size)
 
static void operator delete (void *p)
 

Private Member Functions

bool AllocateFreshPage ()
 
void RewindPages (int num_pages)
 
void FixPagesFlags ()
 
void IncrementCommittedPhysicalMemory (size_t increment_value)
 
void DecrementCommittedPhysicalMemory (size_t decrement_value)
 
void ShrinkCapacityTo (size_t capacity)
 
void Reset ()
 

Private Attributes

size_t current_capacity_ = 0
 
size_t committed_physical_memory_ = 0
 
SemiSpaceId id_
 
PageMetadatacurrent_page_ = nullptr
 
size_t quarantined_pages_count_ = 0
 

Friends

class SemiSpaceNewSpace
 
class SemiSpaceObjectIterator
 

Additional Inherited Members

- 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 inherited from v8::internal::Space
heap::List< MutablePageMetadatamemory_chunk_list_
 
std::atomic< size_texternal_backing_store_bytes_ [static_cast< int >(ExternalBackingStoreType::kNumValues)] = {0}
 
std::unique_ptr< FreeListfree_list_
 
- Protected Attributes inherited from v8::internal::BaseSpace
Heapheap_
 
AllocationSpace id_
 
std::atomic< size_tcommitted_ {0}
 
size_t max_committed_ = 0
 

Detailed Description

Definition at line 43 of file new-spaces.h.

Member Typedef Documentation

◆ const_iterator

◆ iterator

Definition at line 45 of file new-spaces.h.

Constructor & Destructor Documentation

◆ SemiSpace()

v8::internal::SemiSpace::SemiSpace ( Heap * heap,
SemiSpaceId semispace )

Definition at line 54 of file new-spaces.cc.

◆ ~SemiSpace()

v8::internal::SemiSpace::~SemiSpace ( )

Definition at line 57 of file new-spaces.cc.

Here is the call graph for this function:

Member Function Documentation

◆ AddRangeToActiveSystemPages()

void v8::internal::SemiSpace::AddRangeToActiveSystemPages ( Address start,
Address end )

Definition at line 267 of file new-spaces.cc.

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

◆ AdvancePage()

bool v8::internal::SemiSpace::AdvancePage ( size_t target_capacity)

Definition at line 220 of file new-spaces.cc.

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

◆ AllocateFreshPage()

bool v8::internal::SemiSpace::AllocateFreshPage ( )
private

Definition at line 116 of file new-spaces.cc.

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

◆ AssertValidRange()

static void v8::internal::SemiSpace::AssertValidRange ( Address from,
Address to )
inlinestatic

Definition at line 134 of file new-spaces.h.

◆ Available()

size_t v8::internal::SemiSpace::Available ( ) const
inlinefinalvirtual

Implements v8::internal::Space.

Definition at line 102 of file new-spaces.h.

Here is the call graph for this function:

◆ begin() [1/2]

iterator v8::internal::SemiSpace::begin ( )
inline

Definition at line 118 of file new-spaces.h.

Here is the call graph for this function:

◆ begin() [2/2]

const_iterator v8::internal::SemiSpace::begin ( ) const
inline

Definition at line 121 of file new-spaces.h.

Here is the call graph for this function:

◆ CommittedPhysicalMemory()

size_t v8::internal::SemiSpace::CommittedPhysicalMemory ( ) const
finalvirtual

Implements v8::internal::BaseSpace.

Definition at line 110 of file new-spaces.cc.

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

◆ Contains() [1/3]

bool v8::internal::SemiSpace::Contains ( Tagged< HeapObject > o) const
inline

Definition at line 26 of file new-spaces-inl.h.

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

◆ Contains() [2/3]

bool v8::internal::SemiSpace::Contains ( Tagged< Object > o) const
inline

Definition at line 33 of file new-spaces-inl.h.

Here is the call graph for this function:

◆ Contains() [3/3]

template<typename T >
bool v8::internal::SemiSpace::Contains ( Tagged< T > o) const
inline

Definition at line 38 of file new-spaces-inl.h.

Here is the call graph for this function:

◆ ContainsSlow()

bool v8::internal::SemiSpace::ContainsSlow ( Address a) const
inline

Definition at line 43 of file new-spaces-inl.h.

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

◆ current_capacity()

size_t v8::internal::SemiSpace::current_capacity ( ) const
inline

Definition at line 84 of file new-spaces.h.

Here is the caller graph for this function:

◆ current_capacity_safe()

size_t v8::internal::SemiSpace::current_capacity_safe ( ) const
inline

Definition at line 86 of file new-spaces.h.

Here is the call graph for this function:

◆ current_page()

PageMetadata * v8::internal::SemiSpace::current_page ( ) const
inline

Definition at line 68 of file new-spaces.h.

Here is the caller graph for this function:

◆ DecrementCommittedPhysicalMemory()

void v8::internal::SemiSpace::DecrementCommittedPhysicalMemory ( size_t decrement_value)
private

Definition at line 261 of file new-spaces.cc.

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

◆ end() [1/2]

iterator v8::internal::SemiSpace::end ( )
inline

Definition at line 119 of file new-spaces.h.

Here is the caller graph for this function:

◆ end() [2/2]

const_iterator v8::internal::SemiSpace::end ( ) const
inline

Definition at line 122 of file new-spaces.h.

◆ first_page() [1/2]

const PageMetadata * v8::internal::SemiSpace::first_page ( ) const
inlinefinalvirtual

Reimplemented from v8::internal::Space.

Definition at line 111 of file new-spaces.h.

◆ first_page() [2/2]

PageMetadata * v8::internal::SemiSpace::first_page ( )
inlinefinalvirtual

Reimplemented from v8::internal::Space.

Definition at line 104 of file new-spaces.h.

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

◆ FixPagesFlags()

void v8::internal::SemiSpace::FixPagesFlags ( )
private

Definition at line 146 of file new-spaces.cc.

Here is the call graph for this function:

◆ GetObjectIterator()

std::unique_ptr< ObjectIterator > v8::internal::SemiSpace::GetObjectIterator ( Heap * heap)
finalvirtual

Implements v8::internal::Space.

Definition at line 282 of file new-spaces.cc.

Here is the call graph for this function:

◆ id()

SemiSpaceId v8::internal::SemiSpace::id ( ) const
inline

Definition at line 90 of file new-spaces.h.

Here is the caller graph for this function:

◆ IncrementCommittedPhysicalMemory()

void v8::internal::SemiSpace::IncrementCommittedPhysicalMemory ( size_t increment_value)
private

Definition at line 254 of file new-spaces.cc.

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

◆ InitializePage()

PageMetadata * v8::internal::SemiSpace::InitializePage ( MutablePageMetadata * chunk)
finalvirtual

Reimplemented from v8::internal::Space.

Definition at line 42 of file new-spaces.cc.

Here is the call graph for this function:

◆ IsCommitted()

bool v8::internal::SemiSpace::IsCommitted ( ) const
inline

Definition at line 60 of file new-spaces.h.

Here is the caller graph for this function:

◆ last_page() [1/2]

const PageMetadata * v8::internal::SemiSpace::last_page ( ) const
inlinefinalvirtual

Reimplemented from v8::internal::Space.

Definition at line 114 of file new-spaces.h.

◆ last_page() [2/2]

PageMetadata * v8::internal::SemiSpace::last_page ( )
inlinefinalvirtual

Reimplemented from v8::internal::Space.

Definition at line 107 of file new-spaces.h.

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

◆ MovePageToTheEnd()

void v8::internal::SemiSpace::MovePageToTheEnd ( PageMetadata * page)

Definition at line 183 of file new-spaces.cc.

Here is the caller graph for this function:

◆ MoveQuarantinedPage()

void v8::internal::SemiSpace::MoveQuarantinedPage ( MemoryChunk * chunk)

Definition at line 375 of file new-spaces.cc.

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

◆ page_high()

Address v8::internal::SemiSpace::page_high ( ) const
inline

Definition at line 74 of file new-spaces.h.

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

◆ page_low()

Address v8::internal::SemiSpace::page_low ( ) const
inline

Definition at line 71 of file new-spaces.h.

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

◆ RemovePage()

void v8::internal::SemiSpace::RemovePage ( PageMetadata * page)

Definition at line 167 of file new-spaces.cc.

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

◆ Reset()

void v8::internal::SemiSpace::Reset ( )
private

Definition at line 287 of file new-spaces.cc.

Here is the caller graph for this function:

◆ RewindPages()

void v8::internal::SemiSpace::RewindPages ( int num_pages)
private

Definition at line 130 of file new-spaces.cc.

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

◆ ShrinkCapacityTo()

void v8::internal::SemiSpace::ShrinkCapacityTo ( size_t capacity)
private

Definition at line 69 of file new-spaces.cc.

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

◆ Size()

size_t v8::internal::SemiSpace::Size ( ) const
inlinefinalvirtual

Implements v8::internal::BaseSpace.

Definition at line 98 of file new-spaces.h.

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

◆ SizeOfObjects()

size_t v8::internal::SemiSpace::SizeOfObjects ( ) const
inlinefinalvirtual

Reimplemented from v8::internal::Space.

Definition at line 100 of file new-spaces.h.

Here is the call graph for this function:

◆ space_start()

Address v8::internal::SemiSpace::space_start ( ) const
inline

Definition at line 63 of file new-spaces.h.

Here is the call graph for this function:

◆ Swap()

void v8::internal::SemiSpace::Swap ( SemiSpace * from,
SemiSpace * to )
static

Definition at line 190 of file new-spaces.cc.

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

◆ Uncommit()

void v8::internal::SemiSpace::Uncommit ( )

Definition at line 96 of file new-spaces.cc.

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

Friends And Related Symbol Documentation

◆ SemiSpaceNewSpace

friend class SemiSpaceNewSpace
friend

Definition at line 172 of file new-spaces.h.

◆ SemiSpaceObjectIterator

friend class SemiSpaceObjectIterator
friend

Definition at line 173 of file new-spaces.h.

Member Data Documentation

◆ committed_physical_memory_

size_t v8::internal::SemiSpace::committed_physical_memory_ = 0
private

Definition at line 164 of file new-spaces.h.

◆ current_capacity_

size_t v8::internal::SemiSpace::current_capacity_ = 0
private

Definition at line 163 of file new-spaces.h.

◆ current_page_

PageMetadata* v8::internal::SemiSpace::current_page_ = nullptr
private

Definition at line 166 of file new-spaces.h.

◆ id_

SemiSpaceId v8::internal::SemiSpace::id_
private

Definition at line 165 of file new-spaces.h.

◆ quarantined_pages_count_

size_t v8::internal::SemiSpace::quarantined_pages_count_ = 0
private

Definition at line 170 of file new-spaces.h.


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