Commit c999da32 authored by Franziska Hinkelmann's avatar Franziska Hinkelmann Committed by Commit Bot

[profiler] Log code-source-info for each function

We were returning too early. Don't double-log the script, but log all
source-code-infos within it.

Bug: v8:7018
Change-Id: Icd29905ee1ae3444e30760cae0b0a18b55440335
Reviewed-on: https://chromium-review.googlesource.com/808165Reviewed-by: 's avatarJaroslav Sevcik <jarin@chromium.org>
Commit-Queue: Franziska Hinkelmann <franzih@chromium.org>
Cr-Commit-Position: refs/heads/master@{#49861}
parent 4048f5ff
......@@ -1049,27 +1049,25 @@ void Logger::CodeCreateEvent(CodeEventListener::LogEventsAndTags tag,
// Make sure the script is written to the log file.
Script* script = Script::cast(script_object);
int script_id = script->id();
if (logged_source_code_.find(script_id) != logged_source_code_.end()) {
return;
}
// This script has not been logged yet.
logged_source_code_.insert(script_id);
Object* source_object = script->source();
if (source_object->IsString()) {
String* source_code = String::cast(source_object);
msg << "script" << kNext << script_id << kNext;
if (logged_source_code_.find(script_id) == logged_source_code_.end()) {
// This script has not been logged yet.
logged_source_code_.insert(script_id);
Object* source_object = script->source();
if (source_object->IsString()) {
String* source_code = String::cast(source_object);
msg << "script" << kNext << script_id << kNext;
// Log the script name.
if (script->name()->IsString()) {
msg << String::cast(script->name()) << kNext;
} else {
msg << "<unknown>" << kNext;
}
// Log the script name.
if (script->name()->IsString()) {
msg << String::cast(script->name()) << kNext;
} else {
msg << "<unknown>" << kNext;
// Log the source code.
msg << source_code;
msg.WriteToLogFile();
}
// Log the source code.
msg << source_code;
msg.WriteToLogFile();
}
// We log source code information in the form:
......
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