;;;###autoload
(defun comp--subr-safe-advice (subr-name)
"Make SUBR-NAME effectively advice-able when called from native code."
- (unless (memq subr-name comp-never-optimize-functions)
+ (unless (or (memq subr-name comp-never-optimize-functions)
+ (gethash subr-name comp-installed-trampolines-h))
(let ((trampoline-sym (comp-trampoline-sym subr-name)))
(cl-assert (subr-primitive-p (symbol-function subr-name)))
(load (or (comp-search-trampoline subr-name)
if (EQ (subr, orig_subr))
{
freloc.link_table[i] = XSUBR (trampoline)->function.a0;
+ Fputhash (subr_name, Qt, Vcomp_installed_trampolines_h);
return Qt;
}
i++;
dump reload. */
Vcomp_eln_load_path = Fcons (build_string ("../native-lisp/"), Qnil);
+ DEFVAR_LISP ("comp-installed-trampolines-h", Vcomp_installed_trampolines_h,
+ doc: /* Hash table subr-name -> bool. */);
+ Vcomp_installed_trampolines_h = CALLN (Fmake_hash_table);
+
#endif /* #ifdef HAVE_NATIVE_COMP */
defsubr (&Snative_comp_available_p);