diff --git a/basis/bootstrap/image/image.factor b/basis/bootstrap/image/image.factor index f3f570b462..db8e8c8ec0 100755 --- a/basis/bootstrap/image/image.factor +++ b/basis/bootstrap/image/image.factor @@ -417,7 +417,7 @@ M: quotation ' } [ [ bootstrap-word ] [ get ] bi ] H{ } map>assoc { class<=-cache class-not-cache classes-intersect-cache - class-and-cache class-or-cache + class-and-cache class-or-cache next-method-quot-cache } [ H{ } clone ] H{ } map>assoc assoc-union bootstrap-global set bootstrap-global emit-userenv ; diff --git a/core/classes/classes.factor b/core/classes/classes.factor index 67a789a1dc..dcb69c9149 100755 --- a/core/classes/classes.factor +++ b/core/classes/classes.factor @@ -10,20 +10,23 @@ SYMBOL: class-not-cache SYMBOL: classes-intersect-cache SYMBOL: class-and-cache SYMBOL: class-or-cache +SYMBOL: next-method-quot-cache : init-caches ( -- ) H{ } clone class<=-cache set H{ } clone class-not-cache set H{ } clone classes-intersect-cache set H{ } clone class-and-cache set - H{ } clone class-or-cache set ; + H{ } clone class-or-cache set + H{ } clone next-method-quot-cache set ; : reset-caches ( -- ) class<=-cache get clear-assoc class-not-cache get clear-assoc classes-intersect-cache get clear-assoc class-and-cache get clear-assoc - class-or-cache get clear-assoc ; + class-or-cache get clear-assoc + next-method-quot-cache get clear-assoc ; SYMBOL: update-map diff --git a/core/generic/generic.factor b/core/generic/generic.factor index 026e372912..d25a98c53c 100755 --- a/core/generic/generic.factor +++ b/core/generic/generic.factor @@ -45,7 +45,9 @@ GENERIC: effective-method ( generic -- method ) GENERIC: next-method-quot* ( class generic combination -- quot ) : next-method-quot ( class generic -- quot ) - dup "combination" word-prop next-method-quot* ; + next-method-quot-cache get [ + dup "combination" word-prop next-method-quot* + ] 2cache ; : (call-next-method) ( class generic -- ) next-method-quot call ; @@ -99,10 +101,11 @@ M: method-body crossref? 2bi ; : create-method ( class generic -- method ) - 2dup method dup [ - 2nip - ] [ - drop [ dup ] 2keep reveal-method + 2dup method dup [ 2nip ] [ + drop + [ dup ] 2keep + reveal-method + reset-caches ] if ; PREDICATE: default-method < word "default" word-prop ;