fitzgen opened PR #6774 from fitzgen:wasmtime-tail-calls
to bytecodealliance:main
:
This adds the
Config::wasm_tail_call
method and--wasm-features tail-call
CLI flag to enable the Wasm tail calls proposal in Wasmtime.This PR is mostly just plumbing and enabling tests, since all the prerequisite work (Wasmtime trampoline overhauls and Cranelift tail calls) was completed in earlier pull requests.
When Wasm tail calls are enabled, Wasm code uses the
tail
calling convention. Thetail
calling convention is known to cause a 1-7% slow down for regular code that isn't using tail calls, which is why it isn't used unconditionally. This involved shepherdingTunables
through to Wasm signature construction methods. The eventual plan is for thetail
calling convention to be used unconditionally, but not until the performance regression is addressed. This work is tracked in
https://github.com/bytecodealliance/wasmtime/issues/6759Additionally while our x86-64, aarch64, and riscv64 backends support tail calls, the s390x backend does not support them yet. Attempts to use tail calls on s390x will return errors. Support for s390x is tracked in https://github.com/bytecodealliance/wasmtime/issues/6530
<!--
Please make sure you include the following information:
If this work has been discussed elsewhere, please include a link to that
conversation. If it was discussed in an issue, just mention "issue #...".Explain why this change is needed. If the details are in an issue already,
this can be brief.Our development process is documented in the Wasmtime book:
https://docs.wasmtime.dev/contributing-development-process.htmlPlease ensure all communication follows the code of conduct:
https://github.com/bytecodealliance/wasmtime/blob/main/CODE_OF_CONDUCT.md
-->
fitzgen requested alexcrichton for a review on PR #6774.
fitzgen requested cfallin for a review on PR #6774.
fitzgen requested wasmtime-compiler-reviewers for a review on PR #6774.
fitzgen requested wasmtime-core-reviewers for a review on PR #6774.
fitzgen requested wasmtime-default-reviewers for a review on PR #6774.
fitzgen requested elliottt for a review on PR #6774.
fitzgen requested wasmtime-compiler-reviewers for a review on PR #6774.
alexcrichton submitted PR review:
Nice :+1:
One thing I might recommend doing though is to push a commit with
prtest:full
which enables tail calls by default. That'll help weed out any lingering issues and the commit can be backed out before landing to keep it off-by-default in tree
alexcrichton submitted PR review:
Nice :+1:
One thing I might recommend doing though is to push a commit with
prtest:full
which enables tail calls by default. That'll help weed out any lingering issues and the commit can be backed out before landing to keep it off-by-default in tree
alexcrichton created PR review comment:
One alternative, if you're interested in a little refactoring, would be to store
Tunables
in theCompiler
itself during its constructor since the tunables areEngine
invariant
fitzgen updated PR #6774.
fitzgen submitted PR review.
fitzgen created PR review comment:
Done
fitzgen updated PR #6774.
fitzgen updated PR #6774.
fitzgen updated PR #6774.
fitzgen updated PR #6774.
fitzgen updated PR #6774.
fitzgen has enabled auto merge for PR #6774.
fitzgen updated PR #6774.
fitzgen has enabled auto merge for PR #6774.
fitzgen has disabled auto merge for PR #6774.
fitzgen updated PR #6774.
fitzgen has enabled auto merge for PR #6774.
fitzgen updated PR #6774.
fitzgen has enabled auto merge for PR #6774.
fitzgen merged PR #6774.
Last updated: Dec 23 2024 at 12:05 UTC