0.8.19.14:
authorChristophe Rhodes <csr21@cam.ac.uk>
Fri, 4 Feb 2005 11:46:41 +0000 (11:46 +0000)
committerChristophe Rhodes <csr21@cam.ac.uk>
Fri, 4 Feb 2005 11:46:41 +0000 (11:46 +0000)
Merge "PCL depessimization" as in sbcl-devel 2005-02-03

NEWS
src/pcl/boot.lisp
version.lisp-expr

diff --git a/NEWS b/NEWS
index be8ba6d..947145f 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -11,6 +11,8 @@ changes in sbcl-0.8.20 (0.9alpha.0?) relative to sbcl-0.8.19:
     Euler)
   * optimization: sequence traversal functions use their freedom to
     coerce function designators to functions.
+  * optimization: code with many calls to CLOS methods specialized on
+    CLOS classes has had redundant type checks removed.
   * fixed some bugs related to Unicode integration:
     ** portions of multibyte characters at the end of buffers for
        character-based file input are correctly transferred to the
index d1a56b4..4e3aa52 100644 (file)
@@ -614,23 +614,28 @@ bootstrapping.
         ;; Otherwise, we can usually make Python very happy.
         (let ((type (info :type :kind specializer)))
           (ecase type
-            ((:primitive :defined :instance :forthcoming-defclass-type)
-             `(type ,specializer ,parameter))
-            ((nil)
+            ((:primitive) `(type ,specializer ,parameter))
+            ((:instance nil)
              (let ((class (find-class specializer nil)))
-               (if class
-                   `(type ,(class-name class) ,parameter)
-                   (progn
-                     ;; we can get here, and still not have a failure
-                     ;; case, by doing MOP programming like (PROGN
-                     ;; (ENSURE-CLASS 'FOO) (DEFMETHOD BAR ((X FOO))
-                     ;; ...)).  Best to let the user know we haven't
-                     ;; been able to extract enough information:
-                     (style-warn
-                      "~@<can't find type for presumed class ~S in ~S.~@:>"
-                      specializer
-                      'parameter-specializer-declaration-in-defmethod)
-                     '(ignorable))))))))))
+               (cond
+                 (class
+                  (if (typep class '(or built-in-class structure-class))
+                      `(type ,specializer ,parameter)
+                      ;; don't declare CLOS classes as parameters;
+                      ;; it's too expensive.
+                      '(ignorable)))
+                 (t
+                  ;; we can get here, and still not have a failure
+                  ;; case, by doing MOP programming like (PROGN
+                  ;; (ENSURE-CLASS 'FOO) (DEFMETHOD BAR ((X FOO))
+                  ;; ...)).  Best to let the user know we haven't
+                  ;; been able to extract enough information:
+                  (style-warn
+                   "~@<can't find type for presumed class ~S in ~S.~@:>"
+                   specializer
+                   'parameter-specializer-declaration-in-defmethod)
+                  '(ignorable)))))
+            ((:forthcoming-defclass-type) '(ignorable)))))))
 
 (defun make-method-lambda-internal (method-lambda &optional env)
   (unless (and (consp method-lambda) (eq (car method-lambda) 'lambda))
index a69dddc..030c40b 100644 (file)
@@ -17,4 +17,4 @@
 ;;; checkins which aren't released. (And occasionally for internal
 ;;; versions, especially for internal versions off the main CVS
 ;;; branch, it gets hairier, e.g. "0.pre7.14.flaky4.13".)
-"0.8.19.13"
+"0.8.19.14"