Commit 6039cda6 authored by Hannes Payer's avatar Hannes Payer Committed by Commit Bot

[heap] Remove NewSpace shrinking logic in CollectAllAvailableGarbage.

NewSpace shrinking is already performed in Heap::GarbageCollectionEpilogueInSafepoint.

Bug: chromium:1054771
Change-Id: Ia274dd5619fd1d7397a06f0b642f07d68de45ea1
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2563267
Commit-Queue: Hannes Payer <hpayer@chromium.org>
Reviewed-by: 's avatarUlan Degenbaev <ulan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#71451}
parent efec9f46
......@@ -1406,10 +1406,6 @@ void Heap::CollectAllAvailableGarbage(GarbageCollectionReason gc_reason) {
}
set_current_gc_flags(kNoGCFlags);
new_space_->Shrink();
new_lo_space_->SetCapacity(new_space_->Capacity() *
kNewLargeObjectSpaceToSemiSpaceRatio);
UncommitFromSpace();
EagerlyFreeExternalMemory();
if (FLAG_trace_duplicate_threshold_kb) {
......
......@@ -457,7 +457,7 @@ void NewSpace::Shrink() {
if (rounded_new_capacity < TotalCapacity() &&
to_space_.ShrinkTo(rounded_new_capacity)) {
// Only shrink from-space if we managed to shrink to-space.
from_space_.Reset();
if (from_space_.is_committed()) from_space_.Reset();
if (!from_space_.ShrinkTo(rounded_new_capacity)) {
// If we managed to shrink to-space but couldn't shrink from
// space, attempt to grow to-space again.
......
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