Bug 1326179: wasm: Disable parallel compilation on machines with 1 CPU; r=luke
authorBenjamin Bouvier <benj@benj.me>
Thu, 29 Dec 2016 11:47:33 +0100
changeset 327648 adb05b1d381cbc9b6c7fa251108862e21a3d25d7
parent 327647 04dff9adc7030e53e30649533b2a3307d0dd2f70
child 327649 8c07ff4ab630c8a753e820c3d68db95df0c29af5
push id31139
push userryanvm@gmail.com
push dateFri, 30 Dec 2016 15:04:57 +0000
treeherdermozilla-central@9104708cc3ac [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersluke
bugs1326179
milestone53.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1326179: wasm: Disable parallel compilation on machines with 1 CPU; r=luke MozReview-Commit-ID: EEGWa2u9U2X
js/src/wasm/WasmGenerator.cpp
--- a/js/src/wasm/WasmGenerator.cpp
+++ b/js/src/wasm/WasmGenerator.cpp
@@ -831,17 +831,20 @@ ModuleGenerator::startFuncDefs()
     // worklist pair. Alternatively, the deadlock could be avoided by having the
     // ModuleGenerator thread make progress (on compile tasks) instead of
     // blocking.
 
     GlobalHelperThreadState& threads = HelperThreadState();
     MOZ_ASSERT(threads.threadCount > 1);
 
     uint32_t numTasks;
-    if (CanUseExtraThreads() && threads.wasmCompilationInProgress.compareExchange(false, true)) {
+    if (CanUseExtraThreads() &&
+        threads.cpuCount > 1 &&
+        threads.wasmCompilationInProgress.compareExchange(false, true))
+    {
 #ifdef DEBUG
         {
             AutoLockHelperThreadState lock;
             MOZ_ASSERT(!HelperThreadState().wasmFailed(lock));
             MOZ_ASSERT(HelperThreadState().wasmWorklist(lock).empty());
             MOZ_ASSERT(HelperThreadState().wasmFinishedList(lock).empty());
         }
 #endif