Files
Alex Crichton b651c44116 Refactor the MemFlags internal representation (#8162)
* 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>
2024-03-18 15:12:03 +00:00
..
2023-04-29 04:37:10 +00:00
2024-02-22 23:54:03 +00:00
2024-02-22 23:54:03 +00:00
2024-02-22 23:54:03 +00:00