diff options
| author | aph <aph@138bc75d-0d04-0410-961f-82ee72b054a4> | 2006-06-08 14:00:43 +0000 |
|---|---|---|
| committer | aph <aph@138bc75d-0d04-0410-961f-82ee72b054a4> | 2006-06-08 14:00:43 +0000 |
| commit | d69ad40b46114268021512410165a7ea3b32196c (patch) | |
| tree | 83ae3658665a4f6c170a94e91e6c36e86cf6b124 /libjava/include | |
| parent | 792f183828f1c38c2b580e1e6cee3e5768f60666 (diff) | |
| download | ppe42-gcc-d69ad40b46114268021512410165a7ea3b32196c.tar.gz ppe42-gcc-d69ad40b46114268021512410165a7ea3b32196c.zip | |
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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@114486 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libjava/include')
| -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 542056af5fe..d99443cf335 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 *); |

