Process passive element segments in compiled code#13444
Merged
cfallin merged 2 commits intoMay 21, 2026
Merged
Conversation
This commit is targeted at implementing the bulk of the `table.init`, `array.init_elem`, and `array.new_elem` instructions in compiled wasm code. This means that these instructions can also more naturally insert fuel/epoch checks described in bytecodealliance#13387. Support in this commit is heavily built on previous refactorings where the goal here is to a new kind of entity, an element segment, and then just fill out all the various places that `match` is needed. The main refactoring needed to support this is that the element size of the src/dst of a copy can now differ. This is because element segments have a 16-byte element size (`ValRaw`'s size), but tables and arrays have a different size of each element. Closes bytecodealliance#13258
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This commit is targeted at implementing the bulk of the
table.init,array.init_elem, andarray.new_eleminstructions in compiled wasm code. This means that these instructions can also more naturally insert fuel/epoch checks described in #13387.Support in this commit is heavily built on previous refactorings where the goal here is to a new kind of entity, an element segment, and then just fill out all the various places that
matchis needed. The main refactoring needed to support this is that the element size of the src/dst of a copy can now differ. This is because element segments have a 16-byte element size (ValRaw's size), but tables and arrays have a different size of each element.Closes #13258