changeset 2452:dd5dc6567d11

JamVM: Is self-hosting. 2011-07-08 Xerxes R?nby <xerxes@zafena.se> JamVM: Is self-hosting. * patches/jamvm/remove-sun.misc.Perf-debug-code.patch: New patch. * Makefile.am: (ICEDTEA_PATCHES): Apply new patch when building JamVM. * HACKING: Updated. * NEWS: Updated.
author Xerxes R?nby <xerxes@zafena.se>
date Fri, 08 Jul 2011 10:51:52 +0200
parents b36e263a2d9c
children c3bc27e0ae44
files ChangeLog HACKING Makefile.am NEWS patches/jamvm/remove-sun.misc.Perf-debug-code.patch
diffstat 5 files changed, 67 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Thu Jul 07 13:10:27 2011 +0100
+++ b/ChangeLog	Fri Jul 08 10:51:52 2011 +0200
@@ -1,3 +1,12 @@
+2011-07-08  Xerxes RĂ„nby  <xerxes@zafena.se>
+
+	JamVM: Is self-hosting.
+	* patches/jamvm/remove-sun.misc.Perf-debug-code.patch: New patch.
+	* Makefile.am:
+	(ICEDTEA_PATCHES): Apply new patch when building JamVM.
+	* HACKING: Updated.
+	* NEWS: Updated.
+
 2011-07-05  Andrew John Hughes  <ahughes@redhat.com>
 
 	PR icedtea/751:
--- a/HACKING	Thu Jul 07 13:10:27 2011 +0100
+++ b/HACKING	Fri Jul 08 10:51:52 2011 +0200
@@ -166,6 +166,11 @@
 * cacao/no-strict-aliasing.patch: Turn off strict aliasing which causes an issue with the verifier
   				  when building with GCC 4.4 (cacao PR129).
 
+The following patches are only applied when building with the JamVM virtual machine:
+* jamvm/remove-sun.misc.Perf-debug-code.patch: Remove use of Hotspot specific
+  sun.misc.Perf debug JNI API inside of the OpenJDK classes that are
+  unsupported by JamVM.
+
 The following patches are to support Xrender pipeline (-Dsun.java2d.xrender):
 
 * icedtea-xrender-xxx.patch: Numbered patches from xrender branch
--- a/Makefile.am	Thu Jul 07 13:10:27 2011 +0100
+++ b/Makefile.am	Fri Jul 08 10:51:52 2011 +0200
@@ -306,6 +306,11 @@
 	patches/cacao/ignore-tests.patch
 endif
 
+if BUILD_JAMVM
+ICEDTEA_PATCHES += \
+	patches/jamvm/remove-sun.misc.Perf-debug-code.patch
+endif
+
 if ENABLE_PULSE_JAVA
 ICEDTEA_PATCHES += \
 	patches/pulse-soundproperties.patch
--- a/NEWS	Thu Jul 07 13:10:27 2011 +0100
+++ b/NEWS	Fri Jul 08 10:51:52 2011 +0200
@@ -12,6 +12,7 @@
 New in release 2.0 (2011-XX-XX):
 
 * JamVM
+  - JamVM is self-hosting.
   - Make classlib init functions consistent + warnings.
   - Correctly implement sun.misc.Unsafe freeMemory().
   - Move lazy-loading to init function.
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/jamvm/remove-sun.misc.Perf-debug-code.patch	Fri Jul 08 10:51:52 2011 +0200
@@ -0,0 +1,47 @@
+Index: openjdk/jdk/src/share/classes/java/net/URLClassLoader.java
+===================================================================
+--- openjdk.orig/jdk/src/share/classes/java/net/URLClassLoader.java	2011-06-13 16:58:42.000000000 +0200
++++ openjdk/jdk/src/share/classes/java/net/URLClassLoader.java	2011-06-28 18:43:50.114802612 +0200
+@@ -438,14 +438,12 @@
+             // Use (direct) ByteBuffer:
+             CodeSigner[] signers = res.getCodeSigners();
+             CodeSource cs = new CodeSource(url, signers);
+-            sun.misc.PerfCounter.getReadClassBytesTime().addElapsedTimeFrom(t0);
+             return defineClass(name, bb, cs);
+         } else {
+             byte[] b = res.getBytes();
+             // must read certificates AFTER reading bytes.
+             CodeSigner[] signers = res.getCodeSigners();
+             CodeSource cs = new CodeSource(url, signers);
+-            sun.misc.PerfCounter.getReadClassBytesTime().addElapsedTimeFrom(t0);
+             return defineClass(name, b, 0, b.length, cs);
+         }
+     }
+Index: openjdk/jdk/src/share/classes/java/lang/ClassLoader.java
+===================================================================
+--- openjdk.orig/jdk/src/share/classes/java/lang/ClassLoader.java	2011-06-13 16:58:42.000000000 +0200
++++ openjdk/jdk/src/share/classes/java/lang/ClassLoader.java	2011-06-28 18:43:50.142802778 +0200
+@@ -422,10 +422,6 @@
+                     long t1 = System.nanoTime();
+                     c = findClass(name);
+ 
+-                    // this is the defining class loader; record the stats
+-                    sun.misc.PerfCounter.getParentDelegationTime().addTime(t1 - t0);
+-                    sun.misc.PerfCounter.getFindClassTime().addElapsedTimeFrom(t1);
+-                    sun.misc.PerfCounter.getFindClasses().increment();
+                 }
+             }
+             if (resolve) {
+Index: openjdk/jdk/src/share/classes/java/util/zip/ZipFile.java
+===================================================================
+--- openjdk.orig/jdk/src/share/classes/java/util/zip/ZipFile.java	2011-06-28 18:56:56.994704556 +0200
++++ openjdk/jdk/src/share/classes/java/util/zip/ZipFile.java	2011-06-28 18:57:11.514776567 +0200
+@@ -212,8 +212,6 @@
+         this.zc = ZipCoder.get(charset);
+         long t0 = System.nanoTime();
+         jzfile = open(name, mode, file.lastModified(), usemmap);
+-        sun.misc.PerfCounter.getZipFileOpenTime().addElapsedTimeFrom(t0);
+-        sun.misc.PerfCounter.getZipFileCount().increment();
+         this.name = name;
+         this.total = getTotal(jzfile);
+     }