Skip to content

[wasm][r2r] Root GenericsHelpers *WithSlotAndModule helpers - #136413

Open
lewing wants to merge 1 commit into
dotnet:mainfrom
lewing:lewing-r2r-generics-helpers-rooting
Open

lewing wants to merge 1 commit into
dotnet:mainfrom
lewing:lewing-r2r-generics-helpers-rooting

Conversation

@lewing

@lewing lewing commented Oct 24, 2026

Copy link
Copy Markdown
Member

GenericsHelpers.MethodWithSlotAndModule and GenericsHelpers.ClassWithSlotAndModule are looked up by name in the runtime (DynamicHelpers::GetDictionaryLookupHelper) to build generic dictionary lookup helpers, so they have no CorInfoHelpFunc entry and ReadyToRunJitHelperRootProvider never rooted them. As a result they were not compiled into R2R builds of System.Private.CoreLib. On Wasm there is no JIT to fall back on.

This adds a second list of runtime-looked-up managed helpers to ReadyToRunJitHelperRootProvider and roots them through the same path as the existing helpers. GenericsHelpers.Method and GenericsHelpers.Class were already rooted.

I audited the other DYNAMICJITHELPER entries in jithelpers.h, and all of them were already rooted.

Validation: ILCompiler.ReadyToRun builds. I also verified with a temporary test (not included in this PR) that compiled CoreLib with unrooted inputs for the browser-wasm target. It failed with Expected compiled method 'System.Runtime.CompilerServices.GenericsHelpers.MethodWithSlotAndModule' not found without this change, and passed with it. I did not run it for x64 or x86.

Resolves #135346

Note

This PR description was AI/Copilot-generated.

GenericsHelpers.MethodWithSlotAndModule and ClassWithSlotAndModule are
looked up by name in the runtime to build dictionary lookup helpers, so
they have no CorInfoHelpFunc entry and were not rooted by
ReadyToRunJitHelperRootProvider. On Wasm there is no JIT to fall back on.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 3 pipeline(s).
13 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: @dotnet/crossgen-contrib
See info in area-owners.md if you want to be subscribed.

@lewing lewing added the arch-wasm WebAssembly architecture label Oct 24, 2026
@lewing
lewing requested a review from davidwrighton October 24, 2026 03:28
@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.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

arch-wasm WebAssembly architecture area-ReadyToRun

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[wasm] [r2r] Generics helper methods aren't rooted as part of helper rooting

1 participant