name c-name byte-func)
(cl-defstruct byte-to-native-top-level
"All other top-level forms."
- form)
+ form lexical)
(defvar byte-native-compiling nil
"Non nil while native compiling.")
;; it here.
(when byte-native-compiling
;; Spill output for the native compiler here
- (push (make-byte-to-native-top-level :form form)
+ (push (make-byte-to-native-top-level :form form :lexical lexical-binding)
byte-to-native-top-level-forms))
(let ((print-escape-newlines t)
(print-length nil)
;; Spill output for the native compiler here.
(push (if macro
(make-byte-to-native-top-level
- :form `(defalias ',name '(macro . ,code) nil))
+ :form `(defalias ',name '(macro . ,code) nil)
+ :lexical lexical-binding)
(make-byte-to-native-func-def :name name
:byte-func code))
byte-to-native-top-level-forms))
(cl-defmethod comp-emit-for-top-level ((form byte-to-native-top-level)
for-late-load)
(unless for-late-load
- (let ((form (byte-to-native-top-level-form form)))
- (comp-emit (comp-call 'eval
- (let ((comp-curr-allocation-class 'd-impure))
- (make-comp-mvar :constant form))
- (make-comp-mvar :constant t))))))
+ (comp-emit
+ (comp-call 'eval
+ (let ((comp-curr-allocation-class 'd-impure))
+ (make-comp-mvar :constant
+ (byte-to-native-top-level-form form)))
+ (make-comp-mvar :constant
+ (byte-to-native-top-level-lexical form))))))
(defun comp-emit-lambda-for-top-level (func)
"Emit the creation of subrs for lambda FUNC.