-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Description
The resumption stubs are responsible for calling into the runtime async function, setting the frame up in the way it expects (by passing zeroed arguments). Furthermore it must propagate the return value into the next continuation if it completes without suspending.
Today these resumption stubs are IL stubs, but it introduces complexity for R2R and it means that the runtime async function takes an additional continuation parameter that in normal synchronous code is always null.
Instead we should consider if we can create multiple entry points for runtime async functions: one used when starting the call, and multiple more entry points used for resumption. The resumption entry points would be funclet-like pieces of code that perform the same responsibilities as the current IL stub, but with additional flexibility in how the stack frame is set up.
There will be some complexity around these since they will show up during stack walks and around whether or not they should be represented as actual funclets, or something more lightweight. See discussion starting around #120303 (comment).