| 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 812 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1062 // Check inputs for all nodes in the block. | 1069 // Check inputs for all nodes in the block. |
| 1063 for (size_t i = 0; i < block->NodeCount(); i++) { | 1070 for (size_t i = 0; i < block->NodeCount(); i++) { |
| 1064 Node* node = block->NodeAt(i); | 1071 Node* node = block->NodeAt(i); |
| 1065 CheckInputsDominate(schedule, block, node, static_cast<int>(i) - 1); | 1072 CheckInputsDominate(schedule, block, node, static_cast<int>(i) - 1); |
| 1066 } | 1073 } |
| 1067 } | 1074 } |
| 1068 } | 1075 } |
| 1069 } | 1076 } |
| 1070 } | 1077 } |
| 1071 } // namespace v8::internal::compiler | 1078 } // namespace v8::internal::compiler |
| OLD | NEW |