diff --git a/compiler/ir/backend.wasm/src/org/jetbrains/kotlin/backend/wasm/compiler.kt b/compiler/ir/backend.wasm/src/org/jetbrains/kotlin/backend/wasm/compiler.kt index a43ffdbaedc..c8a61c73249 100644 --- a/compiler/ir/backend.wasm/src/org/jetbrains/kotlin/backend/wasm/compiler.kt +++ b/compiler/ir/backend.wasm/src/org/jetbrains/kotlin/backend/wasm/compiler.kt @@ -250,8 +250,6 @@ fun WasmCompiledModuleFragment.generateAsyncJsWrapper( }.sorted() .joinToString("\n") - val d = "$" - //language=js return """ export async function instantiate(imports={}, runInitializer=true) { @@ -320,23 +318,11 @@ $imports } } catch (e) { if (e instanceof WebAssembly.CompileError) { - const styles = []; - const styled = (t, css, escSeq) => isBrowser ? (styles.push(css, /* reset */""), `%c$d{t}%c`) : `\x1b[$d{escSeq}m$d{t}\x1b[m`; - const name = t => styled(t, "font-weight:bold", 1); - const uri = t => styled(t, "text-decoration:underline", 4); - const cli = t => styled(t, "font-family:monospace", 2); - - let text = `Using experimental Kotlin/Wasm may require enabling experimental features in the target environment. - -- $d{name("Chrome")}: enable $d{name("WebAssembly Garbage Collection")} at $d{uri("chrome://flags/#enable-webassembly-garbage-collection")} or run the program with the $d{cli("--js-flags=--experimental-wasm-gc")} command line argument. -- $d{name("Firefox")}: enable $d{name("javascript.options.wasm_function_references")} and $d{name("javascript.options.wasm_gc")} at $d{uri("about:config")}. -- $d{name("Edge")}: run the program with the $d{cli("--js-flags=--experimental-wasm-gc")} command line argument. -- $d{name("Node.js")}: run the program with the $d{cli("--experimental-wasm-gc")} command line argument. - -For more information see $d{uri("https://kotl.in/wasm_help/")}. + let text = `Please make sure that your runtime environment supports the latest version of Wasm GC and Exception-Handling proposals. +For more information, see https://kotl.in/wasm-help `; if (isBrowser) { - console.error(text, ...styles); + console.error(text); } else { const t = "\n" + text; if (typeof console !== "undefined" && console.log !== void 0) diff --git a/compiler/testData/codegen/box/size/add.kt b/compiler/testData/codegen/box/size/add.kt index 99875d3e180..45599cf96ab 100644 --- a/compiler/testData/codegen/box/size/add.kt +++ b/compiler/testData/codegen/box/size/add.kt @@ -1,7 +1,7 @@ // TARGET_BACKEND: WASM // WASM_DCE_EXPECTED_OUTPUT_SIZE: wasm 12_946 -// WASM_DCE_EXPECTED_OUTPUT_SIZE: mjs 5_456 +// WASM_DCE_EXPECTED_OUTPUT_SIZE: mjs 4_526 // FILE: test.kt diff --git a/compiler/testData/codegen/box/size/helloWorld.kt b/compiler/testData/codegen/box/size/helloWorld.kt index 11424830689..ef1ae7a82d8 100644 --- a/compiler/testData/codegen/box/size/helloWorld.kt +++ b/compiler/testData/codegen/box/size/helloWorld.kt @@ -1,7 +1,7 @@ // TARGET_BACKEND: WASM // WASM_DCE_EXPECTED_OUTPUT_SIZE: wasm 48_430 -// WASM_DCE_EXPECTED_OUTPUT_SIZE: mjs 5_482 +// WASM_DCE_EXPECTED_OUTPUT_SIZE: mjs 4_552 fun box(): String { println("Hello, World!") diff --git a/compiler/testData/codegen/box/size/helloWorldDOM.kt b/compiler/testData/codegen/box/size/helloWorldDOM.kt index 381a9fb5cad..53fc0e05c7b 100644 --- a/compiler/testData/codegen/box/size/helloWorldDOM.kt +++ b/compiler/testData/codegen/box/size/helloWorldDOM.kt @@ -1,7 +1,7 @@ // TARGET_BACKEND: WASM // WASM_DCE_EXPECTED_OUTPUT_SIZE: wasm 14_307 -// WASM_DCE_EXPECTED_OUTPUT_SIZE: mjs 6_011 +// WASM_DCE_EXPECTED_OUTPUT_SIZE: mjs 5_081 // FILE: test.kt diff --git a/compiler/testData/codegen/box/size/objectsOptimization.kt b/compiler/testData/codegen/box/size/objectsOptimization.kt index f70fb47cd49..70abbd49680 100644 --- a/compiler/testData/codegen/box/size/objectsOptimization.kt +++ b/compiler/testData/codegen/box/size/objectsOptimization.kt @@ -1,7 +1,7 @@ // TARGET_BACKEND: WASM // WASM_DCE_EXPECTED_OUTPUT_SIZE: wasm 18_621 -// WASM_DCE_EXPECTED_OUTPUT_SIZE: mjs 5_328 +// WASM_DCE_EXPECTED_OUTPUT_SIZE: mjs 4_398 // Muting because K2 DCE code size was less than expected (17377) // IGNORE_BACKEND_K2: WASM diff --git a/compiler/testData/codegen/box/size/ok.kt b/compiler/testData/codegen/box/size/ok.kt index 71f7e74f1c8..22148b8e075 100644 --- a/compiler/testData/codegen/box/size/ok.kt +++ b/compiler/testData/codegen/box/size/ok.kt @@ -1,6 +1,6 @@ // TARGET_BACKEND: WASM // WASM_DCE_EXPECTED_OUTPUT_SIZE: wasm 12_988 -// WASM_DCE_EXPECTED_OUTPUT_SIZE: mjs 5_328 +// WASM_DCE_EXPECTED_OUTPUT_SIZE: mjs 4_398 fun box() = "OK" \ No newline at end of file