Loading js/src/vm/Shape.cpp +13 −7 Original line number Diff line number Diff line Loading @@ -986,13 +986,7 @@ bool NativeObject::generateNewDictionaryShape(JSContext* cx, MOZ_ASSERT(obj->inDictionaryMode()); Rooted<BaseShape*> base(cx, obj->shape()->base()); Rooted<DictionaryPropMap*> map(cx, obj->dictionaryShape()->propMap()); uint32_t mapLength = obj->shape()->propMapLength(); Shape* shape = DictionaryShape::new_(cx, base, obj->shape()->objectFlags(), obj->shape()->numFixedSlots(), map, mapLength); Shape* shape = DictionaryShape::new_(cx, obj); if (!shape) { return false; } Loading Loading @@ -1128,6 +1122,18 @@ DictionaryShape* DictionaryShape::new_(JSContext* cx, Handle<BaseShape*> base, mapLength); } DictionaryShape::DictionaryShape(NativeObject* nobj) : DictionaryShape(nobj->shape()->base(), nobj->shape()->objectFlags(), nobj->shape()->numFixedSlots(), nobj->dictionaryShape()->propMap(), nobj->shape()->propMapLength()) {} // static DictionaryShape* DictionaryShape::new_(JSContext* cx, Handle<NativeObject*> obj) { return cx->newCell<DictionaryShape>(obj); } // static ProxyShape* ProxyShape::new_(JSContext* cx, Handle<BaseShape*> base, ObjectFlags objectFlags) { Loading js/src/vm/Shape.h +4 −2 Original line number Diff line number Diff line Loading @@ -511,7 +511,7 @@ class NativeShape : public Shape { class SharedShape : public NativeShape { friend class js::gc::CellAllocator; SharedShape(BaseShape* base, ObjectFlags objectFlags, uint32_t nfixed, PropMap* map, uint32_t mapLength) SharedPropMap* map, uint32_t mapLength) : NativeShape(Kind::Shared, base, objectFlags, nfixed, map, mapLength) { initSmallSlotSpan(); } Loading Loading @@ -622,11 +622,12 @@ class DictionaryShape : public NativeShape { friend class NativeObject; DictionaryShape(BaseShape* base, ObjectFlags objectFlags, uint32_t nfixed, PropMap* map, uint32_t mapLength) DictionaryPropMap* map, uint32_t mapLength) : NativeShape(Kind::Dictionary, base, objectFlags, nfixed, map, mapLength) { MOZ_ASSERT(map); } explicit DictionaryShape(NativeObject* nobj); // Methods to set fields of a new dictionary shape. Must not be used for // shapes that might have been exposed to script. Loading @@ -648,6 +649,7 @@ class DictionaryShape : public NativeShape { ObjectFlags objectFlags, uint32_t nfixed, Handle<DictionaryPropMap*> map, uint32_t mapLength); static DictionaryShape* new_(JSContext* cx, Handle<NativeObject*> obj); DictionaryPropMap* propMap() const { MOZ_ASSERT(isDictionary()); Loading Loading
js/src/vm/Shape.cpp +13 −7 Original line number Diff line number Diff line Loading @@ -986,13 +986,7 @@ bool NativeObject::generateNewDictionaryShape(JSContext* cx, MOZ_ASSERT(obj->inDictionaryMode()); Rooted<BaseShape*> base(cx, obj->shape()->base()); Rooted<DictionaryPropMap*> map(cx, obj->dictionaryShape()->propMap()); uint32_t mapLength = obj->shape()->propMapLength(); Shape* shape = DictionaryShape::new_(cx, base, obj->shape()->objectFlags(), obj->shape()->numFixedSlots(), map, mapLength); Shape* shape = DictionaryShape::new_(cx, obj); if (!shape) { return false; } Loading Loading @@ -1128,6 +1122,18 @@ DictionaryShape* DictionaryShape::new_(JSContext* cx, Handle<BaseShape*> base, mapLength); } DictionaryShape::DictionaryShape(NativeObject* nobj) : DictionaryShape(nobj->shape()->base(), nobj->shape()->objectFlags(), nobj->shape()->numFixedSlots(), nobj->dictionaryShape()->propMap(), nobj->shape()->propMapLength()) {} // static DictionaryShape* DictionaryShape::new_(JSContext* cx, Handle<NativeObject*> obj) { return cx->newCell<DictionaryShape>(obj); } // static ProxyShape* ProxyShape::new_(JSContext* cx, Handle<BaseShape*> base, ObjectFlags objectFlags) { Loading
js/src/vm/Shape.h +4 −2 Original line number Diff line number Diff line Loading @@ -511,7 +511,7 @@ class NativeShape : public Shape { class SharedShape : public NativeShape { friend class js::gc::CellAllocator; SharedShape(BaseShape* base, ObjectFlags objectFlags, uint32_t nfixed, PropMap* map, uint32_t mapLength) SharedPropMap* map, uint32_t mapLength) : NativeShape(Kind::Shared, base, objectFlags, nfixed, map, mapLength) { initSmallSlotSpan(); } Loading Loading @@ -622,11 +622,12 @@ class DictionaryShape : public NativeShape { friend class NativeObject; DictionaryShape(BaseShape* base, ObjectFlags objectFlags, uint32_t nfixed, PropMap* map, uint32_t mapLength) DictionaryPropMap* map, uint32_t mapLength) : NativeShape(Kind::Dictionary, base, objectFlags, nfixed, map, mapLength) { MOZ_ASSERT(map); } explicit DictionaryShape(NativeObject* nobj); // Methods to set fields of a new dictionary shape. Must not be used for // shapes that might have been exposed to script. Loading @@ -648,6 +649,7 @@ class DictionaryShape : public NativeShape { ObjectFlags objectFlags, uint32_t nfixed, Handle<DictionaryPropMap*> map, uint32_t mapLength); static DictionaryShape* new_(JSContext* cx, Handle<NativeObject*> obj); DictionaryPropMap* propMap() const { MOZ_ASSERT(isDictionary()); Loading