Stream: wasm

Topic: tail call


view this post on Zulip Dan Gohman (Feb 15 2020 at 00:14):

On the current course, when the wasm tail-call feature is standardized, we'll loose the ability to pass a wasm function pointer to native Rust or C code.

view this post on Zulip Dan Gohman (Feb 15 2020 at 00:14):

Because the tail-call feature is incompatible with the native calling conventions on Linux and Windows

view this post on Zulip Dan Gohman (Feb 15 2020 at 00:14):

and Mac

view this post on Zulip Dan Gohman (Feb 15 2020 at 00:15):

And the current proposal will require all exported functions to be compatible with the tail-call feature.

view this post on Zulip Lars Hansen (Feb 16 2020 at 18:26):

Currently exported functions are also compatible with the JS ABI (for a lack of better terminology) but that doesn't stop wasm from optimizing calls to those functions when they are imported into a wasm module somewhere else. I'm not really clued into the WASI semantics but could an exported function not have multiple entry points / ABIs, to support this use case properly? The situation seems analogous to the JS case.

view this post on Zulip Lars Hansen (Feb 16 2020 at 18:27):

(Hm, my avatar looks like the corona virus, maybe time to update.)

view this post on Zulip Dan Gohman (Feb 18 2020 at 14:37):

It's more than just multiple entrypoints, because we need to fix up the stack pointer on return. We could do it with a wrapper function though.


Last updated: Dec 23 2024 at 12:05 UTC