mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 852667 - Permit passing #fixed slots to getInitialShape (r=bhackett)
This commit is contained in:
parent
7c3b1d3b99
commit
561ee16bc2
@ -1075,7 +1075,7 @@ JSObject::sealOrFreeze(JSContext *cx, HandleObject obj, ImmutabilityType it)
|
||||
RootedShape last(cx, EmptyShape::getInitialShape(cx, obj->getClass(),
|
||||
obj->getTaggedProto(),
|
||||
obj->getParent(),
|
||||
obj->getAllocKind(),
|
||||
obj->numFixedSlots(),
|
||||
obj->lastProperty()->getObjectFlags()));
|
||||
if (!last)
|
||||
return false;
|
||||
@ -1808,7 +1808,7 @@ JSObject::ReserveForTradeGuts(JSContext *cx, JSObject *aArg, JSObject *bArg,
|
||||
return false;
|
||||
} else {
|
||||
reserved.newbshape = EmptyShape::getInitialShape(cx, aClass, aProto, a->getParent(),
|
||||
b->getAllocKind());
|
||||
b->numFixedSlots());
|
||||
if (!reserved.newbshape)
|
||||
return false;
|
||||
}
|
||||
@ -1817,7 +1817,7 @@ JSObject::ReserveForTradeGuts(JSContext *cx, JSObject *aArg, JSObject *bArg,
|
||||
return false;
|
||||
} else {
|
||||
reserved.newashape = EmptyShape::getInitialShape(cx, bClass, bProto, b->getParent(),
|
||||
a->getAllocKind());
|
||||
a->numFixedSlots());
|
||||
if (!reserved.newashape)
|
||||
return false;
|
||||
}
|
||||
|
@ -1230,7 +1230,7 @@ InitialShapeEntry::match(const InitialShapeEntry &key, const Lookup &lookup)
|
||||
|
||||
/* static */ Shape *
|
||||
EmptyShape::getInitialShape(JSContext *cx, Class *clasp, TaggedProto proto, JSObject *parent,
|
||||
AllocKind kind, uint32_t objectFlags)
|
||||
size_t nfixed, uint32_t objectFlags)
|
||||
{
|
||||
JS_ASSERT_IF(proto.isObject(), cx->compartment == proto.toObject()->compartment());
|
||||
JS_ASSERT_IF(parent, cx->compartment == parent->compartment());
|
||||
@ -1240,7 +1240,6 @@ EmptyShape::getInitialShape(JSContext *cx, Class *clasp, TaggedProto proto, JSOb
|
||||
if (!table.initialized() && !table.init())
|
||||
return NULL;
|
||||
|
||||
size_t nfixed = GetGCKindSlots(kind, clasp);
|
||||
InitialShapeEntry::Lookup lookup(clasp, proto, parent, nfixed, objectFlags);
|
||||
|
||||
InitialShapeSet::AddPtr p = table.lookupForAdd(lookup);
|
||||
@ -1270,6 +1269,13 @@ EmptyShape::getInitialShape(JSContext *cx, Class *clasp, TaggedProto proto, JSOb
|
||||
return shape;
|
||||
}
|
||||
|
||||
/* static */ Shape *
|
||||
EmptyShape::getInitialShape(JSContext *cx, Class *clasp, TaggedProto proto, JSObject *parent,
|
||||
AllocKind kind, uint32_t objectFlags)
|
||||
{
|
||||
return getInitialShape(cx, clasp, proto, parent, GetGCKindSlots(kind, clasp), objectFlags);
|
||||
}
|
||||
|
||||
void
|
||||
NewObjectCache::invalidateEntriesForShape(JSContext *cx, HandleShape shape, HandleObject proto)
|
||||
{
|
||||
|
@ -898,6 +898,8 @@ struct EmptyShape : public js::Shape
|
||||
* Lookup an initial shape matching the given parameters, creating an empty
|
||||
* shape if none was found.
|
||||
*/
|
||||
static Shape *getInitialShape(JSContext *cx, Class *clasp, TaggedProto proto,
|
||||
JSObject *parent, size_t nfixed, uint32_t objectFlags = 0);
|
||||
static Shape *getInitialShape(JSContext *cx, Class *clasp, TaggedProto proto,
|
||||
JSObject *parent, gc::AllocKind kind, uint32_t objectFlags = 0);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user