Bug 951346 - Don't improve type information for objects with metadata, r=jimb.

This commit is contained in:
Brian Hackett 2014-02-21 12:26:42 -07:00
parent 6d31f2f597
commit 087ea8a8f8
2 changed files with 9 additions and 1 deletions

View File

@ -0,0 +1,3 @@
setObjectMetadataCallback(function(obj) {});
eval(uneval({'-1':true}));

View File

@ -2603,7 +2603,12 @@ TypeCompartment::fixObjectType(ExclusiveContext *cx, JSObject *obj)
*/
JS_ASSERT(obj->is<JSObject>());
if (obj->slotSpan() == 0 || obj->inDictionaryMode() || !obj->hasEmptyElements())
/*
* Exclude some objects we can't readily associate common types for based on their
* shape. Objects with metadata are excluded so that the metadata does not need to
* be included in the table lookup (the metadata object might be in the nursery).
*/
if (obj->slotSpan() == 0 || obj->inDictionaryMode() || !obj->hasEmptyElements() || obj->getMetadata())
return;
Vector<IdValuePair> properties(cx);