X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fpcl%2Fdfun.lisp;h=3b5a5999f730bf09fba48bd33d8e8e759ae460d7;hb=46d8e06740236e41db254d95c6bdc662039d32f6;hp=0e816d0dddc4e99863503e1a9f1f4d12b77b409b;hpb=e3932d9a8cf3b8d2272cf75d1c40173af48747be;p=sbcl.git diff --git a/src/pcl/dfun.lisp b/src/pcl/dfun.lisp index 0e816d0..3b5a599 100644 --- a/src/pcl/dfun.lisp +++ b/src/pcl/dfun.lisp @@ -606,10 +606,20 @@ Except see also BREAK-VICIOUS-METACIRCLE. -- CSR, 2003-05-28 classes-list new-class))) (make-constant-value-dfun generic-function cache))) +(defun gf-has-method-with-nonstandard-specializer-p (gf) + (let ((methods (generic-function-methods gf))) + (dolist (method methods nil) + (unless (every (lambda (s) (standard-specializer-p s)) + (method-specializers method)) + (return t))))) + (defun use-dispatch-dfun-p (gf &optional (caching-p (use-caching-dfun-p gf))) (when (eq *boot-state* 'complete) (unless (or caching-p - (gf-requires-emf-keyword-checks gf)) + (gf-requires-emf-keyword-checks gf) + ;; DISPATCH-DFUN-COST will error if it encounters a + ;; method with a non-standard specializer. + (gf-has-method-with-nonstandard-specializer-p gf)) ;; This should return T when almost all dispatching is by ;; eql specializers or built-in classes. In other words, ;; return NIL if we might ever need to do more than