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

Unified Diff: src/cpu-profiler-inl.h

Issue 10871039: Replacing circular queue by single buffer in CPU Profiler. (Closed) Base URL: http://git.chromium.org/external/v8.git@profiling
Patch Set: an attempt to fix a test that strangely crashed only once Created 8 years, 3 months 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
Index: src/cpu-profiler-inl.h
diff --git a/src/cpu-profiler-inl.h b/src/cpu-profiler-inl.h
index 4982197cabaf418006431f15d107fa29e6af8f2a..d8fb4f04286b7ae3a519a701c20673d1fd6a083e 100644
--- a/src/cpu-profiler-inl.h
+++ b/src/cpu-profiler-inl.h
@@ -31,7 +31,6 @@
#include "cpu-profiler.h"
#include <new>
-#include "circular-queue-inl.h"
#include "profile-generator-inl.h"
#include "unbound-queue-inl.h"
@@ -56,11 +55,18 @@ void SharedFunctionInfoMoveEventRecord::UpdateCodeMap(CodeMap* code_map) {
}
-TickSample* ProfilerEventsProcessor::TickSampleEvent() {
+TickSample* ProfilerEventsProcessor::StartTickSampleEvent() {
+ if (!ticks_buffer_is_empty_ || ticks_buffer_is_initialized_) return NULL;
+ ticks_buffer_is_initialized_ = true;
generator_->Tick();
- TickSampleEventRecord* evt =
- new(ticks_buffer_.Enqueue()) TickSampleEventRecord(enqueue_order_);
- return &evt->sample;
+ ticks_buffer_ = TickSampleEventRecord(enqueue_order_);
+ return &ticks_buffer_.sample;
+}
+
+
+void ProfilerEventsProcessor::FinishTickSampleEvent() {
+ ASSERT(ticks_buffer_is_initialized && ticks_buffer_is_empty_);
Jakob Kummerow 2012/10/02 10:56:51 typo: ticks_buffer_is_initialized_ is missing its
+ ticks_buffer_is_empty_ = false;
}
« src/cpu-profiler.h ('K') | « src/cpu-profiler.cc ('k') | src/platform-cygwin.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698