diff options
| author | Andrea Corallo | 2020-06-11 22:22:00 +0200 |
|---|---|---|
| committer | Andrea Corallo | 2020-06-11 22:22:00 +0200 |
| commit | 506febd5e72b0cd48acdf8887fb95701004b6e43 (patch) | |
| tree | 85a2fd33001c7056bc7cf15c438fc64c7716cac3 /src/comp.c | |
| parent | dd939d7484adad7735e66b1759283d00df708e70 (diff) | |
| download | emacs-506febd5e72b0cd48acdf8887fb95701004b6e43.tar.gz emacs-506febd5e72b0cd48acdf8887fb95701004b6e43.zip | |
Remove `Vcomp_sym_subr_c_name_h'
Given there's no more unique relation symbol-name -> c-name remove
`Vcomp_sym_subr_c_name_h' and store the c_name directly in struct
Lisp_Subr. The old approach would have failed dumping two functions
with the same symbol-name.
* src/lisp.h (struct Lisp_Subr): Add 'native_c_name' field.
* src/pdumper.c (dump_subr): Update hash + dump 'native_c_name'.
(dump_cold_native_subr): dump 'native_c_name'.
(dump_do_dump_relocation): Update logic for reviving using
'native_c_name'.
* src/comp.c (make_subr): Update for 'native_c_name' field.
(Fcomp__register_lambda, Fcomp__register_subr): Clean-up code for
'Vcomp_sym_subr_c_name_h' removal.
(syms_of_comp): Remove 'Vcomp_sym_subr_c_name_h'.
Diffstat (limited to 'src/comp.c')
| -rw-r--r-- | src/comp.c | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/src/comp.c b/src/comp.c index af61d76d46d..0f7c04129b3 100644 --- a/src/comp.c +++ b/src/comp.c | |||
| @@ -4567,6 +4567,7 @@ make_subr (Lisp_Object symbol_name, Lisp_Object minarg, Lisp_Object maxarg, | |||
| 4567 | x->s.native_intspec = intspec; | 4567 | x->s.native_intspec = intspec; |
| 4568 | x->s.doc = XFIXNUM (doc_idx); | 4568 | x->s.doc = XFIXNUM (doc_idx); |
| 4569 | x->s.native_comp_u[0] = comp_u; | 4569 | x->s.native_comp_u[0] = comp_u; |
| 4570 | x->s.native_c_name[0] = xstrdup (SSDATA (c_name)); | ||
| 4570 | Lisp_Object tem; | 4571 | Lisp_Object tem; |
| 4571 | XSETSUBR (tem, &x->s); | 4572 | XSETSUBR (tem, &x->s); |
| 4572 | 4573 | ||
| @@ -4595,9 +4596,6 @@ DEFUN ("comp--register-lambda", Fcomp__register_lambda, Scomp__register_lambda, | |||
| 4595 | from dump. See 'dump_do_dump_relocation'. */ | 4596 | from dump. See 'dump_do_dump_relocation'. */ |
| 4596 | eassert (NILP (Fgethash (c_name, cu->lambda_c_name_idx_h, Qnil))); | 4597 | eassert (NILP (Fgethash (c_name, cu->lambda_c_name_idx_h, Qnil))); |
| 4597 | Fputhash (c_name, reloc_idx, cu->lambda_c_name_idx_h); | 4598 | Fputhash (c_name, reloc_idx, cu->lambda_c_name_idx_h); |
| 4598 | /* The key is not really important as long is the same as | ||
| 4599 | symbol_name so use c_name. */ | ||
| 4600 | Fputhash (Fintern (c_name, Qnil), c_name, Vcomp_sym_subr_c_name_h); | ||
| 4601 | /* Do the real relocation fixup. */ | 4599 | /* Do the real relocation fixup. */ |
| 4602 | cu->data_imp_relocs[XFIXNUM (reloc_idx)] = tem; | 4600 | cu->data_imp_relocs[XFIXNUM (reloc_idx)] = tem; |
| 4603 | 4601 | ||
| @@ -4618,7 +4616,6 @@ DEFUN ("comp--register-subr", Fcomp__register_subr, Scomp__register_subr, | |||
| 4618 | 4616 | ||
| 4619 | set_symbol_function (name, tem); | 4617 | set_symbol_function (name, tem); |
| 4620 | LOADHIST_ATTACH (Fcons (Qdefun, name)); | 4618 | LOADHIST_ATTACH (Fcons (Qdefun, name)); |
| 4621 | Fputhash (name, c_name, Vcomp_sym_subr_c_name_h); | ||
| 4622 | 4619 | ||
| 4623 | return tem; | 4620 | return tem; |
| 4624 | } | 4621 | } |
| @@ -4820,10 +4817,6 @@ syms_of_comp (void) | |||
| 4820 | to be necessarily exposed to lisp but can easy debug for now. */ | 4817 | to be necessarily exposed to lisp but can easy debug for now. */ |
| 4821 | DEFVAR_LISP ("comp-subr-list", Vcomp_subr_list, | 4818 | DEFVAR_LISP ("comp-subr-list", Vcomp_subr_list, |
| 4822 | doc: /* List of all defined subrs. */); | 4819 | doc: /* List of all defined subrs. */); |
| 4823 | DEFVAR_LISP ("comp-sym-subr-c-name-h", Vcomp_sym_subr_c_name_h, | ||
| 4824 | doc: /* Hash table symbol-function -> function-c-name. For | ||
| 4825 | internal use during dump reload */); | ||
| 4826 | Vcomp_sym_subr_c_name_h = CALLN (Fmake_hash_table, QCtest, Qeq); | ||
| 4827 | DEFVAR_LISP ("comp-abi-hash", Vcomp_abi_hash, | 4820 | DEFVAR_LISP ("comp-abi-hash", Vcomp_abi_hash, |
| 4828 | doc: /* String signing the ABI exposed to .eln files. */); | 4821 | doc: /* String signing the ABI exposed to .eln files. */); |
| 4829 | Vcomp_abi_hash = Qnil; | 4822 | Vcomp_abi_hash = Qnil; |