Skip to content

[RuntimeAsync] R2R and Native AOT support #115098

@VSadov

Description

@VSadov
  • Update managed type system to understand MethodImpl.Async Pass async flag to jit in aot tools #120772
  • Create MethodDescs for async thunks (Async version of Task-returning, Task-returning version of Async)
  • Determine the best format for emitting async variants and resumption stubs into an R2R image. Emitting Async methods in ReadyToRun image #121559
  • Update R2R dump to indicate the async thunks and any other information that is helpful.
  • Get a totally sync Async method compiling and running.
  • Get a method with an await compiling and running.
  • Generate IL for the Async thunks that forward to Task-returning methods.
  • Generate IL for the Task-returning thunks that forward to Async methods.
  • Enable R2R for Async helpers. We explicitly make them BypassReadyToRun. This could be done today, they will just fail r2r compilation and not be emitted into the image.
  • Emit the AsyncResumptionStubs to the readytorun image. These likely will go into the InstantiatedMethodEntryPointTable with a new flag for ResumptionStubs.
  • Retrieve the AsyncResumptionStubs from the image at runtime.
  • Determine behavior expected for a generic method that returns T when instantiated with T as Task.

Some relevant source files:
src/coreclr/tools/Common/JitInterface/CorInfoImpl.cs
src/coreclr/tools/Common/TypeSystem/Common/AsyncMethodDesc.cs
src/coreclr/tools/Common/TypeSystem/Common/MethodDelegator.cs
src/coreclr/tools/Common/TypeSystem/Common/MethodDesc.cs
src/coreclr/tools/Common/TypeSystem/Ecma/EcmaMethod.cs
src/coreclr/tools/aot/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/InstanceEntryPointTableNode.cs
src/coreclr/tools/aot/ILCompiler.ReadyToRun/Compiler/ReadyToRunTableManager.cs
src/coreclr/tools/aot/ILCompiler.ReadyToRun/JitInterface/CorInfoImpl.ReadyToRun.cs
src/coreclr/tools/aot/ILCompiler.ReadyToRun/IL/ReadyToRunILProvider.cs
src/coreclr/vm/readytoruninfo.cpp
src/coreclr/vm/readytoruninfo.h

Sub-issues

Metadata

Metadata

Type

No type

Projects

Status

No status

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions