[kaffe] CVS kaffe (hkraemer): minor fixes

Kaffe CVS cvs-commits at kaffe.org
Sun Feb 8 05:47:01 PST 2004


PatchSet 4398 
Date: 2004/02/08 13:44:39
Author: hkraemer
Branch: HEAD
Tag: (none) 
Log:
minor fixes

Members: 
	ChangeLog:1.1982->1.1983 
	kaffe/kaffevm/jni.c:1.101->1.102 
	kaffe/kaffevm/intrp/machine.c:1.38->1.39 
	kaffe/kaffevm/systems/unix-pthreads/thread-impl.c:1.18->1.19 
	libraries/javalib/java/net/URL.java:1.39->1.40 

Index: kaffe/ChangeLog
diff -u kaffe/ChangeLog:1.1982 kaffe/ChangeLog:1.1983
--- kaffe/ChangeLog:1.1982	Sat Feb  7 15:30:38 2004
+++ kaffe/ChangeLog	Sun Feb  8 13:44:39 2004
@@ -1,3 +1,19 @@
+2004-02-08  Helmer Kraemer <hkraemer at freenet.de>
+
+	* libraries/javalib/java/net/URL.java
+	(getURLStreamHandler): use context classloader to load streamhandler
+
+	Reported by: Mark Maxham <mark at maxham.com>
+
+	* kaffe/kaffevm/jni.c
+	(Kaffe_AttachCurrentThread): init semaphore and return thread's JNIEnv
+
+	* kaffe/kaffevm/systems/unix-pthreads/thread-impl.c
+	(jthread_attach_current_thread): make some guess about the stack size
+
+	* kaffe/kaffevm/intrp/machine.c
+	(runVirtualMachine): fix throwing of stackoverflow exception
+
 2004-02-07  Dalibor Topic <robilad at kaffe.org>
 
 	* kaffe/kaffevm/intrp/machine.c
Index: kaffe/kaffe/kaffevm/jni.c
diff -u kaffe/kaffe/kaffevm/jni.c:1.101 kaffe/kaffe/kaffevm/jni.c:1.102
--- kaffe/kaffe/kaffevm/jni.c:1.101	Sun Feb  1 22:14:53 2004
+++ kaffe/kaffe/kaffevm/jni.c	Sun Feb  8 13:44:41 2004
@@ -3585,7 +3585,9 @@
 Kaffe_AttachCurrentThread(JavaVM* vm, void** penv, ThreadAttachArgs* args)
 {
 	if (jthread_attach_current_thread (false)) {
+		ksemInit(&THREAD_DATA()->sem);
 		attachFakedThreadInstance ("test attach");
+		*penv = THREAD_JNIENV();
 		return 0;
 	}
 	return -1;
Index: kaffe/kaffe/kaffevm/intrp/machine.c
diff -u kaffe/kaffe/kaffevm/intrp/machine.c:1.38 kaffe/kaffe/kaffevm/intrp/machine.c:1.39
--- kaffe/kaffe/kaffevm/intrp/machine.c:1.38	Sat Feb  7 15:30:40 2004
+++ kaffe/kaffe/kaffevm/intrp/machine.c	Sun Feb  8 13:44:41 2004
@@ -83,9 +83,6 @@
 int profFlag;			 /* flag to control profiling */
 #endif
 
-/* Used to store overflow exception */
-static Hjava_lang_Throwable overflow;
-
 void runVirtualMachine(methods *meth, slots *lcl, slots *sp, uintp npc, slots *retval, volatile VmExceptHandler *mjbuf, threadData *thread_data);
 
 void
@@ -121,7 +118,7 @@
 			th = (Hjava_lang_Throwable *)newObjectChecked (javaLangStackOverflowError, &einfo);
 			thread_data->needOnStack = STACK_HIGH;
 		
-			throwException(&overflow);
+			throwException(th);
 		}
 	}
 
Index: kaffe/kaffe/kaffevm/systems/unix-pthreads/thread-impl.c
diff -u kaffe/kaffe/kaffevm/systems/unix-pthreads/thread-impl.c:1.18 kaffe/kaffe/kaffevm/systems/unix-pthreads/thread-impl.c:1.19
--- kaffe/kaffe/kaffevm/systems/unix-pthreads/thread-impl.c:1.18	Sun Feb  1 22:14:55 2004
+++ kaffe/kaffe/kaffevm/systems/unix-pthreads/thread-impl.c	Sun Feb  8 13:44:42 2004
@@ -497,8 +497,10 @@
 
   nt->func         = 0;
   nt->suspendState = 0;
-  nt->stackCur     = 0;
-  nt->daemon	 = daemon;
+  nt->stackMin     = (void *)((uintp)&nt - 0x8000);
+  nt->stackMax     = (void *)((uintp)&nt + 0x400);
+  nt->stackCur     = 0; 
+  nt->daemon       = daemon;
 
   /* link everything together */
   nt->tid = pthread_self();
Index: kaffe/libraries/javalib/java/net/URL.java
diff -u kaffe/libraries/javalib/java/net/URL.java:1.39 kaffe/libraries/javalib/java/net/URL.java:1.40
--- kaffe/libraries/javalib/java/net/URL.java:1.39	Mon Jan 12 02:34:29 2004
+++ kaffe/libraries/javalib/java/net/URL.java	Sun Feb  8 13:44:42 2004
@@ -858,7 +858,9 @@
          
             try
               {
-                Object obj = Class.forName (clsName).newInstance();
+                Object obj = Class.forName (clsName,
+                                            true,
+                                            Thread.currentThread().getContextClassLoader()).newInstance();
 	    
                 if (!(obj instanceof URLStreamHandler))
                   continue;




More information about the kaffe mailing list