pub enum Instr {
Show 21 variants
Send {
chan: Reg,
val: Reg,
},
Receive {
chan: Reg,
dst: Reg,
},
Offer {
chan: Reg,
label: String,
},
Choose {
chan: Reg,
table: Vec<(String, PC)>,
},
Open {
roles: Vec<String>,
local_types: Vec<(String, LocalTypeR)>,
handlers: Vec<((String, String), String)>,
dsts: Vec<(String, Reg)>,
},
Close {
session: Reg,
},
Invoke {
action: InvokeAction,
},
Acquire {
layer: String,
dst: Reg,
},
Release {
layer: String,
evidence: Reg,
},
Fork {
ghost: Reg,
},
Join,
Abort,
Transfer {
endpoint: Reg,
target: Reg,
bundle: Reg,
},
Tag {
fact: Reg,
dst: Reg,
},
Check {
knowledge: Reg,
target: Reg,
dst: Reg,
},
Set {
dst: Reg,
val: ImmValue,
},
Move {
dst: Reg,
src: Reg,
},
Jump {
target: PC,
},
Spawn {
target: PC,
args: Vec<Reg>,
},
Yield,
Halt,
}Expand description
Bytecode instruction.
The initial instruction set covers communication, session lifecycle, effects, and control flow. Guard/speculation/ownership instructions are deferred.
Variants§
Send
Send value in val register to channel in chan register.
Receive
Receive from channel in chan register, store in dst register.
Offer
Offer a label on channel.
Choose
Choose from a branch table using a received label.
Open
Open a new session with the given roles and endpoint destinations.
Fields
local_types: Vec<(String, LocalTypeR)>Role-to-local-type mappings for session initialization.
Close
Close the session referenced by the register.
Invoke
Invoke an effect handler action.
Fields
action: InvokeActionAction descriptor.
Acquire
Acquire a guard layer and store evidence in a register.
Release
Release a guard layer using evidence from a register.
Fork
Enter speculation using a ghost session id.
Join
Join speculative execution.
Abort
Abort speculative execution.
Transfer
Transfer an endpoint to another coroutine.
Fields
Tag
Tag a knowledge fact and return success.
Check
Check a knowledge fact against the flow policy.
Fields
Set
Set a register to an immediate value.
Move
Copy register src to dst.
Jump
Unconditional jump.
Spawn
Spawn a new coroutine at target PC with argument registers.
Fields
Yield
Yield execution to the scheduler.
Halt
Halt this coroutine (normal termination).