[WASM] Add array copy intrinsic

This commit is contained in:
Igor Yakovlev
2022-06-29 18:51:31 +02:00
committed by teamcity
parent 8306b1bd71
commit 0ea7e8b70a
17 changed files with 218 additions and 203 deletions
+6 -3
View File
@@ -104,7 +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 $name.fill(size: Int, init: (Int) -> $type) {
@@ -113,8 +117,7 @@ fun wasmArrayForType(
set(i, init(i))
i++
}
}
}
""".trimIndent()
}