aboutsummaryrefslogtreecommitdiffstats
path: root/src/comp.c
diff options
context:
space:
mode:
authorAndrea Corallo2019-06-23 18:50:21 +0200
committerAndrea Corallo2020-01-01 11:33:44 +0100
commit5637eae4a4a1be757f5f203c7e08ec5cf1a69c03 (patch)
tree60973284ea4f91657723fbb7acefa703f44d72eb /src/comp.c
parent3a64ec8021fee9694ead7b551d4ecbe7ef8ea869 (diff)
downloademacs-5637eae4a4a1be757f5f203c7e08ec5cf1a69c03.tar.gz
emacs-5637eae4a4a1be757f5f203c7e08ec5cf1a69c03.zip
locals to array
Diffstat (limited to 'src/comp.c')
-rw-r--r--src/comp.c21
1 files changed, 17 insertions, 4 deletions
diff --git a/src/comp.c b/src/comp.c
index 1bbf1a0136e..296f215cd27 100644
--- a/src/comp.c
+++ b/src/comp.c
@@ -1367,11 +1367,24 @@ compile_f (const char *f_name, ptrdiff_t bytestr_length,
1367 comp.func = emit_func_declare (f_name, comp.lisp_obj_type, comp_res.max_args, 1367 comp.func = emit_func_declare (f_name, comp.lisp_obj_type, comp_res.max_args,
1368 NULL, GCC_JIT_FUNCTION_EXPORTED, false); 1368 NULL, GCC_JIT_FUNCTION_EXPORTED, false);
1369 1369
1370 gcc_jit_lvalue *meta_stack_array =
1371 gcc_jit_function_new_local (
1372 comp.func,
1373 NULL,
1374 gcc_jit_context_new_array_type (comp.ctxt,
1375 NULL,
1376 comp.lisp_obj_type,
1377 stack_depth),
1378 "local");
1379
1370 for (int i = 0; i < stack_depth; ++i) 1380 for (int i = 0; i < stack_depth; ++i)
1371 stack[i] = gcc_jit_function_new_local (comp.func, 1381 stack[i] = gcc_jit_context_new_array_access (
1372 NULL, 1382 comp.ctxt,
1373 comp.lisp_obj_type, 1383 NULL,
1374 format_string ("local_%d", i)); 1384 gcc_jit_lvalue_as_rvalue (meta_stack_array),
1385 gcc_jit_context_new_rvalue_from_int (comp.ctxt,
1386 comp.int_type,
1387 i));
1375 1388
1376 gcc_jit_block *prologue_bb = 1389 gcc_jit_block *prologue_bb =
1377 gcc_jit_function_new_block (comp.func, "prologue"); 1390 gcc_jit_function_new_block (comp.func, "prologue");