Bug 828248 - Part d: Pass MutableHandleId to FetchElementId; r=sfink

This commit is contained in:
Ms2ger 2013-01-11 09:43:00 +01:00
parent 9aff3353c5
commit a10016bd7c
5 changed files with 12 additions and 11 deletions

View File

@ -1703,7 +1703,7 @@ js::ion::GetElementCache(JSContext *cx, size_t cacheIndex, HandleObject obj, Han
AutoDetectInvalidation adi(cx, res.address(), ion);
RootedId id(cx);
if (!FetchElementId(cx, obj, idval, id.address(), res))
if (!FetchElementId(cx, obj, idval, &id, res))
return false;
if (cache.stubCount() < MAX_STUBS) {

View File

@ -455,7 +455,7 @@ OperatorIn(JSContext *cx, HandleValue key, HandleObject obj, JSBool *out)
{
RootedValue dummy(cx); // Disregards atomization changes: no way to propagate.
RootedId id(cx);
if (!FetchElementId(cx, obj, key, id.address(), &dummy))
if (!FetchElementId(cx, obj, key, &id, &dummy))
return false;
RootedObject obj2(cx);

View File

@ -3926,7 +3926,7 @@ js::SetObjectElement(JSContext *cx, HandleObject obj, HandleValue index, HandleV
{
RootedId id(cx);
RootedValue indexval(cx, index);
if (!FetchElementId(cx, obj, indexval, id.address(), &indexval))
if (!FetchElementId(cx, obj, indexval, &id, &indexval))
return false;
return SetObjectElementOperation(cx, obj, id, value, strict);
}

View File

@ -681,14 +681,15 @@ NegOperation(JSContext *cx, HandleScript script, jsbytecode *pc, HandleValue val
}
static inline bool
FetchElementId(JSContext *cx, JSObject *obj, const Value &idval, jsid *idp, MutableHandleValue vp)
FetchElementId(JSContext *cx, JSObject *obj, const Value &idval, MutableHandleId idp,
MutableHandleValue vp)
{
int32_t i_;
if (ValueFitsInInt32(idval, &i_) && INT_FITS_IN_JSID(i_)) {
*idp = INT_TO_JSID(i_);
idp.set(INT_TO_JSID(i_));
return true;
}
return !!InternNonIntElementId(cx, obj, idval, idp, vp);
return !!InternNonIntElementId(cx, obj, idval, idp.address(), vp);
}
static JS_ALWAYS_INLINE bool
@ -718,7 +719,7 @@ GetObjectElementOperation(JSContext *cx, JSOp op, HandleObject obj, const Value
{
#if JS_HAS_XML_SUPPORT
if (op == JSOP_CALLELEM && JS_UNLIKELY(obj->isXML())) {
jsid id;
RootedId id(cx);
if (!FetchElementId(cx, obj, rref, &id, res))
return false;
return js_GetXMLMethod(cx, obj, id, res);
@ -892,7 +893,7 @@ InitElemOperation(JSContext *cx, HandleObject obj, MutableHandleValue idval, Han
JS_ASSERT(!val.isMagic(JS_ARRAY_HOLE));
RootedId id(cx);
if (!FetchElementId(cx, obj, idval, id.address(), idval))
if (!FetchElementId(cx, obj, idval, &id, idval))
return false;
return JSObject::defineGeneric(cx, obj, id, val, NULL, NULL, JSPROP_ENUMERATE);

View File

@ -142,7 +142,7 @@ stubs::SetElem(VMFrame &f)
if (!obj)
THROW();
if (!FetchElementId(f.cx, obj, idval, id.address(),
if (!FetchElementId(f.cx, obj, idval, &id,
MutableHandleValue::fromMarkedLocation(&regs.sp[-2])))
{
THROW();
@ -193,7 +193,7 @@ stubs::ToId(VMFrame &f)
THROW();
RootedId id(f.cx);
if (!FetchElementId(f.cx, obj, idval, id.address(), idval))
if (!FetchElementId(f.cx, obj, idval, &id, idval))
THROW();
if (!idval.isInt32()) {
@ -1492,7 +1492,7 @@ stubs::In(VMFrame &f)
RootedObject obj(cx, &rref.toObject());
RootedId id(cx);
if (!FetchElementId(f.cx, obj, f.regs.sp[-2], id.address(),
if (!FetchElementId(f.cx, obj, f.regs.sp[-2], &id,
MutableHandleValue::fromMarkedLocation(&f.regs.sp[-2])))
{
THROWV(JS_FALSE);