1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-12-13 09:32:47 +00:00

* Make the Evil happy (Bug#41374)

* lisp/emacs-lisp/comp.el (comp-never-optimize-functions):
	Blacklist all primitives advised by evil-mode from trampoline
	optimization.
	(comp-call-optim-form-call): Prevent trampoline optimization for
	recursive calls at speed 2 to respect elisp original semantic.
This commit is contained in:
Andrea Corallo 2020-05-18 19:04:07 +01:00
parent cd4ef52c86
commit 6d850b50c5

View File

@ -103,7 +103,10 @@ Skip if any is matching."
macroexpand scroll-down scroll-up narrow-to-region widen rename-buffer macroexpand scroll-down scroll-up narrow-to-region widen rename-buffer
make-indirect-buffer delete-file top-level abort-recursive-edit make-indirect-buffer delete-file top-level abort-recursive-edit
;; For user convenience ;; For user convenience
yes-or-no-p) yes-or-no-p
;; Make the Evil happy :/
read-key-sequence select-window set-window-buffer split-window-internal
use-global-map use-local-map)
"Primitive functions for which we do not perform trampoline optimization. "Primitive functions for which we do not perform trampoline optimization.
This is especially useful for primitives known to be advised or This is especially useful for primitives known to be advised or
redefined when compilation is performed at `comp-speed' > 0." redefined when compilation is performed at `comp-speed' > 0."
@ -1983,10 +1986,9 @@ Backward propagate array placement properties."
(fill-args args maxarg)))) (fill-args args maxarg))))
`(,call-type ,callee ,@args))) `(,call-type ,callee ,@args)))
;; Intra compilation unit procedure call optimization. ;; Intra compilation unit procedure call optimization.
;; Attention speed 3 triggers that for non self calls too!! ;; Attention speed 3 triggers this for non self calls too!!
((or (eq callee self) ((and (>= comp-speed 3)
(and (>= comp-speed 3) callee-in-unit)
callee-in-unit))
(let* ((func-args (comp-func-args callee-in-unit)) (let* ((func-args (comp-func-args callee-in-unit))
(nargs (comp-nargs-p func-args)) (nargs (comp-nargs-p func-args))
(call-type (if nargs 'direct-callref 'direct-call)) (call-type (if nargs 'direct-callref 'direct-call))