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 | 9 |
10 #include "src/compiler/generic-algorithm.h" | 10 #include "src/compiler/generic-algorithm.h" |
(...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
300 CHECK_GE(count, static_cast<int>(rpo_order->size())); | 300 CHECK_GE(count, static_cast<int>(rpo_order->size())); |
301 for (BasicBlockVector::iterator b = rpo_order->begin(); b != rpo_order->end(); | 301 for (BasicBlockVector::iterator b = rpo_order->begin(); b != rpo_order->end(); |
302 ++b) { | 302 ++b) { |
303 CHECK_EQ((*b), schedule->GetBlockById((*b)->id())); | 303 CHECK_EQ((*b), schedule->GetBlockById((*b)->id())); |
304 } | 304 } |
305 | 305 |
306 // Verify RPO numbers of blocks. | 306 // Verify RPO numbers of blocks. |
307 CHECK_EQ(start, rpo_order->at(0)); // Start should be first. | 307 CHECK_EQ(start, rpo_order->at(0)); // Start should be first. |
308 for (size_t b = 0; b < rpo_order->size(); b++) { | 308 for (size_t b = 0; b < rpo_order->size(); b++) { |
309 BasicBlock* block = rpo_order->at(b); | 309 BasicBlock* block = rpo_order->at(b); |
310 CHECK_EQ(b, block->rpo_number_); | 310 CHECK_EQ(static_cast<int>(b), block->rpo_number_); |
311 BasicBlock* dom = schedule->dominator(block); | 311 BasicBlock* dom = schedule->dominator(block); |
312 if (b == 0) { | 312 if (b == 0) { |
313 // All blocks except start should have a dominator. | 313 // All blocks except start should have a dominator. |
314 CHECK_EQ(NULL, dom); | 314 CHECK_EQ(NULL, dom); |
315 } else { | 315 } else { |
316 // Check that the immediate dominator appears somewhere before the block. | 316 // Check that the immediate dominator appears somewhere before the block. |
317 CHECK_NE(NULL, dom); | 317 CHECK_NE(NULL, dom); |
318 CHECK_LT(dom->rpo_number_, block->rpo_number_); | 318 CHECK_LT(dom->rpo_number_, block->rpo_number_); |
319 } | 319 } |
320 } | 320 } |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
443 // Check inputs for all nodes in the block. | 443 // Check inputs for all nodes in the block. |
444 for (size_t i = 0; i < block->nodes_.size(); i++) { | 444 for (size_t i = 0; i < block->nodes_.size(); i++) { |
445 Node* node = block->nodes_[i]; | 445 Node* node = block->nodes_[i]; |
446 CheckInputsDominate(schedule, block, node, static_cast<int>(i) - 1); | 446 CheckInputsDominate(schedule, block, node, static_cast<int>(i) - 1); |
447 } | 447 } |
448 } | 448 } |
449 } | 449 } |
450 } | 450 } |
451 } | 451 } |
452 } // namespace v8::internal::compiler | 452 } // namespace v8::internal::compiler |
OLD | NEW |