From: Andrea Corallo Date: Fri, 6 Sep 2019 17:33:16 +0000 (+0200) Subject: prepare for file compilation X-Git-Tag: emacs-28.0.90~2727^2~1211 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=2b51859d447cf2914cb64936f18231363d971b21;p=emacs.git prepare for file compilation --- diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el index ca7c67e6907..04f19426f1b 100644 --- a/lisp/emacs-lisp/bytecomp.el +++ b/lisp/emacs-lisp/bytecomp.el @@ -563,9 +563,10 @@ Each element is (INDEX . VALUE)") (defvar byte-compile-depth 0 "Current depth of execution stack.") (defvar byte-compile-maxdepth 0 "Maximum depth of execution stack.") -;; These are use by comp.el to spill lap -(defvar byte-compile-spilling-lap nil) -(defvar byte-compile-lap-output nil) +;; These are use by comp.el to spill +(defvar byte-native-compiling nil) +(defvar byte-to-native-lap-output nil) +(defvar byte-to-native-bytecode-output nil) ;;; The byte codes; this information is duplicated in bytecomp.c @@ -3117,7 +3118,8 @@ for symbols generated by the byte compiler itself." (setq rest (cdr rest))) rest)) ;; Spill lap output here - (setq byte-compile-lap-output byte-compile-output) + (when byte-native-compiling + (push byte-compile-output byte-to-native-lap-output)) (let ((byte-compile-vector (byte-compile-constants-vector))) (list 'byte-code (byte-compile-lapcode byte-compile-output) byte-compile-vector byte-compile-maxdepth))) diff --git a/lisp/emacs-lisp/comp.el b/lisp/emacs-lisp/comp.el index 3a01bb12387..2e35cd31d66 100644 --- a/lisp/emacs-lisp/comp.el +++ b/lisp/emacs-lisp/comp.el @@ -253,17 +253,18 @@ Put PREFIX in front of it." (defun comp-spill-lap (func) "Byte compile and spill the LAP rapresentation for FUNC." - (let (byte-compile-lap-output) + (let ((byte-native-compiling t) + (byte-to-native-lap-output ())) (setf (comp-func-byte-func func) (byte-compile (comp-func-symbol-name func))) (comp-within-log-buff - (cl-prettyprint byte-compile-lap-output)) + (cl-prettyprint byte-to-native-lap-output)) (let ((lambda-list (aref (comp-func-byte-func func) 0))) (if (fixnump lambda-list) (setf (comp-func-args func) (comp-decrypt-lambda-list lambda-list)) (error "Can't native compile a non lexical scoped function"))) - (setf (comp-func-lap func) byte-compile-lap-output) + (setf (comp-func-lap func) (car byte-to-native-lap-output)) (setf (comp-func-frame-size func) (aref (comp-func-byte-func func) 3)) func))