Bug 992535 - Add a missing barrier in ArrayPopShift; r=sfink

--HG--
extra : rebase_source : 9506fd7b727877bc635e8977171aaa079bc66199
This commit is contained in:
Terrence Cole 2014-04-07 14:54:58 -07:00
parent 0c5c3fa967
commit 7e26c7cd83
2 changed files with 3 additions and 2 deletions

View File

@ -2141,7 +2141,7 @@ js::ArrayShiftMoveElements(JSObject *obj)
* themselves.
*/
uint32_t initlen = obj->getDenseInitializedLength();
obj->moveDenseElementsUnbarriered(0, 1, initlen);
obj->moveDenseElementsNoPreBarrier(0, 1, initlen);
}
/* ES5 15.4.4.9 */

View File

@ -725,13 +725,14 @@ class JSObject : public js::ObjectImpl
}
}
void moveDenseElementsUnbarriered(uint32_t dstStart, uint32_t srcStart, uint32_t count) {
void moveDenseElementsNoPreBarrier(uint32_t dstStart, uint32_t srcStart, uint32_t count) {
JS_ASSERT(!shadowZone()->needsBarrier());
JS_ASSERT(dstStart + count <= getDenseCapacity());
JS_ASSERT(srcStart + count <= getDenseCapacity());
memmove(elements + dstStart, elements + srcStart, count * sizeof(js::Value));
DenseRangeWriteBarrierPost(runtimeFromMainThread(), this, dstStart, count);
}
bool shouldConvertDoubleElements() {