Merge backout a=test-bustage
authorJosh Matthews <josh@joshmatthews.net>
Sat, 11 Sep 2010 21:05:46 -0400
changeset 53648 0f98f549bc00128957e99ff4bc7a03d9d486846d
parent 53647 4651348911d213c4eef60f09f15c5cc85cc938c2 (current diff)
parent 53646 8a6a5cf00da73adce5261d20d3eea79d58fda6ee (diff)
child 53649 8afc7bd2f49551918fb2bd0ec00b2314ee627e57
push idunknown
push userunknown
push dateunknown
reviewerstest-bustage
milestone2.0b6pre
Merge backout a=test-bustage
--- a/dom/base/nsJSEnvironment.cpp
+++ b/dom/base/nsJSEnvironment.cpp
@@ -3216,18 +3216,17 @@ IsJProfAction(struct sigaction *action)
     return (action->sa_sigaction &&
             action->sa_flags == (SA_RESTART | SA_SIGINFO));
 }
 
 void NS_JProfStartProfiling();
 void NS_JProfStopProfiling();
 
 static JSBool
-JProfStartProfilingJS(JSContext *cx, JSObject *obj,
-                      uintN argc, jsval *argv, jsval *rval)
+JProfStartProfilingJS(JSContext *cx, uintN argc, jsval *vp)
 {
   NS_JProfStartProfiling();
   return JS_TRUE;
 }
 
 void NS_JProfStartProfiling()
 {
     // Figure out whether we're dealing with SIGPROF, SIGALRM, or
@@ -3255,18 +3254,17 @@ void NS_JProfStartProfiling()
         raise(SIGPOLL);
         return;
     }
 
     printf("Could not start jprof-profiling since JPROF_FLAGS was not set.\n");
 }
 
 static JSBool
-JProfStopProfilingJS(JSContext *cx, JSObject *obj,
-                     uintN argc, jsval *argv, jsval *rval)
+JProfStopProfilingJS(JSContext *cx, uintN argc, jsval *vp)
 {
   NS_JProfStopProfiling();
   return JS_TRUE;
 }
 
 void
 NS_JProfStopProfiling()
 {
--- a/js/src/jsdbgapi.cpp
+++ b/js/src/jsdbgapi.cpp
@@ -1986,18 +1986,17 @@ static const char *vtuneErrorMessages[] 
   "sampling file already bound",
   "invalid event path",
   "invalid license",
   "invalid 'global options' field",
 
 };
 
 JS_FRIEND_API(JSBool)
-js_StartVtune(JSContext *cx, JSObject *obj,
-              uintN argc, jsval *argv, jsval *rval)
+js_StartVtune(JSContext *cx, uintN argc, jsval *vp)
 {
     VTUNE_EVENT events[] = {
         { 1000000, 0, 0, 0, "CPU_CLK_UNHALTED.CORE" },
         { 1000000, 0, 0, 0, "INST_RETIRED.ANY" },
     };
 
     U32 n_events = sizeof(events) / sizeof(VTUNE_EVENT);
     char *default_filename = "mozilla-vtune.tb5";
@@ -2014,16 +2013,17 @@ js_StartVtune(JSContext *cx, JSObject *o
         0.1,  /* Sampling interval in ms */
         1,    /* 1 for event-based sampling, 0 for time-based */
 
         n_events,
         events,
         default_filename,
     };
 
+    jsval *argv = JS_ARGV(cx, vp);
     if (argc > 0 && JSVAL_IS_STRING(argv[0])) {
         str = JSVAL_TO_STRING(argv[0]);
         params.tb5Filename = js_DeflateString(cx, str->chars(), str->length());
     }
 
     status = VTStartSampling(&params);
 
     if (params.tb5Filename != default_filename)
@@ -2039,43 +2039,40 @@ js_StartVtune(JSContext *cx, JSObject *o
             JS_ReportError(cx, "Vtune setup error: %d",
                            status);
         return JS_FALSE;
     }
     return JS_TRUE;
 }
 
 JS_FRIEND_API(JSBool)
-js_StopVtune(JSContext *cx, JSObject *obj,
-             uintN argc, jsval *argv, jsval *rval)
+js_StopVtune(JSContext *cx, uintN argc, jsval *vp)
 {
     U32 status = VTStopSampling(1);
     if (status) {
         if (status < sizeof(vtuneErrorMessages))
             JS_ReportError(cx, "Vtune shutdown error: %s",
                            vtuneErrorMessages[status]);
         else
             JS_ReportError(cx, "Vtune shutdown error: %d",
                            status);
         return JS_FALSE;
     }
     return JS_TRUE;
 }
 
 JS_FRIEND_API(JSBool)
-js_PauseVtune(JSContext *cx, JSObject *obj,
-              uintN argc, jsval *argv, jsval *rval)
+js_PauseVtune(JSContext *cx, uintN argc, jsval *vp)
 {
     VTPause();
     return JS_TRUE;
 }
 
 JS_FRIEND_API(JSBool)
-js_ResumeVtune(JSContext *cx, JSObject *obj,
-               uintN argc, jsval *argv, jsval *rval)
+js_ResumeVtune(JSContext *cx, uintN argc, jsval *vp)
 {
     VTResume();
     return JS_TRUE;
 }
 
 #endif /* MOZ_VTUNE */
 
 #ifdef MOZ_TRACEVIS
@@ -2093,18 +2090,17 @@ js_ResumeVtune(JSContext *cx, JSObject *
 #else
 #include <sys/time.h>
 #endif
 #include "jstracer.h"
 
 #define ETHOGRAM_BUF_SIZE 65536
 
 static JSBool
-ethogram_construct(JSContext *cx, JSObject *obj,
-                   uintN argc, jsval *argv, jsval *rval);
+ethogram_construct(JSContext *cx, uintN argc, jsval *vp);
 static void
 ethogram_finalize(JSContext *cx, JSObject *obj);
 
 static JSClass ethogram_class = {
     "Ethogram",
     JSCLASS_HAS_PRIVATE,
     JS_PropertyStub, JS_PropertyStub, JS_PropertyStub, JS_PropertyStub,
     JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub, ethogram_finalize,
@@ -2139,18 +2135,17 @@ private:
         JSString *jsfilename;
 
         EthogramScriptEntry *next;
     };
     EthogramScriptEntry *mScripts;
 
 public:
     friend JSBool
-    ethogram_construct(JSContext *cx, JSObject *obj,
-                       uintN argc, jsval *argv, jsval *rval);
+    ethogram_construct(JSContext *cx, uintN argc, jsval *vp);
 
     inline void push(TraceVisState s, TraceVisExitReason r, char *filename, int lineno) {
         mBuf[mWritePos].s = s;
         mBuf[mWritePos].r = r;
 #if defined(XP_WIN)
         FILETIME now;
         GetSystemTimeAsFileTime(&now);
         unsigned long long raw_us = 0.1 *
@@ -2283,18 +2278,17 @@ js::StoreTraceVisState(JSContext *cx, Tr
         EthogramEventBuffer *p;
         p = (EthogramEventBuffer *) he->value;
 
         p->push(s, r, script_file, jstv_Lineno(cx, fp));
     }
 }
 
 static JSBool
-ethogram_construct(JSContext *cx, JSObject *obj,
-                   uintN argc, jsval *argv, jsval *rval)
+ethogram_construct(JSContext *cx, uintN argc, jsval *vp)
 {
     EthogramEventBuffer *p;
 
     p = (EthogramEventBuffer *) JS_malloc(cx, sizeof(EthogramEventBuffer));
 
     p->mReadPos = p->mWritePos = 0;
     p->mScripts = NULL;
     p->mFilenames = JS_NewArrayObject(cx, 0, NULL);
@@ -2316,17 +2310,17 @@ ethogram_construct(JSContext *cx, JSObje
     if (!JS_DefineProperty(cx, obj, "filenames", filenames,
                            NULL, NULL, JSPROP_READONLY|JSPROP_PERMANENT))
         return JS_FALSE;
 
     if (!JS_IsConstructing(cx)) {
         obj = JS_NewObject(cx, &ethogram_class, NULL, NULL);
         if (!obj)
             return JS_FALSE;
-        *rval = OBJECT_TO_JSVAL(obj);
+        *JS_RVAL(cx, vp) = OBJECT_TO_JSVAL(obj);
     }
     JS_SetPrivate(cx, obj, p);
     return JS_TRUE;
 }
 
 static void
 ethogram_finalize(JSContext *cx, JSObject *obj)
 {
@@ -2336,49 +2330,51 @@ ethogram_finalize(JSContext *cx, JSObjec
         return;
 
     p->removeScripts(cx);
 
     JS_free(cx, p);
 }
 
 static JSBool
-ethogram_addScript(JSContext *cx, JSObject *obj,
-                   uintN argc, jsval *argv, jsval *rval)
+ethogram_addScript(JSContext *cx, uintN argc, jsval *vp)
 {
     JSString *str;
     char *filename = NULL;
+    jsval *argv = JS_ARGV(cx, vp);
     if (argc > 0 && JSVAL_IS_STRING(argv[0])) {
         str = JSVAL_TO_STRING(argv[0]);
         filename = js_DeflateString(cx,
                                     str->chars(),
                                     str->length());
     }
 
     /* silently ignore no args */
     if (!filename)
         return JS_TRUE;
 
     EthogramEventBuffer *p = (EthogramEventBuffer *) JS_GetInstancePrivate(cx, obj, &ethogram_class, argv);
 
     p->addScript(cx, obj, filename, str);
+    jsval *rval = JS_RVAL(cx, vp);
     JS_CallFunctionName(cx, p->filenames(), "push", 1, argv, rval);
     return JS_TRUE;
 }
 
 static JSBool
-ethogram_getAllEvents(JSContext *cx, JSObject *obj,
-                      uintN argc, jsval *argv, jsval *rval)
+ethogram_getAllEvents(JSContext *cx, uintN argc, jsval *vp)
 {
     EthogramEventBuffer *p;
 
+    jsval *argv = JS_ARGV(cx, vp);
     p = (EthogramEventBuffer *) JS_GetInstancePrivate(cx, obj, &ethogram_class, argv);
     if (!p)
         return JS_FALSE;
 
+    jsval *rval = JS_RVAL(cx, vp);
     if (p->isEmpty()) {
         *rval = JSVAL_NULL;
         return JS_TRUE;
     }
 
     JSObject *rarray = JS_NewArrayObject(cx, 0, NULL);
     if (rarray == NULL) {
         *rval = JSVAL_NULL;
@@ -2420,29 +2416,30 @@ ethogram_getAllEvents(JSContext *cx, JSO
         jsval element = OBJECT_TO_JSVAL(x);
         JS_SetElement(cx, rarray, i, &element);
     }
 
     return JS_TRUE;
 }
 
 static JSBool
-ethogram_getNextEvent(JSContext *cx, JSObject *obj,
-                      uintN argc, jsval *argv, jsval *rval)
+ethogram_getNextEvent(JSContext *cx, uintN argc, jsval *vp)
 {
     EthogramEventBuffer *p;
 
+    jsval *argv = JS_ARGV(cx, vp);
     p = (EthogramEventBuffer *) JS_GetInstancePrivate(cx, obj, &ethogram_class, argv);
     if (!p)
         return JS_FALSE;
 
     JSObject *x = JS_NewObject(cx, NULL, NULL, NULL);
     if (x == NULL)
         return JS_FALSE;
 
+    jsval *rval = JS_RVAL(cx, vp);
     if (p->isEmpty()) {
         *rval = JSVAL_NULL;
         return JS_TRUE;
     }
 
     EthogramEvent *e = p->pop();
     jsval state = INT_TO_JSVAL(e->s);
     jsval reason = INT_TO_JSVAL(e->r);
@@ -2478,34 +2475,32 @@ static JSFunctionSpec ethogram_methods[]
     {0}
 };
 
 /*
  * An |Ethogram| organizes the output of a collection of files that should be
  * monitored together. A single object gets events for the group.
  */
 JS_FRIEND_API(JSBool)
-js_InitEthogram(JSContext *cx, JSObject *obj,
-                uintN argc, jsval *argv, jsval *rval)
+js_InitEthogram(JSContext *cx, uintN argc, jsval *vp)
 {
     if (!traceVisScriptTable) {
         traceVisScriptTable = JS_NewHashTable(8, JS_HashString, compare_strings,
                                          NULL, NULL, NULL);
     }
 
     JS_InitClass(cx, JS_GetGlobalObject(cx), NULL, &ethogram_class,
                  ethogram_construct, 0, NULL, ethogram_methods,
                  NULL, NULL);
 
     return JS_TRUE;
 }
 
 JS_FRIEND_API(JSBool)
-js_ShutdownEthogram(JSContext *cx, JSObject *obj,
-                    uintN argc, jsval *argv, jsval *rval)
+js_ShutdownEthogram(JSContext *cx, uintN argc, jsval *vp)
 {
     if (traceVisScriptTable)
         JS_HashTableDestroy(traceVisScriptTable);
 
     return JS_TRUE;
 }
 
 #endif /* MOZ_TRACEVIS */
--- a/js/src/jsdbgapi.h
+++ b/js/src/jsdbgapi.h
@@ -541,37 +541,31 @@ js_StartCallgrind(JSContext *cx, uintN a
 extern JS_FRIEND_API(JSBool)
 js_DumpCallgrind(JSContext *cx, uintN argc, jsval *vp);
 
 #endif /* MOZ_CALLGRIND */
 
 #ifdef MOZ_VTUNE
 
 extern JS_FRIEND_API(JSBool)
-js_StartVtune(JSContext *cx, JSObject *obj, uintN argc, jsval *argv,
-              jsval *rval);
+js_StartVtune(JSContext *cx, uintN argc, jsval *vp);
 
 extern JS_FRIEND_API(JSBool)
-js_StopVtune(JSContext *cx, JSObject *obj, uintN argc, jsval *argv,
-             jsval *rval);
+js_StopVtune(JSContext *cx, uintN argc, jsval *vp);
 
 extern JS_FRIEND_API(JSBool)
-js_PauseVtune(JSContext *cx, JSObject *obj, uintN argc, jsval *argv,
-              jsval *rval);
+js_PauseVtune(JSContext *cx, uintN argc, jsval *vp);
 
 extern JS_FRIEND_API(JSBool)
-js_ResumeVtune(JSContext *cx, JSObject *obj, uintN argc, jsval *argv,
-               jsval *rval);
+js_ResumeVtune(JSContext *cx, uintN argc, jsval *vp);
 
 #endif /* MOZ_VTUNE */
 
 #ifdef MOZ_TRACEVIS
 extern JS_FRIEND_API(JSBool)
-js_InitEthogram(JSContext *cx, JSObject *obj,
-                uintN argc, jsval *argv, jsval *rval);
+js_InitEthogram(JSContext *cx, uintN argc, jsval *vp);
 extern JS_FRIEND_API(JSBool)
-js_ShutdownEthogram(JSContext *cx, JSObject *obj,
-                    uintN argc, jsval *argv, jsval *rval);
+js_ShutdownEthogram(JSContext *cx, uintN argc, jsval *vp);
 #endif /* MOZ_TRACEVIS */
 
 JS_END_EXTERN_C
 
 #endif /* jsdbgapi_h___ */