/hg/icedtea7: Allow Zero to build again by using 2.1's HotSpot w...

andrew at icedtea.classpath.org andrew at icedtea.classpath.org
Wed Jul 25 14:49:03 PDT 2012


changeset dc1eb9ec0fef in /hg/icedtea7
details: http://icedtea.classpath.org/hg/icedtea7?cmd=changeset;node=dc1eb9ec0fef
author: Andrew John Hughes <gnu_andrew at member.fsf.org>
date: Wed Jul 25 22:48:43 2012 +0100

	Allow Zero to build again by using 2.1's HotSpot when selected.

	2012-07-25  Andrew John Hughes  <gnu_andrew at member.fsf.org>

		* Makefile.am:
		(JDK_CHANGESET): Temporarily revert to u6-b16.
		(JDK_SHA256SUM): Likewise.
		(HS_SHA256SUM): Always set from hotspot.map
		(HS_CHANGESET): Likewise.
		(HS_URL): LIkewise.
		(ICEDTEA_PATCHES): Add additional patches for HotSpot zero.
		(ICEDTEA_BOOT_PATCHES): Use different hotspot-jdk-dependency
		patch dependent on version of HotSpot in use.
		(download-openjdk): Echo HotSpot build being used.
		* acinclude.m4:
		(IT_ENABLE_ZERO_BUILD): Use AC_DEFUN_ONCE.
		(IT_WITH_HOTSPOT_BUILD): Make default "zero" if Zero is enabled.
		* hotspot.map:
		Add default (previous configuration) and zero (from 2.1).
		* patches/boot/hotspot/zero/jdk-dependency.patch:
		Regenerated against 2.1 HotSpot.
		* patches/hotspot/zero/6924259-string_offset.patch:
		Backport so that HotSpot can work with current java.lang.String.
		* patches/hotspot/zero/7089790-bsd_port.patch,
		* patches/hotspot/zero/7098194-macosx_port.patch:
		Backported for modern SystemTap support & setnativethreadname.
		* patches/hotspot/zero/7116189-setnativethreadname.patch:
		Expose setnativethreadname.
		* patches/hotspot/zero/7175133-string_offset.patch:
		Fix jinfo with new java.lang.String.
		* patches/hotspot/zero/revert_arm_debug.patch:
		Remove definition of ps() in vmError.cpp (now defined in debug.cpp)


diffstat:

 ChangeLog                                              |     31 +
 Makefile.am                                            |     31 +-
 acinclude.m4                                           |      9 +-
 hotspot.map                                            |      4 +-
 patches/boot/hotspot-jdk-dependency.patch              |     23 -
 patches/boot/hotspot/default/jdk-dependency.patch      |     23 +
 patches/boot/hotspot/zero/jdk-dependency.patch         |     25 +
 patches/cacao/memory.patch                             |     24 +-
 patches/hotspot/zero/6924259-string_offset.patch       |    934 +
 patches/hotspot/zero/7089790-bsd_port.patch            |  28881 +++++++++++++++
 patches/hotspot/zero/7098194-macosx_port.patch         |  11389 +++++
 patches/hotspot/zero/7116189-setnativethreadname.patch |     67 +
 patches/hotspot/zero/7175133-string_offset.patch       |     48 +
 patches/hotspot/zero/revert_arm_debug.patch            |     55 +
 14 files changed, 41492 insertions(+), 52 deletions(-)

diffs (truncated from 41671 to 500 lines):

diff -r 7d3000c44b3b -r dc1eb9ec0fef ChangeLog
--- a/ChangeLog	Mon Jul 16 10:59:46 2012 +0200
+++ b/ChangeLog	Wed Jul 25 22:48:43 2012 +0100
@@ -1,3 +1,34 @@
+2012-07-25  Andrew John Hughes  <gnu_andrew at member.fsf.org>
+
+	* Makefile.am:
+	(JDK_CHANGESET): Temporarily revert to u6-b16.
+	(JDK_SHA256SUM): Likewise.
+	(HS_SHA256SUM): Always set from hotspot.map
+	(HS_CHANGESET): Likewise.
+	(HS_URL): LIkewise.
+	(ICEDTEA_PATCHES): Add additional patches for HotSpot zero.
+	(ICEDTEA_BOOT_PATCHES): Use different hotspot-jdk-dependency
+	patch dependent on version of HotSpot in use.
+	(download-openjdk): Echo HotSpot build being used.
+	* acinclude.m4:
+	(IT_ENABLE_ZERO_BUILD): Use AC_DEFUN_ONCE.
+	(IT_WITH_HOTSPOT_BUILD): Make default "zero" if Zero is enabled.
+	* hotspot.map:
+	Add default (previous configuration) and zero (from 2.1).
+	* patches/boot/hotspot/zero/jdk-dependency.patch:
+	Regenerated against 2.1 HotSpot.
+	* patches/hotspot/zero/6924259-string_offset.patch:
+	Backport so that HotSpot can work with current java.lang.String.
+	* patches/hotspot/zero/7089790-bsd_port.patch,
+	* patches/hotspot/zero/7098194-macosx_port.patch:
+	Backported for modern SystemTap support & setnativethreadname.
+	* patches/hotspot/zero/7116189-setnativethreadname.patch:
+	Expose setnativethreadname.
+	* patches/hotspot/zero/7175133-string_offset.patch:
+	Fix jinfo with new java.lang.String.
+	* patches/hotspot/zero/revert_arm_debug.patch:
+	Remove definition of ps() in vmError.cpp (now defined in debug.cpp)
+
 2012-07-13  Pavel Tisnovsky  <ptisnovs at redhat.com>
 
 	Resolved conflict between merge jdk7u6-b16 and the fix
diff -r 7d3000c44b3b -r dc1eb9ec0fef Makefile.am
--- a/Makefile.am	Mon Jul 16 10:59:46 2012 +0200
+++ b/Makefile.am	Wed Jul 25 22:48:43 2012 +0100
@@ -8,7 +8,7 @@
 HOTSPOT_CHANGESET = 3359eef69d1e
 JAXP_CHANGESET = 411912b74c9c
 JAXWS_CHANGESET = d5997e503698
-JDK_CHANGESET = 1e341b69c2f7
+JDK_CHANGESET = 0f03c3a0bf94
 LANGTOOLS_CHANGESET = 480d4eb554fc
 OPENJDK_CHANGESET = 7f5ea73378df
 
@@ -16,7 +16,7 @@
 HOTSPOT_SHA256SUM = c10b4208b76c1012e91774bc8a29f561fbb4747fb5bbebe3267f3cbaa24b8c5a
 JAXP_SHA256SUM = 77de1a8c4ab40652d0cf9c862c543376a877eb9399ad20e653c7103c599640e4
 JAXWS_SHA256SUM = 4fdb7a02b9d42fef84a7fb0f2de2b4c15a737a14be93b5de1c5f6d658072cdea
-JDK_SHA256SUM = c8b080004b6e61f66c27a8213ed54840cd5aedc4e141999db7e3e4181bbef1da
+JDK_SHA256SUM = 9c5790b4e35f52c351900b9e71ce0c81479961a6146cbf6b74ef2a2d3c802fd5
 LANGTOOLS_SHA256SUM = 6a3995facdaae90fd7c68faa6c8a566825317136a0064892d71a76f5d5f09efe
 OPENJDK_SHA256SUM = a426ab622e51d5ca40a7da4af4b42c2c216f7c27b56190df36e3bf7fea8529ca
 
@@ -47,7 +47,10 @@
 JAXWS_URL = $(ICEDTEA_HG_URL)/jaxws
 JDK_URL = $(ICEDTEA_HG_URL)/jdk
 LANGTOOLS_URL = $(ICEDTEA_HG_URL)/langtools
-HOTSPOT_URL = $(ICEDTEA_HG_URL)/hotspot
+
+HS_SHA256SUM = "`$(AWK) 'version==$$1 {print $$4}' version=$(HSBUILD) $(abs_top_srcdir)/hotspot.map`"
+HS_CHANGESET = "`$(AWK) 'version==$$1 {print $$3}' version=$(HSBUILD) $(abs_top_srcdir)/hotspot.map`"
+HS_URL = "`$(AWK) 'version==$$1 {print $$2}' version=$(HSBUILD) $(abs_top_srcdir)/hotspot.map`"
 
 # Build directories
 
@@ -140,16 +143,6 @@
   HOTSPOT_SRC_ZIP = hotspot.tar.gz
 endif
 
-if WITH_ALT_HSBUILD
-  HS_SHA256SUM = "`$(AWK) 'version==$$1 {print $$4}' version=$(HSBUILD) $(abs_top_srcdir)/hotspot.map`"
-  HS_CHANGESET = "`$(AWK) 'version==$$1 {print $$3}' version=$(HSBUILD) $(abs_top_srcdir)/hotspot.map`"
-  HS_URL = "`$(AWK) 'version==$$1 {print $$2}' version=$(HSBUILD) $(abs_top_srcdir)/hotspot.map`"
-else
-  HS_SHA256SUM = $(HOTSPOT_SHA256SUM)
-  HS_CHANGESET = $(HOTSPOT_CHANGESET)
-  HS_URL = $(HOTSPOT_URL)
-endif
-
 if ENABLE_PULSE_JAVA
 PULSE_JAVA_TARGET = stamps/pulse-java.stamp
 endif
@@ -239,6 +232,15 @@
 
 # Conditional patches
 
+if WITH_ALT_HSBUILD
+ICEDTEA_PATCHES += \
+	patches/hotspot/$(HSBUILD)/7089790-bsd_port.patch \
+	patches/hotspot/$(HSBUILD)/7098194-macosx_port.patch \
+	patches/hotspot/$(HSBUILD)/7116189-setnativethreadname.patch \
+	patches/hotspot/$(HSBUILD)/6924259-string_offset.patch \
+	patches/hotspot/$(HSBUILD)/revert_arm_debug.patch
+endif
+
 if WITH_RHINO
 ICEDTEA_PATCHES += \
 	patches/rhino.patch
@@ -318,7 +320,7 @@
 	patches/boot/corba-dependencies.patch \
 	patches/boot/jaxws-langtools-dependency.patch \
 	patches/boot/jaxws-jdk-dependency.patch \
-	patches/boot/hotspot-jdk-dependency.patch \
+	patches/boot/hotspot/${HSBUILD}/jdk-dependency.patch \
 	patches/boot/ecj-multicatch.patch \
 	patches/boot/ecj-trywithresources.patch \
 	patches/boot/ecj-autoboxing.patch \
@@ -986,6 +988,7 @@
 if USE_ALT_HOTSPOT_SRC_ZIP
 	ln -sf $(ALT_HOTSPOT_SRC_ZIP) $(HOTSPOT_SRC_ZIP)
 endif
+	echo "Using HotSpot build: ${HSBUILD}"
 	if ! echo "$(HS_SHA256SUM)  $(HOTSPOT_SRC_ZIP)" \
 	  | $(SHA256SUM) --check ; \
 	then \
diff -r 7d3000c44b3b -r dc1eb9ec0fef acinclude.m4
--- a/acinclude.m4	Mon Jul 16 10:59:46 2012 +0200
+++ b/acinclude.m4	Wed Jul 25 22:48:43 2012 +0100
@@ -650,7 +650,7 @@
  AC_SUBST([$1])
 ])
 
-AC_DEFUN([IT_ENABLE_ZERO_BUILD],
+AC_DEFUN_ONCE([IT_ENABLE_ZERO_BUILD],
 [
   AC_REQUIRE([IT_SET_ARCH_SETTINGS])
   AC_MSG_CHECKING([whether to use the zero-assembler port])
@@ -923,7 +923,12 @@
 
 AC_DEFUN([IT_WITH_HOTSPOT_BUILD],
 [
-  DEFAULT_BUILD="default"
+  AC_REQUIRE([IT_ENABLE_ZERO_BUILD])
+  if test "x${use_zero}" = "xyes"; then
+    DEFAULT_BUILD="zero"
+  else
+    DEFAULT_BUILD="default"
+  fi
   AC_MSG_CHECKING([which HotSpot build to use])
   AC_ARG_WITH([hotspot-build],
 	      [AS_HELP_STRING(--with-hotspot-build=BUILD,the HotSpot build to use [[BUILD=default]])],
diff -r 7d3000c44b3b -r dc1eb9ec0fef hotspot.map
--- a/hotspot.map	Mon Jul 16 10:59:46 2012 +0200
+++ b/hotspot.map	Wed Jul 25 22:48:43 2012 +0100
@@ -1,1 +1,3 @@
-# version url changeset md5sum
+# version url changeset sha256sum
+default http://icedtea.classpath.org/hg/icedtea7-forest/hotspot 3359eef69d1e c10b4208b76c1012e91774bc8a29f561fbb4747fb5bbebe3267f3cbaa24b8c5a
+zero http://icedtea.classpath.org/hg/release/icedtea7-forest-2.1/hotspot 8b7c4c5f6ba9 22866990d143e76ced94b76defa3051e5e5d9a51fd272d63daa0df272d6406a2
diff -r 7d3000c44b3b -r dc1eb9ec0fef patches/boot/hotspot-jdk-dependency.patch
--- a/patches/boot/hotspot-jdk-dependency.patch	Mon Jul 16 10:59:46 2012 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,23 +0,0 @@
-diff -Nru openjdk-boot.orig/hotspot/make/linux/makefiles/sa.make openjdk-boot/hotspot/make/linux/makefiles/sa.make
---- openjdk-boot.orig/hotspot/make/linux/makefiles/sa.make	2012-05-23 22:15:04.747642641 +0100
-+++ openjdk-boot/hotspot/make/linux/makefiles/sa.make	2012-05-23 22:16:32.825095823 +0100
-@@ -91,7 +91,7 @@
- # are in AGENT_FILES, so use the shell to expand them.
- # Be extra carefull to not produce too long command lines in the shell!
- 	$(foreach file,$(AGENT_FILES),$(shell ls -1 $(file) >> $(AGENT_FILES_LIST)))
--	$(QUIETLY) $(REMOTE) $(COMPILE.JAVAC) -classpath $(SA_CLASSPATH) -sourcepath $(AGENT_SRC_DIR) -d $(SA_CLASSDIR) @$(AGENT_FILES_LIST)
-+	$(QUIETLY) $(REMOTE) $(COMPILE.JAVAC) -classpath $(SA_CLASSPATH) -sourcepath $(AGENT_SRC_DIR):$(JDK_TOPDIR)/src/share/classes:$(JDK_TOPDIR)/src/solaris/classes:$(GENSRCDIR) -d $(SA_CLASSDIR) @$(AGENT_FILES_LIST)
- 	$(QUIETLY) $(REMOTE) $(COMPILE.RMIC)  -classpath $(SA_CLASSDIR) -d $(SA_CLASSDIR) sun.jvm.hotspot.debugger.remote.RemoteDebuggerServer
- 	$(QUIETLY) echo "$(SA_BUILD_VERSION_PROP)" > $(SA_PROPERTIES)
- 	$(QUIETLY) rm -f $(SA_CLASSDIR)/sun/jvm/hotspot/utilities/soql/sa.js
-diff -Nru openjdk-boot.orig/make/hotspot-rules.gmk openjdk-boot/make/hotspot-rules.gmk
---- openjdk-boot.orig/make/hotspot-rules.gmk	2012-05-23 20:37:39.000000000 +0100
-+++ openjdk-boot/make/hotspot-rules.gmk	2012-05-23 22:16:52.425419199 +0100
-@@ -85,6 +85,7 @@
- HOTSPOT_BUILD_ARGUMENTS += ALT_OUTPUTDIR=$(HOTSPOT_OUTPUTDIR)
- HOTSPOT_BUILD_ARGUMENTS += ALT_EXPORT_PATH=$(HOTSPOT_EXPORT_PATH)
- HOTSPOT_BUILD_ARGUMENTS += BUILD_FLAVOR=$(BUILD_FLAVOR)
-+HOTSPOT_BUILD_ARGUMENTS += GENSRCDIR=$(GENSRCDIR)
- 
- # Why do these need to be passed in? Because of windows nmake? and MAKEFLAGS=?
- #   Or is there something wrong with hotspot/make/Makefile?
diff -r 7d3000c44b3b -r dc1eb9ec0fef patches/boot/hotspot/default/jdk-dependency.patch
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/boot/hotspot/default/jdk-dependency.patch	Wed Jul 25 22:48:43 2012 +0100
@@ -0,0 +1,23 @@
+diff -Nru openjdk-boot.orig/hotspot/make/linux/makefiles/sa.make openjdk-boot/hotspot/make/linux/makefiles/sa.make
+--- openjdk-boot.orig/hotspot/make/linux/makefiles/sa.make	2012-05-23 22:15:04.747642641 +0100
++++ openjdk-boot/hotspot/make/linux/makefiles/sa.make	2012-05-23 22:16:32.825095823 +0100
+@@ -91,7 +91,7 @@
+ # are in AGENT_FILES, so use the shell to expand them.
+ # Be extra carefull to not produce too long command lines in the shell!
+ 	$(foreach file,$(AGENT_FILES),$(shell ls -1 $(file) >> $(AGENT_FILES_LIST)))
+-	$(QUIETLY) $(REMOTE) $(COMPILE.JAVAC) -classpath $(SA_CLASSPATH) -sourcepath $(AGENT_SRC_DIR) -d $(SA_CLASSDIR) @$(AGENT_FILES_LIST)
++	$(QUIETLY) $(REMOTE) $(COMPILE.JAVAC) -classpath $(SA_CLASSPATH) -sourcepath $(AGENT_SRC_DIR):$(JDK_TOPDIR)/src/share/classes:$(JDK_TOPDIR)/src/solaris/classes:$(GENSRCDIR) -d $(SA_CLASSDIR) @$(AGENT_FILES_LIST)
+ 	$(QUIETLY) $(REMOTE) $(COMPILE.RMIC)  -classpath $(SA_CLASSDIR) -d $(SA_CLASSDIR) sun.jvm.hotspot.debugger.remote.RemoteDebuggerServer
+ 	$(QUIETLY) echo "$(SA_BUILD_VERSION_PROP)" > $(SA_PROPERTIES)
+ 	$(QUIETLY) rm -f $(SA_CLASSDIR)/sun/jvm/hotspot/utilities/soql/sa.js
+diff -Nru openjdk-boot.orig/make/hotspot-rules.gmk openjdk-boot/make/hotspot-rules.gmk
+--- openjdk-boot.orig/make/hotspot-rules.gmk	2012-05-23 20:37:39.000000000 +0100
++++ openjdk-boot/make/hotspot-rules.gmk	2012-05-23 22:16:52.425419199 +0100
+@@ -85,6 +85,7 @@
+ HOTSPOT_BUILD_ARGUMENTS += ALT_OUTPUTDIR=$(HOTSPOT_OUTPUTDIR)
+ HOTSPOT_BUILD_ARGUMENTS += ALT_EXPORT_PATH=$(HOTSPOT_EXPORT_PATH)
+ HOTSPOT_BUILD_ARGUMENTS += BUILD_FLAVOR=$(BUILD_FLAVOR)
++HOTSPOT_BUILD_ARGUMENTS += GENSRCDIR=$(GENSRCDIR)
+ 
+ # Why do these need to be passed in? Because of windows nmake? and MAKEFLAGS=?
+ #   Or is there something wrong with hotspot/make/Makefile?
diff -r 7d3000c44b3b -r dc1eb9ec0fef patches/boot/hotspot/zero/jdk-dependency.patch
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/boot/hotspot/zero/jdk-dependency.patch	Wed Jul 25 22:48:43 2012 +0100
@@ -0,0 +1,25 @@
+diff -Nru openjdk-boot.orig/hotspot/make/linux/makefiles/sa.make openjdk-boot/hotspot/make/linux/makefiles/sa.make
+--- openjdk-boot.orig/hotspot/make/linux/makefiles/sa.make	2012-07-20 18:05:26.733484117 +0100
++++ openjdk-boot/hotspot/make/linux/makefiles/sa.make	2012-07-20 18:10:11.384736044 +0100
+@@ -97,8 +97,8 @@
+ 	$(foreach file,$(AGENT_FILES1),$(shell echo $(file) >> $(AGENT_FILES1_LIST)))
+ 	$(foreach file,$(AGENT_FILES2),$(shell echo $(file) >> $(AGENT_FILES2_LIST)))
+ 	
+-	$(QUIETLY) $(REMOTE) $(COMPILE.JAVAC) -classpath $(SA_CLASSPATH) -sourcepath $(AGENT_SRC_DIR) -d $(SA_CLASSDIR) @$(AGENT_FILES1_LIST)
+-	$(QUIETLY) $(REMOTE) $(COMPILE.JAVAC) -classpath $(SA_CLASSPATH) -sourcepath $(AGENT_SRC_DIR) -d $(SA_CLASSDIR) @$(AGENT_FILES2_LIST)
++	$(QUIETLY) $(REMOTE) $(COMPILE.JAVAC) -classpath $(SA_CLASSPATH) -sourcepath $(AGENT_SRC_DIR):$(JDK_TOPDIR)/src/share/classes:$(JDK_TOPDIR)/src/solaris/classes:$(GENSRCDIR) -d $(SA_CLASSDIR) @$(AGENT_FILES1_LIST)
++	$(QUIETLY) $(REMOTE) $(COMPILE.JAVAC) -classpath $(SA_CLASSPATH) -sourcepath $(AGENT_SRC_DIR):$(JDK_TOPDIR)/src/share/classes:$(JDK_TOPDIR)/src/solaris/classes:$(GENSRCDIR) -d $(SA_CLASSDIR) @$(AGENT_FILES2_LIST)
+ 	
+ 	$(QUIETLY) $(REMOTE) $(COMPILE.RMIC)  -classpath $(SA_CLASSDIR) -d $(SA_CLASSDIR) sun.jvm.hotspot.debugger.remote.RemoteDebuggerServer
+ 	$(QUIETLY) echo "$(SA_BUILD_VERSION_PROP)" > $(SA_PROPERTIES)
+diff -Nru openjdk-boot.orig/make/hotspot-rules.gmk openjdk-boot/make/hotspot-rules.gmk
+--- openjdk-boot.orig/make/hotspot-rules.gmk	2012-06-29 15:19:51.000000000 +0100
++++ openjdk-boot/make/hotspot-rules.gmk	2012-07-20 18:10:28.277161702 +0100
+@@ -85,6 +85,7 @@
+ HOTSPOT_BUILD_ARGUMENTS += ALT_OUTPUTDIR=$(HOTSPOT_OUTPUTDIR)
+ HOTSPOT_BUILD_ARGUMENTS += ALT_EXPORT_PATH=$(HOTSPOT_EXPORT_PATH)
+ HOTSPOT_BUILD_ARGUMENTS += BUILD_FLAVOR=$(BUILD_FLAVOR)
++HOTSPOT_BUILD_ARGUMENTS += GENSRCDIR=$(GENSRCDIR)
+ 
+ # Why do these need to be passed in? Because of windows nmake? and MAKEFLAGS=?
+ #   Or is there something wrong with hotspot/make/Makefile?
diff -r 7d3000c44b3b -r dc1eb9ec0fef patches/cacao/memory.patch
--- a/patches/cacao/memory.patch	Mon Jul 16 10:59:46 2012 +0200
+++ b/patches/cacao/memory.patch	Wed Jul 25 22:48:43 2012 +0100
@@ -1,15 +1,3 @@
-diff -Nru openjdk.orig/hotspot/make/bsd/makefiles/rules.make openjdk/hotspot/make/bsd/makefiles/rules.make
---- openjdk.orig/hotspot/make/bsd/makefiles/rules.make	2012-06-08 17:13:09.000000000 +0100
-+++ openjdk/hotspot/make/bsd/makefiles/rules.make	2012-06-12 10:50:20.974290246 +0100
-@@ -128,7 +128,7 @@
- # Settings for javac
- BOOT_SOURCE_LANGUAGE_VERSION = 6
- BOOT_TARGET_CLASS_VERSION = 6
--JAVAC_FLAGS = -g -encoding ascii
-+JAVAC_FLAGS = -g -encoding ascii -J-Xmx256m
- BOOTSTRAP_JAVAC_FLAGS = $(JAVAC_FLAGS) -source $(BOOT_SOURCE_LANGUAGE_VERSION) -target $(BOOT_TARGET_CLASS_VERSION)
- 
- # With parallel makes, print a message at the end of compilation.
 diff -Nru openjdk.orig/hotspot/make/linux/makefiles/rules.make openjdk/hotspot/make/linux/makefiles/rules.make
 --- openjdk.orig/hotspot/make/linux/makefiles/rules.make	2012-06-08 17:13:09.000000000 +0100
 +++ openjdk/hotspot/make/linux/makefiles/rules.make	2012-06-12 10:50:20.982290377 +0100
@@ -84,3 +72,15 @@
                      <compilerarg line="@{bootclasspath.opt}"/>
                      <compilerarg line="${javac.no.jdk.warnings}"/>
                      <compilerarg line="${javac.version.opt}"/>
+diff -Nru openjdk.orig/hotspot/make/bsd/makefiles/rules.make openjdk/hotspot/make/bsd/makefiles/rules.make
+--- openjdk.orig/hotspot/make/bsd/makefiles/rules.make	2012-06-08 17:13:09.000000000 +0100
++++ openjdk/hotspot/make/bsd/makefiles/rules.make	2012-06-12 10:50:20.974290246 +0100
+@@ -128,7 +128,7 @@
+ # Settings for javac
+ BOOT_SOURCE_LANGUAGE_VERSION = 6
+ BOOT_TARGET_CLASS_VERSION = 6
+-JAVAC_FLAGS = -g -encoding ascii
++JAVAC_FLAGS = -g -encoding ascii -J-Xmx256m
+ BOOTSTRAP_JAVAC_FLAGS = $(JAVAC_FLAGS) -source $(BOOT_SOURCE_LANGUAGE_VERSION) -target $(BOOT_TARGET_CLASS_VERSION)
+ 
+ # With parallel makes, print a message at the end of compilation.
diff -r 7d3000c44b3b -r dc1eb9ec0fef patches/hotspot/zero/6924259-string_offset.patch
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/hotspot/zero/6924259-string_offset.patch	Wed Jul 25 22:48:43 2012 +0100
@@ -0,0 +1,934 @@
+# HG changeset patch
+# User kvn
+# Date 1337013360 25200
+# Node ID 3facbb14e873f14af743e05139e6e48b5890ffcc
+# Parent  ea3152ff2a498749bf5d889b247902f5d02915be
+6924259: Remove String.count/String.offset
+Summary: Allow a version of String class that doesn't have count and offset fields.
+Reviewed-by: never, coleenp
+
+diff --git a/src/cpu/sparc/vm/c1_LIRAssembler_sparc.cpp b/src/cpu/sparc/vm/c1_LIRAssembler_sparc.cpp
+--- openjdk/hotspot/src/cpu/sparc/vm/c1_LIRAssembler_sparc.cpp
++++ openjdk/hotspot/src/cpu/sparc/vm/c1_LIRAssembler_sparc.cpp
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
+  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+  *
+  * This code is free software; you can redistribute it and/or modify it
+@@ -238,9 +238,12 @@
+ 
+   Register result = dst->as_register();
+   {
+-    // Get a pointer to the first character of string0 in tmp0 and get string0.count in str0
+-    // Get a pointer to the first character of string1 in tmp1 and get string1.count in str1
+-    // Also, get string0.count-string1.count in o7 and get the condition code set
++    // Get a pointer to the first character of string0 in tmp0
++    //   and get string0.length() in str0
++    // Get a pointer to the first character of string1 in tmp1
++    //   and get string1.length() in str1
++    // Also, get string0.length()-string1.length() in
++    //   o7 and get the condition code set
+     // Note: some instructions have been hoisted for better instruction scheduling
+ 
+     Register tmp0 = L0;
+@@ -248,27 +251,40 @@
+     Register tmp2 = L2;
+ 
+     int  value_offset = java_lang_String:: value_offset_in_bytes(); // char array
+-    int offset_offset = java_lang_String::offset_offset_in_bytes(); // first character position
+-    int  count_offset = java_lang_String:: count_offset_in_bytes();
+-
+-    __ load_heap_oop(str0, value_offset, tmp0);
+-    __ ld(str0, offset_offset, tmp2);
+-    __ add(tmp0, arrayOopDesc::base_offset_in_bytes(T_CHAR), tmp0);
+-    __ ld(str0, count_offset, str0);
+-    __ sll(tmp2, exact_log2(sizeof(jchar)), tmp2);
++    if (java_lang_String::has_offset_field()) {
++      int offset_offset = java_lang_String::offset_offset_in_bytes(); // first character position
++      int  count_offset = java_lang_String:: count_offset_in_bytes();
++      __ load_heap_oop(str0, value_offset, tmp0);
++      __ ld(str0, offset_offset, tmp2);
++      __ add(tmp0, arrayOopDesc::base_offset_in_bytes(T_CHAR), tmp0);
++      __ ld(str0, count_offset, str0);
++      __ sll(tmp2, exact_log2(sizeof(jchar)), tmp2);
++    } else {
++      __ load_heap_oop(str0, value_offset, tmp1);
++      __ add(tmp1, arrayOopDesc::base_offset_in_bytes(T_CHAR), tmp0);
++      __ ld(tmp1, arrayOopDesc::length_offset_in_bytes(), str0);
++    }
+ 
+     // str1 may be null
+     add_debug_info_for_null_check_here(info);
+ 
+-    __ load_heap_oop(str1, value_offset, tmp1);
+-    __ add(tmp0, tmp2, tmp0);
+-
+-    __ ld(str1, offset_offset, tmp2);
+-    __ add(tmp1, arrayOopDesc::base_offset_in_bytes(T_CHAR), tmp1);
+-    __ ld(str1, count_offset, str1);
+-    __ sll(tmp2, exact_log2(sizeof(jchar)), tmp2);
++    if (java_lang_String::has_offset_field()) {
++      int offset_offset = java_lang_String::offset_offset_in_bytes(); // first character position
++      int  count_offset = java_lang_String:: count_offset_in_bytes();
++      __ load_heap_oop(str1, value_offset, tmp1);
++      __ add(tmp0, tmp2, tmp0);
++
++      __ ld(str1, offset_offset, tmp2);
++      __ add(tmp1, arrayOopDesc::base_offset_in_bytes(T_CHAR), tmp1);
++      __ ld(str1, count_offset, str1);
++      __ sll(tmp2, exact_log2(sizeof(jchar)), tmp2);
++      __ add(tmp1, tmp2, tmp1);
++    } else {
++      __ load_heap_oop(str1, value_offset, tmp2);
++      __ add(tmp2, arrayOopDesc::base_offset_in_bytes(T_CHAR), tmp1);
++      __ ld(tmp2, arrayOopDesc::length_offset_in_bytes(), str1);
++    }
+     __ subcc(str0, str1, O7);
+-    __ add(tmp1, tmp2, tmp1);
+   }
+ 
+   {
+@@ -302,7 +318,7 @@
+     // Shift base0 and base1 to the end of the arrays, negate limit
+     __ add(base0, limit, base0);
+     __ add(base1, limit, base1);
+-    __ neg(limit);  // limit = -min{string0.count, strin1.count}
++    __ neg(limit);  // limit = -min{string0.length(), string1.length()}
+ 
+     __ lduh(base0, limit, chr0);
+     __ bind(Lloop);
+diff --git a/src/cpu/x86/vm/c1_LIRAssembler_x86.cpp b/src/cpu/x86/vm/c1_LIRAssembler_x86.cpp
+--- openjdk/hotspot/src/cpu/x86/vm/c1_LIRAssembler_x86.cpp
++++ openjdk/hotspot/src/cpu/x86/vm/c1_LIRAssembler_x86.cpp
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
+  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+  *
+  * This code is free software; you can redistribute it and/or modify it
+@@ -505,19 +505,28 @@
+ 
+   // Get addresses of first characters from both Strings
+   __ load_heap_oop(rsi, Address(rax, java_lang_String::value_offset_in_bytes()));
+-  __ movptr       (rcx, Address(rax, java_lang_String::offset_offset_in_bytes()));
+-  __ lea          (rsi, Address(rsi, rcx, Address::times_2, arrayOopDesc::base_offset_in_bytes(T_CHAR)));
+-
++  if (java_lang_String::has_offset_field()) {
++    __ movptr     (rcx, Address(rax, java_lang_String::offset_offset_in_bytes()));
++    __ movl       (rax, Address(rax, java_lang_String::count_offset_in_bytes()));
++    __ lea        (rsi, Address(rsi, rcx, Address::times_2, arrayOopDesc::base_offset_in_bytes(T_CHAR)));
++  } else {
++    __ movl       (rax, Address(rsi, arrayOopDesc::length_offset_in_bytes()));
++    __ lea        (rsi, Address(rsi, arrayOopDesc::base_offset_in_bytes(T_CHAR)));
++  }
+ 
+   // rbx, may be NULL
+   add_debug_info_for_null_check_here(info);
+   __ load_heap_oop(rdi, Address(rbx, java_lang_String::value_offset_in_bytes()));
+-  __ movptr       (rcx, Address(rbx, java_lang_String::offset_offset_in_bytes()));
+-  __ lea          (rdi, Address(rdi, rcx, Address::times_2, arrayOopDesc::base_offset_in_bytes(T_CHAR)));
++  if (java_lang_String::has_offset_field()) {
++    __ movptr     (rcx, Address(rbx, java_lang_String::offset_offset_in_bytes()));
++    __ movl       (rbx, Address(rbx, java_lang_String::count_offset_in_bytes()));
++    __ lea        (rdi, Address(rdi, rcx, Address::times_2, arrayOopDesc::base_offset_in_bytes(T_CHAR)));
++  } else {
++    __ movl       (rbx, Address(rdi, arrayOopDesc::length_offset_in_bytes()));
++    __ lea        (rdi, Address(rdi, arrayOopDesc::base_offset_in_bytes(T_CHAR)));
++  }
+ 
+   // compute minimum length (in rax) and difference of lengths (on top of stack)
+-  __ movl  (rbx, Address(rbx, java_lang_String::count_offset_in_bytes()));
+-  __ movl  (rax, Address(rax, java_lang_String::count_offset_in_bytes()));
+   __ mov   (rcx, rbx);
+   __ subptr(rbx, rax); // subtract lengths
+   __ push  (rbx);      // result
+diff --git a/src/share/vm/classfile/javaClasses.cpp b/src/share/vm/classfile/javaClasses.cpp
+--- openjdk/hotspot/src/share/vm/classfile/javaClasses.cpp
++++ openjdk/hotspot/src/share/vm/classfile/javaClasses.cpp
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
+  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+  *
+  * This code is free software; you can redistribute it and/or modify it
+@@ -143,7 +143,27 @@
+ }
+ 
+ 
++int java_lang_String::value_offset  = 0;
++int java_lang_String::offset_offset = 0;
++int java_lang_String::count_offset  = 0;
++int java_lang_String::hash_offset   = 0;
++
++bool java_lang_String::initialized  = false;
++
++void java_lang_String::compute_offsets() {
++  assert(!initialized, "offsets should be initialized only once");
++
++  klassOop k = SystemDictionary::String_klass();
++  compute_offset(value_offset,           k, vmSymbols::value_name(),  vmSymbols::char_array_signature());
++  compute_optional_offset(offset_offset, k, vmSymbols::offset_name(), vmSymbols::int_signature());
++  compute_optional_offset(count_offset,  k, vmSymbols::count_name(),  vmSymbols::int_signature());
++  compute_optional_offset(hash_offset,   k, vmSymbols::hash_name(),   vmSymbols::int_signature());
++
++  initialized = true;
++}
++
+ Handle java_lang_String::basic_create(int length, bool tenured, TRAPS) {
++  assert(initialized, "Must be initialized");
+   // Create the String object first, so there's a chance that the String
+   // and the char array it points to end up in the same cache line.
+   oop obj;
+@@ -2837,10 +2857,6 @@
+ 
+ 
+ 
+-int java_lang_String::value_offset;
+-int java_lang_String::offset_offset;
+-int java_lang_String::count_offset;
+-int java_lang_String::hash_offset;
+ int java_lang_Class::_klass_offset;
+ int java_lang_Class::_array_klass_offset;
+ int java_lang_Class::_resolved_constructor_offset;
+@@ -3000,12 +3016,6 @@
+   const int x = heapOopSize;
+   const int header = instanceOopDesc::base_offset_in_bytes();
+ 
+-  // Do the String Class
+-  java_lang_String::value_offset  = java_lang_String::hc_value_offset  * x + header;
+-  java_lang_String::offset_offset = java_lang_String::hc_offset_offset * x + header;
+-  java_lang_String::count_offset  = java_lang_String::offset_offset + sizeof (jint);
+-  java_lang_String::hash_offset   = java_lang_String::count_offset + sizeof (jint);
+-
+   // Throwable Class
+   java_lang_Throwable::backtrace_offset  = java_lang_Throwable::hc_backtrace_offset  * x + header;
+   java_lang_Throwable::detailMessage_offset = java_lang_Throwable::hc_detailMessage_offset * x + header;
+@@ -3200,9 +3210,13 @@
+   // java.lang.String
+ 
+   CHECK_OFFSET("java/lang/String", java_lang_String, value, "[C");
+-  CHECK_OFFSET("java/lang/String", java_lang_String, offset, "I");
+-  CHECK_OFFSET("java/lang/String", java_lang_String, count, "I");
+-  CHECK_OFFSET("java/lang/String", java_lang_String, hash, "I");
++  if (java_lang_String::has_offset_field()) {
++    CHECK_OFFSET("java/lang/String", java_lang_String, offset, "I");
++    CHECK_OFFSET("java/lang/String", java_lang_String, count, "I");
++  }
++  if (java_lang_String::has_hash_field()) {
++    CHECK_OFFSET("java/lang/String", java_lang_String, hash, "I");
++  }



More information about the distro-pkg-dev mailing list