pub enum SlotBase {
Arg(usize),
Global(u64),
Unmappable,
}Expand description
What an InterfaceSlot’s address is relative to.
Deliberately register-free. A materialized function is on its way to being a pure function of its arguments, and its interface should carry no notion of a register file: the register channel has already turned every register input into a by-value argument, so a base that was a register is simply the argument bound to it. The property that matters is that a caller can express the address — hence the vocabulary is “an argument you pass” or “an address that is the same everywhere”.
The address-less cases are kept apart on purpose: an absolute address and a base we failed to describe are both address-less, but only the first is bindable. Collapsing them would let a consumer load from a bogus absolute address for a base it never resolved.
Variants§
Arg(usize)
The callee’s i-th positional argument: mem[args[i] + offset].
Bindable at any site that passes that argument — which is site-relative, and honestly so: a pointer the caller supplies cannot be reconstructed without a caller. A caller-less function is still materialized; it simply binds nowhere.
Global(u64)
An absolute address (a global): mem[addr + offset]. Bindable anywhere,
including at an implicit or indirect site, since the address is the same
in every caller.
Unmappable
The base could not be expressed. Not bindable: a consumer must refuse such a slot rather than treat it as absolute.