| \ CROSS.FS The Cross-Compiler 06oct92py |
\ CROSS.FS The Cross-Compiler 06oct92py |
| \ Idea and implementation: Bernd Paysan (py) |
\ Idea and implementation: Bernd Paysan (py) |
| |
|
| \ Copyright (C) 1995,1996,1997,1998,1999,2000,2003,2004,2005 Free Software Foundation, Inc. |
\ Copyright (C) 1995,1996,1997,1998,1999,2000,2003,2004,2005,2006 Free Software Foundation, Inc. |
| |
|
| \ This file is part of Gforth. |
\ This file is part of Gforth. |
| |
|
| false DefaultValue backtrace |
false DefaultValue backtrace |
| false DefaultValue new-input |
false DefaultValue new-input |
| false DefaultValue peephole |
false DefaultValue peephole |
| |
false DefaultValue primcentric |
| false DefaultValue abranch |
false DefaultValue abranch |
| true DefaultValue f83headerstring |
true DefaultValue f83headerstring |
| true DefaultValue control-rack |
true DefaultValue control-rack |
| prim# @ (THeader ( S xt ghost ) |
prim# @ (THeader ( S xt ghost ) |
| ['] prim-resolved over >comp ! |
['] prim-resolved over >comp ! |
| dup >ghost-flags <primitive> set-flag |
dup >ghost-flags <primitive> set-flag |
| over resolve-noforwards T A, H alias-mask flag! |
over resolve-noforwards T A, H |
| |
s" EC" T $has? H 0= |
| |
IF |
| |
alias-mask flag! |
| |
THEN |
| -1 prim# +! ; |
-1 prim# +! ; |
| >CROSS |
>CROSS |
| |
|
| |
|
| Defer instant-interpret-does>-hook ' noop IS instant-interpret-does>-hook |
Defer instant-interpret-does>-hook ' noop IS instant-interpret-does>-hook |
| |
|
| T has? peephole H [IF] |
T has? primcentric H [IF] |
| : does-resolved ( ghost -- ) |
: does-resolved ( ghost -- ) |
| compile does-exec g>xt T a, H ; |
compile does-exec g>xt T a, H ; |
| [ELSE] |
[ELSE] |
| |
|
| >TARGET |
>TARGET |
| Cond: DOES> |
Cond: DOES> |
| T here H [ T has? peephole H [IF] ] 5 [ [ELSE] ] 4 [ [THEN] ] T cells |
T here H [ T has? primcentric H [IF] ] 5 [ [ELSE] ] 4 [ [THEN] ] T cells |
| H + alit, compile (does>2) compile ;s |
H + alit, compile (does>2) compile ;s |
| doeshandler, resolve-does>-part |
doeshandler, resolve-does>-part |
| ;Cond |
;Cond |
| \ optimizer for cross |
\ optimizer for cross |
| |
|
| |
|
| T has? peephole H [IF] |
T has? primcentric H [IF] |
| |
|
| \ .( loading peephole optimization) cr |
\ .( loading peephole optimization) cr |
| |
|
| : IS T >address ' >body @ ! H ; |
: IS T >address ' >body @ ! H ; |
| Cond: TO T ' >body @ H compile ALiteral compile ! ;Cond |
Cond: TO T ' >body @ H compile ALiteral compile ! ;Cond |
| : TO T ' >body @ ! H ; |
: TO T ' >body @ ! H ; |
| |
Cond: CTO T ' >body H compile ALiteral compile ! ;Cond |
| |
: CTO T ' >body ! H ; |
| [ELSE] |
[ELSE] |
| Cond: IS T ' >body H compile ALiteral compile ! ;Cond |
Cond: IS T ' >body H compile ALiteral compile ! ;Cond |
| : IS T >address ' >body ! H ; |
: IS T >address ' >body ! H ; |