Add support for exception handling using the PNaClSjLjEH LLVM pass
Extend libcxxabi with support for PNaCl's SJLJ
(setjmp()+longjmp()-based) C++ exception handling. The routines
assume that the program has been transformed using the PNaClSjLjEH
LLVM pass, which inserts setjmp() calls around function calls that
need to handle C++ exceptions.
As noted in the comments, this will coexist with non-SJLJ (zero cost)
exception handling within the same build of libcxxabi. When SJLJ is
enabled, pnacl-ld.py will rename
__pnacl_eh_sjlj_Unwind_RaiseException() to _Unwind_RaiseException() at
link time to enable cxa_pnacl_sjlj_exception.cpp.
This is similar to the eh_pnacl.cc file I added before to libsupc++.
Some of the differences are:
* Coding style: 4-space indentation, etc.
* Use libcxxabi's can_catch() instead of libsupc++'s __do_catch().
We no longer need the __is_pointer_p() check, because that's built
into can_catch(). So get_adjusted_ptr() becomes trivial and can be
inlined.
* Add casting between std::type_info and __shim_type_info, which are
equivalent.
* Add helpers: get_object_from_ue(), get_exception_header_from_ue().
libcxxabi tends to open code the implementation of these.
BUG=https://code.google.com/p/nativeclient/issues/detail?id=3696
TEST=run_eh_throw_tests_sjlj_test from the NaCl build
Review URL: https://codereview.chromium.org/95613004
1 file changed