diff options
| author | Andrea Corallo | 2019-07-13 17:24:44 +0200 |
|---|---|---|
| committer | Andrea Corallo | 2020-01-01 11:33:53 +0100 |
| commit | fdbdf3da7f0dc09bb04a919b1840652b327b64b4 (patch) | |
| tree | ba41dac0c7a37ed41dae6a14bc66ab31e2ccd202 | |
| parent | 2e20dca7a090b3821e78451f83930b689f5499c7 (diff) | |
| download | emacs-fdbdf3da7f0dc09bb04a919b1840652b327b64b4.tar.gz emacs-fdbdf3da7f0dc09bb04a919b1840652b327b64b4.zip | |
symbol-value +1 test
| -rw-r--r-- | lisp/emacs-lisp/comp.el | 9 | ||||
| -rw-r--r-- | test/src/comp-tests.el | 16 |
2 files changed, 14 insertions, 11 deletions
diff --git a/lisp/emacs-lisp/comp.el b/lisp/emacs-lisp/comp.el index 712cade3829..2f3c6899337 100644 --- a/lisp/emacs-lisp/comp.el +++ b/lisp/emacs-lisp/comp.el | |||
| @@ -37,6 +37,8 @@ | |||
| 37 | 37 | ||
| 38 | (defconst comp-debug t) | 38 | (defconst comp-debug t) |
| 39 | 39 | ||
| 40 | (defvar comp-speed 2) | ||
| 41 | |||
| 40 | (defconst comp-passes '(comp-recuparate-lap | 42 | (defconst comp-passes '(comp-recuparate-lap |
| 41 | comp-limplify) | 43 | comp-limplify) |
| 42 | "Passes to be executed in order.") | 44 | "Passes to be executed in order.") |
| @@ -268,15 +270,16 @@ VAL is known at compile time." | |||
| 268 | (comp-pop 1)) | 270 | (comp-pop 1)) |
| 269 | ('byte-dup | 271 | ('byte-dup |
| 270 | (comp-push-slot-n (comp-sp))) | 272 | (comp-push-slot-n (comp-sp))) |
| 273 | ('byte-symbol-value | ||
| 274 | (comp-emit-set-call `(call Fsymbol_value ,(comp-slot)))) | ||
| 271 | ('byte-varref | 275 | ('byte-varref |
| 272 | (comp-push-call `(call Fsymbol_value ,(make-comp-mvar | 276 | (comp-push-call `(call Fsymbol_value ,(make-comp-mvar |
| 273 | :const-vld t | 277 | :const-vld t |
| 274 | :constant (cadr inst))))) | 278 | :constant (cadr inst))))) |
| 275 | ('byte-varset | 279 | ('byte-varset |
| 276 | (comp-emit `(call set_internal | 280 | (comp-emit `(call set_internal |
| 277 | ,(make-comp-mvar | 281 | ,(make-comp-mvar :const-vld t |
| 278 | :const-vld t | 282 | :constant (cadr inst)) |
| 279 | :constant (cadr inst)) | ||
| 280 | ,(comp-slot)))) | 283 | ,(comp-slot)))) |
| 281 | ('byte-constant | 284 | ('byte-constant |
| 282 | (comp-push-const (cadr inst))) | 285 | (comp-push-const (cadr inst))) |
diff --git a/test/src/comp-tests.el b/test/src/comp-tests.el index 00bb2e09321..1030900752d 100644 --- a/test/src/comp-tests.el +++ b/test/src/comp-tests.el | |||
| @@ -123,14 +123,14 @@ | |||
| 123 | 123 | ||
| 124 | (should (= (comp-tests-aref-aset-f) 100))) | 124 | (should (= (comp-tests-aref-aset-f) 100))) |
| 125 | 125 | ||
| 126 | ;; (ert-deftest comp-tests-symbol-value () | 126 | (ert-deftest comp-tests-symbol-value () |
| 127 | ;; "Testing aref and aset." | 127 | "Testing aref and aset." |
| 128 | ;; (defvar comp-tests-var2 3) | 128 | (defvar comp-tests-var2 3) |
| 129 | ;; (defun comp-tests-symbol-value-f () | 129 | (defun comp-tests-symbol-value-f () |
| 130 | ;; (symbol-value 'comp-tests-var2)) | 130 | (symbol-value 'comp-tests-var2)) |
| 131 | ;; (native-compile #'comp-tests-symbol-value-f) | 131 | (native-compile #'comp-tests-symbol-value-f) |
| 132 | 132 | ||
| 133 | ;; (should (= (comp-tests-symbol-value-f) 3))) | 133 | (should (= (comp-tests-symbol-value-f) 3))) |
| 134 | 134 | ||
| 135 | ;; (ert-deftest comp-tests-concat () | 135 | ;; (ert-deftest comp-tests-concat () |
| 136 | ;; "Testing concatX opcodes." | 136 | ;; "Testing concatX opcodes." |