[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: Ulan Degenbaev <ulan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#71451}
This commit is contained in:
Hannes Payer 2020-11-27 12:35:52 +01:00 committed by Commit Bot
parent efec9f46ba
commit 6039cda616
2 changed files with 1 additions and 5 deletions

View File

@ -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) {

View File

@ -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.