| OLD | NEW |
| 1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 2002 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2013 heap()->FreeQueuedChunks(); | 2013 heap()->FreeQueuedChunks(); |
| 2014 | 2014 |
| 2015 return IsSweepingComplete(); | 2015 return IsSweepingComplete(); |
| 2016 } | 2016 } |
| 2017 | 2017 |
| 2018 | 2018 |
| 2019 void PagedSpace::EvictEvacuationCandidatesFromFreeLists() { | 2019 void PagedSpace::EvictEvacuationCandidatesFromFreeLists() { |
| 2020 if (allocation_info_.top >= allocation_info_.limit) return; | 2020 if (allocation_info_.top >= allocation_info_.limit) return; |
| 2021 | 2021 |
| 2022 if (Page::FromAddress(allocation_info_.top)->IsEvacuationCandidate()) { | 2022 if (Page::FromAddress(allocation_info_.top)->IsEvacuationCandidate()) { |
| 2023 allocation_info_.top = NULL; | 2023 // Create filler object to keep page iterable if it was iterable. |
| 2024 allocation_info_.limit = NULL; | 2024 int remaining = |
| 2025 static_cast<int>(allocation_info_.limit - allocation_info_.top); |
| 2026 heap()->CreateFillerObjectAt(allocation_info_.top, remaining); |
| 2027 |
| 2028 allocation_info_.top = NULL; |
| 2029 allocation_info_.limit = NULL; |
| 2025 } | 2030 } |
| 2026 } | 2031 } |
| 2027 | 2032 |
| 2028 | 2033 |
| 2029 HeapObject* PagedSpace::SlowAllocateRaw(int size_in_bytes) { | 2034 HeapObject* PagedSpace::SlowAllocateRaw(int size_in_bytes) { |
| 2030 // Allocation in this space has failed. | 2035 // Allocation in this space has failed. |
| 2031 | 2036 |
| 2032 // Free list allocation failed and there is no next page. Fail if we have | 2037 // Free list allocation failed and there is no next page. Fail if we have |
| 2033 // hit the old generation size limit that should cause a garbage | 2038 // hit the old generation size limit that should cause a garbage |
| 2034 // collection. | 2039 // collection. |
| (...skipping 465 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2500 for (HeapObject* obj = obj_it.Next(); obj != NULL; obj = obj_it.Next()) { | 2505 for (HeapObject* obj = obj_it.Next(); obj != NULL; obj = obj_it.Next()) { |
| 2501 if (obj->IsCode()) { | 2506 if (obj->IsCode()) { |
| 2502 Code* code = Code::cast(obj); | 2507 Code* code = Code::cast(obj); |
| 2503 isolate->code_kind_statistics()[code->kind()] += code->Size(); | 2508 isolate->code_kind_statistics()[code->kind()] += code->Size(); |
| 2504 } | 2509 } |
| 2505 } | 2510 } |
| 2506 } | 2511 } |
| 2507 #endif // DEBUG | 2512 #endif // DEBUG |
| 2508 | 2513 |
| 2509 } } // namespace v8::internal | 2514 } } // namespace v8::internal |
| OLD | NEW |