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.
Not 100% sure exactly what this would look like yet, but we very mechanically repeat ourselves in multiple places:
VM*types themselves incrates/wasmtime/src/runtime/vm/vmcontext.rscrates/environ/src/vmoffsets.rscrates/cranelift/src/alias_regions.rsAnd all of those need to be kept in-sync.
Probably want some kind of
for_each_vm_type!macro defined inwasmtime-environ, and then use that to define theVMOffsetsinwasmtime-environ, the types themselves inwasmtime::runtime::vm, and the emit helpers inwasmtime-cranelift.