OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
299 void HEscapeAnalysisPhase::PerformScalarReplacement() { | 299 void HEscapeAnalysisPhase::PerformScalarReplacement() { |
300 for (int i = 0; i < captured_.length(); i++) { | 300 for (int i = 0; i < captured_.length(); i++) { |
301 HAllocate* allocate = HAllocate::cast(captured_.at(i)); | 301 HAllocate* allocate = HAllocate::cast(captured_.at(i)); |
302 | 302 |
303 // Compute number of scalar values and start with clean slate. | 303 // Compute number of scalar values and start with clean slate. |
304 int size_in_bytes = allocate->size()->GetInteger32Constant(); | 304 int size_in_bytes = allocate->size()->GetInteger32Constant(); |
305 number_of_values_ = size_in_bytes / kPointerSize; | 305 number_of_values_ = size_in_bytes / kPointerSize; |
306 number_of_objects_++; | 306 number_of_objects_++; |
307 block_states_.Clear(); | 307 block_states_.Clear(); |
308 | 308 |
309 // Perform actual analysis steps. | 309 // Perform actual analysis step. |
310 AnalyzeDataFlow(allocate); | 310 AnalyzeDataFlow(allocate); |
311 | 311 |
312 cumulative_values_ += number_of_values_; | 312 cumulative_values_ += number_of_values_; |
313 ASSERT(allocate->HasNoUses()); | 313 ASSERT(allocate->HasNoUses()); |
314 ASSERT(!allocate->IsLinked()); | 314 ASSERT(!allocate->IsLinked()); |
315 } | 315 } |
316 } | 316 } |
317 | 317 |
318 | 318 |
319 void HEscapeAnalysisPhase::Run() { | 319 void HEscapeAnalysisPhase::Run() { |
320 // TODO(mstarzinger): We disable escape analysis with OSR for now, because | 320 // TODO(mstarzinger): We disable escape analysis with OSR for now, because |
321 // spill slots might be uninitialized. Needs investigation. | 321 // spill slots might be uninitialized. Needs investigation. |
322 if (graph()->has_osr()) return; | 322 if (graph()->has_osr()) return; |
323 CollectCapturedValues(); | 323 int max_fixpoint_iteration_count = FLAG_escape_analysis_iterations; |
324 PerformScalarReplacement(); | 324 for (int i = 0; i < max_fixpoint_iteration_count; i++) { |
| 325 CollectCapturedValues(); |
| 326 if (captured_.is_empty()) break; |
| 327 PerformScalarReplacement(); |
| 328 captured_.Clear(); |
| 329 } |
325 } | 330 } |
326 | 331 |
327 | 332 |
328 } } // namespace v8::internal | 333 } } // namespace v8::internal |
OLD | NEW |