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

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

Issue 2061623002: Introduce JIT code events dispatcher for the isolate. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: rebaseline Created 4 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
« no previous file with comments | « src/profiler/cpu-profiler.h ('k') | src/profiler/profile-generator.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 2da286cb7f5194a4065c7cc807399461ef3850a9..cd9bb9be051ca43496c85c73760767b1849a23f6 100644
--- a/src/profiler/cpu-profiler.cc
+++ b/src/profiler/cpu-profiler.cc
@@ -204,14 +204,13 @@ void CpuProfiler::CallbackEvent(Name* name, Address entry_point) {
CodeEventsContainer evt_rec(CodeEventRecord::CODE_CREATION);
CodeCreateEventRecord* rec = &evt_rec.CodeCreateEventRecord_;
rec->start = entry_point;
- rec->entry = profiles_->NewCodeEntry(
- Logger::CALLBACK_TAG,
- profiles_->GetName(name));
+ rec->entry = profiles_->NewCodeEntry(CodeEventListener::CALLBACK_TAG,
+ profiles_->GetName(name));
rec->size = 1;
processor_->Enqueue(evt_rec);
}
-void CpuProfiler::CodeCreateEvent(Logger::LogEventsAndTags tag,
+void CpuProfiler::CodeCreateEvent(CodeEventListener::LogEventsAndTags tag,
AbstractCode* code, const char* name) {
CodeEventsContainer evt_rec(CodeEventRecord::CODE_CREATION);
CodeCreateEventRecord* rec = &evt_rec.CodeCreateEventRecord_;
@@ -225,7 +224,7 @@ void CpuProfiler::CodeCreateEvent(Logger::LogEventsAndTags tag,
processor_->Enqueue(evt_rec);
}
-void CpuProfiler::CodeCreateEvent(Logger::LogEventsAndTags tag,
+void CpuProfiler::CodeCreateEvent(CodeEventListener::LogEventsAndTags tag,
AbstractCode* code, Name* name) {
CodeEventsContainer evt_rec(CodeEventRecord::CODE_CREATION);
CodeCreateEventRecord* rec = &evt_rec.CodeCreateEventRecord_;
@@ -239,7 +238,7 @@ void CpuProfiler::CodeCreateEvent(Logger::LogEventsAndTags tag,
processor_->Enqueue(evt_rec);
}
-void CpuProfiler::CodeCreateEvent(Logger::LogEventsAndTags tag,
+void CpuProfiler::CodeCreateEvent(CodeEventListener::LogEventsAndTags tag,
AbstractCode* code,
SharedFunctionInfo* shared,
Name* script_name) {
@@ -258,7 +257,7 @@ void CpuProfiler::CodeCreateEvent(Logger::LogEventsAndTags tag,
processor_->Enqueue(evt_rec);
}
-void CpuProfiler::CodeCreateEvent(Logger::LogEventsAndTags tag,
+void CpuProfiler::CodeCreateEvent(CodeEventListener::LogEventsAndTags tag,
AbstractCode* abstract_code,
SharedFunctionInfo* shared, Name* script_name,
int line, int column) {
@@ -312,7 +311,7 @@ void CpuProfiler::CodeCreateEvent(Logger::LogEventsAndTags tag,
processor_->Enqueue(evt_rec);
}
-void CpuProfiler::CodeCreateEvent(Logger::LogEventsAndTags tag,
+void CpuProfiler::CodeCreateEvent(CodeEventListener::LogEventsAndTags tag,
AbstractCode* code, int args_count) {
CodeEventsContainer evt_rec(CodeEventRecord::CODE_CREATION);
CodeCreateEventRecord* rec = &evt_rec.CodeCreateEventRecord_;
@@ -359,10 +358,8 @@ void CpuProfiler::GetterCallbackEvent(Name* name, Address entry_point) {
CodeEventsContainer evt_rec(CodeEventRecord::CODE_CREATION);
CodeCreateEventRecord* rec = &evt_rec.CodeCreateEventRecord_;
rec->start = entry_point;
- rec->entry = profiles_->NewCodeEntry(
- Logger::CALLBACK_TAG,
- profiles_->GetName(name),
- "get ");
+ rec->entry = profiles_->NewCodeEntry(CodeEventListener::CALLBACK_TAG,
+ profiles_->GetName(name), "get ");
rec->size = 1;
processor_->Enqueue(evt_rec);
}
@@ -372,7 +369,7 @@ void CpuProfiler::RegExpCodeCreateEvent(AbstractCode* code, String* source) {
CodeCreateEventRecord* rec = &evt_rec.CodeCreateEventRecord_;
rec->start = code->address();
rec->entry = profiles_->NewCodeEntry(
- Logger::REG_EXP_TAG, profiles_->GetName(source), "RegExp: ",
+ CodeEventListener::REG_EXP_TAG, profiles_->GetName(source), "RegExp: ",
CodeEntry::kEmptyResourceName, CpuProfileNode::kNoLineNumberInfo,
CpuProfileNode::kNoColumnNumberInfo, NULL, code->instruction_start());
rec->size = code->ExecutableSize();
@@ -384,10 +381,8 @@ void CpuProfiler::SetterCallbackEvent(Name* name, Address entry_point) {
CodeEventsContainer evt_rec(CodeEventRecord::CODE_CREATION);
CodeCreateEventRecord* rec = &evt_rec.CodeCreateEventRecord_;
rec->start = entry_point;
- rec->entry = profiles_->NewCodeEntry(
- Logger::CALLBACK_TAG,
- profiles_->GetName(name),
- "set ");
+ rec->entry = profiles_->NewCodeEntry(CodeEventListener::CALLBACK_TAG,
+ profiles_->GetName(name), "set ");
rec->size = 1;
processor_->Enqueue(evt_rec);
}
@@ -573,6 +568,7 @@ void CpuProfiler::StartProcessorIfNotStarted() {
isolate_->set_is_profiling(true);
// Enumerate stuff we already have in the heap.
DCHECK(isolate_->heap()->HasBeenSetUp());
+ isolate_->code_event_dispatcher()->AddListener(this);
if (!FLAG_prof_browser_mode) {
logger->LogCodeObjects();
}
@@ -617,6 +613,7 @@ void CpuProfiler::StopProcessor() {
reinterpret_cast<sampler::Sampler*>(logger->ticker_);
is_profiling_ = false;
isolate_->set_is_profiling(false);
+ isolate_->code_event_dispatcher()->RemoveListener(this);
processor_->StopSynchronously();
delete processor_;
delete generator_;
« no previous file with comments | « src/profiler/cpu-profiler.h ('k') | src/profiler/profile-generator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698