]> git.eshelyaron.com Git - emacs.git/commitdiff
update tests
authorAndrea Corallo <andrea_corallo@yahoo.it>
Tue, 9 Jul 2019 20:28:29 +0000 (22:28 +0200)
committerAndrea Corallo <akrl@sdf.org>
Wed, 1 Jan 2020 10:33:51 +0000 (11:33 +0100)
lisp/emacs-lisp/comp.el
test/src/comp-tests.el

index 93e3bf17b353459886690c6184edfafd6446d55a..e3cb868438605e76384e1e57104b14bc19e06d4f 100644 (file)
@@ -79,7 +79,7 @@ To be used when ncall-conv is nil.")
 
 (cl-defstruct (comp-mvar (:copier nil) (:constructor make--comp-mvar))
   "A meta-variable being a slot in the meta-stack."
-  (n nil :type number
+  (id nil :type number
      :documentation "SSA number")
   (slot nil :type fixnum
         :documentation "Slot position")
@@ -139,8 +139,11 @@ To be used when ncall-conv is nil.")
         (byte-compile (comp-func-symbol-name func)))
   (when comp-debug
     (cl-prettyprint byte-compile-lap-output))
-  (setf (comp-func-args func)
-        (comp-decrypt-lambda-list (aref (comp-func-byte-func func) 0)))
+  (let ((lambda-list (aref (comp-func-byte-func func) 0)))
+    (if (fixnump lambda-list)
+        (setf (comp-func-args func)
+              (comp-decrypt-lambda-list (aref (comp-func-byte-func func) 0)))
+      (error "Can't native compile a non lexical scoped function")))
   (setf (comp-func-ir func) byte-compile-lap-output)
   (setf (comp-func-frame-size func) (aref (comp-func-byte-func func) 3))
   func)
@@ -163,7 +166,7 @@ To be used when ncall-conv is nil.")
 (defvar comp-func)
 
 (cl-defun make-comp-mvar (&key slot const-vld constant type)
-  (make--comp-mvar :n (cl-incf (comp-func-limple-cnt comp-func))
+  (make--comp-mvar :id (cl-incf (comp-func-limple-cnt comp-func))
                    :slot slot :const-vld const-vld :constant constant
                    :type type))
 
@@ -207,11 +210,10 @@ To be used when ncall-conv is nil.")
   "Push VAL into frame.
 VAL is known at compile time."
   (cl-incf (comp-sp))
-  (let ((const (make-comp-mvar :slot (comp-sp)
+  (setf (comp-slot) (make-comp-mvar :slot (comp-sp)
                                     :const-vld t
-                                    :constant val)))
-    (setf (comp-slot) const)
-    (push (list '=const (comp-slot) const) comp-limple)))
+                                    :constant val))
+  (push (list '=const (comp-slot) val) comp-limple))
 
 (defun comp-push-block (bblock)
   "Push basic block BBLOCK."
@@ -307,8 +309,6 @@ VAL is known at compile time."
 
 (defun native-compile (fun)
   "FUN is the function definition to be compiled into native code."
-  (unless lexical-binding
-    (error "Can't native compile a non lexical scoped function"))
   (if-let ((f (symbol-function fun)))
       (progn
         (when (byte-code-function-p f)
index c6ee5b76855f4e9333aafe960a4cc0b9197c9b92..8d3a0f507d37324faa4b24477bf21bd7c26c2fc7 100644 (file)
@@ -26,6 +26,7 @@
 ;;; Code:
 
 (require 'ert)
+(require 'comp)
 
 (setq garbage-collection-messages t)
 
   (defun comp-tests-varset-f ()
       (setq comp-tests-var1 55))
   (comp-test-compile #'comp-tests-varset-f)
-((byte-constant 55 . 1)
- (byte-dup . 0)
- (byte-varset comp-tests-var1 . 0)
- (byte-return . 0))
 
   (comp-tests-varset-f)