From 6aa96c99a6339f2eb2e396d02113be16ddd55129 Mon Sep 17 00:00:00 2001 From: bryce Date: Sun, 26 Oct 2003 02:25:42 +0000 Subject: 2003-10-26 Bryce McKinlay * java/lang/reflect/Constructor.java (toString): Avoid extra whitespace on constructor with no modifiers. * java/lang/reflect/natConstructor.java (newInstance): Look up caller and perform accessibility check only if constructor is non-public and accessible flag is not set. 2003-10-26 Bryce McKinlay * jni.cc (_Jv_JNI_CallAnyMethodV, _Jv_JNI_CallAnyMethodA, _Jv_JNI_CallAnyVoidMethodV, _Jv_JNI_CallAnyVoidMethodA): Don't use _Jv_LookupDeclaredMethod(). Call _Jv_CallAnyMethodA with is_virtual_call argument. * include/jvm.h (_Jv_isVirtualMethod): Moved and renamed from natClass.cc. * java/lang/natClass.cc (_Jv_LayoutVTableMethods): Use _Jv_isVirtualMethod. * java/lang/reflect/natMethod.cc (invoke): Don't use _Jv_LookupDeclaredMethod. (_Jv_CallAnyMethodA): New is_virtual_call argument. If specified, look up method in target object's vtable. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@72942 138bc75d-0d04-0410-961f-82ee72b054a4 --- libjava/jni.cc | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) (limited to 'libjava/jni.cc') diff --git a/libjava/jni.cc b/libjava/jni.cc index 857ee4bc3dd..e2e10defd0a 100644 --- a/libjava/jni.cc +++ b/libjava/jni.cc @@ -767,9 +767,6 @@ static T obj = unwrap (obj); klass = unwrap (klass); - if (style == normal) - id = _Jv_LookupDeclaredMethod (obj->getClass (), id->name, id->signature); - jclass decl_class = klass ? klass : obj->getClass (); JvAssert (decl_class != NULL); @@ -791,6 +788,7 @@ static T jvalue result; _Jv_CallAnyMethodA (obj, return_type, id, style == constructor, + style == normal, arg_types, args, &result); return wrap_value (env, extract_from_jvalue(result)); @@ -826,9 +824,6 @@ static T obj = unwrap (obj); klass = unwrap (klass); - if (style == normal) - id = _Jv_LookupDeclaredMethod (obj->getClass (), id->name, id->signature); - jclass decl_class = klass ? klass : obj->getClass (); JvAssert (decl_class != NULL); @@ -857,6 +852,7 @@ static T jvalue result; _Jv_CallAnyMethodA (obj, return_type, id, style == constructor, + style == normal, arg_types, arg_copy, &result); return wrap_value (env, extract_from_jvalue(result)); @@ -877,9 +873,6 @@ static void obj = unwrap (obj); klass = unwrap (klass); - if (style == normal) - id = _Jv_LookupDeclaredMethod (obj->getClass (), id->name, id->signature); - jclass decl_class = klass ? klass : obj->getClass (); JvAssert (decl_class != NULL); @@ -899,6 +892,7 @@ static void _Jv_CallAnyMethodA (obj, return_type, id, style == constructor, + style == normal, arg_types, args, NULL); } catch (jthrowable t) @@ -924,9 +918,6 @@ static void (JNICALL _Jv_JNI_CallAnyVoidMethodA) (JNIEnv *env, jobject obj, jclass klass, jmethodID id, jvalue *args) { - if (style == normal) - id = _Jv_LookupDeclaredMethod (obj->getClass (), id->name, id->signature); - jclass decl_class = klass ? klass : obj->getClass (); JvAssert (decl_class != NULL); @@ -950,6 +941,7 @@ static void _Jv_CallAnyMethodA (obj, return_type, id, style == constructor, + style == normal, arg_types, args, NULL); } catch (jthrowable t) -- cgit v1.2.1