diff options
| author | Andrea Corallo | 2023-02-13 11:09:46 +0100 |
|---|---|---|
| committer | Andrea Corallo | 2023-02-13 12:48:09 +0100 |
| commit | 1795839babcf8572a79aaee3c76ca5b357937a59 (patch) | |
| tree | e4f572276a12cc11cec8cac6e29864ce89ad3b0c /src | |
| parent | b6e2799aa1c3887c2995e115e6ff2f69d59f0e44 (diff) | |
| download | emacs-1795839babcf8572a79aaee3c76ca5b357937a59.tar.gz emacs-1795839babcf8572a79aaee3c76ca5b357937a59.zip | |
Support `comp-enable-subr-trampolines' as string value
* src/comp.c (syms_of_comp): Update `comp-enable-subr-trampolines'.
* lisp/emacs-lisp/comp.el (native-comp-never-optimize-functions)
(comp--trampoline-abs-filename): Support
`comp-enable-subr-trampolines' string value.
* src/data.c (Ffset): Use Vcomp_enable_subr_trampolines now.
Diffstat (limited to 'src')
| -rw-r--r-- | src/comp.c | 5 | ||||
| -rw-r--r-- | src/data.c | 2 |
2 files changed, 5 insertions, 2 deletions
diff --git a/src/comp.c b/src/comp.c index 7d67995fa87..82224845bff 100644 --- a/src/comp.c +++ b/src/comp.c | |||
| @@ -5858,12 +5858,15 @@ The last directory of this list is assumed to be the system one. */); | |||
| 5858 | dump reload. */ | 5858 | dump reload. */ |
| 5859 | Vnative_comp_eln_load_path = Fcons (build_string ("../native-lisp/"), Qnil); | 5859 | Vnative_comp_eln_load_path = Fcons (build_string ("../native-lisp/"), Qnil); |
| 5860 | 5860 | ||
| 5861 | DEFVAR_BOOL ("comp-enable-subr-trampolines", comp_enable_subr_trampolines, | 5861 | DEFVAR_LISP ("comp-enable-subr-trampolines", Vcomp_enable_subr_trampolines, |
| 5862 | doc: /* If non-nil, enable primitive trampoline synthesis. | 5862 | doc: /* If non-nil, enable primitive trampoline synthesis. |
| 5863 | This makes Emacs respect redefinition or advises of primitive functions | 5863 | This makes Emacs respect redefinition or advises of primitive functions |
| 5864 | when they are called from Lisp code natively-compiled at `native-comp-speed' | 5864 | when they are called from Lisp code natively-compiled at `native-comp-speed' |
| 5865 | of 2. | 5865 | of 2. |
| 5866 | 5866 | ||
| 5867 | If `comp-enable-subr-trampolines' is a string it specifies a directory | ||
| 5868 | in which to deposit the trampoline. | ||
| 5869 | |||
| 5867 | By default, this is enabled, and when Emacs sees a redefined or advised | 5870 | By default, this is enabled, and when Emacs sees a redefined or advised |
| 5868 | primitive called from natively-compiled Lisp, it generates a trampoline | 5871 | primitive called from natively-compiled Lisp, it generates a trampoline |
| 5869 | for it on-the-fly. | 5872 | for it on-the-fly. |
diff --git a/src/data.c b/src/data.c index bb4d1347d72..a43fa8991fe 100644 --- a/src/data.c +++ b/src/data.c | |||
| @@ -855,7 +855,7 @@ DEFUN ("fset", Ffset, Sfset, 2, 2, 0, | |||
| 855 | #ifdef HAVE_NATIVE_COMP | 855 | #ifdef HAVE_NATIVE_COMP |
| 856 | register Lisp_Object function = XSYMBOL (symbol)->u.s.function; | 856 | register Lisp_Object function = XSYMBOL (symbol)->u.s.function; |
| 857 | 857 | ||
| 858 | if (comp_enable_subr_trampolines | 858 | if (!NILP (Vcomp_enable_subr_trampolines) |
| 859 | && SUBRP (function) | 859 | && SUBRP (function) |
| 860 | && !SUBR_NATIVE_COMPILEDP (function)) | 860 | && !SUBR_NATIVE_COMPILEDP (function)) |
| 861 | CALLN (Ffuncall, Qcomp_subr_trampoline_install, symbol); | 861 | CALLN (Ffuncall, Qcomp_subr_trampoline_install, symbol); |