Changeset 11686


Ignore:
Timestamp:
Feb 4, 2009, 10:42:15 PM (11 years ago)
Author:
gz
Message:

Don't catch all errors in specifier-type-if-known, just unknown type. Also more tweaks on the constant folding for typep.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/working-0711/ccl/compiler/optimizers.lisp

    r11681 r11686  
    640640(defun specifier-type-if-known (typespec &optional env)
    641641  (handler-case (specifier-type typespec env)
    642     (parse-unknown-type (c) (values nil (parse-unknown-type-specifier c)))
    643     (error () nil)))
     642    (parse-unknown-type (c) (values nil (parse-unknown-type-specifier c)))))
    644643
    645644#+debugging-version
     
    648647                                       (break "caught unknown-type ~s" c)
    649648                                       (return-from specifier-type-if-known
    650                                          (values nil (parse-unknown-type-specifier c)))))
    651                  (error (lambda (c)
    652                           (break "caught error ~s" c)
    653                           (return-from specifier-type-if-known nil))))
     649                                         (values nil (parse-unknown-type-specifier c))))))
    654650    (specifier-type typespec env)))
    655651
     
    15901586
    15911587(define-compiler-macro typep  (&whole call &environment env thing type &optional e)
    1592   (if (quoted-form-p type)
    1593     (if (and (constantp thing) (specifier-type-if-known (%cadr type) env))
    1594       (typep (if (quoted-form-p thing) (%cadr thing) thing) (%cadr type) env)
    1595       (or (and (null e) (optimize-typep thing (%cadr type) env))
    1596           call))
    1597     (if (eq type t)
    1598       `(progn ,thing t)
    1599       call)))
     1588  (if (or (quoted-form-p type) (self-evaluating-p type))
     1589    (let ((type-val (nx-unquote type)))
     1590      (if (eq type-val t)
     1591        `(progn ,thing t)
     1592        (if (and (or (quoted-form-p thing) (self-evaluating-p thing))
     1593                 (specifier-type-if-known type-val env))
     1594          (typep (nx-unquote thing) type-val env)
     1595          (or (and (null e) (optimize-typep thing type-val env))
     1596              call))))
     1597    call))
    16001598
    16011599(define-compiler-macro structure-typep (&whole w thing type)
Note: See TracChangeset for help on using the changeset viewer.