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 #include <sstream> | 9 #include <sstream> |
10 #include <string> | 10 #include <string> |
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
171 // Verify all control inputs are control nodes. | 171 // Verify all control inputs are control nodes. |
172 for (int i = 0; i < control_count; ++i) { | 172 for (int i = 0; i < control_count; ++i) { |
173 Node* control = NodeProperties::GetControlInput(node, i); | 173 Node* control = NodeProperties::GetControlInput(node, i); |
174 CHECK(control->op()->ControlOutputCount() > 0); | 174 CHECK(control->op()->ControlOutputCount() > 0); |
175 CHECK(IsDefUseChainLinkPresent(control, node)); | 175 CHECK(IsDefUseChainLinkPresent(control, node)); |
176 CHECK(IsUseDefChainLinkPresent(control, node)); | 176 CHECK(IsUseDefChainLinkPresent(control, node)); |
177 } | 177 } |
178 | 178 |
179 // Verify all successors are projections if multiple value outputs exist. | 179 // Verify all successors are projections if multiple value outputs exist. |
180 if (node->op()->ValueOutputCount() > 1) { | 180 if (node->op()->ValueOutputCount() > 1) { |
181 Node::Uses uses = node->uses(); | 181 for (auto edge : node->use_edges()) { |
182 for (Node::Uses::iterator it = uses.begin(); it != uses.end(); ++it) { | 182 Node* use = edge.from(); |
183 CHECK(!NodeProperties::IsValueEdge(it.edge()) || | 183 CHECK(!NodeProperties::IsValueEdge(edge) || |
184 (*it)->opcode() == IrOpcode::kProjection || | 184 use->opcode() == IrOpcode::kProjection || |
185 (*it)->opcode() == IrOpcode::kParameter); | 185 use->opcode() == IrOpcode::kParameter); |
186 } | 186 } |
187 } | 187 } |
188 | 188 |
189 switch (node->opcode()) { | 189 switch (node->opcode()) { |
190 case IrOpcode::kStart: | 190 case IrOpcode::kStart: |
191 // Start has no inputs. | 191 // Start has no inputs. |
192 CHECK_EQ(0, input_count); | 192 CHECK_EQ(0, input_count); |
193 // Type is a tuple. | 193 // Type is a tuple. |
194 // TODO(rossberg): Multiple outputs are currently typed as Internal. | 194 // TODO(rossberg): Multiple outputs are currently typed as Internal. |
195 CheckUpperIs(node, Type::Internal()); | 195 CheckUpperIs(node, Type::Internal()); |
(...skipping 775 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
971 // Check inputs for all nodes in the block. | 971 // Check inputs for all nodes in the block. |
972 for (size_t i = 0; i < block->NodeCount(); i++) { | 972 for (size_t i = 0; i < block->NodeCount(); i++) { |
973 Node* node = block->NodeAt(i); | 973 Node* node = block->NodeAt(i); |
974 CheckInputsDominate(schedule, block, node, static_cast<int>(i) - 1); | 974 CheckInputsDominate(schedule, block, node, static_cast<int>(i) - 1); |
975 } | 975 } |
976 } | 976 } |
977 } | 977 } |
978 } | 978 } |
979 } | 979 } |
980 } // namespace v8::internal::compiler | 980 } // namespace v8::internal::compiler |
OLD | NEW |