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

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

Issue 642883003: [turbofan] Add support for deferred code. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Add cctest 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 | « src/compiler/schedule.cc ('k') | src/compiler/simplified-lowering.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 260 matching lines...) Expand 10 before | Expand all | Expand 10 after
271 BasicBlock* branch_block = schedule_->block(branch_block_node); 271 BasicBlock* branch_block = schedule_->block(branch_block_node);
272 DCHECK(branch_block != NULL); 272 DCHECK(branch_block != NULL);
273 273
274 BasicBlock* successor_blocks[2]; 274 BasicBlock* successor_blocks[2];
275 CollectSuccessorBlocks(branch, successor_blocks, IrOpcode::kIfTrue, 275 CollectSuccessorBlocks(branch, successor_blocks, IrOpcode::kIfTrue,
276 IrOpcode::kIfFalse); 276 IrOpcode::kIfFalse);
277 277
278 TraceConnect(branch, branch_block, successor_blocks[0]); 278 TraceConnect(branch, branch_block, successor_blocks[0]);
279 TraceConnect(branch, branch_block, successor_blocks[1]); 279 TraceConnect(branch, branch_block, successor_blocks[1]);
280 280
281 // Consider branch hints.
282 // TODO(turbofan): Propagate the deferred flag to all blocks dominated by
283 // this IfTrue/IfFalse later.
284 switch (BranchHintOf(branch->op())) {
285 case BranchHint::kNone:
286 break;
287 case BranchHint::kTrue:
288 successor_blocks[1]->set_deferred(true);
289 break;
290 case BranchHint::kFalse:
291 successor_blocks[0]->set_deferred(true);
292 break;
293 }
294
281 schedule_->AddBranch(branch_block, branch, successor_blocks[0], 295 schedule_->AddBranch(branch_block, branch, successor_blocks[0],
282 successor_blocks[1]); 296 successor_blocks[1]);
283 } 297 }
284 298
285 void ConnectMerge(Node* merge) { 299 void ConnectMerge(Node* merge) {
286 // Don't connect the special merge at the end to its predecessors. 300 // Don't connect the special merge at the end to its predecessors.
287 if (IsFinalMerge(merge)) return; 301 if (IsFinalMerge(merge)) return;
288 302
289 BasicBlock* block = schedule_->block(merge); 303 BasicBlock* block = schedule_->block(merge);
290 DCHECK(block != NULL); 304 DCHECK(block != NULL);
(...skipping 897 matching lines...) Expand 10 before | Expand all | Expand 10 after
1188 current->set_loop_depth(loop_depth); 1202 current->set_loop_depth(loop_depth);
1189 if (current->loop_header() == NULL) { 1203 if (current->loop_header() == NULL) {
1190 Trace("B%d is not in a loop (depth == %d)\n", current->id().ToInt(), 1204 Trace("B%d is not in a loop (depth == %d)\n", current->id().ToInt(),
1191 current->loop_depth()); 1205 current->loop_depth());
1192 } else { 1206 } else {
1193 Trace("B%d has loop header B%d, (depth == %d)\n", current->id().ToInt(), 1207 Trace("B%d has loop header B%d, (depth == %d)\n", current->id().ToInt(),
1194 current->loop_header()->id().ToInt(), current->loop_depth()); 1208 current->loop_header()->id().ToInt(), current->loop_depth());
1195 } 1209 }
1196 } 1210 }
1197 1211
1212 // Compute the assembly order (non-deferred code first, deferred code
1213 // afterwards).
1214 int32_t number = 0;
1215 for (auto block : *final_order) {
1216 if (block->deferred()) continue;
1217 block->set_ao_number(number++);
1218 }
1219 for (auto block : *final_order) {
1220 if (!block->deferred()) continue;
1221 block->set_ao_number(number++);
1222 }
1223
1198 #if DEBUG 1224 #if DEBUG
1199 if (FLAG_trace_turbo_scheduler) PrintRPO(num_loops, loops, final_order); 1225 if (FLAG_trace_turbo_scheduler) PrintRPO(num_loops, loops, final_order);
1200 VerifySpecialRPO(num_loops, loops, final_order); 1226 VerifySpecialRPO(num_loops, loops, final_order);
1201 #endif 1227 #endif
1202 return final_order; 1228 return final_order;
1203 } 1229 }
1204 1230
1205 } // namespace compiler 1231 } // namespace compiler
1206 } // namespace internal 1232 } // namespace internal
1207 } // namespace v8 1233 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/schedule.cc ('k') | src/compiler/simplified-lowering.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698