| OLD | NEW |
| 1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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/graph-visualizer.h" | 5 #include "src/compiler/graph-visualizer.h" |
| 6 | 6 |
| 7 #include <sstream> | 7 #include <sstream> |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "src/code-stubs.h" | 10 #include "src/code-stubs.h" |
| 11 #include "src/compiler/all-nodes.h" | 11 #include "src/compiler/all-nodes.h" |
| 12 #include "src/compiler/graph.h" | 12 #include "src/compiler/graph.h" |
| 13 #include "src/compiler/node.h" | 13 #include "src/compiler/node.h" |
| 14 #include "src/compiler/node-properties.h" | 14 #include "src/compiler/node-properties.h" |
| 15 #include "src/compiler/opcodes.h" | 15 #include "src/compiler/opcodes.h" |
| 16 #include "src/compiler/operator.h" | 16 #include "src/compiler/operator.h" |
| 17 #include "src/compiler/operator-properties.h" | 17 #include "src/compiler/operator-properties.h" |
| 18 #include "src/compiler/register-allocator.h" | 18 #include "src/compiler/register-allocator.h" |
| 19 #include "src/compiler/schedule.h" | 19 #include "src/compiler/schedule.h" |
| 20 #include "src/compiler/scheduler.h" | 20 #include "src/compiler/scheduler.h" |
| 21 #include "src/ostreams.h" | 21 #include "src/ostreams.h" |
| 22 | 22 |
| 23 namespace v8 { | 23 namespace v8 { |
| 24 namespace internal { | 24 namespace internal { |
| 25 namespace compiler { | 25 namespace compiler { |
| 26 | 26 |
| 27 | 27 |
| 28 FILE* OpenVisualizerLogFile(CompilationInfo* info, const char* phase, | 28 FILE* OpenVisualizerLogFile(CompilationInfo* info, const char* phase, |
| 29 const char* suffix, const char* mode) { | 29 const char* suffix, const char* mode) { |
| 30 EmbeddedVector<char, 256> filename; | 30 EmbeddedVector<char, 256> filename(0); |
| 31 SmartArrayPointer<char> function_name; | 31 SmartArrayPointer<char> function_name; |
| 32 if (!info->shared_info().is_null()) { | 32 if (info->has_shared_info()) { |
| 33 function_name = info->shared_info()->DebugName()->ToCString(); | 33 function_name = info->shared_info()->DebugName()->ToCString(); |
| 34 if (strlen(function_name.get()) > 0) { | 34 if (strlen(function_name.get()) > 0) { |
| 35 SNPrintF(filename, "turbo-%s", function_name.get()); | 35 SNPrintF(filename, "turbo-%s", function_name.get()); |
| 36 } else { | 36 } else { |
| 37 SNPrintF(filename, "turbo-%p", static_cast<void*>(info)); | 37 SNPrintF(filename, "turbo-%p", static_cast<void*>(info)); |
| 38 } | 38 } |
| 39 } else { | 39 } else { |
| 40 SNPrintF(filename, "turbo-none-%s", phase); | 40 SNPrintF(filename, "turbo-none-%s", phase); |
| 41 } | 41 } |
| 42 std::replace(filename.start(), filename.start() + filename.length(), ' ', | 42 std::replace(filename.start(), filename.start() + filename.length(), ' ', |
| (...skipping 772 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 815 os << "#" << SafeId(i) << ":" << SafeMnemonic(i); | 815 os << "#" << SafeId(i) << ":" << SafeMnemonic(i); |
| 816 } | 816 } |
| 817 os << ")" << std::endl; | 817 os << ")" << std::endl; |
| 818 } | 818 } |
| 819 } | 819 } |
| 820 return os; | 820 return os; |
| 821 } | 821 } |
| 822 } | 822 } |
| 823 } | 823 } |
| 824 } // namespace v8::internal::compiler | 824 } // namespace v8::internal::compiler |
| OLD | NEW |