1.0.45.20: optimize ERROR and CERROR
authorNikodemus Siivola <nikodemus@random-state.net>
Fri, 11 Feb 2011 17:41:46 +0000 (17:41 +0000)
committerNikodemus Siivola <nikodemus@random-state.net>
Fri, 11 Feb 2011 17:41:46 +0000 (17:41 +0000)
 They were both surprisingly slow as we looked for a *STACK-TOP-HINT*
 before calling SIGNAL.

 The hint is needed (and was used) only for the INVOKE-DEBUGGER case,
 however, so there is no need to pay that price if SIGNAL is enough
 -- eg. when there's a handler.

 Fixes lp#715191.

 Also missing NEWS items for the CTOR hackery.

NEWS
src/code/cold-error.lisp
version.lisp-expr

diff --git a/NEWS b/NEWS
index 22a9839..d4165fd 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,6 +1,11 @@
 ;;;; -*- coding: utf-8; fill-column: 78 -*-
 changes relative to sbcl-1.0.45:
   * enhancement: largefile support on Solaris.
+  * optimization: ERROR and CERROR are approximately 5 times faster.
+  * optimization: optimized constructors are used for MAKE-INSTANCE of classes
+    with applicable non-standard (SETF SLOT-VALUE-USING-CLASS),
+    SLOT-BOUNDP-USING-CLASS, and INITIALIZE-INSTANCE :AROUND methods, speeding
+    up instance creation in those cases.
   * bug fix: local tail calls to DYNAMIC-EXTENT functions can no longer cause
     lifetime analysis to overwrite closed-over variables (lp#681092).
   * bug fix: encoding errors from some multibyte external formats such as EUC-JP
index 96a5670..ba9bfae 100644 (file)
 
   (infinite-error-protect
     (let ((condition (coerce-to-condition datum arguments
-                                          'simple-error 'error))
-          (sb!debug:*stack-top-hint* (maybe-find-stack-top-hint)))
+                                          'simple-error 'error)))
       (/show0 "done coercing DATUM to CONDITION")
+      (/show0 "signalling CONDITION from within ERROR")
       (let ((sb!debug:*stack-top-hint* nil))
-        (/show0 "signalling CONDITION from within ERROR")
         (signal condition))
       (/show0 "done signalling CONDITION within ERROR")
-      (invoke-debugger condition))))
+      ;; Finding the stack top hint is pretty expensive, so don't do
+      ;; it until we know we need the debugger.
+      (let ((sb!debug:*stack-top-hint* (maybe-find-stack-top-hint)))
+        (invoke-debugger condition)))))
 
 (defun cerror (continue-string datum &rest arguments)
   (infinite-error-protect
       (let ((condition (coerce-to-condition datum
                                             arguments
                                             'simple-error
-                                            'cerror))
-            (sb!debug:*stack-top-hint* (maybe-find-stack-top-hint)))
+                                            'cerror)))
         (with-condition-restarts condition (list (find-restart 'continue))
           (let ((sb!debug:*stack-top-hint* nil))
             (signal condition))
-          (invoke-debugger condition)))))
+          (let ((sb!debug:*stack-top-hint* (maybe-find-stack-top-hint)))
+            (invoke-debugger condition))))))
   nil)
 
 ;;; like BREAK, but without rebinding *DEBUGGER-HOOK* to NIL, so that
index ed982e9..a691cdf 100644 (file)
@@ -20,4 +20,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".)
-"1.0.45.19"
+"1.0.45.20"