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
This commit is contained in:
parent
4bd994c627
commit
04d98c14ca
@ -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);
|
||||
}
|
||||
|
||||
|
@ -1701,7 +1701,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->tenuredGetAllocKind());
|
||||
RootedObject obj(cx);
|
||||
obj = NewBuiltinClassInstance(cx, &ObjectClass, allocKind, newKind);
|
||||
if (!obj)
|
||||
|
@ -209,7 +209,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