Bug 1167860 - Make sure unboxed expandos are traced during minor GCs if the original unboxed object is converted to a native, r=terrence.

This commit is contained in:
Brian Hackett 2015-05-28 18:46:52 -06:00
parent 88d6136d16
commit e6068dfcb2

View File

@ -517,8 +517,17 @@ UnboxedPlainObject::convertToNative(JSContext* cx, JSObject* obj)
return false;
}
// We are eliminating the expando edge with the conversion, so trigger a
// pre barrier.
JSObject::writeBarrierPre(expando);
// Additionally trigger a post barrier on the expando itself. Whole cell
// store buffer entries can be added on the original unboxed object for
// writes to the expando (see WholeCellEdges::trace), so after conversion
// we need to make sure the expando itself will still be traced.
if (expando && !IsInsideNursery(expando))
cx->runtime()->gc.storeBuffer.putWholeCellFromMainThread(expando);
obj->setGroup(layout.nativeGroup());
obj->as<PlainObject>().setLastPropertyMakeNative(cx, layout.nativeShape());