Bug 1454862 - Enable compaction for BigInt values r=tcampbell,jonco
authorAndy Wingo <wingo@igalia.com>
Mon, 25 Feb 2019 15:28:42 +0000
changeset 518783 7f6e5294fb0fc1314d2f56de6c6423937cfd0a93
parent 518782 d18e4e5cf3fa9c4b845b9fe073f28a157386a458
child 518784 45bc26c5c749250f733fdc4f77fca660894ba57e
push id10862
push userffxbld-merge
push dateMon, 11 Mar 2019 13:01:11 +0000
treeherdermozilla-beta@a2e7f5c935da [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstcampbell, jonco
bugs1454862
milestone67.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 1454862 - Enable compaction for BigInt values r=tcampbell,jonco Differential Revision: https://phabricator.services.mozilla.com/D20986
js/src/gc/AllocKind.h
js/src/gc/GC.cpp
js/src/gc/GCInternals.h
js/src/gc/Marking-inl.h
--- a/js/src/gc/AllocKind.h
+++ b/js/src/gc/AllocKind.h
@@ -61,17 +61,17 @@ namespace gc {
     D(SHAPE,               Shape,        js::Shape,         js::Shape,         true,   false,  true) \
     D(ACCESSOR_SHAPE,      Shape,        js::AccessorShape, js::AccessorShape, true,   false,  true) \
     D(BASE_SHAPE,          BaseShape,    js::BaseShape,     js::BaseShape,     true,   false,  true) \
     D(OBJECT_GROUP,        ObjectGroup,  js::ObjectGroup,   js::ObjectGroup,   true,   false,  false) \
     D(EXTERNAL_STRING,     String,       JSExternalString,  JSExternalString,  true,   false,  true) \
     D(FAT_INLINE_ATOM,     String,       js::FatInlineAtom, js::FatInlineAtom, true,   false,  true) \
     D(ATOM,                String,       js::NormalAtom,    js::NormalAtom,    true,   false,  true) \
     D(SYMBOL,              Symbol,       JS::Symbol,        JS::Symbol,        true,   false,  false) \
-    D(BIGINT,              BigInt,       JS::BigInt,        JS::BigInt,        true,   false,  false) \
+    D(BIGINT,              BigInt,       JS::BigInt,        JS::BigInt,        true,   false,  true) \
     D(JITCODE,             JitCode,      js::jit::JitCode,  js::jit::JitCode,  false,  false,  false) \
     D(SCOPE,               Scope,        js::Scope,         js::Scope,         true,   false,  true) \
     D(REGEXP_SHARED,       RegExpShared, js::RegExpShared,  js::RegExpShared,  true,   false,  true)
 
 #define FOR_EACH_NURSERY_STRING_ALLOCKIND(D) \
     D(FAT_INLINE_STRING,   String,        JSFatInlineString, JSFatInlineString, true,   true,  true) \
     D(STRING,              String,        JSString,          JSString,          true,   true,  true)
 // clang-format on
--- a/js/src/gc/GC.cpp
+++ b/js/src/gc/GC.cpp
@@ -2448,16 +2448,17 @@ void MovingTracer::onShapeEdge(Shape** s
 void MovingTracer::onStringEdge(JSString** stringp) { updateEdge(stringp); }
 void MovingTracer::onScriptEdge(JSScript** scriptp) { updateEdge(scriptp); }
 void MovingTracer::onLazyScriptEdge(LazyScript** lazyp) { updateEdge(lazyp); }
 void MovingTracer::onBaseShapeEdge(BaseShape** basep) { updateEdge(basep); }
 void MovingTracer::onScopeEdge(Scope** scopep) { updateEdge(scopep); }
 void MovingTracer::onRegExpSharedEdge(RegExpShared** sharedp) {
   updateEdge(sharedp);
 }
+void MovingTracer::onBigIntEdge(BigInt** bip) { updateEdge(bip); }
 
 void Zone::prepareForCompacting() {
   FreeOp* fop = runtimeFromMainThread()->defaultFreeOp();
   discardJitCode(fop);
 }
 
 void GCRuntime::sweepTypesAfterCompacting(Zone* zone) {
   zone->beginSweepTypes();
--- a/js/src/gc/GCInternals.h
+++ b/js/src/gc/GCInternals.h
@@ -156,16 +156,17 @@ struct MovingTracer : JS::CallbackTracer
   void onObjectEdge(JSObject** objp) override;
   void onShapeEdge(Shape** shapep) override;
   void onStringEdge(JSString** stringp) override;
   void onScriptEdge(JSScript** scriptp) override;
   void onLazyScriptEdge(LazyScript** lazyp) override;
   void onBaseShapeEdge(BaseShape** basep) override;
   void onScopeEdge(Scope** basep) override;
   void onRegExpSharedEdge(RegExpShared** sharedp) override;
+  void onBigIntEdge(BigInt** bip) override;
   void onChild(const JS::GCCellPtr& thing) override {
     MOZ_ASSERT(!thing.asCell()->isForwarded());
   }
 
 #ifdef DEBUG
   TracerKind getTracerKind() const override { return TracerKind::Moving; }
 #endif
 
--- a/js/src/gc/Marking-inl.h
+++ b/js/src/gc/Marking-inl.h
@@ -57,16 +57,17 @@ struct MightBeForwarded {
   static_assert(!mozilla::IsSame<Cell, T>::value &&
                     !mozilla::IsSame<TenuredCell, T>::value,
                 "T must not be Cell or TenuredCell");
 
   static const bool value = mozilla::IsBaseOf<JSObject, T>::value ||
                             mozilla::IsBaseOf<Shape, T>::value ||
                             mozilla::IsBaseOf<BaseShape, T>::value ||
                             mozilla::IsBaseOf<JSString, T>::value ||
+                            mozilla::IsBaseOf<JS::BigInt, T>::value ||
                             mozilla::IsBaseOf<JSScript, T>::value ||
                             mozilla::IsBaseOf<js::LazyScript, T>::value ||
                             mozilla::IsBaseOf<js::Scope, T>::value ||
                             mozilla::IsBaseOf<js::RegExpShared, T>::value;
 };
 
 template <typename T>
 inline bool IsForwarded(const T* t) {