Minor compiler tweaks

db4
Slava Pestov 2008-08-24 01:21:23 -05:00
parent 88e3f6bd1d
commit 7359873b60
4 changed files with 15 additions and 6 deletions

View File

@ -126,7 +126,9 @@ M: #r> check-stack-flow* [ check-in-r ] [ check-out-d ] bi ;
retainstack get empty? [ "Retain stack not empty" throw ] unless ;
M: #return check-stack-flow*
check-in-d assert-datastack-empty assert-retainstack-empty ;
check-in-d
assert-datastack-empty
terminated? get [ assert-retainstack-empty ] unless ;
M: #enter-recursive check-stack-flow*
check-out-d ;
@ -157,7 +159,7 @@ SYMBOL: branch-out
datastack [ clone ] change
V{ } clone retainstack set
(check-stack-flow)
assert-retainstack-empty
terminated? get [ assert-retainstack-empty ] unless
terminated? get f datastack get ?
] with-scope ;

View File

@ -456,3 +456,8 @@ cell-bits 32 = [
[ [ 2array ] [ 0 3array ] if first ]
{ nth-unsafe < <= > >= } inlined?
] unit-test
[ ] [
[ [ >r "A" throw r> ] [ "B" throw ] if ]
cleaned-up-tree drop
] unit-test

View File

@ -26,7 +26,7 @@ IN: compiler.tree.optimizer
compute-def-use
remove-dead-code
! strength-reduce
USE: kernel
compute-def-use
dup check-nodes
! USE: kernel
! compute-def-use
! dup check-nodes
;

View File

@ -134,4 +134,6 @@ M: #alien-indirect unbox-tuples* dup in-d>> assert-not-unboxed ;
M: #alien-callback unbox-tuples* ;
: unbox-tuples ( nodes -- nodes ) [ unbox-tuples* ] map-nodes ;
: unbox-tuples ( nodes -- nodes )
allocations get escaping-allocations get assoc-diff assoc-empty?
[ [ unbox-tuples* ] map-nodes ] unless ;