diff options
author | Tom Tromey <tromey@redhat.com> | 2006-10-18 23:17:04 +0000 |
---|---|---|
committer | Tom Tromey <tromey@gcc.gnu.org> | 2006-10-18 23:17:04 +0000 |
commit | e7f7d2338771bcf4e77614ffd84fba85444811e6 (patch) | |
tree | 090a052b333feb86cf809ba60ebdc7a86794ff1e /libjava/java | |
parent | 9e7fc6b946e8a9f616ce12a458017bad8357247e (diff) | |
download | gcc-e7f7d2338771bcf4e77614ffd84fba85444811e6.zip gcc-e7f7d2338771bcf4e77614ffd84fba85444811e6.tar.gz gcc-e7f7d2338771bcf4e77614ffd84fba85444811e6.tar.bz2 |
register2.java: New file.
* testsuite/libjava.jni/register2.java: New file.
* testsuite/libjava.jni/register2.out: New file.
* testsuite/libjava.jni/register2.c: New file.
* java/lang/natClass.cc (_Jv_GetClassNameUtf8): New function.
* java/lang/Class.h (_Jv_GetClassNameUtf8): Declare.
* jni.cc (struct NativeMethodCacheEntry): New struct.
(nathash): Changed type.
(hash): Updated.
(nathash_find_slot): Likewise.
(nathash_find): Likewise.
(natrehash): Likewise.
(nathash_add): Likewise.
(_Jv_JNI_RegisterNatives): Likewise.
(_Jv_LookupJNIMethod): Likewise.
Idea from Juerg Lehni <juerg@scratchdisk.com>
Co-Authored-By: Bryce McKinlay <mckinlay@redhat.com>
From-SVN: r117867
Diffstat (limited to 'libjava/java')
-rw-r--r-- | libjava/java/lang/Class.h | 2 | ||||
-rw-r--r-- | libjava/java/lang/natClass.cc | 8 |
2 files changed, 10 insertions, 0 deletions
diff --git a/libjava/java/lang/Class.h b/libjava/java/lang/Class.h index 1638f94..a884cd6 100644 --- a/libjava/java/lang/Class.h +++ b/libjava/java/lang/Class.h @@ -231,6 +231,7 @@ jmethodID _Jv_FromReflectedMethod (java::lang::reflect::Method *); jmethodID _Jv_FromReflectedConstructor (java::lang::reflect::Constructor *); jint JvNumMethods (jclass); jmethodID JvGetFirstMethod (jclass); +_Jv_Utf8Const *_Jv_GetClassNameUtf8 (jclass); #ifdef INTERPRETER // Finds a desired interpreter method in the given class or NULL if not found @@ -474,6 +475,7 @@ private: friend jmethodID (::_Jv_FromReflectedConstructor) (java::lang::reflect::Constructor *); friend jint (::JvNumMethods) (jclass); friend jmethodID (::JvGetFirstMethod) (jclass); + friend _Jv_Utf8Const *::_Jv_GetClassNameUtf8 (jclass); #ifdef INTERPRETER friend _Jv_MethodBase *(::_Jv_FindInterpreterMethod) (jclass klass, jmethodID desired_method); diff --git a/libjava/java/lang/natClass.cc b/libjava/java/lang/natClass.cc index 0682fd6..1298429 100644 --- a/libjava/java/lang/natClass.cc +++ b/libjava/java/lang/natClass.cc @@ -1259,3 +1259,11 @@ _Jv_FindInterpreterMethod (jclass klass, jmethodID desired_method) return NULL; } #endif + +// Return Utf8 name of a class. This function is here for code that +// can't access klass->name directly. +_Jv_Utf8Const* +_Jv_GetClassNameUtf8 (jclass klass) +{ + return klass->name; +} |