version 1.48, 2002/12/26 19:16:17
|
version 1.49, 2003/01/10 21:43:41
|
Line 219 is basic-block-end
|
Line 219 is basic-block-end
|
has? peephole [IF] |
has? peephole [IF] |
|
|
\ dynamic only |
\ dynamic only |
\ : peephole-compile, ( xt -- ) |
: peephole-compile, ( xt -- ) |
\ \ compile xt, appending its code to the current dynamic superinstruction |
\ compile xt, appending its code to the current dynamic superinstruction |
\ compile-prim , ; |
here swap , compile-prim1 ; |
|
|
\ static only |
\ static only |
\ : peephole-compile, ( xt -- ) |
\ : peephole-compile, ( xt -- ) |
Line 235 has? peephole [IF]
|
Line 235 has? peephole [IF]
|
\ here last-compiled ! |
\ here last-compiled ! |
\ dyn-compile, ; |
\ dyn-compile, ; |
|
|
: dyn-compile! ( xt -- ) |
\ combine greedy static with dynamic |
\ compile xt, appending its code to the current dynamic superinstruction |
\ : dyn-compile! ( xt -- ) |
last-compiled-here @ tuck ! compile-prim1 ; |
\ \ compile xt, appending its code to the current dynamic superinstruction |
|
\ last-compiled-here @ tuck ! compile-prim1 ; |
|
|
:noname ( -- ) |
\ :noname ( -- ) |
last-compiled @ if |
\ last-compiled @ if |
last-compiled @ dyn-compile! |
\ last-compiled @ dyn-compile! |
0 last-compiled ! |
\ 0 last-compiled ! |
then |
\ then ; |
finish-code ; |
\ is basic-block-end |
is basic-block-end |
|
|
|
: static-compile, ( xt -- ) |
\ : peephole-compile, ( xt -- ) |
\ compile xt, possibly combining it with the previous compiled xt |
\ \ compile xt, possibly combining it with the previous compiled xt |
\ into a superinstruction (static superinstructions) |
\ \ into a superinstruction (static superinstructions) |
last-compiled @ ?dup if |
\ last-compiled @ ?dup if |
over peeptable peephole-opt ?dup if ( xt comb-xt ) |
\ over peeptable peephole-opt ?dup if ( xt comb-xt ) |
last-compiled ! drop EXIT |
\ last-compiled ! drop EXIT |
then ( xt ) |
\ then ( xt ) |
last-compiled @ dyn-compile! |
\ last-compiled @ dyn-compile! |
then ( xt ) |
\ then ( xt ) |
last-compiled ! |
\ last-compiled ! |
here last-compiled-here ! 0 , ; |
\ here last-compiled-here ! 0 , ; |
|
|
: compile-to-prims, ( xt -- ) |
: compile-to-prims, ( xt -- ) |
\G compile xt to use primitives (and their peephole optimization) |
\G compile xt to use primitives (and their peephole optimization) |
Line 280 is basic-block-end
|
Line 280 is basic-block-end
|
\ code words and ;code-defined words (code words could be optimized): |
\ code words and ;code-defined words (code words could be optimized): |
dup in-dictionary? IF drop POSTPONE literal POSTPONE execute EXIT THEN |
dup in-dictionary? IF drop POSTPONE literal POSTPONE execute EXIT THEN |
ENDCASE |
ENDCASE |
static-compile, ; |
peephole-compile, ; |
|
|
' compile-to-prims, IS compile, |
' compile-to-prims, IS compile, |
[ELSE] |
[ELSE] |