Bug 1123237 - Part 12. Fix GC hazards. r=terrence
authorKan-Ru Chen <kanru@kanru.info>
Sun, 06 Sep 2015 10:35:12 +0800
changeset 295339 1bc5e8663f6404c6e7d3e5624267c7e09101b4ca
parent 295338 15363064445116e4965248c467037b1eaf2ee78e
child 295340 61a6a8dcefd364bc7a069198d065abf78ca0307d
push id5245
push userraliiev@mozilla.com
push dateThu, 29 Oct 2015 11:30:51 +0000
treeherdermozilla-beta@dac831dc1bd0 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersterrence
bugs1123237
milestone43.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 1123237 - Part 12. Fix GC hazards. r=terrence
js/src/jsfriendapi.h
--- a/js/src/jsfriendapi.h
+++ b/js/src/jsfriendapi.h
@@ -2903,88 +2903,106 @@ class MemProfiler
 
     static MemProfiler* GetMemProfiler(JSRuntime* runtime);
 
     static void SetNativeProfiler(NativeProfiler* aProfiler) {
         sNativeProfiler = aProfiler;
     }
 
     static void SampleNative(void* addr, uint32_t size) {
+        JS::AutoSuppressGCAnalysis nogc;
+
         if (MOZ_LIKELY(!enabled()))
             return;
 
         NativeProfiler* profiler = GetNativeProfiler();
         if (profiler)
             profiler->sampleNative(addr, size);
     }
 
     static void SampleTenured(void* addr, uint32_t size) {
+        JS::AutoSuppressGCAnalysis nogc;
+
         if (MOZ_LIKELY(!enabled()))
             return;
 
         GCHeapProfiler* profiler = GetGCHeapProfiler(addr);
         if (profiler)
             profiler->sampleTenured(addr, size);
     }
 
     static void SampleNursery(void* addr, uint32_t size) {
+        JS::AutoSuppressGCAnalysis nogc;
+
         if (MOZ_LIKELY(!enabled()))
             return;
 
         GCHeapProfiler* profiler = GetGCHeapProfiler(addr);
         if (profiler)
             profiler->sampleNursery(addr, size);
     }
 
     static void RemoveNative(void* addr) {
+        JS::AutoSuppressGCAnalysis nogc;
+
         if (MOZ_LIKELY(!enabled()))
             return;
 
         NativeProfiler* profiler = GetNativeProfiler();
         if (profiler)
             profiler->removeNative(addr);
     }
 
     static void MarkTenuredStart(JSRuntime* runtime) {
+        JS::AutoSuppressGCAnalysis nogc;
+
         if (MOZ_LIKELY(!enabled()))
             return;
 
         GCHeapProfiler* profiler = GetGCHeapProfiler(runtime);
         if (profiler)
             profiler->markTenuredStart();
     }
 
     static void MarkTenured(void* addr) {
+        JS::AutoSuppressGCAnalysis nogc;
+
         if (MOZ_LIKELY(!enabled()))
             return;
 
         GCHeapProfiler* profiler = GetGCHeapProfiler(addr);
         if (profiler)
             profiler->markTenured(addr);
     }
 
     static void SweepTenured(JSRuntime* runtime) {
+        JS::AutoSuppressGCAnalysis nogc;
+
         if (MOZ_LIKELY(!enabled()))
             return;
 
         GCHeapProfiler* profiler = GetGCHeapProfiler(runtime);
         if (profiler)
             profiler->sweepTenured();
     }
 
     static void SweepNursery(JSRuntime* runtime) {
+        JS::AutoSuppressGCAnalysis nogc;
+
         if (MOZ_LIKELY(!enabled()))
             return;
 
         GCHeapProfiler* profiler = GetGCHeapProfiler(runtime);
         if (profiler)
             profiler->sweepNursery();
     }
 
     static void MoveNurseryToTenured(void* addrOld, void* addrNew) {
+        JS::AutoSuppressGCAnalysis nogc;
+
         if (MOZ_LIKELY(!enabled()))
             return;
 
         GCHeapProfiler* profiler = GetGCHeapProfiler(addrOld);
         if (profiler)
             profiler->moveNurseryToTenured(addrOld, addrNew);
     }
 };