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/scheduler.h" | 5 #include "src/compiler/scheduler.h" |
6 | 6 |
7 #include <iomanip> | 7 #include <iomanip> |
8 | 8 |
9 #include "src/base/adapters.h" | |
9 #include "src/bit-vector.h" | 10 #include "src/bit-vector.h" |
10 #include "src/compiler/common-operator.h" | 11 #include "src/compiler/common-operator.h" |
11 #include "src/compiler/control-equivalence.h" | 12 #include "src/compiler/control-equivalence.h" |
12 #include "src/compiler/graph.h" | 13 #include "src/compiler/graph.h" |
13 #include "src/compiler/node.h" | 14 #include "src/compiler/node.h" |
14 #include "src/compiler/node-marker.h" | 15 #include "src/compiler/node-marker.h" |
15 #include "src/compiler/node-properties.h" | 16 #include "src/compiler/node-properties.h" |
16 #include "src/zone-containers.h" | 17 #include "src/zone-containers.h" |
17 | 18 |
18 namespace v8 { | 19 namespace v8 { |
(...skipping 1596 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1615 | 1616 |
1616 // Serialize the assembly order and reverse-post-order numbering. | 1617 // Serialize the assembly order and reverse-post-order numbering. |
1617 special_rpo_->SerializeRPOIntoSchedule(); | 1618 special_rpo_->SerializeRPOIntoSchedule(); |
1618 special_rpo_->PrintAndVerifySpecialRPO(); | 1619 special_rpo_->PrintAndVerifySpecialRPO(); |
1619 | 1620 |
1620 // Add collected nodes for basic blocks to their blocks in the right order. | 1621 // Add collected nodes for basic blocks to their blocks in the right order. |
1621 int block_num = 0; | 1622 int block_num = 0; |
1622 for (NodeVector& nodes : scheduled_nodes_) { | 1623 for (NodeVector& nodes : scheduled_nodes_) { |
1623 BasicBlock::Id id = BasicBlock::Id::FromInt(block_num++); | 1624 BasicBlock::Id id = BasicBlock::Id::FromInt(block_num++); |
1624 BasicBlock* block = schedule_->GetBlockById(id); | 1625 BasicBlock* block = schedule_->GetBlockById(id); |
1625 for (auto i = nodes.rbegin(); i != nodes.rend(); ++i) { | 1626 for (auto i : base::Reversed(nodes)) { |
Michael Starzinger
2015/04/20 13:11:14
nit: s/auto i/Node* node/
Sven Panne
2015/04/20 14:38:35
Done.
| |
1626 schedule_->AddNode(block, *i); | 1627 schedule_->AddNode(block, i); |
1627 } | 1628 } |
1628 } | 1629 } |
1629 } | 1630 } |
1630 | 1631 |
1631 | 1632 |
1632 // ----------------------------------------------------------------------------- | 1633 // ----------------------------------------------------------------------------- |
1633 | 1634 |
1634 | 1635 |
1635 void Scheduler::FuseFloatingControl(BasicBlock* block, Node* node) { | 1636 void Scheduler::FuseFloatingControl(BasicBlock* block, Node* node) { |
1636 TRACE("--- FUSE FLOATING CONTROL ----------------------------------\n"); | 1637 TRACE("--- FUSE FLOATING CONTROL ----------------------------------\n"); |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1690 for (Node* const node : *nodes) { | 1691 for (Node* const node : *nodes) { |
1691 schedule_->SetBlockForNode(to, node); | 1692 schedule_->SetBlockForNode(to, node); |
1692 scheduled_nodes_[to->id().ToSize()].push_back(node); | 1693 scheduled_nodes_[to->id().ToSize()].push_back(node); |
1693 } | 1694 } |
1694 nodes->clear(); | 1695 nodes->clear(); |
1695 } | 1696 } |
1696 | 1697 |
1697 } // namespace compiler | 1698 } // namespace compiler |
1698 } // namespace internal | 1699 } // namespace internal |
1699 } // namespace v8 | 1700 } // namespace v8 |
OLD | NEW |