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 <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/bit-vector.h" | 10 #include "src/bit-vector.h" |
(...skipping 1014 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1025 Trace("--- COMPUTING SPECIAL RPO ----------------------------------\n"); | 1025 Trace("--- COMPUTING SPECIAL RPO ----------------------------------\n"); |
1026 | 1026 |
1027 // Compute the special reverse-post-order for basic blocks. | 1027 // Compute the special reverse-post-order for basic blocks. |
1028 special_rpo_ = new (zone_) SpecialRPONumberer(zone_, schedule_); | 1028 special_rpo_ = new (zone_) SpecialRPONumberer(zone_, schedule_); |
1029 special_rpo_->ComputeSpecialRPO(); | 1029 special_rpo_->ComputeSpecialRPO(); |
1030 } | 1030 } |
1031 | 1031 |
1032 | 1032 |
1033 void Scheduler::PropagateImmediateDominators(BasicBlock* block) { | 1033 void Scheduler::PropagateImmediateDominators(BasicBlock* block) { |
1034 for (/*nop*/; block != NULL; block = block->rpo_next()) { | 1034 for (/*nop*/; block != NULL; block = block->rpo_next()) { |
1035 BasicBlock::Predecessors::iterator pred = block->predecessors_begin(); | 1035 auto pred = block->predecessors().begin(); |
1036 BasicBlock::Predecessors::iterator end = block->predecessors_end(); | 1036 auto end = block->predecessors().end(); |
1037 DCHECK(pred != end); // All blocks except start have predecessors. | 1037 DCHECK(pred != end); // All blocks except start have predecessors. |
1038 BasicBlock* dominator = *pred; | 1038 BasicBlock* dominator = *pred; |
1039 // For multiple predecessors, walk up the dominator tree until a common | 1039 // For multiple predecessors, walk up the dominator tree until a common |
1040 // dominator is found. Visitation order guarantees that all predecessors | 1040 // dominator is found. Visitation order guarantees that all predecessors |
1041 // except for backwards edges have been visited. | 1041 // except for backwards edges have been visited. |
1042 for (++pred; pred != end; ++pred) { | 1042 for (++pred; pred != end; ++pred) { |
1043 // Don't examine backwards edges. | 1043 // Don't examine backwards edges. |
1044 if ((*pred)->dominator_depth() < 0) continue; | 1044 if ((*pred)->dominator_depth() < 0) continue; |
1045 dominator = GetCommonDominator(dominator, *pred); | 1045 dominator = GetCommonDominator(dominator, *pred); |
1046 } | 1046 } |
(...skipping 424 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1471 for (Node* const node : *nodes) { | 1471 for (Node* const node : *nodes) { |
1472 schedule_->SetBlockForNode(to, node); | 1472 schedule_->SetBlockForNode(to, node); |
1473 scheduled_nodes_[to->id().ToSize()].push_back(node); | 1473 scheduled_nodes_[to->id().ToSize()].push_back(node); |
1474 } | 1474 } |
1475 nodes->clear(); | 1475 nodes->clear(); |
1476 } | 1476 } |
1477 | 1477 |
1478 } // namespace compiler | 1478 } // namespace compiler |
1479 } // namespace internal | 1479 } // namespace internal |
1480 } // namespace v8 | 1480 } // namespace v8 |
OLD | NEW |