Skip to content

[Wasm RyuJit] codegen for callfinally#128348

Merged
AndyAyersMS merged 1 commit into
dotnet:mainfrom
AndyAyersMS:WasmCallfinally
May 19, 2026
Merged

[Wasm RyuJit] codegen for callfinally#128348
AndyAyersMS merged 1 commit into
dotnet:mainfrom
AndyAyersMS:WasmCallfinally

Conversation

@AndyAyersMS

Copy link
Copy Markdown
Member

Implement the codegen needed to call the finally, in the cases where the finally was not inlined and needs to be invoked on a normal try exit.

Implement the codegen needed to call the finally, in the cases where the finally
was not inlined and needs to be invoked on a normal try exit.
Copilot AI review requested due to automatic review settings May 19, 2026 00:21
@github-actions github-actions Bot added the area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI label May 19, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Implements WASM RyuJIT codegen for BBJ_CALLFINALLY blocks, replacing the previous NYI_WASM stub. The new code emits an indirect WASM call to the finally funclet, passing SP and FP as pointer arguments, and emits an unreachable for retless calls.

Changes:

  • Replace NYI_WASM("genCallFinally") with real codegen.
  • Build the finally's WASM function signature (two pointer args, no return) via getWasmTypeSymbol.
  • Push SP/FP locals plus a funclet address constant, issue an indirect call, and emit unreachable when BBF_RETLESS_CALL is set.

@AndyAyersMS

Copy link
Copy Markdown
Member Author

@kg PTAL
fyi @dotnet/wasm-contrib

@AndyAyersMS
AndyAyersMS requested a review from kg May 19, 2026 01:12
@AndyAyersMS
AndyAyersMS merged commit 2f5243c into dotnet:main May 19, 2026
137 of 140 checks passed
@dotnet-milestone-bot dotnet-milestone-bot Bot added this to the 11.0-preview6 milestone May 21, 2026
@pavelsavara pavelsavara added the arch-wasm WebAssembly architecture label Jun 16, 2026
@dotnet-policy-service

Copy link
Copy Markdown
Contributor

Tagging subscribers to 'arch-wasm': @lewing, @pavelsavara
See info in area-owners.md if you want to be subscribed.

eiriktsarpalis pushed a commit that referenced this pull request Jul 15, 2026
Implement the codegen needed to call the finally, in the cases where the
finally was not inlined and needs to be invoked on a normal try exit.
@github-actions github-actions Bot locked and limited conversation to collaborators Jul 16, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

arch-wasm WebAssembly architecture area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants