From 8fd57ace20e1e6bb59dd83ed59f513954c0aed9d Mon Sep 17 00:00:00 2001 From: Moonchild Date: Tue, 26 Jan 2021 22:42:46 +0000 Subject: [DOM] Try to avoid slow shrinking GC during sync calls --- dom/workers/WorkerPrivate.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'dom/workers') diff --git a/dom/workers/WorkerPrivate.cpp b/dom/workers/WorkerPrivate.cpp index 860bf8468..1f8b3b70c 100644 --- a/dom/workers/WorkerPrivate.cpp +++ b/dom/workers/WorkerPrivate.cpp @@ -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) { -- cgit v1.2.3