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

#include <new-spaces.h>

Inheritance diagram for v8::internal::SemiSpaceNewSpace:
Collaboration diagram for v8::internal::SemiSpaceNewSpace:

Public Member Functions

 SemiSpaceNewSpace (Heap *heap, size_t initial_semispace_capacity, size_t min_semispace_capacity_, size_t max_semispace_capacity)
 
 ~SemiSpaceNewSpace () final=default
 
bool ContainsSlow (Address a) const final
 
void Grow (size_t new_capacity) final
 
void Shrink (size_t new_capacity)
 
size_t Size () const final
 
size_t SizeOfObjects () const final
 
size_t Capacity () const final
 
size_t CurrentCapacitySafe () const
 
size_t TotalCapacity () const final
 
size_t CommittedMemory () const final
 
size_t MaximumCommittedMemory () const final
 
size_t CommittedPhysicalMemory () const final
 
size_t Available () const final
 
bool ReachedTargetCapacity () const
 
size_t ExternalBackingStoreBytes (ExternalBackingStoreType type) const final
 
size_t AllocatedSinceLastGC () const final
 
void GrowToMaximumCapacityForTesting () final
 
size_t MaximumCapacity () const final
 
size_t MinimumCapacity () const final
 
Address first_allocatable_address () const final
 
Address age_mark () const
 
void SetAgeMarkAndBelowAgeMarkPageFlags ()
 
bool AddFreshPage ()
 
bool AddParkedAllocationBuffer (int size_in_bytes, AllocationAlignment alignment)
 
void ResetParkedAllocationBuffers ()
 
void MakeIterable () override
 
void MakeAllPagesInFromSpaceIterable ()
 
void MakeUnusedPagesInToSpaceIterable ()
 
PageMetadatafirst_page () final
 
PageMetadatalast_page () final
 
const PageMetadatafirst_page () const final
 
const PageMetadatalast_page () const final
 
iterator begin () final
 
iterator end () final
 
const_iterator begin () const final
 
const_iterator end () const final
 
std::unique_ptr< ObjectIteratorGetObjectIterator (Heap *heap) final
 
SemiSpacefrom_space ()
 
const SemiSpacefrom_space () const
 
SemiSpaceto_space ()
 
const SemiSpaceto_space () const
 
bool ShouldPageBePromoted (const MemoryChunk *chunk) const
 
V8_INLINE bool ShouldBePromoted (Address object) const
 
void SwapSemiSpaces ()
 
void GarbageCollectionPrologue () final
 
void GarbageCollectionEpilogue () final
 
void ZapUnusedMemory ()
 
bool IsPromotionCandidate (const MutablePageMetadata *page) const final
 
AllocatorPolicyCreateAllocatorPolicy (MainAllocator *allocator) final
 
int GetSpaceRemainingOnCurrentPageForTesting ()
 
void FillCurrentPageForTesting ()
 
void MoveQuarantinedPage (MemoryChunk *chunk)
 
size_t QuarantinedSize () const
 
size_t QuarantinedPageCount () const
 
void SetQuarantinedSize (size_t quarantined_size)
 
V8_INLINE bool IsAddressBelowAgeMark (Address address) const
 
- Public Member Functions inherited from v8::internal::NewSpace
 NewSpace (Heap *heap)
 
base::Mutexmutex ()
 
bool Contains (Tagged< Object > o) const
 
bool Contains (Tagged< HeapObject > o) const
 
size_t ExternalBackingStoreOverallBytes () const
 
void PromotePageToOldSpace (PageMetadata *page, FreeMode free_mode)
 

Static Public Member Functions

static SemiSpaceNewSpaceFrom (NewSpace *space)
 

Private Types

using ParkedAllocationBuffer = std::pair<int, Address>
 
using ParkedAllocationBuffersVector = std::vector<ParkedAllocationBuffer>
 

Private Member Functions

bool IsFromSpaceCommitted () const
 
SemiSpaceactive_space ()
 
std::optional< std::pair< Address, Address > > Allocate (int size_in_bytes, AllocationAlignment alignment)
 
std::optional< std::pair< Address, Address > > AllocateOnNewPageBeyondCapacity (int size_in_bytes, AllocationAlignment alignment)
 
void RemovePage (PageMetadata *page) final
 
void Free (Address start, Address end)
 
void ResetAllocationTopToCurrentPageStart ()
 
void SetAllocationTop (Address top)
 
V8_INLINE void IncrementAllocationTop (Address new_top)
 
V8_INLINE void DecrementAllocationTop (Address new_top)
 
Address allocation_top () const
 

Private Attributes

SemiSpace to_space_
 
SemiSpace from_space_
 
Address allocation_top_ = kNullAddress
 
ParkedAllocationBuffersVector parked_allocation_buffers_
 
size_t quarantined_size_ = 0
 
size_t size_after_last_gc_ = 0
 
const size_t minimum_capacity_ = 0
 
const size_t maximum_capacity_ = 0
 
Address age_mark_ = kNullAddress
 
size_t target_capacity_ = 0
 

Friends

class SemiSpaceObjectIterator
 
class SemiSpaceNewSpaceAllocatorPolicy
 

Additional Inherited Members

- Public Types inherited from v8::internal::NewSpace
using iterator = PageIterator
 
using const_iterator = ConstPageIterator
 
- Protected Member Functions inherited from v8::internal::NewSpace
- Protected Attributes inherited from v8::internal::NewSpace
base::Mutex mutex_
 
- Static Protected Attributes inherited from v8::internal::NewSpace
static const int kAllocationBufferParkingThreshold = 4 * KB
 

Detailed Description

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

Member Typedef Documentation

◆ ParkedAllocationBuffer

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

◆ ParkedAllocationBuffersVector

Constructor & Destructor Documentation

◆ SemiSpaceNewSpace()

v8::internal::SemiSpaceNewSpace::SemiSpaceNewSpace ( Heap * heap,
size_t initial_semispace_capacity,
size_t min_semispace_capacity_,
size_t max_semispace_capacity )

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

Here is the call graph for this function:

◆ ~SemiSpaceNewSpace()

v8::internal::SemiSpaceNewSpace::~SemiSpaceNewSpace ( )
finaldefault

Member Function Documentation

◆ active_space()

SemiSpace * v8::internal::SemiSpaceNewSpace::active_space ( )
inlineprivate

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

◆ AddFreshPage()

bool v8::internal::SemiSpaceNewSpace::AddFreshPage ( )

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

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

◆ AddParkedAllocationBuffer()

bool v8::internal::SemiSpaceNewSpace::AddParkedAllocationBuffer ( int size_in_bytes,
AllocationAlignment alignment )

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

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

◆ age_mark()

Address v8::internal::SemiSpaceNewSpace::age_mark ( ) const
inline

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

Here is the caller graph for this function:

◆ Allocate()

std::optional< std::pair< Address, Address > > v8::internal::SemiSpaceNewSpace::Allocate ( int size_in_bytes,
AllocationAlignment alignment )
private

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

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

◆ AllocatedSinceLastGC()

size_t v8::internal::SemiSpaceNewSpace::AllocatedSinceLastGC ( ) const
finalvirtual

Implements v8::internal::NewSpace.

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

Here is the call graph for this function:

◆ AllocateOnNewPageBeyondCapacity()

std::optional< std::pair< Address, Address > > v8::internal::SemiSpaceNewSpace::AllocateOnNewPageBeyondCapacity ( int size_in_bytes,
AllocationAlignment alignment )
private

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

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

◆ allocation_top()

Address v8::internal::SemiSpaceNewSpace::allocation_top ( ) const
inlineprivate

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

Here is the caller graph for this function:

◆ Available()

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

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

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

◆ begin() [1/2]

const_iterator v8::internal::SemiSpaceNewSpace::begin ( ) const
inlinefinalvirtual

Implements v8::internal::NewSpace.

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

◆ begin() [2/2]

iterator v8::internal::SemiSpaceNewSpace::begin ( )
inlinefinalvirtual

Implements v8::internal::NewSpace.

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

◆ Capacity()

size_t v8::internal::SemiSpaceNewSpace::Capacity ( ) const
inlinefinalvirtual

Implements v8::internal::NewSpace.

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

Here is the caller graph for this function:

◆ CommittedMemory()

size_t v8::internal::SemiSpaceNewSpace::CommittedMemory ( ) const
inlinefinal

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

Here is the caller graph for this function:

◆ CommittedPhysicalMemory()

size_t v8::internal::SemiSpaceNewSpace::CommittedPhysicalMemory ( ) const
final

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

Here is the call graph for this function:

◆ ContainsSlow()

bool v8::internal::SemiSpaceNewSpace::ContainsSlow ( Address a) const
finalvirtual

Implements v8::internal::NewSpace.

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

Here is the call graph for this function:

◆ CreateAllocatorPolicy()

AllocatorPolicy * v8::internal::SemiSpaceNewSpace::CreateAllocatorPolicy ( MainAllocator * allocator)
final

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

◆ CurrentCapacitySafe()

size_t v8::internal::SemiSpaceNewSpace::CurrentCapacitySafe ( ) const
inline

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

Here is the caller graph for this function:

◆ DecrementAllocationTop()

void v8::internal::SemiSpaceNewSpace::DecrementAllocationTop ( Address new_top)
private

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

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

◆ end() [1/2]

const_iterator v8::internal::SemiSpaceNewSpace::end ( ) const
inlinefinalvirtual

Implements v8::internal::NewSpace.

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

◆ end() [2/2]

iterator v8::internal::SemiSpaceNewSpace::end ( )
inlinefinalvirtual

Implements v8::internal::NewSpace.

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

Here is the caller graph for this function:

◆ ExternalBackingStoreBytes()

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

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

◆ FillCurrentPageForTesting()

void v8::internal::SemiSpaceNewSpace::FillCurrentPageForTesting ( )

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

Here is the call graph for this function:

◆ first_allocatable_address()

Address v8::internal::SemiSpaceNewSpace::first_allocatable_address ( ) const
inlinefinalvirtual

Implements v8::internal::NewSpace.

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

◆ first_page() [1/2]

const PageMetadata * v8::internal::SemiSpaceNewSpace::first_page ( ) const
inlinefinal

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

◆ first_page() [2/2]

PageMetadata * v8::internal::SemiSpaceNewSpace::first_page ( )
inlinefinal

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

Here is the caller graph for this function:

◆ Free()

void v8::internal::SemiSpaceNewSpace::Free ( Address start,
Address end )
private

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

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

◆ From()

static SemiSpaceNewSpace * v8::internal::SemiSpaceNewSpace::From ( NewSpace * space)
inlinestatic

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

Here is the caller graph for this function:

◆ from_space() [1/2]

SemiSpace & v8::internal::SemiSpaceNewSpace::from_space ( )
inline

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

Here is the caller graph for this function:

◆ from_space() [2/2]

const SemiSpace & v8::internal::SemiSpaceNewSpace::from_space ( ) const
inline

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

◆ GarbageCollectionEpilogue()

void v8::internal::SemiSpaceNewSpace::GarbageCollectionEpilogue ( )
finalvirtual

Implements v8::internal::NewSpace.

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

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

◆ GarbageCollectionPrologue()

void v8::internal::SemiSpaceNewSpace::GarbageCollectionPrologue ( )
finalvirtual

Reimplemented from v8::internal::NewSpace.

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

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

◆ GetObjectIterator()

std::unique_ptr< ObjectIterator > v8::internal::SemiSpaceNewSpace::GetObjectIterator ( Heap * heap)
final

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

◆ GetSpaceRemainingOnCurrentPageForTesting()

int v8::internal::SemiSpaceNewSpace::GetSpaceRemainingOnCurrentPageForTesting ( )

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

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

◆ Grow()

void v8::internal::SemiSpaceNewSpace::Grow ( size_t new_capacity)
finalvirtual

Implements v8::internal::NewSpace.

Definition at line 435 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::SemiSpaceNewSpace::GrowToMaximumCapacityForTesting ( )
finalvirtual

Implements v8::internal::NewSpace.

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

Here is the call graph for this function:

◆ IncrementAllocationTop()

void v8::internal::SemiSpaceNewSpace::IncrementAllocationTop ( Address new_top)
private

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

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

◆ IsAddressBelowAgeMark()

bool v8::internal::SemiSpaceNewSpace::IsAddressBelowAgeMark ( Address address) const

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

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

◆ IsFromSpaceCommitted()

bool v8::internal::SemiSpaceNewSpace::IsFromSpaceCommitted ( ) const
inlineprivate

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

Here is the caller graph for this function:

◆ IsPromotionCandidate()

bool v8::internal::SemiSpaceNewSpace::IsPromotionCandidate ( const MutablePageMetadata * page) const
finalvirtual

Implements v8::internal::NewSpace.

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

Here is the call graph for this function:

◆ last_page() [1/2]

const PageMetadata * v8::internal::SemiSpaceNewSpace::last_page ( ) const
inlinefinal

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

◆ last_page() [2/2]

PageMetadata * v8::internal::SemiSpaceNewSpace::last_page ( )
inlinefinal

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

◆ MakeAllPagesInFromSpaceIterable()

void v8::internal::SemiSpaceNewSpace::MakeAllPagesInFromSpaceIterable ( )

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

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

◆ MakeIterable()

void v8::internal::SemiSpaceNewSpace::MakeIterable ( )
overridevirtual

Implements v8::internal::NewSpace.

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

Here is the call graph for this function:

◆ MakeUnusedPagesInToSpaceIterable()

void v8::internal::SemiSpaceNewSpace::MakeUnusedPagesInToSpaceIterable ( )

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

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

◆ MaximumCapacity()

size_t v8::internal::SemiSpaceNewSpace::MaximumCapacity ( ) const
inlinefinalvirtual

Implements v8::internal::NewSpace.

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

◆ MaximumCommittedMemory()

size_t v8::internal::SemiSpaceNewSpace::MaximumCommittedMemory ( ) const
inlinefinal

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

◆ MinimumCapacity()

size_t v8::internal::SemiSpaceNewSpace::MinimumCapacity ( ) const
inlinefinalvirtual

Implements v8::internal::NewSpace.

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

◆ MoveQuarantinedPage()

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

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

Here is the call graph for this function:

◆ QuarantinedPageCount()

size_t v8::internal::SemiSpaceNewSpace::QuarantinedPageCount ( ) const
inline

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

Here is the caller graph for this function:

◆ QuarantinedSize()

size_t v8::internal::SemiSpaceNewSpace::QuarantinedSize ( ) const
inline

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

Here is the caller graph for this function:

◆ ReachedTargetCapacity()

bool v8::internal::SemiSpaceNewSpace::ReachedTargetCapacity ( ) const
inline

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

Here is the caller graph for this function:

◆ RemovePage()

void v8::internal::SemiSpaceNewSpace::RemovePage ( PageMetadata * page)
finalprivatevirtual

Implements v8::internal::NewSpace.

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

Here is the call graph for this function:

◆ ResetAllocationTopToCurrentPageStart()

void v8::internal::SemiSpaceNewSpace::ResetAllocationTopToCurrentPageStart ( )
inlineprivate

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

Here is the caller graph for this function:

◆ ResetParkedAllocationBuffers()

void v8::internal::SemiSpaceNewSpace::ResetParkedAllocationBuffers ( )

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

Here is the caller graph for this function:

◆ SetAgeMarkAndBelowAgeMarkPageFlags()

void v8::internal::SemiSpaceNewSpace::SetAgeMarkAndBelowAgeMarkPageFlags ( )

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

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

◆ SetAllocationTop()

void v8::internal::SemiSpaceNewSpace::SetAllocationTop ( Address top)
inlineprivate

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

Here is the caller graph for this function:

◆ SetQuarantinedSize()

void v8::internal::SemiSpaceNewSpace::SetQuarantinedSize ( size_t quarantined_size)
inline

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

◆ ShouldBePromoted()

bool v8::internal::SemiSpaceNewSpace::ShouldBePromoted ( Address object) const

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

Here is the call graph for this function:

◆ ShouldPageBePromoted()

bool v8::internal::SemiSpaceNewSpace::ShouldPageBePromoted ( const MemoryChunk * chunk) const

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

Here is the call graph for this function:

◆ Shrink()

void v8::internal::SemiSpaceNewSpace::Shrink ( size_t new_capacity)

Definition at line 477 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::SemiSpaceNewSpace::Size ( ) const
final

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

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

◆ SizeOfObjects()

size_t v8::internal::SemiSpaceNewSpace::SizeOfObjects ( ) const
inlinefinal

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

◆ SwapSemiSpaces()

void v8::internal::SemiSpaceNewSpace::SwapSemiSpaces ( )

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

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

◆ to_space() [1/2]

SemiSpace & v8::internal::SemiSpaceNewSpace::to_space ( )
inline

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

Here is the caller graph for this function:

◆ to_space() [2/2]

const SemiSpace & v8::internal::SemiSpaceNewSpace::to_space ( ) const
inline

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

◆ TotalCapacity()

size_t v8::internal::SemiSpaceNewSpace::TotalCapacity ( ) const
inlinefinalvirtual

Implements v8::internal::NewSpace.

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

Here is the caller graph for this function:

◆ ZapUnusedMemory()

void v8::internal::SemiSpaceNewSpace::ZapUnusedMemory ( )

Definition at line 740 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

◆ SemiSpaceNewSpaceAllocatorPolicy

friend class SemiSpaceNewSpaceAllocatorPolicy
friend

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

◆ SemiSpaceObjectIterator

friend class SemiSpaceObjectIterator
friend

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

Member Data Documentation

◆ age_mark_

Address v8::internal::SemiSpaceNewSpace::age_mark_ = kNullAddress
private

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

◆ allocation_top_

Address v8::internal::SemiSpaceNewSpace::allocation_top_ = kNullAddress
private

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

◆ from_space_

SemiSpace v8::internal::SemiSpaceNewSpace::from_space_
private

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

◆ maximum_capacity_

const size_t v8::internal::SemiSpaceNewSpace::maximum_capacity_ = 0
private

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

◆ minimum_capacity_

const size_t v8::internal::SemiSpaceNewSpace::minimum_capacity_ = 0
private

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

◆ parked_allocation_buffers_

ParkedAllocationBuffersVector v8::internal::SemiSpaceNewSpace::parked_allocation_buffers_
private

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

◆ quarantined_size_

size_t v8::internal::SemiSpaceNewSpace::quarantined_size_ = 0
private

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

◆ size_after_last_gc_

size_t v8::internal::SemiSpaceNewSpace::size_after_last_gc_ = 0
private

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

◆ target_capacity_

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

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

◆ to_space_

SemiSpace v8::internal::SemiSpaceNewSpace::to_space_
private

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


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