diff options
| author | Andrea Corallo | 2021-01-17 16:50:16 +0100 |
|---|---|---|
| committer | Andrea Corallo | 2021-01-17 17:01:51 +0100 |
| commit | 883d937320a8be2bdc6d0ab7b5dd9551cbfeebd4 (patch) | |
| tree | 8c5c8534501d51f76ef34772207812cf8d88ec15 | |
| parent | 88100bed0af530f04cf56acca9f9d1bb12b45771 (diff) | |
| download | emacs-883d937320a8be2bdc6d0ab7b5dd9551cbfeebd4.tar.gz emacs-883d937320a8be2bdc6d0ab7b5dd9551cbfeebd4.zip | |
Make `comp-enable-subr-trampolines' effective for advices (bug#45854)
* src/comp.c: Copyright update.
(syms_of_comp): Update `comp-enable-subr-trampolines' doc.
* lisp/emacs-lisp/comp.el (comp-subr-trampoline-install): Check
for `comp-enable-subr-trampolines'.
| -rw-r--r-- | lisp/emacs-lisp/comp.el | 3 | ||||
| -rw-r--r-- | src/comp.c | 6 |
2 files changed, 5 insertions, 4 deletions
diff --git a/lisp/emacs-lisp/comp.el b/lisp/emacs-lisp/comp.el index d127cea449e..238d86f7d51 100644 --- a/lisp/emacs-lisp/comp.el +++ b/lisp/emacs-lisp/comp.el | |||
| @@ -3668,7 +3668,8 @@ Return the trampoline if found or nil otherwise." | |||
| 3668 | ;;;###autoload | 3668 | ;;;###autoload |
| 3669 | (defun comp-subr-trampoline-install (subr-name) | 3669 | (defun comp-subr-trampoline-install (subr-name) |
| 3670 | "Make SUBR-NAME effectively advice-able when called from native code." | 3670 | "Make SUBR-NAME effectively advice-able when called from native code." |
| 3671 | (unless (or (memq subr-name comp-never-optimize-functions) | 3671 | (unless (or (null comp-enable-subr-trampolines) |
| 3672 | (memq subr-name comp-never-optimize-functions) | ||
| 3672 | (gethash subr-name comp-installed-trampolines-h)) | 3673 | (gethash subr-name comp-installed-trampolines-h)) |
| 3673 | (cl-assert (subr-primitive-p (symbol-function subr-name))) | 3674 | (cl-assert (subr-primitive-p (symbol-function subr-name))) |
| 3674 | (comp--install-trampoline | 3675 | (comp--install-trampoline |
diff --git a/src/comp.c b/src/comp.c index 619f5e1b65f..b5adc3ed864 100644 --- a/src/comp.c +++ b/src/comp.c | |||
| @@ -1,5 +1,5 @@ | |||
| 1 | /* Compile elisp into native code. | 1 | /* Compile elisp into native code. |
| 2 | Copyright (C) 2019-2020 Free Software Foundation, Inc. | 2 | Copyright (C) 2019-2021 Free Software Foundation, Inc. |
| 3 | 3 | ||
| 4 | Author: Andrea Corallo <akrl@sdf.org> | 4 | Author: Andrea Corallo <akrl@sdf.org> |
| 5 | 5 | ||
| @@ -5269,8 +5269,8 @@ The last directory of this list is assumed to be the system one. */); | |||
| 5269 | Vcomp_eln_load_path = Fcons (build_string ("../native-lisp/"), Qnil); | 5269 | Vcomp_eln_load_path = Fcons (build_string ("../native-lisp/"), Qnil); |
| 5270 | 5270 | ||
| 5271 | DEFVAR_BOOL ("comp-enable-subr-trampolines", comp_enable_subr_trampolines, | 5271 | DEFVAR_BOOL ("comp-enable-subr-trampolines", comp_enable_subr_trampolines, |
| 5272 | doc: /* If non-nil, enable trampoline synthesis triggered by `fset'. | 5272 | doc: /* If non-nil enable primitive trampoline synthesis. |
| 5273 | This makes primitives redefinable effectively. */); | 5273 | This makes primitive functions redefinable or advisable effectively. */); |
| 5274 | 5274 | ||
| 5275 | DEFVAR_LISP ("comp-installed-trampolines-h", Vcomp_installed_trampolines_h, | 5275 | DEFVAR_LISP ("comp-installed-trampolines-h", Vcomp_installed_trampolines_h, |
| 5276 | doc: /* Hash table subr-name -> installed trampoline. | 5276 | doc: /* Hash table subr-name -> installed trampoline. |