镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

[multibyte] Encode typeidx before offset - #9222

Open
brendandahl wants to merge 2 commits into
WebAssembly:mainfrom
brendandahl:multibyte-reorder-memarg
Open

brendandahl wants to merge 2 commits into
WebAssembly:mainfrom
brendandahl:multibyte-reorder-memarg

Conversation

@brendandahl

@brendandahl brendandahl commented Oct 6, 2026 •

Copy link
Copy Markdown
Collaborator

The multibyte array access proposal updated the binary format of memarg to place typeidx immediately after flags and before offset (flags:u32 typeidx:u32 offset:u32), matching the position of memidx in multi-memory accesses. Update the binary reader and writer accordingly.

See WebAssembly/multibyte-array-access#10

The multibyte array access proposal updated the binary format of memarg
to place typeidx immediately after flags and before offset
(flags:u32 typeidx:u32 offset:u32), matching the position of memidx in
multi-memory accesses. Update the binary reader and writer accordingly.
@brendandahl
brendandahl requested a review from a team as a code owner October 6, 2026 21:35
@brendandahl
brendandahl requested review from tlively and removed request for a team October 6, 2026 21:35

@tlively tlively 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.

LGTM % nits + questions

Comment thread src/wasm/wasm-binary.cpp
if (backing == BackingType::Array) {
return {Name(), alignment, offset, backing};
if (arrayType) {
return {Name(), alignment, offset, arrayType};

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.

I wonder if using a std::variant<Name, HeapType> instead of a separate Name and std::optional<HeapType> would be any nicer. Probably not, given how gross std::variant is!

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I tried it out, but yeah it looked more verbose. getMemarg is called in quite a few places.

Comment thread src/wasm/wasm-binary.cpp Outdated
Comment thread src/wasm/wasm-stack.cpp

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants