]> git.eshelyaron.com Git - emacs.git/commit
Extend LAP optimisations to more operations
authorMattias Engdegård <mattiase@acm.org>
Tue, 9 Aug 2022 08:57:46 +0000 (10:57 +0200)
committerMattias Engdegård <mattiase@acm.org>
Wed, 10 Aug 2022 10:51:40 +0000 (12:51 +0200)
commit9d35afed49896928433bb28a781b6060bc1601b1
tree682d3ea793c52fbfc3bda5baed72a093834effda
parent1d9ee2727046c1ca405e8c5a03069b0254d1277d
Extend LAP optimisations to more operations

Extend the set of eligible opcodes for certain peephole
transformations, which then provide further optimisation
opportunities.

* lisp/emacs-lisp/byte-opt.el (byte-optimize-lapcode):
Optimise empty save-current-buffer in the same way as we already
do for save-excursion and save-restriction.  This is safe
because (save-current-buffer) is a no-op.
(byte-compile-side-effect-and-error-free-ops): Add list3, list4 and
listN.  These were all apparent oversights as list1 and list2 were
already included.
(byte-after-unbind-ops): Add stack-ref, stack-set, discard, list3,
list4 and listN.  Stack manipulation is safe because unbind cannot
read or modify stack entries.
lisp/emacs-lisp/byte-opt.el