V8 Project
v8::internal::AllocationTraceTree Class Reference

#include <allocation-tracker.h>

+ Collaboration diagram for v8::internal::AllocationTraceTree:

Public Member Functions

 AllocationTraceTree ()
 
 ~AllocationTraceTree ()
 
AllocationTraceNodeAddPathFromEnd (const Vector< unsigned > &path)
 
AllocationTraceNoderoot ()
 
unsigned next_node_id ()
 
void Print (AllocationTracker *tracker)
 

Private Member Functions

 DISALLOW_COPY_AND_ASSIGN (AllocationTraceTree)
 

Private Attributes

unsigned next_node_id_
 
AllocationTraceNode root_
 

Detailed Description

Definition at line 46 of file allocation-tracker.h.

Constructor & Destructor Documentation

◆ AllocationTraceTree()

v8::internal::AllocationTraceTree::AllocationTraceTree ( )

Definition at line 73 of file allocation-tracker.cc.

74  : next_node_id_(1),
75  root_(this, 0) {
76 }

◆ ~AllocationTraceTree()

v8::internal::AllocationTraceTree::~AllocationTraceTree ( )

Definition at line 79 of file allocation-tracker.cc.

79  {
80 }

Member Function Documentation

◆ AddPathFromEnd()

AllocationTraceNode * v8::internal::AllocationTraceTree::AddPathFromEnd ( const Vector< unsigned > &  path)

Definition at line 83 of file allocation-tracker.cc.

84  {
85  AllocationTraceNode* node = root();
86  for (unsigned* entry = path.start() + path.length() - 1;
87  entry != path.start() - 1;
88  --entry) {
89  node = node->FindOrAddChild(*entry);
90  }
91  return node;
92 }
T * start() const
Definition: vector.h:47
int length() const
Definition: vector.h:41

References v8::internal::AllocationTraceNode::FindOrAddChild(), v8::internal::Vector< T >::length(), root(), and v8::internal::Vector< T >::start().

Referenced by v8::internal::AllocationTracker::AllocationEvent().

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

◆ DISALLOW_COPY_AND_ASSIGN()

v8::internal::AllocationTraceTree::DISALLOW_COPY_AND_ASSIGN ( AllocationTraceTree  )
private

◆ next_node_id()

unsigned v8::internal::AllocationTraceTree::next_node_id ( )
inline

Definition at line 52 of file allocation-tracker.h.

52 { return next_node_id_++; }

References next_node_id_.

◆ Print()

void v8::internal::AllocationTraceTree::Print ( AllocationTracker tracker)

Definition at line 95 of file allocation-tracker.cc.

95  {
96  base::OS::Print("[AllocationTraceTree:]\n");
97  base::OS::Print("Total size | Allocation count | Function id | id\n");
98  root()->Print(0, tracker);
99 }
static void Print(const char *format,...)
void Print(int indent, AllocationTracker *tracker)

References v8::base::OS::Print(), v8::internal::AllocationTraceNode::Print(), and root().

+ Here is the call graph for this function:

◆ root()

AllocationTraceNode* v8::internal::AllocationTraceTree::root ( )
inline

Definition at line 51 of file allocation-tracker.h.

51 { return &root_; }

References root_.

Referenced by AddPathFromEnd(), Print(), and v8::internal::HeapSnapshotJSONSerializer::SerializeTraceTree().

+ Here is the caller graph for this function:

Member Data Documentation

◆ next_node_id_

unsigned v8::internal::AllocationTraceTree::next_node_id_
private

Definition at line 56 of file allocation-tracker.h.

Referenced by next_node_id().

◆ root_

AllocationTraceNode v8::internal::AllocationTraceTree::root_
private

Definition at line 57 of file allocation-tracker.h.

Referenced by root().


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