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

Unified Diff: src/heap/mark-compact.cc

Issue 2020743002: [heap] Add the free remainder of a black page to the free list. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rename test Created 4 years, 7 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
« no previous file with comments | « src/heap/incremental-marking.h ('k') | src/heap/spaces.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/heap/mark-compact.cc
diff --git a/src/heap/mark-compact.cc b/src/heap/mark-compact.cc
index 713ce8d3ac3b129ca55c01ea09e33443992ec130..555ad6b31291ac99cf0ef60e24774c38df7c255f 100644
--- a/src/heap/mark-compact.cc
+++ b/src/heap/mark-compact.cc
@@ -3813,6 +3813,7 @@ void MarkCompactCollector::Sweeper::AddSweepingPageSafe(AllocationSpace space,
}
void MarkCompactCollector::StartSweepSpace(PagedSpace* space) {
+ Address space_top = space->top();
space->ClearStats();
PageIterator it(space);
@@ -3836,7 +3837,15 @@ void MarkCompactCollector::StartSweepSpace(PagedSpace* space) {
Bitmap::Clear(p);
p->concurrent_sweeping_state().SetValue(Page::kSweepingDone);
p->ClearFlag(Page::BLACK_PAGE);
- // TODO(hpayer): Free unused memory of last black page.
+ // Area above the high watermark is free.
+ Address free_start = p->HighWaterMark();
+ // Check if the space top was in this page, which means that the
+ // high watermark is not up-to-date.
+ if (free_start < space_top && space_top <= p->area_end()) {
+ free_start = space_top;
+ }
+ int size = static_cast<int>(p->area_end() - free_start);
+ space->Free(free_start, size);
continue;
}
« no previous file with comments | « src/heap/incremental-marking.h ('k') | src/heap/spaces.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698