| Index: src/compiler/scheduler.h
|
| diff --git a/src/compiler/scheduler.h b/src/compiler/scheduler.h
|
| index a5207128beb62d77e9049f3e38941a82ec521016..a0addbdc2c11b719635b374cea6888253a413722 100644
|
| --- a/src/compiler/scheduler.h
|
| +++ b/src/compiler/scheduler.h
|
| @@ -9,6 +9,7 @@
|
|
|
| #include "src/compiler/opcodes.h"
|
| #include "src/compiler/schedule.h"
|
| +#include "src/compiler/zone-pool.h"
|
| #include "src/zone-containers.h"
|
|
|
| namespace v8 {
|
| @@ -21,13 +22,14 @@ class Scheduler {
|
| public:
|
| // The complete scheduling algorithm. Creates a new schedule and places all
|
| // nodes from the graph into it.
|
| - static Schedule* ComputeSchedule(Graph* graph);
|
| + static Schedule* ComputeSchedule(ZonePool* zone_pool, Graph* graph);
|
|
|
| // Compute the RPO of blocks in an existing schedule.
|
| - static BasicBlockVector* ComputeSpecialRPO(Schedule* schedule);
|
| + static BasicBlockVector* ComputeSpecialRPO(ZonePool* zone_pool,
|
| + Schedule* schedule);
|
|
|
| private:
|
| - enum Placement { kUnknown, kSchedulable, kFixed };
|
| + enum Placement { kUnknown, kSchedulable, kFixed, kCoupled };
|
|
|
| // Per-node data tracked during scheduling.
|
| struct SchedulerData {
|
| @@ -36,53 +38,50 @@ class Scheduler {
|
| bool is_connected_control_; // {true} if control-connected to the end node.
|
| bool is_floating_control_; // {true} if control, but not control-connected
|
| // to the end node.
|
| - Placement placement_ : 3; // Whether the node is fixed, schedulable,
|
| - // or not yet known.
|
| + Placement placement_; // Whether the node is fixed, schedulable,
|
| + // coupled to another node, or not yet known.
|
| };
|
|
|
| Zone* zone_;
|
| Graph* graph_;
|
| Schedule* schedule_;
|
| - NodeVectorVector scheduled_nodes_;
|
| - NodeVector schedule_root_nodes_;
|
| - ZoneVector<SchedulerData> node_data_;
|
| + NodeVectorVector scheduled_nodes_; // Per-block list of nodes in reverse.
|
| + NodeVector schedule_root_nodes_; // Fixed root nodes seed the worklist.
|
| + ZoneQueue<Node*> schedule_queue_; // Worklist of schedulable nodes.
|
| + ZoneVector<SchedulerData> node_data_; // Per-node data for all nodes.
|
| bool has_floating_control_;
|
|
|
| Scheduler(Zone* zone, Graph* graph, Schedule* schedule);
|
|
|
| - SchedulerData DefaultSchedulerData();
|
| -
|
| - SchedulerData* GetData(Node* node) {
|
| - DCHECK(node->id() < static_cast<int>(node_data_.size()));
|
| - return &node_data_[node->id()];
|
| - }
|
| + inline SchedulerData DefaultSchedulerData();
|
| + inline SchedulerData* GetData(Node* node);
|
|
|
| Placement GetPlacement(Node* node);
|
|
|
| - int GetRPONumber(BasicBlock* block) {
|
| - DCHECK(block->rpo_number() >= 0 &&
|
| - block->rpo_number() <
|
| - static_cast<int>(schedule_->rpo_order_.size()));
|
| - DCHECK(schedule_->rpo_order_[block->rpo_number()] == block);
|
| - return block->rpo_number();
|
| - }
|
| + void IncrementUnscheduledUseCount(Node* node, Node* from);
|
| + void DecrementUnscheduledUseCount(Node* node, Node* from);
|
|
|
| + inline int GetRPONumber(BasicBlock* block);
|
| BasicBlock* GetCommonDominator(BasicBlock* b1, BasicBlock* b2);
|
|
|
| - // Phase 1: Build control-flow graph and dominator tree.
|
| + // Phase 1: Build control-flow graph.
|
| friend class CFGBuilder;
|
| void BuildCFG();
|
| +
|
| + // Phase 2: Compute special RPO and dominator tree.
|
| + friend class SpecialRPONumberer;
|
| + void ComputeSpecialRPONumbering();
|
| void GenerateImmediateDominatorTree();
|
|
|
| - // Phase 2: Prepare use counts for nodes.
|
| + // Phase 3: Prepare use counts for nodes.
|
| friend class PrepareUsesVisitor;
|
| void PrepareUses();
|
|
|
| - // Phase 3: Schedule nodes early.
|
| + // Phase 4: Schedule nodes early.
|
| friend class ScheduleEarlyNodeVisitor;
|
| void ScheduleEarly();
|
|
|
| - // Phase 4: Schedule nodes late.
|
| + // Phase 5: Schedule nodes late.
|
| friend class ScheduleLateNodeVisitor;
|
| void ScheduleLate();
|
|
|
|
|