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

Unified Diff: src/crankshaft/hydrogen.cc

Issue 1913973004: Include file names in hydrogen logs (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix optimization id collection Created 4 years, 7 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/crankshaft/hydrogen.cc
diff --git a/src/crankshaft/hydrogen.cc b/src/crankshaft/hydrogen.cc
index 1f81cbaac425eb6e6d453ea7128e50036e1725cd..76d1ef51e2c3f9d666a654a4ab808b8c25f7579b 100644
--- a/src/crankshaft/hydrogen.cc
+++ b/src/crankshaft/hydrogen.cc
@@ -1378,10 +1378,14 @@ int HGraphBuilder::TraceInlinedFunction(Handle<SharedFunctionInfo> shared,
if (FLAG_hydrogen_track_positions && !script->source()->IsUndefined()) {
CodeTracer::Scope tracing_scope(isolate()->GetCodeTracer());
+ Object* source_name = script->name();
OFStream os(tracing_scope.file());
- os << "--- FUNCTION SOURCE (" << shared->DebugName()->ToCString().get()
- << ") id{" << info_->optimization_id() << "," << inline_id
- << "} ---\n";
+ os << "--- FUNCTION SOURCE (";
+ if (source_name->IsString()) {
+ os << String::cast(source_name)->ToCString().get() << ":";
+ }
+ os << shared->DebugName()->ToCString().get() << ") id{";
+ os << info_->optimization_id() << "," << inline_id << "} ---\n";
{
DisallowHeapAllocation no_allocation;
int start = shared->start_position();
@@ -13445,13 +13449,24 @@ std::ostream& operator<<(std::ostream& os, const HEnvironment& env) {
void HTracer::TraceCompilation(CompilationInfo* info) {
Tag tag(this, "compilation");
- base::SmartArrayPointer<char> name = info->GetDebugName();
+ std::string name;
+ Object* source_name = info->script()->name();
+ if (source_name->IsString()) {
+ String* str = String::cast(source_name);
+ if (str->length() > 0) {
+ name.append(str->ToCString().get());
+ name.append(":");
+ }
+ }
+ base::SmartArrayPointer<char> method_name = info->GetDebugName();
+ name.append(method_name.get());
if (info->IsOptimizing()) {
- PrintStringProperty("name", name.get());
+ PrintStringProperty("name", name.c_str());
PrintIndent();
- trace_.Add("method \"%s:%d\"\n", name.get(), info->optimization_id());
+ trace_.Add("method \"%s:%d\"\n", method_name.get(),
+ info->optimization_id());
} else {
- PrintStringProperty("name", name.get());
+ PrintStringProperty("name", name.c_str());
PrintStringProperty("method", "stub");
}
PrintLongProperty("date",
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698