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

Side by Side Diff: test/cctest/compiler/test-scheduler.cc

Issue 705043002: Revert "Remove workaround for successors on end block from scheduler." (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 1 month 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 | « src/compiler/scheduler.cc ('k') | 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/v8.h" 5 #include "src/v8.h"
6 #include "test/cctest/cctest.h" 6 #include "test/cctest/cctest.h"
7 7
8 #include "src/compiler/access-builder.h" 8 #include "src/compiler/access-builder.h"
9 #include "src/compiler/common-operator.h" 9 #include "src/compiler/common-operator.h"
10 #include "src/compiler/generic-node-inl.h" 10 #include "src/compiler/generic-node-inl.h"
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after
193 BasicBlockVector* order = Scheduler::ComputeSpecialRPO(&zone_pool, &schedule); 193 BasicBlockVector* order = Scheduler::ComputeSpecialRPO(&zone_pool, &schedule);
194 CheckRPONumbers(order, 1, true); 194 CheckRPONumbers(order, 1, true);
195 BasicBlock* loop[] = {schedule.start()}; 195 BasicBlock* loop[] = {schedule.start()};
196 CheckLoop(order, loop, 1); 196 CheckLoop(order, loop, 1);
197 } 197 }
198 198
199 199
200 TEST(RPOEntryLoop) { 200 TEST(RPOEntryLoop) {
201 HandleAndZoneScope scope; 201 HandleAndZoneScope scope;
202 Schedule schedule(scope.main_zone()); 202 Schedule schedule(scope.main_zone());
203 BasicBlock* body = schedule.NewBasicBlock(); 203 schedule.AddSuccessorForTesting(schedule.start(), schedule.end());
204 schedule.AddSuccessorForTesting(schedule.start(), body); 204 schedule.AddSuccessorForTesting(schedule.end(), schedule.start());
205 schedule.AddSuccessorForTesting(body, schedule.start());
206 ZonePool zone_pool(scope.main_isolate()); 205 ZonePool zone_pool(scope.main_isolate());
207 BasicBlockVector* order = Scheduler::ComputeSpecialRPO(&zone_pool, &schedule); 206 BasicBlockVector* order = Scheduler::ComputeSpecialRPO(&zone_pool, &schedule);
208 CheckRPONumbers(order, 2, true); 207 CheckRPONumbers(order, 2, true);
209 BasicBlock* loop[] = {schedule.start(), body}; 208 BasicBlock* loop[] = {schedule.start(), schedule.end()};
210 CheckLoop(order, loop, 2); 209 CheckLoop(order, loop, 2);
211 } 210 }
212 211
213 212
214 TEST(RPOEndLoop) { 213 TEST(RPOEndLoop) {
215 HandleAndZoneScope scope; 214 HandleAndZoneScope scope;
216 Schedule schedule(scope.main_zone()); 215 Schedule schedule(scope.main_zone());
217 SmartPointer<TestLoop> loop1(CreateLoop(&schedule, 2)); 216 SmartPointer<TestLoop> loop1(CreateLoop(&schedule, 2));
218 schedule.AddSuccessorForTesting(schedule.start(), loop1->header()); 217 schedule.AddSuccessorForTesting(schedule.start(), loop1->header());
219 ZonePool zone_pool(scope.main_isolate()); 218 ZonePool zone_pool(scope.main_isolate());
(...skipping 427 matching lines...) Expand 10 before | Expand all | Expand 10 after
647 } 646 }
648 647
649 648
650 TEST(RPOLoopMultibackedge) { 649 TEST(RPOLoopMultibackedge) {
651 HandleAndZoneScope scope; 650 HandleAndZoneScope scope;
652 Schedule schedule(scope.main_zone()); 651 Schedule schedule(scope.main_zone());
653 652
654 BasicBlock* A = schedule.start(); 653 BasicBlock* A = schedule.start();
655 BasicBlock* B = schedule.NewBasicBlock(); 654 BasicBlock* B = schedule.NewBasicBlock();
656 BasicBlock* C = schedule.NewBasicBlock(); 655 BasicBlock* C = schedule.NewBasicBlock();
657 BasicBlock* D = schedule.NewBasicBlock(); 656 BasicBlock* D = schedule.end();
658 BasicBlock* E = schedule.NewBasicBlock(); 657 BasicBlock* E = schedule.NewBasicBlock();
659 658
660 schedule.AddSuccessorForTesting(A, B); 659 schedule.AddSuccessorForTesting(A, B);
661 schedule.AddSuccessorForTesting(B, C); 660 schedule.AddSuccessorForTesting(B, C);
662 schedule.AddSuccessorForTesting(B, D); 661 schedule.AddSuccessorForTesting(B, D);
663 schedule.AddSuccessorForTesting(B, E); 662 schedule.AddSuccessorForTesting(B, E);
664 schedule.AddSuccessorForTesting(C, B); 663 schedule.AddSuccessorForTesting(C, B);
665 schedule.AddSuccessorForTesting(D, B); 664 schedule.AddSuccessorForTesting(D, B);
666 schedule.AddSuccessorForTesting(E, B); 665 schedule.AddSuccessorForTesting(E, B);
667 666
(...skipping 1343 matching lines...) Expand 10 before | Expand all | Expand 10 after
2011 graph.SetEnd(end); 2010 graph.SetEnd(end);
2012 2011
2013 Schedule* schedule = ComputeAndVerifySchedule(6, &graph); 2012 Schedule* schedule = ComputeAndVerifySchedule(6, &graph);
2014 BasicBlock* block = schedule->block(loop); 2013 BasicBlock* block = schedule->block(loop);
2015 CHECK_NE(NULL, loop); 2014 CHECK_NE(NULL, loop);
2016 CHECK_EQ(block, schedule->block(effect)); 2015 CHECK_EQ(block, schedule->block(effect));
2017 CHECK_GE(block->rpo_number(), 0); 2016 CHECK_GE(block->rpo_number(), 0);
2018 } 2017 }
2019 2018
2020 #endif 2019 #endif
OLDNEW
« no previous file with comments | « src/compiler/scheduler.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698