aboutsummaryrefslogtreecommitdiffstats
path: root/core/module.c
diff options
context:
space:
mode:
authoreunhhu <[email protected]>2026-10-05 07:43:22 +0100
committereunhhu <[email protected]>2026-10-05 07:43:22 +0100
commit2dc0a4df9485c0a4c08859ad81f41d6efab98dd5 (patch)
tree0b35c0993f0da03eee9d6b89f56d9b4ae6c15105 /core/module.c
parent75b9c1c1e936e2b7c55275139897e1c78d7939c1 (diff)
downloadpure-2dc0a4df9485c0a4c08859ad81f41d6efab98dd5.tar.gz
pure-2dc0a4df9485c0a4c08859ad81f41d6efab98dd5.zip
Write the hot instructions as code: constants, states, locals, rows, arithmetic, has by bits, a DENSE field by key, a FLAT item, and loop iterations (021)
- module-jit.c writes CONST, LOAD, STORE, the local and row loads, INDEX_FIRST, LIST_COUNT, INDEX_MOVE, NOT, NEG, FLOOR, the number arithmetic and comparisons (DIVIDE and NON_FINITE faults where the executor gives them), LIST_HAS by a key set's bits, a joined FIND's field of a DENSE list, a FLAT list's ITEM_GET, and a walk's and a count's iteration (work charged as the executor charges it). Anything else, or a list in another form, still calls step. - module-list.c says where a list keeps what the code reads (pure_list_layout); list_of and item_field are shared. - PURE_JIT_DUMP=file writes the code made, to read with objdump. - A search (core only): 103 ms compiled, 122 ms executed; the answers (hops, reached, work) are the executor's.
Diffstat (limited to 'core/module.c')
-rw-r--r--core/module.c2
1 files changed, 0 insertions, 2 deletions
diff --git a/core/module.c b/core/module.c
index 2b484a6..ff6f131 100644
--- a/core/module.c
+++ b/core/module.c
@@ -335,8 +335,6 @@ static bool state_of(const PureModule *m, uint32_t state, uint8_t type) {
}
/* The list an item operation names: its low 16 bits (the field is above). */
-static uint32_t list_of(uint32_t arg) { return arg & 0xFFFF; }
-static uint32_t item_field(uint32_t arg) { return arg >> 16; }
static unsigned char field_type(const PureModule *m, uint32_t list, uint32_t field) {
static const unsigned char types[] = {[PURE_RECORD_NUMBER] = T_NUM, [PURE_RECORD_TEXT] = T_TEXT,