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_PROFILER_PROFILE_GENERATOR_H_ | 5 #ifndef V8_PROFILER_PROFILE_GENERATOR_H_ |
6 #define V8_PROFILER_PROFILE_GENERATOR_H_ | 6 #define V8_PROFILER_PROFILE_GENERATOR_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include "src/allocation.h" | 9 #include "src/allocation.h" |
10 #include "src/base/hashmap.h" | 10 #include "src/base/hashmap.h" |
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
214 | 214 |
215 private: | 215 private: |
216 static uint32_t CodeEntryHash(CodeEntry* entry) { return entry->GetHash(); } | 216 static uint32_t CodeEntryHash(CodeEntry* entry) { return entry->GetHash(); } |
217 | 217 |
218 static bool LineTickMatch(void* a, void* b) { return a == b; } | 218 static bool LineTickMatch(void* a, void* b) { return a == b; } |
219 | 219 |
220 ProfileTree* tree_; | 220 ProfileTree* tree_; |
221 CodeEntry* entry_; | 221 CodeEntry* entry_; |
222 unsigned self_ticks_; | 222 unsigned self_ticks_; |
223 // Mapping from CodeEntry* to ProfileNode* | 223 // Mapping from CodeEntry* to ProfileNode* |
224 base::HashMap children_; | 224 base::CustomMatcherHashMap children_; |
225 List<ProfileNode*> children_list_; | 225 List<ProfileNode*> children_list_; |
226 unsigned id_; | 226 unsigned id_; |
227 base::HashMap line_ticks_; | 227 base::CustomMatcherHashMap line_ticks_; |
228 | 228 |
229 std::vector<CpuProfileDeoptInfo> deopt_infos_; | 229 std::vector<CpuProfileDeoptInfo> deopt_infos_; |
230 | 230 |
231 DISALLOW_COPY_AND_ASSIGN(ProfileNode); | 231 DISALLOW_COPY_AND_ASSIGN(ProfileNode); |
232 }; | 232 }; |
233 | 233 |
234 | 234 |
235 class ProfileTree { | 235 class ProfileTree { |
236 public: | 236 public: |
237 explicit ProfileTree(Isolate* isolate); | 237 explicit ProfileTree(Isolate* isolate); |
(...skipping 16 matching lines...) Expand all Loading... |
254 private: | 254 private: |
255 template <typename Callback> | 255 template <typename Callback> |
256 void TraverseDepthFirst(Callback* callback); | 256 void TraverseDepthFirst(Callback* callback); |
257 | 257 |
258 CodeEntry root_entry_; | 258 CodeEntry root_entry_; |
259 unsigned next_node_id_; | 259 unsigned next_node_id_; |
260 ProfileNode* root_; | 260 ProfileNode* root_; |
261 Isolate* isolate_; | 261 Isolate* isolate_; |
262 | 262 |
263 unsigned next_function_id_; | 263 unsigned next_function_id_; |
264 base::HashMap function_ids_; | 264 base::CustomMatcherHashMap function_ids_; |
265 | 265 |
266 DISALLOW_COPY_AND_ASSIGN(ProfileTree); | 266 DISALLOW_COPY_AND_ASSIGN(ProfileTree); |
267 }; | 267 }; |
268 | 268 |
269 | 269 |
270 class CpuProfile { | 270 class CpuProfile { |
271 public: | 271 public: |
272 CpuProfile(CpuProfiler* profiler, const char* title, bool record_samples); | 272 CpuProfile(CpuProfiler* profiler, const char* title, bool record_samples); |
273 | 273 |
274 // Add pc -> ... -> main() call path to the profile. | 274 // Add pc -> ... -> main() call path to the profile. |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
379 CodeMap code_map_; | 379 CodeMap code_map_; |
380 | 380 |
381 DISALLOW_COPY_AND_ASSIGN(ProfileGenerator); | 381 DISALLOW_COPY_AND_ASSIGN(ProfileGenerator); |
382 }; | 382 }; |
383 | 383 |
384 | 384 |
385 } // namespace internal | 385 } // namespace internal |
386 } // namespace v8 | 386 } // namespace v8 |
387 | 387 |
388 #endif // V8_PROFILER_PROFILE_GENERATOR_H_ | 388 #endif // V8_PROFILER_PROFILE_GENERATOR_H_ |
OLD | NEW |