[Wasm R2R] Bypass dynamic LDVIRTFTN helper#129075
Conversation
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>
|
@davidwrighton PTAL Fixes some more pri0 test failures. |
|
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch |
There was a problem hiding this comment.
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 forldvirtftnbehind!TARGET_WASM. - Adds an explanatory comment indicating why Wasm cannot use the R2R helper path.
| // Wasm R2R cannot use the CORINFO_HELP_READYTORUN_VIRTUAL_FUNC_PTR fast path because it | ||
| // relies on DelayLoad_Helper_Obj dynamic-helper thunks, which are not implemented on wasm. | ||
| // Fall through to the runtime CORINFO_HELP_VIRTUAL_FUNC_PTR helper instead. |
There was a problem hiding this comment.
Note
AI-generated content (GitHub Copilot CLI)
Moved the explanatory comment to immediately precede the #if defined(FEATURE_READYTORUN) && !defined(TARGET_WASM) directive (instead of sitting after the matching #endif), so it now reads as part of the conditional gate that excludes WASM. Pushed in 7eaa5a9.
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>
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.