[wasm] Implement the ENDFINALLY opcode in the jiterpreter (#84273)
authorKatelyn Gadd <kg@luminance.org>
Wed, 5 Apr 2023 12:23:38 +0000 (05:23 -0700)
committerGitHub <noreply@github.com>
Wed, 5 Apr 2023 12:23:38 +0000 (05:23 -0700)
commit66211eb2bbe05c9fc3b3191cad5d415d66ba49f5
tree8f34c548fd5770115baaf43ed350278bc60f1693
parent6114f1932e14269e5a23e201c4c58b091bbdf6af
[wasm] Implement the ENDFINALLY opcode in the jiterpreter (#84273)

* Mark the opcode following CALL_HANDLER interpreter opcodes as a back branch target
* In the jiterpreter, record each CALL_HANDLER location when compiling them
* Then when compiling an ENDFINALLY opcode check to see whether the branch target is one we recognize and if so do a branch, otherwise bail out
* Tweak CFG to filter out branch targets that are never used
* Add browser-bench measurement for try-finally
src/mono/mono/mini/interp/jiterpreter.c
src/mono/mono/mini/interp/transform.c
src/mono/sample/wasm/browser-bench/Exceptions.cs
src/mono/wasm/runtime/jiterpreter-support.ts
src/mono/wasm/runtime/jiterpreter-trace-generator.ts
src/mono/wasm/runtime/jiterpreter.ts