From b9b5672b49c02abf4eb9ee7a41268676975fe8dd Mon Sep 17 00:00:00 2001 From: Bryce McKinlay Date: Sun, 26 Oct 2003 02:25:42 +0000 Subject: Constructor.java (toString): Avoid extra whitespace on constructor with no modifiers. 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. From-SVN: r72942 --- libjava/include/jvm.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'libjava/include') diff --git a/libjava/include/jvm.h b/libjava/include/jvm.h index b28f61a..e1a5c33 100644 --- a/libjava/include/jvm.h +++ b/libjava/include/jvm.h @@ -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 *parameter_types, jvalue *args, jvalue *result, -- cgit v1.1