| 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 <deque> | 7 #include <deque> |
| 8 #include <queue> | 8 #include <queue> |
| 9 | 9 |
| 10 #include "src/compiler/generic-algorithm.h" | 10 #include "src/compiler/generic-algorithm.h" |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 int control_count = OperatorProperties::GetControlInputCount(node->op()); | 69 int control_count = OperatorProperties::GetControlInputCount(node->op()); |
| 70 | 70 |
| 71 // Verify number of inputs matches up. | 71 // Verify number of inputs matches up. |
| 72 int input_count = value_count + context_count + frame_state_count + | 72 int input_count = value_count + context_count + frame_state_count + |
| 73 effect_count + control_count; | 73 effect_count + control_count; |
| 74 CHECK_EQ(input_count, node->InputCount()); | 74 CHECK_EQ(input_count, node->InputCount()); |
| 75 | 75 |
| 76 // Verify that frame state has been inserted for the nodes that need it. | 76 // Verify that frame state has been inserted for the nodes that need it. |
| 77 if (OperatorProperties::HasFrameStateInput(node->op())) { | 77 if (OperatorProperties::HasFrameStateInput(node->op())) { |
| 78 Node* frame_state = NodeProperties::GetFrameStateInput(node); | 78 Node* frame_state = NodeProperties::GetFrameStateInput(node); |
| 79 CHECK(frame_state->opcode() == IrOpcode::kFrameState); | 79 CHECK(frame_state->opcode() == IrOpcode::kFrameState || |
| 80 // kFrameState uses undefined as a sentinel. |
| 81 (node->opcode() == IrOpcode::kFrameState && |
| 82 frame_state->opcode() == IrOpcode::kHeapConstant)); |
| 80 CHECK(IsDefUseChainLinkPresent(frame_state, node)); | 83 CHECK(IsDefUseChainLinkPresent(frame_state, node)); |
| 81 CHECK(IsUseDefChainLinkPresent(frame_state, node)); | 84 CHECK(IsUseDefChainLinkPresent(frame_state, node)); |
| 82 } | 85 } |
| 83 | 86 |
| 84 // Verify all value inputs actually produce a value. | 87 // Verify all value inputs actually produce a value. |
| 85 for (int i = 0; i < value_count; ++i) { | 88 for (int i = 0; i < value_count; ++i) { |
| 86 Node* value = NodeProperties::GetValueInput(node, i); | 89 Node* value = NodeProperties::GetValueInput(node, i); |
| 87 CHECK(OperatorProperties::HasValueOutput(value->op())); | 90 CHECK(OperatorProperties::HasValueOutput(value->op())); |
| 88 CHECK(IsDefUseChainLinkPresent(value, node)); | 91 CHECK(IsDefUseChainLinkPresent(value, node)); |
| 89 CHECK(IsUseDefChainLinkPresent(value, node)); | 92 CHECK(IsUseDefChainLinkPresent(value, node)); |
| (...skipping 352 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 442 // Check inputs for all nodes in the block. | 445 // Check inputs for all nodes in the block. |
| 443 for (size_t i = 0; i < block->nodes_.size(); i++) { | 446 for (size_t i = 0; i < block->nodes_.size(); i++) { |
| 444 Node* node = block->nodes_[i]; | 447 Node* node = block->nodes_[i]; |
| 445 CheckInputsDominate(schedule, block, node, static_cast<int>(i) - 1); | 448 CheckInputsDominate(schedule, block, node, static_cast<int>(i) - 1); |
| 446 } | 449 } |
| 447 } | 450 } |
| 448 } | 451 } |
| 449 } | 452 } |
| 450 } | 453 } |
| 451 } // namespace v8::internal::compiler | 454 } // namespace v8::internal::compiler |
| OLD | NEW |