| OLD | NEW |
| 1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 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_INL_H_ | 5 #ifndef V8_PROFILER_CPU_PROFILER_INL_H_ |
| 6 #define V8_PROFILER_CPU_PROFILER_INL_H_ | 6 #define V8_PROFILER_CPU_PROFILER_INL_H_ |
| 7 | 7 |
| 8 #include "src/profiler/cpu-profiler.h" | 8 #include "src/profiler/cpu-profiler.h" |
| 9 | 9 |
| 10 #include <new> | 10 #include <new> |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 CodeEntry* entry = code_map->FindEntry(start); | 43 CodeEntry* entry = code_map->FindEntry(start); |
| 44 if (!entry) { | 44 if (!entry) { |
| 45 // Code objects for builtins should already have been added to the map but | 45 // Code objects for builtins should already have been added to the map but |
| 46 // some of them have been filtered out by CpuProfiler. | 46 // some of them have been filtered out by CpuProfiler. |
| 47 return; | 47 return; |
| 48 } | 48 } |
| 49 entry->SetBuiltinId(builtin_id); | 49 entry->SetBuiltinId(builtin_id); |
| 50 } | 50 } |
| 51 | 51 |
| 52 | 52 |
| 53 TickSample* CpuProfiler::StartTickSample() { | |
| 54 if (is_profiling_) return processor_->StartTickSample(); | |
| 55 return NULL; | |
| 56 } | |
| 57 | |
| 58 | |
| 59 void CpuProfiler::FinishTickSample() { | |
| 60 processor_->FinishTickSample(); | |
| 61 } | |
| 62 | |
| 63 | |
| 64 TickSample* ProfilerEventsProcessor::StartTickSample() { | 53 TickSample* ProfilerEventsProcessor::StartTickSample() { |
| 65 void* address = ticks_buffer_.StartEnqueue(); | 54 void* address = ticks_buffer_.StartEnqueue(); |
| 66 if (address == NULL) return NULL; | 55 if (address == NULL) return NULL; |
| 67 TickSampleEventRecord* evt = | 56 TickSampleEventRecord* evt = |
| 68 new (address) TickSampleEventRecord(last_code_event_id_.Value()); | 57 new (address) TickSampleEventRecord(last_code_event_id_.Value()); |
| 69 return &evt->sample; | 58 return &evt->sample; |
| 70 } | 59 } |
| 71 | 60 |
| 72 | 61 |
| 73 void ProfilerEventsProcessor::FinishTickSample() { | 62 void ProfilerEventsProcessor::FinishTickSample() { |
| 74 ticks_buffer_.FinishEnqueue(); | 63 ticks_buffer_.FinishEnqueue(); |
| 75 } | 64 } |
| 76 | 65 |
| 77 } // namespace internal | 66 } // namespace internal |
| 78 } // namespace v8 | 67 } // namespace v8 |
| 79 | 68 |
| 80 #endif // V8_PROFILER_CPU_PROFILER_INL_H_ | 69 #endif // V8_PROFILER_CPU_PROFILER_INL_H_ |
| OLD | NEW |