Bug 714616 followup: add assertions to moveDenseArrayElements unbarriered, r=billm

This commit is contained in:
David Mandelin 2012-02-03 13:47:39 -08:00
parent e96ff07d7b
commit 02ff01199a

View File

@ -630,6 +630,10 @@ inline void
JSObject::moveDenseArrayElementsUnbarriered(uintN dstStart, uintN srcStart, uintN count) JSObject::moveDenseArrayElementsUnbarriered(uintN dstStart, uintN srcStart, uintN count)
{ {
JS_ASSERT(!compartment()->needsBarrier()); JS_ASSERT(!compartment()->needsBarrier());
JS_ASSERT(dstStart + count <= getDenseArrayCapacity());
JS_ASSERT(srcStart + count <= getDenseArrayCapacity());
memmove(elements + dstStart, elements + srcStart, count * sizeof(js::Value)); memmove(elements + dstStart, elements + srcStart, count * sizeof(js::Value));
} }