Remove temporary hack now that new JIT works

db4
Slava Pestov 2007-12-26 20:20:49 -05:00
parent 93e1bdfcd7
commit 9de32c7b2d
3 changed files with 3 additions and 19 deletions

View File

@ -45,7 +45,6 @@ M: object redefined* drop ;
dup unxref crossref get delete-at ;
SYMBOL: changed-words
SYMBOL: changed-generics
SYMBOL: old-definitions
SYMBOL: new-definitions
@ -79,18 +78,15 @@ TUPLE: forward-error word ;
[ drop f ] if ;
SYMBOL: recompile-hook
SYMBOL: make-generic-hook
: <definitions> ( -- pair ) { H{ } H{ } } [ clone ] map ;
: with-compilation-unit ( quot -- new-defs )
[
H{ } clone changed-words set
H{ } clone changed-generics set
<definitions> new-definitions set
<definitions> old-definitions set
[
changed-generics get keys make-generic-hook get call
changed-words get keys recompile-hook get call
] [ ] cleanup
] with-scope ; inline

6
core/generic/generic-docs.factor Normal file → Executable file
View File

@ -44,7 +44,6 @@ $nl
{ $subsection implementors }
"Low-level words which rebuilds the generic word after methods are added or removed, or the method combination is changed:"
{ $subsection make-generic }
{ $subsection ?make-generic }
"A " { $emphasis "method specifier" } " refers to a method and implements the " { $link "definition-protocol" } ":"
{ $subsection method-spec } ;
@ -108,11 +107,6 @@ HELP: make-generic
{ $description "Regenerates the definition of a generic word by applying the method combination to the set of defined methods." }
$low-level-note ;
HELP: ?make-generic
{ $values { "word" generic } }
{ $description "Regenerates the definition of a generic word, unless bootstrap is in progress, in which case nothing is done. This avoids regenerating generic words multiple times during bootstrap as methods are defined. Instead, all generic words are built once at the end of the process, resulting in a performance improvement." }
$low-level-note ;
HELP: init-methods
{ $values { "word" word } }
{ $description "Prepare to define a generic word." } ;

View File

@ -28,12 +28,6 @@ M: object perform-combination
dup "combination" word-prop perform-combination
define-compound ;
[ [ make-generic ] each ] make-generic-hook set-global
: ?make-generic ( word -- )
dup compound? [ dup [ ] define-compound ] unless
dup changed-generics get set-at ;
: init-methods ( word -- )
dup "methods" word-prop
H{ } assoc-like
@ -41,7 +35,7 @@ M: object perform-combination
: define-generic ( word combination -- )
dupd "combination" set-word-prop
dup init-methods ?make-generic ;
dup init-methods make-generic ;
TUPLE: method loc def ;
@ -77,7 +71,7 @@ TUPLE: check-method class generic ;
] unless ;
: with-methods ( word quot -- )
swap [ "methods" word-prop swap call ] keep ?make-generic ;
swap [ "methods" word-prop swap call ] keep make-generic ;
inline
: define-method ( method class generic -- )
@ -114,4 +108,4 @@ M: class forget ( class -- )
forget-word ;
M: class update-methods ( class -- )
class-usages implementors* [ ?make-generic ] each ;
class-usages implementors* [ make-generic ] each ;