diff --git a/js/public/MemoryMetrics.h b/js/public/MemoryMetrics.h index adf68f31cd54..86da2efed55a 100644 --- a/js/public/MemoryMetrics.h +++ b/js/public/MemoryMetrics.h @@ -537,17 +537,16 @@ struct RuntimeSizes { }; struct UnusedGCThingSizes { -#define FOR_EACH_SIZE(MACRO) \ - MACRO(Other, GCHeapUnused, object) \ - MACRO(Other, GCHeapUnused, script) \ - MACRO(Other, GCHeapUnused, shape) \ - MACRO(Other, GCHeapUnused, baseShape) \ - MACRO(Other, GCHeapUnused, objectGroup) \ - MACRO(Other, GCHeapUnused, string) \ - MACRO(Other, GCHeapUnused, symbol) \ - MACRO(Other, GCHeapUnused, bigInt) \ - MACRO(Other, GCHeapUnused, jitcode) \ - MACRO(Other, GCHeapUnused, scope) \ +#define FOR_EACH_SIZE(MACRO) \ + MACRO(Other, GCHeapUnused, object) \ + MACRO(Other, GCHeapUnused, script) \ + MACRO(Other, GCHeapUnused, shape) \ + MACRO(Other, GCHeapUnused, baseShape) \ + MACRO(Other, GCHeapUnused, string) \ + MACRO(Other, GCHeapUnused, symbol) \ + MACRO(Other, GCHeapUnused, bigInt) \ + MACRO(Other, GCHeapUnused, jitcode) \ + MACRO(Other, GCHeapUnused, scope) \ MACRO(Other, GCHeapUnused, regExpShared) UnusedGCThingSizes() = default; @@ -579,9 +578,6 @@ struct UnusedGCThingSizes { case JS::TraceKind::JitCode: jitcode += n; break; - case JS::TraceKind::ObjectGroup: - objectGroup += n; - break; case JS::TraceKind::Scope: scope += n; break; @@ -623,7 +619,6 @@ struct ZoneStats { MACRO(Other, MallocHeap, bigIntsMallocHeap) \ MACRO(Other, GCHeapAdmin, gcHeapArenaAdmin) \ MACRO(Other, GCHeapUsed, jitCodesGCHeap) \ - MACRO(Other, GCHeapUsed, objectGroupsGCHeap) \ MACRO(Other, GCHeapUsed, scopesGCHeap) \ MACRO(Other, MallocHeap, scopesMallocHeap) \ MACRO(Other, GCHeapUsed, regExpSharedsGCHeap) \ diff --git a/js/public/TraceKind.h b/js/public/TraceKind.h index 3e181df9f443..c11e55582465 100644 --- a/js/public/TraceKind.h +++ b/js/public/TraceKind.h @@ -17,7 +17,6 @@ class JSLinearString; namespace js { class BaseScript; class BaseShape; -class ObjectGroup; class RegExpShared; class Shape; class Scope; @@ -49,15 +48,12 @@ enum class TraceKind { // Shape details are exposed through JS_TraceShapeCycleCollectorChildren. Shape = 0x04, - // ObjectGroup details are exposed through - // JS_TraceObjectGroupCycleCollectorChildren. - ObjectGroup = 0x05, + BaseShape = 0x05, // The kind associated with a nullptr. Null = 0x06, // The following kinds do not have an exposed C++ idiom. - BaseShape, JitCode, Script, Scope, @@ -93,7 +89,6 @@ struct MapTypeToTraceKind { D(JitCode, js::jit::JitCode, true, false) \ D(Scope, js::Scope, true, true) \ D(Object, JSObject, true, true) \ - D(ObjectGroup, js::ObjectGroup, true, false) \ D(Script, js::BaseScript, true, true) \ D(Shape, js::Shape, true, false) \ D(String, JSString, false, false) \ diff --git a/js/public/TracingAPI.h b/js/public/TracingAPI.h index 8c605029cba4..5ec2d512a995 100644 --- a/js/public/TracingAPI.h +++ b/js/public/TracingAPI.h @@ -250,7 +250,6 @@ class GenericTracer : public JSTracer { virtual js::BaseScript* onScriptEdge(js::BaseScript* script) = 0; virtual js::Shape* onShapeEdge(js::Shape* shape) = 0; virtual js::RegExpShared* onRegExpSharedEdge(js::RegExpShared* shared) = 0; - virtual js::ObjectGroup* onObjectGroupEdge(js::ObjectGroup* group) = 0; virtual js::BaseShape* onBaseShapeEdge(js::BaseShape* base) = 0; virtual js::jit::JitCode* onJitCodeEdge(js::jit::JitCode* code) = 0; virtual js::Scope* onScopeEdge(js::Scope* scope) = 0; @@ -300,10 +299,6 @@ class JS_PUBLIC_API CallbackTracer : public js::GenericTracer { onChild(JS::GCCellPtr(shape, JS::TraceKind::Shape)); return shape; } - virtual js::ObjectGroup* onObjectGroupEdge(js::ObjectGroup* group) { - onChild(JS::GCCellPtr(group, JS::TraceKind::ObjectGroup)); - return group; - } virtual js::BaseShape* onBaseShapeEdge(js::BaseShape* base) { onChild(JS::GCCellPtr(base, JS::TraceKind::BaseShape)); return base; diff --git a/js/src/builtin/String.h b/js/src/builtin/String.h index d2b96cb7b0a2..3b96ffd64bfe 100644 --- a/js/src/builtin/String.h +++ b/js/src/builtin/String.h @@ -16,7 +16,6 @@ namespace js { class ArrayObject; class GlobalObject; -class ObjectGroup; /* Initialize the String class, returning its prototype object. */ extern JSObject* InitStringClass(JSContext* cx, Handle global); diff --git a/js/src/gc/AllocKind.h b/js/src/gc/AllocKind.h index 89ae7cc4fee5..73f43b8ebb81 100644 --- a/js/src/gc/AllocKind.h +++ b/js/src/gc/AllocKind.h @@ -64,7 +64,6 @@ 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, true) \ D(EXTERNAL_STRING, String, JSExternalString, JSExternalString, true, false, true) \ D(FAT_INLINE_ATOM, String, js::FatInlineAtom, js::FatInlineAtom, true, false, false) \ D(ATOM, String, js::NormalAtom, js::NormalAtom, true, false, false) \ diff --git a/js/src/gc/Barrier.h b/js/src/gc/Barrier.h index 97e1f297daa8..180207fee551 100644 --- a/js/src/gc/Barrier.h +++ b/js/src/gc/Barrier.h @@ -1109,7 +1109,6 @@ namespace js { class ArrayObject; class DebugEnvironmentProxy; class GlobalObject; -class ObjectGroup; class PropertyName; class Scope; class ScriptSourceObject; @@ -1136,7 +1135,6 @@ using GCPtrObject = GCPtr; using GCPtrScript = GCPtr; using GCPtrString = GCPtr; using GCPtrShape = GCPtr; -using GCPtrObjectGroup = GCPtr; using GCPtrValue = GCPtr; using GCPtrId = GCPtr; @@ -1150,7 +1148,6 @@ using WeakHeapPtrScript = WeakHeapPtr; using WeakHeapPtrScriptSourceObject = WeakHeapPtr; using WeakHeapPtrShape = WeakHeapPtr; using WeakHeapPtrJitCode = WeakHeapPtr; -using WeakHeapPtrObjectGroup = WeakHeapPtr; using WeakHeapPtrSymbol = WeakHeapPtr; using WeakHeapPtrWasmInstanceObject = WeakHeapPtr; using WeakHeapPtrWasmTableObject = WeakHeapPtr; diff --git a/js/src/gc/ClearEdgesTracer.h b/js/src/gc/ClearEdgesTracer.h index efed4961382b..7f51a69a83ed 100644 --- a/js/src/gc/ClearEdgesTracer.h +++ b/js/src/gc/ClearEdgesTracer.h @@ -25,7 +25,6 @@ struct ClearEdgesTracer final : public GenericTracer { JS::BigInt* onBigIntEdge(JS::BigInt* bi) override; js::BaseScript* onScriptEdge(js::BaseScript* script) override; js::Shape* onShapeEdge(js::Shape* shape) override; - js::ObjectGroup* onObjectGroupEdge(js::ObjectGroup* group) override; js::BaseShape* onBaseShapeEdge(js::BaseShape* base) override; js::jit::JitCode* onJitCodeEdge(js::jit::JitCode* code) override; js::Scope* onScopeEdge(js::Scope* scope) override; diff --git a/js/src/gc/GC.cpp b/js/src/gc/GC.cpp index ea3b157d2241..cad5b86fbad5 100644 --- a/js/src/gc/GC.cpp +++ b/js/src/gc/GC.cpp @@ -401,8 +401,7 @@ static constexpr FinalizePhase BackgroundFinalizePhases[] = { AllocKind::EXTERNAL_STRING, AllocKind::FAT_INLINE_ATOM, AllocKind::ATOM, AllocKind::SYMBOL, AllocKind::BIGINT}}, {gcstats::PhaseKind::SWEEP_SHAPE, - {AllocKind::SHAPE, AllocKind::ACCESSOR_SHAPE, AllocKind::BASE_SHAPE, - AllocKind::OBJECT_GROUP}}}; + {AllocKind::SHAPE, AllocKind::ACCESSOR_SHAPE, AllocKind::BASE_SHAPE}}}; void Arena::unmarkAll() { MarkBitmapWord* arenaBits = chunk()->markBits.arenaBits(this); @@ -2312,9 +2311,6 @@ RegExpShared* MovingTracer::onRegExpSharedEdge(RegExpShared* shared) { return onEdge(shared); } BigInt* MovingTracer::onBigIntEdge(BigInt* bi) { return onEdge(bi); } -ObjectGroup* MovingTracer::onObjectGroupEdge(ObjectGroup* group) { - return onEdge(group); -} JS::Symbol* MovingTracer::onSymbolEdge(JS::Symbol* sym) { MOZ_ASSERT(!sym->isForwarded()); return sym; @@ -2598,9 +2594,9 @@ void GCRuntime::updateCellPointers(Zone* zone, AllocKinds kinds) { // arbitrary phases. static constexpr AllocKinds UpdatePhaseOne{ - AllocKind::SCRIPT, AllocKind::BASE_SHAPE, AllocKind::SHAPE, - AllocKind::ACCESSOR_SHAPE, AllocKind::OBJECT_GROUP, AllocKind::STRING, - AllocKind::JITCODE, AllocKind::REGEXP_SHARED, AllocKind::SCOPE}; + AllocKind::SCRIPT, AllocKind::BASE_SHAPE, AllocKind::SHAPE, + AllocKind::ACCESSOR_SHAPE, AllocKind::STRING, AllocKind::JITCODE, + AllocKind::REGEXP_SHARED, AllocKind::SCOPE}; // UpdatePhaseTwo is typed object descriptor objects. @@ -8040,22 +8036,6 @@ void GCRuntime::mergeRealms(Realm* source, Realm* target) { MOZ_ASSERT(global); AssertTargetIsNotGray(global); - for (auto group = source->zone()->cellIterUnsafe(); - !group.done(); group.next()) { - // Replace placeholder object prototypes with the correct prototype in - // the target realm. - TaggedProto proto(group->protoDeprecated()); - if (proto.isObject()) { - JSObject* obj = proto.toObject(); - if (GlobalObject::isOffThreadPrototypePlaceholder(obj)) { - JSObject* targetProto = - global->getPrototypeForOffThreadPlaceholder(obj); - MOZ_ASSERT(targetProto->isDelegate()); - group->setProtoUncheckedDeprecated(TaggedProto(targetProto)); - } - } - } - for (auto baseShape = source->zone()->cellIterUnsafe(); !baseShape.done(); baseShape.next()) { baseShape->setRealmForMergeRealms(target); @@ -8429,7 +8409,6 @@ void GCRuntime::checkHashTablesAfterMovingGC() { for (CompartmentsIter c(this); !c.done(); c.next()) { for (RealmsInCompartmentIter r(c); !r.done(); r.next()) { - r->checkObjectGroupTablesAfterMovingGC(); r->dtoaCache.checkCacheAfterMovingGC(); if (r->debugEnvs()) { r->debugEnvs()->checkHashTablesAfterMovingGC(); @@ -9093,10 +9072,6 @@ js::BaseScript* js::gc::ClearEdgesTracer::onScriptEdge(js::BaseScript* script) { js::Shape* js::gc::ClearEdgesTracer::onShapeEdge(js::Shape* shape) { return onEdge(shape); } -js::ObjectGroup* js::gc::ClearEdgesTracer::onObjectGroupEdge( - js::ObjectGroup* group) { - return onEdge(group); -} js::BaseShape* js::gc::ClearEdgesTracer::onBaseShapeEdge(js::BaseShape* base) { return onEdge(base); } diff --git a/js/src/gc/GCInternals.h b/js/src/gc/GCInternals.h index 007ba7d70a21..c29e4b06b010 100644 --- a/js/src/gc/GCInternals.h +++ b/js/src/gc/GCInternals.h @@ -242,7 +242,6 @@ struct MovingTracer final : public GenericTracer { Scope* onScopeEdge(Scope* scope) override; RegExpShared* onRegExpSharedEdge(RegExpShared* shared) override; BigInt* onBigIntEdge(BigInt* bi) override; - ObjectGroup* onObjectGroupEdge(ObjectGroup* group) override; JS::Symbol* onSymbolEdge(JS::Symbol* sym) override; jit::JitCode* onJitCodeEdge(jit::JitCode* jit) override; @@ -265,7 +264,6 @@ struct SweepingTracer final : public GenericTracer { Scope* onScopeEdge(Scope* scope) override; RegExpShared* onRegExpSharedEdge(RegExpShared* shared) override; BigInt* onBigIntEdge(BigInt* bi) override; - js::ObjectGroup* onObjectGroupEdge(js::ObjectGroup* group) override; JS::Symbol* onSymbolEdge(JS::Symbol* sym) override; private: diff --git a/js/src/gc/GCMarker.h b/js/src/gc/GCMarker.h index 8cfade4c08d0..eaf567d81c49 100644 --- a/js/src/gc/GCMarker.h +++ b/js/src/gc/GCMarker.h @@ -89,7 +89,6 @@ class MarkStack { enum Tag { SlotsOrElementsRangeTag, ObjectTag, - GroupTag, JitCodeTag, ScriptTag, TempRopeTag, @@ -430,7 +429,6 @@ class GCMarker final : public JSTracer { void eagerlyMarkChildren(JSString* str); void eagerlyMarkChildren(Shape* shape); void eagerlyMarkChildren(Scope* scope); - void lazilyMarkChildren(ObjectGroup* group); // We may not have concrete types yet, so this has to be outside the header. template diff --git a/js/src/gc/GCProbes.h b/js/src/gc/GCProbes.h index 19acfe76e31e..f58c6457e31e 100644 --- a/js/src/gc/GCProbes.h +++ b/js/src/gc/GCProbes.h @@ -17,9 +17,6 @@ #include "gc/Heap.h" namespace js { - -class ObjectGroup; - namespace gc { namespace gcprobes { diff --git a/js/src/gc/GCRuntime.h b/js/src/gc/GCRuntime.h index 3973ac996b2f..6d9d81ae0acc 100644 --- a/js/src/gc/GCRuntime.h +++ b/js/src/gc/GCRuntime.h @@ -269,7 +269,6 @@ class BarrierTracer final : public GenericTracer { Scope* onScopeEdge(Scope* scope) override; RegExpShared* onRegExpSharedEdge(RegExpShared* shared) override; BigInt* onBigIntEdge(BigInt* bi) override; - ObjectGroup* onObjectGroupEdge(ObjectGroup* group) override; JS::Symbol* onSymbolEdge(JS::Symbol* sym) override; jit::JitCode* onJitCodeEdge(jit::JitCode* jit) override; diff --git a/js/src/gc/Marking.cpp b/js/src/gc/Marking.cpp index 84b1b70e8479..9e0cf66f2df2 100644 --- a/js/src/gc/Marking.cpp +++ b/js/src/gc/Marking.cpp @@ -1112,10 +1112,6 @@ void GCMarker::traverse(JSObject* thing) { pushThing(thing); } template <> -void GCMarker::traverse(ObjectGroup* thing) { - pushThing(thing); -} -template <> void GCMarker::traverse(jit::JitCode* thing) { pushThing(thing); } @@ -1559,18 +1555,6 @@ inline void js::GCMarker::eagerlyMarkChildren(Scope* scope) { } while (scope && mark(scope)); } -void js::ObjectGroup::traceChildren(JSTracer* trc) { - if (protoDeprecated().isObject()) { - TraceEdge(trc, &protoDeprecated(), "group_proto"); - } -} - -void js::GCMarker::lazilyMarkChildren(ObjectGroup* group) { - if (group->protoDeprecated().isObject()) { - markAndTraverseEdge(group, group->protoDeprecated().toObject()); - } -} - void BaseShape::traceChildren(JSTracer* trc) { // Note: the realm's global can be nullptr if we GC while creating the global. if (JSObject* global = realm()->unsafeUnbarrieredMaybeGlobal()) { @@ -1947,11 +1931,6 @@ inline void GCMarker::processMarkStackTop(SliceBudget& budget) { goto scan_obj; } - case MarkStack::GroupTag: { - auto group = stack.popPtr().as(); - return lazilyMarkChildren(group); - } - case MarkStack::JitCodeTag: { auto code = stack.popPtr().as(); AutoSetTracingSource asts(this, code); @@ -2090,10 +2069,6 @@ struct MapTypeToMarkStackTag { static const auto value = MarkStack::ObjectTag; }; template <> -struct MapTypeToMarkStackTag { - static const auto value = MarkStack::GroupTag; -}; -template <> struct MapTypeToMarkStackTag { static const auto value = MarkStack::JitCodeTag; }; @@ -2861,9 +2836,6 @@ js::Shape* TenuringTracer::onShapeEdge(Shape* shape) { return shape; } js::RegExpShared* TenuringTracer::onRegExpSharedEdge(RegExpShared* shared) { return shared; } -js::ObjectGroup* TenuringTracer::onObjectGroupEdge(ObjectGroup* group) { - return group; -} js::BaseShape* TenuringTracer::onBaseShapeEdge(BaseShape* base) { return base; } js::jit::JitCode* TenuringTracer::onJitCodeEdge(jit::JitCode* code) { return code; @@ -3902,9 +3874,6 @@ Scope* SweepingTracer::onScopeEdge(Scope* scope) { return onEdge(scope); } RegExpShared* SweepingTracer::onRegExpSharedEdge(RegExpShared* shared) { return onEdge(shared); } -ObjectGroup* SweepingTracer::onObjectGroupEdge(ObjectGroup* group) { - return onEdge(group); -} BigInt* SweepingTracer::onBigIntEdge(BigInt* bi) { return onEdge(bi); } JS::Symbol* SweepingTracer::onSymbolEdge(JS::Symbol* sym) { return onEdge(sym); @@ -4214,10 +4183,6 @@ BigInt* BarrierTracer::onBigIntEdge(BigInt* bi) { PreWriteBarrier(bi); return bi; } -ObjectGroup* BarrierTracer::onObjectGroupEdge(ObjectGroup* group) { - PreWriteBarrier(group); - return group; -} JS::Symbol* BarrierTracer::onSymbolEdge(JS::Symbol* sym) { PreWriteBarrier(sym); return sym; diff --git a/js/src/gc/Marking.h b/js/src/gc/Marking.h index f92f9a4862ec..e48c6b4a39b2 100644 --- a/js/src/gc/Marking.h +++ b/js/src/gc/Marking.h @@ -24,7 +24,6 @@ namespace js { class BaseShape; class GCMarker; class NativeObject; -class ObjectGroup; class Shape; class WeakMapBase; diff --git a/js/src/gc/Nursery.h b/js/src/gc/Nursery.h index 3ba0d9925937..ee2c4b75f0ec 100644 --- a/js/src/gc/Nursery.h +++ b/js/src/gc/Nursery.h @@ -133,7 +133,6 @@ class TenuringTracer final : public GenericTracer { js::BaseScript* onScriptEdge(BaseScript* script) override; js::Shape* onShapeEdge(Shape* shape) override; js::RegExpShared* onRegExpSharedEdge(RegExpShared* shared) override; - js::ObjectGroup* onObjectGroupEdge(ObjectGroup* group) override; js::BaseShape* onBaseShapeEdge(BaseShape* base) override; js::jit::JitCode* onJitCodeEdge(jit::JitCode* code) override; js::Scope* onScopeEdge(Scope* scope) override; diff --git a/js/src/gc/RootMarking.cpp b/js/src/gc/RootMarking.cpp index ee1450be460b..1269e6ea0ccf 100644 --- a/js/src/gc/RootMarking.cpp +++ b/js/src/gc/RootMarking.cpp @@ -518,10 +518,6 @@ class BufferGrayRootsTracer final : public GenericTracer { unsupportedEdge(); return nullptr; } - js::ObjectGroup* onObjectGroupEdge(js::ObjectGroup* group) override { - unsupportedEdge(); - return nullptr; - } js::BaseShape* onBaseShapeEdge(js::BaseShape* base) override { unsupportedEdge(); return nullptr; diff --git a/js/src/gc/Rooting.h b/js/src/gc/Rooting.h index 1564f41e3e62..1b6a2e99960d 100644 --- a/js/src/gc/Rooting.h +++ b/js/src/gc/Rooting.h @@ -25,7 +25,6 @@ class PlainObject; class ScriptSourceObject; class SavedFrame; class Shape; -class ObjectGroup; class DebuggerArguments; class DebuggerEnvironment; class DebuggerFrame; @@ -39,7 +38,6 @@ class ModuleObject; using HandleNativeObject = JS::Handle; using HandleShape = JS::Handle; -using HandleObjectGroup = JS::Handle; using HandleAtom = JS::Handle; using HandleLinearString = JS::Handle; using HandlePropertyName = JS::Handle; @@ -74,7 +72,6 @@ using MutableHandleArrayObject = JS::MutableHandle; using RootedNativeObject = JS::Rooted; using RootedShape = JS::Rooted; -using RootedObjectGroup = JS::Rooted; using RootedAtom = JS::Rooted; using RootedLinearString = JS::Rooted; using RootedPropertyName = JS::Rooted; diff --git a/js/src/gc/Tracer.cpp b/js/src/gc/Tracer.cpp index c2b9f9f14141..fb6581bb7411 100644 --- a/js/src/gc/Tracer.cpp +++ b/js/src/gc/Tracer.cpp @@ -116,13 +116,6 @@ void gc::TraceCycleCollectorChildren(JS::CallbackTracer* trc, Shape* shape) { } while (shape); } -void gc::TraceCycleCollectorChildren(JS::CallbackTracer* trc, - ObjectGroup* group) { - MOZ_ASSERT(trc->isCallbackTracer()); - - group->traceChildren(trc); -} - /*** Traced Edge Printer ****************************************************/ static size_t CountDecimalDigits(size_t num) { @@ -194,10 +187,6 @@ void js::gc::GetTraceThingInfo(char* buf, size_t bufsize, void* thing, break; } - case JS::TraceKind::ObjectGroup: - name = "object_group"; - break; - case JS::TraceKind::RegExpShared: name = "reg_exp_shared"; break; diff --git a/js/src/gc/Tracer.h b/js/src/gc/Tracer.h index 570d2943e9d3..0c2ee7d7ce6f 100644 --- a/js/src/gc/Tracer.h +++ b/js/src/gc/Tracer.h @@ -295,7 +295,6 @@ namespace gc { // Trace through a shape or group iteratively during cycle collection to avoid // deep or infinite recursion. void TraceCycleCollectorChildren(JS::CallbackTracer* trc, Shape* shape); -void TraceCycleCollectorChildren(JS::CallbackTracer* trc, ObjectGroup* group); /** * Trace every value within |compartments| that is wrapped by a @@ -329,10 +328,6 @@ inline js::BaseScript* DispatchToOnEdge(GenericTracer* trc, inline js::Shape* DispatchToOnEdge(GenericTracer* trc, js::Shape* shape) { return trc->onShapeEdge(shape); } -inline js::ObjectGroup* DispatchToOnEdge(GenericTracer* trc, - js::ObjectGroup* group) { - return trc->onObjectGroupEdge(group); -} inline js::BaseShape* DispatchToOnEdge(GenericTracer* trc, js::BaseShape* base) { return trc->onBaseShapeEdge(base); diff --git a/js/src/gdb/mozilla/GCCellPtr.py b/js/src/gdb/mozilla/GCCellPtr.py index 738d9b3e452a..150b7219fc89 100644 --- a/js/src/gdb/mozilla/GCCellPtr.py +++ b/js/src/gdb/mozilla/GCCellPtr.py @@ -40,10 +40,9 @@ class GCCellPtrTypeCache(object): "String": "JSString", "Symbol": "JS::Symbol", "Shape": "js::Shape", - "ObjectGroup": "js::ObjectGroup", + "BaseShape": "js::BaseShape", "Null": "std::nullptr_t", # Out-of-line types. - "BaseShape": "js::BaseShape", "JitCode": "js::jit::JitCode", "Script": "js::BaseScript", "Scope": "js::Scope", @@ -52,7 +51,6 @@ class GCCellPtrTypeCache(object): # Map from AllocKind to TraceKind for out-of-line types. alloc_map = { - "BASE_SHAPE": "BaseShape", "JITCODE": "JitCode", "SCRIPT": "Script", "SCOPE": "Scope", diff --git a/js/src/gdb/tests/test-GCCellPtr.py b/js/src/gdb/tests/test-GCCellPtr.py index 56207c886377..355ca69806fe 100644 --- a/js/src/gdb/tests/test-GCCellPtr.py +++ b/js/src/gdb/tests/test-GCCellPtr.py @@ -11,7 +11,6 @@ assert_pretty("string", "JS::GCCellPtr((JSString*) )") assert_pretty("symbol", "JS::GCCellPtr((JS::Symbol*) )") assert_pretty("bigint", "JS::GCCellPtr((JS::BigInt*) )") assert_pretty("shape", "JS::GCCellPtr((js::Shape*) )") -assert_pretty("objectGroup", "JS::GCCellPtr((js::ObjectGroup*) )") assert_pretty("baseShape", "JS::GCCellPtr((js::BaseShape*) )") assert_pretty("script", "JS::GCCellPtr((js::BaseScript*) )") assert_pretty("scope", "JS::GCCellPtr((js::Scope*) )") diff --git a/js/src/jit/CacheIR.cpp b/js/src/jit/CacheIR.cpp index 786dc4fde981..02eaed5199e6 100644 --- a/js/src/jit/CacheIR.cpp +++ b/js/src/jit/CacheIR.cpp @@ -183,9 +183,6 @@ int64_t CacheIRCloner::readStubInt64(uint32_t offset) { Shape* CacheIRCloner::getShapeField(uint32_t stubOffset) { return reinterpret_cast(readStubWord(stubOffset)); } -ObjectGroup* CacheIRCloner::getGroupField(uint32_t stubOffset) { - return reinterpret_cast(readStubWord(stubOffset)); -} JSObject* CacheIRCloner::getObjectField(uint32_t stubOffset) { return reinterpret_cast(readStubWord(stubOffset)); } diff --git a/js/src/jit/CacheIR.h b/js/src/jit/CacheIR.h index 740f0d09bf1a..5a22cbfcfa0b 100644 --- a/js/src/jit/CacheIR.h +++ b/js/src/jit/CacheIR.h @@ -247,7 +247,6 @@ class StubField { RawInt32, RawPointer, Shape, - ObjectGroup, JSObject, Symbol, String, @@ -637,10 +636,6 @@ class MOZ_RAII CacheIRWriter : public JS::CustomAutoRooter { assertSameZone(shape); addStubField(uintptr_t(shape), StubField::Type::Shape); } - void writeGroupField(ObjectGroup* group) { - MOZ_ASSERT(group); - addStubField(uintptr_t(group), StubField::Type::ObjectGroup); - } void writeObjectField(JSObject* obj) { MOZ_ASSERT(obj); assertSameCompartment(obj); @@ -1221,7 +1216,6 @@ class MOZ_RAII CacheIRCloner { int64_t readStubInt64(uint32_t offset); Shape* getShapeField(uint32_t stubOffset); - ObjectGroup* getGroupField(uint32_t stubOffset); JSObject* getObjectField(uint32_t stubOffset); JSString* getStringField(uint32_t stubOffset); JSAtom* getAtomField(uint32_t stubOffset); diff --git a/js/src/jit/CacheIRCompiler.cpp b/js/src/jit/CacheIRCompiler.cpp index 4aa19f95c460..9d36ae6f1251 100644 --- a/js/src/jit/CacheIRCompiler.cpp +++ b/js/src/jit/CacheIRCompiler.cpp @@ -1089,8 +1089,6 @@ GCPtr& CacheIRStubInfo::getStubField(Stub* stub, uint32_t offset) const { template GCPtr& CacheIRStubInfo::getStubField( ICCacheIRStub* stub, uint32_t offset) const; -template GCPtr& CacheIRStubInfo::getStubField( - ICCacheIRStub* stub, uint32_t offset) const; template GCPtr& CacheIRStubInfo::getStubField( ICCacheIRStub* stub, uint32_t offset) const; template GCPtr& CacheIRStubInfo::getStubField( @@ -1130,9 +1128,6 @@ void CacheIRWriter::copyStubData(uint8_t* dest) const { case StubField::Type::JSObject: InitGCPtr(destWords, field.asWord()); break; - case StubField::Type::ObjectGroup: - InitGCPtr(destWords, field.asWord()); - break; case StubField::Type::Symbol: InitGCPtr(destWords, field.asWord()); break; @@ -1181,10 +1176,6 @@ void jit::TraceCacheIRStub(JSTracer* trc, T* stub, TraceSameZoneCrossCompartmentEdge(trc, &shapeField, "cacheir-shape"); break; } - case StubField::Type::ObjectGroup: - TraceEdge(trc, &stubInfo->getStubField(stub, offset), - "cacheir-group"); - break; case StubField::Type::JSObject: TraceEdge(trc, &stubInfo->getStubField(stub, offset), "cacheir-object"); @@ -6783,9 +6774,6 @@ void CacheIRCompiler::emitLoadStubFieldConstant(StubFieldOffset val, case StubField::Type::String: masm.movePtr(ImmGCPtr(stringStubField(val.getOffset())), dest); break; - case StubField::Type::ObjectGroup: - masm.movePtr(ImmGCPtr(groupStubField(val.getOffset())), dest); - break; case StubField::Type::JSObject: masm.movePtr(ImmGCPtr(objectStubField(val.getOffset())), dest); break; @@ -6818,7 +6806,6 @@ void CacheIRCompiler::emitLoadStubField(StubFieldOffset val, Register dest) { switch (val.getStubFieldType()) { case StubField::Type::RawPointer: case StubField::Type::Shape: - case StubField::Type::ObjectGroup: case StubField::Type::JSObject: case StubField::Type::Symbol: case StubField::Type::String: diff --git a/js/src/jit/CacheIRCompiler.h b/js/src/jit/CacheIRCompiler.h index 98d68801c8f9..f6e472d429f6 100644 --- a/js/src/jit/CacheIRCompiler.h +++ b/js/src/jit/CacheIRCompiler.h @@ -874,10 +874,6 @@ class MOZ_RAII CacheIRCompiler { MOZ_ASSERT(stubFieldPolicy_ == StubFieldPolicy::Constant); return (JS::Symbol*)readStubWord(offset, StubField::Type::Symbol); } - ObjectGroup* groupStubField(uint32_t offset) { - MOZ_ASSERT(stubFieldPolicy_ == StubFieldPolicy::Constant); - return (ObjectGroup*)readStubWord(offset, StubField::Type::ObjectGroup); - } JS::Compartment* compartmentStubField(uint32_t offset) { MOZ_ASSERT(stubFieldPolicy_ == StubFieldPolicy::Constant); return (JS::Compartment*)readStubWord(offset, StubField::Type::RawPointer); diff --git a/js/src/jit/GenerateCacheIRFiles.py b/js/src/jit/GenerateCacheIRFiles.py index 781ad6c5e72c..37f79c255215 100644 --- a/js/src/jit/GenerateCacheIRFiles.py +++ b/js/src/jit/GenerateCacheIRFiles.py @@ -76,7 +76,6 @@ arg_writer_info = { "IntPtrId": ("IntPtrOperandId", "writeOperandId"), "RawId": ("OperandId", "writeOperandId"), "ShapeField": ("Shape*", "writeShapeField"), - "GroupField": ("ObjectGroup*", "writeGroupField"), "ObjectField": ("JSObject*", "writeObjectField"), "StringField": ("JSString*", "writeStringField"), "AtomField": ("JSAtom*", "writeStringField"), @@ -171,7 +170,6 @@ arg_reader_info = { "IntPtrId": ("IntPtrOperandId", "Id", "reader.intPtrOperandId()"), "RawId": ("uint32_t", "Id", "reader.rawOperandId()"), "ShapeField": ("uint32_t", "Offset", "reader.stubOffset()"), - "GroupField": ("uint32_t", "Offset", "reader.stubOffset()"), "ObjectField": ("uint32_t", "Offset", "reader.stubOffset()"), "StringField": ("uint32_t", "Offset", "reader.stubOffset()"), "AtomField": ("uint32_t", "Offset", "reader.stubOffset()"), @@ -252,7 +250,6 @@ arg_spewer_method = { "IntPtrId": "spewOperandId", "RawId": "spewRawOperandId", "ShapeField": "spewField", - "GroupField": "spewField", "ObjectField": "spewField", "StringField": "spewField", "AtomField": "spewField", @@ -384,7 +381,6 @@ arg_length = { "IntPtrId": 1, "RawId": 1, "ShapeField": 1, - "GroupField": 1, "ObjectField": 1, "StringField": 1, "AtomField": 1, diff --git a/js/src/jit/IonAnalysis.h b/js/src/jit/IonAnalysis.h index fdb0e6134617..5c84bce12257 100644 --- a/js/src/jit/IonAnalysis.h +++ b/js/src/jit/IonAnalysis.h @@ -21,7 +21,6 @@ namespace js { class GenericPrinter; -class ObjectGroup; class PlainObject; namespace jit { diff --git a/js/src/jit/MIR.h b/js/src/jit/MIR.h index 735db6c2335a..bb3aea5d9808 100644 --- a/js/src/jit/MIR.h +++ b/js/src/jit/MIR.h @@ -963,7 +963,6 @@ using CompilerFunction = CompilerGCPointer; using CompilerBaseScript = CompilerGCPointer; using CompilerPropertyName = CompilerGCPointer; using CompilerShape = CompilerGCPointer; -using CompilerObjectGroup = CompilerGCPointer; // An instruction is an SSA name that is inserted into a basic block's IR // stream. diff --git a/js/src/jit/VMFunctions.cpp b/js/src/jit/VMFunctions.cpp index 10362f581943..f000e0bdd2e5 100644 --- a/js/src/jit/VMFunctions.cpp +++ b/js/src/jit/VMFunctions.cpp @@ -320,11 +320,6 @@ struct TypeToArgProperties { TypeToArgProperties::result | VMFunctionData::ByRef; }; template <> -struct TypeToArgProperties { - static const uint32_t result = - TypeToArgProperties::result | VMFunctionData::ByRef; -}; -template <> struct TypeToArgProperties { static const uint32_t result = TypeToArgProperties::result | VMFunctionData::ByRef; @@ -379,10 +374,6 @@ struct TypeToRootType { static const uint32_t result = VMFunctionData::RootCell; }; template <> -struct TypeToRootType { - static const uint32_t result = VMFunctionData::RootCell; -}; -template <> struct TypeToRootType { static const uint32_t result = VMFunctionData::RootCell; }; diff --git a/js/src/jit/VMFunctions.h b/js/src/jit/VMFunctions.h index 3062d993f951..c3b6d4805a72 100644 --- a/js/src/jit/VMFunctions.h +++ b/js/src/jit/VMFunctions.h @@ -30,7 +30,6 @@ class GlobalObject; class InterpreterFrame; class LexicalScope; class NativeObject; -class ObjectGroup; class PropertyName; class Shape; class TypedArrayObject; diff --git a/js/src/jit/WarpCacheIRTranspiler.cpp b/js/src/jit/WarpCacheIRTranspiler.cpp index 9f82d66c3c89..5dcaa8fb0a69 100644 --- a/js/src/jit/WarpCacheIRTranspiler.cpp +++ b/js/src/jit/WarpCacheIRTranspiler.cpp @@ -141,9 +141,6 @@ class MOZ_RAII WarpCacheIRTranspiler : public WarpBuilderShared { JS::Symbol* symbolStubField(uint32_t offset) { return reinterpret_cast(readStubWord(offset)); } - ObjectGroup* groupStubField(uint32_t offset) { - return reinterpret_cast(readStubWord(offset)); - } BaseScript* baseScriptStubField(uint32_t offset) { return reinterpret_cast(readStubWord(offset)); } diff --git a/js/src/jit/WarpOracle.cpp b/js/src/jit/WarpOracle.cpp index 323de7c6e54b..c6605826be25 100644 --- a/js/src/jit/WarpOracle.cpp +++ b/js/src/jit/WarpOracle.cpp @@ -1067,10 +1067,6 @@ bool WarpScriptOracle::replaceNurseryPointers(ICCacheIRStub* stub, static_assert(std::is_convertible_v, "Code assumes shapes are tenured"); break; - case StubField::Type::ObjectGroup: - static_assert(std::is_convertible_v, - "Code assumes groups are tenured"); - break; case StubField::Type::Symbol: static_assert(std::is_convertible_v, "Code assumes symbols are tenured"); diff --git a/js/src/jit/WarpSnapshot.cpp b/js/src/jit/WarpSnapshot.cpp index fa3d72fd5927..74e222b725bb 100644 --- a/js/src/jit/WarpSnapshot.cpp +++ b/js/src/jit/WarpSnapshot.cpp @@ -337,11 +337,6 @@ void WarpCacheIR::traceData(JSTracer* trc) { TraceWarpStubPtr(trc, word, "warp-cacheir-shape"); break; } - case StubField::Type::ObjectGroup: { - uintptr_t word = stubInfo_->getStubRawWord(stubData_, offset); - TraceWarpStubPtr(trc, word, "warp-cacheir-group"); - break; - } case StubField::Type::JSObject: { uintptr_t word = stubInfo_->getStubRawWord(stubData_, offset); WarpObjectField field = WarpObjectField::fromData(word); diff --git a/js/src/jsfriendapi.cpp b/js/src/jsfriendapi.cpp index 5abcd2415434..4ad903c2ab7a 100644 --- a/js/src/jsfriendapi.cpp +++ b/js/src/jsfriendapi.cpp @@ -184,12 +184,6 @@ JS_FRIEND_API void JS_TraceShapeCycleCollectorChildren(JS::CallbackTracer* trc, TraceCycleCollectorChildren(trc, &shape.as()); } -JS_FRIEND_API void JS_TraceObjectGroupCycleCollectorChildren( - JS::CallbackTracer* trc, JS::GCCellPtr group) { - MOZ_ASSERT(group.is()); - TraceCycleCollectorChildren(trc, &group.as()); -} - static bool DefineHelpProperty(JSContext* cx, HandleObject obj, const char* prop, const char* value) { RootedAtom atom(cx, Atomize(cx, value, strlen(value))); diff --git a/js/src/vm/MemoryMetrics.cpp b/js/src/vm/MemoryMetrics.cpp index d074e8639b1d..e54e1c6d0fec 100644 --- a/js/src/vm/MemoryMetrics.cpp +++ b/js/src/vm/MemoryMetrics.cpp @@ -479,11 +479,6 @@ static void StatsCellCallback(JSRuntime* rt, void* data, JS::GCCellPtr cellptr, break; } - case JS::TraceKind::ObjectGroup: { - zStats->objectGroupsGCHeap += thingSize; - break; - } - case JS::TraceKind::Scope: { Scope* scope = &cellptr.as(); zStats->scopesGCHeap += thingSize; diff --git a/js/src/vm/ObjectGroup.cpp b/js/src/vm/ObjectGroup.cpp index d53f40570de6..f5b2b5af3347 100644 --- a/js/src/vm/ObjectGroup.cpp +++ b/js/src/vm/ObjectGroup.cpp @@ -35,35 +35,6 @@ using namespace js; -///////////////////////////////////////////////////////////////////// -// ObjectGroup -///////////////////////////////////////////////////////////////////// - -static ObjectGroup* MakeGroup(JSContext* cx, Handle proto) { - MOZ_ASSERT_IF(proto.isObject(), - cx->isInsideCurrentCompartment(proto.toObject())); - - ObjectGroup* group = Allocate(cx); - if (!group) { - return nullptr; - } - new (group) ObjectGroup(proto); - - return group; -} - -ObjectGroup::ObjectGroup(TaggedProto proto) - : TenuredCellWithNonGCPointer(nullptr), proto_(proto) { - /* Windows may not appear on prototype chains. */ - MOZ_ASSERT_IF(proto.isObject(), !IsWindow(proto.toObject())); -} - -void ObjectGroup::setProtoUncheckedDeprecated(TaggedProto proto) { - proto_ = proto; - MOZ_ASSERT_IF(proto_.isObject() && proto_.toObject()->is(), - proto_.toObject()->isDelegate()); -} - ///////////////////////////////////////////////////////////////////// // GlobalObject ///////////////////////////////////////////////////////////////////// @@ -93,139 +64,6 @@ bool GlobalObject::splicePrototype(JSContext* cx, Handle global, return JSObject::setProtoUnchecked(cx, global, proto); } -///////////////////////////////////////////////////////////////////// -// ObjectGroupRealm NewTable -///////////////////////////////////////////////////////////////////// - -/* - * Entries for the per-realm set of groups based on prototype and class. An - * optional associated object is used which allows multiple groups to be - * created with the same prototype. The associated object is a type descriptor - * (for typed objects). - */ -struct ObjectGroupRealm::NewEntry { - WeakHeapPtrObjectGroup group; - - explicit NewEntry(ObjectGroup* group) : group(group) {} - - struct Lookup { - TaggedProto proto; - - explicit Lookup(TaggedProto proto) : proto(proto) {} - - explicit Lookup(const NewEntry& entry) - : proto(entry.group.unbarrieredGet()->protoDeprecated()) {} - }; - - bool needsSweep() { return IsAboutToBeFinalized(&group); } - - bool operator==(const NewEntry& other) const { return group == other.group; } -}; - -namespace js { -template <> -struct MovableCellHasher { - using Key = ObjectGroupRealm::NewEntry; - using Lookup = ObjectGroupRealm::NewEntry::Lookup; - - static bool hasHash(const Lookup& l) { - return MovableCellHasher::hasHash(l.proto); - } - - static bool ensureHash(const Lookup& l) { - return MovableCellHasher::ensureHash(l.proto); - } - - static inline HashNumber hash(const Lookup& lookup) { - return MovableCellHasher::hash(lookup.proto); - } - - static inline bool match(const ObjectGroupRealm::NewEntry& key, - const Lookup& lookup) { - TaggedProto proto = key.group.unbarrieredGet()->protoDeprecated(); - return MovableCellHasher::match(proto, lookup.proto); - } -}; -} // namespace js - -class ObjectGroupRealm::NewTable - : public JS::WeakCache, - SystemAllocPolicy>> { - using Table = - js::GCHashSet, SystemAllocPolicy>; - using Base = JS::WeakCache; - - public: - explicit NewTable(Zone* zone) : Base(zone) {} -}; - -/* static*/ ObjectGroupRealm& ObjectGroupRealm::getForNewObject(JSContext* cx) { - return cx->realm()->objectGroups_; -} - -MOZ_ALWAYS_INLINE ObjectGroup* ObjectGroupRealm::DefaultNewGroupCache::lookup( - const JSClass* clasp, TaggedProto proto) { - if (group_ && group_->protoDeprecated() == proto) { - return group_; - } - return nullptr; -} - -/* static */ -ObjectGroup* ObjectGroup::defaultNewGroup(JSContext* cx, const JSClass* clasp, - TaggedProto proto) { - MOZ_ASSERT(clasp); - MOZ_ASSERT_IF(proto.isObject(), - cx->isInsideCurrentCompartment(proto.toObject())); - - ObjectGroupRealm& groups = ObjectGroupRealm::getForNewObject(cx); - - if (ObjectGroup* group = groups.defaultNewGroupCache.lookup(clasp, proto)) { - return group; - } - - gc::AutoSuppressGC suppressGC(cx); - - ObjectGroupRealm::NewTable*& table = groups.defaultNewTable; - - if (!table) { - table = cx->new_(cx->zone()); - if (!table) { - return nullptr; - } - } - - if (proto.isObject() && !proto.toObject()->isDelegate()) { - RootedObject protoObj(cx, proto.toObject()); - if (!JSObject::setDelegate(cx, protoObj)) { - return nullptr; - } - } - - ObjectGroupRealm::NewTable::AddPtr p = - table->lookupForAdd(ObjectGroupRealm::NewEntry::Lookup(proto)); - if (p) { - ObjectGroup* group = p->group; - MOZ_ASSERT(group->protoDeprecated() == proto); - groups.defaultNewGroupCache.put(group); - return group; - } - - Rooted protoRoot(cx, proto); - ObjectGroup* group = MakeGroup(cx, protoRoot); - if (!group) { - return nullptr; - } - - if (!table->add(p, ObjectGroupRealm::NewEntry(group))) { - ReportOutOfMemory(cx); - return nullptr; - } - - groups.defaultNewGroupCache.put(group); - return group; -} - static bool AddPlainObjectProperties(JSContext* cx, HandlePlainObject obj, IdValuePair* properties, size_t nproperties) { @@ -255,80 +93,3 @@ PlainObject* js::NewPlainObjectWithProperties(JSContext* cx, } return obj; } - -///////////////////////////////////////////////////////////////////// -// ObjectGroupRealm -///////////////////////////////////////////////////////////////////// - -ObjectGroupRealm::~ObjectGroupRealm() { js_delete(defaultNewTable); } - -void ObjectGroupRealm::addSizeOfExcludingThis( - mozilla::MallocSizeOf mallocSizeOf, size_t* realmTables) { - if (defaultNewTable) { - *realmTables += defaultNewTable->sizeOfIncludingThis(mallocSizeOf); - } -} - -void ObjectGroupRealm::clearTables() { - if (defaultNewTable) { - defaultNewTable->clear(); - } - defaultNewGroupCache.purge(); -} - -void ObjectGroupRealm::fixupNewTableAfterMovingGC(NewTable* table) { - /* - * Each entry's hash depends on the object's prototype and we can't tell - * whether that has been moved or not in sweepNewObjectGroupTable(). - */ - if (table) { - for (NewTable::Enum e(*table); !e.empty(); e.popFront()) { - NewEntry& entry = e.mutableFront(); - - ObjectGroup* group = entry.group.unbarrieredGet(); - if (IsForwarded(group)) { - group = Forwarded(group); - entry.group.set(group); - } - TaggedProto proto = group->protoDeprecated(); - if (proto.isObject() && IsForwarded(proto.toObject())) { - proto = TaggedProto(Forwarded(proto.toObject())); - // Update the group's proto here so that we are able to lookup - // entries in this table before all object pointers are updated. - group->protoDeprecated() = proto; - } - } - } -} - -#ifdef JSGC_HASH_TABLE_CHECKS - -void ObjectGroupRealm::checkNewTableAfterMovingGC(NewTable* table) { - /* - * Assert that nothing points into the nursery or needs to be relocated, and - * that the hash table entries are discoverable. - */ - if (!table) { - return; - } - - for (auto r = table->all(); !r.empty(); r.popFront()) { - NewEntry entry = r.front(); - CheckGCThingAfterMovingGC(entry.group.unbarrieredGet()); - TaggedProto proto = entry.group.unbarrieredGet()->protoDeprecated(); - if (proto.isObject()) { - CheckGCThingAfterMovingGC(proto.toObject()); - } - - auto ptr = table->lookup(NewEntry::Lookup(entry)); - MOZ_RELEASE_ASSERT(ptr.found() && &*ptr == &r.front()); - } -} - -#endif // JSGC_HASH_TABLE_CHECKS - -JS::ubi::Node::Size JS::ubi::Concrete::size( - mozilla::MallocSizeOf mallocSizeOf) const { - Size size = js::gc::Arena::thingSize(get().asTenured().getAllocKind()); - return size; -} diff --git a/js/src/vm/ObjectGroup.h b/js/src/vm/ObjectGroup.h index d129c0aebbf7..858ed9af318c 100644 --- a/js/src/vm/ObjectGroup.h +++ b/js/src/vm/ObjectGroup.h @@ -21,7 +21,6 @@ namespace js { -class ObjectGroupRealm; class PlainObject; /* @@ -40,113 +39,6 @@ enum NewObjectKind { TenuredObject }; -// Note: for now just store an int* in the CellHeader. We can't store the Realm* -// because it's an incomplete type and we can't include vm/Realm.h here. This -// class will be removed shortly anyway. -class ObjectGroup : public gc::TenuredCellWithNonGCPointer { - /* Prototype shared by objects in this group. */ - GCPtr proto_; // set by constructor - -#ifndef JS_64BIT - // Temporary padding to respect MinCellSize. - uint64_t padding_ = 0; -#endif - - // END OF PROPERTIES - - private: - friend class gc::GCRuntime; - - // See JSObject::offsetOfGroup() comment. - friend class js::jit::MacroAssembler; - - public: - inline explicit ObjectGroup(TaggedProto proto); - - const GCPtr& protoDeprecated() const { return proto_; } - - GCPtr& protoDeprecated() { return proto_; } - - void setProtoUncheckedDeprecated(TaggedProto proto); - - /* Helpers */ - - void traceChildren(JSTracer* trc); - - void finalize(JSFreeOp* fop) { - // Nothing to do. - } - - static const JS::TraceKind TraceKind = JS::TraceKind::ObjectGroup; - - static ObjectGroup* defaultNewGroup(JSContext* cx, const JSClass* clasp, - TaggedProto proto); -}; - -// Structure used to manage the groups in a realm. -class ObjectGroupRealm { - private: - class NewTable; - - private: - // Set of default 'new' groups in the realm. - NewTable* defaultNewTable = nullptr; - - // This cache is purged on GC. - class DefaultNewGroupCache { - ObjectGroup* group_; - - public: - DefaultNewGroupCache() { purge(); } - - void purge() { group_ = nullptr; } - void put(ObjectGroup* group) { group_ = group; } - - MOZ_ALWAYS_INLINE ObjectGroup* lookup(const JSClass* clasp, - TaggedProto proto); - } defaultNewGroupCache = {}; - - // END OF PROPERTIES - - private: - friend class ObjectGroup; - - public: - struct NewEntry; - - ObjectGroupRealm() = default; - ~ObjectGroupRealm(); - - ObjectGroupRealm(ObjectGroupRealm&) = delete; - void operator=(ObjectGroupRealm&) = delete; - - static ObjectGroupRealm& getForNewObject(JSContext* cx); - - void addSizeOfExcludingThis(mozilla::MallocSizeOf mallocSizeOf, - size_t* realmTables); - - void clearTables(); - - void purge() { defaultNewGroupCache.purge(); } - -#ifdef JSGC_HASH_TABLE_CHECKS - void checkTablesAfterMovingGC() { - checkNewTableAfterMovingGC(defaultNewTable); - } -#endif - - void fixupTablesAfterMovingGC() { - fixupNewTableAfterMovingGC(defaultNewTable); - } - - private: -#ifdef JSGC_HASH_TABLE_CHECKS - void checkNewTableAfterMovingGC(NewTable* table); -#endif - - void fixupNewTableAfterMovingGC(NewTable* table); -}; - PlainObject* NewPlainObjectWithProperties(JSContext* cx, IdValuePair* properties, size_t nproperties, @@ -154,29 +46,4 @@ PlainObject* NewPlainObjectWithProperties(JSContext* cx, } // namespace js -// JS::ubi::Nodes can point to object groups; they're js::gc::Cell instances -// with no associated compartment. -namespace JS { -namespace ubi { - -template <> -class Concrete : TracerConcrete { - protected: - explicit Concrete(js::ObjectGroup* ptr) - : TracerConcrete(ptr) {} - - public: - static void construct(void* storage, js::ObjectGroup* ptr) { - new (storage) Concrete(ptr); - } - - Size size(mozilla::MallocSizeOf mallocSizeOf) const override; - - const char16_t* typeName() const override { return concreteTypeName; } - static const char16_t concreteTypeName[]; -}; - -} // namespace ubi -} // namespace JS - #endif /* vm_ObjectGroup_h */ diff --git a/js/src/vm/Realm.cpp b/js/src/vm/Realm.cpp index 3634d19cfc61..5d11f6799341 100644 --- a/js/src/vm/Realm.cpp +++ b/js/src/vm/Realm.cpp @@ -450,7 +450,6 @@ void Realm::traceWeakTemplateObjects(JSTracer* trc) { void Realm::fixupAfterMovingGC(JSTracer* trc) { purge(); fixupGlobal(); - objectGroups_.fixupTablesAfterMovingGC(); } void Realm::fixupGlobal() { @@ -463,7 +462,6 @@ void Realm::fixupGlobal() { void Realm::purge() { dtoaCache.purge(); newProxyCache.purge(); - objectGroups_.purge(); objects_.iteratorCache.clearAndCompact(); arraySpeciesLookup.purge(); promiseLookup.purge(); @@ -480,7 +478,6 @@ void Realm::clearTables() { MOZ_ASSERT(!debugEnvs_); MOZ_ASSERT(objects_.enumerators->next() == objects_.enumerators); - objectGroups_.clearTables(); savedStacks_.clear(); varNames_.clear(); } @@ -649,7 +646,6 @@ void Realm::addSizeOfIncludingThis(mozilla::MallocSizeOf mallocSizeOf, size_t* nonSyntacticLexicalEnvironmentsArg, size_t* jitRealm) { *realmObject += mallocSizeOf(this); - objectGroups_.addSizeOfExcludingThis(mallocSizeOf, realmTables); wasm.addSizeOfExcludingThis(mallocSizeOf, realmTables); objects_.addSizeOfExcludingThis(mallocSizeOf, innerViewsArg, diff --git a/js/src/vm/Realm.h b/js/src/vm/Realm.h index 8631ccc737d0..1f8852befc72 100644 --- a/js/src/vm/Realm.h +++ b/js/src/vm/Realm.h @@ -314,12 +314,6 @@ class JS::Realm : public JS::shadow::Realm { js::ObjectRealm objects_; friend js::ObjectRealm& js::ObjectRealm::get(const JSObject*); - // Object group tables and other state in the realm. This is private to - // enforce use of ObjectGroupRealm::getForNewObject(cx). - js::ObjectGroupRealm objectGroups_; - friend js::ObjectGroupRealm& js::ObjectGroupRealm::getForNewObject( - JSContext* cx); - // The global environment record's [[VarNames]] list that contains all // names declared using FunctionDeclaration, GeneratorDeclaration, and // VariableDeclaration declarations in global code in this realm. @@ -571,12 +565,6 @@ class JS::Realm : public JS::shadow::Realm { void fixupAfterMovingGC(JSTracer* trc); -#ifdef JSGC_HASH_TABLE_CHECKS - void checkObjectGroupTablesAfterMovingGC() { - objectGroups_.checkTablesAfterMovingGC(); - } -#endif - // Add a name to [[VarNames]]. Reports OOM on failure. [[nodiscard]] bool addToVarNames(JSContext* cx, JS::Handle name); void tracekWeakVarNames(JSTracer* trc); diff --git a/js/src/vm/UbiNode.cpp b/js/src/vm/UbiNode.cpp index 4da83925caae..5a5be01e5831 100644 --- a/js/src/vm/UbiNode.cpp +++ b/js/src/vm/UbiNode.cpp @@ -256,7 +256,6 @@ JS::Zone* TracerConcrete::zone() const { template JS::Zone* TracerConcrete::zone() const; template JS::Zone* TracerConcrete::zone() const; template JS::Zone* TracerConcrete::zone() const; -template JS::Zone* TracerConcrete::zone() const; template JS::Zone* TracerConcrete::zone() const; template JS::Zone* TracerConcrete::zone() const; template JS::Zone* TracerConcrete::zone() const; @@ -289,8 +288,6 @@ template UniquePtr TracerConcrete::edges( JSContext* cx, bool wantNames) const; template UniquePtr TracerConcrete::edges( JSContext* cx, bool wantNames) const; -template UniquePtr TracerConcrete::edges( - JSContext* cx, bool wantNames) const; template UniquePtr TracerConcrete::edges( JSContext* cx, bool wantNames) const; template UniquePtr TracerConcrete::edges( @@ -346,8 +343,6 @@ const char16_t Concrete::concreteTypeName[] = u"js::jit::JitCode"; const char16_t Concrete::concreteTypeName[] = u"js::Shape"; const char16_t Concrete::concreteTypeName[] = u"js::BaseShape"; -const char16_t Concrete::concreteTypeName[] = - u"js::ObjectGroup"; const char16_t Concrete::concreteTypeName[] = u"js::Scope"; const char16_t Concrete::concreteTypeName[] = u"js::RegExpShared"; diff --git a/js/xpconnect/src/XPCJSRuntime.cpp b/js/xpconnect/src/XPCJSRuntime.cpp index e8805daf1f3e..5de19ef66f3f 100644 --- a/js/xpconnect/src/XPCJSRuntime.cpp +++ b/js/xpconnect/src/XPCJSRuntime.cpp @@ -1405,10 +1405,6 @@ static void ReportZoneStats(const JS::ZoneStats& zStats, ZRREPORT_GC_BYTES(pathPrefix + "jit-codes-gc-heap"_ns, zStats.jitCodesGCHeap, "References to executable code pools used by the JITs."); - ZRREPORT_GC_BYTES( - pathPrefix + "object-groups/gc-heap"_ns, zStats.objectGroupsGCHeap, - "Classification and type inference information about objects."); - ZRREPORT_GC_BYTES(pathPrefix + "scopes/gc-heap"_ns, zStats.scopesGCHeap, "Scope information for scripts."); @@ -2352,12 +2348,6 @@ void JSReporter::CollectReports(WindowPaths* windowPaths, KIND_OTHER, rtStats.zTotals.unusedGCThings.baseShape, "Unused base shape cells within non-empty arenas."); - REPORT_BYTES( - nsLiteralCString( - "js-main-runtime-gc-heap-committed/unused/gc-things/object-groups"), - KIND_OTHER, rtStats.zTotals.unusedGCThings.objectGroup, - "Unused object group cells within non-empty arenas."); - REPORT_BYTES(nsLiteralCString( "js-main-runtime-gc-heap-committed/unused/gc-things/scopes"), KIND_OTHER, rtStats.zTotals.unusedGCThings.scope, @@ -2419,12 +2409,6 @@ void JSReporter::CollectReports(WindowPaths* windowPaths, KIND_OTHER, rtStats.zTotals.shapeInfo.shapesGCHeapBase, "Used base shape cells."); - MREPORT_BYTES( - nsLiteralCString( - "js-main-runtime-gc-heap-committed/used/gc-things/object-groups"), - KIND_OTHER, rtStats.zTotals.objectGroupsGCHeap, - "Used object group cells."); - MREPORT_BYTES(nsLiteralCString( "js-main-runtime-gc-heap-committed/used/gc-things/scopes"), KIND_OTHER, rtStats.zTotals.scopesGCHeap, "Used scope cells."); diff --git a/xpcom/base/CycleCollectedJSRuntime.cpp b/xpcom/base/CycleCollectedJSRuntime.cpp index f291e1b0cf75..a537de490a8b 100644 --- a/xpcom/base/CycleCollectedJSRuntime.cpp +++ b/xpcom/base/CycleCollectedJSRuntime.cpp @@ -428,11 +428,6 @@ void TraversalTracer::onChild(const JS::GCCellPtr& aThing) { // The maximum depth of traversal when tracing a Shape is unbounded, due to // the parent pointers on the shape. JS_TraceShapeCycleCollectorChildren(this, aThing); - } else if (aThing.is()) { - // The maximum depth of traversal when tracing an ObjectGroup is unbounded, - // due to information attached to the groups which can lead other groups to - // be traced. - JS_TraceObjectGroupCycleCollectorChildren(this, aThing); } else { JS::TraceChildren(this, aThing); }