]> git.eshelyaron.com Git - emacs.git/commitdiff
symbol-value +1 test
authorAndrea Corallo <andrea_corallo@yahoo.it>
Sat, 13 Jul 2019 15:24:44 +0000 (17:24 +0200)
committerAndrea Corallo <akrl@sdf.org>
Wed, 1 Jan 2020 10:33:53 +0000 (11:33 +0100)
lisp/emacs-lisp/comp.el
test/src/comp-tests.el

index 712cade38296d118957ac7424e5ee65c31b7532e..2f3c68993378fae798df43636a4304e8ad02a294 100644 (file)
@@ -37,6 +37,8 @@
 
 (defconst comp-debug t)
 
+(defvar comp-speed 2)
+
 (defconst comp-passes '(comp-recuparate-lap
                         comp-limplify)
   "Passes to be executed in order.")
@@ -268,15 +270,16 @@ VAL is known at compile time."
        (comp-pop 1))
       ('byte-dup
        (comp-push-slot-n (comp-sp)))
+      ('byte-symbol-value
+       (comp-emit-set-call `(call Fsymbol_value ,(comp-slot))))
       ('byte-varref
        (comp-push-call `(call Fsymbol_value ,(make-comp-mvar
                                               :const-vld t
                                               :constant (cadr inst)))))
       ('byte-varset
        (comp-emit `(call set_internal
-                         ,(make-comp-mvar
-                           :const-vld t
-                           :constant (cadr inst))
+                         ,(make-comp-mvar :const-vld t
+                                          :constant (cadr inst))
                          ,(comp-slot))))
       ('byte-constant
        (comp-push-const (cadr inst)))
index 00bb2e09321df4764c611ca08598821b893a5ddd..1030900752d24148d5650ba8cd442f13f3cca97b 100644 (file)
 
   (should (= (comp-tests-aref-aset-f) 100)))
 
-;; (ert-deftest  comp-tests-symbol-value ()
-;;   "Testing aref and aset."
-;;   (defvar comp-tests-var2 3)
-;;   (defun comp-tests-symbol-value-f ()
-;;     (symbol-value 'comp-tests-var2))
-;;   (native-compile #'comp-tests-symbol-value-f)
-
-;;   (should (= (comp-tests-symbol-value-f) 3)))
+(ert-deftest  comp-tests-symbol-value ()
+  "Testing aref and aset."
+  (defvar comp-tests-var2 3)
+  (defun comp-tests-symbol-value-f ()
+    (symbol-value 'comp-tests-var2))
+  (native-compile #'comp-tests-symbol-value-f)
+
+  (should (= (comp-tests-symbol-value-f) 3)))
 
 ;; (ert-deftest  comp-tests-concat ()
 ;;   "Testing concatX opcodes."