diff options
| author | Andrea Corallo | 2019-09-22 20:58:26 +0200 |
|---|---|---|
| committer | Andrea Corallo | 2020-01-01 11:37:53 +0100 |
| commit | 59d53e1fde516b911c29cedf338779df29f59dff (patch) | |
| tree | e84e2067dae2db49589af3628c8901b136979be8 /src | |
| parent | 84caa1a404cb89a6f02aa1cb517f5251e7e0e022 (diff) | |
| download | emacs-59d53e1fde516b911c29cedf338779df29f59dff.tar.gz emacs-59d53e1fde516b911c29cedf338779df29f59dff.zip | |
fix push handler propagation
Diffstat (limited to 'src')
| -rw-r--r-- | src/comp.c | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/src/comp.c b/src/comp.c index afc7a3b1873..4905dbfdcaf 100644 --- a/src/comp.c +++ b/src/comp.c | |||
| @@ -62,6 +62,8 @@ along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. */ | |||
| 62 | XCAR (XCDR (XCDR (x))) | 62 | XCAR (XCDR (XCDR (x))) |
| 63 | #define FORTH(x) \ | 63 | #define FORTH(x) \ |
| 64 | XCAR (XCDR (XCDR (XCDR (x)))) | 64 | XCAR (XCDR (XCDR (XCDR (x)))) |
| 65 | #define FIFTH(x) \ | ||
| 66 | XCAR (XCDR (XCDR (XCDR (XCDR (x))))) | ||
| 65 | 67 | ||
| 66 | #define FUNCALL1(fun, arg) \ | 68 | #define FUNCALL1(fun, arg) \ |
| 67 | CALLN (Ffuncall, intern_c_string (STR(fun)), arg) | 69 | CALLN (Ffuncall, intern_c_string (STR(fun)), arg) |
| @@ -1149,7 +1151,11 @@ emit_limple_push_handler (gcc_jit_rvalue *handler, gcc_jit_rvalue *handler_type, | |||
| 1149 | gcc_jit_block *handler_bb, gcc_jit_block *guarded_bb, | 1151 | gcc_jit_block *handler_bb, gcc_jit_block *guarded_bb, |
| 1150 | Lisp_Object clobbered_mvar) | 1152 | Lisp_Object clobbered_mvar) |
| 1151 | { | 1153 | { |
| 1152 | /* Ex: (push-handler #s(comp-mvar 6 0 t (arith-error) nil) 1 bb_3 bb_2). */ | 1154 | /* |
| 1155 | Ex: (push-handler #s(comp-mvar 1 8 nil nil nil nil) | ||
| 1156 | #s(comp-mvar 1 7 t done symbol nil) | ||
| 1157 | catcher bb_2 bb_1). | ||
| 1158 | */ | ||
| 1153 | 1159 | ||
| 1154 | static unsigned pushhandler_n; /* FIXME move at ctxt or func level. */ | 1160 | static unsigned pushhandler_n; /* FIXME move at ctxt or func level. */ |
| 1155 | 1161 | ||
| @@ -1158,8 +1164,7 @@ emit_limple_push_handler (gcc_jit_rvalue *handler, gcc_jit_rvalue *handler_type, | |||
| 1158 | gcc_jit_function_new_local (comp.func, | 1164 | gcc_jit_function_new_local (comp.func, |
| 1159 | NULL, | 1165 | NULL, |
| 1160 | comp.handler_ptr_type, | 1166 | comp.handler_ptr_type, |
| 1161 | format_string ("c_%u", | 1167 | format_string ("c_%u", pushhandler_n)); |
| 1162 | pushhandler_n)); | ||
| 1163 | 1168 | ||
| 1164 | gcc_jit_rvalue *args[] = { handler, handler_type }; | 1169 | gcc_jit_rvalue *args[] = { handler, handler_type }; |
| 1165 | gcc_jit_block_add_assignment ( | 1170 | gcc_jit_block_add_assignment ( |
| @@ -1263,9 +1268,10 @@ emit_limple_insn (Lisp_Object insn) | |||
| 1263 | { | 1268 | { |
| 1264 | gcc_jit_rvalue *handler = emit_mvar_val (arg0); | 1269 | gcc_jit_rvalue *handler = emit_mvar_val (arg0); |
| 1265 | int h_num UNINIT; | 1270 | int h_num UNINIT; |
| 1266 | if (EQ (SECOND (args), Qcatcher)) | 1271 | Lisp_Object handler_spec = THIRD (args); |
| 1272 | if (EQ (handler_spec, Qcatcher)) | ||
| 1267 | h_num = CATCHER; | 1273 | h_num = CATCHER; |
| 1268 | else if (EQ (SECOND (args), Qcondition_case)) | 1274 | else if (EQ (handler_spec, Qcondition_case)) |
| 1269 | h_num = CONDITION_CASE; | 1275 | h_num = CONDITION_CASE; |
| 1270 | else | 1276 | else |
| 1271 | ice ("incoherent insn"); | 1277 | ice ("incoherent insn"); |
| @@ -1273,8 +1279,8 @@ emit_limple_insn (Lisp_Object insn) | |||
| 1273 | gcc_jit_context_new_rvalue_from_int (comp.ctxt, | 1279 | gcc_jit_context_new_rvalue_from_int (comp.ctxt, |
| 1274 | comp.int_type, | 1280 | comp.int_type, |
| 1275 | h_num); | 1281 | h_num); |
| 1276 | gcc_jit_block *handler_bb = retrive_block (THIRD (args)); | 1282 | gcc_jit_block *handler_bb = retrive_block (FORTH (args)); |
| 1277 | gcc_jit_block *guarded_bb = retrive_block (FORTH (args)); | 1283 | gcc_jit_block *guarded_bb = retrive_block (FIFTH (args)); |
| 1278 | emit_limple_push_handler (handler, handler_type, handler_bb, guarded_bb, | 1284 | emit_limple_push_handler (handler, handler_type, handler_bb, guarded_bb, |
| 1279 | arg0); | 1285 | arg0); |
| 1280 | } | 1286 | } |