bytecodealliance / bytecodealliance/wasmtime
Create a macro to define `VM*` types, their layout and offsets, and alias-region helpers
- Dominant language
- Rust
- Stars
- 18.6k
- Forks
- 1.8k
- Avg merge
- 1d 18h
- Merged PRs (30d)
- 126
Description
Not 100% sure exactly what this would look like yet, but we very mechanically repeat ourselves in multiple places:
* We define the `VM*` types themselves in `crates/wasmtime/src/runtime/vm/vmcontext.rs`
* We define their layouts and field offsets in `crates/environ/src/vmoffsets.rs`
* We define helpers to emit loads/stores of these types/fields with the proper alias regions in `crates/cranelift/src/alias_regions.rs`
And all of those need to be kept in-sync.
Probably want some kind of `for_each_vm_type!` macro defined in `wasmtime-environ`, and then use that to define the `VMOffsets` in `wasmtime-environ`, the types themselves in `wasmtime::runtime::vm`, and the emit helpers in `wasmtime-cranelift`.
Contributor guide
Assessment
This issue has not been assessed yet.