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

Unified Diff: src/heap/spaces.cc

Issue 2428043002: [heap] Start sweeper tasks after evacuation. (Closed)
Patch Set: address comment Created 4 years, 2 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 9d5ac8ca4a46ecc7c88d0a066277952659e9ebe3..d78d621cda40447408cab4ec260ecbdf0a8f37a3 100644
--- a/src/heap/spaces.cc
+++ b/src/heap/spaces.cc
@@ -394,12 +394,14 @@ void MemoryAllocator::Unmapper::ReconsiderDelayedChunks() {
}
bool MemoryAllocator::CanFreeMemoryChunk(MemoryChunk* chunk) {
- MarkCompactCollector* mc = isolate_->heap()->mark_compact_collector();
// We cannot free memory chunks in new space while the sweeper is running
// since a sweeper thread might be stuck right before trying to lock the
// corresponding page.
- return !chunk->InNewSpace() || (mc == nullptr) || !FLAG_concurrent_sweeping ||
- mc->sweeper().IsSweepingCompleted();
+
+ // Chunks in old generation are unmapped if they are empty.
+ DCHECK(chunk->InNewSpace() || chunk->SweepingDone());
+ return !chunk->InNewSpace() || !FLAG_concurrent_sweeping ||
+ chunk->SweepingDone();
}
bool MemoryAllocator::CommitMemory(Address base, size_t size,
« 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