Index: src/heap/spaces.h |
diff --git a/src/heap/spaces.h b/src/heap/spaces.h |
index c0837e4351b87c08fca9d811607d7d8d2ade6db5..16014c7eacacb62e0318bc40286d23a62060b2a0 100644 |
--- a/src/heap/spaces.h |
+++ b/src/heap/spaces.h |
@@ -1479,7 +1479,7 @@ class AllocationStats BASE_EMBEDDED { |
// Free allocated bytes, making them available (size -> available). |
void DeallocateBytes(intptr_t size_in_bytes) { |
size_ -= size_in_bytes; |
- DCHECK(size_ >= 0); |
+ DCHECK_GE(size_, 0); |
} |
// Merge {other} into {this}. |
@@ -1494,6 +1494,7 @@ class AllocationStats BASE_EMBEDDED { |
void DecreaseCapacity(intptr_t size_in_bytes) { |
capacity_ -= size_in_bytes; |
DCHECK_GE(capacity_, 0); |
+ DCHECK_GE(capacity_, size_); |
} |
void IncreaseCapacity(intptr_t size_in_bytes) { capacity_ += size_in_bytes; } |
@@ -1597,6 +1598,10 @@ class FreeList { |
public: |
explicit FreeList(PagedSpace* owner); |
+ // The method concatenates {other} into {this} and returns the added bytes, |
+ // including waste. |
+ // |
+ // Can be used concurrently. |
intptr_t Concatenate(FreeList* other); |
// Clear the free list. |
@@ -1922,22 +1927,6 @@ class PagedSpace : public Space { |
!p->IsFlagSet(Page::RESCAN_ON_EVACUATION) && !p->WasSwept(); |
} |
- void IncrementUnsweptFreeBytes(intptr_t by) { unswept_free_bytes_ += by; } |
- |
- void IncreaseUnsweptFreeBytes(Page* p) { |
- DCHECK(ShouldBeSweptBySweeperThreads(p)); |
- unswept_free_bytes_ += (p->area_size() - p->LiveBytes()); |
- } |
- |
- void DecrementUnsweptFreeBytes(intptr_t by) { unswept_free_bytes_ -= by; } |
- |
- void DecreaseUnsweptFreeBytes(Page* p) { |
- DCHECK(ShouldBeSweptBySweeperThreads(p)); |
- unswept_free_bytes_ -= (p->area_size() - p->LiveBytes()); |
- } |
- |
- void ResetUnsweptFreeBytes() { unswept_free_bytes_ = 0; } |
- |
// This function tries to steal size_in_bytes memory from the sweeper threads |
// free-lists. If it does not succeed stealing enough memory, it will wait |
// for the sweeper threads to finish sweeping. |
@@ -2020,10 +2009,6 @@ class PagedSpace : public Space { |
// Normal allocation information. |
AllocationInfo allocation_info_; |
- // The number of free bytes which could be reclaimed by advancing the |
- // concurrent sweeper threads. |
- intptr_t unswept_free_bytes_; |
- |
// The sweeper threads iterate over the list of pointer and data space pages |
// and sweep these pages concurrently. They will stop sweeping after the |
// end_of_unswept_pages_ page. |