1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
//! Payload types of the [`Op`](super::Op) enum: index aliases, immediates, and branch edges.
pub type TypeIdx = u32;
pub type FuncIdx = u32;
pub type TableIdx = u32;
pub type GlobalIdx = u32;
pub type LocalIdx = u32;
pub type DataIdx = u32;
pub type ElemIdx = u32;
/// A memory-access immediate: target memory index (#41) + static offset (`align` is
/// validation-only). The inline offset is `u32`; a `u64` offset (reachable only with a
/// memory64 memarg — or the literal value `u32::MAX` in wasm32, which collides with the
/// sentinel) is demoted to the function's [`BigMemArg`] pool: `offset == u32::MAX` marks
/// the demoted form, and `memory` then holds the pool index instead of the memory index.
pub
/// The `u32::MAX`-offset sentinel of a [`MemArg`] whose real immediate lives out of line.
pub const BIG_MEMARG: u32 = u32MAX;
/// A pooled wide memory immediate (see [`MemArg`]): the real memory index + full 64-bit offset.
pub
/// A resolved branch edge: on a taken branch the top `keep` operands are moved down over
/// `pop` discarded ones, then execution jumps to `ip`. `keep`/`pop` are `u16` to keep every
/// branch payload within the 16-byte `Op`: `keep` is a label arity (spec-capped at 1000);
/// `pop` is an operand-stack delta, and compilation rejects a function whose operand stack
/// outgrows `u16` (a resource bound, like the stack limit — see `control::branch`).
pub
/// A `br_table`'s target list, stored out-of-line in [`CompiledFunc::br_tables`]: the `len` case
/// targets occupy `[base .. base + len]` and the default sits at `base + len`. Keeping the targets
/// out of the `Op` enum is what makes `Op` non-drop (the `Box` here was its only drop field) — so a
/// `Vec<Op>` frees in one shot. (`br_on_cast` edges share this pool via a packed index.)
pub
/// Bit 31 of a pooled `br_on_cast` edge index (`Op::BrOnCast`/`BrOnCastFail`): the cast's
/// `nullable` flag; the low 31 bits index `CompiledFunc::br_tables`.
pub const NULLABLE_BIT: u32 = 1 << 31;
/// The i32 comparison of a fused [`Op::BrIfCmp`].
pub