diff options
| author | Stefan Kangas | 2025-01-14 00:35:51 +0100 |
|---|---|---|
| committer | Stefan Kangas | 2025-01-14 00:48:07 +0100 |
| commit | e6ad99e36c6c2e5322381f8af48cc283d2d899dc (patch) | |
| tree | c0230079db65c62e2f11f910ee99788fac467f04 /src/comp.c | |
| parent | 383de5c3f6f1ca7c8da7450d6e1716b43e9d2020 (diff) | |
| download | emacs-e6ad99e36c6c2e5322381f8af48cc283d2d899dc.tar.gz emacs-e6ad99e36c6c2e5322381f8af48cc283d2d899dc.zip | |
src/comp.c: New macro CALLNI
* src/comp.c (CALL0I, CALL1I, CALL2I, CALL4I): Delete macros.
(CALLNI): New macro, replacing the above. All callers updated.
Diffstat (limited to 'src/comp.c')
| -rw-r--r-- | src/comp.c | 122 |
1 files changed, 55 insertions, 67 deletions
diff --git a/src/comp.c b/src/comp.c index 8b56bcf0257..96b314b2709 100644 --- a/src/comp.c +++ b/src/comp.c | |||
| @@ -502,21 +502,9 @@ load_gccjit_if_necessary (bool mandatory) | |||
| 502 | #define THIRD(x) \ | 502 | #define THIRD(x) \ |
| 503 | XCAR (XCDR (XCDR (x))) | 503 | XCAR (XCDR (XCDR (x))) |
| 504 | 504 | ||
| 505 | /* Like call0 but stringify and intern. */ | 505 | /* Like calln but stringify and intern. */ |
| 506 | #define CALL0I(fun) \ | 506 | #define CALLNI(fun, ...) \ |
| 507 | calln (intern_c_string (STR (fun))) | 507 | calln (intern_c_string (STR (fun)), __VA_ARGS__) |
| 508 | |||
| 509 | /* Like call1 but stringify and intern. */ | ||
| 510 | #define CALL1I(fun, arg) \ | ||
| 511 | calln (intern_c_string (STR (fun)), arg) | ||
| 512 | |||
| 513 | /* Like call2 but stringify and intern. */ | ||
| 514 | #define CALL2I(fun, arg1, arg2) \ | ||
| 515 | calln (intern_c_string (STR (fun)), arg1, arg2) | ||
| 516 | |||
| 517 | /* Like call4 but stringify and intern. */ | ||
| 518 | #define CALL4I(fun, arg1, arg2, arg3, arg4) \ | ||
| 519 | calln (intern_c_string (STR (fun)), arg1, arg2, arg3, arg4) | ||
| 520 | 508 | ||
| 521 | #define DECL_BLOCK(name, func) \ | 509 | #define DECL_BLOCK(name, func) \ |
| 522 | gcc_jit_block *(name) = \ | 510 | gcc_jit_block *(name) = \ |
| @@ -904,7 +892,7 @@ declare_block (Lisp_Object block_name) | |||
| 904 | static gcc_jit_lvalue * | 892 | static gcc_jit_lvalue * |
| 905 | emit_mvar_lval (Lisp_Object mvar) | 893 | emit_mvar_lval (Lisp_Object mvar) |
| 906 | { | 894 | { |
| 907 | Lisp_Object mvar_slot = CALL1I (comp-mvar-slot, mvar); | 895 | Lisp_Object mvar_slot = CALLNI (comp-mvar-slot, mvar); |
| 908 | 896 | ||
| 909 | if (EQ (mvar_slot, Qscratch)) | 897 | if (EQ (mvar_slot, Qscratch)) |
| 910 | { | 898 | { |
| @@ -2022,22 +2010,22 @@ emit_PURE_P (gcc_jit_rvalue *ptr) | |||
| 2022 | static gcc_jit_rvalue * | 2010 | static gcc_jit_rvalue * |
| 2023 | emit_mvar_rval (Lisp_Object mvar) | 2011 | emit_mvar_rval (Lisp_Object mvar) |
| 2024 | { | 2012 | { |
| 2025 | Lisp_Object const_vld = CALL1I (comp-cstr-imm-vld-p, mvar); | 2013 | Lisp_Object const_vld = CALLNI (comp-cstr-imm-vld-p, mvar); |
| 2026 | 2014 | ||
| 2027 | if (!NILP (const_vld)) | 2015 | if (!NILP (const_vld)) |
| 2028 | { | 2016 | { |
| 2029 | Lisp_Object value = CALL1I (comp-cstr-imm, mvar); | 2017 | Lisp_Object value = CALLNI (comp-cstr-imm, mvar); |
| 2030 | if (comp.debug > 1) | 2018 | if (comp.debug > 1) |
| 2031 | { | 2019 | { |
| 2032 | Lisp_Object func = | 2020 | Lisp_Object func = |
| 2033 | Fgethash (value, | 2021 | Fgethash (value, |
| 2034 | CALL1I (comp-ctxt-byte-func-to-func-h, Vcomp_ctxt), | 2022 | CALLNI (comp-ctxt-byte-func-to-func-h, Vcomp_ctxt), |
| 2035 | Qnil); | 2023 | Qnil); |
| 2036 | 2024 | ||
| 2037 | emit_comment ( | 2025 | emit_comment ( |
| 2038 | SSDATA ( | 2026 | SSDATA ( |
| 2039 | Fprin1_to_string ( | 2027 | Fprin1_to_string ( |
| 2040 | NILP (func) ? value : CALL1I (comp-func-c-name, func), | 2028 | NILP (func) ? value : CALLNI (comp-func-c-name, func), |
| 2041 | Qnil, Qnil))); | 2029 | Qnil, Qnil))); |
| 2042 | } | 2030 | } |
| 2043 | if (FIXNUMP (value)) | 2031 | if (FIXNUMP (value)) |
| @@ -2158,7 +2146,7 @@ emit_limple_call_ref (Lisp_Object insn, bool direct) | |||
| 2158 | { | 2146 | { |
| 2159 | /* FIXME: See bug#42360. */ | 2147 | /* FIXME: See bug#42360. */ |
| 2160 | Lisp_Object first_arg = SECOND (insn); | 2148 | Lisp_Object first_arg = SECOND (insn); |
| 2161 | EMACS_INT first_slot = XFIXNUM (CALL1I (comp-mvar-slot, first_arg)); | 2149 | EMACS_INT first_slot = XFIXNUM (CALLNI (comp-mvar-slot, first_arg)); |
| 2162 | return emit_call_ref (callee, nargs, comp.frame[first_slot], direct); | 2150 | return emit_call_ref (callee, nargs, comp.frame[first_slot], direct); |
| 2163 | } | 2151 | } |
| 2164 | 2152 | ||
| @@ -2310,10 +2298,10 @@ emit_limple_insn (Lisp_Object insn) | |||
| 2310 | gcc_jit_block *target1 = retrieve_block (arg[2]); | 2298 | gcc_jit_block *target1 = retrieve_block (arg[2]); |
| 2311 | gcc_jit_block *target2 = retrieve_block (arg[3]); | 2299 | gcc_jit_block *target2 = retrieve_block (arg[3]); |
| 2312 | 2300 | ||
| 2313 | if ((!NILP (CALL1I (comp-cstr-imm-vld-p, arg[0])) | 2301 | if ((!NILP (CALLNI (comp-cstr-imm-vld-p, arg[0])) |
| 2314 | && NILP (CALL1I (comp-cstr-imm, arg[0]))) | 2302 | && NILP (CALLNI (comp-cstr-imm, arg[0]))) |
| 2315 | || (!NILP (CALL1I (comp-cstr-imm-vld-p, arg[1])) | 2303 | || (!NILP (CALLNI (comp-cstr-imm-vld-p, arg[1])) |
| 2316 | && NILP (CALL1I (comp-cstr-imm, arg[1])))) | 2304 | && NILP (CALLNI (comp-cstr-imm, arg[1])))) |
| 2317 | emit_cond_jump (emit_BASE_EQ (a, b), target1, target2); | 2305 | emit_cond_jump (emit_BASE_EQ (a, b), target1, target2); |
| 2318 | else | 2306 | else |
| 2319 | emit_cond_jump (emit_EQ (a, b), target1, target2); | 2307 | emit_cond_jump (emit_EQ (a, b), target1, target2); |
| @@ -2498,7 +2486,7 @@ emit_limple_insn (Lisp_Object insn) | |||
| 2498 | C: local[2] = list (nargs - 2, args); | 2486 | C: local[2] = list (nargs - 2, args); |
| 2499 | */ | 2487 | */ |
| 2500 | 2488 | ||
| 2501 | EMACS_INT slot_n = XFIXNUM (CALL1I (comp-mvar-slot, arg[0])); | 2489 | EMACS_INT slot_n = XFIXNUM (CALLNI (comp-mvar-slot, arg[0])); |
| 2502 | eassert (slot_n < INT_MAX); | 2490 | eassert (slot_n < INT_MAX); |
| 2503 | gcc_jit_rvalue *n = | 2491 | gcc_jit_rvalue *n = |
| 2504 | gcc_jit_context_new_rvalue_from_int (comp.ctxt, | 2492 | gcc_jit_context_new_rvalue_from_int (comp.ctxt, |
| @@ -2589,7 +2577,7 @@ emit_call_with_type_hint (gcc_jit_function *func, Lisp_Object insn, | |||
| 2589 | { | 2577 | { |
| 2590 | bool hint_match = | 2578 | bool hint_match = |
| 2591 | !comp.func_safety | 2579 | !comp.func_safety |
| 2592 | && !NILP (CALL2I (comp-mvar-type-hint-match-p, SECOND (insn), type)); | 2580 | && !NILP (CALLNI (comp-mvar-type-hint-match-p, SECOND (insn), type)); |
| 2593 | gcc_jit_rvalue *args[] = | 2581 | gcc_jit_rvalue *args[] = |
| 2594 | { emit_mvar_rval (SECOND (insn)), | 2582 | { emit_mvar_rval (SECOND (insn)), |
| 2595 | gcc_jit_context_new_rvalue_from_int (comp.ctxt, | 2583 | gcc_jit_context_new_rvalue_from_int (comp.ctxt, |
| @@ -2606,7 +2594,7 @@ emit_call2_with_type_hint (gcc_jit_function *func, Lisp_Object insn, | |||
| 2606 | { | 2594 | { |
| 2607 | bool hint_match = | 2595 | bool hint_match = |
| 2608 | !comp.func_safety | 2596 | !comp.func_safety |
| 2609 | && !NILP (CALL2I (comp-mvar-type-hint-match-p, SECOND (insn), type)); | 2597 | && !NILP (CALLNI (comp-mvar-type-hint-match-p, SECOND (insn), type)); |
| 2610 | gcc_jit_rvalue *args[] = | 2598 | gcc_jit_rvalue *args[] = |
| 2611 | { emit_mvar_rval (SECOND (insn)), | 2599 | { emit_mvar_rval (SECOND (insn)), |
| 2612 | emit_mvar_rval (THIRD (insn)), | 2600 | emit_mvar_rval (THIRD (insn)), |
| @@ -2896,9 +2884,9 @@ declare_imported_data_relocs (Lisp_Object container, const char *code_symbol, | |||
| 2896 | /* Imported objects. */ | 2884 | /* Imported objects. */ |
| 2897 | reloc_array_t res; | 2885 | reloc_array_t res; |
| 2898 | res.len = | 2886 | res.len = |
| 2899 | XFIXNUM (CALL1I (hash-table-count, | 2887 | XFIXNUM (CALLNI (hash-table-count, |
| 2900 | CALL1I (comp-data-container-idx, container))); | 2888 | CALLNI (comp-data-container-idx, container))); |
| 2901 | Lisp_Object d_reloc = CALL1I (comp-data-container-l, container); | 2889 | Lisp_Object d_reloc = CALLNI (comp-data-container-l, container); |
| 2902 | d_reloc = Fvconcat (1, &d_reloc); | 2890 | d_reloc = Fvconcat (1, &d_reloc); |
| 2903 | 2891 | ||
| 2904 | res.r_val = | 2892 | res.r_val = |
| @@ -2923,15 +2911,15 @@ declare_imported_data (void) | |||
| 2923 | { | 2911 | { |
| 2924 | /* Imported objects. */ | 2912 | /* Imported objects. */ |
| 2925 | comp.data_relocs = | 2913 | comp.data_relocs = |
| 2926 | declare_imported_data_relocs (CALL1I (comp-ctxt-d-default, Vcomp_ctxt), | 2914 | declare_imported_data_relocs (CALLNI (comp-ctxt-d-default, Vcomp_ctxt), |
| 2927 | DATA_RELOC_SYM, | 2915 | DATA_RELOC_SYM, |
| 2928 | TEXT_DATA_RELOC_SYM); | 2916 | TEXT_DATA_RELOC_SYM); |
| 2929 | comp.data_relocs_impure = | 2917 | comp.data_relocs_impure = |
| 2930 | declare_imported_data_relocs (CALL1I (comp-ctxt-d-impure, Vcomp_ctxt), | 2918 | declare_imported_data_relocs (CALLNI (comp-ctxt-d-impure, Vcomp_ctxt), |
| 2931 | DATA_RELOC_IMPURE_SYM, | 2919 | DATA_RELOC_IMPURE_SYM, |
| 2932 | TEXT_DATA_RELOC_IMPURE_SYM); | 2920 | TEXT_DATA_RELOC_IMPURE_SYM); |
| 2933 | comp.data_relocs_ephemeral = | 2921 | comp.data_relocs_ephemeral = |
| 2934 | declare_imported_data_relocs (CALL1I (comp-ctxt-d-ephemeral, Vcomp_ctxt), | 2922 | declare_imported_data_relocs (CALLNI (comp-ctxt-d-ephemeral, Vcomp_ctxt), |
| 2935 | DATA_RELOC_EPHEMERAL_SYM, | 2923 | DATA_RELOC_EPHEMERAL_SYM, |
| 2936 | TEXT_DATA_RELOC_EPHEMERAL_SYM); | 2924 | TEXT_DATA_RELOC_EPHEMERAL_SYM); |
| 2937 | } | 2925 | } |
| @@ -3020,7 +3008,7 @@ emit_ctxt_code (void) | |||
| 3020 | emit_static_object (TEXT_OPTIM_QLY_SYM, Flist (ARRAYELTS (opt_qly), opt_qly)); | 3008 | emit_static_object (TEXT_OPTIM_QLY_SYM, Flist (ARRAYELTS (opt_qly), opt_qly)); |
| 3021 | 3009 | ||
| 3022 | emit_static_object (TEXT_FDOC_SYM, | 3010 | emit_static_object (TEXT_FDOC_SYM, |
| 3023 | CALL1I (comp-ctxt-function-docs, Vcomp_ctxt)); | 3011 | CALLNI (comp-ctxt-function-docs, Vcomp_ctxt)); |
| 3024 | 3012 | ||
| 3025 | comp.current_thread_ref = | 3013 | comp.current_thread_ref = |
| 3026 | gcc_jit_lvalue_as_rvalue ( | 3014 | gcc_jit_lvalue_as_rvalue ( |
| @@ -4205,14 +4193,14 @@ static gcc_jit_function * | |||
| 4205 | declare_lex_function (Lisp_Object func) | 4193 | declare_lex_function (Lisp_Object func) |
| 4206 | { | 4194 | { |
| 4207 | gcc_jit_function *res; | 4195 | gcc_jit_function *res; |
| 4208 | Lisp_Object c_name = CALL1I (comp-func-c-name, func); | 4196 | Lisp_Object c_name = CALLNI (comp-func-c-name, func); |
| 4209 | Lisp_Object args = CALL1I (comp-func-l-args, func); | 4197 | Lisp_Object args = CALLNI (comp-func-l-args, func); |
| 4210 | bool nargs = !NILP (CALL1I (comp-nargs-p, args)); | 4198 | bool nargs = !NILP (CALLNI (comp-nargs-p, args)); |
| 4211 | USE_SAFE_ALLOCA; | 4199 | USE_SAFE_ALLOCA; |
| 4212 | 4200 | ||
| 4213 | if (!nargs) | 4201 | if (!nargs) |
| 4214 | { | 4202 | { |
| 4215 | EMACS_INT max_args = XFIXNUM (CALL1I (comp-args-max, args)); | 4203 | EMACS_INT max_args = XFIXNUM (CALLNI (comp-args-max, args)); |
| 4216 | eassert (max_args < INT_MAX); | 4204 | eassert (max_args < INT_MAX); |
| 4217 | gcc_jit_type **type; | 4205 | gcc_jit_type **type; |
| 4218 | SAFE_NALLOCA (type, 1, max_args); | 4206 | SAFE_NALLOCA (type, 1, max_args); |
| @@ -4263,15 +4251,15 @@ static void | |||
| 4263 | declare_function (Lisp_Object func) | 4251 | declare_function (Lisp_Object func) |
| 4264 | { | 4252 | { |
| 4265 | gcc_jit_function *gcc_func = | 4253 | gcc_jit_function *gcc_func = |
| 4266 | !NILP (CALL1I (comp-func-l-p, func)) | 4254 | !NILP (CALLNI (comp-func-l-p, func)) |
| 4267 | ? declare_lex_function (func) | 4255 | ? declare_lex_function (func) |
| 4268 | : gcc_jit_context_new_function (comp.ctxt, | 4256 | : gcc_jit_context_new_function (comp.ctxt, |
| 4269 | NULL, | 4257 | NULL, |
| 4270 | GCC_JIT_FUNCTION_EXPORTED, | 4258 | GCC_JIT_FUNCTION_EXPORTED, |
| 4271 | comp.lisp_obj_type, | 4259 | comp.lisp_obj_type, |
| 4272 | SSDATA (CALL1I (comp-func-c-name, func)), | 4260 | SSDATA (CALLNI (comp-func-c-name, func)), |
| 4273 | 0, NULL, 0); | 4261 | 0, NULL, 0); |
| 4274 | Fputhash (CALL1I (comp-func-c-name, func), | 4262 | Fputhash (CALLNI (comp-func-c-name, func), |
| 4275 | make_mint_ptr (gcc_func), | 4263 | make_mint_ptr (gcc_func), |
| 4276 | comp.exported_funcs_h); | 4264 | comp.exported_funcs_h); |
| 4277 | } | 4265 | } |
| @@ -4280,15 +4268,15 @@ static void | |||
| 4280 | compile_function (Lisp_Object func) | 4268 | compile_function (Lisp_Object func) |
| 4281 | { | 4269 | { |
| 4282 | USE_SAFE_ALLOCA; | 4270 | USE_SAFE_ALLOCA; |
| 4283 | comp.frame_size = XFIXNUM (CALL1I (comp-func-frame-size, func)); | 4271 | comp.frame_size = XFIXNUM (CALLNI (comp-func-frame-size, func)); |
| 4284 | eassert (comp.frame_size < INT_MAX); | 4272 | eassert (comp.frame_size < INT_MAX); |
| 4285 | 4273 | ||
| 4286 | comp.func = xmint_pointer (Fgethash (CALL1I (comp-func-c-name, func), | 4274 | comp.func = xmint_pointer (Fgethash (CALLNI (comp-func-c-name, func), |
| 4287 | comp.exported_funcs_h, Qnil)); | 4275 | comp.exported_funcs_h, Qnil)); |
| 4288 | 4276 | ||
| 4289 | comp.func_has_non_local = !NILP (CALL1I (comp-func-has-non-local, func)); | 4277 | comp.func_has_non_local = !NILP (CALLNI (comp-func-has-non-local, func)); |
| 4290 | comp.func_speed = XFIXNUM (CALL1I (comp-func-speed, func)); | 4278 | comp.func_speed = XFIXNUM (CALLNI (comp-func-speed, func)); |
| 4291 | comp.func_safety = XFIXNUM (CALL1I (comp-func-safety, func)); | 4279 | comp.func_safety = XFIXNUM (CALLNI (comp-func-safety, func)); |
| 4292 | 4280 | ||
| 4293 | comp.func_relocs_local = | 4281 | comp.func_relocs_local = |
| 4294 | gcc_jit_function_new_local (comp.func, | 4282 | gcc_jit_function_new_local (comp.func, |
| @@ -4340,7 +4328,7 @@ compile_function (Lisp_Object func) | |||
| 4340 | /* Pre-declare all basic blocks to gcc. | 4328 | /* Pre-declare all basic blocks to gcc. |
| 4341 | The "entry" block must be declared as first. */ | 4329 | The "entry" block must be declared as first. */ |
| 4342 | declare_block (Qentry); | 4330 | declare_block (Qentry); |
| 4343 | struct Lisp_Hash_Table *ht = XHASH_TABLE (CALL1I (comp-func-blocks, func)); | 4331 | struct Lisp_Hash_Table *ht = XHASH_TABLE (CALLNI (comp-func-blocks, func)); |
| 4344 | DOHASH (ht, block_name, block) | 4332 | DOHASH (ht, block_name, block) |
| 4345 | { | 4333 | { |
| 4346 | if (!EQ (block_name, Qentry)) | 4334 | if (!EQ (block_name, Qentry)) |
| @@ -4355,7 +4343,7 @@ compile_function (Lisp_Object func) | |||
| 4355 | 4343 | ||
| 4356 | DOHASH (ht, block_name, block) | 4344 | DOHASH (ht, block_name, block) |
| 4357 | { | 4345 | { |
| 4358 | Lisp_Object insns = CALL1I (comp-block-insns, block); | 4346 | Lisp_Object insns = CALLNI (comp-block-insns, block); |
| 4359 | if (NILP (block) || NILP (insns)) | 4347 | if (NILP (block) || NILP (insns)) |
| 4360 | xsignal1 (Qnative_ice, | 4348 | xsignal1 (Qnative_ice, |
| 4361 | build_string ("basic block is missing or empty")); | 4349 | build_string ("basic block is missing or empty")); |
| @@ -4372,7 +4360,7 @@ compile_function (Lisp_Object func) | |||
| 4372 | if (err) | 4360 | if (err) |
| 4373 | xsignal3 (Qnative_ice, | 4361 | xsignal3 (Qnative_ice, |
| 4374 | build_string ("failing to compile function"), | 4362 | build_string ("failing to compile function"), |
| 4375 | CALL1I (comp-func-name, func), | 4363 | CALLNI (comp-func-name, func), |
| 4376 | build_string (err)); | 4364 | build_string (err)); |
| 4377 | SAFE_FREE (); | 4365 | SAFE_FREE (); |
| 4378 | } | 4366 | } |
| @@ -4388,7 +4376,7 @@ static Lisp_Object loadsearch_re_list; | |||
| 4388 | static Lisp_Object | 4376 | static Lisp_Object |
| 4389 | make_directory_wrapper (Lisp_Object directory) | 4377 | make_directory_wrapper (Lisp_Object directory) |
| 4390 | { | 4378 | { |
| 4391 | CALL2I (make-directory, directory, Qt); | 4379 | CALLNI (make-directory, directory, Qt); |
| 4392 | return Qnil; | 4380 | return Qnil; |
| 4393 | } | 4381 | } |
| 4394 | 4382 | ||
| @@ -4556,9 +4544,9 @@ the latter is supposed to be used by the Emacs build procedure. */) | |||
| 4556 | base_dir = Fexpand_file_name (Vcomp_native_version_dir, base_dir); | 4544 | base_dir = Fexpand_file_name (Vcomp_native_version_dir, base_dir); |
| 4557 | if (comp_file_preloaded_p | 4545 | if (comp_file_preloaded_p |
| 4558 | || (!NILP (lisp_preloaded) | 4546 | || (!NILP (lisp_preloaded) |
| 4559 | && !NILP (Fmember (CALL1I (file-name-base, source_filename), | 4547 | && !NILP (Fmember (CALLNI (file-name-base, source_filename), |
| 4560 | Fmapcar (intern_c_string ("file-name-base"), | 4548 | Fmapcar (intern_c_string ("file-name-base"), |
| 4561 | CALL1I (split-string, lisp_preloaded)))))) | 4549 | CALLNI (split-string, lisp_preloaded)))))) |
| 4562 | base_dir = Fexpand_file_name (build_string ("preloaded"), base_dir); | 4550 | base_dir = Fexpand_file_name (build_string ("preloaded"), base_dir); |
| 4563 | 4551 | ||
| 4564 | return Fexpand_file_name (filename, base_dir); | 4552 | return Fexpand_file_name (filename, base_dir); |
| @@ -4909,12 +4897,12 @@ DEFUN ("comp--compile-ctxt-to-file0", Fcomp__compile_ctxt_to_file0, | |||
| 4909 | "libgccjit-0.dll"); | 4897 | "libgccjit-0.dll"); |
| 4910 | #endif | 4898 | #endif |
| 4911 | 4899 | ||
| 4912 | comp.speed = XFIXNUM (CALL1I (comp-ctxt-speed, Vcomp_ctxt)); | 4900 | comp.speed = XFIXNUM (CALLNI (comp-ctxt-speed, Vcomp_ctxt)); |
| 4913 | eassert (comp.speed < INT_MAX); | 4901 | eassert (comp.speed < INT_MAX); |
| 4914 | comp.debug = XFIXNUM (CALL1I (comp-ctxt-debug, Vcomp_ctxt)); | 4902 | comp.debug = XFIXNUM (CALLNI (comp-ctxt-debug, Vcomp_ctxt)); |
| 4915 | eassert (comp.debug < INT_MAX); | 4903 | eassert (comp.debug < INT_MAX); |
| 4916 | comp.driver_options = CALL1I (comp-ctxt-driver-options, Vcomp_ctxt); | 4904 | comp.driver_options = CALLNI (comp-ctxt-driver-options, Vcomp_ctxt); |
| 4917 | comp.compiler_options = CALL1I (comp-ctxt-compiler-options, Vcomp_ctxt); | 4905 | comp.compiler_options = CALLNI (comp-ctxt-compiler-options, Vcomp_ctxt); |
| 4918 | 4906 | ||
| 4919 | if (comp.debug) | 4907 | if (comp.debug) |
| 4920 | gcc_jit_context_set_bool_option (comp.ctxt, | 4908 | gcc_jit_context_set_bool_option (comp.ctxt, |
| @@ -4948,11 +4936,11 @@ DEFUN ("comp--compile-ctxt-to-file0", Fcomp__compile_ctxt_to_file0, | |||
| 4948 | #endif | 4936 | #endif |
| 4949 | 4937 | ||
| 4950 | comp.d_default_idx = | 4938 | comp.d_default_idx = |
| 4951 | CALL1I (comp-data-container-idx, CALL1I (comp-ctxt-d-default, Vcomp_ctxt)); | 4939 | CALLNI (comp-data-container-idx, CALLNI (comp-ctxt-d-default, Vcomp_ctxt)); |
| 4952 | comp.d_impure_idx = | 4940 | comp.d_impure_idx = |
| 4953 | CALL1I (comp-data-container-idx, CALL1I (comp-ctxt-d-impure, Vcomp_ctxt)); | 4941 | CALLNI (comp-data-container-idx, CALLNI (comp-ctxt-d-impure, Vcomp_ctxt)); |
| 4954 | comp.d_ephemeral_idx = | 4942 | comp.d_ephemeral_idx = |
| 4955 | CALL1I (comp-data-container-idx, CALL1I (comp-ctxt-d-ephemeral, Vcomp_ctxt)); | 4943 | CALLNI (comp-data-container-idx, CALLNI (comp-ctxt-d-ephemeral, Vcomp_ctxt)); |
| 4956 | 4944 | ||
| 4957 | emit_ctxt_code (); | 4945 | emit_ctxt_code (); |
| 4958 | 4946 | ||
| @@ -4970,7 +4958,7 @@ DEFUN ("comp--compile-ctxt-to-file0", Fcomp__compile_ctxt_to_file0, | |||
| 4970 | define_maybe_gc_or_quit (); | 4958 | define_maybe_gc_or_quit (); |
| 4971 | 4959 | ||
| 4972 | struct Lisp_Hash_Table *func_h = | 4960 | struct Lisp_Hash_Table *func_h = |
| 4973 | XHASH_TABLE (CALL1I (comp-ctxt-funcs-h, Vcomp_ctxt)); | 4961 | XHASH_TABLE (CALLNI (comp-ctxt-funcs-h, Vcomp_ctxt)); |
| 4974 | DOHASH (func_h, k, function) | 4962 | DOHASH (func_h, k, function) |
| 4975 | declare_function (function); | 4963 | declare_function (function); |
| 4976 | /* Compile all functions. Can't be done before because the | 4964 | /* Compile all functions. Can't be done before because the |
| @@ -5001,7 +4989,7 @@ DEFUN ("comp--compile-ctxt-to-file0", Fcomp__compile_ctxt_to_file0, | |||
| 5001 | format_string ("%s_libgccjit_repro.c", SSDATA (ebase_name))); | 4989 | format_string ("%s_libgccjit_repro.c", SSDATA (ebase_name))); |
| 5002 | 4990 | ||
| 5003 | Lisp_Object tmp_file = | 4991 | Lisp_Object tmp_file = |
| 5004 | CALL4I (make-temp-file, base_name, Qnil, build_string (".eln.tmp"), Qnil); | 4992 | CALLNI (make-temp-file, base_name, Qnil, build_string (".eln.tmp"), Qnil); |
| 5005 | 4993 | ||
| 5006 | Lisp_Object encoded_tmp_file = ENCODE_FILE (tmp_file); | 4994 | Lisp_Object encoded_tmp_file = ENCODE_FILE (tmp_file); |
| 5007 | #ifdef WINDOWSNT | 4995 | #ifdef WINDOWSNT |
| @@ -5018,8 +5006,8 @@ DEFUN ("comp--compile-ctxt-to-file0", Fcomp__compile_ctxt_to_file0, | |||
| 5018 | filename, | 5006 | filename, |
| 5019 | build_string (err)); | 5007 | build_string (err)); |
| 5020 | 5008 | ||
| 5021 | CALL1I (comp-clean-up-stale-eln, filename); | 5009 | CALLNI (comp-clean-up-stale-eln, filename); |
| 5022 | CALL2I (comp-delete-or-replace-file, filename, tmp_file); | 5010 | CALLNI (comp-delete-or-replace-file, filename, tmp_file); |
| 5023 | 5011 | ||
| 5024 | return filename; | 5012 | return filename; |
| 5025 | } | 5013 | } |
| @@ -5096,12 +5084,12 @@ static Lisp_Object | |||
| 5096 | helper_sanitizer_assert (Lisp_Object val, Lisp_Object type) | 5084 | helper_sanitizer_assert (Lisp_Object val, Lisp_Object type) |
| 5097 | { | 5085 | { |
| 5098 | if (!comp_sanitizer_active | 5086 | if (!comp_sanitizer_active |
| 5099 | || !NILP ((CALL2I (cl-typep, val, type)))) | 5087 | || !NILP ((CALLNI (cl-typep, val, type)))) |
| 5100 | return Qnil; | 5088 | return Qnil; |
| 5101 | 5089 | ||
| 5102 | AUTO_STRING (format, "Comp sanitizer FAIL for %s with type %s"); | 5090 | AUTO_STRING (format, "Comp sanitizer FAIL for %s with type %s"); |
| 5103 | CALLN (Fmessage, format, val, type); | 5091 | CALLN (Fmessage, format, val, type); |
| 5104 | CALL0I (backtrace); | 5092 | CALLNI (backtrace); |
| 5105 | xsignal2 (Qcomp_sanitizer_error, val, type); | 5093 | xsignal2 (Qcomp_sanitizer_error, val, type); |
| 5106 | 5094 | ||
| 5107 | return Qnil; | 5095 | return Qnil; |
| @@ -5209,7 +5197,7 @@ maybe_defer_native_compilation (Lisp_Object function_name, | |||
| 5209 | return; | 5197 | return; |
| 5210 | 5198 | ||
| 5211 | Lisp_Object src = | 5199 | Lisp_Object src = |
| 5212 | concat2 (CALL1I (file-name-sans-extension, Vload_true_file_name), | 5200 | concat2 (CALLNI (file-name-sans-extension, Vload_true_file_name), |
| 5213 | build_pure_c_string (".el")); | 5201 | build_pure_c_string (".el")); |
| 5214 | if (NILP (Ffile_exists_p (src))) | 5202 | if (NILP (Ffile_exists_p (src))) |
| 5215 | { | 5203 | { |