diff options
author | Andrew Haley <aph@redhat.com> | 2006-06-08 14:00:43 +0000 |
---|---|---|
committer | Andrew Haley <aph@gcc.gnu.org> | 2006-06-08 14:00:43 +0000 |
commit | 297750da0393e5542752140f9ad5abb924f6305e (patch) | |
tree | 83ae3658665a4f6c170a94e91e6c36e86cf6b124 /libjava/include/jvm.h | |
parent | f70b22c9423c0352d34ed783b92eb98645cb18f1 (diff) | |
download | gcc-297750da0393e5542752140f9ad5abb924f6305e.zip gcc-297750da0393e5542752140f9ad5abb924f6305e.tar.gz gcc-297750da0393e5542752140f9ad5abb924f6305e.tar.bz2 |
jvm.h (_Jv_Linker::maybe_adjust_signature): New.
2006-06-07 Andrew Haley <aph@redhat.com>
* include/jvm.h (_Jv_Linker::maybe_adjust_signature): New.
(_Jv_Linker::uaddr): New.
* link.cc (resolve_pool_entry): Call search_method_in_superclasses
instead of an open-coded loop around search_method_in_class.
(search_method_in_class): Add a new arg, check_perms.
(search_method_in_superclasses): New.
(link_symbol_table): Call maybe_adjust_signature() to extract the
least significnt bit of the signature pointer. Do this three
times, for instace method calls, static methods, and interfaces.
Call search_method_in_superclasses() instead of
_Jv_LookupDeclaredMethod.
(typedef uaddr): Delete.
From-SVN: r114486
Diffstat (limited to 'libjava/include/jvm.h')
-rw-r--r-- | libjava/include/jvm.h | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/libjava/include/jvm.h b/libjava/include/jvm.h index 542056a..d99443c 100644 --- a/libjava/include/jvm.h +++ b/libjava/include/jvm.h @@ -239,6 +239,8 @@ namespace gcj class _Jv_Linker { private: + typedef unsigned int uaddr __attribute__ ((mode (pointer))); + static _Jv_Field *find_field_helper(jclass, _Jv_Utf8Const *, _Jv_Utf8Const *, jclass, jclass *); static _Jv_Field *find_field(jclass, jclass, jclass *, _Jv_Utf8Const *, @@ -264,9 +266,32 @@ private: static jshort append_partial_itable(jclass, jclass, void **, jshort); static _Jv_Method *search_method_in_class (jclass, jclass, _Jv_Utf8Const *, - _Jv_Utf8Const *); + _Jv_Utf8Const *, + bool check_perms = true); + static _Jv_Method *search_method_in_superclasses (jclass cls, jclass klass, + _Jv_Utf8Const *method_name, + _Jv_Utf8Const *method_signature, + jclass *found_class, + bool check_perms = true); static void *create_error_method(_Jv_Utf8Const *); + /* The least significant bit of the signature pointer in a symbol + table is set to 1 by the compiler if the reference is "special", + i.e. if it is an access to a private field or method. Extract + that bit, clearing it in the address and setting the LSB of + SPECIAL accordingly. */ + static void maybe_adjust_signature (_Jv_Utf8Const *&s, uaddr &special) + { + union { + _Jv_Utf8Const *signature; + uaddr signature_bits; + }; + signature = s; + special = signature_bits & 1; + signature_bits -= special; + s = signature; + } + public: static bool has_field_p (jclass, _Jv_Utf8Const *); |