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_PROFILER_CPU_PROFILER_H_ | 5 #ifndef V8_PROFILER_CPU_PROFILER_H_ |
6 #define V8_PROFILER_CPU_PROFILER_H_ | 6 #define V8_PROFILER_CPU_PROFILER_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 | 9 |
10 #include "src/allocation.h" | 10 #include "src/allocation.h" |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
131 // methods called by event producers: VM and stack sampler threads. | 131 // methods called by event producers: VM and stack sampler threads. |
132 class ProfilerEventsProcessor : public base::Thread { | 132 class ProfilerEventsProcessor : public base::Thread { |
133 public: | 133 public: |
134 ProfilerEventsProcessor(Isolate* isolate, ProfileGenerator* generator, | 134 ProfilerEventsProcessor(Isolate* isolate, ProfileGenerator* generator, |
135 base::TimeDelta period); | 135 base::TimeDelta period); |
136 virtual ~ProfilerEventsProcessor(); | 136 virtual ~ProfilerEventsProcessor(); |
137 | 137 |
138 // Thread control. | 138 // Thread control. |
139 virtual void Run(); | 139 virtual void Run(); |
140 void StopSynchronously(); | 140 void StopSynchronously(); |
141 INLINE(bool running()) { return !!base::NoBarrier_Load(&running_); } | 141 INLINE(bool running()) { return !!base::Relaxed_Load(&running_); } |
142 void Enqueue(const CodeEventsContainer& event); | 142 void Enqueue(const CodeEventsContainer& event); |
143 | 143 |
144 // Puts current stack into tick sample events buffer. | 144 // Puts current stack into tick sample events buffer. |
145 void AddCurrentStack(Isolate* isolate, bool update_stats = false); | 145 void AddCurrentStack(Isolate* isolate, bool update_stats = false); |
146 void AddDeoptStack(Isolate* isolate, Address from, int fp_to_sp_delta); | 146 void AddDeoptStack(Isolate* isolate, Address from, int fp_to_sp_delta); |
147 | 147 |
148 // Tick sample events are filled directly in the buffer of the circular | 148 // Tick sample events are filled directly in the buffer of the circular |
149 // queue (because the structure is of fixed width, but usually not all | 149 // queue (because the structure is of fixed width, but usually not all |
150 // stack frame entries are filled.) This method returns a pointer to the | 150 // stack frame entries are filled.) This method returns a pointer to the |
151 // next record of the buffer. | 151 // next record of the buffer. |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
232 bool is_profiling_; | 232 bool is_profiling_; |
233 | 233 |
234 DISALLOW_COPY_AND_ASSIGN(CpuProfiler); | 234 DISALLOW_COPY_AND_ASSIGN(CpuProfiler); |
235 }; | 235 }; |
236 | 236 |
237 } // namespace internal | 237 } // namespace internal |
238 } // namespace v8 | 238 } // namespace v8 |
239 | 239 |
240 | 240 |
241 #endif // V8_PROFILER_CPU_PROFILER_H_ | 241 #endif // V8_PROFILER_CPU_PROFILER_H_ |
OLD | NEW |