-
Notifications
You must be signed in to change notification settings - Fork 5k
[RuntimeAsync] Merge from labs, all except JIT #114675
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
Merged
Merged
Changes from all commits
Commits
Show all changes
30 commits
Select commit
Hold shift + click to select a range
a0e9046
Merge from RTL, all except JIT
VSadov 7e088a9
fix mono build
VSadov eebd959
Removed public API changes.
VSadov af7a529
require FEATURE_RUNTIME_ASYNC
VSadov 924cfa1
whitespace changes
VSadov 2eefbea
redundant change
VSadov 43c46cd
removed GetNativeCodeSlot
VSadov ff126fe
Apply suggestions from code review
VSadov ff6dc4c
fix the build
VSadov f305713
add a frameless path in IL_ThrowExact (except for X86)
VSadov 029a53a
keep amTracker untill after CreateAndLinkNewILStubMethodDesc
VSadov b59344d
no comment numbering
VSadov 1b0f737
undo changes to IsRuntimeSupplied
VSadov c4d3e2e
move async thunk generation code into separate file
VSadov bd93053
Moved infrastructure helpers into CompilerServices.AsyncHelpers
VSadov f1d33d4
Added a section on Async calling convention in ABI doc
VSadov 7b6e9c9
Apply suggestions from code review
VSadov 4cbc09b
undo unnecessary change in stubgen
VSadov e466e5e
Use the newest API
VSadov 31744c8
Use approved value for MethodImplAttributes.Async
VSadov 42e42e1
added some TODOs
VSadov 89a68b1
Update src/coreclr/vm/prestub.cpp
VSadov 2489290
some simple PR feedback
VSadov 74f4da3
Fail if EnC targets an Async method
VSadov 61c63d3
moved IsEnCAddedMethod bit to Flags4
VSadov 55caeca
Implement IL_ThrowExact for x86/funclets
filipnavara ad5cb52
Addres PR feedback
filipnavara 6f2c815
couple TODOs for EnC NYI
VSadov 7dbc621
add a simple ldtoken test scenario for Task-returning method
VSadov 49f651f
Put back BypassReadyToRun untill we are sure about R2R support
VSadov File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are the other arguments expected to have null/default values when Continuation argument is non-null?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The arguments need to have some value, so we do set other arguments to default values when calling with a continuation.
I am not sure it is strictly required as they are not supposed to be used if continuation is passed in. Perhaps nothing will break if arguments contain random values. Managed refs might need to be valid though - actual objects or null, for GC reasons.
Maybe it is worth to document that arguments/returns in the presence of continuation are supposed to have default values, although I am not sure we would check/enforce that.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually it looks like we can return random values for non-gc returns when returning continuation.
This is in the JIT (so not in this PR):
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The resumption stub does fill arguments with default values, but that might be because it is in IL
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or perhaps just mentioning that they are unused is good enough. Caller might zero them out or might not - whatever is more convenient.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have we considered generating the resumption stub in the JIT? It feels like we are leaving some perf and code size on the table here.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is possible, although resumption is not a hot path. A lot happens between suspension and resumption.
I think every part will be revisited eventually with perf in mind, but resumption may not be the most impactful area.
This is where, I think, getting correct and reasonably fast behavior is good enough for now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think eventually we will want to add support for generating multiple entry points for async functions and have the JIT generate an entry point for resumption and an entry point for fresh calls. It will also remove the extra null argument being passed on the synchronous path.
This is the 4th item under https://github.com/dotnet/runtimelab/blob/feature/async2-experiment/docs/design/features/runtime-handled-tasks.md#potential-future-improvements
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not totally trivial to completely remove the resumption stub, even with multiple entry points -- currently the resumption stub has the important job of setting up space for the arguments. The resumed function uses that space to store parameters from the continuation when parameters are live. Particularly for implicit byrefs that space exists on the stack frame of the resumption stub and cannot easily be allocated by the callee (without deoptimizing e.g. tailcalls).