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 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
221 CheckNotTyped(node); | 221 CheckNotTyped(node); |
222 break; | 222 break; |
223 } | 223 } |
224 case IrOpcode::kIfTrue: | 224 case IrOpcode::kIfTrue: |
225 case IrOpcode::kIfFalse: | 225 case IrOpcode::kIfFalse: |
226 CHECK_EQ(IrOpcode::kBranch, | 226 CHECK_EQ(IrOpcode::kBranch, |
227 NodeProperties::GetControlInput(node, 0)->opcode()); | 227 NodeProperties::GetControlInput(node, 0)->opcode()); |
228 // Type is empty. | 228 // Type is empty. |
229 CheckNotTyped(node); | 229 CheckNotTyped(node); |
230 break; | 230 break; |
| 231 case IrOpcode::kSwitch: { |
| 232 // Switch uses are Case. |
| 233 std::vector<bool> uses; |
| 234 uses.resize(node->UseCount()); |
| 235 for (auto use : node->uses()) { |
| 236 CHECK_EQ(IrOpcode::kCase, use->opcode()); |
| 237 size_t const index = CaseIndexOf(use->op()); |
| 238 CHECK_LT(index, uses.size()); |
| 239 CHECK(!uses[index]); |
| 240 uses[index] = true; |
| 241 } |
| 242 // Type is empty. |
| 243 CheckNotTyped(node); |
| 244 break; |
| 245 } |
| 246 case IrOpcode::kCase: |
| 247 CHECK_EQ(IrOpcode::kSwitch, |
| 248 NodeProperties::GetControlInput(node)->opcode()); |
| 249 // Type is empty. |
| 250 CheckNotTyped(node); |
| 251 break; |
231 case IrOpcode::kLoop: | 252 case IrOpcode::kLoop: |
232 case IrOpcode::kMerge: | 253 case IrOpcode::kMerge: |
233 CHECK_EQ(control_count, input_count); | 254 CHECK_EQ(control_count, input_count); |
234 // Type is empty. | 255 // Type is empty. |
235 CheckNotTyped(node); | 256 CheckNotTyped(node); |
236 break; | 257 break; |
237 case IrOpcode::kReturn: | 258 case IrOpcode::kReturn: |
238 // TODO(rossberg): check successor is End | 259 // TODO(rossberg): check successor is End |
239 // Type is empty. | 260 // Type is empty. |
240 CheckNotTyped(node); | 261 CheckNotTyped(node); |
(...skipping 760 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1001 // Check inputs for all nodes in the block. | 1022 // Check inputs for all nodes in the block. |
1002 for (size_t i = 0; i < block->NodeCount(); i++) { | 1023 for (size_t i = 0; i < block->NodeCount(); i++) { |
1003 Node* node = block->NodeAt(i); | 1024 Node* node = block->NodeAt(i); |
1004 CheckInputsDominate(schedule, block, node, static_cast<int>(i) - 1); | 1025 CheckInputsDominate(schedule, block, node, static_cast<int>(i) - 1); |
1005 } | 1026 } |
1006 } | 1027 } |
1007 } | 1028 } |
1008 } | 1029 } |
1009 } | 1030 } |
1010 } // namespace v8::internal::compiler | 1031 } // namespace v8::internal::compiler |
OLD | NEW |