| OLD | NEW | 
|---|
| 1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 the V8 project authors. All rights reserved. | 
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be | 
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. | 
| 4 | 4 | 
| 5 #include "hydrogen-escape-analysis.h" | 5 #include "hydrogen-escape-analysis.h" | 
| 6 | 6 | 
| 7 namespace v8 { | 7 namespace v8 { | 
| 8 namespace internal { | 8 namespace internal { | 
| 9 | 9 | 
| 10 | 10 | 
| (...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 292 | 292 | 
| 293 | 293 | 
| 294 void HEscapeAnalysisPhase::PerformScalarReplacement() { | 294 void HEscapeAnalysisPhase::PerformScalarReplacement() { | 
| 295   for (int i = 0; i < captured_.length(); i++) { | 295   for (int i = 0; i < captured_.length(); i++) { | 
| 296     HAllocate* allocate = HAllocate::cast(captured_.at(i)); | 296     HAllocate* allocate = HAllocate::cast(captured_.at(i)); | 
| 297 | 297 | 
| 298     // Compute number of scalar values and start with clean slate. | 298     // Compute number of scalar values and start with clean slate. | 
| 299     int size_in_bytes = allocate->size()->GetInteger32Constant(); | 299     int size_in_bytes = allocate->size()->GetInteger32Constant(); | 
| 300     number_of_values_ = size_in_bytes / kPointerSize; | 300     number_of_values_ = size_in_bytes / kPointerSize; | 
| 301     number_of_objects_++; | 301     number_of_objects_++; | 
| 302     block_states_.Clear(); | 302     block_states_.Rewind(0); | 
| 303 | 303 | 
| 304     // Perform actual analysis step. | 304     // Perform actual analysis step. | 
| 305     AnalyzeDataFlow(allocate); | 305     AnalyzeDataFlow(allocate); | 
| 306 | 306 | 
| 307     cumulative_values_ += number_of_values_; | 307     cumulative_values_ += number_of_values_; | 
| 308     ASSERT(allocate->HasNoUses()); | 308     ASSERT(allocate->HasNoUses()); | 
| 309     ASSERT(!allocate->IsLinked()); | 309     ASSERT(!allocate->IsLinked()); | 
| 310   } | 310   } | 
| 311 } | 311 } | 
| 312 | 312 | 
| 313 | 313 | 
| 314 void HEscapeAnalysisPhase::Run() { | 314 void HEscapeAnalysisPhase::Run() { | 
| 315   // TODO(mstarzinger): We disable escape analysis with OSR for now, because | 315   // TODO(mstarzinger): We disable escape analysis with OSR for now, because | 
| 316   // spill slots might be uninitialized. Needs investigation. | 316   // spill slots might be uninitialized. Needs investigation. | 
| 317   if (graph()->has_osr()) return; | 317   if (graph()->has_osr()) return; | 
| 318   int max_fixpoint_iteration_count = FLAG_escape_analysis_iterations; | 318   int max_fixpoint_iteration_count = FLAG_escape_analysis_iterations; | 
| 319   for (int i = 0; i < max_fixpoint_iteration_count; i++) { | 319   for (int i = 0; i < max_fixpoint_iteration_count; i++) { | 
| 320     CollectCapturedValues(); | 320     CollectCapturedValues(); | 
| 321     if (captured_.is_empty()) break; | 321     if (captured_.is_empty()) break; | 
| 322     PerformScalarReplacement(); | 322     PerformScalarReplacement(); | 
| 323     captured_.Clear(); | 323     captured_.Rewind(0); | 
| 324   } | 324   } | 
| 325 } | 325 } | 
| 326 | 326 | 
| 327 | 327 | 
| 328 } }  // namespace v8::internal | 328 } }  // namespace v8::internal | 
| OLD | NEW | 
|---|