diff options
| author | Alan Mackenzie | 2019-04-05 12:18:53 +0000 |
|---|---|---|
| committer | Alan Mackenzie | 2019-04-05 12:18:53 +0000 |
| commit | b071398ba3e8031fe8284f2aed95d714cd3c92af (patch) | |
| tree | d27dd7d78dfff9a8b28778bee260dbbdf6c10e1d /src/lisp.h | |
| parent | 8a23e8717008d31b4648c999c7a417f4729d239f (diff) | |
| download | emacs-scratch/accurate-warning-pos.tar.gz emacs-scratch/accurate-warning-pos.zip | |
Enhance struct Lisp_Subr to hold the alternative "BC_" function.scratch/accurate-warning-pos
Also fix a GC bug, where symbols with position were not being disabled.
* src/lisp.h (union Lisp_Function): New type.
(struct Lisp_Subr): Add fields normal_function, BC_function, and next.
(DEFUN): Setup all three function fields to the subr (BC_function is still a
dummy), set field next to NULL.
* src/alloc.c (Fgarbage_collect): Move the binding of
Qsymbols_with_pos_enabled to garbage_collect_1 so that it gets bound when GC
is invoked via garbage_collect.
* src/lread.c (subr_ptr, using_BC_subrs): New static variables.
(Fswitch_to_BC_subrs, Fswitch_to_normal_subrs): New defuns.
(defsubr): Chain new subr to previous using field next and variable subr_ptr.
(init_lread): Initialise subr_ptr to NULL.
(syms_of_lread): Create subrs Sswitch_to_BC_subrs and Sswitch_to_normal_subrs.
* src/pdumper.c (dump_subr): Enhance to dump struct Lisp_Subr's new fields.
Update the expected value of HASH_Lisp_Subr_xxxxxxxxxx.
(dump_vectorlike): Also dump PVEC_SYMBOL_WITH_POSes.
Diffstat (limited to 'src/lisp.h')
| -rw-r--r-- | src/lisp.h | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/src/lisp.h b/src/lisp.h index 3324dac98f6..a22043026ad 100644 --- a/src/lisp.h +++ b/src/lisp.h | |||
| @@ -2127,10 +2127,7 @@ CHAR_TABLE_SET (Lisp_Object ct, int idx, Lisp_Object val) | |||
| 2127 | It is generated by the DEFUN macro only. | 2127 | It is generated by the DEFUN macro only. |
| 2128 | defsubr makes it into a Lisp object. */ | 2128 | defsubr makes it into a Lisp object. */ |
| 2129 | 2129 | ||
| 2130 | struct Lisp_Subr | 2130 | union Lisp_Function { |
| 2131 | { | ||
| 2132 | union vectorlike_header header; | ||
| 2133 | union { | ||
| 2134 | Lisp_Object (*a0) (void); | 2131 | Lisp_Object (*a0) (void); |
| 2135 | Lisp_Object (*a1) (Lisp_Object); | 2132 | Lisp_Object (*a1) (Lisp_Object); |
| 2136 | Lisp_Object (*a2) (Lisp_Object, Lisp_Object); | 2133 | Lisp_Object (*a2) (Lisp_Object, Lisp_Object); |
| @@ -2142,10 +2139,18 @@ struct Lisp_Subr | |||
| 2142 | Lisp_Object (*a8) (Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object); | 2139 | Lisp_Object (*a8) (Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object); |
| 2143 | Lisp_Object (*aUNEVALLED) (Lisp_Object args); | 2140 | Lisp_Object (*aUNEVALLED) (Lisp_Object args); |
| 2144 | Lisp_Object (*aMANY) (ptrdiff_t, Lisp_Object *); | 2141 | Lisp_Object (*aMANY) (ptrdiff_t, Lisp_Object *); |
| 2145 | } function; | 2142 | }; |
| 2143 | |||
| 2144 | struct Lisp_Subr | ||
| 2145 | { | ||
| 2146 | union vectorlike_header header; | ||
| 2147 | union Lisp_Function function; | ||
| 2148 | union Lisp_Function normal_function; | ||
| 2149 | union Lisp_Function BC_function; | ||
| 2146 | short min_args, max_args; | 2150 | short min_args, max_args; |
| 2147 | const char *symbol_name; | 2151 | const char *symbol_name; |
| 2148 | const char *intspec; | 2152 | const char *intspec; |
| 2153 | union Aligned_Lisp_Subr *next; | ||
| 2149 | EMACS_INT doc; | 2154 | EMACS_INT doc; |
| 2150 | } GCALIGNED_STRUCT; | 2155 | } GCALIGNED_STRUCT; |
| 2151 | union Aligned_Lisp_Subr | 2156 | union Aligned_Lisp_Subr |
| @@ -3162,7 +3167,11 @@ CHECK_INTEGER (Lisp_Object x) | |||
| 3162 | static union Aligned_Lisp_Subr sname = \ | 3167 | static union Aligned_Lisp_Subr sname = \ |
| 3163 | {{{ PVEC_SUBR << PSEUDOVECTOR_AREA_BITS }, \ | 3168 | {{{ PVEC_SUBR << PSEUDOVECTOR_AREA_BITS }, \ |
| 3164 | { .a ## maxargs = fnname }, \ | 3169 | { .a ## maxargs = fnname }, \ |
| 3165 | minargs, maxargs, lname, intspec, 0}}; \ | 3170 | { .a ## maxargs = fnname }, \ |
| 3171 | { .a ## maxargs = /* BC_ ## */fnname }, \ | ||
| 3172 | minargs, maxargs, lname, intspec, \ | ||
| 3173 | NULL, \ | ||
| 3174 | 0}}; \ | ||
| 3166 | Lisp_Object fnname | 3175 | Lisp_Object fnname |
| 3167 | 3176 | ||
| 3168 | /* defsubr (Sname); | 3177 | /* defsubr (Sname); |