Skip to content

Initial fixed size list implementation #1277

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 11 commits into
base: main
Choose a base branch
from

Conversation

cpetig
Copy link
Contributor

@cpetig cpetig commented Apr 20, 2025

See WebAssembly/component-model#384 for the commit which added fixed size lists to the component model standard documents.

Comment on lines +310 to +323
/// Pops all fields for a fixed list off the stack and then composes them
/// into an array.
FixedSizeListLift {
element: &'a Type,
size: u32,
id: TypeId,
} : [*size as usize] => [1],

/// Pops an array off the stack, decomposes the elements and then pushes them onto the stack.
FixedSizeListLower {
element: &'a Type,
size: u32,
id: TypeId,
} : [1] => [*size as usize],
Copy link
Member

Choose a reason for hiding this comment

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

For this I'll echo some of my thoughts on the sibling PRs: I think we'll want to have this with a different shape where the size of the list isn't affecting the O(...) processing here. For example this is pushing/popping the list items from the operand stack of the ABI code, but I think we're going to want something different more akin to how dynamically sized lists work to avoid generating an exponential amount of code in the code generators

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