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" |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
117 for (Node* const node : all_.live) PrintNode(node); | 117 for (Node* const node : all_.live) PrintNode(node); |
118 os_ << "\n"; | 118 os_ << "\n"; |
119 } | 119 } |
120 | 120 |
121 void PrintNode(Node* node) { | 121 void PrintNode(Node* node) { |
122 if (first_node_) { | 122 if (first_node_) { |
123 first_node_ = false; | 123 first_node_ = false; |
124 } else { | 124 } else { |
125 os_ << ",\n"; | 125 os_ << ",\n"; |
126 } | 126 } |
127 std::ostringstream label; | 127 std::ostringstream label, title; |
128 label << *node->op(); | 128 node->op()->PrintTo(label, Operator::PrintVerbosity::kSilent); |
| 129 node->op()->PrintTo(title, Operator::PrintVerbosity::kVerbose); |
129 os_ << "{\"id\":" << SafeId(node) << ",\"label\":\"" << Escaped(label, "\"") | 130 os_ << "{\"id\":" << SafeId(node) << ",\"label\":\"" << Escaped(label, "\"") |
130 << "\""; | 131 << "\"" |
| 132 << ",\"title\":\"" << Escaped(title, "\"") << "\""; |
131 IrOpcode::Value opcode = node->opcode(); | 133 IrOpcode::Value opcode = node->opcode(); |
132 if (IrOpcode::IsPhiOpcode(opcode)) { | 134 if (IrOpcode::IsPhiOpcode(opcode)) { |
133 os_ << ",\"rankInputs\":[0," << NodeProperties::FirstControlIndex(node) | 135 os_ << ",\"rankInputs\":[0," << NodeProperties::FirstControlIndex(node) |
134 << "]"; | 136 << "]"; |
135 os_ << ",\"rankWithInput\":[" << NodeProperties::FirstControlIndex(node) | 137 os_ << ",\"rankWithInput\":[" << NodeProperties::FirstControlIndex(node) |
136 << "]"; | 138 << "]"; |
137 } else if (opcode == IrOpcode::kIfTrue || opcode == IrOpcode::kIfFalse || | 139 } else if (opcode == IrOpcode::kIfTrue || opcode == IrOpcode::kIfFalse || |
138 opcode == IrOpcode::kLoop) { | 140 opcode == IrOpcode::kLoop) { |
139 os_ << ",\"rankInputs\":[" << NodeProperties::FirstControlIndex(node) | 141 os_ << ",\"rankInputs\":[" << NodeProperties::FirstControlIndex(node) |
140 << "]"; | 142 << "]"; |
(...skipping 548 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
689 os << "]"; | 691 os << "]"; |
690 } | 692 } |
691 os << std::endl; | 693 os << std::endl; |
692 } | 694 } |
693 } | 695 } |
694 return os; | 696 return os; |
695 } | 697 } |
696 } // namespace compiler | 698 } // namespace compiler |
697 } // namespace internal | 699 } // namespace internal |
698 } // namespace v8 | 700 } // namespace v8 |
OLD | NEW |