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/pdumper.c | |
| 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/pdumper.c')
| -rw-r--r-- | src/pdumper.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/pdumper.c b/src/pdumper.c index a9b3732a2d4..59cd824142d 100644 --- a/src/pdumper.c +++ b/src/pdumper.c | |||
| @@ -2914,17 +2914,20 @@ dump_bool_vector (struct dump_context *ctx, const struct Lisp_Vector *v) | |||
| 2914 | static dump_off | 2914 | static dump_off |
| 2915 | dump_subr (struct dump_context *ctx, const struct Lisp_Subr *subr) | 2915 | dump_subr (struct dump_context *ctx, const struct Lisp_Subr *subr) |
| 2916 | { | 2916 | { |
| 2917 | #if CHECK_STRUCTS && !defined (HASH_Lisp_Subr_594AB72B54) | 2917 | #if CHECK_STRUCTS && !defined (HASH_Lisp_Subr_6AE56C1912) |
| 2918 | # error "Lisp_Subr changed. See CHECK_STRUCTS comment." | 2918 | # error "Lisp_Subr changed. See CHECK_STRUCTS comment." |
| 2919 | #endif | 2919 | #endif |
| 2920 | struct Lisp_Subr out; | 2920 | struct Lisp_Subr out; |
| 2921 | dump_object_start (ctx, &out, sizeof (out)); | 2921 | dump_object_start (ctx, &out, sizeof (out)); |
| 2922 | DUMP_FIELD_COPY (&out, subr, header.size); | 2922 | DUMP_FIELD_COPY (&out, subr, header.size); |
| 2923 | dump_field_emacs_ptr (ctx, &out, subr, &subr->function.a0); | 2923 | dump_field_emacs_ptr (ctx, &out, subr, &subr->function.a0); |
| 2924 | dump_field_emacs_ptr (ctx, &out, subr, &subr->normal_function.a0); | ||
| 2925 | dump_field_emacs_ptr (ctx, &out, subr, &subr->BC_function.a0); | ||
| 2924 | DUMP_FIELD_COPY (&out, subr, min_args); | 2926 | DUMP_FIELD_COPY (&out, subr, min_args); |
| 2925 | DUMP_FIELD_COPY (&out, subr, max_args); | 2927 | DUMP_FIELD_COPY (&out, subr, max_args); |
| 2926 | dump_field_emacs_ptr (ctx, &out, subr, &subr->symbol_name); | 2928 | dump_field_emacs_ptr (ctx, &out, subr, &subr->symbol_name); |
| 2927 | dump_field_emacs_ptr (ctx, &out, subr, &subr->intspec); | 2929 | dump_field_emacs_ptr (ctx, &out, subr, &subr->intspec); |
| 2930 | dump_field_emacs_ptr (ctx, &out, subr, &subr->next); | ||
| 2928 | DUMP_FIELD_COPY (&out, subr, doc); | 2931 | DUMP_FIELD_COPY (&out, subr, doc); |
| 2929 | return dump_object_finish (ctx, &out, sizeof (out)); | 2932 | return dump_object_finish (ctx, &out, sizeof (out)); |
| 2930 | } | 2933 | } |
| @@ -2953,7 +2956,7 @@ dump_vectorlike (struct dump_context *ctx, | |||
| 2953 | Lisp_Object lv, | 2956 | Lisp_Object lv, |
| 2954 | dump_off offset) | 2957 | dump_off offset) |
| 2955 | { | 2958 | { |
| 2956 | #if CHECK_STRUCTS && !defined (HASH_pvec_type_549C833A54) | 2959 | #if CHECK_STRUCTS && !defined (HASH_pvec_type_3C7A719153) |
| 2957 | # error "pvec_type changed. See CHECK_STRUCTS comment." | 2960 | # error "pvec_type changed. See CHECK_STRUCTS comment." |
| 2958 | #endif | 2961 | #endif |
| 2959 | const struct Lisp_Vector *v = XVECTOR (lv); | 2962 | const struct Lisp_Vector *v = XVECTOR (lv); |
| @@ -2974,6 +2977,7 @@ dump_vectorlike (struct dump_context *ctx, | |||
| 2974 | case PVEC_CHAR_TABLE: | 2977 | case PVEC_CHAR_TABLE: |
| 2975 | case PVEC_SUB_CHAR_TABLE: | 2978 | case PVEC_SUB_CHAR_TABLE: |
| 2976 | case PVEC_RECORD: | 2979 | case PVEC_RECORD: |
| 2980 | case PVEC_SYMBOL_WITH_POS: | ||
| 2977 | offset = dump_vectorlike_generic (ctx, &v->header); | 2981 | offset = dump_vectorlike_generic (ctx, &v->header); |
| 2978 | break; | 2982 | break; |
| 2979 | case PVEC_BOOL_VECTOR: | 2983 | case PVEC_BOOL_VECTOR: |