[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
master 00553628558 2/2: * Don't install unnecessary trampolines (bug#695
From: |
Andrea Corallo |
Subject: |
master 00553628558 2/2: * Don't install unnecessary trampolines (bug#69573) |
Date: |
Fri, 15 Mar 2024 09:47:16 -0400 (EDT) |
branch: master
commit 005536285585bcdf5a67a01cdfd8e1242742f953
Author: Andrea Corallo <acorallo@gnu.org>
Commit: Andrea Corallo <acorallo@gnu.org>
* Don't install unnecessary trampolines (bug#69573)
* lisp/emacs-lisp/comp-run.el (comp-subr-trampoline-install):
Check that subr-name actually matches the target subr.
---
lisp/emacs-lisp/comp-run.el | 16 +++++++++-------
1 file changed, 9 insertions(+), 7 deletions(-)
diff --git a/lisp/emacs-lisp/comp-run.el b/lisp/emacs-lisp/comp-run.el
index 057760322ab..afb46e3cd19 100644
--- a/lisp/emacs-lisp/comp-run.el
+++ b/lisp/emacs-lisp/comp-run.el
@@ -364,13 +364,15 @@ Return the trampoline if found or nil otherwise."
(when (memq subr-name comp-warn-primitives)
(warn "Redefining `%s' might break native compilation of trampolines."
subr-name))
- (unless (or (null native-comp-enable-subr-trampolines)
- (memq subr-name native-comp-never-optimize-functions)
- (gethash subr-name comp-installed-trampolines-h))
- (cl-assert (subr-primitive-p (symbol-function subr-name)))
- (when-let ((trampoline (or (comp-trampoline-search subr-name)
- (comp-trampoline-compile subr-name))))
- (comp--install-trampoline subr-name trampoline))))
+ (let ((subr (symbol-function subr-name)))
+ (unless (or (not (string= subr-name (subr-name subr))) ;; (bug#69573)
+ (null native-comp-enable-subr-trampolines)
+ (memq subr-name native-comp-never-optimize-functions)
+ (gethash subr-name comp-installed-trampolines-h))
+ (cl-assert (subr-primitive-p subr))
+ (when-let ((trampoline (or (comp-trampoline-search subr-name)
+ (comp-trampoline-compile subr-name))))
+ (comp--install-trampoline subr-name trampoline)))))
;;;###autoload
(defun native--compile-async (files &optional recursively load selector)