aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAndrea Corallo2019-06-16 16:34:14 +0200
committerAndrea Corallo2020-01-01 11:33:42 +0100
commit72e2d6752ce09e8fb75f1ddc5094e7810eefebcc (patch)
tree0a6c2153966baaa73b62a929a0bed65b6e83ca59 /src
parentbb45450e4b63c4a40689b8b797de275713197a79 (diff)
downloademacs-72e2d6752ce09e8fb75f1ddc5094e7810eefebcc.tar.gz
emacs-72e2d6752ce09e8fb75f1ddc5094e7810eefebcc.zip
some renaming convention
Diffstat (limited to 'src')
-rw-r--r--src/comp.c49
1 files changed, 21 insertions, 28 deletions
diff --git a/src/comp.c b/src/comp.c
index 4f50c1cc7c2..2da173f7231 100644
--- a/src/comp.c
+++ b/src/comp.c
@@ -122,23 +122,28 @@ along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. */
122/* With most of the ops we need to do the same stuff so this macros are meant 122/* With most of the ops we need to do the same stuff so this macros are meant
123 to save some typing. */ 123 to save some typing. */
124 124
125/* Generate appropriate case and emit convential calls to function. */ 125/* Pop from the meta-stack, emit the call and push the result */
126
127#define EMIT_CALL_N(name, nargs) \
128 POP##nargs; \
129 res = emit_call (name, comp.lisp_obj_type, nargs, args); \
130 PUSH_RVAL (res);
131
132/* Generate appropriate case and emit call to function. */
126 133
127#define CASE_CALL_NARGS(name, nargs) \ 134#define CASE_CALL_NARGS(name, nargs) \
128 case B##name: \ 135 case B##name: \
129 POP##nargs; \ 136 EMIT_CALL_N (STR(F##name), nargs) \
130 res = emit_call (STR(F##name), comp.lisp_obj_type, nargs, args); \
131 PUSH_RVAL (res); \
132 break 137 break
133 138
134/* Emit calls to functions with prototype (ptrdiff_t nargs, Lisp_Object *args) 139/* Emit calls to functions with prototype (ptrdiff_t nargs, Lisp_Object *args)
135 This is done aggregating args into the scratch_call_area. */ 140 This is done aggregating args into the scratch_call_area. */
136 141
137#define EMIT_SCRATCH_CALL_N(name, nargs) \ 142#define EMIT_SCRATCH_CALL_N(name, nargs) \
138 do { \ 143 do { \
139 pop (nargs, &stack, args); \ 144 pop (nargs, &stack, args); \
140 res = emit_callN (name, nargs, args); \ 145 res = emit_scratch_callN (name, nargs, args); \
141 PUSH_RVAL (res); \ 146 PUSH_RVAL (res); \
142 } while (0) 147 } while (0)
143 148
144#define EMIT_ARITHCOMPARE(comparison) \ 149#define EMIT_ARITHCOMPARE(comparison) \
@@ -151,7 +156,6 @@ along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. */
151 PUSH_RVAL (res); \ 156 PUSH_RVAL (res); \
152 } while (0) 157 } while (0)
153 158
154
155typedef struct { 159typedef struct {
156 gcc_jit_block *gcc_bb; 160 gcc_jit_block *gcc_bb;
157 bool terminated; 161 bool terminated;
@@ -671,7 +675,7 @@ emit_lisp_obj_from_ptr (basic_block_t *bblock, void *p)
671} 675}
672 676
673static gcc_jit_rvalue * 677static gcc_jit_rvalue *
674emit_callN (const char *f_name, unsigned nargs, gcc_jit_rvalue **args) 678emit_scratch_callN (const char *f_name, unsigned nargs, gcc_jit_rvalue **args)
675{ 679{
676 /* Here we set all the pointers into the scratch call area. */ 680 /* Here we set all the pointers into the scratch call area. */
677 /* TODO: distinguish primitives for faster calling convention. */ 681 /* TODO: distinguish primitives for faster calling convention. */
@@ -1303,7 +1307,7 @@ compile_f (const char *f_name, ptrdiff_t bytestr_length,
1303 { 1307 {
1304 ptrdiff_t nargs = op + 1; 1308 ptrdiff_t nargs = op + 1;
1305 pop (nargs, &stack, args); 1309 pop (nargs, &stack, args);
1306 res = emit_callN ("Ffuncall", nargs, args); 1310 res = emit_scratch_callN ("Ffuncall", nargs, args);
1307 PUSH_RVAL (res); 1311 PUSH_RVAL (res);
1308 break; 1312 break;
1309 } 1313 }
@@ -1781,10 +1785,7 @@ compile_f (const char *f_name, ptrdiff_t bytestr_length,
1781 break; 1785 break;
1782 1786
1783 case Bsave_window_excursion: /* Obsolete since 24.1. */ 1787 case Bsave_window_excursion: /* Obsolete since 24.1. */
1784 POP1; 1788 EMIT_CALL_N ("helper_save_window_excursion", 1);
1785 res = emit_call ("helper_save_window_excursion",
1786 comp.lisp_obj_type, 1, args);
1787 PUSH_RVAL (res);
1788 break; 1789 break;
1789 1790
1790 case Bsave_restriction: 1791 case Bsave_restriction:
@@ -1843,15 +1844,11 @@ compile_f (const char *f_name, ptrdiff_t bytestr_length,
1843 CASE_CALL_NARGS (downcase, 1); 1844 CASE_CALL_NARGS (downcase, 1);
1844 1845
1845 case Bstringeqlsign: 1846 case Bstringeqlsign:
1846 POP2; 1847 EMIT_CALL_N ("Fstring_equal", 2);
1847 res = emit_call ("Fstring_equal", comp.lisp_obj_type, 2, args);
1848 PUSH_RVAL (res);
1849 break; 1848 break;
1850 1849
1851 case Bstringlss: 1850 case Bstringlss:
1852 POP2; 1851 EMIT_CALL_N ("Fstring_lessp", 2);
1853 res = emit_call ("Fstring_lessp", comp.lisp_obj_type, 2, args);
1854 PUSH_RVAL (res);
1855 break; 1852 break;
1856 1853
1857 CASE_CALL_NARGS (equal, 2); 1854 CASE_CALL_NARGS (equal, 2);
@@ -1863,15 +1860,11 @@ compile_f (const char *f_name, ptrdiff_t bytestr_length,
1863 CASE_CALL_NARGS (setcdr, 2); 1860 CASE_CALL_NARGS (setcdr, 2);
1864 1861
1865 case Bcar_safe: 1862 case Bcar_safe:
1866 POP2; 1863 EMIT_CALL_N ("CAR_SAFE", 1);
1867 res = emit_call ("CAR_SAFE", comp.lisp_obj_type, 1, args);
1868 PUSH_RVAL (res);
1869 break; 1864 break;
1870 1865
1871 case Bcdr_safe: 1866 case Bcdr_safe:
1872 POP2; 1867 EMIT_CALL_N ("CDR_SAFE", 1);
1873 res = emit_call ("CDR_SAFE", comp.lisp_obj_type, 1, args);
1874 PUSH_RVAL (res);
1875 break; 1868 break;
1876 1869
1877 case Bnconc: 1870 case Bnconc: