[heap] Fix DCHECK in Heap::PerformGarbageCollection

In memory reducing GCs, promoted page iteration is not delayed and thus
pretenuring feedback is available earlier.

Bug: chromium:1411113
Change-Id: I3140b0bbcb9bfa537def5faac9ddd07183668498
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4204030
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Commit-Queue: Omer Katz <omerkatz@chromium.org>
Cr-Commit-Position: refs/heads/main@{#85557}
This commit is contained in:
Omer Katz 2023-01-30 17:28:43 +01:00 committed by V8 LUCI CQ
parent 39b0ade26b
commit cabbfe53d5
2 changed files with 4 additions and 4 deletions

View File

@ -2260,9 +2260,11 @@ size_t Heap::PerformGarbageCollection(GarbageCollector collector,
Scavenge();
}
DCHECK_IMPLIES(collector == GarbageCollector::MINOR_MARK_COMPACTOR,
DCHECK_IMPLIES(collector == GarbageCollector::MINOR_MARK_COMPACTOR &&
!ShouldReduceMemory() && v8_flags.concurrent_sweeping,
!pretenuring_handler_.HasPretenuringFeedback());
if (collector != GarbageCollector::MINOR_MARK_COMPACTOR)
if (collector != GarbageCollector::MINOR_MARK_COMPACTOR ||
pretenuring_handler_.HasPretenuringFeedback())
pretenuring_handler_.ProcessPretenuringFeedback();
UpdateSurvivalStatistics(static_cast<int>(start_young_generation_size));

View File

@ -68,11 +68,9 @@ class PretenuringHandler final {
// Removes an entry from the global pretenuring storage.
void RemoveAllocationSitePretenuringFeedback(AllocationSite site);
#if DEBUG
bool HasPretenuringFeedback() const {
return !global_pretenuring_feedback_.empty();
}
#endif // DEBUG
private:
bool DeoptMaybeTenuredAllocationSites() const;