diff options
Diffstat (limited to 'js/src/gc/GCAPI.cpp')
-rw-r--r-- | js/src/gc/GCAPI.cpp | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/js/src/gc/GCAPI.cpp b/js/src/gc/GCAPI.cpp index 293bfce80d..d2eab44dea 100644 --- a/js/src/gc/GCAPI.cpp +++ b/js/src/gc/GCAPI.cpp @@ -487,8 +487,7 @@ JS_PUBLIC_API bool JS::WasIncrementalGC(JSRuntime* rt) { bool js::gc::CreateUniqueIdForNativeObject(NativeObject* nobj, uint64_t* uidp) { JSRuntime* runtime = nobj->runtimeFromMainThread(); *uidp = NextCellUniqueId(runtime); - JSContext* cx = runtime->mainContextFromOwnThread(); - return nobj->setUniqueId(cx, *uidp); + return nobj->setUniqueId(runtime, *uidp); } bool js::gc::CreateUniqueIdForNonNativeObject(Cell* cell, @@ -793,6 +792,15 @@ const char* CellColorName(CellColor color) { } /* namespace gc */ } /* namespace js */ +JS_PUBLIC_API bool js::gc::IsDeadNurseryObject(JSObject* obj) { + MOZ_ASSERT(JS::RuntimeHeapIsMinorCollecting()); + MOZ_ASSERT(obj); + MOZ_ASSERT(IsInsideNursery(obj)); + MOZ_ASSERT(!IsForwarded(obj)); + + return obj->runtimeFromMainThread()->gc.nursery().inCollectedRegion(obj); +} + JS_PUBLIC_API void js::gc::FinalizeDeadNurseryObject(JSContext* cx, JSObject* obj) { CHECK_THREAD(cx); |