1
0
mirror of https://github.com/roytam1/UXP.git synced 2026-05-26 13:58:49 +00:00

Issue #3092 - Implement BackgroundFinalizeTask for parallel garbage collection finalization

This commit is contained in:
ownedbywuigi
2026-05-10 06:38:06 -07:00
committed by roytam1
parent 47746b476e
commit c06776336d
2 changed files with 6 additions and 22 deletions
+2 -4
View File
@@ -4523,10 +4523,8 @@ PrepareWeakCacheTasks(JSRuntime* rt)
WeakCacheTaskVector out;
for (GCZoneGroupIter zone(rt); !zone.done(); zone.next()) {
for (JS::WeakCache<void*>* cache : zone->weakCaches_) {
if (!out.append(SweepWeakCacheTask(rt, *cache))) {
SweepWeakCachesFromMainThread(rt);
return WeakCacheTaskVector();
}
if (!out.emplaceBack(rt, *cache))
return out;
}
}
return out;
+4 -18
View File
@@ -49,6 +49,10 @@ js::CreateHelperThreadsState()
{
MOZ_ASSERT(!gHelperThreadState);
gHelperThreadState = js_new<GlobalHelperThreadState>();
return gHelperThreadState != nullptr;
}
void
js::DestroyHelperThreadsState()
{
MOZ_ASSERT(gHelperThreadState);
@@ -473,24 +477,6 @@ js::CancelOffThreadParses(JSRuntime* rt)
HelperThreadState().wait(lock, GlobalHelperThreadState::CONSUMER);
}
return gHelperThreadState != nullptr;
}
void
js::DestroyHelperThreadsState()
{
MOZ_ASSERT(gHelperThreadState);
gHelperThreadState->finish();
js_delete(gHelperThreadState);
gHelperThreadState = nullptr;
// Clean up any parse tasks which haven't been finished by the main thread.
AutoUnlockHelperThreadState unlock(lock);
HelperThreadState().cancelParseTask(rt->contextFromMainThread(), task->kind, task);
}
}
if (!found)
break;
}
}
bool