Commit d7618796 authored by bmeurer@chromium.org's avatar bmeurer@chromium.org

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
parent 73d32d2f
...@@ -45,8 +45,7 @@ static const int kTickSamplesBufferChunksCount = 16; ...@@ -45,8 +45,7 @@ static const int kTickSamplesBufferChunksCount = 16;
static const int kProfilerStackSize = 64 * KB; static const int kProfilerStackSize = 64 * KB;
ProfilerEventsProcessor::ProfilerEventsProcessor( ProfilerEventsProcessor::ProfilerEventsProcessor(ProfileGenerator* generator)
ProfileGenerator* generator, CpuProfilesCollection* profiles)
: Thread(Thread::Options("v8:ProfEvntProc", kProfilerStackSize)), : Thread(Thread::Options("v8:ProfEvntProc", kProfilerStackSize)),
generator_(generator), generator_(generator),
running_(true), running_(true),
...@@ -435,7 +434,7 @@ void CpuProfiler::StartProcessorIfNotStarted() { ...@@ -435,7 +434,7 @@ void CpuProfiler::StartProcessorIfNotStarted() {
saved_logging_nesting_ = isolate_->logger()->logging_nesting_; saved_logging_nesting_ = isolate_->logger()->logging_nesting_;
isolate_->logger()->logging_nesting_ = 0; isolate_->logger()->logging_nesting_ = 0;
generator_ = new ProfileGenerator(profiles_); generator_ = new ProfileGenerator(profiles_);
processor_ = new ProfilerEventsProcessor(generator_, profiles_); processor_ = new ProfilerEventsProcessor(generator_);
is_profiling_ = true; is_profiling_ = true;
processor_->StartSynchronously(); processor_->StartSynchronously();
// Enumerate stuff we already have in the heap. // Enumerate stuff we already have in the heap.
......
...@@ -141,8 +141,7 @@ class CodeEventsContainer { ...@@ -141,8 +141,7 @@ class CodeEventsContainer {
// methods called by event producers: VM and stack sampler threads. // methods called by event producers: VM and stack sampler threads.
class ProfilerEventsProcessor : public Thread { class ProfilerEventsProcessor : public Thread {
public: public:
ProfilerEventsProcessor(ProfileGenerator* generator, explicit ProfilerEventsProcessor(ProfileGenerator* generator);
CpuProfilesCollection* profiles);
virtual ~ProfilerEventsProcessor() {} virtual ~ProfilerEventsProcessor() {}
// Thread control. // Thread control.
......
...@@ -51,7 +51,7 @@ using i::Vector; ...@@ -51,7 +51,7 @@ using i::Vector;
TEST(StartStop) { TEST(StartStop) {
CpuProfilesCollection profiles; CpuProfilesCollection profiles;
ProfileGenerator generator(&profiles); ProfileGenerator generator(&profiles);
ProfilerEventsProcessor processor(&generator, &profiles); ProfilerEventsProcessor processor(&generator);
processor.Start(); processor.Start();
processor.Stop(); processor.Stop();
processor.Join(); processor.Join();
...@@ -141,7 +141,7 @@ TEST(CodeEvents) { ...@@ -141,7 +141,7 @@ TEST(CodeEvents) {
CpuProfilesCollection* profiles = new CpuProfilesCollection; CpuProfilesCollection* profiles = new CpuProfilesCollection;
profiles->StartProfiling("", 1, false); profiles->StartProfiling("", 1, false);
ProfileGenerator generator(profiles); ProfileGenerator generator(profiles);
ProfilerEventsProcessor processor(&generator, profiles); ProfilerEventsProcessor processor(&generator);
processor.Start(); processor.Start();
CpuProfiler profiler(isolate, profiles, &generator, &processor); CpuProfiler profiler(isolate, profiles, &generator, &processor);
...@@ -202,7 +202,7 @@ TEST(TickEvents) { ...@@ -202,7 +202,7 @@ TEST(TickEvents) {
CpuProfilesCollection* profiles = new CpuProfilesCollection; CpuProfilesCollection* profiles = new CpuProfilesCollection;
profiles->StartProfiling("", 1, false); profiles->StartProfiling("", 1, false);
ProfileGenerator generator(profiles); ProfileGenerator generator(profiles);
ProfilerEventsProcessor processor(&generator, profiles); ProfilerEventsProcessor processor(&generator);
processor.Start(); processor.Start();
CpuProfiler profiler(isolate, profiles, &generator, &processor); CpuProfiler profiler(isolate, profiles, &generator, &processor);
...@@ -272,7 +272,7 @@ TEST(Issue1398) { ...@@ -272,7 +272,7 @@ TEST(Issue1398) {
CpuProfilesCollection* profiles = new CpuProfilesCollection; CpuProfilesCollection* profiles = new CpuProfilesCollection;
profiles->StartProfiling("", 1, false); profiles->StartProfiling("", 1, false);
ProfileGenerator generator(profiles); ProfileGenerator generator(profiles);
ProfilerEventsProcessor processor(&generator, profiles); ProfilerEventsProcessor processor(&generator);
processor.Start(); processor.Start();
CpuProfiler profiler(isolate, profiles, &generator, &processor); CpuProfiler profiler(isolate, profiles, &generator, &processor);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment