Constructor.java (toString): Avoid extra whitespace on constructor with no modifiers.

2003-10-26  Bryce McKinlay  <bryce@mckinlay.net.nz>

	* 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  <bryce@mckinlay.net.nz>

	* 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.

From-SVN: r72942
This commit is contained in:
Bryce McKinlay 2003-10-26 02:25:42 +00:00 committed by Bryce McKinlay
parent 077a148bf5
commit b9b5672b49
7 changed files with 90 additions and 57 deletions

View file

@ -335,6 +335,14 @@ _Jv_VTable::new_vtable (int count)
return (_Jv_VTable *) _Jv_AllocBytes (size);
}
// Determine if METH gets an entry in a VTable.
static inline jboolean _Jv_isVirtualMethod (_Jv_Method *meth)
{
using namespace java::lang::reflect;
return (((meth->accflags & (Modifier::STATIC | Modifier::PRIVATE)) == 0)
&& meth->name->data[0] != '<');
}
// This function is used to determine the hash code of an object.
inline jint
_Jv_HashCode (jobject obj)
@ -418,6 +426,7 @@ extern void _Jv_CallAnyMethodA (jobject obj,
jclass return_type,
jmethodID meth,
jboolean is_constructor,
jboolean is_virtual_call,
JArray<jclass> *parameter_types,
jvalue *args,
jvalue *result,