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

#include <v8-cppgc.h>

Inheritance diagram for v8::CppHeap:
Collaboration diagram for v8::CppHeap:

Public Member Functions

virtual ~CppHeap ()=default
 
cppgc::AllocationHandleGetAllocationHandle ()
 
cppgc::HeapHandleGetHeapHandle ()
 
void Terminate ()
 
cppgc::HeapStatistics CollectStatistics (cppgc::HeapStatistics::DetailLevel detail_level)
 
void CollectCustomSpaceStatisticsAtLastGC (std::vector< cppgc::CustomSpaceIndex > custom_spaces, std::unique_ptr< CustomSpaceStatisticsReceiver > receiver)
 
void EnableDetachedGarbageCollectionsForTesting ()
 
void CollectGarbageForTesting (cppgc::EmbedderStackState stack_state)
 
void CollectGarbageInYoungGenerationForTesting (cppgc::EmbedderStackState stack_state)
 

Static Public Member Functions

static std::unique_ptr< CppHeapCreate (v8::Platform *platform, const CppHeapCreateParams &params)
 

Private Member Functions

 CppHeap ()=default
 

Friends

class internal::CppHeap
 

Detailed Description

A heap for allocating managed C++ objects.

Similar to v8::Isolate, the heap may only be accessed from one thread at a time. The heap may be used from different threads using the v8::Locker/v8::Unlocker APIs which is different from generic Oilpan.

Definition at line 65 of file v8-cppgc.h.

Constructor & Destructor Documentation

◆ ~CppHeap()

virtual v8::CppHeap::~CppHeap ( )
virtualdefault

Reimplemented in v8::internal::CppHeap.

◆ CppHeap()

v8::CppHeap::CppHeap ( )
privatedefault

Member Function Documentation

◆ CollectCustomSpaceStatisticsAtLastGC()

void v8::CppHeap::CollectCustomSpaceStatisticsAtLastGC ( std::vector< cppgc::CustomSpaceIndex > custom_spaces,
std::unique_ptr< CustomSpaceStatisticsReceiver > receiver )

Collects statistics for the given spaces and reports them to the receiver.

Parameters
custom_spacesa collection of custom space indices.
receiveran object that gets the results.

Definition at line 126 of file cpp-heap.cc.

Here is the call graph for this function:

◆ CollectGarbageForTesting()

void v8::CppHeap::CollectGarbageForTesting ( cppgc::EmbedderStackState stack_state)

Performs a stop-the-world garbage collection for testing purposes.

Parameters
stack_stateThe stack state to assume for the garbage collection.

Definition at line 138 of file cpp-heap.cc.

Here is the call graph for this function:

◆ CollectGarbageInYoungGenerationForTesting()

void v8::CppHeap::CollectGarbageInYoungGenerationForTesting ( cppgc::EmbedderStackState stack_state)

Performs a stop-the-world minor garbage collection for testing purposes.

Parameters
stack_stateThe stack state to assume for the garbage collection.

Definition at line 143 of file cpp-heap.cc.

Here is the call graph for this function:

◆ CollectStatistics()

cppgc::HeapStatistics v8::CppHeap::CollectStatistics ( cppgc::HeapStatistics::DetailLevel detail_level)
Parameters
detail_levelspecifies whether should return detailed statistics or only brief summary statistics.
Returns
current CppHeap statistics regarding memory consumption and utilization.

Definition at line 120 of file cpp-heap.cc.

Here is the call graph for this function:

◆ Create()

std::unique_ptr< CppHeap > v8::CppHeap::Create ( v8::Platform * platform,
const CppHeapCreateParams & params )
static

Definition at line 103 of file cpp-heap.cc.

Here is the caller graph for this function:

◆ EnableDetachedGarbageCollectionsForTesting()

void v8::CppHeap::EnableDetachedGarbageCollectionsForTesting ( )

Enables a detached mode that allows testing garbage collection using cppgc::testing APIs. Once used, the heap cannot be attached to an Isolate anymore.

Definition at line 133 of file cpp-heap.cc.

Here is the call graph for this function:

◆ GetAllocationHandle()

cppgc::AllocationHandle & v8::CppHeap::GetAllocationHandle ( )
Returns
the opaque handle for allocating objects using MakeGarbageCollected().

Definition at line 110 of file cpp-heap.cc.

Here is the call graph for this function:

◆ GetHeapHandle()

cppgc::HeapHandle & v8::CppHeap::GetHeapHandle ( )
Returns
the opaque heap handle which may be used to refer to this heap in other APIs. Valid as long as the underlying CppHeap is alive.

Definition at line 114 of file cpp-heap.cc.

Here is the call graph for this function:

◆ Terminate()

void v8::CppHeap::Terminate ( )

Terminate clears all roots and performs multiple garbage collections to reclaim potentially newly created objects in destructors.

After this call, object allocation is prohibited.

Definition at line 118 of file cpp-heap.cc.

Here is the call graph for this function:

Friends And Related Symbol Documentation

◆ internal::CppHeap

friend class internal::CppHeap
friend

Definition at line 137 of file v8-cppgc.h.


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