Forgetting a word removes it from the recompile set
parent
de124cc191
commit
b453a74743
|
@ -14,8 +14,11 @@
|
||||||
- [ [ dup call ] dup call ] infer hangs
|
- [ [ dup call ] dup call ] infer hangs
|
||||||
- the invalid recursion form case needs to be fixed, for inlines too
|
- the invalid recursion form case needs to be fixed, for inlines too
|
||||||
- graphical module manager tool
|
- graphical module manager tool
|
||||||
- instead of decompiling words, add them to a 'recompile' set; compiler
|
- forget should remove words from the recompile set
|
||||||
treats words in the recompile set as if they were not compiled
|
- 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
|
- see if alien calls can be made faster
|
||||||
|
|
||||||
========================================================================
|
========================================================================
|
||||||
|
|
|
@ -34,14 +34,14 @@ namespaces optimizer prettyprint sequences test threads words ;
|
||||||
|
|
||||||
: recompile ( -- )
|
: recompile ( -- )
|
||||||
[
|
[
|
||||||
recompile-words get hash-keys [ try-compile ] each
|
changed-words get hash-keys [ try-compile ] each
|
||||||
recompile-words get clear-hash
|
changed-words get clear-hash
|
||||||
] with-class<cache ;
|
] with-class<cache ;
|
||||||
|
|
||||||
M: compound unxref-word*
|
M: compound unxref-word*
|
||||||
dup "infer" word-prop [
|
dup "infer" word-prop [
|
||||||
drop
|
drop
|
||||||
] [
|
] [
|
||||||
dup dup recompile-words get set-hash
|
dup dup changed-words get set-hash
|
||||||
{ "infer-effect" "base-case" "no-effect" } reset-props
|
{ "infer-effect" "base-case" "no-effect" } reset-props
|
||||||
] if ;
|
] if ;
|
||||||
|
|
|
@ -5,10 +5,6 @@ USING: arrays assembler errors generic hashtables kernel
|
||||||
kernel-internals math namespaces prettyprint queues
|
kernel-internals math namespaces prettyprint queues
|
||||||
sequences strings vectors words ;
|
sequences strings vectors words ;
|
||||||
|
|
||||||
SYMBOL: recompile-words
|
|
||||||
|
|
||||||
H{ } clone recompile-words set-global
|
|
||||||
|
|
||||||
DEFER: (compile)
|
DEFER: (compile)
|
||||||
|
|
||||||
: compiled-offset ( -- n ) building get length code-format * ;
|
: compiled-offset ( -- n ) building get length code-format * ;
|
||||||
|
@ -25,7 +21,7 @@ C: label ( -- label ) ;
|
||||||
SYMBOL: compiled-xts
|
SYMBOL: compiled-xts
|
||||||
|
|
||||||
: save-xt ( word xt -- )
|
: save-xt ( word xt -- )
|
||||||
over recompile-words get remove-hash
|
over changed-words get remove-hash
|
||||||
swap compiled-xts get set-hash ;
|
swap compiled-xts get set-hash ;
|
||||||
|
|
||||||
SYMBOL: literal-table
|
SYMBOL: literal-table
|
||||||
|
@ -86,7 +82,7 @@ SYMBOL: label-table
|
||||||
: compiling? ( word -- ? )
|
: compiling? ( word -- ? )
|
||||||
#! A word that is compiling or already compiled will not be
|
#! A word that is compiling or already compiled will not be
|
||||||
#! added to the list of words to be compiled.
|
#! 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 ;
|
swap compiled-xts get hash-member? or ;
|
||||||
|
|
||||||
: with-compiler ( quot -- )
|
: with-compiler ( quot -- )
|
||||||
|
|
|
@ -8,6 +8,11 @@ USING: arrays definitions errors generic graphs hashtables
|
||||||
kernel kernel-internals math namespaces sequences strings
|
kernel kernel-internals math namespaces sequences strings
|
||||||
vectors ;
|
vectors ;
|
||||||
|
|
||||||
|
! Used by the compiler
|
||||||
|
SYMBOL: changed-words
|
||||||
|
|
||||||
|
H{ } clone changed-words set-global
|
||||||
|
|
||||||
M: word <=>
|
M: word <=>
|
||||||
[ dup word-name swap word-vocabulary 2array ] 2apply <=> ;
|
[ dup word-name swap word-vocabulary 2array ] 2apply <=> ;
|
||||||
|
|
||||||
|
@ -190,6 +195,7 @@ M: word subdefs drop f ;
|
||||||
: forget-word ( word -- )
|
: forget-word ( word -- )
|
||||||
dup unxref-word
|
dup unxref-word
|
||||||
dup remove-word-help
|
dup remove-word-help
|
||||||
|
dup changed-words remove-hash
|
||||||
crossref get [ dupd remove-hash ] when*
|
crossref get [ dupd remove-hash ] when*
|
||||||
dup word-name swap word-vocabulary vocab remove-hash ;
|
dup word-name swap word-vocabulary vocab remove-hash ;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue