Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(159)

Side by Side Diff: src/compiler/verifier.cc

Issue 444583004: Verifier must ensure that start and end node of graph are set. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698