Skip to content

Avoid Wasm unwindable-frame identity for call-free funclets #134597

Description

@davidwrighton

Problem

CoreCLR's Wasm JIT stores each unwindable frame's function identity in the shadow-stack frame. Funclets that make no calls currently receive the same identity prolog even though they cannot have a callee that needs to walk through that frame.

In a recent retail System.Private.CoreLib.wasm measurement, 162 call-free funclets had this prolog. The function-index immediate also prevents otherwise identical funclet bodies from being folded: 58 funclets formed 21 identical groups after normalizing only that immediate.

Proposed change

Teach the JIT to omit unwindable-frame identity for funclets that make no calls, while retaining it for:

  • Root functions.
  • Funclets containing direct or indirect calls.
  • Any funclet for which GC, EH, resume, or stack-walking behavior requires the identity.

The decision should use JIT IR/control-flow information rather than scanning emitted Wasm bytes.

Validation

  • Build CoreCLR browser/Wasm in Release.
  • Verify leaf funclets omit the tableBase + functionIndex store.
  • Verify calling funclets and root methods retain it.
  • Run focused Wasm startup/tests and compare CoreLib Code-section size.

Note

This issue was generated with GitHub Copilot.

Activity

  1. added
    area-CodeGen-coreclrCLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI
    on Sep 24, 2026
  2. dotnet-policy-service commented on Sep 24, 2026

    @dotnet-policy-service
    Contributor

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

  3. added
    arch-wasmWebAssembly architecture
    and removed
    untriagedNew issue has not been triaged by the area owner
    on Sep 26, 2026
  4. dotnet-policy-service commented on Sep 26, 2026

    @dotnet-policy-service
    Contributor

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

  5. added this to the 12.0.0 milestone on Sep 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

arch-wasmWebAssembly architecturearea-CodeGen-coreclrCLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions