Bug 841646 - Part 4: Allow parallel compilation while the SPS Profiler is active. r=jandem

This commit is contained in:
Emanuel Hoogeveen 2014-01-28 08:56:51 -05:00
parent 599ba813a7
commit a1352a9298

View File

@ -1571,14 +1571,9 @@ OffThreadCompilationAvailable(JSContext *cx)
// 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 cx->runtime()->canUseParallelIonCompilation()
&& cx->runtime()->gcIncrementalState == gc::NO_INCREMENTAL
&& !cx->runtime()->profilingScripts
&& !cx->runtime()->spsProfiler.enabled();
&& !cx->runtime()->profilingScripts;
}
static void
@ -1735,8 +1730,7 @@ IonCompile(JSContext *cx, JSScript *script,
Maybe<AutoProtectHeapForIonCompilation> protect;
if (js_JitOptions.checkThreadSafety &&
cx->runtime()->gcIncrementalState == gc::NO_INCREMENTAL &&
!cx->runtime()->profilingScripts &&
!cx->runtime()->spsProfiler.enabled())
!cx->runtime()->profilingScripts)
{
protect.construct(cx->runtime());
}