diff --git a/js/src/vm/UnboxedObject-inl.h b/js/src/vm/UnboxedObject-inl.h index ad6af5c10c7a..e7fa81201869 100644 --- a/js/src/vm/UnboxedObject-inl.h +++ b/js/src/vm/UnboxedObject-inl.h @@ -568,10 +568,12 @@ MoveBoxedOrUnboxedDenseElements(JSContext* cx, JSObject* obj, uint32_t dstStart, uint8_t* data = obj->as().elements(); size_t elementSize = UnboxedTypeSize(Type); - if (UnboxedTypeNeedsPreBarrier(Type)) { + if (UnboxedTypeNeedsPreBarrier(Type) && + JS::shadow::Zone::asShadowZone(obj->zone())->needsIncrementalBarrier()) + { // Trigger pre barriers on any elements we are overwriting. See - // moveDenseElements::moveDenseElements. No post barrier is needed - // as only whole cell post barriers are used with unboxed objects. + // NativeObject::moveDenseElements. No post barrier is needed as + // only whole cell post barriers are used with unboxed objects. for (size_t i = 0; i < length; i++) obj->as().triggerPreBarrier(dstStart + i); }