aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKarl Heuer1995-03-24 23:43:21 +0000
committerKarl Heuer1995-03-24 23:43:21 +0000
commit69dc83fd8466788376fa5bf606d87c51be007c85 (patch)
tree130d2b2b6f9a8e0e6a899b7fc728b602e56a5580
parentc7b6dfa6df76885853be8cadf06d8905e1310940 (diff)
downloademacs-69dc83fd8466788376fa5bf606d87c51be007c85.tar.gz
emacs-69dc83fd8466788376fa5bf606d87c51be007c85.zip
(byte-compile-out-toplevel): Compile lambda forms even if trivial.
-rw-r--r--lisp/emacs-lisp/bytecomp.el13
1 files changed, 8 insertions, 5 deletions
diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el
index 9d4f632a485..b11b0fd1f14 100644
--- a/lisp/emacs-lisp/bytecomp.el
+++ b/lisp/emacs-lisp/bytecomp.el
@@ -555,7 +555,7 @@ otherwise pop it")
555;; these ops are new to v19 555;; these ops are new to v19
556 556
557;; To unbind back to the beginning of this frame. 557;; To unbind back to the beginning of this frame.
558;; Not used yet, but wil be needed for tail-recursion elimination. 558;; Not used yet, but will be needed for tail-recursion elimination.
559(byte-defop 146 0 byte-unbind-all) 559(byte-defop 146 0 byte-unbind-all)
560 560
561;; these ops are new to v19 561;; these ops are new to v19
@@ -1946,7 +1946,10 @@ If FORM is a lambda or a macro, byte-compile it as a function."
1946 ;; Note that even (quote foo) must be parsed just as any subr by the 1946 ;; Note that even (quote foo) must be parsed just as any subr by the
1947 ;; interpreter, so quote should be compiled into byte-code in some contexts. 1947 ;; interpreter, so quote should be compiled into byte-code in some contexts.
1948 ;; What to leave uncompiled: 1948 ;; What to leave uncompiled:
1949 ;; lambda -> a single atom. 1949 ;; lambda -> never. we used to leave it uncompiled if the body was
1950 ;; a single atom, but that causes confusion if the docstring
1951 ;; uses the (file . pos) syntax. Besides, now that we have
1952 ;; the Lisp_Compiled type, the compiled form is faster.
1950 ;; eval -> atom, quote or (function atom atom atom) 1953 ;; eval -> atom, quote or (function atom atom atom)
1951 ;; progn -> as <<same-as-eval>> or (progn <<same-as-eval>> atom) 1954 ;; progn -> as <<same-as-eval>> or (progn <<same-as-eval>> atom)
1952 ;; file -> as progn, but takes both quotes and atoms, and longer forms. 1955 ;; file -> as progn, but takes both quotes and atoms, and longer forms.
@@ -1955,7 +1958,8 @@ If FORM is a lambda or a macro, byte-compile it as a function."
1955 tmp body) 1958 tmp body)
1956 (cond 1959 (cond
1957 ;; #### This should be split out into byte-compile-nontrivial-function-p. 1960 ;; #### This should be split out into byte-compile-nontrivial-function-p.
1958 ((or (nthcdr (if (eq output-type 'file) 50 8) byte-compile-output) 1961 ((or (eq output-type 'lambda)
1962 (nthcdr (if (eq output-type 'file) 50 8) byte-compile-output)
1959 (assq 'TAG byte-compile-output) ; Not necessary, but speeds up a bit. 1963 (assq 'TAG byte-compile-output) ; Not necessary, but speeds up a bit.
1960 (not (setq tmp (assq 'byte-return byte-compile-output))) 1964 (not (setq tmp (assq 'byte-return byte-compile-output)))
1961 (progn 1965 (progn
@@ -1990,8 +1994,7 @@ If FORM is a lambda or a macro, byte-compile it as a function."
1990 (or (eq output-type 'file) 1994 (or (eq output-type 'file)
1991 (not (delq nil (mapcar 'consp (cdr (car body)))))))) 1995 (not (delq nil (mapcar 'consp (cdr (car body))))))))
1992 (setq rest (cdr rest))) 1996 (setq rest (cdr rest)))
1993 rest) 1997 rest))
1994 (and (consp (car body)) (eq output-type 'lambda)))
1995 (let ((byte-compile-vector (byte-compile-constants-vector))) 1998 (let ((byte-compile-vector (byte-compile-constants-vector)))
1996 (list 'byte-code (byte-compile-lapcode byte-compile-output) 1999 (list 'byte-code (byte-compile-lapcode byte-compile-output)
1997 byte-compile-vector byte-compile-maxdepth))) 2000 byte-compile-vector byte-compile-maxdepth)))