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 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
217 reached_from_end.insert(node); | 217 reached_from_end.insert(node); |
218 } | 218 } |
219 | 219 |
220 return GenericGraphVisit::CONTINUE; | 220 return GenericGraphVisit::CONTINUE; |
221 } | 221 } |
222 | 222 |
223 | 223 |
224 void Verifier::Run(Graph* graph) { | 224 void Verifier::Run(Graph* graph) { |
225 Visitor visitor(graph->zone()); | 225 Visitor visitor(graph->zone()); |
226 | 226 |
| 227 CHECK_NE(NULL, graph->start()); |
227 visitor.from_start = true; | 228 visitor.from_start = true; |
228 graph->VisitNodeUsesFromStart(&visitor); | 229 graph->VisitNodeUsesFromStart(&visitor); |
| 230 CHECK_NE(NULL, graph->end()); |
229 visitor.from_start = false; | 231 visitor.from_start = false; |
230 graph->VisitNodeInputsFromEnd(&visitor); | 232 graph->VisitNodeInputsFromEnd(&visitor); |
231 | 233 |
232 // All control nodes reachable from end are reachable from start. | 234 // All control nodes reachable from end are reachable from start. |
233 for (NodeSet::iterator it = visitor.reached_from_end.begin(); | 235 for (NodeSet::iterator it = visitor.reached_from_end.begin(); |
234 it != visitor.reached_from_end.end(); ++it) { | 236 it != visitor.reached_from_end.end(); ++it) { |
235 CHECK(!NodeProperties::IsControl(*it) || | 237 CHECK(!NodeProperties::IsControl(*it) || |
236 visitor.reached_from_start.count(*it)); | 238 visitor.reached_from_start.count(*it)); |
237 } | 239 } |
238 } | 240 } |
239 } | 241 } |
240 } | 242 } |
241 } // namespace v8::internal::compiler | 243 } // namespace v8::internal::compiler |
OLD | NEW |