summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp/comp.el
diff options
context:
space:
mode:
authorJens Schmidt <jschmidt4gnu@vodafonemail.de>2023-11-20 23:42:01 +0100
committerAndrea Corallo <acorallo@gnu.org>2023-12-04 21:43:31 +0100
commite670412a3e101e70dc26e021f467faece8cb7f6b (patch)
treeee437a40654aae105241cfdaf3cc31330c22e65f /lisp/emacs-lisp/comp.el
parentf5e45247081ab2489581c650423413a2b6c2caf9 (diff)
downloademacs-e670412a3e101e70dc26e021f467faece8cb7f6b.tar.gz
emacs-e670412a3e101e70dc26e021f467faece8cb7f6b.tar.bz2
emacs-e670412a3e101e70dc26e021f467faece8cb7f6b.zip
Update handling of advices during preload
* lisp/emacs-lisp/comp-common.el (native-comp-never-optimize-functions): Remove macroexpand and rename-buffer from default value. * lisp/emacs-lisp/comp.el (comp-call-optim-form-call): Document call optimization for advised primitives. * lisp/emacs-lisp/nadvice.el (advice-add): Remove references to TODOs that were completed already earlier. * lisp/loadup.el: Disallow advices during preload. (Bug#67005)
Diffstat (limited to 'lisp/emacs-lisp/comp.el')
-rw-r--r--lisp/emacs-lisp/comp.el8
1 files changed, 8 insertions, 0 deletions
diff --git a/lisp/emacs-lisp/comp.el b/lisp/emacs-lisp/comp.el
index 39e32d5142c..3e5ff195764 100644
--- a/lisp/emacs-lisp/comp.el
+++ b/lisp/emacs-lisp/comp.el
@@ -2789,6 +2789,14 @@ FUNCTION can be a function-name or byte compiled function."
(symbol-function callee)
(cl-assert (byte-code-function-p callee))
callee))
+ ;; Below call to `subrp' returns nil on an advised
+ ;; primitive F, so that we do not optimize calls to F
+ ;; with the funcall trampoline removal below. But if F
+ ;; is advised while we compile its call, it is very
+ ;; likely to be advised also when that call is executed.
+ ;; And in that case an "unoptimized" call to F is
+ ;; actually cheaper since it avoids the call to the
+ ;; intermediate native trampoline (bug#67005).
(subrp (subrp f))
(comp-func-callee (comp-func-in-unit callee)))
(cond