Commit 05e92849 authored by mattloring's avatar mattloring Committed by Commit bot

Include file names in trace-opt/trace-deopt output

Trace-opt/trace-deopt output is ambiguous if multiple functions share
the same name. This change adds file names to this output behind the
--trace-file-names flag to reduce this ambiguity.

R=ofrobots@google.com
BUG=

Review URL: https://codereview.chromium.org/1920873003

Cr-Commit-Position: refs/heads/master@{#35824}
parent 41acd51b
......@@ -573,6 +573,8 @@ DEFINE_BOOL(mask_constants_with_cookie, true,
DEFINE_BOOL(lazy, true, "use lazy compilation")
DEFINE_BOOL(trace_opt, false, "trace lazy optimization")
DEFINE_BOOL(trace_opt_stats, false, "trace lazy optimization statistics")
DEFINE_BOOL(trace_file_names, false,
"include file names in trace-opt/trace-deopt output")
DEFINE_BOOL(opt, true, "use adaptive optimizations")
DEFINE_BOOL(always_opt, false, "always try to optimize functions")
DEFINE_BOOL(always_osr, false, "always try to OSR functions")
......
......@@ -1921,6 +1921,18 @@ void JSObject::JSObjectShortPrint(StringStream* accumulator) {
if (!printed) {
accumulator->Add("<JS Function");
}
if (FLAG_trace_file_names) {
Object* source_name =
Script::cast(function->shared()->script())->name();
if (source_name->IsString()) {
String* str = String::cast(source_name);
if (str->length() > 0) {
accumulator->Add(" <");
accumulator->Put(str);
accumulator->Add(">");
}
}
}
accumulator->Add(" (SharedFunctionInfo %p)",
reinterpret_cast<void*>(function->shared()));
accumulator->Put('>');
......
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