Chromium Code Reviews| Index: src/hydrogen-escape-analysis.h |
| diff --git a/src/hydrogen-escape-analysis.h b/src/hydrogen-escape-analysis.h |
| index 2d425e2ecd692e4831cd2c802fd0e597881b3f7c..ff796866a8475baa3ef80f457998cb460d9810b2 100644 |
| --- a/src/hydrogen-escape-analysis.h |
| +++ b/src/hydrogen-escape-analysis.h |
| @@ -40,14 +40,17 @@ class HEscapeAnalysisPhase : public HPhase { |
| explicit HEscapeAnalysisPhase(HGraph* graph) |
| : HPhase("H_Escape analysis", graph), |
| captured_(0, zone()), |
| + maybe_more_work_(true), |
| number_of_objects_(0), |
| number_of_values_(0), |
| cumulative_values_(0), |
| block_states_(graph->blocks()->length(), zone()) { } |
| void Run() { |
|
titzer
2013/08/30 11:19:29
I would move this method into the .cc file and mak
Michael Starzinger
2013/09/17 13:47:13
Done. After rebasing I can just check for "capture
|
| - CollectCapturedValues(); |
| - PerformScalarReplacement(); |
| + for (int i = 0; i < kMaxFixpointIterationCount && maybe_more_work_; i++) { |
| + CollectCapturedValues(); |
| + PerformScalarReplacement(); |
| + } |
| } |
| private: |
| @@ -71,9 +74,15 @@ class HEscapeAnalysisPhase : public HPhase { |
| block_states_.Set(block->block_id(), state); |
| } |
| + // Maximum number of escape analysis iterations. |
| + static const int kMaxFixpointIterationCount = 2; |
| + |
| // List of allocations captured during collection phase. |
| ZoneList<HInstruction*> captured_; |
| + // Indicates another iteration might discover new captured objects. |
| + bool maybe_more_work_; |
| + |
| // Number of captured objects on which scalar replacement was done. |
| int number_of_objects_; |