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 "include/v8-profiler.h" | 8 #include "include/v8-profiler.h" |
9 #include "src/allocation.h" | 9 #include "src/allocation.h" |
10 #include "src/hashmap.h" | 10 #include "src/hashmap.h" |
(...skipping 16 matching lines...) Expand all Loading... |
27 const char* GetName(Name* name); | 27 const char* GetName(Name* name); |
28 const char* GetName(int index); | 28 const char* GetName(int index); |
29 const char* GetFunctionName(Name* name); | 29 const char* GetFunctionName(Name* name); |
30 const char* GetFunctionName(const char* name); | 30 const char* GetFunctionName(const char* name); |
31 size_t GetUsedMemorySize() const; | 31 size_t GetUsedMemorySize() const; |
32 | 32 |
33 private: | 33 private: |
34 static const int kMaxNameSize = 1024; | 34 static const int kMaxNameSize = 1024; |
35 | 35 |
36 static bool StringsMatch(void* key1, void* key2); | 36 static bool StringsMatch(void* key1, void* key2); |
37 const char* BeautifyFunctionName(const char* name); | |
38 const char* AddOrDisposeString(char* str, int len); | 37 const char* AddOrDisposeString(char* str, int len); |
39 HashMap::Entry* GetEntry(const char* str, int len); | 38 HashMap::Entry* GetEntry(const char* str, int len); |
40 | 39 |
41 uint32_t hash_seed_; | 40 uint32_t hash_seed_; |
42 HashMap names_; | 41 HashMap names_; |
43 | 42 |
44 DISALLOW_COPY_AND_ASSIGN(StringsStorage); | 43 DISALLOW_COPY_AND_ASSIGN(StringsStorage); |
45 }; | 44 }; |
46 | 45 |
47 | 46 |
(...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
306 | 305 |
307 | 306 |
308 class ProfileGenerator { | 307 class ProfileGenerator { |
309 public: | 308 public: |
310 explicit ProfileGenerator(CpuProfilesCollection* profiles); | 309 explicit ProfileGenerator(CpuProfilesCollection* profiles); |
311 | 310 |
312 void RecordTickSample(const TickSample& sample); | 311 void RecordTickSample(const TickSample& sample); |
313 | 312 |
314 CodeMap* code_map() { return &code_map_; } | 313 CodeMap* code_map() { return &code_map_; } |
315 | 314 |
316 static const char* const kAnonymousFunctionName; | |
317 static const char* const kProgramEntryName; | 315 static const char* const kProgramEntryName; |
318 static const char* const kIdleEntryName; | 316 static const char* const kIdleEntryName; |
319 static const char* const kGarbageCollectorEntryName; | 317 static const char* const kGarbageCollectorEntryName; |
320 // Used to represent frames for which we have no reliable way to | 318 // Used to represent frames for which we have no reliable way to |
321 // detect function. | 319 // detect function. |
322 static const char* const kUnresolvedFunctionName; | 320 static const char* const kUnresolvedFunctionName; |
323 | 321 |
324 private: | 322 private: |
325 CodeEntry* EntryForVMState(StateTag tag); | 323 CodeEntry* EntryForVMState(StateTag tag); |
326 | 324 |
327 CpuProfilesCollection* profiles_; | 325 CpuProfilesCollection* profiles_; |
328 CodeMap code_map_; | 326 CodeMap code_map_; |
329 CodeEntry* program_entry_; | 327 CodeEntry* program_entry_; |
330 CodeEntry* idle_entry_; | 328 CodeEntry* idle_entry_; |
331 CodeEntry* gc_entry_; | 329 CodeEntry* gc_entry_; |
332 CodeEntry* unresolved_entry_; | 330 CodeEntry* unresolved_entry_; |
333 | 331 |
334 DISALLOW_COPY_AND_ASSIGN(ProfileGenerator); | 332 DISALLOW_COPY_AND_ASSIGN(ProfileGenerator); |
335 }; | 333 }; |
336 | 334 |
337 | 335 |
338 } } // namespace v8::internal | 336 } } // namespace v8::internal |
339 | 337 |
340 #endif // V8_PROFILE_GENERATOR_H_ | 338 #endif // V8_PROFILE_GENERATOR_H_ |
OLD | NEW |