diff options
author | Andrea Corallo <akrl@sdf.org> | 2020-04-26 09:11:33 +0100 |
---|---|---|
committer | Andrea Corallo <akrl@sdf.org> | 2020-04-26 10:10:17 +0100 |
commit | bb4cf13c47a1a24ce83233cc7b77dc87fc274d52 (patch) | |
tree | 2ae6445e1d524a04d1103171f0086883a5d96813 /lisp/emacs-lisp/comp.el | |
parent | 2878624980a116550e8b07acc76a24c373eab342 (diff) | |
download | emacs-bb4cf13c47a1a24ce83233cc7b77dc87fc274d52.tar.gz emacs-bb4cf13c47a1a24ce83233cc7b77dc87fc274d52.tar.bz2 emacs-bb4cf13c47a1a24ce83233cc7b77dc87fc274d52.zip |
Convert before final function doc hash into a vector.
* lisp/emacs-lisp/comp.el (comp-finalize-relocs): Convert doc hash
table into vector befor final.
(comp-emit-for-top-level): Rename `comp-ctxt-doc-index-h' ->
`comp-ctxt-function-docs'.
(comp-ctxt): Likewise.
* src/comp.c (native_function_doc): Update logic for documentation
being a vector.
(emit_ctxt_code): Update for 'comp-ctxt-doc-index-h' slot rename.
* src/comp.h (struct Lisp_Native_Comp_Unit): Rename 'data_fdoc_h'
into data_fdoc_v.
* src/pdumper.c (dump_native_comp_unit): Likewise.
Diffstat (limited to 'lisp/emacs-lisp/comp.el')
-rw-r--r-- | lisp/emacs-lisp/comp.el | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/lisp/emacs-lisp/comp.el b/lisp/emacs-lisp/comp.el index 5096a143a0f..f8e30f0047a 100644 --- a/lisp/emacs-lisp/comp.el +++ b/lisp/emacs-lisp/comp.el @@ -216,7 +216,7 @@ 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 + (function-docs (make-hash-table :test #'eql) :type (or hash-table vector) :documentation "Documentation index -> documentation") (d-default (make-comp-data-container) :type comp-data-container :documentation "Standard data relocated in use by functions.") @@ -1218,7 +1218,7 @@ the annotation emission." (make-comp-mvar :constant c-name) (make-comp-mvar :constant - (let* ((h (comp-ctxt-doc-index-h comp-ctxt)) + (let* ((h (comp-ctxt-function-docs comp-ctxt)) (i (hash-table-count h))) (puthash i (comp-func-doc f) h) i)) @@ -2103,7 +2103,15 @@ Update all insn accordingly." do (remhash obj d-ephemeral-idx)) ;; Fix-up indexes in each relocation class and fill corresponding ;; reloc lists. - (mapc #'comp-finalize-container (list d-default d-impure d-ephemeral)))) + (mapc #'comp-finalize-container (list d-default d-impure d-ephemeral)) + ;; Make a vector from the function documentation hash table. + (cl-loop with h = (comp-ctxt-function-docs comp-ctxt) + with v = (make-vector (hash-table-count h) nil) + for idx being each hash-keys of h + for doc = (gethash idx h) + do (setf (aref v idx) doc) + finally + do (setf (comp-ctxt-function-docs comp-ctxt) v)))) (defun comp-compile-ctxt-to-file (name) "Compile as native code the current context naming it NAME. |