aboutsummaryrefslogtreecommitdiff
path: root/libjava/gcj
diff options
context:
space:
mode:
authorTom Tromey <tromey@cygnus.com>2000-01-21 23:50:31 +0000
committerTom Tromey <tromey@gcc.gnu.org>2000-01-21 23:50:31 +0000
commit8a9220959f7ab20324aee4c78f0ed2233a623f74 (patch)
treee63221042f53661dc5ac90918d840d796a598554 /libjava/gcj
parent24823dcf497ec69ca34146422071308d1063ed28 (diff)
downloadgcc-8a9220959f7ab20324aee4c78f0ed2233a623f74.zip
gcc-8a9220959f7ab20324aee4c78f0ed2233a623f74.tar.gz
gcc-8a9220959f7ab20324aee4c78f0ed2233a623f74.tar.bz2
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
Diffstat (limited to 'libjava/gcj')
-rw-r--r--libjava/gcj/field.h27
-rw-r--r--libjava/gcj/method.h8
2 files changed, 28 insertions, 7 deletions
diff --git a/libjava/gcj/field.h b/libjava/gcj/field.h
index 219da9e..28006fc 100644
--- a/libjava/gcj/field.h
+++ b/libjava/gcj/field.h
@@ -1,6 +1,6 @@
// field.h - Header file for fieldID instances. -*- c++ -*-
-/* Copyright (C) 1998, 1999 Red Hat, Inc.
+/* Copyright (C) 1998, 1999, 2000 Red Hat, Inc.
This file is part of libgcj.
@@ -30,7 +30,7 @@ struct _Jv_Field
_Jv_ushort flags;
#ifdef COMPACT_FIELDS
- short nameIndex; /* ofsfet in class's name table */
+ short nameIndex; /* offset in class's name table */
#else
_Jv_ushort bsize; /* not really needed ... */
#endif
@@ -51,7 +51,7 @@ struct _Jv_Field
jobject getObjectField (jobject obj)
{ return *(jobject *)((char *)obj + getOffset ()); }
- jfieldID getNextInstanceField () { return this + 1; }
+ jfieldID getNextField () { return this + 1; }
jboolean isRef ()
{
@@ -66,6 +66,12 @@ struct _Jv_Field
}
}
+ jclass getClass ()
+ {
+ JvAssert (isResolved ());
+ return type;
+ }
+
// FIXME - may need to mask off internal flags.
int getModifiers() { return flags; }
@@ -79,6 +85,7 @@ struct _Jv_Field
};
#ifdef __cplusplus
+
inline jbyte
_Jv_GetStaticByteField (jclass, _Jv_Field* field)
{
@@ -151,6 +158,18 @@ JvNumInstanceFields (jclass klass)
return klass->field_count - klass->static_field_count;
}
+extern inline jfieldID
+JvGetFirstStaticField (jclass klass)
+{
+ return &(klass->fields[0]);
+}
+
+extern inline jint
+JvNumStaticFields (jclass klass)
+{
+ return klass->static_field_count;
+}
+
extern inline jboolean
JvFieldIsRef (jfieldID field)
{
@@ -164,6 +183,6 @@ JvGetObjectField (jobject obj, _Jv_Field* field)
}
#endif /* defined (__GCJ_CNI_H__) */
-#endif
+#endif /* __cplusplus */
#endif /* __GCJ_FIELD_H */
diff --git a/libjava/gcj/method.h b/libjava/gcj/method.h
index 13f30fe..fe8f03b 100644
--- a/libjava/gcj/method.h
+++ b/libjava/gcj/method.h
@@ -1,6 +1,6 @@
-// java-method.h - Header file for methodID instances. -*- c++ -*-
+// method.h - Header file for methodID instances. -*- c++ -*-
-/* Copyright (C) 1999 Red Hat, Inc.
+/* Copyright (C) 1999, 2000 Red Hat, Inc.
This file is part of libgcj.
@@ -11,8 +11,10 @@ details. */
#ifndef __GCJ_METHOD_H__
#define __GCJ_METHOD_H__
+#include <java/lang/Class.h>
+
extern inline jmethodID
-_Jv_FromReflectedMethod(java::lang::reflect::Method *method)
+_Jv_FromReflectedMethod (java::lang::reflect::Method *method)
{
return (jmethodID)
((char *) method->declaringClass->methods + method->offset);