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

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

Issue 1977843002: [turbofan] Simplify handling of JSON tracing files. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@local_fix-trace-turbo-again
Patch Set: 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 | « src/compiler/graph-visualizer.h ('k') | src/compiler/pipeline.cc » ('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 f431ab5d4d1a68b016045c61d1182363939c74f1..1dc38df0d965c89d50a5ffa3e8db5453295e9845 100644
--- a/src/compiler/graph-visualizer.cc
+++ b/src/compiler/graph-visualizer.cc
@@ -25,9 +25,8 @@ namespace v8 {
namespace internal {
namespace compiler {
-
-FILE* OpenVisualizerLogFile(CompilationInfo* info, const char* phase,
- const char* suffix, const char* mode) {
+base::SmartArrayPointer<const char> GetVisualizerLogFileName(
+ CompilationInfo* info, const char* phase, const char* suffix) {
EmbeddedVector<char, 256> filename(0);
base::SmartArrayPointer<char> debug_name = info->GetDebugName();
if (strlen(debug_name.get()) > 0) {
@@ -46,7 +45,11 @@ FILE* OpenVisualizerLogFile(CompilationInfo* info, const char* phase,
} else {
SNPrintF(full_filename, "%s-%s.%s", filename.start(), phase, suffix);
}
- return base::OS::FOpen(full_filename.start(), mode);
+
+ char* buffer = new char[full_filename.length() + 1];
+ memcpy(buffer, full_filename.start(), full_filename.length());
+ buffer[full_filename.length()] = '\0';
+ return base::SmartArrayPointer<const char>(buffer);
}
« no previous file with comments | « src/compiler/graph-visualizer.h ('k') | src/compiler/pipeline.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698