Chromium Code Reviews| Index: src/compiler/pipeline.cc |
| diff --git a/src/compiler/pipeline.cc b/src/compiler/pipeline.cc |
| index fa0ff173b25703d3994b2d428160c953ee14c269..28801804ecd9fed6f000f5890f99cbe1451657b0 100644 |
| --- a/src/compiler/pipeline.cc |
| +++ b/src/compiler/pipeline.cc |
| @@ -22,6 +22,7 @@ |
| #include "src/compiler/verifier.h" |
| #include "src/hydrogen.h" |
| #include "src/ostreams.h" |
| +#include "src/utils.h" |
| namespace v8 { |
| namespace internal { |
| @@ -73,9 +74,22 @@ class PhaseStats { |
| void Pipeline::VerifyAndPrintGraph(Graph* graph, const char* phase) { |
| if (FLAG_trace_turbo) { |
| + Vector<char> str = Vector<char>::New(256); |
|
Michael Starzinger
2014/08/11 18:31:23
nit: s/str/filename/
sigurds
2014/08/12 09:24:49
Done.
|
| + SmartArrayPointer<char> name = |
| + info_->shared_info()->DebugName()->ToCString(); |
| + if (strlen(name.get()) > 0) { |
| + SNPrintF(str, "%s-%s.dot", name.get(), phase); |
|
Michael Starzinger
2014/08/11 18:31:23
Can we get a common prefix for all of the files? T
sigurds
2014/08/12 09:24:49
Done.
|
| + } else { |
| + SNPrintF(str, "%p-%s.dot", static_cast<void*>(info_), phase); |
| + } |
| + std::replace(str.start(), str.start() + str.length(), ' ', '_'); |
| + FILE* file = fopen(str.start(), "w+"); |
|
Michael Starzinger
2014/08/11 18:31:23
I think we will need to use base::OS::FOpen to mak
sigurds
2014/08/12 09:24:49
Done.
|
| + OFStream of(file); |
| + of << AsDOT(*graph); |
| + fclose(file); |
| + |
| OFStream os(stdout); |
| - os << "-- " << phase << " graph -----------------------------------\n" |
| - << AsDOT(*graph); |
| + os << "-- " << phase << " graph printed to file " << str.start() << "\n"; |
| } |
| if (VerifyGraphs()) Verifier::Run(graph); |
| } |