[LLVMdev] One way to support unwind on x86

Bjarke Walling bwp at bwp.dk
Tue Mar 3 11:01:44 PST 2009


Hi Andrew,

On Tue, Mar 3, 2009 at 2:40 PM, Andrew Haley <aph at redhat.com> wrote:
> JIT-compiling the unwinder data, yes.  Given that the unwinder data
> is, basically, the source for a specialized bytecode interpreter I
> can't see any reason this wouldn't work.

I might look into that. It will be a good challenge to understand the
EH data in detail and program my own stack unwinding routine. If it
works out I can think of how to do most of the work compile-time. I
still don't see the complexities in stack unwinding: Restore caller
registers, remove the frame, lookup next frame, etc. The complexity
might be in the details of course. If I start implementing my own
unwinding routine I can prove myself wrong in how easy I think it is.

It would be nice with a suite of test cases that use invoke/unwind in
various situations (complex stack frames, simple stack frames, unwind
as the first thing/last thing/middle of function, unwind few/many
frames, etc.) I can run this suite to see if and where my runtime
fails. I'm not sure such a thing exists? Even with the test suite I
would have to run it using different compiler settings and
optimisations.

Bjarke Walling



More information about the llvm-dev mailing list