[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
feature/native-comp 29b2a08 03/12: Execute top level forms in the right
From: |
Andrea Corallo |
Subject: |
feature/native-comp 29b2a08 03/12: Execute top level forms in the right lex/dyn scope. |
Date: |
Sun, 21 Jun 2020 18:37:16 -0400 (EDT) |
branch: feature/native-comp
commit 29b2a08c36554ec26f8f3c51da2a2a26b13bfe8f
Author: Andrea Corallo <akrl@sdf.org>
Commit: Andrea Corallo <akrl@sdf.org>
Execute top level forms in the right lex/dyn scope.
* lisp/emacs-lisp/bytecomp.el (byte-to-native-top-level): Add
'lexical' slot.
(byte-compile-output-file-form): Update for new slot.
(byte-compile-file-form-defmumble): Capture scope.
* lisp/emacs-lisp/comp.el (comp-emit-for-top-level): Specify
execution scope.
---
lisp/emacs-lisp/bytecomp.el | 7 ++++---
lisp/emacs-lisp/comp.el | 12 +++++++-----
2 files changed, 11 insertions(+), 8 deletions(-)
diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el
index 9e39b8f..c7d2344 100644
--- a/lisp/emacs-lisp/bytecomp.el
+++ b/lisp/emacs-lisp/bytecomp.el
@@ -585,7 +585,7 @@ Each element is (INDEX . VALUE)")
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.")
@@ -2248,7 +2248,7 @@ Call from the source buffer."
;; 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)
@@ -2707,7 +2707,8 @@ not to take responsibility for the actual compilation of
the code."
;; 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))
diff --git a/lisp/emacs-lisp/comp.el b/lisp/emacs-lisp/comp.el
index e7bd069..928fa51 100644
--- a/lisp/emacs-lisp/comp.el
+++ b/lisp/emacs-lisp/comp.el
@@ -1373,11 +1373,13 @@ the annotation emission."
(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.
- feature/native-comp updated (5a55a84 -> c324e02), Andrea Corallo, 2020/06/21
- feature/native-comp c37b544 01/12: Add native compiler dynamic scope support, Andrea Corallo, 2020/06/21
- feature/native-comp 47ab6c2 02/12: Add some testing for dynamic scope, Andrea Corallo, 2020/06/21
- feature/native-comp 29b2a08 03/12: Execute top level forms in the right lex/dyn scope.,
Andrea Corallo <=
- feature/native-comp decced8 04/12: Allow per function speed declaration, Andrea Corallo, 2020/06/21
- feature/native-comp 34117de 05/12: Add a test for speed -1, Andrea Corallo, 2020/06/21
- feature/native-comp 51df0ab 06/12: Do not native compile two functions to allow cc-mode hack, Andrea Corallo, 2020/06/21
- feature/native-comp 1179a1c 07/12: * Add a func-arity test for dynamic functions, Andrea Corallo, 2020/06/21
- feature/native-comp 89b6f56 09/12: * src/comp.c (Fcomp__compile_ctxt_to_file): Confine gcc optim level in [0, 3]., Andrea Corallo, 2020/06/21
- feature/native-comp cfb871a 08/12: * Handle correctly pure delaration specifier., Andrea Corallo, 2020/06/21
- feature/native-comp 0a70ed9 10/12: ; * src/comp.c (define_maybe_gc_or_quit): Fix a comment., Andrea Corallo, 2020/06/21
- feature/native-comp c324e02 12/12: Merge remote-tracking branch 'savahnna/master' into dev, Andrea Corallo, 2020/06/21
- feature/native-comp f0e9fdd 11/12: Two `load-history' eln related fixes., Andrea Corallo, 2020/06/21