1 new commit in XEmacs:
https://bitbucket.org/xemacs/xemacs/changeset/b4715fcbe001/
changeset: b4715fcbe001
user: kehoea
date: 2012-05-14 16:16:47
summary: #'byte-optimize-letX; group constant initialisations together in let
forms
lisp/ChangeLog addition:
2012-05-14 Aidan Kehoe <kehoea(a)parhasard.net>
* byte-optimize.el (byte-optimize-letX):
In (let ...) forms, group constant initialisations together, so we
can just dup in the byte code.
affected #: 2 files
diff -r daf5accfe9736ac481b1bdd6063d060f8b4a633d -r
b4715fcbe00185e5ab8c00208e14d15fb3c936a9 lisp/ChangeLog
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,9 @@
+2012-05-14 Aidan Kehoe <kehoea(a)parhasard.net>
+
+ * byte-optimize.el (byte-optimize-letX):
+ In (let ...) forms, group constant initialisations together, so we
+ can just dup in the byte code.
+
2012-05-14 Aidan Kehoe <kehoea(a)parhasard.net>
Update minibuf.el to use #'test-completion, use the generality of
diff -r daf5accfe9736ac481b1bdd6063d060f8b4a633d -r
b4715fcbe00185e5ab8c00208e14d15fb3c936a9 lisp/byte-optimize.el
--- a/lisp/byte-optimize.el
+++ b/lisp/byte-optimize.el
@@ -1194,7 +1194,27 @@
;; No bindings
(cons 'progn (cdr (cdr form))))
((or (nth 2 form) (nthcdr 3 form))
- form)
+ (if (and (eq 'let (car form)) (> (length (nth 1 form)) 2))
+ ;; Group constant initialisations together, so we can
+ ;; just dup in the lap code. Can't group other
+ ;; initialisations together if they have side-effects,
+ ;; that would re-order them.
+ (let ((sort (stable-sort
+ (copy-list (nth 1 form))
+ #'< :key #'(lambda (object)
+ (cond ((atom object)
+ most-positive-fixnum)
+ ((null (cadr object))
+ most-positive-fixnum)
+ ((byte-compile-trueconstp
+ (cadr object))
+ (mod (sxhash (cadr object))
+ most-positive-fixnum))
+ (t 0))))))
+ (if (equal sort (nth 1 form))
+ form
+ `(let ,sort ,@(cddr form))))
+ form))
;; The body is nil
((eq (car form) 'let)
(append '(progn) (mapcar 'car-safe (mapcar 'cdr-safe (nth 1 form)))
Repository URL:
https://bitbucket.org/xemacs/xemacs/
--
This is a commit notification from
bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://lists.xemacs.org/mailman/listinfo/xemacs-patches