[DOM] Try to avoid slow shrinking GC during sync calls

This commit is contained in:
Moonchild 2021-01-26 22:42:46 +00:00 committed by roytam1
commit 8630e4f6dc
2 changed files with 2 additions and 2 deletions

View file

@ -6392,7 +6392,7 @@ WorkerPrivate::GarbageCollectInternal(JSContext* aCx, bool aShrinking,
if (aShrinking || aCollectChildren) {
JS::PrepareForFullGC(aCx);
if (aShrinking) {
if (aShrinking && mSyncLoopStack.IsEmpty()) {
JS::GCForReason(aCx, GC_SHRINK, JS::gcreason::DOM_WORKER);
if (!aCollectChildren) {