Bug 671632 - Fix shark builds broken by bug 588537 (r=waldo)
authorSteve Fink <sfink@mozilla.com>
Fri, 15 Jul 2011 11:47:16 -0700
changeset 73692 bf955b263587172bfe1a0ce5c3f2df6473b1c20a
parent 73691 ff9c4941d4d5139167153fcfe6b99af115df7354
child 73693 2f5959074445fd93a59acf7e07910d2ac66c2089
push id235
push userbzbarsky@mozilla.com
push dateTue, 27 Sep 2011 17:13:04 +0000
treeherdermozilla-beta@2d1e082d176a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerswaldo
bugs671632, 588537
milestone8.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 671632 - Fix shark builds broken by bug 588537 (r=waldo)
js/src/jsprobes.cpp
--- a/js/src/jsprobes.cpp
+++ b/js/src/jsprobes.cpp
@@ -60,37 +60,36 @@ const char Probes::nullName[] = "(null)"
 const char Probes::anonymousName[] = "(anonymous)";
 
 bool Probes::ProfilingActive = true;
 
 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
         if (! js_StartCallgrind(cx, 0, &dummy))
             ok = JS_FALSE;
 #endif
 #ifdef MOZ_VTUNE
         if (! js_ResumeVtune(cx, 0, &dummy))
             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))
             ok = JS_FALSE;
 #endif
 #ifdef MOZ_VTUNE
         if (! js_PauseVtune(cx, 0, &dummy))
             ok = JS_FALSE;
@@ -162,22 +161,22 @@ Probes::handleFunctionReturn(JSContext *
                                FunctionName(cx, fun, &funNameBytes));
 }
 
 #endif
 
 bool
 Probes::startProfiling()
 {
-#ifdef MOZ_SHARK
+#if defined(MOZ_SHARK) && defined(__APPLE__)
     if (Shark::Start())
         return true;
 #endif
     return false;
 }
 
 void
 Probes::stopProfiling()
 {
-#ifdef MOZ_SHARK
+#if defined(MOZ_SHARK) && defined(__APPLE__)
     Shark::Stop();
 #endif
 }