diff options
| author | Andrea Corallo | 2020-04-25 16:13:03 +0100 |
|---|---|---|
| committer | Andrea Corallo | 2020-04-25 19:55:39 +0100 |
| commit | d73e64076e08cf0bcb81ea9d161fb7409e1bf896 (patch) | |
| tree | f07c3127f9cdc6ac97390460e6466ba7b81b4de0 /src/comp.c | |
| parent | 9c4c0af89d88f5b4a9124741f64915c5378f1283 (diff) | |
| download | emacs-d73e64076e08cf0bcb81ea9d161fb7409e1bf896.tar.gz emacs-d73e64076e08cf0bcb81ea9d161fb7409e1bf896.zip | |
Store function documentations in a hash table.
* src/pdumper.c (dump_subr): Update Lisp_Subr hash.
(dump_subr): Update for new compilation unit layout.
(dump_vectorlike): Update pvec_type hash.
* src/lisp.h (struct Lisp_Subr): Remove 'native_doc' index.
(DEFUN): Update macro for new compilation unit
layout.
* src/doc.c (Fdocumentation): Update for new compilation unit
layout.
* src/comp.h (struct Lisp_Native_Comp_Unit):
Add 'data_fdoc_h' field.
* src/comp.c (TEXT_FDOC_SYM): New macro.
(emit_ctxt_code): Emit function documentations.
(load_comp_unit): Load function documentation.
(Fcomp__register_subr): Rename parameter.
(Fcomp__register_subr): Update for new compilation unit
layout.
* src/alloc.c (mark_object): Update for new compilation unit
layout.
(syms_of_alloc): Likewise.
* lisp/emacs-lisp/comp.el (comp-ctxt): Add doc-index-h slot.
(comp-emit-for-top-level): Emit doc index as 'comp--register-subr'
doc parameter.
Diffstat (limited to 'src/comp.c')
| -rw-r--r-- | src/comp.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/comp.c b/src/comp.c index 4bd271402c2..2f59164b770 100644 --- a/src/comp.c +++ b/src/comp.c | |||
| @@ -41,13 +41,17 @@ along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. */ | |||
| 41 | #define DATA_RELOC_SYM "d_reloc" | 41 | #define DATA_RELOC_SYM "d_reloc" |
| 42 | #define DATA_RELOC_IMPURE_SYM "d_reloc_imp" | 42 | #define DATA_RELOC_IMPURE_SYM "d_reloc_imp" |
| 43 | #define DATA_RELOC_EPHEMERAL_SYM "d_reloc_eph" | 43 | #define DATA_RELOC_EPHEMERAL_SYM "d_reloc_eph" |
| 44 | |||
| 44 | #define FUNC_LINK_TABLE_SYM "freloc_link_table" | 45 | #define FUNC_LINK_TABLE_SYM "freloc_link_table" |
| 45 | #define LINK_TABLE_HASH_SYM "freloc_hash" | 46 | #define LINK_TABLE_HASH_SYM "freloc_hash" |
| 46 | #define COMP_UNIT_SYM "comp_unit" | 47 | #define COMP_UNIT_SYM "comp_unit" |
| 47 | #define TEXT_DATA_RELOC_SYM "text_data_reloc" | 48 | #define TEXT_DATA_RELOC_SYM "text_data_reloc" |
| 48 | #define TEXT_DATA_RELOC_IMPURE_SYM "text_data_reloc_imp" | 49 | #define TEXT_DATA_RELOC_IMPURE_SYM "text_data_reloc_imp" |
| 49 | #define TEXT_DATA_RELOC_EPHEMERAL_SYM "text_data_reloc_eph" | 50 | #define TEXT_DATA_RELOC_EPHEMERAL_SYM "text_data_reloc_eph" |
| 51 | |||
| 50 | #define TEXT_OPTIM_QLY "text_optim_qly" | 52 | #define TEXT_OPTIM_QLY "text_optim_qly" |
| 53 | #define TEXT_FDOC_SYM "text_data_fdoc" | ||
| 54 | |||
| 51 | 55 | ||
| 52 | #define SPEED XFIXNUM (Fsymbol_value (Qcomp_speed)) | 56 | #define SPEED XFIXNUM (Fsymbol_value (Qcomp_speed)) |
| 53 | #define COMP_DEBUG XFIXNUM (Fsymbol_value (Qcomp_debug)) | 57 | #define COMP_DEBUG XFIXNUM (Fsymbol_value (Qcomp_debug)) |
| @@ -2097,6 +2101,9 @@ emit_ctxt_code (void) | |||
| 2097 | Fsymbol_value (Qcomp_debug)) }; | 2101 | Fsymbol_value (Qcomp_debug)) }; |
| 2098 | emit_static_object (TEXT_OPTIM_QLY, Flist (2, opt_qly)); | 2102 | emit_static_object (TEXT_OPTIM_QLY, Flist (2, opt_qly)); |
| 2099 | 2103 | ||
| 2104 | emit_static_object (TEXT_FDOC_SYM, | ||
| 2105 | CALL1I (comp-ctxt-doc-index-h, Vcomp_ctxt)); | ||
| 2106 | |||
| 2100 | comp.current_thread_ref = | 2107 | comp.current_thread_ref = |
| 2101 | gcc_jit_lvalue_as_rvalue ( | 2108 | gcc_jit_lvalue_as_rvalue ( |
| 2102 | gcc_jit_context_new_global ( | 2109 | gcc_jit_context_new_global ( |
| @@ -3619,6 +3626,7 @@ load_comp_unit (struct Lisp_Native_Comp_Unit *comp_u, bool loading_dump, | |||
| 3619 | comp_u->data_vec = load_static_obj (comp_u, TEXT_DATA_RELOC_SYM); | 3626 | comp_u->data_vec = load_static_obj (comp_u, TEXT_DATA_RELOC_SYM); |
| 3620 | comp_u->data_impure_vec = | 3627 | comp_u->data_impure_vec = |
| 3621 | load_static_obj (comp_u, TEXT_DATA_RELOC_IMPURE_SYM); | 3628 | load_static_obj (comp_u, TEXT_DATA_RELOC_IMPURE_SYM); |
| 3629 | comp_u->data_fdoc_h = load_static_obj (comp_u, TEXT_FDOC_SYM); | ||
| 3622 | 3630 | ||
| 3623 | if (!NILP (Vpurify_flag)) | 3631 | if (!NILP (Vpurify_flag)) |
| 3624 | /* Non impure can be copied into pure space. */ | 3632 | /* Non impure can be copied into pure space. */ |
| @@ -3668,7 +3676,7 @@ DEFUN ("comp--register-subr", Fcomp__register_subr, Scomp__register_subr, | |||
| 3668 | doc: /* This gets called by top_level_run during load phase to register | 3676 | doc: /* This gets called by top_level_run during load phase to register |
| 3669 | each exported subr. */) | 3677 | each exported subr. */) |
| 3670 | (Lisp_Object name, Lisp_Object minarg, Lisp_Object maxarg, | 3678 | (Lisp_Object name, Lisp_Object minarg, Lisp_Object maxarg, |
| 3671 | Lisp_Object c_name, Lisp_Object doc, Lisp_Object intspec, | 3679 | Lisp_Object c_name, Lisp_Object doc_idx, Lisp_Object intspec, |
| 3672 | Lisp_Object comp_u) | 3680 | Lisp_Object comp_u) |
| 3673 | { | 3681 | { |
| 3674 | dynlib_handle_ptr handle = XNATIVE_COMP_UNIT (comp_u)->handle; | 3682 | dynlib_handle_ptr handle = XNATIVE_COMP_UNIT (comp_u)->handle; |
| @@ -3688,7 +3696,7 @@ DEFUN ("comp--register-subr", Fcomp__register_subr, Scomp__register_subr, | |||
| 3688 | x->s.max_args = FIXNUMP (maxarg) ? XFIXNUM (maxarg) : MANY; | 3696 | x->s.max_args = FIXNUMP (maxarg) ? XFIXNUM (maxarg) : MANY; |
| 3689 | x->s.symbol_name = xstrdup (SSDATA (Fsymbol_name (name))); | 3697 | x->s.symbol_name = xstrdup (SSDATA (Fsymbol_name (name))); |
| 3690 | x->s.native_intspec = intspec; | 3698 | x->s.native_intspec = intspec; |
| 3691 | x->s.native_doc = doc; | 3699 | x->s.doc = XFIXNUM (doc_idx); |
| 3692 | x->s.native_comp_u[0] = comp_u; | 3700 | x->s.native_comp_u[0] = comp_u; |
| 3693 | Lisp_Object tem; | 3701 | Lisp_Object tem; |
| 3694 | XSETSUBR (tem, &x->s); | 3702 | XSETSUBR (tem, &x->s); |