]> git.eshelyaron.com Git - emacs.git/commitdiff
locals to array
authorAndrea Corallo <andrea_corallo@yahoo.it>
Sun, 23 Jun 2019 16:50:21 +0000 (18:50 +0200)
committerAndrea Corallo <akrl@sdf.org>
Wed, 1 Jan 2020 10:33:44 +0000 (11:33 +0100)
src/comp.c

index 1bbf1a0136e6bbbbeeacdb1ad65df73528f355e8..296f215cd27dbd204b122726d1bbc802bf8d40ae 100644 (file)
@@ -1367,11 +1367,24 @@ compile_f (const char *f_name, ptrdiff_t bytestr_length,
   comp.func = emit_func_declare (f_name, comp.lisp_obj_type, comp_res.max_args,
                                 NULL, GCC_JIT_FUNCTION_EXPORTED, false);
 
+  gcc_jit_lvalue *meta_stack_array =
+    gcc_jit_function_new_local (
+      comp.func,
+      NULL,
+      gcc_jit_context_new_array_type (comp.ctxt,
+                                     NULL,
+                                     comp.lisp_obj_type,
+                                     stack_depth),
+      "local");
+
   for (int i = 0; i < stack_depth; ++i)
-    stack[i] = gcc_jit_function_new_local (comp.func,
-                                          NULL,
-                                          comp.lisp_obj_type,
-                                          format_string ("local_%d", i));
+    stack[i] = gcc_jit_context_new_array_access (
+                comp.ctxt,
+                NULL,
+                gcc_jit_lvalue_as_rvalue (meta_stack_array),
+                gcc_jit_context_new_rvalue_from_int (comp.ctxt,
+                                                     comp.int_type,
+                                                     i));
 
   gcc_jit_block *prologue_bb =
     gcc_jit_function_new_block (comp.func, "prologue");