From: Andrea Corallo Date: Sun, 17 Jan 2021 15:50:16 +0000 (+0100) Subject: Make `comp-enable-subr-trampolines' effective for advices (bug#45854) X-Git-Tag: emacs-28.0.90~2727^2~166 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=883d937320a8be2bdc6d0ab7b5dd9551cbfeebd4;p=emacs.git 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'. --- 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." ;;;###autoload (defun comp-subr-trampoline-install (subr-name) "Make SUBR-NAME effectively advice-able when called from native code." - (unless (or (memq subr-name comp-never-optimize-functions) + (unless (or (null comp-enable-subr-trampolines) + (memq subr-name comp-never-optimize-functions) (gethash subr-name comp-installed-trampolines-h)) (cl-assert (subr-primitive-p (symbol-function subr-name))) (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 @@ /* Compile elisp into native code. - Copyright (C) 2019-2020 Free Software Foundation, Inc. + Copyright (C) 2019-2021 Free Software Foundation, Inc. Author: Andrea Corallo @@ -5269,8 +5269,8 @@ The last directory of this list is assumed to be the system one. */); Vcomp_eln_load_path = Fcons (build_string ("../native-lisp/"), Qnil); DEFVAR_BOOL ("comp-enable-subr-trampolines", comp_enable_subr_trampolines, - doc: /* If non-nil, enable trampoline synthesis triggered by `fset'. -This makes primitives redefinable effectively. */); + doc: /* If non-nil enable primitive trampoline synthesis. +This makes primitive functions redefinable or advisable effectively. */); DEFVAR_LISP ("comp-installed-trampolines-h", Vcomp_installed_trampolines_h, doc: /* Hash table subr-name -> installed trampoline.