v8  9.4.146 (node 16.13.0)
V8 is Google's open source JavaScript engine
StandaloneTestingHeap Class Referencefinal

#include <testing.h>

Public Member Functions

 StandaloneTestingHeap (HeapHandle &)
 
void StartGarbageCollection ()
 
bool PerformMarkingStep (EmbedderStackState stack_state)
 
void FinalizeGarbageCollection (EmbedderStackState stack_state)
 
void ToggleMainThreadMarking (bool should_mark)
 
void ForceCompactionForNextGarbageCollection ()
 

Detailed Description

Testing interface for managed heaps that allows for controlling garbage collection timings. Embedders should use this class when testing the interaction of their code with incremental/concurrent garbage collection.

Definition at line 52 of file testing.h.

Constructor & Destructor Documentation

◆ StandaloneTestingHeap()

StandaloneTestingHeap ( HeapHandle &  )
explicit

Member Function Documentation

◆ FinalizeGarbageCollection()

void FinalizeGarbageCollection ( EmbedderStackState  stack_state)

Finalize the current garbage collection cycle atomically. Assumes that garbage collection is in progress.

Parameters
stack_stateThe state of the stack for finalizing the garbage collection cycle.

◆ ForceCompactionForNextGarbageCollection()

void ForceCompactionForNextGarbageCollection ( )

Force enable compaction for the next garbage collection cycle.

◆ PerformMarkingStep()

bool PerformMarkingStep ( EmbedderStackState  stack_state)

Perform an incremental step. This will also schedule concurrent steps if needed.

Parameters
stack_stateThe state of the stack during the step.

◆ StartGarbageCollection()

void StartGarbageCollection ( )

Start an incremental garbage collection.

◆ ToggleMainThreadMarking()

void ToggleMainThreadMarking ( bool  should_mark)

Toggle main thread marking on/off. Allows to stress concurrent marking (e.g. to better detect data races).

Parameters
should_markDenotes whether the main thread should contribute to marking. Defaults to true.

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