Bug 1691361 - Do not add BigInts to the tenuring fixup list, since they do not have children r=jonco
authorSteve Fink <sfink@mozilla.com>
Fri, 12 Feb 2021 17:16:27 +0000
changeset 567358 db8812c0aed81d3a9dbaab29065ff2002eaee071
parent 567357 69fc05e2d363c0cd25ba48251cb88999778081d9
child 567359 f9dbe7d566bbff6190c18435535d8ff99a2622b3
push id136368
push usersfink@mozilla.com
push dateFri, 12 Feb 2021 17:18:54 +0000
treeherderautoland@729dc620483a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjonco
bugs1691361
milestone87.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 1691361 - Do not add BigInts to the tenuring fixup list, since they do not have children r=jonco Differential Revision: https://phabricator.services.mozilla.com/D104932
js/src/gc/Marking.cpp
js/src/gc/Nursery.cpp
js/src/gc/Nursery.h
--- a/js/src/gc/Marking.cpp
+++ b/js/src/gc/Marking.cpp
@@ -3560,37 +3560,29 @@ void js::Nursery::relocateDependentStrin
         return;
       }
 
       baseOrRelocOverlay = base->nurseryBaseOrRelocOverlay();
     }
   }
 }
 
-inline void js::TenuringTracer::insertIntoBigIntFixupList(
-    RelocationOverlay* entry) {
-  *bigIntTail = entry;
-  bigIntTail = &entry->nextRef();
-  *bigIntTail = nullptr;
-}
-
 JS::BigInt* js::TenuringTracer::moveToTenured(JS::BigInt* src) {
   MOZ_ASSERT(IsInsideNursery(src));
   MOZ_ASSERT(!src->nurseryZone()->usedByHelperThread());
 
   AllocKind dstKind = src->getAllocKind();
   Zone* zone = src->nurseryZone();
   zone->tenuredBigInts++;
 
   JS::BigInt* dst = allocTenured<JS::BigInt>(zone, dstKind);
   tenuredSize += moveBigIntToTenured(dst, src, dstKind);
   tenuredCells++;
 
-  RelocationOverlay* overlay = RelocationOverlay::forwardCell(src, dst);
-  insertIntoBigIntFixupList(overlay);
+  RelocationOverlay::forwardCell(src, dst);
 
   gcprobes::PromoteToTenured(src, dst);
   return dst;
 }
 
 void js::Nursery::collectToFixedPoint(TenuringTracer& mover) {
   for (RelocationOverlay* p = mover.objHead; p; p = p->next()) {
     auto* obj = static_cast<JSObject*>(p->forwardingAddress());
@@ -3637,20 +3629,16 @@ void js::Nursery::collectToFixedPoint(Te
             tenuredRootBase->twoByteChars(nogc), offset);
       } else {
         tenuredStr->asDependent().relocateNonInlineChars<const JS::Latin1Char*>(
             tenuredRootBase->latin1Chars(nogc), offset);
       }
       tenuredStr->setBase(tenuredRootBase);
     }
   }
-
-  for (RelocationOverlay* p = mover.bigIntHead; p; p = p->next()) {
-    mover.traceBigInt(static_cast<JS::BigInt*>(p->forwardingAddress()));
-  }
 }
 
 size_t js::TenuringTracer::moveStringToTenured(JSString* dst, JSString* src,
                                                AllocKind dstKind) {
   size_t size = Arena::thingSize(dstKind);
 
   // At the moment, strings always have the same AllocKind between src and
   // dst. This may change in the future.
--- a/js/src/gc/Nursery.cpp
+++ b/js/src/gc/Nursery.cpp
@@ -755,19 +755,17 @@ js::TenuringTracer::TenuringTracer(JSRun
     : GenericTracer(rt, JS::TracerKind::Tenuring,
                     JS::WeakMapTraceAction::TraceKeysAndValues),
       nursery_(*nursery),
       tenuredSize(0),
       tenuredCells(0),
       objHead(nullptr),
       objTail(&objHead),
       stringHead(nullptr),
-      stringTail(&stringHead),
-      bigIntHead(nullptr),
-      bigIntTail(&bigIntHead) {}
+      stringTail(&stringHead) {}
 
 inline double js::Nursery::calcPromotionRate(bool* validForTenuring) const {
   double used = double(previousGC.nurseryUsedBytes);
   double capacity = double(previousGC.nurseryCapacity);
   double tenured = double(previousGC.tenuredBytes);
   double rate;
 
   if (previousGC.nurseryUsedBytes > 0) {
--- a/js/src/gc/Nursery.h
+++ b/js/src/gc/Nursery.h
@@ -117,18 +117,16 @@ class TenuringTracer final : public Gene
 
   // These lists are threaded through the Nursery using the space from
   // already moved things. The lists are used to fix up the moved things and
   // to find things held live by intra-Nursery pointers.
   gc::RelocationOverlay* objHead;
   gc::RelocationOverlay** objTail;
   gc::StringRelocationOverlay* stringHead;
   gc::StringRelocationOverlay** stringTail;
-  gc::RelocationOverlay* bigIntHead;
-  gc::RelocationOverlay** bigIntTail;
 
   TenuringTracer(JSRuntime* rt, Nursery* nursery);
 
   JSObject* onObjectEdge(JSObject* obj) override;
   JSString* onStringEdge(JSString* str) override;
   JS::Symbol* onSymbolEdge(JS::Symbol* sym) override;
   JS::BigInt* onBigIntEdge(JS::BigInt* bi) override;
   js::BaseScript* onScriptEdge(BaseScript* script) override;
@@ -151,17 +149,16 @@ class TenuringTracer final : public Gene
   void traceObjectSlots(NativeObject* nobj, uint32_t start, uint32_t end);
   void traceSlots(JS::Value* vp, uint32_t nslots);
   void traceString(JSString* src);
   void traceBigInt(JS::BigInt* src);
 
  private:
   inline void insertIntoObjectFixupList(gc::RelocationOverlay* entry);
   inline void insertIntoStringFixupList(gc::StringRelocationOverlay* entry);
-  inline void insertIntoBigIntFixupList(gc::RelocationOverlay* entry);
 
   template <typename T>
   inline T* allocTenured(JS::Zone* zone, gc::AllocKind kind);
   JSString* allocTenuredString(JSString* src, JS::Zone* zone,
                                gc::AllocKind dstKind);
 
   inline JSObject* movePlainObjectToTenured(PlainObject* src);
   JSObject* moveToTenuredSlow(JSObject* src);