v8  5.5.372(node7.10.1)
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 * > > &internal_fields)=0
virtual void TracePrologue ()
virtual void TracePrologue (EmbedderReachableReferenceReporter *reporter)
virtual bool AdvanceTracing (double deadline_in_ms, AdvanceTracingActions actions)=0
virtual void TraceEpilogue ()=0
virtual void EnterFinalPause ()
virtual void AbortTracing ()
virtual size_t NumberOfWrappersToTrace ()

Protected Member Functions

virtual ~EmbedderHeapTracer ()=default

Detailed Description

Interface for tracing through the embedder heap. During the 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 js 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 6158 of file v8.h.

Member Enumeration Documentation


Definition at line 6160 of file v8.h.

Constructor & Destructor Documentation

virtual ~EmbedderHeapTracer ( )

Member Function Documentation

virtual void AbortTracing ( )

Throw away all intermediate data and reset to the initial state.

Definition at line 6216 of file v8.h.

virtual bool AdvanceTracing ( double  deadline_in_ms,
AdvanceTracingActions  actions 
pure virtual

Embedder is expected to trace its heap starting from wrappers reported by RegisterV8References method, and use reporter for all reachable wrappers. Embedder is expected to stop tracing by the given deadline.

Returns true if there is still work to do.

virtual void EnterFinalPause ( )

Let embedder know v8 entered final marking pause (no more incremental steps will follow).

Definition at line 6211 of file v8.h.

virtual size_t NumberOfWrappersToTrace ( )

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

Definition at line 6221 of file v8.h.

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

V8 will call this method with internal fields of found wrappers. The embedder is expected to store them in its marking deque and trace reachable wrappers from them when called through |AdvanceTracing|.

virtual void TraceEpilogue ( )
pure virtual

V8 will call this method at the end of a GC cycle.

Note that allocation is not allowed within |TraceEpilogue|.

virtual void TracePrologue ( )

Deprecated. TODO(hlopko) Remove once the migration to reporter is finished.

Definition at line 6181 of file v8.h.

virtual void TracePrologue ( EmbedderReachableReferenceReporter reporter)

V8 will call this method at the beginning of a GC cycle. Embedder is expected to use EmbedderReachableReferenceReporter for reporting all reachable v8 objects.

Definition at line 6188 of file v8.h.

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