Skip to content

Skip profiler leave callback on wasm instead of asserting - #130955

Merged
tannergooding merged 1 commit into
dotnet:mainfrom
tannergooding:wasm-prof-leave-noop
Jul 17, 2026
Merged

tannergooding merged 1 commit into
dotnet:mainfrom
tannergooding:wasm-prof-leave-noop

Conversation

@tannergooding

Copy link
Copy Markdown
Member

Turns the genProfilingLeaveCallback NYI_WASM stub into an explicit no-op on WASM.

genReturn and genJmpPlaceArgs call genProfilingLeaveCallback whenever compIsProfilerHookNeeded(), but the matching enter callback in genFnProlog is compiled out for WASM (#if !TARGET_WASM). So WASM would emit a leave hook with no matching enter hook. In normal builds NYI_WASM is a no-op, but under the JitWasmNyiToR2RUnsupported diagnostic it asserts and flags profiler-leave as an unimplemented oper, rejecting those methods for R2R.

This makes the interim behavior explicit and symmetric with the enter side: emit nothing, keeping WASM consistently free of ELT hooks. It is not a working profiler-ELT implementation — the full enter/leave/tailcall codegen for WASM is tracked by #130953.

No behavioral change in normal DEBUG/Release builds (both no-op already); the change only affects the JitWasmNyiToR2RUnsupported diagnostic path.

Note

This PR was authored with the assistance of GitHub Copilot.

genProfilingLeaveCallback was a NYI_WASM stub, so genReturn emits a leave
hook with no matching enter hook (the enter callback in genFnProlog is
compiled out for wasm via #if !TARGET_WASM). Under the R2R-unsupported
diagnostic this flags profiler-leave as an unimplemented oper and rejects
those methods. Make the interim behavior explicit: emit nothing, keeping
wasm consistently free of ELT hooks until the full feature is implemented
(dotnet#130953).

Co-authored-by: Copilot App <[email protected]>
Copilot AI review requested due to automatic review settings July 17, 2026 05:38
@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 Jul 17, 2026
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 5 pipeline(s).
10 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

@dotnet-policy-service

Copy link
Copy Markdown
Contributor

Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch
See info in area-owners.md if you want to be subscribed.

@tannergooding

Copy link
Copy Markdown
Member Author

CC. @adamperlin, @lewing

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

This PR makes the WASM implementation of CodeGen::genProfilingLeaveCallback an explicit no-op (instead of calling NYI_WASM), so WASM codegen doesn’t reject methods due to an unimplemented profiler leave hook.

Changes:

  • Replace the NYI_WASM("genProfilingLeaveCallback") stub in the WASM backend with an explicit no-op and explanatory comment.
Show a summary per file
File Description
src/coreclr/jit/codegenwasm.cpp Makes genProfilingLeaveCallback on WASM explicitly emit nothing (no NYI_WASM), documenting the intended interim behavior.

Copilot's findings

  • Files reviewed: 1/1 changed files
  • Comments generated: 1

Comment thread src/coreclr/jit/codegenwasm.cpp Resolved
@tannergooding

Copy link
Copy Markdown
Member Author

/ba-g unrelated LibraryImport test failure on windows x86

@tannergooding
tannergooding merged commit 299a040 into dotnet:main Jul 17, 2026
140 of 142 checks passed
@tannergooding
tannergooding deleted the wasm-prof-leave-noop branch July 17, 2026 16:53
@dotnet-milestone-bot dotnet-milestone-bot Bot added this to the 11.0-preview7 milestone Jul 18, 2026
@github-actions github-actions Bot locked and limited conversation to collaborators Aug 17, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

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.

3 participants