mirror of
https://github.com/classilla/tenfourfox.git
synced 2025-01-06 09:29:35 +00:00
#438: M1371908 (gc-JS)
This commit is contained in:
parent
3ee4857708
commit
999e0bb484
6
js/src/jit-test/tests/gc/bug-1371908.js
Normal file
6
js/src/jit-test/tests/gc/bug-1371908.js
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
if (helperThreadCount() === 0)
|
||||||
|
quit();
|
||||||
|
offThreadCompileScript("");
|
||||||
|
startgc(0);
|
||||||
|
runOffThreadScript();
|
||||||
|
|
21
js/src/jit-test/tests/gc/bug1146213.js
Normal file
21
js/src/jit-test/tests/gc/bug1146213.js
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
if (!("setGCCallback" in this &&
|
||||||
|
"schedulegc" in this &&
|
||||||
|
"gcslice" in this &&
|
||||||
|
"newGlobal" in this &&
|
||||||
|
"helperThreadCount" in this))
|
||||||
|
{
|
||||||
|
quit();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (helperThreadCount() == 0)
|
||||||
|
quit();
|
||||||
|
|
||||||
|
setGCCallback({
|
||||||
|
action: "majorGC",
|
||||||
|
});
|
||||||
|
schedulegc(this)
|
||||||
|
gcslice(3)
|
||||||
|
var lfGlobal = newGlobal();
|
||||||
|
lfGlobal.offThreadCompileScript("");
|
||||||
|
lfGlobal.runOffThreadScript();
|
||||||
|
|
@ -6845,7 +6845,11 @@ gc::MergeCompartments(JSCompartment* source, JSCompartment* target)
|
|||||||
|
|
||||||
JSRuntime* rt = source->runtimeFromMainThread();
|
JSRuntime* rt = source->runtimeFromMainThread();
|
||||||
|
|
||||||
AutoPrepareForTracing prepare(rt, SkipAtoms);
|
MOZ_ASSERT(!source->zone()->wasGCStarted());
|
||||||
|
MOZ_ASSERT(!target->zone()->wasGCStarted());
|
||||||
|
JS::AutoAssertOnGC nogc(rt);
|
||||||
|
|
||||||
|
AutoTraceSession session(rt);
|
||||||
|
|
||||||
// Cleanup tables and other state in the source compartment that will be
|
// Cleanup tables and other state in the source compartment that will be
|
||||||
// meaningless after merging into the target compartment.
|
// meaningless after merging into the target compartment.
|
||||||
|
@ -1103,11 +1103,13 @@ GlobalHelperThreadState::mergeParseTaskCompartment(JSRuntime* rt, ParseTask* par
|
|||||||
Handle<GlobalObject*> global,
|
Handle<GlobalObject*> global,
|
||||||
JSCompartment* dest)
|
JSCompartment* dest)
|
||||||
{
|
{
|
||||||
|
// Finish any ongoing incremental GC that may affect the destination zone.
|
||||||
|
if (JS::IsIncrementalGCInProgress(rt) && dest->zone()->wasGCStarted())
|
||||||
|
JS::FinishIncrementalGC(rt, JS::gcreason::API);
|
||||||
|
|
||||||
// After we call LeaveParseTaskZone() it's not safe to GC until we have
|
// After we call LeaveParseTaskZone() it's not safe to GC until we have
|
||||||
// finished merging the contents of the parse task's compartment into the
|
// finished merging the contents of the parse task's compartment into the
|
||||||
// destination compartment. Finish any ongoing incremental GC first and
|
// destination compartment.
|
||||||
// assert that no allocation can occur.
|
|
||||||
gc::AutoFinishGC finishGC(rt);
|
|
||||||
JS::AutoAssertNoAlloc noAlloc(rt);
|
JS::AutoAssertNoAlloc noAlloc(rt);
|
||||||
|
|
||||||
LeaveParseTaskZone(rt, parseTask);
|
LeaveParseTaskZone(rt, parseTask);
|
||||||
|
Loading…
Reference in New Issue
Block a user