Skip to content

Split out the flags type from record#209

Merged
alexcrichton merged 4 commits intobytecodealliance:mainfrom
alexcrichton:flags-type
Apr 28, 2022
Merged

Split out the flags type from record#209
alexcrichton merged 4 commits intobytecodealliance:mainfrom
alexcrichton:flags-type

Conversation

@alexcrichton
Copy link
Member

This commit creates a dedicated flags type which is distinct from the
record type rather than the previous inferred-from-the-structure
logic. This also additionally changes the canonical ABI of the flags
type where 64-bit flags are now passed as two i32 values instead of
one i64. This ended up changing a significant amount of the logic
internally in each code generator, notably around the new lift/lower
behavior.

Along the way I tried to refactor code to support 64+ flags in a few
more places. While some support may be there, though, this is untested
and will need a full-fledged feature in the future.

This commit creates a dedicated `flags` type which is distinct from the
`record` type rather than the previous inferred-from-the-structure
logic. This also additionally changes the canonical ABI of the `flags`
type where 64-bit flags are now passed as two `i32` values instead of
one `i64`. This ended up changing a significant amount of the logic
internally in each code generator, notably around the new lift/lower
behavior.

Along the way I tried to refactor code to support 64+ flags in a few
more places. While some support may be there, though, this is untested
and will need a full-fledged feature in the future.
@alexcrichton alexcrichton mentioned this pull request Apr 28, 2022
21 tasks
@alexcrichton alexcrichton merged commit 8080af2 into bytecodealliance:main Apr 28, 2022
@alexcrichton alexcrichton deleted the flags-type branch April 28, 2022 23:25
willemneal pushed a commit to theahaco/wit-bindgen that referenced this pull request May 31, 2022
* Split out the `flags` type from `record`

This commit creates a dedicated `flags` type which is distinct from the
`record` type rather than the previous inferred-from-the-structure
logic. This also additionally changes the canonical ABI of the `flags`
type where 64-bit flags are now passed as two `i32` values instead of
one `i64`. This ended up changing a significant amount of the logic
internally in each code generator, notably around the new lift/lower
behavior.

Along the way I tried to refactor code to support 64+ flags in a few
more places. While some support may be there, though, this is untested
and will need a full-fledged feature in the future.

* Fix a test

* Fix some more flags

* Fix more tests
@codefromthecrypt
Copy link

what was the rationale for splitting a 64 bitflag into two fields? As you noticed in refactoring, this has a lot of impact and isn't universally desirable.

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.

3 participants