V8 API Reference Guide for node.js v9.9.0
Classes | Public Types | Public Member Functions | List of all members
v8::EmbedderHeapTracer Class Referenceabstract

#include <v8.h>

Classes

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 void TraceEpilogue ()=0
 
virtual void EnterFinalPause ()=0
 
virtual void AbortTracing ()=0
 
virtual size_t NumberOfWrappersToTrace ()
 

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

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.

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.

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

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

virtual size_t v8::EmbedderHeapTracer::NumberOfWrappersToTrace ( )
inlinevirtual

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

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|.

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

Called at the end of a GC cycle.

Note that allocation is not allowed within |TraceEpilogue|.

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

Called at the beginning of a GC cycle.


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