diff options
author | aph <aph@138bc75d-0d04-0410-961f-82ee72b054a4> | 2003-08-20 17:27:56 +0000 |
---|---|---|
committer | aph <aph@138bc75d-0d04-0410-961f-82ee72b054a4> | 2003-08-20 17:27:56 +0000 |
commit | 30e23acf269fc543557d02a61c9f9d3539f5e8fa (patch) | |
tree | 8cc9800fc859447329cd4c9ba42a32a51f71de0f /libjava/exception.cc | |
parent | 09b5e87b255c834c2e43f4869eaaef0ae78dc1e6 (diff) | |
download | gcc-30e23acf269fc543557d02a61c9f9d3539f5e8fa.tar.gz |
2003-01-31 Andrew Haley <aph@redhat.com>
* except.c (prepare_eh_table_type): Use new encoding for exception
handlers when using -fno-assume-compiled.
2003-08-20 Andrew Haley <aph@redhat.com>
* gnu/gcj/runtime/StackTrace.java (getClass): New method.
* gnu/gcj/runtime/natStackTrace.cc (getClass): New method.
(classAt): Break out class lookup function into getClass().
* exception.cc (PERSONALITY_FUNCTION): Use new encoding for exception
handlers when using -fno-assume-compiled.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@70605 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libjava/exception.cc')
-rw-r--r-- | libjava/exception.cc | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/libjava/exception.cc b/libjava/exception.cc index d983f98f8fa..9647d446d18 100644 --- a/libjava/exception.cc +++ b/libjava/exception.cc @@ -15,6 +15,9 @@ details. */ #include <java/lang/Class.h> #include <java/lang/NullPointerException.h> +#include <gnu/gcj/runtime/StackTrace.h> +#include <gnu/gcj/runtime/MethodRef.h> +#include <gnu/gcj/RawData.h> #include <gcj/cni.h> #include <jvm.h> @@ -335,11 +338,21 @@ PERSONALITY_FUNCTION (int version, jclass catch_type = get_ttype_entry (context, &info, ar_filter); - // The catch_type is either a (java::lang::Class*) or - // is one more than a (Utf8Const*). - if ((size_t)catch_type & 1) - catch_type = _Jv_FindClass ((Utf8Const*)((size_t)catch_type ^ 1), NULL); - + 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; |