diff options
| author | eunhhu <[email protected]> | 2026-10-18 16:44:17 +0100 |
|---|---|---|
| committer | eunhhu <[email protected]> | 2026-10-18 16:44:17 +0100 |
| commit | 433f56c29b26b83cd2991b4a834b427fae3e75d4 (patch) | |
| tree | 2ef84f30892e5dcabb196d63b1016d255d759beb /core/module.h | |
| parent | a9adaf2a1a62e5dd37f0067653b35e9cfa2c1860 (diff) | |
| download | pure-433f56c29b26b83cd2991b4a834b427fae3e75d4.tar.gz pure-433f56c29b26b83cd2991b4a834b427fae3e75d4.zip | |
Module executor: a call's frame counted in the event's room by a table, as gas is (PURE_CALL_*: 256 a frame, 64 a value of its stack's height, 8 a local, 128 a loop it nests, 1024 a list of its own, 128 a held value, 16 a register; each at least what it stands for, checked as it compiles), not by the implementation's sizes: a module's calls fail at the same depth on every machine and build; a call's list let go is kept for the next calls unless what it keeps empty passes what a frame counts for it
Diffstat (limited to 'core/module.h')
| -rw-r--r-- | core/module.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/core/module.h b/core/module.h index 9ce354f..18947d0 100644 --- a/core/module.h +++ b/core/module.h @@ -131,6 +131,11 @@ enum { PURE_FORMAT_WIDTH = 8, PURE_FORMAT_ZEROS = 1 << 16, PURE_FORMAT_FORM = 17 * text of a code point, failing as LIMIT outside 0-0x10FFFF and as ENCODING * for a surrogate. */ enum { PURE_MODULE_FUNCTIONS = 64, PURE_MODULE_SIGNATURES = 1024, PURE_SIGNATURE_BYTES = 5 }; +/* What a call's frame counts in the event's room: a table, as gas is, not the implementation's sizes (each at least + * what it stands for), so a module's calls fail at the same depth wherever and on whatever build they run: so much a + * frame, a value of its stack's height, a local, a loop it nests, a list of its own, a held value and a register. */ +enum { PURE_CALL_BYTES = 256, PURE_CALL_VALUE = 64, PURE_CALL_LOCAL = 8, PURE_CALL_LOOP = 128, PURE_CALL_LIST = 1024, + PURE_CALL_HELD = 128, PURE_CALL_REGISTER = 16 }; /* A local: one of an event's PURE_MODULE_LOCALS slots, 0 when the event * begins and never saved. LOCAL_LOAD and LOCAL_STORE name the slot (bits * 0-7), what it holds (bits 8-15: 0 a number, 1 an index, 2 a bool, 3 an i64, |
