0.9.17.5:
authorJuho Snellman <jsnell@iki.fi>
Mon, 2 Oct 2006 11:34:25 +0000 (11:34 +0000)
committerJuho Snellman <jsnell@iki.fi>
Mon, 2 Oct 2006 11:34:25 +0000 (11:34 +0000)
        The debugger tends to not show all variables regardless of the
        optimization policy. Fix the most common reason for that happening.

        * When compiling with a high debug quality, don't do substitution for
          variables that are only used once.
        * Except for variables introduced in DEFTRANSFORM inline
          lambdas, since they're not going to very interesting for the
          debugger.

NEWS
src/compiler/ir1opt.lisp
src/compiler/policies.lisp
version.lisp-expr

diff --git a/NEWS b/NEWS
index 8bc1042..be6d635 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -5,6 +5,9 @@ changes in sbcl-0.9.18 (1.0.beta?) relative to sbcl-0.9.16:
     returns T (reported by Anton Kazennikov)
   * bug fix: the STORE-VALUE restart of CHECK-TYPE works correctly
     with non-variable places
+  * improvement: the debugger will now also display local variables that
+    are only used once, for code compiled with a DEBUG optimization quality
+    of 2 or higher.
 
 changes in sbcl-0.9.17 (0.9.99?) relative to sbcl-0.9.16:
   * feature: weak hash tables, see MAKE-HASH-TABLE documentation
index 1fd55cd..2bdb4de 100644 (file)
             (ref (lvar-use (combination-fun call))))
         (change-ref-leaf ref new-fun)
         (setf (combination-kind call) :full)
+        ;; The internal variables of a transform are not going to be
+        ;; interesting to the debugger, so there's no sense in
+        ;; suppressing the substitution of variables with only one use
+        ;; (the extra variables can slow down constraint propagation).
+        (setf (combination-lexenv call)
+              (make-lexenv :default (combination-lexenv call)
+                           :policy (process-optimize-decl
+                                    '(optimize
+                                      (preserve-single-use-debug-variables 0))
+                                    (lexenv-policy
+                                     (combination-lexenv call)))))
         (locall-analyze-component *current-component*))))
   (values))
 
                            leaf var)))
                  t)))))
         ((and (null (rest (leaf-refs var)))
+              ;; Don't substitute single-ref variables on high-debug /
+              ;; low speed, to improve the debugging experience.
+              (policy call (< preserve-single-use-debug-variables 3))
               (substitute-single-use-lvar arg var)))
         (t
          (propagate-to-refs var (lvar-type arg))))))
index e68e4b0..78759f4 100644 (file)
 (define-optimization-quality compute-debug-fun
     debug
   ("no" "minimal" "yes" "yes"))
+
+(define-optimization-quality preserve-single-use-debug-variables
+    (if (and (>= debug 2)
+             (< speed 3))
+        3
+        0)
+  ("no" "no" "no" "yes"))
index 3adfc5a..99ff286 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.9.17.4"
+"0.9.17.5"