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 <memory> | 7 #include <memory> |
8 #include <sstream> | 8 #include <sstream> |
9 #include <string> | 9 #include <string> |
10 | 10 |
11 #include "src/code-stubs.h" | 11 #include "src/code-stubs.h" |
12 #include "src/compilation-info.h" | 12 #include "src/compilation-info.h" |
13 #include "src/compiler/all-nodes.h" | 13 #include "src/compiler/all-nodes.h" |
14 #include "src/compiler/compiler-source-position-table.h" | |
14 #include "src/compiler/graph.h" | 15 #include "src/compiler/graph.h" |
15 #include "src/compiler/node-properties.h" | 16 #include "src/compiler/node-properties.h" |
16 #include "src/compiler/node.h" | 17 #include "src/compiler/node.h" |
17 #include "src/compiler/opcodes.h" | 18 #include "src/compiler/opcodes.h" |
18 #include "src/compiler/operator-properties.h" | 19 #include "src/compiler/operator-properties.h" |
19 #include "src/compiler/operator.h" | 20 #include "src/compiler/operator.h" |
20 #include "src/compiler/register-allocator.h" | 21 #include "src/compiler/register-allocator.h" |
21 #include "src/compiler/schedule.h" | 22 #include "src/compiler/schedule.h" |
22 #include "src/compiler/scheduler.h" | 23 #include "src/compiler/scheduler.h" |
23 #include "src/interpreter/bytecodes.h" | 24 #include "src/interpreter/bytecodes.h" |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
144 } else if (opcode == IrOpcode::kIfTrue || opcode == IrOpcode::kIfFalse || | 145 } else if (opcode == IrOpcode::kIfTrue || opcode == IrOpcode::kIfFalse || |
145 opcode == IrOpcode::kLoop) { | 146 opcode == IrOpcode::kLoop) { |
146 os_ << ",\"rankInputs\":[" << NodeProperties::FirstControlIndex(node) | 147 os_ << ",\"rankInputs\":[" << NodeProperties::FirstControlIndex(node) |
147 << "]"; | 148 << "]"; |
148 } | 149 } |
149 if (opcode == IrOpcode::kBranch) { | 150 if (opcode == IrOpcode::kBranch) { |
150 os_ << ",\"rankInputs\":[0]"; | 151 os_ << ",\"rankInputs\":[0]"; |
151 } | 152 } |
152 SourcePosition position = positions_->GetSourcePosition(node); | 153 SourcePosition position = positions_->GetSourcePosition(node); |
153 if (position.IsKnown()) { | 154 if (position.IsKnown()) { |
154 os_ << ",\"pos\":" << position.raw(); | 155 os_ << ",\"pos\":" << position.ScriptOffset(); |
Yang
2016/11/04 14:32:59
Also here, include inlining id as well?
Tobias Tebbi
2016/11/07 15:10:34
Yes, but Turbolizer also needs support for this, s
| |
155 } | 156 } |
156 os_ << ",\"opcode\":\"" << IrOpcode::Mnemonic(node->opcode()) << "\""; | 157 os_ << ",\"opcode\":\"" << IrOpcode::Mnemonic(node->opcode()) << "\""; |
157 os_ << ",\"control\":" << (NodeProperties::IsControl(node) ? "true" | 158 os_ << ",\"control\":" << (NodeProperties::IsControl(node) ? "true" |
158 : "false"); | 159 : "false"); |
159 os_ << ",\"opinfo\":\"" << node->op()->ValueInputCount() << " v " | 160 os_ << ",\"opinfo\":\"" << node->op()->ValueInputCount() << " v " |
160 << node->op()->EffectInputCount() << " eff " | 161 << node->op()->EffectInputCount() << " eff " |
161 << node->op()->ControlInputCount() << " ctrl in, " | 162 << node->op()->ControlInputCount() << " ctrl in, " |
162 << node->op()->ValueOutputCount() << " v " | 163 << node->op()->ValueOutputCount() << " v " |
163 << node->op()->EffectOutputCount() << " eff " | 164 << node->op()->EffectOutputCount() << " eff " |
164 << node->op()->ControlOutputCount() << " ctrl out\""; | 165 << node->op()->ControlOutputCount() << " ctrl out\""; |
(...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
489 PrintIndent(); | 490 PrintIndent(); |
490 os_ << "0 " << uses << " "; | 491 os_ << "0 " << uses << " "; |
491 PrintNode(node); | 492 PrintNode(node); |
492 if (FLAG_trace_turbo_types) { | 493 if (FLAG_trace_turbo_types) { |
493 os_ << " "; | 494 os_ << " "; |
494 PrintType(node); | 495 PrintType(node); |
495 } | 496 } |
496 if (positions != nullptr) { | 497 if (positions != nullptr) { |
497 SourcePosition position = positions->GetSourcePosition(node); | 498 SourcePosition position = positions->GetSourcePosition(node); |
498 if (position.IsKnown()) { | 499 if (position.IsKnown()) { |
499 os_ << " pos:" << position.raw(); | 500 os_ << " pos:" << position.ScriptOffset(); |
Yang
2016/11/04 14:32:59
Same here.
| |
500 } | 501 } |
501 } | 502 } |
502 os_ << " <|@\n"; | 503 os_ << " <|@\n"; |
503 } | 504 } |
504 | 505 |
505 BasicBlock::Control control = current->control(); | 506 BasicBlock::Control control = current->control(); |
506 if (control != BasicBlock::kNone) { | 507 if (control != BasicBlock::kNone) { |
507 PrintIndent(); | 508 PrintIndent(); |
508 os_ << "0 0 "; | 509 os_ << "0 0 "; |
509 if (current->control_input() != nullptr) { | 510 if (current->control_input() != nullptr) { |
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
703 os << "]"; | 704 os << "]"; |
704 } | 705 } |
705 os << std::endl; | 706 os << std::endl; |
706 } | 707 } |
707 } | 708 } |
708 return os; | 709 return os; |
709 } | 710 } |
710 } // namespace compiler | 711 } // namespace compiler |
711 } // namespace internal | 712 } // namespace internal |
712 } // namespace v8 | 713 } // namespace v8 |
OLD | NEW |