]> git.eshelyaron.com Git - emacs.git/commitdiff
prepare for file compilation
authorAndrea Corallo <andrea_corallo@yahoo.it>
Fri, 6 Sep 2019 17:33:16 +0000 (19:33 +0200)
committerAndrea Corallo <akrl@sdf.org>
Wed, 1 Jan 2020 10:37:44 +0000 (11:37 +0100)
lisp/emacs-lisp/bytecomp.el
lisp/emacs-lisp/comp.el

index ca7c67e6907a0be848ae0b421801493d258908e3..04f19426f1b69da220e9a52042c5688ce82cca32 100644 (file)
@@ -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)
 
 \f
 ;;; 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)))
index 3a01bb12387fa89787a7a5a29c62da1a6cb5bc8b..2e35cd31d66f893b8affe6a42e317ea23a9ebb0d 100644 (file)
@@ -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))