Bug 1394831 part 5 - Remove slot and flags arguments from putDataProperty. r=bhackett

This commit is contained in:
Jan de Mooij 2017-10-31 15:19:45 +01:00
parent d12a053cff
commit d812dc22e3
3 changed files with 9 additions and 11 deletions

View File

@ -1439,8 +1439,7 @@ AddOrChangeProperty(JSContext* cx, HandleNativeObject obj, HandleId id,
}
} else {
if (Shape::isDataProperty(desc.attributes(), desc.getter(), desc.setter())) {
shape = NativeObject::putDataProperty(cx, obj, id, SHAPE_INVALID_SLOT,
desc.attributes(), 0);
shape = NativeObject::putDataProperty(cx, obj, id, desc.attributes());
} else {
shape = NativeObject::putAccessorProperty(cx, obj, id, desc.getter(), desc.setter(),
desc.attributes(), 0);

View File

@ -870,8 +870,7 @@ class NativeObject : public ShapedObject
/* Add or overwrite a property for id in this scope. */
static Shape*
putDataProperty(JSContext* cx, HandleNativeObject obj, HandleId id,
uint32_t slot, unsigned attrs, unsigned flags);
putDataProperty(JSContext* cx, HandleNativeObject obj, HandleId id, unsigned attrs);
static Shape*
putAccessorProperty(JSContext* cx, HandleNativeObject obj, HandleId id,

View File

@ -784,7 +784,7 @@ AssertValidArrayIndex(NativeObject* obj, jsid id)
/* static */ Shape*
NativeObject::putDataProperty(JSContext* cx, HandleNativeObject obj, HandleId id,
uint32_t slot, unsigned attrs, unsigned flags)
unsigned attrs)
{
MOZ_ASSERT(!JSID_IS_VOID(id));
@ -817,7 +817,8 @@ NativeObject::putDataProperty(JSContext* cx, HandleNativeObject obj, HandleId id
*/
MOZ_ASSERT(obj->nonProxyIsExtensible());
return addDataPropertyInternal(cx, obj, id, slot, attrs, flags, entry, true, keep);
return addDataPropertyInternal(cx, obj, id, SHAPE_INVALID_SLOT, attrs, 0, entry, true,
keep);
}
/* Property exists: search must have returned a valid entry. */
@ -832,8 +833,7 @@ NativeObject::putDataProperty(JSContext* cx, HandleNativeObject obj, HandleId id
*/
bool hadSlot = shape->isDataProperty();
uint32_t oldSlot = shape->maybeSlot();
if (slot == SHAPE_INVALID_SLOT && hadSlot)
slot = oldSlot;
uint32_t slot = hadSlot ? oldSlot : SHAPE_INVALID_SLOT;
Rooted<UnownedBaseShape*> nbase(cx);
{
@ -847,7 +847,7 @@ NativeObject::putDataProperty(JSContext* cx, HandleNativeObject obj, HandleId id
* Now that we've possibly preserved slot, check whether all members match.
* If so, this is a redundant "put" and we can return without more work.
*/
if (shape->matchesParamsAfterId(nbase, slot, attrs, flags, nullptr, nullptr))
if (shape->matchesParamsAfterId(nbase, slot, attrs, 0, nullptr, nullptr))
return shape;
/*
@ -897,7 +897,7 @@ NativeObject::putDataProperty(JSContext* cx, HandleNativeObject obj, HandleId id
shape->setSlot(slot);
shape->attrs = uint8_t(attrs);
shape->flags = flags | Shape::IN_DICTIONARY;
shape->flags = Shape::IN_DICTIONARY;
} else {
/*
* Updating the last property in a non-dictionary-mode object. Find an
@ -912,7 +912,7 @@ NativeObject::putDataProperty(JSContext* cx, HandleNativeObject obj, HandleId id
MOZ_ASSERT(shape == obj->lastProperty());
/* Find or create a property tree node labeled by our arguments. */
Rooted<StackShape> child(cx, StackShape(nbase, id, slot, attrs, flags));
Rooted<StackShape> child(cx, StackShape(nbase, id, slot, attrs, 0));
RootedShape parent(cx, shape->parent);
shape = getChildProperty(cx, obj, parent, &child);
if (!shape)