From b3cbdfc86474932e4ef8d1237ed100a6f4f4c854 Mon Sep 17 00:00:00 2001 From: Andrea Corallo Date: Thu, 19 Dec 2019 11:06:38 +0100 Subject: [PATCH] add basic compilation unit into structure --- src/comp.c | 1 - src/data.c | 4 ++-- src/lisp.h | 11 ++++++++++- src/pdumper.c | 2 +- 4 files changed, 13 insertions(+), 5 deletions(-) diff --git a/src/comp.c b/src/comp.c index ce2a542e7cf..79ece461a54 100644 --- a/src/comp.c +++ b/src/comp.c @@ -3280,7 +3280,6 @@ DEFUN ("comp--register-subr", Fcomp__register_subr, Scomp__register_subr, x->s.symbol_name = xstrdup (SSDATA (Fsymbol_name (name))); x->s.native_intspec = intspec; x->s.native_doc = doc; - x->s.native_elisp = true; XSETPVECTYPE (&x->s, PVEC_SUBR); Lisp_Object tem; XSETSUBR (tem, &x->s); diff --git a/src/data.c b/src/data.c index 67613881d67..0a13569bc6d 100644 --- a/src/data.c +++ b/src/data.c @@ -870,7 +870,7 @@ DEFUN ("subr-native-elisp-p", Fsubr_native_elisp_p, Ssubr_native_elisp_p, 1, 1, nil otherwise. */) (Lisp_Object object) { - return (SUBRP (object) && XSUBR (object)->native_elisp) ? Qt : Qnil; + return (SUBRP (object) && XSUBR (object)->native_comp_u) ? Qt : Qnil; } #endif @@ -900,7 +900,7 @@ Value, if non-nil, is a list (interactive SPEC). */) if (SUBRP (fun)) { #ifdef HAVE_NATIVE_COMP - if (XSUBR (fun)->native_elisp && XSUBR (fun)->native_intspec) + if (XSUBR (fun)->native_comp_u && XSUBR (fun)->native_intspec) return XSUBR (fun)->native_intspec; #endif const char *spec = XSUBR (fun)->intspec; diff --git a/src/lisp.h b/src/lisp.h index d0f7a9720c0..04f729f182a 100644 --- a/src/lisp.h +++ b/src/lisp.h @@ -34,6 +34,10 @@ along with GNU Emacs. If not, see . */ #include #include +#ifdef HAVE_NATIVE_COMP +#include +#endif + INLINE_HEADER_BEGIN /* Define a TYPE constant ID as an externally visible name. Use like this: @@ -2064,6 +2068,11 @@ CHAR_TABLE_SET (Lisp_Object ct, int idx, Lisp_Object val) char_table_set (ct, idx, val); } +struct Native_Compilation_Unit +{ + dynlib_handle_ptr handle; +}; + /* This structure describes a built-in function. It is generated by the DEFUN macro only. defsubr makes it into a Lisp object. */ @@ -2095,7 +2104,7 @@ struct Lisp_Subr Lisp_Object native_doc; }; #ifdef HAVE_NATIVE_COMP - bool native_elisp; + struct Native_Compilation_Unit *native_comp_u;; #endif } GCALIGNED_STRUCT; union Aligned_Lisp_Subr diff --git a/src/pdumper.c b/src/pdumper.c index 38b70146b4f..24698d48b57 100644 --- a/src/pdumper.c +++ b/src/pdumper.c @@ -2938,7 +2938,7 @@ dump_subr (struct dump_context *ctx, const struct Lisp_Subr *subr) dump_field_emacs_ptr (ctx, &out, subr, &subr->intspec); DUMP_FIELD_COPY (&out, subr, doc); #ifdef HAVE_NATIVE_COMP - DUMP_FIELD_COPY (&out, subr, native_elisp); + dump_field_emacs_ptr (ctx, &out, subr, &subr->native_comp_u); #endif return dump_object_finish (ctx, &out, sizeof (out)); } -- 2.39.5