Commits

Andrew Sutherland committed a5400e1

uintn folded into add-jsprobemgr-class, with some chnages to js-runtime-fixups

Comments (0)

Files changed (6)

add-jsprobemgr-class

 # HG changeset patch
-# Parent bfb30c5e7f0b6bbc15cfbb4e45b66e01b7fe5fd8
+# Parent 89a1c6c6158ca50dd17b8562a54fb7d995f83372
 Add the ProbeManager class.
 
 diff --git a/js/src/Makefile.in b/js/src/Makefile.in
 --- a/js/src/Makefile.in
 +++ b/js/src/Makefile.in
-@@ -131,16 +131,17 @@ CPPSRCS		= \
- 		jsnum.cpp \
- 		jsobj.cpp \
- 		json.cpp \
- 		jsonparser.cpp \
- 		jsopcode.cpp \
+@@ -135,6 +135,7 @@
  		jsproxy.cpp \
  		jsprf.cpp \
  		jsprobedefs.cpp \
  		jsprobes.cpp \
  		jspropertycache.cpp \
  		jspropertytree.cpp \
- 		jsreflect.cpp \
- 		jsscope.cpp \
- 		jsscript.cpp \
- 		jsstr.cpp \
- 		jstypedarray.cpp \
-@@ -196,16 +197,17 @@ INSTALLED_HEADERS = \
- 		jscell.h \
- 		jsgcstats.h \
- 		jshash.h \
- 		jslock.h \
- 		json.h \
+@@ -202,6 +203,7 @@
  		jsproxy.h \
  		jsprf.h \
  		jsprobedefs.h \
  		jsprobes.tbl \
  		jsproto.tbl \
  		jsprvtd.h \
- 		jspubtd.h \
- 		jstypedarray.h \
- 		jstypes.h \
- 		jsutil.h \
- 		jsversion.h \
 diff --git a/js/src/jsprobedefs.cpp b/js/src/jsprobedefs.cpp
 --- a/js/src/jsprobedefs.cpp
 +++ b/js/src/jsprobedefs.cpp
-@@ -228,17 +228,17 @@ js::Value
- deserialize_intptr_t(JSContext *cx, ProbeValue v)
- {
-     return js::DoubleValue((double)v.data.as_intptr_t);
- }
- 
+@@ -233,7 +233,7 @@
  js::Value
  deserialize_int(JSContext *cx, ProbeValue v)
  {
          return js::DoubleValue((double)v.data.as_int);
      else
          return js::Int32Value(v.data.as_int);
- }
- 
- js::Value
- deserialize_double(JSContext *cx, ProbeValue v)
- {
 diff --git a/js/src/jsprobemgr.cpp b/js/src/jsprobemgr.cpp
 new file mode 100644
 --- /dev/null
 +static JSBool ItemBuilder_initItem(JSContext *cx, JSObject *obj, 
 +                                   ProbePoint probe, int argn);
 +static JSBool OrderBuilder_initOrder(JSContext *cx, JSObject *obj, PickOrder *order);
-+static JSBool OrderBuilder_call(JSContext *cx, uintN argc, jsval *vp);
++static JSBool OrderBuilder_call(JSContext *cx, unsigned argc, jsval *vp);
 +
-+static JSBool script_postMessage(JSContext *cx, uintN argc, jsval *vp);
++static JSBool script_postMessage(JSContext *cx, unsigned argc, jsval *vp);
 +
 +static PickOrder *createOrderFromSpec(JSContext *cx, ProbePoint probe,
 +                                      ScriptDescriptor &specInfo);
 +   and add it to the current PickOrder. */
 +
 +JSBool
-+OrderBuilder_call(JSContext *cx, uintN argc, jsval *vp)
++OrderBuilder_call(JSContext *cx, unsigned argc, jsval *vp)
 +{
 +    PickOrder *order;
 +    PickItem *item;
 +}
 +
 +JSBool
-+script_postMessage(JSContext *cx, uintN argc, jsval *vp)
++script_postMessage(JSContext *cx, unsigned argc, jsval *vp)
 +{
 +    ProbeManager *mgr = static_cast<ProbeManager *>(JS_GetContextPrivate(cx));
 +    JS_ASSERT(mgr != NULL);
 +createOrderFromSpec(JSContext *cx, ProbePoint probe, ScriptDescriptor &specInfo)
 +{
 +    /* extra args for OrderBuilder instance, env vars */
-+    uintN argc = 1 + ProbePointData[GLOBAL_PROBE_ARGS].argc + ProbePointData[probe].argc;
-+    uintN curOffset = 0;
++    unsigned argc = 1 + ProbePointData[GLOBAL_PROBE_ARGS].argc + ProbePointData[probe].argc;
++    uint32_t curOffset = 0;
 +    const char **argNames;
 +    jsval *args;
 +    PickOrder *order;
 +};
 +
 +static const JSErrorFormatString *
-+my_GetErrorMessage(void *userRef, const char *locale, const uintN errorNumber);
++my_GetErrorMessage(void *userRef, const char *locale, const unsigned errorNumber);
 +
 +typedef enum JSErrNum {
 +#define MSG_DEF(name, number, count, exception, format)                        \
 +}
 +
 +static JSBool
-+Print(JSContext *cx, uintN argc, jsval *vp)
++Print(JSContext *cx, unsigned argc, jsval *vp)
 +{
 +    jsval *argv;
-+    uintN i;
++    unsigned i;
 +    JSString *str;
 +    char *bytes;
 +
 +}
 +
 +JSBool
-+Serialize(JSContext *cx, uintN argc, jsval *vp)
++Serialize(JSContext *cx, unsigned argc, jsval *vp)
 +{
 +    jsval v = argc > 0 ? JS_ARGV(cx, vp)[0] : JSVAL_VOID;
 +    uint64_t *datap;
 +}
 +
 +JSBool
-+Deserialize(JSContext *cx, uintN argc, jsval *vp)
++Deserialize(JSContext *cx, unsigned argc, jsval *vp)
 +{
 +    jsval v = argc > 0 ? JS_ARGV(cx, vp)[0] : JSVAL_VOID;
 +    JSObject *obj;
 +};
 +
 +static const JSErrorFormatString *
-+my_GetErrorMessage(void *userRef, const char *locale, const uintN errorNumber)
++my_GetErrorMessage(void *userRef, const char *locale, const unsigned errorNumber)
 +{
 +    if ((errorNumber > 0) && (errorNumber < JSErr_Limit))
 +        return &js_ErrorFormatString[errorNumber];
 +           this item is for a global arg */
 +        int offset = ((*it)->probe == GLOBAL_PROBE_ARGS) ? argn + ProbePointData[probe].argc : argn;
 +        jsval curObj = argv[offset];
-+        uintN transformCount = (*it)->transforms.size();
++        unsigned transformCount = (*it)->transforms.size();
 +
 +        /* corner case: there are no transforms (i.e., we are unpacking an actual arg to the probe) */
 +        if (transformCount == 0) {
 +            continue;
 +        }
 +
-+        for (uintN i = 0; i < transformCount; i++) {
++        for (unsigned i = 0; i < transformCount; i++) {
 +            ProbeTransform curTransform = (*it)->transforms[i];
 +            const char *nextPropName = ProbeFunctionData[curTransform].api_name;
 +            JSBool propExists;
 +    JSObject *globalObj;
 +    PickOrder *order;
 +    const char **argnames;
-+    uintN argc = ProbePointData[probe].argc + ProbePointData[GLOBAL_PROBE_ARGS].argc;
++    unsigned argc = ProbePointData[probe].argc + ProbePointData[GLOBAL_PROBE_ARGS].argc;
 +
 +    globalObj = JS_GetGlobalObject(adminCx);
 +    JS_ASSERT(globalObj != NULL);
 +    const jschar *body;
 +    size_t length;
 +    const char *filename;
-+    uintN lineno;
++    uint32_t lineno;
 +};
 +
 +struct HandlerDescriptor {

jetpack-scriptcontext-naked-jscontext

 # HG changeset patch
-# Parent 9af83a523235c7ec4adfd6d7e75815c5f419521c
+# Parent 6a8655ceb5021e8e16e59c277d2933d73195a97f
 
 diff --git a/toolkit/components/probes/ProbeService.cpp b/toolkit/components/probes/ProbeService.cpp
 --- a/toolkit/components/probes/ProbeService.cpp

js-runtime-fixups

 # HG changeset patch
-# Parent 897717105735a2735498e89381eb00ff2ff3d80b
+# Parent bda0a18e2ea44ff94454a7ebe6fefed790b3e962
 
 diff --git a/js/src/jsprobemgr.cpp b/js/src/jsprobemgr.cpp
 --- a/js/src/jsprobemgr.cpp
 +    jschar *mBody;
 +    size_t mBodyLength;
 +    char *mFilename;
-+    uintN mLineno;
++    uint32_t mLineno;
      ScriptCookie mCookie;
  
 -    static RunScriptEvent *create(JSScript *script, ScriptCookie cookie) {
 +    JSObject   *handlerFunObj;
 +    /* the script info to be used to compile handlerFun */
 +    ScriptDescriptor handlerDef;
-+    uintN argc;
++    unsigned argc;
 +    const char **argnames;
      ProbePoint probe;
      PickOrder *order;

jsprobes-dispatch-integration

 # HG changeset patch
-# Parent 04e45a2565c931e0251cee71f3299d05477116a0
+# Parent 2f1255e1bd6628c8e3fab895e0bd15af8987161c
 integrate ProbeManager with jsprobes.h and the js shell (js.cpp)
 
 diff --git a/js/src/gc/Statistics.cpp b/js/src/gc/Statistics.cpp
 --- a/js/src/gc/Statistics.cpp
 +++ b/js/src/gc/Statistics.cpp
-@@ -250,13 +250,13 @@
+@@ -256,13 +256,13 @@
      slices.clearAndFree();
-     wasReset = false;
+     nonincrementalReason = NULL;
  
 -    Probes::GCStart();
 +    Probes::GCStart(runtime, compartment);
 js-run-probes
 provide-all-compartment-ptrs
 jetpack-scriptcontext-naked-jscontext
-uintn
 
 
 

uintn

-# HG changeset patch
-# Parent 2a5105beb48d8558c21e40e3d2711db3038cdd1e
-
-diff --git a/js/src/jsprobemgr.cpp b/js/src/jsprobemgr.cpp
---- a/js/src/jsprobemgr.cpp
-+++ b/js/src/jsprobemgr.cpp
-@@ -143,9 +143,9 @@
- static JSBool ItemBuilder_initItem(JSContext *cx, JSObject *obj, 
-                                    ProbePoint probe, int argn);
- static JSBool OrderBuilder_initOrder(JSContext *cx, JSObject *obj, PickOrder *order);
--static JSBool OrderBuilder_call(JSContext *cx, uintN argc, jsval *vp);
-+static JSBool OrderBuilder_call(JSContext *cx, unsigned argc, jsval *vp);
- 
--static JSBool script_postMessage(JSContext *cx, uintN argc, jsval *vp);
-+static JSBool script_postMessage(JSContext *cx, unsigned argc, jsval *vp);
- 
- static PickOrder *createOrderFromSpec(JSContext *cx, ProbePoint probe,
-                                       ScriptDescriptor &specInfo);
-@@ -342,7 +342,7 @@
-    and add it to the current PickOrder. */
- 
- JSBool
--OrderBuilder_call(JSContext *cx, uintN argc, jsval *vp)
-+OrderBuilder_call(JSContext *cx, unsigned argc, jsval *vp)
- {
-     PickOrder *order;
-     PickItem *item;
-@@ -521,7 +521,7 @@
- }
- 
- JSBool
--script_postMessage(JSContext *cx, uintN argc, jsval *vp)
-+script_postMessage(JSContext *cx, unsigned argc, jsval *vp)
- {
-     ProbeManager *mgr = static_cast<ProbeManager *>(JS_GetContextPrivate(cx));
-     JS_ASSERT(mgr != NULL);
-@@ -551,8 +551,8 @@
- createOrderFromSpec(JSContext *cx, ProbePoint probe, ScriptDescriptor &specInfo)
- {
-     /* extra args for OrderBuilder instance, env vars */
--    uintN argc = 1 + ProbePointData[GLOBAL_PROBE_ARGS].argc + ProbePointData[probe].argc;
--    uintN curOffset = 0;
-+    unsigned argc = 1 + ProbePointData[GLOBAL_PROBE_ARGS].argc + ProbePointData[probe].argc;
-+    uint32_t curOffset = 0;
-     const char **argNames;
-     jsval *args;
-     PickOrder *order;
-@@ -791,7 +791,7 @@
-     jschar *mBody;
-     size_t mBodyLength;
-     char *mFilename;
--    uintN mLineno;
-+    uint32_t mLineno;
-     ScriptCookie mCookie;
- 
-     static RunScriptEvent *create(const ScriptDescriptor &fdesc, ScriptCookie cookie) {
-@@ -890,7 +890,7 @@
- };
- 
- static const JSErrorFormatString *
--my_GetErrorMessage(void *userRef, const char *locale, const uintN errorNumber);
-+my_GetErrorMessage(void *userRef, const char *locale, const unsigned errorNumber);
- 
- typedef enum JSErrNum {
- #define MSG_DEF(name, number, count, exception, format)                        \
-@@ -923,10 +923,10 @@
- }
- 
- static JSBool
--Print(JSContext *cx, uintN argc, jsval *vp)
-+Print(JSContext *cx, unsigned argc, jsval *vp)
- {
-     jsval *argv;
--    uintN i;
-+    unsigned i;
-     JSString *str;
-     char *bytes;
- 
-@@ -950,7 +950,7 @@
- }
- 
- JSBool
--Serialize(JSContext *cx, uintN argc, jsval *vp)
-+Serialize(JSContext *cx, unsigned argc, jsval *vp)
- {
-     jsval v = argc > 0 ? JS_ARGV(cx, vp)[0] : JSVAL_VOID;
-     uint64_t *datap;
-@@ -972,7 +972,7 @@
- }
- 
- JSBool
--Deserialize(JSContext *cx, uintN argc, jsval *vp)
-+Deserialize(JSContext *cx, unsigned argc, jsval *vp)
- {
-     jsval v = argc > 0 ? JS_ARGV(cx, vp)[0] : JSVAL_VOID;
-     JSObject *obj;
-@@ -1006,7 +1006,7 @@
- };
- 
- static const JSErrorFormatString *
--my_GetErrorMessage(void *userRef, const char *locale, const uintN errorNumber)
-+my_GetErrorMessage(void *userRef, const char *locale, const unsigned errorNumber)
- {
-     if ((errorNumber > 0) && (errorNumber < JSErr_Limit))
-         return &js_ErrorFormatString[errorNumber];
-@@ -1387,7 +1387,7 @@
-            this item is for a global arg */
-         int offset = ((*it)->probe == GLOBAL_PROBE_ARGS) ? argn + ProbePointData[probe].argc : argn;
-         jsval curObj = argv[offset];
--        uintN transformCount = (*it)->transforms.size();
-+        unsigned transformCount = (*it)->transforms.size();
- 
-         /* corner case: there are no transforms (i.e., we are unpacking an actual arg to the probe) */
-         if (transformCount == 0) {
-@@ -1395,7 +1395,7 @@
-             continue;
-         }
- 
--        for (uintN i = 0; i < transformCount; i++) {
-+        for (unsigned i = 0; i < transformCount; i++) {
-             ProbeTransform curTransform = (*it)->transforms[i];
-             const char *nextPropName = ProbeFunctionData[curTransform].api_name;
-             JSBool propExists;
-@@ -1518,7 +1518,7 @@
-     JSObject *globalObj;
-     PickOrder *order;
-     const char **argnames;
--    uintN argc = ProbePointData[probe].argc + ProbePointData[GLOBAL_PROBE_ARGS].argc;
-+    unsigned argc = ProbePointData[probe].argc + ProbePointData[GLOBAL_PROBE_ARGS].argc;
- 
-     globalObj = JS_GetGlobalObject(adminCx);
-     JS_ASSERT(globalObj != NULL);
-diff --git a/js/src/jsprobemgr.h b/js/src/jsprobemgr.h
---- a/js/src/jsprobemgr.h
-+++ b/js/src/jsprobemgr.h
-@@ -58,7 +58,7 @@
-     const jschar *body;
-     size_t length;
-     const char *filename;
--    uintN lineno;
-+    uint32_t lineno;
- };
- 
- struct HandlerDescriptor {
-@@ -68,7 +68,7 @@
-     JSObject   *handlerFunObj;
-     /* the script info to be used to compile handlerFun */
-     ScriptDescriptor handlerDef;
--    uintN argc;
-+    unsigned argc;
-     const char **argnames;
-     ProbePoint probe;
-     PickOrder *order;