[tor-commits] [tor-browser] 43/43: Bug 1768734 - Make sure JS holders are cleared before a shutdown GC. r=mccr8, a=RyanVM

gitolite role git at cupani.torproject.org
Tue May 31 07:07:26 UTC 2022


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

pierov pushed a commit to branch tor-browser-91.10.0esr-11.0-1
in repository tor-browser.

commit 2010fcc588669fbdb36cf9953e126c4a6e176643
Author: Jon Coppeard <jcoppeard at mozilla.com>
AuthorDate: Mon May 23 10:39:47 2022 +0000

    Bug 1768734 - Make sure JS holders are cleared before a shutdown GC. r=mccr8, a=RyanVM
    
    Differential Revision: https://phabricator.services.mozilla.com/D147074
---
 xpcom/base/CycleCollectedJSRuntime.cpp | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/xpcom/base/CycleCollectedJSRuntime.cpp b/xpcom/base/CycleCollectedJSRuntime.cpp
index 98663952e8db7..86ee791994220 100644
--- a/xpcom/base/CycleCollectedJSRuntime.cpp
+++ b/xpcom/base/CycleCollectedJSRuntime.cpp
@@ -972,10 +972,12 @@ void CycleCollectedJSRuntime::TraceGrayJS(JSTracer* aTracer, void* aData) {
 
   // Mark these roots as gray so the CC can walk them later.
 
-  JSHolderMap::WhichHolders which = JSHolderMap::HoldersInCollectingZones;
-  if (JS::AtomsZoneIsCollecting(self->Runtime())) {
-    // Any holder may point into the atoms zone.
-    which = JSHolderMap::AllHolders;
+  // Only trace holders in collecting zones when marking, except if we are
+  // collecting the atoms zone since any holder may point into that zone.
+  JSHolderMap::WhichHolders which = JSHolderMap::AllHolders;
+  if (aTracer->isMarkingTracer() &&
+      !JS::AtomsZoneIsCollecting(self->Runtime())) {
+    which = JSHolderMap::HoldersInCollectingZones;
   }
 
   self->TraceNativeGrayRoots(aTracer, which);

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


More information about the tor-commits mailing list