#[repr(u8)]pub enum Opcode {
Show 18 variants
OpenTag = 1,
CloseTag = 2,
VoidTag = 3,
Text = 4,
DynText = 5,
DynAttr = 6,
ShowIf = 7,
ShowElse = 8,
Switch = 9,
List = 10,
IslandStart = 11,
IslandEnd = 12,
TryStart = 13,
Fallback = 14,
Preload = 15,
Comment = 16,
ListItemKey = 17,
Prop = 18,
}Expand description
Bytecode opcodes for the FMIR instruction stream.
Variants§
OpenTag = 1
Open an element. str_idx(u32) + attr_count(u16) + [(key u32, val u32)]
CloseTag = 2
Close the named element. str_idx(u32)
VoidTag = 3
A void element, which takes no CLOSE_TAG. Same operands as OPEN_TAG.
Text = 4
Static text from the string table. str_idx(u32)
DynText = 5
Slot-bound text wrapped in <!--f:tN--> markers.
slot_id(u16) + marker_id(u16)
DynAttr = 6
Slot-bound attribute on the tag currently being opened.
attr_str_idx(u32) + slot_id(u16)
ShowIf = 7
Conditional region wrapped in <!--f:sN--> markers.
slot_id(u16) + then_len(u32) + else_len(u32), then the two bodies
separated by a Opcode::ShowElse byte.
ShowElse = 8
Separator byte between a SHOW_IF’s then- and else-bodies.
Switch = 9
First-match-wins multi-way branch on a slot’s text.
slot_id(u16) + case_count(u16), then one
(val_str_idx u32, body_len u32) header per case, then the bodies.
List = 10
Repeat a body once per element of an array slot, wrapped in
<!--f:lN--> markers. slot_id(u16) + item_slot_id(u16) + body_len(u32)
IslandStart = 11
Begin an island region. island_id(u16)
IslandEnd = 12
End an island region. island_id(u16)
TryStart = 13
Begin a try block. fallback_len(u32)
Fallback = 14
Separator between a try block’s main and fallback bodies.
Preload = 15
Emit a <link rel="preload">. resource_type(u8) + url_str_idx(u32)
Comment = 16
An HTML comment. str_idx(u32)
ListItemKey = 17
Set data-forma-key on the next element opened in a LIST body.
key_str_idx(u32)
LIMITATION: the operand is a static string-table index, so every item in a list gets the same key. Per-item keys would need a slot-bound operand, which is a v-bump to this opcode’s layout and a coordinated compiler change — not something the walker can work around.
Prop = 18
Extract a named property from an Object slot into a target slot. Format: src_slot_id(u16) + prop_str_idx(u32) + target_slot_id(u16)