Mercurial > hg > xemacs-beta
comparison lisp/bytecomp.el @ 280:7df0dd720c89 r21-0b38
Import from CVS: tag r21-0b38
author | cvs |
---|---|
date | Mon, 13 Aug 2007 10:32:22 +0200 |
parents | c5d627a313b1 |
children | 558f606b08ae |
comparison
equal
deleted
inserted
replaced
279:c20b2fb5bb0a | 280:7df0dd720c89 |
---|---|
2887 (byte-defop-compiler (eql byte-eq) 2) | 2887 (byte-defop-compiler (eql byte-eq) 2) |
2888 (byte-defop-compiler20 old-eq 2) | 2888 (byte-defop-compiler20 old-eq 2) |
2889 (byte-defop-compiler20 old-memq 2) | 2889 (byte-defop-compiler20 old-memq 2) |
2890 (byte-defop-compiler cons 2) | 2890 (byte-defop-compiler cons 2) |
2891 (byte-defop-compiler aref 2) | 2891 (byte-defop-compiler aref 2) |
2892 (byte-defop-compiler (= byte-eqlsign) 2) | 2892 (byte-defop-compiler (= byte-eqlsign) byte-compile-one-or-more-args) |
2893 (byte-defop-compiler (< byte-lss) 2) | 2893 (byte-defop-compiler (< byte-lss) byte-compile-one-or-more-args) |
2894 (byte-defop-compiler (> byte-gtr) 2) | 2894 (byte-defop-compiler (> byte-gtr) byte-compile-one-or-more-args) |
2895 (byte-defop-compiler (<= byte-leq) 2) | 2895 (byte-defop-compiler (<= byte-leq) byte-compile-one-or-more-args) |
2896 (byte-defop-compiler (>= byte-geq) 2) | 2896 (byte-defop-compiler (>= byte-geq) byte-compile-one-or-more-args) |
2897 (byte-defop-compiler /= byte-compile-/=) | |
2897 (byte-defop-compiler get 2+1) | 2898 (byte-defop-compiler get 2+1) |
2898 (byte-defop-compiler nth 2) | 2899 (byte-defop-compiler nth 2) |
2899 (byte-defop-compiler substring 2-3) | 2900 (byte-defop-compiler substring 2-3) |
2900 (byte-defop-compiler (move-marker byte-set-marker) 2-3) | 2901 (byte-defop-compiler (move-marker byte-set-marker) 2-3) |
2901 (byte-defop-compiler set-marker 2-3) | 2902 (byte-defop-compiler set-marker 2-3) |
3100 (byte-defop-compiler-1 function byte-compile-function-form) | 3101 (byte-defop-compiler-1 function byte-compile-function-form) |
3101 (byte-defop-compiler-1 - byte-compile-minus) | 3102 (byte-defop-compiler-1 - byte-compile-minus) |
3102 (byte-defop-compiler (/ byte-quo) byte-compile-quo) | 3103 (byte-defop-compiler (/ byte-quo) byte-compile-quo) |
3103 (byte-defop-compiler nconc) | 3104 (byte-defop-compiler nconc) |
3104 (byte-defop-compiler-1 beginning-of-line) | 3105 (byte-defop-compiler-1 beginning-of-line) |
3106 | |
3107 (defun byte-compile-one-or-more-args (form) | |
3108 (let ((len (length form))) | |
3109 (cond ((= len 1) (byte-compile-subr-wrong-args form "1 or more")) | |
3110 ((= len 2) (byte-compile-constant t)) | |
3111 ((= len 3) (byte-compile-two-args form)) | |
3112 (t (byte-compile-normal-call form))))) | |
3113 | |
3114 (defun byte-compile-/= (form) | |
3115 (let ((len (length form))) | |
3116 (cond ((= len 1) (byte-compile-subr-wrong-args form "1 or more")) | |
3117 ((= len 2) (byte-compile-constant t)) | |
3118 ;; optimize (/= X Y) to (not (= X Y)) | |
3119 ((= len 3) (byte-compile-form-do-effect `(not (= ,@(cdr form))))) | |
3120 (t (byte-compile-normal-call form))))) | |
3105 | 3121 |
3106 (defun byte-compile-buffer-substring (form) | 3122 (defun byte-compile-buffer-substring (form) |
3107 (let ((len (length form))) | 3123 (let ((len (length form))) |
3108 ;; buffer-substring used to take exactly two args, but now takes 0-3. | 3124 ;; buffer-substring used to take exactly two args, but now takes 0-3. |
3109 ;; convert 0-2 to two args and use special bytecode operand. | 3125 ;; convert 0-2 to two args and use special bytecode operand. |
3537 ;; done compiling in this scope, warn now. | 3553 ;; done compiling in this scope, warn now. |
3538 (byte-compile-warn-about-unused-variables)) | 3554 (byte-compile-warn-about-unused-variables)) |
3539 (byte-compile-out 'byte-unbind (length (car (cdr form)))))) | 3555 (byte-compile-out 'byte-unbind (length (car (cdr form)))))) |
3540 | 3556 |
3541 | 3557 |
3542 (byte-defop-compiler-1 /= byte-compile-negated) | 3558 ;;(byte-defop-compiler-1 /= byte-compile-negated) |
3543 (byte-defop-compiler-1 atom byte-compile-negated) | 3559 (byte-defop-compiler-1 atom byte-compile-negated) |
3544 (byte-defop-compiler-1 nlistp byte-compile-negated) | 3560 (byte-defop-compiler-1 nlistp byte-compile-negated) |
3545 | 3561 |
3546 (put '/= 'byte-compile-negated-op '=) | 3562 ;;(put '/= 'byte-compile-negated-op '=) |
3547 (put 'atom 'byte-compile-negated-op 'consp) | 3563 (put 'atom 'byte-compile-negated-op 'consp) |
3548 (put 'nlistp 'byte-compile-negated-op 'listp) | 3564 (put 'nlistp 'byte-compile-negated-op 'listp) |
3549 | 3565 |
3550 (defun byte-compile-negated (form) | 3566 (defun byte-compile-negated (form) |
3551 (byte-compile-form-do-effect (byte-compile-negation-optimizer form))) | 3567 (byte-compile-form-do-effect (byte-compile-negation-optimizer form))) |
3552 | 3568 |
3553 ;; Even when optimization is off, /= is optimized to (not (= ...)). | 3569 ;; Even when optimization is off, atom is optimized to (not (consp ...)). |
3554 (defun byte-compile-negation-optimizer (form) | 3570 (defun byte-compile-negation-optimizer (form) |
3555 ;; an optimizer for forms where <form1> is less efficient than (not <form2>) | 3571 ;; an optimizer for forms where <form1> is less efficient than (not <form2>) |
3556 (list 'not | 3572 (list 'not |
3557 (cons (or (get (car form) 'byte-compile-negated-op) | 3573 (cons (or (get (car form) 'byte-compile-negated-op) |
3558 (error | 3574 (error |