[WASM] Fix interop adapter for long strings
This commit is contained in:
@@ -185,6 +185,7 @@ class WasmSymbols(
|
||||
val nullableDoubleIeee754Equals = getInternalFunction("nullableDoubleIeee754Equals")
|
||||
|
||||
val unsafeGetScratchRawMemory = getInternalFunction("unsafeGetScratchRawMemory")
|
||||
val unsafeGetScratchRawMemorySize = getInternalFunction("unsafeGetScratchRawMemorySize")
|
||||
val startCoroutineUninterceptedOrReturnIntrinsics =
|
||||
(0..2).map { getInternalFunction("startCoroutineUninterceptedOrReturnIntrinsic$it") }
|
||||
|
||||
|
||||
+4
@@ -465,6 +465,10 @@ class BodyGenerator(
|
||||
body.buildConstI32Symbol(context.scratchMemAddr)
|
||||
}
|
||||
|
||||
wasmSymbols.unsafeGetScratchRawMemorySize -> {
|
||||
body.buildConstI32Symbol(WasmSymbol(context.scratchMemSizeInBytes))
|
||||
}
|
||||
|
||||
else -> {
|
||||
return false
|
||||
}
|
||||
|
||||
+1
@@ -16,6 +16,7 @@ interface WasmBaseCodegenContext {
|
||||
val backendContext: WasmBackendContext
|
||||
|
||||
val scratchMemAddr: WasmSymbol<Int>
|
||||
val scratchMemSizeInBytes: Int
|
||||
|
||||
fun referenceFunction(irFunction: IrFunctionSymbol): WasmSymbol<WasmFunction>
|
||||
fun referenceGlobalField(irField: IrFieldSymbol): WasmSymbol<WasmGlobal>
|
||||
|
||||
+1
-1
@@ -60,7 +60,7 @@ class WasmCompiledModuleFragment(val irBuiltIns: IrBuiltIns) {
|
||||
val initFunctions = mutableListOf<FunWithPriority>()
|
||||
|
||||
val scratchMemAddr = WasmSymbol<Int>()
|
||||
private val scratchMemSizeInBytes = 65_536
|
||||
val scratchMemSizeInBytes = 65_536
|
||||
|
||||
open class ReferencableElements<Ir, Wasm : Any> {
|
||||
val unbound = mutableMapOf<Ir, WasmSymbol<Wasm>>()
|
||||
|
||||
+3
@@ -25,6 +25,9 @@ class WasmModuleCodegenContextImpl(
|
||||
override val scratchMemAddr: WasmSymbol<Int>
|
||||
get() = wasmFragment.scratchMemAddr
|
||||
|
||||
override val scratchMemSizeInBytes: Int
|
||||
get() = wasmFragment.scratchMemSizeInBytes
|
||||
|
||||
override fun transformType(irType: IrType): WasmType {
|
||||
return with(typeTransformer) { irType.toWasmValueType() }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user