Bug 586362 - xpcshell: gczeal() doesn't work in the content process. r=bent a=bsmedberg
☠☠ backed out by 3dee85f9ce3a ☠ ☠
authorJosh Matthews <josh@joshmatthews.net>
Wed, 11 Aug 2010 13:45:00 -0400
changeset 58094 1d4e3afd67e718a036aa7ef9cb99a95284de16c8
parent 58093 43a10e7fbef398cd9d629e7cb094f01a5eb175ab
child 58095 9fb7937e306d2b2c9fb35d96b1d9396acade8dde
child 58097 3dee85f9ce3a84613261de0ec83301ddf83ddf5f
push id17153
push userjmatthews@mozilla.com
push dateTue, 23 Nov 2010 20:49:49 +0000
treeherdermozilla-central@5538d32b4fae [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbent, bsmedberg
bugs586362
milestone2.0b8pre
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 586362 - xpcshell: gczeal() doesn't work in the content process. r=bent a=bsmedberg
ipc/testshell/XPCShellEnvironment.cpp
--- a/ipc/testshell/XPCShellEnvironment.cpp
+++ b/ipc/testshell/XPCShellEnvironment.cpp
@@ -422,16 +422,33 @@ GC(JSContext *cx,
            );
 #ifdef JS_GCMETER
     js_DumpGCStats(rt, stdout);
 #endif
     JS_SET_RVAL(cx, vp, JSVAL_VOID);
     return JS_TRUE;
 }
 
+#ifdef JS_GC_ZEAL
+static JSBool
+GCZeal(JSContext *cx,
+       JSObject *obj,
+       uintN argc,
+       jsval *argv,
+       jsval *rval)
+{
+  uint32 zeal;
+  if (!JS_ValueToECMAUint32(cx, argv[0], &zeal))
+    return JS_FALSE;
+
+  JS_SetGCZeal(cx, (PRUint8)zeal);
+  return JS_TRUE;
+}
+#endif
+
 #ifdef DEBUG
 
 static JSBool
 DumpHeap(JSContext *cx,
          uintN argc,
          jsval *vp)
 {
     JSAutoByteString fileName;
@@ -536,16 +553,19 @@ JSFunctionSpec gGlobalFunctions[] =
     {"print",           Print,          0,0},
     {"load",            Load,           1,0},
     {"quit",            Quit,           0,0},
     {"version",         Version,        1,0},
     {"build",           BuildDate,      0,0},
     {"dumpXPC",         DumpXPC,        1,0},
     {"dump",            Dump,           1,0},
     {"gc",              GC,             0,0},
+#ifdef JS_GC_ZEAL
+    {"gczeal",          GCZeal,         1,0},
+#endif
     {"clear",           Clear,          1,0},
 #ifdef DEBUG
     {"dumpHeap",        DumpHeap,       5,0},
 #endif
 #ifdef MOZ_SHARK
     {"startShark",      js_StartShark,      0,0},
     {"stopShark",       js_StopShark,       0,0},
     {"connectShark",    js_ConnectShark,    0,0},