[armedbear-cvs] r12107 - trunk/abcl/src/org/armedbear/lisp

Erik Huelsmann ehuelsmann at common-lisp.net
Wed Aug 19 21:17:30 UTC 2009


Author: ehuelsmann
Date: Wed Aug 19 17:17:28 2009
New Revision: 12107

Log:
Check simple (symbolp) types in compiled code
when *safety* is 1 or 2.

Note: *safety* 3 checks full types; 0 skips checks.

Modified:
   trunk/abcl/src/org/armedbear/lisp/compiler-pass1.lisp

Modified: trunk/abcl/src/org/armedbear/lisp/compiler-pass1.lisp
==============================================================================
--- trunk/abcl/src/org/armedbear/lisp/compiler-pass1.lisp	(original)
+++ trunk/abcl/src/org/armedbear/lisp/compiler-pass1.lisp	Wed Aug 19 17:17:28 2009
@@ -855,6 +855,13 @@
                                (require-type ,sym ',type)
                                ,sym)))
              (p1 new-expr)))
+          ((and (<= 1 *safety* 2) ;; at safety 1 or 2 check relatively
+                (symbolp type))   ;; simple types (those specified by a single symbol)
+           (let* ((sym (gensym))
+                  (new-expr `(let ((,sym ,expr))
+                               (require-type ,sym ',type)
+                               ,sym)))
+             (p1 new-expr)))
           (t
            (list 'THE type (p1 expr))))))
 




More information about the armedbear-cvs mailing list