[Wasm] Loader improvements

- Output ES modules instead of plain files
- Support -Xwasm-launcher=d8 for d8 shell used in tests and benchmarks.
- Reuse launcher generation logic in CLI and box tests runners.
- Create separate output directory for each box since
  there are multiple output files generated for each test.
- Stop using absolute paths in generate JS files
  to simplify running generated code on different machine
- Remove ">>>" from println output


Merge-request: KT-MR-5729
Merged-by: Svyatoslav Kuzmich <svyatoslav.kuzmich@jetbrains.com>
This commit is contained in:
Svyatoslav Kuzmich
2022-02-10 22:59:44 +00:00
committed by Space
parent 918a91dbdf
commit 4636f71076
12 changed files with 236 additions and 211 deletions
@@ -241,6 +241,14 @@ fun box(): String {
return "OK"
}
// TODO: Rewrite test to use module system
@JsFun("() => { globalThis.main = wasmExports; }")
external fun hackNonModuleExport()
fun main() {
hackNonModuleExport()
}
// FILE: functionTypes__after.js
const exportedFres = main.exportedF()(1, 20, 300)("<", ">");
+10
View File
@@ -1,3 +1,4 @@
// IGNORE_BACKEND: JS_IR, JS
// MODULE: main
// FILE: externals.kt
@@ -25,6 +26,15 @@ fun anyAsEI(any: Any): EI = any as EI
fun box(): String = "OK"
// TODO: Rewrite test to use module system
@JsFun("() => { globalThis.main = wasmExports; }")
external fun hackNonModuleExport()
fun main() {
hackNonModuleExport()
}
// FILE: jsExport__after.js
const c = main.makeC(300);