diff options
author | tromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4> | 1999-11-19 19:13:42 +0000 |
---|---|---|
committer | tromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4> | 1999-11-19 19:13:42 +0000 |
commit | 0b324007fd92fc4b62a40088b7d49fa3ee743a1c (patch) | |
tree | 66d0cd37d209d1f5d9df73c934dc9f25f92bdf03 /libjava/exception.cc | |
parent | 4e11cb6534c31d4902cd189a9d220865d616d301 (diff) | |
download | gcc-0b324007fd92fc4b62a40088b7d49fa3ee743a1c.tar.gz |
sjlj jumbo patch
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@30591 138bc75d-0d04-0410-961f-82ee72b054a4
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 b1eb690d388..0dbf4aa1b54 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 } |