aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAndrea Corallo2019-12-19 11:06:38 +0100
committerAndrea Corallo2020-01-01 11:38:13 +0100
commitb3cbdfc86474932e4ef8d1237ed100a6f4f4c854 (patch)
tree000694222e8dbb47e9385e47669269007df24836 /src
parenta647a97320e72db275a05961ae09e487ee3063e2 (diff)
downloademacs-b3cbdfc86474932e4ef8d1237ed100a6f4f4c854.tar.gz
emacs-b3cbdfc86474932e4ef8d1237ed100a6f4f4c854.zip
add basic compilation unit into structure
Diffstat (limited to 'src')
-rw-r--r--src/comp.c1
-rw-r--r--src/data.c4
-rw-r--r--src/lisp.h11
-rw-r--r--src/pdumper.c2
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,
3280 x->s.symbol_name = xstrdup (SSDATA (Fsymbol_name (name))); 3280 x->s.symbol_name = xstrdup (SSDATA (Fsymbol_name (name)));
3281 x->s.native_intspec = intspec; 3281 x->s.native_intspec = intspec;
3282 x->s.native_doc = doc; 3282 x->s.native_doc = doc;
3283 x->s.native_elisp = true;
3284 XSETPVECTYPE (&x->s, PVEC_SUBR); 3283 XSETPVECTYPE (&x->s, PVEC_SUBR);
3285 Lisp_Object tem; 3284 Lisp_Object tem;
3286 XSETSUBR (tem, &x->s); 3285 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,
870nil otherwise. */) 870nil otherwise. */)
871 (Lisp_Object object) 871 (Lisp_Object object)
872{ 872{
873 return (SUBRP (object) && XSUBR (object)->native_elisp) ? Qt : Qnil; 873 return (SUBRP (object) && XSUBR (object)->native_comp_u) ? Qt : Qnil;
874} 874}
875#endif 875#endif
876 876
@@ -900,7 +900,7 @@ Value, if non-nil, is a list (interactive SPEC). */)
900 if (SUBRP (fun)) 900 if (SUBRP (fun))
901 { 901 {
902#ifdef HAVE_NATIVE_COMP 902#ifdef HAVE_NATIVE_COMP
903 if (XSUBR (fun)->native_elisp && XSUBR (fun)->native_intspec) 903 if (XSUBR (fun)->native_comp_u && XSUBR (fun)->native_intspec)
904 return XSUBR (fun)->native_intspec; 904 return XSUBR (fun)->native_intspec;
905#endif 905#endif
906 const char *spec = XSUBR (fun)->intspec; 906 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 <https://www.gnu.org/licenses/>. */
34#include <intprops.h> 34#include <intprops.h>
35#include <verify.h> 35#include <verify.h>
36 36
37#ifdef HAVE_NATIVE_COMP
38#include <dynlib.h>
39#endif
40
37INLINE_HEADER_BEGIN 41INLINE_HEADER_BEGIN
38 42
39/* Define a TYPE constant ID as an externally visible name. Use like this: 43/* 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)
2064 char_table_set (ct, idx, val); 2068 char_table_set (ct, idx, val);
2065} 2069}
2066 2070
2071struct Native_Compilation_Unit
2072{
2073 dynlib_handle_ptr handle;
2074};
2075
2067/* This structure describes a built-in function. 2076/* This structure describes a built-in function.
2068 It is generated by the DEFUN macro only. 2077 It is generated by the DEFUN macro only.
2069 defsubr makes it into a Lisp object. */ 2078 defsubr makes it into a Lisp object. */
@@ -2095,7 +2104,7 @@ struct Lisp_Subr
2095 Lisp_Object native_doc; 2104 Lisp_Object native_doc;
2096 }; 2105 };
2097#ifdef HAVE_NATIVE_COMP 2106#ifdef HAVE_NATIVE_COMP
2098 bool native_elisp; 2107 struct Native_Compilation_Unit *native_comp_u;;
2099#endif 2108#endif
2100 } GCALIGNED_STRUCT; 2109 } GCALIGNED_STRUCT;
2101union Aligned_Lisp_Subr 2110union 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)
2938 dump_field_emacs_ptr (ctx, &out, subr, &subr->intspec); 2938 dump_field_emacs_ptr (ctx, &out, subr, &subr->intspec);
2939 DUMP_FIELD_COPY (&out, subr, doc); 2939 DUMP_FIELD_COPY (&out, subr, doc);
2940#ifdef HAVE_NATIVE_COMP 2940#ifdef HAVE_NATIVE_COMP
2941 DUMP_FIELD_COPY (&out, subr, native_elisp); 2941 dump_field_emacs_ptr (ctx, &out, subr, &subr->native_comp_u);
2942#endif 2942#endif
2943 return dump_object_finish (ctx, &out, sizeof (out)); 2943 return dump_object_finish (ctx, &out, sizeof (out));
2944} 2944}