Skip to content

WASM JIT: profiler ELT (enter/leave/tailcall) hooks are not implemented #130953

Open

Description

@tannergooding

Summary

The experimental WASM JIT (clrjit_universal_wasm) does not implement profiler ELT (enter/leave/tailcall) hook codegen. Today this is asymmetric and inconsistent:

  • Enter hook: the genProfilingEnterCallback call in genFnProlog is fully compiled out for WASM (codegencommon.cpp, #if !TARGET_WASM), so WASM never emits the enter hook.
  • Leave / tailcall hooks: genReturn (codegencommon.cpp:7438) and genJmpPlaceArgs (codegencommon.cpp:7949) still call genProfilingLeaveCallback whenever compIsProfilerHookNeeded(), and the WASM implementation is a bare NYI_WASM("genProfilingLeaveCallback") (codegenwasm.cpp).

So when the runtime requests ELT profiling, a WASM method emits a leave hook with no matching enter hook and asserts.

Scope

This issue tracks implementing real profiler ELT hook codegen for WASM: emitting the enter/leave/tailcall helper calls (CORINFO_HELP_PROF_FCN_ENTER / _LEAVE / _TAILCALL) with the appropriate WASM calling sequence and frame/argument setup.

An interim change makes the leave/tailcall path a no-op on WASM (matching the already-skipped enter side) so WASM is internally consistent — no ELT hooks emitted — instead of emitting half of them and asserting. That unblocks measurement but does not provide working profiler ELT on WASM; this issue tracks the real implementation.

Impact

In an SPMI replay of the WASM altjit over libraries_tests_no_tiered_compilation + coreclr_tests, the leave-callback stub accounts for ~1,522 asserting contexts.

Note

This issue was authored with the assistance of GitHub Copilot.

Activity

  1. added
    area-CodeGen-coreclr
    on Jul 17, 2026
  2. added
    untriaged
    on Jul 17, 2026
  3. dotnet-policy-service commented on Jul 17, 2026

    @dotnet-policy-service
    Contributor

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

  4. tannergooding commented on Jul 17, 2026

    @tannergooding
    MemberAuthor
  5. added
    arch-wasm
    on Jul 17, 2026
  6. dotnet-policy-service commented on Jul 17, 2026

    @dotnet-policy-service
    Contributor

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

  7. added this to the 12.0.0 milestone on Jul 17, 2026
  8. removed
    untriaged
    on Jul 17, 2026
  9. modified the milestones: 12.0.0, 11.0.0 on Jul 17, 2026
  10. JulieLeeMSFT commented on Jul 17, 2026

    @JulieLeeMSFT
    Member

    CC @dotnet/wasm-contrib.

  11. tannergooding commented on Jul 17, 2026

    @tannergooding
    MemberAuthor

    Not sure how important these are, but they cause a large number of SPMI contexts to fail which hurt the ability to get SuperPMI diffs

  12. AndyAyersMS commented on Jul 17, 2026

    @AndyAyersMS
    Member

    JIT only, not R2R. Not a .NET 11 thing.

  13. modified the milestones: 11.0.0, Future on Jul 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

arch-wasmarea-CodeGen-coreclr

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions