forth: JIT cooperation hooks (vm-eligible flag + call-count + forth-hot-words)
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 11s
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 11s
This commit is contained in:
@@ -193,6 +193,12 @@
|
||||
forth-emit-str
|
||||
(fn (state s) (dict-set! state "output" (str (get state "output") s))))
|
||||
|
||||
;; The body is always a plain SX lambda — primitives and colon-def
|
||||
;; bodies alike — which means the SX VM's JIT-on-first-call can lift
|
||||
;; the body directly into bytecode. We tag every word `:vm-eligible?
|
||||
;; true` so downstream JIT cooperation (a tracing layer, a hot-call
|
||||
;; counter) can pick out the JIT-friendly entries by metadata rather
|
||||
;; than by inspecting the body shape.
|
||||
(define
|
||||
forth-make-word
|
||||
(fn
|
||||
@@ -202,6 +208,8 @@
|
||||
(dict-set! w "kind" kind)
|
||||
(dict-set! w "body" body)
|
||||
(dict-set! w "immediate?" immediate?)
|
||||
(dict-set! w "vm-eligible?" true)
|
||||
(dict-set! w "call-count" 0)
|
||||
w)))
|
||||
|
||||
(define
|
||||
|
||||
Reference in New Issue
Block a user