Bug 1010947 - Nursery: tenuredSize is computed incorrectly for ArrayObject objects. r=jonco

This commit is contained in:
Lars T Hansen 2014-06-06 09:44:02 +02:00
parent 718adcc924
commit 84c691ea1a

View File

@ -583,9 +583,13 @@ js::Nursery::moveObjectToTenured(JSObject *dst, JSObject *src, AllocKind dstKind
* Arrays do not necessarily have the same AllocKind between src and dst.
* We deal with this by copying elements manually, possibly re-inlining
* them if there is adequate room inline in dst.
*
* For Arrays we're reducing tenuredSize to the smaller srcSize
* because moveElementsToTenured() accounts for all Array elements,
* even if they are inlined.
*/
if (src->is<ArrayObject>())
srcSize = sizeof(ObjectImpl);
tenuredSize = srcSize = sizeof(ObjectImpl);
js_memcpy(dst, src, srcSize);
tenuredSize += moveSlotsToTenured(dst, src, dstKind);