forth: inline primitive calls in colon-def body (skip forth-execute-word)
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Has been cancelled

This commit is contained in:
2026-04-25 04:00:24 +00:00
parent c28333adb3
commit f6e333dd19
4 changed files with 19 additions and 6 deletions

View File

@@ -34,6 +34,10 @@
;; to the prior X — matching standard Forth redefinition semantics.
;; RECURSE is the one exception: it stays late-bound against the not-yet-
;; installed current definition.
;; Inline primitive calls: skip the `forth-execute-word` indirection by
;; appending the word's body fn directly (forth-execute-word body
;; reduces to `((get w "body") state)`, which is exactly what the body
;; fn already is). Saves one frame per call op in every colon-def.
(define
forth-compile-call
(fn
@@ -43,9 +47,7 @@
(if
(nil? w)
(forth-error state (str name " ?"))
(let
((op (fn (s) (forth-execute-word s w))))
(forth-def-append! state op))))))
(forth-def-append! state (get w "body"))))))
(define
forth-compile-recurse

View File

@@ -1,6 +1,6 @@
{
"source": "gerryjackson/forth2012-test-suite src/core.fr",
"generated_at": "2026-04-25T03:32:23Z",
"generated_at": "2026-04-25T04:00:01Z",
"chunks_available": 638,
"chunks_fed": 638,
"total": 638,

View File

@@ -11,7 +11,7 @@
| percent | 96% |
- **Source**: `gerryjackson/forth2012-test-suite` `src/core.fr`
- **Generated**: 2026-04-25T03:32:23Z
- **Generated**: 2026-04-25T04:00:01Z
- **Note**: completed
A "chunk" is any preprocessed segment ending at a `}T` (every Hayes test