From 16df2c682c7070187af6aa79a1ba66400f84532c Mon Sep 17 00:00:00 2001 From: Jon Coppeard Date: Tue, 2 May 2017 10:40:32 +0100 Subject: [PATCH] Bug 1360502 - Prioritise GC parallel tasks when selecting tasks to run on helper threads r=jandem --- js/src/vm/HelperThreads.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/js/src/vm/HelperThreads.cpp b/js/src/vm/HelperThreads.cpp index 23a55c2ac931..8ac8774f1dcf 100644 --- a/js/src/vm/HelperThreads.cpp +++ b/js/src/vm/HelperThreads.cpp @@ -1949,7 +1949,13 @@ HelperThread::threadLoop() HelperThreadState().wait(lock, GlobalHelperThreadState::PRODUCER); } - if (ionCompile) { + if (HelperThreadState().canStartGCParallelTask(lock)) { + js::oom::SetThreadType(js::oom::THREAD_TYPE_GCPARALLEL); + handleGCParallelWorkload(lock); + } else if (HelperThreadState().canStartGCHelperTask(lock)) { + js::oom::SetThreadType(js::oom::THREAD_TYPE_GCHELPER); + handleGCHelperWorkload(lock); + } else if (ionCompile) { js::oom::SetThreadType(js::oom::THREAD_TYPE_ION); handleIonWorkload(lock); } else if (HelperThreadState().canStartWasmCompile(lock)) { @@ -1964,12 +1970,6 @@ HelperThread::threadLoop() } else if (HelperThreadState().canStartCompressionTask(lock)) { js::oom::SetThreadType(js::oom::THREAD_TYPE_COMPRESS); handleCompressionWorkload(lock); - } else if (HelperThreadState().canStartGCHelperTask(lock)) { - js::oom::SetThreadType(js::oom::THREAD_TYPE_GCHELPER); - handleGCHelperWorkload(lock); - } else if (HelperThreadState().canStartGCParallelTask(lock)) { - js::oom::SetThreadType(js::oom::THREAD_TYPE_GCPARALLEL); - handleGCParallelWorkload(lock); } else { MOZ_CRASH("No task to perform"); }