From b2ade7f5562e21cf5b502c3e22a263a4e0ef1f09 Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Sun, 12 Oct 2008 17:37:26 -0500 Subject: [PATCH] Fix callbacks and non-tailcalls to dispatch --- basis/compiler/cfg/builder/builder.factor | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/basis/compiler/cfg/builder/builder.factor b/basis/compiler/cfg/builder/builder.factor index 3cc2c13311..df437024b7 100755 --- a/basis/compiler/cfg/builder/builder.factor +++ b/basis/compiler/cfg/builder/builder.factor @@ -178,11 +178,14 @@ M: #if emit-node [ finalize-phantoms ##epilogue ] 2dip ##dispatch dispatch-branches init-phantoms ; +: ( -- word ) + gensym dup t "inlined-block" set-word-prop ; + M: #dispatch emit-node tail-call? [ emit-dispatch stop-iterating ] [ - current-word get gensym [ + current-word get [ [ begin-word emit-dispatch @@ -329,12 +332,9 @@ M: #terminate emit-node [ alien-parameters parameter-sizes drop >>params ] bi dup [ params>> ] [ return>> ] bi + >>size ; -: alien-stack-frame ( node -- ) - params>> ##stack-frame ; - : emit-alien-node ( node quot -- next ) - [ drop alien-stack-frame ] - [ [ params>> ] dip call ] 2bi + [ params>> ] dip + [ drop ##stack-frame ] [ call ] 2bi iterate-next ; inline M: #alien-invoke emit-node @@ -344,7 +344,7 @@ M: #alien-indirect emit-node [ ##alien-indirect ] emit-alien-node ; M: #alien-callback emit-node - params>> dup xt>> dup + dup params>> xt>> dup [ init-phantoms [ ##alien-callback ] emit-alien-node drop