From 37447209042e174f4e95c8d0166418d2aef018ed Mon Sep 17 00:00:00 2001 From: Andrea Corallo Date: Tue, 11 Oct 2022 21:17:55 +0200 Subject: Add trampoline AOT compilation target (bug#58318) * Makefile.in (trampolines): New target. * lisp/Makefile.in (trampolines): Likewise. * lisp/emacs-lisp/comp.el (comp-compile-all-trampolines): New function. --- lisp/emacs-lisp/comp.el | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'lisp/emacs-lisp/comp.el') diff --git a/lisp/emacs-lisp/comp.el b/lisp/emacs-lisp/comp.el index 6656b7e57c1..889bffa3f5c 100644 --- a/lisp/emacs-lisp/comp.el +++ b/lisp/emacs-lisp/comp.el @@ -4204,6 +4204,17 @@ bytecode definition was not changed in the meantime)." ;;; Compiler entry points. +(defun comp-compile-all-trampolines () + "Pre-compile AOT all trampolines." + (let ((comp-running-batch-compilation t) + ;; We want to target only the 'native-lisp' directory. + (native-compile-target-directory + (car (last native-comp-eln-load-path)))) + (mapatoms (lambda (f) + (when (subr-primitive-p (symbol-function f)) + (message "Compiling trampoline for: %s" f) + (comp-trampoline-compile f)))))) + ;;;###autoload (defun comp-lookup-eln (filename) "Given a Lisp source FILENAME return the corresponding .eln file if found. -- cgit v1.2.3