Bug 1335595 (part 1) - Remove the profiler's ASSERT macro. r=mstange.

MOZ_ASSERT is the standard macro.

--HG--
extra : rebase_source : 8aa9b96b82ff4b7ec2de4ec5c62aeb23aafea85f
This commit is contained in:
Nicholas Nethercote 2017-02-01 15:40:55 +11:00
Родитель f229e3220d
Коммит f542865603
6 изменённых файлов: 11 добавлений и 13 удалений

Просмотреть файл

@ -329,7 +329,7 @@ Sampler::RegisterCurrentThread(const char* aName,
if (info->ThreadId() == id && !info->IsPendingDelete()) { if (info->ThreadId() == id && !info->IsPendingDelete()) {
// Thread already registered. This means the first unregister will be // Thread already registered. This means the first unregister will be
// too early. // too early.
ASSERT(false); MOZ_ASSERT(false);
return false; return false;
} }
} }

Просмотреть файл

@ -165,7 +165,7 @@ static void* setup_atfork() {
struct SamplerRegistry { struct SamplerRegistry {
static void AddActiveSampler(Sampler *sampler) { static void AddActiveSampler(Sampler *sampler) {
ASSERT(!SamplerRegistry::sampler); MOZ_ASSERT(!SamplerRegistry::sampler);
SamplerRegistry::sampler = sampler; SamplerRegistry::sampler = sampler;
} }
static void RemoveActiveSampler(Sampler *sampler) { static void RemoveActiveSampler(Sampler *sampler) {

Просмотреть файл

@ -47,7 +47,7 @@ using mozilla::TimeDuration;
// that only supports a single Sampler // that only supports a single Sampler
struct SamplerRegistry { struct SamplerRegistry {
static void AddActiveSampler(Sampler *sampler) { static void AddActiveSampler(Sampler *sampler) {
ASSERT(!SamplerRegistry::sampler); MOZ_ASSERT(!SamplerRegistry::sampler);
SamplerRegistry::sampler = sampler; SamplerRegistry::sampler = sampler;
} }
static void RemoveActiveSampler(Sampler *sampler) { static void RemoveActiveSampler(Sampler *sampler) {
@ -138,7 +138,7 @@ public:
thread->mThread = pthread_self(); thread->mThread = pthread_self();
SetThreadName(); SetThreadName();
ASSERT(thread->mThread != kNoThread); MOZ_ASSERT(thread->mThread != kNoThread);
thread->Run(); thread->Run();
return NULL; return NULL;
} }
@ -146,7 +146,7 @@ public:
void Start() { void Start() {
pthread_attr_t* attr_ptr = NULL; pthread_attr_t* attr_ptr = NULL;
pthread_create(&mThread, attr_ptr, ThreadEntry, this); pthread_create(&mThread, attr_ptr, ThreadEntry, this);
ASSERT(mThread != kNoThread); MOZ_ASSERT(mThread != kNoThread);
} }
void Join() { void Join() {
@ -289,13 +289,13 @@ private:
SamplerThread* SamplerThread::mInstance = NULL; SamplerThread* SamplerThread::mInstance = NULL;
void Sampler::Start() { void Sampler::Start() {
ASSERT(!IsActive()); MOZ_ASSERT(!IsActive());
SetActive(true); SetActive(true);
SamplerThread::AddActiveSampler(this); SamplerThread::AddActiveSampler(this);
} }
void Sampler::Stop() { void Sampler::Stop() {
ASSERT(IsActive()); MOZ_ASSERT(IsActive());
SetActive(false); SetActive(false);
SamplerThread::RemoveActiveSampler(this); SamplerThread::RemoveActiveSampler(this);
} }

Просмотреть файл

@ -146,7 +146,7 @@ class SamplerThread
mInstance = new SamplerThread(sampler->interval(), sampler); mInstance = new SamplerThread(sampler->interval(), sampler);
mInstance->Start(); mInstance->Start();
} else { } else {
ASSERT(mInstance->mInterval == sampler->interval()); MOZ_ASSERT(mInstance->mInterval == sampler->interval());
} }
} }
@ -306,13 +306,13 @@ private:
SamplerThread* SamplerThread::mInstance = NULL; SamplerThread* SamplerThread::mInstance = NULL;
void Sampler::Start() { void Sampler::Start() {
ASSERT(!IsActive()); MOZ_ASSERT(!IsActive());
SetActive(true); SetActive(true);
SamplerThread::StartSampler(this); SamplerThread::StartSampler(this);
} }
void Sampler::Stop() { void Sampler::Stop() {
ASSERT(IsActive()); MOZ_ASSERT(IsActive());
SetActive(false); SetActive(false);
SamplerThread::StopSampler(); SamplerThread::StopSampler();
} }

Просмотреть файл

@ -840,7 +840,7 @@ profiler_stop()
if (disableJS) { if (disableJS) {
PseudoStack *stack = tlsPseudoStack.get(); PseudoStack *stack = tlsPseudoStack.get();
ASSERT(stack != nullptr); MOZ_ASSERT(stack != nullptr);
stack->disableJSSampling(); stack->disableJSSampling();
} }

Просмотреть файл

@ -75,8 +75,6 @@ static inline pid_t gettid()
#include <windows.h> #include <windows.h>
#endif #endif
#define ASSERT(a) MOZ_ASSERT(a)
bool profiler_verbose(); bool profiler_verbose();
#ifdef ANDROID #ifdef ANDROID