1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-01-30 12:21:25 -08:00

add basic compilation unit into structure

This commit is contained in:
Andrea Corallo 2019-12-19 11:06:38 +01:00
parent a647a97320
commit b3cbdfc864
4 changed files with 13 additions and 5 deletions

View 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);

View 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;

View 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

View 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));
}