| 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 289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 300 void HEscapeAnalysisPhase::PerformScalarReplacement() { | 300 void HEscapeAnalysisPhase::PerformScalarReplacement() { |
| 301 for (int i = 0; i < captured_.length(); i++) { | 301 for (int i = 0; i < captured_.length(); i++) { |
| 302 HAllocate* allocate = HAllocate::cast(captured_.at(i)); | 302 HAllocate* allocate = HAllocate::cast(captured_.at(i)); |
| 303 | 303 |
| 304 // Compute number of scalar values and start with clean slate. | 304 // Compute number of scalar values and start with clean slate. |
| 305 int size_in_bytes = allocate->size()->GetInteger32Constant(); | 305 int size_in_bytes = allocate->size()->GetInteger32Constant(); |
| 306 number_of_values_ = size_in_bytes / kPointerSize; | 306 number_of_values_ = size_in_bytes / kPointerSize; |
| 307 number_of_objects_++; | 307 number_of_objects_++; |
| 308 block_states_.Clear(); | 308 block_states_.Clear(); |
| 309 | 309 |
| 310 // Perform actual analysis steps. | 310 // Perform actual analysis step. |
| 311 AnalyzeDataFlow(allocate); | 311 AnalyzeDataFlow(allocate); |
| 312 | 312 |
| 313 cumulative_values_ += number_of_values_; | 313 cumulative_values_ += number_of_values_; |
| 314 ASSERT(allocate->HasNoUses()); | 314 ASSERT(allocate->HasNoUses()); |
| 315 ASSERT(!allocate->IsLinked()); | 315 ASSERT(!allocate->IsLinked()); |
| 316 } | 316 } |
| 317 } | 317 } |
| 318 | 318 |
| 319 | 319 |
| 320 void HEscapeAnalysisPhase::Run() { | 320 void HEscapeAnalysisPhase::Run() { |
| 321 // TODO(mstarzinger): We disable escape analysis with OSR for now, because | 321 // TODO(mstarzinger): We disable escape analysis with OSR for now, because |
| 322 // spill slots might be uninitialized. Needs investigation. | 322 // spill slots might be uninitialized. Needs investigation. |
| 323 if (graph()->has_osr()) return; | 323 if (graph()->has_osr()) return; |
| 324 CollectCapturedValues(); | 324 for (int i = 0; i < kMaxFixpointIterationCount; i++) { |
| 325 PerformScalarReplacement(); | 325 CollectCapturedValues(); |
| 326 if (captured_.is_empty()) break; |
| 327 PerformScalarReplacement(); |
| 328 captured_.Clear(); |
| 329 } |
| 326 } | 330 } |
| 327 | 331 |
| 328 | 332 |
| 329 } } // namespace v8::internal | 333 } } // namespace v8::internal |
| OLD | NEW |