Clean up generator a bit

release
Slava Pestov 2007-10-05 04:18:08 -04:00
parent 24dd9c25c9
commit d76a59bceb
2 changed files with 7 additions and 4 deletions

View File

@ -47,14 +47,16 @@ M: x86-backend stack-frame ( n -- i )
M: x86-backend %save-xt ( -- )
xt-reg compiling-label get MOV ;
: factor-area-size 4 cells ;
M: x86-backend %prologue ( n -- )
xt-reg PUSH
xt-reg stack-reg pick stack-frame 4 cells + neg [+] LEA
xt-reg stack-reg pick factor-area-size + neg [+] LEA
xt-reg PUSH
stack-reg swap stack-frame 2 cells - SUB ;
stack-reg swap 2 cells - SUB ;
M: x86-backend %epilogue ( n -- )
stack-reg swap stack-frame ADD ;
stack-reg swap ADD ;
: %alien-global ( symbol dll register -- )
[ 0 MOV rc-absolute-cell rel-dlsym ] keep dup [] MOV ;

View File

@ -35,7 +35,8 @@ M: label fixup*
: resolve-label ( label/name -- ) dup label? [ get ] unless , ;
: if-stack-frame ( frame-size quot -- )
over no-stack-frame = [ 2drop ] [ call ] if ; inline
swap dup no-stack-frame =
[ 2drop ] [ stack-frame swap call ] if ; inline
M: word fixup*
{