[tor-commits] [tor-browser] 242/311: Backed out changeset efd35f1d9bd5 (bug 1661293) for causing Bug 1758370

gitolite role git at cupani.torproject.org
Tue Apr 26 15:30:42 UTC 2022


This is an automated email from the git hooks/post-receive script.

pierov pushed a commit to branch geckoview-99.0.1-11.0-1
in repository tor-browser.

commit 10de58b9b33398a274bce279e2d2b5591e764d86
Author: donal meehan <dmeehan at mozilla.com>
AuthorDate: Wed Mar 23 17:23:23 2022 -0400

    Backed out changeset efd35f1d9bd5 (bug 1661293) for causing Bug 1758370
---
 dom/base/CCGCScheduler.cpp             | 21 ---------------------
 dom/base/CCGCScheduler.h               |  1 -
 dom/base/nsJSEnvironment.cpp           | 11 -----------
 dom/base/nsJSEnvironment.h             |  7 +------
 js/xpconnect/src/XPCJSContext.cpp      |  3 ---
 js/xpconnect/src/xpcprivate.h          |  4 ----
 xpcom/base/CycleCollectedJSContext.cpp |  6 ++----
 xpcom/base/CycleCollectedJSContext.h   |  4 ++--
 8 files changed, 5 insertions(+), 52 deletions(-)

diff --git a/dom/base/CCGCScheduler.cpp b/dom/base/CCGCScheduler.cpp
index b1d88736cd040..ad426b58d6fe6 100644
--- a/dom/base/CCGCScheduler.cpp
+++ b/dom/base/CCGCScheduler.cpp
@@ -465,9 +465,6 @@ void CCGCScheduler::PokeFullGC() {
 
 void CCGCScheduler::PokeGC(JS::GCReason aReason, JSObject* aObj,
                            TimeDuration aDelay) {
-  MOZ_ASSERT(aReason != JS::GCReason::NO_REASON);
-  MOZ_ASSERT(aReason != JS::GCReason::EAGER_NURSERY_COLLECTION);
-
   if (mDidShutdown) {
     return;
   }
@@ -505,24 +502,6 @@ void CCGCScheduler::PokeGC(JS::GCReason aReason, JSObject* aObj,
   EnsureGCRunner(delay);
 }
 
-void CCGCScheduler::PokeMinorGC(JS::GCReason aReason) {
-  MOZ_ASSERT(aReason != JS::GCReason::NO_REASON);
-
-  if (mDidShutdown) {
-    return;
-  }
-
-  SetWantEagerMinorGC(aReason);
-
-  if (mGCRunner || mHaveAskedParent || mCCRunner) {
-    // There's already a runner, or there will be, so just return.
-    return;
-  }
-
-  // Immediately start looking for idle time to run the minor GC.
-  EnsureGCRunner(0);
-}
-
 void CCGCScheduler::EnsureGCRunner(TimeDuration aDelay) {
   if (mGCRunner) {
     return;
diff --git a/dom/base/CCGCScheduler.h b/dom/base/CCGCScheduler.h
index b72cf2505471c..393d0125a317d 100644
--- a/dom/base/CCGCScheduler.h
+++ b/dom/base/CCGCScheduler.h
@@ -168,7 +168,6 @@ class CCGCScheduler {
   void PokeShrinkingGC();
   void PokeFullGC();
   void MaybePokeCC(TimeStamp aNow, uint32_t aSuspectedCCObjects);
-  void PokeMinorGC(JS::GCReason aReason);
 
   void UserIsInactive();
   void UserIsActive();
diff --git a/dom/base/nsJSEnvironment.cpp b/dom/base/nsJSEnvironment.cpp
index add8c6deb01c3..c4f42f3ab2da9 100644
--- a/dom/base/nsJSEnvironment.cpp
+++ b/dom/base/nsJSEnvironment.cpp
@@ -1656,17 +1656,6 @@ void nsJSContext::PokeGC(JS::GCReason aReason, JSObject* aObj,
 }
 
 // static
-void nsJSContext::MaybePokeGC() {
-  if (sShuttingDown) {
-    return;
-  }
-
-  JSRuntime* rt = CycleCollectedJSRuntime::Get()->Runtime();
-  if (JS::IsIdleGCTaskNeeded(rt)) {
-    sScheduler.PokeMinorGC(JS::GCReason::EAGER_NURSERY_COLLECTION);
-  }
-}
-
 void nsJSContext::DoLowMemoryGC() {
   if (sShuttingDown) {
     return;
diff --git a/dom/base/nsJSEnvironment.h b/dom/base/nsJSEnvironment.h
index aacdc8139e45d..e339305176918 100644
--- a/dom/base/nsJSEnvironment.h
+++ b/dom/base/nsJSEnvironment.h
@@ -103,15 +103,10 @@ class nsJSContext : public nsIScriptContext {
   static void MaybeRunNextCollectorSlice(nsIDocShell* aDocShell,
                                          JS::GCReason aReason);
 
-  // The GC should run soon, in the zone of aObj if given. If aObj is
-  // nullptr, collect all Zones.
+  // The GC should probably run soon, in the zone of object aObj (if given).
   static void PokeGC(JS::GCReason aReason, JSObject* aObj,
                      mozilla::TimeDuration aDelay = 0);
 
-  // If usage is nearing a threshold, request idle-only GC work. (This is called
-  // when a collection would be relatively convenient.)
-  static void MaybePokeGC();
-
   // Immediately perform a non-incremental shrinking GC and CC.
   static void DoLowMemoryGC();
 
diff --git a/js/xpconnect/src/XPCJSContext.cpp b/js/xpconnect/src/XPCJSContext.cpp
index eba040f35ccd2..be9a29cc11b9c 100644
--- a/js/xpconnect/src/XPCJSContext.cpp
+++ b/js/xpconnect/src/XPCJSContext.cpp
@@ -38,7 +38,6 @@
 #include "nsCCUncollectableMarker.h"
 #include "nsCycleCollectionNoteRootCallback.h"
 #include "nsCycleCollector.h"
-#include "nsJSEnvironment.h"
 #include "jsapi.h"
 #include "js/ArrayBuffer.h"
 #include "js/ContextOptions.h"
@@ -1491,8 +1490,6 @@ void XPCJSContext::AfterProcessTask(uint32_t aNewRecursionDepth) {
   SetPendingException(nullptr);
 }
 
-void XPCJSContext::MaybePokeGC() { nsJSContext::MaybePokeGC(); }
-
 bool XPCJSContext::IsSystemCaller() const {
   return nsContentUtils::IsSystemCaller(Context());
 }
diff --git a/js/xpconnect/src/xpcprivate.h b/js/xpconnect/src/xpcprivate.h
index 4f98ad778c01b..ac4bc1a9cd09c 100644
--- a/js/xpconnect/src/xpcprivate.h
+++ b/js/xpconnect/src/xpcprivate.h
@@ -337,10 +337,6 @@ class XPCJSContext final : public mozilla::CycleCollectedJSContext,
   virtual void BeforeProcessTask(bool aMightBlock) override;
   virtual void AfterProcessTask(uint32_t aNewRecursionDepth) override;
 
-  // Relay to the CCGCScheduler instead of queuing up an idle runnable
-  // (as is done for workers in CycleCollectedJSContext).
-  virtual void MaybePokeGC() override;
-
   ~XPCJSContext();
 
   size_t SizeOfIncludingThis(mozilla::MallocSizeOf mallocSizeOf);
diff --git a/xpcom/base/CycleCollectedJSContext.cpp b/xpcom/base/CycleCollectedJSContext.cpp
index 7bac784f1cdfa..136a5e7062609 100644
--- a/xpcom/base/CycleCollectedJSContext.cpp
+++ b/xpcom/base/CycleCollectedJSContext.cpp
@@ -467,7 +467,7 @@ void CycleCollectedJSContext::AfterProcessTask(uint32_t aRecursionDepth) {
 
   // This should be a fast test so that it won't affect the next task
   // processing.
-  MaybePokeGC();
+  IsIdleGCTaskNeeded();
 }
 
 void CycleCollectedJSContext::AfterProcessMicrotasks() {
@@ -493,9 +493,7 @@ void CycleCollectedJSContext::AfterProcessMicrotasks() {
   JS::ClearKeptObjects(mJSContext);
 }
 
-void CycleCollectedJSContext::MaybePokeGC() {
-  // Worker-compatible check to see if we want to do an idle-time minor
-  // GC.
+void CycleCollectedJSContext::IsIdleGCTaskNeeded() const {
   class IdleTimeGCTaskRunnable : public mozilla::IdleRunnable {
    public:
     using mozilla::IdleRunnable::IdleRunnable;
diff --git a/xpcom/base/CycleCollectedJSContext.h b/xpcom/base/CycleCollectedJSContext.h
index 4236e58434402..c6f18f5c714b8 100644
--- a/xpcom/base/CycleCollectedJSContext.h
+++ b/xpcom/base/CycleCollectedJSContext.h
@@ -210,8 +210,8 @@ class CycleCollectedJSContext : dom::PerThreadAtomCache, private JS::JobQueue {
   MOZ_CAN_RUN_SCRIPT_BOUNDARY
   virtual void AfterProcessTask(uint32_t aRecursionDepth);
 
-  // Check whether we need an idle minor GC task.
-  virtual void MaybePokeGC();
+  // Check whether we need an idle GC task.
+  void IsIdleGCTaskNeeded() const;
 
   uint32_t RecursionDepth() const;
 

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the tor-commits mailing list