OLD | NEW |
---|---|
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "src/compiler/pipeline.h" | 5 #include "src/compiler/pipeline.h" |
6 | 6 |
7 #include "src/base/platform/elapsed-timer.h" | 7 #include "src/base/platform/elapsed-timer.h" |
8 #include "src/compiler/ast-graph-builder.h" | 8 #include "src/compiler/ast-graph-builder.h" |
9 #include "src/compiler/change-lowering.h" | 9 #include "src/compiler/change-lowering.h" |
10 #include "src/compiler/code-generator.h" | 10 #include "src/compiler/code-generator.h" |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
88 | 88 |
89 | 89 |
90 void Pipeline::VerifyAndPrintGraph(Graph* graph, const char* phase) { | 90 void Pipeline::VerifyAndPrintGraph(Graph* graph, const char* phase) { |
91 if (FLAG_trace_turbo) { | 91 if (FLAG_trace_turbo) { |
92 char buffer[256]; | 92 char buffer[256]; |
93 Vector<char> filename(buffer, sizeof(buffer)); | 93 Vector<char> filename(buffer, sizeof(buffer)); |
94 if (!info_->shared_info().is_null()) { | 94 if (!info_->shared_info().is_null()) { |
95 SmartArrayPointer<char> functionname = | 95 SmartArrayPointer<char> functionname = |
96 info_->shared_info()->DebugName()->ToCString(); | 96 info_->shared_info()->DebugName()->ToCString(); |
97 if (strlen(functionname.get()) > 0) { | 97 if (strlen(functionname.get()) > 0) { |
98 SNPrintF(filename, "turbo-%s-%s.dot", functionname.get(), phase); | 98 SNPrintF(filename, "turbo-%s-%s.json", functionname.get(), phase); |
99 } else { | 99 } else { |
100 SNPrintF(filename, "turbo-%p-%s.dot", static_cast<void*>(info_), phase); | 100 SNPrintF(filename, "turbo-%p-%s.json", static_cast<void*>(info_), |
101 phase); | |
101 } | 102 } |
102 } else { | 103 } else { |
103 SNPrintF(filename, "turbo-none-%s.dot", phase); | 104 SNPrintF(filename, "turbo-none-%s.json", phase); |
104 } | 105 } |
105 std::replace(filename.start(), filename.start() + filename.length(), ' ', | 106 std::replace(filename.start(), filename.start() + filename.length(), ' ', |
106 '_'); | 107 '_'); |
107 FILE* file = base::OS::FOpen(filename.start(), "w+"); | 108 FILE* file = base::OS::FOpen(filename.start(), "w+"); |
108 OFStream of(file); | 109 OFStream of(file); |
109 of << AsDOT(*graph); | 110 of << AsJSON(*graph); |
Michael Starzinger
2014/09/25 11:02:50
This seems to disable dumping of ".dot" files, I t
| |
110 fclose(file); | 111 fclose(file); |
111 | 112 |
112 OFStream os(stdout); | 113 OFStream os(stdout); |
113 os << "-- " << phase << " graph printed to file " << filename.start() | 114 os << "-- " << phase << " graph printed to file " << filename.start() |
114 << "\n"; | 115 << "\n"; |
115 } | 116 } |
116 if (VerifyGraphs()) Verifier::Run(graph); | 117 if (VerifyGraphs()) Verifier::Run(graph); |
117 } | 118 } |
118 | 119 |
119 | 120 |
(...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
413 } | 414 } |
414 | 415 |
415 | 416 |
416 void Pipeline::TearDown() { | 417 void Pipeline::TearDown() { |
417 InstructionOperand::TearDownCaches(); | 418 InstructionOperand::TearDownCaches(); |
418 } | 419 } |
419 | 420 |
420 } // namespace compiler | 421 } // namespace compiler |
421 } // namespace internal | 422 } // namespace internal |
422 } // namespace v8 | 423 } // namespace v8 |
OLD | NEW |