diff --git a/js/public/GCAPI.h b/js/public/GCAPI.h index 50700b715ff9..58178a0f60ba 100644 --- a/js/public/GCAPI.h +++ b/js/public/GCAPI.h @@ -524,20 +524,6 @@ class JS_PUBLIC_API(AutoAssertNoAlloc) -class JS_PUBLIC_API(AutoAssertOnBarrier) -{ - JSContext* context; - bool prev; - - public: - explicit AutoAssertOnBarrier(JSContext* cx); - ~AutoAssertOnBarrier(); -}; - - - - - @@ -623,7 +609,6 @@ ExposeGCThingToActiveJS(JS::GCCellPtr thing) if (IsInsideNursery(thing.asCell())) return; JS::shadow::Runtime* rt = detail::GetGCThingRuntime(thing.unsafeAsUIntPtr()); - MOZ_DIAGNOSTIC_ASSERT(rt->allowGCBarriers()); if (IsIncrementalBarrierNeededOnTenuredGCThing(rt, thing)) JS::IncrementalReferenceBarrier(thing); else if (JS::GCThingIsMarkedGray(thing)) @@ -634,7 +619,6 @@ static MOZ_ALWAYS_INLINE void MarkGCThingAsLive(JSRuntime* aRt, JS::GCCellPtr thing) { JS::shadow::Runtime* rt = JS::shadow::Runtime::asShadowRuntime(aRt); - MOZ_DIAGNOSTIC_ASSERT(rt->allowGCBarriers()); diff --git a/js/src/jsgc.cpp b/js/src/jsgc.cpp index bc322f15eab9..650fe1d8c92c 100644 --- a/js/src/jsgc.cpp +++ b/js/src/jsgc.cpp @@ -7013,20 +7013,6 @@ JS::AutoAssertOnGC::~AutoAssertOnGC() } } -JS::AutoAssertOnBarrier::AutoAssertOnBarrier(JSContext* cx) - : context(cx), - prev(cx->runtime()->allowGCBarriers()) -{ - context->runtime()->allowGCBarriers_ = false; -} - -JS::AutoAssertOnBarrier::~AutoAssertOnBarrier() -{ - MOZ_ASSERT(!context->runtime()->allowGCBarriers_); - context->runtime()->allowGCBarriers_ = prev; -} - -#ifdef DEBUG JS::AutoAssertNoAlloc::AutoAssertNoAlloc(JSContext* cx) : gc(nullptr) { diff --git a/js/src/jspubtd.h b/js/src/jspubtd.h index 812c4a1b36c0..8a1b2507d9d5 100644 --- a/js/src/jspubtd.h +++ b/js/src/jspubtd.h @@ -131,7 +131,6 @@ class StoreBuffer; namespace JS { class JS_PUBLIC_API(AutoEnterCycleCollection); -class JS_PUBLIC_API(AutoAssertOnBarrier); struct PropertyDescriptor; typedef void (*OffThreadCompileCallback)(void* token, void* callbackData); @@ -154,17 +153,11 @@ struct Runtime friend class JS::AutoEnterCycleCollection; JS::HeapState heapState_; - - - bool allowGCBarriers_; - friend class JS::AutoAssertOnBarrier; - js::gc::StoreBuffer* gcStoreBufferPtr_; public: Runtime() : heapState_(JS::HeapState::Idle) - , allowGCBarriers_(true) , gcStoreBufferPtr_(nullptr) {} @@ -176,8 +169,6 @@ struct Runtime return heapState_ == JS::HeapState::CycleCollecting; } - bool allowGCBarriers() const { return allowGCBarriers_; } - js::gc::StoreBuffer* gcStoreBufferPtr() { return gcStoreBufferPtr_; } static JS::shadow::Runtime* asShadowRuntime(JSRuntime* rt) {