aboutsummaryrefslogtreecommitdiffstats
path: root/src/comp.c
diff options
context:
space:
mode:
authorAndrea Corallo2019-11-18 00:05:55 +0100
committerAndrea Corallo2020-01-01 11:38:07 +0100
commita99a3fbc40076aa3965feb759e816a8a25621c6a (patch)
treeeaebe86ace6fdbf3443d5347a8259db42ef4cd60 /src/comp.c
parent42b08f8a9ada7791c992894e88f648909e1ecc95 (diff)
downloademacs-a99a3fbc40076aa3965feb759e816a8a25621c6a.tar.gz
emacs-a99a3fbc40076aa3965feb759e816a8a25621c6a.zip
fix jump table emission when test fn is not eq
Diffstat (limited to 'src/comp.c')
-rw-r--r--src/comp.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/comp.c b/src/comp.c
index 8001580eba2..3687bdb86a9 100644
--- a/src/comp.c
+++ b/src/comp.c
@@ -146,6 +146,7 @@ typedef struct {
146 gcc_jit_block *block; /* Current basic block being compiled. */ 146 gcc_jit_block *block; /* Current basic block being compiled. */
147 gcc_jit_lvalue **frame; /* Frame for the current function. */ 147 gcc_jit_lvalue **frame; /* Frame for the current function. */
148 gcc_jit_lvalue **f_frame; /* "Floating" frame for the current function. */ 148 gcc_jit_lvalue **f_frame; /* "Floating" frame for the current function. */
149 gcc_jit_lvalue *scratch; /* Used as scratch slot for some code sequence (switch). */
149 gcc_jit_rvalue *most_positive_fixnum; 150 gcc_jit_rvalue *most_positive_fixnum;
150 gcc_jit_rvalue *most_negative_fixnum; 151 gcc_jit_rvalue *most_negative_fixnum;
151 gcc_jit_rvalue *one; 152 gcc_jit_rvalue *one;
@@ -301,6 +302,15 @@ static gcc_jit_lvalue *
301get_slot (Lisp_Object mvar) 302get_slot (Lisp_Object mvar)
302{ 303{
303 EMACS_INT slot_n = XFIXNUM (CALL1I (comp-mvar-slot, mvar)); 304 EMACS_INT slot_n = XFIXNUM (CALL1I (comp-mvar-slot, mvar));
305 if (slot_n == -1)
306 {
307 if (!comp.scratch)
308 comp.scratch = gcc_jit_function_new_local (comp.func,
309 NULL,
310 comp.lisp_obj_type,
311 "scratch");
312 return comp.scratch;
313 }
304 gcc_jit_lvalue **frame = 314 gcc_jit_lvalue **frame =
305 (CALL1I (comp-mvar-ref, mvar) || SPEED < 2) 315 (CALL1I (comp-mvar-ref, mvar) || SPEED < 2)
306 ? comp.frame : comp.f_frame; 316 ? comp.frame : comp.f_frame;
@@ -2823,6 +2833,8 @@ compile_function (Lisp_Object func)
2823 format_string ("local%u", i)); 2833 format_string ("local%u", i));
2824 } 2834 }
2825 2835
2836 comp.scratch = NULL;
2837
2826 comp.loc_handler = gcc_jit_function_new_local (comp.func, 2838 comp.loc_handler = gcc_jit_function_new_local (comp.func,
2827 NULL, 2839 NULL,
2828 comp.handler_ptr_type, 2840 comp.handler_ptr_type,