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§

ItemIndex
Every function, constant and constructor of the loaded modules, by definition. Updated as modules are imported.

Enums§

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.

Functions§

display_function
Lists function and the closures it creates.
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.