emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/lisp/emacs-lisp/byte-opt.el


From: Juanma Barranquero
Subject: [Emacs-diffs] Changes to emacs/lisp/emacs-lisp/byte-opt.el
Date: Tue, 21 Jun 2005 09:45:12 -0400

Index: emacs/lisp/emacs-lisp/byte-opt.el
diff -c emacs/lisp/emacs-lisp/byte-opt.el:1.79 
emacs/lisp/emacs-lisp/byte-opt.el:1.80
*** emacs/lisp/emacs-lisp/byte-opt.el:1.79      Thu Nov 25 02:58:34 2004
--- emacs/lisp/emacs-lisp/byte-opt.el   Tue Jun 21 13:45:12 2005
***************
*** 152,162 ****
  ;; ;; 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
--- 152,162 ----
  ;; ;; 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
***************
*** 165,183 ****
  ;; ;; 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)))))
  
--- 165,183 ----
  ;; ;; 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)))))
  
***************
*** 1126,1132 ****
  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."
    (let ((args (cdr form))
        (constant t))
      (while (and args constant)
--- 1126,1132 ----
  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 signaling the error at compile-time."
    (let ((args (cdr form))
        (constant t))
      (while (and args constant)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]