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

#include <heap.h>

Inheritance diagram for cppgc::internal::Heap:
Collaboration diagram for cppgc::internal::Heap:

Public Member Functions

 Heap (std::shared_ptr< cppgc::Platform > platform, cppgc::Heap::HeapOptions options)
 
 ~Heap () final
 
HeapBaseAsBase ()
 
const HeapBaseAsBase () const
 
void CollectGarbage (GCConfig) final
 
void StartIncrementalGarbageCollection (GCConfig) final
 
void FinalizeIncrementalGarbageCollectionIfRunning (GCConfig)
 
size_t epoch () const final
 
std::optional< EmbedderStackStateoverridden_stack_state () const final
 
void set_override_stack_state (EmbedderStackState state) final
 
void clear_overridden_stack_state () final
 
void EnableGenerationalGC ()
 
void DisableHeapGrowingForTesting ()
 
- Public Member Functions inherited from cppgc::internal::HeapBase
 HeapBase (std::shared_ptr< cppgc::Platform > platform, const std::vector< std::unique_ptr< CustomSpaceBase > > &custom_spaces, StackSupport stack_support, MarkingType marking_support, SweepingType sweeping_support, GarbageCollector &garbage_collector)
 
virtual ~HeapBase ()
 
 HeapBase (const HeapBase &)=delete
 
HeapBaseoperator= (const HeapBase &)=delete
 
RawHeapraw_heap ()
 
const RawHeapraw_heap () const
 
cppgc::Platformplatform ()
 
const cppgc::Platformplatform () const
 
FatalOutOfMemoryHandleroom_handler ()
 
const FatalOutOfMemoryHandleroom_handler () const
 
PageBackendpage_backend ()
 
const PageBackendpage_backend () const
 
StatsCollectorstats_collector ()
 
const StatsCollectorstats_collector () const
 
PreFinalizerHandlerprefinalizer_handler ()
 
const PreFinalizerHandlerprefinalizer_handler () const
 
MarkerBasemarker () const
 
std::unique_ptr< MarkerBase > & GetMarkerRefForTesting ()
 
Compactorcompactor ()
 
ObjectAllocatorobject_allocator ()
 
const ObjectAllocatorobject_allocator () const
 
Sweepersweeper ()
 
const Sweepersweeper () const
 
PersistentRegionGetStrongPersistentRegion ()
 
const PersistentRegionGetStrongPersistentRegion () const
 
PersistentRegionGetWeakPersistentRegion ()
 
const PersistentRegionGetWeakPersistentRegion () const
 
CrossThreadPersistentRegionGetStrongCrossThreadPersistentRegion ()
 
const CrossThreadPersistentRegionGetStrongCrossThreadPersistentRegion () const
 
CrossThreadPersistentRegionGetWeakCrossThreadPersistentRegion ()
 
const CrossThreadPersistentRegionGetWeakCrossThreadPersistentRegion () const
 
size_t ObjectPayloadSize () const
 
virtual heap::base::Stackstack ()
 
StackSupport stack_support () const
 
void Terminate ()
 
virtual bool IsGCForbidden () const
 
bool in_atomic_pause () const
 
HeapStatistics CollectStatistics (HeapStatistics::DetailLevel)
 
EmbedderStackState stack_state_of_prev_gc () const
 
void SetStackStateOfPrevGC (EmbedderStackState stack_state)
 
void SetInAtomicPauseForTesting (bool value)
 
void SetMetricRecorder (std::unique_ptr< MetricRecorder > histogram_recorder)
 
virtual bool CurrentThreadIsHeapThread () const
 
MarkingType marking_support () const
 
SweepingType sweeping_support () const
 
bool incremental_marking_supported () const
 
bool generational_gc_supported () const
 
StickyBits sticky_bits () const
 
HeapObjectNameForUnnamedObject name_of_unnamed_object () const
 
void set_name_of_unnamed_object (HeapObjectNameForUnnamedObject value)
 
bool HasMoveListeners () const
 
void CallMoveListeners (Address from, Address to, size_t size_including_header)
 
void RegisterMoveListener (MoveListener *listener)
 
void UnregisterMoveListener (MoveListener *listener)
 
void set_incremental_marking_in_progress (bool value)
 
void EnterNoGCScope ()
 
void LeaveNoGCScope ()
 
void EnterDisallowGCScope ()
 
void LeaveDisallowGCScope ()
 
- Public Member Functions inherited from cppgc::HeapHandle
 HeapHandle (const HeapHandle &)=delete
 
HeapHandleoperator= (const HeapHandle &)=delete
 
- Public Member Functions inherited from cppgc::Heap
void ForceGarbageCollectionSlow (const char *source, const char *reason, StackState stack_state=StackState::kMayContainHeapPointers)
 
AllocationHandleGetAllocationHandle ()
 
HeapHandleGetHeapHandle ()
 
- Public Member Functions inherited from cppgc::internal::GarbageCollector

Static Public Member Functions

static HeapFrom (cppgc::Heap *heap)
 
static const HeapFrom (const cppgc::Heap *heap)
 
- Static Public Member Functions inherited from cppgc::internal::HeapBase
static HeapBaseFrom (cppgc::HeapHandle &heap_handle)
 
static const HeapBaseFrom (const cppgc::HeapHandle &heap_handle)
 
- Static Public Member Functions inherited from cppgc::Heap
static std::unique_ptr< HeapCreate (std::shared_ptr< Platform > platform, HeapOptions options=HeapOptions::Default())
 

Private Member Functions

void StartGarbageCollection (GCConfig)
 
void FinalizeGarbageCollection (StackState)
 
void FinalizeGarbageCollectionImpl (StackState)
 
void FinalizeIncrementalGarbageCollectionIfNeeded (StackState) final
 
void StartIncrementalGarbageCollectionForTesting () final
 
void FinalizeIncrementalGarbageCollectionForTesting (EmbedderStackState) final
 

Private Attributes

GCConfig config_
 
GCInvoker gc_invoker_
 
HeapGrowing growing_
 
bool generational_gc_enabled_ = false
 
size_t epoch_ = 0
 
std::optional< cppgc::EmbedderStackStateoverride_stack_state_
 

Additional Inherited Members

- Public Types inherited from cppgc::internal::HeapBase
using StackSupport = cppgc::Heap::StackSupport
 
using MarkingType = cppgc::Heap::MarkingType
 
using SweepingType = cppgc::Heap::SweepingType
 
- Public Types inherited from cppgc::Heap
enum class  StackSupport : uint8_t { kSupportsConservativeStackScan , kNoConservativeStackScan }
 
enum class  MarkingType : uint8_t { kAtomic , kIncremental , kIncrementalAndConcurrent }
 
enum class  SweepingType : uint8_t { kAtomic , kIncremental , kIncrementalAndConcurrent }
 
using StackState = EmbedderStackState
 
- Protected Member Functions inherited from cppgc::internal::HeapBase
virtual bool IsGCAllowed () const
 
bool in_no_gc_scope () const
 
bool IsMarking () const
 
size_t ExecutePreFinalizers ()
 
PageAllocatorpage_allocator () const
 
- Static Protected Member Functions inherited from cppgc::internal::HeapBase
static std::unique_ptr< PageBackendInitializePageBackend (PageAllocator &allocator)
 
- Protected Attributes inherited from cppgc::internal::HeapBase
int heap_thread_id_ = v8::base::OS::GetCurrentThreadId()
 
RawHeap raw_heap_
 
std::shared_ptr< cppgc::Platformplatform_
 
std::unique_ptr< FatalOutOfMemoryHandleroom_handler_
 
std::unique_ptr< PageBackendpage_backend_
 
HeapRegistry::Subscription heap_registry_subscription_ {*this}
 
std::unique_ptr< StatsCollectorstats_collector_
 
std::unique_ptr< heap::base::Stackstack_
 
std::unique_ptr< PreFinalizerHandlerprefinalizer_handler_
 
std::unique_ptr< MarkerBasemarker_
 
Compactor compactor_
 
ObjectAllocator object_allocator_
 
Sweeper sweeper_
 
PersistentRegion strong_persistent_region_
 
PersistentRegion weak_persistent_region_
 
CrossThreadPersistentRegion strong_cross_thread_persistent_region_
 
CrossThreadPersistentRegion weak_cross_thread_persistent_region_
 
ProcessHeapStatisticsUpdater::AllocationObserverImpl allocation_observer_for_PROCESS_HEAP_STATISTICS_
 
size_t no_gc_scope_ = 0
 
size_t disallow_gc_scope_ = 0
 
const StackSupport stack_support_
 
EmbedderStackState stack_state_of_prev_gc_
 
bool in_atomic_pause_ = false
 
MarkingType marking_support_
 
SweepingType sweeping_support_
 
HeapObjectNameForUnnamedObject name_for_unnamed_object_
 
std::vector< MoveListener * > move_listeners_
 

Detailed Description

Definition at line 21 of file heap.h.

Constructor & Destructor Documentation

◆ Heap()

cppgc::internal::Heap::Heap ( std::shared_ptr< cppgc::Platform > platform,
cppgc::Heap::HeapOptions options )

Definition at line 75 of file heap.cc.

Here is the call graph for this function:

◆ ~Heap()

cppgc::internal::Heap::~Heap ( )
finalvirtual

Reimplemented from cppgc::Heap.

Definition at line 92 of file heap.cc.

Here is the call graph for this function:

Member Function Documentation

◆ AsBase() [1/2]

HeapBase & cppgc::internal::Heap::AsBase ( )
inline

Definition at line 34 of file heap.h.

Here is the caller graph for this function:

◆ AsBase() [2/2]

const HeapBase & cppgc::internal::Heap::AsBase ( ) const
inline

Definition at line 35 of file heap.h.

◆ clear_overridden_stack_state()

void cppgc::internal::Heap::clear_overridden_stack_state ( )
inlinefinalvirtual

Implements cppgc::internal::HeapBase.

Definition at line 50 of file heap.h.

◆ CollectGarbage()

void cppgc::internal::Heap::CollectGarbage ( GCConfig config)
finalvirtual

Implements cppgc::internal::GarbageCollector.

Definition at line 104 of file heap.cc.

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

◆ DisableHeapGrowingForTesting()

void cppgc::internal::Heap::DisableHeapGrowingForTesting ( )

Definition at line 230 of file heap.cc.

Here is the call graph for this function:

◆ EnableGenerationalGC()

void cppgc::internal::Heap::EnableGenerationalGC ( )

Definition at line 224 of file heap.cc.

Here is the call graph for this function:

◆ epoch()

size_t cppgc::internal::Heap::epoch ( ) const
inlinefinalvirtual

Implements cppgc::internal::GarbageCollector.

Definition at line 41 of file heap.h.

◆ FinalizeGarbageCollection()

void cppgc::internal::Heap::FinalizeGarbageCollection ( StackState stack_state)
private

Definition at line 170 of file heap.cc.

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

◆ FinalizeGarbageCollectionImpl()

void cppgc::internal::Heap::FinalizeGarbageCollectionImpl ( StackState stack_state)
private

Definition at line 175 of file heap.cc.

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

◆ FinalizeIncrementalGarbageCollectionForTesting()

void cppgc::internal::Heap::FinalizeIncrementalGarbageCollectionForTesting ( EmbedderStackState stack_state)
finalprivatevirtual

Implements cppgc::internal::HeapBase.

Definition at line 247 of file heap.cc.

Here is the call graph for this function:

◆ FinalizeIncrementalGarbageCollectionIfNeeded()

void cppgc::internal::Heap::FinalizeIncrementalGarbageCollectionIfNeeded ( StackState stack_state)
finalprivatevirtual

Implements cppgc::internal::HeapBase.

Definition at line 232 of file heap.cc.

Here is the call graph for this function:

◆ FinalizeIncrementalGarbageCollectionIfRunning()

void cppgc::internal::Heap::FinalizeIncrementalGarbageCollectionIfRunning ( GCConfig config)

Definition at line 133 of file heap.cc.

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

◆ From() [1/2]

static const Heap * cppgc::internal::Heap::From ( const cppgc::Heap * heap)
inlinestatic

Definition at line 26 of file heap.h.

◆ From() [2/2]

static Heap * cppgc::internal::Heap::From ( cppgc::Heap * heap)
inlinestatic

Definition at line 25 of file heap.h.

Here is the caller graph for this function:

◆ overridden_stack_state()

std::optional< EmbedderStackState > cppgc::internal::Heap::overridden_stack_state ( ) const
inlinefinalvirtual

Implements cppgc::internal::GarbageCollector.

Definition at line 43 of file heap.h.

◆ set_override_stack_state()

void cppgc::internal::Heap::set_override_stack_state ( EmbedderStackState state)
inlinefinalvirtual

Implements cppgc::internal::HeapBase.

Definition at line 46 of file heap.h.

◆ StartGarbageCollection()

void cppgc::internal::Heap::StartGarbageCollection ( GCConfig config)
private

Definition at line 145 of file heap.cc.

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

◆ StartIncrementalGarbageCollection()

void cppgc::internal::Heap::StartIncrementalGarbageCollection ( GCConfig config)
finalvirtual

Implements cppgc::internal::GarbageCollector.

Definition at line 121 of file heap.cc.

Here is the call graph for this function:

◆ StartIncrementalGarbageCollectionForTesting()

void cppgc::internal::Heap::StartIncrementalGarbageCollectionForTesting ( )
finalprivatevirtual

Implements cppgc::internal::HeapBase.

Definition at line 239 of file heap.cc.

Here is the call graph for this function:

Member Data Documentation

◆ config_

GCConfig cppgc::internal::Heap::config_
private

Definition at line 70 of file heap.h.

◆ epoch_

size_t cppgc::internal::Heap::epoch_ = 0
private

Definition at line 75 of file heap.h.

◆ gc_invoker_

GCInvoker cppgc::internal::Heap::gc_invoker_
private

Definition at line 71 of file heap.h.

◆ generational_gc_enabled_

bool cppgc::internal::Heap::generational_gc_enabled_ = false
private

Definition at line 73 of file heap.h.

◆ growing_

HeapGrowing cppgc::internal::Heap::growing_
private

Definition at line 72 of file heap.h.

◆ override_stack_state_

std::optional<cppgc::EmbedderStackState> cppgc::internal::Heap::override_stack_state_
private

Definition at line 77 of file heap.h.


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