Revert #1142 - Remove unboxed objects

- accounting for removal of watch()/unwatch()
This commit is contained in:
wolfbeast 2020-02-22 21:09:32 +01:00 committed by Roy Tam
commit 47781d6165
48 changed files with 3400 additions and 75 deletions

View file

@ -5016,6 +5016,11 @@ js::NewObjectOperationWithTemplate(JSContext* cx, HandleObject templateObject)
NewObjectKind newKind = templateObject->group()->shouldPreTenure() ? TenuredObject : GenericObject;
if (templateObject->group()->maybeUnboxedLayout()) {
RootedObjectGroup group(cx, templateObject->group());
return UnboxedPlainObject::create(cx, group, newKind);
}
JSObject* obj = CopyInitializerObject(cx, templateObject.as<PlainObject>(), newKind);
if (!obj)
return nullptr;