]> git.eshelyaron.com Git - emacs.git/commitdiff
add record_unwind_current_buffer helper_unwind_protect support
authorAndrea Corallo <andrea_corallo@yahoo.it>
Thu, 8 Aug 2019 15:35:25 +0000 (17:35 +0200)
committerAndrea Corallo <akrl@sdf.org>
Wed, 1 Jan 2020 10:33:57 +0000 (11:33 +0100)
lisp/emacs-lisp/comp.el
src/comp.c

index 169a124cc1adc4b37bd8fe6c4fbe2ee02a86ebcb..7fa723fc88ba791bf731347473aad71020bed2f1 100644 (file)
@@ -573,7 +573,8 @@ the annotation emission."
       (byte-bobp auto)
       (byte-current-buffer auto)
       (byte-set-buffer auto)
-      (byte-save-current-buffer)
+      (byte-save-current-buffer
+       (comp-emit '(call record_unwind_current_buffer)))
       (byte-set-mark-OBSOLETE)
       (byte-interactive-p-OBSOLETE)
       (byte-forward-char auto)
@@ -603,7 +604,7 @@ the annotation emission."
        (comp-emit-cond-jump (comp-slot-next) (make-comp-mvar :constant nil) 1
                             (cl-third insn) t))
       (byte-return
-       (comp-emit (list 'return (comp-slot-next)))
+       (comp-emit `(return ,(comp-slot-next)))
        (comp-mark-block-closed))
       (byte-discard 'pass)
       (byte-dup
@@ -612,7 +613,8 @@ the annotation emission."
       (byte-save-window-excursion-OBSOLETE)
       (byte-save-restriction)
       (byte-catch)
-      (byte-unwind-protect)
+      (byte-unwind-protect
+       (comp-emit '(call helper_unwind_protect)))
       (byte-condition-case)
       (byte-temp-output-buffer-setup-OBSOLETE)
       (byte-temp-output-buffer-show-OBSOLETE)
index 5c5551c8da87c5eaada63342be5515a7d01c9038..29fd9ce4f2ecaa23ba617623e24cbfc71a8f4cb3 100644 (file)
@@ -1093,6 +1093,11 @@ emit_limple_call (Lisp_Object arg1)
                                                         SET_INTERNAL_SET);
       return emit_call ("set_internal", comp.void_type , 4, gcc_args);
     }
+  else if (!strcmp (calle, "record_unwind_current_buffer") ||
+          !strcmp (calle, "helper_unwind_protect"))
+    {
+      return emit_call (calle, comp.void_type, 0, NULL);
+    }
   error ("LIMPLE call is inconsistent");
 }