Improve comments and readability of scheduler.

R=jarin@chromium.org

Review URL: https://codereview.chromium.org/642803003

git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@24526 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 6490b9a6
This diff is collapsed.
...@@ -19,17 +19,13 @@ namespace compiler { ...@@ -19,17 +19,13 @@ namespace compiler {
// ordering the basic blocks in the special RPO order. // ordering the basic blocks in the special RPO order.
class Scheduler { class Scheduler {
public: public:
// The complete scheduling algorithm. // The complete scheduling algorithm. Creates a new schedule and places all
// Create a new schedule and place all nodes from the graph into it. // nodes from the graph into it.
static Schedule* ComputeSchedule(Graph* graph); static Schedule* ComputeSchedule(Graph* graph);
// Compute the RPO of blocks in an existing schedule. // Compute the RPO of blocks in an existing schedule.
static BasicBlockVector* ComputeSpecialRPO(Schedule* schedule); static BasicBlockVector* ComputeSpecialRPO(Schedule* schedule);
// (Exposed for testing only)
// Build and connect the CFG for a node graph, but don't schedule nodes.
static void ComputeCFG(Graph* graph, Schedule* schedule);
private: private:
enum Placement { kUnknown, kSchedulable, kFixed }; enum Placement { kUnknown, kSchedulable, kFixed };
...@@ -61,8 +57,6 @@ class Scheduler { ...@@ -61,8 +57,6 @@ class Scheduler {
return &node_data_[node->id()]; return &node_data_[node->id()];
} }
void BuildCFG();
Placement GetPlacement(Node* node); Placement GetPlacement(Node* node);
int GetRPONumber(BasicBlock* block) { int GetRPONumber(BasicBlock* block) {
...@@ -73,26 +67,31 @@ class Scheduler { ...@@ -73,26 +67,31 @@ class Scheduler {
return block->rpo_number(); return block->rpo_number();
} }
void GenerateImmediateDominatorTree();
BasicBlock* GetCommonDominator(BasicBlock* b1, BasicBlock* b2); BasicBlock* GetCommonDominator(BasicBlock* b1, BasicBlock* b2);
// Phase 1: Build control-flow graph and dominator tree.
friend class CFGBuilder; friend class CFGBuilder;
void BuildCFG();
void GenerateImmediateDominatorTree();
friend class ScheduleEarlyNodeVisitor; // Phase 2: Prepare use counts for nodes.
void ScheduleEarly();
friend class PrepareUsesVisitor; friend class PrepareUsesVisitor;
void PrepareUses(); void PrepareUses();
// Phase 3: Schedule nodes early.
friend class ScheduleEarlyNodeVisitor;
void ScheduleEarly();
// Phase 4: Schedule nodes late.
friend class ScheduleLateNodeVisitor; friend class ScheduleLateNodeVisitor;
void ScheduleLate(); void ScheduleLate();
bool ConnectFloatingControl(); bool ConnectFloatingControl();
void ConnectFloatingControlSubgraph(BasicBlock* block, Node* node); void ConnectFloatingControlSubgraph(BasicBlock* block, Node* node);
}; };
}
} } // namespace compiler
} // namespace v8::internal::compiler } // namespace internal
} // namespace v8
#endif // V8_COMPILER_SCHEDULER_H_ #endif // V8_COMPILER_SCHEDULER_H_
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment