Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(292)

Issue 95613004: Add support for exception handling using the PNaClSjLjEH LLVM pass (Closed)

Created:
7 years ago by Mark Seaborn
Modified:
7 years ago
Reviewers:
Derek Schuff, JF
CC:
native-client-reviews_googlegroups.com, JF
Base URL:
https://llvm.org/svn/llvm-project/libcxxabi/trunk
Visibility:
Public.

Description

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 Committed: https://gerrit.chromium.org/gerrit/gitweb?p=native_client/pnacl-libcxxabi.git;a=commit;h=bf2aa59

Patch Set 1 #

Patch Set 2 : Retry upload #

Patch Set 3 : Cleanup #

Patch Set 4 : Fix line length #

Patch Set 5 : Fix references to libsupc++ in comments #

Total comments: 4

Patch Set 6 : Fix handling of exceptions with virtual base classes #

Unified diffs Side-by-side diffs Delta from patch set Stats (+408 lines, -0 lines) Patch
A src/cxa_pnacl_sjlj_exception.cpp View 1 2 3 4 5 1 chunk +408 lines, -0 lines 0 comments Download

Messages

Total messages: 9 (0 generated)
Mark Seaborn
7 years ago (2013-12-04 18:38:18 UTC) #1
Derek Schuff
On 2013/12/04 18:38:18, Mark Seaborn wrote: +jfb in case he is interested: also for reference ...
7 years ago (2013-12-04 18:50:54 UTC) #2
JF
Does this fix all the EH tests marked as failing for: ./pnacl/scripts/llvm-test.py --libcxx-tests And pass ...
7 years ago (2013-12-04 20:54:09 UTC) #3
Derek Schuff
lgtm https://codereview.chromium.org/95613004/diff/70001/src/cxa_pnacl_sjlj_exception.cpp File src/cxa_pnacl_sjlj_exception.cpp (right): https://codereview.chromium.org/95613004/diff/70001/src/cxa_pnacl_sjlj_exception.cpp#newcode70 src/cxa_pnacl_sjlj_exception.cpp:70: // matches none of the exception types in ...
7 years ago (2013-12-04 22:26:26 UTC) #4
Mark Seaborn
https://codereview.chromium.org/95613004/diff/70001/src/cxa_pnacl_sjlj_exception.cpp File src/cxa_pnacl_sjlj_exception.cpp (right): https://codereview.chromium.org/95613004/diff/70001/src/cxa_pnacl_sjlj_exception.cpp#newcode70 src/cxa_pnacl_sjlj_exception.cpp:70: // matches none of the exception types in a ...
7 years ago (2013-12-04 23:03:17 UTC) #5
Mark Seaborn
@Derek: Can you have a look at the fix I sneaked in for patch set ...
7 years ago (2013-12-05 00:42:14 UTC) #6
Mark Seaborn
On 4 December 2013 12:54, <jfb@chromium.org> wrote: > Does this fix all the EH tests ...
7 years ago (2013-12-05 00:54:21 UTC) #7
Derek Schuff
virtual base case LGTM too
7 years ago (2013-12-05 01:23:10 UTC) #8
Mark Seaborn
7 years ago (2013-12-05 05:25:27 UTC) #9
Message was sent while issue was closed.
Committed patchset #6 manually as rbf2aa59 (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698