| 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 "include/v8-profiler.h" | 9 #include "include/v8-profiler.h" |
| 10 #include "src/allocation.h" | 10 #include "src/allocation.h" |
| 11 #include "src/base/hashmap.h" |
| 11 #include "src/compiler.h" | 12 #include "src/compiler.h" |
| 12 #include "src/hashmap.h" | |
| 13 #include "src/profiler/strings-storage.h" | 13 #include "src/profiler/strings-storage.h" |
| 14 | 14 |
| 15 namespace v8 { | 15 namespace v8 { |
| 16 namespace internal { | 16 namespace internal { |
| 17 | 17 |
| 18 // Provides a mapping from the offsets within generated code to | 18 // Provides a mapping from the offsets within generated code to |
| 19 // the source line. | 19 // the source line. |
| 20 class JITLineInfoTable : public Malloced { | 20 class JITLineInfoTable : public Malloced { |
| 21 public: | 21 public: |
| 22 JITLineInfoTable(); | 22 JITLineInfoTable(); |
| (...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 173 | 173 |
| 174 private: | 174 private: |
| 175 static uint32_t CodeEntryHash(CodeEntry* entry) { return entry->GetHash(); } | 175 static uint32_t CodeEntryHash(CodeEntry* entry) { return entry->GetHash(); } |
| 176 | 176 |
| 177 static bool LineTickMatch(void* a, void* b) { return a == b; } | 177 static bool LineTickMatch(void* a, void* b) { return a == b; } |
| 178 | 178 |
| 179 ProfileTree* tree_; | 179 ProfileTree* tree_; |
| 180 CodeEntry* entry_; | 180 CodeEntry* entry_; |
| 181 unsigned self_ticks_; | 181 unsigned self_ticks_; |
| 182 // Mapping from CodeEntry* to ProfileNode* | 182 // Mapping from CodeEntry* to ProfileNode* |
| 183 HashMap children_; | 183 base::HashMap children_; |
| 184 List<ProfileNode*> children_list_; | 184 List<ProfileNode*> children_list_; |
| 185 unsigned id_; | 185 unsigned id_; |
| 186 HashMap line_ticks_; | 186 base::HashMap line_ticks_; |
| 187 | 187 |
| 188 std::vector<CpuProfileDeoptInfo> deopt_infos_; | 188 std::vector<CpuProfileDeoptInfo> deopt_infos_; |
| 189 | 189 |
| 190 DISALLOW_COPY_AND_ASSIGN(ProfileNode); | 190 DISALLOW_COPY_AND_ASSIGN(ProfileNode); |
| 191 }; | 191 }; |
| 192 | 192 |
| 193 | 193 |
| 194 class ProfileTree { | 194 class ProfileTree { |
| 195 public: | 195 public: |
| 196 explicit ProfileTree(Isolate* isolate); | 196 explicit ProfileTree(Isolate* isolate); |
| (...skipping 16 matching lines...) Expand all Loading... |
| 213 private: | 213 private: |
| 214 template <typename Callback> | 214 template <typename Callback> |
| 215 void TraverseDepthFirst(Callback* callback); | 215 void TraverseDepthFirst(Callback* callback); |
| 216 | 216 |
| 217 CodeEntry root_entry_; | 217 CodeEntry root_entry_; |
| 218 unsigned next_node_id_; | 218 unsigned next_node_id_; |
| 219 ProfileNode* root_; | 219 ProfileNode* root_; |
| 220 Isolate* isolate_; | 220 Isolate* isolate_; |
| 221 | 221 |
| 222 unsigned next_function_id_; | 222 unsigned next_function_id_; |
| 223 HashMap function_ids_; | 223 base::HashMap function_ids_; |
| 224 | 224 |
| 225 DISALLOW_COPY_AND_ASSIGN(ProfileTree); | 225 DISALLOW_COPY_AND_ASSIGN(ProfileTree); |
| 226 }; | 226 }; |
| 227 | 227 |
| 228 | 228 |
| 229 class CpuProfile { | 229 class CpuProfile { |
| 230 public: | 230 public: |
| 231 CpuProfile(Isolate* isolate, const char* title, bool record_samples); | 231 CpuProfile(Isolate* isolate, const char* title, bool record_samples); |
| 232 | 232 |
| 233 // Add pc -> ... -> main() call path to the profile. | 233 // Add pc -> ... -> main() call path to the profile. |
| (...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 387 CodeEntry* unresolved_entry_; | 387 CodeEntry* unresolved_entry_; |
| 388 | 388 |
| 389 DISALLOW_COPY_AND_ASSIGN(ProfileGenerator); | 389 DISALLOW_COPY_AND_ASSIGN(ProfileGenerator); |
| 390 }; | 390 }; |
| 391 | 391 |
| 392 | 392 |
| 393 } // namespace internal | 393 } // namespace internal |
| 394 } // namespace v8 | 394 } // namespace v8 |
| 395 | 395 |
| 396 #endif // V8_PROFILER_PROFILE_GENERATOR_H_ | 396 #endif // V8_PROFILER_PROFILE_GENERATOR_H_ |
| OLD | NEW |