Skip to main content

Module vm

Module vm 

Source

Structs§

KeyByText
A key as a map looks it up, matching a stored key by same_key. It hashes as Data::as_map_key files the key, so one that matches sits in the bucket this looks in.
Pool
RegisterFile
Regs
The registers of one run, addressed through the register file’s base pointer. execute makes one at the start of a run and reads and writes every register through it; the file is never resized while a program runs, so the pointer stays valid to the end.
StringPool
Every string too long to sit inside a Data, with the character count of each one remembered.

Constants§

CALL_DEPTH_LIMIT
How many calls may stand at once. A recursion that never returns pushes a frame per call, so an unbounded one grows the frame stack until the operating system kills the process; the call past this many frames raises call_depth_exceeded instead. The limit sits far above what a working recursion needs, and the frames a run this deep stands on stay within a few hundred megabytes even for a function that saves many registers per level.

Traits§

UncheckedSliceOps
UncheckedVecOps

Functions§

execute
Runs instructions from start until the program halts.
map_insert
Puts value under key, replacing the value of a key with the same text if the map holds one, and answers the value it replaced. Every insert goes through here, so every key a map holds is filed by Data::as_map_key.
same_key
Whether two values are the same as a map key or a list element: the same value, or two strings with the same text. A string longer than six bytes lives in the string pool, and the same text can sit in more than one slot.
shift_count_in_range
Whether count is a number of bits an int can be shifted by.

Type Aliases§

CandelaMap
A candela map: Data-keyed, hashed by the raw value bits, and walked in the order its keys were first inserted. Every surface that walks a map (a for loop, keys, values, printing, json) reads it in that one order, so a program that builds a map the same way twice prints it the same way twice.
MapPool
ObjectPool