[WASM] Refactoring wasm array copy functions

This commit is contained in:
Igor Yakovlev
2022-07-07 16:19:27 +02:00
committed by teamcity
parent 39844af876
commit a0a66ffb96
8 changed files with 84 additions and 125 deletions
@@ -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
"""
}
}
}
}
}