From 03e98f93f72c8a158a3584355bca174e2c63dce6 Mon Sep 17 00:00:00 2001 From: Andrea Corallo Date: Tue, 13 Oct 2020 22:48:22 +0200 Subject: Use form native compilation in `comp-trampoline-compile' * lisp/emacs-lisp/comp.el (comp-trampoline-sym): Remove function. (comp-trampoline-filename): As we are introducing an ABI change in the eln trampoline format change the trampoline filename to disambiguate. (comp-trampoline-search): Rename from `comp-search-trampoline' and return directly the trampoline. (comp-trampoline-compile): Rework to use native form compilation in place of un-evaluating a function and return directly the trampoline. (comp-subr-trampoline-install): Update for `comp-trampoline-search' and `comp-trampoline-compile' new interfaces. * src/comp.c (Fcomp__install_trampoline): Store the trampoline itself as value in `comp-installed-trampolines-h'. (syms_of_comp): Doc update `comp-installed-trampolines-h'. --- src/comp.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/comp.c') diff --git a/src/comp.c b/src/comp.c index f80172e89bf..0c555578f81 100644 --- a/src/comp.c +++ b/src/comp.c @@ -4158,7 +4158,7 @@ DEFUN ("comp--install-trampoline", Fcomp__install_trampoline, if (EQ (subr, orig_subr)) { freloc.link_table[i] = XSUBR (trampoline)->function.a0; - Fputhash (subr_name, Qt, Vcomp_installed_trampolines_h); + Fputhash (subr_name, trampoline, Vcomp_installed_trampolines_h); return Qt; } i++; @@ -5296,7 +5296,9 @@ The last directory of this list is assumed to be the system one. */); redefinable effectivelly. */); DEFVAR_LISP ("comp-installed-trampolines-h", Vcomp_installed_trampolines_h, - doc: /* Hash table subr-name -> bool. */); + doc: /* Hash table subr-name -> installed trampoline. +This is used to prevent double trampoline instantiation but also to +protect the trampolines against GC. */); Vcomp_installed_trampolines_h = CALLN (Fmake_hash_table); Fprovide (intern_c_string ("nativecomp"), Qnil); -- cgit v1.2.1