Skip to content

Tail-call calling convention #5568

Open
@kateinoigakukun

Description

@kateinoigakukun

Currently, we are using simple recursive call for coroutine lowering in CoroSplit LLVM pass. However, it limits number of suspension chains due to the limitation of number of call frames.

In theory, with tail-call feature, which is now in standardizing phase, we can use swiftasynccall calling convention and musttail call to ensure the call is tail-called, and it will remove the limitation of the length of suspension chain.

Let's enable swiftasynccall calling convention with tail-call feature

Blockers

  • Swift SDK Support: We need to build separate stdlib builds for tail-call enabled and not, to allow produced binary to be used with WebAssembly runtimes with/without tail-call support. Managing multiple variants of stdlib builds requires supporting Swift SDK at first.
  • Fix WebAssembly LLVM backend for async coroutine lowering. See my comment
  • CI failure: cannot guarantee tail call due to mismatched parameter counts #5567
  • Support tail-call feature in WasmKit, to be able to run tests in upstream CI

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions