Simplify scheduler API by removing zone scopes.

R=dcarney@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#25265}
git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@25265 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 480fbfeb
......@@ -496,8 +496,9 @@ Handle<Code> Pipeline::GenerateCode() {
void Pipeline::ComputeSchedule(PipelineData* data) {
PhaseScope phase_scope(data->pipeline_statistics(), "scheduling");
ZonePool::Scope zone_scope(data->zone_pool());
Schedule* schedule =
Scheduler::ComputeSchedule(data->zone_pool(), data->graph());
Scheduler::ComputeSchedule(zone_scope.zone(), data->graph());
TraceSchedule(schedule);
if (VerifyGraphs()) ScheduleVerifier::Run(schedule);
data->set_schedule(schedule);
......
......@@ -40,8 +40,7 @@ RawMachineAssembler::RawMachineAssembler(Graph* graph,
Schedule* RawMachineAssembler::Export() {
// Compute the correct codegen order.
DCHECK(schedule_->rpo_order()->empty());
ZonePool zone_pool(isolate());
Scheduler::ComputeSpecialRPO(&zone_pool, schedule_);
Scheduler::ComputeSpecialRPO(zone(), schedule_);
// Invalidate MachineAssembler.
Schedule* schedule = schedule_;
schedule_ = NULL;
......
......@@ -38,11 +38,10 @@ Scheduler::Scheduler(Zone* zone, Graph* graph, Schedule* schedule)
node_data_(graph_->NodeCount(), DefaultSchedulerData(), zone) {}
Schedule* Scheduler::ComputeSchedule(ZonePool* zone_pool, Graph* graph) {
ZonePool::Scope zone_scope(zone_pool);
Schedule* Scheduler::ComputeSchedule(Zone* zone, Graph* graph) {
Schedule* schedule = new (graph->zone())
Schedule(graph->zone(), static_cast<size_t>(graph->NodeCount()));
Scheduler scheduler(zone_scope.zone(), graph, schedule);
Scheduler scheduler(zone, graph, schedule);
scheduler.BuildCFG();
scheduler.ComputeSpecialRPONumbering();
......@@ -1025,11 +1024,7 @@ class SpecialRPONumberer : public ZoneObject {
};
BasicBlockVector* Scheduler::ComputeSpecialRPO(ZonePool* zone_pool,
Schedule* schedule) {
ZonePool::Scope zone_scope(zone_pool);
Zone* zone = zone_scope.zone();
BasicBlockVector* Scheduler::ComputeSpecialRPO(Zone* zone, Schedule* schedule) {
SpecialRPONumberer numberer(zone, schedule);
numberer.ComputeSpecialRPO();
numberer.SerializeAOIntoSchedule();
......
......@@ -24,11 +24,10 @@ class Scheduler {
public:
// The complete scheduling algorithm. Creates a new schedule and places all
// nodes from the graph into it.
static Schedule* ComputeSchedule(ZonePool* zone_pool, Graph* graph);
static Schedule* ComputeSchedule(Zone* zone, Graph* graph);
// Compute the RPO of blocks in an existing schedule.
static BasicBlockVector* ComputeSpecialRPO(ZonePool* zone_pool,
Schedule* schedule);
static BasicBlockVector* ComputeSpecialRPO(Zone* zone, Schedule* schedule);
private:
// Placement of a node changes during scheduling. The placement state
......
......@@ -52,8 +52,7 @@ class InstructionTester : public HandleAndZoneScope {
void allocCode() {
if (schedule.rpo_order()->size() == 0) {
// Compute the RPO order.
ZonePool zone_pool(isolate);
Scheduler::ComputeSpecialRPO(&zone_pool, &schedule);
Scheduler::ComputeSpecialRPO(main_zone(), &schedule);
DCHECK(schedule.rpo_order()->size() > 0);
}
InstructionBlocks* instruction_blocks =
......
This diff is collapsed.
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