(or (cdr (assoc thing (ir2-environment-environment (environment-info env))))
(etypecase thing
(lambda-var
+ ;; I think that a failure of this assertion means that we're
+ ;; trying to access a variable which was improperly closed
+ ;; over. An ENVIRONMENT structure is a physical environment.
+ ;; Every variable that a form refers to should either be in
+ ;; its physical environment directly, or grabbed from a
+ ;; surrounding physical environment when it was closed over.
+ ;; The ASSOC expression above finds closed-over variables, so
+ ;; if we fell through the ASSOC expression, it wasn't closed
+ ;; over. Therefore, it must be in our physical environment
+ ;; directly. If instead it is in some other physical
+ ;; environment, then it's bogus for us to reference it here
+ ;; without it being closed over. -- WHN 2001-09-29
(aver (eq env (lambda-environment (lambda-var-home thing))))
(leaf-info thing))
(nlx-info
;;; the called function, since local call analysis converts all
;;; closure references. If a TL-XEP, we know it is not a closure.
;;;
-;;; If a closed-over lambda-var has no refs (is deleted), then we
+;;; If a closed-over LAMBDA-VAR has no refs (is deleted), then we
;;; don't initialize that slot. This can happen with closures over
;;; top-level variables, where optimization of the closure deleted the
;;; variable. Since we committed to the closure format when we
(vop count-me node block *dynamic-counts-tn*
(block-number (ir2-block-block block)))))
- (emit-move node block (ir2-environment-return-pc-pass env)
+ (emit-move node
+ block
+ (ir2-environment-return-pc-pass env)
(ir2-environment-return-pc env))
(let ((lab (gen-label)))
(defoptimizer (%special-unbind ir2-convert) ((var) node block)
(vop unbind node block))
-;;; ### Not clear that this really belongs in this file, or should
-;;; really be done this way, but this is the least violation of
+;;; ### It's not clear that this really belongs in this file, or
+;;; should really be done this way, but this is the least violation of
;;; abstraction in the current setup. We don't want to wire
;;; shallow-binding assumptions into IR1tran.
(def-ir1-translator progv ((vars vals &body body) start cont)
(ir1-convert
start cont
- (if (or *converting-for-interpreter* (byte-compiling))
- `(%progv ,vars ,vals #'(lambda () ,@body))
- (once-only ((n-save-bs '(%primitive current-binding-pointer)))
- `(unwind-protect
- (progn
- (mapc #'(lambda (var val)
- (%primitive bind val var))
- ,vars
- ,vals)
- ,@body)
- (%primitive unbind-to-here ,n-save-bs))))))
+ (once-only ((n-save-bs '(%primitive current-binding-pointer)))
+ `(unwind-protect
+ (progn
+ (mapc #'(lambda (var val)
+ (%primitive bind val var))
+ ,vars
+ ,vals)
+ ,@body)
+ (%primitive unbind-to-here ,n-save-bs)))))
\f
;;;; non-local exit