Re: carbon throwing objc exceptions
Re: carbon throwing objc exceptions
- Subject: Re: carbon throwing objc exceptions
- From: Greg Parker <email@hidden>
- Date: Tue, 15 Sep 2009 15:16:03 -0700
On Sep 15, 2009, at 2:58 PM, Nathan Herring wrote:
I have separately made the suggestion, via rdar://7225898, that
Apple move ObjC[++] to use libUnwind, so that callbacks of any kind
would see this as a (possibly foreign) exception, and would either
(1) terminate due to un-unwindability (rather than quietly unwind
stack that cannot be unwound), (2) allow for standard exception
handling, including catching and rethrowing for finally-like behavior.
That's unfortunately not binary-compatible with existing 32-bit Mac
binaries. Such code does not include the unwind tables that libunwind
needs to do its work, so exceptions that work today would almost
always terminate as un-unwindable.
iPhone and 64-bit Mac do have C++-compatible Objective-C exceptions
courtesy of libunwind. Objective-C exceptions run destructors and
`catch (...)` clauses, and C++ exceptions unlock `@synchronized` and
run `@catch (...)` and `@finally` clauses.
(But C++ and Objective-C exceptions are implemented with setjmp/
longjmp on iPhone OS, so you still get the same clumsy machine code
that started this whole thread.)
--
Greg Parker email@hidden Runtime Wrangler
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden