Commit 7fbce1ad authored by Ulan Degenbaev's avatar Ulan Degenbaev Committed by Commit Bot

[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/1483055Reviewed-by: 's avatarMichael Lippautz <mlippautz@chromium.org>
Commit-Queue: Ulan Degenbaev <ulan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#59842}
parent 45ed388d
......@@ -639,6 +639,7 @@ void Heap::GarbageCollectionPrologue() {
ephemeron_retainer_.clear();
retaining_root_.clear();
}
memory_allocator()->unmapper()->PrepareForGC();
}
size_t Heap::SizeOfObjects() {
......
......@@ -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();
......
......@@ -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();
}
......
......@@ -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();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment