mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-19 00:05:36 +00:00
Bug 1608069 - Move sweeping of finalization groups to main thread so the browser doesn't get confused when called from our helper threads r=sfink
Differential Revision: https://phabricator.services.mozilla.com/D59374 --HG-- extra : moz-landing-system : lando
This commit is contained in:
parent
c7b5617848
commit
7cddbcdb64
@ -4912,10 +4912,12 @@ static void SweepUniqueIds(GCParallelTask* task) {
|
||||
}
|
||||
}
|
||||
|
||||
void js::gc::SweepFinalizationGroups(GCParallelTask* task) {
|
||||
for (SweepGroupZonesIter zone(task->gc); !zone.done(); zone.next()) {
|
||||
AutoSetThreadIsSweeping threadIsSweeping(zone);
|
||||
task->gc->sweepFinalizationGroups(zone);
|
||||
void GCRuntime::sweepFinalizationGroupsOnMainThread() {
|
||||
// This calls back into the browser which expects to be called from the main
|
||||
// thread.
|
||||
gcstats::AutoPhase ap(stats(), gcstats::PhaseKind::SWEEP_FINALIZATION_GROUPS);
|
||||
for (SweepGroupZonesIter zone(this); !zone.done(); zone.next()) {
|
||||
sweepFinalizationGroups(zone);
|
||||
}
|
||||
}
|
||||
|
||||
@ -5194,9 +5196,6 @@ IncrementalProgress GCRuntime::beginSweepingSweepGroup(JSFreeOp* fop,
|
||||
PhaseKind::SWEEP_WEAKMAPS, lock);
|
||||
AutoRunParallelTask sweepUniqueIds(this, SweepUniqueIds,
|
||||
PhaseKind::SWEEP_UNIQUEIDS, lock);
|
||||
AutoRunParallelTask sweepFinalizationGroups(
|
||||
this, SweepFinalizationGroups, PhaseKind::SWEEP_FINALIZATION_GROUPS,
|
||||
lock);
|
||||
AutoRunParallelTask sweepWeakRefs(this, SweepWeakRefs,
|
||||
PhaseKind::SWEEP_WEAKREFS, lock);
|
||||
|
||||
@ -5212,6 +5211,7 @@ IncrementalProgress GCRuntime::beginSweepingSweepGroup(JSFreeOp* fop,
|
||||
{
|
||||
AutoUnlockHelperThreadState unlock(lock);
|
||||
sweepJitDataOnMainThread(fop);
|
||||
sweepFinalizationGroupsOnMainThread();
|
||||
}
|
||||
|
||||
for (auto& task : sweepCacheTasks) {
|
||||
|
@ -248,7 +248,6 @@ class ZoneList {
|
||||
ZoneList& operator=(const ZoneList& other) = delete;
|
||||
};
|
||||
|
||||
void SweepFinalizationGroups(GCParallelTask* task);
|
||||
void SweepWeakRefs(GCParallelTask* task);
|
||||
|
||||
class GCRuntime {
|
||||
@ -701,8 +700,8 @@ class GCRuntime {
|
||||
void updateAtomsBitmap();
|
||||
void sweepDebuggerOnMainThread(JSFreeOp* fop);
|
||||
void sweepJitDataOnMainThread(JSFreeOp* fop);
|
||||
void sweepFinalizationGroupsOnMainThread();
|
||||
void sweepFinalizationGroups(Zone* zone);
|
||||
friend void SweepFinalizationGroups(GCParallelTask* task);
|
||||
void queueFinalizationGroupForCleanup(FinalizationGroupObject* group);
|
||||
void sweepWeakRefs(Zone* zone);
|
||||
friend void SweepWeakRefs(GCParallelTask* task);
|
||||
|
Loading…
Reference in New Issue
Block a user