Forgetting a word removes it from the recompile set
parent
de124cc191
commit
b453a74743
|
@ -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
|
||||
|
||||
========================================================================
|
||||
|
|
|
@ -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 ;
|
||||
|
|
|
@ -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 -- )
|
||||
|
|
|
@ -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 ;
|
||||
|
||||
|
|
Loading…
Reference in New Issue