diff options
Diffstat (limited to 'src/comp.c')
| -rw-r--r-- | src/comp.c | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/src/comp.c b/src/comp.c index cb5f1a1ce96..0d464281858 100644 --- a/src/comp.c +++ b/src/comp.c | |||
| @@ -1845,32 +1845,32 @@ emit_PURE_P (gcc_jit_rvalue *ptr) | |||
| 1845 | static gcc_jit_rvalue * | 1845 | static gcc_jit_rvalue * |
| 1846 | emit_mvar_rval (Lisp_Object mvar) | 1846 | emit_mvar_rval (Lisp_Object mvar) |
| 1847 | { | 1847 | { |
| 1848 | Lisp_Object const_vld = CALL1I (comp-mvar-const-vld, mvar); | 1848 | Lisp_Object const_vld = CALL1I (comp-mvar-value-vld-p, mvar); |
| 1849 | Lisp_Object constant = CALL1I (comp-mvar-constant, mvar); | ||
| 1850 | 1849 | ||
| 1851 | if (!NILP (const_vld)) | 1850 | if (!NILP (const_vld)) |
| 1852 | { | 1851 | { |
| 1852 | Lisp_Object value = CALL1I (comp-mvar-value, mvar); | ||
| 1853 | if (comp.debug > 1) | 1853 | if (comp.debug > 1) |
| 1854 | { | 1854 | { |
| 1855 | Lisp_Object func = | 1855 | Lisp_Object func = |
| 1856 | Fgethash (constant, | 1856 | Fgethash (value, |
| 1857 | CALL1I (comp-ctxt-byte-func-to-func-h, Vcomp_ctxt), | 1857 | CALL1I (comp-ctxt-byte-func-to-func-h, Vcomp_ctxt), |
| 1858 | Qnil); | 1858 | Qnil); |
| 1859 | 1859 | ||
| 1860 | emit_comment ( | 1860 | emit_comment ( |
| 1861 | SSDATA ( | 1861 | SSDATA ( |
| 1862 | Fprin1_to_string ( | 1862 | Fprin1_to_string ( |
| 1863 | NILP (func) ? constant : CALL1I (comp-func-c-name, func), | 1863 | NILP (func) ? value : CALL1I (comp-func-c-name, func), |
| 1864 | Qnil))); | 1864 | Qnil))); |
| 1865 | } | 1865 | } |
| 1866 | if (FIXNUMP (constant)) | 1866 | if (FIXNUMP (value)) |
| 1867 | { | 1867 | { |
| 1868 | /* We can still emit directly objects that are self-contained in a | 1868 | /* We can still emit directly objects that are self-contained in a |
| 1869 | word (read fixnums). */ | 1869 | word (read fixnums). */ |
| 1870 | return emit_rvalue_from_lisp_obj (constant); | 1870 | return emit_rvalue_from_lisp_obj (value); |
| 1871 | } | 1871 | } |
| 1872 | /* Other const objects are fetched from the reloc array. */ | 1872 | /* Other const objects are fetched from the reloc array. */ |
| 1873 | return emit_lisp_obj_rval (constant); | 1873 | return emit_lisp_obj_rval (value); |
| 1874 | } | 1874 | } |
| 1875 | 1875 | ||
| 1876 | return gcc_jit_lvalue_as_rvalue (emit_mvar_lval (mvar)); | 1876 | return gcc_jit_lvalue_as_rvalue (emit_mvar_lval (mvar)); |
| @@ -2371,12 +2371,13 @@ static gcc_jit_rvalue * | |||
| 2371 | emit_call_with_type_hint (gcc_jit_function *func, Lisp_Object insn, | 2371 | emit_call_with_type_hint (gcc_jit_function *func, Lisp_Object insn, |
| 2372 | Lisp_Object type) | 2372 | Lisp_Object type) |
| 2373 | { | 2373 | { |
| 2374 | bool type_hint = EQ (CALL1I (comp-mvar-type, SECOND (insn)), type); | 2374 | bool hint_match = |
| 2375 | !NILP (CALL2I (comp-mvar-type-hint-match-p, SECOND (insn), type)); | ||
| 2375 | gcc_jit_rvalue *args[] = | 2376 | gcc_jit_rvalue *args[] = |
| 2376 | { emit_mvar_rval (SECOND (insn)), | 2377 | { emit_mvar_rval (SECOND (insn)), |
| 2377 | gcc_jit_context_new_rvalue_from_int (comp.ctxt, | 2378 | gcc_jit_context_new_rvalue_from_int (comp.ctxt, |
| 2378 | comp.bool_type, | 2379 | comp.bool_type, |
| 2379 | type_hint) }; | 2380 | hint_match) }; |
| 2380 | 2381 | ||
| 2381 | return gcc_jit_context_new_call (comp.ctxt, NULL, func, 2, args); | 2382 | return gcc_jit_context_new_call (comp.ctxt, NULL, func, 2, args); |
| 2382 | } | 2383 | } |
| @@ -2386,13 +2387,14 @@ static gcc_jit_rvalue * | |||
| 2386 | emit_call2_with_type_hint (gcc_jit_function *func, Lisp_Object insn, | 2387 | emit_call2_with_type_hint (gcc_jit_function *func, Lisp_Object insn, |
| 2387 | Lisp_Object type) | 2388 | Lisp_Object type) |
| 2388 | { | 2389 | { |
| 2389 | bool type_hint = EQ (CALL1I (comp-mvar-type, SECOND (insn)), type); | 2390 | bool hint_match = |
| 2391 | !NILP (CALL2I (comp-mvar-type-hint-match-p, SECOND (insn), type)); | ||
| 2390 | gcc_jit_rvalue *args[] = | 2392 | gcc_jit_rvalue *args[] = |
| 2391 | { emit_mvar_rval (SECOND (insn)), | 2393 | { emit_mvar_rval (SECOND (insn)), |
| 2392 | emit_mvar_rval (THIRD (insn)), | 2394 | emit_mvar_rval (THIRD (insn)), |
| 2393 | gcc_jit_context_new_rvalue_from_int (comp.ctxt, | 2395 | gcc_jit_context_new_rvalue_from_int (comp.ctxt, |
| 2394 | comp.bool_type, | 2396 | comp.bool_type, |
| 2395 | type_hint) }; | 2397 | hint_match) }; |
| 2396 | 2398 | ||
| 2397 | return gcc_jit_context_new_call (comp.ctxt, NULL, func, 3, args); | 2399 | return gcc_jit_context_new_call (comp.ctxt, NULL, func, 3, args); |
| 2398 | } | 2400 | } |