Skip to content

Create a macro to define VM* types, their layout and offsets, and alias-region helpers #13707

Description

@fitzgen

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    cleanupLabel to track issues for small clean-ups.craneliftIssues related to the Cranelift code generatorwasmtimeIssues about wasmtime that don't fall into another label

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions