Skip to content

Move table.copy implementation to compiled code - #13407

Merged
alexcrichton merged 2 commits into
bytecodealliance:mainfrom
alexcrichton:refactor-table-copy
May 20, 2026
Merged

alexcrichton merged 2 commits into
bytecodealliance:mainfrom
alexcrichton:refactor-table-copy

Conversation

@alexcrichton

Copy link
Copy Markdown
Member

This commit is the dual of #13382 but for tables. The goal here is to
move the copying operation into WebAssembly to enable fuel/epoch
checking during larger copies (#13387). This additionally enables
removing quite a lot of library code to implement this in the host.
Finally, most of the code to do this was already implemented for
compilation, so much of this PR focuses on refactoring all of that to
reuse all of the existing logic in a way that table support "falls out
by default".

Note: the first commit here comes from #13394 for now.

@alexcrichton
alexcrichton requested review from a team as code owners May 19, 2026 05:54
@alexcrichton
alexcrichton requested review from cfallin and removed request for a team May 19, 2026 05:54
@github-actions github-actions Bot added cranelift Issues related to the Cranelift code generator wasmtime:api Related to the API of the `wasmtime` crate itself wasmtime:ref-types Issues related to reference types and GC in Wasmtime labels May 19, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Subscribe to Label Action

cc @fitzgen

Details This issue or pull request has been labeled: "cranelift", "wasmtime:api", "wasmtime:ref-types"

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

  • fitzgen: wasmtime:ref-types

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

Learn more.

@fitzgen fitzgen left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks great!

This commit is the dual of bytecodealliance#13382 but for tables. The goal here is to
move the copying operation into WebAssembly to enable fuel/epoch
checking during larger copies (bytecodealliance#13387). This additionally enables
removing quite a lot of library code to implement this in the host.
Finally, most of the code to do this was already implemented for
compilation, so much of this PR focuses on refactoring all of that to
reuse all of the existing logic in a way that table support "falls out
by default".
@alexcrichton
alexcrichton force-pushed the refactor-table-copy branch from 983a5c4 to 3e2e3f3 Compare May 20, 2026 06:12
@alexcrichton
alexcrichton enabled auto-merge May 20, 2026 06:12
@alexcrichton
alexcrichton added this pull request to the merge queue May 20, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks May 20, 2026
* Take src/dst into account separately when reading/writing.
* Use `table.{get,set}` translation to reuse formats/flags/etc.
@alexcrichton
alexcrichton enabled auto-merge May 20, 2026 20:41
@alexcrichton
alexcrichton added this pull request to the merge queue May 20, 2026
Merged via the queue into bytecodealliance:main with commit 63af868 May 20, 2026
51 checks passed
@alexcrichton
alexcrichton deleted the refactor-table-copy branch May 20, 2026 21:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cranelift Issues related to the Cranelift code generator wasmtime:api Related to the API of the `wasmtime` crate itself wasmtime:ref-types Issues related to reference types and GC in Wasmtime

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants