| 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 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 263 // Type is empty. | 263 // Type is empty. |
| 264 CheckNotTyped(node); | 264 CheckNotTyped(node); |
| 265 break; | 265 break; |
| 266 case IrOpcode::kLoop: | 266 case IrOpcode::kLoop: |
| 267 case IrOpcode::kMerge: | 267 case IrOpcode::kMerge: |
| 268 CHECK_EQ(control_count, input_count); | 268 CHECK_EQ(control_count, input_count); |
| 269 // Type is empty. | 269 // Type is empty. |
| 270 CheckNotTyped(node); | 270 CheckNotTyped(node); |
| 271 break; | 271 break; |
| 272 case IrOpcode::kDeoptimize: | 272 case IrOpcode::kDeoptimize: |
| 273 // TODO(rossberg): check successor is End | 273 // Deoptimize uses are End. |
| 274 for (auto use : node->uses()) { |
| 275 CHECK_EQ(IrOpcode::kEnd, use->opcode()); |
| 276 } |
| 274 // Type is empty. | 277 // Type is empty. |
| 275 CheckNotTyped(node); | 278 CheckNotTyped(node); |
| 276 case IrOpcode::kReturn: | 279 case IrOpcode::kReturn: |
| 277 // TODO(rossberg): check successor is End | 280 // Return uses are End. |
| 281 for (auto use : node->uses()) { |
| 282 CHECK_EQ(IrOpcode::kEnd, use->opcode()); |
| 283 } |
| 278 // Type is empty. | 284 // Type is empty. |
| 279 CheckNotTyped(node); | 285 CheckNotTyped(node); |
| 280 break; | 286 break; |
| 281 case IrOpcode::kThrow: | 287 case IrOpcode::kThrow: |
| 282 // TODO(rossberg): what are the constraints on these? | 288 // TODO(rossberg): what are the constraints on these? |
| 283 // Type is empty. | 289 // Type is empty. |
| 284 CheckNotTyped(node); | 290 CheckNotTyped(node); |
| 285 break; | 291 break; |
| 286 case IrOpcode::kTerminate: | 292 case IrOpcode::kTerminate: |
| 287 CHECK_EQ(IrOpcode::kLoop, | 293 // Terminates take one loop and effect. |
| 288 NodeProperties::GetControlInput(node)->opcode()); | |
| 289 // Type is empty. | |
| 290 CheckNotTyped(node); | |
| 291 CHECK_EQ(1, control_count); | 294 CHECK_EQ(1, control_count); |
| 292 CHECK_EQ(1, effect_count); | 295 CHECK_EQ(1, effect_count); |
| 293 CHECK_EQ(2, input_count); | 296 CHECK_EQ(2, input_count); |
| 297 CHECK_EQ(IrOpcode::kLoop, |
| 298 NodeProperties::GetControlInput(node)->opcode()); |
| 299 // Terminate uses are End. |
| 300 for (auto use : node->uses()) { |
| 301 CHECK_EQ(IrOpcode::kEnd, use->opcode()); |
| 302 } |
| 303 // Type is empty. |
| 304 CheckNotTyped(node); |
| 294 break; | 305 break; |
| 295 case IrOpcode::kOsrNormalEntry: | 306 case IrOpcode::kOsrNormalEntry: |
| 296 case IrOpcode::kOsrLoopEntry: | 307 case IrOpcode::kOsrLoopEntry: |
| 297 // Osr entries have | 308 // Osr entries take one control and effect. |
| 309 CHECK_EQ(1, control_count); |
| 298 CHECK_EQ(1, effect_count); | 310 CHECK_EQ(1, effect_count); |
| 299 CHECK_EQ(1, control_count); | 311 CHECK_EQ(2, input_count); |
| 300 // Type is empty. | 312 // Type is empty. |
| 301 CheckNotTyped(node); | 313 CheckNotTyped(node); |
| 302 break; | 314 break; |
| 303 | 315 |
| 304 // Common operators | 316 // Common operators |
| 305 // ---------------- | 317 // ---------------- |
| 306 case IrOpcode::kParameter: { | 318 case IrOpcode::kParameter: { |
| 307 // Parameters have the start node as inputs. | 319 // Parameters have the start node as inputs. |
| 308 CHECK_EQ(1, input_count); | 320 CHECK_EQ(1, input_count); |
| 309 CHECK_EQ(IrOpcode::kStart, | 321 CHECK_EQ(IrOpcode::kStart, |
| (...skipping 790 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1100 // Check inputs for all nodes in the block. | 1112 // Check inputs for all nodes in the block. |
| 1101 for (size_t i = 0; i < block->NodeCount(); i++) { | 1113 for (size_t i = 0; i < block->NodeCount(); i++) { |
| 1102 Node* node = block->NodeAt(i); | 1114 Node* node = block->NodeAt(i); |
| 1103 CheckInputsDominate(schedule, block, node, static_cast<int>(i) - 1); | 1115 CheckInputsDominate(schedule, block, node, static_cast<int>(i) - 1); |
| 1104 } | 1116 } |
| 1105 } | 1117 } |
| 1106 } | 1118 } |
| 1107 } // namespace compiler | 1119 } // namespace compiler |
| 1108 } // namespace internal | 1120 } // namespace internal |
| 1109 } // namespace v8 | 1121 } // namespace v8 |
| OLD | NEW |