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

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

Issue 7203005: Cleanup extra initialization of TickSample fields. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 9 years, 6 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
« src/cpu-profiler.h ('K') | « src/cpu-profiler.cc ('k') | src/log.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/cpu-profiler-inl.h
diff --git a/src/cpu-profiler-inl.h b/src/cpu-profiler-inl.h
index b704417795c21dc9eaf0255f9b224e37d7f9c250..c6720eedd9ae336cdd5b127f9ce7b1d4bc4c141f 100644
--- a/src/cpu-profiler-inl.h
+++ b/src/cpu-profiler-inl.h
@@ -32,6 +32,7 @@
#ifdef ENABLE_LOGGING_AND_PROFILING
+#include <new>
#include "circular-queue-inl.h"
#include "profile-generator-inl.h"
#include "unbound-queue-inl.h"
@@ -62,23 +63,10 @@ void SharedFunctionInfoMoveEventRecord::UpdateCodeMap(CodeMap* code_map) {
}
-TickSampleEventRecord* TickSampleEventRecord::init(void* value) {
- TickSampleEventRecord* result =
- reinterpret_cast<TickSampleEventRecord*>(value);
- result->filler = 1;
- ASSERT(result->filler != SamplingCircularQueue::kClear);
- // Init the required fields only.
- result->sample.pc = NULL;
- result->sample.frames_count = 0;
- result->sample.has_external_callback = false;
- return result;
-}
-
-
TickSample* ProfilerEventsProcessor::TickSampleEvent() {
generator_->Tick();
TickSampleEventRecord* evt =
- TickSampleEventRecord::init(ticks_buffer_.Enqueue());
+ new(ticks_buffer_.Enqueue()) TickSampleEventRecord();
evt->order = enqueue_order_; // No increment!
return &evt->sample;
}
« src/cpu-profiler.h ('K') | « src/cpu-profiler.cc ('k') | src/log.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698