This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
Re: JNI vs. #ifdef INTERPRETER
- To: mgd at swarm dot org (Marcus G. Daniels)
- Subject: Re: JNI vs. #ifdef INTERPRETER
- From: Tom Tromey <tromey at redhat dot com>
- Date: 30 Mar 2001 14:38:50 -0700
- Cc: java at gcc dot gnu dot org
- References: <rfi3dbymza0.fsf@cathcart.sysc.pdx.edu>
- Reply-To: tromey at redhat dot com
>>>>> "Marcus" == Marcus G Daniels <mgd@swarm.org> writes:
Marcus> An observation: _Jv_GetJNIEnvNewFrame and _Jv_LookupJNIMethod
Marcus> aren't defined unless INTERPRETER is defined which means that
Marcus> it isn't possible to use JNI on platforms like Sparc Solaris
Marcus> that don't build with interpreter support.
Could you try the appended patch and see if it works?
If it does I will check it in.
Note that RegisterNatives will only work when the interpreter is
around :-(. This is a known flaw in our JNI implementation. Fixing
it is probably easy, but I haven't done it.
BTW I really appreciate the testing you've done with JNI. This is the
first time our JNI implementation has been heavily used. Thanks.
Tom
Index: jni.cc
===================================================================
RCS file: /cvs/gcc/gcc/libjava/jni.cc,v
retrieving revision 1.36.4.2
diff -u -r1.36.4.2 jni.cc
--- jni.cc 2001/03/23 19:12:19 1.36.4.2
+++ jni.cc 2001/03/30 21:14:17
@@ -1595,8 +1595,6 @@
-#ifdef INTERPRETER
-
// Add a character to the buffer, encoding properly.
static void
add_char (char *buf, jchar c, int *here)
@@ -1752,6 +1750,8 @@
return function;
}
+
+#ifdef INTERPRETER
// This function is the stub which is used to turn an ordinary (CNI)
// method call into a JNI call.