Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't statically enumerate host signatures in Pulley #9693

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

alexcrichton
Copy link
Member

I'm doing some other refactoring which makes it a pain to maintain a list in two locations of what all the host signatures are. Instead remove the pulley for_each_host_signature! macro entirely. My thinking is to instead implement a different system for host calls in pulley:

  • The same relocation-style mechanism is used with some number-embedded-in-the-bytecode.
  • The interpreter exits with "imma call the host" when it sees this special opcode.
  • The interpreter embedder, aka Wasmtime, is responsible for then invoking the actual function pointer.
  • Wasmtime already has static knowledge of all its function signatures, e.g. via various macros.

This will prevent the need to list all function signatures twice and risk them getting out of sync. Most of the Pulley-level integration work here is left to a future commit.

I'm doing some other refactoring which makes it a pain to maintain a
list in two locations of what all the host signatures are. Instead
remove the pulley `for_each_host_signature!` macro entirely. My thinking
is to instead implement a different system for host calls in pulley:

* The same relocation-style mechanism is used with some
  number-embedded-in-the-bytecode.
* The interpreter exits with "imma call the host" when it sees this
  special opcode.
* The interpreter embedder, aka Wasmtime, is responsible for then
  invoking the actual function pointer.
* Wasmtime already has static knowledge of all its function signatures,
  e.g. via various macros.

This will prevent the need to list all function signatures twice and
risk them getting out of sync. Most of the Pulley-level integration work
here is left to a future commit.
@alexcrichton alexcrichton marked this pull request as ready for review November 29, 2024 02:00
@alexcrichton alexcrichton requested review from a team as code owners November 29, 2024 02:00
@alexcrichton alexcrichton requested review from pchickey and removed request for a team November 29, 2024 02:00
@github-actions github-actions bot added the pulley Issues related to the Pulley interpreter label Nov 29, 2024
Copy link

Subscribe to Label Action

cc @fitzgen

This issue or pull request has been labeled: "pulley"

Thus the following users have been cc'd because of the following labels:

  • fitzgen: pulley

To subscribe or unsubscribe from this label, edit the .github/subscribe-to-label.json configuration file.

Learn more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pulley Issues related to the Pulley interpreter
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant