diff options
| author | Andrea Corallo | 2019-06-11 19:41:34 +0200 |
|---|---|---|
| committer | Andrea Corallo | 2020-01-01 11:33:41 +0100 |
| commit | b3d858da8d577449e2ab40572422fdd1bdf8b538 (patch) | |
| tree | 0a61c585fc9f1f8e889b0366c51d2592f45dc32e | |
| parent | 4da353c6a3900ddacab00d685432fba12099dbd0 (diff) | |
| download | emacs-b3d858da8d577449e2ab40572422fdd1bdf8b538.tar.gz emacs-b3d858da8d577449e2ab40572422fdd1bdf8b538.zip | |
inline consp
| -rw-r--r-- | src/comp.c | 16 | ||||
| -rw-r--r-- | test/src/comp-tests.el | 9 |
2 files changed, 24 insertions, 1 deletions
diff --git a/src/comp.c b/src/comp.c index 823956e147a..93edd4df452 100644 --- a/src/comp.c +++ b/src/comp.c | |||
| @@ -330,6 +330,12 @@ comp_TAGGEDP (gcc_jit_rvalue *obj, unsigned tag) | |||
| 330 | } | 330 | } |
| 331 | 331 | ||
| 332 | static gcc_jit_rvalue * | 332 | static gcc_jit_rvalue * |
| 333 | comp_CONSP (gcc_jit_rvalue *obj) | ||
| 334 | { | ||
| 335 | return comp_TAGGEDP(obj, Lisp_Cons); | ||
| 336 | } | ||
| 337 | |||
| 338 | static gcc_jit_rvalue * | ||
| 333 | comp_FIXNUMP (gcc_jit_rvalue *obj) | 339 | comp_FIXNUMP (gcc_jit_rvalue *obj) |
| 334 | { | 340 | { |
| 335 | /* (! (((unsigned) (XLI (x) >> (USE_LSB_TAG ? 0 : FIXNUM_BITS)) | 341 | /* (! (((unsigned) (XLI (x) >> (USE_LSB_TAG ? 0 : FIXNUM_BITS)) |
| @@ -1004,7 +1010,15 @@ compile_f (const char *f_name, ptrdiff_t bytestr_length, | |||
| 1004 | 1010 | ||
| 1005 | CASE_CALL_NARGS (nth, 2); | 1011 | CASE_CALL_NARGS (nth, 2); |
| 1006 | CASE_CALL_NARGS (symbolp, 1); | 1012 | CASE_CALL_NARGS (symbolp, 1); |
| 1007 | CASE_CALL_NARGS (consp, 1); | 1013 | |
| 1014 | case Bconsp: | ||
| 1015 | gcc_jit_block_add_assignment ( | ||
| 1016 | comp.bblock->gcc_bb, | ||
| 1017 | NULL, | ||
| 1018 | TOS, | ||
| 1019 | comp_CONSP(gcc_jit_lvalue_as_rvalue (TOS))); | ||
| 1020 | break; | ||
| 1021 | |||
| 1008 | CASE_CALL_NARGS (stringp, 1); | 1022 | CASE_CALL_NARGS (stringp, 1); |
| 1009 | CASE_CALL_NARGS (listp, 1); | 1023 | CASE_CALL_NARGS (listp, 1); |
| 1010 | CASE_CALL_NARGS (eq, 2); | 1024 | CASE_CALL_NARGS (eq, 2); |
diff --git a/test/src/comp-tests.el b/test/src/comp-tests.el index 74ed33a43cf..63dfafafb04 100644 --- a/test/src/comp-tests.el +++ b/test/src/comp-tests.el | |||
| @@ -272,6 +272,15 @@ | |||
| 272 | (should (equal (comp-bubble-sort-f list1) | 272 | (should (equal (comp-bubble-sort-f list1) |
| 273 | (sort list2 #'<))))) | 273 | (sort list2 #'<))))) |
| 274 | 274 | ||
| 275 | (ert-deftest comp-tests-list-inline () | ||
| 276 | "Test some inlined list functions." | ||
| 277 | (defun comp-tests-consp-f (x) | ||
| 278 | ;; Bconsp | ||
| 279 | (consp x)) | ||
| 280 | |||
| 281 | (should (eq (comp-tests-consp-f '(1)) t)) | ||
| 282 | (should (eq (comp-tests-consp-f 1) nil))) | ||
| 283 | |||
| 275 | (ert-deftest comp-tests-gc () | 284 | (ert-deftest comp-tests-gc () |
| 276 | "Try to do some longer computation to let the gc kick in." | 285 | "Try to do some longer computation to let the gc kick in." |
| 277 | (dotimes (_ 100000) | 286 | (dotimes (_ 100000) |