aboutsummaryrefslogtreecommitdiffstats
path: root/src/comp.c
diff options
context:
space:
mode:
authorAndrea Corallo2024-05-03 22:21:20 +0200
committerAndrea Corallo2024-05-13 23:01:08 +0200
commit13ddfc201108bfc71c7fa9040ee9970e929070cf (patch)
tree29798a91facfff4daf7d88c69f95ad6d62a66018 /src/comp.c
parent595799edd3188a8992bbd08d0b29feaf184a092e (diff)
downloademacs-13ddfc201108bfc71c7fa9040ee9970e929070cf.tar.gz
emacs-13ddfc201108bfc71c7fa9040ee9970e929070cf.zip
Introduce 'compilation-safety' variable
* lisp/emacs-lisp/bytecomp.el (compilation-safety): New customize. * src/comp.c (comp_t): Add func_safety. (emit_call_with_type_hint, emit_call2_with_type_hint): Make use of. (compile_function): Set 'comp.func_safety'.
Diffstat (limited to 'src/comp.c')
-rw-r--r--src/comp.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/comp.c b/src/comp.c
index 4e779cdf898..e8945df63ff 100644
--- a/src/comp.c
+++ b/src/comp.c
@@ -633,6 +633,7 @@ typedef struct {
633 gcc_jit_function *func; /* Current function being compiled. */ 633 gcc_jit_function *func; /* Current function being compiled. */
634 bool func_has_non_local; /* From comp-func has-non-local slot. */ 634 bool func_has_non_local; /* From comp-func has-non-local slot. */
635 EMACS_INT func_speed; /* From comp-func speed slot. */ 635 EMACS_INT func_speed; /* From comp-func speed slot. */
636 EMACS_INT func_safety; /* From comp-func safety slot. */
636 gcc_jit_block *block; /* Current basic block being compiled. */ 637 gcc_jit_block *block; /* Current basic block being compiled. */
637 gcc_jit_lvalue *scratch; /* Used as scratch slot for some code sequence (switch). */ 638 gcc_jit_lvalue *scratch; /* Used as scratch slot for some code sequence (switch). */
638 ptrdiff_t frame_size; /* Size of the following array in elements. */ 639 ptrdiff_t frame_size; /* Size of the following array in elements. */
@@ -2586,7 +2587,8 @@ emit_call_with_type_hint (gcc_jit_function *func, Lisp_Object insn,
2586 Lisp_Object type) 2587 Lisp_Object type)
2587{ 2588{
2588 bool hint_match = 2589 bool hint_match =
2589 !NILP (CALL2I (comp-mvar-type-hint-match-p, SECOND (insn), type)); 2590 !comp.func_safety
2591 && !NILP (CALL2I (comp-mvar-type-hint-match-p, SECOND (insn), type));
2590 gcc_jit_rvalue *args[] = 2592 gcc_jit_rvalue *args[] =
2591 { emit_mvar_rval (SECOND (insn)), 2593 { emit_mvar_rval (SECOND (insn)),
2592 gcc_jit_context_new_rvalue_from_int (comp.ctxt, 2594 gcc_jit_context_new_rvalue_from_int (comp.ctxt,
@@ -2602,7 +2604,8 @@ emit_call2_with_type_hint (gcc_jit_function *func, Lisp_Object insn,
2602 Lisp_Object type) 2604 Lisp_Object type)
2603{ 2605{
2604 bool hint_match = 2606 bool hint_match =
2605 !NILP (CALL2I (comp-mvar-type-hint-match-p, SECOND (insn), type)); 2607 !comp.func_safety
2608 && !NILP (CALL2I (comp-mvar-type-hint-match-p, SECOND (insn), type));
2606 gcc_jit_rvalue *args[] = 2609 gcc_jit_rvalue *args[] =
2607 { emit_mvar_rval (SECOND (insn)), 2610 { emit_mvar_rval (SECOND (insn)),
2608 emit_mvar_rval (THIRD (insn)), 2611 emit_mvar_rval (THIRD (insn)),
@@ -4282,6 +4285,7 @@ compile_function (Lisp_Object func)
4282 4285
4283 comp.func_has_non_local = !NILP (CALL1I (comp-func-has-non-local, func)); 4286 comp.func_has_non_local = !NILP (CALL1I (comp-func-has-non-local, func));
4284 comp.func_speed = XFIXNUM (CALL1I (comp-func-speed, func)); 4287 comp.func_speed = XFIXNUM (CALL1I (comp-func-speed, func));
4288 comp.func_safety = XFIXNUM (CALL1I (comp-func-safety, func));
4285 4289
4286 comp.func_relocs_local = 4290 comp.func_relocs_local =
4287 gcc_jit_function_new_local (comp.func, 4291 gcc_jit_function_new_local (comp.func,