1320408 - Part 24: Change NativeObject::{fillInAfterSwap,replaceWithNewEquivalentShape,generateOwnShape,shadowingShapeChange} to static method.

This commit is contained in:
Gaming4JC 2019-06-09 00:58:44 -04:00 • committed by Roy Tam
commit 83fb6841af
4 changed files with 61 additions and 55 deletions

View file

@ -491,8 +491,8 @@ class NativeObject : public ShapedObject
void checkShapeConsistency() { }
#endif
Shape*
replaceWithNewEquivalentShape(ExclusiveContext* cx,
static Shape*
replaceWithNewEquivalentShape(ExclusiveContext* cx, HandleNativeObject obj,
Shape* existingShape, Shape* newShape = nullptr,
bool accessorShape = false);
@ -609,11 +609,14 @@ class NativeObject : public ShapedObject
}
public:
bool generateOwnShape(ExclusiveContext* cx, Shape* newShape = nullptr) {
return replaceWithNewEquivalentShape(cx, lastProperty(), newShape);
static MOZ_MUST_USE bool generateOwnShape(ExclusiveContext* cx, HandleNativeObject obj,
Shape* newShape = nullptr)
{
return replaceWithNewEquivalentShape(cx, obj, obj->lastProperty(), newShape);
}
bool shadowingShapeChange(ExclusiveContext* cx, const Shape& shape);
static MOZ_MUST_USE bool shadowingShapeChange(ExclusiveContext* cx, HandleNativeObject obj,
const Shape& shape);
static bool clearFlag(ExclusiveContext* cx, HandleNativeObject obj, BaseShape::Flag flag);
// The maximum number of slots in an object.
@ -783,7 +786,8 @@ class NativeObject : public ShapedObject
unsigned flags, ShapeTable::Entry* entry, bool allowDictionary,
const AutoKeepShapeTables& keep);
bool fillInAfterSwap(JSContext* cx, const Vector<Value>& values, void* priv);
static MOZ_MUST_USE bool fillInAfterSwap(JSContext* cx, HandleNativeObject obj,
const Vector<Value>& values, void* priv);
public:
// Return true if this object has been converted from shared-immutable