summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp/bytecomp.el
diff options
context:
space:
mode:
authorStefan Monnier <monnier@iro.umontreal.ca>2011-02-11 14:48:54 -0500
committerStefan Monnier <monnier@iro.umontreal.ca>2011-02-11 14:48:54 -0500
commit43e67019dfc4fb7d3474e0fbedcfec60f2300521 (patch)
treecf67296a599964c895e443024fe4544bcd54f428 /lisp/emacs-lisp/bytecomp.el
parentd779e73c22ae9fedcf6edc6ec286f19cf2e3d89a (diff)
downloademacs-43e67019dfc4fb7d3474e0fbedcfec60f2300521.tar.gz
emacs-43e67019dfc4fb7d3474e0fbedcfec60f2300521.tar.bz2
emacs-43e67019dfc4fb7d3474e0fbedcfec60f2300521.zip
Make cconv-analyse understand the need for closures.
* lisp/emacs-lisp/byte-lexbind.el (byte-compile-lforminfo-analyze): Understand the :fun-body case for catch, save-window-excursion, and condition-case. (byte-compile-maybe-push-heap-environment): No need when nclosures is zero and byte-compile-current-num-closures is -1. * lisp/emacs-lisp/bytecomp.el (byte-compile-lambda): Fix `fun' that was not renamed to `bytecomp-fun'. * lisp/emacs-lisp/cconv.el (cconv-not-lexical-var-p): New function. (cconv-freevars): Use it. (cconv-closure-convert-rec): Avoid `position'. (cconv-analyse-function): New function. (cconv-analyse-form): Use it. `inclosure' can't be nil any more. Check lexical vars at let-binding time rather than when referenced. For defuns to be in an empty environment and lambdas to take lexical args. Pay attention to the need to build closures in catch, unwind-protect, save-window-excursion, condition-case, and track-mouse. Fix defconst/defvar handling.
Diffstat (limited to 'lisp/emacs-lisp/bytecomp.el')
-rw-r--r--lisp/emacs-lisp/bytecomp.el4
1 files changed, 2 insertions, 2 deletions
diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el
index e14ecc608c7..f37d7489e9a 100644
--- a/lisp/emacs-lisp/bytecomp.el
+++ b/lisp/emacs-lisp/bytecomp.el
@@ -2745,7 +2745,7 @@ If FORM is a lambda or a macro, byte-compile it as a function."
;; containing the args and any closed-over variables.
(and lexical-binding
(byte-compile-make-lambda-lexenv
- fun
+ bytecomp-fun
byte-compile-lexical-environment)))
(is-closure
;; This is true if we should be making a closure instead of
@@ -2804,7 +2804,7 @@ If FORM is a lambda or a macro, byte-compile it as a function."
(let ((code (byte-compile-lambda form add-lambda)))
(if (byte-compile-closure-code-p code)
(byte-compile-make-closure code)
- ;; A simple lambda is just a constant
+ ;; A simple lambda is just a constant.
(byte-compile-constant code))))
(defun byte-compile-constants-vector ()