V8 Project
v8::HeapGraphEdge Class Reference

HeapSnapshotEdge represents a directed connection between heap graph nodes: from retainers to retained nodes. More...

#include <v8-profiler.h>

+ Collaboration diagram for v8::HeapGraphEdge:

Public Types

enum  Type {
  kContextVariable = 0 , kElement = 1 , kProperty = 2 , kInternal = 3 ,
  kHidden = 4 , kShortcut = 5 , kWeak = 6
}
 

Public Member Functions

Type GetType () const
 Returns edge type (see HeapGraphEdge::Type). More...
 
Handle< ValueGetName () const
 Returns edge name. More...
 
const HeapGraphNodeGetFromNode () const
 Returns origin node. More...
 
const HeapGraphNodeGetToNode () const
 Returns destination node. More...
 

Detailed Description

HeapSnapshotEdge represents a directed connection between heap graph nodes: from retainers to retained nodes.

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

Member Enumeration Documentation

◆ Type

Enumerator
kContextVariable 
kElement 
kProperty 
kInternal 
kHidden 
kShortcut 
kWeak 

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

185  {
186  kContextVariable = 0, // A variable from a function context.
187  kElement = 1, // An element of an array.
188  kProperty = 2, // A named object property.
189  kInternal = 3, // A link that can't be accessed from JS,
190  // thus, its name isn't a real property name
191  // (e.g. parts of a ConsString).
192  kHidden = 4, // A link that is needed for proper sizes
193  // calculation, but may be hidden from user.
194  kShortcut = 5, // A link that must not be followed during
195  // sizes calculation.
196  kWeak = 6 // A weak reference (ignored by the GC).
197  };

Member Function Documentation

◆ GetFromNode()

const HeapGraphNode * v8::HeapGraphEdge::GetFromNode ( ) const

Returns origin node.

Definition at line 7245 of file api.cc.

7245  {
7246  const i::HeapEntry* from = ToInternal(this)->from();
7247  return reinterpret_cast<const HeapGraphNode*>(from);
7248 }
static i::HeapGraphEdge * ToInternal(const HeapGraphEdge *edge)
Definition: api.cc:7213

References v8::ToInternal().

+ Here is the call graph for this function:

◆ GetName()

Handle< Value > v8::HeapGraphEdge::GetName ( ) const

Returns edge name.

This can be a variable name, an element index, or a property name.

Definition at line 7224 of file api.cc.

7224  {
7225  i::Isolate* isolate = i::Isolate::Current();
7226  i::HeapGraphEdge* edge = ToInternal(this);
7227  switch (edge->type()) {
7228  case i::HeapGraphEdge::kContextVariable:
7229  case i::HeapGraphEdge::kInternal:
7230  case i::HeapGraphEdge::kProperty:
7231  case i::HeapGraphEdge::kShortcut:
7233  return ToApiHandle<String>(
7234  isolate->factory()->InternalizeUtf8String(edge->name()));
7235  case i::HeapGraphEdge::kElement:
7236  case i::HeapGraphEdge::kHidden:
7237  return ToApiHandle<Number>(
7238  isolate->factory()->NewNumberFromInt(edge->index()));
7239  default: UNREACHABLE();
7240  }
7241  return v8::Undefined(reinterpret_cast<v8::Isolate*>(isolate));
7242 }
Isolate represents an isolated instance of the V8 engine.
Definition: v8.h:4356
Factory * factory()
Definition: isolate.h:982
#define UNREACHABLE()
Definition: logging.h:30
@ kWeak
Definition: v8-util.h:25
Handle< Primitive > Undefined(Isolate *isolate)
Definition: v8.h:6836

References v8::internal::Isolate::factory(), v8::kWeak, v8::ToInternal(), v8::Undefined(), and UNREACHABLE.

+ Here is the call graph for this function:

◆ GetToNode()

const HeapGraphNode * v8::HeapGraphEdge::GetToNode ( ) const

Returns destination node.

Definition at line 7251 of file api.cc.

7251  {
7252  const i::HeapEntry* to = ToInternal(this)->to();
7253  return reinterpret_cast<const HeapGraphNode*>(to);
7254 }
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 only print modified registers Trace simulator debug messages Implied by trace sim abort randomize hashes to avoid predictable hash Fixed seed to use to hash property Print the time it takes to deserialize the snapshot A filename with extra code to be included in the A file to write the raw snapshot bytes to(mksnapshot only)") DEFINE_STRING(raw_context_file

References to(), and v8::ToInternal().

+ Here is the call graph for this function:

◆ GetType()

HeapGraphEdge::Type v8::HeapGraphEdge::GetType ( ) const

Returns edge type (see HeapGraphEdge::Type).

Definition at line 7219 of file api.cc.

7219  {
7220  return static_cast<HeapGraphEdge::Type>(ToInternal(this)->type());
7221 }

References v8::ToInternal().

+ Here is the call graph for this function:

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