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

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

Issue 864293002: [turbofan] Cleanup Schedule and related classes. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Address auto comments. Created 5 years, 11 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
« no previous file with comments | « src/compiler/scheduler.cc ('k') | test/cctest/cctest.gyp » ('j') | 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 <algorithm> 7 #include <algorithm>
8 #include <deque> 8 #include <deque>
9 #include <queue> 9 #include <queue>
10 #include <sstream> 10 #include <sstream>
(...skipping 822 matching lines...) Expand 10 before | Expand all | Expand 10 after
833 Zone* zone = &tmp_zone; 833 Zone* zone = &tmp_zone;
834 BasicBlock* start = schedule->start(); 834 BasicBlock* start = schedule->start();
835 BasicBlockVector* rpo_order = schedule->rpo_order(); 835 BasicBlockVector* rpo_order = schedule->rpo_order();
836 836
837 // Verify the RPO order contains only blocks from this schedule. 837 // Verify the RPO order contains only blocks from this schedule.
838 CHECK_GE(count, rpo_order->size()); 838 CHECK_GE(count, rpo_order->size());
839 for (BasicBlockVector::iterator b = rpo_order->begin(); b != rpo_order->end(); 839 for (BasicBlockVector::iterator b = rpo_order->begin(); b != rpo_order->end();
840 ++b) { 840 ++b) {
841 CHECK_EQ((*b), schedule->GetBlockById((*b)->id())); 841 CHECK_EQ((*b), schedule->GetBlockById((*b)->id()));
842 // All predecessors and successors should be in rpo and in this schedule. 842 // All predecessors and successors should be in rpo and in this schedule.
843 for (BasicBlock::Predecessors::iterator j = (*b)->predecessors_begin(); 843 for (BasicBlock const* predecessor : (*b)->predecessors()) {
844 j != (*b)->predecessors_end(); ++j) { 844 CHECK_GE(predecessor->rpo_number(), 0);
845 CHECK_GE((*j)->rpo_number(), 0); 845 CHECK_EQ(predecessor, schedule->GetBlockById(predecessor->id()));
846 CHECK_EQ((*j), schedule->GetBlockById((*j)->id()));
847 } 846 }
848 for (BasicBlock::Successors::iterator j = (*b)->successors_begin(); 847 for (BasicBlock const* successor : (*b)->successors()) {
849 j != (*b)->successors_end(); ++j) { 848 CHECK_GE(successor->rpo_number(), 0);
850 CHECK_GE((*j)->rpo_number(), 0); 849 CHECK_EQ(successor, schedule->GetBlockById(successor->id()));
851 CHECK_EQ((*j), schedule->GetBlockById((*j)->id()));
852 } 850 }
853 } 851 }
854 852
855 // Verify RPO numbers of blocks. 853 // Verify RPO numbers of blocks.
856 CHECK_EQ(start, rpo_order->at(0)); // Start should be first. 854 CHECK_EQ(start, rpo_order->at(0)); // Start should be first.
857 for (size_t b = 0; b < rpo_order->size(); b++) { 855 for (size_t b = 0; b < rpo_order->size(); b++) {
858 BasicBlock* block = rpo_order->at(b); 856 BasicBlock* block = rpo_order->at(b);
859 CHECK_EQ(static_cast<int>(b), block->rpo_number()); 857 CHECK_EQ(static_cast<int>(b), block->rpo_number());
860 BasicBlock* dom = block->dominator(); 858 BasicBlock* dom = block->dominator();
861 if (b == 0) { 859 if (b == 0) {
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
993 // Check inputs for all nodes in the block. 991 // Check inputs for all nodes in the block.
994 for (size_t i = 0; i < block->NodeCount(); i++) { 992 for (size_t i = 0; i < block->NodeCount(); i++) {
995 Node* node = block->NodeAt(i); 993 Node* node = block->NodeAt(i);
996 CheckInputsDominate(schedule, block, node, static_cast<int>(i) - 1); 994 CheckInputsDominate(schedule, block, node, static_cast<int>(i) - 1);
997 } 995 }
998 } 996 }
999 } 997 }
1000 } 998 }
1001 } 999 }
1002 } // namespace v8::internal::compiler 1000 } // namespace v8::internal::compiler
OLDNEW
« no previous file with comments | « src/compiler/scheduler.cc ('k') | test/cctest/cctest.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698