]> git.eshelyaron.com Git - emacs.git/commit
Eliminate lazy bytecode loading
authorMattias EngdegÄrd <mattiase@acm.org>
Tue, 30 Jan 2024 16:55:19 +0000 (17:55 +0100)
committerEshel Yaron <me@eshelyaron.com>
Wed, 31 Jan 2024 20:17:08 +0000 (21:17 +0100)
commitf05b061c2f6375732e34483c1d5d2cf27698bb04
tree877574279a52a3372db3b2d2da88774b6a4a28e6
parent245b7520c211f147eba10bff0b00e68ba32546fc
Eliminate lazy bytecode loading

The obsolete lazy-loaded bytecode feature, enabled by
`byte-compile-dynamic`, slows down Lisp execution even when not in use
because every call to a bytecode function has to check that function
for laziness.

This change forces up-front loading of all lazy bytecode so that we
can remove all those checks.  (Dynamically loaded doc strings are not
affected.)

There is no point in generating lazy bytecode any more so we stop
doing that; this simplifies the compiler.  `byte-compile-dynamic` now
has no effect.

This is a fully compatible change; the few remaining users of
`byte-compile-dynamic` should not notice any difference.

* src/lread.c (bytecode_from_rev_list): Force eager loading of
lazy bytecode.
* src/bytecode.c (exec_byte_code): Remove lazy bytecode checks.
* src/eval.c (fetch_and_exec_byte_code, Ffetch_bytecode): Remove.
(funcall_lambda): Call exec_byte_code directly, avoiding checks.
* lisp/subr.el (fetch-bytecode): New definition, obsolete no-op.
* lisp/emacs-lisp/disass.el (disassemble-1):
* lisp/emacs-lisp/bytecomp.el (byte-compile-unfold-bcf):
Remove calls to fetch-bytecode.
(byte-compile-dynamic): Update doc string.
(byte-compile-close-variables, byte-compile-from-buffer)
(byte-compile-insert-header, byte-compile-output-file-form)
(byte-compile--output-docform-recurse, byte-compile-output-docform)
(byte-compile-file-form-defmumble):
Remove effects of byte-compile-dynamic.
* doc/lispref/compile.texi (Dynamic Loading): Remove node now that
the entire `byte-compile-dynamic` facility has been rendered inert.
* etc/NEWS: Announce changes.

(cherry picked from commit 9bcc9690a8076a22398c27a7ccf836ee95eb16a2)
doc/lispref/compile.texi
doc/lispref/elisp.texi
etc/NEWS
lisp/emacs-lisp/bytecomp.el
lisp/emacs-lisp/disass.el
lisp/subr.el
src/bytecode.c
src/eval.c
src/lread.c