Bug 1146472 part 1. Don't do object-kind guessing for object literal templates in scripts, since we in fact know exactly how many slots we want them to have and hence what the kind should be. r=terrence

This commit is contained in:
Boris Zbarsky
2015-03-23 20:37:30 -04:00
parent 11e138b789
commit 71a1f41921
2 changed files with 7 additions and 3 deletions

View File

@@ -2107,7 +2107,7 @@ JSObject *
js::CloneObjectLiteral(JSContext *cx, HandleObject srcObj)
{
if (srcObj->is<PlainObject>()) {
AllocKind kind = GetBackgroundAllocKind(GuessObjectGCKind(srcObj->as<PlainObject>().numFixedSlots()));
AllocKind kind = GetBackgroundAllocKind(gc::GetGCObjectKind(srcObj->as<PlainObject>().numFixedSlots()));
MOZ_ASSERT_IF(srcObj->isTenured(), kind == srcObj->asTenured().getAllocKind());
RootedObject proto(cx, cx->global()->getOrCreateObjectPrototype(cx));