Bug 1196590 - Don't assume that objects without shapes are unboxed plain objects, r=jandem.

This commit is contained in:
Brian Hackett 2015-08-24 10:30:51 -06:00
parent d45a22a11a
commit f1fc12d77b
3 changed files with 14 additions and 1 deletions

View File

@ -0,0 +1,11 @@
function bar(x, i) {
if (i == 50)
x.length = 0;
}
function foo(x, j, n) {
for (var i = 0; i < n; i++) {
bar(x, i);
}
}
var a = foo([1,2,3,4], 3, 100);

View File

@ -7953,6 +7953,7 @@ DoSetPropFallback(JSContext* cx, BaselineFrame* frame, ICSetProp_Fallback* stub_
RootedReceiverGuard oldGuard(cx, ReceiverGuard(obj));
if (obj->is<UnboxedPlainObject>()) {
MOZ_ASSERT(!oldShape);
if (UnboxedExpandoObject* expando = obj->as<UnboxedPlainObject>().maybeExpando())
oldShape = expando->lastProperty();
}

View File

@ -3309,7 +3309,8 @@ SetPropertyIC::update(JSContext* cx, HandleScript outerScript, size_t cacheIndex
}
RootedShape oldShape(cx, obj->maybeShape());
if (!oldShape) {
if (obj->is<UnboxedPlainObject>()) {
MOZ_ASSERT(!oldShape);
if (UnboxedExpandoObject* expando = obj->as<UnboxedPlainObject>().maybeExpando())
oldShape = expando->lastProperty();
}