Expand description
The interpreter. Dispatch is a plain match over opcodes (the P10 ceiling pass owns dispatch optimization). Lua→Lua calls share one loop and never recurse the Rust stack; only native↔Lua boundaries do (e.g. pcall).
Varargs follow 5.5 semantics: a vararg call materializes a vararg table
(fields 1..n plus “n”) kept in the function’s own stack slot; ...
expands from it and ...name binds it. 5.1 LUAI_COMPAT_VARARG also
materializes a local arg table (see proto.has_compat_vararg_arg).
Structs§
- Hook
State - Per-thread debug hook state (PUC
lua_Statehook/hookmask/basehookcount/ hookcount).funcis the Lua hook; the booleans are the PUC mask bits. - Vm
- A Lua virtual machine: one OS thread’s worth of Lua state.
Enums§
- Error
- Combined error type returned by
Vm::evaland friends — either the chunk failed to parse / compile, or it raised at runtime. - Rust
Hook Event - Classified debug event delivered to a
RustDebugHook. - Warn
State - PUC 5.4+ default warnf state. The base library’s
warnfunction flips betweenOffandOnvia the@on/@offcontrol messages; any other@<word>control is silently ignored, mirroringlauxlib.c::checkcontrol.
Constants§
- HOOK_
MASK_ CALL - Mask flags for
Vm::set_rust_debug_hook. OR these to subscribe to multiple event categories with a single hook installation. - HOOK_
MASK_ COUNT - Subscribe to instruction-count events.
- HOOK_
MASK_ LINE - Subscribe to line-change events.
- HOOK_
MASK_ RETURN - Subscribe to function-return events.
Type Aliases§
- Rust
Debug Hook - Rust-side debug hook callback (B11). Receives the
Vmplus a classified event. The callback runs synchronously in the dispatcher; the hook flag (in_hook) is set for its duration so hook recursion is suppressed.