Commit b6c0c447 authored by Ulan Degenbaev's avatar Ulan Degenbaev Committed by Commit Bot

[heap] Start unmapper tasks for freed young large pages

This fixes the case of accumulating large pages after scavenges if
there is no mark-compact GC.

Bug: chromium:934453
Change-Id: Ide57c64ae985cc79ad9f477a759ab729f894c73b
Reviewed-on: https://chromium-review.googlesource.com/c/1482740Reviewed-by: 's avatarMichael Lippautz <mlippautz@chromium.org>
Commit-Queue: Ulan Degenbaev <ulan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#59838}
parent 942dc585
...@@ -3797,12 +3797,14 @@ void NewLargeObjectSpace::FreeDeadObjects( ...@@ -3797,12 +3797,14 @@ void NewLargeObjectSpace::FreeDeadObjects(
const std::function<bool(HeapObject)>& is_dead) { const std::function<bool(HeapObject)>& is_dead) {
bool is_marking = heap()->incremental_marking()->IsMarking(); bool is_marking = heap()->incremental_marking()->IsMarking();
size_t surviving_object_size = 0; size_t surviving_object_size = 0;
bool freed_pages = false;
for (auto it = begin(); it != end();) { for (auto it = begin(); it != end();) {
LargePage* page = *it; LargePage* page = *it;
it++; it++;
HeapObject object = page->GetObject(); HeapObject object = page->GetObject();
size_t size = static_cast<size_t>(object->Size()); size_t size = static_cast<size_t>(object->Size());
if (is_dead(object)) { if (is_dead(object)) {
freed_pages = true;
RemovePage(page, size); RemovePage(page, size);
heap()->memory_allocator()->Free<MemoryAllocator::kPreFreeAndQueue>(page); heap()->memory_allocator()->Free<MemoryAllocator::kPreFreeAndQueue>(page);
if (FLAG_concurrent_marking && is_marking) { if (FLAG_concurrent_marking && is_marking) {
...@@ -3815,6 +3817,9 @@ void NewLargeObjectSpace::FreeDeadObjects( ...@@ -3815,6 +3817,9 @@ void NewLargeObjectSpace::FreeDeadObjects(
// Right-trimming does not update the objects_size_ counter. We are lazily // Right-trimming does not update the objects_size_ counter. We are lazily
// updating it after every GC. // updating it after every GC.
objects_size_ = surviving_object_size; objects_size_ = surviving_object_size;
if (freed_pages) {
heap()->memory_allocator()->unmapper()->FreeQueuedChunks();
}
} }
void NewLargeObjectSpace::SetCapacity(size_t capacity) { void NewLargeObjectSpace::SetCapacity(size_t capacity) {
......
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