Skip to content

[Wasm R2R] Bypass dynamic LDVIRTFTN helper#129075

Merged
AndyAyersMS merged 2 commits into
dotnet:mainfrom
AndyAyersMS:wasm-ldvirtftn-r2r
Jun 7, 2026
Merged

[Wasm R2R] Bypass dynamic LDVIRTFTN helper#129075
AndyAyersMS merged 2 commits into
dotnet:mainfrom
AndyAyersMS:wasm-ldvirtftn-r2r

Conversation

@AndyAyersMS
Copy link
Copy Markdown
Member

Wasm does not implement the DelayLoad_Helper_Obj stub backing CORINFO_HELP_READYTORUN_VIRTUAL_FUNC_PTR, so route virtual function pointer lookups through the runtime CORINFO_HELP_VIRTUAL_FUNC_PTR helper instead.

Wasm does not implement the DelayLoad_Helper_Obj stub backing
CORINFO_HELP_READYTORUN_VIRTUAL_FUNC_PTR, so route virtual function
pointer lookups through the runtime CORINFO_HELP_VIRTUAL_FUNC_PTR
helper instead.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings June 6, 2026 17:15
@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 Jun 6, 2026
@AndyAyersMS
Copy link
Copy Markdown
Member Author

@davidwrighton PTAL
fyi @dotnet/wasm-contrib

Fixes some more pri0 test failures.

@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.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

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 adjusts impImportLdvirtftn in the CoreCLR JIT importer so that the ReadyToRun-specific CORINFO_HELP_READYTORUN_VIRTUAL_FUNC_PTR path is not used when targeting Wasm, causing Wasm AOT/R2R to use the normal runtime CORINFO_HELP_VIRTUAL_FUNC_PTR helper instead.

Changes:

  • Gates the ReadyToRun IsAot() fast-path for ldvirtftn behind !TARGET_WASM.
  • Adds an explanatory comment indicating why Wasm cannot use the R2R helper path.

Comment thread src/coreclr/jit/importer.cpp Outdated
Address Copilot review feedback: place the explanatory comment immediately
before the '#if defined(FEATURE_READYTORUN) && !defined(TARGET_WASM)' guard so
it clearly applies to the conditional that excludes WASM, instead of sitting
unconditionally after the '#endif' where it could be read as standalone on
non-WASM targets.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@AndyAyersMS AndyAyersMS merged commit 01cd5cc into dotnet:main Jun 7, 2026
139 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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