Skip to main content

Module abi

Module abi 

Source
Expand description

The contract between generated code and the VM: the layout of the context, the status codes, and the layout of an object in the pool.

Constants§

CTX_CALL_VM
CTX_DYLIBS
CTX_ERR_A
CTX_ERR_AT
CTX_ERR_B
CTX_MARKING
CTX_OBJS
CTX_POP_ROOTS
CTX_PRINT
CTX_PUSH_ROOTS
CTX_REGS
CTX_RET
CTX_SHADE
CTX_STATUS
STATUS_DEPTH
A call would have stood past the call depth limit.
STATUS_HALT
main ran to its end.
STATUS_INDEX
A list index was out of range: err_a is the length, err_b the index.
STATUS_OK
The call went through.
STATUS_PANIC
A panic in a host function is on its way out; the VM holds it.
STATUS_SHIFT
A shift count was outside 0..64: err_a is the count.
STATUS_VM
The interpreter, entered from the code, stopped with an error it recorded itself.
VERSION
Bumped whenever anything below, the helpers’ signatures, or the layout of a value changes.

Functions§

object_layout
How an object in the pool is laid out: the size of one entry, and the offsets of its buffer pointer and its length. The pool is a vector of vectors the code indexes directly, and Rust promises no layout for a vector, so the build measures it and the VM checks the build’s answer against its own before it runs any of the code.