dotnet / dotnet/runtime

JIT: Continuation allocation code can be shared

Open
#125,688 2 comments 0 reactions 1 assignee Claimed by @dhartglassMSFT View on GitHub
area-CodeGen-coreclr Priority:2 runtime-async
Dominant language
C#
Stars
18.3k
Forks
5.6k
PR merge metrics
PR metrics pending

Description

After #125556 the head of every suspension looks something like:
```
Continuation newCont;
if (continuationParam != null)
{
newCont = continuationParam;
returnedCont.Next = newCont;
}
else
{
newCont = CORINFO_HELP_ALLOC_CONTINUATION(returnedCont, continuationMethodTable);
}
```
The codegen of this is quite large. If we have multiple suspension points it would likely be beneficial to share this fragment of it.
One problem is that we cannot make "function local calls", and we need some way to return back. Perhaps just passing the state number and doing that via a switch would be fine -- it would use some space, but it would not require any major changes to block representations.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.