Bug 834826 - Eliminate or refactor various unnecessary stack roots, r=terrence.

This commit is contained in:
Brian Hackett
2013-01-26 07:42:20 -07:00
parent 70ffd37174
commit 6ffc2c1ff8
58 changed files with 632 additions and 572 deletions

View File

@@ -1118,7 +1118,7 @@ SuppressDeletedPropertyHelper(JSContext *cx, HandleObject obj, StringPredicate p
RootedObject obj2(cx);
RootedShape prop(cx);
RootedId id(cx);
if (!ValueToId(cx, StringValue(*idp), &id))
if (!ValueToId<CanGC>(cx, StringValue(*idp), &id))
return false;
if (!JSObject::lookupGeneric(cx, proto, id, &obj2, &prop))
return false;
@@ -1249,7 +1249,7 @@ js_IteratorMore(JSContext *cx, HandleObject iterobj, MutableHandleValue rval)
if (ni) {
JS_ASSERT(!ni->isKeyIter());
RootedId id(cx);
if (!ValueToId(cx, StringValue(*ni->current()), &id))
if (!ValueToId<CanGC>(cx, StringValue(*ni->current()), &id))
return false;
ni->incCursor();
RootedObject obj(cx, ni->obj);
@@ -1582,10 +1582,7 @@ SendToGenerator(JSContext *cx, JSGeneratorOp op, HandleObject obj,
gen->regs = cx->regs();
cx->enterGenerator(gen); /* OOM check above. */
RootedScript script(cx, fp->script());
ok = RunScript(cx, script, fp);
ok = RunScript(cx, fp);
cx->leaveGenerator(gen);
}