mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-01-27 15:55:16 +00:00
Bug 832425 - gcPreserveCode() should be defined when not using JS_GC_ZEAL, r=h4writer.
This commit is contained in:
parent
89e5bcee7e
commit
ab11476dc9
@ -327,6 +327,23 @@ InternalConst(JSContext *cx, unsigned argc, jsval *vp)
|
||||
return true;
|
||||
}
|
||||
|
||||
static JSBool
|
||||
GCPreserveCode(JSContext *cx, unsigned argc, jsval *vp)
|
||||
{
|
||||
CallArgs args = CallArgsFromVp(argc, vp);
|
||||
|
||||
if (argc != 0) {
|
||||
RootedObject callee(cx, &args.callee());
|
||||
ReportUsageError(cx, callee, "Wrong number of arguments");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
cx->runtime->alwaysPreserveCode = true;
|
||||
|
||||
*vp = JSVAL_VOID;
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
#ifdef JS_GC_ZEAL
|
||||
static JSBool
|
||||
GCZeal(JSContext *cx, unsigned argc, jsval *vp)
|
||||
@ -476,23 +493,6 @@ GCState(JSContext *cx, unsigned argc, jsval *vp)
|
||||
return true;
|
||||
}
|
||||
|
||||
static JSBool
|
||||
GCPreserveCode(JSContext *cx, unsigned argc, jsval *vp)
|
||||
{
|
||||
CallArgs args = CallArgsFromVp(argc, vp);
|
||||
|
||||
if (argc != 0) {
|
||||
RootedObject callee(cx, &args.callee());
|
||||
ReportUsageError(cx, callee, "Wrong number of arguments");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
cx->runtime->alwaysPreserveCode = true;
|
||||
|
||||
*vp = JSVAL_VOID;
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
static JSBool
|
||||
DeterministicGC(JSContext *cx, unsigned argc, jsval *vp)
|
||||
{
|
||||
@ -899,6 +899,10 @@ static JSFunctionSpecWithHelp TestingFunctions[] = {
|
||||
" Return the current value of the finalization counter that is incremented\n"
|
||||
" each time an object returned by the makeFinalizeObserver is finalized."),
|
||||
|
||||
JS_FN_HELP("gcPreserveCode", GCPreserveCode, 0, 0,
|
||||
"gcPreserveCode()",
|
||||
" Preserve JIT code during garbage collections."),
|
||||
|
||||
#ifdef JS_GC_ZEAL
|
||||
JS_FN_HELP("gczeal", GCZeal, 2, 0,
|
||||
"gczeal(level, [period])",
|
||||
@ -944,10 +948,6 @@ static JSFunctionSpecWithHelp TestingFunctions[] = {
|
||||
"gcstate()",
|
||||
" Report the global GC state."),
|
||||
|
||||
JS_FN_HELP("gcPreserveCode", GCPreserveCode, 0, 0,
|
||||
"gcPreserveCode()",
|
||||
" Preserve JIT code during garbage collections."),
|
||||
|
||||
JS_FN_HELP("deterministicgc", DeterministicGC, 1, 0,
|
||||
"deterministicgc(true|false)",
|
||||
" If true, only allow determinstic GCs to run."),
|
||||
|
Loading…
x
Reference in New Issue
Block a user