mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 849453 - Use the AllocKind to get the size instead of sizeOfThis; r=billm
--HG-- extra : rebase_source : 988997984bda4ec329a801655f1649bb73aeea7a
This commit is contained in:
parent
b60d8cddf6
commit
241444bb22
@ -73,7 +73,7 @@ NewObjectCache::fill(EntryIndex entry_, Class *clasp, gc::Cell *key, gc::AllocKi
|
||||
entry->key = key;
|
||||
entry->kind = kind;
|
||||
|
||||
entry->nbytes = obj->sizeOfThis();
|
||||
entry->nbytes = gc::Arena::thingSize(kind);
|
||||
js_memcpy(&entry->templateObject, obj, entry->nbytes);
|
||||
}
|
||||
|
||||
|
@ -1085,7 +1085,7 @@ JSObject::hasShapeTable() const
|
||||
inline size_t
|
||||
JSObject::computedSizeOfThisSlotsElements() const
|
||||
{
|
||||
size_t n = sizeOfThis();
|
||||
size_t n = js::gc::Arena::thingSize(js::gc::GetGCObjectFixedSlotsKind(numFixedSlots()));
|
||||
|
||||
if (hasDynamicSlots())
|
||||
n += numDynamicSlots() * sizeof(js::Value);
|
||||
@ -1721,7 +1721,7 @@ CopyInitializerObject(JSContext *cx, HandleObject baseobj, NewObjectKind newKind
|
||||
|
||||
gc::AllocKind allocKind = gc::GetGCObjectFixedSlotsKind(baseobj->numFixedSlots());
|
||||
allocKind = gc::GetBackgroundAllocKind(allocKind);
|
||||
JS_ASSERT(allocKind == baseobj->getAllocKind());
|
||||
JS_ASSERT_IF(baseobj->isTenured(), allocKind == baseobj->getAllocKind());
|
||||
RootedObject obj(cx);
|
||||
obj = NewBuiltinClassInstance(cx, &ObjectClass, allocKind, newKind);
|
||||
if (!obj)
|
||||
|
@ -215,7 +215,9 @@ bool CrossCompartmentWrapper::finalizeInBackground(Value priv)
|
||||
* Make the 'background-finalized-ness' of the wrapper the same as the
|
||||
* wrapped object, to allow transplanting between them.
|
||||
*/
|
||||
return IsBackgroundFinalized(priv.toObject().getAllocKind());
|
||||
if (IsInsideNursery(priv.toObject().runtime(), &priv.toObject()))
|
||||
return false;
|
||||
return IsBackgroundFinalized(priv.toObject().tenuredGetAllocKind());
|
||||
}
|
||||
|
||||
#define PIERCE(cx, wrapper, pre, op, post) \
|
||||
|
Loading…
Reference in New Issue
Block a user