]> git.eshelyaron.com Git - emacs.git/commitdiff
add basic compilation unit into structure
authorAndrea Corallo <akrl@sdf.org>
Thu, 19 Dec 2019 10:06:38 +0000 (11:06 +0100)
committerAndrea Corallo <akrl@sdf.org>
Wed, 1 Jan 2020 10:38:13 +0000 (11:38 +0100)
src/comp.c
src/data.c
src/lisp.h
src/pdumper.c

index ce2a542e7cfa1200543d60061ca31fe1a40c8ca9..79ece461a546c40e21b3362faeb647f1666d68d3 100644 (file)
@@ -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);
index 67613881d67f3f59c3be761f2025489f1c080f6a..0a13569bc6d99dacc1d0940e265097430d38f129 100644 (file)
@@ -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;
index d0f7a9720c060d118f10018e9f801d7258963f36..04f729f182a8eb78928eccc4957298fe1831bf00 100644 (file)
@@ -34,6 +34,10 @@ along with GNU Emacs.  If not, see <https://www.gnu.org/licenses/>.  */
 #include <intprops.h>
 #include <verify.h>
 
+#ifdef HAVE_NATIVE_COMP
+#include <dynlib.h>
+#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
index 38b70146b4fac4d289763b1162e4076a0c08503a..24698d48b57ee53253472f1dad6362e7e3f096ac 100644 (file)
@@ -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));
 }