| 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/interpreter/bytecodes.h" |
| 21 #include "src/ostreams.h" | 22 #include "src/ostreams.h" |
| 22 | 23 |
| 23 namespace v8 { | 24 namespace v8 { |
| 24 namespace internal { | 25 namespace internal { |
| 25 namespace compiler { | 26 namespace compiler { |
| 26 | 27 |
| 27 | 28 |
| 28 FILE* OpenVisualizerLogFile(CompilationInfo* info, const char* phase, | 29 FILE* OpenVisualizerLogFile(CompilationInfo* info, const char* phase, |
| 29 const char* suffix, const char* mode) { | 30 const char* suffix, const char* mode) { |
| 30 EmbeddedVector<char, 256> filename(0); | 31 EmbeddedVector<char, 256> filename(0); |
| 31 base::SmartArrayPointer<char> function_name; | 32 base::SmartArrayPointer<char> function_name; |
| 32 if (info->has_shared_info()) { | 33 if (info->has_shared_info()) { |
| 33 function_name = info->shared_info()->DebugName()->ToCString(); | 34 function_name = info->shared_info()->DebugName()->ToCString(); |
| 34 if (strlen(function_name.get()) > 0) { | 35 if (strlen(function_name.get()) > 0) { |
| 35 SNPrintF(filename, "turbo-%s", function_name.get()); | 36 SNPrintF(filename, "turbo-%s", function_name.get()); |
| 36 } else { | 37 } else { |
| 37 SNPrintF(filename, "turbo-%p", static_cast<void*>(info)); | 38 SNPrintF(filename, "turbo-%p", static_cast<void*>(info)); |
| 38 } | 39 } |
| 40 } else if (info->IsBytecodeHandler()) { |
| 41 SNPrintF(filename, "turbo-bytecode-%s", |
| 42 interpreter::Bytecodes::ToString(info->bytecode())); |
| 39 } else { | 43 } else { |
| 40 SNPrintF(filename, "turbo-none-%s", phase); | 44 SNPrintF(filename, "turbo-none-%s", phase); |
| 41 } | 45 } |
| 42 std::replace(filename.start(), filename.start() + filename.length(), ' ', | 46 std::replace(filename.start(), filename.start() + filename.length(), ' ', |
| 43 '_'); | 47 '_'); |
| 44 | 48 |
| 45 EmbeddedVector<char, 256> full_filename; | 49 EmbeddedVector<char, 256> full_filename; |
| 46 if (phase == NULL) { | 50 if (phase == NULL) { |
| 47 SNPrintF(full_filename, "%s.%s", filename.start(), suffix); | 51 SNPrintF(full_filename, "%s.%s", filename.start(), suffix); |
| 48 } else { | 52 } else { |
| (...skipping 773 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 822 os << "#" << SafeId(i) << ":" << SafeMnemonic(i); | 826 os << "#" << SafeId(i) << ":" << SafeMnemonic(i); |
| 823 } | 827 } |
| 824 os << ")" << std::endl; | 828 os << ")" << std::endl; |
| 825 } | 829 } |
| 826 } | 830 } |
| 827 return os; | 831 return os; |
| 828 } | 832 } |
| 829 } // namespace compiler | 833 } // namespace compiler |
| 830 } // namespace internal | 834 } // namespace internal |
| 831 } // namespace v8 | 835 } // namespace v8 |
| OLD | NEW |