| 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" | |
| 10 #include "src/allocation.h" | 9 #include "src/allocation.h" |
| 11 #include "src/base/hashmap.h" | 10 #include "src/base/hashmap.h" |
| 12 #include "src/compiler.h" | 11 #include "src/compiler.h" |
| 13 #include "src/profiler/strings-storage.h" | 12 #include "src/profiler/strings-storage.h" |
| 14 | 13 |
| 15 namespace v8 { | 14 namespace v8 { |
| 15 |
| 16 struct TickSample; |
| 17 |
| 16 namespace internal { | 18 namespace internal { |
| 17 | 19 |
| 18 // Provides a mapping from the offsets within generated code to | 20 // Provides a mapping from the offsets within generated code to |
| 19 // the source line. | 21 // the source line. |
| 20 class JITLineInfoTable : public Malloced { | 22 class JITLineInfoTable : public Malloced { |
| 21 public: | 23 public: |
| 22 JITLineInfoTable(); | 24 JITLineInfoTable(); |
| 23 ~JITLineInfoTable(); | 25 ~JITLineInfoTable(); |
| 24 | 26 |
| 25 void SetPosition(int pc_offset, int line); | 27 void SetPosition(int pc_offset, int line); |
| (...skipping 334 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 360 base::Semaphore current_profiles_semaphore_; | 362 base::Semaphore current_profiles_semaphore_; |
| 361 | 363 |
| 362 DISALLOW_COPY_AND_ASSIGN(CpuProfilesCollection); | 364 DISALLOW_COPY_AND_ASSIGN(CpuProfilesCollection); |
| 363 }; | 365 }; |
| 364 | 366 |
| 365 | 367 |
| 366 class ProfileGenerator { | 368 class ProfileGenerator { |
| 367 public: | 369 public: |
| 368 explicit ProfileGenerator(CpuProfilesCollection* profiles); | 370 explicit ProfileGenerator(CpuProfilesCollection* profiles); |
| 369 | 371 |
| 370 void RecordTickSample(const TickSample& sample); | 372 void RecordTickSample(const TickSample& sample, |
| 373 const base::TimeTicks& timestamp); |
| 371 | 374 |
| 372 CodeMap* code_map() { return &code_map_; } | 375 CodeMap* code_map() { return &code_map_; } |
| 373 | 376 |
| 374 private: | 377 private: |
| 375 CodeEntry* EntryForVMState(StateTag tag); | 378 CodeEntry* EntryForVMState(StateTag tag); |
| 376 | 379 |
| 377 CpuProfilesCollection* profiles_; | 380 CpuProfilesCollection* profiles_; |
| 378 CodeMap code_map_; | 381 CodeMap code_map_; |
| 379 | 382 |
| 380 DISALLOW_COPY_AND_ASSIGN(ProfileGenerator); | 383 DISALLOW_COPY_AND_ASSIGN(ProfileGenerator); |
| 381 }; | 384 }; |
| 382 | 385 |
| 383 | 386 |
| 384 } // namespace internal | 387 } // namespace internal |
| 385 } // namespace v8 | 388 } // namespace v8 |
| 386 | 389 |
| 387 #endif // V8_PROFILER_PROFILE_GENERATOR_H_ | 390 #endif // V8_PROFILER_PROFILE_GENERATOR_H_ |
| OLD | NEW |