Skip to content
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

Merge with upstream #131

Merged
merged 9 commits into from
Aug 28, 2024
Merged

Merge with upstream #131

merged 9 commits into from
Aug 28, 2024

Conversation

dhil
Copy link
Member

@dhil dhil commented Aug 28, 2024

No description provided.

alexcrichton and others added 9 commits August 23, 2024 17:43
Nothing major here, just minor updates
This is a re-application of bytecodealliance#1712 to fix the broken build from
upgrading serde in a previous commit.
…bytecodealliance#1741)

* Remove feature flag from post-stabilization feature gates

This commit removes the optional `feature` specification from feature
gates (`@since`, in particular).

This change should simplify the usage of feature gates (see
WebAssembly/component-model#387) for more
discussion.

This is a breaking change for those who were depending on `wit-parser`
as `feature` now no longer present.

Signed-off-by: Victor Adossi <vadossi@cosmonic.com>

* Update wit-component to not use feature option in since

This commit updates `wit-component` to remove reliance on the
`feature` option when dealing with post-stabilization (`@since`)
feature gates.

Signed-off-by: Victor Adossi <vadossi@cosmonic.com>

* Update tests to remove optional feature on since gates

Signed-off-by: Victor Adossi <vadossi@cosmonic.com>

---------

Signed-off-by: Victor Adossi <vadossi@cosmonic.com>
)

These display representations are easy to get confused with the previous
return values of `u32` which do implement `Display`, but the `Display`
here isn't as applicable as it used to be. As a stopgap remove the
`Display` implementations entirely to help identify locations that need
to be updated to explicitly use an accessor or otherwise to calculate
the size/align information.
)

* Support optimizing feature checks at compile time

Something I've long wanted for `wasmparser` is the ability to
constant-propagate decisions about feature selection instead of
requiring runtime checks to do so. This should be a performance win for
proposals as they become standardized and more and more of wasm is gated
behind some feature or another. The goal with this is to enable a mode
of `wasmparser` which doesn't require runtime checks of booleans/bits to
see whether a proposal is enabled or not.

In lieu of not redesigning everything too much (e.g. adding `F:
WasmFeatures` everywhere) this commit adds a new compile time Cargo
feature to the crate called `features` which, when disabled, makes
`WasmFeatures` a zero-sized type that represent the default active
features for `wasmparser`. This enables const-propagating decisions
about features throughout the codebase and should help optimize the
validator/decoder in niche situations.

* Add required feature

* Update crates/wasmparser/src/features.rs

Co-authored-by: Nick Fitzgerald <fitzgen@gmail.com>

---------

Co-authored-by: Nick Fitzgerald <fitzgen@gmail.com>
* threads: add validation for shared calls

The shared-everything-threads [proposal] prevents `shared` contexts
(e.g., in a `shared` function) from accessing unshared objects. This
change adds validation to prevent `shared`-to-unshared calls.

[proposal]: https://github.com/WebAssembly/shared-everything-threads

* threads: refactor and add shared access checks

This checks shareability of other kinds of shared objects (minus
`shared` memories).

* Replace `type_of_function` with `type_index_of_function`

`WasmModuleResources` previously retrieved the entire `FuncType` but
this obscured the sharedness of the function in question, since the
shared flag is held a level up in `CompositeType`. By replacing
`WasmModuleResources::type_of_function` with a more low-level
`WasmModuleResources::type_index_of_function`, we can reuse the existing
helper functions that retrieve a `FuncType` from a `CompositeType` and
do the necessary sharedness checks.

* Clean up `OperatorValidator::new_func`
@dhil dhil merged commit 8901c08 into wasmfx:main Aug 28, 2024
29 checks passed
@dhil dhil deleted the wasmfx-merge branch August 28, 2024 14:09
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.

4 participants