Bug 308429 - "make tooMuchGC dynamic (runtime gczeal option)". r+sr=jst, a=schrep.

git-svn-id: svn://10.0.0.236/trunk@239144 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
bent.mozilla%gmail.com
2007-11-11 18:59:28 +00:00
parent 6577b1feae
commit f140aa17e1

View File

@@ -998,7 +998,10 @@ nsJSContext::DOMBranchCallback(JSContext *cx, JSScript *script)
static const char js_options_dot_str[] = JS_OPTIONS_DOT_STR;
static const char js_strict_option_str[] = JS_OPTIONS_DOT_STR "strict";
static const char js_werror_option_str[] = JS_OPTIONS_DOT_STR "werror";
static const char js_relimit_option_str[] = JS_OPTIONS_DOT_STR "relimit";
static const char js_relimit_option_str[]= JS_OPTIONS_DOT_STR "relimit";
#ifdef JS_GC_ZEAL
static const char js_zeal_option_str[] = JS_OPTIONS_DOT_STR "gczeal";
#endif
int PR_CALLBACK
nsJSContext::JSOptionChangedCallback(const char *pref, void *data)
@@ -1046,6 +1049,13 @@ nsJSContext::JSOptionChangedCallback(const char *pref, void *data)
// Save the new defaults for the next page load (InitContext).
context->mDefaultJSOptions = newDefaultJSOptions;
}
#ifdef JS_GC_ZEAL
PRInt32 zeal = nsContentUtils::GetIntPref(js_zeal_option_str, -1);
if (zeal >= 0)
::JS_SetGCZeal(context->mContext, (PRUint8)zeal);
#endif
return 0;
}