Skip to main content

Crate xur_bytecode

Crate xur_bytecode 

Source
Expand description

Xur’s bytecode, and lowering resolved syntax to it.

Each function becomes a control-flow graph of basic blocks over virtual registers (see ir). The shape is close to Cranelift’s IR, so a JIT can later compile the same code the interpreter runs.

Re-exports§

pub use ir::Block;
pub use ir::BlockId;
pub use ir::Constant;
pub use ir::Decorator;
pub use ir::DefRef;
pub use ir::Function;
pub use ir::Inst;
pub use ir::InstKind;
pub use ir::RecordFields;
pub use ir::Reg;
pub use ir::Terminator;
pub use ir::TypeArg;

Modules§

ir
The instruction set.

Structs§

FieldSig
FnSig
A function’s parameters and return type.
ItemIndex
Every function, constant and constructor of the loaded modules, by definition. Updated as modules are imported.
ParamSig
VariantSig

Enums§

BinOpKind
ItemRef
What lowering needs to know about a definition.
RtType
A type written in the source, as checked at runtime. Xur is checked dynamically: where a type is written it is enforced when the value arrives, and where it isn’t (or is generic) anything goes.
TypeSig
A written type, in full.
UnOp

Functions§

display_function
Lists function and the closures it creates.
fn_signature
The signature of the top-level function name in the program’s root module, or None if there is no such function.
lower
Lowers the function or constant def, or returns None if def is neither. A constant lowers to a function without parameters that computes its value.
rt_type
The runtime check for a written type, or None when nothing about it can be checked (an inferred or generic type).
type_def
The struct, enum or native type a written type names, if any.
type_name
How a written type is named at runtime, e.g. by type_name: u32, Point, [u8], or _ for a type left to be inferred.