changeset in /hg/icedtea: 2009-06-03 Xerxes R?nby <xerxes at zafe...

Xerxes R?nby xerxes at zafena.se
Wed Jun 3 07:42:28 PDT 2009


changeset 123d98a5d278 in /hg/icedtea
details: http://icedtea.classpath.org/hg/icedtea?cmd=changeset;node=123d98a5d278
description:
	2009-06-03  Xerxes R?nby  <xerxes at zafena.se>
		    Stefan Ring  <stefan at complang.tuwien.ac.at>

		* patches/cacao/native-resolve.patch: New.
		* patches/cacao/xxoption-warning.patch: Likewise.
		* Makefile.am (ICEDTEA_PATCHES): Apply above patches.
		* HACKING: Update.

diffstat:

5 files changed, 178 insertions(+), 2 deletions(-)
ChangeLog                            |    8 +
HACKING                              |    4 
Makefile.am                          |    4 
patches/cacao/native-resolve.patch   |  143 ++++++++++++++++++++++++++++++++++
patches/cacao/xxoption-warning.patch |   21 ++++

diffs (215 lines):

diff -r e9bd43d303d1 -r 123d98a5d278 ChangeLog
--- a/ChangeLog	Sun May 31 15:29:57 2009 +0200
+++ b/ChangeLog	Wed Jun 03 16:41:46 2009 +0200
@@ -1,3 +1,11 @@ 2009-05-30  Mark Wielaard  <mark at klomp.o
+2009-06-03  Xerxes RÃ¥nby  <xerxes at zafena.se>
+	    Stefan Ring  <stefan at complang.tuwien.ac.at>
+
+	* patches/cacao/native-resolve.patch: New.
+	* patches/cacao/xxoption-warning.patch: Likewise.
+	* Makefile.am (ICEDTEA_PATCHES): Apply above patches.
+	* HACKING: Update.
+
 2009-05-30  Mark Wielaard  <mark at klomp.org>
 
 	* configure.ac (enable-nio2): Removed.
diff -r e9bd43d303d1 -r 123d98a5d278 HACKING
--- a/HACKING	Sun May 31 15:29:57 2009 +0200
+++ b/HACKING	Wed Jun 03 16:41:46 2009 +0200
@@ -72,7 +72,9 @@ The following patches are currently appl
 * icedtea-includedb.patch: Add missing include files. (S6793825, mostly applied in b47)
 * icedtea-xml-encodinginfo.patch: Fix possible StackOverflowError in EncodingInfo (PR295).
 * cacao/launcher.patch: For the 'java' command, create new thread depending on the current VM.
-* icedtea-cacao-no-mmap-first-page.patch: Don't mmap the first memory page.
+* cacao/no-mmap-first-page.patch: Don't mmap the first memory page.
+* cacao/native-resolve.patch: Changes CACAO resolution order for native methods. (cacao PR128).
+* cacao/xxoption-warning.patch: Makes CACAO print warnings to stderr (cacao PR128).
 
 The following patches are only applied to OpenJDK6 in IcedTea6:
 
diff -r e9bd43d303d1 -r 123d98a5d278 Makefile.am
--- a/Makefile.am	Sun May 31 15:29:57 2009 +0200
+++ b/Makefile.am	Wed Jun 03 16:41:46 2009 +0200
@@ -2087,7 +2087,9 @@ if BUILD_CACAO
 if BUILD_CACAO
 ICEDTEA_PATCHES += \
 	patches/cacao/launcher.patch \
-	patches/cacao/no-mmap-first-page.patch
+	patches/cacao/no-mmap-first-page.patch \
+	patches/cacao/native-resolve.patch \
+	patches/cacao/xxoption-warning.patch
 endif
 
 if WITH_CACAO
diff -r e9bd43d303d1 -r 123d98a5d278 patches/cacao/native-resolve.patch
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/cacao/native-resolve.patch	Wed Jun 03 16:41:46 2009 +0200
@@ -0,0 +1,143 @@
+
+# HG changeset patch
+# User Stefan Ring <stefan at complang.tuwien.ac.at>
+# Date 1244023392 -7200
+# Node ID 8e8a38453f6c1e11e057457daf979a1acb40d9bf
+# Parent 5fdb98095047abf89f3d3298417499c2c06f8d56
+Fixes PR128 (changed resolution order for native methods).
+* src/native/native.c (native_method_resolve): Consider internal
+methods before descending into java.lang.ClassLoader.
+
+--- cacao/cacao/src/native/native.c	Wed Jun 03 01:35:48 2009 +0200
++++ cacao/cacao/src/native/native.c	Wed Jun 03 12:03:12 2009 +0200
+@@ -1,6 +1,6 @@
+ /* src/native/native.c - native library support
+ 
+-   Copyright (C) 1996-2005, 2006, 2007, 2008
++   Copyright (C) 1996-2005, 2006, 2007, 2008, 2009
+    CACAOVM - Verein zur Foerderung der freien virtuellen Maschine CACAO
+ 
+    This file is part of CACAO.
+@@ -529,39 +529,47 @@
+ 
+ 	newname = native_make_overloaded_function(name, m->descriptor);
+ 
++	/* Try to find the native function symbol in the main program. */
++
++	f = native_method_find(m);
++
++	if (f != NULL)
++		if (opt_verbosejni)
++			printf("internal ]\n");
++
++#if defined(ENABLE_DL)
+ 	/* check the library hash entries of the classloader of the
+ 	   methods's class  */
+ 
+-	f = NULL;
++	if (f == NULL) {
++		/* Get the classloader. */
+ 
+-#if defined(ENABLE_DL)
+-	/* Get the classloader. */
++		cl = class_get_classloader(m->clazz);
+ 
+-	cl = class_get_classloader(m->clazz);
++		/* normally addresses are aligned to 4, 8 or 16 bytes */
+ 
+-	/* normally addresses are aligned to 4, 8 or 16 bytes */
++		key  = ((u4) (ptrint) cl) >> 4;                       /* align to 16-byte */
++		slot = key & (hashtable_library->size - 1);
++		le   = hashtable_library->ptr[slot];
+ 
+-	key  = ((u4) (ptrint) cl) >> 4;                       /* align to 16-byte */
+-	slot = key & (hashtable_library->size - 1);
+-	le   = hashtable_library->ptr[slot];
++		/* iterate through loaders in this hash slot */
+ 
+-	/* iterate through loaders in this hash slot */
++		while ((le != NULL) && (f == NULL)) {
++			/* iterate through names in this loader */
+ 
+-	while ((le != NULL) && (f == NULL)) {
+-		/* iterate through names in this loader */
++			ne = le->namelink;
+ 
+-		ne = le->namelink;
+-			
+-		while ((ne != NULL) && (f == NULL)) {
+-			f = (functionptr) (ptrint) system_dlsym(ne->handle, name->text);
++			while ((ne != NULL) && (f == NULL)) {
++				f = (functionptr) (ptrint) system_dlsym(ne->handle, name->text);
+ 
+-			if (f == NULL)
+-				f = (functionptr) (ptrint) system_dlsym(ne->handle, newname->text);
++				if (f == NULL)
++					f = (functionptr) (ptrint) system_dlsym(ne->handle, newname->text);
+ 
+-			ne = ne->hashlink;
++				ne = ne->hashlink;
++			}
++
++			le = le->hashlink;
+ 		}
+-
+-		le = le->hashlink;
+ 	}
+ 
+ # if defined(WITH_JAVA_RUNTIME_LIBRARY_OPENJDK)
+@@ -577,23 +585,22 @@
+ 									 class_java_lang_ClassLoader,
+ 									 true);
+ 
+-		if (method_findNative == NULL)
+-			return NULL;
++		if (method_findNative != NULL) {
++			/* try the normal name */
+ 
+-		/* try the normal name */
+-
+-		s = javastring_new(name);
+-
+-		f = (functionptr) (intptr_t) vm_call_method_long(method_findNative,
+-														 NULL, cl, s);
+-
+-		/* if not found, try the mangled name */
+-
+-		if (f == NULL) {
+-			s = javastring_new(newname);
++			s = javastring_new(name);
+ 
+ 			f = (functionptr) (intptr_t) vm_call_method_long(method_findNative,
+ 															 NULL, cl, s);
++
++			/* if not found, try the mangled name */
++
++			if (f == NULL) {
++				s = javastring_new(newname);
++
++				f = (functionptr) (intptr_t) vm_call_method_long(method_findNative,
++																 NULL, cl, s);
++			}
+ 		}
+ 	}
+ # endif
+@@ -602,17 +609,6 @@
+ 		if (opt_verbosejni)
+ 			printf("JNI ]\n");
+ #endif
+-
+-	/* If not found, try to find the native function symbol in the
+-	   main program. */
+-
+-	if (f == NULL) {
+-		f = native_method_find(m);
+-
+-		if (f != NULL)
+-			if (opt_verbosejni)
+-				printf("internal ]\n");
+-	}
+ 
+ #if defined(ENABLE_JVMTI)
+ 	/* fire Native Method Bind event */
+
diff -r e9bd43d303d1 -r 123d98a5d278 patches/cacao/xxoption-warning.patch
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/cacao/xxoption-warning.patch	Wed Jun 03 16:41:46 2009 +0200
@@ -0,0 +1,21 @@
+
+# HG changeset patch
+# User Stefan Ring <stefan at complang.tuwien.ac.at>
+# Date 1243985748 -7200
+# Node ID 5fdb98095047abf89f3d3298417499c2c06f8d56
+# Parent 2d848ae770f5b7bfc59cf007ceae36f97adccc03
+* src/vm/options.c (options_xx): Don't clutter output with warning (print to
+stderr instead).
+
+--- cacao/cacao/src/vmcore/options.c	Wed Apr 22 11:20:27 2009 +0200
++++ cacao/cacao/src/vmcore/options.c	Wed Jun 03 01:35:48 2009 +0200
+@@ -816,7 +816,7 @@
+ #endif
+ 
+ 		default:
+-			printf("Unknown -XX option: %s\n", name);
++			fprintf(stderr, "Unknown -XX option: %s\n", name);
+ 			break;
+ 		}
+ 	}
+



More information about the distro-pkg-dev mailing list