OLD | NEW |
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 "src/compiler/schedule.h" | 5 #include "src/compiler/schedule.h" |
6 | 6 |
7 #include "src/compiler/node.h" | 7 #include "src/compiler/node.h" |
8 #include "src/compiler/node-properties.h" | 8 #include "src/compiler/node-properties.h" |
9 #include "src/ostreams.h" | 9 #include "src/ostreams.h" |
10 | 10 |
(...skipping 326 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
337 DCHECK(block->PredecessorCount() > 1 && block != end_); | 337 DCHECK(block->PredecessorCount() > 1 && block != end_); |
338 for (auto current_pred = block->predecessors().begin(); | 338 for (auto current_pred = block->predecessors().begin(); |
339 current_pred != block->predecessors().end(); ++current_pred) { | 339 current_pred != block->predecessors().end(); ++current_pred) { |
340 BasicBlock* pred = *current_pred; | 340 BasicBlock* pred = *current_pred; |
341 if (pred->SuccessorCount() > 1) { | 341 if (pred->SuccessorCount() > 1) { |
342 // Found a predecessor block with multiple successors. | 342 // Found a predecessor block with multiple successors. |
343 BasicBlock* split_edge_block = NewBasicBlock(); | 343 BasicBlock* split_edge_block = NewBasicBlock(); |
344 split_edge_block->set_control(BasicBlock::kGoto); | 344 split_edge_block->set_control(BasicBlock::kGoto); |
345 split_edge_block->successors().push_back(block); | 345 split_edge_block->successors().push_back(block); |
346 split_edge_block->predecessors().push_back(pred); | 346 split_edge_block->predecessors().push_back(pred); |
347 split_edge_block->set_deferred(pred->deferred()); | 347 split_edge_block->set_deferred(block->deferred()); |
348 *current_pred = split_edge_block; | 348 *current_pred = split_edge_block; |
349 // Find a corresponding successor in the previous block, replace it | 349 // Find a corresponding successor in the previous block, replace it |
350 // with the split edge block... but only do it once, since we only | 350 // with the split edge block... but only do it once, since we only |
351 // replace the previous blocks in the current block one at a time. | 351 // replace the previous blocks in the current block one at a time. |
352 for (auto successor = pred->successors().begin(); | 352 for (auto successor = pred->successors().begin(); |
353 successor != pred->successors().end(); ++successor) { | 353 successor != pred->successors().end(); ++successor) { |
354 if (*successor == block) { | 354 if (*successor == block) { |
355 *successor = split_edge_block; | 355 *successor = split_edge_block; |
356 break; | 356 break; |
357 } | 357 } |
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
502 } | 502 } |
503 os << "\n"; | 503 os << "\n"; |
504 } | 504 } |
505 } | 505 } |
506 return os; | 506 return os; |
507 } | 507 } |
508 | 508 |
509 } // namespace compiler | 509 } // namespace compiler |
510 } // namespace internal | 510 } // namespace internal |
511 } // namespace v8 | 511 } // namespace v8 |
OLD | NEW |