diff options
author | aph <aph@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-07-13 14:07:16 +0000 |
---|---|---|
committer | aph <aph@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-07-13 14:07:16 +0000 |
commit | 6f8ca8e7d56132c079f6fd7ad4c7fae4f7847330 (patch) | |
tree | 0b3032c23182661b8162b7446fbe323c12606d36 /libjava/java | |
parent | 7b8353ed709794ad7c47bcf75f12f56e2c028f4f (diff) | |
download | gcc-6f8ca8e7d56132c079f6fd7ad4c7fae4f7847330.tar.gz |
2007-07-13 Andrew Haley <aph@redhat.com>
* libgcj.ver: Add __gcj_personality_sj0.
* testsuite/libjava.jvmti/jvmti-interp.exp: Likewise.
* testsuite/libjava.jni/jni.exp: Use -fdollars-in-identifiers.
* testsuite/libjava.jni/cni.exp: Use -fdollars-in-identifiers.
* testsuite/libjava.jvmti/jvmti.exp (gcj_jvmti_compile_cxx_to_o): Likewise.
* gnu/classpath/natVMStackWalker.cc (getCallingClassLoader): Check
klass is non-null.
* java/lang/reflect/natField.cc (getAddr): Call
_Jv_StackTrace::GetCallingClass only if CALLER is non-null.
* java/lang/reflect/natVMProxy.cc (run_proxy): Use
_Jv_getFieldInternal to get field proxyClass.m.
(_Jv_getFieldInternal): New function.
2007-07-11 Andrew Haley <aph@redhat.com>
* configure.host (arm*-linux-gnu): New.
* sysdep/arm/locks.h: New.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@126622 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libjava/java')
-rw-r--r-- | libjava/java/lang/reflect/Field.h | 2 | ||||
-rw-r--r-- | libjava/java/lang/reflect/natField.cc | 8 | ||||
-rw-r--r-- | libjava/java/lang/reflect/natVMProxy.cc | 12 |
3 files changed, 15 insertions, 7 deletions
diff --git a/libjava/java/lang/reflect/Field.h b/libjava/java/lang/reflect/Field.h index 3e39fb2bad1..0af95652def 100644 --- a/libjava/java/lang/reflect/Field.h +++ b/libjava/java/lang/reflect/Field.h @@ -12,6 +12,7 @@ jfieldID _Jv_FromReflectedField (java::lang::reflect::Field *); jobject _Jv_JNI_ToReflectedField (_Jv_JNIEnv*, jclass, jfieldID, jboolean); +jobject _Jv_getFieldInternal (java::lang::reflect::Field *f, jclass c, jobject o); class java::lang::reflect::Field : public ::java::lang::reflect::AccessibleObject { @@ -91,6 +92,7 @@ public: friend jfieldID (::_Jv_FromReflectedField) (java::lang::reflect::Field *); friend jobject (::_Jv_JNI_ToReflectedField) (_Jv_JNIEnv*, jclass, jfieldID, jboolean); friend class java::lang::Class; + friend jobject (::_Jv_getFieldInternal) (java::lang::reflect::Field *f, jclass c, jobject o); }; #endif // __java_lang_reflect_Field__ diff --git a/libjava/java/lang/reflect/natField.cc b/libjava/java/lang/reflect/natField.cc index b107ab851b7..734f653168b 100644 --- a/libjava/java/lang/reflect/natField.cc +++ b/libjava/java/lang/reflect/natField.cc @@ -74,11 +74,6 @@ static void* getAddr (java::lang::reflect::Field* field, jclass caller, jobject obj, jboolean checkFinal) { - // FIXME: we know CALLER is NULL here. At one point we planned to - // have the compiler insert the caller as a hidden argument in some - // calls. However, we never implemented that, so we have to find - // the caller by hand instead. - using namespace java::lang::reflect; jfieldID fld = _Jv_FromReflectedField (field); @@ -97,7 +92,8 @@ getAddr (java::lang::reflect::Field* field, jclass caller, jobject obj, // Check accessibility, if required. if (! (Modifier::isPublic (flags) || field->isAccessible())) { - caller = _Jv_StackTrace::GetCallingClass (&Field::class$); + if (! caller) + caller = _Jv_StackTrace::GetCallingClass (&Field::class$); if (! _Jv_CheckAccess (caller, field->getDeclaringClass(), flags)) throw new java::lang::IllegalAccessException; } diff --git a/libjava/java/lang/reflect/natVMProxy.cc b/libjava/java/lang/reflect/natVMProxy.cc index e5f8fbe52aa..1d9a3c6a551 100644 --- a/libjava/java/lang/reflect/natVMProxy.cc +++ b/libjava/java/lang/reflect/natVMProxy.cc @@ -299,6 +299,15 @@ unbox (jobject o, jclass klass, void *rvalue, FFI_TYPE type) JvFail ("Bad ffi type in proxy"); } +// _Jv_getFieldInternal is declared as a friend of reflect.Field in +// libjava/headers.txt. This gives us a way to call the private +// method Field.get (Class caller, Object obj). +extern inline jobject +_Jv_getFieldInternal (java::lang::reflect::Field *f, jclass c, jobject o) +{ + return f->get(c, o); +} + // run_proxy is the entry point for all proxy methods. It boxes up // all the arguments and then invokes the invocation handler's invoke() // method. Exceptions are caught and propagated. @@ -340,7 +349,8 @@ run_proxy (ffi_cif *cif, // difference. We'd still have to save the method array because // ncode structs are not scanned by the gc. Field *f = proxyClass->getDeclaredField (JvNewStringLatin1 ("m")); - JArray<Method*> *methods = (JArray<Method*>*)f->get (NULL); + JArray<Method*> *methods + = (JArray<Method*>*)_Jv_getFieldInternal (f, proxyClass, NULL); Method *meth = elements(methods)[self->method_index]; JArray<jclass> *parameter_types = meth->internalGetParameterTypes (); |