Bug 832812 - Don't use off-thread Ion compilation while profiling (r=dvander)
authorBill McCloskey <wmccloskey@mozilla.com>
Thu, 14 Feb 2013 17:13:38 -0800
changeset 131867 ce7ef6d06439975fd9f31cddd5bb549c430a4dd4
parent 131866 4167e90a7a99d4b5d1303fcba74ca85cee1e022c
child 131868 193d1a6e5b68f2bc9b96908e0254bf3afd5550f1
push id2323
push userbbajaj@mozilla.com
push dateMon, 01 Apr 2013 19:47:02 +0000
treeherdermozilla-beta@7712be144d91 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdvander
bugs832812
milestone21.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 832812 - Don't use off-thread Ion compilation while profiling (r=dvander)
js/src/ion/Ion.cpp
--- a/js/src/ion/Ion.cpp
+++ b/js/src/ion/Ion.cpp
@@ -1196,23 +1196,29 @@ OffThreadCompilationEnabled(JSContext *c
         && cx->runtime->helperThreadCount() != 0;
 }
 
 static inline bool
 OffThreadCompilationAvailable(JSContext *cx)
 {
     // Even if off thread compilation is enabled, compilation must still occur
     // on the main thread in some cases. Do not compile off thread during an
-    // incremental GC, as this may trip incremental read barriers. Also skip
-    // off thread compilation if script execution is being profiled, as
+    // incremental GC, as this may trip incremental read barriers.
+    //
+    // Skip off thread compilation if PC count profiling is enabled, as
     // CodeGenerator::maybeCreateScriptCounts will not attach script profiles
     // when running off thread.
+    //
+    // Also skip off thread compilation if the SPS profiler is enabled, as it
+    // stores strings in the spsProfiler data structure, which is not protected
+    // by a lock.
     return OffThreadCompilationEnabled(cx)
         && cx->runtime->gcIncrementalState == gc::NO_INCREMENTAL
-        && !cx->runtime->profilingScripts;
+        && !cx->runtime->profilingScripts
+        && !cx->runtime->spsProfiler.enabled();
 }
 
 AbortReason
 SequentialCompileContext::compile(IonBuilder *builder, MIRGraph *graph,
                                   ScopedJSDeletePtr<LifoAlloc> &autoDelete)
 {
     JS_ASSERT(!builder->script()->ion);
     JSContext *cx = GetIonContext()->cx;