Skip to content

[wasm] [r2r] Consider adding support for universal shared generics where the code is universally shared generic #135345

Open

Description

@davidwrighton

In some cases the generated code for a generic instance is the same regardless of the instantiation. As an example, take SzArrayHelper.get_Count<T> In WASM, since the actual method is not unique in any case, (at least after we do the work to initialize the prolog with a PEP), we should be able to reuse the code. I'm not sure if we would need to allocate a new table index for the method, but that IS possible.

See https://gist.github.com/radekdoulik/cd90a8b30ba016a6470bfb571a1da0e4 and https://gist.github.com/radekdoulik/056eb6edff8a8ff38374d8a6685c9427 for why this might be interesting.

Activity

  1. added
    untriaged
    on Oct 7, 2026
  2. added
    area-CodeGen-coreclr
    on Oct 7, 2026
  3. dotnet-policy-service commented on Oct 7, 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. added
    arch-wasm
    on Oct 7, 2026
  5. dotnet-policy-service commented on Oct 7, 2026

    @dotnet-policy-service
    Contributor

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

  6. removed
    untriaged
    on Oct 8, 2026
  7. added this to the 12.0.0 milestone on Oct 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    arch-wasmarea-CodeGen-coreclr

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions