Skip to main content

Module program

Module program 

Source
Expand description

A lowered program, and the tables an instruction indexes into.

A Program is immutable once lowered. ADR 0008 runs a spawned task on a thread of its own and a task’s body is a lowered function like any other, so every thread of one run reads this same program rather than a copy of it — which is why the strings in it are Arc<str> and why nothing here is behind a cell.

Structs§

Arg
One argument of a call: where the value is, and what it is.
ArgsId
Names an argument list in Program::args.
Builtin
One builtin a program calls: Array.length, String.split, Int.abs.
BuiltinId
Names a builtin in Program::builtins.
Capture
A capture a closure body reads.
CaseId
Names one case of an enum layout: its position in crate::layout::Shape::Enum::cases.
Function
One lowered function.
FunctionId
Names a Function in Program::functions.
HostOp
One host operation a program calls: console.log, files.read, files.Writer.writeLine.
HostOpId
Names a host operation in Program::host_ops.
Inlined
A body that was written elsewhere and expanded into this one.
Local
One named binding, and the range of the function’s code over which that name denotes that slot.
Program
A whole lowered package.
StrId
Names a string in Program::strings.
Table
Where a Inst::Switch goes.
TableId
Names a jump table in Program::tables.