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

Side by Side Diff: test/cctest/compiler/test-scheduler.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 | « test/cctest/compiler/test-schedule.cc ('k') | test/unittests/compiler/schedule-unittest.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 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 6
7 #include "src/compiler/access-builder.h" 7 #include "src/compiler/access-builder.h"
8 #include "src/compiler/common-operator.h" 8 #include "src/compiler/common-operator.h"
9 #include "src/compiler/graph.h" 9 #include "src/compiler/graph.h"
10 #include "src/compiler/graph-visualizer.h" 10 #include "src/compiler/graph-visualizer.h"
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 loop->nodes[i] = schedule->NewBasicBlock(); 79 loop->nodes[i] = schedule->NewBasicBlock();
80 if (i > 0) { 80 if (i > 0) {
81 schedule->AddSuccessorForTesting(loop->nodes[i - 1], loop->nodes[i]); 81 schedule->AddSuccessorForTesting(loop->nodes[i - 1], loop->nodes[i]);
82 } 82 }
83 } 83 }
84 schedule->AddSuccessorForTesting(loop->nodes[count - 1], loop->nodes[0]); 84 schedule->AddSuccessorForTesting(loop->nodes[count - 1], loop->nodes[0]);
85 return loop; 85 return loop;
86 } 86 }
87 87
88 88
89 static int GetScheduledNodeCount(Schedule* schedule) { 89 static int GetScheduledNodeCount(const Schedule* schedule) {
90 int node_count = 0; 90 size_t node_count = 0;
91 for (BasicBlockVectorIter i = schedule->rpo_order()->begin(); 91 for (auto block : *schedule->rpo_order()) {
92 i != schedule->rpo_order()->end(); ++i) { 92 node_count += block->NodeCount();
93 BasicBlock* block = *i; 93 if (block->control() != BasicBlock::kNone) ++node_count;
94 for (BasicBlock::const_iterator j = block->begin(); j != block->end();
95 ++j) {
96 ++node_count;
97 }
98 BasicBlock::Control control = block->control();
99 if (control != BasicBlock::kNone) {
100 ++node_count;
101 }
102 } 94 }
103 return node_count; 95 return static_cast<int>(node_count);
104 } 96 }
105 97
106 98
107 static Schedule* ComputeAndVerifySchedule(int expected, Graph* graph) { 99 static Schedule* ComputeAndVerifySchedule(int expected, Graph* graph) {
108 if (FLAG_trace_turbo) { 100 if (FLAG_trace_turbo) {
109 OFStream os(stdout); 101 OFStream os(stdout);
110 os << AsDOT(*graph); 102 os << AsDOT(*graph);
111 } 103 }
112 104
113 Schedule* schedule = Scheduler::ComputeSchedule(graph->zone(), graph); 105 Schedule* schedule = Scheduler::ComputeSchedule(graph->zone(), graph);
(...skipping 2001 matching lines...) Expand 10 before | Expand all | Expand 10 after
2115 graph.SetEnd(end); 2107 graph.SetEnd(end);
2116 2108
2117 Schedule* schedule = ComputeAndVerifySchedule(6, &graph); 2109 Schedule* schedule = ComputeAndVerifySchedule(6, &graph);
2118 BasicBlock* block = schedule->block(loop); 2110 BasicBlock* block = schedule->block(loop);
2119 CHECK_NE(NULL, loop); 2111 CHECK_NE(NULL, loop);
2120 CHECK_EQ(block, schedule->block(effect)); 2112 CHECK_EQ(block, schedule->block(effect));
2121 CHECK_GE(block->rpo_number(), 0); 2113 CHECK_GE(block->rpo_number(), 0);
2122 } 2114 }
2123 2115
2124 #endif 2116 #endif
OLDNEW
« no previous file with comments | « test/cctest/compiler/test-schedule.cc ('k') | test/unittests/compiler/schedule-unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698