]> code.delx.au - gnu-emacs/blobdiff - lisp/emacs-lisp/byte-opt.el
2005-09-24 Emilio C. Lopes <eclig@gmx.net>
[gnu-emacs] / lisp / emacs-lisp / byte-opt.el
index 856a31551dfc819dad3ef18d8ce2382f6684523f..7d47d809673684a6fb82f8bff7c0773e94fbd598 100644 (file)
@@ -1,7 +1,7 @@
 ;;; byte-opt.el --- the optimization passes of the emacs-lisp byte compiler
 
-;; Copyright (c) 1991, 1994, 2000, 2001, 2002, 2004
-;;           Free Software Foundation, Inc.
+;; Copyright (C) 1991, 1994, 2000, 2001, 2002, 2003, 2004,
+;;   2005 Free Software Foundation, Inc.
 
 ;; Author: Jamie Zawinski <jwz@lucid.com>
 ;;     Hallvard Furuseth <hbf@ulrik.uio.no>
@@ -22,8 +22,8 @@
 
 ;; You should have received a copy of the GNU General Public License
 ;; along with GNU Emacs; see the file COPYING.  If not, write to the
-;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-;; Boston, MA 02111-1307, USA.
+;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+;; Boston, MA 02110-1301, USA.
 
 ;;; Commentary:
 
 ;; ;; Associative math should recognize subcalls to identical function:
 ;; (disassemble (lambda (x) (+ (+ (foo) 1) (+ (bar) 2))))
 ;; ;; This should generate the same as (1+ x) and (1- x)
-   
+
 ;; (disassemble (lambda (x) (cons (+ x 1) (- x 1))))
 ;; ;; An awful lot of functions always return a non-nil value.  If they're
 ;; ;; error free also they may act as true-constants.
-   
+
 ;; (disassemble (lambda (x) (and (point) (foo))))
 ;; ;; When
 ;; ;;   - all but one arguments to a function are constant
 ;; ;; condition is side-effect-free [assignment-free] then the other
 ;; ;; arguments may be any expressions.  Since, however, the code size
 ;; ;; can increase this way they should be "simple".  Compare:
-   
+
 ;; (disassemble (lambda (x) (eq (if (point) 'a 'b) 'c)))
 ;; (disassemble (lambda (x) (if (point) (eq 'a 'c) (eq 'b 'c))))
-   
+
 ;; ;; (car (cons A B)) -> (prog1 A B)
 ;; (disassemble (lambda (x) (car (cons (foo) 42))))
-   
+
 ;; ;; (cdr (cons A B)) -> (progn A B)
 ;; (disassemble (lambda (x) (cdr (cons 42 (foo)))))
-   
+
 ;; ;; (car (list A B ...)) -> (prog1 A B ...)
 ;; (disassemble (lambda (x) (car (list (foo) 42 (bar)))))
-   
+
 ;; ;; (cdr (list A B ...)) -> (progn A (list B ...))
 ;; (disassemble (lambda (x) (cdr (list 42 (foo) (bar)))))
 
   (cons 'progn
        (mapcar
         (lambda (sexp)
-           (let ((fn (car-safe sexp)))
-             (if (and (symbolp fn)
-                   (or (cdr (assq fn byte-compile-function-environment))
-                     (and (fboundp fn)
-                       (not (or (cdr (assq fn byte-compile-macro-environment))
-                                (and (consp (setq fn (symbol-function fn)))
-                                     (eq (car fn) 'macro))
-                                (subrp fn))))))
-                 (byte-compile-inline-expand sexp)
-               sexp)))
+          (let ((f (car-safe sexp)))
+            (if (and (symbolp f)
+                     (or (cdr (assq f byte-compile-function-environment))
+                         (not (or (not (fboundp f))
+                                  (cdr (assq f byte-compile-macro-environment))
+                                  (and (consp (setq f (symbol-function f)))
+                                       (eq (car f) 'macro))
+                                  (subrp f)))))
+                (byte-compile-inline-expand sexp)
+              sexp)))
         (cdr form))))
 
 
                (symbolp (car-safe form))
                (get (car-safe form) 'cl-compiler-macro)
                (not (eq form
-                        (setq form (compiler-macroexpand form)))))
+                        (with-no-warnings
+                         (setq form (compiler-macroexpand form))))))
           (byte-optimize-form form for-effect))
 
          ((not (symbolp fn))
 This assumes that the function will not have any side-effects and that
 its return value depends solely on its arguments.
 If the function can signal an error, this might change the semantics
-of FORM by signalling the error at compile-time."
+of FORM by signaling the error at compile-time."
   (let ((args (cdr form))
        (constant t))
     (while (and args constant)
@@ -1365,10 +1366,9 @@ of FORM by signalling the error at compile-time."
 ;; before each insn (or its label).
 (defun byte-decompile-bytecode-1 (bytes constvec &optional make-spliceable)
   (let ((length (length bytes))
-       (ptr 0) optr tag tags op offset
+       (ptr 0) optr tags op offset
        lap tmp
-       endtag
-       (retcount 0))
+       endtag)
     (while (not (= ptr length))
       (or make-spliceable
          (setq lap (cons ptr lap)))