mirror of
https://github.com/encounter/wasmtime.git
synced 2026-03-30 11:42:15 -07:00
b651c44116
* Refactor the `MemFlags` internal representation This commit refactors the internal `MemFlags` bits to be not just flags. Instead some bits are now grouped together and interpreted as a unit. This enables two primary API changes: * First the `heap`/`table`/`vmctx` split is now represented as an "alias region" which is set as an enum. This means that all `MemFlags` carry an `Option<AliasRegion>` internally. * Second trapping state is now represented as an `Option<TrapCode>`. This means that `notrap` is no longer a flag and `tabletrap` is no longer a flag. This does enable storing arbitrary trap codes though so long as they aren't `TrapCode::User(_)`. The main purpose of this commit is to enable using more trap codes with `MemFlags` for when a segfault is detected. For example with #5291 we want a segfault to indicate a call-to-null, which is not currently covered by `MemFlags`. * Remove individual alias region setters/getters from `MemFlags` Instead use the `AliasRegion` enum instead to help emphasize that only one region is possible on a `MemFlags`, not multiple. * Update cranelift/codegen/src/ir/memflags.rs Co-authored-by: Jamey Sharp <jamey@minilop.net> --------- Co-authored-by: Jamey Sharp <jamey@minilop.net>