Reviewers: jarin,
Description:
Scheduler checks that end block doesn't have successors.
[email protected]
TEST=cctest/test-scheduler/RPOLoop
Please review this at https://codereview.chromium.org/710333002/
Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Affected files (+7, -6 lines):
M src/compiler/scheduler.cc
M test/cctest/compiler/test-scheduler.cc
Index: src/compiler/scheduler.cc
diff --git a/src/compiler/scheduler.cc b/src/compiler/scheduler.cc
index
af8fba0d116f5695edfd39d8e24bf847eee3fae7..8d125ac2d989f1eee8dcf484bb8594b520f24b5c
100644
--- a/src/compiler/scheduler.cc
+++ b/src/compiler/scheduler.cc
@@ -535,9 +535,9 @@ class SpecialRPONumberer : public ZoneObject {
// Computes the special reverse-post-order for the main control flow
graph,
// that is for the graph spanned between the schedule's start and end
blocks.
void ComputeSpecialRPO() {
+ DCHECK(schedule_->end()->SuccessorCount() == 0);
DCHECK_EQ(NULL, order_); // Main order does not exist yet.
- // TODO(mstarzinger): Should use Schedule::end() after tests are fixed.
- ComputeAndInsertSpecialRPO(schedule_->start(), NULL);
+ ComputeAndInsertSpecialRPO(schedule_->start(), schedule_->end());
}
// Computes the special reverse-post-order for a partial control flow
graph,
Index: test/cctest/compiler/test-scheduler.cc
diff --git a/test/cctest/compiler/test-scheduler.cc
b/test/cctest/compiler/test-scheduler.cc
index
f835265201eb704b012abf761d99d453eaac9e85..447422d121ac249799ac1879b2d4bd111e75dbfa
100644
--- a/test/cctest/compiler/test-scheduler.cc
+++ b/test/cctest/compiler/test-scheduler.cc
@@ -203,12 +203,13 @@ TEST(RPOSelfLoop) {
TEST(RPOEntryLoop) {
HandleAndZoneScope scope;
Schedule schedule(scope.main_zone());
- schedule.AddSuccessorForTesting(schedule.start(), schedule.end());
- schedule.AddSuccessorForTesting(schedule.end(), schedule.start());
+ BasicBlock* body = schedule.NewBasicBlock();
+ schedule.AddSuccessorForTesting(schedule.start(), body);
+ schedule.AddSuccessorForTesting(body, schedule.start());
ZonePool zone_pool(scope.main_isolate());
BasicBlockVector* order = Scheduler::ComputeSpecialRPO(&zone_pool,
&schedule);
CheckRPONumbers(order, 2, true);
- BasicBlock* loop[] = {schedule.start(), schedule.end()};
+ BasicBlock* loop[] = {schedule.start(), body};
CheckLoop(order, loop, 2);
}
@@ -656,7 +657,7 @@ TEST(RPOLoopMultibackedge) {
BasicBlock* A = schedule.start();
BasicBlock* B = schedule.NewBasicBlock();
BasicBlock* C = schedule.NewBasicBlock();
- BasicBlock* D = schedule.end();
+ BasicBlock* D = schedule.NewBasicBlock();
BasicBlock* E = schedule.NewBasicBlock();
schedule.AddSuccessorForTesting(A, B);
--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.