From: bmeurer@chromium.org Date: Mon, 1 Jul 2013 12:24:26 +0000 (+0000) Subject: No need to pass profiles to ProfilerEventsProcessor. X-Git-Tag: upstream/4.7.83~13601 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d7618796f6402f8b54b643055a20437ddd1ddc51;p=platform%2Fupstream%2Fv8.git No need to pass profiles to ProfilerEventsProcessor. Following up on https://codereview.chromium.org/18353002, there's no need to pass the profiles to ProfilerEventsProcessor's constructor. BUG= R=danno@chromium.org Review URL: https://codereview.chromium.org/18332004 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@15413 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- diff --git a/src/cpu-profiler.cc b/src/cpu-profiler.cc index 1309604..512f7d5 100644 --- a/src/cpu-profiler.cc +++ b/src/cpu-profiler.cc @@ -45,8 +45,7 @@ static const int kTickSamplesBufferChunksCount = 16; static const int kProfilerStackSize = 64 * KB; -ProfilerEventsProcessor::ProfilerEventsProcessor( - ProfileGenerator* generator, CpuProfilesCollection* profiles) +ProfilerEventsProcessor::ProfilerEventsProcessor(ProfileGenerator* generator) : Thread(Thread::Options("v8:ProfEvntProc", kProfilerStackSize)), generator_(generator), running_(true), @@ -435,7 +434,7 @@ void CpuProfiler::StartProcessorIfNotStarted() { saved_logging_nesting_ = isolate_->logger()->logging_nesting_; isolate_->logger()->logging_nesting_ = 0; generator_ = new ProfileGenerator(profiles_); - processor_ = new ProfilerEventsProcessor(generator_, profiles_); + processor_ = new ProfilerEventsProcessor(generator_); is_profiling_ = true; processor_->StartSynchronously(); // Enumerate stuff we already have in the heap. diff --git a/src/cpu-profiler.h b/src/cpu-profiler.h index 1e8ac79..98096be 100644 --- a/src/cpu-profiler.h +++ b/src/cpu-profiler.h @@ -141,8 +141,7 @@ class CodeEventsContainer { // methods called by event producers: VM and stack sampler threads. class ProfilerEventsProcessor : public Thread { public: - ProfilerEventsProcessor(ProfileGenerator* generator, - CpuProfilesCollection* profiles); + explicit ProfilerEventsProcessor(ProfileGenerator* generator); virtual ~ProfilerEventsProcessor() {} // Thread control. diff --git a/test/cctest/test-cpu-profiler.cc b/test/cctest/test-cpu-profiler.cc index 7374a54..fb0566d 100644 --- a/test/cctest/test-cpu-profiler.cc +++ b/test/cctest/test-cpu-profiler.cc @@ -51,7 +51,7 @@ using i::Vector; TEST(StartStop) { CpuProfilesCollection profiles; ProfileGenerator generator(&profiles); - ProfilerEventsProcessor processor(&generator, &profiles); + ProfilerEventsProcessor processor(&generator); processor.Start(); processor.Stop(); processor.Join(); @@ -141,7 +141,7 @@ TEST(CodeEvents) { CpuProfilesCollection* profiles = new CpuProfilesCollection; profiles->StartProfiling("", 1, false); ProfileGenerator generator(profiles); - ProfilerEventsProcessor processor(&generator, profiles); + ProfilerEventsProcessor processor(&generator); processor.Start(); CpuProfiler profiler(isolate, profiles, &generator, &processor); @@ -202,7 +202,7 @@ TEST(TickEvents) { CpuProfilesCollection* profiles = new CpuProfilesCollection; profiles->StartProfiling("", 1, false); ProfileGenerator generator(profiles); - ProfilerEventsProcessor processor(&generator, profiles); + ProfilerEventsProcessor processor(&generator); processor.Start(); CpuProfiler profiler(isolate, profiles, &generator, &processor); @@ -272,7 +272,7 @@ TEST(Issue1398) { CpuProfilesCollection* profiles = new CpuProfilesCollection; profiles->StartProfiling("", 1, false); ProfileGenerator generator(profiles); - ProfilerEventsProcessor processor(&generator, profiles); + ProfilerEventsProcessor processor(&generator); processor.Start(); CpuProfiler profiler(isolate, profiles, &generator, &processor);