diff options
author | Mattias EngdegÄrd <mattiase@acm.org> | 2021-07-28 21:12:27 +0200 |
---|---|---|
committer | Mattias EngdegÄrd <mattiase@acm.org> | 2021-07-30 09:54:29 +0200 |
commit | 566e29f78ccee4fcf0421576c0306860c8afae0f (patch) | |
tree | aaedb56c599f5d80cb102b34e0fbc6522d74ba08 /lisp/emacs-lisp/bytecomp.el | |
parent | 5fb8b20fa35a931660d9d59afc9ca863dd33a123 (diff) | |
download | emacs-566e29f78ccee4fcf0421576c0306860c8afae0f.tar.gz emacs-566e29f78ccee4fcf0421576c0306860c8afae0f.tar.bz2 emacs-566e29f78ccee4fcf0421576c0306860c8afae0f.zip |
Single source optimiser entry point
Make the optimiser aware of lexical arguments. Otherwise we cannot
know for sure whether a variable is lexical or dynamic during
traversal.
* lisp/emacs-lisp/byte-opt.el (byte-optimize-one-form): New optimiser
entry point, replacing the recursive byte-optimize-form.
* lisp/emacs-lisp/bytecomp.el (byte-optimize-one-form): Autoload.
(byte-compile-keep-pending, byte-compile-top-level):
Use byte-optimize-one-form.
Diffstat (limited to 'lisp/emacs-lisp/bytecomp.el')
-rw-r--r-- | lisp/emacs-lisp/bytecomp.el | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el index a6e7e03cb0a..7bd642d2b23 100644 --- a/lisp/emacs-lisp/bytecomp.el +++ b/lisp/emacs-lisp/bytecomp.el @@ -192,7 +192,7 @@ otherwise adds \".elc\"." (autoload 'byte-compile-inline-expand "byte-opt") ;; This is the entry point to the lapcode optimizer pass1. -(autoload 'byte-optimize-form "byte-opt") +(autoload 'byte-optimize-one-form "byte-opt") ;; This is the entry point to the lapcode optimizer pass2. (autoload 'byte-optimize-lapcode "byte-opt") @@ -2455,7 +2455,7 @@ list that represents a doc string reference. (defun byte-compile-keep-pending (form &optional handler) (if (memq byte-optimize '(t source)) - (setq form (byte-optimize-form form t))) + (setq form (byte-optimize-one-form form t))) (if handler (let ((byte-compile--for-effect t)) ;; To avoid consing up monstrously large forms at load time, we split @@ -3155,7 +3155,7 @@ for symbols generated by the byte compiler itself." (byte-compile-output nil) (byte-compile-jump-tables nil)) (if (memq byte-optimize '(t source)) - (setq form (byte-optimize-form form byte-compile--for-effect))) + (setq form (byte-optimize-one-form form byte-compile--for-effect))) (while (and (eq (car-safe form) 'progn) (null (cdr (cdr form)))) (setq form (nth 1 form))) ;; Set up things for a lexically-bound function. |