In addition to VM instructions, an instruction stream may contain variable-length data embedded within it. This data is always preceded by special loading instructions, which interpret the data and advance the instruction pointer to the next VM instruction.
All of these loading instructions have a
indicating the size of the embedded data, in bytes. The length itself
is encoded in 3 bytes.
Load an arbitrary number from the instruction stream. The number is embedded in the stream as a string.
Load a string from the instruction stream. The string is assumed to be encoded in the “latin1” locale.
Load a UTF-32 string from the instruction stream. length is the length in bytes, not in codepoints.
Load a symbol from the instruction stream. The symbol is assumed to be
encoded in the “latin1” locale. Symbols backed by wide strings may
be loaded via
Load a uniform array from the instruction stream. The shape and type of the array are popped off the stack, in that order.
Load bytecode from the instruction stream, and push a compiled procedure.
This instruction pops one value from the stack: the program’s object
table, as a vector, or
#f in the case that the program has no
object table. A program that does not reference toplevel bindings and
does not use
object-ref does not need an object table.
This instruction is unlike the rest of the loading instructions,
because instead of parsing its data, it directly maps the instruction
stream onto a C structure,
struct scm_objcode. See Bytecode and Objcode, for more information.
The resulting compiled procedure will not have any free variables captured, so it may be loaded only once but used many times to create closures.