Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(107)

Unified Diff: src/compiler/scheduler.cc

Issue 665893006: [turbofan] add ZonePool to correctly track compiler phase memory usage (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/compiler/scheduler.h ('k') | src/compiler/zone-pool.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/scheduler.cc
diff --git a/src/compiler/scheduler.cc b/src/compiler/scheduler.cc
index 4952827124a80c985d2558da024e739c5154e419..16773c5cba00b290045ea02a5a14d8750c77bbe7 100644
--- a/src/compiler/scheduler.cc
+++ b/src/compiler/scheduler.cc
@@ -28,8 +28,10 @@ static inline void Trace(const char* msg, ...) {
}
-Scheduler::Scheduler(Zone* zone, Graph* graph, Schedule* schedule)
- : zone_(zone),
+Scheduler::Scheduler(ZonePool* zone_pool, Zone* zone, Graph* graph,
+ Schedule* schedule)
+ : zone_pool_(zone_pool),
+ zone_(zone),
graph_(graph),
schedule_(schedule),
scheduled_nodes_(zone),
@@ -38,17 +40,17 @@ Scheduler::Scheduler(Zone* zone, Graph* graph, Schedule* schedule)
has_floating_control_(false) {}
-Schedule* Scheduler::ComputeSchedule(Graph* graph) {
+Schedule* Scheduler::ComputeSchedule(ZonePool* zone_pool, Graph* graph) {
Schedule* schedule;
bool had_floating_control = false;
do {
- Zone tmp_zone(graph->zone()->isolate());
+ ZonePool::Scope zone_scope(zone_pool);
schedule = new (graph->zone())
Schedule(graph->zone(), static_cast<size_t>(graph->NodeCount()));
- Scheduler scheduler(&tmp_zone, graph, schedule);
+ Scheduler scheduler(zone_pool, zone_scope.zone(), graph, schedule);
scheduler.BuildCFG();
- Scheduler::ComputeSpecialRPO(schedule);
+ Scheduler::ComputeSpecialRPO(zone_pool, schedule);
scheduler.GenerateImmediateDominatorTree();
scheduler.PrepareUses();
@@ -672,10 +674,11 @@ void Scheduler::ScheduleLate() {
ScheduleLateNodeVisitor schedule_late_visitor(this);
{
- Zone zone(zone_->isolate());
+ ZonePool::Scope zone_scope(zone_pool_);
+ Zone* zone = zone_scope.zone();
GenericGraphVisit::Visit<ScheduleLateNodeVisitor,
NodeInputIterationTraits<Node> >(
- graph_, &zone, schedule_root_nodes_.begin(), schedule_root_nodes_.end(),
+ graph_, zone, schedule_root_nodes_.begin(), schedule_root_nodes_.end(),
&schedule_late_visitor);
}
@@ -999,9 +1002,10 @@ static void VerifySpecialRPO(int num_loops, LoopInfo* loops,
// 2. All loops are contiguous in the order (i.e. no intervening blocks that
// do not belong to the loop.)
// Note a simple RPO traversal satisfies (1) but not (3).
-BasicBlockVector* Scheduler::ComputeSpecialRPO(Schedule* schedule) {
- Zone tmp_zone(schedule->zone()->isolate());
- Zone* zone = &tmp_zone;
+BasicBlockVector* Scheduler::ComputeSpecialRPO(ZonePool* zone_pool,
+ Schedule* schedule) {
+ ZonePool::Scope zone_scope(zone_pool);
+ Zone* zone = zone_scope.zone();
Trace("--- COMPUTING SPECIAL RPO ----------------------------------\n");
// RPO should not have been computed for this schedule yet.
CHECK_EQ(kBlockUnvisited1, schedule->start()->rpo_number());
« no previous file with comments | « src/compiler/scheduler.h ('k') | src/compiler/zone-pool.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698