[kaffe] CVS kaffe (dalibor): Fixes for Eclipse3 and Jython

Kaffe CVS cvs-commits at kaffe.org
Fri Jan 2 14:54:02 PST 2004


PatchSet 4260 
Date: 2004/01/02 22:36:20
Author: dalibor
Branch: HEAD
Tag: (none) 
Log:
Fixes for Eclipse3 and Jython

2004-01-02  Mark Wielaard <mark at klomp.org>

        Fix for eclipse3.

        * include/jni.h
        (JNINativeInterface): Added GetPrimitiveArrayCritical
        and ReleasePrimitiveArrayCritical.

        * kaffe/kaffevm/jni.c
        (Kaffe_GetPrimitiveArrayCritical,
        Kaffe_ReleasePrimitiveArrayCritical): New functions.
        (Kaffe_JNINativeInterface) Added Kaffe_GetPrimitiveArrayCritical
        and Kaffe_ReleasePrimitiveArrayCritical.

2004-01-02  Mark Wielaard <mark at klomp.org>,
            Dalibor Topic <robilad at kaffe.org>

        Fix for eclipse3 and jython crash.

        * kaffe/kaffevm/jit3/machine.c
        (installMethodCode) Changed assert for bad exception table entrys
        to a warning message.

Members: 
	ChangeLog:1.1847->1.1848 
	include/jni.h:1.24->1.25 
	kaffe/kaffevm/jni.c:1.97->1.98 
	kaffe/kaffevm/jit3/machine.c:1.44->1.45 

Index: kaffe/ChangeLog
diff -u kaffe/ChangeLog:1.1847 kaffe/ChangeLog:1.1848
--- kaffe/ChangeLog:1.1847	Fri Jan  2 19:55:37 2004
+++ kaffe/ChangeLog	Fri Jan  2 22:36:20 2004
@@ -1,3 +1,26 @@
+2004-01-02  Mark Wielaard <mark at klomp.org>
+
+	Fix for eclipse3.
+
+	* include/jni.h
+	(JNINativeInterface): Added GetPrimitiveArrayCritical
+	and ReleasePrimitiveArrayCritical.
+
+	* kaffe/kaffevm/jni.c
+	(Kaffe_GetPrimitiveArrayCritical,
+	Kaffe_ReleasePrimitiveArrayCritical): New functions.
+	(Kaffe_JNINativeInterface) Added Kaffe_GetPrimitiveArrayCritical
+	and Kaffe_ReleasePrimitiveArrayCritical.
+
+2004-01-02  Mark Wielaard <mark at klomp.org>,
+	    Dalibor Topic <robilad at kaffe.org>
+
+	Fix for eclipse3 and jython crash.
+
+	* kaffe/kaffevm/jit3/machine.c
+	(installMethodCode) Changed assert for bad exception table entrys 
+	to a warning message.
+
 2004-01-02  Dalibor Topic <robilad at kaffe.org>
 
 	* config/m68k/netbsd1/config.frag
Index: kaffe/include/jni.h
diff -u kaffe/include/jni.h:1.24 kaffe/include/jni.h:1.25
--- kaffe/include/jni.h:1.24	Mon Nov  3 05:29:29 2003
+++ kaffe/include/jni.h	Fri Jan  2 22:36:21 2004
@@ -294,8 +294,8 @@
 	
         void* reserved12; /* GetStringRegion */
         void* reserved13; /* GetStringUTFRegion */
-        void* reserved14; /* GetPrimitiveArrayCritical */
-        void* reserved15; /* ReleasePromitiveArrayCritical */
+	void* (*GetPrimitiveArrayCritical)	(JNIEnv*, jarray, jboolean);
+	void  (*ReleasePrimitiveArrayCritical)	(JNIEnv*, jarray, void*, jint);
         void* reserved16; /* GetStringCritical */
         void* reserved17; /* ReleaseStringCritical */
         void* reserved18; /* NewWeakGlobalRef */
Index: kaffe/kaffe/kaffevm/jni.c
diff -u kaffe/kaffe/kaffevm/jni.c:1.97 kaffe/kaffe/kaffevm/jni.c:1.98
--- kaffe/kaffe/kaffevm/jni.c:1.97	Mon Nov  3 05:29:31 2003
+++ kaffe/kaffe/kaffevm/jni.c	Fri Jan  2 22:36:22 2004
@@ -3024,6 +3024,12 @@
 	return (ret);
 }
 
+static void*
+Kaffe_GetPrimitiveArrayCritical(JNIEnv* env, jarray arr, jbool* iscopy)
+{
+  return (Kaffe_GetByteArrayElements(env, (jbyteArray)arr, iscopy));
+}
+
 static jchar*
 Kaffe_GetCharArrayElements(JNIEnv* env, jcharArray arr, jbool* iscopy)
 {
@@ -3159,6 +3165,12 @@
 }
 
 static void
+Kaffe_ReleasePrimitiveArrayCritical(JNIEnv* env, jbyteArray arr, jbyte* elems, jint mode)
+{
+  Kaffe_ReleaseByteArrayElements(env, (jbyteArray)arr, (jbyte*)elems, mode);
+}
+
+static void
 Kaffe_ReleaseCharArrayElements(JNIEnv* env, jcharArray arr, jchar* elems, jint mode)
 {
 	BEGIN_EXCEPTION_HANDLING_VOID();
@@ -4425,8 +4437,8 @@
 	Kaffe_GetJavaVM,
 	NULL,
 	NULL,
-	NULL,
-	NULL,
+	Kaffe_GetPrimitiveArrayCritical,
+	Kaffe_ReleasePrimitiveArrayCritical,
 	NULL,
 	NULL,
 	NULL,
Index: kaffe/kaffe/kaffevm/jit3/machine.c
diff -u kaffe/kaffe/kaffevm/jit3/machine.c:1.44 kaffe/kaffe/kaffevm/jit3/machine.c:1.45
--- kaffe/kaffe/kaffevm/jit3/machine.c:1.44	Sun Nov  2 17:51:59 2003
+++ kaffe/kaffe/kaffevm/jit3/machine.c	Fri Jan  2 22:36:23 2004
@@ -611,7 +611,17 @@
 			e->start_pc = getInsnPC(e->start_pc, codeInfo, code) + (uintp)code->code;
 			e->end_pc = getInsnPC(e->end_pc, codeInfo, code) + (uintp)code->code;
 			e->handler_pc = getInsnPC(e->handler_pc, codeInfo, code) + (uintp)code->code;
-			assert (e->start_pc <= e->end_pc);
+			if (e->start_pc >= e->end_pc)
+			  fprintf(stderr, 
+				 "WARNING Bad bytecode! Illegal exception table entry:"
+				 " start_pc=%d is not lower than end_pc=%d in method %s.%s(%s)\n"
+				 "See Java Virtual Machine Specification 2nd Edition $4.7.3 for details.\n"
+				 "Please report this bug to the developers of the application you're running on kaffe.\n"
+				 "A simple fix might be to use another java compiler to build the application.\n",
+				 e->start_pc, e->end_pc,
+				 CLASS_CNAME(meth->class),
+				 meth->name->data,
+				 METHOD_SIGD(meth));
 		}
 	}
 




More information about the kaffe mailing list