| 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 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 144 CheckOutput(effect, node, effect->op()->EffectOutputCount(), "effect"); | 144 CheckOutput(effect, node, effect->op()->EffectOutputCount(), "effect"); |
| 145 } | 145 } |
| 146 | 146 |
| 147 // Verify all control inputs are control nodes. | 147 // Verify all control inputs are control nodes. |
| 148 for (int i = 0; i < control_count; ++i) { | 148 for (int i = 0; i < control_count; ++i) { |
| 149 Node* control = NodeProperties::GetControlInput(node, i); | 149 Node* control = NodeProperties::GetControlInput(node, i); |
| 150 CheckOutput(control, node, control->op()->ControlOutputCount(), | 150 CheckOutput(control, node, control->op()->ControlOutputCount(), |
| 151 "control"); | 151 "control"); |
| 152 } | 152 } |
| 153 | 153 |
| 154 // Verify that no-no-throw nodes only have IfSuccess/IfException control | 154 // Verify that nodes that can throw only have IfSuccess/IfException control |
| 155 // uses. | 155 // uses. |
| 156 if (!node->op()->HasProperty(Operator::kNoThrow)) { | 156 if (!node->op()->HasProperty(Operator::kNoThrow)) { |
| 157 int count_success = 0, count_exception = 0; | 157 int count_success = 0, count_exception = 0; |
| 158 for (Edge edge : node->use_edges()) { | 158 for (Edge edge : node->use_edges()) { |
| 159 if (!NodeProperties::IsControlEdge(edge)) { | 159 if (!NodeProperties::IsControlEdge(edge)) { |
| 160 continue; | 160 continue; |
| 161 } | 161 } |
| 162 Node* control_use = edge.from(); | 162 Node* control_use = edge.from(); |
| 163 if (control_use->opcode() != IrOpcode::kIfSuccess && | 163 if (control_use->opcode() != IrOpcode::kIfSuccess && |
| 164 control_use->opcode() != IrOpcode::kIfException) { | 164 control_use->opcode() != IrOpcode::kIfException) { |
| (...skipping 1513 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1678 replacement->op()->EffectOutputCount() > 0); | 1678 replacement->op()->EffectOutputCount() > 0); |
| 1679 DCHECK(!NodeProperties::IsFrameStateEdge(edge) || | 1679 DCHECK(!NodeProperties::IsFrameStateEdge(edge) || |
| 1680 replacement->opcode() == IrOpcode::kFrameState); | 1680 replacement->opcode() == IrOpcode::kFrameState); |
| 1681 } | 1681 } |
| 1682 | 1682 |
| 1683 #endif // DEBUG | 1683 #endif // DEBUG |
| 1684 | 1684 |
| 1685 } // namespace compiler | 1685 } // namespace compiler |
| 1686 } // namespace internal | 1686 } // namespace internal |
| 1687 } // namespace v8 | 1687 } // namespace v8 |
| OLD | NEW |