Bug 1236523 part 1 - Remove Shape NON_NATIVE flag. r=bhackett

This commit is contained in:
Jan de Mooij 2016-01-07 10:16:46 +01:00
parent 6d634ad96e
commit e14f74c792
2 changed files with 5 additions and 17 deletions

View File

@ -356,7 +356,7 @@ void
NativeObject::setLastPropertyMakeNative(ExclusiveContext* cx, Shape* shape) NativeObject::setLastPropertyMakeNative(ExclusiveContext* cx, Shape* shape)
{ {
MOZ_ASSERT(getClass()->isNative()); MOZ_ASSERT(getClass()->isNative());
MOZ_ASSERT(shape->isNative()); MOZ_ASSERT(shape->getObjectClass()->isNative());
MOZ_ASSERT(!shape->inDictionary()); MOZ_ASSERT(!shape->inDictionary());
// This method is used to convert unboxed objects into native objects. In // This method is used to convert unboxed objects into native objects. In

View File

@ -635,11 +635,6 @@ class Shape : public gc::TenuredCell
info->shapesMallocHeapTreeKids += kids.toHash()->sizeOfIncludingThis(mallocSizeOf); info->shapesMallocHeapTreeKids += kids.toHash()->sizeOfIncludingThis(mallocSizeOf);
} }
bool isNative() const {
MOZ_ASSERT(!(flags & NON_NATIVE) == getObjectClass()->isNative());
return !(flags & NON_NATIVE);
}
bool isAccessorShape() const { bool isAccessorShape() const {
MOZ_ASSERT_IF(flags & ACCESSOR_SHAPE, getAllocKind() == gc::AllocKind::ACCESSOR_SHAPE); MOZ_ASSERT_IF(flags & ACCESSOR_SHAPE, getAllocKind() == gc::AllocKind::ACCESSOR_SHAPE);
return flags & ACCESSOR_SHAPE; return flags & ACCESSOR_SHAPE;
@ -705,23 +700,20 @@ class Shape : public gc::TenuredCell
* with these bits. * with these bits.
*/ */
enum { enum {
/* Property is placeholder for a non-native class. */
NON_NATIVE = 0x01,
/* Property stored in per-object dictionary, not shared property tree. */ /* Property stored in per-object dictionary, not shared property tree. */
IN_DICTIONARY = 0x02, IN_DICTIONARY = 0x01,
/* /*
* Slotful property was stored to more than once. This is used as a * Slotful property was stored to more than once. This is used as a
* hint for type inference. * hint for type inference.
*/ */
OVERWRITTEN = 0x04, OVERWRITTEN = 0x02,
/* /*
* This shape is an AccessorShape, a fat Shape that can store * This shape is an AccessorShape, a fat Shape that can store
* getter/setter information. * getter/setter information.
*/ */
ACCESSOR_SHAPE = 0x08, ACCESSOR_SHAPE = 0x04,
UNUSED_BITS = 0x3C UNUSED_BITS = 0x3C
}; };
@ -1015,11 +1007,7 @@ struct EmptyShape : public js::Shape
{ {
EmptyShape(UnownedBaseShape* base, uint32_t nfixed) EmptyShape(UnownedBaseShape* base, uint32_t nfixed)
: js::Shape(base, nfixed) : js::Shape(base, nfixed)
{ { }
// Only empty shapes can be NON_NATIVE.
if (!getObjectClass()->isNative())
flags |= NON_NATIVE;
}
static Shape* new_(ExclusiveContext* cx, Handle<UnownedBaseShape*> base, uint32_t nfixed); static Shape* new_(ExclusiveContext* cx, Handle<UnownedBaseShape*> base, uint32_t nfixed);