Bug 1182730 - Followup: only mark the JitcodeGlobalMap when profiling is on. (r=djvj)

This commit is contained in:
Shu-yu Guo 2015-08-02 15:11:39 -07:00
parent c09a27e482
commit 73a70dbcd5
2 changed files with 7 additions and 5 deletions

View File

@ -624,7 +624,8 @@ JitRuntime::Mark(JSTracer* trc)
/* static */ void
JitRuntime::MarkJitcodeGlobalTableUnconditionally(JSTracer* trc)
{
if (trc->runtime()->hasJitRuntime() &&
if (trc->runtime()->spsProfiler.enabled() &&
trc->runtime()->hasJitRuntime() &&
trc->runtime()->jitRuntime()->hasJitcodeGlobalTable())
{
trc->runtime()->jitRuntime()->getJitcodeGlobalTable()->markUnconditionally(trc);
@ -634,7 +635,8 @@ JitRuntime::MarkJitcodeGlobalTableUnconditionally(JSTracer* trc)
/* static */ bool
JitRuntime::MarkJitcodeGlobalTableIteratively(JSTracer* trc)
{
if (trc->runtime()->hasJitRuntime() &&
if (trc->runtime()->spsProfiler.enabled() &&
trc->runtime()->hasJitRuntime() &&
trc->runtime()->jitRuntime()->hasJitcodeGlobalTable())
{
return trc->runtime()->jitRuntime()->getJitcodeGlobalTable()->markIteratively(trc);

View File

@ -763,6 +763,8 @@ JitcodeGlobalTable::markUnconditionally(JSTracer* trc)
// Mark all entries unconditionally. This is done during minor collection
// to account for tenuring.
MOZ_ASSERT(trc->runtime()->spsProfiler.enabled());
AutoSuppressProfilerSampling suppressSampling(trc->runtime());
for (Range r(*this); !r.empty(); r.popFront())
r.front()->mark<Unconditionally>(trc);
@ -806,14 +808,12 @@ JitcodeGlobalTable::markIteratively(JSTracer* trc)
// above is checked in JitcodeGlobalTable::lookupForSampler.
MOZ_ASSERT(!trc->runtime()->isHeapMinorCollecting());
MOZ_ASSERT(trc->runtime()->spsProfiler.enabled());
AutoSuppressProfilerSampling suppressSampling(trc->runtime());
uint32_t gen = trc->runtime()->profilerSampleBufferGen();
uint32_t lapCount = trc->runtime()->profilerSampleBufferLapCount();
if (!trc->runtime()->spsProfiler.enabled())
gen = UINT32_MAX;
bool markedAny = false;
for (Range r(*this); !r.empty(); r.popFront()) {
JitcodeGlobalEntry* entry = r.front();