V8 API Reference Guide generated from the header files
Data Structures | Public Types | Public Member Functions | Protected Attributes | Friends
v8::EmbedderHeapTracer Class Referenceabstract

#include <v8.h>

Data Structures

struct  AdvanceTracingActions
 

Public Types

enum  ForceCompletionAction { FORCE_COMPLETION, DO_NOT_FORCE_COMPLETION }
 

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 bool IsTracingDone ()
 
virtual void TraceEpilogue ()=0
 
virtual void EnterFinalPause ()=0
 
virtual void AbortTracing ()=0
 
void FinalizeTracing ()
 
v8::Isolateisolate () const
 
 V8_DEPRECATE_SOON ("Use IsTracingDone", virtual size_t NumberOfWrappersToTrace() { return 0;})
 

Protected Attributes

v8::Isolateisolate_ = nullptr
 

Friends

class internal::LocalEmbedderHeapTracer
 

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.

Member Function Documentation

◆ AbortTracing()

virtual void v8::EmbedderHeapTracer::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 v8::EmbedderHeapTracer::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 v8::EmbedderHeapTracer::EnterFinalPause ( )
pure virtual

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

◆ RegisterV8References()

virtual void v8::EmbedderHeapTracer::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 v8::EmbedderHeapTracer::TraceEpilogue ( )
pure virtual

Called at the end of a GC cycle.

Note that allocation is not allowed within |TraceEpilogue|.

◆ TracePrologue()

virtual void v8::EmbedderHeapTracer::TracePrologue ( )
pure virtual

Called at the beginning of a GC cycle.

◆ V8_DEPRECATE_SOON()

v8::EmbedderHeapTracer::V8_DEPRECATE_SOON ( "Use IsTracingDone"  ,
virtual size_t NumberOfWrappersToTrace() { return 0;}   
)

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


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