Changeset 11836


Ignore:
Timestamp:
Mar 21, 2009, 9:03:33 PM (10 years ago)
Author:
gz
Message:

Typecheck new bindings in nx1-env-body, if nx-declarations-typecheck is true. Remove the typechecking from nx1-typed-var-initform since no longer needed. Remove some bogus declarations found by compiling the system with typechecking declarations.

Location:
branches/working-0711/ccl
Files:
8 edited

Legend:

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

    r11824 r11836  
    39313931
    39323932(defun x862-test-reg-%izerop (seg vreg xfer reg cr-bit true-p  zero)
    3933   (declare (fixnum reg zero))
     3933  (declare (fixnum zero))
    39343934  (with-x86-local-vinsn-macros (seg vreg xfer)
    39353935    (if (zerop zero)
  • branches/working-0711/ccl/compiler/backend.lisp

    r11089 r11836  
    379379    `(if ,regspec
    380380       (multiple-value-bind (,class ,regval) (regspec-class-and-value ,regspec hard-reg-class-gpr-crf-mask)
    381          (declare (fixnum ,class ,regval))
     381         (declare (fixnum ,class))
    382382         (if (= ,class hard-reg-class-crf)
    383383           ,crf-form
  • branches/working-0711/ccl/compiler/nx0.lisp

    r11823 r11836  
    400400(defun nx1-typed-var-initform (pending sym form &optional (env *nx-lexical-environment*))
    401401  (let* ((type t)
    402          (form-type (dolist (decl (pending-declarations-vdecls pending)  type)
    403                       (when (and (eq (car decl) sym) (eq (cadr decl) 'type))
    404                         (setq type (nx1-type-intersect sym (nx-target-type type) (cddr decl))))))
    405402         (*nx-form-type* (if (nx-trust-declarations env)
    406                            form-type
     403                           (dolist (decl (pending-declarations-vdecls pending) type)
     404                             (when (and (eq (car decl) sym) (eq (cadr decl) 'type))
     405                               (setq type (nx1-type-intersect sym (nx-target-type type) (cddr decl)))))
    407406                           t)))
    408     (when (nx-declarations-typecheck env)
    409       (setq form `(the ,form-type ,form))
    410       (nx-note-source-transformation (caddr form) form))
    411407    (nx1-typed-form form env)))
    412408
     
    979975    (when inittype (setf (var-inittype var) inittype))
    980976    (when (and (not (%ilogbitp $vbitspecial bits))
    981                (consp init))
     977               (acode-p init))
    982978      (let* ((op (acode-operator init)))
    983979        (if (eq op (%nx1-operator lexical-reference))
     
    14601456        (nx-effect-other-decls pending *nx-lexical-environment*)
    14611457        (setq body (nx1-env-body body old-env))
    1462         (nx1-punt-bindings (%car auxen) (%cdr auxen))         
     1458        (nx1-punt-bindings (%car auxen) (%cdr auxen))
    14631459        (when methvar
    14641460          (push methvar req)
  • branches/working-0711/ccl/compiler/nx1.lisp

    r11823 r11836  
    20082008
    20092009
    2010 (defun nx1-env-body (body old-env)
     2010(defun nx1-env-body (body old-env &optional (typecheck (nx-declarations-typecheck *nx-lexical-environment*)))
    20112011  (do* ((form (nx1-progn-body body))
     2012        (typechecks nil)
    20122013        (env *nx-lexical-environment* (lexenv.parent-env env)))
    2013        ((or (eq env old-env) (null env)) form)
     2014       ((or (eq env old-env) (null env))
     2015        (if typechecks
     2016          (make-acode
     2017           (%nx1-operator progn)
     2018           (nconc (nreverse typechecks) (list form)))
     2019          form))
    20142020    (let ((vars (lexenv.variables env)))
    2015       (if (consp vars)
     2021      (when (consp vars)
    20162022        (dolist (var vars)
    2017           (nx-check-var-usage var))))))
     2023          (nx-check-var-usage var)
     2024          (when typecheck
     2025            (let* ((sym (var-name var))
     2026                   (type (nx-declared-type sym)))
     2027              (unless (eq type t)
     2028                (let ((old-bits (nx-var-bits var)))
     2029                  (push (nx1-form `(the ,type ,sym)) typechecks)
     2030                  (when (%izerop (%ilogand2 old-bits
     2031                                            (%ilogior (%ilsl $vbitspecial 1)
     2032                                                      (%ilsl $vbitreffed 1)
     2033                                                      (%ilsl $vbitclosed 1)
     2034                                                      $vrefmask
     2035                                                      $vsetqmask)))
     2036                    (nx-set-var-bits var (%ilogand2 (nx-var-bits var)
     2037                                                    (%ilognot (%ilsl $vbitignore 1))))))))))))))
     2038
    20182039
    20192040(defnx1 nx1-let* (let*) (varspecs &body forms)
     
    20632084            (push (nx-new-var pending sym t) vars))
    20642085          (nx-effect-other-decls pending *nx-lexical-environment*)
    2065           (make-acode 
     2086          (make-acode
    20662087           (%nx1-operator multiple-value-bind)
    20672088           (nreverse vars)
  • branches/working-0711/ccl/level-1/l1-clos-boot.lisp

    r11834 r11836  
    12421242
    12431243(defun std-instance-class-cell-typep (form class-cell)
    1244   (declare (type class-cell  class-cell))
    12451244  (let* ((typecode (typecode form))
    12461245         (wrapper (cond ((= typecode target::subtag-instance)
  • branches/working-0711/ccl/level-1/l1-dcode.lisp

    r11821 r11836  
    13101310
    13111311(defun nth-or-gf-error (n l gf)
    1312   (declare (fixnum l))
    13131312  (do* ((i 0 (1+ i))
    13141313        (l l (cdr l)))
  • branches/working-0711/ccl/lib/macros.lisp

    r11834 r11836  
    13521352  `(logior (the fixnum ,x) (the fixnum ,y)))
    13531353
    1354 (defmacro %ilogior (body &body args)
     1354(defmacro %ilogior (body &rest args)
    13551355   (while args
    13561356     (setq body (list '%ilogior2 body (pop args))))
  • branches/working-0711/ccl/library/lispequ.lisp

    r11819 r11836  
    199199  (var-bits var-parent)                 ; fixnum or ptr to parent
    200200  (var-ea  var-expansion)               ; p2 address (or symbol-macro expansion)
    201   var-decls                             ; list of applicable decls
     201  var-decls                             ; list of applicable decls [not used]
    202202  var-inittype
    203203  var-binding-info
Note: See TracChangeset for help on using the changeset viewer.