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 {
// ordering the basic blocks in the special RPO order.
class Scheduler {
public:
// The complete scheduling algorithm.
// Create a new schedule and place all nodes from the graph into it.
// The complete scheduling algorithm. Creates a new schedule and places all
// nodes from the graph into it.
static Schedule* ComputeSchedule(Graph* graph);
// Compute the RPO of blocks in an existing 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:
enum Placement { kUnknown, kSchedulable, kFixed };
......@@ -61,8 +57,6 @@ class Scheduler {
return &node_data_[node->id()];
}
void BuildCFG();
Placement GetPlacement(Node* node);
int GetRPONumber(BasicBlock* block) {
......@@ -73,26 +67,31 @@ class Scheduler {
return block->rpo_number();
}
void GenerateImmediateDominatorTree();
BasicBlock* GetCommonDominator(BasicBlock* b1, BasicBlock* b2);
// Phase 1: Build control-flow graph and dominator tree.
friend class CFGBuilder;
void BuildCFG();
void GenerateImmediateDominatorTree();
friend class ScheduleEarlyNodeVisitor;
void ScheduleEarly();
// Phase 2: Prepare use counts for nodes.
friend class PrepareUsesVisitor;
void PrepareUses();
// Phase 3: Schedule nodes early.
friend class ScheduleEarlyNodeVisitor;
void ScheduleEarly();
// Phase 4: Schedule nodes late.
friend class ScheduleLateNodeVisitor;
void ScheduleLate();
bool ConnectFloatingControl();
void ConnectFloatingControlSubgraph(BasicBlock* block, Node* node);
};
}
}
} // namespace v8::internal::compiler
} // namespace compiler
} // namespace internal
} // namespace v8
#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