Forgetting a word removes it from the recompile set

slava 2006-08-10 20:47:10 +00:00
parent de124cc191
commit b453a74743
4 changed files with 16 additions and 11 deletions

View File

@ -14,8 +14,11 @@
- [ [ dup call ] dup call ] infer hangs
- the invalid recursion form case needs to be fixed, for inlines too
- graphical module manager tool
- instead of decompiling words, add them to a 'recompile' set; compiler
treats words in the recompile set as if they were not compiled
- forget should remove words from the recompile set
- unit test this
- define should add words to the recompile set if they're interned
- unit test this
- make sure the changed-words thing works with bootstrap too
- see if alien calls can be made faster
========================================================================

View File

@ -34,14 +34,14 @@ namespaces optimizer prettyprint sequences test threads words ;
: recompile ( -- )
[
recompile-words get hash-keys [ try-compile ] each
recompile-words get clear-hash
changed-words get hash-keys [ try-compile ] each
changed-words get clear-hash
] with-class<cache ;
M: compound unxref-word*
dup "infer" word-prop [
drop
] [
dup dup recompile-words get set-hash
dup dup changed-words get set-hash
{ "infer-effect" "base-case" "no-effect" } reset-props
] if ;

View File

@ -5,10 +5,6 @@ USING: arrays assembler errors generic hashtables kernel
kernel-internals math namespaces prettyprint queues
sequences strings vectors words ;
SYMBOL: recompile-words
H{ } clone recompile-words set-global
DEFER: (compile)
: compiled-offset ( -- n ) building get length code-format * ;
@ -25,7 +21,7 @@ C: label ( -- label ) ;
SYMBOL: compiled-xts
: save-xt ( word xt -- )
over recompile-words get remove-hash
over changed-words get remove-hash
swap compiled-xts get set-hash ;
SYMBOL: literal-table
@ -86,7 +82,7 @@ SYMBOL: label-table
: compiling? ( word -- ? )
#! A word that is compiling or already compiled will not be
#! added to the list of words to be compiled.
dup compiled? over recompile-words get hash-member? not and
dup compiled? over changed-words get hash-member? not and
swap compiled-xts get hash-member? or ;
: with-compiler ( quot -- )

View File

@ -8,6 +8,11 @@ USING: arrays definitions errors generic graphs hashtables
kernel kernel-internals math namespaces sequences strings
vectors ;
! Used by the compiler
SYMBOL: changed-words
H{ } clone changed-words set-global
M: word <=>
[ dup word-name swap word-vocabulary 2array ] 2apply <=> ;
@ -190,6 +195,7 @@ M: word subdefs drop f ;
: forget-word ( word -- )
dup unxref-word
dup remove-word-help
dup changed-words remove-hash
crossref get [ dupd remove-hash ] when*
dup word-name swap word-vocabulary vocab remove-hash ;