V8 Project
v8::internal::ProfileTree Class Reference

#include <profile-generator.h>

+ Collaboration diagram for v8::internal::ProfileTree:

Public Member Functions

 ProfileTree ()
 
 ~ProfileTree ()
 
ProfileNodeAddPathFromEnd (const Vector< CodeEntry * > &path)
 
void AddPathFromStart (const Vector< CodeEntry * > &path)
 
ProfileNoderoot () const
 
unsigned next_node_id ()
 
void Print ()
 

Private Member Functions

template<typename Callback >
void TraverseDepthFirst (Callback *callback)
 
 DISALLOW_COPY_AND_ASSIGN (ProfileTree)
 

Private Attributes

CodeEntry root_entry_
 
unsigned next_node_id_
 
ProfileNoderoot_
 

Detailed Description

Definition at line 147 of file profile-generator.h.

Constructor & Destructor Documentation

◆ ProfileTree()

v8::internal::ProfileTree::ProfileTree ( )

Definition at line 232 of file profile-generator.cc.

233  : root_entry_(Logger::FUNCTION_TAG, "(root)"),
234  next_node_id_(1),
235  root_(new ProfileNode(this, &root_entry_)) {
236 }

◆ ~ProfileTree()

v8::internal::ProfileTree::~ProfileTree ( )

Definition at line 239 of file profile-generator.cc.

239  {
240  DeleteNodesCallback cb;
241  TraverseDepthFirst(&cb);
242 }
void TraverseDepthFirst(Callback *callback)

References TraverseDepthFirst().

+ Here is the call graph for this function:

Member Function Documentation

◆ AddPathFromEnd()

ProfileNode * v8::internal::ProfileTree::AddPathFromEnd ( const Vector< CodeEntry * > &  path)

Definition at line 245 of file profile-generator.cc.

245  {
246  ProfileNode* node = root_;
247  for (CodeEntry** entry = path.start() + path.length() - 1;
248  entry != path.start() - 1;
249  --entry) {
250  if (*entry != NULL) {
251  node = node->FindOrAddChild(*entry);
252  }
253  }
254  node->IncrementSelfTicks();
255  return node;
256 }
ProfileNode * FindOrAddChild(CodeEntry *entry)
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 NULL

References v8::internal::ProfileNode::FindOrAddChild(), v8::internal::ProfileNode::IncrementSelfTicks(), v8::internal::Vector< T >::length(), NULL, root_, and v8::internal::Vector< T >::start().

Referenced by v8::internal::CpuProfile::AddPath().

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

◆ AddPathFromStart()

void v8::internal::ProfileTree::AddPathFromStart ( const Vector< CodeEntry * > &  path)

Definition at line 259 of file profile-generator.cc.

259  {
260  ProfileNode* node = root_;
261  for (CodeEntry** entry = path.start();
262  entry != path.start() + path.length();
263  ++entry) {
264  if (*entry != NULL) {
265  node = node->FindOrAddChild(*entry);
266  }
267  }
268  node->IncrementSelfTicks();
269 }

References v8::internal::ProfileNode::FindOrAddChild(), v8::internal::ProfileNode::IncrementSelfTicks(), v8::internal::Vector< T >::length(), NULL, root_, and v8::internal::Vector< T >::start().

+ Here is the call graph for this function:

◆ DISALLOW_COPY_AND_ASSIGN()

v8::internal::ProfileTree::DISALLOW_COPY_AND_ASSIGN ( ProfileTree  )
private

◆ next_node_id()

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

Definition at line 155 of file profile-generator.h.

155 { return next_node_id_++; }

References next_node_id_.

◆ Print()

void v8::internal::ProfileTree::Print ( )
inline

Definition at line 157 of file profile-generator.h.

157  {
158  root_->Print(0);
159  }

References v8::internal::ProfileNode::Print(), and root_.

Referenced by v8::internal::CpuProfile::Print().

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

◆ root()

ProfileNode* v8::internal::ProfileTree::root ( ) const
inline

Definition at line 154 of file profile-generator.h.

154 { return root_; }

References root_.

Referenced by v8::CpuProfile::GetTopDownRoot().

+ Here is the caller graph for this function:

◆ TraverseDepthFirst()

template<typename Callback >
void v8::internal::ProfileTree::TraverseDepthFirst ( Callback *  callback)
private

Definition at line 300 of file profile-generator.cc.

300  {
301  List<Position> stack(10);
302  stack.Add(Position(root_));
303  while (stack.length() > 0) {
304  Position& current = stack.last();
305  if (current.has_current_child()) {
306  callback->BeforeTraversingChild(current.node, current.current_child());
307  stack.Add(Position(current.current_child()));
308  } else {
309  callback->AfterAllChildrenTraversed(current.node);
310  if (stack.length() > 1) {
311  Position& parent = stack[stack.length() - 2];
312  callback->AfterChildTraversed(parent.node, current.node);
313  parent.next_child();
314  }
315  // Remove child from the stack.
316  stack.RemoveLast();
317  }
318  }
319 }

References v8::internal::List< T, AllocationPolicy >::Add(), v8::internal::List< T, AllocationPolicy >::last(), v8::internal::Position::node, and root_.

Referenced by ~ProfileTree().

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

Member Data Documentation

◆ next_node_id_

unsigned v8::internal::ProfileTree::next_node_id_
private

Definition at line 166 of file profile-generator.h.

Referenced by next_node_id().

◆ root_

ProfileNode* v8::internal::ProfileTree::root_
private

◆ root_entry_

CodeEntry v8::internal::ProfileTree::root_entry_
private

Definition at line 165 of file profile-generator.h.


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