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::kIfSuccess: | 231 case IrOpcode::kIfSuccess: { |
232 case IrOpcode::kIfException: { | |
233 // IfSuccess and IfException continuation only on throwing nodes. | 232 // IfSuccess and IfException continuation only on throwing nodes. |
234 Node* input = NodeProperties::GetControlInput(node, 0); | 233 Node* input = NodeProperties::GetControlInput(node, 0); |
235 CHECK(!input->op()->HasProperty(Operator::kNoThrow)); | 234 CHECK(!input->op()->HasProperty(Operator::kNoThrow)); |
236 // Type is empty. | 235 // Type is empty. |
237 CheckNotTyped(node); | 236 CheckNotTyped(node); |
238 break; | 237 break; |
239 } | 238 } |
| 239 case IrOpcode::kIfException: { |
| 240 // IfSuccess and IfException continuation only on throwing nodes. |
| 241 Node* input = NodeProperties::GetControlInput(node, 0); |
| 242 CHECK(!input->op()->HasProperty(Operator::kNoThrow)); |
| 243 // Type can be anything. |
| 244 CheckUpperIs(node, Type::Any()); |
| 245 break; |
| 246 } |
240 case IrOpcode::kSwitch: { | 247 case IrOpcode::kSwitch: { |
241 // Switch uses are Case and Default. | 248 // Switch uses are Case and Default. |
242 int count_case = 0, count_default = 0; | 249 int count_case = 0, count_default = 0; |
243 for (auto use : node->uses()) { | 250 for (auto use : node->uses()) { |
244 switch (use->opcode()) { | 251 switch (use->opcode()) { |
245 case IrOpcode::kIfValue: { | 252 case IrOpcode::kIfValue: { |
246 for (auto user : node->uses()) { | 253 for (auto user : node->uses()) { |
247 if (user != use && user->opcode() == IrOpcode::kIfValue) { | 254 if (user != use && user->opcode() == IrOpcode::kIfValue) { |
248 CHECK_NE(OpParameter<int32_t>(use->op()), | 255 CHECK_NE(OpParameter<int32_t>(use->op()), |
249 OpParameter<int32_t>(user->op())); | 256 OpParameter<int32_t>(user->op())); |
(...skipping 832 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1082 // Check inputs for all nodes in the block. | 1089 // Check inputs for all nodes in the block. |
1083 for (size_t i = 0; i < block->NodeCount(); i++) { | 1090 for (size_t i = 0; i < block->NodeCount(); i++) { |
1084 Node* node = block->NodeAt(i); | 1091 Node* node = block->NodeAt(i); |
1085 CheckInputsDominate(schedule, block, node, static_cast<int>(i) - 1); | 1092 CheckInputsDominate(schedule, block, node, static_cast<int>(i) - 1); |
1086 } | 1093 } |
1087 } | 1094 } |
1088 } | 1095 } |
1089 } | 1096 } |
1090 } | 1097 } |
1091 } // namespace v8::internal::compiler | 1098 } // namespace v8::internal::compiler |
OLD | NEW |