From 8450c835d52db07c2a70cb5f4178af6fa8fcf9c9 Mon Sep 17 00:00:00 2001 From: Olli Pettay Date: Wed, 1 May 2019 01:41:06 +0300 Subject: [PATCH] Bug 1548146 - Tweak sLastForgetSkippableCycleEndTime handling to be able to check two tasks within < 1ms, r=mccr8 --HG-- extra : rebase_source : a4d82ac6cbac8d58b091565cb8ccc4c12d71fcde --- dom/base/nsJSEnvironment.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dom/base/nsJSEnvironment.cpp b/dom/base/nsJSEnvironment.cpp index f7fb7b0613b0..a10eaf538056 100644 --- a/dom/base/nsJSEnvironment.cpp +++ b/dom/base/nsJSEnvironment.cpp @@ -2066,11 +2066,11 @@ void nsJSContext::MaybePokeCC() { // If GC hasn't run recently and forget skippable only cycle was run, // don't start a new cycle too soon. - if (sCleanupsSinceLastGC > NS_MAJOR_FORGET_SKIPPABLE_CALLS) { + if ((sCleanupsSinceLastGC > NS_MAJOR_FORGET_SKIPPABLE_CALLS) && + !sLastForgetSkippableCycleEndTime.IsNull()) { uint32_t sinceLastForgetSkippableCycle = TimeUntilNow(sLastForgetSkippableCycleEndTime); - if (sinceLastForgetSkippableCycle && - sinceLastForgetSkippableCycle < + if (sinceLastForgetSkippableCycle < NS_TIME_BETWEEN_FORGET_SKIPPABLE_CYCLES) { return; }