From 6c641903b089d81fb193c3949ccc677b701bc55b Mon Sep 17 00:00:00 2001 From: eunhhu Date: Mon, 5 Oct 2026 07:53:22 +0100 Subject: Read a tree's items in compiled code from a run the frame keeps, start a run at the finger's leaf, and move indices only for a list an index refers to (021) - The frame keeps the run compiled code read a tree's item from last (the list as it was: its version); an item it holds is read from its column, else pure_run_item takes the item's run and steps. - pure_list_run starts at the leaf the finger keeps when it holds the position (a slice found by key just before): no second descent; the run after it is found from the root (PureRun.pathless). - LIST_APPEND and LIST_REMOVE move index states only for a list one refers to. - A search (core only): 89 ms compiled (answers the executor's). --- core/module-run.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'core/module-run.h') diff --git a/core/module-run.h b/core/module-run.h index 453c342..8844685 100644 --- a/core/module-run.h +++ b/core/module-run.h @@ -64,6 +64,9 @@ typedef struct { PureResult status; /* what refused or stopped it */ uint32_t fault_pc; /* the instruction that faulted or refused */ Loop *loops; /* PURE_MODULE_NESTING of them, apart: a walk points into its loop */ + /* The run of a tree compiled code read an item from last (pure_run_item): + * the list as it was (its version), its positions and each field's cells. */ + struct { const PureList *list; uint64_t version; size_t start, count; const void *columns[16]; } run; } Frame; /* How a step went: on to the next instruction; a fault (kind at fault_pc); @@ -87,11 +90,14 @@ int pure_run_each(Frame *, uint32_t pc); int pure_run_loop(Frame *, uint32_t pc); void pure_run_break(Frame *); int pure_run_iterate(Frame *); +/* ITEM_GET at pc whose list is a tree its kept run does not hold: the + * item's run kept, then the step. */ +int pure_run_item(Frame *, uint32_t pc); /* Where a list keeps what compiled code reads of it (module-list.c owns the * layout and says where): its item count, its key set (the words, how many, * whether they are bits), its form (pure_list_form) and its arrays. */ -enum { LIST_COUNT_AT, LIST_MEMBERS_AT, LIST_MEMBER_CAPACITY_AT, LIST_BITMAP_AT, LIST_FORM_AT, LIST_COLUMNS_AT }; +enum { LIST_COUNT_AT, LIST_MEMBERS_AT, LIST_MEMBER_CAPACITY_AT, LIST_BITMAP_AT, LIST_FORM_AT, LIST_COLUMNS_AT, LIST_VERSION_AT }; extern const size_t pure_list_layout[]; /* A module's code compiled (AArch64 Linux; elsewhere, or with PURE_JIT=0 in -- cgit v1.2.3