v8  6.8.275 (node 10.15.3)
V8 is Google's open source JavaScript engine
EmbedderHeapTracer Class Referenceabstract

#include <v8.h>

Data Structures

struct  AdvanceTracingActions

Public Types


Public Member Functions

virtual void RegisterV8References (const std::vector< std::pair< void *, void * > > &embedder_fields)=0
virtual void TracePrologue ()=0
virtual bool AdvanceTracing (double deadline_in_ms, AdvanceTracingActions actions)=0
virtual void TraceEpilogue ()=0
virtual void EnterFinalPause ()=0
virtual void AbortTracing ()=0
virtual size_t NumberOfWrappersToTrace ()

Protected Member Functions

virtual ~EmbedderHeapTracer ()=default

Detailed Description

Interface for tracing through the embedder heap. During a v8 garbage collection, v8 collects hidden fields of all potential wrappers, and at the end of its marking phase iterates the collection and asks the embedder to trace through its heap and use reporter to report each JavaScript object reachable from any of the given wrappers.

Before the first call to the TraceWrappersFrom function TracePrologue will be called. When the garbage collection cycle is finished, TraceEpilogue will be called.

Definition at line 6909 of file v8.h.

Member Enumeration Documentation

◆ ForceCompletionAction


Definition at line 6911 of file v8.h.

Constructor & Destructor Documentation

◆ ~EmbedderHeapTracer()

virtual ~EmbedderHeapTracer ( )

Member Function Documentation

◆ AbortTracing()

virtual void AbortTracing ( )
pure virtual

Called when tracing is aborted.

The embedder is expected to throw away all intermediate data and reset to the initial state.

◆ AdvanceTracing()

virtual bool AdvanceTracing ( double  deadline_in_ms,
AdvanceTracingActions  actions 
pure virtual

Called to to make a tracing step in the embedder.

The embedder is expected to trace its heap starting from wrappers reported by RegisterV8References method, and report back all reachable wrappers. Furthermore, the embedder is expected to stop tracing by the given deadline.

Returns true if there is still work to do.

◆ EnterFinalPause()

virtual void EnterFinalPause ( )
pure virtual

Called upon entering the final marking pause. No more incremental marking steps will follow this call.

◆ NumberOfWrappersToTrace()

virtual size_t NumberOfWrappersToTrace ( )

Returns the number of wrappers that are still to be traced by the embedder.

Definition at line 6971 of file v8.h.

◆ RegisterV8References()

virtual void RegisterV8References ( const std::vector< std::pair< void *, void * > > &  embedder_fields)
pure virtual

Called by v8 to register internal fields of found wrappers.

The embedder is expected to store them somewhere and trace reachable wrappers from them when called through |AdvanceTracing|.

◆ TraceEpilogue()

virtual void TraceEpilogue ( )
pure virtual

Called at the end of a GC cycle.

Note that allocation is not allowed within |TraceEpilogue|.

◆ TracePrologue()

virtual void TracePrologue ( )
pure virtual

Called at the beginning of a GC cycle.

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