Bug 841059 - Do not use the ArenaHeader for sizeOfThis on JSObject; r=billm

--HG--
extra : rebase_source : 6d14d5dca727703166c1cdcc694ec688223e6692
This commit is contained in:
Terrence Cole 2013-02-13 13:34:25 -08:00
parent 388179ea1b
commit 800f1f3a80
4 changed files with 5 additions and 5 deletions

View File

@ -355,7 +355,7 @@ class NewObjectCache
private:
inline bool lookup(Class *clasp, gc::Cell *key, gc::AllocKind kind, EntryIndex *pentry);
inline void fill(EntryIndex entry, Class *clasp, gc::Cell *key, gc::AllocKind kind, JSObject *obj);
static inline void copyCachedToObject(JSObject *dst, JSObject *src);
static inline void copyCachedToObject(JSObject *dst, JSObject *src, gc::AllocKind kind);
};
/*

View File

@ -107,7 +107,7 @@ NewObjectCache::newObjectFromHit(JSContext *cx, EntryIndex entry_, js::gc::Initi
JSObject *obj = js_NewGCObject<NoGC>(cx, entry->kind, heap);
if (obj) {
copyCachedToObject(obj, reinterpret_cast<JSObject *>(&entry->templateObject));
copyCachedToObject(obj, reinterpret_cast<JSObject *>(&entry->templateObject), entry->kind);
Probes::createObject(cx, obj);
return obj;
}

View File

@ -1540,9 +1540,9 @@ class AutoPropertyDescriptorRooter : private AutoGCRooter, public PropertyDescri
};
inline void
NewObjectCache::copyCachedToObject(JSObject *dst, JSObject *src)
NewObjectCache::copyCachedToObject(JSObject *dst, JSObject *src, gc::AllocKind kind)
{
js_memcpy(dst, src, dst->sizeOfThis());
js_memcpy(dst, src, gc::Arena::thingSize(kind));
#ifdef JSGC_GENERATIONAL
Shape::writeBarrierPost(dst->shape_, &dst->shape_);
types::TypeObject::writeBarrierPost(dst->type_, &dst->type_);

View File

@ -314,7 +314,7 @@ js::ObjectImpl::dynamicSlotsCount(uint32_t nfixed, uint32_t span)
inline size_t
js::ObjectImpl::sizeOfThis() const
{
return arenaHeader()->getThingSize();
return js::gc::Arena::thingSize(getAllocKind());
}
/* static */ inline void