diff --git a/js/src/jsprobes.cpp b/js/src/jsprobes.cpp index c75c0c1753c..879ca94744b 100644 --- a/js/src/jsprobes.cpp +++ b/js/src/jsprobes.cpp @@ -65,13 +65,13 @@ bool Probes::controlProfilers(JSContext *cx, bool toState) { JSBool ok = JS_TRUE; -#if defined(MOZ_SHARK) || defined(MOZ_CALLGRIND) || defined(MOZ_VTUNE) +#if defined(MOZ_CALLGRIND) || defined(MOZ_VTUNE) jsval dummy; #endif if (! ProfilingActive && toState) { -#ifdef MOZ_SHARK - if (! js_StartShark(cx, 0, &dummy)) +#if defined(MOZ_SHARK) && defined(__APPLE__) + if (!Shark::Start()) ok = JS_FALSE; #endif #ifdef MOZ_CALLGRIND @@ -83,9 +83,8 @@ Probes::controlProfilers(JSContext *cx, bool toState) ok = JS_FALSE; #endif } else if (ProfilingActive && ! toState) { -#ifdef MOZ_SHARK - if (! js_StopShark(cx, 0, &dummy)) - ok = JS_FALSE; +#if defined(MOZ_SHARK) && defined(__APPLE__) + Shark::Stop(); #endif #ifdef MOZ_CALLGRIND if (! js_StopCallgrind(cx, 0, &dummy)) @@ -167,7 +166,7 @@ Probes::handleFunctionReturn(JSContext *cx, JSFunction *fun, JSScript *script) bool Probes::startProfiling() { -#ifdef MOZ_SHARK +#if defined(MOZ_SHARK) && defined(__APPLE__) if (Shark::Start()) return true; #endif @@ -177,7 +176,7 @@ Probes::startProfiling() void Probes::stopProfiling() { -#ifdef MOZ_SHARK +#if defined(MOZ_SHARK) && defined(__APPLE__) Shark::Stop(); #endif }