Revert "[heap] Adjust pretenuring heuristic for MinorMC"

This reverts commit a614ccb8f7.

Reason for revert: Causes failures with --shared-string-table

https://bugs.chromium.org/p/chromium/issues/detail?id=1399489
https://bugs.chromium.org/p/chromium/issues/detail?id=1399491
https://bugs.chromium.org/p/chromium/issues/detail?id=1399488
https://bugs.chromium.org/p/v8/issues/detail?id=13574

Original change's description:
> [heap] Adjust pretenuring heuristic for MinorMC
>
> MinorMC needed to process pretenuring feedback both after sweeping and
> at the end of the atomic pause, despite having no new feedback at the
> end of the atomic pause, because the heuristics didn't hold after
> sweeping. This CL adjusts the heuristics for MinorMC so that processing
> twice is no longer needed.
>
> Bug: v8:12612
> Change-Id: I4d3ebaeaa6e7868bcdcae6fbdb3bcecb0ebcb8bf
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4085983
> Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
> Commit-Queue: Omer Katz <omerkatz@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#84730}

Bug: v8:12612
Change-Id: I291de288cb1dff451197fc222ede49b428893fe0
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4089968
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Dominik Inführ <dinfuehr@chromium.org>
Cr-Commit-Position: refs/heads/main@{#84757}
This commit is contained in:
Dominik Inführ 2022-12-09 12:55:39 +00:00 committed by V8 LUCI CQ
parent fb02c04d48
commit 5b9cc13eb5
3 changed files with 2 additions and 14 deletions

View File

@ -2258,8 +2258,7 @@ size_t Heap::PerformGarbageCollection(GarbageCollector collector,
DCHECK_IMPLIES(collector == GarbageCollector::MINOR_MARK_COMPACTOR,
!pretenuring_handler_.HasPretenuringFeedback());
if (collector != GarbageCollector::MINOR_MARK_COMPACTOR)
pretenuring_handler_.ProcessPretenuringFeedback();
pretenuring_handler_.ProcessPretenuringFeedback();
UpdateSurvivalStatistics(static_cast<int>(start_young_generation_size));
ConfigureInitialOldGenerationSize();

View File

@ -1946,10 +1946,7 @@ class Heap {
void UpdateTotalGCTime(double duration);
bool MaximumSizeMinorGC() const { return maximum_size_minor_gcs_ > 0; }
bool IsFirstMaximumSizeMinorGC() const {
return maximum_size_minor_gcs_ == 1;
}
bool MaximumSizeMinorGC() { return maximum_size_minor_gcs_ > 0; }
bool IsIneffectiveMarkCompact(size_t old_generation_size,
double mutator_utilization);

View File

@ -4,9 +4,7 @@
#include "src/heap/pretenuring-handler.h"
#include "src/common/globals.h"
#include "src/execution/isolate.h"
#include "src/flags/flags.h"
#include "src/handles/global-handles-inl.h"
#include "src/heap/new-spaces.h"
#include "src/objects/allocation-site-inl.h"
@ -46,12 +44,6 @@ void PretenuringHandler::MergeAllocationSitePretenuringFeedback(
bool PretenuringHandler::DeoptMaybeTenuredAllocationSites() const {
NewSpace* new_space = heap_->new_space();
if (heap_->tracer()->GetCurrentCollector() ==
GarbageCollector::MINOR_MARK_COMPACTOR) {
DCHECK(v8_flags.minor_mc);
DCHECK_NOT_NULL(new_space);
return heap_->IsFirstMaximumSizeMinorGC();
}
return new_space && new_space->IsAtMaximumCapacity() &&
!heap_->MaximumSizeMinorGC();
}