alexcrichton opened PR #8162 from alexcrichton:refactor-mem-flags
to bytecodealliance:main
:
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 allMemFlags
carry
anOption<AliasRegion>
internally.Second trapping state is now represented as an
Option<TrapCode>
.
This means thatnotrap
is no longer a flag andtabletrap
is no
longer a flag. This does enable storing arbitrary trap codes though so
long as they aren'tTrapCode::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 https://github.com/bytecodealliance/wasmtime/issues/5291 we
want a segfault to indicate a call-to-null, which is not currently
covered byMemFlags
.
alexcrichton requested fitzgen for a review on PR #8162.
alexcrichton requested wasmtime-compiler-reviewers for a review on PR #8162.
alexcrichton requested wasmtime-core-reviewers for a review on PR #8162.
jameysharp created PR review comment:
I think this comment no longer applies; the "Errors" section below covers semantic errors,
set_by_name
doesn't returnfalse
for them any more./// name.
jameysharp submitted PR review:
This looks great, after one minor doc-comment fix I think. Very clear and reviewable, thank you!
jameysharp submitted PR review:
This looks great, after one minor doc-comment fix I think. Very clear and reviewable, thank you!
alexcrichton updated PR #8162.
alexcrichton has enabled auto merge for PR #8162.
alexcrichton merged PR #8162.
Last updated: Nov 22 2024 at 16:03 UTC