OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef V8_PROFILE_GENERATOR_H_ | 5 #ifndef V8_PROFILE_GENERATOR_H_ |
6 #define V8_PROFILE_GENERATOR_H_ | 6 #define V8_PROFILE_GENERATOR_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include "include/v8-profiler.h" | 9 #include "include/v8-profiler.h" |
10 #include "src/allocation.h" | 10 #include "src/allocation.h" |
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
191 | 191 |
192 | 192 |
193 class ProfileTree { | 193 class ProfileTree { |
194 public: | 194 public: |
195 ProfileTree(); | 195 ProfileTree(); |
196 ~ProfileTree(); | 196 ~ProfileTree(); |
197 | 197 |
198 ProfileNode* AddPathFromEnd( | 198 ProfileNode* AddPathFromEnd( |
199 const Vector<CodeEntry*>& path, | 199 const Vector<CodeEntry*>& path, |
200 int src_line = v8::CpuProfileNode::kNoLineNumberInfo); | 200 int src_line = v8::CpuProfileNode::kNoLineNumberInfo); |
201 void AddPathFromStart(const Vector<CodeEntry*>& path, | |
202 int src_line = v8::CpuProfileNode::kNoLineNumberInfo); | |
203 ProfileNode* root() const { return root_; } | 201 ProfileNode* root() const { return root_; } |
204 unsigned next_node_id() { return next_node_id_++; } | 202 unsigned next_node_id() { return next_node_id_++; } |
205 | 203 |
206 void Print() { | 204 void Print() { |
207 root_->Print(0); | 205 root_->Print(0); |
208 } | 206 } |
209 | 207 |
210 private: | 208 private: |
211 template <typename Callback> | 209 template <typename Callback> |
212 void TraverseDepthFirst(Callback* callback); | 210 void TraverseDepthFirst(Callback* callback); |
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
379 CodeEntry* gc_entry_; | 377 CodeEntry* gc_entry_; |
380 CodeEntry* unresolved_entry_; | 378 CodeEntry* unresolved_entry_; |
381 | 379 |
382 DISALLOW_COPY_AND_ASSIGN(ProfileGenerator); | 380 DISALLOW_COPY_AND_ASSIGN(ProfileGenerator); |
383 }; | 381 }; |
384 | 382 |
385 | 383 |
386 } } // namespace v8::internal | 384 } } // namespace v8::internal |
387 | 385 |
388 #endif // V8_PROFILE_GENERATOR_H_ | 386 #endif // V8_PROFILE_GENERATOR_H_ |
OLD | NEW |