Access component-model flags via their VmType alias region in adapters - #14116
Merged
fitzgen merged 2 commits intoAug 20, 2026
Merged
Conversation
alexcrichton
approved these changes
Aug 14, 2026
These flags were imported by adapters and accessed with the `PublicGlobal` alias
region, but this led to ambiguity between loads and stores to different
flags. The flags are stored in the `VMComponentContext` and we generally know
when we are importing flags as globals unambiguously, so do the same thing we do
to get precise alias regions for defined globals for component-model flags, but
use the `AliasRegionKey::Vm { ty: VMComponentContext, .. }` alias region.
A final wrinkle: core Wasm does not have the enclosing `VMComponentContext`'s
offsets on hand, so we move `task_may_block` ahead of `may_leave` so both flags
are before every component-shape-dependent field and the flags' offsets are a
function of the pointer size alone.
Avoid defining new `AliasRegions` helpers and use macro-generated helpers instead.
fitzgen
force-pushed
the
alias-regions-for-component-model-flags
branch
from
August 20, 2026 19:49
5e85339 to
1831d57
Compare
Member
Author
|
@alexcrichton mind taking another look? when rebasing this, it went across the vmctx macro stuff, so I added another commit that makes it avoid defining new |
alexcrichton
approved these changes
Aug 20, 2026
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.
These flags were imported by adapters and accessed with the
PublicGlobalaliasregion, but this led to ambiguity between loads and stores to different
flags. The flags are stored in the
VMComponentContextand we generally knowwhen we are importing flags as globals unambiguously, so do the same thing we do
to get precise alias regions for defined globals for component-model flags, but
use the
AliasRegionKey::Vm { ty: VMComponentContext, .. }alias region.A final wrinkle: core Wasm does not have the enclosing
VMComponentContext'soffsets on hand, so we move
task_may_blockahead ofmay_leaveso both flagsare before every component-shape-dependent field and the flags' offsets are a
function of the pointer size alone.
Depends on #14115