JIT: Continuation allocation code can be shared
- 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
Assessment
This issue has not been assessed yet.