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

Unified Diff: src/log.cc

Issue 519543002: [WIP] Added CodeEventListener to the sampler API. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: CallbackEvent also logs as code-creation, added coverage for that. Created 6 years, 4 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/isolate.cc ('k') | src/mips/regexp-macro-assembler-mips.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/log.cc
diff --git a/src/log.cc b/src/log.cc
index 6d88a535dc78f4ce10ce7a578d56d1b7b32b4e7c..483443aae3dcca0705653f8b0aec2ecbd04e7e5f 100644
--- a/src/log.cc
+++ b/src/log.cc
@@ -1865,6 +1865,7 @@ void Logger::LogCodeObject(Object* object) {
break;
}
PROFILE(isolate_, CodeCreateEvent(tag, code_object, description));
+ isolate_->CodeCreateEvent(code_object, description);
}
@@ -1896,12 +1897,15 @@ void Logger::LogExistingFunction(Handle<SharedFunctionInfo> shared,
Logger::ToNativeByScript(Logger::LAZY_COMPILE_TAG, *script),
*code, *shared, NULL,
*script_name, line_num, column_num));
+ isolate_->CodeCreateEvent(*code, *shared, *script_name,
+ line_num, column_num);
} else {
// Can't distinguish eval and script here, so always use Script.
PROFILE(isolate_,
CodeCreateEvent(
Logger::ToNativeByScript(Logger::SCRIPT_TAG, *script),
*code, *shared, NULL, *script_name));
+ isolate_->CodeCreateEvent(*code, *script_name);
}
} else {
PROFILE(isolate_,
@@ -1909,6 +1913,9 @@ void Logger::LogExistingFunction(Handle<SharedFunctionInfo> shared,
Logger::ToNativeByScript(Logger::LAZY_COMPILE_TAG, *script),
*code, *shared, NULL,
isolate_->heap()->empty_string(), line_num, column_num));
+ isolate_->CodeCreateEvent(*code, *shared,
+ isolate_->heap()->empty_string(),
+ line_num, column_num);
}
} else if (shared->IsApiFunction()) {
// API function.
@@ -1919,11 +1926,13 @@ void Logger::LogExistingFunction(Handle<SharedFunctionInfo> shared,
Object* callback_obj = call_data->callback();
Address entry_point = v8::ToCData<Address>(callback_obj);
PROFILE(isolate_, CallbackEvent(*func_name, entry_point));
+ isolate_->CodeCreateEvent(entry_point, "", *func_name);
}
} else {
PROFILE(isolate_,
CodeCreateEvent(
Logger::LAZY_COMPILE_TAG, *code, *shared, NULL, *func_name));
+ isolate_->CodeCreateEvent(*code, *func_name);
}
}
@@ -1963,10 +1972,12 @@ void Logger::LogAccessorCallbacks() {
Name* name = Name::cast(ai->name());
if (getter_entry != 0) {
PROFILE(isolate_, GetterCallbackEvent(name, getter_entry));
+ isolate_->CodeCreateEvent(getter_entry, "get ", name);
}
Address setter_entry = v8::ToCData<Address>(ai->setter());
if (setter_entry != 0) {
PROFILE(isolate_, SetterCallbackEvent(name, setter_entry));
+ isolate_->CodeCreateEvent(setter_entry, "set ", name);
}
}
}
@@ -2060,6 +2071,13 @@ bool Logger::SetUp(Isolate* isolate) {
profiler_->Engage();
}
+ // TODO(gholap): This one's for the new sampler API. (include/v8-sampler.h)
+ // Call to IncreaseProfilingDepth causes the
+ // SIGPROF signal handler to be installed on the VM thread.
+ // Figure out whether there's a way to only optionally
+ // do this based on a runtime flag.
+ ticker_->IncreaseProfilingDepth();
+
if (FLAG_log_internal_timer_events || FLAG_prof) timer_.Start();
return true;
« no previous file with comments | « src/isolate.cc ('k') | src/mips/regexp-macro-assembler-mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698