diff options
| author | Gerd Moellmann | 2001-10-11 17:25:26 +0000 |
|---|---|---|
| committer | Gerd Moellmann | 2001-10-11 17:25:26 +0000 |
| commit | 3ecf67a1844bb1797692b1b768e3d652a33bec62 (patch) | |
| tree | 767cb4533dbaf517cd7ca32b11cc14d350cafb85 | |
| parent | cb938d466064a865f7b6f9748d44b5f5baccdd6c (diff) | |
| download | emacs-3ecf67a1844bb1797692b1b768e3d652a33bec62.tar.gz 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.
| -rw-r--r-- | lisp/emacs-lisp/byte-opt.el | 15 |
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 @@ | |||
| 1879 | (setq lap0 (car rest) | 1879 | (setq lap0 (car rest) |
| 1880 | lap1 (nth 1 rest)) | 1880 | lap1 (nth 1 rest)) |
| 1881 | (if (memq (car lap0) byte-constref-ops) | 1881 | (if (memq (car lap0) byte-constref-ops) |
| 1882 | (if (not (eq (car lap0) 'byte-constant)) | 1882 | (if (or (eq (car lap0) 'byte-constant) |
| 1883 | (or (memq (cdr lap0) byte-compile-variables) | 1883 | (eq (car lap0) 'byte-constant2)) |
| 1884 | (setq byte-compile-variables (cons (cdr lap0) | 1884 | (unless (memq (cdr lap0) byte-compile-constants) |
| 1885 | byte-compile-variables))) | ||
| 1886 | (or (memq (cdr lap0) byte-compile-constants) | ||
| 1887 | (setq byte-compile-constants (cons (cdr lap0) | 1885 | (setq byte-compile-constants (cons (cdr lap0) |
| 1888 | byte-compile-constants))))) | 1886 | byte-compile-constants))) |
| 1887 | (unless (memq (cdr lap0) byte-compile-variables) | ||
| 1888 | (setq byte-compile-variables (cons (cdr lap0) | ||
| 1889 | byte-compile-variables))))) | ||
| 1889 | (cond (;; | 1890 | (cond (;; |
| 1890 | ;; const-C varset-X const-C --> const-C dup varset-X | 1891 | ;; const-C varset-X const-C --> const-C dup varset-X |
| 1891 | ;; const-C varbind-X const-C --> const-C dup varbind-X | 1892 | ;; const-C varbind-X const-C --> const-C dup varbind-X |
| 1892 | ;; | 1893 | ;; |
| 1893 | (and (eq (car lap0) 'byte-constant) | 1894 | (and (eq (car lap0) 'byte-constant) |
| 1894 | (eq (car (nth 2 rest)) 'byte-constant) | 1895 | (eq (car (nth 2 rest)) 'byte-constant) |
| 1895 | (eq (cdr lap0) (car (nth 2 rest))) | 1896 | (eq (cdr lap0) (cdr (nth 2 rest))) |
| 1896 | (memq (car lap1) '(byte-varbind byte-varset))) | 1897 | (memq (car lap1) '(byte-varbind byte-varset))) |
| 1897 | (byte-compile-log-lap " %s %s %s\t-->\t%s dup %s" | 1898 | (byte-compile-log-lap " %s %s %s\t-->\t%s dup %s" |
| 1898 | lap0 lap1 lap0 lap0 lap1) | 1899 | lap0 lap1 lap0 lap0 lap1) |