]> git.eshelyaron.com Git - emacs.git/commitdiff
optimize nil emission
authorAndrea Corallo <akrl@sdf.org>
Sun, 22 Sep 2019 17:13:32 +0000 (19:13 +0200)
committerAndrea Corallo <akrl@sdf.org>
Wed, 1 Jan 2020 10:37:53 +0000 (11:37 +0100)
src/comp.c

index 6daeae311c31d63d4a5901d860aa5ea7ec19df3e..afc7a3b18736c936b0994cedde985ce5b0e4a8ac 100644 (file)
@@ -803,6 +803,12 @@ emit_const_lisp_obj (Lisp_Object obj)
   emit_comment (format_string ("const lisp obj: %s",
                               SSDATA (Fprin1_to_string (obj, Qnil))));
 
+  if (Qnil == NULL && EQ (obj, Qnil))
+    return emit_cast (comp.lisp_obj_type,
+                     gcc_jit_context_new_rvalue_from_ptr (comp.ctxt,
+                                                          comp.void_ptr_type,
+                                                          NULL));
+
   Lisp_Object d_reloc_idx = FUNCALL1 (comp-ctxt-data-relocs-idx, Vcomp_ctxt);
   ptrdiff_t reloc_fixn = XFIXNUM (Fgethash (obj, d_reloc_idx, Qnil));
   gcc_jit_rvalue *reloc_n =