mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-10-29 02:27:30 +09:00
Bug 1323868: Report object allocation failure when running off-main-thread
Issue #77 [Depends on] Bug 1192038: RegExp.prototype should be an ordinary object
This commit is contained in:
parent
7f0f087cff
commit
49ce6a7928
2 changed files with 11 additions and 2 deletions
|
|
@ -39,8 +39,12 @@ js::Allocate(ExclusiveContext* cx, AllocKind kind, size_t nDynamicSlots, Initial
|
||||||
MOZ_ASSERT_IF(nDynamicSlots != 0, clasp->isNative() || clasp->isProxy());
|
MOZ_ASSERT_IF(nDynamicSlots != 0, clasp->isNative() || clasp->isProxy());
|
||||||
|
|
||||||
// Off-main-thread alloc cannot trigger GC or make runtime assertions.
|
// Off-main-thread alloc cannot trigger GC or make runtime assertions.
|
||||||
if (!cx->isJSContext())
|
if (!cx->isJSContext()) {
|
||||||
return GCRuntime::tryNewTenuredObject<NoGC>(cx, kind, thingSize, nDynamicSlots);
|
JSObject* obj = GCRuntime::tryNewTenuredObject<NoGC>(cx, kind, thingSize, nDynamicSlots);
|
||||||
|
if (MOZ_UNLIKELY(allowGC && !obj))
|
||||||
|
ReportOutOfMemory(cx);
|
||||||
|
return obj;
|
||||||
|
}
|
||||||
|
|
||||||
JSContext* ncx = cx->asJSContext();
|
JSContext* ncx = cx->asJSContext();
|
||||||
JSRuntime* rt = ncx->runtime();
|
JSRuntime* rt = ncx->runtime();
|
||||||
|
|
|
||||||
5
js/src/jit-test/tests/gc/bug-1323868.js
Normal file
5
js/src/jit-test/tests/gc/bug-1323868.js
Normal file
|
|
@ -0,0 +1,5 @@
|
||||||
|
if (helperThreadCount() == 0)
|
||||||
|
quit();
|
||||||
|
startgc(8301);
|
||||||
|
offThreadCompileScript("(({a,b,c}))");
|
||||||
|
gcparam("maxBytes", gcparam("gcBytes"));
|
||||||
Loading…
Add table
Add a link
Reference in a new issue