| 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" |
| (...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 138 // Puts current stack into tick sample events buffer. | 138 // Puts current stack into tick sample events buffer. |
| 139 void AddCurrentStack(Isolate* isolate); | 139 void AddCurrentStack(Isolate* isolate); |
| 140 | 140 |
| 141 // Tick sample events are filled directly in the buffer of the circular | 141 // Tick sample events are filled directly in the buffer of the circular |
| 142 // queue (because the structure is of fixed width, but usually not all | 142 // queue (because the structure is of fixed width, but usually not all |
| 143 // stack frame entries are filled.) This method returns a pointer to the | 143 // stack frame entries are filled.) This method returns a pointer to the |
| 144 // next record of the buffer. | 144 // next record of the buffer. |
| 145 inline TickSample* StartTickSample(); | 145 inline TickSample* StartTickSample(); |
| 146 inline void FinishTickSample(); | 146 inline void FinishTickSample(); |
| 147 | 147 |
| 148 Sampler* sampler() const { return sampler_; } |
| 149 |
| 148 // SamplingCircularQueue has stricter alignment requirements than a normal new | 150 // SamplingCircularQueue has stricter alignment requirements than a normal new |
| 149 // can fulfil, so we need to provide our own new/delete here. | 151 // can fulfil, so we need to provide our own new/delete here. |
| 150 void* operator new(size_t size); | 152 void* operator new(size_t size); |
| 151 void operator delete(void* ptr); | 153 void operator delete(void* ptr); |
| 152 | 154 |
| 153 private: | 155 private: |
| 154 // Called from events processing thread (Run() method.) | 156 // Called from events processing thread (Run() method.) |
| 155 bool ProcessCodeEvent(); | 157 bool ProcessCodeEvent(); |
| 156 | 158 |
| 157 enum SampleProcessingResult { | 159 enum SampleProcessingResult { |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 266 bool saved_is_logging_; | 268 bool saved_is_logging_; |
| 267 bool is_profiling_; | 269 bool is_profiling_; |
| 268 | 270 |
| 269 DISALLOW_COPY_AND_ASSIGN(CpuProfiler); | 271 DISALLOW_COPY_AND_ASSIGN(CpuProfiler); |
| 270 }; | 272 }; |
| 271 | 273 |
| 272 } } // namespace v8::internal | 274 } } // namespace v8::internal |
| 273 | 275 |
| 274 | 276 |
| 275 #endif // V8_CPU_PROFILER_H_ | 277 #endif // V8_CPU_PROFILER_H_ |
| OLD | NEW |