V8 API Reference Guide generated from the header files
Data Structures | Public Member Functions
v8::EmbedderGraph Class Referenceabstract

#include <v8-profiler.h>

Data Structures

class  Node
 

Public Member Functions

virtual NodeV8Node (const v8::Local< v8::Value > &value)=0
 
virtual NodeAddNode (std::unique_ptr< Node > node)=0
 
virtual void AddEdge (Node *from, Node *to)=0
 

Detailed Description

An object graph consisting of embedder objects and V8 objects. Edges of the graph are strong references between the objects. The embedder can build this graph during heap snapshot generation to include the embedder objects in the heap snapshot. Usage: 1) Define derived class of EmbedderGraph::Node for embedder objects. 2) Set the build embedder graph callback on the heap profiler using HeapProfiler::AddBuildEmbedderGraphCallback. 3) In the callback use graph->AddEdge(node1, node2) to add an edge from node1 to node2. 4) To represent references from/to V8 object, construct V8 nodes using graph->V8Node(value).

Member Function Documentation

◆ AddEdge()

virtual void v8::EmbedderGraph::AddEdge ( Node from,
Node to 
)
pure virtual

Adds an edge that represents a strong reference from the given node |from| to the given node |to|. The nodes must be added to the graph before calling this function.

◆ AddNode()

virtual Node* v8::EmbedderGraph::AddNode ( std::unique_ptr< Node node)
pure virtual

Adds the given node to the graph and takes ownership of the node. Returns a raw pointer to the node that is valid while the graph is alive.

◆ V8Node()

virtual Node* v8::EmbedderGraph::V8Node ( const v8::Local< v8::Value > &  value)
pure virtual

Returns a node corresponding to the given V8 value. Ownership is not transferred. The result pointer is valid while the graph is alive.


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