Ignore:
Timestamp:
Feb 19, 2008, 8:08:50 AM (13 years ago)
Author:
gb
Message:

Propagate changeset:8513 to this branch.

File:
1 edited

Legend:

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

    r8444 r8514  
    927927    (nx1-punt-var v (pop initforms))))
    928928
    929 ; at the beginning of a binding construct, note which lexical variables are bound to other
    930 ; variables and the number of setqs done so far on the initform.
    931 ; After executing the body, if neither variable has been closed over,
    932 ; the new variable hasn't been setq'ed, and the old guy wasn't setq'ed
    933 ; in the body, the binding can be punted.
    934 (defun nx1-note-var-bindings (vars initforms &aux alist)
    935   (dolist (var vars alist)
    936     (let* ((binding (nx1-note-var-binding var (pop initforms))))
    937       (if binding (push binding alist)))))
     929;;; at the beginning of a binding construct, note which lexical
     930;;; variables are bound to other variables and the number of setqs
     931;;; done so far on the initform.  After executing the body, if neither
     932;;; variable has been closed over, the new variable hasn't been
     933;;; setq'ed, and the old guy wasn't setq'ed in the body, the binding
     934;;; can be punted.
    938935
    939936(defun nx1-note-var-binding (var initform)
     
    961958              nil)))))))
    962959                     
     960;;; Process entries involving variables bound to other variables at
     961;;; the end of a binding construct.  Each entry is of the form
     962;;; (source-var setq-count . target-var), where setq-count is the
     963;;; assignment count of TARGET-VAR at the time that the binding's
     964;;; initform was evaluated (not, in the case of LET, at the time that
     965;;; the bindinw was established.).  If the target isn't closed-over
     966;;; and SETQed (somewhere), and wasn't setqed in the body (e.g.,
     967;;; still has the same assignment-count as it had when the initform
     968;;; was executed), then we can "punt" the source (and replace references
     969;;; to it with references to the target.)
     970;;; It obviously makes no sense to do this if the source is SPECIAL;
     971;;; in some cases (LET), we create the source variable and add it to
     972;;; this alist before it's known whether or not the source variable
     973;;; is SPECIAL. so we have to ignore that case here.
    963974(defun nx1-check-var-bindings (alist)
    964975  (dolist (pair alist)
     
    968979           (target-bits (nx-var-bits target)))
    969980      (unless (or
    970                ; var can't be setq'ed or closed; target can't be setq'ed AND closed.
    971                (neq (%ilogand vbits (%ilogior (%ilsl $vbitsetq 1) (%ilsl $vbitclosed 1))) 0)
     981               ;; var can't be special, setq'ed or closed; target can't be
     982               ;; setq'ed AND closed.
     983               (neq (%ilogand vbits (%ilogior (%ilsl $vbitsetq 1)
     984                                              (%ilsl $vbitclosed 1)
     985                                              (%ilsl $vbitspecial 1))) 0)
    972986               (eq (%ilogior (%ilsl $vbitsetq 1) (%ilsl $vbitclosed 1))
    973987                   (%ilogand
Note: See TracChangeset for help on using the changeset viewer.