diff options
Diffstat (limited to 'compilation/transform.e')
| -rw-r--r-- | compilation/transform.e | 112 |
1 files changed, 55 insertions, 57 deletions
diff --git a/compilation/transform.e b/compilation/transform.e index 39c3bc5..46d4da8 100644 --- a/compilation/transform.e +++ b/compilation/transform.e @@ -925,7 +925,7 @@ allocate-transformation-state s" transformation-state" variable ~ Since [ is an immediate word, we have to go to extra trouble to compile ~ it as part of ;. - [ ' [ entry-to-execution-token , ] + [ x' [ , ] ; make-immediate @@ -953,7 +953,7 @@ allocate-transformation-state s" transformation-state" variable ~ Since [ is an immediate word, we have to go to extra trouble to compile ~ it as part of ;asm. - [ ' [ entry-to-execution-token , ] + [ x' [ , ] ; make-immediate @@ -1001,11 +1001,11 @@ allocate-transformation-state s" transformation-state" variable ~ implementations, they'd have to be kept in sync, and it's an important ~ user-facing word with semantics that are likely to improve over time. interpreter-flags @ - ' s" entry-to-execution-token + x' s" swap-transform-variables ~ Since [ is an immediate word, we have to go to extra trouble to compile ~ it as part of the alternate. - [ ' [ entry-to-execution-token , ] + [ x' [ , ] execute swap-transform-variables swap interpreter-flags ! @@ -1030,7 +1030,7 @@ allocate-transformation-state s" transformation-state" variable : label-dot-string-alternate - ' label-string-alternate entry-to-execution-token execute + x' label-string-alternate execute interpreter-flags @ 0x01 & { swap-transform-variables @@ -1928,7 +1928,7 @@ allocate-transformation-state s" transformation-state" variable ~ Since [ is an immediate word, we have to go to extra trouble to compile ~ it as part of ;. - [ ' [ entry-to-execution-token , ] + [ x' [ , ] ; make-immediate @@ -1959,7 +1959,7 @@ allocate-transformation-state s" transformation-state" variable ~ Since [ is an immediate word, we have to go to extra trouble to compile ~ it as part of ;. - [ ' [ entry-to-execution-token , ] + [ x' [ , ] ; make-immediate @@ -1970,7 +1970,7 @@ allocate-transformation-state s" transformation-state" variable : log-load-left-square-brace-alternate ~ Since [ is an immediate word, we have to go to extra trouble to compile ~ it as part of the alternate. - [ ' [ entry-to-execution-token , ] + [ x' [ , ] ; make-immediate ~ We need this one, too. It's not even an immediate word normally! @@ -2061,7 +2061,7 @@ allocate-transformation-state s" transformation-state" variable ~ Yeah comments have to go. : log-load-tilde-alternate - ' ~ entry-to-execution-token execute + x' ~ execute ; make-immediate @@ -2072,11 +2072,11 @@ allocate-transformation-state s" transformation-state" variable ~ transform-time part, our implementations will diverge, but this first bit ~ is the same. interpreter-flags @ - ' s" entry-to-execution-token + x' s" swap-transform-variables ~ Since [ is an immediate word, we have to go to extra trouble to compile ~ it as part of the alternate. - [ ' [ entry-to-execution-token , ] + [ x' [ , ] execute swap-transform-variables swap interpreter-flags ! @@ -2155,7 +2155,7 @@ allocate-transformation-state s" transformation-state" variable : log-load-dot-string-alternate - ' log-load-string-alternate entry-to-execution-token execute + x' log-load-string-alternate execute interpreter-flags @ 0x01 & { ~ Hey look, it's the one time we're doing something simple enough that @@ -2252,7 +2252,7 @@ allocate-transformation-state s" transformation-state" variable : log-load-executable-tick-alternate - ' log-load-tick-alternate entry-to-execution-token execute + x' log-load-tick-alternate execute interpreter-flags @ 0x01 & { s" entry-to-execution-token" log-load-compile-dynamic-word @@ -4058,8 +4058,8 @@ allocate-transformation-state s" transformation-state" variable ~ Now, regardless of what mode we're actually in, call the interpreted ~ version of s" to read the actual string and its null terminator. interpreter-flags @ - ' s" entry-to-execution-token - [ ' [ entry-to-execution-token , ] + x' s" + [ x' [ , ] execute swap interpreter-flags ! @@ -4075,7 +4075,7 @@ allocate-transformation-state s" transformation-state" variable ; make-immediate : hex-dot-string-alternate - ' hex-string-alternate entry-to-execution-token execute + x' hex-string-alternate execute interpreter-flags @ 0x01 & { ~ We look up the inner version of emitstring, too. @@ -5296,7 +5296,7 @@ allocate-transformation-state s" transformation-state" variable ~ by processing the source words that form the regular body of "variable", ~ eventually hitting the matching semicolon. Our friendly tampering is ~ now complete! - ' ] entry-to-execution-token execute + x' ] execute exit } if @@ -5315,12 +5315,12 @@ allocate-transformation-state s" transformation-state" variable ~ then skip forward in the code under transformation, but that would be ~ complex, and it's unnecessary: We let it keep running, outputting the ~ usual body of s", which we know will never be reached. - ' hex-string-alternate entry-to-execution-token , + x' hex-string-alternate , s" exit" find entry-to-execution-token , ~ As before, finish up colon's responsibilities, then return control to ~ the code under transformation. - ' ] entry-to-execution-token execute + x' ] execute exit } if @@ -5330,10 +5330,10 @@ allocate-transformation-state s" transformation-state" variable s" docol" find entry-to-execution-token execute , make-hidden - ' hex-dot-string-alternate entry-to-execution-token , + x' hex-dot-string-alternate , s" exit" find entry-to-execution-token , - ' ] entry-to-execution-token execute + x' ] execute exit } if @@ -5348,7 +5348,7 @@ allocate-transformation-state s" transformation-state" variable ~ Return before doing anything. s" exit" find entry-to-execution-token , - ' ] entry-to-execution-token execute + x' ] execute exit } if @@ -5360,10 +5360,10 @@ allocate-transformation-state s" transformation-state" variable s" docol" find entry-to-execution-token execute , make-hidden - ' hex-sys-write-replacement entry-to-execution-token , + x' hex-sys-write-replacement , s" exit" find entry-to-execution-token , - ' ] entry-to-execution-token execute + x' ] execute exit } if @@ -5378,11 +5378,10 @@ allocate-transformation-state s" transformation-state" variable ~ of label-loop. We need to reinitialize all the metadata entries whenever ~ that happens, and reset-labels is a good semantic match for that ~ behavior, so it's a good place for the hook. - ' create-hex-output-metadata-top-of-file-entries - entry-to-execution-token , + x' create-hex-output-metadata-top-of-file-entries , ~ Fall through to the inner implementation. - ' ] entry-to-execution-token execute + x' ] execute exit } if @@ -5393,10 +5392,10 @@ allocate-transformation-state s" transformation-state" variable ~ (new label value, label entry pointer --) s" 2dup" find entry-to-execution-token , - ' hex-set-label-trace entry-to-execution-token , + x' hex-set-label-trace , ~ Fall through to the inner implementation. - ' ] entry-to-execution-token execute + x' ] execute exit } if @@ -5409,10 +5408,10 @@ allocate-transformation-state s" transformation-state" variable ~ (output point, string pointer) s" 2dup" find entry-to-execution-token , ~ This one's a lot of work, so we defer to a single-purpose word. - ' hex-packstring-trace entry-to-execution-token , + x' hex-packstring-trace , ~ Fall through to the inner implementation. - ' ] entry-to-execution-token execute + x' ] execute exit } if @@ -5441,18 +5440,17 @@ allocate-transformation-state s" transformation-state" variable s" 3unroll" find entry-to-execution-token , ~ (output point, string pointer, string length NOT including terminator, ~ output point, string length NOT including terminator) - ' hex-pack-trace entry-to-execution-token , + x' hex-pack-trace , ~ (output point, string pointer, string length including terminator) s" swap" find entry-to-execution-token , - ' hex-output-metadata-entry-type-raw-string-literal - entry-to-execution-token , + x' hex-output-metadata-entry-type-raw-string-literal , s" swap" find entry-to-execution-token , - ' add-hex-output-metadata-entry entry-to-execution-token , + x' add-hex-output-metadata-entry , ~ (output point, string pointer) ~ Fall through to the inner implementation. - ' ] entry-to-execution-token execute + x' ] execute exit } if @@ -5472,10 +5470,10 @@ allocate-transformation-state s" transformation-state" variable ~ (output point, value, output point) s" lit" find entry-to-execution-token , 1 , - ' hex-pack-trace entry-to-execution-token , + x' hex-pack-trace , ~ Fall through to the inner implementation. - ' ] entry-to-execution-token execute + x' ] execute exit } if @@ -5495,10 +5493,10 @@ allocate-transformation-state s" transformation-state" variable ~ (output point, value, output point) s" lit" find entry-to-execution-token , 2 , - ' hex-pack-trace entry-to-execution-token , + x' hex-pack-trace , ~ Fall through to the inner implementation. - ' ] entry-to-execution-token execute + x' ] execute exit } if @@ -5518,10 +5516,10 @@ allocate-transformation-state s" transformation-state" variable ~ (output point, value, output point) s" lit" find entry-to-execution-token , 4 , - ' hex-pack-trace entry-to-execution-token , + x' hex-pack-trace , ~ Fall through to the inner implementation. - ' ] entry-to-execution-token execute + x' ] execute exit } if @@ -5541,10 +5539,10 @@ allocate-transformation-state s" transformation-state" variable ~ (output point, value, output point) s" lit" find entry-to-execution-token , 8 , - ' hex-pack-trace entry-to-execution-token , + x' hex-pack-trace , ~ Fall through to the inner implementation. - ' ] entry-to-execution-token execute + x' ] execute exit } if @@ -5554,7 +5552,7 @@ allocate-transformation-state s" transformation-state" variable create dropstring s" docol" find entry-to-execution-token execute , make-hidden - ' ] entry-to-execution-token execute + x' ] execute ; @@ -5691,14 +5689,14 @@ allocate-transformation-state s" transformation-state" variable ~ place for the word we're trapping. So we don't need to scrounge up any ~ runtime data for the trap's benefit; the trap will be able to get what it ~ needs by inspecting the control stack and the log. - ' hex-trace entry-to-execution-token , + x' hex-trace , ~ We're done compiling the trap's contents, so swap "here" back. Again, ~ keep this in sync with the length of the trap. 8 + here ! ~ Now we do the regular semicolon stuff. - [ ' ; entry-to-execution-token , ] + [ x' ; , ] ; make-immediate @@ -5714,13 +5712,13 @@ allocate-transformation-state s" transformation-state" variable ~ call semicolon. drop here @ 8 packalign here ! - [ ' ; entry-to-execution-token , ] + [ x' ; , ] exit } if drop ~ If no special case matches, we fall back to the regular behavior. - [ ' ;asm entry-to-execution-token , ] + [ x' ;asm , ] ; make-immediate @@ -5804,7 +5802,7 @@ allocate-transformation-state s" transformation-state" variable latest @ entry-to-name dup s" label-loop" stringcmp 0 = { ~ In label-loop. drop - ' hex-allocate-replacement entry-to-execution-token , + x' hex-allocate-replacement , } { ~ Not in label-loop. drop @@ -5855,7 +5853,7 @@ allocate-transformation-state s" transformation-state" variable ~ down. : hex-memcopy-alternate interpreter-flags @ 0x01 & { - ' hex-memory-slide-replacement entry-to-execution-token , + x' hex-memory-slide-replacement , s" memcopy" find entry-to-execution-token , } { hex-memory-slide-replacement @@ -5863,7 +5861,7 @@ allocate-transformation-state s" transformation-state" variable } if-else ; make-immediate : hex-memmove-alternate interpreter-flags @ 0x01 & { - ' hex-memory-slide-replacement entry-to-execution-token , + x' hex-memory-slide-replacement , s" memmove" find entry-to-execution-token , } { hex-memory-slide-replacement @@ -6336,7 +6334,7 @@ allocate-transformation-state s" transformation-state" variable 8 packalign here ! - ' hex-tilde-replacement entry-to-execution-token , + x' hex-tilde-replacement , } { ~ We're in interpret mode. has-non-space-this-input-line@ swap @@ -6545,13 +6543,13 @@ allocate-transformation-state s" transformation-state" variable dup s" label-transform-one" stringcmp 0 = { drop - ' hex-label-word-replacement entry-to-execution-token , + x' hex-label-word-replacement , exit } if dup s" log-load-transform-one" stringcmp 0 = { drop - ' hex-log-load-word-replacement entry-to-execution-token , + x' hex-log-load-word-replacement , exit } if @@ -6587,7 +6585,7 @@ allocate-transformation-state s" transformation-state" variable ~ executing it in immediate mode. : hex-interpret-alternate interpreter-flags @ 0x01 & { - ' hex-interpret-replacement entry-to-execution-token , + x' hex-interpret-replacement , } { hex-interpret-replacement } if-else ; make-immediate @@ -6796,7 +6794,7 @@ allocate-transformation-state s" transformation-state" variable interpreter-flags @ 0x01 & { ~ TODO this probably needs a lit alternate (!) - ' lit entry-to-execution-token , , + x' lit , , 0 exit } if |