summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp
diff options
context:
space:
mode:
authorGerd Moellmann <gerd@gnu.org>2001-10-11 17:25:26 +0000
committerGerd Moellmann <gerd@gnu.org>2001-10-11 17:25:26 +0000
commit3ecf67a1844bb1797692b1b768e3d652a33bec62 (patch)
tree767cb4533dbaf517cd7ca32b11cc14d350cafb85 /lisp/emacs-lisp
parentcb938d466064a865f7b6f9748d44b5f5baccdd6c (diff)
downloademacs-3ecf67a1844bb1797692b1b768e3d652a33bec62.tar.gz
emacs-3ecf67a1844bb1797692b1b768e3d652a33bec62.tar.bz2
emacs-3ecf67a1844bb1797692b1b768e3d652a33bec62.zip
(byte-optimize-lapcode)
<byte-constref-ops>: Consider byte-constant2 and clarify the code. <const-C varset-X const-C>: Fix car/cdr typo.
Diffstat (limited to 'lisp/emacs-lisp')
-rw-r--r--lisp/emacs-lisp/byte-opt.el15
1 files changed, 8 insertions, 7 deletions
diff --git a/lisp/emacs-lisp/byte-opt.el b/lisp/emacs-lisp/byte-opt.el
index 47b803af81c..dbe039866e0 100644
--- a/lisp/emacs-lisp/byte-opt.el
+++ b/lisp/emacs-lisp/byte-opt.el
@@ -1879,20 +1879,21 @@
(setq lap0 (car rest)
lap1 (nth 1 rest))
(if (memq (car lap0) byte-constref-ops)
- (if (not (eq (car lap0) 'byte-constant))
- (or (memq (cdr lap0) byte-compile-variables)
- (setq byte-compile-variables (cons (cdr lap0)
- byte-compile-variables)))
- (or (memq (cdr lap0) byte-compile-constants)
+ (if (or (eq (car lap0) 'byte-constant)
+ (eq (car lap0) 'byte-constant2))
+ (unless (memq (cdr lap0) byte-compile-constants)
(setq byte-compile-constants (cons (cdr lap0)
- byte-compile-constants)))))
+ byte-compile-constants)))
+ (unless (memq (cdr lap0) byte-compile-variables)
+ (setq byte-compile-variables (cons (cdr lap0)
+ byte-compile-variables)))))
(cond (;;
;; const-C varset-X const-C --> const-C dup varset-X
;; const-C varbind-X const-C --> const-C dup varbind-X
;;
(and (eq (car lap0) 'byte-constant)
(eq (car (nth 2 rest)) 'byte-constant)
- (eq (cdr lap0) (car (nth 2 rest)))
+ (eq (cdr lap0) (cdr (nth 2 rest)))
(memq (car lap1) '(byte-varbind byte-varset)))
(byte-compile-log-lap " %s %s %s\t-->\t%s dup %s"
lap0 lap1 lap0 lap0 lap1)