compiler.cfg.builder: Fix construction of ##return instructions from #return-recursive nodes

db4
Slava Pestov 2009-07-22 19:17:21 -05:00
parent 091d2d07f2
commit d29c275089
2 changed files with 15 additions and 4 deletions

View File

@ -9,6 +9,15 @@ byte-arrays kernel.private math slots.private ;
: unit-test-cfg ( quot -- )
'[ _ test-cfg [ compute-predecessors check-cfg ] each ] [ ] swap unit-test ;
: blahblah ( nodes -- ? )
{ fixnum } declare [
dup 3 bitand 1 = [ drop t ] [
dup 3 bitand 2 = [
blahblah
] [ drop f ] if
] if
] any? ; inline recursive
{
[ ]
[ dup ]
@ -52,6 +61,7 @@ byte-arrays kernel.private math slots.private ;
[ "int" { "int" } "cdecl" [ ] alien-callback ]
[ swap - + * ]
[ swap slot ]
[ blahblah ]
} [
unit-test-cfg
] each

View File

@ -160,12 +160,13 @@ M: #shuffle emit-node
[ [ [ out-r>> ] [ mapping>> ] bi ] dip '[ _ at _ at ] map rs-store ] 2bi ;
! #return
M: #return emit-node
drop ##branch begin-basic-block ##epilogue ##return ;
: emit-return ( -- )
##branch begin-basic-block ##epilogue ##return ;
M: #return emit-node drop emit-return ;
M: #return-recursive emit-node
label>> id>> loops get key?
[ ##epilogue ##return ] unless ;
label>> id>> loops get key? [ emit-return ] unless ;
! #terminate
M: #terminate emit-node drop ##no-tco basic-block off ;