v8
V8 is Google’s open source high-performance JavaScript and WebAssembly engine, written in C++.
Loading...
Searching...
No Matches
v8::internal::EmbedderGraphImpl Class Reference
Inheritance diagram for v8::internal::EmbedderGraphImpl:
Collaboration diagram for v8::internal::EmbedderGraphImpl:

Classes

struct  Edge
 
class  V8NodeImpl
 

Public Member Functions

NodeV8Node (const v8::Local< v8::Value > &value) final
 
NodeV8Node (const v8::Local< v8::Data > &data) final
 
NodeAddNode (std::unique_ptr< Node > node) final
 
void AddEdge (Node *from, Node *to, const char *name) final
 
void AddNativeSize (size_t size) final
 
size_t native_size () const
 
const std::vector< std::unique_ptr< Node > > & nodes ()
 
const std::vector< Edge > & edges ()
 
- Public Member Functions inherited from v8::EmbedderGraph
virtual ~EmbedderGraph ()=default
 

Private Attributes

std::vector< std::unique_ptr< Node > > nodes_
 
std::vector< Edgeedges_
 
size_t native_size_ = 0
 

Detailed Description

Definition at line 2969 of file heap-snapshot-generator.cc.

Member Function Documentation

◆ AddEdge()

void v8::internal::EmbedderGraphImpl::AddEdge ( Node * from,
Node * to,
const char * name )
inlinefinalvirtual

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.

If name is nullptr, the edge will have auto-increment indexes, otherwise it will be named accordingly.

Implements v8::EmbedderGraph.

Definition at line 3014 of file heap-snapshot-generator.cc.

◆ AddNativeSize()

void v8::internal::EmbedderGraphImpl::AddNativeSize ( size_t size)
inlinefinalvirtual

Adds a count of bytes that are not associated with any particular Node. An embedder may use this to represent the size of nodes which were omitted from this EmbedderGraph despite being retained by the graph, or other overhead costs. This number will contribute to the total size in a heap snapshot, without being represented in the object graph.

Reimplemented from v8::EmbedderGraph.

Definition at line 3018 of file heap-snapshot-generator.cc.

◆ AddNode()

Node * v8::internal::EmbedderGraphImpl::AddNode ( std::unique_ptr< Node > node)
inlinefinalvirtual

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.

Implements v8::EmbedderGraph.

Definition at line 3008 of file heap-snapshot-generator.cc.

Here is the caller graph for this function:

◆ edges()

const std::vector< Edge > & v8::internal::EmbedderGraphImpl::edges ( )
inline

Definition at line 3022 of file heap-snapshot-generator.cc.

◆ native_size()

size_t v8::internal::EmbedderGraphImpl::native_size ( ) const
inline

Definition at line 3019 of file heap-snapshot-generator.cc.

◆ nodes()

const std::vector< std::unique_ptr< Node > > & v8::internal::EmbedderGraphImpl::nodes ( )
inline

Definition at line 3021 of file heap-snapshot-generator.cc.

◆ V8Node() [1/2]

Node * v8::internal::EmbedderGraphImpl::V8Node ( const v8::Local< v8::Data > & value)
inlinefinalvirtual

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

For API compatibility, this default implementation just checks that the data is a v8::Value and forward it to the variant that takes v8::Value, which is currently required to be implemented. In the future we'll remove the v8::Value variant, and make this variant that takes v8::Data abstract instead. If the embedder subclasses v8::EmbedderGraph and also use v8::TracedReference<v8::Data>, they must override this variant.

Reimplemented from v8::EmbedderGraph.

Definition at line 3002 of file heap-snapshot-generator.cc.

Here is the call graph for this function:

◆ V8Node() [2/2]

Node * v8::internal::EmbedderGraphImpl::V8Node ( const v8::Local< v8::Value > & value)
inlinefinalvirtual

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

For now the variant that takes v8::Data is not marked as abstract for compatibility, but embedders who subclass EmbedderGraph are expected to implement it. Then in the implementation of the variant that takes v8::Value, they can simply forward the call to the one that takes v8::Local<v8::Data>.

Implements v8::EmbedderGraph.

Definition at line 2997 of file heap-snapshot-generator.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ edges_

std::vector<Edge> v8::internal::EmbedderGraphImpl::edges_
private

Definition at line 3026 of file heap-snapshot-generator.cc.

◆ native_size_

size_t v8::internal::EmbedderGraphImpl::native_size_ = 0
private

Definition at line 3027 of file heap-snapshot-generator.cc.

◆ nodes_

std::vector<std::unique_ptr<Node> > v8::internal::EmbedderGraphImpl::nodes_
private

Definition at line 3025 of file heap-snapshot-generator.cc.


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