зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1125389 - Fix NewReshapedObject to use the old shape's data, r=jandem.
This commit is contained in:
Родитель
aa3b065ff1
Коммит
68cfb28171
|
@ -4046,8 +4046,13 @@ TypeNewScript::maybeAnalyze(JSContext *cx, TypeObject *type, bool *regenerate, b
|
||||||
// For now, we require all preliminary objects to have only simple
|
// For now, we require all preliminary objects to have only simple
|
||||||
// lineages of plain data properties.
|
// lineages of plain data properties.
|
||||||
Shape *shape = obj->lastProperty();
|
Shape *shape = obj->lastProperty();
|
||||||
if (shape->inDictionary() || !OnlyHasDataProperties(shape))
|
if (shape->inDictionary() ||
|
||||||
|
!OnlyHasDataProperties(shape) ||
|
||||||
|
shape->getObjectFlags() != 0 ||
|
||||||
|
shape->getObjectMetadata() != nullptr)
|
||||||
|
{
|
||||||
return true;
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
maxSlotSpan = Max<size_t>(maxSlotSpan, obj->slotSpan());
|
maxSlotSpan = Max<size_t>(maxSlotSpan, obj->slotSpan());
|
||||||
|
|
||||||
|
|
|
@ -640,7 +640,12 @@ js::NewReshapedObject(JSContext *cx, HandleTypeObject type, JSObject *parent,
|
||||||
|
|
||||||
/* Construct the new shape, without updating type information. */
|
/* Construct the new shape, without updating type information. */
|
||||||
RootedId id(cx);
|
RootedId id(cx);
|
||||||
RootedShape newShape(cx, res->lastProperty());
|
RootedShape newShape(cx, EmptyShape::getInitialShape(cx, res->getClass(),
|
||||||
|
res->getTaggedProto(),
|
||||||
|
res->getMetadata(),
|
||||||
|
res->getParent(),
|
||||||
|
res->numFixedSlots(),
|
||||||
|
shape->getObjectFlags()));
|
||||||
for (unsigned i = 0; i < ids.length(); i++) {
|
for (unsigned i = 0; i < ids.length(); i++) {
|
||||||
id = ids[i];
|
id = ids[i];
|
||||||
MOZ_ASSERT(!res->contains(cx, id));
|
MOZ_ASSERT(!res->contains(cx, id));
|
||||||
|
|
Загрузка…
Ссылка в новой задаче