natConstructor.cc (newInstance): Use _Jv_CallAnyMethodA.
* java/lang/reflect/natConstructor.cc (newInstance): Use _Jv_CallAnyMethodA. * include/jvm.h: Declare _Jv_CallAnyMethodA. * java/lang/reflect/natMethod.cc (_Jv_CallAnyMethodA): Renamed from _Jv_CallNonvirtualMethodA. Changed interface; overloaded. Include <jni.h>. (COPY): Removed. (invoke): Use _Jv_CallAnyMethodA. (VAL): Redefined. * java/lang/Class.h (Class): Declare JvGetFirstStaticField, JvNumStaticFields, JvNumMethods, and JvGetFirstMethod as friend functions. (struct _Jv_Method): Added getNextMethod method. (JvNumMethods): New function. (JvGetFirstMethod): Likewise. * gcj/field.h (JvGetFirstStaticField): New function. (JvNumStaticFields): Likewise. (getNextField): Renamed from getNextInstanceField. (struct _Jv_Field): New method getClass. * jni.cc: Wrote many new functions. * include/jni.h (JNI_TRUE): Define. (JNI_FALSE): Likewise. (jobject, jclass, jstring, jarray, jthrowable, jobjectArray, jbyteArray, jshortArray, jintArray, jlongArray, jbooleanArray, jcharArray, jfloatArray, jdoubleArray): New typedefs. (jfieldID, jmethodID): Likewise. (JNI_COMMIT, JNI_ABORT): New defines. (JNINativeMethod): New struct. (struct JNINativeInterface): Correctly declared more entries. (class _Jv_JNIEnv): Added `ex' member. (JNI_VERSION_1_1): New define. (JNI_VERSION_1_2): Likewise. * boehm.cc (_Jv_MarkObj): Use getNextField, not getNextInstanceField. From-SVN: r31553
This commit is contained in:
parent
24823dcf49
commit
8a9220959f
10 changed files with 1677 additions and 540 deletions
|
@ -60,6 +60,9 @@ struct _Jv_Method
|
|||
_Jv_Utf8Const *signature;
|
||||
unsigned short accflags;
|
||||
void *ncode;
|
||||
|
||||
_Jv_Method *getNextMethod ()
|
||||
{ return this + 1; }
|
||||
};
|
||||
|
||||
#define JV_PRIMITIVE_VTABLE ((_Jv_VTable *) -1)
|
||||
|
@ -168,13 +171,19 @@ private:
|
|||
|
||||
friend jfieldID JvGetFirstInstanceField (jclass);
|
||||
friend jint JvNumInstanceFields (jclass);
|
||||
friend jfieldID JvGetFirstStaticField (jclass);
|
||||
friend jint JvNumStaticFields (jclass);
|
||||
|
||||
friend jobject _Jv_AllocObject (jclass, jint);
|
||||
friend jobjectArray _Jv_NewObjectArray (jsize, jclass, jobject);
|
||||
friend jobject _Jv_NewPrimArray (jclass, jint);
|
||||
friend jobject _Jv_JNI_ToReflectedField (_Jv_JNIEnv *, jclass, jfieldID);
|
||||
friend jfieldID _Jv_FromReflectedField (java::lang::reflect::Field *);
|
||||
|
||||
friend jmethodID _Jv_FromReflectedMethod (java::lang::reflect::Method *);
|
||||
friend jmethodID _Jv_FromReflectedConstructor (java::lang::reflect::Constructor *);
|
||||
friend jint JvNumMethods (jclass);
|
||||
friend jmethodID JvGetFirstMethod (jclass);
|
||||
|
||||
friend class _Jv_PrimClass;
|
||||
|
||||
|
@ -257,4 +266,17 @@ private:
|
|||
java::lang::Thread *thread;
|
||||
};
|
||||
|
||||
|
||||
extern inline jint
|
||||
JvNumMethods (jclass klass)
|
||||
{
|
||||
return klass->method_count;
|
||||
}
|
||||
|
||||
extern inline jmethodID
|
||||
JvGetFirstMethod (jclass klass)
|
||||
{
|
||||
return &klass->methods[0];
|
||||
}
|
||||
|
||||
#endif /* __JAVA_LANG_CLASS_H__ */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue