Chromium Code Reviews| Index: src/heap/spaces.cc |
| diff --git a/src/heap/spaces.cc b/src/heap/spaces.cc |
| index 90d252abb592a46a051864883c30c6bd44b436b3..5b76243da3e408584616d62ac4380318acc018bd 100644 |
| --- a/src/heap/spaces.cc |
| +++ b/src/heap/spaces.cc |
| @@ -952,9 +952,7 @@ STATIC_ASSERT(static_cast<ObjectSpace>(1 << AllocationSpace::MAP_SPACE) == |
| PagedSpace::PagedSpace(Heap* heap, AllocationSpace space, |
| Executability executable) |
| - : Space(heap, space, executable), |
| - free_list_(this), |
| - end_of_unswept_pages_(NULL) { |
| + : Space(heap, space, executable), free_list_(this) { |
| area_size_ = MemoryAllocator::PageAreaSize(space); |
| accounting_stats_.Clear(); |
| @@ -1109,8 +1107,6 @@ void PagedSpace::MergeCompactionSpace(CompactionSpace* other) { |
| DCHECK(other->top() == nullptr); |
| DCHECK(other->limit() == nullptr); |
| - DCHECK(other->end_of_unswept_pages_ == nullptr); |
| - |
| AccountCommitted(other->CommittedMemory()); |
| // Move over pages. |
| @@ -2851,10 +2847,13 @@ HeapObject* PagedSpace::SlowAllocateRaw(int size_in_bytes) { |
| if (object != NULL) return object; |
| // If sweeping is still in progress try to sweep pages on the main thread. |
| - collector->SweepInParallel(heap()->paged_space(identity()), size_in_bytes); |
| - RefillFreeList(); |
| - object = free_list_.Allocate(size_in_bytes); |
| - if (object != nullptr) return object; |
| + int max_freed = collector->SweepInParallel(heap()->paged_space(identity()), |
| + size_in_bytes, 1); |
|
Hannes Payer (out of office)
2016/01/20 09:25:03
1 should be a constant.
Michael Lippautz
2016/01/20 11:11:16
Done: kMaxPagesSweptDuringSlowAllocation
|
| + if (max_freed >= size_in_bytes) { |
|
Hannes Payer (out of office)
2016/01/20 09:25:03
If you add this case, you want to call RefillFreeL
Michael Lippautz
2016/01/20 11:11:16
Done. (ftr: this is to move over already freed mem
|
| + RefillFreeList(); |
| + object = free_list_.Allocate(size_in_bytes); |
| + if (object != nullptr) return object; |
| + } |
| } |
| // Free list allocation failed and there is no next page. Fail if we have |