]> git.eshelyaron.com Git - emacs.git/commit
Constant-propagate access to captured variables
authorMattias Engdegård <mattiase@acm.org>
Sat, 11 Dec 2021 21:11:08 +0000 (22:11 +0100)
committerMattias Engdegård <mattiase@acm.org>
Sat, 11 Dec 2021 21:16:55 +0000 (22:16 +0100)
commit8716f21d94bfda0072843e087833fedb38dcf13e
tree668849f67d7fa4b50d59b19ebaa6e52c546a9544
parent36cd4f5d81c3c19e5719e25daa1a8e08c88cc1a7
Constant-propagate access to captured variables

* lisp/emacs-lisp/byte-opt.el (byte-optimize--substitutable-p):
Treat (internal-get-closed-var N) as constants for propagation
purposes, because that is effectively what such forms will be compiled
to.  This allows for the elimination of some lexical variables.

* test/lisp/emacs-lisp/bytecomp-tests.el (bytecomp-tests--test-cases):
Add test case.
lisp/emacs-lisp/byte-opt.el
test/lisp/emacs-lisp/bytecomp-tests.el