summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp
diff options
context:
space:
mode:
authorAndrea Corallo <akrl@sdf.org>2020-05-03 20:26:35 +0100
committerAndrea Corallo <akrl@sdf.org>2020-05-14 21:50:32 +0100
commit2ee2fb5a86a8933b1105a1dc5b597ebb8ce57e40 (patch)
tree2a53f18ab3e980a30998a939be3e42131fd4d19a /lisp/emacs-lisp
parentc12831a6b6fd445950300d33c95747ac923e1ebf (diff)
downloademacs-2ee2fb5a86a8933b1105a1dc5b597ebb8ce57e40.tar.gz
emacs-2ee2fb5a86a8933b1105a1dc5b597ebb8ce57e40.tar.bz2
emacs-2ee2fb5a86a8933b1105a1dc5b597ebb8ce57e40.zip
* Prune now unnecessary byte-code objects
* lisp/emacs-lisp/comp.el (comp-finalize-container): Prune byte-code that was lambdas. (comp-compile-ctxt-to-file): Remove fixme.
Diffstat (limited to 'lisp/emacs-lisp')
-rw-r--r--lisp/emacs-lisp/comp.el12
1 files changed, 10 insertions, 2 deletions
diff --git a/lisp/emacs-lisp/comp.el b/lisp/emacs-lisp/comp.el
index 705225d82f3..3bcfdc9420b 100644
--- a/lisp/emacs-lisp/comp.el
+++ b/lisp/emacs-lisp/comp.el
@@ -2117,7 +2117,16 @@ These are substituted with a normal 'set' op."
for obj each hash-keys of h
for i from 0
do (puthash obj i h)
- collect obj)))
+ ;; Prune byte-code objects coming from lambdas.
+ ;; These are not anymore necessary as they will be
+ ;; replaced at load time by native-elisp-subrs.
+ ;; Note: we leave the objects in the idx hash table
+ ;; to still be able to retrieve the correct index
+ ;; from the corresponding m-var.
+ collect (if (gethash obj
+ (comp-ctxt-byte-func-to-func-h comp-ctxt))
+ nil
+ obj))))
(defun comp-finalize-relocs ()
"Finalize data containers for each relocation class.
@@ -2159,7 +2168,6 @@ Update all insn accordingly."
"Compile as native code the current context naming it NAME.
Prepare every function for final compilation and drive the C back-end."
(let ((dir (file-name-directory name)))
- ;; FIXME: Strip bytecompiled functions here.
(comp-finalize-relocs)
(unless (file-exists-p dir)
;; In case it's created in the meanwhile.