Bug 866112 - GC: Fix some misc rooting hazards in the shell r=terrence

This commit is contained in:
Jon Coppeard 2013-04-25 11:55:40 +01:00
parent 672186739c
commit 18ed8e4e2b
3 changed files with 7 additions and 6 deletions

View File

@ -7601,7 +7601,8 @@ template <size_t ProtoChainDepth>
ICUpdatedStub *
ICSetElemDenseAddCompiler::getStubSpecific(ICStubSpace *space, const AutoShapeVector *shapes)
{
return ICSetElem_DenseAddImpl<ProtoChainDepth>::New(space, getStubCode(), obj_->getType(cx),
Rooted<IonCode *> stubCode(cx, getStubCode());
return ICSetElem_DenseAddImpl<ProtoChainDepth>::New(space, stubCode, obj_->getType(cx),
shapes);
}

View File

@ -265,7 +265,7 @@ ion::CanEnterBaselineJIT(JSContext *cx, JSScript *scriptArg, StackFrame *fp, boo
if (IsJSDEnabled(cx)) {
if (JSOp(*cx->regs().pc) == JSOP_LOOPENTRY) // No OSR.
return Method_Skipped;
} else if (scriptArg->incUseCount() <= js_IonOptions.baselineUsesBeforeCompile) {
} else if (script->incUseCount() <= js_IonOptions.baselineUsesBeforeCompile) {
return Method_Skipped;
}

View File

@ -176,11 +176,11 @@ fun_getProperty(JSContext *cx, HandleObject obj_, HandleId id, MutableHandleValu
/*
* Censor the caller if we don't have full access to it.
*/
JSObject &caller = vp.toObject();
if (caller.isWrapper() && !Wrapper::wrapperHandler(&caller)->isSafeToUnwrap()) {
RootedObject caller(cx, &vp.toObject());
if (caller->isWrapper() && !Wrapper::wrapperHandler(caller)->isSafeToUnwrap()) {
vp.setNull();
} else if (caller.isFunction()) {
JSFunction *callerFun = caller.toFunction();
} else if (caller->isFunction()) {
JSFunction *callerFun = caller->toFunction();
if (callerFun->isInterpreted() && callerFun->strict()) {
JS_ReportErrorFlagsAndNumber(cx, JSREPORT_ERROR, js_GetErrorMessage, NULL,
JSMSG_CALLER_IS_STRICT);