forked from dotnet/runtime
-
Notifications
You must be signed in to change notification settings - Fork 0
Async work in R2R #3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
jtschuster
wants to merge
37
commits into
main
Choose a base branch
from
AsyncR2R
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
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
Co-authored-by: Copilot <[email protected]>
- Introduced TaskReturningAsyncWrapperMethodDesc and TaskReturningAsyncWrapperMethodDescFactory to handle async-callable methods. - Updated CorInfoTypes.cs to include new call convention for async methods. - Enhanced ILEmitter to support async resumption stubs and exception handling for async methods. - Modified ReadyToRunILProvider to generate IL for async methods, including proper handling of Task and ValueTask return types. - Updated project files to include new async-related classes and ensure proper compilation.
Notably, I've tweak the cross module inlining feature to enable compilation of the tokens needed in these thunks. The tweak enables using these particular apis without enabling the cross module switch. It successfully finishes jitting a method. - This does not ... handle the dependency graph issues - I've noticed that we seem to make the thunks as temporary things, and assume they don't need process long lifetime. This is not likely to true, as they are actual useable symbols, so that needs to be fixed so that the various thunk methoddescs aren't treated as transient. (Anything which is a symbol or goes in the dependency graph needs to be non-transient, and able to be looked up later. Newing up a new instance is not a valid thing to do.) - We seem to have a concept of thunks and whatnot in the MethodDescs... I'm seeing us compile the original method... with the IL for a thunk, and then I'm seeing something try to add to the dependency graph a thunk which is supposed to have the calling convention of the method we just compiled, but is MethodDesc of type TaskReturnAsyncMethodDescThunk or something.
Adjustment to get the compiler to finish the jitting
- Add AsyncVariant flag to readytorun async methods - Comment assertions that fail async methods in readytoruninfo.cpp
jtschuster
pushed a commit
that referenced
this pull request
Oct 27, 2025
Currently, offsets are incorrectly treated as indices which is leading to incorrect code being emitted. e.g., `ScatterWithByteOffsets<long>` emits `ST1D Zdata.D, Pg, [Xbase, Zoffsets.D, lsl #3]` instead of, `ST1D Zdata.D, Pg, [Xbase, Zoffsets.D]`
- Use EcmaMethod as the method with the implementation, whether Async or Task-returning. These go into the MethodDefTable in the R2Rimage - Create TaskReturningThunk and use AsyncMethodDesc as MethodDescs for the async thunk. These go into the InstanceMethodEntryPoints table. - Substitute signatures for Async variant methods - Add AsyncMethodData analogous to the same type in the Runtime
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
No description provided.