[heap] Ensure that non-regular chunks are freed before scavenge

This prevents accumulation of non-regular chunks if unmapper tasks
are not making progress.

Bug: chromium:934453
Change-Id: I552bc4f566f4be8877d9e806cca2aa9c284a7f4f
Reviewed-on: https://chromium-review.googlesource.com/c/1483055
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Commit-Queue: Ulan Degenbaev <ulan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#59842}
This commit is contained in:
Ulan Degenbaev 2019-02-22 18:58:01 +01:00 committed by Commit Bot
parent 45ed388d3b
commit 7fbce1ad4b
4 changed files with 3 additions and 5 deletions

View File

@ -639,6 +639,7 @@ void Heap::GarbageCollectionPrologue() {
ephemeron_retainer_.clear();
retaining_root_.clear();
}
memory_allocator()->unmapper()->PrepareForGC();
}
size_t Heap::SizeOfObjects() {

View File

@ -796,8 +796,6 @@ void MarkCompactCollector::Prepare() {
heap()->incremental_marking()->Stop();
}
heap()->memory_allocator()->unmapper()->PrepareForMarkCompact();
if (!was_marked_incrementally_) {
TRACE_GC(heap()->tracer(), GCTracer::Scope::MC_MARK_EMBEDDER_PROLOGUE);
heap_->local_embedder_heap_tracer()->TracePrologue();

View File

@ -307,8 +307,7 @@ void MemoryAllocator::Unmapper::CancelAndWaitForPendingTasks() {
}
}
void MemoryAllocator::Unmapper::PrepareForMarkCompact() {
CancelAndWaitForPendingTasks();
void MemoryAllocator::Unmapper::PrepareForGC() {
// Free non-regular chunks because they cannot be re-used.
PerformFreeMemoryOnQueuedNonRegularChunks();
}

View File

@ -1250,7 +1250,7 @@ class V8_EXPORT_PRIVATE MemoryAllocator {
V8_EXPORT_PRIVATE void FreeQueuedChunks();
void CancelAndWaitForPendingTasks();
void PrepareForMarkCompact();
void PrepareForGC();
void EnsureUnmappingCompleted();
V8_EXPORT_PRIVATE void TearDown();
size_t NumberOfCommittedChunks();