OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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/verifier.h" | 5 #include "src/compiler/verifier.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <deque> | 8 #include <deque> |
9 #include <queue> | 9 #include <queue> |
10 #include <sstream> | 10 #include <sstream> |
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
187 case IrOpcode::kEnd: | 187 case IrOpcode::kEnd: |
188 // End has no outputs. | 188 // End has no outputs. |
189 CHECK(node->op()->ValueOutputCount() == 0); | 189 CHECK(node->op()->ValueOutputCount() == 0); |
190 CHECK(node->op()->EffectOutputCount() == 0); | 190 CHECK(node->op()->EffectOutputCount() == 0); |
191 CHECK(node->op()->ControlOutputCount() == 0); | 191 CHECK(node->op()->ControlOutputCount() == 0); |
192 // Type is empty. | 192 // Type is empty. |
193 CheckNotTyped(node); | 193 CheckNotTyped(node); |
194 break; | 194 break; |
195 case IrOpcode::kDead: | 195 case IrOpcode::kDead: |
196 // Dead is never connected to the graph. | 196 // Dead is never connected to the graph. |
197 UNREACHABLE(); | 197 // TODO(mstarzinger): Make the GraphReducer immediately perform control |
| 198 // reduction in case control is killed. This will prevent {Dead} from |
| 199 // being reachable after a phase finished. Then re-enable below assert. |
| 200 // UNREACHABLE(); |
198 break; | 201 break; |
199 case IrOpcode::kBranch: { | 202 case IrOpcode::kBranch: { |
200 // Branch uses are IfTrue and IfFalse. | 203 // Branch uses are IfTrue and IfFalse. |
201 int count_true = 0, count_false = 0; | 204 int count_true = 0, count_false = 0; |
202 for (auto use : node->uses()) { | 205 for (auto use : node->uses()) { |
203 CHECK(use->opcode() == IrOpcode::kIfTrue || | 206 CHECK(use->opcode() == IrOpcode::kIfTrue || |
204 use->opcode() == IrOpcode::kIfFalse); | 207 use->opcode() == IrOpcode::kIfFalse); |
205 if (use->opcode() == IrOpcode::kIfTrue) ++count_true; | 208 if (use->opcode() == IrOpcode::kIfTrue) ++count_true; |
206 if (use->opcode() == IrOpcode::kIfFalse) ++count_false; | 209 if (use->opcode() == IrOpcode::kIfFalse) ++count_false; |
207 } | 210 } |
(...skipping 920 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1128 // Check inputs for all nodes in the block. | 1131 // Check inputs for all nodes in the block. |
1129 for (size_t i = 0; i < block->NodeCount(); i++) { | 1132 for (size_t i = 0; i < block->NodeCount(); i++) { |
1130 Node* node = block->NodeAt(i); | 1133 Node* node = block->NodeAt(i); |
1131 CheckInputsDominate(schedule, block, node, static_cast<int>(i) - 1); | 1134 CheckInputsDominate(schedule, block, node, static_cast<int>(i) - 1); |
1132 } | 1135 } |
1133 } | 1136 } |
1134 } | 1137 } |
1135 } // namespace compiler | 1138 } // namespace compiler |
1136 } // namespace internal | 1139 } // namespace internal |
1137 } // namespace v8 | 1140 } // namespace v8 |
OLD | NEW |