diff options
author | aph <aph@138bc75d-0d04-0410-961f-82ee72b054a4> | 2003-10-24 09:29:43 +0000 |
---|---|---|
committer | aph <aph@138bc75d-0d04-0410-961f-82ee72b054a4> | 2003-10-24 09:29:43 +0000 |
commit | e164eae76e4e677e729d62cf39e1c51e4ef7f311 (patch) | |
tree | 8c726fb42c811bb6652ba1a759bae78c2c8d9378 /libjava/exception.cc | |
parent | aeac46d4895e26ae7c0fb8976229512eaa26a922 (diff) | |
download | gcc-e164eae76e4e677e729d62cf39e1c51e4ef7f311.tar.gz |
2003-10-22 Andrew Haley <aph@redhat.com>
* lang.c (LANG_HOOKS_GET_CALLEE_FNDECL): New.
(java_get_callee_fndecl): New.
* jcf-parse.c (java_parse_file): Call emit_catch_table().
* java-tree.h (ctable_decl): New.
(catch_classes): New.
(java_tree_index): Add JTI_CTABLE_DECL, JTI_CATCH_CLASSES.
* decl.c (java_init_decl_processing): Add catch_class_type.
Add ctable_decl.
Add catch_classes field.
* class.c (build_indirect_class_ref): Break out from
build_class_ref.
(make_field_value): Check flag_indirect_dispatch.
(make_class_data): Ditto.
Tidy uses of PUSH_FIELD_VALUE.
Add field catch_classes.
(make_catch_class_record): New.
* java-tree.h (PUSH_FIELD_VALUE): Tidy.
2003-10-22 Andrew Haley <aph@redhat.com>
* java/lang/natClass.cc (initializeClass): Call
_Jv_linkExceptionClassTable.
(_Jv_LinkSymbolTable): Call )_Jv_ThrowNoSuchMethodError. Call
_Jv_Defer_Resolution on a method whose ncode is NULL.
(_Jv_linkExceptionClassTable): New function.
(_Jv_LayoutVTableMethods): If superclass looks like a constant pool
entry, look it up.
* java/lang/Class.h (struct _Jv_CatchClass): New.
(_Jv_linkExceptionClassTable): New friend.
(_Jv_Defer_Resolution): New friend.
(class Class.catch_classes): New field.
* include/java-interp.h (Jv_Defer_Resolution): New method.
(_Jv_PrepareClass): Make a friend of _Jv_MethodBase.
(_Jv_MethodBase.deferred): New field.
(_Jv_Defer_Resolution): New function.
* resolve.cc (_Jv_PrepareClass): Resolve deferred handlers.
* exception.cc (get_ttype_entry): Change return type to void**.
(PERSONALITY_FUNCTION): Remove all code related to using a
Utf8Const* for a match type. Change match type to be a pointer to
a pointer, rather than a pointer to a Class.
* defineclass.cc (handleCodeAttribute): Initialize
method->deferred.
(handleMethodsEnd): Likewise.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@72886 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libjava/exception.cc')
-rw-r--r-- | libjava/exception.cc | 28 |
1 files changed, 10 insertions, 18 deletions
diff --git a/libjava/exception.cc b/libjava/exception.cc index 9647d446d18..088d48268e3 100644 --- a/libjava/exception.cc +++ b/libjava/exception.cc @@ -161,7 +161,7 @@ parse_lsda_header (_Unwind_Context *context, const unsigned char *p, return p; } -static jclass +static void ** get_ttype_entry (_Unwind_Context *context, lsda_header_info *info, long i) { _Unwind_Ptr ptr; @@ -169,7 +169,7 @@ get_ttype_entry (_Unwind_Context *context, lsda_header_info *info, long i) i *= size_of_encoded_value (info->ttype_encoding); read_encoded_value (context, info->ttype_encoding, info->TType - i, &ptr); - return reinterpret_cast<jclass>(ptr); + return reinterpret_cast<void **>(ptr); } @@ -336,23 +336,15 @@ PERSONALITY_FUNCTION (int version, { // Positive filter values are handlers. - jclass catch_type = get_ttype_entry (context, &info, ar_filter); + void **catch_word = get_ttype_entry (context, &info, ar_filter); + jclass catch_type = (jclass)*catch_word; + + // FIXME: This line is a kludge to work around exception + // handlers written in C++, which don't yet use indirect + // dispatch. + if (catch_type == *(void **)&java::lang::Class::class$) + catch_type = (jclass)catch_word; - typedef struct { - int __attribute__ ((mode (pointer))) dummy; - Utf8Const *utf8; - } utf8_hdr; - utf8_hdr *p = (utf8_hdr *)catch_type; - if (p->dummy == -1) - { - using namespace gnu::gcj::runtime; - java::lang::Class *klass - = StackTrace::getClass ((gnu::gcj::RawData *)ip); - java::lang::ClassLoader *loader - = klass ? klass->getClassLoaderInternal () : NULL; - catch_type = _Jv_FindClass (p->utf8, loader); - } - if (_Jv_IsInstanceOf (xh->value, catch_type)) { handler_switch_value = ar_filter; |