From 5189e62b76ca914f8f0f28d12c0a67458b45858d Mon Sep 17 00:00:00 2001 From: Larry Ewing Date: Mon, 10 Apr 2023 11:39:27 -0500 Subject: [PATCH 1/3] Turn Wasm exception handling on by default and use WasmEnableExceptionHandling as the default value for WasmEnableSIMD --- src/mono/wasm/build/WasmApp.targets | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/mono/wasm/build/WasmApp.targets b/src/mono/wasm/build/WasmApp.targets index 22f26139e3be2..b388b0f4c7e38 100644 --- a/src/mono/wasm/build/WasmApp.targets +++ b/src/mono/wasm/build/WasmApp.targets @@ -69,8 +69,8 @@ Defaults to false. - $(WasmAotProfilePath) - Path to an AOT profile file. - $(WasmEnableLegacyJsInterop) - Include support for legacy JS interop. Defaults to true. - - $(WasmEnableExceptionHandling) - Enable support for the WASM Exception Handling feature. - - $(WasmEnableSIMD) - Enable support for the WASM SIMD feature. + - $(WasmEnableExceptionHandling) - Enable support for the WASM post MVP Exception Handling runtime extension. + - $(WasmEnableSIMD) - Enable support for the WASM post MVP SIMD runtime extension. - $(WasmEnableWebcil) - Enable conversion of assembly .dlls to .webcil - $(WasmIncludeFullIcuData) - Loads full ICU data (icudt.dat). Defaults to false. Only applicable when InvariantGlobalization=false. - $(WasmIcuDataFileName) - Name/path of ICU globalization file loaded to app. Only when InvariantGloblization=false and WasmIncludeFullIcuData=false. @@ -99,8 +99,10 @@ true - false - true + + < + true + $(WasmEnableExceptionHandling) true From f0f9a714705f732f5edb2b2dd66f7fcab06362d4 Mon Sep 17 00:00:00 2001 From: Larry Ewing Date: Mon, 10 Apr 2023 12:26:40 -0500 Subject: [PATCH 2/3] Update WasmApp.targets fix typo --- src/mono/wasm/build/WasmApp.targets | 1 - 1 file changed, 1 deletion(-) diff --git a/src/mono/wasm/build/WasmApp.targets b/src/mono/wasm/build/WasmApp.targets index b388b0f4c7e38..fc0977f282271 100644 --- a/src/mono/wasm/build/WasmApp.targets +++ b/src/mono/wasm/build/WasmApp.targets @@ -100,7 +100,6 @@ true - < true $(WasmEnableExceptionHandling) true From ae4d360951c438391bd2b49387e5918bf6dd0898 Mon Sep 17 00:00:00 2001 From: Radek Doulik Date: Fri, 14 Apr 2023 17:24:51 +0200 Subject: [PATCH 3/3] Add --experimental-wasm-eh to nodejs arguments --- src/mono/wasm/Wasm.Build.Tests/HostRunner/NodeJSHostRunner.cs | 4 ++-- src/mono/wasm/Wasm.Build.Tests/WasmSIMDTests.cs | 4 ++-- .../templates/templates/console/runtimeconfig.template.json | 3 ++- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/mono/wasm/Wasm.Build.Tests/HostRunner/NodeJSHostRunner.cs b/src/mono/wasm/Wasm.Build.Tests/HostRunner/NodeJSHostRunner.cs index 9c81295012616..3f1bc819ba2a6 100644 --- a/src/mono/wasm/Wasm.Build.Tests/HostRunner/NodeJSHostRunner.cs +++ b/src/mono/wasm/Wasm.Build.Tests/HostRunner/NodeJSHostRunner.cs @@ -8,8 +8,8 @@ namespace Wasm.Build.Tests; public class NodeJSHostRunner : IHostRunner { public string GetTestCommand() => "wasm test"; - public string GetXharnessArgsWindowsOS(XHarnessArgsOptions options) => $"--js-file={options.jsRelativePath} --engine=NodeJS -v trace --engine-arg=--experimental-wasm-simd"; - public string GetXharnessArgsOtherOS(XHarnessArgsOptions options) => $"--js-file={options.jsRelativePath} --engine=NodeJS -v trace --locale={options.environmentLocale} --engine-arg=--experimental-wasm-simd"; + public string GetXharnessArgsWindowsOS(XHarnessArgsOptions options) => $"--js-file={options.jsRelativePath} --engine=NodeJS -v trace --engine-arg=--experimental-wasm-simd --engine-arg=--experimental-wasm-eh"; + public string GetXharnessArgsOtherOS(XHarnessArgsOptions options) => $"--js-file={options.jsRelativePath} --engine=NodeJS -v trace --locale={options.environmentLocale} --engine-arg=--experimental-wasm-simd --engine-arg=--experimental-wasm-eh"; public bool UseWasmConsoleOutput() => true; public bool CanRunWBT() => true; } diff --git a/src/mono/wasm/Wasm.Build.Tests/WasmSIMDTests.cs b/src/mono/wasm/Wasm.Build.Tests/WasmSIMDTests.cs index c4db21e18ad53..96183d8cdeac7 100644 --- a/src/mono/wasm/Wasm.Build.Tests/WasmSIMDTests.cs +++ b/src/mono/wasm/Wasm.Build.Tests/WasmSIMDTests.cs @@ -42,7 +42,7 @@ public void Build_NoAOT_ShouldNotRelink(BuildArgs buildArgs, RunHost host, strin Assert.DoesNotContain("Compiling native assets with emcc", output); RunAndTestWasmApp(buildArgs, - extraXHarnessArgs: host == RunHost.NodeJS ? "--engine-arg=--experimental-wasm-simd" : "", + extraXHarnessArgs: host == RunHost.NodeJS ? "--engine-arg=--experimental-wasm-simd --engine-arg=--experimental-wasm-eh" : "", expectedExitCode: 42, test: output => { @@ -67,7 +67,7 @@ public void PublishWithSIMD_AOT(BuildArgs buildArgs, RunHost host, string id) DotnetWasmFromRuntimePack: false)); RunAndTestWasmApp(buildArgs, - extraXHarnessArgs: host == RunHost.NodeJS ? "--engine-arg=--experimental-wasm-simd" : "", + extraXHarnessArgs: host == RunHost.NodeJS ? "--engine-arg=--experimental-wasm-simd --engine-arg=--experimental-wasm-eh" : "", expectedExitCode: 42, test: output => { diff --git a/src/mono/wasm/templates/templates/console/runtimeconfig.template.json b/src/mono/wasm/templates/templates/console/runtimeconfig.template.json index 0be5fb5929fcd..49721faa0baa4 100644 --- a/src/mono/wasm/templates/templates/console/runtimeconfig.template.json +++ b/src/mono/wasm/templates/templates/console/runtimeconfig.template.json @@ -6,7 +6,8 @@ "js-path": "main.mjs", "Host": "nodejs", "host-args": [ - "--experimental-wasm-simd" + "--experimental-wasm-simd", + "--experimental-wasm-eh" ] } ]