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

#include <paged-spaces.h>

Inheritance diagram for v8::internal::PagedSpaceBase:
Collaboration diagram for v8::internal::PagedSpaceBase:

Classes

class  ConcurrentAllocationMutex
 

Public Types

using iterator = PageIterator
 
using const_iterator = ConstPageIterator
 

Public Member Functions

 PagedSpaceBase (Heap *heap, AllocationSpace id, Executability executable, std::unique_ptr< FreeList > free_list, CompactionSpaceKind compaction_space_kind)
 
 ~PagedSpaceBase () override
 
bool Contains (Address a) const
 
bool Contains (Tagged< Object > o) const
 
bool ContainsSlow (Address addr) const
 
Executability executable () const
 
size_t Capacity () const
 
size_t CommittedPhysicalMemory () const override
 
void IncrementCommittedPhysicalMemory (size_t increment_value)
 
void DecrementCommittedPhysicalMemory (size_t decrement_value)
 
void ClearAllocatorState ()
 
size_t Available () const override
 
size_t Size () const override
 
size_t Waste () const
 
V8_WARN_UNUSED_RESULT std::optional< std::pair< Address, size_t > > RawAllocateBackground (LocalHeap *local_heap, size_t min_size_in_bytes, size_t max_size_in_bytes, AllocationOrigin origin)
 
V8_INLINE size_t Free (Address start, size_t size_in_bytes)
 
V8_INLINE size_t FreeDuringSweep (Address start, size_t size_in_bytes)
 
void ResetFreeList ()
 
void DecreaseAllocatedBytes (size_t bytes, PageMetadata *page)
 
void IncreaseAllocatedBytes (size_t bytes, PageMetadata *page)
 
void DecreaseCapacity (size_t bytes)
 
void IncreaseCapacity (size_t bytes)
 
PageMetadataInitializePage (MutablePageMetadata *chunk) override
 
virtual void ReleasePage (PageMetadata *page)
 
virtual size_t AddPage (PageMetadata *page)
 
virtual void RemovePage (PageMetadata *page)
 
PageMetadataRemovePageSafe (int size_in_bytes)
 
bool CanExpand (size_t size) const
 
int CountTotalPages () const
 
int AreaSize () const
 
bool is_compaction_space () const
 
CompactionSpaceKind compaction_space_kind () const
 
void MergeCompactionSpace (CompactionSpace *other)
 
virtual void RefillFreeList ()
 
base::Mutexmutex ()
 
void UnlinkFreeListCategories (PageMetadata *page)
 
size_t RelinkFreeListCategories (PageMetadata *page)
 
PageMetadatafirst_page () override
 
const PageMetadatafirst_page () const override
 
PageMetadatalast_page () override
 
const PageMetadatalast_page () const override
 
iterator begin ()
 
iterator end ()
 
const_iterator begin () const
 
const_iterator end () const
 
std::unique_ptr< ObjectIteratorGetObjectIterator (Heap *heap) override
 
void AddRangeToActiveSystemPages (PageMetadata *page, Address start, Address end)
 
void ReduceActiveSystemPages (PageMetadata *page, ActiveSystemPages active_system_pages)
 
bool TryExpand (LocalHeap *local_heap, AllocationOrigin origin)
 
void RefineAllocatedBytesAfterSweeping (PageMetadata *page)
 
virtual void AdjustDifferenceInAllocatedBytes (size_t diff)
 
template<bool during_sweep>
size_t FreeInternal (Address start, size_t size_in_bytes)
 

Static Public Attributes

static const size_t kCompactionMemoryWanted = 500 * KB
 

Protected Member Functions

virtual bool snapshotable () const
 
bool HasPages () const
 
void TearDown ()
 
virtual void NotifyNewPage (PageMetadata *page)
 
size_t committed_physical_memory () const
 
void ReleasePageImpl (PageMetadata *page, MemoryAllocator::FreeMode free_mode)
 
void AddPageImpl (PageMetadata *page)
 

Protected Attributes

Executability executable_
 
CompactionSpaceKind compaction_space_kind_
 
size_t area_size_
 
AllocationStats accounting_stats_
 
base::Mutex space_mutex_
 
std::atomic< size_tcommitted_physical_memory_ {0}
 
size_t size_at_last_gc_ = 0
 

Private Member Functions

template<bool during_sweep>
V8_INLINE size_t FreeInternal (Address start, size_t size_in_bytes)
 
bool SupportsConcurrentAllocation () const
 

Friends

class IncrementalMarking
 
class MarkCompactCollector
 
class PagedSpaceAllocatorPolicy
 
class heap::HeapTester
 

Detailed Description

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

Member Typedef Documentation

◆ const_iterator

◆ iterator

Constructor & Destructor Documentation

◆ PagedSpaceBase()

v8::internal::PagedSpaceBase::PagedSpaceBase ( Heap * heap,
AllocationSpace id,
Executability executable,
std::unique_ptr< FreeList > free_list,
CompactionSpaceKind compaction_space_kind )

Definition at line 68 of file paged-spaces.cc.

Here is the call graph for this function:

◆ ~PagedSpaceBase()

v8::internal::PagedSpaceBase::~PagedSpaceBase ( )
inlineoverride

Definition at line 123 of file paged-spaces.h.

Member Function Documentation

◆ AddPage()

size_t v8::internal::PagedSpaceBase::AddPage ( PageMetadata * page)
virtual

Reimplemented in v8::internal::PagedSpaceForNewSpace.

Definition at line 250 of file paged-spaces.cc.

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

◆ AddPageImpl()

void v8::internal::PagedSpaceBase::AddPageImpl ( PageMetadata * page)
protected

Definition at line 230 of file paged-spaces.cc.

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

◆ AddRangeToActiveSystemPages()

void v8::internal::PagedSpaceBase::AddRangeToActiveSystemPages ( PageMetadata * page,
Address start,
Address end )

Definition at line 499 of file paged-spaces.cc.

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

◆ AdjustDifferenceInAllocatedBytes()

virtual void v8::internal::PagedSpaceBase::AdjustDifferenceInAllocatedBytes ( size_t diff)
inlinevirtual

Reimplemented in v8::internal::StickySpace.

Definition at line 293 of file paged-spaces.h.

Here is the caller graph for this function:

◆ AreaSize()

int v8::internal::PagedSpaceBase::AreaSize ( ) const
inline

Definition at line 239 of file paged-spaces.h.

Here is the caller graph for this function:

◆ Available()

size_t v8::internal::PagedSpaceBase::Available ( ) const
override

Definition at line 323 of file paged-spaces.cc.

Here is the caller graph for this function:

◆ begin() [1/2]

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

Definition at line 276 of file paged-spaces.h.

Here is the caller graph for this function:

◆ begin() [2/2]

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

Definition at line 279 of file paged-spaces.h.

◆ CanExpand()

bool v8::internal::PagedSpaceBase::CanExpand ( size_t size) const

◆ Capacity()

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

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

Here is the caller graph for this function:

◆ ClearAllocatorState()

void v8::internal::PagedSpaceBase::ClearAllocatorState ( )
inline

Definition at line 151 of file paged-spaces.h.

Here is the caller graph for this function:

◆ committed_physical_memory()

size_t v8::internal::PagedSpaceBase::committed_physical_memory ( ) const
inlineprotected

Definition at line 309 of file paged-spaces.h.

Here is the caller graph for this function:

◆ CommittedPhysicalMemory()

size_t v8::internal::PagedSpaceBase::CommittedPhysicalMemory ( ) const
override

Definition at line 156 of file paged-spaces.cc.

Here is the call graph for this function:

◆ compaction_space_kind()

CompactionSpaceKind v8::internal::PagedSpaceBase::compaction_space_kind ( ) const
inline

Definition at line 245 of file paged-spaces.h.

◆ Contains() [1/2]

bool v8::internal::PagedSpaceBase::Contains ( Address a) const
inline

Definition at line 78 of file paged-spaces-inl.h.

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

◆ Contains() [2/2]

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

Definition at line 82 of file paged-spaces-inl.h.

Here is the call graph for this function:

◆ ContainsSlow()

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

Definition at line 193 of file paged-spaces.cc.

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

◆ CountTotalPages()

int v8::internal::PagedSpaceBase::CountTotalPages ( ) const

Definition at line 319 of file paged-spaces.cc.

Here is the call graph for this function:

◆ DecreaseAllocatedBytes()

void v8::internal::PagedSpaceBase::DecreaseAllocatedBytes ( size_t bytes,
PageMetadata * page )
inline

Definition at line 189 of file paged-spaces.h.

Here is the caller graph for this function:

◆ DecreaseCapacity()

void v8::internal::PagedSpaceBase::DecreaseCapacity ( size_t bytes)
inline

Definition at line 195 of file paged-spaces.h.

Here is the caller graph for this function:

◆ DecrementCommittedPhysicalMemory()

void v8::internal::PagedSpaceBase::DecrementCommittedPhysicalMemory ( size_t decrement_value)

Definition at line 172 of file paged-spaces.cc.

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

◆ end() [1/2]

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

Definition at line 277 of file paged-spaces.h.

Here is the caller graph for this function:

◆ end() [2/2]

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

Definition at line 280 of file paged-spaces.h.

◆ executable()

Executability v8::internal::PagedSpaceBase::executable ( ) const
inline

Definition at line 131 of file paged-spaces.h.

Here is the caller graph for this function:

◆ first_page() [1/2]

const PageMetadata * v8::internal::PagedSpaceBase::first_page ( ) const
inlineoverride

Definition at line 265 of file paged-spaces.h.

◆ first_page() [2/2]

PageMetadata * v8::internal::PagedSpaceBase::first_page ( )
inlineoverride

Definition at line 262 of file paged-spaces.h.

◆ Free()

size_t v8::internal::PagedSpaceBase::Free ( Address start,
size_t size_in_bytes )

Definition at line 115 of file paged-spaces-inl.h.

Here is the caller graph for this function:

◆ FreeDuringSweep()

size_t v8::internal::PagedSpaceBase::FreeDuringSweep ( Address start,
size_t size_in_bytes )

Definition at line 119 of file paged-spaces-inl.h.

Here is the caller graph for this function:

◆ FreeInternal() [1/2]

template<bool during_sweep>
size_t v8::internal::PagedSpaceBase::FreeInternal ( Address start,
size_t size_in_bytes )

Definition at line 88 of file paged-spaces-inl.h.

Here is the call graph for this function:

◆ FreeInternal() [2/2]

template<bool during_sweep>
V8_INLINE size_t v8::internal::PagedSpaceBase::FreeInternal ( Address start,
size_t size_in_bytes )
private

◆ GetObjectIterator()

std::unique_ptr< ObjectIterator > v8::internal::PagedSpaceBase::GetObjectIterator ( Heap * heap)
override

Definition at line 359 of file paged-spaces.cc.

◆ HasPages()

bool v8::internal::PagedSpaceBase::HasPages ( ) const
inlineprotected

Definition at line 300 of file paged-spaces.h.

◆ IncreaseAllocatedBytes()

void v8::internal::PagedSpaceBase::IncreaseAllocatedBytes ( size_t bytes,
PageMetadata * page )
inline

Definition at line 192 of file paged-spaces.h.

Here is the caller graph for this function:

◆ IncreaseCapacity()

void v8::internal::PagedSpaceBase::IncreaseCapacity ( size_t bytes)
inline

Definition at line 198 of file paged-spaces.h.

Here is the caller graph for this function:

◆ IncrementCommittedPhysicalMemory()

void v8::internal::PagedSpaceBase::IncrementCommittedPhysicalMemory ( size_t increment_value)

Definition at line 164 of file paged-spaces.cc.

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

◆ InitializePage()

PageMetadata * v8::internal::PagedSpaceBase::InitializePage ( MutablePageMetadata * chunk)
override

Definition at line 79 of file paged-spaces.cc.

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

◆ is_compaction_space()

bool v8::internal::PagedSpaceBase::is_compaction_space ( ) const
inline

Definition at line 241 of file paged-spaces.h.

Here is the caller graph for this function:

◆ last_page() [1/2]

const PageMetadata * v8::internal::PagedSpaceBase::last_page ( ) const
inlineoverride

Definition at line 272 of file paged-spaces.h.

◆ last_page() [2/2]

PageMetadata * v8::internal::PagedSpaceBase::last_page ( )
inlineoverride

Definition at line 269 of file paged-spaces.h.

◆ MergeCompactionSpace()

void v8::internal::PagedSpaceBase::MergeCompactionSpace ( CompactionSpace * other)

Definition at line 112 of file paged-spaces.cc.

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

◆ mutex()

base::Mutex * v8::internal::PagedSpaceBase::mutex ( )
inline

Definition at line 257 of file paged-spaces.h.

Here is the caller graph for this function:

◆ NotifyNewPage()

virtual void v8::internal::PagedSpaceBase::NotifyNewPage ( PageMetadata * page)
inlineprotectedvirtual

Reimplemented in v8::internal::CompactionSpace.

Definition at line 307 of file paged-spaces.h.

Here is the caller graph for this function:

◆ RawAllocateBackground()

V8_WARN_UNUSED_RESULT std::optional< std::pair< Address, size_t > > v8::internal::PagedSpaceBase::RawAllocateBackground ( LocalHeap * local_heap,
size_t min_size_in_bytes,
size_t max_size_in_bytes,
AllocationOrigin origin )

◆ ReduceActiveSystemPages()

void v8::internal::PagedSpaceBase::ReduceActiveSystemPages ( PageMetadata * page,
ActiveSystemPages active_system_pages )

Definition at line 514 of file paged-spaces.cc.

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

◆ RefillFreeList()

void v8::internal::PagedSpaceBase::RefillFreeList ( )
virtual

Reimplemented in v8::internal::CompactionSpace.

Definition at line 544 of file paged-spaces.cc.

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

◆ RefineAllocatedBytesAfterSweeping()

void v8::internal::PagedSpaceBase::RefineAllocatedBytesAfterSweeping ( PageMetadata * page)

Definition at line 201 of file paged-spaces.cc.

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

◆ ReleasePage()

void v8::internal::PagedSpaceBase::ReleasePage ( PageMetadata * page)
virtual

Reimplemented in v8::internal::OldSpace, v8::internal::PagedSpaceForNewSpace, and v8::internal::SharedSpace.

Definition at line 332 of file paged-spaces.cc.

Here is the call graph for this function:

◆ ReleasePageImpl()

void v8::internal::PagedSpaceBase::ReleasePageImpl ( PageMetadata * page,
MemoryAllocator::FreeMode free_mode )
protected

Definition at line 336 of file paged-spaces.cc.

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

◆ RelinkFreeListCategories()

size_t v8::internal::PagedSpaceBase::RelinkFreeListCategories ( PageMetadata * page)

Definition at line 529 of file paged-spaces.cc.

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

◆ RemovePage()

void v8::internal::PagedSpaceBase::RemovePage ( PageMetadata * page)
virtual

Reimplemented in v8::internal::PagedSpaceForNewSpace.

Definition at line 255 of file paged-spaces.cc.

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

◆ RemovePageSafe()

PageMetadata * v8::internal::PagedSpaceBase::RemovePageSafe ( int size_in_bytes)

Definition at line 222 of file paged-spaces.cc.

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

◆ ResetFreeList()

void v8::internal::PagedSpaceBase::ResetFreeList ( )

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

Here is the caller graph for this function:

◆ Size()

size_t v8::internal::PagedSpaceBase::Size ( ) const
inlineoverride

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

Here is the caller graph for this function:

◆ snapshotable()

virtual bool v8::internal::PagedSpaceBase::snapshotable ( ) const
inlineprotectedvirtual

Reimplemented in v8::internal::CompactionSpace.

Definition at line 298 of file paged-spaces.h.

◆ SupportsConcurrentAllocation()

bool v8::internal::PagedSpaceBase::SupportsConcurrentAllocation ( ) const
inlineprivate

Definition at line 349 of file paged-spaces.h.

◆ TearDown()

void v8::internal::PagedSpaceBase::TearDown ( )
protected

Definition at line 95 of file paged-spaces.cc.

Here is the call graph for this function:

◆ TryExpand()

bool v8::internal::PagedSpaceBase::TryExpand ( LocalHeap * local_heap,
AllocationOrigin origin )

Definition at line 290 of file paged-spaces.cc.

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

◆ UnlinkFreeListCategories()

void v8::internal::PagedSpaceBase::UnlinkFreeListCategories ( PageMetadata * page)

Definition at line 522 of file paged-spaces.cc.

Here is the caller graph for this function:

◆ Waste()

size_t v8::internal::PagedSpaceBase::Waste ( ) const

Definition at line 328 of file paged-spaces.cc.

Here is the caller graph for this function:

Friends And Related Symbol Documentation

◆ heap::HeapTester

friend class heap::HeapTester
friend

Definition at line 358 of file paged-spaces.h.

◆ IncrementalMarking

friend class IncrementalMarking
friend

Definition at line 353 of file paged-spaces.h.

◆ MarkCompactCollector

friend class MarkCompactCollector
friend

Definition at line 354 of file paged-spaces.h.

◆ PagedSpaceAllocatorPolicy

friend class PagedSpaceAllocatorPolicy
friend

Definition at line 355 of file paged-spaces.h.

Member Data Documentation

◆ accounting_stats_

AllocationStats v8::internal::PagedSpaceBase::accounting_stats_
protected

Definition at line 324 of file paged-spaces.h.

◆ area_size_

size_t v8::internal::PagedSpaceBase::area_size_
protected

Definition at line 321 of file paged-spaces.h.

◆ committed_physical_memory_

std::atomic<size_t> v8::internal::PagedSpaceBase::committed_physical_memory_ {0}
protected

Definition at line 329 of file paged-spaces.h.

◆ compaction_space_kind_

CompactionSpaceKind v8::internal::PagedSpaceBase::compaction_space_kind_
protected

Definition at line 319 of file paged-spaces.h.

◆ executable_

Executability v8::internal::PagedSpaceBase::executable_
protected

Definition at line 317 of file paged-spaces.h.

◆ kCompactionMemoryWanted

const size_t v8::internal::PagedSpaceBase::kCompactionMemoryWanted = 500 * KB
static

Definition at line 117 of file paged-spaces.h.

◆ size_at_last_gc_

size_t v8::internal::PagedSpaceBase::size_at_last_gc_ = 0
protected

Definition at line 332 of file paged-spaces.h.

◆ space_mutex_

base::Mutex v8::internal::PagedSpaceBase::space_mutex_
mutableprotected

Definition at line 327 of file paged-spaces.h.


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