Skip to content

Investigate generating resumption stubs as funclet-like code in runtime async functions #121013

@jakobbotsch

Description

@jakobbotsch

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).

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-CodeGen-coreclrCLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMIruntime-async

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions