Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(474)

Unified Diff: src/heap/spaces.h

Issue 1380723002: [heap] Remove unswept bytes counter (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Simplify concatenate API and add comment Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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.
« src/heap/mark-compact.cc ('K') | « src/heap/mark-compact.cc ('k') | src/heap/spaces.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698