This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [objc] exception handling rewrite; gnu runtime operational
- From: David Ayers <d dot ayers at inode dot at>
- To: Andrew Pinski <pinskia at physics dot uc dot edu>
- Cc: Nicola Pero <nicola at brainstorm dot co dot uk>, Richard Henderson <rth at redhat dot com>, gcc-patches at gcc dot gnu dot org
- Date: Fri, 18 Jun 2004 23:41:54 +0200
- Subject: Re: [objc] exception handling rewrite; gnu runtime operational
- References: <200406181603.i5IG3ea25293@tin.geop.uc.edu>
Andrew Pinski wrote:
I'd like to have a look at the new exception handling system and see if we
can update gnustep-base to use that exception handling system (when
available) instead of sjlj - basically NS_DURING, etc would become
wrappers of @try, etc. That would be a nice test as we can then run
plenty of software which is using exception handling and test that it
works.
And code generation should be better as there is no call to setjmp for
NS_DURING anymore (unless you have sjlj exception turned on, instead
of using dwarf unwinder, which is only used on some targets by default).
And let me also say that this is a great start! Thanks!
Please note though, that we will probably also need the runtime hooks to
replace the default implementations of isKindOf() & co. just like the
Apple runtime. This is because the /true/ semantics of the exception
handling isn't actually in the runtime but in the Foundation framework
for Cocoa and therefore will be handled in GNUstepBase for GNUstep.
(i.e. it will use -isKindOfClass: to be able to handle Proxies
correctly. So wrt to the actual language (compiler & runtime), the
semantics of these new constructs are effectively undefined.)
I think we'll have to take a closer look at all these hooks:
objc-act.c
/* NeXT-specific tags. */
...
#define TAG_EXCEPTIONEXTRACT "objc_exception_extract"
#define TAG_EXCEPTIONTRYENTER "objc_exception_try_enter"
#define TAG_EXCEPTIONTRYEXIT "objc_exception_try_exit"
#define TAG_EXCEPTIONMATCH "objc_exception_match"
#define TAG_EXCEPTIONTHROW "objc_exception_throw"
#define TAG_SYNCENTER "objc_sync_enter"
#define TAG_SYNCEXIT "objc_sync_exit"
#define TAG_SETJMP "_setjmp"
#define UTAG_EXCDATA "_objc_exception_data"
#define UTAG_EXCDATA_VAR "_stackExceptionData"
#define UTAG_CAUGHTEXC_VAR "_caughtException"
#define UTAG_RETHROWEXC_VAR "_rethrowException"
...
But this can be done incrementally.
Cheers,
David Ayers