Chromium Code Reviews| 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 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 66 int frame_state_count = | 66 int frame_state_count = |
| 67 OperatorProperties::GetFrameStateInputCount(node->op()); | 67 OperatorProperties::GetFrameStateInputCount(node->op()); |
| 68 int effect_count = OperatorProperties::GetEffectInputCount(node->op()); | 68 int effect_count = OperatorProperties::GetEffectInputCount(node->op()); |
| 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. | |
| 77 if (OperatorProperties::HasFrameStateInput(node->op())) { | |
| 78 CHECK(NodeProperties::GetFrameStateInput(node)->op()->opcode() == | |
|
Michael Starzinger
2014/09/01 23:10:46
nit: There should be Node::opcode() directly IIRC.
| |
| 79 IrOpcode::kFrameState); | |
|
Michael Starzinger
2014/09/01 23:10:46
suggestion: Do you think it makes sense to check t
| |
| 80 } | |
| 81 | |
| 76 // Verify all value inputs actually produce a value. | 82 // Verify all value inputs actually produce a value. |
| 77 for (int i = 0; i < value_count; ++i) { | 83 for (int i = 0; i < value_count; ++i) { |
| 78 Node* value = NodeProperties::GetValueInput(node, i); | 84 Node* value = NodeProperties::GetValueInput(node, i); |
| 79 CHECK(OperatorProperties::HasValueOutput(value->op())); | 85 CHECK(OperatorProperties::HasValueOutput(value->op())); |
| 80 CHECK(IsDefUseChainLinkPresent(value, node)); | 86 CHECK(IsDefUseChainLinkPresent(value, node)); |
| 81 CHECK(IsUseDefChainLinkPresent(value, node)); | 87 CHECK(IsUseDefChainLinkPresent(value, node)); |
| 82 } | 88 } |
| 83 | 89 |
| 84 // Verify all context inputs are value nodes. | 90 // Verify all context inputs are value nodes. |
| 85 for (int i = 0; i < context_count; ++i) { | 91 for (int i = 0; i < context_count; ++i) { |
| (...skipping 348 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 434 // Check inputs for all nodes in the block. | 440 // Check inputs for all nodes in the block. |
| 435 for (size_t i = 0; i < block->nodes_.size(); i++) { | 441 for (size_t i = 0; i < block->nodes_.size(); i++) { |
| 436 Node* node = block->nodes_[i]; | 442 Node* node = block->nodes_[i]; |
| 437 CheckInputsDominate(schedule, block, node, static_cast<int>(i) - 1); | 443 CheckInputsDominate(schedule, block, node, static_cast<int>(i) - 1); |
| 438 } | 444 } |
| 439 } | 445 } |
| 440 } | 446 } |
| 441 } | 447 } |
| 442 } | 448 } |
| 443 } // namespace v8::internal::compiler | 449 } // namespace v8::internal::compiler |
| OLD | NEW |