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.
After #125556 the head of every suspension looks something like:
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.