summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp
diff options
context:
space:
mode:
authorAndrea Corallo <akrl@sdf.org>2020-04-25 16:13:03 +0100
committerAndrea Corallo <akrl@sdf.org>2020-04-25 19:55:39 +0100
commitd73e64076e08cf0bcb81ea9d161fb7409e1bf896 (patch)
treef07c3127f9cdc6ac97390460e6466ba7b81b4de0 /lisp/emacs-lisp
parent9c4c0af89d88f5b4a9124741f64915c5378f1283 (diff)
downloademacs-d73e64076e08cf0bcb81ea9d161fb7409e1bf896.tar.gz
emacs-d73e64076e08cf0bcb81ea9d161fb7409e1bf896.tar.bz2
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 'lisp/emacs-lisp')
-rw-r--r--lisp/emacs-lisp/comp.el9
1 files changed, 8 insertions, 1 deletions
diff --git a/lisp/emacs-lisp/comp.el b/lisp/emacs-lisp/comp.el
index e96de273359..5096a143a0f 100644
--- a/lisp/emacs-lisp/comp.el
+++ b/lisp/emacs-lisp/comp.el
@@ -216,6 +216,8 @@ Can be one of: 'd-default', 'd-impure' or 'd-ephemeral'. See `comp-ctxt'.")
(sym-to-c-name-h (make-hash-table :test #'eq) :type hash-table
:documentation "symbol-function -> c-name.
This is only for optimizing intra CU calls at speed 3.")
+ (doc-index-h (make-hash-table :test #'eql) :type hash-table
+ :documentation "Documentation index -> documentation")
(d-default (make-comp-data-container) :type comp-data-container
:documentation "Standard data relocated in use by functions.")
(d-impure (make-comp-data-container) :type comp-data-container
@@ -1214,7 +1216,12 @@ the annotation emission."
(comp-args-max args)
'many))
(make-comp-mvar :constant c-name)
- (make-comp-mvar :constant (comp-func-doc f))
+ (make-comp-mvar
+ :constant
+ (let* ((h (comp-ctxt-doc-index-h comp-ctxt))
+ (i (hash-table-count h)))
+ (puthash i (comp-func-doc f) h)
+ i))
(make-comp-mvar :constant
(comp-func-int-spec f))
;; This is the compilation unit it-self passed as