[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

please review new branch feature/byte-unwind-protect

From: Tom Tromey
Subject: please review new branch feature/byte-unwind-protect
Date: Mon, 22 Jan 2018 22:20:36 -0700


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.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]