| 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 361 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 372 // Accessed by VM thread and profile generator thread. | 372 // Accessed by VM thread and profile generator thread. |
| 373 List<CpuProfile*> current_profiles_; | 373 List<CpuProfile*> current_profiles_; |
| 374 base::Semaphore current_profiles_semaphore_; | 374 base::Semaphore current_profiles_semaphore_; |
| 375 | 375 |
| 376 DISALLOW_COPY_AND_ASSIGN(CpuProfilesCollection); | 376 DISALLOW_COPY_AND_ASSIGN(CpuProfilesCollection); |
| 377 }; | 377 }; |
| 378 | 378 |
| 379 | 379 |
| 380 class ProfileGenerator { | 380 class ProfileGenerator { |
| 381 public: | 381 public: |
| 382 explicit ProfileGenerator(CpuProfilesCollection* profiles); | 382 ProfileGenerator(Isolate* isolate, CpuProfilesCollection* profiles); |
| 383 | 383 |
| 384 void RecordTickSample(const TickSample& sample); | 384 void RecordTickSample(const TickSample& sample); |
| 385 | 385 |
| 386 CodeMap* code_map() { return &code_map_; } | 386 CodeMap* code_map() { return &code_map_; } |
| 387 | 387 |
| 388 private: | 388 private: |
| 389 CodeEntry* FindEntry(void* address); |
| 389 CodeEntry* EntryForVMState(StateTag tag); | 390 CodeEntry* EntryForVMState(StateTag tag); |
| 390 | 391 |
| 392 Isolate* isolate_; |
| 391 CpuProfilesCollection* profiles_; | 393 CpuProfilesCollection* profiles_; |
| 392 CodeMap code_map_; | 394 CodeMap code_map_; |
| 393 | 395 |
| 394 DISALLOW_COPY_AND_ASSIGN(ProfileGenerator); | 396 DISALLOW_COPY_AND_ASSIGN(ProfileGenerator); |
| 395 }; | 397 }; |
| 396 | 398 |
| 397 | 399 |
| 398 } // namespace internal | 400 } // namespace internal |
| 399 } // namespace v8 | 401 } // namespace v8 |
| 400 | 402 |
| 401 #endif // V8_PROFILER_PROFILE_GENERATOR_H_ | 403 #endif // V8_PROFILER_PROFILE_GENERATOR_H_ |
| OLD | NEW |