From: Andrea Corallo Date: Fri, 24 May 2019 14:32:25 +0000 (+0200) Subject: store ffuncall with all other functions X-Git-Tag: emacs-28.0.90~2727^2~1526 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=2a5c81a5c92d15e8db471d16f3a014a338f9c271;p=emacs.git store ffuncall with all other functions --- diff --git a/src/comp.c b/src/comp.c index feec3c965e0..2e5f3342cbd 100644 --- a/src/comp.c +++ b/src/comp.c @@ -110,7 +110,6 @@ typedef struct { gcc_jit_type *void_ptr_type; gcc_jit_type *ptrdiff_type; gcc_jit_function *func; /* Current function being compiled */ - gcc_jit_function *Ffuncall; /* Current function being compiled */ gcc_jit_rvalue *scratch; /* Will point to scratch_call_area */ gcc_jit_block *block; /* Current basic block */ Lisp_Object func_hash; /* f_name -> gcc_func */ @@ -273,8 +272,7 @@ jit_emit_call (const char *f_name, gcc_jit_type *ret_type, unsigned nargs, } static gcc_jit_lvalue * -jit_emit_callN (gcc_jit_function *func, unsigned nargs, - gcc_jit_rvalue **args) +jit_emit_callN (const char *f_name, unsigned nargs, gcc_jit_rvalue **args) { /* Here we set all the pointers into the scratch call area. */ /* TODO: distinguish primitives for faster calling convention. */ @@ -320,18 +318,7 @@ jit_emit_callN (gcc_jit_function *func, unsigned nargs, nargs); args[1] = comp.scratch; - gcc_jit_lvalue *res = gcc_jit_function_new_local(comp.func, - NULL, - comp.lisp_obj_type, - "res"); - gcc_jit_block_add_assignment(comp.block, NULL, - res, - gcc_jit_context_new_call(comp.ctxt, - NULL, - func, - 2, - args)); - return res; + return jit_emit_call (f_name, comp.lisp_obj_type, 2, args); } static comp_f_res_t @@ -513,7 +500,7 @@ compile_f (const char *f_name, ptrdiff_t bytestr_length, { ptrdiff_t nargs = op + 1; pop (nargs, &stack, args); - res = jit_emit_callN (comp.Ffuncall, nargs, args); + res = jit_emit_callN ("Ffuncall", nargs, args); PUSH (gcc_jit_lvalue_as_rvalue (res)); break; } @@ -1090,25 +1077,6 @@ init_comp (void) comp.ptrdiff_type = gcc_jit_context_get_type(comp.ctxt, ptrdiff_t_gcc); - gcc_jit_param *funcall_param[2] = { - gcc_jit_context_new_param(comp.ctxt, - NULL, - comp.ptrdiff_type, - "nargs"), - gcc_jit_context_new_param(comp.ctxt, - NULL, - gcc_jit_type_get_pointer (comp.lisp_obj_type), - "args") }; - - comp.Ffuncall = - gcc_jit_context_new_function(comp.ctxt, NULL, - GCC_JIT_FUNCTION_IMPORTED, - comp.lisp_obj_type, - "Ffuncall", - 2, - funcall_param, - 0); - comp.scratch = gcc_jit_lvalue_get_address( gcc_jit_context_new_global (comp.ctxt, NULL,