Skip to main content

Module backend

Module backend 

Source
Expand description

Backend trait and registry for multi-backend compilation

Every compiler backend (ARM, aWsm, wasker, w2c2) implements the Backend trait, allowing the CLI and verification framework to treat them uniformly.

Structs§

BackendCapabilities
What a backend can and cannot do
BackendRegistry
Registry of available backends
CodeRelocation
CompilationResult
Result of compiling a full module
CompileConfig
Configuration for a compilation run
CompiledFunction
A single compiled function
LocalsFirst
The locals-first symbol order, computed ONCE for every container that needs it (#656, #1180).
VolatileRange
#543 — an integrator-marked volatile linear-memory segment (the DMA transfer window): the half-open byte range [base, base + len) of the fused linear memory that an external agent rewrites out-of-band. Parsed from the CLI --volatile-segment <base>:<len> flag. See CompileConfig::volatile_segments for the Phase-1/Phase-2 split.

Enums§

BackendError
Errors from backend compilation
BranchClass
VCR-DEC-003 (#396, witness#130): the object-level control-flow class of one emitted machine instruction, captured at encode time alongside LineMap. It is the piece post-hoc CLI derivation cannot recover — line_map records which wasm op an instruction came from, but not whether that instruction IS a conditional branch, an unconditional branch, or a predicated (IT-block) move. The synth-provenance-v1 emitter needs it to enumerate the ACTUAL object conditional branches (so it can prove “every object branch resolves to a source condition”, not just “every source branch has an object PC”).
RelocKind
A relocation entry produced during compilation
SafetyBounds
Memory-bounds safety strategy. Phase 1 of docs/binary-safety-design.md §3.1.
SymbolBinding
Symbol BINDING — whether a symbol takes part in cross-object resolution (#656 ARM, #1180 / RQ-65-FUNCN aarch64).

Constants§

FUNC_TABLE_SYMBOL
#275: the base symbol of the SELF-CONTAINED funcref table — the flash-resident region build_multi_func_cortex_m_elf appends after the function code: one 4-byte code pointer per table slot across ALL tables in declaration order (the same contiguous layout the --relocatable R11 contract uses — TableGuards::base_byte_offset stays valid verbatim), null slots as ZERO words (#664), followed by the #676 type-id sidecar at type_ids_byte_offset when a heterogeneous table needs it. The dispatch reaches it through an LdrSym literal-pool word (an Abs32 reloc against this symbol) that the image builder patches post-layout — never through R11, which is the linear-memory base (the #717 collision).
OPTIMIZED_LINMEM_BASE
The absolute SRAM address the OPTIMIZED (non-relocatable) ARM path materializes as its linear-memory base (MOVW/MOVT R12, #base before each const-address access, and the #468 base-CSE R11 hoist). Historical value: 256 bytes above the SRAM start — the differential-harness contract for optimized-path fixtures maps linmem here. CompileConfig::linmem_base defaults to this; --stack-layout=low (#687) shifts it up by the reserved stack size so the moved layout reaches user code, not just the startup.

Traits§

Backend
Trait that every compilation backend implements

Functions§

locals_first
Compute the LocalsFirst permutation for bindings (in the caller’s current order).

Type Aliases§

BranchMap
VCR-DEC-003: per-instruction object-branch class, parallel to LineMap (same length, same order — one entry per emitted machine instruction). (machine_offset_within_code, class). Empty when provenance is not being produced (never serialized into .text; frozen-safe additive metadata).
LineMap
VCR-DBG-001: a per-instruction source map — (machine_offset_within_code, wasm_op_index) pairs, one per emitted machine instruction. A None op-index marks an instruction with no originating wasm op (prologue/epilogue, literal pool). Consumed by the DWARF .debug_line emitter; empty when no source map was produced.