Backed out changeset 8d3f2162b557 (bug 1627954) for causing multiple crashes on [@ js::gcstats::Statistics::lookupChildPhase(js::gcstats::PhaseKind) const]

CLOSED TREE
This commit is contained in:
Arthur Iakab
2020-04-08 15:20:16 +03:00
parent aaf2f6ef70
commit 24c3f51e05

View File

@@ -4970,8 +4970,8 @@ void GCRuntime::startTask(GCParallelTask& task, gcstats::PhaseKind phase,
AutoLockHelperThreadState& lock) {
if (!CanUseExtraThreads()) {
AutoUnlockHelperThreadState unlock(lock);
gcstats::AutoPhase ap(stats(), phase);
task.runFromMainThread();
stats().recordParallelPhase(phase, task.duration());
return;
}
@@ -4987,15 +4987,18 @@ void GCRuntime::joinTask(GCParallelTask& task, gcstats::PhaseKind phase,
return;
}
// If the task was dispatched but has not yet started then cancel the task and
// run it from the main thread. This stops us from blocking here when the
// helper threads are busy with other tasks.
if (task.isDispatched(lock)) {
// If the task was dispatched but has not yet started then cancel the task
// and run it from the main thread. This stops us from blocking here when
// the helper threads are busy with other tasks.
task.cancelDispatchedTask(lock);
AutoUnlockHelperThreadState unlock(lock);
gcstats::AutoPhase ap(stats(), phase);
task.runFromMainThread();
} else {
// Otherwise wait for the task to complete.
return;
}
{
gcstats::AutoPhase ap(stats(), gcstats::PhaseKind::JOIN_PARALLEL_TASKS);
task.joinRunningOrFinishedTask(lock);
}