Migrate some VM* type fields to macro-generated helpers - #14195
Merged
fitzgen merged 4 commits intoAug 24, 2026
Merged
Conversation
cfallin
approved these changes
Aug 24, 2026
Member
|
(Merge conflict to fix before merging but LGTM) |
`Field::readonly`, `Field::can_move`, and `Field::cast` took `&mut self` and returned `&mut Self`, while `Field::relative_to` consumed `self`. That mix meant a caller that needed to set a flag *and* rebase the access could not write it as one chain, and instead had to bind a `let mut` and set flags in separate statements. Make all three consume and return `Self`, and add `readonly_if` / `can_move_if` for the common case where the flag depends on a dynamic property of the module being compiled.
Also add `Field::trap_code`, so that a `Field` can express the optional trap code that `VMFuncRef` loads carry for the null-funcref case, and add `AliasRegions::offsets` so that callers can compute the offset needed to rebase a `Field` onto a containing structure.
fitzgen
force-pushed
the
migrate-some-fields-to-macro-generated-helpers
branch
from
August 24, 2026 21:08
bb79f85 to
9c961ef
Compare
fitzgen
enabled auto-merge
August 24, 2026 21:09
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.
See each commit for details.