summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--transform.e97
1 files changed, 97 insertions, 0 deletions
diff --git a/transform.e b/transform.e
index 6328e82..5475db4 100644
--- a/transform.e
+++ b/transform.e
@@ -2976,6 +2976,12 @@ allocate-transformation-state s" transformation-state" variable
     1+ swap 1- swap
   } while ;
 
+~ (data start, data length)
+: hex-pack-trace
+  hex-output-metadata-entry-type-line-comment
+  s" pack"
+  add-hex-output-metadata-entry ;
+
 ~   By overriding colon, we can special-case the definitions of particular
 ~ words. It's very metacircular.
 ~
@@ -3174,6 +3180,97 @@ allocate-transformation-state s" transformation-state" variable
     exit
   } if
 
+  dup s" pack8" stringcmp 0 = {
+    create dropstring
+    s" docol" find entry-to-execution-token execute ,
+    make-hidden
+
+    ~   We can't use over because this patch happens at the time pack8 is
+    ~ being defined, and it would be a forward reference. We do the equivalent
+    ~ by hand.
+    ~ (output point, value)
+    s" swap" find entry-to-execution-token ,
+    s" dup" find entry-to-execution-token ,
+    s" 3unroll" find entry-to-execution-token ,
+    ~ (output point, value, output point)
+    s" lit" find entry-to-execution-token ,
+    1 ,
+    ' hex-pack-trace entry-to-execution-token ,
+    ~ Fall through to the inner implementation.
+
+    ' ] entry-to-execution-token execute
+    exit
+  } if
+
+  ~ Extremely similar to the pack8 patch.
+  dup s" pack16" stringcmp 0 = {
+    create dropstring
+    s" docol" find entry-to-execution-token execute ,
+    make-hidden
+
+    ~   We can't use over because this patch happens at the time pack8 is
+    ~ being defined, and it would be a forward reference. We do the equivalent
+    ~ by hand.
+    ~ (output point, value)
+    s" swap" find entry-to-execution-token ,
+    s" dup" find entry-to-execution-token ,
+    s" 3unroll" find entry-to-execution-token ,
+    ~ (output point, value, output point)
+    s" lit" find entry-to-execution-token ,
+    2 ,
+    ' hex-pack-trace entry-to-execution-token ,
+    ~ Fall through to the inner implementation.
+
+    ' ] entry-to-execution-token execute
+    exit
+  } if
+
+  ~ Extremely similar to the pack8 patch.
+  dup s" pack32" stringcmp 0 = {
+    create dropstring
+    s" docol" find entry-to-execution-token execute ,
+    make-hidden
+
+    ~   We can't use over because this patch happens at the time pack8 is
+    ~ being defined, and it would be a forward reference. We do the equivalent
+    ~ by hand.
+    ~ (output point, value)
+    s" swap" find entry-to-execution-token ,
+    s" dup" find entry-to-execution-token ,
+    s" 3unroll" find entry-to-execution-token ,
+    ~ (output point, value, output point)
+    s" lit" find entry-to-execution-token ,
+    4 ,
+    ' hex-pack-trace entry-to-execution-token ,
+    ~ Fall through to the inner implementation.
+
+    ' ] entry-to-execution-token execute
+    exit
+  } if
+
+  ~ Extremely similar to the pack8 patch.
+  dup s" pack64" stringcmp 0 = {
+    create dropstring
+    s" docol" find entry-to-execution-token execute ,
+    make-hidden
+
+    ~   We can't use over because this patch happens at the time pack8 is
+    ~ being defined, and it would be a forward reference. We do the equivalent
+    ~ by hand.
+    ~ (output point, value)
+    s" swap" find entry-to-execution-token ,
+    s" dup" find entry-to-execution-token ,
+    s" 3unroll" find entry-to-execution-token ,
+    ~ (output point, value, output point)
+    s" lit" find entry-to-execution-token ,
+    8 ,
+    ' hex-pack-trace entry-to-execution-token ,
+    ~ Fall through to the inner implementation.
+
+    ' ] entry-to-execution-token execute
+    exit
+  } if
+
   dup s" packalign" stringcmp 0 = {
     create dropstring
     s" docol" find entry-to-execution-token execute ,