Get new object empty shapes with a common hash table, bug 701509.

This commit is contained in:
Brian Hackett
2011-11-10 17:50:05 -08:00
parent c918ed606d
commit b58540799b
22 changed files with 292 additions and 391 deletions

View File

@@ -1372,9 +1372,8 @@ JSObject::makeDenseArraySlow(JSContext *cx)
/* Create a native scope. */
gc::AllocKind kind = getAllocKind();
Shape *shape = GetInitialShapeForObject(cx, &SlowArrayClass,
oldShape->getObjectParent(),
getProto()->getNewType(cx), kind);
Shape *shape = EmptyShape::lookupInitialShape(cx, &SlowArrayClass, getProto(),
oldShape->getObjectParent(), kind);
if (!shape)
return false;
setLastPropertyInfallible(shape);
@@ -3892,7 +3891,8 @@ NewArray(JSContext *cx, jsuint length, JSObject *proto)
if (!type)
return NULL;
Shape *shape = GetInitialShapeForObject(cx, &ArrayClass, proto->getParent(), type, kind);
Shape *shape = EmptyShape::lookupInitialShape(cx, &ArrayClass, proto,
proto->getParent(), kind);
if (!shape)
return NULL;