diff options
| author | Andrea Corallo | 2019-12-07 18:19:00 +0100 |
|---|---|---|
| committer | Andrea Corallo | 2020-01-01 11:38:12 +0100 |
| commit | a248dfe2c3341ed73de38c2feea64ec12f053aaa (patch) | |
| tree | 7b0f352051a5cfcfe889e4b8d654edfc68ba1a5e /src | |
| parent | 48f5530e7922e4c46db1c4ab82b1c3532db724c9 (diff) | |
| download | emacs-a248dfe2c3341ed73de38c2feea64ec12f053aaa.tar.gz emacs-a248dfe2c3341ed73de38c2feea64ec12f053aaa.zip | |
native compile interactive functions support
Diffstat (limited to 'src')
| -rw-r--r-- | src/alloc.c | 4 | ||||
| -rw-r--r-- | src/comp.c | 6 | ||||
| -rw-r--r-- | src/data.c | 4 | ||||
| -rw-r--r-- | src/lisp.h | 9 |
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. */); | |||
| 7450 | static union Aligned_Lisp_Subr Swatch_gc_cons_threshold = | 7450 | static union Aligned_Lisp_Subr Swatch_gc_cons_threshold = |
| 7451 | {{{ PSEUDOVECTOR_FLAG | (PVEC_SUBR << PSEUDOVECTOR_AREA_BITS) }, | 7451 | {{{ PSEUDOVECTOR_FLAG | (PVEC_SUBR << PSEUDOVECTOR_AREA_BITS) }, |
| 7452 | { .a4 = watch_gc_cons_threshold }, | 7452 | { .a4 = watch_gc_cons_threshold }, |
| 7453 | 4, 4, "watch_gc_cons_threshold", 0, {0}}}; | 7453 | 4, 4, "watch_gc_cons_threshold", {0}, {0}, 0}}; |
| 7454 | XSETSUBR (watcher, &Swatch_gc_cons_threshold.s); | 7454 | XSETSUBR (watcher, &Swatch_gc_cons_threshold.s); |
| 7455 | Fadd_variable_watcher (Qgc_cons_threshold, watcher); | 7455 | Fadd_variable_watcher (Qgc_cons_threshold, watcher); |
| 7456 | 7456 | ||
| 7457 | static union Aligned_Lisp_Subr Swatch_gc_cons_percentage = | 7457 | static union Aligned_Lisp_Subr Swatch_gc_cons_percentage = |
| 7458 | {{{ PSEUDOVECTOR_FLAG | (PVEC_SUBR << PSEUDOVECTOR_AREA_BITS) }, | 7458 | {{{ PSEUDOVECTOR_FLAG | (PVEC_SUBR << PSEUDOVECTOR_AREA_BITS) }, |
| 7459 | { .a4 = watch_gc_cons_percentage }, | 7459 | { .a4 = watch_gc_cons_percentage }, |
| 7460 | 4, 4, "watch_gc_cons_percentage", 0, {0}}}; | 7460 | 4, 4, "watch_gc_cons_percentage", {0}, {0}, 0}}; |
| 7461 | XSETSUBR (watcher, &Swatch_gc_cons_percentage.s); | 7461 | XSETSUBR (watcher, &Swatch_gc_cons_percentage.s); |
| 7462 | Fadd_variable_watcher (Qgc_cons_percentage, watcher); | 7462 | Fadd_variable_watcher (Qgc_cons_percentage, watcher); |
| 7463 | } | 7463 | } |
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) | |||
| 3304 | 3304 | ||
| 3305 | DEFUN ("comp--register-subr", Fcomp__register_subr, | 3305 | DEFUN ("comp--register-subr", Fcomp__register_subr, |
| 3306 | Scomp__register_subr, | 3306 | Scomp__register_subr, |
| 3307 | 5, 5, 0, | 3307 | 6, 6, 0, |
| 3308 | doc: /* This gets called by top_level_run during load phase to register | 3308 | doc: /* This gets called by top_level_run during load phase to register |
| 3309 | each exported subr. */) | 3309 | each exported subr. */) |
| 3310 | (Lisp_Object name, Lisp_Object minarg, Lisp_Object maxarg, | 3310 | (Lisp_Object name, Lisp_Object minarg, Lisp_Object maxarg, |
| 3311 | Lisp_Object c_name, Lisp_Object doc) | 3311 | Lisp_Object c_name, Lisp_Object doc, Lisp_Object intspec) |
| 3312 | { | 3312 | { |
| 3313 | dynlib_handle_ptr handle = xmint_pointer (XCAR (load_handle_stack)); | 3313 | dynlib_handle_ptr handle = xmint_pointer (XCAR (load_handle_stack)); |
| 3314 | if (!handle) | 3314 | if (!handle) |
| @@ -3325,7 +3325,7 @@ DEFUN ("comp--register-subr", Fcomp__register_subr, | |||
| 3325 | x->s.min_args = XFIXNUM (minarg); | 3325 | x->s.min_args = XFIXNUM (minarg); |
| 3326 | x->s.max_args = FIXNUMP (maxarg) ? XFIXNUM (maxarg) : MANY; | 3326 | x->s.max_args = FIXNUMP (maxarg) ? XFIXNUM (maxarg) : MANY; |
| 3327 | x->s.symbol_name = xstrdup (SSDATA (Fsymbol_name (name))); | 3327 | x->s.symbol_name = xstrdup (SSDATA (Fsymbol_name (name))); |
| 3328 | x->s.intspec = NULL; | 3328 | x->s.native_intspec = intspec; |
| 3329 | x->s.native_doc = doc; | 3329 | x->s.native_doc = doc; |
| 3330 | x->s.native_elisp = true; | 3330 | x->s.native_elisp = true; |
| 3331 | defsubr (x); | 3331 | 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). */) | |||
| 899 | 899 | ||
| 900 | if (SUBRP (fun)) | 900 | if (SUBRP (fun)) |
| 901 | { | 901 | { |
| 902 | #ifdef HAVE_NATIVE_COMP | ||
| 903 | if (XSUBR (fun)->native_elisp && XSUBR (fun)->native_intspec) | ||
| 904 | return XSUBR (fun)->native_intspec; | ||
| 905 | #endif | ||
| 902 | const char *spec = XSUBR (fun)->intspec; | 906 | const char *spec = XSUBR (fun)->intspec; |
| 903 | if (spec) | 907 | if (spec) |
| 904 | return list2 (Qinteractive, | 908 | 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 | |||
| 2086 | } function; | 2086 | } function; |
| 2087 | short min_args, max_args; | 2087 | short min_args, max_args; |
| 2088 | const char *symbol_name; | 2088 | const char *symbol_name; |
| 2089 | const char *intspec; | 2089 | union { |
| 2090 | const char *intspec; | ||
| 2091 | #ifdef HAVE_NATIVE_COMP | ||
| 2092 | Lisp_Object native_intspec; | ||
| 2093 | #endif | ||
| 2094 | }; | ||
| 2090 | union { | 2095 | union { |
| 2091 | EMACS_INT doc; | 2096 | EMACS_INT doc; |
| 2092 | #ifdef HAVE_NATIVE_COMP | 2097 | #ifdef HAVE_NATIVE_COMP |
| @@ -3106,7 +3111,7 @@ CHECK_INTEGER (Lisp_Object x) | |||
| 3106 | static union Aligned_Lisp_Subr sname = \ | 3111 | static union Aligned_Lisp_Subr sname = \ |
| 3107 | {{{ PVEC_SUBR << PSEUDOVECTOR_AREA_BITS }, \ | 3112 | {{{ PVEC_SUBR << PSEUDOVECTOR_AREA_BITS }, \ |
| 3108 | { .a ## maxargs = fnname }, \ | 3113 | { .a ## maxargs = fnname }, \ |
| 3109 | minargs, maxargs, lname, intspec, {0}}}; \ | 3114 | minargs, maxargs, lname, {intspec}, {0}, 0}}; \ |
| 3110 | Lisp_Object fnname | 3115 | Lisp_Object fnname |
| 3111 | 3116 | ||
| 3112 | /* defsubr (Sname); | 3117 | /* defsubr (Sname); |