V8 Project
v8::HeapGraphNode Class Reference

HeapGraphNode represents a node in a heap graph. More...

#include <v8-profiler.h>

+ Collaboration diagram for v8::HeapGraphNode:

Public Types

enum  Type {
  kHidden = 0 , kArray = 1 , kString = 2 , kObject = 3 ,
  kCode = 4 , kClosure = 5 , kRegExp = 6 , kHeapNumber = 7 ,
  kNative = 8 , kSynthetic = 9 , kConsString = 10 , kSlicedString = 11 ,
  kSymbol = 12
}
 

Public Member Functions

Type GetType () const
 Returns node type (see HeapGraphNode::Type). More...
 
Handle< StringGetName () const
 Returns node name. More...
 
SnapshotObjectId GetId () const
 Returns node id. More...
 
 V8_DEPRECATED ("Use GetShallowSize instead", int GetSelfSize() const)
 Returns node's own size, in bytes. More...
 
size_t GetShallowSize () const
 Returns node's own size, in bytes. More...
 
int GetChildrenCount () const
 Returns child nodes count of the node. More...
 
const HeapGraphEdgeGetChild (int index) const
 Retrieves a child by index. More...
 

Detailed Description

HeapGraphNode represents a node in a heap graph.

Definition at line 219 of file v8-profiler.h.

Member Enumeration Documentation

◆ Type

Enumerator
kHidden 
kArray 
kString 
kObject 
kCode 
kClosure 
kRegExp 
kHeapNumber 
kNative 
kSynthetic 
kConsString 
kSlicedString 
kSymbol 

Definition at line 221 of file v8-profiler.h.

221  {
222  kHidden = 0, // Hidden node, may be filtered when shown to user.
223  kArray = 1, // An array of elements.
224  kString = 2, // A string.
225  kObject = 3, // A JS object (except for arrays and strings).
226  kCode = 4, // Compiled code.
227  kClosure = 5, // Function closure.
228  kRegExp = 6, // RegExp.
229  kHeapNumber = 7, // Number stored in the heap.
230  kNative = 8, // Native object (not from V8 heap).
231  kSynthetic = 9, // Synthetic object, usualy used for grouping
232  // snapshot items together.
233  kConsString = 10, // Concatenated string. A pair of pointers to strings.
234  kSlicedString = 11, // Sliced string. A fragment of another string.
235  kSymbol = 12 // A Symbol (ES6).
236  };

Member Function Documentation

◆ GetChild()

const HeapGraphEdge * v8::HeapGraphNode::GetChild ( int  index) const

Retrieves a child by index.

Definition at line 7297 of file api.cc.

7297  {
7298  return reinterpret_cast<const HeapGraphEdge*>(
7299  ToInternal(this)->children()[index]);
7300 }
static i::HeapGraphEdge * ToInternal(const HeapGraphEdge *edge)
Definition: api.cc:7213

References v8::ToInternal().

+ Here is the call graph for this function:

◆ GetChildrenCount()

int v8::HeapGraphNode::GetChildrenCount ( ) const

Returns child nodes count of the node.

Definition at line 7292 of file api.cc.

7292  {
7293  return ToInternal(this)->children().length();
7294 }

References v8::ToInternal().

+ Here is the call graph for this function:

◆ GetId()

SnapshotObjectId v8::HeapGraphNode::GetId ( ) const

Returns node id.

For the same heap object, the id remains the same across all snapshots.

Definition at line 7275 of file api.cc.

7275  {
7276  return ToInternal(this)->id();
7277 }

References v8::ToInternal().

+ Here is the call graph for this function:

◆ GetName()

Handle< String > v8::HeapGraphNode::GetName ( ) const

Returns node name.

Depending on node's type this can be the name of the constructor (for objects), the name of the function (for closures), string value, or an empty string (for compiled code).

Definition at line 7268 of file api.cc.

7268  {
7269  i::Isolate* isolate = i::Isolate::Current();
7270  return ToApiHandle<String>(
7271  isolate->factory()->InternalizeUtf8String(ToInternal(this)->name()));
7272 }
Factory * factory()
Definition: isolate.h:982
enable harmony numeric enable harmony object literal extensions Optimize object Array DOM strings and string trace pretenuring decisions of HAllocate instructions Enables optimizations which favor memory size over execution speed maximum source size in bytes considered for a single inlining maximum cumulative number of AST nodes considered for inlining trace the tracking of allocation sites deoptimize every n garbage collections perform array bounds checks elimination analyze liveness of environment slots and zap dead values flushes the cache of optimized code for closures on every GC allow uint32 values on optimize frames if they are used only in safe operations track concurrent recompilation artificial compilation delay in ms do not emit check maps for constant values that have a leaf deoptimize the optimized code if the layout of the maps changes enable context specialization in TurboFan execution budget before interrupt is triggered max percentage of megamorphic generic ICs to allow optimization enable use of SAHF instruction if enable use of VFP3 instructions if available enable use of NEON instructions if enable use of SDIV and UDIV instructions if enable use of MLS instructions if enable loading bit constant by means of movw movt instruction enable unaligned accesses for enable use of d16 d31 registers on ARM this requires VFP3 force all emitted branches to be in long enable alignment of csp to bytes on platforms which prefer the register to always be expose gc extension under the specified name show built in functions in stack traces use random jit cookie to mask large constants minimum length for automatic enable preparsing CPU profiler sampling interval in microseconds trace out of bounds accesses to external arrays default size of stack region v8 is allowed to maximum length of function source code printed in a stack trace min size of a semi the new space consists of two semi spaces print one trace line following each garbage collection do not print trace line after scavenger collection print cumulative GC statistics in name

References v8::internal::Isolate::factory(), name, and v8::ToInternal().

+ Here is the call graph for this function:

◆ GetShallowSize()

size_t v8::HeapGraphNode::GetShallowSize ( ) const

Returns node's own size, in bytes.

Definition at line 7287 of file api.cc.

7287  {
7288  return ToInternal(this)->self_size();
7289 }

References v8::ToInternal().

+ Here is the call graph for this function:

◆ GetType()

HeapGraphNode::Type v8::HeapGraphNode::GetType ( ) const

Returns node type (see HeapGraphNode::Type).

Definition at line 7263 of file api.cc.

7263  {
7264  return static_cast<HeapGraphNode::Type>(ToInternal(this)->type());
7265 }

References v8::ToInternal().

+ Here is the call graph for this function:

◆ V8_DEPRECATED()

v8::HeapGraphNode::V8_DEPRECATED ( "Use GetShallowSize instead"  ,
int GetSelfSize() const   
)

Returns node's own size, in bytes.


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