Bug 1574449 - revert sweepAtomIncrementally. r=jonco
authorYoshi Cheng-Hao Huang <allstars.chh@gmail.com>
Tue, 20 Aug 2019 18:58:04 +0000
changeset 489046 79ab941f4f41e231257d3697a9e442e3c3aef7eb
parent 489045 c4beb93536583415da4c05c3d27154d38d8e4970
child 489047 a9d8686d7b495b58cda85750a6726abd250bee67
push id93095
push userallstars.chh@gmail.com
push dateTue, 20 Aug 2019 18:59:01 +0000
treeherderautoland@79ab941f4f41 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjonco
bugs1574449
milestone70.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1574449 - revert sweepAtomIncrementally. r=jonco Differential Revision: https://phabricator.services.mozilla.com/D42598
js/src/gc/GC.cpp
js/src/vm/AtomsTable.h
js/src/vm/JSAtom.cpp
--- a/js/src/gc/GC.cpp
+++ b/js/src/gc/GC.cpp
@@ -6148,19 +6148,17 @@ IncrementalProgress GCRuntime::sweepAtom
 
   gcstats::AutoPhase ap(stats(), gcstats::PhaseKind::SWEEP_ATOMS_TABLE);
 
   auto& maybeAtoms = maybeAtomsToSweep.ref();
   if (!maybeAtoms) {
     return Finished;
   }
 
-  SweepingTracer trc(rt);
-  if (!rt->atomsForSweeping()->traceWeakIncrementally(&trc, maybeAtoms.ref(),
-                                                      budget)) {
+  if (!rt->atomsForSweeping()->sweepIncrementally(maybeAtoms.ref(), budget)) {
     return NotFinished;
   }
 
   maybeAtoms.reset();
 
   return Finished;
 }
 
--- a/js/src/vm/AtomsTable.h
+++ b/js/src/vm/AtomsTable.h
@@ -188,18 +188,17 @@ class AtomsTable {
   void tracePinnedAtoms(JSTracer* trc, const AutoAccessAtomsZone& access);
 
   // Sweep all atoms non-incrementally.
   void traceWeak(JSTracer* trc);
 
   bool startIncrementalSweep();
 
   // Sweep some atoms incrementally and return whether we finished.
-  bool traceWeakIncrementally(JSTracer* trc, SweepIterator& atomsToSweep,
-                              SliceBudget& budget);
+  bool sweepIncrementally(SweepIterator& atomsToSweep, SliceBudget& budget);
 
 #ifdef DEBUG
   bool mainThreadHasAllLocks() const { return allPartitionsLocked; }
 #endif
 
   size_t sizeOfIncludingThis(mozilla::MallocSizeOf mallocSizeOf) const;
 
  private:
--- a/js/src/vm/JSAtom.cpp
+++ b/js/src/vm/JSAtom.cpp
@@ -584,29 +584,31 @@ void AtomsTable::mergeAtomsAddedWhileSwe
                            r.front())) {
       oomUnsafe.crash("Adding atom from secondary table after sweep");
     }
   }
 
   js_delete(newAtoms);
 }
 
-bool AtomsTable::traceWeakIncrementally(JSTracer* trc,
-                                        SweepIterator& atomsToSweep,
-                                        SliceBudget& budget) {
+bool AtomsTable::sweepIncrementally(SweepIterator& atomsToSweep,
+                                    SliceBudget& budget) {
   // Sweep the table incrementally until we run out of work or budget.
   while (!atomsToSweep.empty()) {
     budget.step();
     if (budget.isOverBudget()) {
       return false;
     }
 
     JSAtom* atom = atomsToSweep.front();
     MOZ_DIAGNOSTIC_ASSERT(atom);
-    if (!TraceWeakEdge(trc, &atom, "maybeAtomsToSweep")) {
+    // TODO: Bug 1574981 - investigate talos regression in
+    // AtomsTable::sweepIncrementally
+    if (IsAboutToBeFinalizedUnbarriered(&atom)) {
+      MOZ_ASSERT(!atom->isPinned());
       atomsToSweep.removeFront();
     } else {
       MOZ_ASSERT(atom == atomsToSweep.front());
     }
     atomsToSweep.popFront();
   }
 
   for (size_t i = 0; i < PartitionCount; i++) {