[kaffe] CVS kaffe (hkraemer): fix for unix-pthreads

Kaffe CVS cvs-commits at kaffe.org
Thu Apr 22 01:18:02 PDT 2004


PatchSet 4673 
Date: 2004/04/22 08:13:54
Author: hkraemer
Branch: HEAD
Tag: (none) 
Log:
fix for unix-pthreads

Members: 
	ChangeLog:1.2249->1.2250 
	kaffe/kaffevm/exception.c:1.82->1.83 
	kaffe/kaffevm/exception.h:1.26->1.27 
	kaffe/kaffevm/thread.c:1.61->1.62 
	kaffe/kaffevm/thread.h:1.18->1.19 

Index: kaffe/ChangeLog
diff -u kaffe/ChangeLog:1.2249 kaffe/ChangeLog:1.2250
--- kaffe/ChangeLog:1.2249	Wed Apr 21 15:57:53 2004
+++ kaffe/ChangeLog	Thu Apr 22 08:13:54 2004
@@ -1,3 +1,16 @@
+2004-04-22  Helmer Kraemer  <hkraemer at freenet.de>
+
+	* kaffe/kaffevm/thread.c, kaffe/kaffevm/thread.h
+	remove some NONRETURNING attributes as they break unix-pthreads
+
+	* kaffe/kaffevm/exception.h
+	(vmExcept_JNIContains, vmExcept_setJNIFrame, VmExceptHandler):
+	change type of fp to uintp as it holds the value of a register
+
+	* kaffe/kaffevm/exception.c
+	(findExceptionBlockInMethod): don't use pointers before checking
+	whether they're != NULL
+	
 2004-04-21  Guilhem Lavaux <guilhem at kaffe.org>
 
 	* kaffe/kaffevm/soft.c
Index: kaffe/kaffe/kaffevm/exception.c
diff -u kaffe/kaffe/kaffevm/exception.c:1.82 kaffe/kaffe/kaffevm/exception.c:1.83
--- kaffe/kaffe/kaffevm/exception.c:1.82	Mon Apr  5 17:43:38 2004
+++ kaffe/kaffe/kaffevm/exception.c	Thu Apr 22 08:13:56 2004
@@ -335,6 +335,9 @@
 	     lastJniFrame && !vmExcept_isJNIFrame(lastJniFrame);
 	     lastJniFrame = lastJniFrame->prev);
 
+	DBG(ELOOKUP,
+		dprintf ("dispatchException(): lastJniFrame is %p, fp 0x%x\n", lastJniFrame, (lastJniFrame?lastJniFrame->frame.jni.fp:0)); );
+
 	/*
 	 * now walk up the stack 
 	 */
@@ -346,7 +349,7 @@
 		/*
 		 * if we reach the last jni frame, we're done
 		 */
-		if (lastJniFrame && vmExcept_JNIContains(lastJniFrame, (void*)frame->fp)) {
+		if (lastJniFrame && vmExcept_JNIContains(lastJniFrame, frame->fp)) {
 			thread_data->exceptPtr = lastJniFrame;
 			vmExcept_jumpToHandler(lastJniFrame); /* doesn't return */
 		}
@@ -513,18 +516,18 @@
 {
 	jexceptionEntry* eptr;
 	Hjava_lang_Class* cptr;
-	int i;
+	unsigned int i;
 
 	assert(handler);
 
-	eptr = &ptr->exception_table->entry[0];
-
 	/* Right method - look for exception */
 	if (ptr->exception_table == 0) {
 DBG(ELOOKUP,
 		dprintf("%s.%s has no handlers.\n", ptr->class->name->data, ptr->name->data); )
 		return (false);
 	}
+
+	eptr = &ptr->exception_table->entry[0];
 
 DBG(ELOOKUP,
 	dprintf("%s.%s has %d handlers (throw was pc=%#lx):\n",
Index: kaffe/kaffe/kaffevm/exception.h
diff -u kaffe/kaffe/kaffevm/exception.h:1.26 kaffe/kaffe/kaffevm/exception.h:1.27
--- kaffe/kaffe/kaffevm/exception.h:1.26	Sun Apr  4 06:11:56 2004
+++ kaffe/kaffe/kaffevm/exception.h	Thu Apr 22 08:13:56 2004
@@ -78,7 +78,7 @@
 		struct
 		{
 			/* Frame address for JNI entry function. */
-			void *	        		fp;
+			uintp	        		fp;
 		} jni;
 		/*
 		 * The intrp bits are only valid if meth != 0 && meth
@@ -105,8 +105,8 @@
 extern void initExceptions(void);
 
 static inline bool vmExcept_isJNIFrame(VmExceptHandler* eh) __UNUSED__;
-static inline bool vmExcept_JNIContains(VmExceptHandler* eh, void *pc) __UNUSED__;
-static inline void vmExcept_setJNIFrame(VmExceptHandler* eh, void *fp) __UNUSED__;
+static inline bool vmExcept_JNIContains(VmExceptHandler* eh, uintp fp) __UNUSED__;
+static inline void vmExcept_setJNIFrame(VmExceptHandler* eh, uintp fp) __UNUSED__;
 static inline struct _methods* vmExcept_getMeth(VmExceptHandler* eh) __UNUSED__;
 static inline void vmExcept_setMeth(VmExceptHandler* eh, struct _methods* m) __UNUSED__;
 static inline void vmExcept_setSyncObj(VmExceptHandler* eh, struct Hjava_lang_Object* syncobj) __UNUSED__;
@@ -123,7 +123,7 @@
 }
 
 static inline bool
-vmExcept_JNIContains(VmExceptHandler* eh, void *fp)
+vmExcept_JNIContains(VmExceptHandler* eh, uintp fp)
 {
 	assert(eh);
 	assert(eh->meth == VMEXCEPTHANDLER_KAFFEJNI_HANDLER);
@@ -133,7 +133,7 @@
 }
 
 static inline void 
-vmExcept_setJNIFrame(VmExceptHandler* eh, void *fp)
+vmExcept_setJNIFrame(VmExceptHandler* eh, uintp fp)
 {
 	assert(eh);
 	assert(fp != 0);
Index: kaffe/kaffe/kaffevm/thread.c
diff -u kaffe/kaffe/kaffevm/thread.c:1.61 kaffe/kaffe/kaffevm/thread.c:1.62
--- kaffe/kaffe/kaffevm/thread.c:1.61	Wed Apr 21 15:58:00 2004
+++ kaffe/kaffe/kaffevm/thread.c	Thu Apr 22 08:13:56 2004
@@ -358,7 +358,6 @@
  */
 static
 void
-NONRETURNING
 firstStartThread(void* arg UNUSED)
 {
 	Hjava_lang_Thread* tid;
Index: kaffe/kaffe/kaffevm/thread.h
diff -u kaffe/kaffe/kaffevm/thread.h:1.18 kaffe/kaffe/kaffevm/thread.h:1.19
--- kaffe/kaffe/kaffevm/thread.h:1.18	Mon Mar 29 21:13:33 2004
+++ kaffe/kaffe/kaffevm/thread.h	Thu Apr 22 08:13:56 2004
@@ -34,7 +34,7 @@
 void    initNativeThreads(int nativestacksize);
 void	yieldThread(void);
 void	sleepThread(jlong);
-void	exitThread(void) NONRETURNING;
+void	exitThread(void);
 bool	aliveThread(Hjava_lang_Thread*);
 jint	framesThread(Hjava_lang_Thread*);
 void	setPriorityThread(Hjava_lang_Thread*, jint);




More information about the kaffe mailing list