mirror of
https://github.com/roytam1/UXP.git
synced 2026-05-26 05:46:58 +00:00
Revert "Issue #3092 - Perform a minor GC on tab close"
This reverts commit 266cc371f7bbb507c07f4e65a1244e5094cd1623.
This commit is contained in:
+3
-19
@@ -6060,12 +6060,6 @@ GCRuntime::checkCanCallAPI()
|
||||
bool
|
||||
GCRuntime::checkIfGCAllowedInCurrentState(JS::gcreason::Reason reason)
|
||||
{
|
||||
auto isTabCloseReason = [](JS::gcreason::Reason r) {
|
||||
return r == JS::gcreason::PAGE_HIDE ||
|
||||
r == JS::gcreason::POST_COMPARTMENT ||
|
||||
r == JS::gcreason::NSJSCONTEXT_DESTROY;
|
||||
};
|
||||
|
||||
if (rt->mainThread.suppressGC)
|
||||
return false;
|
||||
|
||||
@@ -6074,10 +6068,8 @@ GCRuntime::checkIfGCAllowedInCurrentState(JS::gcreason::Reason reason)
|
||||
if (rt->isBeingDestroyed() && !IsShutdownGC(reason))
|
||||
return false;
|
||||
|
||||
// Allow fast tab-close cleanup even when the runtime is otherwise busy.
|
||||
if (!isTabCloseReason(reason) &&
|
||||
!IdleGCManager::shouldBypassIdleCheck(reason) &&
|
||||
!idleGC.isIdleEnough())
|
||||
// Check if the system is idle enough for GC, unless this is a critical GC
|
||||
if (!IdleGCManager::shouldBypassIdleCheck(reason) && !idleGC.isIdleEnough())
|
||||
return false;
|
||||
|
||||
return true;
|
||||
@@ -6164,16 +6156,8 @@ js::AutoEnqueuePendingParseTasksAfterGC::~AutoEnqueuePendingParseTasksAfterGC()
|
||||
SliceBudget
|
||||
GCRuntime::defaultBudget(JS::gcreason::Reason reason, int64_t millis)
|
||||
{
|
||||
auto isTabCloseReason = [](JS::gcreason::Reason r) {
|
||||
return r == JS::gcreason::PAGE_HIDE ||
|
||||
r == JS::gcreason::POST_COMPARTMENT ||
|
||||
r == JS::gcreason::NSJSCONTEXT_DESTROY;
|
||||
};
|
||||
|
||||
if (millis == 0) {
|
||||
if (isTabCloseReason(reason))
|
||||
millis = 3;
|
||||
else if (reason == JS::gcreason::ALLOC_TRIGGER)
|
||||
if (reason == JS::gcreason::ALLOC_TRIGGER)
|
||||
millis = defaultSliceBudget();
|
||||
else if (schedulingState.inHighFrequencyGCMode() && tunables.isDynamicMarkSliceEnabled())
|
||||
millis = defaultSliceBudget() * IGC_MARK_SLICE_MULTIPLIER;
|
||||
|
||||
Reference in New Issue
Block a user