v8  5.8.282(node8.0.0)
V8 is Google's open source JavaScript engine
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 * > > &internal_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 6256 of file v8.h.

Member Enumeration Documentation

Enumerator
FORCE_COMPLETION 
DO_NOT_FORCE_COMPLETION 

Definition at line 6258 of file v8.h.

Constructor & Destructor Documentation

virtual ~EmbedderHeapTracer ( )
protectedvirtualdefault

Member Function Documentation

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.

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.

virtual void EnterFinalPause ( )
pure virtual

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

virtual size_t NumberOfWrappersToTrace ( )
inlinevirtual

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

Definition at line 6318 of file v8.h.

virtual void RegisterV8References ( const std::vector< std::pair< void *, void * > > &  internal_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|.

virtual void TraceEpilogue ( )
pure virtual

Called at the end of a GC cycle.

Note that allocation is not allowed within |TraceEpilogue|.

virtual void TracePrologue ( )
pure virtual

Called at the beginning of a GC cycle.


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