Index: src/profiler/cpu-profiler.cc |
diff --git a/src/profiler/cpu-profiler.cc b/src/profiler/cpu-profiler.cc |
index a3658eda306b3efbe37b502da78fd9258bfcfb91..fa41198e571a831c30239df88c12a42efd9c7ff4 100644 |
--- a/src/profiler/cpu-profiler.cc |
+++ b/src/profiler/cpu-profiler.cc |
@@ -6,6 +6,7 @@ |
#include "src/deoptimizer.h" |
#include "src/frames-inl.h" |
+#include "src/locked-queue-inl.h" |
#include "src/log-inl.h" |
#include "src/profiler/cpu-profiler-inl.h" |
#include "src/vm-state-inl.h" |
@@ -34,14 +35,14 @@ ProfilerEventsProcessor::~ProfilerEventsProcessor() {} |
void ProfilerEventsProcessor::Enqueue(const CodeEventsContainer& event) { |
- event.generic.order = ++last_code_event_id_; |
+ event.generic.order = last_code_event_id_.Increment(1); |
events_buffer_.Enqueue(event); |
} |
void ProfilerEventsProcessor::AddDeoptStack(Isolate* isolate, Address from, |
int fp_to_sp_delta) { |
- TickSampleEventRecord record(last_code_event_id_); |
+ TickSampleEventRecord record(last_code_event_id_.Value()); |
RegisterState regs; |
Address fp = isolate->c_entry_fp(isolate->thread_local_top()); |
regs.sp = fp - fp_to_sp_delta; |
@@ -53,7 +54,7 @@ void ProfilerEventsProcessor::AddDeoptStack(Isolate* isolate, Address from, |
void ProfilerEventsProcessor::AddCurrentStack(Isolate* isolate) { |
- TickSampleEventRecord record(last_code_event_id_); |
+ TickSampleEventRecord record(last_code_event_id_.Value()); |
RegisterState regs; |
StackFrameIterator it(isolate); |
if (!it.done()) { |
@@ -95,9 +96,9 @@ bool ProfilerEventsProcessor::ProcessCodeEvent() { |
ProfilerEventsProcessor::SampleProcessingResult |
ProfilerEventsProcessor::ProcessOneSample() { |
- if (!ticks_from_vm_buffer_.IsEmpty() |
- && ticks_from_vm_buffer_.Peek()->order == |
- last_processed_code_event_id_) { |
+ TickSampleEventRecord record1; |
+ if (ticks_from_vm_buffer_.Peek(&record1) && |
+ (record1.order == last_processed_code_event_id_)) { |
TickSampleEventRecord record; |
ticks_from_vm_buffer_.Dequeue(&record); |
generator_->RecordTickSample(record.sample); |