diff options
| author | Irene Knapp <ireneista@irenes.space> | 2026-09-07 15:43:07 -0700 |
|---|---|---|
| committer | Irene Knapp <ireneista@irenes.space> | 2026-09-07 15:43:07 -0700 |
| commit | 2ac74d5f4c5515a449e5fe1389772f293c0ceaeb (patch) | |
| tree | 0c4c2e2c2fd93f142efb0885778650eedffd1f94 | |
| parent | 8bc536ad9fd240e01e115eba3a4f44d615d9acc3 (diff) | |
add traps to all the pack[0-9]+ words
this is probably not going to be used in the end, but we found it necessary to write it out to get in touch with our feelings, which allowed us to decide on the other approach, and it's a small amount of code so it's probably best to leave it in until the transform is done. if we took it out we'd keep being tempted to put it back. Force-Push: yes Change-Id: I431d27d4f8b8e5415d84d0a2752a0522639792e9
| -rw-r--r-- | transform.e | 97 |
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 , |