diff --git a/generators/wasm/WasmIntrinsicGenerator.kt b/generators/wasm/WasmIntrinsicGenerator.kt index aa5e6836c9f..70bacfac8b4 100644 --- a/generators/wasm/WasmIntrinsicGenerator.kt +++ b/generators/wasm/WasmIntrinsicGenerator.kt @@ -104,11 +104,11 @@ fun wasmArrayForType( @WasmOp(WasmOp.ARRAY_LEN) fun len(): Int = - implementedAsIntrinsic + implementedAsIntrinsic } - internal inline fun $name.copyTo(destination: $name, sourceIndex: Int, destinationIndex: Int, length: Int) { - wasm_array_copy<$name>(destination, destinationIndex, this, sourceIndex, length) + internal inline fun copyWasmArray(source: $name, destination: $name, sourceIndex: Int, destinationIndex: Int, length: Int) { + wasm_array_copy<$name>(destination, destinationIndex, source, sourceIndex, length) } internal inline fun $name.fill(size: Int, init: (Int) -> $type) { diff --git a/libraries/stdlib/wasm/builtins/kotlin/String.kt b/libraries/stdlib/wasm/builtins/kotlin/String.kt index b119532473a..719c8bd98dd 100644 --- a/libraries/stdlib/wasm/builtins/kotlin/String.kt +++ b/libraries/stdlib/wasm/builtins/kotlin/String.kt @@ -29,8 +29,8 @@ public class String private constructor(internal val chars: WasmCharArray) : Com if (otherLen == 0) return String(thisChars) val newChars = WasmCharArray(thisLen + otherLen) - thisChars.copyTo(newChars, 0, 0, thisLen) - otherChars.copyTo(newChars, 0, thisLen, otherLen) + copyWasmArray(thisChars, newChars, 0, 0, thisLen) + copyWasmArray(otherChars, newChars, 0, thisLen, otherLen) return String(newChars) } @@ -54,7 +54,7 @@ public class String private constructor(internal val chars: WasmCharArray) : Com val actualEndIndex = endIndex.coerceAtMost(thisChars.len()) val newCharsLen = actualEndIndex - actualStartIndex val newChars = WasmCharArray(newCharsLen) - thisChars.copyTo(newChars, actualStartIndex, 0, newCharsLen) + copyWasmArray(thisChars, newChars, actualStartIndex, 0, newCharsLen) return String(newChars) } diff --git a/libraries/stdlib/wasm/src/generated/_ArraysWasm.kt b/libraries/stdlib/wasm/src/generated/_ArraysWasm.kt index 322f4152c6a..c3f4ee7116c 100644 --- a/libraries/stdlib/wasm/src/generated/_ArraysWasm.kt +++ b/libraries/stdlib/wasm/src/generated/_ArraysWasm.kt @@ -1017,8 +1017,10 @@ public actual fun CharArray?.contentToString(): String { @SinceKotlin("1.3") @Suppress("ACTUAL_FUNCTION_WITH_DEFAULT_ARGUMENTS") public actual fun Array.copyInto(destination: Array, destinationOffset: Int = 0, startIndex: Int = 0, endIndex: Int = size): Array { - @Suppress("UNCHECKED_CAST") - arrayCopy(this as Array, startIndex, destination as Array, destinationOffset, endIndex - startIndex) + AbstractList.checkRangeIndexes(startIndex, endIndex, this.size) + val rangeSize = endIndex - startIndex + AbstractList.checkRangeIndexes(destinationOffset, destinationOffset + rangeSize, destination.size) + kotlin.wasm.internal.copyWasmArray(this.storage, destination.storage, startIndex, destinationOffset, rangeSize) return destination } @@ -1041,7 +1043,10 @@ public actual fun Array.copyInto(destination: Array, destinationOf @SinceKotlin("1.3") @Suppress("ACTUAL_FUNCTION_WITH_DEFAULT_ARGUMENTS") public actual fun ByteArray.copyInto(destination: ByteArray, destinationOffset: Int = 0, startIndex: Int = 0, endIndex: Int = size): ByteArray { - arrayCopy(this, startIndex, destination, destinationOffset, endIndex - startIndex) + AbstractList.checkRangeIndexes(startIndex, endIndex, this.size) + val rangeSize = endIndex - startIndex + AbstractList.checkRangeIndexes(destinationOffset, destinationOffset + rangeSize, destination.size) + kotlin.wasm.internal.copyWasmArray(this.storage, destination.storage, startIndex, destinationOffset, rangeSize) return destination } @@ -1064,7 +1069,10 @@ public actual fun ByteArray.copyInto(destination: ByteArray, destinationOffset: @SinceKotlin("1.3") @Suppress("ACTUAL_FUNCTION_WITH_DEFAULT_ARGUMENTS") public actual fun ShortArray.copyInto(destination: ShortArray, destinationOffset: Int = 0, startIndex: Int = 0, endIndex: Int = size): ShortArray { - arrayCopy(this, startIndex, destination, destinationOffset, endIndex - startIndex) + AbstractList.checkRangeIndexes(startIndex, endIndex, this.size) + val rangeSize = endIndex - startIndex + AbstractList.checkRangeIndexes(destinationOffset, destinationOffset + rangeSize, destination.size) + kotlin.wasm.internal.copyWasmArray(this.storage, destination.storage, startIndex, destinationOffset, rangeSize) return destination } @@ -1087,7 +1095,10 @@ public actual fun ShortArray.copyInto(destination: ShortArray, destinationOffset @SinceKotlin("1.3") @Suppress("ACTUAL_FUNCTION_WITH_DEFAULT_ARGUMENTS") public actual fun IntArray.copyInto(destination: IntArray, destinationOffset: Int = 0, startIndex: Int = 0, endIndex: Int = size): IntArray { - arrayCopy(this, startIndex, destination, destinationOffset, endIndex - startIndex) + AbstractList.checkRangeIndexes(startIndex, endIndex, this.size) + val rangeSize = endIndex - startIndex + AbstractList.checkRangeIndexes(destinationOffset, destinationOffset + rangeSize, destination.size) + kotlin.wasm.internal.copyWasmArray(this.storage, destination.storage, startIndex, destinationOffset, rangeSize) return destination } @@ -1110,7 +1121,10 @@ public actual fun IntArray.copyInto(destination: IntArray, destinationOffset: In @SinceKotlin("1.3") @Suppress("ACTUAL_FUNCTION_WITH_DEFAULT_ARGUMENTS") public actual fun LongArray.copyInto(destination: LongArray, destinationOffset: Int = 0, startIndex: Int = 0, endIndex: Int = size): LongArray { - arrayCopy(this, startIndex, destination, destinationOffset, endIndex - startIndex) + AbstractList.checkRangeIndexes(startIndex, endIndex, this.size) + val rangeSize = endIndex - startIndex + AbstractList.checkRangeIndexes(destinationOffset, destinationOffset + rangeSize, destination.size) + kotlin.wasm.internal.copyWasmArray(this.storage, destination.storage, startIndex, destinationOffset, rangeSize) return destination } @@ -1133,7 +1147,10 @@ public actual fun LongArray.copyInto(destination: LongArray, destinationOffset: @SinceKotlin("1.3") @Suppress("ACTUAL_FUNCTION_WITH_DEFAULT_ARGUMENTS") public actual fun FloatArray.copyInto(destination: FloatArray, destinationOffset: Int = 0, startIndex: Int = 0, endIndex: Int = size): FloatArray { - arrayCopy(this, startIndex, destination, destinationOffset, endIndex - startIndex) + AbstractList.checkRangeIndexes(startIndex, endIndex, this.size) + val rangeSize = endIndex - startIndex + AbstractList.checkRangeIndexes(destinationOffset, destinationOffset + rangeSize, destination.size) + kotlin.wasm.internal.copyWasmArray(this.storage, destination.storage, startIndex, destinationOffset, rangeSize) return destination } @@ -1156,7 +1173,10 @@ public actual fun FloatArray.copyInto(destination: FloatArray, destinationOffset @SinceKotlin("1.3") @Suppress("ACTUAL_FUNCTION_WITH_DEFAULT_ARGUMENTS") public actual fun DoubleArray.copyInto(destination: DoubleArray, destinationOffset: Int = 0, startIndex: Int = 0, endIndex: Int = size): DoubleArray { - arrayCopy(this, startIndex, destination, destinationOffset, endIndex - startIndex) + AbstractList.checkRangeIndexes(startIndex, endIndex, this.size) + val rangeSize = endIndex - startIndex + AbstractList.checkRangeIndexes(destinationOffset, destinationOffset + rangeSize, destination.size) + kotlin.wasm.internal.copyWasmArray(this.storage, destination.storage, startIndex, destinationOffset, rangeSize) return destination } @@ -1179,7 +1199,10 @@ public actual fun DoubleArray.copyInto(destination: DoubleArray, destinationOffs @SinceKotlin("1.3") @Suppress("ACTUAL_FUNCTION_WITH_DEFAULT_ARGUMENTS") public actual fun BooleanArray.copyInto(destination: BooleanArray, destinationOffset: Int = 0, startIndex: Int = 0, endIndex: Int = size): BooleanArray { - arrayCopy(this, startIndex, destination, destinationOffset, endIndex - startIndex) + AbstractList.checkRangeIndexes(startIndex, endIndex, this.size) + val rangeSize = endIndex - startIndex + AbstractList.checkRangeIndexes(destinationOffset, destinationOffset + rangeSize, destination.size) + kotlin.wasm.internal.copyWasmArray(this.storage, destination.storage, startIndex, destinationOffset, rangeSize) return destination } @@ -1202,7 +1225,10 @@ public actual fun BooleanArray.copyInto(destination: BooleanArray, destinationOf @SinceKotlin("1.3") @Suppress("ACTUAL_FUNCTION_WITH_DEFAULT_ARGUMENTS") public actual fun CharArray.copyInto(destination: CharArray, destinationOffset: Int = 0, startIndex: Int = 0, endIndex: Int = size): CharArray { - arrayCopy(this, startIndex, destination, destinationOffset, endIndex - startIndex) + AbstractList.checkRangeIndexes(startIndex, endIndex, this.size) + val rangeSize = endIndex - startIndex + AbstractList.checkRangeIndexes(destinationOffset, destinationOffset + rangeSize, destination.size) + kotlin.wasm.internal.copyWasmArray(this.storage, destination.storage, startIndex, destinationOffset, rangeSize) return destination } diff --git a/libraries/stdlib/wasm/src/generated/_WasmArrays.kt b/libraries/stdlib/wasm/src/generated/_WasmArrays.kt index 3db1676adf2..b28e080e9c3 100644 --- a/libraries/stdlib/wasm/src/generated/_WasmArrays.kt +++ b/libraries/stdlib/wasm/src/generated/_WasmArrays.kt @@ -32,11 +32,11 @@ internal class WasmAnyArray(size: Int) { @WasmOp(WasmOp.ARRAY_LEN) fun len(): Int = - implementedAsIntrinsic + implementedAsIntrinsic } -internal inline fun WasmAnyArray.copyTo(destination: WasmAnyArray, sourceIndex: Int, destinationIndex: Int, length: Int) { - wasm_array_copy(destination, destinationIndex, this, sourceIndex, length) +internal inline fun copyWasmArray(source: WasmAnyArray, destination: WasmAnyArray, sourceIndex: Int, destinationIndex: Int, length: Int) { + wasm_array_copy(destination, destinationIndex, source, sourceIndex, length) } internal inline fun WasmAnyArray.fill(size: Int, init: (Int) -> Any?) { @@ -58,11 +58,11 @@ internal class WasmByteArray(size: Int) { @WasmOp(WasmOp.ARRAY_LEN) fun len(): Int = - implementedAsIntrinsic + implementedAsIntrinsic } -internal inline fun WasmByteArray.copyTo(destination: WasmByteArray, sourceIndex: Int, destinationIndex: Int, length: Int) { - wasm_array_copy(destination, destinationIndex, this, sourceIndex, length) +internal inline fun copyWasmArray(source: WasmByteArray, destination: WasmByteArray, sourceIndex: Int, destinationIndex: Int, length: Int) { + wasm_array_copy(destination, destinationIndex, source, sourceIndex, length) } internal inline fun WasmByteArray.fill(size: Int, init: (Int) -> Byte) { @@ -84,11 +84,11 @@ internal class WasmCharArray(size: Int) { @WasmOp(WasmOp.ARRAY_LEN) fun len(): Int = - implementedAsIntrinsic + implementedAsIntrinsic } -internal inline fun WasmCharArray.copyTo(destination: WasmCharArray, sourceIndex: Int, destinationIndex: Int, length: Int) { - wasm_array_copy(destination, destinationIndex, this, sourceIndex, length) +internal inline fun copyWasmArray(source: WasmCharArray, destination: WasmCharArray, sourceIndex: Int, destinationIndex: Int, length: Int) { + wasm_array_copy(destination, destinationIndex, source, sourceIndex, length) } internal inline fun WasmCharArray.fill(size: Int, init: (Int) -> Char) { @@ -110,11 +110,11 @@ internal class WasmShortArray(size: Int) { @WasmOp(WasmOp.ARRAY_LEN) fun len(): Int = - implementedAsIntrinsic + implementedAsIntrinsic } -internal inline fun WasmShortArray.copyTo(destination: WasmShortArray, sourceIndex: Int, destinationIndex: Int, length: Int) { - wasm_array_copy(destination, destinationIndex, this, sourceIndex, length) +internal inline fun copyWasmArray(source: WasmShortArray, destination: WasmShortArray, sourceIndex: Int, destinationIndex: Int, length: Int) { + wasm_array_copy(destination, destinationIndex, source, sourceIndex, length) } internal inline fun WasmShortArray.fill(size: Int, init: (Int) -> Short) { @@ -136,11 +136,11 @@ internal class WasmIntArray(size: Int) { @WasmOp(WasmOp.ARRAY_LEN) fun len(): Int = - implementedAsIntrinsic + implementedAsIntrinsic } -internal inline fun WasmIntArray.copyTo(destination: WasmIntArray, sourceIndex: Int, destinationIndex: Int, length: Int) { - wasm_array_copy(destination, destinationIndex, this, sourceIndex, length) +internal inline fun copyWasmArray(source: WasmIntArray, destination: WasmIntArray, sourceIndex: Int, destinationIndex: Int, length: Int) { + wasm_array_copy(destination, destinationIndex, source, sourceIndex, length) } internal inline fun WasmIntArray.fill(size: Int, init: (Int) -> Int) { @@ -162,11 +162,11 @@ internal class WasmLongArray(size: Int) { @WasmOp(WasmOp.ARRAY_LEN) fun len(): Int = - implementedAsIntrinsic + implementedAsIntrinsic } -internal inline fun WasmLongArray.copyTo(destination: WasmLongArray, sourceIndex: Int, destinationIndex: Int, length: Int) { - wasm_array_copy(destination, destinationIndex, this, sourceIndex, length) +internal inline fun copyWasmArray(source: WasmLongArray, destination: WasmLongArray, sourceIndex: Int, destinationIndex: Int, length: Int) { + wasm_array_copy(destination, destinationIndex, source, sourceIndex, length) } internal inline fun WasmLongArray.fill(size: Int, init: (Int) -> Long) { @@ -188,11 +188,11 @@ internal class WasmFloatArray(size: Int) { @WasmOp(WasmOp.ARRAY_LEN) fun len(): Int = - implementedAsIntrinsic + implementedAsIntrinsic } -internal inline fun WasmFloatArray.copyTo(destination: WasmFloatArray, sourceIndex: Int, destinationIndex: Int, length: Int) { - wasm_array_copy(destination, destinationIndex, this, sourceIndex, length) +internal inline fun copyWasmArray(source: WasmFloatArray, destination: WasmFloatArray, sourceIndex: Int, destinationIndex: Int, length: Int) { + wasm_array_copy(destination, destinationIndex, source, sourceIndex, length) } internal inline fun WasmFloatArray.fill(size: Int, init: (Int) -> Float) { @@ -214,11 +214,11 @@ internal class WasmDoubleArray(size: Int) { @WasmOp(WasmOp.ARRAY_LEN) fun len(): Int = - implementedAsIntrinsic + implementedAsIntrinsic } -internal inline fun WasmDoubleArray.copyTo(destination: WasmDoubleArray, sourceIndex: Int, destinationIndex: Int, length: Int) { - wasm_array_copy(destination, destinationIndex, this, sourceIndex, length) +internal inline fun copyWasmArray(source: WasmDoubleArray, destination: WasmDoubleArray, sourceIndex: Int, destinationIndex: Int, length: Int) { + wasm_array_copy(destination, destinationIndex, source, sourceIndex, length) } internal inline fun WasmDoubleArray.fill(size: Int, init: (Int) -> Double) { diff --git a/libraries/stdlib/wasm/src/kotlin/collections/ArraysWasm.kt b/libraries/stdlib/wasm/src/kotlin/collections/ArraysWasm.kt index 862b4c5df44..7143e735332 100644 --- a/libraries/stdlib/wasm/src/kotlin/collections/ArraysWasm.kt +++ b/libraries/stdlib/wasm/src/kotlin/collections/ArraysWasm.kt @@ -5,84 +5,6 @@ package kotlin.collections -import kotlin.wasm.internal.copyTo - -private inline fun rangeCheck(index: Int, count: Int, arraySize: Int) { - if (index < 0 || count < 0 || index + count > arraySize) throw IndexOutOfBoundsException() -} - -internal inline fun arrayCopy(array: ByteArray, fromIndex: Int, destination: ByteArray, toIndex: Int, count: Int) { - val srcStorage = array.storage - rangeCheck(fromIndex, count, srcStorage.len()) - val dstStorage = destination.storage - rangeCheck(toIndex, count, dstStorage.len()) - srcStorage.copyTo(dstStorage, fromIndex, toIndex, count) -} - -internal inline fun arrayCopy(array: ShortArray, fromIndex: Int, destination: ShortArray, toIndex: Int, count: Int) { - val srcStorage = array.storage - rangeCheck(fromIndex, count, srcStorage.len()) - val dstStorage = destination.storage - rangeCheck(toIndex, count, dstStorage.len()) - srcStorage.copyTo(dstStorage, fromIndex, toIndex, count) -} - -internal inline fun arrayCopy(array: CharArray, fromIndex: Int, destination: CharArray, toIndex: Int, count: Int) { - val srcStorage = array.storage - rangeCheck(fromIndex, count, srcStorage.len()) - val dstStorage = destination.storage - rangeCheck(toIndex, count, dstStorage.len()) - srcStorage.copyTo(dstStorage, fromIndex, toIndex, count) -} - -internal inline fun arrayCopy(array: IntArray, fromIndex: Int, destination: IntArray, toIndex: Int, count: Int) { - val srcStorage = array.storage - rangeCheck(fromIndex, count, srcStorage.len()) - val dstStorage = destination.storage - rangeCheck(toIndex, count, dstStorage.len()) - srcStorage.copyTo(dstStorage, fromIndex, toIndex, count) -} - -internal inline fun arrayCopy(array: LongArray, fromIndex: Int, destination: LongArray, toIndex: Int, count: Int) { - val srcStorage = array.storage - rangeCheck(fromIndex, count, srcStorage.len()) - val dstStorage = destination.storage - rangeCheck(toIndex, count, dstStorage.len()) - srcStorage.copyTo(dstStorage, fromIndex, toIndex, count) -} - -internal inline fun arrayCopy(array: FloatArray, fromIndex: Int, destination: FloatArray, toIndex: Int, count: Int) { - val srcStorage = array.storage - rangeCheck(fromIndex, count, srcStorage.len()) - val dstStorage = destination.storage - rangeCheck(toIndex, count, dstStorage.len()) - srcStorage.copyTo(dstStorage, fromIndex, toIndex, count) -} - -internal inline fun arrayCopy(array: DoubleArray, fromIndex: Int, destination: DoubleArray, toIndex: Int, count: Int) { - val srcStorage = array.storage - rangeCheck(fromIndex, count, srcStorage.len()) - val dstStorage = destination.storage - rangeCheck(toIndex, count, dstStorage.len()) - srcStorage.copyTo(dstStorage, fromIndex, toIndex, count) -} - -internal inline fun arrayCopy(array: BooleanArray, fromIndex: Int, destination: BooleanArray, toIndex: Int, count: Int) { - val srcStorage = array.storage - rangeCheck(fromIndex, count, srcStorage.len()) - val dstStorage = destination.storage - rangeCheck(toIndex, count, dstStorage.len()) - srcStorage.copyTo(dstStorage, fromIndex, toIndex, count) -} - -internal inline fun arrayCopy(array: Array, fromIndex: Int, destination: Array, toIndex: Int, count: Int) { - val srcStorage = array.storage - rangeCheck(fromIndex, count, srcStorage.len()) - val dstStorage = destination.storage - rangeCheck(toIndex, count, dstStorage.len()) - srcStorage.copyTo(dstStorage, fromIndex, toIndex, count) -} - /** * Returns a *typed* array containing all of the elements of this collection. * diff --git a/libraries/stdlib/wasm/src/kotlin/text/StringBuilderWasm.kt b/libraries/stdlib/wasm/src/kotlin/text/StringBuilderWasm.kt index 771d4dc50c3..80bdcf2dd82 100644 --- a/libraries/stdlib/wasm/src/kotlin/text/StringBuilderWasm.kt +++ b/libraries/stdlib/wasm/src/kotlin/text/StringBuilderWasm.kt @@ -8,13 +8,13 @@ package kotlin.text import kotlin.wasm.internal.* internal fun insertString(array: CharArray, destinationIndex: Int, value: String, sourceIndex: Int, count: Int): Int { - value.chars.copyTo(array.storage, sourceIndex, destinationIndex, count) + copyWasmArray(value.chars, array.storage, sourceIndex, destinationIndex, count) return count } internal fun unsafeStringFromCharArray(array: CharArray, start: Int, size: Int): String { val copy = WasmCharArray(size) - array.storage.copyTo(copy, start, 0, size) + copyWasmArray(array.storage, copy, start, 0, size) return String.unsafeFromCharArray(copy) } diff --git a/libraries/stdlib/wasm/src/kotlin/text/StringsWasm.kt b/libraries/stdlib/wasm/src/kotlin/text/StringsWasm.kt index 89fde9f7886..fd033c17941 100644 --- a/libraries/stdlib/wasm/src/kotlin/text/StringsWasm.kt +++ b/libraries/stdlib/wasm/src/kotlin/text/StringsWasm.kt @@ -74,7 +74,7 @@ public actual fun String(chars: CharArray, offset: Int, length: Int): String { throw IndexOutOfBoundsException() val copy = WasmCharArray(length) - chars.storage.copyTo(copy, offset, 0, length) + copyWasmArray(chars.storage, copy, offset, 0, length) return String.unsafeFromCharArray(copy) } @@ -87,7 +87,7 @@ public actual fun CharArray.concatToString(): String { val thisStorage = this.storage val thisLength = thisStorage.len() val copy = WasmCharArray(thisLength) - this.storage.copyTo(copy, 0, 0, thisLength) + copyWasmArray(this.storage, copy, 0, 0, thisLength) return String.unsafeFromCharArray(copy) } @@ -108,7 +108,7 @@ public actual fun CharArray.concatToString(startIndex: Int = 0, endIndex: Int = val length = endIndex - startIndex val copy = WasmCharArray(length) - this.storage.copyTo(copy, startIndex, 0, length) + copyWasmArray(this.storage, copy, startIndex, 0, length) return String.unsafeFromCharArray(copy) } @@ -121,7 +121,7 @@ public actual fun String.toCharArray(): CharArray { val thisChars = this.chars val thisLength = thisChars.len() val newArray = CharArray(thisLength) - thisChars.copyTo(newArray.storage, 0, 0, thisLength) + copyWasmArray(thisChars, newArray.storage, 0, 0, thisLength) return newArray } @@ -141,7 +141,7 @@ public actual fun String.toCharArray(startIndex: Int = 0, endIndex: Int = this.l AbstractList.checkBoundsIndexes(startIndex, endIndex, length) val newLength = endIndex - startIndex val newArray = CharArray(newLength) - this.chars.copyTo(newArray.storage, startIndex, 0, newLength) + copyWasmArray(this.chars, newArray.storage, startIndex, 0, newLength) return newArray } diff --git a/libraries/tools/kotlin-stdlib-gen/src/templates/Arrays.kt b/libraries/tools/kotlin-stdlib-gen/src/templates/Arrays.kt index 96755d3791f..0c1d8c3950b 100644 --- a/libraries/tools/kotlin-stdlib-gen/src/templates/Arrays.kt +++ b/libraries/tools/kotlin-stdlib-gen/src/templates/Arrays.kt @@ -919,6 +919,17 @@ object ArrayOps : TemplateGroupBase() { """ } } + on(Backend.Wasm) { + body { + """ + AbstractList.checkRangeIndexes(startIndex, endIndex, this.size) + val rangeSize = endIndex - startIndex + AbstractList.checkRangeIndexes(destinationOffset, destinationOffset + rangeSize, destination.size) + kotlin.wasm.internal.copyWasmArray(this.storage, destination.storage, startIndex, destinationOffset, rangeSize) + return destination + """ + } + } } } }