/hg/icedtea: 3 new changesets

andrew at icedtea.classpath.org andrew at icedtea.classpath.org
Thu May 7 04:26:21 UTC 2015


changeset d1b536142970 in /hg/icedtea
details: http://icedtea.classpath.org/hg/icedtea?cmd=changeset;node=d1b536142970
author: Andrew John Hughes <gnu_andrew at member.fsf.org>
date: Wed May 06 21:20:05 2015 +0100

	PR2335: CACAO lacks JVM_FindClassFromCaller

	2014-10-29  Andrew John Hughes  <gnu.andrew at redhat.com>

		* Makefile.am:
		(ICEDTEA_PATCHES): Add new patch for CACAO
		builds.
		* NEWS: Updated.
		* patches/cacao/pr2032.patch:
		Implement JVM_FindClassFromCaller as same
		as JVM_FindClassFromClassLoader for now.


changeset 597cc3d8fb28 in /hg/icedtea
details: http://icedtea.classpath.org/hg/icedtea?cmd=changeset;node=597cc3d8fb28
author: Andrew John Hughes <gnu_andrew at member.fsf.org>
date: Wed May 06 22:27:53 2015 +0100

	PR2336: JamVM lacks JVM_FindClassFromCaller

	2015-01-07  Andrew John Hughes  <gnu.andrew at member.fsf.org>

		PR2336: JamVM lacks JVM_FindClassFromCaller
		* Makefile.am:
		(ICEDTEA_PATCHES): Add new patch when building
		JamVM.
		(EXTRA_DIST): Include patches from JamVM directory.
		* NEWS: Updated.
		* patches/jamvm/find_class_from_caller.patch:
		Backport JamVM patch to implement FindClassFromCaller.


changeset 12df15a72296 in /hg/icedtea
details: http://icedtea.classpath.org/hg/icedtea?cmd=changeset;node=12df15a72296
author: Andrew John Hughes <gnu_andrew at member.fsf.org>
date: Thu May 07 05:17:05 2015 +0100

	PR1341: Remove Rhino support

	2015-05-06  Andrew John Hughes  <gnu_andrew at member.fsf.org>

		PR1341: Remove Rhino support
		* rewriter/agpl-3.0.txt,
		* rewriter/com/redhat/rewriter/ClassRewriter.java:
		Removed.
		* INSTALL: Remove references to Rhino.
		* Makefile.am:
		(REWRITER_BUILD_DIR): Removed.
		(REWRITER_SRCS): Likewise.
		(ICEDTEA_ENV): Drop RHINO_JAR.
		(EXTRA_DIST): Remove REWRITER_SRCS and agpl-3.0.txt.
		(clean-local): Drop clean-rewrite-rhino and clean-rewriter.
		(icedtea-configure): Don't depend on rewrite-rhino.
		(icedtea-debug-configure): Likewise.
		(icedtea-boot-configure): Likewise.
		(rewriter): Removed.
		(clean-rewriter): Likewise.
		(rewrite-rhino): Likewise.
		(clean-rewrite-rhino): Likewise.
		* NEWS: Updated.
		* README: Remove references to Rhino.
		* acinclude.m4:
		(IT_FIND_RHINO_JAR): Removed.
		* configure.ac:
		Don't invoke IT_FIND_RHINO_JAR.


diffstat:

 ChangeLog                                       |   49 +
 INSTALL                                         |   21 -
 Makefile.am                                     |   80 +--
 NEWS                                            |    3 +
 README                                          |    2 +-
 acinclude.m4                                    |   48 -
 configure.ac                                    |    1 -
 patches/cacao/pr2032.patch                      |   75 ++
 patches/jamvm/find_class_from_caller.patch      |   93 +++
 rewriter/agpl-3.0.txt                           |  661 ------------------------
 rewriter/com/redhat/rewriter/ClassRewriter.java |  293 ----------
 11 files changed, 233 insertions(+), 1093 deletions(-)

diffs (truncated from 1520 to 500 lines):

diff -r 1c77e4c99219 -r 12df15a72296 ChangeLog
--- a/ChangeLog	Wed May 06 06:12:27 2015 +0100
+++ b/ChangeLog	Thu May 07 05:17:05 2015 +0100
@@ -1,3 +1,52 @@
+2015-05-06  Andrew John Hughes  <gnu_andrew at member.fsf.org>
+
+	PR1341: Remove Rhino support
+	* rewriter/agpl-3.0.txt,
+	* rewriter/com/redhat/rewriter/ClassRewriter.java:
+	Removed.
+	* INSTALL: Remove references to Rhino.
+	* Makefile.am:
+	(REWRITER_BUILD_DIR): Removed.
+	(REWRITER_SRCS): Likewise.
+	(ICEDTEA_ENV): Drop RHINO_JAR.
+	(EXTRA_DIST): Remove REWRITER_SRCS and agpl-3.0.txt.
+	(clean-local): Drop clean-rewrite-rhino and clean-rewriter.
+	(icedtea-configure): Don't depend on rewrite-rhino.
+	(icedtea-debug-configure): Likewise.
+	(icedtea-boot-configure): Likewise.
+	(rewriter): Removed.
+	(clean-rewriter): Likewise.
+	(rewrite-rhino): Likewise.
+	(clean-rewrite-rhino): Likewise.
+	* NEWS: Updated.
+	* README: Remove references to Rhino.
+	* acinclude.m4:
+	(IT_FIND_RHINO_JAR): Removed.
+	* configure.ac:
+	Don't invoke IT_FIND_RHINO_JAR.
+
+2015-01-07  Andrew John Hughes  <gnu_andrew at member.fsf.org>
+
+	PR2336: JamVM lacks JVM_FindClassFromCaller
+	* Makefile.am:
+	(ICEDTEA_PATCHES): Add new patch when building
+	JamVM.
+	(EXTRA_DIST): Include patches from JamVM directory.
+	* NEWS: Updated.
+	* patches/jamvm/find_class_from_caller.patch:
+	Backport JamVM patch to implement FindClassFromCaller.
+
+2014-10-29  Andrew John Hughes  <gnu_andrew at member.fsf.org>
+
+	PR2335: CACAO lacks JVM_FindClassFromCaller
+	* Makefile.am:
+	(ICEDTEA_PATCHES): Add new patch for CACAO
+	builds.
+	* NEWS: Updated.
+	* patches/cacao/pr2032.patch:
+	Implement JVM_FindClassFromCaller as same
+	as JVM_FindClassFromClassLoader for now.
+
 2012-06-12  Andrew John Hughes  <gnu_andrew at member.fsf.org>
 
 	PR2331: IcedTea8 fails to build with IcedTea7
diff -r 1c77e4c99219 -r 12df15a72296 INSTALL
--- a/INSTALL	Wed May 06 06:12:27 2015 +0100
+++ b/INSTALL	Thu May 07 05:17:05 2015 +0100
@@ -27,7 +27,6 @@
 libpng-devel
 libjpeg-devel >= 6b
 zlib-devel
-rhino (can be disabled using --without-rhino)
 libffi (for --enable-zero or on archs other than x86/x86_64/sparc)
 pulseaudio-libs-devel >= 0.9.11 (for --enable-pulse-java)
 LLVM 2.5 or later (for --enable-shark)
@@ -184,7 +183,6 @@
 * --enable-shark: Build the Shark LLVM-based JIT.
 * --enable-zero: Build the zero assembler port on x86/x86_64/sparc platforms.
 * --with-hotspot-build: The HotSpot to use, defaulting to 'original' i.e. hs14 as bundled with OpenJDK.
-* --with-rhino: Include Javascript support using Rhino.
 * --with-additional-vms=vm-list: Additional VMs to build using the system described
   below.
 
@@ -321,25 +319,6 @@
 Currently, IcedTea7 only supports the 'original' HotSpot provided as
 part of the upstream IcedTea forest.
 
-Javascript Support
-==================
-
-IcedTea7 adds Javascript support via the javax.script API by using
-an existing installation of Rhino.  Support is enabled by default,
-with the following locations being searched for a Rhino JAR file:
-
-* /usr/share/java/rhino.jar
-* /usr/share/java/js.jar
-* /usr/share/rhino-1.6/lib/js.jar
-
-A JAR file can instead be specified using the --with-rhino option,
-or support may be disabled by specifying --without-rhino.
-
-Note that the final installed JAR file is a modified version with the
-namespace prefixed by 'sun.' as in the proprietary Oracle JDK.  This
-avoids conflicts between the JDK's copy of Rhino and any used by other
-applications.
-
 Building Additional Virtual Machines
 ====================================
 
diff -r 1c77e4c99219 -r 12df15a72296 Makefile.am
--- a/Makefile.am	Wed May 06 06:12:27 2015 +0100
+++ b/Makefile.am	Thu May 07 05:17:05 2015 +0100
@@ -59,7 +59,6 @@
 BUILD_DEBUG_IMAGE_DIR = $(DEBUG_BUILD_OUTPUT_DIR)/images
 BUILD_DEBUG_JRE_ARCH_DIR = $(BUILD_DEBUG_IMAGE_DIR)/j2sdk-image/jre/lib/$(INSTALL_ARCH_DIR)
 BUILD_BOOT_IMAGE_DIR = $(BOOT_BUILD_OUTPUT_DIR)/images
-REWRITER_BUILD_DIR = $(abs_top_builddir)/rewriter.build
 STAGE1_BOOT_DIR = $(abs_top_builddir)/bootstrap/boot
 STAGE2_BOOT_DIR = $(abs_top_builddir)/bootstrap/icedtea
 JAMVM_IMPORT_PATH = $(abs_top_builddir)/jamvm/install/hotspot
@@ -209,7 +208,6 @@
 
 # Sources list
 
-REWRITER_SRCS = $(top_srcdir)/rewriter/com/redhat/rewriter/ClassRewriter.java
 CRYPTO_CHECK_SRCS = $(top_srcdir)/TestCryptoLevel.java
 
 # Patch list
@@ -224,7 +222,8 @@
 ICEDTEA_PATCHES += \
 	patches/cacao/launcher.patch \
 	patches/cacao/memory.patch \
-	patches/cacao/armhf.patch
+	patches/cacao/armhf.patch \
+	patches/cacao/pr2032.patch
 else
 if USING_CACAO
 ICEDTEA_PATCHES += \
@@ -246,6 +245,11 @@
 ICEDTEA_PATCHES += patches/systemtap-gcc-4.5.patch
 endif
 
+if BUILD_JAMVM
+ICEDTEA_PATCHES += \
+	patches/jamvm/find_class_from_caller.patch
+endif
+
 if ENABLE_NSS
 ICEDTEA_PATCHES += patches/nss-config.patch
 else
@@ -349,11 +353,6 @@
 	HOTSPOT_BUILD_VERSION="$(HOTSPOT_REVISION)"
 endif
 
-if WITH_RHINO
-ICEDTEA_ENV += \
-	RHINO_JAR="$(abs_top_builddir)/rhino/rhino.jar"
-endif
-
 if USE_SYSTEM_LCMS
 ICEDTEA_ENV += \
 	LCMS_LIBS="${LCMS2_LIBS}" \
@@ -488,6 +487,7 @@
 
 EXTRA_DIST = $(top_srcdir)/patches/*.patch \
 	$(top_srcdir)/patches/cacao/*.patch \
+	$(top_srcdir)/patches/jamvm/*.patch \
 	tools-copy contrib overlays \
 	javaws.png javaws.desktop \
 	jconsole.desktop policytool.desktop \
@@ -498,8 +498,6 @@
 	tapset/hotspot_jni.stp.in \
 	scripts/jni_create_stap.c \
 	scripts/jni_desc \
-	rewriter/agpl-3.0.txt \
-	$(REWRITER_SRCS) \
 	THANKYOU test/tapset \
 	$(CRYPTO_CHECK_SRCS)
 
@@ -523,8 +521,7 @@
  clean-bootstrap-directory-symlink-stage1 clean-bootstrap-directory-symlink-stage2 \
  clean-extract clean-native-ecj clean-icedtea-stage2 \
  clean-icedtea-debug-stage2 clean-icedtea-stage1 clean-add-zero clean-add-zero-debug \
- clean-add-cacao clean-add-cacao-debug clean-rt clean-rewrite-rhino clean-rewriter \
- clean-cryptocheck
+ clean-add-cacao clean-add-cacao-debug clean-rt clean-cryptocheck
 	if [ -e bootstrap ]; then \
 	  rmdir bootstrap ; \
 	fi
@@ -1464,8 +1461,7 @@
 # you change it in the icedtea-debug target as well.
 stamps/icedtea-configure.stamp: stamps/bootstrap-directory-symlink-stage2.stamp \
  stamps/download.stamp stamps/extract.stamp $(OPENJDK_TREE) \
- stamps/cacao.stamp $(PULSE_JAVA_TARGET) stamps/rewrite-rhino.stamp \
- stamps/jamvm.stamp
+ stamps/cacao.stamp $(PULSE_JAVA_TARGET) stamps/jamvm.stamp
 	mkdir -p $(BUILD_OUTPUT_DIR)
 	cd $(BUILD_OUTPUT_DIR) && \
 	$(SHELL) $(abs_top_builddir)/openjdk/configure $(ICEDTEA_CONFIGURE)
@@ -1537,8 +1533,7 @@
 
 stamps/icedtea-debug-configure.stamp: stamps/bootstrap-directory-symlink-stage2.stamp \
  stamps/download.stamp stamps/extract.stamp $(OPENJDK_TREE) \
- stamps/cacao.stamp $(PULSE_JAVA_TARGET) stamps/rewrite-rhino.stamp \
- stamps/jamvm.stamp
+ stamps/cacao.stamp $(PULSE_JAVA_TARGET) stamps/jamvm.stamp
 	mkdir -p $(DEBUG_BUILD_OUTPUT_DIR)
 	cd $(DEBUG_BUILD_OUTPUT_DIR) && \
 	$(SHELL) $(abs_top_builddir)/openjdk/configure $(ICEDTEA_CONFIGURE) \
@@ -1693,8 +1688,7 @@
 # ===================
 
 stamps/icedtea-boot-configure.stamp: stamps/bootstrap-directory-symlink-stage1.stamp \
- stamps/download.stamp $(OPENJDK_BOOT_TREE) stamps/cacao.stamp \
- stamps/rewrite-rhino.stamp stamps/jamvm.stamp
+ stamps/download.stamp $(OPENJDK_BOOT_TREE) stamps/cacao.stamp stamps/jamvm.stamp
 	mkdir -p $(BOOT_BUILD_OUTPUT_DIR)
 	cd $(BOOT_BUILD_OUTPUT_DIR) && \
 	$(SHELL) $(abs_top_builddir)/openjdk-boot/configure $(ICEDTEA_CONFIGURE_BOOT)
@@ -1846,52 +1840,6 @@
 
 # end of pulse-java
 
-# Rhino support
-
-stamps/rewriter.stamp: $(INITIAL_BOOTSTRAP_LINK_STAMP)
-if WITH_RHINO
-	mkdir -p $(REWRITER_BUILD_DIR)
-	$(BOOT_DIR)/bin/javac $(IT_JAVACFLAGS) \
-	 -d $(REWRITER_BUILD_DIR) $(REWRITER_SRCS)
-endif
-	mkdir -p stamps
-	touch stamps/rewriter.stamp
-
-clean-rewriter:
-	rm -rf $(REWRITER_BUILD_DIR)
-	rm -f stamps/rewriter.stamp
-
-stamps/rewrite-rhino.stamp: stamps/rewriter.stamp $(RHINO_JAR)
-if WITH_RHINO
-	mkdir -p rhino/rhino.{old,new} && \
-	(cd rhino/rhino.old && $(BOOT_DIR)/bin/jar xf $(RHINO_JAR)) && \
-	$(BOOT_DIR)/bin/java -cp $(REWRITER_BUILD_DIR) \
-	  com.redhat.rewriter.ClassRewriter \
-	  $(abs_top_builddir)/rhino/rhino.old $(abs_top_builddir)/rhino/rhino.new \
-	  org.mozilla sun.org.mozilla && \
-	(cd rhino/rhino.old && \
-	 for files in `find -type f -not -name '*.class'` ; do \
-	   new_file=../rhino.new/`echo $$files|sed -e 's#org#sun/org#'` ; \
-	   mkdir -p `dirname $$new_file` ; \
-	   cp -v $$files $$new_file ; \
-	   sed -ie 's#org\.mozilla#sun.org.mozilla#g' $$new_file ; \
-	 done \
-	) && \
-	(cd rhino/rhino.new && \
-	 $(BOOT_DIR)/bin/jar cfm ../rhino.jar META-INF/MANIFEST.MF sun )
-endif
-	mkdir -p stamps
-	touch stamps/rewrite-rhino.stamp
-
-clean-rewrite-rhino:
-	rm -rf rhino/rhino.old
-	rm -rf rhino/rhino.new
-	rm -f rhino/rhino.jar
-	if [ -e rhino ] ; then \
-	  rmdir rhino ; \
-	fi
-	rm -f stamps/rewrite-rhino.stamp
-
 # JamVM
 
 stamps/jamvm.stamp: $(OPENJDK_TREE) stamps/rt.stamp
@@ -2410,10 +2358,6 @@
 
 pulse-java: $(PULSE_JAVA_TARGET)
 
-rewriter: stamps/rewriter.stamp
-
-rewrite-rhino: stamps/rewrite-rhino.stamp
-
 rt: stamps/rt.stamp
 
 rt-class-files: stamps/rt-class-files.stamp
diff -r 1c77e4c99219 -r 12df15a72296 NEWS
--- a/NEWS	Wed May 06 06:12:27 2015 +0100
+++ b/NEWS	Thu May 07 05:17:05 2015 +0100
@@ -29,6 +29,7 @@
   - PR1289: Allow JARs to be optionally compressed by setting COMPRESS_JARS
   - PR1291: Ensure unlimited crypto policy is in place.
   - PR1325: Only add classes to rt-source-files.txt if actually needed
+  - PR1341: Remove Rhino support
   - PR1346: Filter out -j option to make
   - PR1347: Update list of checked JDKs
   - PR1348: java -version output is broken
@@ -89,11 +90,13 @@
   - JSR 292: correct intrinsic cache COMPARE function
   - Race condition in setting up imethod table
   - GC: Minor performance improvement
+  - PR2336: JamVM lacks JVM_FindClassFromCaller
 * CACAO
   - PR1277: Synchronise CACAO rules between IcedTea6/7/8 where possible
   - PR1279: Synchronise CACAO versions between IcedTea6/7/8 where possible
   - CA172, PR2330, G453612: Add ARM hardfloat support to CACAO on Gentoo
   - PR2331: IcedTea8 fails to build with IcedTea7 CACAO due to low max heap size
+  - PR2335: CACAO lacks JVM_FindClassFromCaller
 
 New in release 2.0 (2011-XX-XX):
 
diff -r 1c77e4c99219 -r 12df15a72296 README
--- a/README	Wed May 06 06:12:27 2015 +0100
+++ b/README	Thu May 07 05:17:05 2015 +0100
@@ -6,7 +6,7 @@
 
 IcedTea addresses two problems: it eliminates the build requirement on
 proprietary build tools and provides additional patches and features
-(such as Javascript support via Rhino) not available in OpenJDK.
+not available in OpenJDK.
 
 IcedTea also provides build scripts and patches that fix a number of issues
 which are as yet unresolved upstream.
diff -r 1c77e4c99219 -r 12df15a72296 acinclude.m4
--- a/acinclude.m4	Wed May 06 06:12:27 2015 +0100
+++ b/acinclude.m4	Thu May 07 05:17:05 2015 +0100
@@ -579,54 +579,6 @@
   AC_SUBST(ALT_JAR_CMD)
 ])
 
-AC_DEFUN([IT_FIND_RHINO_JAR],
-[
-  AC_MSG_CHECKING([whether to include Javascript support via Rhino])
-  AC_ARG_WITH([rhino],
-              [AS_HELP_STRING([--with-rhino[[=PATH]]],specify location of the rhino jar)],
-  [
-    case "${withval}" in
-      yes)
-	RHINO_JAR=yes
-        ;;
-      no)
-        RHINO_JAR=no
-        ;;
-      *)
-    	if test -f "${withval}"; then
-          RHINO_JAR="${withval}"
-        else
-	  AC_MSG_RESULT([not found])
-          AC_MSG_ERROR("The rhino jar ${withval} was not found.")
-        fi
-	;;
-     esac
-  ],
-  [
-    RHINO_JAR=yes
-  ])
-  if test x"${RHINO_JAR}" = "xyes"; then
-    if test -e "/usr/share/java/rhino.jar"; then
-      RHINO_JAR=/usr/share/java/rhino.jar
-    elif test -e "/usr/share/java/js.jar"; then
-      RHINO_JAR=/usr/share/java/js.jar
-    elif test -e "/usr/share/rhino-1.6/lib/js.jar"; then
-      RHINO_JAR=/usr/share/rhino-1.6/lib/js.jar
-    fi
-    if test x"${RHINO_JAR}" = "xyes"; then
-      AC_MSG_RESULT([not found])
-      AC_MSG_ERROR("A rhino jar was not found in /usr/share/java as either rhino.jar or js.jar.")
-    fi
-  fi
-  AC_MSG_RESULT(${RHINO_JAR})
-  AM_CONDITIONAL(WITH_RHINO, test x"${RHINO_JAR}" != "xno")
-dnl Clear RHINO_JAR if it doesn't contain a valid filename
-  if test x"${RHINO_JAR}" = "xno"; then
-    RHINO_JAR=
-  fi
-  AC_SUBST(RHINO_JAR)
-])
-
 AC_DEFUN([IT_DISABLE_OPTIMIZATIONS],
 [
   AC_MSG_CHECKING([whether to disable optimizations and build with -O0 -g])
diff -r 1c77e4c99219 -r 12df15a72296 configure.ac
--- a/configure.ac	Wed May 06 06:12:27 2015 +0100
+++ b/configure.ac	Thu May 07 05:17:05 2015 +0100
@@ -120,7 +120,6 @@
 IT_CHECK_ENABLE_WARNINGS
 IT_DIAMOND_CHECK
 
-IT_FIND_RHINO_JAR
 IT_WITH_OPENJDK_SRC_ZIP
 IT_WITH_HOTSPOT_SRC_ZIP
 IT_WITH_CORBA_SRC_ZIP
diff -r 1c77e4c99219 -r 12df15a72296 patches/cacao/pr2032.patch
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/cacao/pr2032.patch	Thu May 07 05:17:05 2015 +0100
@@ -0,0 +1,75 @@
+# HG changeset patch
+# User Xerxes RÃ¥nby <xerxes at gudinna.com>
+# Date 1414362363 -3600
+# Node ID ec6bd33b3e927738d1353e6e639e76f74d55635f
+# Parent  ea3c9a40d975430d1e9dcb598bf25b4bd7aec4ca
+OpenJDK: Implement JVM_FindClassFromCaller
+
+8015256: Better class accessibility
+Summary: Improve protection domain check in forName()
+
+* contrib/mapfile-vers-product: Export said function.
+* src/native/vm/openjdk/jvm.cpp (JVM_FindClassFromCaller): Implement it.
+
+diff --git a/contrib/mapfile-vers-product b/contrib/mapfile-vers-product
+--- cacao/cacao/contrib/mapfile-vers-product
++++ cacao/cacao/contrib/mapfile-vers-product
+@@ -87,6 +87,7 @@
+                 JVM_Exit;
+                 JVM_FillInStackTrace;
+                 JVM_FindClassFromBootLoader;
++                JVM_FindClassFromCaller;
+                 JVM_FindClassFromClass;
+                 JVM_FindClassFromClassLoader;
+                 JVM_FindLibraryEntry;
+--- cacao/cacao/src/native/vm/openjdk/jvm.cpp.orig	2014-10-29 16:40:30.732305204 +0000
++++ cacao/cacao/src/native/vm/openjdk/jvm.cpp	2014-10-29 16:44:06.643292016 +0000
+@@ -684,6 +684,48 @@
+ }
+ 
+ 
++/* JVM_FindClassFromCaller
++ * Find a class from a given class loader.  Throws ClassNotFoundException.
++ *  name:   name of class
++ *  init:   whether initialization is done
++ *  loader: class loader to look up the class.
++ *          This may not be the same as the caller's class loader.
++ *  caller: initiating class. The initiating class may be null when a security
++ *          manager is not installed.
++ *
++ * Find a class with this name in this loader,
++ * using the caller's "protection domain".
++ */
++
++jclass JVM_FindClassFromCaller(JNIEnv* env, const char* name, jboolean init, jobject loader, jclass caller)
++{
++	classinfo     *c;
++	utf           *u;
++	classloader_t *cl;
++
++	TRACEJVMCALLS(("JVM_FindClassFromCaller(name=%s, init=%d, loader=%p, caller=%p)", name, init, loader, caller));
++
++	u  = utf_new_char(name);
++	cl = loader_hashtable_classloader_add((java_handle_t *) loader);
++
++	/* XXX The caller's protection domain should be used during
++	   the load_class_from_classloader but there is no specification or
++	   unit-test in OpenJDK documenting the desired effect */
++
++	c = load_class_from_classloader(u, cl);
++
++	if (c == NULL)
++		return NULL;
++
++	if (init)
++		if (!(c->state & CLASS_INITIALIZED))
++			if (!initialize_class(c))
++				return NULL;
++
++	return (jclass) LLNI_classinfo_wrap(c);
++}
++
++
+ /* JVM_FindClassFromClassLoader */
+ 
+ jclass JVM_FindClassFromClassLoader(JNIEnv* env, const char* name, jboolean init, jobject loader, jboolean throwError)
diff -r 1c77e4c99219 -r 12df15a72296 patches/jamvm/find_class_from_caller.patch
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/jamvm/find_class_from_caller.patch	Thu May 07 05:17:05 2015 +0100
@@ -0,0 +1,93 @@
+diff -Nru jamvm.old/src/classlib/openjdk/class.c jamvm/src/classlib/openjdk/class.c
+--- jamvm/jamvm.old/src/classlib/openjdk/class.c	2013-11-18 03:45:44.000000000 +0000
++++ jamvm/jamvm/src/classlib/openjdk/class.c	2015-01-07 16:14:57.599311159 +0000
+@@ -23,6 +23,7 @@
+ #include "jam.h"
+ #include "hash.h"
+ #include "class.h"
++#include "excep.h"
+ #include "symbol.h"
+ 
+ /* Cached offset of classes field in java.lang.ClassLoader objects */
+@@ -161,3 +162,24 @@
+ 
+     return strcat(strcpy(endorsed_dirs, java_home), "/lib/endorsed");
+ }
++
++Class *findClassFromLoader(char *name, int init, Object *loader,
++                           int throw_error) {
++
++    Class *class = findClassFromClassLoader(name, loader);
++
++    if(class == NULL) {
++        if(!throw_error) {
++            Object *excep = exceptionOccurred();
++            char *dot_name = slash2DotsDup(name);
++
++            clearException();
++            signalChainedException(java_lang_ClassNotFoundException,
++                                   dot_name, excep);
++            sysFree(dot_name);
++        }
++    } else if(init)
++        initClass(class);
++
++    return class;
++}


More information about the distro-pkg-dev mailing list