diff --git a/js/src/gc/Allocator.cpp b/js/src/gc/Allocator.cpp index f6ca867b3aa8..b99f38ff3755 100644 --- a/js/src/gc/Allocator.cpp +++ b/js/src/gc/Allocator.cpp @@ -82,10 +82,12 @@ template JSObject* GCRuntime::tryNewNurseryObject(JSContext* cx, size_t thingSize, size_t nDynamicSlots, const Class* clasp) { + MOZ_RELEASE_ASSERT(!cx->helperThread()); + MOZ_ASSERT(cx->isNurseryAllocAllowed()); - MOZ_ASSERT(!cx->helperThread()); MOZ_ASSERT(!cx->isNurseryAllocSuppressed()); MOZ_ASSERT(!IsAtomsCompartment(cx->compartment())); + JSObject* obj = cx->nursery().allocateObject(cx, thingSize, nDynamicSlots, clasp); if (obj) return obj;