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

#include <v8.h>

Public Member Functions

virtual void TraceRoots (Isolate *isolate)=0
 
virtual void TraceWrappableFrom (Isolate *isolate, const std::vector< std::pair< void *, void * > > &internal_fields)=0
 
virtual void ClearTracingMarks (Isolate *isolate)=0
 

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 call PersistentBase::RegisterExternalReference on each js object reachable from any of the given wrappers.

Before the first call to the TraceWrappableFrom function v8 will call TraceRoots. When the v8 garbage collection is finished, v8 will call ClearTracingMarks.

Definition at line 5385 of file v8.h.

Constructor & Destructor Documentation

◆ ~EmbedderHeapTracer()

virtual ~EmbedderHeapTracer ( )
protectedvirtualdefault

Member Function Documentation

◆ ClearTracingMarks()

virtual void ClearTracingMarks ( Isolate isolate)
pure virtual

V8 will call this method at the end of the gc cycle. Allocation is not allowed in the ClearTracingMarks.

◆ TraceRoots()

virtual void TraceRoots ( Isolate isolate)
pure virtual

V8 will call this method at the beginning of the gc cycle.

◆ TraceWrappableFrom()

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

V8 will call this method with internal fields of a potential wrappers. Embedder is expected to trace its heap (synchronously) and call PersistentBase::RegisterExternalReference() on all wrappers reachable from any of the given wrappers.


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