Skip to content
This repository was archived by the owner on Sep 8, 2025. It is now read-only.

Update for new async ABI changes#171

Merged
alexcrichton merged 13 commits into
bytecodealliance:mainfrom
alexcrichton:new-async-abi
May 28, 2025
Merged

Update for new async ABI changes#171
alexcrichton merged 13 commits into
bytecodealliance:mainfrom
alexcrichton:new-async-abi

Conversation

@alexcrichton
Copy link
Copy Markdown
Member

This commit updates to account for WebAssembly/component-model#520. This is a large-ish change to the semantics from a runtime perspective and needed a number of changes:

  • The sync_prepare_call and async_prepare_call libcalls were merged together. The previous async version statically took two arguments but now it's taking a variable number of arguments which looked quite a lot like sync_prepare_call so they're now merged into one.

  • Lots of little updates were made to fact/signatures.rs to account for ABI changes.

  • Tests with handwritten signatures were all updated to the new ABI.

  • The CallerInfo::Async structure which "buffers" a call was updated to have a Vec<ValRaw> for the incoming parameters. This is a particularly inefficient way to store parameters but it's in theory workable for now.

  • The Storage abstraction in host calls was refactored and updated to account for async and how lifting parameters could be either flat or indirect. Similar updates were made to the dynamic path as well

This commit updates to account for WebAssembly/component-model#520. This
is a large-ish change to the semantics from a runtime perspective and
needed a number of changes:

* The `sync_prepare_call` and `async_prepare_call` libcalls were merged
  together. The previous async version statically took two arguments but
  now it's taking a variable number of arguments which looked quite a
  lot like `sync_prepare_call` so they're now merged into one.

* Lots of little updates were made to `fact/signatures.rs` to account
  for ABI changes.

* Tests with handwritten signatures were all updated to the new ABI.

* The `CallerInfo::Async` structure which "buffers" a call was updated
  to have a `Vec<ValRaw>` for the incoming parameters. This is a
  particularly inefficient way to store parameters but it's in theory
  workable for now.

* The `Storage` abstraction in host calls was refactored and updated to
  account for async and how lifting parameters could be either flat or
  indirect. Similar updates were made to the dynamic path as well
Copy link
Copy Markdown
Collaborator

@dicej dicej left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ABI changes like this are so tedious to implement; thanks for doing it and saving the rest of us from the pain!

Comment thread crates/environ/src/component/info.rs Outdated
Comment thread crates/environ/src/fact.rs Outdated
Comment thread crates/environ/src/fact.rs Outdated
Comment thread crates/environ/src/fact/trampoline.rs Outdated
Comment thread crates/wasmtime/src/runtime/component/concurrent.rs
@alexcrichton
Copy link
Copy Markdown
Member Author

Alas while I was hoping to land this before the wit-bindgen changes I don't think that's possible. Landing this will require updating wit-bindgen first, and landing that will require publishing wasm-tools first. Given that I'll look to release wasm-tools in the near future for this.

@alexcrichton alexcrichton added this pull request to the merge queue May 28, 2025
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks May 28, 2025
@alexcrichton alexcrichton added this pull request to the merge queue May 28, 2025
Merged via the queue into bytecodealliance:main with commit f59581d May 28, 2025
42 checks passed
@alexcrichton alexcrichton deleted the new-async-abi branch May 28, 2025 16:06
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants