1376614 - Pass budget to forgetSkippable and return early when budget has been used

1376614 - Pass budget to forgetSkippable and return early when budget has been used,
This commit is contained in:
win7-7 2024-04-27 15:30:21 +03:00 committed by wuggy
commit d3450c11de
3 changed files with 50 additions and 18 deletions

View file

@ -1325,7 +1325,13 @@ FireForgetSkippable(uint32_t aSuspected, bool aRemoveChildless)
FinishAnyIncrementalGC();
bool earlyForgetSkippable =
sCleanupsSinceLastGC < NS_MAJOR_FORGET_SKIPPABLE_CALLS;
nsCycleCollector_forgetSkippable(aRemoveChildless, earlyForgetSkippable);
int64_t budgetMs = aDeadline.IsNull() ?
kForgetSkippableSliceDuration :
int64_t((aDeadline - TimeStamp::Now()).ToMilliseconds());
js::SliceBudget budget = js::SliceBudget(js::TimeBudget(budgetMs));
nsCycleCollector_forgetSkippable(budget, aRemoveChildless, earlyForgetSkippable);
sPreviousSuspectedCount = nsCycleCollector_suspectedCount();
++sCleanupsSinceLastGC;
PRTime delta = PR_Now() - startTime;