summary refs log tree commit diff
path: root/execution.e
diff options
context:
space:
mode:
authorIrene Knapp <ireneista@irenes.space>2026-05-16 13:16:12 -0700
committerIrene Knapp <ireneista@irenes.space>2026-05-16 13:16:12 -0700
commit32f1fde313ce07e086b503b08babffe60a7be05d (patch)
tree74acb06f388959517cd52bcb8e788f81f9ca92be /execution.e
parent8c5b92312f9e7bc2fff7b547a03805d9bf47d26e (diff)
ah, oops, there was a bug in the label transform for compiled words
fixed now

also a bunch of small things towards adding a log-load transform

Force-Push: yes
Change-Id: I6eeb94d896a7e79092886d7b60e9404c31b2ba6f
Diffstat (limited to 'execution.e')
-rw-r--r--execution.e21
1 files changed, 17 insertions, 4 deletions
diff --git a/execution.e b/execution.e
index bd27f7e..6af9e2c 100644
--- a/execution.e
+++ b/execution.e
@@ -310,7 +310,7 @@
 ~
 ~ (output memory start, current output point
 ~  -- output memory start, current output point)
-: cold-start
+: output-cold-start
   current-offset L' cold-start set-label
   cld                                      ~ clear the DF flag
 
@@ -466,6 +466,7 @@
   L@' warm-start L@' origin + :rsi mov-reg64-imm64
   pack-next ;
 
+
 ~ Routine warm-start
 ~ ~~~~~~~~~~~~~~~~~~
 ~
@@ -473,15 +474,23 @@
 ~ been initialized, and the structure of this routine is an array of codeword
 ~ pointers. It was directly jumped to from cold-start. There's nowhere to
 ~ return to, so it needs to never return.
-: warm-start
+~
+~ (output buffer start, output point, input string pointer
+~  -- output buffer start, output point)
+: output-warm-start
   ~   While it's not actually a requirement that codeword pointers be
   ~ word-aligned, it's highly likely that it helps performance. (Whether it
   ~ does is up to Intel's microcode.)
+  3unroll
   8 packalign
   current-offset L!' warm-start
+  3roll
+
+  ~ log-load-transform
+  drop
 
   ~ TODO this is tied to the specific example in evoke
-  L@' happy-path L@' origin + pack64
+  ~ L@' happy-path L@' origin + pack64
 
   ~   Before handing off to us, cold-start pushed a single value onto the
   ~ stack, a pointer to the beginning of the heap. Now, we load our entire
@@ -607,11 +616,15 @@
 ~ We pop the control stack, and then, since this is threaded execution, we
 ~ do the next thing the caller wants to do, by inlining "next".
 ~
+~   This word would work fine with the label transformation, so we could put
+~ it in core.e, but we choose to define it here because it's easier to
+~ understand when it's close to the rest of the execution stuff.
+~
 ~ (previous entry address, output point
 ~  -- new entry address, output point)
 : output-exit
   s" exit" output-create
-  L!' exit
+  current-offset L!' exit
   :rsi pack-popcontrol
   pack-next
   ;