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

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

Issue 603533002: [turbofan] more verification of rpo (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 2 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 | test/cctest/compiler/test-run-machops.cc » ('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 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 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 <deque> 5 #include <deque>
6 #include <queue> 6 #include <queue>
7 7
8 #include "src/compiler/scheduler.h" 8 #include "src/compiler/scheduler.h"
9 9
10 #include "src/compiler/graph.h" 10 #include "src/compiler/graph.h"
(...skipping 847 matching lines...) Expand 10 before | Expand all | Expand 10 after
858 PrintF("\n"); 858 PrintF("\n");
859 } 859 }
860 } 860 }
861 861
862 862
863 static void VerifySpecialRPO(int num_loops, LoopInfo* loops, 863 static void VerifySpecialRPO(int num_loops, LoopInfo* loops,
864 BasicBlockVector* order) { 864 BasicBlockVector* order) {
865 DCHECK(order->size() > 0); 865 DCHECK(order->size() > 0);
866 DCHECK((*order)[0]->id() == 0); // entry should be first. 866 DCHECK((*order)[0]->id() == 0); // entry should be first.
867 867
868 // All predecessors and successors should be in rpo.
869 for (BasicBlockVector::iterator i = order->begin(); i != order->end(); ++i) {
870 BasicBlock* block = *i;
871 BasicBlock::Predecessors p = block->predecessors();
872 for (BasicBlock::Predecessors::iterator j = p.begin(); j != p.end(); ++j) {
873 DCHECK((*j)->rpo_number_ >= 0);
874 }
875 BasicBlock::Successors s = block->successors();
876 for (BasicBlock::Successors::iterator j = s.begin(); j != s.end(); ++j) {
877 DCHECK((*j)->rpo_number_ >= 0);
878 }
879 }
titzer 2014/09/25 14:52:58 Can we put this new code into ScheduleVerifier::Ru
dcarney 2014/09/29 13:29:54 Done.
880
868 for (int i = 0; i < num_loops; i++) { 881 for (int i = 0; i < num_loops; i++) {
869 LoopInfo* loop = &loops[i]; 882 LoopInfo* loop = &loops[i];
870 BasicBlock* header = loop->header; 883 BasicBlock* header = loop->header;
871 884
872 DCHECK(header != NULL); 885 DCHECK(header != NULL);
873 DCHECK(header->rpo_number_ >= 0); 886 DCHECK(header->rpo_number_ >= 0);
874 DCHECK(header->rpo_number_ < static_cast<int>(order->size())); 887 DCHECK(header->rpo_number_ < static_cast<int>(order->size()));
875 DCHECK(header->loop_end_ >= 0); 888 DCHECK(header->loop_end_ >= 0);
876 DCHECK(header->loop_end_ <= static_cast<int>(order->size())); 889 DCHECK(header->loop_end_ <= static_cast<int>(order->size()));
877 DCHECK(header->loop_end_ > header->rpo_number_); 890 DCHECK(header->loop_end_ > header->rpo_number_);
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after
1116 1129
1117 #if DEBUG 1130 #if DEBUG
1118 if (FLAG_trace_turbo_scheduler) PrintRPO(num_loops, loops, final_order); 1131 if (FLAG_trace_turbo_scheduler) PrintRPO(num_loops, loops, final_order);
1119 VerifySpecialRPO(num_loops, loops, final_order); 1132 VerifySpecialRPO(num_loops, loops, final_order);
1120 #endif 1133 #endif
1121 return final_order; 1134 return final_order;
1122 } 1135 }
1123 } 1136 }
1124 } 1137 }
1125 } // namespace v8::internal::compiler 1138 } // namespace v8::internal::compiler
OLDNEW
« no previous file with comments | « no previous file | test/cctest/compiler/test-run-machops.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698