((equal dump-mode "bootstrap") "emacs")
((equal dump-mode "pbootstrap") "bootstrap-emacs.pdmp")
(t (error "unrecognized dump mode %s" dump-mode)))))
+ (when (and (boundp 'comp-ctxt)
+ (equal dump-mode "pdump"))
+ ;; Don't enable this before bootstrap is completed the as the
+ ;; compiler infrastructure may not be usable.
+ (setq comp-enable-subr-trampolines t))
(message "Dumping under the name %s" output)
(condition-case ()
(delete-file output)
DEFSYM (Qlate, "late");
DEFSYM (Qlambda_fixup, "lambda-fixup");
DEFSYM (Qgccjit, "gccjit");
+ DEFSYM (Qcomp_subr_trampoline_install, "comp-subr-trampoline-install")
/* To be signaled by the compiler. */
DEFSYM (Qnative_compiler_error, "native-compiler-error");
dump reload. */
Vcomp_eln_load_path = Fcons (build_string ("../native-lisp/"), Qnil);
+ DEFVAR_BOOL ("comp-enable-subr-trampolines", comp_enable_subr_trampolines,
+ doc: /* When non-nil enable trampoline synthesis
+ triggerd by `fset' making primitives
+ redefinable effectivelly. */);
+
DEFVAR_LISP ("comp-installed-trampolines-h", Vcomp_installed_trampolines_h,
doc: /* Hash table subr-name -> bool. */);
Vcomp_installed_trampolines_h = CALLN (Fmake_hash_table);
eassert (valid_lisp_object_p (definition));
+#ifdef HAVE_NATIVE_COMP
+ if (comp_enable_subr_trampolines
+ && SUBRP (function)
+ && !SUBR_NATIVE_COMPILEDP (function))
+ CALLN (Ffuncall, Qcomp_subr_trampoline_install, symbol);
+#endif
+
set_symbol_function (symbol, definition);
return definition;