all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* please review new branch feature/byte-unwind-protect
@ 2018-01-23  5:20 Tom Tromey
  2018-01-23  8:47 ` John Wiegley
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Tom Tromey @ 2018-01-23  5:20 UTC (permalink / raw)
  To: emacs-devel

Hi.

I recently wrote a couple of patches to add two new bytecodes to Emacs.
These make it possible to compile unwind-protect without the need to
introduce a closure for the unwind forms.

I've pushed these to feature/byte-unwind-protect.  They seem to be
working pretty well, so I would appreciate a review.  I'd like to merge
these to trunk.

The first patch changes the C code so that a CATCHER_ALL handler sees
both signals and throws.  In addition to being needed for the second
patch, this allowed some simplifications in the module code.  Note that
this changes the interface exposed by internal_catch_all, but as there
is only one caller, it is easy to verify that the change doesn't matter.

The second patch adds the new bytecodes and updates the byte compiler.
Two bytecodes are added.

The first, Bpushunwindprotect, pushes a CATCHER_ALL handler.  On error,
it then pushes the exception value and `t' and jumps to the unwind
forms.  When there is no error, the body form's value is left on the
stack and then an additional `nil' is pushed.

The second bytecode, Bendunwindprotect, looks at the top of the stack
and decides whether to carry on or to call `signal' or `throw'.

It's possible that this new bytecode could be used to remove the
unwind-protect restrictions in generator.el, though I didn't look deeply
into that.

thanks,
Tom



^ permalink raw reply	[flat|nested] 8+ messages in thread
* Re: please review new branch feature/byte-unwind-protect
@ 2018-01-26  7:58 Rocky Bernstein
  0 siblings, 0 replies; 8+ messages in thread
From: Rocky Bernstein @ 2018-01-26  7:58 UTC (permalink / raw)
  To: tom, emacs-devel

[-- Attachment #1: Type: text/plain, Size: 128 bytes --]

If this does get added to emacs, would you please consider making a change
to https://github.com/rocky/elisp-bytecode ? Thanks.

[-- Attachment #2: Type: text/html, Size: 207 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2018-02-03 19:43 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-01-23  5:20 please review new branch feature/byte-unwind-protect Tom Tromey
2018-01-23  8:47 ` John Wiegley
2018-01-23 15:50   ` Tom Tromey
2018-01-23 16:37     ` Stefan Monnier
2018-01-27 17:37 ` Markus Triska
2018-01-27 21:28   ` Stefan Monnier
2018-02-03 19:43 ` Philipp Stephani
  -- strict thread matches above, loose matches on Subject: below --
2018-01-26  7:58 Rocky Bernstein

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.