mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 828248 - Part c: Pass MutableHandleId to Shape::getUserId; r=sfink
This commit is contained in:
parent
031240dad6
commit
4312f71e86
@ -542,7 +542,7 @@ struct GetNativePropertyStub
|
||||
masm.movePtr(StackPointer, argVpReg);
|
||||
|
||||
// push canonical jsid from shape instead of propertyname.
|
||||
jsid propId;
|
||||
RootedId propId(cx);
|
||||
if (!shape->getUserId(cx, &propId))
|
||||
return false;
|
||||
masm.Push(propId, scratchReg);
|
||||
@ -1205,7 +1205,7 @@ IonCacheSetProperty::attachSetterCall(JSContext *cx, IonScript *ion,
|
||||
masm.move32(Imm32(strict() ? 1 : 0), argStrictReg);
|
||||
|
||||
// push canonical jsid from shape instead of propertyname.
|
||||
jsid propId;
|
||||
RootedId propId(cx);
|
||||
if (!shape->getUserId(cx, &propId))
|
||||
return false;
|
||||
masm.Push(propId, argIdReg);
|
||||
|
@ -3871,7 +3871,7 @@ baseops::DeleteGeneric(JSContext *cx, HandleObject obj, HandleId id, MutableHand
|
||||
}
|
||||
|
||||
RootedId userid(cx);
|
||||
if (!shape->getUserId(cx, userid.address()))
|
||||
if (!shape->getUserId(cx, &userid))
|
||||
return false;
|
||||
|
||||
if (!CallJSPropertyOp(cx, obj->getClass()->delProperty, obj, userid, rval))
|
||||
|
@ -755,7 +755,7 @@ class Shape : public js::gc::Cell
|
||||
* If SHORTID is set in shape->flags, we use shape->shortid rather
|
||||
* than id when calling shape's getter or setter.
|
||||
*/
|
||||
inline bool getUserId(JSContext *cx, jsid *idp) const;
|
||||
inline bool getUserId(JSContext *cx, MutableHandleId idp) const;
|
||||
|
||||
uint8_t attributes() const { return attrs; }
|
||||
bool configurable() const { return (attrs & JSPROP_PERMANENT) == 0; }
|
||||
|
@ -265,7 +265,7 @@ Shape::matchesParamsAfterId(UnrootedBaseShape base, uint32_t aslot,
|
||||
}
|
||||
|
||||
inline bool
|
||||
Shape::getUserId(JSContext *cx, jsid *idp) const
|
||||
Shape::getUserId(JSContext *cx, MutableHandleId idp) const
|
||||
{
|
||||
AssertCanGC();
|
||||
const Shape *self = this;
|
||||
@ -277,16 +277,11 @@ Shape::getUserId(JSContext *cx, jsid *idp) const
|
||||
#endif
|
||||
if (self->hasShortID()) {
|
||||
int16_t id = self->shortid();
|
||||
if (id < 0) {
|
||||
RootedId rootedId(cx);
|
||||
if (!ValueToId(cx, Int32Value(id), &rootedId))
|
||||
return false;
|
||||
*idp = rootedId;
|
||||
return true;
|
||||
}
|
||||
*idp = INT_TO_JSID(id);
|
||||
if (id < 0)
|
||||
return ValueToId(cx, Int32Value(id), idp);
|
||||
idp.set(INT_TO_JSID(id));
|
||||
} else {
|
||||
*idp = self->propid();
|
||||
idp.set(self->propid());
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@ -303,7 +298,7 @@ Shape::get(JSContext* cx, HandleObject receiver, JSObject* obj, JSObject *pobj,
|
||||
|
||||
Rooted<Shape *> self(cx, this);
|
||||
RootedId id(cx);
|
||||
if (!self->getUserId(cx, id.address()))
|
||||
if (!self->getUserId(cx, &id))
|
||||
return false;
|
||||
|
||||
return CallJSPropertyOp(cx, self->getterOp(), receiver, id, vp);
|
||||
@ -324,7 +319,7 @@ Shape::set(JSContext* cx, HandleObject obj, HandleObject receiver, bool strict,
|
||||
|
||||
Rooted<Shape *> self(cx, this);
|
||||
RootedId id(cx);
|
||||
if (!self->getUserId(cx, id.address()))
|
||||
if (!self->getUserId(cx, &id))
|
||||
return false;
|
||||
|
||||
/*
|
||||
|
@ -1393,7 +1393,7 @@ class GetPropCompiler : public PICStubCompiler
|
||||
if (shape->hasGetterValue()) {
|
||||
generateNativeGetterStub(masm, shape, start, shapeMismatches);
|
||||
} else {
|
||||
jsid userid;
|
||||
RootedId userid(cx);
|
||||
if (!shape->getUserId(cx, &userid))
|
||||
return error();
|
||||
generateGetterStub(masm, shape, userid, start, shapeMismatches);
|
||||
|
Loading…
Reference in New Issue
Block a user