mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-10-21 14:47:31 +09:00
1320408 - Part 17: Change NativeObject::clearFlag to static method.
This commit is contained in:
parent
9e0f10ac59
commit
d102bd41c8
3 changed files with 8 additions and 9 deletions
|
|
@ -691,7 +691,7 @@ NativeObject::maybeDensifySparseElements(js::ExclusiveContext* cx, HandleNativeO
|
||||||
* flag so that we will not start using sparse indexes again if we need
|
* flag so that we will not start using sparse indexes again if we need
|
||||||
* to grow the object.
|
* to grow the object.
|
||||||
*/
|
*/
|
||||||
if (!obj->clearFlag(cx, BaseShape::INDEXED))
|
if (!NativeObject::clearFlag(cx, obj, BaseShape::INDEXED))
|
||||||
return DenseElementResult::Failure;
|
return DenseElementResult::Failure;
|
||||||
|
|
||||||
return DenseElementResult::Success;
|
return DenseElementResult::Success;
|
||||||
|
|
|
||||||
|
|
@ -614,7 +614,7 @@ class NativeObject : public ShapedObject
|
||||||
}
|
}
|
||||||
|
|
||||||
bool shadowingShapeChange(ExclusiveContext* cx, const Shape& shape);
|
bool shadowingShapeChange(ExclusiveContext* cx, const Shape& shape);
|
||||||
bool clearFlag(ExclusiveContext* cx, BaseShape::Flag flag);
|
static bool clearFlag(ExclusiveContext* cx, HandleNativeObject obj, BaseShape::Flag flag);
|
||||||
|
|
||||||
// The maximum number of slots in an object.
|
// The maximum number of slots in an object.
|
||||||
// |MAX_SLOTS_COUNT * sizeof(JS::Value)| shouldn't overflow
|
// |MAX_SLOTS_COUNT * sizeof(JS::Value)| shouldn't overflow
|
||||||
|
|
|
||||||
|
|
@ -1240,21 +1240,20 @@ JSObject::setFlags(ExclusiveContext* cx, HandleObject obj, BaseShape::Flag flags
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
/* static */ bool
|
||||||
NativeObject::clearFlag(ExclusiveContext* cx, BaseShape::Flag flag)
|
NativeObject::clearFlag(ExclusiveContext* cx, HandleNativeObject obj, BaseShape::Flag flag)
|
||||||
{
|
{
|
||||||
MOZ_ASSERT(inDictionaryMode());
|
MOZ_ASSERT(obj->inDictionaryMode());
|
||||||
|
|
||||||
RootedNativeObject self(cx, &as<NativeObject>());
|
MOZ_ASSERT(obj->lastProperty()->getObjectFlags() & flag);
|
||||||
MOZ_ASSERT(self->lastProperty()->getObjectFlags() & flag);
|
|
||||||
|
|
||||||
StackBaseShape base(self->lastProperty());
|
StackBaseShape base(obj->lastProperty());
|
||||||
base.flags &= ~flag;
|
base.flags &= ~flag;
|
||||||
UnownedBaseShape* nbase = BaseShape::getUnowned(cx, base);
|
UnownedBaseShape* nbase = BaseShape::getUnowned(cx, base);
|
||||||
if (!nbase)
|
if (!nbase)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
self->lastProperty()->base()->adoptUnowned(nbase);
|
obj->lastProperty()->base()->adoptUnowned(nbase);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue