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

Issue 24777002: Add PNaClSjLjEH pass to implement C++ exception handling using setjmp()+longjmp() (Closed)

Created:
7 years, 2 months ago by Mark Seaborn
Modified:
7 years, 2 months ago
CC:
native-client-reviews_googlegroups.com, JF
Base URL:
http://git.chromium.org/native_client/pnacl-llvm.git@master
Visibility:
Public.

Description

Add PNaClSjLjEH pass to implement C++ exception handling using setjmp()+longjmp() There are two parts to this: * PNaClSjLjEH.cpp expands out the "invoke", "landingpad" and "resume" instructions, modifying the control flow to use setjmp(). * ExceptionInfoWriter.cpp lowers landingpads' clause lists to data that PNaCl's C++ runtime library will interpret. This part will be reused when we drop the SjLj part and create a stable ABI for zero-cost EH. This pass isn't enabled in PNaClABISimplify yet: I'll do that in a separate change. BUG=https://code.google.com/p/nativeclient/issues/detail?id=3696 TEST=*.ll tests (also tested end-to-end: plumbing for this will follow later) Committed: https://gerrit.chromium.org/gerrit/gitweb?p=native_client/pnacl-llvm.git;a=commit;h=f058041

Patch Set 1 #

Patch Set 2 : Retry upload #

Patch Set 3 : Hacky version to test enabling by default #

Patch Set 4 : Revert to proper version #

Patch Set 5 : Cleanup #

Patch Set 6 : Cleanup #

Patch Set 7 : Cleanup #

Patch Set 8 : Retry upload #

Patch Set 9 : Rename UnwindFrame -> ExceptionFrame for consistency #

Total comments: 18

Patch Set 10 : Review #

Patch Set 11 : Review 2 #

Patch Set 12 : Retry upload #

Patch Set 13 : Add second filter to example #

Patch Set 14 : Fix type of __pnacl_eh_filter_table in comment #

Patch Set 15 : Retry upload #

Unified diffs Side-by-side diffs Delta from patch set Stats (+958 lines, -0 lines) Patch
M include/llvm/InitializePasses.h View 1 2 3 4 1 chunk +1 line, -0 lines 0 comments Download
M include/llvm/Transforms/NaCl.h View 1 2 3 4 1 chunk +1 line, -0 lines 0 comments Download
M lib/Transforms/NaCl/CMakeLists.txt View 1 2 3 4 2 chunks +2 lines, -0 lines 0 comments Download
A lib/Transforms/NaCl/ExceptionInfoWriter.h View 1 2 3 4 5 6 7 8 9 1 chunk +71 lines, -0 lines 0 comments Download
A lib/Transforms/NaCl/ExceptionInfoWriter.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +281 lines, -0 lines 0 comments Download
A lib/Transforms/NaCl/PNaClSjLjEH.cpp View 1 2 3 4 5 6 7 8 9 1 chunk +346 lines, -0 lines 0 comments Download
A test/Transforms/NaCl/pnacl-eh-exception-info.ll View 1 2 3 4 1 chunk +128 lines, -0 lines 0 comments Download
A test/Transforms/NaCl/pnacl-sjlj-eh.ll View 1 2 3 4 5 6 1 chunk +127 lines, -0 lines 0 comments Download
M tools/opt/opt.cpp View 1 2 3 4 1 chunk +1 line, -0 lines 0 comments Download

Messages

Total messages: 11 (0 generated)
Mark Seaborn
7 years, 2 months ago (2013-10-11 17:32:15 UTC) #1
sehr (please use chromium)
I would like to review this before it is committed, but cannot do so today. ...
7 years, 2 months ago (2013-10-11 18:59:48 UTC) #2
Derek Schuff
https://codereview.chromium.org/24777002/diff/23001/lib/Transforms/NaCl/ExceptionInfoWriter.cpp File lib/Transforms/NaCl/ExceptionInfoWriter.cpp (right): https://codereview.chromium.org/24777002/diff/23001/lib/Transforms/NaCl/ExceptionInfoWriter.cpp#newcode10 lib/Transforms/NaCl/ExceptionInfoWriter.cpp:10: // The ExceptionInfoWriter class converts the clauses of a ...
7 years, 2 months ago (2013-10-15 17:39:25 UTC) #3
Mark Seaborn
https://codereview.chromium.org/24777002/diff/23001/lib/Transforms/NaCl/ExceptionInfoWriter.cpp File lib/Transforms/NaCl/ExceptionInfoWriter.cpp (right): https://codereview.chromium.org/24777002/diff/23001/lib/Transforms/NaCl/ExceptionInfoWriter.cpp#newcode10 lib/Transforms/NaCl/ExceptionInfoWriter.cpp:10: // The ExceptionInfoWriter class converts the clauses of a ...
7 years, 2 months ago (2013-10-15 21:41:17 UTC) #4
Derek Schuff
lgtm https://codereview.chromium.org/24777002/diff/23001/lib/Transforms/NaCl/ExceptionInfoWriter.cpp File lib/Transforms/NaCl/ExceptionInfoWriter.cpp (right): https://codereview.chromium.org/24777002/diff/23001/lib/Transforms/NaCl/ExceptionInfoWriter.cpp#newcode26 lib/Transforms/NaCl/ExceptionInfoWriter.cpp:26: // ExceptionInfoWriter encodes each clause as a 32-bit ...
7 years, 2 months ago (2013-10-15 22:36:19 UTC) #5
Mark Seaborn
Since you asked me what interprets the tables that ExceptionInfoWriter.cpp produces, have a look at ...
7 years, 2 months ago (2013-10-15 22:57:05 UTC) #6
Mark Seaborn
https://codereview.chromium.org/24777002/diff/23001/lib/Transforms/NaCl/ExceptionInfoWriter.cpp File lib/Transforms/NaCl/ExceptionInfoWriter.cpp (right): https://codereview.chromium.org/24777002/diff/23001/lib/Transforms/NaCl/ExceptionInfoWriter.cpp#newcode26 lib/Transforms/NaCl/ExceptionInfoWriter.cpp:26: // ExceptionInfoWriter encodes each clause as a 32-bit "clause ...
7 years, 2 months ago (2013-10-15 23:08:57 UTC) #7
Mark Seaborn
As discussed, I've added a second filter to the example in the comments, and fixed ...
7 years, 2 months ago (2013-10-16 17:59:52 UTC) #8
Derek Schuff
thanks, it's definitely better. We should probably add this to the design doc as well ...
7 years, 2 months ago (2013-10-16 18:16:22 UTC) #9
Mark Seaborn
Committed patchset #15 manually as rf058041 (presubmit successful).
7 years, 2 months ago (2013-10-16 20:06:29 UTC) #10
sehr
7 years, 2 months ago (2013-10-16 20:52:57 UTC) #11
Message was sent while issue was closed.
On 2013/10/16 18:16:22, Derek Schuff wrote:
> thanks, it's definitely better. We should probably add this to the design doc
as
> well
> LGTM

I agree we should add this to the design document now and use that for future
discussions of zero-cost exceptions, etc.
Otherwise, LGTM also.

Powered by Google App Engine
This is Rietveld 408576698