Make coreclr_initialize run cleanly for corewasmrun#119217
Merged
AaronRobinsonMSFT merged 25 commits intodotnet:mainfrom Sep 3, 2025
Merged
Make coreclr_initialize run cleanly for corewasmrun#119217AaronRobinsonMSFT merged 25 commits intodotnet:mainfrom
coreclr_initialize run cleanly for corewasmrun#119217AaronRobinsonMSFT merged 25 commits intodotnet:mainfrom
Conversation
Separate call invokers between JIT compatible interpreter and interpreter with Portable EntryPoints.
Member
Author
|
/cc @steveisok |
Member
Author
|
/azp list |
jkotas
reviewed
Aug 30, 2025
jkotas
reviewed
Aug 30, 2025
Add simple interpreter managed frame stack walker when native assert fires. This will help debugging asserts in interpreter scenarios.
corewasmrun
corewasmruncoreclr_initialize runs cleanly for corewasmrun
coreclr_initialize runs cleanly for corewasmruncoreclr_initialize run cleanly for corewasmrun
Open
3 tasks
janvorli
reviewed
Sep 1, 2025
jkotas
reviewed
Sep 1, 2025
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR implements support for making coreclr_initialize run cleanly for corewasmrun by separating call invokers between JIT-compatible interpreters and interpreters with Portable EntryPoints. The changes enable proper execution of CoreCLR with the interpreter on WebAssembly platforms.
Key changes:
- Implements separate call invokers for interpreted vs. JIT-compiled methods on WASM
- Adds support for Portable EntryPoints in the JIT helper system
- Introduces WASM-specific calling convention thunks for unmanaged code interop
Reviewed Changes
Copilot reviewed 20 out of 20 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| src/coreclr/vm/wasm/helpers.cpp | Implements WASM-specific call invokers and calli signature thunks |
| src/coreclr/vm/wasm/cgencpu.h | Updates stack element size calculation for interpreter compatibility |
| src/coreclr/vm/wasm/calldescrworkerwasm.cpp | Updates call descriptor worker to use Portable EntryPoints |
| src/coreclr/vm/threads.cpp | Adds WASM-specific guards for patched helper assertions |
| src/coreclr/vm/prestub.cpp | Adds interpreter data handling for IL stubs under Portable EntryPoints |
| src/coreclr/vm/precode_portable.hpp | Extends Portable EntryPoint with state query methods and native initialization |
| src/coreclr/vm/precode_portable.cpp | Implements new Portable EntryPoint functionality and validation |
| src/coreclr/vm/mlinfo.cpp | Adds WASM-specific assertion for stack element size validation |
| src/coreclr/vm/jitinterface.h | Updates helper function structure to support Portable EntryPoints |
| src/coreclr/vm/jitinterface.cpp | Implements Portable EntryPoint support in JIT helper resolution |
| src/coreclr/vm/jithelpers.cpp | Updates helper table structure and dynamic helper loading |
| src/coreclr/vm/interpexec.cpp | Refactors call invokers and adds debug stack printing for WASM |
| src/coreclr/vm/dllimport.cpp | Ensures vararg P/Invoke methods get precodes |
| src/coreclr/vm/callingconvention.h | Updates argument offset calculation for interpreter stack alignment |
| src/coreclr/vm/callhelpers.h | Removes unused fields from CallDescrData for WASM |
| src/coreclr/vm/callhelpers.cpp | Updates call descriptor data initialization for WASM |
| src/coreclr/pal/src/arch/wasm/stubs.cpp | Adds interpreter stack printing to debug break handler |
| src/coreclr/inc/regdisp.h | Adds WASM-specific case for context pointer filling |
| src/coreclr/debug/ee/controller.cpp | Updates helper function address comparison and logging format |
| src/coreclr/debug/daccess/daccess.cpp | Updates helper function address comparison for new structure |
jkotas
reviewed
Sep 2, 2025
jkotas
reviewed
Sep 2, 2025
jkotas
reviewed
Sep 2, 2025
jkotas
reviewed
Sep 2, 2025
jkotas
reviewed
Sep 2, 2025
jkotas
reviewed
Sep 3, 2025
jkotas
approved these changes
Sep 3, 2025
Member
jkotas
left a comment
There was a problem hiding this comment.
LGTM (modulo fixes for breaks that I have introduced by the last commit :)
This was referenced Sep 3, 2025
This was referenced Sep 3, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Current output of
corewasmrunrunning on Chrome.Fixes #119001