mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 900598 - Make sure not to collect the atoms compartment when exclusive threads are present (r=bhackett)
This commit is contained in:
parent
d5c2e9336d
commit
c6a58bf7a5
@ -2773,6 +2773,15 @@ BeginMarkPhase(JSRuntime *rt)
|
|||||||
for (ThreadDataIter iter(rt); !iter.done(); iter.next())
|
for (ThreadDataIter iter(rt); !iter.done(); iter.next())
|
||||||
keepAtoms |= iter->gcKeepAtoms;
|
keepAtoms |= iter->gcKeepAtoms;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* We don't scan the stacks of exclusive threads, so we need to avoid
|
||||||
|
* collecting their objects in another way. The only GC thing pointers they
|
||||||
|
* have are to their exclusive compartment (which is not collected) or to
|
||||||
|
* the atoms compartment. Therefore, we avoid collecting the atoms
|
||||||
|
* compartment when exclusive threads are running.
|
||||||
|
*/
|
||||||
|
keepAtoms |= rt->exclusiveThreadsPresent();
|
||||||
|
|
||||||
if (atomsZone->isGCScheduled() && rt->gcIsFull && !keepAtoms) {
|
if (atomsZone->isGCScheduled() && rt->gcIsFull && !keepAtoms) {
|
||||||
JS_ASSERT(!atomsZone->isCollecting());
|
JS_ASSERT(!atomsZone->isCollecting());
|
||||||
atomsZone->setGCState(Zone::Mark);
|
atomsZone->setGCState(Zone::Mark);
|
||||||
@ -4352,6 +4361,8 @@ gc::IsIncrementalGCSafe(JSRuntime *rt)
|
|||||||
for (ThreadDataIter iter(rt); !iter.done(); iter.next())
|
for (ThreadDataIter iter(rt); !iter.done(); iter.next())
|
||||||
keepAtoms |= iter->gcKeepAtoms;
|
keepAtoms |= iter->gcKeepAtoms;
|
||||||
|
|
||||||
|
keepAtoms |= rt->exclusiveThreadsPresent();
|
||||||
|
|
||||||
if (keepAtoms)
|
if (keepAtoms)
|
||||||
return IncrementalSafety::Unsafe("gcKeepAtoms set");
|
return IncrementalSafety::Unsafe("gcKeepAtoms set");
|
||||||
|
|
||||||
|
@ -765,6 +765,14 @@ struct JSRuntime : public JS::shadow::Runtime,
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool exclusiveThreadsPresent() const {
|
||||||
|
#ifdef JS_THREADSAFE
|
||||||
|
return numExclusiveThreads > 0;
|
||||||
|
#else
|
||||||
|
return false;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
/* Default compartment. */
|
/* Default compartment. */
|
||||||
JSCompartment *atomsCompartment;
|
JSCompartment *atomsCompartment;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user