summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrea Corallo <akrl@sdf.org>2019-12-07 18:19:00 +0100
committerAndrea Corallo <akrl@sdf.org>2020-01-01 11:38:12 +0100
commita248dfe2c3341ed73de38c2feea64ec12f053aaa (patch)
tree7b0f352051a5cfcfe889e4b8d654edfc68ba1a5e /src
parent48f5530e7922e4c46db1c4ab82b1c3532db724c9 (diff)
native compile interactive functions support
Diffstat (limited to 'src')
-rw-r--r--src/alloc.c4
-rw-r--r--src/comp.c6
-rw-r--r--src/data.c4
-rw-r--r--src/lisp.h9
4 files changed, 16 insertions, 7 deletions
diff --git a/src/alloc.c b/src/alloc.c
index 00da90464be..5ff0d907915 100644
--- a/src/alloc.c
+++ b/src/alloc.c
@@ -7450,14 +7450,14 @@ N should be nonnegative. */);
static union Aligned_Lisp_Subr Swatch_gc_cons_threshold =
{{{ PSEUDOVECTOR_FLAG | (PVEC_SUBR << PSEUDOVECTOR_AREA_BITS) },
{ .a4 = watch_gc_cons_threshold },
- 4, 4, "watch_gc_cons_threshold", 0, {0}}};
+ 4, 4, "watch_gc_cons_threshold", {0}, {0}, 0}};
XSETSUBR (watcher, &Swatch_gc_cons_threshold.s);
Fadd_variable_watcher (Qgc_cons_threshold, watcher);
static union Aligned_Lisp_Subr Swatch_gc_cons_percentage =
{{{ PSEUDOVECTOR_FLAG | (PVEC_SUBR << PSEUDOVECTOR_AREA_BITS) },
{ .a4 = watch_gc_cons_percentage },
- 4, 4, "watch_gc_cons_percentage", 0, {0}}};
+ 4, 4, "watch_gc_cons_percentage", {0}, {0}, 0}};
XSETSUBR (watcher, &Swatch_gc_cons_percentage.s);
Fadd_variable_watcher (Qgc_cons_percentage, watcher);
}
diff --git a/src/comp.c b/src/comp.c
index 5a00200ee87..a15bedf41aa 100644
--- a/src/comp.c
+++ b/src/comp.c
@@ -3304,11 +3304,11 @@ load_comp_unit (dynlib_handle_ptr handle, Lisp_Object file)
DEFUN ("comp--register-subr", Fcomp__register_subr,
Scomp__register_subr,
- 5, 5, 0,
+ 6, 6, 0,
doc: /* This gets called by top_level_run during load phase to register
each exported subr. */)
(Lisp_Object name, Lisp_Object minarg, Lisp_Object maxarg,
- Lisp_Object c_name, Lisp_Object doc)
+ Lisp_Object c_name, Lisp_Object doc, Lisp_Object intspec)
{
dynlib_handle_ptr handle = xmint_pointer (XCAR (load_handle_stack));
if (!handle)
@@ -3325,7 +3325,7 @@ DEFUN ("comp--register-subr", Fcomp__register_subr,
x->s.min_args = XFIXNUM (minarg);
x->s.max_args = FIXNUMP (maxarg) ? XFIXNUM (maxarg) : MANY;
x->s.symbol_name = xstrdup (SSDATA (Fsymbol_name (name)));
- x->s.intspec = NULL;
+ x->s.native_intspec = intspec;
x->s.native_doc = doc;
x->s.native_elisp = true;
defsubr (x);
diff --git a/src/data.c b/src/data.c
index 50dce9e4644..67613881d67 100644
--- a/src/data.c
+++ b/src/data.c
@@ -899,6 +899,10 @@ 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)
+ return XSUBR (fun)->native_intspec;
+#endif
const char *spec = XSUBR (fun)->intspec;
if (spec)
return list2 (Qinteractive,
diff --git a/src/lisp.h b/src/lisp.h
index 1c692933cdb..56aa7b151e6 100644
--- a/src/lisp.h
+++ b/src/lisp.h
@@ -2086,7 +2086,12 @@ struct Lisp_Subr
} function;
short min_args, max_args;
const char *symbol_name;
- const char *intspec;
+ union {
+ const char *intspec;
+#ifdef HAVE_NATIVE_COMP
+ Lisp_Object native_intspec;
+#endif
+ };
union {
EMACS_INT doc;
#ifdef HAVE_NATIVE_COMP
@@ -3106,7 +3111,7 @@ CHECK_INTEGER (Lisp_Object x)
static union Aligned_Lisp_Subr sname = \
{{{ PVEC_SUBR << PSEUDOVECTOR_AREA_BITS }, \
{ .a ## maxargs = fnname }, \
- minargs, maxargs, lname, intspec, {0}}}; \
+ minargs, maxargs, lname, {intspec}, {0}, 0}}; \
Lisp_Object fnname
/* defsubr (Sname);