Bug 1647342 - Part 3: Remove unused detachAllDebuggersFromGlobal Debugger method. r=arai! draft
authorLogan Smyth <loganfsmyth@gmail.com>
Wed, 24 Jun 2020 00:01:13 +0000
changeset 3000026 37573ea1bdea78ec900d7e2f80151a52ba4618f8
parent 3000025 13cd016748a2c43c42bbb14c2dd8002c1cdb39ad
child 3000027 6efa0c7a1c918af50b8b567b8b5e1ae114871091
push id558604
push userreviewbot
push dateWed, 24 Jun 2020 00:01:54 +0000
treeherdertry@997f6b6c671f [default view] [failures only]
reviewersarai
bugs1647342
milestone79.0a1
Bug 1647342 - Part 3: Remove unused detachAllDebuggersFromGlobal Debugger method. r=arai! Summary: I have no idea how long this has been stale. Differential Revision: https://phabricator.services.mozilla.com/D80736 Depends on D80735 Test Plan: Reviewers: Subscribers: Bug #: 1647342 Differential Diff: PHID-DIFF-pm56s2opuy672eaeawhj
js/src/debugger/Debugger.cpp
js/src/debugger/Debugger.h
--- a/js/src/debugger/Debugger.cpp
+++ b/js/src/debugger/Debugger.cpp
@@ -3834,27 +3834,16 @@ void DebugAPI::sweepAll(JSFreeOp* fop) {
     if (debuggerDying) {
       fop->delete_(dbg->object, dbg, MemoryUse::Debugger);
     }
 
     dbg = next;
   }
 }
 
-/* static */
-void Debugger::detachAllDebuggersFromGlobal(JSFreeOp* fop,
-                                            GlobalObject* global) {
-  const Realm::DebuggerVector& debuggers = global->getDebuggers();
-  MOZ_ASSERT(!debuggers.empty());
-  while (!debuggers.empty()) {
-    debuggers.back().dbg->removeDebuggeeGlobal(fop, global, nullptr,
-                                               Debugger::FromSweep::No);
-  }
-}
-
 static inline bool SweepZonesInSameGroup(Zone* a, Zone* b) {
   // Ensure two zones are swept in the same sweep group by adding an edge
   // between them in each direction.
   return a->addSweepGroupEdgeTo(b) && b->addSweepGroupEdgeTo(a);
 }
 
 /* static */
 bool DebugAPI::findSweepGroupEdges(JSRuntime* rt) {
--- a/js/src/debugger/Debugger.h
+++ b/js/src/debugger/Debugger.h
@@ -1084,17 +1084,16 @@ class Debugger : private mozilla::Linked
 
   Zone* zone() const { return toJSObject()->zone(); }
 
   bool hasMemory() const;
   DebuggerMemory& memory() const;
 
   WeakGlobalObjectSet::Range allDebuggees() const { return debuggees.all(); }
 
-  static void detachAllDebuggersFromGlobal(JSFreeOp* fop, GlobalObject* global);
 #ifdef DEBUG
   static bool isDebuggerCrossCompartmentEdge(JSObject* obj,
                                              const js::gc::Cell* cell);
 #endif
 
   static bool hasLiveHook(GlobalObject* global, Hook which);
 
   /*** Functions for use by Debugger.cpp. *********************************/