summaryrefslogtreecommitdiff
path: root/libjava/include
diff options
context:
space:
mode:
authorTom Tromey <tromey@cygnus.com>2000-02-04 20:49:27 +0000
committerTom Tromey <tromey@gcc.gnu.org>2000-02-04 20:49:27 +0000
commitfacc279fc19a31c23323ce3eeac869eb14d07bda (patch)
treef2e35a2ea96bcecfa7499a5ec8161bd2528c22d5 /libjava/include
parenta89608cbebb11969af54ba5a5354302fab2a0b4b (diff)
downloadgcc-facc279fc19a31c23323ce3eeac869eb14d07bda.tar.gz
defineclass.cc (handleMethodsBegin): Allocate _Jv_MethodBase pointers.
* defineclass.cc (handleMethodsBegin): Allocate _Jv_MethodBase pointers. (handleMethodsEnd): Fixed error messages. Create a _Jv_JNIMethod if the method is native. * resolve.cc (ncode): Don't handle native methods. (_Jv_JNIMethod::ncode): New method. (_Jv_PrepareClass): Handle native methods. * jni.cc (call): Renamed from _Jv_JNI_conversion_call. Include AbstractMethodError.h. (add_char): New function. (mangled_name): Likewise. * include/java-interp.h (class _Jv_JNIMethod): New class. (class _Jv_MethodBase): New class. (class _Jv_InterpMethod): Derive from _Jv_MethodBase. (_Jv_InterpClass): Changed `interpreted_methods' field to type `_Jv_MethodBase'. * include/jvm.h (_Jv_FindSymbolInExecutable): Declare. * java/lang/natRuntime.cc (libraries_size, libraries_count, libraries): New globals. (add_library): New function. (_Jv_FindSymbolInExecutable): New function. * java/lang/natClassLoader.cc (initiated_classes, loaded_classes): Now static. From-SVN: r31790
Diffstat (limited to 'libjava/include')
-rw-r--r--libjava/include/java-interp.h39
-rw-r--r--libjava/include/jvm.h3
2 files changed, 33 insertions, 9 deletions
diff --git a/libjava/include/java-interp.h b/libjava/include/java-interp.h
index 0feab21762c..7022411bb51 100644
--- a/libjava/include/java-interp.h
+++ b/libjava/include/java-interp.h
@@ -14,6 +14,18 @@ details. */
#include <jvm.h>
#include <java-cpool.h>
+// Base class for method representations. Subclasses are interpreted
+// and JNI methods.
+class _Jv_MethodBase
+{
+protected:
+ // The class which defined this method.
+ _Jv_InterpClass *defining_class;
+
+ // The method description.
+ _Jv_Method *self;
+};
+
#ifdef INTERPRETER
#pragma interface
@@ -66,8 +78,8 @@ class _Jv_InterpException {
friend class _Jv_InterpMethod;
};
-class _Jv_InterpMethod {
-
+class _Jv_InterpMethod : public _Jv_MethodBase
+{
_Jv_ushort max_stack;
_Jv_ushort max_locals;
int code_length;
@@ -75,9 +87,6 @@ class _Jv_InterpMethod {
_Jv_ushort exc_count;
_Jv_ushort args_raw_size;
- _Jv_InterpClass *defining_class;
- _Jv_Method *self;
-
unsigned char* bytecode ()
{
return
@@ -121,9 +130,6 @@ class _Jv_InterpMethod {
friend class gnu::gcj::runtime::MethodInvocation;
friend void _Jv_PrepareClass(jclass);
-
- // This function is used when making a JNI call from the interpreter.
- friend void _Jv_JNI_conversion_call (ffi_cif *, void *, ffi_raw *, void *);
};
class _Jv_InterpMethodInvocation {
@@ -140,7 +146,7 @@ class _Jv_InterpMethodInvocation {
class _Jv_InterpClass : public java::lang::Class
{
- _Jv_InterpMethod **interpreted_methods;
+ _Jv_MethodBase **interpreted_methods;
_Jv_ushort *field_initializers;
friend class _Jv_ClassReader;
@@ -165,4 +171,19 @@ struct _Jv_ResolvedMethod {
#endif /* INTERPRETER */
+class _Jv_JNIMethod : public _Jv_MethodBase
+{
+ // The underlying function. If NULL we have to look for the
+ // function.
+ void *function;
+
+ // This function is used when making a JNI call from the interpreter.
+ static void call (ffi_cif *, void *, ffi_raw *, void *);
+
+ void *ncode ();
+
+ friend class _Jv_ClassReader;
+ friend void _Jv_PrepareClass(jclass);
+};
+
#endif /* __JAVA_INTERP_H__ */
diff --git a/libjava/include/jvm.h b/libjava/include/jvm.h
index ccf552aaf19..325fe939095 100644
--- a/libjava/include/jvm.h
+++ b/libjava/include/jvm.h
@@ -201,6 +201,9 @@ extern "C"
extern char *_Jv_ThisExecutable (void);
extern void _Jv_ThisExecutable (const char *);
+/* Return a pointer to a symbol in executable or loaded library. */
+void *_Jv_FindSymbolInExecutable (const char *);
+
/* Initialize JNI. */
extern void _Jv_JNI_Init (void);