Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(103)

Unified Diff: src/profiler/cpu-profiler.cc

Issue 1457483002: [profiler] Move away from UnboundedQueue to LockedQueue for regular events. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@locked-queue
Patch Set: Rebase Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/profiler/cpu-profiler.h ('k') | src/profiler/cpu-profiler-inl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
« no previous file with comments | « src/profiler/cpu-profiler.h ('k') | src/profiler/cpu-profiler-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698