diff options
author | Tom Tromey <tromey@gcc.gnu.org> | 1999-11-19 19:13:42 +0000 |
---|---|---|
committer | Tom Tromey <tromey@gcc.gnu.org> | 1999-11-19 19:13:42 +0000 |
commit | 3cf88fb4e850d8dc5aafbe280bef674e79326005 (patch) | |
tree | 66d0cd37d209d1f5d9df73c934dc9f25f92bdf03 /libjava/exception.cc | |
parent | 2395f8059c43b8411090fd4461cbd61d53a55ce9 (diff) | |
download | gcc-3cf88fb4e850d8dc5aafbe280bef674e79326005.zip gcc-3cf88fb4e850d8dc5aafbe280bef674e79326005.tar.gz gcc-3cf88fb4e850d8dc5aafbe280bef674e79326005.tar.bz2 |
sjlj jumbo patch
From-SVN: r30591
Diffstat (limited to 'libjava/exception.cc')
-rw-r--r-- | libjava/exception.cc | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/libjava/exception.cc b/libjava/exception.cc index b1eb690..0dbf4aa 100644 --- a/libjava/exception.cc +++ b/libjava/exception.cc @@ -33,10 +33,10 @@ typedef struct { extern "C" java_eh_info **__get_eh_info (); extern "C" void __throw () __attribute__ ((__noreturn__)); +extern "C" void __sjthrow () __attribute__ ((__noreturn__)); extern "C" short __get_eh_table_version (void *table); extern "C" short __get_eh_table_language (void *table); - extern "C" void * malloc (size_t); extern "C" void free (void *); @@ -45,8 +45,12 @@ extern "C" void * _Jv_type_matcher (java_eh_info *info, void* match_info, void *exception_table) { - if (__get_eh_table_language (exception_table) != EH_LANG_Java) +#ifndef SJLJ_EXCEPTIONS + /* No exception table implies the old style mechanism, so don't check. */ + if (exception_table != NULL + && __get_eh_table_language (exception_table) != EH_LANG_Java) return NULL; +#endif /* we don't worry about version info yet, there is only one version! */ @@ -125,10 +129,6 @@ _Jv_eh_free () *info_ptr = NULL; } -/* Perform a throw, Java style. Throw will unwind through this call, so - there better not be any handlers or exception thrown here. */ - - /* Initialize an __eh_info structure with this libraries matching info. */ extern "C" void @@ -136,6 +136,9 @@ _Jv_setup_eh_info (__eh_info *) { } +/* Perform a throw, Java style. Throw will unwind through this call, + so there better not be any handlers or exception thrown here. */ + extern "C" void _Jv_Throw (void *value) { @@ -151,5 +154,12 @@ _Jv_Throw (void *value) ehinfo->eh_info.language = EH_LANG_Java; ehinfo->eh_info.version = 1; ehinfo->value = value; - __throw(); + +/* We're happy with setjmp/longjmp exceptions or region-based + exception handlers: entry points are provided here for both. */ +#ifdef SJLJ_EXCEPTIONS + __sjthrow (); +#else + __throw (); +#endif } |