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

#include <new-spaces.h>

Inheritance diagram for v8::internal::PagedSpaceForNewSpace:
Collaboration diagram for v8::internal::PagedSpaceForNewSpace:

Public Member Functions

 PagedSpaceForNewSpace (Heap *heap, size_t initial_capacity, size_t min_capacity, size_t max_capacity)
 
void TearDown ()
 
void Grow (size_t new_capacity)
 
void GrowToMaximumCapacityForTesting ()
 
bool StartShrinking (size_t new_target_capacity)
 
void FinishShrinking ()
 
size_t AllocatedSinceLastGC () const
 
size_t MinimumCapacity () const
 
size_t MaximumCapacity () const
 
size_t TotalCapacity () const
 
Address first_allocatable_address () const
 
void GarbageCollectionEpilogue ()
 
PageMetadataInitializePage (MutablePageMetadata *chunk) final
 
size_t AddPage (PageMetadata *page) final
 
void RemovePage (PageMetadata *page) final
 
void ReleasePage (PageMetadata *page) final
 
size_t ExternalBackingStoreBytes (ExternalBackingStoreType type) const final
 
void MakeIterable ()
 
bool ShouldReleaseEmptyPage () const
 
void AllocatePageUpToCapacityForTesting ()
 
bool IsPromotionCandidate (const MutablePageMetadata *page) const
 
size_t Available () const final
 
size_t UsableCapacity () const
 
AllocatorPolicyCreateAllocatorPolicy (MainAllocator *allocator) final
 
- Public Member Functions inherited from v8::internal::PagedSpaceBase
 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
 
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)
 

Private Member Functions

bool AllocatePage ()
 

Private Attributes

const size_t min_capacity_
 
const size_t max_capacity_
 
size_t target_capacity_ = 0
 
size_t current_capacity_ = 0
 
PageMetadatalast_lab_page_ = nullptr
 

Friends

class PagedNewSpaceAllocatorPolicy
 

Additional Inherited Members

- Public Types inherited from v8::internal::PagedSpaceBase
using iterator = PageIterator
 
using const_iterator = ConstPageIterator
 
- Static Public Attributes inherited from v8::internal::PagedSpaceBase
static const size_t kCompactionMemoryWanted = 500 * KB
 
- Protected Member Functions inherited from v8::internal::PagedSpaceBase
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 inherited from v8::internal::PagedSpaceBase
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
 

Detailed Description

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

Constructor & Destructor Documentation

◆ PagedSpaceForNewSpace()

v8::internal::PagedSpaceForNewSpace::PagedSpaceForNewSpace ( Heap * heap,
size_t initial_capacity,
size_t min_capacity,
size_t max_capacity )
explicit

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

Here is the call graph for this function:

Member Function Documentation

◆ AddPage()

size_t v8::internal::PagedSpaceForNewSpace::AddPage ( PageMetadata * page)
finalvirtual

Reimplemented from v8::internal::PagedSpaceBase.

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

Here is the call graph for this function:

◆ AllocatedSinceLastGC()

size_t v8::internal::PagedSpaceForNewSpace::AllocatedSinceLastGC ( ) const

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

Here is the call graph for this function:

◆ AllocatePage()

bool v8::internal::PagedSpaceForNewSpace::AllocatePage ( )
private

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

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

◆ AllocatePageUpToCapacityForTesting()

void v8::internal::PagedSpaceForNewSpace::AllocatePageUpToCapacityForTesting ( )

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

Here is the call graph for this function:

◆ Available()

size_t v8::internal::PagedSpaceForNewSpace::Available ( ) const
final

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

Here is the call graph for this function:

◆ CreateAllocatorPolicy()

AllocatorPolicy * v8::internal::PagedSpaceForNewSpace::CreateAllocatorPolicy ( MainAllocator * allocator)
inlinefinal

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

◆ ExternalBackingStoreBytes()

size_t v8::internal::PagedSpaceForNewSpace::ExternalBackingStoreBytes ( ExternalBackingStoreType type) const
inlinefinal

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

◆ FinishShrinking()

void v8::internal::PagedSpaceForNewSpace::FinishShrinking ( )

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

◆ first_allocatable_address()

Address v8::internal::PagedSpaceForNewSpace::first_allocatable_address ( ) const
inline

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

◆ GarbageCollectionEpilogue()

void v8::internal::PagedSpaceForNewSpace::GarbageCollectionEpilogue ( )
inline

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

◆ Grow()

void v8::internal::PagedSpaceForNewSpace::Grow ( size_t new_capacity)

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

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

◆ GrowToMaximumCapacityForTesting()

void v8::internal::PagedSpaceForNewSpace::GrowToMaximumCapacityForTesting ( )

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

Here is the call graph for this function:

◆ InitializePage()

PageMetadata * v8::internal::PagedSpaceForNewSpace::InitializePage ( MutablePageMetadata * chunk)
final

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

Here is the call graph for this function:

◆ IsPromotionCandidate()

bool v8::internal::PagedSpaceForNewSpace::IsPromotionCandidate ( const MutablePageMetadata * page) const

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

◆ MakeIterable()

void v8::internal::PagedSpaceForNewSpace::MakeIterable ( )
inline

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

◆ MaximumCapacity()

size_t v8::internal::PagedSpaceForNewSpace::MaximumCapacity ( ) const
inline

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

Here is the caller graph for this function:

◆ MinimumCapacity()

size_t v8::internal::PagedSpaceForNewSpace::MinimumCapacity ( ) const
inline

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

◆ ReleasePage()

void v8::internal::PagedSpaceForNewSpace::ReleasePage ( PageMetadata * page)
finalvirtual

Reimplemented from v8::internal::PagedSpaceBase.

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

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

◆ RemovePage()

void v8::internal::PagedSpaceForNewSpace::RemovePage ( PageMetadata * page)
finalvirtual

Reimplemented from v8::internal::PagedSpaceBase.

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

Here is the call graph for this function:

◆ ShouldReleaseEmptyPage()

bool v8::internal::PagedSpaceForNewSpace::ShouldReleaseEmptyPage ( ) const

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

Here is the caller graph for this function:

◆ StartShrinking()

bool v8::internal::PagedSpaceForNewSpace::StartShrinking ( size_t new_target_capacity)

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

◆ TearDown()

void v8::internal::PagedSpaceForNewSpace::TearDown ( )
inline

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

Here is the caller graph for this function:

◆ TotalCapacity()

size_t v8::internal::PagedSpaceForNewSpace::TotalCapacity ( ) const
inline

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

Here is the caller graph for this function:

◆ UsableCapacity()

size_t v8::internal::PagedSpaceForNewSpace::UsableCapacity ( ) const
inline

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

Here is the caller graph for this function:

Friends And Related Symbol Documentation

◆ PagedNewSpaceAllocatorPolicy

friend class PagedNewSpaceAllocatorPolicy
friend

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

Member Data Documentation

◆ current_capacity_

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

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

◆ last_lab_page_

PageMetadata* v8::internal::PagedSpaceForNewSpace::last_lab_page_ = nullptr
private

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

◆ max_capacity_

const size_t v8::internal::PagedSpaceForNewSpace::max_capacity_
private

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

◆ min_capacity_

const size_t v8::internal::PagedSpaceForNewSpace::min_capacity_
private

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

◆ target_capacity_

size_t v8::internal::PagedSpaceForNewSpace::target_capacity_ = 0
private

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


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