From 7720dceba1079151c37aa0a3117ac22dac45a119 Mon Sep 17 00:00:00 2001 From: Andrea Corallo Date: Thu, 8 Aug 2019 17:35:25 +0200 Subject: [PATCH] add record_unwind_current_buffer helper_unwind_protect support --- lisp/emacs-lisp/comp.el | 8 +++++--- src/comp.c | 5 +++++ 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/lisp/emacs-lisp/comp.el b/lisp/emacs-lisp/comp.el index 169a124cc1a..7fa723fc88b 100644 --- a/lisp/emacs-lisp/comp.el +++ b/lisp/emacs-lisp/comp.el @@ -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) diff --git a/src/comp.c b/src/comp.c index 5c5551c8da8..29fd9ce4f2e 100644 --- a/src/comp.c +++ b/src/comp.c @@ -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"); } -- 2.39.5