| 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 "src/compiler/generic-algorithm.h" | 7 #include "src/compiler/generic-algorithm.h" |
| 8 #include "src/compiler/generic-node-inl.h" | 8 #include "src/compiler/generic-node-inl.h" |
| 9 #include "src/compiler/generic-node.h" | 9 #include "src/compiler/generic-node.h" |
| 10 #include "src/compiler/graph-inl.h" | 10 #include "src/compiler/graph-inl.h" |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 51 | 51 |
| 52 bool from_start; | 52 bool from_start; |
| 53 NodeSet reached_from_start; | 53 NodeSet reached_from_start; |
| 54 NodeSet reached_from_end; | 54 NodeSet reached_from_end; |
| 55 }; | 55 }; |
| 56 | 56 |
| 57 | 57 |
| 58 GenericGraphVisit::Control Verifier::Visitor::Pre(Node* node) { | 58 GenericGraphVisit::Control Verifier::Visitor::Pre(Node* node) { |
| 59 int value_count = OperatorProperties::GetValueInputCount(node->op()); | 59 int value_count = OperatorProperties::GetValueInputCount(node->op()); |
| 60 int context_count = OperatorProperties::GetContextInputCount(node->op()); | 60 int context_count = OperatorProperties::GetContextInputCount(node->op()); |
| 61 int frame_state_count = |
| 62 OperatorProperties::GetFrameStateInputCount(node->op()); |
| 61 int effect_count = OperatorProperties::GetEffectInputCount(node->op()); | 63 int effect_count = OperatorProperties::GetEffectInputCount(node->op()); |
| 62 int control_count = OperatorProperties::GetControlInputCount(node->op()); | 64 int control_count = OperatorProperties::GetControlInputCount(node->op()); |
| 63 | 65 |
| 64 // Verify number of inputs matches up. | 66 // Verify number of inputs matches up. |
| 65 int input_count = value_count + context_count + effect_count + control_count; | 67 int input_count = value_count + context_count + frame_state_count + |
| 68 effect_count + control_count; |
| 66 CHECK_EQ(input_count, node->InputCount()); | 69 CHECK_EQ(input_count, node->InputCount()); |
| 67 | 70 |
| 68 // Verify all value inputs actually produce a value. | 71 // Verify all value inputs actually produce a value. |
| 69 for (int i = 0; i < value_count; ++i) { | 72 for (int i = 0; i < value_count; ++i) { |
| 70 Node* value = NodeProperties::GetValueInput(node, i); | 73 Node* value = NodeProperties::GetValueInput(node, i); |
| 71 CHECK(OperatorProperties::HasValueOutput(value->op())); | 74 CHECK(OperatorProperties::HasValueOutput(value->op())); |
| 72 CHECK(IsDefUseChainLinkPresent(value, node)); | 75 CHECK(IsDefUseChainLinkPresent(value, node)); |
| 73 CHECK(IsUseDefChainLinkPresent(value, node)); | 76 CHECK(IsUseDefChainLinkPresent(value, node)); |
| 74 } | 77 } |
| 75 | 78 |
| (...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 236 // All control nodes reachable from end are reachable from start. | 239 // All control nodes reachable from end are reachable from start. |
| 237 for (NodeSet::iterator it = visitor.reached_from_end.begin(); | 240 for (NodeSet::iterator it = visitor.reached_from_end.begin(); |
| 238 it != visitor.reached_from_end.end(); ++it) { | 241 it != visitor.reached_from_end.end(); ++it) { |
| 239 CHECK(!NodeProperties::IsControl(*it) || | 242 CHECK(!NodeProperties::IsControl(*it) || |
| 240 visitor.reached_from_start.count(*it)); | 243 visitor.reached_from_start.count(*it)); |
| 241 } | 244 } |
| 242 } | 245 } |
| 243 } | 246 } |
| 244 } | 247 } |
| 245 } // namespace v8::internal::compiler | 248 } // namespace v8::internal::compiler |
| OLD | NEW |