Add support for the new WASM Exception Handling feature (#66435)
authorZoltan Varga <vargaz@gmail.com>
Fri, 11 Mar 2022 16:50:33 +0000 (11:50 -0500)
committerGitHub <noreply@github.com>
Fri, 11 Mar 2022 16:50:33 +0000 (11:50 -0500)
commit3e2d483153adcab27033340fa40ad0bcdc3acc2a
tree8b8a7b0adc8ee60b6ac23c59465381655a0e226f
parent718927c2cdf7f56cd2af40163b1853f8480f821e
Add support for the new WASM Exception Handling feature (#66435)

* [mono] Fix parsing options added by utils/options.h when using --response.

* [mono][jit] Add support for WASM EH.

WASM EH uses the newly added llvm catchpad instructions instead of
the old landingpad instructions. Add a --wasm-exceptions option
to control whenever the old JS style or the new WASM style code
is generated.

* Add support for the new WASM Exception Handling feature.

It is controlled by the $(WasmExceptionHandling) msbuild property.

Its only used in AOT mode, the interpreter mode wouldn't benefit from it.

The only file in the runtime which contains a throw or a catch is
llvm-runtime.cpp, so create 2 small static libraries from this file:
* libmono-wasm-eh-js - compiled to use JS style EH
* libmono-wasm-eh-wasm - compiled to use WASM style EH
This avoids the need to compile 2 versions of the whole runtime.

Requires emscripten 3.x.

* Add missing quote

* Update src/mono/mono/mini/CMakeLists.txt

Co-authored-by: Aleksey Kliger (λgeek) <akliger@gmail.com>
* Update src/mono/CMakeLists.txt

Co-authored-by: Aleksey Kliger (λgeek) <akliger@gmail.com>
Co-authored-by: Radek Doulik <radek.doulik@gmail.com>
Co-authored-by: Aleksey Kliger (λgeek) <akliger@gmail.com>
src/installer/pkg/sfx/Microsoft.NETCore.App/Directory.Build.props
src/mono/mono.proj
src/mono/mono/mini/CMakeLists.txt
src/mono/mono/mini/driver.c
src/mono/mono/mini/mini-llvm.c
src/mono/mono/utils/options-def.h
src/mono/wasm/build/WasmApp.Native.targets
src/mono/wasm/build/WasmApp.targets
src/mono/wasm/runtime/CMakeLists.txt