Very experimental WASM code generation by MST in contexts of Int and Real #158

Closed
CommanderTvis wants to merge 16 commits from feature/binaryen into dev
Showing only changes of commit ca219fa91b - Show all commits

View File

@ -63,7 +63,7 @@ internal sealed class WasmBuilder<T>(val binaryenType: Type, val kmathAlgebra: A
) )
setOptimizeLevel(3) setOptimizeLevel(3)
// optimizeFunction("executable") optimizeFunction("executable")
addFunctionExport("executable", "executable") addFunctionExport("executable", "executable")
val res = emitBinary() val res = emitBinary()
dispose() dispose()
@ -74,7 +74,7 @@ internal sealed class WasmBuilder<T>(val binaryenType: Type, val kmathAlgebra: A
val i = Instance(c, js("{}") as Any) val i = Instance(c, js("{}") as Any)
return Expression { args -> return Expression { args ->
val params = keys.map { StringSymbol(it) }.map { args.getValue(it) }.toTypedArray() val params = keys.map(::StringSymbol).map(args::getValue).toTypedArray()
keys.clear() keys.clear()
spreader(i.exports.asDynamic().executable, params) as T spreader(i.exports.asDynamic().executable, params) as T
} }