| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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_CPU_PROFILER_H_ | 5 #ifndef V8_CPU_PROFILER_H_ |
| 6 #define V8_CPU_PROFILER_H_ | 6 #define V8_CPU_PROFILER_H_ |
| 7 | 7 |
| 8 #include "src/allocation.h" | 8 #include "src/allocation.h" |
| 9 #include "src/base/atomicops.h" | 9 #include "src/base/atomicops.h" |
| 10 #include "src/base/platform/time.h" | 10 #include "src/base/platform/time.h" |
| 11 #include "src/circular-queue.h" | 11 #include "src/circular-queue.h" |
| 12 #include "src/compiler.h" | 12 #include "src/compiler.h" |
| 13 #include "src/sampler.h" | 13 #include "src/sampler.h" |
| 14 #include "src/unbound-queue-inl.h" | 14 #include "src/unbound-queue.h" |
| 15 | 15 |
| 16 namespace v8 { | 16 namespace v8 { |
| 17 namespace internal { | 17 namespace internal { |
| 18 | 18 |
| 19 // Forward declarations. | 19 // Forward declarations. |
| 20 class CodeEntry; | 20 class CodeEntry; |
| 21 class CodeMap; | 21 class CodeMap; |
| 22 class CompilationInfo; | 22 class CompilationInfo; |
| 23 class CpuProfile; | 23 class CpuProfile; |
| 24 class CpuProfilesCollection; | 24 class CpuProfilesCollection; |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 122 }; | 122 }; |
| 123 | 123 |
| 124 | 124 |
| 125 // This class implements both the profile events processor thread and | 125 // This class implements both the profile events processor thread and |
| 126 // methods called by event producers: VM and stack sampler threads. | 126 // methods called by event producers: VM and stack sampler threads. |
| 127 class ProfilerEventsProcessor : public base::Thread { | 127 class ProfilerEventsProcessor : public base::Thread { |
| 128 public: | 128 public: |
| 129 ProfilerEventsProcessor(ProfileGenerator* generator, | 129 ProfilerEventsProcessor(ProfileGenerator* generator, |
| 130 Sampler* sampler, | 130 Sampler* sampler, |
| 131 base::TimeDelta period); | 131 base::TimeDelta period); |
| 132 virtual ~ProfilerEventsProcessor() {} | 132 virtual ~ProfilerEventsProcessor(); |
| 133 | 133 |
| 134 // Thread control. | 134 // Thread control. |
| 135 virtual void Run(); | 135 virtual void Run(); |
| 136 void StopSynchronously(); | 136 void StopSynchronously(); |
| 137 INLINE(bool running()) { return !!base::NoBarrier_Load(&running_); } | 137 INLINE(bool running()) { return !!base::NoBarrier_Load(&running_); } |
| 138 void Enqueue(const CodeEventsContainer& event); | 138 void Enqueue(const CodeEventsContainer& event); |
| 139 | 139 |
| 140 // Puts current stack into tick sample events buffer. | 140 // Puts current stack into tick sample events buffer. |
| 141 void AddCurrentStack(Isolate* isolate); | 141 void AddCurrentStack(Isolate* isolate); |
| 142 void AddDeoptStack(Isolate* isolate, Address from, int fp_to_sp_delta); | 142 void AddDeoptStack(Isolate* isolate, Address from, int fp_to_sp_delta); |
| (...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 267 bool saved_is_logging_; | 267 bool saved_is_logging_; |
| 268 bool is_profiling_; | 268 bool is_profiling_; |
| 269 | 269 |
| 270 DISALLOW_COPY_AND_ASSIGN(CpuProfiler); | 270 DISALLOW_COPY_AND_ASSIGN(CpuProfiler); |
| 271 }; | 271 }; |
| 272 | 272 |
| 273 } } // namespace v8::internal | 273 } } // namespace v8::internal |
| 274 | 274 |
| 275 | 275 |
| 276 #endif // V8_CPU_PROFILER_H_ | 276 #endif // V8_CPU_PROFILER_H_ |
| OLD | NEW |