fix a prettyprinter bug and optimizer regression

cvs
Slava Pestov 2005-11-28 03:18:17 +00:00
parent 7a4aed9fc5
commit fa38f93e49
4 changed files with 10 additions and 17 deletions

View File

@ -1,11 +1,5 @@
+ 0.80:
- flip-branches optimizer not working
- prettyprint:
{ V{ T{ literal T{ value f f G:110886 } f } T{ value
f f G:110887
} } }
- intrinsic char-slot set-char-slot for x86
- closing ui does not stop timers
- adding/removing timers automatically for animated gadgets
@ -18,8 +12,6 @@
- what about tasks and timers between image restarts
- double hash
- empty key change
- if hash is full and we change existing key, it should not grow
+ ui:

View File

@ -41,7 +41,7 @@ TUPLE: tombstone ;
>r >r [ key@ ] 2keep pick -1 > r> r> if ; inline
: <hash-array> ( n -- array )
1+ 4 * ((empty)) <repeated> >array ;
4 * ((empty)) <repeated> >array ;
: reset-hash ( n hash -- )
swap <hash-array> over set-underlying
@ -154,15 +154,16 @@ IN: hashtables
: hash-size ( hash -- n ) dup hash-count swap hash-deleted - ;
: grow-hash ( hash -- )
[ underlying ] keep
[ >r length r> reset-hash ] 2keep
swap [ swap pick (set-hash) ] each-pair drop ;
[ dup underlying swap hash-size 1+ ] keep
[ reset-hash ] keep swap [ swap pick (set-hash) ] each-pair
drop ;
: ?grow-hash ( hash -- )
dup hash-count 1+ 4 * over underlying length >
dup hash-count 2 + 2 * over underlying length >
[ dup grow-hash ] when drop ;
: set-hash ( value key hash -- ) dup ?grow-hash (set-hash) ;
: set-hash ( value key hash -- )
[ (set-hash) ] keep ?grow-hash ;
: hash-keys ( hash -- keys ) 0 swap hash>seq ;

View File

@ -65,8 +65,8 @@ M: #shuffle optimize-node* ( node -- node/t )
compose-shuffle-nodes
] [
drop [
dup node-in-d over node-out-d =
[ dup node-in-r swap node-out-r = ] [ drop f ] if
dup node-in-d over node-out-d sequence=
>r dup node-in-r swap node-out-r sequence= r> and
] prune-if
] if ;

View File

@ -298,7 +298,7 @@ M: tuple pprint* ( tuple -- )
[
\ T{ pprint*
tuple>array dup first pprint*
<block 1 swap tail-slice pprint-elements block>
<block 1 swap tail-slice pprint-elements
\ } pprint*
] check-recursion ;