| 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 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 122 os_ << ",\"rankInputs\":[0]"; | 122 os_ << ",\"rankInputs\":[0]"; |
| 123 } | 123 } |
| 124 SourcePosition position = positions_->GetSourcePosition(node); | 124 SourcePosition position = positions_->GetSourcePosition(node); |
| 125 if (!position.IsUnknown()) { | 125 if (!position.IsUnknown()) { |
| 126 DCHECK(!position.IsInvalid()); | 126 DCHECK(!position.IsInvalid()); |
| 127 os_ << ",\"pos\":" << position.raw(); | 127 os_ << ",\"pos\":" << position.raw(); |
| 128 } | 128 } |
| 129 os_ << ",\"opcode\":\"" << IrOpcode::Mnemonic(node->opcode()) << "\""; | 129 os_ << ",\"opcode\":\"" << IrOpcode::Mnemonic(node->opcode()) << "\""; |
| 130 os_ << ",\"control\":" << (NodeProperties::IsControl(node) ? "true" | 130 os_ << ",\"control\":" << (NodeProperties::IsControl(node) ? "true" |
| 131 : "false"); | 131 : "false"); |
| 132 if (NodeProperties::IsTyped(node)) { |
| 133 Bounds bounds = NodeProperties::GetBounds(node); |
| 134 std::ostringstream upper; |
| 135 bounds.upper->PrintTo(upper); |
| 136 std::ostringstream lower; |
| 137 bounds.lower->PrintTo(lower); |
| 138 os_ << ",\"upper_type\":\"" << Escaped(upper, "\"") << "\""; |
| 139 os_ << ",\"lower_type\":\"" << Escaped(lower, "\"") << "\""; |
| 140 } |
| 132 os_ << "}"; | 141 os_ << "}"; |
| 133 } | 142 } |
| 134 | 143 |
| 135 private: | 144 private: |
| 136 std::ostream& os_; | 145 std::ostream& os_; |
| 137 AllNodes all_; | 146 AllNodes all_; |
| 138 const SourcePositionTable* positions_; | 147 const SourcePositionTable* positions_; |
| 139 bool first_node_; | 148 bool first_node_; |
| 140 | 149 |
| 141 DISALLOW_COPY_AND_ASSIGN(JSONGraphNodeWriter); | 150 DISALLOW_COPY_AND_ASSIGN(JSONGraphNodeWriter); |
| (...skipping 678 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 820 os << "#" << SafeId(i) << ":" << SafeMnemonic(i); | 829 os << "#" << SafeId(i) << ":" << SafeMnemonic(i); |
| 821 } | 830 } |
| 822 os << ")" << std::endl; | 831 os << ")" << std::endl; |
| 823 } | 832 } |
| 824 } | 833 } |
| 825 return os; | 834 return os; |
| 826 } | 835 } |
| 827 } | 836 } |
| 828 } | 837 } |
| 829 } // namespace v8::internal::compiler | 838 } // namespace v8::internal::compiler |
| OLD | NEW |