JNI vs. #ifdef INTERPRETER

Tom Tromey tromey@redhat.com
Fri Mar 30 13:31:00 GMT 2001


>>>>> "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.


More information about the Java mailing list

AltStyle によって変換されたページ (->オリジナル) /