Fix recompilation of foldable, flushable

db4
Slava Pestov 2008-01-21 17:30:10 -05:00
parent 913403f066
commit 64d284a970
4 changed files with 42 additions and 6 deletions

View File

@ -205,3 +205,27 @@ DEFER: generic-then-not-generic-test-2
[ ] [ "IN: temporary USE: math : generic-then-not-generic-test-1 1 + ;" eval ] unit-test
[ 4 ] [ generic-then-not-generic-test-2 ] unit-test
DEFER: foldable-test-2
[ ] [ "IN: temporary : foldable-test-1 3 ; foldable" eval ] unit-test
[ ] [ "IN: temporary : foldable-test-2 foldable-test-1 ;" eval ] unit-test
[ 3 ] [ foldable-test-2 ] unit-test
[ ] [ "IN: temporary : foldable-test-1 4 ; foldable" eval ] unit-test
[ 4 ] [ foldable-test-2 ] unit-test
DEFER: flushable-test-2
[ ] [ "IN: temporary USE: kernel : flushable-test-1 drop 3 ; flushable" eval ] unit-test
[ ] [ "IN: temporary USE: kernel : flushable-test-2 V{ } dup flushable-test-1 drop ;" eval ] unit-test
[ V{ } ] [ flushable-test-2 ] unit-test
[ ] [ "IN: temporary USING: kernel sequences ; : flushable-test-1 3 over push ;" eval ] unit-test
[ V{ 3 } ] [ flushable-test-2 ] unit-test

View File

@ -17,17 +17,17 @@ SYMBOL: optimizer-changed
GENERIC: optimize-node* ( node -- node/t changed? )
: ?union ( hash/f hash -- hash )
: ?union ( assoc/f assoc -- hash )
over [ union ] [ nip ] if ;
: add-node-literals ( hash node -- )
: add-node-literals ( assoc node -- )
over assoc-empty? [
2drop
] [
[ node-literals ?union ] keep set-node-literals
] if ;
: add-node-classes ( hash node -- )
: add-node-classes ( assoc node -- )
over assoc-empty? [
2drop
] [
@ -324,6 +324,7 @@ M: #dispatch optimize-node*
] if ;
: flush-eval ( #call -- node )
dup node-param +inlined+ depends-on
dup node-out-d length f <repetition> inline-literals ;
: partial-eval? ( #call -- ? )
@ -337,9 +338,9 @@ M: #dispatch optimize-node*
dup node-in-d [ node-literal ] with map ;
: partial-eval ( #call -- node )
dup node-param +inlined+ depends-on
dup literal-in-d over node-param 1quotation
[ with-datastack ] catch
[ 3drop t ] [ inline-literals ] if ;
[ with-datastack inline-literals ] [ 2drop 2drop t ] recover ;
: define-identities ( words identities -- )
[ "identities" set-word-prop ] curry each ;

View File

@ -175,3 +175,14 @@ SYMBOL: quot-uses-b
[ t ] [ "symbol-generic" "temporary" lookup symbol? ] unit-test
[ f ] [ "symbol-generic" "temporary" lookup generic? ] unit-test
! Regressions
[ ] [ "IN: temporary : decl-forget-test ; foldable" eval ] unit-test
[ t ] [ "decl-forget-test" "temporary" lookup "foldable" word-prop ] unit-test
[ ] [ "IN: temporary : decl-forget-test ;" eval ] unit-test
[ f ] [ "decl-forget-test" "temporary" lookup "foldable" word-prop ] unit-test
[ ] [ "IN: temporary : decl-forget-test ; flushable" eval ] unit-test
[ t ] [ "decl-forget-test" "temporary" lookup "flushable" word-prop ] unit-test
[ ] [ "IN: temporary : decl-forget-test ;" eval ] unit-test
[ f ] [ "decl-forget-test" "temporary" lookup "flushable" word-prop ] unit-test

View File

@ -127,7 +127,7 @@ SYMBOL: changed-words
: reset-word ( word -- )
{
"unannotated-def"
"parsing" "inline" "foldable"
"parsing" "inline" "foldable" "flushable"
"predicating"
"reading" "writing"
"constructing"