Bug 879079 - Fix some static root analysis failures; r=sfink

--HG--
extra : rebase_source : 40407ff41a7380fc4107958a7e4af843c826301f
This commit is contained in:
Terrence Cole 2013-06-26 10:37:42 -07:00
parent ebc01dfda0
commit ad5df63273
4 changed files with 6 additions and 6 deletions

View File

@ -1698,19 +1698,19 @@ ion::CanEnter(JSContext *cx, RunState &state)
// If --ion-eager is used, compile with Baseline first, so that we
// can directly enter IonMonkey.
if (js_IonOptions.eagerCompilation && !script->hasBaselineScript()) {
RootedScript rscript(cx, script);
if (js_IonOptions.eagerCompilation && !rscript->hasBaselineScript()) {
MethodStatus status = CanEnterBaselineMethod(cx, state);
if (status != Method_Compiled)
return status;
}
// Attempt compilation. Returns Method_Compiled if already compiled.
RootedScript rscript(cx, script);
bool constructing = state.isInvoke() && state.asInvoke()->constructing();
MethodStatus status = Compile(cx, rscript, NULL, NULL, constructing, SequentialExecution);
if (status != Method_Compiled) {
if (status == Method_CantCompile)
ForbidCompilation(cx, script);
ForbidCompilation(cx, rscript);
return status;
}

View File

@ -1542,7 +1542,7 @@ JSObject *
js::CreateThisForFunctionWithProto(JSContext *cx, HandleObject callee, JSObject *proto,
NewObjectKind newKind /* = GenericObject */)
{
JSObject *res;
RootedObject res(cx);
if (proto) {
RootedTypeObject type(cx, proto->getNewType(cx, &ObjectClass, &callee->as<JSFunction>()));

View File

@ -2694,7 +2694,7 @@ LambdaIsGetElem(JSContext *cx, JSObject &lambda, MutableHandleObject pobj)
if (!lambda.is<JSFunction>())
return true;
JSFunction *fun = &lambda.as<JSFunction>();
RootedFunction fun(cx, &lambda.as<JSFunction>());
if (!fun->isInterpreted())
return true;

View File

@ -283,7 +283,7 @@ JS_ALWAYS_INLINE bool
InterpreterStack::pushInlineFrame(JSContext *cx, FrameRegs &regs, const CallArgs &args,
HandleScript script, InitialFrameFlags initial)
{
JSFunction *callee = &args.callee().as<JSFunction>();
RootedFunction callee(cx, &args.callee().as<JSFunction>());
JS_ASSERT(regs.sp == args.end());
JS_ASSERT(callee->nonLazyScript() == script);