mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 841059 - Do not use the ArenaHeader for sizeOfThis on JSObject; r=billm
--HG-- extra : rebase_source : 6d14d5dca727703166c1cdcc694ec688223e6692
This commit is contained in:
parent
388179ea1b
commit
800f1f3a80
@ -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);
|
||||
};
|
||||
|
||||
/*
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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_);
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user