Chromium Code Reviews| Index: src/hydrogen-environment-liveness.cc |
| diff --git a/src/hydrogen-environment-liveness.cc b/src/hydrogen-environment-liveness.cc |
| index 8c660597ab891c8f0d69d05646002eded60592d8..930e6af09606836d1b9c766e5c8f9532f8fcc03a 100644 |
| --- a/src/hydrogen-environment-liveness.cc |
| +++ b/src/hydrogen-environment-liveness.cc |
| @@ -34,10 +34,11 @@ namespace internal { |
| EnvironmentSlotLivenessAnalyzer::EnvironmentSlotLivenessAnalyzer( |
| - HGraph* graph) |
| + HGraph* graph, |
| + Zone* phase_zone) |
|
danno
2013/06/24 12:11:21
This should take an CompilationInfo rather than a
Benedikt Meurer
2013/06/24 12:18:28
Separate CL, see https://codereview.chromium.org/1
|
| : graph_(graph), |
| - zone_(graph->isolate()), |
| - zone_scope_(&zone_, DELETE_ON_EXIT), |
| + phase_zone_(phase_zone), |
| + phase_zone_scope_(phase_zone_, DELETE_ON_EXIT), |
| block_count_(graph->blocks()->length()), |
| maximum_environment_size_(graph->maximum_environment_size()), |
| collect_markers_(true), |
| @@ -45,21 +46,24 @@ EnvironmentSlotLivenessAnalyzer::EnvironmentSlotLivenessAnalyzer( |
| if (maximum_environment_size_ == 0) return; |
| live_at_block_start_ = |
| - new(zone()) ZoneList<BitVector*>(block_count_, zone()); |
| - first_simulate_ = new(zone()) ZoneList<HSimulate*>(block_count_, zone()); |
| + new(phase_zone) ZoneList<BitVector*>(block_count_, phase_zone); |
| + first_simulate_ = new(phase_zone) ZoneList<HSimulate*>(block_count_, |
| + phase_zone); |
| first_simulate_invalid_for_index_ = |
| - new(zone()) ZoneList<BitVector*>(block_count_, zone()); |
| - markers_ = new(zone()) |
| - ZoneList<HEnvironmentMarker*>(maximum_environment_size_, zone()); |
| + new(phase_zone) ZoneList<BitVector*>(block_count_, phase_zone); |
| + markers_ = new(phase_zone) |
| + ZoneList<HEnvironmentMarker*>(maximum_environment_size_, phase_zone); |
| went_live_since_last_simulate_ = |
| - new(zone()) BitVector(maximum_environment_size_, zone()); |
| + new(phase_zone) BitVector(maximum_environment_size_, phase_zone); |
| for (int i = 0; i < block_count_; ++i) { |
| live_at_block_start_->Add( |
| - new(zone()) BitVector(maximum_environment_size_, zone()), zone()); |
| - first_simulate_->Add(NULL, zone()); |
| + new(phase_zone) BitVector(maximum_environment_size_, phase_zone), |
| + phase_zone); |
| + first_simulate_->Add(NULL, phase_zone); |
| first_simulate_invalid_for_index_->Add( |
| - new(zone()) BitVector(maximum_environment_size_, zone()), zone()); |
| + new(phase_zone) BitVector(maximum_environment_size_, phase_zone), |
| + phase_zone); |
| } |
| } |
| @@ -147,7 +151,7 @@ void EnvironmentSlotLivenessAnalyzer::UpdateLivenessAtInstruction( |
| } |
| if (collect_markers_) { |
| // Populate |markers_| list during the first pass. |
| - markers_->Add(marker, &zone_); |
| + markers_->Add(marker, phase_zone()); |
| } |
| break; |
| } |
| @@ -200,7 +204,7 @@ void EnvironmentSlotLivenessAnalyzer::UpdateLivenessAtInstruction( |
| } |
| -void EnvironmentSlotLivenessAnalyzer::AnalyzeAndTrim() { |
| +void EnvironmentSlotLivenessAnalyzer::Run() { |
| HPhase phase("H_EnvironmentLivenessAnalysis", graph_); |
| if (maximum_environment_size_ == 0) return; |
| @@ -208,8 +212,9 @@ void EnvironmentSlotLivenessAnalyzer::AnalyzeAndTrim() { |
| // for each block until it doesn't change any more. For efficiency, visit |
| // blocks in reverse order and walk backwards through each block. We |
| // need several iterations to propagate liveness through nested loops. |
| - BitVector* live = new(zone()) BitVector(maximum_environment_size_, zone()); |
| - BitVector* worklist = new(zone()) BitVector(block_count_, zone()); |
| + BitVector* live = new(phase_zone()) BitVector(maximum_environment_size_, |
| + phase_zone()); |
| + BitVector* worklist = new(phase_zone()) BitVector(block_count_, phase_zone()); |
| for (int i = 0; i < block_count_; ++i) { |
| worklist->Add(i); |
| } |