зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1205255 - Force inline and use relaxed atomic. r=terrence
This commit is contained in:
Родитель
a3dcc92724
Коммит
2f53a68cb8
|
@ -10,7 +10,7 @@
|
|||
|
||||
using js::gc::Cell;
|
||||
|
||||
mozilla::Atomic<int> MemProfiler::sActiveProfilerCount;
|
||||
mozilla::Atomic<uint32_t, mozilla::Relaxed> MemProfiler::sActiveProfilerCount;
|
||||
NativeProfiler* MemProfiler::sNativeProfiler;
|
||||
|
||||
GCHeapProfiler*
|
||||
|
|
|
@ -2874,7 +2874,7 @@ class GCHeapProfiler
|
|||
|
||||
class MemProfiler
|
||||
{
|
||||
static mozilla::Atomic<int> sActiveProfilerCount;
|
||||
static mozilla::Atomic<uint32_t, mozilla::Relaxed> sActiveProfilerCount;
|
||||
static NativeProfiler* sNativeProfiler;
|
||||
|
||||
static GCHeapProfiler* GetGCHeapProfiler(void* addr);
|
||||
|
@ -2897,7 +2897,7 @@ class MemProfiler
|
|||
return mGCHeapProfiler;
|
||||
}
|
||||
|
||||
static bool enabled() {
|
||||
static MOZ_ALWAYS_INLINE bool enabled() {
|
||||
return sActiveProfilerCount > 0;
|
||||
}
|
||||
|
||||
|
@ -2907,7 +2907,7 @@ class MemProfiler
|
|||
sNativeProfiler = aProfiler;
|
||||
}
|
||||
|
||||
static void SampleNative(void* addr, uint32_t size) {
|
||||
static MOZ_ALWAYS_INLINE void SampleNative(void* addr, uint32_t size) {
|
||||
JS::AutoSuppressGCAnalysis nogc;
|
||||
|
||||
if (MOZ_LIKELY(!enabled()))
|
||||
|
@ -2918,7 +2918,7 @@ class MemProfiler
|
|||
profiler->sampleNative(addr, size);
|
||||
}
|
||||
|
||||
static void SampleTenured(void* addr, uint32_t size) {
|
||||
static MOZ_ALWAYS_INLINE void SampleTenured(void* addr, uint32_t size) {
|
||||
JS::AutoSuppressGCAnalysis nogc;
|
||||
|
||||
if (MOZ_LIKELY(!enabled()))
|
||||
|
@ -2929,7 +2929,7 @@ class MemProfiler
|
|||
profiler->sampleTenured(addr, size);
|
||||
}
|
||||
|
||||
static void SampleNursery(void* addr, uint32_t size) {
|
||||
static MOZ_ALWAYS_INLINE void SampleNursery(void* addr, uint32_t size) {
|
||||
JS::AutoSuppressGCAnalysis nogc;
|
||||
|
||||
if (MOZ_LIKELY(!enabled()))
|
||||
|
@ -2940,7 +2940,7 @@ class MemProfiler
|
|||
profiler->sampleNursery(addr, size);
|
||||
}
|
||||
|
||||
static void RemoveNative(void* addr) {
|
||||
static MOZ_ALWAYS_INLINE void RemoveNative(void* addr) {
|
||||
JS::AutoSuppressGCAnalysis nogc;
|
||||
|
||||
if (MOZ_LIKELY(!enabled()))
|
||||
|
@ -2951,7 +2951,7 @@ class MemProfiler
|
|||
profiler->removeNative(addr);
|
||||
}
|
||||
|
||||
static void MarkTenuredStart(JSRuntime* runtime) {
|
||||
static MOZ_ALWAYS_INLINE void MarkTenuredStart(JSRuntime* runtime) {
|
||||
JS::AutoSuppressGCAnalysis nogc;
|
||||
|
||||
if (MOZ_LIKELY(!enabled()))
|
||||
|
@ -2962,7 +2962,7 @@ class MemProfiler
|
|||
profiler->markTenuredStart();
|
||||
}
|
||||
|
||||
static void MarkTenured(void* addr) {
|
||||
static MOZ_ALWAYS_INLINE void MarkTenured(void* addr) {
|
||||
JS::AutoSuppressGCAnalysis nogc;
|
||||
|
||||
if (MOZ_LIKELY(!enabled()))
|
||||
|
@ -2973,7 +2973,7 @@ class MemProfiler
|
|||
profiler->markTenured(addr);
|
||||
}
|
||||
|
||||
static void SweepTenured(JSRuntime* runtime) {
|
||||
static MOZ_ALWAYS_INLINE void SweepTenured(JSRuntime* runtime) {
|
||||
JS::AutoSuppressGCAnalysis nogc;
|
||||
|
||||
if (MOZ_LIKELY(!enabled()))
|
||||
|
@ -2984,7 +2984,7 @@ class MemProfiler
|
|||
profiler->sweepTenured();
|
||||
}
|
||||
|
||||
static void SweepNursery(JSRuntime* runtime) {
|
||||
static MOZ_ALWAYS_INLINE void SweepNursery(JSRuntime* runtime) {
|
||||
JS::AutoSuppressGCAnalysis nogc;
|
||||
|
||||
if (MOZ_LIKELY(!enabled()))
|
||||
|
@ -2995,7 +2995,7 @@ class MemProfiler
|
|||
profiler->sweepNursery();
|
||||
}
|
||||
|
||||
static void MoveNurseryToTenured(void* addrOld, void* addrNew) {
|
||||
static MOZ_ALWAYS_INLINE void MoveNurseryToTenured(void* addrOld, void* addrNew) {
|
||||
JS::AutoSuppressGCAnalysis nogc;
|
||||
|
||||
if (MOZ_LIKELY(!enabled()))
|
||||
|
|
Загрузка…
Ссылка в новой задаче