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

Unified Diff: src/heap/spaces.cc

Issue 2446583003: Revert of Reland "[heap] Start sweeper tasks after evacuation. (patchset #2 id:20001 of https://chromiumcoder… (Closed)
Patch Set: fix formatting 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 5e0a7a86a2aa3751a179ae732f090c63c9a705d1..3a794a8c6b4417ad4c7faa5b14d3d0510634d3d3 100644
--- a/src/heap/spaces.cc
+++ b/src/heap/spaces.cc
@@ -394,14 +394,12 @@ 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.
-
- // Chunks in old generation are unmapped if they are empty.
- DCHECK(chunk->InNewSpace() || chunk->SweepingDone());
- return !chunk->InNewSpace() || !FLAG_concurrent_sweeping ||
- chunk->SweepingDone();
+ return !chunk->InNewSpace() || (mc == nullptr) || !FLAG_concurrent_sweeping ||
+ mc->sweeper().IsSweepingCompleted();
}
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