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

Unified Diff: src/heap/spaces.cc

Issue 2862563002: [heap] Pause black allocation during GCs (Closed)
Patch Set: Created 3 years, 8 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/spaces.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/heap/spaces.cc
diff --git a/src/heap/spaces.cc b/src/heap/spaces.cc
index dc271ecc66e9292eb3cec230abd8e6c69e1c0884..371dfb1e5627b403886d4d292f782debb630d5cf 100644
--- a/src/heap/spaces.cc
+++ b/src/heap/spaces.cc
@@ -849,6 +849,17 @@ void Page::CreateBlackArea(Address start, Address end) {
static_cast<int>(end - start));
}
+void Page::DestroyBlackArea(Address start, Address end) {
+ DCHECK(heap()->incremental_marking()->black_allocation());
+ DCHECK_EQ(Page::FromAddress(start), this);
+ DCHECK_NE(start, end);
+ DCHECK_EQ(Page::FromAddress(end - 1), this);
+ MarkingState::Internal(this).bitmap()->ClearRange(
+ AddressToMarkbitIndex(start), AddressToMarkbitIndex(end));
+ MarkingState::Internal(this).IncrementLiveBytes(
+ -static_cast<int>(end - start));
+}
+
void MemoryAllocator::PartialFreeMemory(MemoryChunk* chunk,
Address start_free) {
// We do not allow partial shrink for code.
@@ -1413,6 +1424,15 @@ void PagedSpace::MarkAllocationInfoBlack() {
}
}
+void PagedSpace::UnmarkAllocationInfo() {
+ Address current_top = top();
+ Address current_limit = limit();
+ if (current_top != nullptr && current_top != current_limit) {
+ Page::FromAllocationAreaAddress(current_top)
+ ->DestroyBlackArea(current_top, current_limit);
+ }
+}
+
// Empty space allocation info, returning unused area to free list.
void PagedSpace::EmptyAllocationInfo() {
// Mark the old linear allocation area with a free space map so it can be
« no previous file with comments | « src/heap/spaces.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698