From cb6853e93fa84ddd4ef2bc7f7ccd7d455ed67891 Mon Sep 17 00:00:00 2001 From: Josh Matthews Date: Wed, 11 Aug 2010 13:45:00 -0400 Subject: [PATCH] Bug 586362 - Add gczeal to content process xpcshell. r=bent --- ipc/testshell/XPCShellEnvironment.cpp | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/ipc/testshell/XPCShellEnvironment.cpp b/ipc/testshell/XPCShellEnvironment.cpp index de0d2c1a4bec..a046f15fe9b2 100644 --- a/ipc/testshell/XPCShellEnvironment.cpp +++ b/ipc/testshell/XPCShellEnvironment.cpp @@ -429,6 +429,23 @@ GC(JSContext *cx, return JS_TRUE; } +#ifdef JS_GC_ZEAL +static JSBool +GCZeal(JSContext *cx, + uintN argc, + jsval *vp) +{ + jsval* argv = JS_ARGV(cx, vp); + + 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 @@ -543,6 +560,9 @@ JSFunctionSpec gGlobalFunctions[] = {"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},