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 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
252 } | 252 } |
253 } | 253 } |
254 | 254 |
255 // All uses have been handled. | 255 // All uses have been handled. |
256 ASSERT(allocate->HasNoUses()); | 256 ASSERT(allocate->HasNoUses()); |
257 allocate->DeleteAndReplaceWith(NULL); | 257 allocate->DeleteAndReplaceWith(NULL); |
258 } | 258 } |
259 | 259 |
260 | 260 |
261 void HEscapeAnalysisPhase::PerformScalarReplacement() { | 261 void HEscapeAnalysisPhase::PerformScalarReplacement() { |
| 262 bool maybe_more_work = false; |
262 for (int i = 0; i < captured_.length(); i++) { | 263 for (int i = 0; i < captured_.length(); i++) { |
263 HAllocate* allocate = HAllocate::cast(captured_.at(i)); | 264 HAllocate* allocate = HAllocate::cast(captured_.at(i)); |
264 | 265 |
265 // Compute number of scalar values and start with clean slate. | 266 // Compute number of scalar values and start with clean slate. |
266 if (!allocate->size()->IsInteger32Constant()) continue; | 267 if (!allocate->size()->IsInteger32Constant()) continue; |
267 int size_in_bytes = allocate->size()->GetInteger32Constant(); | 268 int size_in_bytes = allocate->size()->GetInteger32Constant(); |
268 number_of_values_ = size_in_bytes / kPointerSize; | 269 number_of_values_ = size_in_bytes / kPointerSize; |
269 number_of_objects_++; | 270 number_of_objects_++; |
270 block_states_.Clear(); | 271 block_states_.Clear(); |
271 | 272 |
272 // Perform actual analysis steps. | 273 // Perform actual analysis step. |
273 AnalyzeDataFlow(allocate); | 274 AnalyzeDataFlow(allocate); |
274 | 275 |
| 276 maybe_more_work = true; |
275 cumulative_values_ += number_of_values_; | 277 cumulative_values_ += number_of_values_; |
276 ASSERT(allocate->HasNoUses()); | 278 ASSERT(allocate->HasNoUses()); |
277 ASSERT(!allocate->IsLinked()); | 279 ASSERT(!allocate->IsLinked()); |
278 } | 280 } |
| 281 |
| 282 // Clear captured objects. |
| 283 maybe_more_work_ = maybe_more_work; |
| 284 captured_.Clear(); |
279 } | 285 } |
280 | 286 |
281 | 287 |
282 } } // namespace v8::internal | 288 } } // namespace v8::internal |
OLD | NEW |