Bug 1146597 - Add unboxed arrays for JSOP_NEWARRAY arrays, and shell option for using them, r=jandem.

This commit is contained in:
Brian Hackett
2015-05-03 08:14:04 -07:00
parent d14e138eaa
commit fef42ee57d
46 changed files with 2870 additions and 835 deletions

View File

@@ -283,8 +283,20 @@ Snapshot(JSContext* cx, HandleObject pobj_, unsigned flags, AutoIdVector* props)
if (!enumerate(cx, pobj, properties))
return false;
RootedId id(cx);
for (size_t n = 0; n < properties.length(); n++) {
if (!Enumerate(cx, pobj, properties[n], true, flags, ht, props))
id = properties[n];
bool enumerable = true;
// The enumerate hook does not indicate whether the properties
// it returns are enumerable or not. There is no non-effectful
// way to determine this from the object, so carve out
// exceptions here for places where the property is not
// enumerable.
if (pobj->is<UnboxedArrayObject>() && id == NameToId(cx->names().length))
enumerable = false;
if (!Enumerate(cx, pobj, id, enumerable, flags, ht, props))
return false;
}