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

Unified Diff: src/compiler/graph-visualizer.cc

Issue 2083863004: Include file names in trace_turbo output (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Remove : from filenames 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 | « no previous file | src/flag-definitions.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/graph-visualizer.cc
diff --git a/src/compiler/graph-visualizer.cc b/src/compiler/graph-visualizer.cc
index f2368931fa21ec3283c84f9260673b8e8b64464c..de47a35583365a4e250fc35adb47c8e50a90f952 100644
--- a/src/compiler/graph-visualizer.cc
+++ b/src/compiler/graph-visualizer.cc
@@ -36,15 +36,32 @@ base::SmartArrayPointer<const char> GetVisualizerLogFileName(
} else {
SNPrintF(filename, "turbo-none-%s", phase);
}
+ char* source_file = nullptr;
+ if (FLAG_trace_file_names && info->parse_info()) {
+ Object* source_name = info->script()->name();
+ if (source_name->IsString()) {
+ String* str = String::cast(source_name);
+ if (str->length() > 0) {
+ source_file = str->ToCString().get();
+ }
+ }
+ }
std::replace(filename.start(), filename.start() + filename.length(), ' ',
'_');
EmbeddedVector<char, 256> full_filename;
- if (phase == nullptr) {
+ if (phase == nullptr && source_file == nullptr) {
SNPrintF(full_filename, "%s.%s", filename.start(), suffix);
- } else {
+ } else if (phase != nullptr && source_file == nullptr) {
SNPrintF(full_filename, "%s-%s.%s", filename.start(), phase, suffix);
+ } else if (phase == nullptr && source_file != nullptr) {
+ SNPrintF(full_filename, "%s_%s.%s", filename.start(), source_file, suffix);
+ } else {
+ SNPrintF(full_filename, "%s_%s-%s.%s", filename.start(), source_file, phase,
+ suffix);
}
+ std::replace(full_filename.start(),
+ full_filename.start() + full_filename.length(), '/', '_');
char* buffer = new char[full_filename.length() + 1];
memcpy(buffer, full_filename.start(), full_filename.length());
« no previous file with comments | « no previous file | src/flag-definitions.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698