changeset 2578:96394d394527

Add security patches for 2012/06/12. 2012-06-07 Andrew John Hughes <ahughes@redhat.com> * Makefile.am: (ICEDTEA_PATCHES): Add security patches. Make more patches HotSpot-build specific. * patches/ecj/override.patch: Add additional cases from 7143872. * patches/arm.patch: Moved to HotSpot-specific versions. * patches/arch.patch, * patches/freetypeversion.patch, * patches/gcc-suffix.patch: Fix to work with no fuzz. * patches/hotspot/hs20/arm.patch, * patches/hotspot/hs20/gcc-stack-markings.patch, * patches/hotspot/hs20/numa_on_early_glibc.patch, * patches/hotspot/hs20/sparc-trapsfix.patch, * patches/hotspot/hs20/version-hotspot.patch: Split to work with hs20 with no fuzz. * patches/hotspot/original/arm.patch, * patches/hotspot/original/gcc-stack-markings.patch, * patches/hotspot/original/numa_on_early_glibc.patch, * patches/hotspot/original/sparc-trapsfix.patch, * patches/hotspot/original/version-hotspot.patch: Likewise for hs19 (original). * patches/jaxp-serial-version-uid.patch, * patches/libraries.patch, * patches/nio2.patch, * patches/no-static-linking.patch, * patches/openjdk/6693253-security_warning.patch, * patches/openjdk/6766342-AA-simple-shape-performance.patch, * patches/openjdk/6797139-jbutton_truncation.patch, * patches/openjdk/6851973-kerberos.patch, * patches/openjdk/7102369-7094468-rmiregistry.patch: Fixed to work with no fuzz. * patches/openjdk/hs20/7034464-hugepage.patch, * patches/openjdk/hs20/7103224-glibc_name_collision.patch, Fixed to work with hs20 and no fuzz. * patches/openjdk/mutter.patch: Fixed to work with no fuzz. * patches/openjdk/original/7034464-hugepage.patch, * patches/openjdk/original/7103224-glibc_name_collision.patch, Fixed to work with hs19 (original) and no fuzz. * patches/openjdk/remove-mimpure-option-to-gcc.patch: Fixed to work with no fuzz. * patches/security/20120612/7079902.patch, * patches/security/20120612/7143606.patch, * patches/security/20120612/7143614.patch, * patches/security/20120612/7143617.patch, * patches/security/20120612/7143851.patch, * patches/security/20120612/7143872.patch, * patches/security/20120612/7145239.patch, * patches/security/20120612/7157609.patch, * patches/security/20120612/7160677.patch, * patches/security/20120612/7160757.patch, * patches/security/20120612/hs20/7110720.patch, * patches/security/20120612/hs20/7152811.patch, * patches/security/20120612/original/7110720.patch, * patches/security/20120612/original/7152811.patch, Security patches for 2012/06/12. * NEWS: Updated.
author Andrew John Hughes <ahughes@redhat.com>
date Fri, 08 Jun 2012 14:23:28 +0100
parents d74c9a4312cd
children 86ca15aa81c3
files ChangeLog Makefile.am NEWS patches/arch.patch patches/arm.patch patches/ecj/override.patch patches/freetypeversion.patch patches/gcc-stack-markings.patch patches/gcc-suffix.patch patches/hotspot/hs20/arm.patch patches/hotspot/hs20/gcc-stack-markings.patch patches/hotspot/hs20/numa_on_early_glibc.patch patches/hotspot/hs20/sparc-trapsfix.patch patches/hotspot/hs20/version-hotspot.patch patches/hotspot/original/arm.patch patches/hotspot/original/gcc-stack-markings.patch patches/hotspot/original/numa_on_early_glibc.patch patches/hotspot/original/sparc-trapsfix.patch patches/hotspot/original/version-hotspot.patch patches/jaxp-serial-version-uid.patch patches/libraries.patch patches/nio2.patch patches/no-static-linking.patch patches/numa_on_early_glibc.patch patches/openjdk/6693253-security_warning.patch patches/openjdk/6766342-AA-simple-shape-performance.patch patches/openjdk/6797139-jbutton_truncation.patch patches/openjdk/6851973-kerberos.patch patches/openjdk/7034464-hugepage.patch patches/openjdk/7102369-7094468-rmiregistry.patch patches/openjdk/7103224-glibc_name_collision.patch patches/openjdk/hs20/7034464-hugepage.patch patches/openjdk/hs20/7103224-glibc_name_collision.patch patches/openjdk/mutter.patch patches/openjdk/original/7034464-hugepage.patch patches/openjdk/original/7103224-glibc_name_collision.patch patches/openjdk/remove-mimpure-option-to-gcc.patch patches/security/20120612/7079902.patch patches/security/20120612/7143606.patch patches/security/20120612/7143614.patch patches/security/20120612/7143617.patch patches/security/20120612/7143851.patch patches/security/20120612/7143872.patch patches/security/20120612/7145239.patch patches/security/20120612/7157609.patch patches/security/20120612/7160677.patch patches/security/20120612/7160757.patch patches/security/20120612/hs20/7110720.patch patches/security/20120612/hs20/7152811.patch patches/security/20120612/original/7110720.patch patches/security/20120612/original/7152811.patch patches/sparc-trapsfix.patch patches/version-hotspot.patch
diffstat 53 files changed, 6515 insertions(+), 3447 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Thu May 31 12:40:08 2012 +0200
+++ b/ChangeLog	Fri Jun 08 14:23:28 2012 +0100
@@ -1,3 +1,64 @@
+2012-06-07  Andrew John Hughes  <ahughes@redhat.com>
+
+	* Makefile.am:
+	(ICEDTEA_PATCHES): Add security patches.  Make more
+	patches HotSpot-build specific.
+	* patches/ecj/override.patch:
+	Add additional cases from 7143872.
+	* patches/arm.patch: Moved to HotSpot-specific versions.
+	* patches/arch.patch,
+	* patches/freetypeversion.patch,
+	* patches/gcc-suffix.patch:
+	Fix to work with no fuzz.
+	* patches/hotspot/hs20/arm.patch,
+	* patches/hotspot/hs20/gcc-stack-markings.patch,
+	* patches/hotspot/hs20/numa_on_early_glibc.patch,
+	* patches/hotspot/hs20/sparc-trapsfix.patch,
+	* patches/hotspot/hs20/version-hotspot.patch:
+	Split to work with hs20 with no fuzz.
+	* patches/hotspot/original/arm.patch,
+	* patches/hotspot/original/gcc-stack-markings.patch,
+	* patches/hotspot/original/numa_on_early_glibc.patch,
+	* patches/hotspot/original/sparc-trapsfix.patch,
+	* patches/hotspot/original/version-hotspot.patch:
+	Likewise for hs19 (original).
+	* patches/jaxp-serial-version-uid.patch,
+	* patches/libraries.patch,
+	* patches/nio2.patch,
+	* patches/no-static-linking.patch,
+	* patches/openjdk/6693253-security_warning.patch,
+	* patches/openjdk/6766342-AA-simple-shape-performance.patch,
+	* patches/openjdk/6797139-jbutton_truncation.patch,
+	* patches/openjdk/6851973-kerberos.patch,
+	* patches/openjdk/7102369-7094468-rmiregistry.patch:
+	Fixed to work with no fuzz.
+	* patches/openjdk/hs20/7034464-hugepage.patch,
+	* patches/openjdk/hs20/7103224-glibc_name_collision.patch,
+	Fixed to work with hs20 and no fuzz.
+	* patches/openjdk/mutter.patch:
+	Fixed to work with no fuzz.
+	* patches/openjdk/original/7034464-hugepage.patch,
+	* patches/openjdk/original/7103224-glibc_name_collision.patch,
+	Fixed to work with hs19 (original) and no fuzz.
+	* patches/openjdk/remove-mimpure-option-to-gcc.patch:
+	Fixed to work with no fuzz.
+	* patches/security/20120612/7079902.patch,
+	* patches/security/20120612/7143606.patch,
+	* patches/security/20120612/7143614.patch,
+	* patches/security/20120612/7143617.patch,
+	* patches/security/20120612/7143851.patch,
+	* patches/security/20120612/7143872.patch,
+	* patches/security/20120612/7145239.patch,
+	* patches/security/20120612/7157609.patch,
+	* patches/security/20120612/7160677.patch,
+	* patches/security/20120612/7160757.patch,
+	* patches/security/20120612/hs20/7110720.patch,
+	* patches/security/20120612/hs20/7152811.patch,
+	* patches/security/20120612/original/7110720.patch,
+	* patches/security/20120612/original/7152811.patch,
+	Security patches for 2012/06/12.
+	* NEWS: Updated.
+
 2012-05-31  Pavel Tisnovsky  <ptisnovs@redhat.com>
 
 	* patches/coverage-table.patch:
--- a/Makefile.am	Thu May 31 12:40:08 2012 +0200
+++ b/Makefile.am	Fri Jun 08 14:23:28 2012 +0100
@@ -214,7 +214,19 @@
 	patches/security/20120214/7110700.patch \
 	patches/security/20120214/7110704.patch \
 	patches/security/20120214/7118283.patch \
-	patches/security/20120214/7126960.patch
+	patches/security/20120214/7126960.patch \
+	patches/security/20120612/7079902.patch \
+	patches/security/20120612/${HSBUILD}/7110720.patch \
+	patches/security/20120612/7143606.patch \
+	patches/security/20120612/7143614.patch \
+	patches/security/20120612/7143617.patch \
+	patches/security/20120612/7143851.patch \
+	patches/security/20120612/7143872.patch \
+	patches/security/20120612/7145239.patch \
+	patches/security/20120612/${HSBUILD}/7152811.patch \
+	patches/security/20120612/7157609.patch \
+	patches/security/20120612/7160677.patch \
+	patches/security/20120612/7160757.patch
 
 SPECIAL_SECURITY_PATCH = patches/security/20120214/7112642.patch
 
@@ -249,7 +261,7 @@
 	patches/parisc-opt.patch \
 	patches/lucene-crash.patch \
 	patches/version.patch \
-	patches/version-hotspot.patch \
+	patches/hotspot/$(HSBUILD)/version-hotspot.patch \
 	patches/hotspot/$(HSBUILD)/text-relocations.patch \
 	patches/ssl.patch \
 	patches/rmi_amd64.patch \
@@ -290,7 +302,7 @@
 	patches/hotspot/$(HSBUILD)/sparc-buildfixes.patch \
 	patches/sparc64-linux.patch \
 	patches/sparc-ptracefix.patch \
-	patches/sparc-trapsfix.patch \
+	patches/hotspot/$(HSBUILD)/sparc-trapsfix.patch \
 	patches/demo-swingapplet.patch \
 	patches/jtreg-6592792.patch \
 	patches/s390-noinline.patch \
@@ -302,7 +314,7 @@
 	patches/java2d-stroker-internal-close-joint.patch \
 	patches/disable-cc-incompatible-sanity-checks.patch \
 	patches/explicit-target-arch.patch \
-	patches/gcc-stack-markings.patch \
+	patches/hotspot/$(HSBUILD)/gcc-stack-markings.patch \
 	patches/parisc.patch \
 	patches/sh4-support.patch \
 	patches/policy-evaluation.patch \
@@ -310,7 +322,6 @@
 	patches/libpng.patch \
 	patches/applet_hole.patch \
 	patches/jtreg-httpTest.patch \
-	patches/arm.patch \
 	patches/hotspot/$(HSBUILD)/arm.patch \
 	patches/debug-dir.patch \
 	patches/no-sync.patch \
@@ -323,7 +334,7 @@
 	patches/openjdk/6510892-httpserver_test.patch \
 	patches/openjdk/6638712-wildcard_types.patch \
 	patches/openjdk/6650759-missing_inference.patch \
-	patches/numa_on_early_glibc.patch \
+	patches/hotspot/$(HSBUILD)/numa_on_early_glibc.patch \
 	patches/jtreg-international-fonts.patch \
 	patches/openjdk/6967436-6976265-6967434-pisces.patch \
 	patches/f14-fonts.patch \
@@ -373,7 +384,7 @@
 	patches/jtreg-bug7036148-test.patch \
 	patches/support_linux_3.patch \
 	patches/openjdk/6826104-npe_on_app_and_toolkit_modal_dialog_click.patch \
-	patches/openjdk/7034464-hugepage.patch \
+	patches/openjdk/$(HSBUILD)/7034464-hugepage.patch \
 	patches/openjdk/7037939-hugepage.patch \
 	patches/openjdk/7043564-hugepage.patch \
 	patches/openjdk/7102369-7094468-rmiregistry.patch \
@@ -382,7 +393,7 @@
 	patches/openjdk/7091528-javadoc_class_files.patch \
 	patches/idresolver_fix.patch \
 	patches/openjdk/6792400-Avoid_loading_Normalizer_resources.patch \
-	patches/openjdk/7103224-glibc_name_collision.patch \
+	patches/openjdk/$(HSBUILD)/7103224-glibc_name_collision.patch \
 	patches/openjdk/7140882-dont-return-booleans-from-methods-returning-pointers.patch \
 	patches/openjdk/remove-mimpure-option-to-gcc.patch \
 	patches/coverage-table.patch
--- a/NEWS	Thu May 31 12:40:08 2012 +0200
+++ b/NEWS	Fri Jun 08 14:23:28 2012 +0100
@@ -9,10 +9,23 @@
 
 CVE-XXXX-YYYY: http://www.cve.mitre.org/cgi-bin/cvename.cgi?name=XXXX-YYYY
 
-New in release 1.10.8 (2012-XX-XX):
+New in release 1.10.8 (2012-06-12):
 
+* Security fixes
+  - S7079902: Refine CORBA data models
+  - S7110720: Issue with vm config file loadingIssue with vm config file loading
+  - S7143606: File.createTempFile should be improved for temporary files created by the platform.
+  - S7143614: SynthLookAndFeel stability improvement
+  - S7143617: Improve fontmanager layout lookup operations
+  - S7143851: Improve IIOP stub and tie generation in RMIC
+  - S7143872: Improve certificate extension processing
+  - S7145239: Finetune package definition restriction
+  - S7152811: Issues in client compiler
+  - S7157609: Issues with loop
+  - S7160677: missing else in fix for 7152811
+  - S7160757: Problem with hotspot/runtime_classfile
 * Bug fixes
-  - PR1018: JVM fails due to SEGV during rendering some Unicode characters
+  - PR1018: JVM fails due to SEGV during rendering some Unicode characters (part of 6886358)
 
 New in release 1.10.7 (2012-05-11):
 
--- a/patches/arch.patch	Thu May 31 12:40:08 2012 +0200
+++ b/patches/arch.patch	Fri Jun 08 14:23:28 2012 +0100
@@ -1,73 +1,74 @@
---- openjdk/jdk/make/javax/sound/SoundDefs.gmk.orig	2008-10-15 17:04:19.000000000 +0200
-+++ openjdk/jdk/make/javax/sound/SoundDefs.gmk	2008-10-15 17:09:56.000000000 +0200
-@@ -58,10 +58,54 @@
- ifdef ICEDTEA_ZERO_BUILD
-   CPPFLAGS += -DX_ARCH=X_ZERO
- else
-+  ifeq ($(ARCH), alpha)
-+    CPPFLAGS += -DX_ARCH=X_ALPHA
-+  endif # ARCH alpha
-+
-+  ifeq ($(ARCH), amd64)
-+    CPPFLAGS += -DX_ARCH=X_AMD64
-+  endif # ARCH amd64
-+
-+  ifeq ($(ARCH), arm)
-+    CPPFLAGS += -DX_ARCH=X_ARM
-+  endif # ARCH arm
-+
-   ifeq ($(ARCH), i586)
-     CPPFLAGS += -DX_ARCH=X_I586
-   endif # ARCH i586
- 
-+  ifeq ($(ARCH), ia64)
-+    CPPFLAGS += -DX_ARCH=X_IA64
-+  endif # ARCH ia64
-+
-+  ifeq ($(ARCH), m68k)
-+    CPPFLAGS += -DX_ARCH=X_M68K
-+  endif # ARCH m68k
-+
-+  ifeq ($(ARCH), mips)
-+    CPPFLAGS += -DX_ARCH=X_MIPS
-+  endif # ARCH mips
-+
-+  ifeq ($(ARCH), mipsel)
-+    CPPFLAGS += -DX_ARCH=X_MIPSEL
-+  endif # ARCH mipsel
-+
-+  ifeq ($(ARCH), ppc)
-+    CPPFLAGS += -DX_ARCH=X_PPC
-+  endif # ARCH ppc
-+
-+  ifeq ($(ARCH), ppc64)
-+    CPPFLAGS += -DX_ARCH=X_PPC64
-+  endif # ARCH ppc64
-+
-+  ifeq ($(ARCH), s390)
-+    CPPFLAGS += -DX_ARCH=X_S390
-+  endif # ARCH s390
-+
-+  ifeq ($(ARCH), s390x)
-+    CPPFLAGS += -DX_ARCH=X_S390X
-+  endif # ARCH s390x
-+
-   ifeq ($(ARCH), sparc)
-     CPPFLAGS += -DX_ARCH=X_SPARC
-   endif # ARCH sparc
-@@ -69,10 +113,6 @@
-   ifeq ($(ARCH), sparcv9)
-     CPPFLAGS += -DX_ARCH=X_SPARCV9
-   endif # ARCH sparcv9
--
--  ifeq ($(ARCH), amd64)
--    CPPFLAGS += -DX_ARCH=X_AMD64
--  endif # ARCH amd64
- endif
- 
- 
---- openjdk/jdk/make/common/Defs-linux.gmk.orig	2008-10-15 17:04:21.000000000 +0200
-+++ openjdk/jdk/make/common/Defs-linux.gmk	2008-10-15 17:08:37.000000000 +0200
+diff -Nru openjdk.orig/corba/make/common/Defs-linux.gmk openjdk/corba/make/common/Defs-linux.gmk
+--- openjdk.orig/corba/make/common/Defs-linux.gmk	2011-02-28 16:02:14.000000000 +0000
++++ openjdk/corba/make/common/Defs-linux.gmk	2012-06-08 11:40:58.778526814 +0100
+@@ -92,9 +92,19 @@
+ #    We need this frame pointer to make it easy to walk the stacks.
+ #    This should be the default on X86, but ia64 and amd64 may not have this
+ #    as the default.
++CFLAGS_REQUIRED_alpha   += -mieee -D_LITTLE_ENDIAN
+ CFLAGS_REQUIRED_amd64   += -fno-omit-frame-pointer -D_LITTLE_ENDIAN
++CFLAGS_REQUIRED_arm     += -D_LITTLE_ENDIAN
++CFLAGS_REQUIRED_hppa    +=
+ CFLAGS_REQUIRED_i586    += -fno-omit-frame-pointer -D_LITTLE_ENDIAN
+ CFLAGS_REQUIRED_ia64    += -fno-omit-frame-pointer -D_LITTLE_ENDIAN
++CFLAGS_REQUIRED_m68k    +=
++CFLAGS_REQUIRED_mips    +=
++CFLAGS_REQUIRED_mipsel  += -D_LITTLE_ENDIAN
++CFLAGS_REQUIRED_ppc     += -m32
++CFLAGS_REQUIRED_ppc64   += -m64
++CFLAGS_REQUIRED_s390    +=
++CFLAGS_REQUIRED_s390x   += -m64
+ CFLAGS_REQUIRED_sparcv9 += -m64 -mcpu=v9
+ LDFLAGS_COMMON_sparcv9  += -m64 -mcpu=v9
+ CFLAGS_REQUIRED_sparc   += -m32 -mcpu=v9
+diff -Nru openjdk.orig/corba/make/common/shared/Platform.gmk openjdk/corba/make/common/shared/Platform.gmk
+--- openjdk.orig/corba/make/common/shared/Platform.gmk	2012-06-08 11:39:58.213547080 +0100
++++ openjdk/corba/make/common/shared/Platform.gmk	2012-06-08 11:40:58.778526814 +0100
+@@ -220,9 +220,40 @@
+   else
+     # i586 is 32-bit, amd64 is 64-bit
+     ifndef ARCH_DATA_MODEL
++      ifeq ($(ARCH), alpha)
++        ARCH_DATA_MODEL=64
++      endif
++      ifeq ($(ARCH), amd64)
++        ARCH_DATA_MODEL=64
++      endif
++      ifeq ($(ARCH), arm)
++        ARCH_DATA_MODEL=32
++      endif
+       ifeq ($(ARCH), i586)
+         ARCH_DATA_MODEL=32
+-      else
++      endif
++      ifeq ($(ARCH), ia64)
++        ARCH_DATA_MODEL=64
++      endif
++      ifeq ($(ARCH), m68k)
++        ARCH_DATA_MODEL=32
++      endif
++      ifeq ($(ARCH), mips)
++        ARCH_DATA_MODEL=32
++      endif
++      ifeq ($(ARCH), mipsel)
++        ARCH_DATA_MODEL=32
++      endif
++      ifeq ($(ARCH), ppc)
++        ARCH_DATA_MODEL=32
++      endif
++      ifeq ($(ARCH), ppc64)
++        ARCH_DATA_MODEL=64
++      endif
++      ifeq ($(ARCH), s390)
++        ARCH_DATA_MODEL=32
++      endif
++      ifeq ($(ARCH), s390x)
+         ARCH_DATA_MODEL=64
+       endif
+     endif
+diff -Nru openjdk.orig/jdk/make/common/Defs-linux.gmk openjdk/jdk/make/common/Defs-linux.gmk
+--- openjdk.orig/jdk/make/common/Defs-linux.gmk	2011-02-28 16:06:10.000000000 +0000
++++ openjdk/jdk/make/common/Defs-linux.gmk	2012-06-08 11:40:58.770526683 +0100
 @@ -102,9 +102,19 @@
  #    We need this frame pointer to make it easy to walk the stacks.
  #    This should be the default on X86, but ia64 and amd64 may not have this
@@ -88,8 +89,9 @@
  CFLAGS_REQUIRED_sparcv9 += -m64 -mcpu=v9
  LDFLAGS_COMMON_sparcv9  += -m64 -mcpu=v9
  CFLAGS_REQUIRED_sparc   += -m32 -mcpu=v9
---- openjdk/jdk/make/common/shared/Compiler-gcc.gmk.orig	2008-10-15 17:04:19.000000000 +0200
-+++ openjdk/jdk/make/common/shared/Compiler-gcc.gmk	2008-10-15 17:11:28.000000000 +0200
+diff -Nru openjdk.orig/jdk/make/common/shared/Compiler-gcc.gmk openjdk/jdk/make/common/shared/Compiler-gcc.gmk
+--- openjdk.orig/jdk/make/common/shared/Compiler-gcc.gmk	2012-06-08 11:39:58.053544493 +0100
++++ openjdk/jdk/make/common/shared/Compiler-gcc.gmk	2012-06-08 11:40:58.778526814 +0100
 @@ -70,28 +70,56 @@
    else
      CXX            = $(COMPILER_PATH)g++$(GCC_SUFFIX)
@@ -157,9 +159,10 @@
    endif
    # Option used to create a shared library
    SHARED_LIBRARY_FLAG = -shared -mimpure-text
---- openjdk/jdk/make/common/shared/Platform.gmk.orig	2008-10-15 17:04:19.000000000 +0200
-+++ openjdk/jdk/make/common/shared/Platform.gmk	2008-10-15 17:13:49.000000000 +0200
-@@ -237,9 +237,40 @@
+diff -Nru openjdk.orig/jdk/make/common/shared/Platform.gmk openjdk/jdk/make/common/shared/Platform.gmk
+--- openjdk.orig/jdk/make/common/shared/Platform.gmk	2012-06-08 11:39:58.221547210 +0100
++++ openjdk/jdk/make/common/shared/Platform.gmk	2012-06-08 11:40:58.778526814 +0100
+@@ -230,9 +230,40 @@
    else
      # i586 is 32-bit, amd64 is 64-bit
      ifndef ARCH_DATA_MODEL
@@ -201,8 +204,78 @@
          ARCH_DATA_MODEL=64
        endif
      endif
---- openjdk/jdk/src/share/native/com/sun/media/sound/SoundDefs.h.orig	2008-10-15 17:04:19.000000000 +0200
-+++ openjdk/jdk/src/share/native/com/sun/media/sound/SoundDefs.h	2008-10-15 17:13:01.000000000 +0200
+diff -Nru openjdk.orig/jdk/make/javax/sound/SoundDefs.gmk openjdk/jdk/make/javax/sound/SoundDefs.gmk
+--- openjdk.orig/jdk/make/javax/sound/SoundDefs.gmk	2011-02-28 16:06:11.000000000 +0000
++++ openjdk/jdk/make/javax/sound/SoundDefs.gmk	2012-06-08 11:40:58.770526683 +0100
+@@ -58,10 +58,54 @@
+ ifeq ($(ZERO_BUILD), true)
+   CPPFLAGS += -DX_ARCH=X_ZERO
+ else
++  ifeq ($(ARCH), alpha)
++    CPPFLAGS += -DX_ARCH=X_ALPHA
++  endif # ARCH alpha
++
++  ifeq ($(ARCH), amd64)
++    CPPFLAGS += -DX_ARCH=X_AMD64
++  endif # ARCH amd64
++
++  ifeq ($(ARCH), arm)
++    CPPFLAGS += -DX_ARCH=X_ARM
++  endif # ARCH arm
++
+   ifeq ($(ARCH), i586)
+     CPPFLAGS += -DX_ARCH=X_I586
+   endif # ARCH i586
+ 
++  ifeq ($(ARCH), ia64)
++    CPPFLAGS += -DX_ARCH=X_IA64
++  endif # ARCH ia64
++
++  ifeq ($(ARCH), m68k)
++    CPPFLAGS += -DX_ARCH=X_M68K
++  endif # ARCH m68k
++
++  ifeq ($(ARCH), mips)
++    CPPFLAGS += -DX_ARCH=X_MIPS
++  endif # ARCH mips
++
++  ifeq ($(ARCH), mipsel)
++    CPPFLAGS += -DX_ARCH=X_MIPSEL
++  endif # ARCH mipsel
++
++  ifeq ($(ARCH), ppc)
++    CPPFLAGS += -DX_ARCH=X_PPC
++  endif # ARCH ppc
++
++  ifeq ($(ARCH), ppc64)
++    CPPFLAGS += -DX_ARCH=X_PPC64
++  endif # ARCH ppc64
++
++  ifeq ($(ARCH), s390)
++    CPPFLAGS += -DX_ARCH=X_S390
++  endif # ARCH s390
++
++  ifeq ($(ARCH), s390x)
++    CPPFLAGS += -DX_ARCH=X_S390X
++  endif # ARCH s390x
++
+   ifeq ($(ARCH), sparc)
+     CPPFLAGS += -DX_ARCH=X_SPARC
+   endif # ARCH sparc
+@@ -69,10 +113,6 @@
+   ifeq ($(ARCH), sparcv9)
+     CPPFLAGS += -DX_ARCH=X_SPARCV9
+   endif # ARCH sparcv9
+-
+-  ifeq ($(ARCH), amd64)
+-    CPPFLAGS += -DX_ARCH=X_AMD64
+-  endif # ARCH amd64
+ endif
+ 
+ 
+diff -Nru openjdk.orig/jdk/src/share/native/com/sun/media/sound/SoundDefs.h openjdk/jdk/src/share/native/com/sun/media/sound/SoundDefs.h
+--- openjdk.orig/jdk/src/share/native/com/sun/media/sound/SoundDefs.h	2011-02-28 16:06:44.000000000 +0000
++++ openjdk/jdk/src/share/native/com/sun/media/sound/SoundDefs.h	2012-06-08 11:40:58.778526814 +0100
 @@ -33,12 +33,21 @@
  #define X_LINUX         3
  
@@ -231,69 +304,3 @@
  
  // **********************************
  // Make sure you set X_PLATFORM and X_ARCH defines correctly.
---- openjdk/corba/make/common/Defs-linux.gmk.orig	2008-10-15 17:04:20.000000000 +0200
-+++ openjdk/corba/make/common/Defs-linux.gmk	2008-10-15 17:08:37.000000000 +0200
-@@ -92,9 +92,19 @@
- #    We need this frame pointer to make it easy to walk the stacks.
- #    This should be the default on X86, but ia64 and amd64 may not have this
- #    as the default.
-+CFLAGS_REQUIRED_alpha   += -mieee -D_LITTLE_ENDIAN
- CFLAGS_REQUIRED_amd64   += -fno-omit-frame-pointer -D_LITTLE_ENDIAN
-+CFLAGS_REQUIRED_arm     += -D_LITTLE_ENDIAN
-+CFLAGS_REQUIRED_hppa    +=
- CFLAGS_REQUIRED_i586    += -fno-omit-frame-pointer -D_LITTLE_ENDIAN
- CFLAGS_REQUIRED_ia64    += -fno-omit-frame-pointer -D_LITTLE_ENDIAN
-+CFLAGS_REQUIRED_m68k    +=
-+CFLAGS_REQUIRED_mips    +=
-+CFLAGS_REQUIRED_mipsel  += -D_LITTLE_ENDIAN
-+CFLAGS_REQUIRED_ppc     += -m32
-+CFLAGS_REQUIRED_ppc64   += -m64
-+CFLAGS_REQUIRED_s390    +=
-+CFLAGS_REQUIRED_s390x   += -m64
- CFLAGS_REQUIRED_sparcv9 += -m64 -mcpu=v9
- LDFLAGS_COMMON_sparcv9  += -m64 -mcpu=v9
- CFLAGS_REQUIRED_sparc   += -m32 -mcpu=v9
---- openjdk/corba/make/common/shared/Platform.gmk.orig	2008-10-15 17:04:19.000000000 +0200
-+++ openjdk/corba/make/common/shared/Platform.gmk	2008-10-15 17:12:19.000000000 +0200
-@@ -227,9 +227,40 @@
-   else
-     # i586 is 32-bit, amd64 is 64-bit
-     ifndef ARCH_DATA_MODEL
-+      ifeq ($(ARCH), alpha)
-+        ARCH_DATA_MODEL=64
-+      endif
-+      ifeq ($(ARCH), amd64)
-+        ARCH_DATA_MODEL=64
-+      endif
-+      ifeq ($(ARCH), arm)
-+        ARCH_DATA_MODEL=32
-+      endif
-       ifeq ($(ARCH), i586)
-         ARCH_DATA_MODEL=32
--      else
-+      endif
-+      ifeq ($(ARCH), ia64)
-+        ARCH_DATA_MODEL=64
-+      endif
-+      ifeq ($(ARCH), m68k)
-+        ARCH_DATA_MODEL=32
-+      endif
-+      ifeq ($(ARCH), mips)
-+        ARCH_DATA_MODEL=32
-+      endif
-+      ifeq ($(ARCH), mipsel)
-+        ARCH_DATA_MODEL=32
-+      endif
-+      ifeq ($(ARCH), ppc)
-+        ARCH_DATA_MODEL=32
-+      endif
-+      ifeq ($(ARCH), ppc64)
-+        ARCH_DATA_MODEL=64
-+      endif
-+      ifeq ($(ARCH), s390)
-+        ARCH_DATA_MODEL=32
-+      endif
-+      ifeq ($(ARCH), s390x)
-         ARCH_DATA_MODEL=64
-       endif
-     endif
--- a/patches/arm.patch	Thu May 31 12:40:08 2012 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,166 +0,0 @@
-diff -Nru openjdk.orig/hotspot/make/linux/makefiles/zeroshark.make openjdk/hotspot/make/linux/makefiles/zeroshark.make
---- openjdk.orig/hotspot/make/linux/makefiles/zeroshark.make	2010-05-28 11:09:25.000000000 +0100
-+++ openjdk/hotspot/make/linux/makefiles/zeroshark.make	2010-06-17 17:28:03.000000000 +0100
-@@ -25,6 +25,43 @@
- 
- # Setup common to Zero (non-Shark) and Shark versions of VM
- 
-+ifeq ($(ZERO_LIBARCH),arm)
-+
-+Obj_Files += asm_helper.o
-+Obj_Files += cppInterpreter_arm.o
-+Obj_Files += thumb2.o
-+
-+#XXX disabled until it has the updated frame anchor code (PR icedteopenjdk.orig/hotspot/323)
-+#XXX and the updated calling convention for deopt (PR icedteopenjdk.orig/hotspot/484)
-+#CFLAGS += -DHOTSPOT_ASM
-+
-+%.o: %.S
-+	@echo Assembling $<
-+	$(QUIETLY) $(REMOVE_TARGET)
-+	$(COMPILE.CC) -o $@ $< $(COMPILE_DONE)
-+
-+cppInterpreter_arm.o:	offsets_arm.s bytecodes_arm.s
-+thumb2.o:		offsets_arm.s
-+
-+offsets_arm.s:	mkoffsets
-+	@echo Generating assembler offsets
-+	./mkoffsets > $@
-+
-+bytecodes_arm.s: bytecodes_arm.def mkbc
-+	@echo Generatine ARM assembler bytecode sequences
-+	$(CC_COMPILE) -E -x c++ - < $< | ./mkbc - $@ $(COMPILE_DONE)
-+
-+mkbc:	$(GAMMADIR)/tools/mkbc.c
-+	@echo Compiling mkbc tool
-+	$(CC_COMPILE) -o $@ $< $(COMPILE_DONE)
-+
-+mkoffsets:	asm_helper.cpp
-+	@echo Compiling offset generator
-+	$(QUIETLY) $(REMOVE_TARGET)
-+	$(CC_COMPILE) -DSTATIC_OFFSETS -o $@ $< $(COMPILE_DONE)
-+
-+endif
-+
- # The copied fdlibm routines in sharedRuntimeTrig.o must not be optimized
- OPT_CFLAGS/sharedRuntimeTrig.o = $(OPT_CFLAGS/NOOPT)
- # The copied fdlibm routines in sharedRuntimeTrans.o must not be optimized
-diff -Nru openjdk.orig/hotspot/src/cpu/zero/vm/bytecodes_zero.cpp openjdk/hotspot/src/cpu/zero/vm/bytecodes_zero.cpp
---- openjdk.orig/hotspot/src/cpu/zero/vm/bytecodes_zero.cpp	2010-05-28 11:10:30.000000000 +0100
-+++ openjdk/hotspot/src/cpu/zero/vm/bytecodes_zero.cpp	2010-06-17 17:29:30.000000000 +0100
-@@ -1,6 +1,7 @@
- /*
-  * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.
-  * Copyright 2007 Red Hat, Inc.
-+ * Copyright 2009 Edward Nevill
-  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-  *
-  * This code is free software; you can redistribute it and/or modify it
-@@ -27,5 +28,54 @@
- #include "incls/_bytecodes_zero.cpp.incl"
- 
- void Bytecodes::pd_initialize() {
--  // No zero specific initialization
-+#ifdef HOTSPOT_ASM
-+  // Because iaccess_N can trap, we must say aload_N can trap, otherwise
-+  // we get an assertion failure
-+  def(_aload_1, "aload_1", "b", NULL, T_OBJECT ,  1, true);
-+  def(_aload_2, "aload_2", "b", NULL, T_OBJECT ,  1, true);
-+  def(_aload_3, "aload_3", "b", NULL, T_OBJECT ,  1, true);
-+
-+  def(_iaccess_0, "_iaccess_0", "b_jj", NULL, T_INT,  1, true, _aload_0);
-+  def(_iaccess_1, "_iaccess_1", "b_jj", NULL, T_INT,  1, true, _aload_1);
-+  def(_iaccess_2, "_iaccess_2", "b_jj", NULL, T_INT,  1, true, _aload_2);
-+  def(_iaccess_3, "_iaccess_3", "b_jj", NULL, T_INT,  1, true, _aload_3);
-+
-+  def(_invokeresolved,   "invokeresolved",   "bjj", NULL, T_ILLEGAL, -1, true, _invokevirtual);
-+  def(_invokespecialresolved, "invokespecialresolved", "bjj", NULL, T_ILLEGAL, -1, true, _invokespecial);
-+  def(_invokestaticresolved,  "invokestaticresolved",  "bjj", NULL, T_ILLEGAL,  0, true, _invokestatic);
-+
-+  def(_dmac,            "dmac",      "b_",  NULL, T_DOUBLE, -16, false, _dmul);
-+
-+  def(_iload_iload,      "iload_iload",      "bi_i",NULL, T_INT, 2, false, _iload);
-+  def(_iload_iload_N,    "ilaod_iload_N",    "bi_", NULL, T_INT, 2, false, _iload);
-+
-+  def(_iload_0_iconst_N, "iload_0_iconst_N", "b_",  NULL, T_INT, 2, false, _iload_0);
-+  def(_iload_1_iconst_N, "iload_1_iconst_N", "b_",  NULL, T_INT, 2, false, _iload_1);
-+  def(_iload_2_iconst_N, "iload_2_iconst_N", "b_",  NULL, T_INT, 2, false, _iload_2);
-+  def(_iload_3_iconst_N, "iload_3_iconst_N", "b_",  NULL, T_INT, 2, false, _iload_3);
-+  def(_iload_iconst_N,   "iload_iconst_N",   "bi_", NULL, T_INT, 2, false, _iload);
-+
-+  def(_iadd_istore_N,    "iadd_istore_N",    "b_",  NULL, T_VOID, -2, false, _iadd);
-+  def(_isub_istore_N,    "isub_istore_N",    "b_",  NULL, T_VOID, -2, false, _isub);
-+  def(_iand_istore_N,    "iand_istore_N",    "b_",  NULL, T_VOID, -2, false, _iand);
-+  def(_ior_istore_N,     "ior_istore_N",     "b_",  NULL, T_VOID, -2, false, _ior);
-+  def(_ixor_istore_N,    "ixor_istore_N",    "b_",  NULL, T_VOID, -2, false, _ixor);
-+
-+  def(_iadd_u4store,     "iadd_u4store",     "b_i", NULL, T_VOID, -2, false, _iadd);
-+  def(_isub_u4store,     "isub_u4store",     "b_i", NULL, T_VOID, -2, false, _isub);
-+  def(_iand_u4store,     "iand_u4store",     "b_i", NULL, T_VOID, -2, false, _iand);
-+  def(_ior_u4store,      "ior_u4store",      "b_i", NULL, T_VOID, -2, false, _ior);
-+  def(_ixor_u4store,     "ixor_u4store",     "b_i", NULL, T_VOID, -2, false, _ixor);
-+
-+  def(_iload_0_iload,    "iload_0_iload",    "b_i", NULL, T_INT, 2, false, _iload_0);
-+  def(_iload_1_iload,    "iload_1_iload",    "b_i", NULL, T_INT, 2, false, _iload_1);
-+  def(_iload_2_iload,    "iload_2_iload",    "b_i", NULL, T_INT, 2, false, _iload_2);
-+  def(_iload_3_iload,    "iload_3_iload",    "b_i", NULL, T_INT, 2, false, _iload_3);
-+
-+  def(_iload_0_iload_N,  "iload_0_iload_N",  "b_",  NULL, T_INT, 2, false, _iload_0);
-+  def(_iload_1_iload_N,  "iload_1_iload_N",  "b_",  NULL, T_INT, 2, false, _iload_1);
-+  def(_iload_2_iload_N,  "iload_2_iload_N",  "b_",  NULL, T_INT, 2, false, _iload_2);
-+  def(_iload_3_iload_N,  "iload_3_iload_N",  "b_",  NULL, T_INT, 2, false, _iload_3);
-+
-+#endif // HOTSPOT_ASM
- }
-diff -Nru openjdk.orig/hotspot/src/cpu/zero/vm/cppInterpreter_zero.cpp openjdk/hotspot/src/cpu/zero/vm/cppInterpreter_zero.cpp
---- openjdk.orig/hotspot/src/cpu/zero/vm/cppInterpreter_zero.cpp	2010-06-16 14:11:07.000000000 +0100
-+++ openjdk/hotspot/src/cpu/zero/vm/cppInterpreter_zero.cpp	2010-06-17 17:30:02.000000000 +0100
-@@ -724,10 +724,21 @@
-   return generate_entry((address) CppInterpreter::normal_entry);
- }
- 
-+#ifdef HOTSPOT_ASM
-+extern "C" address asm_generate_method_entry(
-+  AbstractInterpreter::MethodKind kind);
-+#endif // HOTSPOT_ASM
-+
- address AbstractInterpreterGenerator::generate_method_entry(
-     AbstractInterpreter::MethodKind kind) {
-   address entry_point = NULL;
- 
-+#ifdef HOTSPOT_ASM
-+    address asm_entry = asm_generate_method_entry(kind);
-+    if (asm_entry)
-+      return ((InterpreterGenerator*) this)->generate_entry(asm_entry);
-+#endif // HOTSPOT_ASM
-+
-   switch (kind) {
-   case Interpreter::zerolocals:
-   case Interpreter::zerolocals_synchronized:
-diff -Nru openjdk.orig/hotspot/src/os_cpu/linux_zero/vm/os_linux_zero.cpp openjdk/hotspot/src/os_cpu/linux_zero/vm/os_linux_zero.cpp
---- openjdk.orig/hotspot/src/os_cpu/linux_zero/vm/os_linux_zero.cpp	2010-05-28 11:11:05.000000000 +0100
-+++ openjdk/hotspot/src/os_cpu/linux_zero/vm/os_linux_zero.cpp	2010-06-17 17:27:35.000000000 +0100
-@@ -82,6 +82,10 @@
-   ShouldNotCallThis();
- }
- 
-+#ifdef HOTSPOT_ASM
-+extern "C" int asm_check_null_ptr(ucontext_t *uc);
-+#endif // HOTSPOT_ASM
-+
- extern "C" int
- JVM_handle_linux_signal(int sig,
-                         siginfo_t* info,
-@@ -89,6 +93,12 @@
-                         int abort_if_unrecognized) {
-   ucontext_t* uc = (ucontext_t*) ucVoid;
- 
-+#ifdef HOTSPOT_ASM
-+  if (sig == SIGSEGV) {
-+        if (asm_check_null_ptr(uc)) return 1;
-+  }
-+#endif // HOTSPOT_ASM
-+
-   Thread* t = ThreadLocalStorage::get_thread_slow();
- 
-   SignalHandlerMark shm(t);
--- a/patches/ecj/override.patch	Thu May 31 12:40:08 2012 +0200
+++ b/patches/ecj/override.patch	Fri Jun 08 14:23:28 2012 +0100
@@ -207,3 +207,25 @@
      public void handshakeCompleted(HandshakeCompletedEvent event)
      {
          session = event.getSession();
+diff --git a/src/share/classes/sun/security/x509/X509CRLEntryImpl.java b/src/share/classes/sun/security/x509/X509CRLEntryImpl.java
+--- openjdk-ecj/jdk/src/share/classes/sun/security/x509/X509CRLEntryImpl.java
++++ openjdk-ecj/jdk/src/share/classes/sun/security/x509/X509CRLEntryImpl.java
+@@ -464,7 +464,6 @@
+             getExtension(PKIXExtensions.CertificateIssuer_Id);
+     }
+ 
+-    @Override
+     public int compareTo(X509CRLEntryImpl that) {
+         int compSerial = getSerialNumber().compareTo(that.getSerialNumber());
+         if (compSerial != 0) {
+diff --git a/src/share/classes/sun/security/x509/X509CRLImpl.java b/src/share/classes/sun/security/x509/X509CRLImpl.java
+--- openjdk-ecj/jdk/src/share/classes/sun/security/x509/X509CRLImpl.java
++++ openjdk-ecj/jdk/src/share/classes/sun/security/x509/X509CRLImpl.java
+@@ -1276,7 +1276,6 @@
+             return hashcode;
+         }
+ 
+-        @Override
+         public int compareTo(X509IssuerSerial another) {
+             int cissuer = issuer.toString()
+                     .compareTo(another.issuer.toString());
--- a/patches/freetypeversion.patch	Thu May 31 12:40:08 2012 +0200
+++ b/patches/freetypeversion.patch	Fri Jun 08 14:23:28 2012 +0100
@@ -1,7 +1,8 @@
---- openjdk/jdk/make/common/shared/Platform.gmk.orig
-+++ openjdk/jdk/make/common/shared/Platform.gmk
-@@ -94,7 +94,7 @@
- REQUIRED_BOOT_VER = 1.5
+diff -Nru openjdk.orig/jdk/make/common/shared/Platform.gmk openjdk/jdk/make/common/shared/Platform.gmk
+--- openjdk.orig/jdk/make/common/shared/Platform.gmk	2012-06-08 11:35:57.889660863 +0100
++++ openjdk/jdk/make/common/shared/Platform.gmk	2012-06-08 11:38:57.008557136 +0100
+@@ -92,7 +92,7 @@
+ REQUIRED_BOOT_VER = 1.6
  
  # If we are using freetype, this is the required version
 -REQUIRED_FREETYPE_VERSION=2.3.0
--- a/patches/gcc-stack-markings.patch	Thu May 31 12:40:08 2012 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,14 +0,0 @@
---- openjdk/hotspot/src/os_cpu/linux_x86/vm/linux_x86_32.s~	2009-08-06 01:08:57.000000000 -0700
-+++ openjdk/hotspot/src/os_cpu/linux_x86/vm/linux_x86_32.s	2009-08-06 01:09:27.000000000 -0700
-@@ -650,3 +650,4 @@ _Atomic_cmpxchg_long:
-         popl     %ebx
-         ret
- 
-+.section        .note.GNU-stack, "", @progbits
---- openjdk/hotspot/src/os_cpu/linux_x86/vm/linux_x86_64.s~	2009-08-06 01:08:57.000000000 -0700
-+++ openjdk/hotspot/src/os_cpu/linux_x86/vm/linux_x86_64.s	2009-08-06 01:09:27.000000000 -0700
-@@ -400,3 +400,4 @@ _Atomic_cmpxchg_long:
-         addq     $4,%rdx
-         jg       4b
-         ret
-+.section        .note.GNU-stack, "", @progbits
--- a/patches/gcc-suffix.patch	Thu May 31 12:40:08 2012 +0200
+++ b/patches/gcc-suffix.patch	Fri Jun 08 14:23:28 2012 +0100
@@ -1,5 +1,31 @@
---- openjdk/jdk/make/common/shared/Compiler-gcc.gmk~	2007-08-02 09:17:53.000000000 +0200
-+++ openjdk/jdk/make/common/shared/Compiler-gcc.gmk	2007-08-08 16:30:52.857814544 +0200
+diff -Nru openjdk.orig/corba/make/common/shared/Compiler-gcc.gmk openjdk/corba/make/common/shared/Compiler-gcc.gmk
+--- openjdk.orig/corba/make/common/shared/Compiler-gcc.gmk	2011-02-28 16:02:14.000000000 +0000
++++ openjdk/corba/make/common/shared/Compiler-gcc.gmk	2012-06-08 11:30:16.296059797 +0100
+@@ -58,17 +58,17 @@
+ ifeq ($(PLATFORM), linux)
+ 
+   # Settings specific to Linux
+-  CC             = $(COMPILER_PATH)gcc
+-  CPP            = $(COMPILER_PATH)gcc -E
++  CC             = $(COMPILER_PATH)gcc$(GCC_SUFFIX)
++  CPP            = $(COMPILER_PATH)gcc$(GCC_SUFFIX) -E
+   # statically link libstdc++ before C++ ABI is stablized on Linux
+   STATIC_CXX     = true
+   ifeq ($(STATIC_CXX),true)
+     # g++ always dynamically links libstdc++, even we use "-Wl,-Bstatic -lstdc++"
+     # We need to use gcc to statically link the C++ runtime. gcc and g++ use
+     # the same subprocess to compile C++ files, so it is OK to build using gcc.
+-    CXX            = $(COMPILER_PATH)gcc
++    CXX            = $(COMPILER_PATH)gcc$(GCC_SUFFIX)
+   else
+-    CXX            = $(COMPILER_PATH)g++
++    CXX            = $(COMPILER_PATH)g++$(GCC_SUFFIX)
+   endif
+   ifeq ($(ZERO_BUILD), true)
+     # zero
+diff -Nru openjdk.orig/jdk/make/common/shared/Compiler-gcc.gmk openjdk/jdk/make/common/shared/Compiler-gcc.gmk
+--- openjdk.orig/jdk/make/common/shared/Compiler-gcc.gmk	2011-02-28 16:06:10.000000000 +0000
++++ openjdk/jdk/make/common/shared/Compiler-gcc.gmk	2012-06-08 11:30:16.288059665 +0100
 @@ -58,17 +58,17 @@
  ifeq ($(PLATFORM), linux)
  
@@ -22,27 +48,3 @@
    endif
    ifneq ("$(findstring sparc,$(ARCH))", "")
      # sparc or sparcv9
---- openjdk/corba/make/common/shared/Compiler-gcc.gmk~	2008-01-14 14:05:43.738465508 +0100
-+++ openjdk/corba/make/common/shared/Compiler-gcc.gmk	2008-01-14 14:19:33.640984398 +0100
-@@ -58,17 +58,17 @@
- ifeq ($(PLATFORM), linux)
- 
-   # Settings specific to Linux
--  CC             = $(COMPILER_PATH)gcc
--  CPP            = $(COMPILER_PATH)gcc -E
-+  CC             = $(COMPILER_PATH)gcc$(GCC_SUFFIX)
-+  CPP            = $(COMPILER_PATH)gcc$(GCC_SUFFIX) -E
-   # statically link libstdc++ before C++ ABI is stablized on Linux
-   STATIC_CXX     = true
-   ifeq ($(STATIC_CXX),true)
-     # g++ always dynamically links libstdc++, even we use "-Wl,-Bstatic -lstdc++"
-     # We need to use gcc to statically link the C++ runtime. gcc and g++ use
-     # the same subprocess to compile C++ files, so it is OK to build using gcc.
--    CXX            = $(COMPILER_PATH)gcc
-+    CXX            = $(COMPILER_PATH)gcc$(GCC_SUFFIX)
-   else
--    CXX            = $(COMPILER_PATH)g++
-+    CXX            = $(COMPILER_PATH)g++$(GCC_SUFFIX)
-   endif
-   ifneq ("$(findstring sparc,$(ARCH))", "")
-     # sparc or sparcv9
--- a/patches/hotspot/hs20/arm.patch	Thu May 31 12:40:08 2012 +0200
+++ b/patches/hotspot/hs20/arm.patch	Fri Jun 08 14:23:28 2012 +0100
@@ -55,3 +55,169 @@
 +#endif // HOTSPOT_ASM
  
  #endif // CPU_ZERO_VM_BYTECODES_ZERO_HPP
+diff -Nru openjdk.orig/hotspot/make/linux/makefiles/zeroshark.make openjdk/hotspot/make/linux/makefiles/zeroshark.make
+--- openjdk.orig/hotspot/make/linux/makefiles/zeroshark.make	2011-03-16 02:30:16.000000000 +0000
++++ openjdk/hotspot/make/linux/makefiles/zeroshark.make	2012-06-08 11:50:01.843317640 +0100
+@@ -25,6 +25,43 @@
+ 
+ # Setup common to Zero (non-Shark) and Shark versions of VM
+ 
++ifeq ($(ZERO_LIBARCH),arm)
++
++Obj_Files += asm_helper.o
++Obj_Files += cppInterpreter_arm.o
++Obj_Files += thumb2.o
++
++#XXX disabled until it has the updated frame anchor code (PR icedteopenjdk.orig/hotspot/323)
++#XXX and the updated calling convention for deopt (PR icedteopenjdk.orig/hotspot/484)
++#CFLAGS += -DHOTSPOT_ASM
++
++%.o: %.S
++	@echo Assembling $<
++	$(QUIETLY) $(REMOVE_TARGET)
++	$(COMPILE.CC) -o $@ $< $(COMPILE_DONE)
++
++cppInterpreter_arm.o:	offsets_arm.s bytecodes_arm.s
++thumb2.o:		offsets_arm.s
++
++offsets_arm.s:	mkoffsets
++	@echo Generating assembler offsets
++	./mkoffsets > $@
++
++bytecodes_arm.s: bytecodes_arm.def mkbc
++	@echo Generatine ARM assembler bytecode sequences
++	$(CC_COMPILE) -E -x c++ - < $< | ./mkbc - $@ $(COMPILE_DONE)
++
++mkbc:	$(GAMMADIR)/tools/mkbc.c
++	@echo Compiling mkbc tool
++	$(CC_COMPILE) -o $@ $< $(COMPILE_DONE)
++
++mkoffsets:	asm_helper.cpp
++	@echo Compiling offset generator
++	$(QUIETLY) $(REMOVE_TARGET)
++	$(CC_COMPILE) -DSTATIC_OFFSETS -o $@ $< $(COMPILE_DONE)
++
++endif
++
+ # The copied fdlibm routines in sharedRuntimeTrig.o must not be optimized
+ OPT_CFLAGS/sharedRuntimeTrig.o = $(OPT_CFLAGS/NOOPT)
+ # The copied fdlibm routines in sharedRuntimeTrans.o must not be optimized
+diff -Nru openjdk.orig/hotspot/src/cpu/zero/vm/bytecodes_zero.cpp openjdk/hotspot/src/cpu/zero/vm/bytecodes_zero.cpp
+--- openjdk.orig/hotspot/src/cpu/zero/vm/bytecodes_zero.cpp	2011-03-16 02:30:16.000000000 +0000
++++ openjdk/hotspot/src/cpu/zero/vm/bytecodes_zero.cpp	2012-06-08 11:50:01.851317769 +0100
+@@ -1,6 +1,7 @@
+ /*
+  * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
+  * Copyright 2007 Red Hat, Inc.
++ * Copyright 2009 Edward Nevill
+  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+  *
+  * This code is free software; you can redistribute it and/or modify it
+@@ -27,5 +28,54 @@
+ #include "interpreter/bytecodes.hpp"
+ 
+ void Bytecodes::pd_initialize() {
+-  // No zero specific initialization
++#ifdef HOTSPOT_ASM
++  // Because iaccess_N can trap, we must say aload_N can trap, otherwise
++  // we get an assertion failure
++  def(_aload_1, "aload_1", "b", NULL, T_OBJECT ,  1, true);
++  def(_aload_2, "aload_2", "b", NULL, T_OBJECT ,  1, true);
++  def(_aload_3, "aload_3", "b", NULL, T_OBJECT ,  1, true);
++
++  def(_iaccess_0, "_iaccess_0", "b_jj", NULL, T_INT,  1, true, _aload_0);
++  def(_iaccess_1, "_iaccess_1", "b_jj", NULL, T_INT,  1, true, _aload_1);
++  def(_iaccess_2, "_iaccess_2", "b_jj", NULL, T_INT,  1, true, _aload_2);
++  def(_iaccess_3, "_iaccess_3", "b_jj", NULL, T_INT,  1, true, _aload_3);
++
++  def(_invokeresolved,   "invokeresolved",   "bjj", NULL, T_ILLEGAL, -1, true, _invokevirtual);
++  def(_invokespecialresolved, "invokespecialresolved", "bjj", NULL, T_ILLEGAL, -1, true, _invokespecial);
++  def(_invokestaticresolved,  "invokestaticresolved",  "bjj", NULL, T_ILLEGAL,  0, true, _invokestatic);
++
++  def(_dmac,            "dmac",      "b_",  NULL, T_DOUBLE, -16, false, _dmul);
++
++  def(_iload_iload,      "iload_iload",      "bi_i",NULL, T_INT, 2, false, _iload);
++  def(_iload_iload_N,    "ilaod_iload_N",    "bi_", NULL, T_INT, 2, false, _iload);
++
++  def(_iload_0_iconst_N, "iload_0_iconst_N", "b_",  NULL, T_INT, 2, false, _iload_0);
++  def(_iload_1_iconst_N, "iload_1_iconst_N", "b_",  NULL, T_INT, 2, false, _iload_1);
++  def(_iload_2_iconst_N, "iload_2_iconst_N", "b_",  NULL, T_INT, 2, false, _iload_2);
++  def(_iload_3_iconst_N, "iload_3_iconst_N", "b_",  NULL, T_INT, 2, false, _iload_3);
++  def(_iload_iconst_N,   "iload_iconst_N",   "bi_", NULL, T_INT, 2, false, _iload);
++
++  def(_iadd_istore_N,    "iadd_istore_N",    "b_",  NULL, T_VOID, -2, false, _iadd);
++  def(_isub_istore_N,    "isub_istore_N",    "b_",  NULL, T_VOID, -2, false, _isub);
++  def(_iand_istore_N,    "iand_istore_N",    "b_",  NULL, T_VOID, -2, false, _iand);
++  def(_ior_istore_N,     "ior_istore_N",     "b_",  NULL, T_VOID, -2, false, _ior);
++  def(_ixor_istore_N,    "ixor_istore_N",    "b_",  NULL, T_VOID, -2, false, _ixor);
++
++  def(_iadd_u4store,     "iadd_u4store",     "b_i", NULL, T_VOID, -2, false, _iadd);
++  def(_isub_u4store,     "isub_u4store",     "b_i", NULL, T_VOID, -2, false, _isub);
++  def(_iand_u4store,     "iand_u4store",     "b_i", NULL, T_VOID, -2, false, _iand);
++  def(_ior_u4store,      "ior_u4store",      "b_i", NULL, T_VOID, -2, false, _ior);
++  def(_ixor_u4store,     "ixor_u4store",     "b_i", NULL, T_VOID, -2, false, _ixor);
++
++  def(_iload_0_iload,    "iload_0_iload",    "b_i", NULL, T_INT, 2, false, _iload_0);
++  def(_iload_1_iload,    "iload_1_iload",    "b_i", NULL, T_INT, 2, false, _iload_1);
++  def(_iload_2_iload,    "iload_2_iload",    "b_i", NULL, T_INT, 2, false, _iload_2);
++  def(_iload_3_iload,    "iload_3_iload",    "b_i", NULL, T_INT, 2, false, _iload_3);
++
++  def(_iload_0_iload_N,  "iload_0_iload_N",  "b_",  NULL, T_INT, 2, false, _iload_0);
++  def(_iload_1_iload_N,  "iload_1_iload_N",  "b_",  NULL, T_INT, 2, false, _iload_1);
++  def(_iload_2_iload_N,  "iload_2_iload_N",  "b_",  NULL, T_INT, 2, false, _iload_2);
++  def(_iload_3_iload_N,  "iload_3_iload_N",  "b_",  NULL, T_INT, 2, false, _iload_3);
++
++#endif // HOTSPOT_ASM
+ }
+diff -Nru openjdk.orig/hotspot/src/cpu/zero/vm/cppInterpreter_zero.cpp openjdk/hotspot/src/cpu/zero/vm/cppInterpreter_zero.cpp
+--- openjdk.orig/hotspot/src/cpu/zero/vm/cppInterpreter_zero.cpp	2011-03-16 02:30:16.000000000 +0000
++++ openjdk/hotspot/src/cpu/zero/vm/cppInterpreter_zero.cpp	2012-06-08 11:50:01.851317769 +0100
+@@ -749,10 +749,21 @@
+   return generate_entry((address) CppInterpreter::normal_entry);
+ }
+ 
++#ifdef HOTSPOT_ASM
++extern "C" address asm_generate_method_entry(
++  AbstractInterpreter::MethodKind kind);
++#endif // HOTSPOT_ASM
++
+ address AbstractInterpreterGenerator::generate_method_entry(
+     AbstractInterpreter::MethodKind kind) {
+   address entry_point = NULL;
+ 
++#ifdef HOTSPOT_ASM
++    address asm_entry = asm_generate_method_entry(kind);
++    if (asm_entry)
++      return ((InterpreterGenerator*) this)->generate_entry(asm_entry);
++#endif // HOTSPOT_ASM
++
+   switch (kind) {
+   case Interpreter::zerolocals:
+   case Interpreter::zerolocals_synchronized:
+diff -Nru openjdk.orig/hotspot/src/os_cpu/linux_zero/vm/os_linux_zero.cpp openjdk/hotspot/src/os_cpu/linux_zero/vm/os_linux_zero.cpp
+--- openjdk.orig/hotspot/src/os_cpu/linux_zero/vm/os_linux_zero.cpp	2011-03-16 02:30:16.000000000 +0000
++++ openjdk/hotspot/src/os_cpu/linux_zero/vm/os_linux_zero.cpp	2012-06-08 11:50:01.851317769 +0100
+@@ -116,6 +116,10 @@
+   ShouldNotCallThis();
+ }
+ 
++#ifdef HOTSPOT_ASM
++extern "C" int asm_check_null_ptr(ucontext_t *uc);
++#endif // HOTSPOT_ASM
++
+ extern "C" int
+ JVM_handle_linux_signal(int sig,
+                         siginfo_t* info,
+@@ -123,6 +127,12 @@
+                         int abort_if_unrecognized) {
+   ucontext_t* uc = (ucontext_t*) ucVoid;
+ 
++#ifdef HOTSPOT_ASM
++  if (sig == SIGSEGV) {
++        if (asm_check_null_ptr(uc)) return 1;
++  }
++#endif // HOTSPOT_ASM
++
+   Thread* t = ThreadLocalStorage::get_thread_slow();
+ 
+   SignalHandlerMark shm(t);
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/hotspot/hs20/gcc-stack-markings.patch	Fri Jun 08 14:23:28 2012 +0100
@@ -0,0 +1,16 @@
+diff -Nru openjdk.orig/hotspot/src/os_cpu/linux_x86/vm/linux_x86_32.s openjdk/hotspot/src/os_cpu/linux_x86/vm/linux_x86_32.s
+--- openjdk.orig/hotspot/src/os_cpu/linux_x86/vm/linux_x86_32.s	2011-03-16 02:30:16.000000000 +0000
++++ openjdk/hotspot/src/os_cpu/linux_x86/vm/linux_x86_32.s	2012-06-08 11:46:36.783997045 +0100
+@@ -666,3 +666,4 @@
+         fistpll   (%eax)
+         ret
+ 
++.section        .note.GNU-stack, "", @progbits
+diff -Nru openjdk.orig/hotspot/src/os_cpu/linux_x86/vm/linux_x86_64.s openjdk/hotspot/src/os_cpu/linux_x86/vm/linux_x86_64.s
+--- openjdk.orig/hotspot/src/os_cpu/linux_x86/vm/linux_x86_64.s	2011-03-16 02:30:16.000000000 +0000
++++ openjdk/hotspot/src/os_cpu/linux_x86/vm/linux_x86_64.s	2012-06-08 11:46:36.783997045 +0100
+@@ -400,3 +400,4 @@
+         addq     $4,%rdx
+         jg       4b
+         ret
++.section        .note.GNU-stack, "", @progbits
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/hotspot/hs20/numa_on_early_glibc.patch	Fri Jun 08 14:23:28 2012 +0100
@@ -0,0 +1,47 @@
+diff -Nru openjdk.orig/hotspot/src/os/linux/vm/os_linux.cpp openjdk/hotspot/src/os/linux/vm/os_linux.cpp
+--- openjdk.orig/hotspot/src/os/linux/vm/os_linux.cpp	2012-06-08 11:51:48.425044103 +0100
++++ openjdk/hotspot/src/os/linux/vm/os_linux.cpp	2012-06-08 11:56:16.305393382 +0100
+@@ -117,6 +117,10 @@
+ # include <inttypes.h>
+ # include <sys/ioctl.h>
+ 
++#if __x86_64__
++#include <asm/vsyscall.h>
++#endif
++
+ #define MAX_PATH    (2 * K)
+ 
+ // for timer info max values which include all bits
+@@ -2544,6 +2548,21 @@
+   return end;
+ }
+ 
++static int sched_getcpu_syscall(void) {
++  unsigned int cpu;
++  int retval = -1;
++
++#if __x86_64__
++  typedef long (*vgetcpu_t)(unsigned int *cpu, unsigned int *node, unsigned long *tcache);
++  vgetcpu_t vgetcpu = (vgetcpu_t)VSYSCALL_ADDR(__NR_vgetcpu);
++  retval = vgetcpu(&cpu, NULL, NULL);
++#elif __i386__
++  retval = syscall(SYS_getcpu, &cpu, NULL, NULL);
++#endif
++
++  return (retval == -1) ? retval : cpu;
++}
++
+ extern "C" void numa_warn(int number, char *where, ...) { }
+ extern "C" void numa_error(char *where) { }
+ 
+@@ -2565,6 +2584,10 @@
+   set_sched_getcpu(CAST_TO_FN_PTR(sched_getcpu_func_t,
+                                   dlsym(RTLD_DEFAULT, "sched_getcpu")));
+ 
++  // If it's not, try a direct syscall.
++  if (sched_getcpu() == -1)
++    set_sched_getcpu(CAST_TO_FN_PTR(sched_getcpu_func_t, (void*)&sched_getcpu_syscall));
++
+   if (sched_getcpu() != -1) { // Does it work?
+     void *handle = dlopen("libnuma.so.1", RTLD_LAZY);
+     if (handle != NULL) {
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/hotspot/hs20/sparc-trapsfix.patch	Fri Jun 08 14:23:28 2012 +0100
@@ -0,0 +1,13 @@
+diff -Nru openjdk.orig/hotspot/src/os_cpu/linux_sparc/vm/assembler_linux_sparc.cpp openjdk/hotspot/src/os_cpu/linux_sparc/vm/assembler_linux_sparc.cpp
+--- openjdk.orig/hotspot/src/os_cpu/linux_sparc/vm/assembler_linux_sparc.cpp	2011-03-16 02:30:16.000000000 +0000
++++ openjdk/hotspot/src/os_cpu/linux_sparc/vm/assembler_linux_sparc.cpp	2012-06-08 11:43:57.641420994 +0100
+@@ -28,7 +28,8 @@
+ #include "runtime/os.hpp"
+ #include "runtime/threadLocalStorage.hpp"
+ 
+-#include <asm-sparc/traps.h>
++// always found in asm/ with merged sparc/sparc64 headers
++#include <asm/traps.h>
+ 
+ void MacroAssembler::read_ccr_trap(Register ccr_save) {
+   // No implementation
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/hotspot/hs20/version-hotspot.patch	Fri Jun 08 14:23:28 2012 +0100
@@ -0,0 +1,56 @@
+diff -Nru openjdk.orig/hotspot/make/linux/makefiles/vm.make openjdk/hotspot/make/linux/makefiles/vm.make
+--- openjdk.orig/hotspot/make/linux/makefiles/vm.make	2011-03-16 02:30:16.000000000 +0000
++++ openjdk/hotspot/make/linux/makefiles/vm.make	2012-06-08 13:21:23.141114783 +0100
+@@ -91,6 +91,14 @@
+   ${JRE_VERSION}     \
+   ${VM_DISTRO}
+ 
++ifdef DERIVATIVE_ID
++CPPFLAGS += -DDERIVATIVE_ID="\"$(DERIVATIVE_ID)\""
++endif
++
++ifdef DISTRIBUTION_ID
++CPPFLAGS += -DDISTRIBUTION_ID="\"$(DISTRIBUTION_ID)\""
++endif
++
+ # CFLAGS_WARN holds compiler options to suppress/enable warnings.
+ CFLAGS += $(CFLAGS_WARN/BYFILE)
+ 
+diff -Nru openjdk.orig/hotspot/src/share/vm/runtime/arguments.cpp openjdk/hotspot/src/share/vm/runtime/arguments.cpp
+--- openjdk.orig/hotspot/src/share/vm/runtime/arguments.cpp	2012-06-08 13:19:52.107615764 +0100
++++ openjdk/hotspot/src/share/vm/runtime/arguments.cpp	2012-06-08 13:21:23.141114783 +0100
+@@ -59,7 +59,7 @@
+ #include "gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.hpp"
+ #endif
+ 
+-#define DEFAULT_VENDOR_URL_BUG "http://java.sun.com/webapps/bugreport/crash.jsp"
++#define DEFAULT_VENDOR_URL_BUG "http://icedtea.classpath.org/bugzilla"
+ #define DEFAULT_JAVA_LAUNCHER  "generic"
+ 
+ char**  Arguments::_jvm_flags_array             = NULL;
+diff -Nru openjdk.orig/hotspot/src/share/vm/utilities/vmError.cpp openjdk/hotspot/src/share/vm/utilities/vmError.cpp
+--- openjdk.orig/hotspot/src/share/vm/utilities/vmError.cpp	2011-03-16 02:30:16.000000000 +0000
++++ openjdk/hotspot/src/share/vm/utilities/vmError.cpp	2012-06-08 13:21:23.141114783 +0100
+@@ -185,7 +185,8 @@
+ 
+ static void print_bug_submit_message(outputStream *out, Thread *thread) {
+   if (out == NULL) return;
+-  out->print_raw_cr("# If you would like to submit a bug report, please visit:");
++  out->print_raw_cr("# If you would like to submit a bug report, please include");
++  out->print_raw_cr("# instructions how to reproduce the bug and visit:");
+   out->print_raw   ("#   ");
+   out->print_raw_cr(Arguments::java_vendor_url_bug());
+   // If the crash is in native code, encourage user to submit a bug to the
+@@ -441,6 +442,12 @@
+                    Abstract_VM_Version::vm_platform_string(),
+                    UseCompressedOops ? "compressed oops" : ""
+                  );
++#ifdef DERIVATIVE_ID
++     st->print_cr("# Derivative: %s", DERIVATIVE_ID);
++#endif
++#ifdef DISTRIBUTION_ID
++     st->print_cr("# Distribution: %s", DISTRIBUTION_ID);
++#endif
+ 
+   STEP(60, "(printing problematic frame)")
+ 
--- a/patches/hotspot/original/arm.patch	Thu May 31 12:40:08 2012 +0200
+++ b/patches/hotspot/original/arm.patch	Fri Jun 08 14:23:28 2012 +0100
@@ -53,3 +53,169 @@
 +        _iload_2_iload_N        ,       // 252
 +        _iload_3_iload_N        ,       // 253
 +#endif // HOTSPOT_ASM
+diff -Nru openjdk.orig/hotspot/make/linux/makefiles/zeroshark.make openjdk/hotspot/make/linux/makefiles/zeroshark.make
+--- openjdk.orig/hotspot/make/linux/makefiles/zeroshark.make	2010-05-28 11:09:25.000000000 +0100
++++ openjdk/hotspot/make/linux/makefiles/zeroshark.make	2010-06-17 17:28:03.000000000 +0100
+@@ -25,6 +25,43 @@
+ 
+ # Setup common to Zero (non-Shark) and Shark versions of VM
+ 
++ifeq ($(ZERO_LIBARCH),arm)
++
++Obj_Files += asm_helper.o
++Obj_Files += cppInterpreter_arm.o
++Obj_Files += thumb2.o
++
++#XXX disabled until it has the updated frame anchor code (PR icedteopenjdk.orig/hotspot/323)
++#XXX and the updated calling convention for deopt (PR icedteopenjdk.orig/hotspot/484)
++#CFLAGS += -DHOTSPOT_ASM
++
++%.o: %.S
++	@echo Assembling $<
++	$(QUIETLY) $(REMOVE_TARGET)
++	$(COMPILE.CC) -o $@ $< $(COMPILE_DONE)
++
++cppInterpreter_arm.o:	offsets_arm.s bytecodes_arm.s
++thumb2.o:		offsets_arm.s
++
++offsets_arm.s:	mkoffsets
++	@echo Generating assembler offsets
++	./mkoffsets > $@
++
++bytecodes_arm.s: bytecodes_arm.def mkbc
++	@echo Generatine ARM assembler bytecode sequences
++	$(CC_COMPILE) -E -x c++ - < $< | ./mkbc - $@ $(COMPILE_DONE)
++
++mkbc:	$(GAMMADIR)/tools/mkbc.c
++	@echo Compiling mkbc tool
++	$(CC_COMPILE) -o $@ $< $(COMPILE_DONE)
++
++mkoffsets:	asm_helper.cpp
++	@echo Compiling offset generator
++	$(QUIETLY) $(REMOVE_TARGET)
++	$(CC_COMPILE) -DSTATIC_OFFSETS -o $@ $< $(COMPILE_DONE)
++
++endif
++
+ # The copied fdlibm routines in sharedRuntimeTrig.o must not be optimized
+ OPT_CFLAGS/sharedRuntimeTrig.o = $(OPT_CFLAGS/NOOPT)
+ # The copied fdlibm routines in sharedRuntimeTrans.o must not be optimized
+diff -Nru openjdk.orig/hotspot/src/cpu/zero/vm/bytecodes_zero.cpp openjdk/hotspot/src/cpu/zero/vm/bytecodes_zero.cpp
+--- openjdk.orig/hotspot/src/cpu/zero/vm/bytecodes_zero.cpp	2010-05-28 11:10:30.000000000 +0100
++++ openjdk/hotspot/src/cpu/zero/vm/bytecodes_zero.cpp	2010-06-17 17:29:30.000000000 +0100
+@@ -1,6 +1,7 @@
+ /*
+  * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.
+  * Copyright 2007 Red Hat, Inc.
++ * Copyright 2009 Edward Nevill
+  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+  *
+  * This code is free software; you can redistribute it and/or modify it
+@@ -27,5 +28,54 @@
+ #include "incls/_bytecodes_zero.cpp.incl"
+ 
+ void Bytecodes::pd_initialize() {
+-  // No zero specific initialization
++#ifdef HOTSPOT_ASM
++  // Because iaccess_N can trap, we must say aload_N can trap, otherwise
++  // we get an assertion failure
++  def(_aload_1, "aload_1", "b", NULL, T_OBJECT ,  1, true);
++  def(_aload_2, "aload_2", "b", NULL, T_OBJECT ,  1, true);
++  def(_aload_3, "aload_3", "b", NULL, T_OBJECT ,  1, true);
++
++  def(_iaccess_0, "_iaccess_0", "b_jj", NULL, T_INT,  1, true, _aload_0);
++  def(_iaccess_1, "_iaccess_1", "b_jj", NULL, T_INT,  1, true, _aload_1);
++  def(_iaccess_2, "_iaccess_2", "b_jj", NULL, T_INT,  1, true, _aload_2);
++  def(_iaccess_3, "_iaccess_3", "b_jj", NULL, T_INT,  1, true, _aload_3);
++
++  def(_invokeresolved,   "invokeresolved",   "bjj", NULL, T_ILLEGAL, -1, true, _invokevirtual);
++  def(_invokespecialresolved, "invokespecialresolved", "bjj", NULL, T_ILLEGAL, -1, true, _invokespecial);
++  def(_invokestaticresolved,  "invokestaticresolved",  "bjj", NULL, T_ILLEGAL,  0, true, _invokestatic);
++
++  def(_dmac,            "dmac",      "b_",  NULL, T_DOUBLE, -16, false, _dmul);
++
++  def(_iload_iload,      "iload_iload",      "bi_i",NULL, T_INT, 2, false, _iload);
++  def(_iload_iload_N,    "ilaod_iload_N",    "bi_", NULL, T_INT, 2, false, _iload);
++
++  def(_iload_0_iconst_N, "iload_0_iconst_N", "b_",  NULL, T_INT, 2, false, _iload_0);
++  def(_iload_1_iconst_N, "iload_1_iconst_N", "b_",  NULL, T_INT, 2, false, _iload_1);
++  def(_iload_2_iconst_N, "iload_2_iconst_N", "b_",  NULL, T_INT, 2, false, _iload_2);
++  def(_iload_3_iconst_N, "iload_3_iconst_N", "b_",  NULL, T_INT, 2, false, _iload_3);
++  def(_iload_iconst_N,   "iload_iconst_N",   "bi_", NULL, T_INT, 2, false, _iload);
++
++  def(_iadd_istore_N,    "iadd_istore_N",    "b_",  NULL, T_VOID, -2, false, _iadd);
++  def(_isub_istore_N,    "isub_istore_N",    "b_",  NULL, T_VOID, -2, false, _isub);
++  def(_iand_istore_N,    "iand_istore_N",    "b_",  NULL, T_VOID, -2, false, _iand);
++  def(_ior_istore_N,     "ior_istore_N",     "b_",  NULL, T_VOID, -2, false, _ior);
++  def(_ixor_istore_N,    "ixor_istore_N",    "b_",  NULL, T_VOID, -2, false, _ixor);
++
++  def(_iadd_u4store,     "iadd_u4store",     "b_i", NULL, T_VOID, -2, false, _iadd);
++  def(_isub_u4store,     "isub_u4store",     "b_i", NULL, T_VOID, -2, false, _isub);
++  def(_iand_u4store,     "iand_u4store",     "b_i", NULL, T_VOID, -2, false, _iand);
++  def(_ior_u4store,      "ior_u4store",      "b_i", NULL, T_VOID, -2, false, _ior);
++  def(_ixor_u4store,     "ixor_u4store",     "b_i", NULL, T_VOID, -2, false, _ixor);
++
++  def(_iload_0_iload,    "iload_0_iload",    "b_i", NULL, T_INT, 2, false, _iload_0);
++  def(_iload_1_iload,    "iload_1_iload",    "b_i", NULL, T_INT, 2, false, _iload_1);
++  def(_iload_2_iload,    "iload_2_iload",    "b_i", NULL, T_INT, 2, false, _iload_2);
++  def(_iload_3_iload,    "iload_3_iload",    "b_i", NULL, T_INT, 2, false, _iload_3);
++
++  def(_iload_0_iload_N,  "iload_0_iload_N",  "b_",  NULL, T_INT, 2, false, _iload_0);
++  def(_iload_1_iload_N,  "iload_1_iload_N",  "b_",  NULL, T_INT, 2, false, _iload_1);
++  def(_iload_2_iload_N,  "iload_2_iload_N",  "b_",  NULL, T_INT, 2, false, _iload_2);
++  def(_iload_3_iload_N,  "iload_3_iload_N",  "b_",  NULL, T_INT, 2, false, _iload_3);
++
++#endif // HOTSPOT_ASM
+ }
+diff -Nru openjdk.orig/hotspot/src/cpu/zero/vm/cppInterpreter_zero.cpp openjdk/hotspot/src/cpu/zero/vm/cppInterpreter_zero.cpp
+--- openjdk.orig/hotspot/src/cpu/zero/vm/cppInterpreter_zero.cpp	2010-06-16 14:11:07.000000000 +0100
++++ openjdk/hotspot/src/cpu/zero/vm/cppInterpreter_zero.cpp	2010-06-17 17:30:02.000000000 +0100
+@@ -724,10 +724,21 @@
+   return generate_entry((address) CppInterpreter::normal_entry);
+ }
+ 
++#ifdef HOTSPOT_ASM
++extern "C" address asm_generate_method_entry(
++  AbstractInterpreter::MethodKind kind);
++#endif // HOTSPOT_ASM
++
+ address AbstractInterpreterGenerator::generate_method_entry(
+     AbstractInterpreter::MethodKind kind) {
+   address entry_point = NULL;
+ 
++#ifdef HOTSPOT_ASM
++    address asm_entry = asm_generate_method_entry(kind);
++    if (asm_entry)
++      return ((InterpreterGenerator*) this)->generate_entry(asm_entry);
++#endif // HOTSPOT_ASM
++
+   switch (kind) {
+   case Interpreter::zerolocals:
+   case Interpreter::zerolocals_synchronized:
+diff -Nru openjdk.orig/hotspot/src/os_cpu/linux_zero/vm/os_linux_zero.cpp openjdk/hotspot/src/os_cpu/linux_zero/vm/os_linux_zero.cpp
+--- openjdk.orig/hotspot/src/os_cpu/linux_zero/vm/os_linux_zero.cpp	2010-05-28 11:11:05.000000000 +0100
++++ openjdk/hotspot/src/os_cpu/linux_zero/vm/os_linux_zero.cpp	2010-06-17 17:27:35.000000000 +0100
+@@ -82,6 +82,10 @@
+   ShouldNotCallThis();
+ }
+ 
++#ifdef HOTSPOT_ASM
++extern "C" int asm_check_null_ptr(ucontext_t *uc);
++#endif // HOTSPOT_ASM
++
+ extern "C" int
+ JVM_handle_linux_signal(int sig,
+                         siginfo_t* info,
+@@ -89,6 +93,12 @@
+                         int abort_if_unrecognized) {
+   ucontext_t* uc = (ucontext_t*) ucVoid;
+ 
++#ifdef HOTSPOT_ASM
++  if (sig == SIGSEGV) {
++        if (asm_check_null_ptr(uc)) return 1;
++  }
++#endif // HOTSPOT_ASM
++
+   Thread* t = ThreadLocalStorage::get_thread_slow();
+ 
+   SignalHandlerMark shm(t);
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/hotspot/original/gcc-stack-markings.patch	Fri Jun 08 14:23:28 2012 +0100
@@ -0,0 +1,16 @@
+diff -Nru openjdk.orig/hotspot/src/os_cpu/linux_x86/vm/linux_x86_32.s openjdk/hotspot/src/os_cpu/linux_x86/vm/linux_x86_32.s
+--- openjdk.orig/hotspot/src/os_cpu/linux_x86/vm/linux_x86_32.s	2011-02-28 16:03:15.000000000 +0000
++++ openjdk/hotspot/src/os_cpu/linux_x86/vm/linux_x86_32.s	2012-06-08 12:38:09.810174294 +0100
+@@ -653,3 +653,4 @@
+         popl     %ebx
+         ret
+ 
++.section        .note.GNU-stack, "", @progbits
+diff -Nru openjdk.orig/hotspot/src/os_cpu/linux_x86/vm/linux_x86_64.s openjdk/hotspot/src/os_cpu/linux_x86/vm/linux_x86_64.s
+--- openjdk.orig/hotspot/src/os_cpu/linux_x86/vm/linux_x86_64.s	2011-02-28 16:03:15.000000000 +0000
++++ openjdk/hotspot/src/os_cpu/linux_x86/vm/linux_x86_64.s	2012-06-08 12:38:09.810174294 +0100
+@@ -400,3 +400,4 @@
+         addq     $4,%rdx
+         jg       4b
+         ret
++.section        .note.GNU-stack, "", @progbits
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/hotspot/original/numa_on_early_glibc.patch	Fri Jun 08 14:23:28 2012 +0100
@@ -0,0 +1,47 @@
+diff -Nru openjdk.orig/hotspot/src/os/linux/vm/os_linux.cpp openjdk/hotspot/src/os/linux/vm/os_linux.cpp
+--- openjdk.orig/hotspot/src/os/linux/vm/os_linux.cpp	2012-06-08 12:41:19.273319289 +0100
++++ openjdk/hotspot/src/os/linux/vm/os_linux.cpp	2012-06-08 12:42:11.990194097 +0100
+@@ -60,6 +60,10 @@
+ # include <stdint.h>
+ # include <inttypes.h>
+ 
++#if __x86_64__
++#include <asm/vsyscall.h>
++#endif
++
+ #define MAX_PATH    (2 * K)
+ 
+ // for timer info max values which include all bits
+@@ -2460,6 +2464,21 @@
+   return end;
+ }
+ 
++static int sched_getcpu_syscall(void) {
++  unsigned int cpu;
++  int retval = -1;
++
++#if __x86_64__
++  typedef long (*vgetcpu_t)(unsigned int *cpu, unsigned int *node, unsigned long *tcache);
++  vgetcpu_t vgetcpu = (vgetcpu_t)VSYSCALL_ADDR(__NR_vgetcpu);
++  retval = vgetcpu(&cpu, NULL, NULL);
++#elif __i386__
++  retval = syscall(SYS_getcpu, &cpu, NULL, NULL);
++#endif
++
++  return (retval == -1) ? retval : cpu;
++}
++
+ extern "C" void numa_warn(int number, char *where, ...) { }
+ extern "C" void numa_error(char *where) { }
+ 
+@@ -2481,6 +2500,10 @@
+   set_sched_getcpu(CAST_TO_FN_PTR(sched_getcpu_func_t,
+                                   dlsym(RTLD_DEFAULT, "sched_getcpu")));
+ 
++  // If it's not, try a direct syscall.
++  if (sched_getcpu() == -1)
++    set_sched_getcpu(CAST_TO_FN_PTR(sched_getcpu_func_t, (void*)&sched_getcpu_syscall));
++
+   if (sched_getcpu() != -1) { // Does it work?
+     void *handle = dlopen("libnuma.so.1", RTLD_LAZY);
+     if (handle != NULL) {
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/hotspot/original/sparc-trapsfix.patch	Fri Jun 08 14:23:28 2012 +0100
@@ -0,0 +1,13 @@
+diff -Nru openjdk.orig/hotspot/src/os_cpu/linux_sparc/vm/assembler_linux_sparc.cpp openjdk/hotspot/src/os_cpu/linux_sparc/vm/assembler_linux_sparc.cpp
+--- openjdk.orig/hotspot/src/os_cpu/linux_sparc/vm/assembler_linux_sparc.cpp	2011-02-28 16:03:15.000000000 +0000
++++ openjdk/hotspot/src/os_cpu/linux_sparc/vm/assembler_linux_sparc.cpp	2012-06-08 12:35:55.651946399 +0100
+@@ -25,7 +25,8 @@
+ #include "incls/_precompiled.incl"
+ #include "incls/_assembler_linux_sparc.cpp.incl"
+ 
+-#include <asm-sparc/traps.h>
++// always found in asm/ with merged sparc/sparc64 headers
++#include <asm/traps.h>
+ 
+ void MacroAssembler::read_ccr_trap(Register ccr_save) {
+   // No implementation
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/hotspot/original/version-hotspot.patch	Fri Jun 08 14:23:28 2012 +0100
@@ -0,0 +1,56 @@
+diff -Nru openjdk.orig/hotspot/make/linux/makefiles/vm.make openjdk/hotspot/make/linux/makefiles/vm.make
+--- openjdk.orig/hotspot/make/linux/makefiles/vm.make	2011-02-28 16:03:13.000000000 +0000
++++ openjdk/hotspot/make/linux/makefiles/vm.make	2012-06-08 12:32:28.224532584 +0100
+@@ -90,6 +90,14 @@
+   ${JRE_VERSION}     \
+   ${VM_DISTRO}
+ 
++ifdef DERIVATIVE_ID
++CPPFLAGS += -DDERIVATIVE_ID="\"$(DERIVATIVE_ID)\""
++endif
++
++ifdef DISTRIBUTION_ID
++CPPFLAGS += -DDISTRIBUTION_ID="\"$(DISTRIBUTION_ID)\""
++endif
++
+ # CFLAGS_WARN holds compiler options to suppress/enable warnings.
+ CFLAGS += $(CFLAGS_WARN/BYFILE)
+ 
+diff -Nru openjdk.orig/hotspot/src/share/vm/runtime/arguments.cpp openjdk/hotspot/src/share/vm/runtime/arguments.cpp
+--- openjdk.orig/hotspot/src/share/vm/runtime/arguments.cpp	2012-06-08 12:31:22.939474450 +0100
++++ openjdk/hotspot/src/share/vm/runtime/arguments.cpp	2012-06-08 12:32:28.224532584 +0100
+@@ -25,7 +25,7 @@
+ #include "incls/_precompiled.incl"
+ #include "incls/_arguments.cpp.incl"
+ 
+-#define DEFAULT_VENDOR_URL_BUG "http://java.sun.com/webapps/bugreport/crash.jsp"
++#define DEFAULT_VENDOR_URL_BUG "http://icedtea.classpath.org/bugzilla"
+ #define DEFAULT_JAVA_LAUNCHER  "generic"
+ 
+ char**  Arguments::_jvm_flags_array             = NULL;
+diff -Nru openjdk.orig/hotspot/src/share/vm/utilities/vmError.cpp openjdk/hotspot/src/share/vm/utilities/vmError.cpp
+--- openjdk.orig/hotspot/src/share/vm/utilities/vmError.cpp	2011-02-28 16:03:22.000000000 +0000
++++ openjdk/hotspot/src/share/vm/utilities/vmError.cpp	2012-06-08 12:32:28.224532584 +0100
+@@ -172,7 +172,8 @@
+ 
+ static void print_bug_submit_message(outputStream *out, Thread *thread) {
+   if (out == NULL) return;
+-  out->print_raw_cr("# If you would like to submit a bug report, please visit:");
++  out->print_raw_cr("# If you would like to submit a bug report, please include");
++  out->print_raw_cr("# instructions how to reproduce the bug and visit:");
+   out->print_raw   ("#   ");
+   out->print_raw_cr(Arguments::java_vendor_url_bug());
+   // If the crash is in native code, encourage user to submit a bug to the
+@@ -400,6 +401,12 @@
+                    Abstract_VM_Version::vm_platform_string(),
+                    UseCompressedOops ? "compressed oops" : ""
+                  );
++#ifdef DERIVATIVE_ID
++     st->print_cr("# Derivative: %s", DERIVATIVE_ID);
++#endif
++#ifdef DISTRIBUTION_ID
++     st->print_cr("# Distribution: %s", DISTRIBUTION_ID);
++#endif
+ 
+   STEP(60, "(printing problematic frame)")
+ 
--- a/patches/jaxp-serial-version-uid.patch	Thu May 31 12:40:08 2012 +0200
+++ b/patches/jaxp-serial-version-uid.patch	Fri Jun 08 14:23:28 2012 +0100
@@ -1,19 +1,18 @@
 diff -Nru openjdk.orig/jaxp/build.properties openjdk/jaxp/build.properties
---- openjdk.orig/jaxp/build.properties	2011-02-28 16:03:34.000000000 +0000
-+++ openjdk/jaxp/build.properties	2011-03-02 17:46:39.609899609 +0000
-@@ -77,6 +77,9 @@
- # Where patches to drop bundle sources live
+--- openjdk.orig/jaxp/build.properties	2012-06-08 12:09:16.085999548 +0100
++++ openjdk/jaxp/build.properties	2012-06-08 12:13:20.597952123 +0100
+@@ -78,7 +78,7 @@
  patches.dir=patches
  
-+# Patches to apply
-+jaxp_src.patch.list=6927050.patch serialversionuid.patch
-+
+ # Patches to apply
+-jaxp_src.patch.list=7157609.patch
++jaxp_src.patch.list=7157609.patch serialversionuid.patch
+ 
  # Sanity information
  sanity.info= Sanity Settings:${line.separator}\
-   ant.home=${ant.home}${line.separator}\
 diff -Nru openjdk.orig/jaxp/patches/jaxp_src/serialversionuid.patch openjdk/jaxp/patches/jaxp_src/serialversionuid.patch
 --- openjdk.orig/jaxp/patches/jaxp_src/serialversionuid.patch	1970-01-01 01:00:00.000000000 +0100
-+++ openjdk/jaxp/patches/jaxp_src/serialversionuid.patch	2011-03-02 17:46:17.322764393 +0000
++++ openjdk/jaxp/patches/jaxp_src/serialversionuid.patch	2012-06-08 12:10:45.967452217 +0100
 @@ -0,0 +1,36 @@
 +--- src/javax/xml/stream/FactoryConfigurationError.java	2010-06-04 01:51:47.000000000 +0200
 ++++ src/javax/xml/stream/FactoryConfigurationError.java	2010-06-04 01:51:47.000000000 +0200
--- a/patches/libraries.patch	Thu May 31 12:40:08 2012 +0200
+++ b/patches/libraries.patch	Fri Jun 08 14:23:28 2012 +0100
@@ -1,71 +1,61 @@
---- openjdk.old/jdk/make/sun/jpeg/Makefile	2007-10-12 03:54:08.000000000 -0400
-+++ openjdk/jdk/make/sun/jpeg/Makefile	2007-10-24 15:15:25.000000000 -0400
-@@ -68,6 +68,8 @@
- include $(BUILDDIR)/common/Mapfile-vers.gmk
- include $(BUILDDIR)/common/Library.gmk
- 
-+LDLIBS += -ldl 
-+
- #
- # Add to ambient vpath to get files in a subdirectory
- #
---- openjdk.old/jdk/src/share/native/sun/awt/splashscreen/splashscreen_png.c	2007-10-12 04:03:51.000000000 -0400
-+++ openjdk/jdk/src/share/native/sun/awt/splashscreen/splashscreen_png.c	2007-10-22 12:50:36.000000000 -0400
-@@ -25,7 +25,7 @@
- 
- #include "splashscreen_impl.h"
- 
--#include "../libpng/png.h"
-+#include <png.h>
- 
- #include <setjmp.h>
- 
---- openjdk.old/jdk/src/share/native/sun/awt/splashscreen/splashscreen_gif.c	2007-10-12 04:03:51.000000000 -0400
-+++ openjdk/jdk/src/share/native/sun/awt/splashscreen/splashscreen_gif.c	2007-10-22 12:50:36.000000000 -0400
-@@ -26,7 +26,7 @@
- #include "splashscreen_impl.h"
- #include "splashscreen_gfx.h"
- 
--#include "../giflib/gif_lib.h"
-+#include <gif_lib.h>
- 
- #define GIF_TRANSPARENT     0x01
- #define GIF_USER_INPUT      0x02
---- openjdk.old/jdk/src/share/native/java/util/zip/Adler32.c	2007-10-12 04:03:46.000000000 -0400
-+++ openjdk/jdk/src/share/native/java/util/zip/Adler32.c	2007-10-22 13:21:09.000000000 -0400
-@@ -29,7 +29,7 @@
- 
- #include "jni.h"
- #include "jni_util.h"
--#include "zlib.h"
-+#include <zlib.h>
- 
- #include "java_util_zip_Adler32.h"
- 
---- openjdk.old/jdk/src/share/native/java/util/zip/Deflater.c	2007-10-12 04:03:46.000000000 -0400
-+++ openjdk/jdk/src/share/native/java/util/zip/Deflater.c	2007-10-22 13:22:34.000000000 -0400
-@@ -32,7 +32,7 @@
- #include "jlong.h"
- #include "jni.h"
- #include "jni_util.h"
--#include "zlib.h"
-+#include <zlib.h>
- 
- #include "java_util_zip_Deflater.h"
- 
---- openjdk.old/jdk/src/share/native/java/util/zip/CRC32.c	2007-10-12 04:03:46.000000000 -0400
-+++ openjdk/jdk/src/share/native/java/util/zip/CRC32.c	2007-10-22 13:23:08.000000000 -0400
-@@ -29,7 +29,7 @@
- 
- #include "jni.h"
- #include "jni_util.h"
--#include "zlib.h"
-+#include <zlib.h>
- 
- #include "java_util_zip_CRC32.h"
- 
---- openjdk.old/jdk/make/common/Program.gmk	2007-10-12 03:54:05.000000000 -0400
-+++ openjdk/jdk/make/common/Program.gmk	2007-10-22 13:26:06.000000000 -0400
+diff -Nru openjdk.orig/jdk/make/com/sun/java/pack/Makefile openjdk/jdk/make/com/sun/java/pack/Makefile
+--- openjdk.orig/jdk/make/com/sun/java/pack/Makefile	2011-02-28 16:06:10.000000000 +0000
++++ openjdk/jdk/make/com/sun/java/pack/Makefile	2012-06-08 11:34:13.899956377 +0100
+@@ -64,23 +64,21 @@
+   ZIPOBJDIR = $(OUTPUTDIR)/tmp/sun/java.util.zip/zip/$(OBJDIRNAME)
+ 
+   ZIPOBJS =  $(ZIPOBJDIR)/zcrc32.$(OBJECT_SUFFIX) \
+-	     $(ZIPOBJDIR)/deflate.$(OBJECT_SUFFIX) \
+-	     $(ZIPOBJDIR)/trees.$(OBJECT_SUFFIX) \
+-	     $(ZIPOBJDIR)/zadler32.$(OBJECT_SUFFIX) \
+-	     $(ZIPOBJDIR)/zutil.$(OBJECT_SUFFIX) \
+-	     $(ZIPOBJDIR)/inflate.$(OBJECT_SUFFIX) \
+-	     $(ZIPOBJDIR)/infblock.$(OBJECT_SUFFIX) \
+-	     $(ZIPOBJDIR)/infcodes.$(OBJECT_SUFFIX) \
+-	     $(ZIPOBJDIR)/inftrees.$(OBJECT_SUFFIX) \
+-	     $(ZIPOBJDIR)/infutil.$(OBJECT_SUFFIX) \
+-	     $(ZIPOBJDIR)/inffast.$(OBJECT_SUFFIX)
+-
+-  ZINCLUDE=-I$(SHARE_SRC)/native/java/util/zip/zlib-1.1.3
+-  OTHER_CXXFLAGS += $(ZINCLUDE)
+-  LDDFLAGS += $(ZIPOBJS)
++            $(ZIPOBJDIR)/deflate.$(OBJECT_SUFFIX) \
++            $(ZIPOBJDIR)/trees.$(OBJECT_SUFFIX) \
++            $(ZIPOBJDIR)/zadler32.$(OBJECT_SUFFIX) \
++            $(ZIPOBJDIR)/zutil.$(OBJECT_SUFFIX) \
++            $(ZIPOBJDIR)/inflate.$(OBJECT_SUFFIX) \
++            $(ZIPOBJDIR)/infblock.$(OBJECT_SUFFIX) \
++            $(ZIPOBJDIR)/infcodes.$(OBJECT_SUFFIX) \
++            $(ZIPOBJDIR)/inftrees.$(OBJECT_SUFFIX) \
++            $(ZIPOBJDIR)/infutil.$(OBJECT_SUFFIX) \
++            $(ZIPOBJDIR)/inffast.$(OBJECT_SUFFIX)
++
++  OTHER_LDLIBS += -lz
+ else
+   OTHER_CXXFLAGS += -DNO_ZLIB -DUNPACK_JNI
+-  OTHER_LDLIBS += $(JVMLIB)
++  OTHER_LDLIBS += -lz $(JVMLIB)
+ endif
+ 
+ CXXFLAGS_DBG += -DFULL
+@@ -102,12 +100,12 @@
+   COMPILER_WARNINGS_FATAL=false
+ else
+   LDOUTPUT = -o #Have a space 
+-  LDDFLAGS += -lc
++  LDDFLAGS += -lz -lc
+   OTHER_LDLIBS  += $(LIBCXX)
+ # setup the list of libraries to link in...
+ ifeq ($(PLATFORM), linux)
+ ifeq ("$(CC_VER_MAJOR)", "3")
+-  OTHER_LDLIBS  += -Wl,-Bstatic -lgcc_eh -Wl,-Bdynamic
++  OTHER_LDLIBS  += -lz -Wl,-Bstatic -lgcc_eh -Wl,-Bdynamic
+ endif
+ endif #LINUX
+ endif #PLATFORM
+diff -Nru openjdk.orig/jdk/make/common/Program.gmk openjdk/jdk/make/common/Program.gmk
+--- openjdk.orig/jdk/make/common/Program.gmk	2011-02-28 16:06:10.000000000 +0000
++++ openjdk/jdk/make/common/Program.gmk	2012-06-08 11:34:13.879956049 +0100
 @@ -85,7 +85,7 @@
  	endif
      endif
@@ -75,16 +65,88 @@
  	LDFLAGS += -Wl,--allow-shlib-undefined
  	LDFLAGS += -Wl,-rpath -Wl,\$$ORIGIN/../lib/$(LIBARCH)/jli
  	LDFLAGS += -Wl,-rpath -Wl,\$$ORIGIN/../jre/lib/$(LIBARCH)/jli
-@@ -251,7 +251,6 @@
+@@ -229,7 +229,6 @@
  endif
  
  OTHER_INCLUDES += -I$(LAUNCHER_SHARE_SRC)/bin -I$(LAUNCHER_PLATFORM_SRC)/bin
 -OTHER_INCLUDES += -I$(SHARE_SRC)/native/java/util/zip/zlib-1.1.3
  
- # this may not be necessary...
+ OTHER_CPPFLAGS += -DPROGNAME='"$(PROGRAM)"'
+ VERSION_DEFINES += -DFULL_VERSION='"$(FULL_VERSION)"'
+diff -Nru openjdk.orig/jdk/make/java/jli/Makefile openjdk/jdk/make/java/jli/Makefile
+--- openjdk.orig/jdk/make/java/jli/Makefile	2011-02-28 16:06:10.000000000 +0000
++++ openjdk/jdk/make/java/jli/Makefile	2012-06-08 11:34:13.899956377 +0100
+@@ -44,8 +44,6 @@
+ 
+ include $(BUILDDIR)/common/Defs.gmk
+ 
+-ZLIB_VERSION = 1.1.3
+-ZIP_SRC = $(SHARE_SRC)/native/java/util/zip/zlib-$(ZLIB_VERSION)
+ LAUNCHER_SHARE_SRC = $(SHARE_SRC)/bin
+ LAUNCHER_PLATFORM_SRC = $(PLATFORM_SRC)/bin
+ 
+@@ -56,22 +54,14 @@
+ 	parse_manifest.c \
+ 	version_comp.c \
+ 	wildcard.c \
+-	jli_util.c \
+-	inflate.c \
+-	infblock.c \
+-	inftrees.c \
+-	infcodes.c \
+-	inffast.c \
+-	infutil.c \
+-	zadler32.c \
+-	zutil.c
++	jli_util.c
+ 
+ OTHER_CPPFLAGS += -DEXPAND_CLASSPATH_WILDCARDS
+ 
+ ifneq (,$(findstring $(PLATFORM), linux solaris))	# UNIX systems
+ 	LIB_LOCATION = $(LIBDIR)/$(LIBARCH)/jli
+ 	# Guarantee very limited dependencies
+-	LDLIBS = -lc
++	LDLIBS = -lz -lc 
+ endif
+ 
  ifeq ($(PLATFORM), windows)
---- openjdk.old/jdk/make/java/zip/Makefile	2007-10-12 03:54:05.000000000 -0400
-+++ openjdk/jdk/make/java/zip/Makefile	2007-10-22 13:27:01.000000000 -0400
+@@ -98,7 +88,6 @@
+ 
+ OTHER_INCLUDES += -I$(LAUNCHER_SHARE_SRC)
+ OTHER_INCLUDES += -I$(LAUNCHER_PLATFORM_SRC)
+-OTHER_INCLUDES += -I$(ZIP_SRC)
+ 
+ #
+ # Library to compile.
+@@ -139,5 +128,5 @@
+ #
+ # Add to ambient vpath so we pick up the library files
+ #
+-vpath %.c $(LAUNCHER_SHARE_SRC) $(ZIP_SRC)
++vpath %.c $(LAUNCHER_SHARE_SRC)
+ 
+diff -Nru openjdk.orig/jdk/make/java/zip/FILES_c.gmk openjdk/jdk/make/java/zip/FILES_c.gmk
+--- openjdk.orig/jdk/make/java/zip/FILES_c.gmk	2011-02-28 16:06:11.000000000 +0000
++++ openjdk/jdk/make/java/zip/FILES_c.gmk	2012-06-08 11:34:13.879956049 +0100
+@@ -30,15 +30,4 @@
+ 	Inflater.c \
+ 	ZipFile.c \
+ 	ZipEntry.c \
+-	zadler32.c \
+-	zcrc32.c \
+-	deflate.c \
+-	trees.c \
+-	zutil.c \
+-	inflate.c \
+-	infblock.c \
+-	inftrees.c \
+-	infcodes.c \
+-	infutil.c \
+-	inffast.c \
+ 	zip_util.c
+diff -Nru openjdk.orig/jdk/make/java/zip/Makefile openjdk/jdk/make/java/zip/Makefile
+--- openjdk.orig/jdk/make/java/zip/Makefile	2011-02-28 16:06:11.000000000 +0000
++++ openjdk/jdk/make/java/zip/Makefile	2012-06-08 11:34:13.879956049 +0100
 @@ -30,8 +30,6 @@
  PRODUCT = sun
  include $(BUILDDIR)/common/Defs.gmk
@@ -112,49 +174,77 @@
  #
 -OTHER_LDLIBS = $(JVMLIB)
 +OTHER_LDLIBS = $(JVMLIB) -lz
---- openjdk.old/jdk/make/java/zip/FILES_c.gmk	2007-10-12 03:54:05.000000000 -0400
-+++ openjdk/jdk/make/java/zip/FILES_c.gmk	2007-10-22 13:52:53.000000000 -0400
-@@ -30,15 +30,4 @@
- 	Inflater.c \
- 	ZipFile.c \
- 	ZipEntry.c \
--	zadler32.c \
--	zcrc32.c \
--	deflate.c \
--	trees.c \
--	zutil.c \
--	inflate.c \
--	infblock.c \
--	inftrees.c \
--	infcodes.c \
--	infutil.c \
--	inffast.c \
- 	zip_util.c
---- openjdk.old/jdk/src/share/native/java/util/zip/Inflater.c	2007-10-12 04:03:46.000000000 -0400
-+++ openjdk/jdk/src/share/native/java/util/zip/Inflater.c	2007-10-22 15:21:32.000000000 -0400
-@@ -35,7 +35,7 @@
- #include "jni.h"
- #include "jvm.h"
- #include "jni_util.h"
--#include "zlib.h"
-+#include <zlib.h>
- #include "java_util_zip_Inflater.h"
- 
- #define ThrowDataFormatException(env, msg) \
---- openjdk.old/jdk/src/share/native/java/util/zip/zip_util.c	2007-10-12 04:03:46.000000000 -0400
-+++ openjdk/jdk/src/share/native/java/util/zip/zip_util.c	2007-10-23 14:33:18.000000000 -0400
-@@ -44,7 +44,8 @@
- #include "io_util.h"
- #include "io_util_md.h"
- #include "zip_util.h"
--#include "zlib.h"
-+
-+#include <zlib.h>
- 
- /* USE_MMAP means mmap the CEN & ENDHDR part of the zip file. */
- #ifdef USE_MMAP
---- openjdk.old/jdk/make/sun/splashscreen/FILES_c.gmk	2007-10-12 03:54:08.000000000 -0400
-+++ openjdk/jdk/make/sun/splashscreen/FILES_c.gmk	2007-10-23 16:15:48.000000000 -0400
+diff -Nru openjdk.orig/jdk/make/sun/jpeg/FILES_c.gmk openjdk/jdk/make/sun/jpeg/FILES_c.gmk
+--- openjdk.orig/jdk/make/sun/jpeg/FILES_c.gmk	2011-02-28 16:06:11.000000000 +0000
++++ openjdk/jdk/make/sun/jpeg/FILES_c.gmk	2012-06-08 11:34:13.883956114 +0100
+@@ -25,51 +25,7 @@
+ 
+ FILES_c = \
+ 	imageioJPEG.c \
+-	jpegdecoder.c \
+-	jcomapi.c \
+-	jdapimin.c \
+-	jdapistd.c \
+-	jdcoefct.c \
+-	jdcolor.c \
+-	jddctmgr.c \
+-	jdhuff.c \
+-	jdinput.c \
+-	jdmainct.c \
+-	jdmarker.c \
+-	jdmaster.c \
+-	jdmerge.c \
+-	jdphuff.c \
+-	jdpostct.c \
+-	jdsample.c \
+-	jerror.c \
+-	jidctflt.c \
+-	jidctfst.c \
+-	jidctint.c \
+-	jidctred.c \
+-	jmemmgr.c \
+-	jmemnobs.c \
+-	jquant1.c \
+-	jquant2.c \
+-	jutils.c \
+-	jcapimin.c \
+-	jcapistd.c \
+-	jccoefct.c \
+-	jccolor.c \
+-	jcdctmgr.c \
+-	jchuff.c \
+-	jcinit.c \
+-	jcmainct.c \
+-	jcmarker.c \
+-	jcmaster.c \
+-	jcparam.c \
+-	jcphuff.c \
+-	jcprepct.c \
+-	jcsample.c \
+-	jctrans.c \
+-	jdtrans.c \
+-	jfdctflt.c \
+-	jfdctfst.c \
+-	jfdctint.c
++	jpegdecoder.c
+ 
+ ifndef OPENJDK
+ FILES_c += \
+diff -Nru openjdk.orig/jdk/make/sun/jpeg/Makefile openjdk/jdk/make/sun/jpeg/Makefile
+--- openjdk.orig/jdk/make/sun/jpeg/Makefile	2011-02-28 16:06:11.000000000 +0000
++++ openjdk/jdk/make/sun/jpeg/Makefile	2012-06-08 11:34:13.875955983 +0100
+@@ -68,6 +68,8 @@
+ include $(BUILDDIR)/common/Mapfile-vers.gmk
+ include $(BUILDDIR)/common/Library.gmk
+ 
++LDLIBS += -ldl 
++
+ #
+ # Add to ambient vpath to get files in a subdirectory
+ #
+diff -Nru openjdk.orig/jdk/make/sun/splashscreen/FILES_c.gmk openjdk/jdk/make/sun/splashscreen/FILES_c.gmk
+--- openjdk.orig/jdk/make/sun/splashscreen/FILES_c.gmk	2011-02-28 16:06:12.000000000 +0000
++++ openjdk/jdk/make/sun/splashscreen/FILES_c.gmk	2012-06-08 11:34:13.879956049 +0100
 @@ -30,81 +30,5 @@
  	splashscreen_impl.c \
  	splashscreen_jpeg.c \
@@ -238,8 +328,9 @@
 -	jfdctint.c
 +	splashscreen_sys.c 
  
---- openjdk.old/jdk/make/sun/splashscreen/Makefile	2007-10-12 03:54:08.000000000 -0400
-+++ openjdk/jdk/make/sun/splashscreen/Makefile	2007-10-23 16:20:24.000000000 -0400
+diff -Nru openjdk.orig/jdk/make/sun/splashscreen/Makefile openjdk/jdk/make/sun/splashscreen/Makefile
+--- openjdk.orig/jdk/make/sun/splashscreen/Makefile	2011-02-28 16:06:12.000000000 +0000
++++ openjdk/jdk/make/sun/splashscreen/Makefile	2012-06-08 11:34:13.883956114 +0100
 @@ -59,12 +59,12 @@
  # C Flags
  #
@@ -270,65 +361,638 @@
  
  ifeq ($(PLATFORM), linux)
    ifeq ($(ARCH_DATA_MODEL), 64)
-diff -ruN openjdk.old/jdk/make/sun/jpeg/FILES_c.gmk openjdk/jdk/make/sun/jpeg/FILES_c.gmk
---- openjdk.old/jdk/make/sun/jpeg/FILES_c.gmk	2007-10-12 03:54:08.000000000 -0400
-+++ openjdk/jdk/make/sun/jpeg/FILES_c.gmk	2007-10-23 17:13:59.000000000 -0400
-@@ -25,51 +25,7 @@
- 
- FILES_c = \
- 	imageioJPEG.c \
--	jpegdecoder.c \
--	jcomapi.c \
--	jdapimin.c \
--	jdapistd.c \
--	jdcoefct.c \
--	jdcolor.c \
--	jddctmgr.c \
--	jdhuff.c \
--	jdinput.c \
--	jdmainct.c \
--	jdmarker.c \
--	jdmaster.c \
--	jdmerge.c \
--	jdphuff.c \
--	jdpostct.c \
--	jdsample.c \
--	jerror.c \
--	jidctflt.c \
--	jidctfst.c \
--	jidctint.c \
--	jidctred.c \
--	jmemmgr.c \
--	jmemnobs.c \
--	jquant1.c \
--	jquant2.c \
--	jutils.c \
--	jcapimin.c \
--	jcapistd.c \
--	jccoefct.c \
--	jccolor.c \
--	jcdctmgr.c \
--	jchuff.c \
--	jcinit.c \
--	jcmainct.c \
--	jcmarker.c \
--	jcmaster.c \
--	jcparam.c \
--	jcphuff.c \
--	jcprepct.c \
--	jcsample.c \
--	jctrans.c \
--	jdtrans.c \
--	jfdctflt.c \
--	jfdctfst.c \
--	jfdctint.c
-+	jpegdecoder.c
- 
- ifndef OPENJDK
- FILES_c += \
-diff -ruN ..openjdk.old/openjdk/jdk/src/share/native/sun/awt/image/jpeg/jcapimin.c openjdk/jdk/src/share/native/sun/awt/image/jpeg/jcapimin.c
---- ..openjdk.old/openjdk/jdk/src/share/native/sun/awt/image/jpeg/jcapimin.c	2007-10-30 04:38:50.000000000 -0400
-+++ openjdk/jdk/src/share/native/sun/awt/image/jpeg/jcapimin.c	1969-12-31 19:00:00.000000000 -0500
+diff -Nru openjdk.orig/jdk/src/share/native/com/sun/java/util/jar/pack/defines.h openjdk/jdk/src/share/native/com/sun/java/util/jar/pack/defines.h
+--- openjdk.orig/jdk/src/share/native/com/sun/java/util/jar/pack/defines.h	2011-02-28 16:06:44.000000000 +0000
++++ openjdk/jdk/src/share/native/com/sun/java/util/jar/pack/defines.h	2012-06-08 11:34:13.899956377 +0100
+@@ -89,11 +89,7 @@
+ // bytes and byte arrays
+ 
+ typedef unsigned int uint;
+-#ifdef _LP64
+-typedef unsigned int uLong; // Historical zlib, should be 32-bit.
+-#else
+ typedef unsigned long uLong;
+-#endif
+ #ifdef _MSC_VER
+ typedef LONGLONG        jlong;
+ typedef DWORDLONG       julong;
+diff -Nru openjdk.orig/jdk/src/share/native/java/util/zip/Adler32.c openjdk/jdk/src/share/native/java/util/zip/Adler32.c
+--- openjdk.orig/jdk/src/share/native/java/util/zip/Adler32.c	2011-02-28 16:06:45.000000000 +0000
++++ openjdk/jdk/src/share/native/java/util/zip/Adler32.c	2012-06-08 11:34:13.879956049 +0100
+@@ -29,7 +29,7 @@
+ 
+ #include "jni.h"
+ #include "jni_util.h"
+-#include "zlib.h"
++#include <zlib.h>
+ 
+ #include "java_util_zip_Adler32.h"
+ 
+diff -Nru openjdk.orig/jdk/src/share/native/java/util/zip/CRC32.c openjdk/jdk/src/share/native/java/util/zip/CRC32.c
+--- openjdk.orig/jdk/src/share/native/java/util/zip/CRC32.c	2011-02-28 16:06:45.000000000 +0000
++++ openjdk/jdk/src/share/native/java/util/zip/CRC32.c	2012-06-08 11:34:13.879956049 +0100
+@@ -29,7 +29,7 @@
+ 
+ #include "jni.h"
+ #include "jni_util.h"
+-#include "zlib.h"
++#include <zlib.h>
+ 
+ #include "java_util_zip_CRC32.h"
+ 
+diff -Nru openjdk.orig/jdk/src/share/native/java/util/zip/Deflater.c openjdk/jdk/src/share/native/java/util/zip/Deflater.c
+--- openjdk.orig/jdk/src/share/native/java/util/zip/Deflater.c	2011-02-28 16:06:45.000000000 +0000
++++ openjdk/jdk/src/share/native/java/util/zip/Deflater.c	2012-06-08 11:34:13.879956049 +0100
+@@ -32,7 +32,7 @@
+ #include "jlong.h"
+ #include "jni.h"
+ #include "jni_util.h"
+-#include "zlib.h"
++#include <zlib.h>
+ 
+ #include "java_util_zip_Deflater.h"
+ 
+diff -Nru openjdk.orig/jdk/src/share/native/java/util/zip/Inflater.c openjdk/jdk/src/share/native/java/util/zip/Inflater.c
+--- openjdk.orig/jdk/src/share/native/java/util/zip/Inflater.c	2011-02-28 16:06:45.000000000 +0000
++++ openjdk/jdk/src/share/native/java/util/zip/Inflater.c	2012-06-08 11:34:13.879956049 +0100
+@@ -35,7 +35,7 @@
+ #include "jni.h"
+ #include "jvm.h"
+ #include "jni_util.h"
+-#include "zlib.h"
++#include <zlib.h>
+ #include "java_util_zip_Inflater.h"
+ 
+ #define ThrowDataFormatException(env, msg) \
+diff -Nru openjdk.orig/jdk/src/share/native/java/util/zip/zip_util.c openjdk/jdk/src/share/native/java/util/zip/zip_util.c
+--- openjdk.orig/jdk/src/share/native/java/util/zip/zip_util.c	2012-06-08 11:31:31.977300907 +0100
++++ openjdk/jdk/src/share/native/java/util/zip/zip_util.c	2012-06-08 11:34:13.879956049 +0100
+@@ -44,7 +44,8 @@
+ #include "io_util.h"
+ #include "io_util_md.h"
+ #include "zip_util.h"
+-#include "zlib.h"
++
++#include <zlib.h>
+ 
+ /* USE_MMAP means mmap the CEN & ENDHDR part of the zip file. */
+ #ifdef USE_MMAP
+diff -Nru openjdk.orig/jdk/src/share/native/sun/awt/image/jpeg/imageioJPEG.c openjdk/jdk/src/share/native/sun/awt/image/jpeg/imageioJPEG.c
+--- openjdk.orig/jdk/src/share/native/sun/awt/image/jpeg/imageioJPEG.c	2012-06-08 11:31:31.729296840 +0100
++++ openjdk/jdk/src/share/native/sun/awt/image/jpeg/imageioJPEG.c	2012-06-08 11:34:13.903956442 +0100
+@@ -52,7 +52,9 @@
+ 
+ /* headers from the JPEG library */
+ #include <jpeglib.h>
+-#include "jerror.h"
++#include <jerror.h>
++
++#include <dlfcn.h>
+ 
+ #undef MAX
+ #define MAX(a,b)        ((a) > (b) ? (a) : (b))
+@@ -76,6 +78,62 @@
+ static jfieldID JPEGHuffmanTable_lengthsID;
+ static jfieldID JPEGHuffmanTable_valuesID;
+ 
++static void initIDs();
++
++typedef struct jpeg_error_mgr * (*fn_jpegstderror)(struct jpeg_error_mgr *);
++typedef boolean (*fn_jpegresynctorestart)(j_decompress_ptr, int);
++typedef JDIMENSION (*fn_jpegreadscanlines)(j_decompress_ptr, JSAMPARRAY, JDIMENSION);
++typedef boolean (*fn_jpegfinishoutput)(j_decompress_ptr);
++typedef int (*fn_jpegreadheader)(j_decompress_ptr, boolean);
++typedef boolean (*fn_jpegstartdecompress)(j_decompress_ptr);
++typedef boolean (*fn_jpeghasmultiplescans)(j_decompress_ptr);
++typedef boolean (*fn_jpegfinishdecompress)(j_decompress_ptr);
++typedef boolean (*fn_jpegstartoutput)(j_decompress_ptr, int);
++typedef void (*fn_jpegabort)(j_common_ptr);
++typedef void (*fn_jpegabortdecompress)(j_decompress_ptr);
++typedef JHUFF_TBL * (*fn_jpegallochufftable)(j_common_ptr);
++typedef JQUANT_TBL * (*fn_jpegallocquanttable)(j_common_ptr);
++typedef void (*fn_jpegcreatecompress)(j_compress_ptr, int, size_t);
++typedef void (*fn_jpegcreatedecompress)(j_decompress_ptr, int, size_t);
++typedef void (*fn_jpegdestroy)(j_common_ptr);
++typedef void (*fn_jpegfinishcompress)(j_compress_ptr);
++typedef boolean (*fn_jpeginputcomplete)(j_decompress_ptr);
++typedef void (*fn_jpegsavemarkers)(j_decompress_ptr, int, unsigned int);
++typedef void (*fn_jpegsetcolorspace)(j_compress_ptr, J_COLOR_SPACE);
++typedef void (*fn_jpegsetdefaults)(j_compress_ptr);
++typedef void (*fn_jpegsimpleprogression)(j_compress_ptr);
++typedef void (*fn_jpegstartcompress)(j_compress_ptr, boolean);
++typedef void (*fn_jpegsuppresstables)(j_compress_ptr, boolean);
++typedef JDIMENSION (*fn_jpegwritescanlines)(j_compress_ptr, JSAMPARRAY, JDIMENSION);
++typedef void (*fn_jpegwritetables)(j_compress_ptr);
++
++fn_jpegabort jpegabort;
++fn_jpegabortdecompress jpegabortdecompress;
++fn_jpegallochufftable jpegallochufftable;
++fn_jpegallocquanttable jpegallocquanttable;
++fn_jpegcreatecompress jpegcreatecompress;
++fn_jpegcreatedecompress jpegcreatedecompress;
++fn_jpegdestroy jpegdestroy;
++fn_jpegfinishcompress jpegfinishcompress;
++fn_jpeginputcomplete jpeginputcomplete;
++fn_jpegsavemarkers jpegsavemarkers;
++fn_jpegsetcolorspace jpegsetcolorspace;
++fn_jpegsetdefaults jpegsetdefaults;
++fn_jpegsimpleprogression jpegsimpleprogression;
++fn_jpegstartcompress jpegstartcompress;
++fn_jpegsuppresstables jpegsuppresstables;
++fn_jpegwritescanlines jpegwritescanlines;
++fn_jpegwritetables jpegwritetables;
++fn_jpegstderror jpegstderror;
++fn_jpegstartoutput jpegstartoutput;
++fn_jpegfinishdecompress jpegfinishdecompress;
++fn_jpeghasmultiplescans jpeghasmultiplescans;
++fn_jpegstartdecompress jpegstartdecompress;
++fn_jpegreadheader jpegreadheader;
++fn_jpegfinishoutput jpegfinishoutput;
++fn_jpegreadscanlines jpegreadscanlines;
++fn_jpegresynctorestart jpegresynctorestart;
++
+ /*
+  * Defined in jpegdecoder.c.  Copy code from there if and
+  * when that disappears. */
+@@ -619,7 +677,7 @@
+         return;
+     }
+ 
+-    jpeg_abort(cinfo);  // Frees any markers, but not tables
++    jpegabort(cinfo);  // Frees any markers, but not tables
+ 
+ }
+ 
+@@ -644,7 +702,7 @@
+         return;
+     }
+ 
+-    jpeg_abort(cinfo);  // Does not reset tables
++    jpegabort(cinfo);  // Does not reset tables
+ 
+ }
+ 
+@@ -662,7 +720,7 @@
+             free(cinfo->dest);
+             cinfo->dest = NULL;
+         }
+-        jpeg_destroy(info);
++        jpegdestroy(info);
+         free(info);
+     }
+ }
+@@ -702,14 +760,14 @@
+             decomp = (j_decompress_ptr) cinfo;
+             if (decomp->quant_tbl_ptrs[i] == NULL) {
+                 decomp->quant_tbl_ptrs[i] =
+-                    jpeg_alloc_quant_table(cinfo);
++                    jpegallocquanttable(cinfo);
+             }
+             quant_ptr = decomp->quant_tbl_ptrs[i];
+         } else {
+             comp = (j_compress_ptr) cinfo;
+             if (comp->quant_tbl_ptrs[i] == NULL) {
+                 comp->quant_tbl_ptrs[i] =
+-                    jpeg_alloc_quant_table(cinfo);
++                    jpegallocquanttable(cinfo);
+             }
+             quant_ptr = comp->quant_tbl_ptrs[i];
+         }
+@@ -800,14 +858,14 @@
+             decomp = (j_decompress_ptr) cinfo;
+             if (decomp->dc_huff_tbl_ptrs[i] == NULL) {
+                 decomp->dc_huff_tbl_ptrs[i] =
+-                    jpeg_alloc_huff_table(cinfo);
++                    jpegallochufftable(cinfo);
+             }
+             huff_ptr = decomp->dc_huff_tbl_ptrs[i];
+         } else {
+             comp = (j_compress_ptr) cinfo;
+             if (comp->dc_huff_tbl_ptrs[i] == NULL) {
+                 comp->dc_huff_tbl_ptrs[i] =
+-                    jpeg_alloc_huff_table(cinfo);
++                    jpegallochufftable(cinfo);
+             }
+             huff_ptr = comp->dc_huff_tbl_ptrs[i];
+         }
+@@ -825,14 +883,14 @@
+             decomp = (j_decompress_ptr) cinfo;
+             if (decomp->ac_huff_tbl_ptrs[i] == NULL) {
+                 decomp->ac_huff_tbl_ptrs[i] =
+-                    jpeg_alloc_huff_table(cinfo);
++                    jpegallochufftable(cinfo);
+             }
+             huff_ptr = decomp->ac_huff_tbl_ptrs[i];
+         } else {
+             comp = (j_compress_ptr) cinfo;
+             if (comp->ac_huff_tbl_ptrs[i] == NULL) {
+                 comp->ac_huff_tbl_ptrs[i] =
+-                    jpeg_alloc_huff_table(cinfo);
++                    jpegallochufftable(cinfo);
+             }
+             huff_ptr = comp->ac_huff_tbl_ptrs[i];
+         }
+@@ -1373,6 +1431,8 @@
+      jclass ImageInputStreamClass,
+      jclass qTableClass,
+      jclass huffClass) {
++   
++    initIDs();
+ 
+     ImageInputStream_readID = (*env)->GetMethodID(env,
+                                                   ImageInputStreamClass,
+@@ -1458,7 +1518,7 @@
+     }
+ 
+     /* We set up the normal JPEG error routines, then override error_exit. */
+-    cinfo->err = jpeg_std_error(&(jerr->pub));
++    cinfo->err = jpegstderror(&(jerr->pub));
+     jerr->pub.error_exit = sun_jpeg_error_exit;
+     /* We need to setup our own print routines */
+     jerr->pub.output_message = sun_jpeg_output_message;
+@@ -1475,11 +1535,11 @@
+     }
+ 
+     /* Perform library initialization */
+-    jpeg_create_decompress(cinfo);
++    jpegcreatedecompress(cinfo, JPEG_LIB_VERSION, (size_t) sizeof(struct jpeg_decompress_struct));
+ 
+     // Set up to keep any APP2 markers, as these might contain ICC profile
+     // data
+-    jpeg_save_markers(cinfo, ICC_MARKER, 0xFFFF);
++    jpegsavemarkers(cinfo, ICC_MARKER, 0xFFFF);
+ 
+     /*
+      * Now set up our source.
+@@ -1497,7 +1557,7 @@
+     cinfo->src->init_source = imageio_init_source;
+     cinfo->src->fill_input_buffer = imageio_fill_input_buffer;
+     cinfo->src->skip_input_data = imageio_skip_input_data;
+-    cinfo->src->resync_to_restart = jpeg_resync_to_restart; // use default
++    cinfo->src->resync_to_restart = jpegresynctorestart; // use default
+     cinfo->src->term_source = imageio_term_source;
+ 
+     /* set up the association to persist for future calls */
+@@ -1615,7 +1675,7 @@
+         src->bytes_in_buffer = 0;
+     }
+ 
+-    ret = jpeg_read_header(cinfo, FALSE);
++    ret = jpegreadheader(cinfo, FALSE);
+ 
+     if (ret == JPEG_HEADER_TABLES_ONLY) {
+         retval = JNI_TRUE;
+@@ -1736,7 +1796,7 @@
+                                cinfo->num_components,
+                                read_icc_profile(env, cinfo));
+         if (reset) {
+-            jpeg_abort_decompress(cinfo);
++            jpegabortdecompress(cinfo);
+         }
+     }
+ 
+@@ -1976,7 +2036,7 @@
+                    TRUE);
+     }
+ 
+-    progressive = jpeg_has_multiple_scans(cinfo);
++    progressive = jpeghasmultiplescans(cinfo);
+     if (progressive) {
+         cinfo->buffered_image = TRUE;
+         cinfo->input_scan_number = minProgressivePass+1; // Java count from 0
+@@ -1988,7 +2048,7 @@
+ 
+     data->streamBuf.suspendable = FALSE;
+ 
+-    jpeg_start_decompress(cinfo);
++    jpegstartdecompress(cinfo);
+ 
+     // loop over progressive passes
+     done = FALSE;
+@@ -1996,7 +2056,7 @@
+         if (progressive) {
+             // initialize the next pass.  Note that this skips up to
+             // the first interesting pass.
+-            jpeg_start_output(cinfo, cinfo->input_scan_number);
++            jpegstartoutput(cinfo, cinfo->input_scan_number);
+             if (wantUpdates) {
+                 (*env)->CallVoidMethod(env, this,
+                                        JPEGImageReader_passStartedID,
+@@ -2012,7 +2072,7 @@
+         // Skip until the first interesting line
+         while ((data->abortFlag == JNI_FALSE)
+                && ((jint)cinfo->output_scanline < sourceYStart)) {
+-            jpeg_read_scanlines(cinfo, &scanLinePtr, 1);
++            jpegreadscanlines(cinfo, &scanLinePtr, 1);
+         }
+ 
+         scanlineLimit = sourceYStart+sourceHeight;
+@@ -2025,7 +2085,7 @@
+         while ((data->abortFlag == JNI_FALSE)
+                && ((jint)cinfo->output_scanline < scanlineLimit)) {
+ 
+-            jpeg_read_scanlines(cinfo, &scanLinePtr, 1);
++            jpegreadscanlines(cinfo, &scanLinePtr, 1);
+ 
+             // Now mangle it into our buffer
+             out = data->pixelBuf.buf.bp;
+@@ -2087,13 +2147,13 @@
+                 skipLines = linesLeft;
+             }
+             for(i = 0; i < skipLines; i++) {
+-                jpeg_read_scanlines(cinfo, &scanLinePtr, 1);
++                jpegreadscanlines(cinfo, &scanLinePtr, 1);
+             }
+         }
+         if (progressive) {
+-            jpeg_finish_output(cinfo); // Increments pass counter
++            jpegfinishoutput(cinfo); // Increments pass counter
+             // Call Java to notify pass complete
+-            if (jpeg_input_complete(cinfo)
++            if (jpeginputcomplete(cinfo)
+                 || (cinfo->input_scan_number > maxProgressivePass)) {
+                 done = TRUE;
+             }
+@@ -2113,9 +2173,9 @@
+     if (cinfo->output_scanline == cinfo->output_height) {
+         //    if ((cinfo->output_scanline == cinfo->output_height) &&
+         //(jpeg_input_complete(cinfo))) {  // We read the whole file
+-        jpeg_finish_decompress(cinfo);
++        jpegfinishdecompress(cinfo);
+     } else {
+-        jpeg_abort_decompress(cinfo);
++        jpegabortdecompress(cinfo);
+     }
+ 
+     free(scanLinePtr);
+@@ -2161,7 +2221,7 @@
+ 
+     cinfo = (j_decompress_ptr) data->jpegObj;
+ 
+-    jpeg_abort_decompress(cinfo);
++    jpegabortdecompress(cinfo);
+ }
+ 
+ 
+@@ -2367,6 +2427,150 @@
+ 
+ /********************** end of destination manager ************/
+ 
++METHODDEF(void)
++initIDs()
++{
++#if JPEG_LIB_VERSION >= 80
++    void *handle = dlopen("libjpeg.so.8", RTLD_LAZY | RTLD_GLOBAL);
++#else
++#if JPEG_LIB_VERSION >= 70
++    void *handle = dlopen("libjpeg.so.7", RTLD_LAZY | RTLD_GLOBAL);
++#else
++    void *handle = dlopen("libjpeg.so.62", RTLD_LAZY | RTLD_GLOBAL);
++#endif
++#endif
++    
++    jpegstderror = (fn_jpegstderror)dlsym(handle, "jpeg_std_error");
++    if (jpegstderror == NULL) {
++       dlclose(handle);
++    }
++
++    jpegreadheader = (fn_jpegreadheader)dlsym(handle, "jpeg_read_header");
++    if (jpegreadheader == NULL) {
++       dlclose(handle);
++    }
++
++    jpeghasmultiplescans = (fn_jpeghasmultiplescans)dlsym(handle, "jpeg_has_multiple_scans");
++    if (jpeghasmultiplescans == NULL) {
++       dlclose(handle);
++    }
++
++    jpegstartdecompress = (fn_jpegstartdecompress)dlsym(handle, "jpeg_start_decompress");
++    if (jpegstartdecompress == NULL) {
++       dlclose(handle);
++    }
++
++    jpegstartoutput = (fn_jpegstartoutput)dlsym(handle, "jpeg_start_output");
++    if (jpegstartoutput == NULL) {
++       dlclose(handle);
++    }
++
++    jpegfinishdecompress = (fn_jpegfinishdecompress)dlsym(handle, "jpeg_finish_decompress");
++    if (jpegfinishdecompress == NULL) {
++       dlclose(handle);
++    }
++
++    jpegreadscanlines = (fn_jpegreadscanlines)dlsym(handle, "jpeg_read_scanlines");
++    if (jpegreadscanlines == NULL) {
++       dlclose(handle);
++    }
++
++    jpegfinishoutput = (fn_jpegfinishoutput)dlsym(handle, "jpeg_finish_output");
++    if (jpegfinishoutput == NULL) {
++       dlclose(handle);
++    }
++
++    jpegresynctorestart = (fn_jpegresynctorestart)dlsym(handle, "jpeg_resync_to_restart");
++    if (jpegresynctorestart == NULL) {
++       dlclose(handle);
++    }
++
++    jpegabort = (fn_jpegabort)dlsym(handle, "jpeg_abort");
++    if (jpegabort == NULL) {
++       dlclose(handle);
++    }
++ 
++    jpegabortdecompress = (fn_jpegabortdecompress)dlsym(handle, "jpeg_abort_decompress");
++    if (jpegabortdecompress == NULL) {
++       dlclose(handle);
++    }
++
++    jpegallochufftable = (fn_jpegallochufftable)dlsym(handle, "jpeg_alloc_huff_table");
++    if (jpegallochufftable == NULL) {
++       dlclose(handle);
++    }
++
++    jpegallocquanttable = (fn_jpegallocquanttable)dlsym(handle, "jpeg_alloc_quant_table");
++    if (jpegallocquanttable == NULL) {
++       dlclose(handle);
++    }
++
++    jpegcreatecompress = (fn_jpegcreatecompress)dlsym(handle, "jpeg_CreateCompress");
++    if (jpegcreatecompress == NULL) {
++       dlclose(handle);
++    }
++
++    jpegcreatedecompress = (fn_jpegcreatedecompress)dlsym(handle, "jpeg_CreateDecompress");
++    if (jpegcreatedecompress == NULL) {
++       dlclose(handle);
++    }
++
++    jpegdestroy = (fn_jpegdestroy)dlsym(handle, "jpeg_destroy");
++    if (jpegdestroy == NULL) {
++       dlclose(handle);
++    }
++
++    jpegfinishcompress = (fn_jpegfinishcompress)dlsym(handle, "jpeg_finish_compress");
++    if (jpegfinishcompress == NULL) {
++       dlclose(handle);
++    }
++
++    jpeginputcomplete = (fn_jpeginputcomplete)dlsym(handle, "jpeg_input_complete");
++    if (jpeginputcomplete == NULL) {
++       dlclose(handle);
++    }
++
++    jpegsavemarkers = (fn_jpegsavemarkers)dlsym(handle, "jpeg_save_markers");
++    if (jpegsavemarkers == NULL) {
++       dlclose(handle);
++    }
++
++    jpegsetcolorspace = (fn_jpegsetcolorspace)dlsym(handle, "jpeg_set_colorspace");
++    if (jpegsetcolorspace == NULL) {
++       dlclose(handle);
++    }
++
++    jpegsetdefaults = (fn_jpegsetdefaults)dlsym(handle, "jpeg_set_defaults");
++    if (jpegsetdefaults == NULL) {
++       dlclose(handle);
++    }
++
++    jpegsimpleprogression = (fn_jpegsimpleprogression)dlsym(handle, "jpeg_simple_progression");
++    if (jpegsimpleprogression == NULL) {
++       dlclose(handle);
++    }
++
++    jpegstartcompress = (fn_jpegstartcompress)dlsym(handle, "jpeg_start_compress");
++    if (jpegstartcompress == NULL) {
++       dlclose(handle);
++    }
++
++    jpegsuppresstables = (fn_jpegsuppresstables)dlsym(handle, "jpeg_suppress_tables");
++    if (jpegsuppresstables == NULL) {
++       dlclose(handle);
++    }
++
++    jpegwritescanlines = (fn_jpegwritescanlines)dlsym(handle, "jpeg_write_scanlines");
++    if (jpegwritescanlines == NULL) {
++       dlclose(handle);
++    }
++
++    jpegwritetables = (fn_jpegwritetables)dlsym(handle, "jpeg_write_tables");
++    if (jpegwritetables == NULL) {
++       dlclose(handle);
++    }
++}
++
+ /********************** Writer JNI calls **********************/
+ 
+ 
+@@ -2378,6 +2582,8 @@
+      jclass qTableClass,
+      jclass huffClass) {
+ 
++    initIDs();
++
+     ImageOutputStream_writeID = (*env)->GetMethodID(env,
+                                                     IOSClass,
+                                                     "write",
+@@ -2451,7 +2657,7 @@
+     }
+ 
+     /* We set up the normal JPEG error routines, then override error_exit. */
+-    cinfo->err = jpeg_std_error(&(jerr->pub));
++    cinfo->err = jpegstderror(&(jerr->pub));
+     jerr->pub.error_exit = sun_jpeg_error_exit;
+     /* We need to setup our own print routines */
+     jerr->pub.output_message = sun_jpeg_output_message;
+@@ -2468,7 +2674,7 @@
+     }
+ 
+     /* Perform library initialization */
+-    jpeg_create_compress(cinfo);
++    jpegcreatecompress(cinfo, JPEG_LIB_VERSION, (size_t) sizeof(struct jpeg_compress_struct));
+ 
+     /* Now set up the destination  */
+     dest = malloc(sizeof(struct jpeg_destination_mgr));
+@@ -2577,7 +2783,7 @@
+         return;
+     }
+ 
+-    jpeg_suppress_tables(cinfo, TRUE);  // Suppress writing of any current
++    jpegsuppresstables(cinfo, TRUE);  // Suppress writing of any current
+ 
+     data->streamBuf.suspendable = FALSE;
+     if (qtables != NULL) {
+@@ -2592,7 +2798,7 @@
+                    DCHuffmanTables, ACHuffmanTables, TRUE);
+     }
+ 
+-    jpeg_write_tables(cinfo); // Flushes the buffer for you
++    jpegwritetables(cinfo); // Flushes the buffer for you
+     RELEASE_ARRAYS(env, data, NULL);
+ }
+ 
+@@ -2756,9 +2962,9 @@
+     cinfo->input_components = numBands;
+     cinfo->in_color_space = inCs;
+ 
+-    jpeg_set_defaults(cinfo);
++    jpegsetdefaults(cinfo);
+ 
+-    jpeg_set_colorspace(cinfo, outCs);
++    jpegsetcolorspace(cinfo, outCs);
+ 
+     cinfo->optimize_coding = optimize;
+ 
+@@ -2795,7 +3001,7 @@
+     (*env)->ReleaseIntArrayElements(env, QtableSelectors,
+                                     qsels, JNI_ABORT);
+ 
+-    jpeg_suppress_tables(cinfo, TRUE);  // Disable writing any current
++    jpegsuppresstables(cinfo, TRUE);  // Disable writing any current
+ 
+     qlen = setQTables(env, (j_common_ptr) cinfo, qtables, writeDQT);
+ 
+@@ -2820,7 +3026,7 @@
+ 
+     if (progressive) {
+         if (numScans == 0) { // then use default scans
+-            jpeg_simple_progression(cinfo);
++            jpegsimpleprogression(cinfo);
+         } else {
+             cinfo->num_scans = numScans;
+             // Copy the scanInfo to a local array
+@@ -2862,7 +3068,7 @@
+ #endif
+ 
+     // start the compressor; tables must already be set
+-    jpeg_start_compress(cinfo, FALSE); // Leaves sent_table alone
++    jpegstartcompress(cinfo, FALSE); // Leaves sent_table alone
+ 
+     if (haveMetadata) {
+         // Flush the buffer
+@@ -2928,7 +3134,7 @@
+           }
+         }
+         // write it out
+-        jpeg_write_scanlines(cinfo, (JSAMPARRAY)&scanLinePtr, 1);
++        jpegwritescanlines(cinfo, (JSAMPARRAY)&scanLinePtr, 1);
+         targetLine += stepY;
+     }
+ 
+@@ -2937,9 +3143,9 @@
+      * so use jpeg_abort instead of jpeg_finish_compress.
+      */
+     if (cinfo->next_scanline == cinfo->image_height) {
+-        jpeg_finish_compress(cinfo);  // Flushes buffer with term_dest
++        jpegfinishcompress(cinfo);  // Flushes buffer with term_dest
+     } else {
+-        jpeg_abort((j_common_ptr)cinfo);
++        jpegabort((j_common_ptr)cinfo);
+     }
+     free(scanLinePtr);
+     RELEASE_ARRAYS(env, data, NULL);
+diff -Nru openjdk.orig/jdk/src/share/native/sun/awt/image/jpeg/jcapimin.c openjdk/jdk/src/share/native/sun/awt/image/jpeg/jcapimin.c
+--- openjdk.orig/jdk/src/share/native/sun/awt/image/jpeg/jcapimin.c	2011-02-28 16:06:45.000000000 +0000
++++ openjdk/jdk/src/share/native/sun/awt/image/jpeg/jcapimin.c	1970-01-01 01:00:00.000000000 +0100
 @@ -1,284 +0,0 @@
 -/*
 - * reserved comment block
@@ -614,9 +1278,9 @@
 -   * each call to jpeg_write_tables().
 -   */
 -}
-diff -ruN ..openjdk.old/openjdk/jdk/src/share/native/sun/awt/image/jpeg/jcapistd.c openjdk/jdk/src/share/native/sun/awt/image/jpeg/jcapistd.c
---- ..openjdk.old/openjdk/jdk/src/share/native/sun/awt/image/jpeg/jcapistd.c	2007-10-30 04:38:51.000000000 -0400
-+++ openjdk/jdk/src/share/native/sun/awt/image/jpeg/jcapistd.c	1969-12-31 19:00:00.000000000 -0500
+diff -Nru openjdk.orig/jdk/src/share/native/sun/awt/image/jpeg/jcapistd.c openjdk/jdk/src/share/native/sun/awt/image/jpeg/jcapistd.c
+--- openjdk.orig/jdk/src/share/native/sun/awt/image/jpeg/jcapistd.c	2011-02-28 16:06:45.000000000 +0000
++++ openjdk/jdk/src/share/native/sun/awt/image/jpeg/jcapistd.c	1970-01-01 01:00:00.000000000 +0100
 @@ -1,165 +0,0 @@
 -/*
 - * reserved comment block
@@ -783,9 +1447,9 @@
 -  cinfo->next_scanline += lines_per_iMCU_row;
 -  return lines_per_iMCU_row;
 -}
-diff -ruN ..openjdk.old/openjdk/jdk/src/share/native/sun/awt/image/jpeg/jccoefct.c openjdk/jdk/src/share/native/sun/awt/image/jpeg/jccoefct.c
---- ..openjdk.old/openjdk/jdk/src/share/native/sun/awt/image/jpeg/jccoefct.c	2007-10-30 04:38:51.000000000 -0400
-+++ openjdk/jdk/src/share/native/sun/awt/image/jpeg/jccoefct.c	1969-12-31 19:00:00.000000000 -0500
+diff -Nru openjdk.orig/jdk/src/share/native/sun/awt/image/jpeg/jccoefct.c openjdk/jdk/src/share/native/sun/awt/image/jpeg/jccoefct.c
+--- openjdk.orig/jdk/src/share/native/sun/awt/image/jpeg/jccoefct.c	2011-02-28 16:06:45.000000000 +0000
++++ openjdk/jdk/src/share/native/sun/awt/image/jpeg/jccoefct.c	1970-01-01 01:00:00.000000000 +0100
 @@ -1,453 +0,0 @@
 -/*
 - * reserved comment block
@@ -1240,9 +1904,9 @@
 -    coef->whole_image[0] = NULL; /* flag for no virtual arrays */
 -  }
 -}
-diff -ruN ..openjdk.old/openjdk/jdk/src/share/native/sun/awt/image/jpeg/jccolor.c openjdk/jdk/src/share/native/sun/awt/image/jpeg/jccolor.c
---- ..openjdk.old/openjdk/jdk/src/share/native/sun/awt/image/jpeg/jccolor.c	2007-10-30 04:38:51.000000000 -0400
-+++ openjdk/jdk/src/share/native/sun/awt/image/jpeg/jccolor.c	1969-12-31 19:00:00.000000000 -0500
+diff -Nru openjdk.orig/jdk/src/share/native/sun/awt/image/jpeg/jccolor.c openjdk/jdk/src/share/native/sun/awt/image/jpeg/jccolor.c
+--- openjdk.orig/jdk/src/share/native/sun/awt/image/jpeg/jccolor.c	2011-02-28 16:06:45.000000000 +0000
++++ openjdk/jdk/src/share/native/sun/awt/image/jpeg/jccolor.c	1970-01-01 01:00:00.000000000 +0100
 @@ -1,462 +0,0 @@
 -/*
 - * reserved comment block
@@ -1706,9 +2370,9 @@
 -    break;
 -  }
 -}
-diff -ruN ..openjdk.old/openjdk/jdk/src/share/native/sun/awt/image/jpeg/jcdctmgr.c openjdk/jdk/src/share/native/sun/awt/image/jpeg/jcdctmgr.c
---- ..openjdk.old/openjdk/jdk/src/share/native/sun/awt/image/jpeg/jcdctmgr.c	2007-10-30 04:38:51.000000000 -0400
-+++ openjdk/jdk/src/share/native/sun/awt/image/jpeg/jcdctmgr.c	1969-12-31 19:00:00.000000000 -0500
+diff -Nru openjdk.orig/jdk/src/share/native/sun/awt/image/jpeg/jcdctmgr.c openjdk/jdk/src/share/native/sun/awt/image/jpeg/jcdctmgr.c
+--- openjdk.orig/jdk/src/share/native/sun/awt/image/jpeg/jcdctmgr.c	2011-02-28 16:06:45.000000000 +0000
++++ openjdk/jdk/src/share/native/sun/awt/image/jpeg/jcdctmgr.c	1970-01-01 01:00:00.000000000 +0100
 @@ -1,391 +0,0 @@
 -/*
 - * reserved comment block
@@ -2101,9 +2765,9 @@
 -#endif
 -  }
 -}
-diff -ruN ..openjdk.old/openjdk/jdk/src/share/native/sun/awt/image/jpeg/jchuff.c openjdk/jdk/src/share/native/sun/awt/image/jpeg/jchuff.c
---- ..openjdk.old/openjdk/jdk/src/share/native/sun/awt/image/jpeg/jchuff.c	2007-10-30 04:38:51.000000000 -0400
-+++ openjdk/jdk/src/share/native/sun/awt/image/jpeg/jchuff.c	1969-12-31 19:00:00.000000000 -0500
+diff -Nru openjdk.orig/jdk/src/share/native/sun/awt/image/jpeg/jchuff.c openjdk/jdk/src/share/native/sun/awt/image/jpeg/jchuff.c
+--- openjdk.orig/jdk/src/share/native/sun/awt/image/jpeg/jchuff.c	2011-02-28 16:06:45.000000000 +0000
++++ openjdk/jdk/src/share/native/sun/awt/image/jpeg/jchuff.c	1970-01-01 01:00:00.000000000 +0100
 @@ -1,913 +0,0 @@
 -/*
 - * reserved comment block
@@ -3018,9 +3682,9 @@
 -#endif
 -  }
 -}
-diff -ruN ..openjdk.old/openjdk/jdk/src/share/native/sun/awt/image/jpeg/jchuff.h openjdk/jdk/src/share/native/sun/awt/image/jpeg/jchuff.h
---- ..openjdk.old/openjdk/jdk/src/share/native/sun/awt/image/jpeg/jchuff.h	2007-10-30 04:38:51.000000000 -0400
-+++ openjdk/jdk/src/share/native/sun/awt/image/jpeg/jchuff.h	1969-12-31 19:00:00.000000000 -0500
+diff -Nru openjdk.orig/jdk/src/share/native/sun/awt/image/jpeg/jchuff.h openjdk/jdk/src/share/native/sun/awt/image/jpeg/jchuff.h
+--- openjdk.orig/jdk/src/share/native/sun/awt/image/jpeg/jchuff.h	2011-02-28 16:06:45.000000000 +0000
++++ openjdk/jdk/src/share/native/sun/awt/image/jpeg/jchuff.h	1970-01-01 01:00:00.000000000 +0100
 @@ -1,51 +0,0 @@
 -/*
 - * reserved comment block
@@ -3073,9 +3737,9 @@
 -/* Generate an optimal table definition given the specified counts */
 -EXTERN(void) jpeg_gen_optimal_table
 -        JPP((j_compress_ptr cinfo, JHUFF_TBL * htbl, long freq[]));
-diff -ruN ..openjdk.old/openjdk/jdk/src/share/native/sun/awt/image/jpeg/jcinit.c openjdk/jdk/src/share/native/sun/awt/image/jpeg/jcinit.c
---- ..openjdk.old/openjdk/jdk/src/share/native/sun/awt/image/jpeg/jcinit.c	2007-10-30 04:38:51.000000000 -0400
-+++ openjdk/jdk/src/share/native/sun/awt/image/jpeg/jcinit.c	1969-12-31 19:00:00.000000000 -0500
+diff -Nru openjdk.orig/jdk/src/share/native/sun/awt/image/jpeg/jcinit.c openjdk/jdk/src/share/native/sun/awt/image/jpeg/jcinit.c
+--- openjdk.orig/jdk/src/share/native/sun/awt/image/jpeg/jcinit.c	2011-02-28 16:06:45.000000000 +0000
++++ openjdk/jdk/src/share/native/sun/awt/image/jpeg/jcinit.c	1970-01-01 01:00:00.000000000 +0100
 @@ -1,76 +0,0 @@
 -/*
 - * reserved comment block
@@ -3153,9 +3817,9 @@
 -   */
 -  (*cinfo->marker->write_file_header) (cinfo);
 -}
-diff -ruN ..openjdk.old/openjdk/jdk/src/share/native/sun/awt/image/jpeg/jcmainct.c openjdk/jdk/src/share/native/sun/awt/image/jpeg/jcmainct.c
---- ..openjdk.old/openjdk/jdk/src/share/native/sun/awt/image/jpeg/jcmainct.c	2007-10-30 04:38:51.000000000 -0400
-+++ openjdk/jdk/src/share/native/sun/awt/image/jpeg/jcmainct.c	1969-12-31 19:00:00.000000000 -0500
+diff -Nru openjdk.orig/jdk/src/share/native/sun/awt/image/jpeg/jcmainct.c openjdk/jdk/src/share/native/sun/awt/image/jpeg/jcmainct.c
+--- openjdk.orig/jdk/src/share/native/sun/awt/image/jpeg/jcmainct.c	2011-02-28 16:06:45.000000000 +0000
++++ openjdk/jdk/src/share/native/sun/awt/image/jpeg/jcmainct.c	1970-01-01 01:00:00.000000000 +0100
 @@ -1,297 +0,0 @@
 -/*
 - * reserved comment block
@@ -3454,9 +4118,9 @@
 -    }
 -  }
 -}
-diff -ruN ..openjdk.old/openjdk/jdk/src/share/native/sun/awt/image/jpeg/jcmarker.c openjdk/jdk/src/share/native/sun/awt/image/jpeg/jcmarker.c
---- ..openjdk.old/openjdk/jdk/src/share/native/sun/awt/image/jpeg/jcmarker.c	2007-10-30 04:38:51.000000000 -0400
-+++ openjdk/jdk/src/share/native/sun/awt/image/jpeg/jcmarker.c	1969-12-31 19:00:00.000000000 -0500
+diff -Nru openjdk.orig/jdk/src/share/native/sun/awt/image/jpeg/jcmarker.c openjdk/jdk/src/share/native/sun/awt/image/jpeg/jcmarker.c
+--- openjdk.orig/jdk/src/share/native/sun/awt/image/jpeg/jcmarker.c	2011-02-28 16:06:45.000000000 +0000
++++ openjdk/jdk/src/share/native/sun/awt/image/jpeg/jcmarker.c	1970-01-01 01:00:00.000000000 +0100
 @@ -1,682 +0,0 @@
 -/*
 - * reserved comment block
@@ -4140,9 +4804,9 @@
 -  /* Initialize private state */
 -  marker->last_restart_interval = 0;
 -}
-diff -ruN ..openjdk.old/openjdk/jdk/src/share/native/sun/awt/image/jpeg/jcmaster.c openjdk/jdk/src/share/native/sun/awt/image/jpeg/jcmaster.c
---- ..openjdk.old/openjdk/jdk/src/share/native/sun/awt/image/jpeg/jcmaster.c	2007-10-30 04:38:51.000000000 -0400
-+++ openjdk/jdk/src/share/native/sun/awt/image/jpeg/jcmaster.c	1969-12-31 19:00:00.000000000 -0500
+diff -Nru openjdk.orig/jdk/src/share/native/sun/awt/image/jpeg/jcmaster.c openjdk/jdk/src/share/native/sun/awt/image/jpeg/jcmaster.c
+--- openjdk.orig/jdk/src/share/native/sun/awt/image/jpeg/jcmaster.c	2011-02-28 16:06:45.000000000 +0000
++++ openjdk/jdk/src/share/native/sun/awt/image/jpeg/jcmaster.c	1970-01-01 01:00:00.000000000 +0100
 @@ -1,594 +0,0 @@
 -/*
 - * reserved comment block
@@ -4738,9 +5402,9 @@
 -  else
 -    master->total_passes = cinfo->num_scans;
 -}
-diff -ruN ..openjdk.old/openjdk/jdk/src/share/native/sun/awt/image/jpeg/jcomapi.c openjdk/jdk/src/share/native/sun/awt/image/jpeg/jcomapi.c
---- ..openjdk.old/openjdk/jdk/src/share/native/sun/awt/image/jpeg/jcomapi.c	2007-10-30 04:38:51.000000000 -0400
-+++ openjdk/jdk/src/share/native/sun/awt/image/jpeg/jcomapi.c	1969-12-31 19:00:00.000000000 -0500
+diff -Nru openjdk.orig/jdk/src/share/native/sun/awt/image/jpeg/jcomapi.c openjdk/jdk/src/share/native/sun/awt/image/jpeg/jcomapi.c
+--- openjdk.orig/jdk/src/share/native/sun/awt/image/jpeg/jcomapi.c	2011-02-28 16:06:45.000000000 +0000
++++ openjdk/jdk/src/share/native/sun/awt/image/jpeg/jcomapi.c	1970-01-01 01:00:00.000000000 +0100
 @@ -1,110 +0,0 @@
 -/*
 - * reserved comment block
@@ -4852,9 +5516,9 @@
 -  tbl->sent_table = FALSE;      /* make sure this is false in any new table */
 -  return tbl;
 -}
-diff -ruN ..openjdk.old/openjdk/jdk/src/share/native/sun/awt/image/jpeg/jconfig.h openjdk/jdk/src/share/native/sun/awt/image/jpeg/jconfig.h
---- ..openjdk.old/openjdk/jdk/src/share/native/sun/awt/image/jpeg/jconfig.h	2007-10-30 04:38:51.000000000 -0400
-+++ openjdk/jdk/src/share/native/sun/awt/image/jpeg/jconfig.h	1969-12-31 19:00:00.000000000 -0500
+diff -Nru openjdk.orig/jdk/src/share/native/sun/awt/image/jpeg/jconfig.h openjdk/jdk/src/share/native/sun/awt/image/jpeg/jconfig.h
+--- openjdk.orig/jdk/src/share/native/sun/awt/image/jpeg/jconfig.h	2011-02-28 16:06:45.000000000 +0000
++++ openjdk/jdk/src/share/native/sun/awt/image/jpeg/jconfig.h	1970-01-01 01:00:00.000000000 +0100
 @@ -1,43 +0,0 @@
 -/* jconfig.cfg --- source file edited by configure script */
 -/* see jconfig.doc for explanations */
@@ -4899,9 +5563,9 @@
 -#undef PROGRESS_REPORT
 -
 -#endif /* JPEG_CJPEG_DJPEG */
-diff -ruN ..openjdk.old/openjdk/jdk/src/share/native/sun/awt/image/jpeg/jcparam.c openjdk/jdk/src/share/native/sun/awt/image/jpeg/jcparam.c
---- ..openjdk.old/openjdk/jdk/src/share/native/sun/awt/image/jpeg/jcparam.c	2007-10-30 04:38:51.000000000 -0400
-+++ openjdk/jdk/src/share/native/sun/awt/image/jpeg/jcparam.c	1969-12-31 19:00:00.000000000 -0500
+diff -Nru openjdk.orig/jdk/src/share/native/sun/awt/image/jpeg/jcparam.c openjdk/jdk/src/share/native/sun/awt/image/jpeg/jcparam.c
+--- openjdk.orig/jdk/src/share/native/sun/awt/image/jpeg/jcparam.c	2011-02-28 16:06:45.000000000 +0000
++++ openjdk/jdk/src/share/native/sun/awt/image/jpeg/jcparam.c	1970-01-01 01:00:00.000000000 +0100
 @@ -1,614 +0,0 @@
 -/*
 - * reserved comment block
@@ -5517,9 +6181,9 @@
 -}
 -
 -#endif /* C_PROGRESSIVE_SUPPORTED */
-diff -ruN ..openjdk.old/openjdk/jdk/src/share/native/sun/awt/image/jpeg/jcphuff.c openjdk/jdk/src/share/native/sun/awt/image/jpeg/jcphuff.c
---- ..openjdk.old/openjdk/jdk/src/share/native/sun/awt/image/jpeg/jcphuff.c	2007-10-30 04:38:51.000000000 -0400
-+++ openjdk/jdk/src/share/native/sun/awt/image/jpeg/jcphuff.c	1969-12-31 19:00:00.000000000 -0500
+diff -Nru openjdk.orig/jdk/src/share/native/sun/awt/image/jpeg/jcphuff.c openjdk/jdk/src/share/native/sun/awt/image/jpeg/jcphuff.c
+--- openjdk.orig/jdk/src/share/native/sun/awt/image/jpeg/jcphuff.c	2011-02-28 16:06:45.000000000 +0000
++++ openjdk/jdk/src/share/native/sun/awt/image/jpeg/jcphuff.c	1970-01-01 01:00:00.000000000 +0100
 @@ -1,837 +0,0 @@
 -/*
 - * reserved comment block
@@ -6358,9 +7022,9 @@
 -}
 -
 -#endif /* C_PROGRESSIVE_SUPPORTED */
-diff -ruN ..openjdk.old/openjdk/jdk/src/share/native/sun/awt/image/jpeg/jcprepct.c openjdk/jdk/src/share/native/sun/awt/image/jpeg/jcprepct.c
---- ..openjdk.old/openjdk/jdk/src/share/native/sun/awt/image/jpeg/jcprepct.c	2007-10-30 04:38:51.000000000 -0400
-+++ openjdk/jdk/src/share/native/sun/awt/image/jpeg/jcprepct.c	1969-12-31 19:00:00.000000000 -0500
+diff -Nru openjdk.orig/jdk/src/share/native/sun/awt/image/jpeg/jcprepct.c openjdk/jdk/src/share/native/sun/awt/image/jpeg/jcprepct.c
+--- openjdk.orig/jdk/src/share/native/sun/awt/image/jpeg/jcprepct.c	2011-02-28 16:06:45.000000000 +0000
++++ openjdk/jdk/src/share/native/sun/awt/image/jpeg/jcprepct.c	1970-01-01 01:00:00.000000000 +0100
 @@ -1,358 +0,0 @@
 -/*
 - * reserved comment block
@@ -6720,9 +7384,9 @@
 -    }
 -  }
 -}
-diff -ruN ..openjdk.old/openjdk/jdk/src/share/native/sun/awt/image/jpeg/jcsample.c openjdk/jdk/src/share/native/sun/awt/image/jpeg/jcsample.c
---- ..openjdk.old/openjdk/jdk/src/share/native/sun/awt/image/jpeg/jcsample.c	2007-10-30 04:38:51.000000000 -0400
-+++ openjdk/jdk/src/share/native/sun/awt/image/jpeg/jcsample.c	1969-12-31 19:00:00.000000000 -0500
+diff -Nru openjdk.orig/jdk/src/share/native/sun/awt/image/jpeg/jcsample.c openjdk/jdk/src/share/native/sun/awt/image/jpeg/jcsample.c
+--- openjdk.orig/jdk/src/share/native/sun/awt/image/jpeg/jcsample.c	2011-02-28 16:06:45.000000000 +0000
++++ openjdk/jdk/src/share/native/sun/awt/image/jpeg/jcsample.c	1970-01-01 01:00:00.000000000 +0100
 @@ -1,523 +0,0 @@
 -/*
 - * reserved comment block
@@ -7247,9 +7911,9 @@
 -    TRACEMS(cinfo, 0, JTRC_SMOOTH_NOTIMPL);
 -#endif
 -}
-diff -ruN ..openjdk.old/openjdk/jdk/src/share/native/sun/awt/image/jpeg/jctrans.c openjdk/jdk/src/share/native/sun/awt/image/jpeg/jctrans.c
---- ..openjdk.old/openjdk/jdk/src/share/native/sun/awt/image/jpeg/jctrans.c	2007-10-30 04:38:51.000000000 -0400
-+++ openjdk/jdk/src/share/native/sun/awt/image/jpeg/jctrans.c	1969-12-31 19:00:00.000000000 -0500
+diff -Nru openjdk.orig/jdk/src/share/native/sun/awt/image/jpeg/jctrans.c openjdk/jdk/src/share/native/sun/awt/image/jpeg/jctrans.c
+--- openjdk.orig/jdk/src/share/native/sun/awt/image/jpeg/jctrans.c	2011-02-28 16:06:45.000000000 +0000
++++ openjdk/jdk/src/share/native/sun/awt/image/jpeg/jctrans.c	1970-01-01 01:00:00.000000000 +0100
 @@ -1,392 +0,0 @@
 -/*
 - * reserved comment block
@@ -7643,9 +8307,9 @@
 -    coef->dummy_buffer[i] = buffer + i;
 -  }
 -}
-diff -ruN ..openjdk.old/openjdk/jdk/src/share/native/sun/awt/image/jpeg/jdapimin.c openjdk/jdk/src/share/native/sun/awt/image/jpeg/jdapimin.c
---- ..openjdk.old/openjdk/jdk/src/share/native/sun/awt/image/jpeg/jdapimin.c	2007-10-30 04:38:51.000000000 -0400
-+++ openjdk/jdk/src/share/native/sun/awt/image/jpeg/jdapimin.c	1969-12-31 19:00:00.000000000 -0500
+diff -Nru openjdk.orig/jdk/src/share/native/sun/awt/image/jpeg/jdapimin.c openjdk/jdk/src/share/native/sun/awt/image/jpeg/jdapimin.c
+--- openjdk.orig/jdk/src/share/native/sun/awt/image/jpeg/jdapimin.c	2011-02-28 16:06:45.000000000 +0000
++++ openjdk/jdk/src/share/native/sun/awt/image/jpeg/jdapimin.c	1970-01-01 01:00:00.000000000 +0100
 @@ -1,399 +0,0 @@
 -/*
 - * reserved comment block
@@ -8046,9 +8710,9 @@
 -  jpeg_abort((j_common_ptr) cinfo);
 -  return TRUE;
 -}
-diff -ruN ..openjdk.old/openjdk/jdk/src/share/native/sun/awt/image/jpeg/jdapistd.c openjdk/jdk/src/share/native/sun/awt/image/jpeg/jdapistd.c
---- ..openjdk.old/openjdk/jdk/src/share/native/sun/awt/image/jpeg/jdapistd.c	2007-10-30 04:38:51.000000000 -0400
-+++ openjdk/jdk/src/share/native/sun/awt/image/jpeg/jdapistd.c	1969-12-31 19:00:00.000000000 -0500
+diff -Nru openjdk.orig/jdk/src/share/native/sun/awt/image/jpeg/jdapistd.c openjdk/jdk/src/share/native/sun/awt/image/jpeg/jdapistd.c
+--- openjdk.orig/jdk/src/share/native/sun/awt/image/jpeg/jdapistd.c	2011-02-28 16:06:45.000000000 +0000
++++ openjdk/jdk/src/share/native/sun/awt/image/jpeg/jdapistd.c	1970-01-01 01:00:00.000000000 +0100
 @@ -1,279 +0,0 @@
 -/*
 - * reserved comment block
@@ -8329,9 +8993,9 @@
 -}
 -
 -#endif /* D_MULTISCAN_FILES_SUPPORTED */
-diff -ruN ..openjdk.old/openjdk/jdk/src/share/native/sun/awt/image/jpeg/jdcoefct.c openjdk/jdk/src/share/native/sun/awt/image/jpeg/jdcoefct.c
---- ..openjdk.old/openjdk/jdk/src/share/native/sun/awt/image/jpeg/jdcoefct.c	2007-10-30 04:38:51.000000000 -0400
-+++ openjdk/jdk/src/share/native/sun/awt/image/jpeg/jdcoefct.c	1969-12-31 19:00:00.000000000 -0500
+diff -Nru openjdk.orig/jdk/src/share/native/sun/awt/image/jpeg/jdcoefct.c openjdk/jdk/src/share/native/sun/awt/image/jpeg/jdcoefct.c
+--- openjdk.orig/jdk/src/share/native/sun/awt/image/jpeg/jdcoefct.c	2011-02-28 16:06:45.000000000 +0000
++++ openjdk/jdk/src/share/native/sun/awt/image/jpeg/jdcoefct.c	1970-01-01 01:00:00.000000000 +0100
 @@ -1,740 +0,0 @@
 -/*
 - * reserved comment block
@@ -9073,9 +9737,9 @@
 -    coef->pub.coef_arrays = NULL; /* flag for no virtual arrays */
 -  }
 -}
-diff -ruN ..openjdk.old/openjdk/jdk/src/share/native/sun/awt/image/jpeg/jdcolor.c openjdk/jdk/src/share/native/sun/awt/image/jpeg/jdcolor.c
---- ..openjdk.old/openjdk/jdk/src/share/native/sun/awt/image/jpeg/jdcolor.c	2007-10-30 04:38:51.000000000 -0400
-+++ openjdk/jdk/src/share/native/sun/awt/image/jpeg/jdcolor.c	1969-12-31 19:00:00.000000000 -0500
+diff -Nru openjdk.orig/jdk/src/share/native/sun/awt/image/jpeg/jdcolor.c openjdk/jdk/src/share/native/sun/awt/image/jpeg/jdcolor.c
+--- openjdk.orig/jdk/src/share/native/sun/awt/image/jpeg/jdcolor.c	2011-02-28 16:06:45.000000000 +0000
++++ openjdk/jdk/src/share/native/sun/awt/image/jpeg/jdcolor.c	1970-01-01 01:00:00.000000000 +0100
 @@ -1,398 +0,0 @@
 -/*
 - * reserved comment block
@@ -9475,9 +10139,9 @@
 -  else
 -    cinfo->output_components = cinfo->out_color_components;
 -}
-diff -ruN ..openjdk.old/openjdk/jdk/src/share/native/sun/awt/image/jpeg/jdct.h openjdk/jdk/src/share/native/sun/awt/image/jpeg/jdct.h
---- ..openjdk.old/openjdk/jdk/src/share/native/sun/awt/image/jpeg/jdct.h	2007-10-30 04:38:51.000000000 -0400
-+++ openjdk/jdk/src/share/native/sun/awt/image/jpeg/jdct.h	1969-12-31 19:00:00.000000000 -0500
+diff -Nru openjdk.orig/jdk/src/share/native/sun/awt/image/jpeg/jdct.h openjdk/jdk/src/share/native/sun/awt/image/jpeg/jdct.h
+--- openjdk.orig/jdk/src/share/native/sun/awt/image/jpeg/jdct.h	2011-02-28 16:06:45.000000000 +0000
++++ openjdk/jdk/src/share/native/sun/awt/image/jpeg/jdct.h	1970-01-01 01:00:00.000000000 +0100
 @@ -1,180 +0,0 @@
 -/*
 - * reserved comment block
@@ -9659,9 +10323,9 @@
 -#ifndef MULTIPLY16V16           /* default definition */
 -#define MULTIPLY16V16(var1,var2)  ((var1) * (var2))
 -#endif
-diff -ruN ..openjdk.old/openjdk/jdk/src/share/native/sun/awt/image/jpeg/jddctmgr.c openjdk/jdk/src/share/native/sun/awt/image/jpeg/jddctmgr.c
---- ..openjdk.old/openjdk/jdk/src/share/native/sun/awt/image/jpeg/jddctmgr.c	2007-10-30 04:38:51.000000000 -0400
-+++ openjdk/jdk/src/share/native/sun/awt/image/jpeg/jddctmgr.c	1969-12-31 19:00:00.000000000 -0500
+diff -Nru openjdk.orig/jdk/src/share/native/sun/awt/image/jpeg/jddctmgr.c openjdk/jdk/src/share/native/sun/awt/image/jpeg/jddctmgr.c
+--- openjdk.orig/jdk/src/share/native/sun/awt/image/jpeg/jddctmgr.c	2011-02-28 16:06:45.000000000 +0000
++++ openjdk/jdk/src/share/native/sun/awt/image/jpeg/jddctmgr.c	1970-01-01 01:00:00.000000000 +0100
 @@ -1,273 +0,0 @@
 -/*
 - * reserved comment block
@@ -9936,9 +10600,9 @@
 -    idct->cur_method[ci] = -1;
 -  }
 -}
-diff -ruN ..openjdk.old/openjdk/jdk/src/share/native/sun/awt/image/jpeg/jdhuff.c openjdk/jdk/src/share/native/sun/awt/image/jpeg/jdhuff.c
---- ..openjdk.old/openjdk/jdk/src/share/native/sun/awt/image/jpeg/jdhuff.c	2007-10-30 04:38:51.000000000 -0400
-+++ openjdk/jdk/src/share/native/sun/awt/image/jpeg/jdhuff.c	1969-12-31 19:00:00.000000000 -0500
+diff -Nru openjdk.orig/jdk/src/share/native/sun/awt/image/jpeg/jdhuff.c openjdk/jdk/src/share/native/sun/awt/image/jpeg/jdhuff.c
+--- openjdk.orig/jdk/src/share/native/sun/awt/image/jpeg/jdhuff.c	2011-02-28 16:06:45.000000000 +0000
++++ openjdk/jdk/src/share/native/sun/awt/image/jpeg/jdhuff.c	1970-01-01 01:00:00.000000000 +0100
 @@ -1,655 +0,0 @@
 -/*
 - * reserved comment block
@@ -10595,9 +11259,9 @@
 -    entropy->dc_derived_tbls[i] = entropy->ac_derived_tbls[i] = NULL;
 -  }
 -}
-diff -ruN ..openjdk.old/openjdk/jdk/src/share/native/sun/awt/image/jpeg/jdhuff.h openjdk/jdk/src/share/native/sun/awt/image/jpeg/jdhuff.h
---- ..openjdk.old/openjdk/jdk/src/share/native/sun/awt/image/jpeg/jdhuff.h	2007-10-30 04:38:51.000000000 -0400
-+++ openjdk/jdk/src/share/native/sun/awt/image/jpeg/jdhuff.h	1969-12-31 19:00:00.000000000 -0500
+diff -Nru openjdk.orig/jdk/src/share/native/sun/awt/image/jpeg/jdhuff.h openjdk/jdk/src/share/native/sun/awt/image/jpeg/jdhuff.h
+--- openjdk.orig/jdk/src/share/native/sun/awt/image/jpeg/jdhuff.h	2011-02-28 16:06:45.000000000 +0000
++++ openjdk/jdk/src/share/native/sun/awt/image/jpeg/jdhuff.h	1970-01-01 01:00:00.000000000 +0100
 @@ -1,205 +0,0 @@
 -/*
 - * reserved comment block
@@ -10804,9 +11468,9 @@
 -EXTERN(int) jpeg_huff_decode
 -        JPP((bitread_working_state * state, register bit_buf_type get_buffer,
 -             register int bits_left, d_derived_tbl * htbl, int min_bits));
-diff -ruN ..openjdk.old/openjdk/jdk/src/share/native/sun/awt/image/jpeg/jdinput.c openjdk/jdk/src/share/native/sun/awt/image/jpeg/jdinput.c
---- ..openjdk.old/openjdk/jdk/src/share/native/sun/awt/image/jpeg/jdinput.c	2007-10-30 04:38:51.000000000 -0400
-+++ openjdk/jdk/src/share/native/sun/awt/image/jpeg/jdinput.c	1969-12-31 19:00:00.000000000 -0500
+diff -Nru openjdk.orig/jdk/src/share/native/sun/awt/image/jpeg/jdinput.c openjdk/jdk/src/share/native/sun/awt/image/jpeg/jdinput.c
+--- openjdk.orig/jdk/src/share/native/sun/awt/image/jpeg/jdinput.c	2011-02-28 16:06:45.000000000 +0000
++++ openjdk/jdk/src/share/native/sun/awt/image/jpeg/jdinput.c	1970-01-01 01:00:00.000000000 +0100
 @@ -1,385 +0,0 @@
 -/*
 - * reserved comment block
@@ -11193,9 +11857,9 @@
 -  inputctl->pub.eoi_reached = FALSE;
 -  inputctl->inheaders = TRUE;
 -}
-diff -ruN ..openjdk.old/openjdk/jdk/src/share/native/sun/awt/image/jpeg/jdmainct.c openjdk/jdk/src/share/native/sun/awt/image/jpeg/jdmainct.c
---- ..openjdk.old/openjdk/jdk/src/share/native/sun/awt/image/jpeg/jdmainct.c	2007-10-30 04:38:51.000000000 -0400
-+++ openjdk/jdk/src/share/native/sun/awt/image/jpeg/jdmainct.c	1969-12-31 19:00:00.000000000 -0500
+diff -Nru openjdk.orig/jdk/src/share/native/sun/awt/image/jpeg/jdmainct.c openjdk/jdk/src/share/native/sun/awt/image/jpeg/jdmainct.c
+--- openjdk.orig/jdk/src/share/native/sun/awt/image/jpeg/jdmainct.c	2011-02-28 16:06:45.000000000 +0000
++++ openjdk/jdk/src/share/native/sun/awt/image/jpeg/jdmainct.c	1970-01-01 01:00:00.000000000 +0100
 @@ -1,516 +0,0 @@
 -/*
 - * reserved comment block
@@ -11713,9 +12377,9 @@
 -                         (JDIMENSION) (rgroup * ngroups));
 -  }
 -}
-diff -ruN ..openjdk.old/openjdk/jdk/src/share/native/sun/awt/image/jpeg/jdmarker.c openjdk/jdk/src/share/native/sun/awt/image/jpeg/jdmarker.c
---- ..openjdk.old/openjdk/jdk/src/share/native/sun/awt/image/jpeg/jdmarker.c	2007-10-30 04:38:51.000000000 -0400
-+++ openjdk/jdk/src/share/native/sun/awt/image/jpeg/jdmarker.c	1969-12-31 19:00:00.000000000 -0500
+diff -Nru openjdk.orig/jdk/src/share/native/sun/awt/image/jpeg/jdmarker.c openjdk/jdk/src/share/native/sun/awt/image/jpeg/jdmarker.c
+--- openjdk.orig/jdk/src/share/native/sun/awt/image/jpeg/jdmarker.c	2011-02-28 16:06:45.000000000 +0000
++++ openjdk/jdk/src/share/native/sun/awt/image/jpeg/jdmarker.c	1970-01-01 01:00:00.000000000 +0100
 @@ -1,1384 +0,0 @@
 -/*
 - * reserved comment block
@@ -13101,9 +13765,9 @@
 -  else
 -    ERREXIT1(cinfo, JERR_UNKNOWN_MARKER, marker_code);
 -}
-diff -ruN ..openjdk.old/openjdk/jdk/src/share/native/sun/awt/image/jpeg/jdmaster.c openjdk/jdk/src/share/native/sun/awt/image/jpeg/jdmaster.c
---- ..openjdk.old/openjdk/jdk/src/share/native/sun/awt/image/jpeg/jdmaster.c	2007-10-30 04:38:51.000000000 -0400
-+++ openjdk/jdk/src/share/native/sun/awt/image/jpeg/jdmaster.c	1969-12-31 19:00:00.000000000 -0500
+diff -Nru openjdk.orig/jdk/src/share/native/sun/awt/image/jpeg/jdmaster.c openjdk/jdk/src/share/native/sun/awt/image/jpeg/jdmaster.c
+--- openjdk.orig/jdk/src/share/native/sun/awt/image/jpeg/jdmaster.c	2011-02-28 16:06:45.000000000 +0000
++++ openjdk/jdk/src/share/native/sun/awt/image/jpeg/jdmaster.c	1970-01-01 01:00:00.000000000 +0100
 @@ -1,561 +0,0 @@
 -/*
 - * reserved comment block
@@ -13666,9 +14330,9 @@
 -
 -  master_selection(cinfo);
 -}
-diff -ruN ..openjdk.old/openjdk/jdk/src/share/native/sun/awt/image/jpeg/jdmerge.c openjdk/jdk/src/share/native/sun/awt/image/jpeg/jdmerge.c
---- ..openjdk.old/openjdk/jdk/src/share/native/sun/awt/image/jpeg/jdmerge.c	2007-10-30 04:38:51.000000000 -0400
-+++ openjdk/jdk/src/share/native/sun/awt/image/jpeg/jdmerge.c	1969-12-31 19:00:00.000000000 -0500
+diff -Nru openjdk.orig/jdk/src/share/native/sun/awt/image/jpeg/jdmerge.c openjdk/jdk/src/share/native/sun/awt/image/jpeg/jdmerge.c
+--- openjdk.orig/jdk/src/share/native/sun/awt/image/jpeg/jdmerge.c	2011-02-28 16:06:45.000000000 +0000
++++ openjdk/jdk/src/share/native/sun/awt/image/jpeg/jdmerge.c	1970-01-01 01:00:00.000000000 +0100
 @@ -1,404 +0,0 @@
 -/*
 - * reserved comment block
@@ -14074,9 +14738,9 @@
 -}
 -
 -#endif /* UPSAMPLE_MERGING_SUPPORTED */
-diff -ruN ..openjdk.old/openjdk/jdk/src/share/native/sun/awt/image/jpeg/jdphuff.c openjdk/jdk/src/share/native/sun/awt/image/jpeg/jdphuff.c
---- ..openjdk.old/openjdk/jdk/src/share/native/sun/awt/image/jpeg/jdphuff.c	2007-10-30 04:38:51.000000000 -0400
-+++ openjdk/jdk/src/share/native/sun/awt/image/jpeg/jdphuff.c	1969-12-31 19:00:00.000000000 -0500
+diff -Nru openjdk.orig/jdk/src/share/native/sun/awt/image/jpeg/jdphuff.c openjdk/jdk/src/share/native/sun/awt/image/jpeg/jdphuff.c
+--- openjdk.orig/jdk/src/share/native/sun/awt/image/jpeg/jdphuff.c	2011-02-28 16:06:45.000000000 +0000
++++ openjdk/jdk/src/share/native/sun/awt/image/jpeg/jdphuff.c	1970-01-01 01:00:00.000000000 +0100
 @@ -1,672 +0,0 @@
 -/*
 - * reserved comment block
@@ -14750,9 +15414,9 @@
 -}
 -
 -#endif /* D_PROGRESSIVE_SUPPORTED */
-diff -ruN ..openjdk.old/openjdk/jdk/src/share/native/sun/awt/image/jpeg/jdpostct.c openjdk/jdk/src/share/native/sun/awt/image/jpeg/jdpostct.c
---- ..openjdk.old/openjdk/jdk/src/share/native/sun/awt/image/jpeg/jdpostct.c	2007-10-30 04:38:51.000000000 -0400
-+++ openjdk/jdk/src/share/native/sun/awt/image/jpeg/jdpostct.c	1969-12-31 19:00:00.000000000 -0500
+diff -Nru openjdk.orig/jdk/src/share/native/sun/awt/image/jpeg/jdpostct.c openjdk/jdk/src/share/native/sun/awt/image/jpeg/jdpostct.c
+--- openjdk.orig/jdk/src/share/native/sun/awt/image/jpeg/jdpostct.c	2011-02-28 16:06:45.000000000 +0000
++++ openjdk/jdk/src/share/native/sun/awt/image/jpeg/jdpostct.c	1970-01-01 01:00:00.000000000 +0100
 @@ -1,294 +0,0 @@
 -/*
 - * reserved comment block
@@ -15048,9 +15712,9 @@
 -    }
 -  }
 -}
-diff -ruN ..openjdk.old/openjdk/jdk/src/share/native/sun/awt/image/jpeg/jdsample.c openjdk/jdk/src/share/native/sun/awt/image/jpeg/jdsample.c
---- ..openjdk.old/openjdk/jdk/src/share/native/sun/awt/image/jpeg/jdsample.c	2007-10-30 04:38:51.000000000 -0400
-+++ openjdk/jdk/src/share/native/sun/awt/image/jpeg/jdsample.c	1969-12-31 19:00:00.000000000 -0500
+diff -Nru openjdk.orig/jdk/src/share/native/sun/awt/image/jpeg/jdsample.c openjdk/jdk/src/share/native/sun/awt/image/jpeg/jdsample.c
+--- openjdk.orig/jdk/src/share/native/sun/awt/image/jpeg/jdsample.c	2011-02-28 16:06:45.000000000 +0000
++++ openjdk/jdk/src/share/native/sun/awt/image/jpeg/jdsample.c	1970-01-01 01:00:00.000000000 +0100
 @@ -1,482 +0,0 @@
 -/*
 - * reserved comment block
@@ -15534,9 +16198,9 @@
 -    }
 -  }
 -}
-diff -ruN ..openjdk.old/openjdk/jdk/src/share/native/sun/awt/image/jpeg/jdtrans.c openjdk/jdk/src/share/native/sun/awt/image/jpeg/jdtrans.c
---- ..openjdk.old/openjdk/jdk/src/share/native/sun/awt/image/jpeg/jdtrans.c	2007-10-30 04:38:51.000000000 -0400
-+++ openjdk/jdk/src/share/native/sun/awt/image/jpeg/jdtrans.c	1969-12-31 19:00:00.000000000 -0500
+diff -Nru openjdk.orig/jdk/src/share/native/sun/awt/image/jpeg/jdtrans.c openjdk/jdk/src/share/native/sun/awt/image/jpeg/jdtrans.c
+--- openjdk.orig/jdk/src/share/native/sun/awt/image/jpeg/jdtrans.c	2011-02-28 16:06:45.000000000 +0000
++++ openjdk/jdk/src/share/native/sun/awt/image/jpeg/jdtrans.c	1970-01-01 01:00:00.000000000 +0100
 @@ -1,147 +0,0 @@
 -/*
 - * reserved comment block
@@ -15685,9 +16349,9 @@
 -    cinfo->progress->total_passes = 1;
 -  }
 -}
-diff -ruN ..openjdk.old/openjdk/jdk/src/share/native/sun/awt/image/jpeg/jerror.c openjdk/jdk/src/share/native/sun/awt/image/jpeg/jerror.c
---- ..openjdk.old/openjdk/jdk/src/share/native/sun/awt/image/jpeg/jerror.c	2007-10-30 04:38:51.000000000 -0400
-+++ openjdk/jdk/src/share/native/sun/awt/image/jpeg/jerror.c	1969-12-31 19:00:00.000000000 -0500
+diff -Nru openjdk.orig/jdk/src/share/native/sun/awt/image/jpeg/jerror.c openjdk/jdk/src/share/native/sun/awt/image/jpeg/jerror.c
+--- openjdk.orig/jdk/src/share/native/sun/awt/image/jpeg/jerror.c	2011-02-28 16:06:45.000000000 +0000
++++ openjdk/jdk/src/share/native/sun/awt/image/jpeg/jerror.c	1970-01-01 01:00:00.000000000 +0100
 @@ -1,272 +0,0 @@
 -/*
 - * reserved comment block
@@ -15961,9 +16625,9 @@
 -
 -  return err;
 -}
-diff -ruN ..openjdk.old/openjdk/jdk/src/share/native/sun/awt/image/jpeg/jerror.h openjdk/jdk/src/share/native/sun/awt/image/jpeg/jerror.h
---- ..openjdk.old/openjdk/jdk/src/share/native/sun/awt/image/jpeg/jerror.h	2007-10-30 04:38:51.000000000 -0400
-+++ openjdk/jdk/src/share/native/sun/awt/image/jpeg/jerror.h	1969-12-31 19:00:00.000000000 -0500
+diff -Nru openjdk.orig/jdk/src/share/native/sun/awt/image/jpeg/jerror.h openjdk/jdk/src/share/native/sun/awt/image/jpeg/jerror.h
+--- openjdk.orig/jdk/src/share/native/sun/awt/image/jpeg/jerror.h	2011-02-28 16:06:45.000000000 +0000
++++ openjdk/jdk/src/share/native/sun/awt/image/jpeg/jerror.h	1970-01-01 01:00:00.000000000 +0100
 @@ -1,295 +0,0 @@
 -/*
 - * reserved comment block
@@ -16260,9 +16924,9 @@
 -   (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl)))
 -
 -#endif /* JERROR_H */
-diff -ruN ..openjdk.old/openjdk/jdk/src/share/native/sun/awt/image/jpeg/jfdctflt.c openjdk/jdk/src/share/native/sun/awt/image/jpeg/jfdctflt.c
---- ..openjdk.old/openjdk/jdk/src/share/native/sun/awt/image/jpeg/jfdctflt.c	2007-10-30 04:38:51.000000000 -0400
-+++ openjdk/jdk/src/share/native/sun/awt/image/jpeg/jfdctflt.c	1969-12-31 19:00:00.000000000 -0500
+diff -Nru openjdk.orig/jdk/src/share/native/sun/awt/image/jpeg/jfdctflt.c openjdk/jdk/src/share/native/sun/awt/image/jpeg/jfdctflt.c
+--- openjdk.orig/jdk/src/share/native/sun/awt/image/jpeg/jfdctflt.c	2011-02-28 16:06:45.000000000 +0000
++++ openjdk/jdk/src/share/native/sun/awt/image/jpeg/jfdctflt.c	1970-01-01 01:00:00.000000000 +0100
 @@ -1,172 +0,0 @@
 -/*
 - * reserved comment block
@@ -16436,9 +17100,9 @@
 -}
 -
 -#endif /* DCT_FLOAT_SUPPORTED */
-diff -ruN ..openjdk.old/openjdk/jdk/src/share/native/sun/awt/image/jpeg/jfdctfst.c openjdk/jdk/src/share/native/sun/awt/image/jpeg/jfdctfst.c
---- ..openjdk.old/openjdk/jdk/src/share/native/sun/awt/image/jpeg/jfdctfst.c	2007-10-30 04:38:51.000000000 -0400
-+++ openjdk/jdk/src/share/native/sun/awt/image/jpeg/jfdctfst.c	1969-12-31 19:00:00.000000000 -0500
+diff -Nru openjdk.orig/jdk/src/share/native/sun/awt/image/jpeg/jfdctfst.c openjdk/jdk/src/share/native/sun/awt/image/jpeg/jfdctfst.c
+--- openjdk.orig/jdk/src/share/native/sun/awt/image/jpeg/jfdctfst.c	2011-02-28 16:06:45.000000000 +0000
++++ openjdk/jdk/src/share/native/sun/awt/image/jpeg/jfdctfst.c	1970-01-01 01:00:00.000000000 +0100
 @@ -1,228 +0,0 @@
 -/*
 - * reserved comment block
@@ -16668,9 +17332,9 @@
 -}
 -
 -#endif /* DCT_IFAST_SUPPORTED */
-diff -ruN ..openjdk.old/openjdk/jdk/src/share/native/sun/awt/image/jpeg/jfdctint.c openjdk/jdk/src/share/native/sun/awt/image/jpeg/jfdctint.c
---- ..openjdk.old/openjdk/jdk/src/share/native/sun/awt/image/jpeg/jfdctint.c	2007-10-30 04:38:51.000000000 -0400
-+++ openjdk/jdk/src/share/native/sun/awt/image/jpeg/jfdctint.c	1969-12-31 19:00:00.000000000 -0500
+diff -Nru openjdk.orig/jdk/src/share/native/sun/awt/image/jpeg/jfdctint.c openjdk/jdk/src/share/native/sun/awt/image/jpeg/jfdctint.c
+--- openjdk.orig/jdk/src/share/native/sun/awt/image/jpeg/jfdctint.c	2011-02-28 16:06:45.000000000 +0000
++++ openjdk/jdk/src/share/native/sun/awt/image/jpeg/jfdctint.c	1970-01-01 01:00:00.000000000 +0100
 @@ -1,287 +0,0 @@
 -/*
 - * reserved comment block
@@ -16959,9 +17623,9 @@
 -}
 -
 -#endif /* DCT_ISLOW_SUPPORTED */
-diff -ruN ..openjdk.old/openjdk/jdk/src/share/native/sun/awt/image/jpeg/jidctflt.c openjdk/jdk/src/share/native/sun/awt/image/jpeg/jidctflt.c
---- ..openjdk.old/openjdk/jdk/src/share/native/sun/awt/image/jpeg/jidctflt.c	2007-10-30 04:38:51.000000000 -0400
-+++ openjdk/jdk/src/share/native/sun/awt/image/jpeg/jidctflt.c	1969-12-31 19:00:00.000000000 -0500
+diff -Nru openjdk.orig/jdk/src/share/native/sun/awt/image/jpeg/jidctflt.c openjdk/jdk/src/share/native/sun/awt/image/jpeg/jidctflt.c
+--- openjdk.orig/jdk/src/share/native/sun/awt/image/jpeg/jidctflt.c	2011-02-28 16:06:45.000000000 +0000
++++ openjdk/jdk/src/share/native/sun/awt/image/jpeg/jidctflt.c	1970-01-01 01:00:00.000000000 +0100
 @@ -1,246 +0,0 @@
 -/*
 - * reserved comment block
@@ -17209,9 +17873,9 @@
 -}
 -
 -#endif /* DCT_FLOAT_SUPPORTED */
-diff -ruN ..openjdk.old/openjdk/jdk/src/share/native/sun/awt/image/jpeg/jidctfst.c openjdk/jdk/src/share/native/sun/awt/image/jpeg/jidctfst.c
---- ..openjdk.old/openjdk/jdk/src/share/native/sun/awt/image/jpeg/jidctfst.c	2007-10-30 04:38:51.000000000 -0400
-+++ openjdk/jdk/src/share/native/sun/awt/image/jpeg/jidctfst.c	1969-12-31 19:00:00.000000000 -0500
+diff -Nru openjdk.orig/jdk/src/share/native/sun/awt/image/jpeg/jidctfst.c openjdk/jdk/src/share/native/sun/awt/image/jpeg/jidctfst.c
+--- openjdk.orig/jdk/src/share/native/sun/awt/image/jpeg/jidctfst.c	2011-02-28 16:06:45.000000000 +0000
++++ openjdk/jdk/src/share/native/sun/awt/image/jpeg/jidctfst.c	1970-01-01 01:00:00.000000000 +0100
 @@ -1,372 +0,0 @@
 -/*
 - * reserved comment block
@@ -17585,9 +18249,9 @@
 -}
 -
 -#endif /* DCT_IFAST_SUPPORTED */
-diff -ruN ..openjdk.old/openjdk/jdk/src/share/native/sun/awt/image/jpeg/jidctint.c openjdk/jdk/src/share/native/sun/awt/image/jpeg/jidctint.c
---- ..openjdk.old/openjdk/jdk/src/share/native/sun/awt/image/jpeg/jidctint.c	2007-10-30 04:38:51.000000000 -0400
-+++ openjdk/jdk/src/share/native/sun/awt/image/jpeg/jidctint.c	1969-12-31 19:00:00.000000000 -0500
+diff -Nru openjdk.orig/jdk/src/share/native/sun/awt/image/jpeg/jidctint.c openjdk/jdk/src/share/native/sun/awt/image/jpeg/jidctint.c
+--- openjdk.orig/jdk/src/share/native/sun/awt/image/jpeg/jidctint.c	2011-02-28 16:06:45.000000000 +0000
++++ openjdk/jdk/src/share/native/sun/awt/image/jpeg/jidctint.c	1970-01-01 01:00:00.000000000 +0100
 @@ -1,393 +0,0 @@
 -/*
 - * reserved comment block
@@ -17982,9 +18646,9 @@
 -}
 -
 -#endif /* DCT_ISLOW_SUPPORTED */
-diff -ruN ..openjdk.old/openjdk/jdk/src/share/native/sun/awt/image/jpeg/jidctred.c openjdk/jdk/src/share/native/sun/awt/image/jpeg/jidctred.c
---- ..openjdk.old/openjdk/jdk/src/share/native/sun/awt/image/jpeg/jidctred.c	2007-10-30 04:38:51.000000000 -0400
-+++ openjdk/jdk/src/share/native/sun/awt/image/jpeg/jidctred.c	1969-12-31 19:00:00.000000000 -0500
+diff -Nru openjdk.orig/jdk/src/share/native/sun/awt/image/jpeg/jidctred.c openjdk/jdk/src/share/native/sun/awt/image/jpeg/jidctred.c
+--- openjdk.orig/jdk/src/share/native/sun/awt/image/jpeg/jidctred.c	2011-02-28 16:06:45.000000000 +0000
++++ openjdk/jdk/src/share/native/sun/awt/image/jpeg/jidctred.c	1970-01-01 01:00:00.000000000 +0100
 @@ -1,402 +0,0 @@
 -/*
 - * reserved comment block
@@ -18388,9 +19052,9 @@
 -}
 -
 -#endif /* IDCT_SCALING_SUPPORTED */
-diff -ruN ..openjdk.old/openjdk/jdk/src/share/native/sun/awt/image/jpeg/jinclude.h openjdk/jdk/src/share/native/sun/awt/image/jpeg/jinclude.h
---- ..openjdk.old/openjdk/jdk/src/share/native/sun/awt/image/jpeg/jinclude.h	2007-10-30 04:38:51.000000000 -0400
-+++ openjdk/jdk/src/share/native/sun/awt/image/jpeg/jinclude.h	1969-12-31 19:00:00.000000000 -0500
+diff -Nru openjdk.orig/jdk/src/share/native/sun/awt/image/jpeg/jinclude.h openjdk/jdk/src/share/native/sun/awt/image/jpeg/jinclude.h
+--- openjdk.orig/jdk/src/share/native/sun/awt/image/jpeg/jinclude.h	2011-02-28 16:06:45.000000000 +0000
++++ openjdk/jdk/src/share/native/sun/awt/image/jpeg/jinclude.h	1970-01-01 01:00:00.000000000 +0100
 @@ -1,95 +0,0 @@
 -/*
 - * reserved comment block
@@ -18487,9 +19151,9 @@
 -  ((size_t) fread((void *) (buf), (size_t) 1, (size_t) (sizeofbuf), (file)))
 -#define JFWRITE(file,buf,sizeofbuf)  \
 -  ((size_t) fwrite((const void *) (buf), (size_t) 1, (size_t) (sizeofbuf), (file)))
-diff -ruN ..openjdk.old/openjdk/jdk/src/share/native/sun/awt/image/jpeg/jmemmgr.c openjdk/jdk/src/share/native/sun/awt/image/jpeg/jmemmgr.c
---- ..openjdk.old/openjdk/jdk/src/share/native/sun/awt/image/jpeg/jmemmgr.c	2007-10-30 04:38:51.000000000 -0400
-+++ openjdk/jdk/src/share/native/sun/awt/image/jpeg/jmemmgr.c	1969-12-31 19:00:00.000000000 -0500
+diff -Nru openjdk.orig/jdk/src/share/native/sun/awt/image/jpeg/jmemmgr.c openjdk/jdk/src/share/native/sun/awt/image/jpeg/jmemmgr.c
+--- openjdk.orig/jdk/src/share/native/sun/awt/image/jpeg/jmemmgr.c	2011-02-28 16:06:45.000000000 +0000
++++ openjdk/jdk/src/share/native/sun/awt/image/jpeg/jmemmgr.c	1970-01-01 01:00:00.000000000 +0100
 @@ -1,1122 +0,0 @@
 -/*
 - * reserved comment block
@@ -19613,9 +20277,9 @@
 -#endif
 -
 -}
-diff -ruN ..openjdk.old/openjdk/jdk/src/share/native/sun/awt/image/jpeg/jmemnobs.c openjdk/jdk/src/share/native/sun/awt/image/jpeg/jmemnobs.c
---- ..openjdk.old/openjdk/jdk/src/share/native/sun/awt/image/jpeg/jmemnobs.c	2007-10-30 04:38:51.000000000 -0400
-+++ openjdk/jdk/src/share/native/sun/awt/image/jpeg/jmemnobs.c	1969-12-31 19:00:00.000000000 -0500
+diff -Nru openjdk.orig/jdk/src/share/native/sun/awt/image/jpeg/jmemnobs.c openjdk/jdk/src/share/native/sun/awt/image/jpeg/jmemnobs.c
+--- openjdk.orig/jdk/src/share/native/sun/awt/image/jpeg/jmemnobs.c	2011-02-28 16:06:45.000000000 +0000
++++ openjdk/jdk/src/share/native/sun/awt/image/jpeg/jmemnobs.c	1970-01-01 01:00:00.000000000 +0100
 @@ -1,113 +0,0 @@
 -/*
 - * reserved comment block
@@ -19730,9 +20394,9 @@
 -{
 -  /* no work */
 -}
-diff -ruN ..openjdk.old/openjdk/jdk/src/share/native/sun/awt/image/jpeg/jmemsys.h openjdk/jdk/src/share/native/sun/awt/image/jpeg/jmemsys.h
---- ..openjdk.old/openjdk/jdk/src/share/native/sun/awt/image/jpeg/jmemsys.h	2007-10-30 04:38:52.000000000 -0400
-+++ openjdk/jdk/src/share/native/sun/awt/image/jpeg/jmemsys.h	1969-12-31 19:00:00.000000000 -0500
+diff -Nru openjdk.orig/jdk/src/share/native/sun/awt/image/jpeg/jmemsys.h openjdk/jdk/src/share/native/sun/awt/image/jpeg/jmemsys.h
+--- openjdk.orig/jdk/src/share/native/sun/awt/image/jpeg/jmemsys.h	2011-02-28 16:06:45.000000000 +0000
++++ openjdk/jdk/src/share/native/sun/awt/image/jpeg/jmemsys.h	1970-01-01 01:00:00.000000000 +0100
 @@ -1,202 +0,0 @@
 -/*
 - * reserved comment block
@@ -19936,9 +20600,9 @@
 -
 -EXTERN(long) jpeg_mem_init JPP((j_common_ptr cinfo));
 -EXTERN(void) jpeg_mem_term JPP((j_common_ptr cinfo));
-diff -ruN ..openjdk.old/openjdk/jdk/src/share/native/sun/awt/image/jpeg/jmorecfg.h openjdk/jdk/src/share/native/sun/awt/image/jpeg/jmorecfg.h
---- ..openjdk.old/openjdk/jdk/src/share/native/sun/awt/image/jpeg/jmorecfg.h	2007-10-30 04:38:52.000000000 -0400
-+++ openjdk/jdk/src/share/native/sun/awt/image/jpeg/jmorecfg.h	1969-12-31 19:00:00.000000000 -0500
+diff -Nru openjdk.orig/jdk/src/share/native/sun/awt/image/jpeg/jmorecfg.h openjdk/jdk/src/share/native/sun/awt/image/jpeg/jmorecfg.h
+--- openjdk.orig/jdk/src/share/native/sun/awt/image/jpeg/jmorecfg.h	2011-02-28 16:06:45.000000000 +0000
++++ openjdk/jdk/src/share/native/sun/awt/image/jpeg/jmorecfg.h	1970-01-01 01:00:00.000000000 +0100
 @@ -1,375 +0,0 @@
 -/*
 - * reserved comment block
@@ -20315,9 +20979,273 @@
 -#endif
 -
 -#endif /* JPEG_INTERNAL_OPTIONS */
-diff -ruN ..openjdk.old/openjdk/jdk/src/share/native/sun/awt/image/jpeg/jpegint.h openjdk/jdk/src/share/native/sun/awt/image/jpeg/jpegint.h
---- ..openjdk.old/openjdk/jdk/src/share/native/sun/awt/image/jpeg/jpegint.h	2007-10-30 04:38:52.000000000 -0400
-+++ openjdk/jdk/src/share/native/sun/awt/image/jpeg/jpegint.h	1969-12-31 19:00:00.000000000 -0500
+diff -Nru openjdk.orig/jdk/src/share/native/sun/awt/image/jpeg/jpegdecoder.c openjdk/jdk/src/share/native/sun/awt/image/jpeg/jpegdecoder.c
+--- openjdk.orig/jdk/src/share/native/sun/awt/image/jpeg/jpegdecoder.c	2011-02-28 16:06:45.000000000 +0000
++++ openjdk/jdk/src/share/native/sun/awt/image/jpeg/jpegdecoder.c	2012-06-08 11:34:13.903956442 +0100
+@@ -45,7 +45,9 @@
+ #undef boolean
+ #undef FAR
+ #include <jpeglib.h>
+-#include "jerror.h"
++#include <jerror.h>
++#include <dlfcn.h>
++
+ 
+ /* The method IDs we cache. Note that the last two belongs to the
+  * java.io.InputStream class.
+@@ -56,6 +58,32 @@
+ static jmethodID InputStream_readID;
+ static jmethodID InputStream_availableID;
+ 
++typedef struct jpeg_error_mgr * (*fn_jpegstderror)(struct jpeg_error_mgr *);
++typedef void (*fn_jpegcreatedecompress)(j_decompress_ptr, int, size_t);
++typedef boolean (*fn_jpegresynctorestart)(j_decompress_ptr, int);
++typedef JDIMENSION (*fn_jpegreadscanlines)(j_decompress_ptr, JSAMPARRAY, JDIMENSION);
++typedef boolean (*fn_jpegfinishoutput)(j_decompress_ptr);
++typedef int (*fn_jpegreadheader)(j_decompress_ptr, boolean);
++typedef boolean (*fn_jpegstartdecompress)(j_decompress_ptr);
++typedef boolean (*fn_jpeghasmultiplescans)(j_decompress_ptr);
++typedef void (*fn_jpegdestroydecompress)(j_decompress_ptr);
++typedef int (*fn_jpegconsumeinput)(j_decompress_ptr);
++typedef boolean (*fn_jpegfinishdecompress)(j_decompress_ptr);
++typedef boolean (*fn_jpegstartoutput)(j_decompress_ptr, int);
++
++fn_jpegstderror jpegstderror;
++fn_jpegstartoutput jpegstartoutput;
++fn_jpegfinishdecompress jpegfinishdecompress;
++fn_jpegconsumeinput jpegconsumeinput;
++fn_jpegdestroydecompress jpegdestroydecompress; 
++fn_jpeghasmultiplescans jpeghasmultiplescans;
++fn_jpegstartdecompress jpegstartdecompress;
++fn_jpegreadheader jpegreadheader;
++fn_jpegfinishoutput jpegfinishoutput;
++fn_jpegreadscanlines jpegreadscanlines;
++fn_jpegresynctorestart jpegresynctorestart;
++fn_jpegcreatedecompress jpegcreatedecompress;
++
+ /* Initialize the Java VM instance variable when the library is
+    first loaded */
+ JavaVM *jvm;
+@@ -462,6 +490,76 @@
+ Java_sun_awt_image_JPEGImageDecoder_initIDs(JNIEnv *env, jclass cls,
+                                             jclass InputStreamClass)
+ {
++#if JPEG_LIB_VERSION >= 80
++    void *handle = dlopen("libjpeg.so.8", RTLD_LAZY | RTLD_GLOBAL);
++#else
++#if JPEG_LIB_VERSION >= 70
++    void *handle = dlopen("libjpeg.so.7", RTLD_LAZY | RTLD_GLOBAL);
++#else
++    void *handle = dlopen("libjpeg.so.62", RTLD_LAZY | RTLD_GLOBAL);
++#endif
++#endif
++ 
++    jpegstderror = (fn_jpegstderror)dlsym(handle, "jpeg_std_error");
++    if (jpegstderror == NULL) {
++       dlclose(handle);
++    }
++
++    jpegdestroydecompress = (fn_jpegdestroydecompress)dlsym(handle, "jpeg_destroy_decompress");
++    if (jpegdestroydecompress == NULL) {
++       dlclose(handle);
++    }  
++
++    jpegcreatedecompress = (fn_jpegcreatedecompress)dlsym(handle, "jpeg_CreateDecompress");
++    if (jpegcreatedecompress == NULL) {
++       dlclose(handle);
++    }
++
++    jpegreadheader = (fn_jpegreadheader)dlsym(handle, "jpeg_read_header");
++    if (jpegreadheader == NULL) {
++       dlclose(handle);
++    }
++
++    jpeghasmultiplescans = (fn_jpeghasmultiplescans)dlsym(handle, "jpeg_has_multiple_scans");
++    if (jpeghasmultiplescans == NULL) {
++       dlclose(handle);
++    }
++
++    jpegstartdecompress = (fn_jpegstartdecompress)dlsym(handle, "jpeg_start_decompress");
++    if (jpegstartdecompress == NULL) {
++       dlclose(handle);
++    }
++
++    jpegconsumeinput = (fn_jpegconsumeinput)dlsym(handle, "jpeg_consume_input");
++    if (jpegconsumeinput == NULL) {
++       dlclose(handle);
++    }
++
++    jpegstartoutput = (fn_jpegstartoutput)dlsym(handle, "jpeg_start_output");
++    if (jpegstartoutput == NULL) {
++       dlclose(handle);
++    }
++
++    jpegfinishdecompress = (fn_jpegfinishdecompress)dlsym(handle, "jpeg_finish_decompress");
++    if (jpegfinishdecompress == NULL) {
++       dlclose(handle);
++    }
++
++    jpegreadscanlines = (fn_jpegreadscanlines)dlsym(handle, "jpeg_read_scanlines");
++    if (jpegreadscanlines == NULL) {
++       dlclose(handle);
++    }
++
++    jpegfinishoutput = (fn_jpegfinishoutput)dlsym(handle, "jpeg_finish_output");
++    if (jpegfinishoutput == NULL) {
++       dlclose(handle);
++    }
++
++    jpegresynctorestart = (fn_jpegresynctorestart)dlsym(handle, "jpeg_resync_to_restart");
++    if (jpegresynctorestart == NULL) {
++       dlclose(handle);
++    }
++
+     sendHeaderInfoID = (*env)->GetMethodID(env, cls, "sendHeaderInfo",
+                                            "(IIZZZ)Z");
+     sendPixelsByteID = (*env)->GetMethodID(env, cls, "sendPixels", "([BI)Z");
+@@ -519,7 +617,7 @@
+   /* Step 1: allocate and initialize JPEG decompression object */
+ 
+   /* We set up the normal JPEG error routines, then override error_exit. */
+-  cinfo.err = jpeg_std_error(&jerr.pub);
++  cinfo.err = jpegstderror(&jerr.pub);
+   jerr.pub.error_exit = sun_jpeg_error_exit;
+ 
+   /* We need to setup our own print routines */
+@@ -530,7 +628,7 @@
+     /* If we get here, the JPEG code has signaled an error.
+      * We need to clean up the JPEG object, close the input file, and return.
+      */
+-    jpeg_destroy_decompress(&cinfo);
++    jpegdestroydecompress(&cinfo);
+     RELEASE_ARRAYS(env, &jsrc);
+     if (!(*env)->ExceptionOccurred(env)) {
+         char buffer[JMSG_LENGTH_MAX];
+@@ -541,7 +639,7 @@
+     return;
+   }
+   /* Now we can initialize the JPEG decompression object. */
+-  jpeg_create_decompress(&cinfo);
++  jpegcreatedecompress(&cinfo, JPEG_LIB_VERSION, (size_t) sizeof(struct jpeg_decompress_struct));
+ 
+   /* Step 2: specify data source (eg, a file) */
+ 
+@@ -555,17 +653,17 @@
+   jsrc.pub.init_source = sun_jpeg_init_source;
+   jsrc.pub.fill_input_buffer = sun_jpeg_fill_input_buffer;
+   jsrc.pub.skip_input_data = sun_jpeg_skip_input_data;
+-  jsrc.pub.resync_to_restart = jpeg_resync_to_restart; /* use default method */
++  jsrc.pub.resync_to_restart = jpegresynctorestart; /* use default method */
+   jsrc.pub.term_source = sun_jpeg_term_source;
+   if (!GET_ARRAYS(env, &jsrc)) {
+-    jpeg_destroy_decompress(&cinfo);
++    jpegdestroydecompress(&cinfo);
+     return;
+   }
+   /* Step 3: read file parameters with jpeg_read_header() */
+ 
+-  (void) jpeg_read_header(&cinfo, TRUE);
++  (void) jpegreadheader(&cinfo, TRUE);
+   /* select buffered-image mode if it is a progressive JPEG only */
+-  buffered_mode = cinfo.buffered_image = jpeg_has_multiple_scans(&cinfo);
++  buffered_mode = cinfo.buffered_image = jpeghasmultiplescans(&cinfo);
+   grayscale = (cinfo.out_color_space == JCS_GRAYSCALE);
+ #ifdef YCCALPHA
+   hasalpha = (cinfo.out_color_space == JCS_RGBA);
+@@ -584,7 +682,7 @@
+                                   grayscale, hasalpha, buffered_mode);
+   if ((*env)->ExceptionOccurred(env) || !ret) {
+     /* No more interest in this image... */
+-    jpeg_destroy_decompress(&cinfo);
++    jpegdestroydecompress(&cinfo);
+     return;
+   }
+   /* Make a one-row-high sample array with enough room to expand to ints */
+@@ -595,7 +693,7 @@
+   }
+ 
+   if (jsrc.hOutputBuffer == 0 || !GET_ARRAYS(env, &jsrc)) {
+-    jpeg_destroy_decompress(&cinfo);
++    jpegdestroydecompress(&cinfo);
+     return;
+   }
+ 
+@@ -613,7 +711,7 @@
+ 
+   /* Step 5: Start decompressor */
+ 
+-  jpeg_start_decompress(&cinfo);
++  jpegstartdecompress(&cinfo);
+ 
+   /* We may need to do some setup of our own at this point before reading
+    * the data.  After jpeg_start_decompress() we have the correct scaled
+@@ -638,28 +736,28 @@
+           do {
+               sun_jpeg_fill_suspended_buffer(&cinfo);
+               jsrc.suspendable = TRUE;
+-              ret = jpeg_consume_input(&cinfo);
++	      ret = jpegconsumeinput(&cinfo);
+               jsrc.suspendable = FALSE;
+           } while (ret != JPEG_SUSPENDED && ret != JPEG_REACHED_EOI);
+           if (ret == JPEG_REACHED_EOI) {
+               final_pass = TRUE;
+               cinfo.dct_method = JDCT_ISLOW;
+           }
+-          jpeg_start_output(&cinfo, cinfo.input_scan_number);
++	  jpegstartoutput(&cinfo, cinfo.input_scan_number);
+       }
+       while (cinfo.output_scanline < cinfo.output_height) {
+           if (! final_pass) {
+               do {
+                   sun_jpeg_fill_suspended_buffer(&cinfo);
+                   jsrc.suspendable = TRUE;
+-                  ret = jpeg_consume_input(&cinfo);
++		  ret = jpegconsumeinput(&cinfo);
+                   jsrc.suspendable = FALSE;
+               } while (ret != JPEG_SUSPENDED && ret != JPEG_REACHED_EOI);
+               if (ret == JPEG_REACHED_EOI) {
+                   break;
+               }
+           }
+-          (void) jpeg_read_scanlines(&cinfo, (JSAMPARRAY) &(jsrc.outbuf), 1);
++	  (void) jpegreadscanlines(&cinfo, (JSAMPARRAY) &(jsrc.outbuf), 1);
+ 
+           if (grayscale) {
+               RELEASE_ARRAYS(env, &jsrc);
+@@ -695,18 +793,18 @@
+           if ((*env)->ExceptionOccurred(env) || !ret ||
+               !GET_ARRAYS(env, &jsrc)) {
+               /* No more interest in this image... */
+-              jpeg_destroy_decompress(&cinfo);
++	      jpegdestroydecompress(&cinfo);
+               return;
+           }
+       }
+       if (buffered_mode) {
+-          jpeg_finish_output(&cinfo);
++	  jpegfinishoutput(&cinfo);
+       }
+   } while (! final_pass);
+ 
+   /* Step 7: Finish decompression */
+ 
+-  (void) jpeg_finish_decompress(&cinfo);
++  (void) jpegfinishdecompress(&cinfo);
+   /* We can ignore the return value since suspension is not possible
+    * with the stdio data source.
+    * (nor with the Java data source)
+@@ -715,7 +813,7 @@
+   /* Step 8: Release JPEG decompression object */
+ 
+   /* This is an important step since it will release a good deal of memory. */
+-  jpeg_destroy_decompress(&cinfo);
++  jpegdestroydecompress(&cinfo);
+ 
+   /* After finish_decompress, we can close the input file.
+    * Here we postpone it until after no more JPEG errors are possible,
+diff -Nru openjdk.orig/jdk/src/share/native/sun/awt/image/jpeg/jpegint.h openjdk/jdk/src/share/native/sun/awt/image/jpeg/jpegint.h
+--- openjdk.orig/jdk/src/share/native/sun/awt/image/jpeg/jpegint.h	2011-02-28 16:06:45.000000000 +0000
++++ openjdk/jdk/src/share/native/sun/awt/image/jpeg/jpegint.h	1970-01-01 01:00:00.000000000 +0100
 @@ -1,396 +0,0 @@
 -/*
 - * reserved comment block
@@ -20715,9 +21643,9 @@
 -struct jvirt_barray_control { long dummy; };
 -#endif
 -#endif /* INCOMPLETE_TYPES_BROKEN */
-diff -ruN ..openjdk.old/openjdk/jdk/src/share/native/sun/awt/image/jpeg/jpeglib.h openjdk/jdk/src/share/native/sun/awt/image/jpeg/jpeglib.h
---- ..openjdk.old/openjdk/jdk/src/share/native/sun/awt/image/jpeg/jpeglib.h	2007-10-30 04:38:52.000000000 -0400
-+++ openjdk/jdk/src/share/native/sun/awt/image/jpeg/jpeglib.h	1969-12-31 19:00:00.000000000 -0500
+diff -Nru openjdk.orig/jdk/src/share/native/sun/awt/image/jpeg/jpeglib.h openjdk/jdk/src/share/native/sun/awt/image/jpeg/jpeglib.h
+--- openjdk.orig/jdk/src/share/native/sun/awt/image/jpeg/jpeglib.h	2011-02-28 16:06:45.000000000 +0000
++++ openjdk/jdk/src/share/native/sun/awt/image/jpeg/jpeglib.h	1970-01-01 01:00:00.000000000 +0100
 @@ -1,1100 +0,0 @@
 -/*
 - * reserved comment block
@@ -21819,9 +22747,9 @@
 -#endif
 -
 -#endif /* JPEGLIB_H */
-diff -ruN ..openjdk.old/openjdk/jdk/src/share/native/sun/awt/image/jpeg/jquant1.c openjdk/jdk/src/share/native/sun/awt/image/jpeg/jquant1.c
---- ..openjdk.old/openjdk/jdk/src/share/native/sun/awt/image/jpeg/jquant1.c	2007-10-30 04:38:52.000000000 -0400
-+++ openjdk/jdk/src/share/native/sun/awt/image/jpeg/jquant1.c	1969-12-31 19:00:00.000000000 -0500
+diff -Nru openjdk.orig/jdk/src/share/native/sun/awt/image/jpeg/jquant1.c openjdk/jdk/src/share/native/sun/awt/image/jpeg/jquant1.c
+--- openjdk.orig/jdk/src/share/native/sun/awt/image/jpeg/jquant1.c	2011-02-28 16:06:45.000000000 +0000
++++ openjdk/jdk/src/share/native/sun/awt/image/jpeg/jquant1.c	1970-01-01 01:00:00.000000000 +0100
 @@ -1,860 +0,0 @@
 -/*
 - * reserved comment block
@@ -22683,9 +23611,9 @@
 -}
 -
 -#endif /* QUANT_1PASS_SUPPORTED */
-diff -ruN ..openjdk.old/openjdk/jdk/src/share/native/sun/awt/image/jpeg/jquant2.c openjdk/jdk/src/share/native/sun/awt/image/jpeg/jquant2.c
---- ..openjdk.old/openjdk/jdk/src/share/native/sun/awt/image/jpeg/jquant2.c	2007-10-30 04:38:52.000000000 -0400
-+++ openjdk/jdk/src/share/native/sun/awt/image/jpeg/jquant2.c	1969-12-31 19:00:00.000000000 -0500
+diff -Nru openjdk.orig/jdk/src/share/native/sun/awt/image/jpeg/jquant2.c openjdk/jdk/src/share/native/sun/awt/image/jpeg/jquant2.c
+--- openjdk.orig/jdk/src/share/native/sun/awt/image/jpeg/jquant2.c	2011-02-28 16:06:45.000000000 +0000
++++ openjdk/jdk/src/share/native/sun/awt/image/jpeg/jquant2.c	1970-01-01 01:00:00.000000000 +0100
 @@ -1,1314 +0,0 @@
 -/*
 - * reserved comment block
@@ -24001,9 +24929,9 @@
 -}
 -
 -#endif /* QUANT_2PASS_SUPPORTED */
-diff -ruN ..openjdk.old/openjdk/jdk/src/share/native/sun/awt/image/jpeg/jutils.c openjdk/jdk/src/share/native/sun/awt/image/jpeg/jutils.c
---- ..openjdk.old/openjdk/jdk/src/share/native/sun/awt/image/jpeg/jutils.c	2007-10-30 04:38:52.000000000 -0400
-+++ openjdk/jdk/src/share/native/sun/awt/image/jpeg/jutils.c	1969-12-31 19:00:00.000000000 -0500
+diff -Nru openjdk.orig/jdk/src/share/native/sun/awt/image/jpeg/jutils.c openjdk/jdk/src/share/native/sun/awt/image/jpeg/jutils.c
+--- openjdk.orig/jdk/src/share/native/sun/awt/image/jpeg/jutils.c	2011-02-28 16:06:45.000000000 +0000
++++ openjdk/jdk/src/share/native/sun/awt/image/jpeg/jutils.c	1970-01-01 01:00:00.000000000 +0100
 @@ -1,183 +0,0 @@
 -/*
 - * reserved comment block
@@ -24188,9 +25116,9 @@
 -  }
 -#endif
 -}
-diff -ruN ..openjdk.old/openjdk/jdk/src/share/native/sun/awt/image/jpeg/jversion.h openjdk/jdk/src/share/native/sun/awt/image/jpeg/jversion.h
---- ..openjdk.old/openjdk/jdk/src/share/native/sun/awt/image/jpeg/jversion.h	2007-10-30 04:38:52.000000000 -0400
-+++ openjdk/jdk/src/share/native/sun/awt/image/jpeg/jversion.h	1969-12-31 19:00:00.000000000 -0500
+diff -Nru openjdk.orig/jdk/src/share/native/sun/awt/image/jpeg/jversion.h openjdk/jdk/src/share/native/sun/awt/image/jpeg/jversion.h
+--- openjdk.orig/jdk/src/share/native/sun/awt/image/jpeg/jversion.h	2011-02-28 16:06:45.000000000 +0000
++++ openjdk/jdk/src/share/native/sun/awt/image/jpeg/jversion.h	1970-01-01 01:00:00.000000000 +0100
 @@ -1,18 +0,0 @@
 -/*
 - * reserved comment block
@@ -24210,9 +25138,9 @@
 -#define JVERSION        "6b  27-Mar-1998"
 -
 -#define JCOPYRIGHT      "Copyright (C) 1998, Thomas G. Lane"
-diff -ruN ..openjdk.old/openjdk/jdk/src/share/native/sun/awt/image/jpeg/README openjdk/jdk/src/share/native/sun/awt/image/jpeg/README
---- ..openjdk.old/openjdk/jdk/src/share/native/sun/awt/image/jpeg/README	2007-10-30 04:38:50.000000000 -0400
-+++ openjdk/jdk/src/share/native/sun/awt/image/jpeg/README	1969-12-31 19:00:00.000000000 -0500
+diff -Nru openjdk.orig/jdk/src/share/native/sun/awt/image/jpeg/README openjdk/jdk/src/share/native/sun/awt/image/jpeg/README
+--- openjdk.orig/jdk/src/share/native/sun/awt/image/jpeg/README	2011-02-28 16:06:45.000000000 +0000
++++ openjdk/jdk/src/share/native/sun/awt/image/jpeg/README	1970-01-01 01:00:00.000000000 +0100
 @@ -1,385 +0,0 @@
 -The Independent JPEG Group's JPEG software
 -==========================================
@@ -24599,8 +25527,21 @@
 -As always, speeding things up is of great interest.
 -
 -Please send bug reports, offers of help, etc. to jpeg-info@uunet.uu.net.
---- ../oipenjdkb23/openjdk/jdk/src/share/native/sun/awt/splashscreen/splashscreen_jpeg.c	2007-10-30 04:38:55.000000000 -0400
-+++ openjdk/jdk/src/share/native/sun/awt/splashscreen/splashscreen_jpeg.c	2007-11-13 15:42:04.000000000 -0500
+diff -Nru openjdk.orig/jdk/src/share/native/sun/awt/splashscreen/splashscreen_gif.c openjdk/jdk/src/share/native/sun/awt/splashscreen/splashscreen_gif.c
+--- openjdk.orig/jdk/src/share/native/sun/awt/splashscreen/splashscreen_gif.c	2011-02-28 16:06:46.000000000 +0000
++++ openjdk/jdk/src/share/native/sun/awt/splashscreen/splashscreen_gif.c	2012-06-08 11:34:13.879956049 +0100
+@@ -26,7 +26,7 @@
+ #include "splashscreen_impl.h"
+ #include "splashscreen_gfx.h"
+ 
+-#include "../giflib/gif_lib.h"
++#include <gif_lib.h>
+ 
+ #define GIF_TRANSPARENT     0x01
+ #define GIF_USER_INPUT      0x02
+diff -Nru openjdk.orig/jdk/src/share/native/sun/awt/splashscreen/splashscreen_jpeg.c openjdk/jdk/src/share/native/sun/awt/splashscreen/splashscreen_jpeg.c
+--- openjdk.orig/jdk/src/share/native/sun/awt/splashscreen/splashscreen_jpeg.c	2011-02-28 16:06:46.000000000 +0000
++++ openjdk/jdk/src/share/native/sun/awt/splashscreen/splashscreen_jpeg.c	2012-06-08 11:34:13.899956377 +0100
 @@ -25,9 +25,8 @@
  
  #include "splashscreen_impl.h"
@@ -24630,937 +25571,15 @@
      }
  
      src = (stream_src_ptr) cinfo->src;
---- ../opienjdkb23/openjdk/jdk/make/com/sun/java/pack/Makefile	2007-10-30 04:39:48.000000000 -0400
-+++ openjdk/jdk/make/com/sun/java/pack/Makefile	2007-11-13 16:47:23.000000000 -0500
-@@ -64,23 +64,21 @@
-   ZIPOBJDIR = $(OUTPUTDIR)/tmp/sun/java.util.zip/zip/$(OBJDIRNAME)
- 
-   ZIPOBJS =  $(ZIPOBJDIR)/zcrc32.$(OBJECT_SUFFIX) \
--	     $(ZIPOBJDIR)/deflate.$(OBJECT_SUFFIX) \
--	     $(ZIPOBJDIR)/trees.$(OBJECT_SUFFIX) \
--	     $(ZIPOBJDIR)/zadler32.$(OBJECT_SUFFIX) \
--	     $(ZIPOBJDIR)/zutil.$(OBJECT_SUFFIX) \
--	     $(ZIPOBJDIR)/inflate.$(OBJECT_SUFFIX) \
--	     $(ZIPOBJDIR)/infblock.$(OBJECT_SUFFIX) \
--	     $(ZIPOBJDIR)/infcodes.$(OBJECT_SUFFIX) \
--	     $(ZIPOBJDIR)/inftrees.$(OBJECT_SUFFIX) \
--	     $(ZIPOBJDIR)/infutil.$(OBJECT_SUFFIX) \
--	     $(ZIPOBJDIR)/inffast.$(OBJECT_SUFFIX)
--
--  ZINCLUDE=-I$(SHARE_SRC)/native/java/util/zip/zlib-1.1.3
--  OTHER_CXXFLAGS += $(ZINCLUDE)
--  LDDFLAGS += $(ZIPOBJS)
-+            $(ZIPOBJDIR)/deflate.$(OBJECT_SUFFIX) \
-+            $(ZIPOBJDIR)/trees.$(OBJECT_SUFFIX) \
-+            $(ZIPOBJDIR)/zadler32.$(OBJECT_SUFFIX) \
-+            $(ZIPOBJDIR)/zutil.$(OBJECT_SUFFIX) \
-+            $(ZIPOBJDIR)/inflate.$(OBJECT_SUFFIX) \
-+            $(ZIPOBJDIR)/infblock.$(OBJECT_SUFFIX) \
-+            $(ZIPOBJDIR)/infcodes.$(OBJECT_SUFFIX) \
-+            $(ZIPOBJDIR)/inftrees.$(OBJECT_SUFFIX) \
-+            $(ZIPOBJDIR)/infutil.$(OBJECT_SUFFIX) \
-+            $(ZIPOBJDIR)/inffast.$(OBJECT_SUFFIX)
-+
-+  OTHER_LDLIBS += -lz
- else
-   OTHER_CXXFLAGS += -DNO_ZLIB -DUNPACK_JNI
--  OTHER_LDLIBS += $(JVMLIB)
-+  OTHER_LDLIBS += -lz $(JVMLIB)
- endif
- 
- CXXFLAGS_DBG += -DFULL
-@@ -102,12 +100,12 @@
-   COMPILER_WARNINGS_FATAL=false
- else
-   LDOUTPUT = -o #Have a space 
--  LDDFLAGS += -lc
-+  LDDFLAGS += -lz -lc
-   OTHER_LDLIBS  += $(LIBCXX)
- # setup the list of libraries to link in...
- ifeq ($(PLATFORM), linux)
- ifeq ("$(CC_VER_MAJOR)", "3")
--  OTHER_LDLIBS  += -Wl,-Bstatic -lgcc_eh -Wl,-Bdynamic
-+  OTHER_LDLIBS  += -lz -Wl,-Bstatic -lgcc_eh -Wl,-Bdynamic
- endif
- endif #LINUX
- endif #PLATFORM
---- penjdk6/jdk/make/java/jli/Makefile	2008-02-12 04:03:55.000000000 -0500
-+++ openjdk/jdk/make/java/jli/Makefile	2008-02-14 16:40:45.000000000 -0500
-@@ -44,8 +44,6 @@
- 
- include $(BUILDDIR)/common/Defs.gmk
- 
--ZLIB_VERSION = 1.1.3
--ZIP_SRC = $(SHARE_SRC)/native/java/util/zip/zlib-$(ZLIB_VERSION)
- LAUNCHER_SHARE_SRC = $(SHARE_SRC)/bin
- LAUNCHER_PLATFORM_SRC = $(PLATFORM_SRC)/bin
- 
-@@ -56,22 +54,14 @@
- 	parse_manifest.c \
- 	version_comp.c \
- 	wildcard.c \
--	jli_util.c \
--	inflate.c \
--	infblock.c \
--	inftrees.c \
--	infcodes.c \
--	inffast.c \
--	infutil.c \
--	zadler32.c \
--	zutil.c
-+	jli_util.c
- 
- OTHER_CPPFLAGS += -DEXPAND_CLASSPATH_WILDCARDS
- 
- ifneq (,$(findstring $(PLATFORM), linux solaris))	# UNIX systems
- 	LIB_LOCATION = $(LIBDIR)/$(LIBARCH)/jli
- 	# Guarantee very limited dependencies
--	LDLIBS = -lc
-+	LDLIBS = -lz -lc 
- endif
- 
- ifeq ($(PLATFORM), windows)
-@@ -98,7 +88,6 @@
- 
- OTHER_INCLUDES += -I$(LAUNCHER_SHARE_SRC)
- OTHER_INCLUDES += -I$(LAUNCHER_PLATFORM_SRC)
--OTHER_INCLUDES += -I$(ZIP_SRC)
- 
- #
- # Library to compile.
-@@ -139,5 +128,5 @@
- #
- # Add to ambient vpath so we pick up the library files
- #
--vpath %.c $(LAUNCHER_SHARE_SRC) $(ZIP_SRC)
-+vpath %.c $(LAUNCHER_SHARE_SRC)
- 
---- openjdk6/jdk/src/share/native/com/sun/java/util/jar/pack/defines.h	2008-02-12 04:08:07.000000000 -0500
-+++ openjdk/jdk/src/share/native/com/sun/java/util/jar/pack/defines.h	2008-02-14 16:57:24.000000000 -0500
-@@ -87,11 +87,7 @@
- // bytes and byte arrays
- 
- typedef unsigned int uint;
--#ifdef _LP64
--typedef unsigned int uLong; // Historical zlib, should be 32-bit.
--#else
- typedef unsigned long uLong;
--#endif
- #ifdef _MSC_VER
- typedef LONGLONG        jlong;
- typedef DWORDLONG       julong;
---- openjdkold/jdk/src/share/native/sun/awt/image/jpeg/imageioJPEG.c	2008-02-12 04:08:13.000000000 -0500
-+++ openjdk/jdk/src/share/native/sun/awt/image/jpeg/imageioJPEG.c	2008-02-26 11:02:52.000000000 -0500
-@@ -51,7 +51,9 @@
- 
- /* headers from the JPEG library */
- #include <jpeglib.h>
--#include "jerror.h"
-+#include <jerror.h>
-+
-+#include <dlfcn.h>
- 
- #undef MAX
- #define MAX(a,b)        ((a) > (b) ? (a) : (b))
-@@ -75,6 +77,62 @@
- static jfieldID JPEGHuffmanTable_lengthsID;
- static jfieldID JPEGHuffmanTable_valuesID;
- 
-+static void initIDs();
-+
-+typedef struct jpeg_error_mgr * (*fn_jpegstderror)(struct jpeg_error_mgr *);
-+typedef boolean (*fn_jpegresynctorestart)(j_decompress_ptr, int);
-+typedef JDIMENSION (*fn_jpegreadscanlines)(j_decompress_ptr, JSAMPARRAY, JDIMENSION);
-+typedef boolean (*fn_jpegfinishoutput)(j_decompress_ptr);
-+typedef int (*fn_jpegreadheader)(j_decompress_ptr, boolean);
-+typedef boolean (*fn_jpegstartdecompress)(j_decompress_ptr);
-+typedef boolean (*fn_jpeghasmultiplescans)(j_decompress_ptr);
-+typedef boolean (*fn_jpegfinishdecompress)(j_decompress_ptr);
-+typedef boolean (*fn_jpegstartoutput)(j_decompress_ptr, int);
-+typedef void (*fn_jpegabort)(j_common_ptr);
-+typedef void (*fn_jpegabortdecompress)(j_decompress_ptr);
-+typedef JHUFF_TBL * (*fn_jpegallochufftable)(j_common_ptr);
-+typedef JQUANT_TBL * (*fn_jpegallocquanttable)(j_common_ptr);
-+typedef void (*fn_jpegcreatecompress)(j_compress_ptr, int, size_t);
-+typedef void (*fn_jpegcreatedecompress)(j_decompress_ptr, int, size_t);
-+typedef void (*fn_jpegdestroy)(j_common_ptr);
-+typedef void (*fn_jpegfinishcompress)(j_compress_ptr);
-+typedef boolean (*fn_jpeginputcomplete)(j_decompress_ptr);
-+typedef void (*fn_jpegsavemarkers)(j_decompress_ptr, int, unsigned int);
-+typedef void (*fn_jpegsetcolorspace)(j_compress_ptr, J_COLOR_SPACE);
-+typedef void (*fn_jpegsetdefaults)(j_compress_ptr);
-+typedef void (*fn_jpegsimpleprogression)(j_compress_ptr);
-+typedef void (*fn_jpegstartcompress)(j_compress_ptr, boolean);
-+typedef void (*fn_jpegsuppresstables)(j_compress_ptr, boolean);
-+typedef JDIMENSION (*fn_jpegwritescanlines)(j_compress_ptr, JSAMPARRAY, JDIMENSION);
-+typedef void (*fn_jpegwritetables)(j_compress_ptr);
-+
-+fn_jpegabort jpegabort;
-+fn_jpegabortdecompress jpegabortdecompress;
-+fn_jpegallochufftable jpegallochufftable;
-+fn_jpegallocquanttable jpegallocquanttable;
-+fn_jpegcreatecompress jpegcreatecompress;
-+fn_jpegcreatedecompress jpegcreatedecompress;
-+fn_jpegdestroy jpegdestroy;
-+fn_jpegfinishcompress jpegfinishcompress;
-+fn_jpeginputcomplete jpeginputcomplete;
-+fn_jpegsavemarkers jpegsavemarkers;
-+fn_jpegsetcolorspace jpegsetcolorspace;
-+fn_jpegsetdefaults jpegsetdefaults;
-+fn_jpegsimpleprogression jpegsimpleprogression;
-+fn_jpegstartcompress jpegstartcompress;
-+fn_jpegsuppresstables jpegsuppresstables;
-+fn_jpegwritescanlines jpegwritescanlines;
-+fn_jpegwritetables jpegwritetables;
-+fn_jpegstderror jpegstderror;
-+fn_jpegstartoutput jpegstartoutput;
-+fn_jpegfinishdecompress jpegfinishdecompress;
-+fn_jpeghasmultiplescans jpeghasmultiplescans;
-+fn_jpegstartdecompress jpegstartdecompress;
-+fn_jpegreadheader jpegreadheader;
-+fn_jpegfinishoutput jpegfinishoutput;
-+fn_jpegreadscanlines jpegreadscanlines;
-+fn_jpegresynctorestart jpegresynctorestart;
-+
- /*
-  * Defined in jpegdecoder.c.  Copy code from there if and
-  * when that disappears. */
-@@ -615,7 +673,7 @@
-         return;
-     }
- 
--    jpeg_abort(cinfo);  // Frees any markers, but not tables
-+    jpegabort(cinfo);  // Frees any markers, but not tables
- 
- }
- 
-@@ -640,7 +698,7 @@
-         return;
-     }
- 
--    jpeg_abort(cinfo);  // Does not reset tables
-+    jpegabort(cinfo);  // Does not reset tables
- 
- }
- 
-@@ -658,7 +716,7 @@
-             free(cinfo->dest);
-             cinfo->dest = NULL;
-         }
--        jpeg_destroy(info);
-+        jpegdestroy(info);
-         free(info);
-     }
- }
-@@ -694,14 +752,14 @@
-             decomp = (j_decompress_ptr) cinfo;
-             if (decomp->quant_tbl_ptrs[i] == NULL) {
-                 decomp->quant_tbl_ptrs[i] =
--                    jpeg_alloc_quant_table(cinfo);
-+                    jpegallocquanttable(cinfo);
-             }
-             quant_ptr = decomp->quant_tbl_ptrs[i];
-         } else {
-             comp = (j_compress_ptr) cinfo;
-             if (comp->quant_tbl_ptrs[i] == NULL) {
-                 comp->quant_tbl_ptrs[i] =
--                    jpeg_alloc_quant_table(cinfo);
-+                    jpegallocquanttable(cinfo);
-             }
-             quant_ptr = comp->quant_tbl_ptrs[i];
-         }
-@@ -777,14 +835,14 @@
-             decomp = (j_decompress_ptr) cinfo;
-             if (decomp->dc_huff_tbl_ptrs[i] == NULL) {
-                 decomp->dc_huff_tbl_ptrs[i] =
--                    jpeg_alloc_huff_table(cinfo);
-+                    jpegallochufftable(cinfo);
-             }
-             huff_ptr = decomp->dc_huff_tbl_ptrs[i];
-         } else {
-             comp = (j_compress_ptr) cinfo;
-             if (comp->dc_huff_tbl_ptrs[i] == NULL) {
-                 comp->dc_huff_tbl_ptrs[i] =
--                    jpeg_alloc_huff_table(cinfo);
-+                    jpegallochufftable(cinfo);
-             }
-             huff_ptr = comp->dc_huff_tbl_ptrs[i];
-         }
-@@ -798,14 +856,14 @@
-             decomp = (j_decompress_ptr) cinfo;
-             if (decomp->ac_huff_tbl_ptrs[i] == NULL) {
-                 decomp->ac_huff_tbl_ptrs[i] =
--                    jpeg_alloc_huff_table(cinfo);
-+                    jpegallochufftable(cinfo);
-             }
-             huff_ptr = decomp->ac_huff_tbl_ptrs[i];
-         } else {
-             comp = (j_compress_ptr) cinfo;
-             if (comp->ac_huff_tbl_ptrs[i] == NULL) {
-                 comp->ac_huff_tbl_ptrs[i] =
--                    jpeg_alloc_huff_table(cinfo);
-+                    jpegallochufftable(cinfo);
-             }
-             huff_ptr = comp->ac_huff_tbl_ptrs[i];
-         }
-@@ -1346,6 +1404,8 @@
-      jclass ImageInputStreamClass,
-      jclass qTableClass,
-      jclass huffClass) {
-+   
-+    initIDs();
- 
-     ImageInputStream_readID = (*env)->GetMethodID(env,
-                                                   ImageInputStreamClass,
-@@ -1431,7 +1491,7 @@
-     }
- 
-     /* We set up the normal JPEG error routines, then override error_exit. */
--    cinfo->err = jpeg_std_error(&(jerr->pub));
-+    cinfo->err = jpegstderror(&(jerr->pub));
-     jerr->pub.error_exit = sun_jpeg_error_exit;
-     /* We need to setup our own print routines */
-     jerr->pub.output_message = sun_jpeg_output_message;
-@@ -1448,11 +1508,11 @@
-     }
- 
-     /* Perform library initialization */
--    jpeg_create_decompress(cinfo);
-+    jpegcreatedecompress(cinfo, JPEG_LIB_VERSION, (size_t) sizeof(struct jpeg_decompress_struct));
- 
-     // Set up to keep any APP2 markers, as these might contain ICC profile
-     // data
--    jpeg_save_markers(cinfo, ICC_MARKER, 0xFFFF);
-+    jpegsavemarkers(cinfo, ICC_MARKER, 0xFFFF);
- 
-     /*
-      * Now set up our source.
-@@ -1470,7 +1530,7 @@
-     cinfo->src->init_source = imageio_init_source;
-     cinfo->src->fill_input_buffer = imageio_fill_input_buffer;
-     cinfo->src->skip_input_data = imageio_skip_input_data;
--    cinfo->src->resync_to_restart = jpeg_resync_to_restart; // use default
-+    cinfo->src->resync_to_restart = jpegresynctorestart; // use default
-     cinfo->src->term_source = imageio_term_source;
- 
-     /* set up the association to persist for future calls */
-@@ -1588,7 +1648,7 @@
-         src->bytes_in_buffer = 0;
-     }
- 
--    ret = jpeg_read_header(cinfo, FALSE);
-+    ret = jpegreadheader(cinfo, FALSE);
- 
-     if (ret == JPEG_HEADER_TABLES_ONLY) {
-         retval = JNI_TRUE;
-@@ -1709,7 +1769,7 @@
-                                cinfo->num_components,
-                                read_icc_profile(env, cinfo));
-         if (reset) {
--            jpeg_abort_decompress(cinfo);
-+            jpegabortdecompress(cinfo);
-         }
-     }
- 
-@@ -1933,7 +1993,7 @@
-                    TRUE);
-     }
- 
--    progressive = jpeg_has_multiple_scans(cinfo);
-+    progressive = jpeghasmultiplescans(cinfo);
-     if (progressive) {
-         cinfo->buffered_image = TRUE;
-         cinfo->input_scan_number = minProgressivePass+1; // Java count from 0
-@@ -1945,7 +2005,7 @@
- 
-     data->streamBuf.suspendable = FALSE;
- 
--    jpeg_start_decompress(cinfo);
-+    jpegstartdecompress(cinfo);
- 
-     // loop over progressive passes
-     done = FALSE;
-@@ -1953,7 +2013,7 @@
-         if (progressive) {
-             // initialize the next pass.  Note that this skips up to
-             // the first interesting pass.
--            jpeg_start_output(cinfo, cinfo->input_scan_number);
-+            jpegstartoutput(cinfo, cinfo->input_scan_number);
-             if (wantUpdates) {
-                 (*env)->CallVoidMethod(env, this,
-                                        JPEGImageReader_passStartedID,
-@@ -1969,7 +2029,7 @@
-         // Skip until the first interesting line
-         while ((data->abortFlag == JNI_FALSE)
-                && ((jint)cinfo->output_scanline < sourceYStart)) {
--            jpeg_read_scanlines(cinfo, &scanLinePtr, 1);
-+            jpegreadscanlines(cinfo, &scanLinePtr, 1);
-         }
- 
-         scanlineLimit = sourceYStart+sourceHeight;
-@@ -1982,7 +2042,7 @@
-         while ((data->abortFlag == JNI_FALSE)
-                && ((jint)cinfo->output_scanline < scanlineLimit)) {
- 
--            jpeg_read_scanlines(cinfo, &scanLinePtr, 1);
-+            jpegreadscanlines(cinfo, &scanLinePtr, 1);
- 
-             // Now mangle it into our buffer
-             out = data->pixelBuf.buf.bp;
-@@ -2037,13 +2097,13 @@
-                 skipLines = linesLeft;
-             }
-             for(i = 0; i < skipLines; i++) {
--                jpeg_read_scanlines(cinfo, &scanLinePtr, 1);
-+                jpegreadscanlines(cinfo, &scanLinePtr, 1);
-             }
-         }
-         if (progressive) {
--            jpeg_finish_output(cinfo); // Increments pass counter
-+            jpegfinishoutput(cinfo); // Increments pass counter
-             // Call Java to notify pass complete
--            if (jpeg_input_complete(cinfo)
-+            if (jpeginputcomplete(cinfo)
-                 || (cinfo->input_scan_number > maxProgressivePass)) {
-                 done = TRUE;
-             }
-@@ -2063,9 +2123,9 @@
-     if (cinfo->output_scanline == cinfo->output_height) {
-         //    if ((cinfo->output_scanline == cinfo->output_height) &&
-         //(jpeg_input_complete(cinfo))) {  // We read the whole file
--        jpeg_finish_decompress(cinfo);
-+        jpegfinishdecompress(cinfo);
-     } else {
--        jpeg_abort_decompress(cinfo);
-+        jpegabortdecompress(cinfo);
-     }
- 
-     free(scanLinePtr);
-@@ -2111,7 +2171,7 @@
- 
-     cinfo = (j_decompress_ptr) data->jpegObj;
- 
--    jpeg_abort_decompress(cinfo);
-+    jpegabortdecompress(cinfo);
- }
- 
- 
-@@ -2317,6 +2377,150 @@
- 
- /********************** end of destination manager ************/
- 
-+METHODDEF(void)
-+initIDs()
-+{
-+#if JPEG_LIB_VERSION >= 80
-+    void *handle = dlopen("libjpeg.so.8", RTLD_LAZY | RTLD_GLOBAL);
-+#else
-+#if JPEG_LIB_VERSION >= 70
-+    void *handle = dlopen("libjpeg.so.7", RTLD_LAZY | RTLD_GLOBAL);
-+#else
-+    void *handle = dlopen("libjpeg.so.62", RTLD_LAZY | RTLD_GLOBAL);
-+#endif
-+#endif
-+    
-+    jpegstderror = (fn_jpegstderror)dlsym(handle, "jpeg_std_error");
-+    if (jpegstderror == NULL) {
-+       dlclose(handle);
-+    }
-+
-+    jpegreadheader = (fn_jpegreadheader)dlsym(handle, "jpeg_read_header");
-+    if (jpegreadheader == NULL) {
-+       dlclose(handle);
-+    }
-+
-+    jpeghasmultiplescans = (fn_jpeghasmultiplescans)dlsym(handle, "jpeg_has_multiple_scans");
-+    if (jpeghasmultiplescans == NULL) {
-+       dlclose(handle);
-+    }
-+
-+    jpegstartdecompress = (fn_jpegstartdecompress)dlsym(handle, "jpeg_start_decompress");
-+    if (jpegstartdecompress == NULL) {
-+       dlclose(handle);
-+    }
-+
-+    jpegstartoutput = (fn_jpegstartoutput)dlsym(handle, "jpeg_start_output");
-+    if (jpegstartoutput == NULL) {
-+       dlclose(handle);
-+    }
-+
-+    jpegfinishdecompress = (fn_jpegfinishdecompress)dlsym(handle, "jpeg_finish_decompress");
-+    if (jpegfinishdecompress == NULL) {
-+       dlclose(handle);
-+    }
-+
-+    jpegreadscanlines = (fn_jpegreadscanlines)dlsym(handle, "jpeg_read_scanlines");
-+    if (jpegreadscanlines == NULL) {
-+       dlclose(handle);
-+    }
-+
-+    jpegfinishoutput = (fn_jpegfinishoutput)dlsym(handle, "jpeg_finish_output");
-+    if (jpegfinishoutput == NULL) {
-+       dlclose(handle);
-+    }
-+
-+    jpegresynctorestart = (fn_jpegresynctorestart)dlsym(handle, "jpeg_resync_to_restart");
-+    if (jpegresynctorestart == NULL) {
-+       dlclose(handle);
-+    }
-+
-+    jpegabort = (fn_jpegabort)dlsym(handle, "jpeg_abort");
-+    if (jpegabort == NULL) {
-+       dlclose(handle);
-+    }
-+ 
-+    jpegabortdecompress = (fn_jpegabortdecompress)dlsym(handle, "jpeg_abort_decompress");
-+    if (jpegabortdecompress == NULL) {
-+       dlclose(handle);
-+    }
-+
-+    jpegallochufftable = (fn_jpegallochufftable)dlsym(handle, "jpeg_alloc_huff_table");
-+    if (jpegallochufftable == NULL) {
-+       dlclose(handle);
-+    }
-+
-+    jpegallocquanttable = (fn_jpegallocquanttable)dlsym(handle, "jpeg_alloc_quant_table");
-+    if (jpegallocquanttable == NULL) {
-+       dlclose(handle);
-+    }
-+
-+    jpegcreatecompress = (fn_jpegcreatecompress)dlsym(handle, "jpeg_CreateCompress");
-+    if (jpegcreatecompress == NULL) {
-+       dlclose(handle);
-+    }
-+
-+    jpegcreatedecompress = (fn_jpegcreatedecompress)dlsym(handle, "jpeg_CreateDecompress");
-+    if (jpegcreatedecompress == NULL) {
-+       dlclose(handle);
-+    }
-+
-+    jpegdestroy = (fn_jpegdestroy)dlsym(handle, "jpeg_destroy");
-+    if (jpegdestroy == NULL) {
-+       dlclose(handle);
-+    }
-+
-+    jpegfinishcompress = (fn_jpegfinishcompress)dlsym(handle, "jpeg_finish_compress");
-+    if (jpegfinishcompress == NULL) {
-+       dlclose(handle);
-+    }
-+
-+    jpeginputcomplete = (fn_jpeginputcomplete)dlsym(handle, "jpeg_input_complete");
-+    if (jpeginputcomplete == NULL) {
-+       dlclose(handle);
-+    }
-+
-+    jpegsavemarkers = (fn_jpegsavemarkers)dlsym(handle, "jpeg_save_markers");
-+    if (jpegsavemarkers == NULL) {
-+       dlclose(handle);
-+    }
-+
-+    jpegsetcolorspace = (fn_jpegsetcolorspace)dlsym(handle, "jpeg_set_colorspace");
-+    if (jpegsetcolorspace == NULL) {
-+       dlclose(handle);
-+    }
-+
-+    jpegsetdefaults = (fn_jpegsetdefaults)dlsym(handle, "jpeg_set_defaults");
-+    if (jpegsetdefaults == NULL) {
-+       dlclose(handle);
-+    }
-+
-+    jpegsimpleprogression = (fn_jpegsimpleprogression)dlsym(handle, "jpeg_simple_progression");
-+    if (jpegsimpleprogression == NULL) {
-+       dlclose(handle);
-+    }
-+
-+    jpegstartcompress = (fn_jpegstartcompress)dlsym(handle, "jpeg_start_compress");
-+    if (jpegstartcompress == NULL) {
-+       dlclose(handle);
-+    }
-+
-+    jpegsuppresstables = (fn_jpegsuppresstables)dlsym(handle, "jpeg_suppress_tables");
-+    if (jpegsuppresstables == NULL) {
-+       dlclose(handle);
-+    }
-+
-+    jpegwritescanlines = (fn_jpegwritescanlines)dlsym(handle, "jpeg_write_scanlines");
-+    if (jpegwritescanlines == NULL) {
-+       dlclose(handle);
-+    }
-+
-+    jpegwritetables = (fn_jpegwritetables)dlsym(handle, "jpeg_write_tables");
-+    if (jpegwritetables == NULL) {
-+       dlclose(handle);
-+    }
-+}
-+
- /********************** Writer JNI calls **********************/
- 
- 
-@@ -2328,6 +2527,8 @@
-      jclass qTableClass,
-      jclass huffClass) {
- 
-+    initIDs();
-+
-     ImageOutputStream_writeID = (*env)->GetMethodID(env,
-                                                     IOSClass,
-                                                     "write",
-@@ -2401,7 +2602,7 @@
-     }
- 
-     /* We set up the normal JPEG error routines, then override error_exit. */
--    cinfo->err = jpeg_std_error(&(jerr->pub));
-+    cinfo->err = jpegstderror(&(jerr->pub));
-     jerr->pub.error_exit = sun_jpeg_error_exit;
-     /* We need to setup our own print routines */
-     jerr->pub.output_message = sun_jpeg_output_message;
-@@ -2418,7 +2619,7 @@
-     }
- 
-     /* Perform library initialization */
--    jpeg_create_compress(cinfo);
-+    jpegcreatecompress(cinfo, JPEG_LIB_VERSION, (size_t) sizeof(struct jpeg_compress_struct));
- 
-     /* Now set up the destination  */
-     dest = malloc(sizeof(struct jpeg_destination_mgr));
-@@ -2527,7 +2728,7 @@
-         return;
-     }
- 
--    jpeg_suppress_tables(cinfo, TRUE);  // Suppress writing of any current
-+    jpegsuppresstables(cinfo, TRUE);  // Suppress writing of any current
- 
-     data->streamBuf.suspendable = FALSE;
-     if (qtables != NULL) {
-@@ -2542,7 +2743,7 @@
-                    DCHuffmanTables, ACHuffmanTables, TRUE);
-     }
- 
--    jpeg_write_tables(cinfo); // Flushes the buffer for you
-+    jpegwritetables(cinfo); // Flushes the buffer for you
-     RELEASE_ARRAYS(env, data, NULL);
- }
- 
-@@ -2698,9 +2899,9 @@
-     cinfo->input_components = numBands;
-     cinfo->in_color_space = inCs;
- 
--    jpeg_set_defaults(cinfo);
-+    jpegsetdefaults(cinfo);
- 
--    jpeg_set_colorspace(cinfo, outCs);
-+    jpegsetcolorspace(cinfo, outCs);
- 
-     cinfo->optimize_coding = optimize;
- 
-@@ -2737,7 +2938,7 @@
-     (*env)->ReleaseIntArrayElements(env, QtableSelectors,
-                                     qsels, JNI_ABORT);
- 
--    jpeg_suppress_tables(cinfo, TRUE);  // Disable writing any current
-+    jpegsuppresstables(cinfo, TRUE);  // Disable writing any current
- 
-     qlen = setQTables(env, (j_common_ptr) cinfo, qtables, writeDQT);
- 
-@@ -2762,7 +2963,7 @@
- 
-     if (progressive) {
-         if (numScans == 0) { // then use default scans
--            jpeg_simple_progression(cinfo);
-+            jpegsimpleprogression(cinfo);
-         } else {
-             cinfo->num_scans = numScans;
-             // Copy the scanInfo to a local array
-@@ -2804,7 +3005,7 @@
- #endif
- 
-     // start the compressor; tables must already be set
--    jpeg_start_compress(cinfo, FALSE); // Leaves sent_table alone
-+    jpegstartcompress(cinfo, FALSE); // Leaves sent_table alone
- 
-     if (haveMetadata) {
-         // Flush the buffer
-@@ -2868,7 +3069,7 @@
-             }
-         }
-         // write it out
--        jpeg_write_scanlines(cinfo, (JSAMPARRAY)&scanLinePtr, 1);
-+        jpegwritescanlines(cinfo, (JSAMPARRAY)&scanLinePtr, 1);
-         targetLine += stepY;
-     }
- 
-@@ -2877,9 +3078,9 @@
-      * so use jpeg_abort instead of jpeg_finish_compress.
-      */
-     if (cinfo->next_scanline == cinfo->image_height) {
--        jpeg_finish_compress(cinfo);  // Flushes buffer with term_dest
-+        jpegfinishcompress(cinfo);  // Flushes buffer with term_dest
-     } else {
--        jpeg_abort((j_common_ptr)cinfo);
-+        jpegabort((j_common_ptr)cinfo);
-     }
-     free(scanLinePtr);
-     RELEASE_ARRAYS(env, data, NULL);
---- openjdkold/jdk/src/share/native/sun/awt/image/jpeg/jpegdecoder.c	2008-02-12 04:08:14.000000000 -0500
-+++ openjdk/jdk/src/share/native/sun/awt/image/jpeg/jpegdecoder.c	2008-02-26 11:01:37.000000000 -0500
-@@ -45,7 +45,9 @@
- #undef boolean
- #undef FAR
- #include <jpeglib.h>
--#include "jerror.h"
-+#include <jerror.h>
-+#include <dlfcn.h>
-+
- 
- /* The method IDs we cache. Note that the last two belongs to the
-  * java.io.InputStream class.
-@@ -56,6 +58,32 @@
- static jmethodID InputStream_readID;
- static jmethodID InputStream_availableID;
- 
-+typedef struct jpeg_error_mgr * (*fn_jpegstderror)(struct jpeg_error_mgr *);
-+typedef void (*fn_jpegcreatedecompress)(j_decompress_ptr, int, size_t);
-+typedef boolean (*fn_jpegresynctorestart)(j_decompress_ptr, int);
-+typedef JDIMENSION (*fn_jpegreadscanlines)(j_decompress_ptr, JSAMPARRAY, JDIMENSION);
-+typedef boolean (*fn_jpegfinishoutput)(j_decompress_ptr);
-+typedef int (*fn_jpegreadheader)(j_decompress_ptr, boolean);
-+typedef boolean (*fn_jpegstartdecompress)(j_decompress_ptr);
-+typedef boolean (*fn_jpeghasmultiplescans)(j_decompress_ptr);
-+typedef void (*fn_jpegdestroydecompress)(j_decompress_ptr);
-+typedef int (*fn_jpegconsumeinput)(j_decompress_ptr);
-+typedef boolean (*fn_jpegfinishdecompress)(j_decompress_ptr);
-+typedef boolean (*fn_jpegstartoutput)(j_decompress_ptr, int);
-+
-+fn_jpegstderror jpegstderror;
-+fn_jpegstartoutput jpegstartoutput;
-+fn_jpegfinishdecompress jpegfinishdecompress;
-+fn_jpegconsumeinput jpegconsumeinput;
-+fn_jpegdestroydecompress jpegdestroydecompress; 
-+fn_jpeghasmultiplescans jpeghasmultiplescans;
-+fn_jpegstartdecompress jpegstartdecompress;
-+fn_jpegreadheader jpegreadheader;
-+fn_jpegfinishoutput jpegfinishoutput;
-+fn_jpegreadscanlines jpegreadscanlines;
-+fn_jpegresynctorestart jpegresynctorestart;
-+fn_jpegcreatedecompress jpegcreatedecompress;
-+
- /* Initialize the Java VM instance variable when the library is
-    first loaded */
- JavaVM *jvm;
-@@ -462,6 +493,76 @@
- Java_sun_awt_image_JPEGImageDecoder_initIDs(JNIEnv *env, jclass cls,
-                                             jclass InputStreamClass)
- {
-+#if JPEG_LIB_VERSION >= 80
-+    void *handle = dlopen("libjpeg.so.8", RTLD_LAZY | RTLD_GLOBAL);
-+#else
-+#if JPEG_LIB_VERSION >= 70
-+    void *handle = dlopen("libjpeg.so.7", RTLD_LAZY | RTLD_GLOBAL);
-+#else
-+    void *handle = dlopen("libjpeg.so.62", RTLD_LAZY | RTLD_GLOBAL);
-+#endif
-+#endif
-+ 
-+    jpegstderror = (fn_jpegstderror)dlsym(handle, "jpeg_std_error");
-+    if (jpegstderror == NULL) {
-+       dlclose(handle);
-+    }
-+
-+    jpegdestroydecompress = (fn_jpegdestroydecompress)dlsym(handle, "jpeg_destroy_decompress");
-+    if (jpegdestroydecompress == NULL) {
-+       dlclose(handle);
-+    }  
-+
-+    jpegcreatedecompress = (fn_jpegcreatedecompress)dlsym(handle, "jpeg_CreateDecompress");
-+    if (jpegcreatedecompress == NULL) {
-+       dlclose(handle);
-+    }
-+
-+    jpegreadheader = (fn_jpegreadheader)dlsym(handle, "jpeg_read_header");
-+    if (jpegreadheader == NULL) {
-+       dlclose(handle);
-+    }
-+
-+    jpeghasmultiplescans = (fn_jpeghasmultiplescans)dlsym(handle, "jpeg_has_multiple_scans");
-+    if (jpeghasmultiplescans == NULL) {
-+       dlclose(handle);
-+    }
-+
-+    jpegstartdecompress = (fn_jpegstartdecompress)dlsym(handle, "jpeg_start_decompress");
-+    if (jpegstartdecompress == NULL) {
-+       dlclose(handle);
-+    }
-+
-+    jpegconsumeinput = (fn_jpegconsumeinput)dlsym(handle, "jpeg_consume_input");
-+    if (jpegconsumeinput == NULL) {
-+       dlclose(handle);
-+    }
-+
-+    jpegstartoutput = (fn_jpegstartoutput)dlsym(handle, "jpeg_start_output");
-+    if (jpegstartoutput == NULL) {
-+       dlclose(handle);
-+    }
-+
-+    jpegfinishdecompress = (fn_jpegfinishdecompress)dlsym(handle, "jpeg_finish_decompress");
-+    if (jpegfinishdecompress == NULL) {
-+       dlclose(handle);
-+    }
-+
-+    jpegreadscanlines = (fn_jpegreadscanlines)dlsym(handle, "jpeg_read_scanlines");
-+    if (jpegreadscanlines == NULL) {
-+       dlclose(handle);
-+    }
-+
-+    jpegfinishoutput = (fn_jpegfinishoutput)dlsym(handle, "jpeg_finish_output");
-+    if (jpegfinishoutput == NULL) {
-+       dlclose(handle);
-+    }
-+
-+    jpegresynctorestart = (fn_jpegresynctorestart)dlsym(handle, "jpeg_resync_to_restart");
-+    if (jpegresynctorestart == NULL) {
-+       dlclose(handle);
-+    }
-+
-     sendHeaderInfoID = (*env)->GetMethodID(env, cls, "sendHeaderInfo",
-                                            "(IIZZZ)Z");
-     sendPixelsByteID = (*env)->GetMethodID(env, cls, "sendPixels", "([BI)Z");
-@@ -519,7 +612,7 @@
-   /* Step 1: allocate and initialize JPEG decompression object */
- 
-   /* We set up the normal JPEG error routines, then override error_exit. */
--  cinfo.err = jpeg_std_error(&jerr.pub);
-+  cinfo.err = jpegstderror(&jerr.pub);
-   jerr.pub.error_exit = sun_jpeg_error_exit;
- 
-   /* We need to setup our own print routines */
-@@ -530,7 +623,7 @@
-     /* If we get here, the JPEG code has signaled an error.
-      * We need to clean up the JPEG object, close the input file, and return.
-      */
--    jpeg_destroy_decompress(&cinfo);
-+    jpegdestroydecompress(&cinfo);
-     RELEASE_ARRAYS(env, &jsrc);
-     if (!(*env)->ExceptionOccurred(env)) {
-         char buffer[JMSG_LENGTH_MAX];
-@@ -541,7 +634,7 @@
-     return;
-   }
-   /* Now we can initialize the JPEG decompression object. */
--  jpeg_create_decompress(&cinfo);
-+  jpegcreatedecompress(&cinfo, JPEG_LIB_VERSION, (size_t) sizeof(struct jpeg_decompress_struct));
- 
-   /* Step 2: specify data source (eg, a file) */
- 
-@@ -555,17 +648,17 @@
-   jsrc.pub.init_source = sun_jpeg_init_source;
-   jsrc.pub.fill_input_buffer = sun_jpeg_fill_input_buffer;
-   jsrc.pub.skip_input_data = sun_jpeg_skip_input_data;
--  jsrc.pub.resync_to_restart = jpeg_resync_to_restart; /* use default method */
-+  jsrc.pub.resync_to_restart = jpegresynctorestart; /* use default method */
-   jsrc.pub.term_source = sun_jpeg_term_source;
-   if (!GET_ARRAYS(env, &jsrc)) {
--    jpeg_destroy_decompress(&cinfo);
-+    jpegdestroydecompress(&cinfo);
-     return;
-   }
-   /* Step 3: read file parameters with jpeg_read_header() */
- 
--  (void) jpeg_read_header(&cinfo, TRUE);
-+  (void) jpegreadheader(&cinfo, TRUE);
-   /* select buffered-image mode if it is a progressive JPEG only */
--  buffered_mode = cinfo.buffered_image = jpeg_has_multiple_scans(&cinfo);
-+  buffered_mode = cinfo.buffered_image = jpeghasmultiplescans(&cinfo);
-   grayscale = (cinfo.out_color_space == JCS_GRAYSCALE);
- #ifdef YCCALPHA
-   hasalpha = (cinfo.out_color_space == JCS_RGBA);
-@@ -584,7 +677,7 @@
-                                   grayscale, hasalpha, buffered_mode);
-   if ((*env)->ExceptionOccurred(env) || !ret) {
-     /* No more interest in this image... */
--    jpeg_destroy_decompress(&cinfo);
-+    jpegdestroydecompress(&cinfo);
-     return;
-   }
-   /* Make a one-row-high sample array with enough room to expand to ints */
-@@ -595,7 +688,7 @@
-   }
- 
-   if (jsrc.hOutputBuffer == 0 || !GET_ARRAYS(env, &jsrc)) {
--    jpeg_destroy_decompress(&cinfo);
-+    jpegdestroydecompress(&cinfo);
-     return;
-   }
- 
-@@ -613,7 +706,7 @@
- 
-   /* Step 5: Start decompressor */
- 
--  jpeg_start_decompress(&cinfo);
-+  jpegstartdecompress(&cinfo);
- 
-   /* We may need to do some setup of our own at this point before reading
-    * the data.  After jpeg_start_decompress() we have the correct scaled
-@@ -638,28 +731,28 @@
-           do {
-               sun_jpeg_fill_suspended_buffer(&cinfo);
-               jsrc.suspendable = TRUE;
--              ret = jpeg_consume_input(&cinfo);
-+	      ret = jpegconsumeinput(&cinfo);
-               jsrc.suspendable = FALSE;
-           } while (ret != JPEG_SUSPENDED && ret != JPEG_REACHED_EOI);
-           if (ret == JPEG_REACHED_EOI) {
-               final_pass = TRUE;
-               cinfo.dct_method = JDCT_ISLOW;
-           }
--          jpeg_start_output(&cinfo, cinfo.input_scan_number);
-+	  jpegstartoutput(&cinfo, cinfo.input_scan_number);
-       }
-       while (cinfo.output_scanline < cinfo.output_height) {
-           if (! final_pass) {
-               do {
-                   sun_jpeg_fill_suspended_buffer(&cinfo);
-                   jsrc.suspendable = TRUE;
--                  ret = jpeg_consume_input(&cinfo);
-+		  ret = jpegconsumeinput(&cinfo);
-                   jsrc.suspendable = FALSE;
-               } while (ret != JPEG_SUSPENDED && ret != JPEG_REACHED_EOI);
-               if (ret == JPEG_REACHED_EOI) {
-                   break;
-               }
-           }
--          (void) jpeg_read_scanlines(&cinfo, (JSAMPARRAY) &(jsrc.outbuf), 1);
-+	  (void) jpegreadscanlines(&cinfo, (JSAMPARRAY) &(jsrc.outbuf), 1);
- 
-           if (grayscale) {
-               RELEASE_ARRAYS(env, &jsrc);
-@@ -695,18 +788,18 @@
-           if ((*env)->ExceptionOccurred(env) || !ret ||
-               !GET_ARRAYS(env, &jsrc)) {
-               /* No more interest in this image... */
--              jpeg_destroy_decompress(&cinfo);
-+	      jpegdestroydecompress(&cinfo);
-               return;
-           }
-       }
-       if (buffered_mode) {
--          jpeg_finish_output(&cinfo);
-+	  jpegfinishoutput(&cinfo);
-       }
-   } while (! final_pass);
- 
-   /* Step 7: Finish decompression */
- 
--  (void) jpeg_finish_decompress(&cinfo);
-+  (void) jpegfinishdecompress(&cinfo);
-   /* We can ignore the return value since suspension is not possible
-    * with the stdio data source.
-    * (nor with the Java data source)
-@@ -715,7 +808,7 @@
-   /* Step 8: Release JPEG decompression object */
- 
-   /* This is an important step since it will release a good deal of memory. */
--  jpeg_destroy_decompress(&cinfo);
-+  jpegdestroydecompress(&cinfo);
- 
-   /* After finish_decompress, we can close the input file.
-    * Here we postpone it until after no more JPEG errors are possible,
+diff -Nru openjdk.orig/jdk/src/share/native/sun/awt/splashscreen/splashscreen_png.c openjdk/jdk/src/share/native/sun/awt/splashscreen/splashscreen_png.c
+--- openjdk.orig/jdk/src/share/native/sun/awt/splashscreen/splashscreen_png.c	2011-02-28 16:06:46.000000000 +0000
++++ openjdk/jdk/src/share/native/sun/awt/splashscreen/splashscreen_png.c	2012-06-08 11:34:13.879956049 +0100
+@@ -25,7 +25,7 @@
+ 
+ #include "splashscreen_impl.h"
+ 
+-#include "../libpng/png.h"
++#include <png.h>
+ 
+ #include <setjmp.h>
+ 
--- a/patches/nio2.patch	Thu May 31 12:40:08 2012 +0200
+++ b/patches/nio2.patch	Fri Jun 08 14:23:28 2012 +0100
@@ -1,6 +1,6 @@
 diff -Nru openjdk.orig/jdk/make/common/shared/Defs-javadoc.gmk openjdk/jdk/make/common/shared/Defs-javadoc.gmk
 --- openjdk.orig/jdk/make/common/shared/Defs-javadoc.gmk	2011-02-28 16:06:10.000000000 +0000
-+++ openjdk/jdk/make/common/shared/Defs-javadoc.gmk	2011-05-23 23:20:58.640622650 +0100
++++ openjdk/jdk/make/common/shared/Defs-javadoc.gmk	2012-06-08 12:23:40.171977726 +0100
 @@ -41,6 +41,7 @@
  TREEAPI_FIRST_COPYRIGHT_YEAR        = 2005
  JNLP_FIRST_COPYRIGHT_YEAR           = 1998
@@ -11,7 +11,7 @@
  COMPANY_NAME = Oracle and/or its affiliates
 diff -Nru openjdk.orig/jdk/make/docs/CORE_PKGS.gmk openjdk/jdk/make/docs/CORE_PKGS.gmk
 --- openjdk.orig/jdk/make/docs/CORE_PKGS.gmk	2011-02-28 16:06:10.000000000 +0000
-+++ openjdk/jdk/make/docs/CORE_PKGS.gmk	2011-05-23 23:20:58.656622907 +0100
++++ openjdk/jdk/make/docs/CORE_PKGS.gmk	2012-06-08 12:23:40.183977920 +0100
 @@ -36,6 +36,7 @@
    sunw.*                   \
    com.sun.*                \
@@ -22,7 +22,7 @@
    org.w3c.dom.html         \
 diff -Nru openjdk.orig/jdk/make/docs/Makefile openjdk/jdk/make/docs/Makefile
 --- openjdk.orig/jdk/make/docs/Makefile	2011-02-28 16:06:10.000000000 +0000
-+++ openjdk/jdk/make/docs/Makefile	2011-05-23 23:20:58.656622907 +0100
++++ openjdk/jdk/make/docs/Makefile	2012-06-08 12:23:40.183977920 +0100
 @@ -1076,6 +1076,58 @@
  
  #############################################################
@@ -84,7 +84,7 @@
  $(DIRECTORY_CACHE): $(ALL_SOURCE_DIRS)
 diff -Nru openjdk.orig/jdk/make/docs/NON_CORE_PKGS.gmk openjdk/jdk/make/docs/NON_CORE_PKGS.gmk
 --- openjdk.orig/jdk/make/docs/NON_CORE_PKGS.gmk	2011-02-28 16:06:10.000000000 +0000
-+++ openjdk/jdk/make/docs/NON_CORE_PKGS.gmk	2011-05-23 23:20:58.656622907 +0100
++++ openjdk/jdk/make/docs/NON_CORE_PKGS.gmk	2012-06-08 12:23:40.183977920 +0100
 @@ -65,6 +65,16 @@
  HTTPSERVER_PKGS  = com.sun.net.httpserver       \
                     com.sun.net.httpserver.spi 
@@ -111,9 +111,9 @@
                     $(HTTPSERVER_PKGS) \
                     $(SMARTCARDIO_PKGS)
 diff -Nru openjdk.orig/jdk/make/java/java/FILES_java.gmk openjdk/jdk/make/java/java/FILES_java.gmk
---- openjdk.orig/jdk/make/java/java/FILES_java.gmk	2011-05-23 23:03:36.000000000 +0100
-+++ openjdk/jdk/make/java/java/FILES_java.gmk	2011-05-23 23:20:58.656622907 +0100
-@@ -518,6 +518,13 @@
+--- openjdk.orig/jdk/make/java/java/FILES_java.gmk	2012-06-08 12:23:07.051441446 +0100
++++ openjdk/jdk/make/java/java/FILES_java.gmk	2012-06-08 12:23:40.183977920 +0100
+@@ -519,6 +519,13 @@
      sun/misc/JavaLangAccess.java \
      sun/misc/JavaIOAccess.java \
      sun/misc/JavaIODeleteOnExitAccess.java \
@@ -129,8 +129,8 @@
  
  FILES_java = $(JAVA_JAVA_java)
 diff -Nru openjdk.orig/jdk/make/java/nio/FILES_java.gmk openjdk/jdk/make/java/nio/FILES_java.gmk
---- openjdk.orig/jdk/make/java/nio/FILES_java.gmk	2011-05-23 23:03:36.000000000 +0100
-+++ openjdk/jdk/make/java/nio/FILES_java.gmk	2011-05-23 23:20:58.656622907 +0100
+--- openjdk.orig/jdk/make/java/nio/FILES_java.gmk	2012-06-08 12:23:07.351446303 +0100
++++ openjdk/jdk/make/java/nio/FILES_java.gmk	2012-06-08 12:23:40.183977920 +0100
 @@ -75,12 +75,13 @@
          sun/nio/ch/DefaultSelectorProvider.java \
  	sun/nio/ch/DirectBuffer.java \
@@ -330,8 +330,8 @@
  
  FILES_java = $(FILES_src) $(FILES_gen)
 diff -Nru openjdk.orig/jdk/make/java/nio/Makefile openjdk/jdk/make/java/nio/Makefile
---- openjdk.orig/jdk/make/java/nio/Makefile	2011-05-23 23:03:36.000000000 +0100
-+++ openjdk/jdk/make/java/nio/Makefile	2011-05-23 23:20:58.656622907 +0100
+--- openjdk.orig/jdk/make/java/nio/Makefile	2012-06-08 12:23:07.351446303 +0100
++++ openjdk/jdk/make/java/nio/Makefile	2012-06-08 12:23:40.183977920 +0100
 @@ -40,6 +40,11 @@
  SNIO_SRC = $(SHARE_SRC)/classes/sun/nio
  SNIO_GEN = $(GENSRCDIR)/sun/nio
@@ -679,7 +679,7 @@
  .PHONY: sources
 diff -Nru openjdk.orig/jdk/make/java/nio/mapfile-linux openjdk/jdk/make/java/nio/mapfile-linux
 --- openjdk.orig/jdk/make/java/nio/mapfile-linux	2011-02-28 16:06:11.000000000 +0000
-+++ openjdk/jdk/make/java/nio/mapfile-linux	2011-05-23 23:20:58.656622907 +0100
++++ openjdk/jdk/make/java/nio/mapfile-linux	2012-06-08 12:23:40.183977920 +0100
 @@ -20,6 +20,14 @@
  		Java_sun_nio_ch_EPollArrayWrapper_interrupt;
  		Java_sun_nio_ch_EPollArrayWrapper_offsetofData;
@@ -797,7 +797,7 @@
  		*;
 diff -Nru openjdk.orig/jdk/make/java/nio/mapfile-solaris openjdk/jdk/make/java/nio/mapfile-solaris
 --- openjdk.orig/jdk/make/java/nio/mapfile-solaris	2011-02-28 16:06:11.000000000 +0000
-+++ openjdk/jdk/make/java/nio/mapfile-solaris	2011-05-23 23:20:58.656622907 +0100
++++ openjdk/jdk/make/java/nio/mapfile-solaris	2012-06-08 12:23:40.183977920 +0100
 @@ -73,6 +73,75 @@
  		Java_sun_nio_ch_ServerSocketChannelImpl_listen;
                  Java_sun_nio_ch_SocketChannelImpl_checkConnect;
@@ -876,7 +876,7 @@
  		*;
 diff -Nru openjdk.orig/jdk/make/mkdemo/Makefile openjdk/jdk/make/mkdemo/Makefile
 --- openjdk.orig/jdk/make/mkdemo/Makefile	2011-02-28 16:06:11.000000000 +0000
-+++ openjdk/jdk/make/mkdemo/Makefile	2011-05-23 23:20:58.656622907 +0100
++++ openjdk/jdk/make/mkdemo/Makefile	2012-06-08 12:23:40.183977920 +0100
 @@ -31,7 +31,7 @@
  PRODUCT = demos
  include $(BUILDDIR)/common/Defs.gmk
@@ -888,7 +888,7 @@
  	$(SUBDIRS-loop)
 diff -Nru openjdk.orig/jdk/make/mksample/nio/Makefile openjdk/jdk/make/mksample/nio/Makefile
 --- openjdk.orig/jdk/make/mksample/nio/Makefile	2011-02-28 16:06:11.000000000 +0000
-+++ openjdk/jdk/make/mksample/nio/Makefile	2011-05-23 23:20:58.656622907 +0100
++++ openjdk/jdk/make/mksample/nio/Makefile	2012-06-08 12:23:40.183977920 +0100
 @@ -31,7 +31,7 @@
  PRODUCT = java
  include $(BUILDDIR)/common/Defs.gmk
@@ -899,9 +899,9 @@
  	$(SUBDIRS-loop)
  
 diff -Nru openjdk.orig/jdk/src/share/classes/java/io/File.java openjdk/jdk/src/share/classes/java/io/File.java
---- openjdk.orig/jdk/src/share/classes/java/io/File.java	2011-02-28 16:06:21.000000000 +0000
-+++ openjdk/jdk/src/share/classes/java/io/File.java	2011-05-23 23:20:58.660622971 +0100
-@@ -1958,6 +1958,13 @@
+--- openjdk.orig/jdk/src/share/classes/java/io/File.java	2012-06-08 12:23:05.671419102 +0100
++++ openjdk/jdk/src/share/classes/java/io/File.java	2012-06-08 12:23:40.187977985 +0100
+@@ -1968,6 +1968,13 @@
                  }
              }
          );
@@ -913,11 +913,11 @@
 +            }
 +        );            									    
      }
- 
- 
+     
+     // Set up JavaIOAccess in SharedSecrets
 diff -Nru openjdk.orig/jdk/src/share/classes/java/net/NetworkInterface.java openjdk/jdk/src/share/classes/java/net/NetworkInterface.java
---- openjdk.orig/jdk/src/share/classes/java/net/NetworkInterface.java	2011-05-23 23:03:33.000000000 +0100
-+++ openjdk/jdk/src/share/classes/java/net/NetworkInterface.java	2011-05-23 23:21:33.029175274 +0100
+--- openjdk.orig/jdk/src/share/classes/java/net/NetworkInterface.java	2012-06-08 12:23:05.327413532 +0100
++++ openjdk/jdk/src/share/classes/java/net/NetworkInterface.java	2012-06-08 12:23:40.187977985 +0100
 @@ -531,4 +531,16 @@
      }
  
@@ -937,7 +937,7 @@
  }
 diff -Nru openjdk.orig/jdk/src/share/classes/java/util/concurrent/ThreadPoolExecutor.java openjdk/jdk/src/share/classes/java/util/concurrent/ThreadPoolExecutor.java
 --- openjdk.orig/jdk/src/share/classes/java/util/concurrent/ThreadPoolExecutor.java	2011-02-28 16:06:24.000000000 +0000
-+++ openjdk/jdk/src/share/classes/java/util/concurrent/ThreadPoolExecutor.java	2011-05-23 23:20:58.660622971 +0100
++++ openjdk/jdk/src/share/classes/java/util/concurrent/ThreadPoolExecutor.java	2012-06-08 12:23:40.187977985 +0100
 @@ -2004,4 +2004,23 @@
              }
          }
@@ -964,7 +964,7 @@
  }
 diff -Nru openjdk.orig/jdk/src/share/classes/sun/misc/Unsafe.java openjdk/jdk/src/share/classes/sun/misc/Unsafe.java
 --- openjdk.orig/jdk/src/share/classes/sun/misc/Unsafe.java	2011-02-28 16:06:34.000000000 +0000
-+++ openjdk/jdk/src/share/classes/sun/misc/Unsafe.java	2011-05-23 23:20:58.660622971 +0100
++++ openjdk/jdk/src/share/classes/sun/misc/Unsafe.java	2012-06-08 12:23:40.187977985 +0100
 @@ -504,9 +504,33 @@
      /**
       * Sets all bytes in a given block of memory to a copy of another
@@ -1013,7 +1013,7 @@
       * allocation of a given array class.  However, arrays of "narrow" types
 diff -Nru openjdk.orig/jdk/src/share/classes/sun/nio/ch/DatagramChannelImpl.java openjdk/jdk/src/share/classes/sun/nio/ch/DatagramChannelImpl.java
 --- openjdk.orig/jdk/src/share/classes/sun/nio/ch/DatagramChannelImpl.java	2011-02-28 16:06:34.000000000 +0000
-+++ openjdk/jdk/src/share/classes/sun/nio/ch/DatagramChannelImpl.java	2011-05-23 23:20:58.660622971 +0100
++++ openjdk/jdk/src/share/classes/sun/nio/ch/DatagramChannelImpl.java	2012-06-08 12:23:40.187977985 +0100
 @@ -29,11 +29,30 @@
  import java.io.IOException;
  import java.net.*;
@@ -1481,7 +1481,7 @@
  }
 diff -Nru openjdk.orig/jdk/src/share/classes/sun/nio/ch/FileChannelImpl.java openjdk/jdk/src/share/classes/sun/nio/ch/FileChannelImpl.java
 --- openjdk.orig/jdk/src/share/classes/sun/nio/ch/FileChannelImpl.java	2011-02-28 16:06:34.000000000 +0000
-+++ openjdk/jdk/src/share/classes/sun/nio/ch/FileChannelImpl.java	2011-05-23 23:20:58.660622971 +0100
++++ openjdk/jdk/src/share/classes/sun/nio/ch/FileChannelImpl.java	2012-06-08 12:23:40.187977985 +0100
 @@ -32,8 +32,15 @@
  import java.io.IOException;
  import java.nio.ByteBuffer;
@@ -1532,7 +1532,7 @@
          int rv = -1;
 diff -Nru openjdk.orig/jdk/src/share/classes/sun/nio/ch/Net.java openjdk/jdk/src/share/classes/sun/nio/ch/Net.java
 --- openjdk.orig/jdk/src/share/classes/sun/nio/ch/Net.java	2011-02-28 16:06:35.000000000 +0000
-+++ openjdk/jdk/src/share/classes/sun/nio/ch/Net.java	2011-05-23 23:20:58.660622971 +0100
++++ openjdk/jdk/src/share/classes/sun/nio/ch/Net.java	2012-06-08 12:23:40.187977985 +0100
 @@ -30,6 +30,15 @@
  import java.net.*;
  import java.nio.channels.*;
@@ -1894,7 +1894,7 @@
  }
 diff -Nru openjdk.orig/jdk/src/share/classes/sun/nio/ch/SelectorProviderImpl.java openjdk/jdk/src/share/classes/sun/nio/ch/SelectorProviderImpl.java
 --- openjdk.orig/jdk/src/share/classes/sun/nio/ch/SelectorProviderImpl.java	2011-02-28 16:06:35.000000000 +0000
-+++ openjdk/jdk/src/share/classes/sun/nio/ch/SelectorProviderImpl.java	2011-05-23 23:20:58.660622971 +0100
++++ openjdk/jdk/src/share/classes/sun/nio/ch/SelectorProviderImpl.java	2012-06-08 12:23:40.187977985 +0100
 @@ -1,5 +1,5 @@
  /*
 - * Copyright (c) 2000, 2001, Oracle and/or its affiliates. All rights reserved.
@@ -1942,7 +1942,7 @@
  }
 diff -Nru openjdk.orig/jdk/src/share/classes/sun/security/util/SecurityConstants.java openjdk/jdk/src/share/classes/sun/security/util/SecurityConstants.java
 --- openjdk.orig/jdk/src/share/classes/sun/security/util/SecurityConstants.java	2011-02-28 16:06:40.000000000 +0000
-+++ openjdk/jdk/src/share/classes/sun/security/util/SecurityConstants.java	2011-05-23 23:20:58.660622971 +0100
++++ openjdk/jdk/src/share/classes/sun/security/util/SecurityConstants.java	2012-06-08 12:23:40.187977985 +0100
 @@ -52,6 +52,7 @@
      public static final String FILE_EXECUTE_ACTION = "execute";
      public static final String FILE_READ_ACTION = "read";
@@ -1953,7 +1953,7 @@
      public static final String SOCKET_CONNECT_ACTION = "connect";
 diff -Nru openjdk.orig/jdk/src/solaris/classes/sun/nio/ch/DefaultSelectorProvider.java openjdk/jdk/src/solaris/classes/sun/nio/ch/DefaultSelectorProvider.java
 --- openjdk.orig/jdk/src/solaris/classes/sun/nio/ch/DefaultSelectorProvider.java	2011-02-28 16:06:48.000000000 +0000
-+++ openjdk/jdk/src/solaris/classes/sun/nio/ch/DefaultSelectorProvider.java	2011-05-23 23:20:58.660622971 +0100
++++ openjdk/jdk/src/solaris/classes/sun/nio/ch/DefaultSelectorProvider.java	2012-06-08 12:23:40.187977985 +0100
 @@ -25,11 +25,12 @@
  
  package sun.nio.ch;
@@ -1970,7 +1970,7 @@
   */
 diff -Nru openjdk.orig/jdk/src/solaris/classes/sun/nio/ch/FileDispatcher.java openjdk/jdk/src/solaris/classes/sun/nio/ch/FileDispatcher.java
 --- openjdk.orig/jdk/src/solaris/classes/sun/nio/ch/FileDispatcher.java	2011-02-28 16:06:48.000000000 +0000
-+++ openjdk/jdk/src/solaris/classes/sun/nio/ch/FileDispatcher.java	2011-05-23 23:20:58.660622971 +0100
++++ openjdk/jdk/src/solaris/classes/sun/nio/ch/FileDispatcher.java	2012-06-08 12:23:40.187977985 +0100
 @@ -35,6 +35,11 @@
  class FileDispatcher extends NativeDispatcher
  {
@@ -2033,7 +2033,7 @@
  }
 diff -Nru openjdk.orig/jdk/src/solaris/classes/sun/nio/ch/InheritedChannel.java openjdk/jdk/src/solaris/classes/sun/nio/ch/InheritedChannel.java
 --- openjdk.orig/jdk/src/solaris/classes/sun/nio/ch/InheritedChannel.java	2011-02-28 16:06:48.000000000 +0000
-+++ openjdk/jdk/src/solaris/classes/sun/nio/ch/InheritedChannel.java	2011-05-23 23:20:58.660622971 +0100
++++ openjdk/jdk/src/solaris/classes/sun/nio/ch/InheritedChannel.java	2012-06-08 12:23:40.187977985 +0100
 @@ -34,7 +34,8 @@
  import java.nio.channels.SocketChannel;
  import java.nio.channels.ServerSocketChannel;
@@ -2046,7 +2046,7 @@
  
 diff -Nru openjdk.orig/jdk/src/solaris/native/sun/nio/ch/Net.c openjdk/jdk/src/solaris/native/sun/nio/ch/Net.c
 --- openjdk.orig/jdk/src/solaris/native/sun/nio/ch/Net.c	2011-02-28 16:06:50.000000000 +0000
-+++ openjdk/jdk/src/solaris/native/sun/nio/ch/Net.c	2011-05-23 23:20:58.660622971 +0100
++++ openjdk/jdk/src/solaris/native/sun/nio/ch/Net.c	2012-06-08 12:23:40.187977985 +0100
 @@ -1,5 +1,5 @@
  /*
 - * Copyright (c) 2001, 2007, Oracle and/or its affiliates. All rights reserved.
@@ -2730,7 +2730,7 @@
  
 diff -Nru openjdk.orig/jdk/src/solaris/native/sun/nio/ch/nio_util.h openjdk/jdk/src/solaris/native/sun/nio/ch/nio_util.h
 --- openjdk.orig/jdk/src/solaris/native/sun/nio/ch/nio_util.h	2011-02-28 16:06:50.000000000 +0000
-+++ openjdk/jdk/src/solaris/native/sun/nio/ch/nio_util.h	2011-05-23 23:20:58.660622971 +0100
++++ openjdk/jdk/src/solaris/native/sun/nio/ch/nio_util.h	2012-06-08 12:23:40.187977985 +0100
 @@ -1,5 +1,5 @@
  /*
 - * Copyright (c) 2001, 2002, Oracle and/or its affiliates. All rights reserved.
@@ -2756,7 +2756,7 @@
  
 diff -Nru openjdk.orig/jdk/src/windows/classes/sun/nio/ch/FileDispatcher.java openjdk/jdk/src/windows/classes/sun/nio/ch/FileDispatcher.java
 --- openjdk.orig/jdk/src/windows/classes/sun/nio/ch/FileDispatcher.java	2011-02-28 16:06:51.000000000 +0000
-+++ openjdk/jdk/src/windows/classes/sun/nio/ch/FileDispatcher.java	2011-05-23 23:20:58.660622971 +0100
++++ openjdk/jdk/src/windows/classes/sun/nio/ch/FileDispatcher.java	2012-06-08 12:23:40.187977985 +0100
 @@ -36,6 +36,11 @@
  class FileDispatcher extends NativeDispatcher
  {
--- a/patches/no-static-linking.patch	Thu May 31 12:40:08 2012 +0200
+++ b/patches/no-static-linking.patch	Fri Jun 08 14:23:28 2012 +0100
@@ -1,19 +1,19 @@
-diff -r f7afe7a5e086 make/common/shared/Compiler-gcc.gmk
---- openjdk.orig/jdk/make/common/shared/Compiler-gcc.gmk	Fri Jan 21 16:21:28 2011 -0800
-+++ openjdk/jdk/make/common/shared/Compiler-gcc.gmk	Thu Feb 03 11:34:13 2011 +0000
+diff -Nru openjdk.orig/corba/make/common/shared/Compiler-gcc.gmk openjdk/corba/make/common/shared/Compiler-gcc.gmk
+--- openjdk.orig/corba/make/common/shared/Compiler-gcc.gmk	2012-06-08 12:00:51.761855021 +0100
++++ openjdk/corba/make/common/shared/Compiler-gcc.gmk	2012-06-08 12:02:57.951891856 +0100
 @@ -61,7 +61,7 @@
-   CC             = $(COMPILER_PATH)gcc
-   CPP            = $(COMPILER_PATH)gcc -E
+   CC             = $(COMPILER_PATH)gcc$(GCC_SUFFIX)
+   CPP            = $(COMPILER_PATH)gcc$(GCC_SUFFIX) -E
    # statically link libstdc++ before C++ ABI is stablized on Linux
 -  STATIC_CXX     = true
 +  STATIC_CXX     = false
    ifeq ($(STATIC_CXX),true)
      # g++ always dynamically links libstdc++, even we use "-Wl,-Bstatic -lstdc++"
      # We need to use gcc to statically link the C++ runtime. gcc and g++ use
-diff -r 9797bcda6c12 make/linux/makefiles/vm.make
---- openjdk.orig/hotspot/make/linux/makefiles/vm.make	Fri Jan 21 16:20:02 2011 -0800
-+++ openjdk/hotspot/make/linux/makefiles/vm.make	Thu Feb 03 15:01:10 2011 +0000
-@@ -137,15 +137,7 @@
+diff -Nru openjdk.orig/hotspot/make/linux/makefiles/vm.make openjdk/hotspot/make/linux/makefiles/vm.make
+--- openjdk.orig/hotspot/make/linux/makefiles/vm.make	2012-06-08 12:00:51.685853794 +0100
++++ openjdk/hotspot/make/linux/makefiles/vm.make	2012-06-08 12:02:57.951891856 +0100
+@@ -204,15 +204,7 @@
  vm.def: $(Res_Files) $(Obj_Files)
  	sh $(GAMMADIR)/make/linux/makefiles/build_vm_def.sh *.o > $@
  
@@ -30,12 +30,12 @@
  
  ifeq ($(LINK_INTO),AOUT)
    LIBJVM.o                 =
-diff -r 05436b84e93a make/common/shared/Compiler-gcc.gmk
---- openjdk.orig/corba/make/common/shared/Compiler-gcc.gmk	Sat Jan 16 01:04:04 2010 +0000
-+++ openjdk/corba/make/common/shared/Compiler-gcc.gmk	Thu Feb 03 16:01:37 2011 +0000
+diff -Nru openjdk.orig/jdk/make/common/shared/Compiler-gcc.gmk openjdk/jdk/make/common/shared/Compiler-gcc.gmk
+--- openjdk.orig/jdk/make/common/shared/Compiler-gcc.gmk	2012-06-08 12:00:52.437865932 +0100
++++ openjdk/jdk/make/common/shared/Compiler-gcc.gmk	2012-06-08 12:02:57.951891856 +0100
 @@ -61,7 +61,7 @@
-   CC             = $(COMPILER_PATH)gcc
-   CPP            = $(COMPILER_PATH)gcc -E
+   CC             = $(COMPILER_PATH)gcc$(GCC_SUFFIX)
+   CPP            = $(COMPILER_PATH)gcc$(GCC_SUFFIX) -E
    # statically link libstdc++ before C++ ABI is stablized on Linux
 -  STATIC_CXX     = true
 +  STATIC_CXX     = false
--- a/patches/numa_on_early_glibc.patch	Thu May 31 12:40:08 2012 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,46 +0,0 @@
---- openjdk.orig/hotspot/src/os/linux/vm/os_linux.cpp	2010-09-14 15:30:59.000000000 +0100
-+++ openjdk/hotspot/src/os/linux/vm/os_linux.cpp	2010-09-14 17:45:54.000000000 +0100
-@@ -54,6 +54,10 @@ 
- # include <sys/shm.h>
- # include <link.h>
- 
-+#if __x86_64__
-+#include <asm/vsyscall.h>
-+#endif
-+
- #define MAX_PATH    (2 * K)
- 
- // for timer info max values which include all bits
-@@ -2414,6 +2418,21 @@ 
-   return end;
- }
- 
-+static int sched_getcpu_syscall(void) {
-+  unsigned int cpu;
-+  int retval = -1;
-+
-+#if __x86_64__
-+  typedef long (*vgetcpu_t)(unsigned int *cpu, unsigned int *node, unsigned long *tcache);
-+  vgetcpu_t vgetcpu = (vgetcpu_t)VSYSCALL_ADDR(__NR_vgetcpu);
-+  retval = vgetcpu(&cpu, NULL, NULL);
-+#elif __i386__
-+  retval = syscall(SYS_getcpu, &cpu, NULL, NULL);
-+#endif
-+
-+  return (retval == -1) ? retval : cpu;
-+}
-+
- extern "C" void numa_warn(int number, char *where, ...) { }
- extern "C" void numa_error(char *where) { }
- 
-@@ -2422,6 +2441,10 @@ 
-   set_sched_getcpu(CAST_TO_FN_PTR(sched_getcpu_func_t,
-                                   dlsym(RTLD_DEFAULT, "sched_getcpu")));
- 
-+  // If it's not, try a direct syscall.
-+  if (sched_getcpu() == -1)
-+    set_sched_getcpu(CAST_TO_FN_PTR(sched_getcpu_func_t, (void*)&sched_getcpu_syscall));
-+
-   if (sched_getcpu() != -1) { // Does it work?
-     void *handle = dlopen("libnuma.so.1", RTLD_LAZY);
-     if (handle != NULL) {
--- a/patches/openjdk/6693253-security_warning.patch	Thu May 31 12:40:08 2012 +0200
+++ b/patches/openjdk/6693253-security_warning.patch	Fri Jun 08 14:23:28 2012 +0100
@@ -1,16 +1,6 @@
-# HG changeset patch
-# User anthony
-# Date 1297956979 0
-# Node ID 2c9218aed28a5706c062eac8c5e7db1ec3dc9dfc
-# Parent  119b67260c33358c5a34dddf69b709b78b39e590
-6693253: Security Warning appearance requires enhancements
-6779717: A Window does not show applet security warning icon on X platforms
-6785058: Parent don't get the focus after dialog is closed if security warning is applied
-Summary: Forward-port from 6u10-6u14
-Reviewed-by: art, dcherepanov
 diff -Nru openjdk.orig/jdk/make/sun/awt/Depend.mak openjdk/jdk/make/sun/awt/Depend.mak
---- openjdk.orig/jdk/make/sun/awt/Depend.mak	2011-01-20 23:54:06.000000000 +0000
-+++ openjdk/jdk/make/sun/awt/Depend.mak	2011-02-17 15:50:10.704058433 +0000
+--- openjdk.orig/jdk/make/sun/awt/Depend.mak	2011-02-28 16:06:11.000000000 +0000
++++ openjdk/jdk/make/sun/awt/Depend.mak	2012-06-08 11:21:24.375337489 +0100
 @@ -71,6 +71,7 @@
  	$(STUBDIR)/Ole2.h \
  	$(STUBDIR)/Zmouse.h \
@@ -20,8 +10,8 @@
  	$(STUBDIR)/direct.h \
  	$(STUBDIR)/d3dcom.h \
 diff -Nru openjdk.orig/jdk/make/sun/awt/FILES_c_windows.gmk openjdk/jdk/make/sun/awt/FILES_c_windows.gmk
---- openjdk.orig/jdk/make/sun/awt/FILES_c_windows.gmk	2011-02-17 15:43:31.000000000 +0000
-+++ openjdk/jdk/make/sun/awt/FILES_c_windows.gmk	2011-02-17 15:50:10.712057805 +0000
+--- openjdk.orig/jdk/make/sun/awt/FILES_c_windows.gmk	2012-06-08 11:18:48.476781365 +0100
++++ openjdk/jdk/make/sun/awt/FILES_c_windows.gmk	2012-06-08 11:21:24.379337555 +0100
 @@ -202,6 +202,7 @@
  	ShellFolder2.cpp \
  	ThemeReader.cpp \
@@ -31,8 +21,8 @@
  	awt_dlls.cpp \
  	UnicowsLoader.cpp \
 diff -Nru openjdk.orig/jdk/make/sun/awt/make.depend openjdk/jdk/make/sun/awt/make.depend
---- openjdk.orig/jdk/make/sun/awt/make.depend	2011-02-17 15:43:31.000000000 +0000
-+++ openjdk/jdk/make/sun/awt/make.depend	2011-02-17 15:50:10.720057177 +0000
+--- openjdk.orig/jdk/make/sun/awt/make.depend	2012-06-08 11:18:48.476781365 +0100
++++ openjdk/jdk/make/sun/awt/make.depend	2012-06-08 11:21:24.383337620 +0100
 @@ -14,145 +14,145 @@
  
  $(OBJDIR)/AnyShort.obj::	$(CLASSHDRDIR)/java_awt_AlphaComposite.h ../../../src/share/javavm/export/jni.h ../../../src/share/native/common/gdefs.h ../../../src/share/native/sun/java2d/loops/AlphaMath.h ../../../src/share/native/sun/java2d/loops/AnyShort.h ../../../src/share/native/sun/java2d/loops/GlyphImageRef.h ../../../src/share/native/sun/java2d/loops/GraphicsPrimitiveMgr.h ../../../src/share/native/sun/java2d/loops/LineUtils.h ../../../src/share/native/sun/java2d/loops/LoopMacros.h ../../../src/share/native/sun/java2d/pipe/SpanIterator.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/native/common/gdefs_md.h ../../../src/windows/native/sun/java2d/j2d_md.h
@@ -487,16 +477,16 @@
 -$(OBJDIR)/WPrinterJob.obj::	$(CLASSHDRDIR)/java_awt_AWTEvent.h $(CLASSHDRDIR)/java_awt_Component.h $(CLASSHDRDIR)/java_awt_Dialog.h $(CLASSHDRDIR)/java_awt_Dimension.h $(CLASSHDRDIR)/java_awt_Event.h $(CLASSHDRDIR)/java_awt_event_FocusEvent.h $(CLASSHDRDIR)/java_awt_event_KeyEvent.h $(CLASSHDRDIR)/java_awt_event_MouseEvent.h $(CLASSHDRDIR)/java_awt_event_WindowEvent.h $(CLASSHDRDIR)/java_awt_FileDialog.h $(CLASSHDRDIR)/java_awt_Font.h $(CLASSHDRDIR)/java_awt_FontMetrics.h $(CLASSHDRDIR)/java_awt_Frame.h $(CLASSHDRDIR)/java_awt_Menu.h $(CLASSHDRDIR)/java_awt_MenuBar.h $(CLASSHDRDIR)/java_awt_MenuComponent.h $(CLASSHDRDIR)/java_awt_MenuItem.h $(CLASSHDRDIR)/java_awt_peer_MenuComponentPeer.h $(CLASSHDRDIR)/java_awt_Window.h $(CLASSHDRDIR)/sun_awt_FontDescriptor.h $(CLASSHDRDIR)/sun_awt_PlatformFont.h $(CLASSHDRDIR)/sun_awt_windows_WCanvasPeer.h $(CLASSHDRDIR)/sun_awt_windows_WComponentPeer.h $(CLASSHDRDIR)/sun_awt_windows_WDialogPeer.h $(CLASSHDRDIR)/sun_awt_windows_WFileDialogPeer.h $(CLASSHDRDIR)/sun_awt_windows_WFontMetrics.h $(CLASSHDRDIR)/sun_awt_windows_WFramePeer.h $(CLASSHDRDIR)/sun_awt_windows_WMenuBarPeer.h $(CLASSHDRDIR)/sun_awt_windows_WMenuItemPeer.h $(CLASSHDRDIR)/sun_awt_windows_WMenuPeer.h $(CLASSHDRDIR)/sun_awt_windows_WObjectPeer.h $(CLASSHDRDIR)/sun_awt_windows_WToolkit.h $(CLASSHDRDIR)/sun_awt_windows_WWindowPeer.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/awt/debug/debug_assert.h ../../../src/share/native/sun/awt/debug/debug_mem.h ../../../src/share/native/sun/awt/debug/debug_trace.h ../../../src/share/native/sun/awt/debug/debug_util.h ../../../src/share/native/sun/awt/image/cvutils/img_globals.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/share/native/sun/java2d/Trace.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/javavm/export/jvm_md.h ../../../src/windows/native/common/jlong_md.h ../../../src/windows/native/sun/java2d/windows/GDIWindowSurfaceData.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/awtmsg.h ../../../src/windows/native/sun/windows/awt_Brush.h ../../../src/windows/native/sun/windows/awt_Canvas.h ../../../src/windows/native/sun/windows/awt_Component.h ../../../src/windows/native/sun/windows/awt_Debug.h ../../../src/windows/native/sun/windows/awt_Dialog.h ../../../src/windows/native/sun/windows/awt_dlls.h ../../../src/windows/native/sun/windows/awt_FileDialog.h ../../../src/windows/native/sun/windows/awt_Font.h ../../../src/windows/native/sun/windows/awt_Frame.h ../../../src/windows/native/sun/windows/awt_GDIObject.h ../../../src/windows/native/sun/windows/awt_Menu.h ../../../src/windows/native/sun/windows/awt_MenuBar.h ../../../src/windows/native/sun/windows/awt_MenuItem.h ../../../src/windows/native/sun/windows/awt_MMStub.h ../../../src/windows/native/sun/windows/awt_Multimon.h ../../../src/windows/native/sun/windows/awt_Object.h ../../../src/windows/native/sun/windows/awt_Palette.h ../../../src/windows/native/sun/windows/awt_Pen.h ../../../src/windows/native/sun/windows/awt_PrintControl.h ../../../src/windows/native/sun/windows/awt_PrintDialog.h ../../../src/windows/native/sun/windows/awt_Toolkit.h ../../../src/windows/native/sun/windows/awt_Unicode.h ../../../src/windows/native/sun/windows/awt_Win32GraphicsDevice.h ../../../src/windows/native/sun/windows/awt_Window.h ../../../src/windows/native/sun/windows/colordata.h ../../../src/windows/native/sun/windows/Devices.h ../../../src/windows/native/sun/windows/GDIHashtable.h ../../../src/windows/native/sun/windows/Hashtable.h ../../../src/windows/native/sun/windows/ObjectList.h ../../../src/windows/native/sun/windows/stdhdrs.h ../../../src/windows/native/sun/windows/UnicowsLoader.h
 +$(OBJDIR)/WPrinterJob.obj::	$(CLASSHDRDIR)/java_awt_AWTEvent.h $(CLASSHDRDIR)/java_awt_Component.h $(CLASSHDRDIR)/java_awt_Dialog.h $(CLASSHDRDIR)/java_awt_Dimension.h $(CLASSHDRDIR)/java_awt_event_FocusEvent.h $(CLASSHDRDIR)/java_awt_Event.h $(CLASSHDRDIR)/java_awt_event_KeyEvent.h $(CLASSHDRDIR)/java_awt_event_MouseEvent.h $(CLASSHDRDIR)/java_awt_event_WindowEvent.h $(CLASSHDRDIR)/java_awt_FileDialog.h $(CLASSHDRDIR)/java_awt_Font.h $(CLASSHDRDIR)/java_awt_FontMetrics.h $(CLASSHDRDIR)/java_awt_Frame.h $(CLASSHDRDIR)/java_awt_MenuBar.h $(CLASSHDRDIR)/java_awt_MenuComponent.h $(CLASSHDRDIR)/java_awt_Menu.h $(CLASSHDRDIR)/java_awt_MenuItem.h $(CLASSHDRDIR)/java_awt_peer_MenuComponentPeer.h $(CLASSHDRDIR)/java_awt_Window.h $(CLASSHDRDIR)/sun_awt_FontDescriptor.h $(CLASSHDRDIR)/sun_awt_PlatformFont.h $(CLASSHDRDIR)/sun_awt_windows_WCanvasPeer.h $(CLASSHDRDIR)/sun_awt_windows_WComponentPeer.h $(CLASSHDRDIR)/sun_awt_windows_WDialogPeer.h $(CLASSHDRDIR)/sun_awt_windows_WFileDialogPeer.h $(CLASSHDRDIR)/sun_awt_windows_WFontMetrics.h $(CLASSHDRDIR)/sun_awt_windows_WFramePeer.h $(CLASSHDRDIR)/sun_awt_windows_WMenuBarPeer.h $(CLASSHDRDIR)/sun_awt_windows_WMenuItemPeer.h $(CLASSHDRDIR)/sun_awt_windows_WMenuPeer.h $(CLASSHDRDIR)/sun_awt_windows_WObjectPeer.h $(CLASSHDRDIR)/sun_awt_windows_WToolkit.h $(CLASSHDRDIR)/sun_awt_windows_WWindowPeer.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/awt/debug/debug_assert.h ../../../src/share/native/sun/awt/debug/debug_mem.h ../../../src/share/native/sun/awt/debug/debug_trace.h ../../../src/share/native/sun/awt/debug/debug_util.h ../../../src/share/native/sun/awt/image/cvutils/img_globals.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/share/native/sun/java2d/Trace.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/javavm/export/jvm_md.h ../../../src/windows/native/common/jlong_md.h ../../../src/windows/native/sun/java2d/windows/GDIWindowSurfaceData.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt_Brush.h ../../../src/windows/native/sun/windows/awt_Canvas.h ../../../src/windows/native/sun/windows/awt_Component.h ../../../src/windows/native/sun/windows/awt_Debug.h ../../../src/windows/native/sun/windows/awt_Dialog.h ../../../src/windows/native/sun/windows/awt_dlls.h ../../../src/windows/native/sun/windows/awt_FileDialog.h ../../../src/windows/native/sun/windows/awt_Font.h ../../../src/windows/native/sun/windows/awt_Frame.h ../../../src/windows/native/sun/windows/awt_GDIObject.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/awt_MenuBar.h ../../../src/windows/native/sun/windows/awt_Menu.h ../../../src/windows/native/sun/windows/awt_MenuItem.h ../../../src/windows/native/sun/windows/awt_MMStub.h ../../../src/windows/native/sun/windows/awtmsg.h ../../../src/windows/native/sun/windows/awt_Multimon.h ../../../src/windows/native/sun/windows/awt_Object.h ../../../src/windows/native/sun/windows/awt_Palette.h ../../../src/windows/native/sun/windows/awt_Pen.h ../../../src/windows/native/sun/windows/awt_PrintControl.h ../../../src/windows/native/sun/windows/awt_PrintDialog.h ../../../src/windows/native/sun/windows/awt_Toolkit.h ../../../src/windows/native/sun/windows/awt_Unicode.h ../../../src/windows/native/sun/windows/awt_Win32GraphicsDevice.h ../../../src/windows/native/sun/windows/awt_Window.h ../../../src/windows/native/sun/windows/colordata.h ../../../src/windows/native/sun/windows/Devices.h ../../../src/windows/native/sun/windows/GDIHashtable.h ../../../src/windows/native/sun/windows/Hashtable.h ../../../src/windows/native/sun/windows/ObjectList.h ../../../src/windows/native/sun/windows/stdhdrs.h ../../../src/windows/native/sun/windows/UnicowsLoader.h
 diff -Nru openjdk.orig/jdk/make/sun/awt/Makefile openjdk/jdk/make/sun/awt/Makefile
---- openjdk.orig/jdk/make/sun/awt/Makefile	2011-02-17 15:43:31.000000000 +0000
-+++ openjdk/jdk/make/sun/awt/Makefile	2011-02-17 15:50:10.712057805 +0000
+--- openjdk.orig/jdk/make/sun/awt/Makefile	2012-06-08 11:18:48.480781430 +0100
++++ openjdk/jdk/make/sun/awt/Makefile	2012-06-08 11:21:24.383337620 +0100
 @@ -551,3 +551,4 @@
  
  .PHONY: dgalibs dgalib.clean fontconfigs fontconfigs.clean
  
 +# DO NOT DELETE
 diff -Nru openjdk.orig/jdk/make/sun/awt/README openjdk/jdk/make/sun/awt/README
---- openjdk.orig/jdk/make/sun/awt/README	2011-01-20 23:54:06.000000000 +0000
-+++ openjdk/jdk/make/sun/awt/README	2011-02-17 15:50:10.712057805 +0000
+--- openjdk.orig/jdk/make/sun/awt/README	2011-02-28 16:06:11.000000000 +0000
++++ openjdk/jdk/make/sun/awt/README	2012-06-08 11:21:24.383337620 +0100
 @@ -6,11 +6,9 @@
  
  Included in this project is a generated file, make.depend, which lists
@@ -511,8 +501,8 @@
  This step only needs to be run when new files are added to the project,
  or include statements are changed.
 diff -Nru openjdk.orig/jdk/make/sun/xawt/FILES_c_unix.gmk openjdk/jdk/make/sun/xawt/FILES_c_unix.gmk
---- openjdk.orig/jdk/make/sun/xawt/FILES_c_unix.gmk	2011-01-20 23:54:06.000000000 +0000
-+++ openjdk/jdk/make/sun/xawt/FILES_c_unix.gmk	2011-02-17 15:50:10.720057177 +0000
+--- openjdk.orig/jdk/make/sun/xawt/FILES_c_unix.gmk	2011-02-28 16:06:12.000000000 +0000
++++ openjdk/jdk/make/sun/xawt/FILES_c_unix.gmk	2012-06-08 11:21:24.383337620 +0100
 @@ -78,4 +78,5 @@
  	awt_Plugin.c \
  	gtk2_interface.c \
@@ -521,8 +511,8 @@
 +        swing_GTKStyle.c \
 +        rect.c
 diff -Nru openjdk.orig/jdk/make/sun/xawt/Makefile openjdk/jdk/make/sun/xawt/Makefile
---- openjdk.orig/jdk/make/sun/xawt/Makefile	2011-01-20 23:54:06.000000000 +0000
-+++ openjdk/jdk/make/sun/xawt/Makefile	2011-02-17 15:50:10.720057177 +0000
+--- openjdk.orig/jdk/make/sun/xawt/Makefile	2011-02-28 16:06:12.000000000 +0000
++++ openjdk/jdk/make/sun/xawt/Makefile	2012-06-08 11:21:24.383337620 +0100
 @@ -79,6 +79,7 @@
  vpath %.c   $(SHARE_SRC)/native/sun/java2d/loops
  vpath %.c   $(SHARE_SRC)/native/sun/java2d/pipe
@@ -556,8 +546,8 @@
  
  $(TEMPDIR_CLASSES)/sun/awt/X11/ToBin.class: ToBin.java
 diff -Nru openjdk.orig/jdk/make/sun/xawt/mapfile-vers openjdk/jdk/make/sun/xawt/mapfile-vers
---- openjdk.orig/jdk/make/sun/xawt/mapfile-vers	2011-02-17 15:43:31.000000000 +0000
-+++ openjdk/jdk/make/sun/xawt/mapfile-vers	2011-02-17 15:50:10.720057177 +0000
+--- openjdk.orig/jdk/make/sun/xawt/mapfile-vers	2012-06-08 11:18:48.588783199 +0100
++++ openjdk/jdk/make/sun/xawt/mapfile-vers	2012-06-08 11:21:24.387337686 +0100
 @@ -93,6 +93,8 @@
          Java_sun_awt_X11_XlibWrapper_XGetWMHints;
          Java_sun_awt_X11_XlibWrapper_XShapeQueryExtension;
@@ -569,7 +559,7 @@
          Java_sun_awt_X11_XWindow_getWMInsets;
 diff -Nru openjdk.orig/jdk/src/share/classes/com/sun/awt/SecurityWarning.java openjdk/jdk/src/share/classes/com/sun/awt/SecurityWarning.java
 --- openjdk.orig/jdk/src/share/classes/com/sun/awt/SecurityWarning.java	1970-01-01 01:00:00.000000000 +0100
-+++ openjdk/jdk/src/share/classes/com/sun/awt/SecurityWarning.java	2011-02-17 15:50:10.720057177 +0000
++++ openjdk/jdk/src/share/classes/com/sun/awt/SecurityWarning.java	2012-06-08 11:21:24.387337686 +0100
 @@ -0,0 +1,169 @@
 +/*
 + * Copyright (c) 2008, 2009, Oracle and/or its affiliates. All rights reserved.
@@ -741,8 +731,8 @@
 +}
 +
 diff -Nru openjdk.orig/jdk/src/share/classes/java/awt/Component.java openjdk/jdk/src/share/classes/java/awt/Component.java
---- openjdk.orig/jdk/src/share/classes/java/awt/Component.java	2011-02-17 15:43:31.000000000 +0000
-+++ openjdk/jdk/src/share/classes/java/awt/Component.java	2011-02-17 15:50:10.724056863 +0000
+--- openjdk.orig/jdk/src/share/classes/java/awt/Component.java	2012-06-08 11:18:48.500781751 +0100
++++ openjdk/jdk/src/share/classes/java/awt/Component.java	2012-06-08 11:21:24.387337686 +0100
 @@ -855,6 +855,10 @@
                      }
                  }
@@ -755,8 +745,8 @@
      }
  
 diff -Nru openjdk.orig/jdk/src/share/classes/java/awt/peer/WindowPeer.java openjdk/jdk/src/share/classes/java/awt/peer/WindowPeer.java
---- openjdk.orig/jdk/src/share/classes/java/awt/peer/WindowPeer.java	2011-02-17 15:43:31.000000000 +0000
-+++ openjdk/jdk/src/share/classes/java/awt/peer/WindowPeer.java	2011-02-17 15:50:10.724056863 +0000
+--- openjdk.orig/jdk/src/share/classes/java/awt/peer/WindowPeer.java	2012-06-08 11:18:48.512781955 +0100
++++ openjdk/jdk/src/share/classes/java/awt/peer/WindowPeer.java	2012-06-08 11:21:24.387337686 +0100
 @@ -67,4 +67,9 @@
       * @see Window#setBackground(Color)
       */
@@ -768,8 +758,8 @@
 +    void repositionSecurityWarning();
  }
 diff -Nru openjdk.orig/jdk/src/share/classes/java/awt/Window.java openjdk/jdk/src/share/classes/java/awt/Window.java
---- openjdk.orig/jdk/src/share/classes/java/awt/Window.java	2011-02-17 15:43:31.000000000 +0000
-+++ openjdk/jdk/src/share/classes/java/awt/Window.java	2011-02-17 15:50:10.724056863 +0000
+--- openjdk.orig/jdk/src/share/classes/java/awt/Window.java	2012-06-08 11:18:48.580783070 +0100
++++ openjdk/jdk/src/share/classes/java/awt/Window.java	2012-06-08 11:21:24.387337686 +0100
 @@ -26,6 +26,7 @@
  
  import java.applet.Applet;
@@ -816,7 +806,7 @@
           deserializeResources(s);
      }
  
-@@ -3463,6 +3488,18 @@
+@@ -3461,6 +3486,18 @@
  
      // ****************** END OF MIXING CODE ********************************
  
@@ -835,7 +825,7 @@
      static {
          AWTAccessor.setWindowAccessor(new AWTAccessor.WindowAccessor() {
              public float getOpacity(Window window) {
-@@ -3496,6 +3533,39 @@
+@@ -3494,6 +3531,39 @@
              public void updateWindow(Window window, BufferedImage backBuffer) {
                  window.updateWindow(backBuffer);
              }
@@ -876,8 +866,8 @@
      } // static
  
 diff -Nru openjdk.orig/jdk/src/share/classes/sun/awt/AWTAccessor.java openjdk/jdk/src/share/classes/sun/awt/AWTAccessor.java
---- openjdk.orig/jdk/src/share/classes/sun/awt/AWTAccessor.java	2011-02-17 15:43:31.000000000 +0000
-+++ openjdk/jdk/src/share/classes/sun/awt/AWTAccessor.java	2011-02-17 15:50:40.725701922 +0000
+--- openjdk.orig/jdk/src/share/classes/sun/awt/AWTAccessor.java	2012-06-08 11:18:48.516782020 +0100
++++ openjdk/jdk/src/share/classes/sun/awt/AWTAccessor.java	2012-06-08 11:21:24.387337686 +0100
 @@ -88,6 +88,12 @@
           * Returns the acc this component was constructed with.
           */
@@ -919,8 +909,8 @@
  
      /*
 diff -Nru openjdk.orig/jdk/src/share/classes/sun/awt/EmbeddedFrame.java openjdk/jdk/src/share/classes/sun/awt/EmbeddedFrame.java
---- openjdk.orig/jdk/src/share/classes/sun/awt/EmbeddedFrame.java	2011-02-17 15:43:31.000000000 +0000
-+++ openjdk/jdk/src/share/classes/sun/awt/EmbeddedFrame.java	2011-02-17 15:50:10.724056863 +0000
+--- openjdk.orig/jdk/src/share/classes/sun/awt/EmbeddedFrame.java	2012-06-08 11:18:48.520782084 +0100
++++ openjdk/jdk/src/share/classes/sun/awt/EmbeddedFrame.java	2012-06-08 11:21:24.387337686 +0100
 @@ -586,5 +586,7 @@
          }
          public void updateWindow(BufferedImage backBuffer) {
@@ -931,7 +921,7 @@
  } // class EmbeddedFrame
 diff -Nru openjdk.orig/jdk/src/solaris/classes/sun/awt/X11/InfoWindow.java openjdk/jdk/src/solaris/classes/sun/awt/X11/InfoWindow.java
 --- openjdk.orig/jdk/src/solaris/classes/sun/awt/X11/InfoWindow.java	1970-01-01 01:00:00.000000000 +0100
-+++ openjdk/jdk/src/solaris/classes/sun/awt/X11/InfoWindow.java	2011-02-17 15:50:10.724056863 +0000
++++ openjdk/jdk/src/solaris/classes/sun/awt/X11/InfoWindow.java	2012-06-08 11:21:24.387337686 +0100
 @@ -0,0 +1,495 @@
 +/*
 + * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved.
@@ -1429,8 +1419,8 @@
 +}
 +
 diff -Nru openjdk.orig/jdk/src/solaris/classes/sun/awt/X11/XDecoratedPeer.java openjdk/jdk/src/solaris/classes/sun/awt/X11/XDecoratedPeer.java
---- openjdk.orig/jdk/src/solaris/classes/sun/awt/X11/XDecoratedPeer.java	2011-01-20 23:54:40.000000000 +0000
-+++ openjdk/jdk/src/solaris/classes/sun/awt/X11/XDecoratedPeer.java	2011-02-17 15:50:10.724056863 +0000
+--- openjdk.orig/jdk/src/solaris/classes/sun/awt/X11/XDecoratedPeer.java	2011-02-28 16:06:48.000000000 +0000
++++ openjdk/jdk/src/solaris/classes/sun/awt/X11/XDecoratedPeer.java	2012-06-08 11:21:24.387337686 +0100
 @@ -451,7 +451,7 @@
  
      public Insets getInsets() {
@@ -1450,8 +1440,8 @@
  
      private void checkShellRectSize(Rectangle shellRect) {
 diff -Nru openjdk.orig/jdk/src/solaris/classes/sun/awt/X11/XKeyboardFocusManagerPeer.java openjdk/jdk/src/solaris/classes/sun/awt/X11/XKeyboardFocusManagerPeer.java
---- openjdk.orig/jdk/src/solaris/classes/sun/awt/X11/XKeyboardFocusManagerPeer.java	2011-02-17 15:43:30.000000000 +0000
-+++ openjdk/jdk/src/solaris/classes/sun/awt/X11/XKeyboardFocusManagerPeer.java	2011-02-17 15:50:10.724056863 +0000
+--- openjdk.orig/jdk/src/solaris/classes/sun/awt/X11/XKeyboardFocusManagerPeer.java	2012-06-08 11:18:47.544766081 +0100
++++ openjdk/jdk/src/solaris/classes/sun/awt/X11/XKeyboardFocusManagerPeer.java	2012-06-08 11:21:24.387337686 +0100
 @@ -62,8 +62,25 @@
  
      static void setCurrentNativeFocusedWindow(Window win) {
@@ -1479,8 +1469,8 @@
      }
  
 diff -Nru openjdk.orig/jdk/src/solaris/classes/sun/awt/X11/XlibWrapper.java openjdk/jdk/src/solaris/classes/sun/awt/X11/XlibWrapper.java
---- openjdk.orig/jdk/src/solaris/classes/sun/awt/X11/XlibWrapper.java	2011-01-20 23:54:40.000000000 +0000
-+++ openjdk/jdk/src/solaris/classes/sun/awt/X11/XlibWrapper.java	2011-02-17 15:50:10.728056549 +0000
+--- openjdk.orig/jdk/src/solaris/classes/sun/awt/X11/XlibWrapper.java	2011-02-28 16:06:48.000000000 +0000
++++ openjdk/jdk/src/solaris/classes/sun/awt/X11/XlibWrapper.java	2012-06-08 11:21:24.391337752 +0100
 @@ -157,6 +157,8 @@
  
      static native void XLowerWindow(long display, long window);
@@ -1503,8 +1493,8 @@
  /* Global memory area used for X lib parameter passing */
  
 diff -Nru openjdk.orig/jdk/src/solaris/classes/sun/awt/X11/XNETProtocol.java openjdk/jdk/src/solaris/classes/sun/awt/X11/XNETProtocol.java
---- openjdk.orig/jdk/src/solaris/classes/sun/awt/X11/XNETProtocol.java	2011-02-17 15:43:31.000000000 +0000
-+++ openjdk/jdk/src/solaris/classes/sun/awt/X11/XNETProtocol.java	2011-02-17 15:50:10.724056863 +0000
+--- openjdk.orig/jdk/src/solaris/classes/sun/awt/X11/XNETProtocol.java	2012-06-08 11:18:48.524782146 +0100
++++ openjdk/jdk/src/solaris/classes/sun/awt/X11/XNETProtocol.java	2012-06-08 11:21:24.391337752 +0100
 @@ -178,6 +178,34 @@
          return ((layer == LAYER_ALWAYS_ON_TOP) || (layer == LAYER_NORMAL)) && doLayerProtocol();
      }
@@ -1575,8 +1565,8 @@
              XAtomList net_wm_state = window.getNETWMState();
              if (log.isLoggable(Level.FINE)) {
 diff -Nru openjdk.orig/jdk/src/solaris/classes/sun/awt/X11/XTrayIconPeer.java openjdk/jdk/src/solaris/classes/sun/awt/X11/XTrayIconPeer.java
---- openjdk.orig/jdk/src/solaris/classes/sun/awt/X11/XTrayIconPeer.java	2011-01-20 23:54:40.000000000 +0000
-+++ openjdk/jdk/src/solaris/classes/sun/awt/X11/XTrayIconPeer.java	2011-02-17 15:50:10.724056863 +0000
+--- openjdk.orig/jdk/src/solaris/classes/sun/awt/X11/XTrayIconPeer.java	2011-02-28 16:06:48.000000000 +0000
++++ openjdk/jdk/src/solaris/classes/sun/awt/X11/XTrayIconPeer.java	2012-06-08 11:21:24.391337752 +0100
 @@ -41,15 +41,18 @@
  import java.security.PrivilegedAction;
  import java.lang.reflect.InvocationTargetException;
@@ -2095,8 +2085,8 @@
 -    }
  }
 diff -Nru openjdk.orig/jdk/src/solaris/classes/sun/awt/X11/XWarningWindow.java openjdk/jdk/src/solaris/classes/sun/awt/X11/XWarningWindow.java
---- openjdk.orig/jdk/src/solaris/classes/sun/awt/X11/XWarningWindow.java	2011-01-20 23:54:40.000000000 +0000
-+++ openjdk/jdk/src/solaris/classes/sun/awt/X11/XWarningWindow.java	2011-02-17 15:50:10.728056549 +0000
+--- openjdk.orig/jdk/src/solaris/classes/sun/awt/X11/XWarningWindow.java	2011-02-28 16:06:48.000000000 +0000
++++ openjdk/jdk/src/solaris/classes/sun/awt/X11/XWarningWindow.java	2012-06-08 11:21:24.391337752 +0100
 @@ -25,16 +25,194 @@
  package sun.awt.X11;
  
@@ -2514,8 +2504,8 @@
 +    }
  }
 diff -Nru openjdk.orig/jdk/src/solaris/classes/sun/awt/X11/XWindow.java openjdk/jdk/src/solaris/classes/sun/awt/X11/XWindow.java
---- openjdk.orig/jdk/src/solaris/classes/sun/awt/X11/XWindow.java	2011-01-20 23:54:40.000000000 +0000
-+++ openjdk/jdk/src/solaris/classes/sun/awt/X11/XWindow.java	2011-02-17 15:50:10.728056549 +0000
+--- openjdk.orig/jdk/src/solaris/classes/sun/awt/X11/XWindow.java	2011-02-28 16:06:48.000000000 +0000
++++ openjdk/jdk/src/solaris/classes/sun/awt/X11/XWindow.java	2012-06-08 11:21:24.391337752 +0100
 @@ -68,6 +68,15 @@
      int oldWidth = -1;
      int oldHeight = -1;
@@ -2694,8 +2684,8 @@
 +
  }
 diff -Nru openjdk.orig/jdk/src/solaris/classes/sun/awt/X11/XWindowPeer.java openjdk/jdk/src/solaris/classes/sun/awt/X11/XWindowPeer.java
---- openjdk.orig/jdk/src/solaris/classes/sun/awt/X11/XWindowPeer.java	2011-02-17 15:43:31.000000000 +0000
-+++ openjdk/jdk/src/solaris/classes/sun/awt/X11/XWindowPeer.java	2011-02-17 15:50:10.728056549 +0000
+--- openjdk.orig/jdk/src/solaris/classes/sun/awt/X11/XWindowPeer.java	2012-06-08 11:18:48.524782146 +0100
++++ openjdk/jdk/src/solaris/classes/sun/awt/X11/XWindowPeer.java	2012-06-08 11:21:24.391337752 +0100
 @@ -66,17 +66,11 @@
      // should be synchronized on awtLock
      private static Set<XWindowPeer> windows = new HashSet<XWindowPeer>();
@@ -2998,8 +2988,8 @@
  
      boolean isWithdrawn() {
 diff -Nru openjdk.orig/jdk/src/solaris/classes/sun/awt/X11/XWM.java openjdk/jdk/src/solaris/classes/sun/awt/X11/XWM.java
---- openjdk.orig/jdk/src/solaris/classes/sun/awt/X11/XWM.java	2011-01-20 23:54:40.000000000 +0000
-+++ openjdk/jdk/src/solaris/classes/sun/awt/X11/XWM.java	2011-02-17 15:50:10.724056863 +0000
+--- openjdk.orig/jdk/src/solaris/classes/sun/awt/X11/XWM.java	2011-02-28 16:06:48.000000000 +0000
++++ openjdk/jdk/src/solaris/classes/sun/awt/X11/XWM.java	2012-06-08 11:21:24.391337752 +0100
 @@ -889,7 +889,7 @@
      /*
       * Set MWM decorations.  Set MWM functions depending on resizability.
@@ -3010,8 +3000,8 @@
          if ((decorations & MWM_DECOR_ALL) != 0
              && (decorations != MWM_DECOR_ALL))
 diff -Nru openjdk.orig/jdk/src/solaris/native/sun/awt/utility/rect.h openjdk/jdk/src/solaris/native/sun/awt/utility/rect.h
---- openjdk.orig/jdk/src/solaris/native/sun/awt/utility/rect.h	2011-01-20 23:54:42.000000000 +0000
-+++ openjdk/jdk/src/solaris/native/sun/awt/utility/rect.h	2011-02-17 15:50:10.728056549 +0000
+--- openjdk.orig/jdk/src/solaris/native/sun/awt/utility/rect.h	2011-02-28 16:06:50.000000000 +0000
++++ openjdk/jdk/src/solaris/native/sun/awt/utility/rect.h	2012-06-08 11:21:24.391337752 +0100
 @@ -43,4 +43,15 @@
  
  #define RECT_INC_HEIGHT(r)      (r).height++
@@ -3029,8 +3019,8 @@
 +
  #endif // _AWT_RECT_H
 diff -Nru openjdk.orig/jdk/src/solaris/native/sun/xawt/XlibWrapper.c openjdk/jdk/src/solaris/native/sun/xawt/XlibWrapper.c
---- openjdk.orig/jdk/src/solaris/native/sun/xawt/XlibWrapper.c	2011-02-17 15:43:30.000000000 +0000
-+++ openjdk/jdk/src/solaris/native/sun/xawt/XlibWrapper.c	2011-02-17 15:50:10.728056549 +0000
+--- openjdk.orig/jdk/src/solaris/native/sun/xawt/XlibWrapper.c	2012-06-08 11:18:47.696768574 +0100
++++ openjdk/jdk/src/solaris/native/sun/xawt/XlibWrapper.c	2012-06-08 11:21:24.391337752 +0100
 @@ -42,6 +42,7 @@
  #include <jvm.h>
  
@@ -3111,8 +3101,8 @@
 +}
 +
 diff -Nru openjdk.orig/jdk/src/windows/classes/sun/awt/windows/WWindowPeer.java openjdk/jdk/src/windows/classes/sun/awt/windows/WWindowPeer.java
---- openjdk.orig/jdk/src/windows/classes/sun/awt/windows/WWindowPeer.java	2011-02-17 15:43:31.000000000 +0000
-+++ openjdk/jdk/src/windows/classes/sun/awt/windows/WWindowPeer.java	2011-02-17 15:50:10.728056549 +0000
+--- openjdk.orig/jdk/src/windows/classes/sun/awt/windows/WWindowPeer.java	2012-06-08 11:18:48.532782276 +0100
++++ openjdk/jdk/src/windows/classes/sun/awt/windows/WWindowPeer.java	2012-06-08 11:21:24.391337752 +0100
 @@ -499,8 +499,10 @@
       private volatile int sysH = 0;
  
@@ -3181,8 +3171,8 @@
       public void setBounds(int x, int y, int width, int height, int op) {
           Rectangle newBounds = constrainBounds(x, y, width, height);
 diff -Nru openjdk.orig/jdk/src/windows/native/sun/windows/awt_Component.cpp openjdk/jdk/src/windows/native/sun/windows/awt_Component.cpp
---- openjdk.orig/jdk/src/windows/native/sun/windows/awt_Component.cpp	2011-02-17 15:43:31.000000000 +0000
-+++ openjdk/jdk/src/windows/native/sun/windows/awt_Component.cpp	2011-02-17 15:50:10.728056549 +0000
+--- openjdk.orig/jdk/src/windows/native/sun/windows/awt_Component.cpp	2012-06-08 11:18:48.540782411 +0100
++++ openjdk/jdk/src/windows/native/sun/windows/awt_Component.cpp	2012-06-08 11:21:24.395337817 +0100
 @@ -282,8 +282,7 @@
       * the native one anymore. So we can safely destroy component's
       * handle.
@@ -3229,7 +3219,7 @@
  
      if (hwndTarget == GetHWnd()) {
          SendKeyEvent(id, when, raw, cooked, modifiers, keyLocation, msg);
-@@ -6355,6 +6365,14 @@
+@@ -6361,6 +6371,14 @@
      }
  }
  
@@ -3245,8 +3235,8 @@
   * Component native methods
   */
 diff -Nru openjdk.orig/jdk/src/windows/native/sun/windows/awt_Component.h openjdk/jdk/src/windows/native/sun/windows/awt_Component.h
---- openjdk.orig/jdk/src/windows/native/sun/windows/awt_Component.h	2011-02-17 15:43:31.000000000 +0000
-+++ openjdk/jdk/src/windows/native/sun/windows/awt_Component.h	2011-02-17 15:50:10.732056235 +0000
+--- openjdk.orig/jdk/src/windows/native/sun/windows/awt_Component.h	2012-06-08 11:18:48.540782411 +0100
++++ openjdk/jdk/src/windows/native/sun/windows/awt_Component.h	2012-06-08 11:21:24.395337817 +0100
 @@ -127,12 +127,13 @@
      virtual void RegisterClass();
      virtual void UnregisterClass();
@@ -3278,9 +3268,9 @@
      static BOOL m_isWin2000;
      static BOOL m_isWinNT;
 diff -Nru openjdk.orig/jdk/src/windows/native/sun/windows/awt_Dialog.cpp openjdk/jdk/src/windows/native/sun/windows/awt_Dialog.cpp
---- openjdk.orig/jdk/src/windows/native/sun/windows/awt_Dialog.cpp	2011-01-20 23:54:44.000000000 +0000
-+++ openjdk/jdk/src/windows/native/sun/windows/awt_Dialog.cpp	2011-02-17 15:50:10.732056235 +0000
-@@ -310,15 +310,20 @@
+--- openjdk.orig/jdk/src/windows/native/sun/windows/awt_Dialog.cpp	2012-06-08 11:18:48.580783070 +0100
++++ openjdk/jdk/src/windows/native/sun/windows/awt_Dialog.cpp	2012-06-08 11:21:24.395337817 +0100
+@@ -311,15 +311,20 @@
          // no beep/flash if the mouse was clicked in the taskbar menu
          // or the dialog is currently inactive
          if (!isModalHook && !onTaskbar && (dialog == prevFGWindow)) {
@@ -3305,8 +3295,8 @@
                                                  WPARAM wParam, LPARAM lParam)
  {
 diff -Nru openjdk.orig/jdk/src/windows/native/sun/windows/awt_Dialog.h openjdk/jdk/src/windows/native/sun/windows/awt_Dialog.h
---- openjdk.orig/jdk/src/windows/native/sun/windows/awt_Dialog.h	2011-01-20 23:54:44.000000000 +0000
-+++ openjdk/jdk/src/windows/native/sun/windows/awt_Dialog.h	2011-02-17 15:50:10.732056235 +0000
+--- openjdk.orig/jdk/src/windows/native/sun/windows/awt_Dialog.h	2012-06-08 11:18:48.580783070 +0100
++++ openjdk/jdk/src/windows/native/sun/windows/awt_Dialog.h	2012-06-08 11:21:24.395337817 +0100
 @@ -76,7 +76,7 @@
       * Thus we don't have to perform any transitive (a blocker of a blocker) checks.
       */
@@ -3316,7 +3306,7 @@
      }
  
      // finds and activates some window after the modal dialog is hidden
-@@ -129,6 +129,8 @@
+@@ -132,6 +132,8 @@
      // example on browser's thread when running in Java Plugin
      static LRESULT CALLBACK MouseHookProc_NonTT(int code,
                                                  WPARAM wParam, LPARAM lParam);
@@ -3326,8 +3316,8 @@
  
  #endif /* AWT_DIALOG_H */
 diff -Nru openjdk.orig/jdk/src/windows/native/sun/windows/awt_Frame.cpp openjdk/jdk/src/windows/native/sun/windows/awt_Frame.cpp
---- openjdk.orig/jdk/src/windows/native/sun/windows/awt_Frame.cpp	2011-01-20 23:54:44.000000000 +0000
-+++ openjdk/jdk/src/windows/native/sun/windows/awt_Frame.cpp	2011-02-17 15:50:10.732056235 +0000
+--- openjdk.orig/jdk/src/windows/native/sun/windows/awt_Frame.cpp	2011-02-28 16:06:52.000000000 +0000
++++ openjdk/jdk/src/windows/native/sun/windows/awt_Frame.cpp	2012-06-08 11:21:24.395337817 +0100
 @@ -551,11 +551,6 @@
      return AwtWindow::WmNcMouseDown(hitTest, x, y, button);
  }
@@ -3407,8 +3397,8 @@
      }
      return TRUE;
 diff -Nru openjdk.orig/jdk/src/windows/native/sun/windows/awt_Frame.h openjdk/jdk/src/windows/native/sun/windows/awt_Frame.h
---- openjdk.orig/jdk/src/windows/native/sun/windows/awt_Frame.h	2011-01-20 23:54:44.000000000 +0000
-+++ openjdk/jdk/src/windows/native/sun/windows/awt_Frame.h	2011-02-17 15:50:10.732056235 +0000
+--- openjdk.orig/jdk/src/windows/native/sun/windows/awt_Frame.h	2011-02-28 16:06:52.000000000 +0000
++++ openjdk/jdk/src/windows/native/sun/windows/awt_Frame.h	2012-06-08 11:21:24.395337817 +0100
 @@ -108,7 +108,6 @@
      MsgRouting WmNcMouseDown(WPARAM hitTest, int x, int y, int button);
      MsgRouting WmNcMouseUp(WPARAM hitTest, int x, int y, int button);
@@ -3418,8 +3408,8 @@
      virtual MsgRouting WmSysCommand(UINT uCmdType, int xPos, int yPos);
  
 diff -Nru openjdk.orig/jdk/src/windows/native/sun/windows/awt.rc openjdk/jdk/src/windows/native/sun/windows/awt.rc
---- openjdk.orig/jdk/src/windows/native/sun/windows/awt.rc	2011-01-20 23:54:44.000000000 +0000
-+++ openjdk/jdk/src/windows/native/sun/windows/awt.rc	2011-02-17 15:50:10.728056549 +0000
+--- openjdk.orig/jdk/src/windows/native/sun/windows/awt.rc	2011-02-28 16:06:52.000000000 +0000
++++ openjdk/jdk/src/windows/native/sun/windows/awt.rc	2012-06-08 11:21:24.395337817 +0100
 @@ -35,6 +35,13 @@
  AWT_ICON     ICON    DISCARDABLE "awt.ico"
  CHECK_BITMAP BITMAP  DISCARDABLE "check.bmp"
@@ -3435,8 +3425,8 @@
  //
  // Version
 diff -Nru openjdk.orig/jdk/src/windows/native/sun/windows/awt_Toolkit.cpp openjdk/jdk/src/windows/native/sun/windows/awt_Toolkit.cpp
---- openjdk.orig/jdk/src/windows/native/sun/windows/awt_Toolkit.cpp	2011-02-17 15:43:31.000000000 +0000
-+++ openjdk/jdk/src/windows/native/sun/windows/awt_Toolkit.cpp	2011-02-17 15:50:10.732056235 +0000
+--- openjdk.orig/jdk/src/windows/native/sun/windows/awt_Toolkit.cpp	2012-06-08 11:18:48.372779658 +0100
++++ openjdk/jdk/src/windows/native/sun/windows/awt_Toolkit.cpp	2012-06-08 11:21:24.395337817 +0100
 @@ -56,6 +56,7 @@
  #include "debug_mem.h"
  
@@ -3691,8 +3681,8 @@
  
      if (safe_ExceptionOccurred(env)) {
 diff -Nru openjdk.orig/jdk/src/windows/native/sun/windows/awt_Toolkit.h openjdk/jdk/src/windows/native/sun/windows/awt_Toolkit.h
---- openjdk.orig/jdk/src/windows/native/sun/windows/awt_Toolkit.h	2011-01-20 23:54:44.000000000 +0000
-+++ openjdk/jdk/src/windows/native/sun/windows/awt_Toolkit.h	2011-02-17 15:50:10.732056235 +0000
+--- openjdk.orig/jdk/src/windows/native/sun/windows/awt_Toolkit.h	2011-02-28 16:06:52.000000000 +0000
++++ openjdk/jdk/src/windows/native/sun/windows/awt_Toolkit.h	2012-06-08 11:21:24.395337817 +0100
 @@ -244,6 +244,8 @@
                                               LPARAM lParam);
      static LRESULT CALLBACK ForegroundIdleFilter(int code, WPARAM wParam,
@@ -3767,8 +3757,8 @@
  
  /*
 diff -Nru openjdk.orig/jdk/src/windows/native/sun/windows/awt_Win32GraphicsEnv.cpp openjdk/jdk/src/windows/native/sun/windows/awt_Win32GraphicsEnv.cpp
---- openjdk.orig/jdk/src/windows/native/sun/windows/awt_Win32GraphicsEnv.cpp	2011-02-17 15:43:31.000000000 +0000
-+++ openjdk/jdk/src/windows/native/sun/windows/awt_Win32GraphicsEnv.cpp	2011-02-17 15:50:10.732056235 +0000
+--- openjdk.orig/jdk/src/windows/native/sun/windows/awt_Win32GraphicsEnv.cpp	2012-06-08 11:18:48.376779724 +0100
++++ openjdk/jdk/src/windows/native/sun/windows/awt_Win32GraphicsEnv.cpp	2012-06-08 11:21:24.395337817 +0100
 @@ -31,6 +31,7 @@
  #include "awt_Win32GraphicsDevice.h"
  #include "Devices.h"
@@ -3837,8 +3827,8 @@
  
      dwmIsCompositionEnabled = bRes;
 diff -Nru openjdk.orig/jdk/src/windows/native/sun/windows/awt_Window.cpp openjdk/jdk/src/windows/native/sun/windows/awt_Window.cpp
---- openjdk.orig/jdk/src/windows/native/sun/windows/awt_Window.cpp	2011-02-17 15:43:31.000000000 +0000
-+++ openjdk/jdk/src/windows/native/sun/windows/awt_Window.cpp	2011-02-17 15:50:10.732056235 +0000
+--- openjdk.orig/jdk/src/windows/native/sun/windows/awt_Window.cpp	2012-06-08 11:18:48.540782411 +0100
++++ openjdk/jdk/src/windows/native/sun/windows/awt_Window.cpp	2012-06-08 11:21:24.395337817 +0100
 @@ -30,6 +30,7 @@
  #include "awt_Component.h"
  #include "awt_Container.h"
@@ -3867,16 +3857,15 @@
  
  /************************************************************************
   * AwtWindow fields
-@@ -138,6 +145,8 @@
+@@ -138,17 +145,23 @@
  jfieldID AwtWindow::warningStringID;
  jfieldID AwtWindow::locationByPlatformID;
  jfieldID AwtWindow::autoRequestFocusID;
 +jfieldID AwtWindow::securityWarningWidthID;
 +jfieldID AwtWindow::securityWarningHeightID;
  
- jclass AwtWindow::wwindowPeerCls;
- jmethodID AwtWindow::getActiveWindowsMID;
-@@ -147,11 +156,15 @@
+ jfieldID AwtWindow::sysXID;
+ jfieldID AwtWindow::sysYID;
  jfieldID AwtWindow::sysWID;
  jfieldID AwtWindow::sysHID;
  
@@ -3892,7 +3881,7 @@
  
  /************************************************************************
   * AwtWindow class methods
-@@ -186,11 +199,30 @@
+@@ -183,11 +196,30 @@
      m_opaque = TRUE;
      m_opacity = 0xff;
  
@@ -3923,7 +3912,7 @@
  }
  
  void AwtWindow::Dispose()
-@@ -230,10 +262,10 @@
+@@ -226,10 +258,10 @@
      }
      m_grabbed = TRUE;
      m_grabbedWindow = this;
@@ -3936,7 +3925,7 @@
          _ToFront(env->NewGlobalRef(GetPeer(env)));
          // Global ref was deleted in _ToFront
      }
-@@ -327,12 +359,40 @@
+@@ -323,12 +355,40 @@
      return mrDoDefault;
  }
  
@@ -3978,7 +3967,7 @@
      return mrDoDefault;
  }
  
-@@ -352,18 +412,591 @@
+@@ -348,18 +408,591 @@
      lpwc->cbWndExtra = DLGWINDOWEXTRA;
  }
  
@@ -4573,7 +4562,7 @@
  /* Create a new AwtWindow object and window.   */
  AwtWindow* AwtWindow::Create(jobject self, jobject parent)
  {
-@@ -672,23 +1305,6 @@
+@@ -668,23 +1301,6 @@
      ::GetClientRect(GetHWnd(), &inside);
      ::GetWindowRect(GetHWnd(), &outside);
  
@@ -4597,7 +4586,7 @@
      /* Update our inset member */
      if (outside.right - outside.left > 0 && outside.bottom - outside.top > 0) {
          ::MapWindowPoints(GetHWnd(), 0, (LPPOINT)&inside, 2);
-@@ -926,13 +1542,13 @@
+@@ -922,13 +1538,13 @@
          type = java_awt_event_WindowEvent_WINDOW_GAINED_FOCUS;
          AwtToolkit::GetInstance().
              InvokeFunctionLater(BounceActivation, this);
@@ -4613,7 +4602,7 @@
      }
  
      SendWindowEvent(type, opposite);
-@@ -984,7 +1600,7 @@
+@@ -980,7 +1596,7 @@
      HWND hwndSelf = GetHWnd();
      HWND hwndParent = ::GetParent(hwndSelf);
  
@@ -4622,7 +4611,7 @@
          hwndParent != NULL && ::IsWindowVisible(hwndParent))
      {
          ::PostMessage(hwndParent, WM_ACTIVATE, (WPARAM)WA_ACTIVE, (LPARAM)hwndSelf);
-@@ -1086,7 +1702,10 @@
+@@ -1082,7 +1698,10 @@
   */
  MsgRouting AwtWindow::WmSize(UINT type, int w, int h)
  {
@@ -4633,7 +4622,7 @@
          return mrDoDefault;
      }
  
-@@ -1150,102 +1769,18 @@
+@@ -1146,102 +1765,18 @@
      if (env->EnsureLocalCapacity(2) < 0) {
          return mrConsume;
      }
@@ -4744,7 +4733,7 @@
  MsgRouting AwtWindow::WmNcHitTest(UINT x, UINT y, LRESULT& retVal)
  {
      // If this window is blocked by modal dialog, return HTCLIENT for any point of it.
-@@ -1474,6 +2009,19 @@
+@@ -1467,6 +2002,19 @@
      }
  }
  
@@ -4764,7 +4753,7 @@
  void AwtWindow::FlashWindowEx(HWND hWnd, UINT count, DWORD timeout, DWORD flags) {
      FLASHWINFO fi;
      fi.cbSize = sizeof(fi);
-@@ -2353,8 +2901,16 @@
+@@ -2346,8 +2894,16 @@
          env->GetFieldID(cls, "warningString", "Ljava/lang/String;");
      AwtWindow::locationByPlatformID =
          env->GetFieldID(cls, "locationByPlatform", "Z");
@@ -4781,7 +4770,7 @@
  
      CATCH_BAD_ALLOC;
  }
-@@ -2880,5 +3436,27 @@
+@@ -2873,5 +3429,27 @@
  
      CATCH_BAD_ALLOC;
  }
@@ -4810,18 +4799,18 @@
  
  } /* extern "C" */
 diff -Nru openjdk.orig/jdk/src/windows/native/sun/windows/awt_Window.h openjdk/jdk/src/windows/native/sun/windows/awt_Window.h
---- openjdk.orig/jdk/src/windows/native/sun/windows/awt_Window.h	2011-02-17 15:43:31.000000000 +0000
-+++ openjdk/jdk/src/windows/native/sun/windows/awt_Window.h	2011-02-17 15:50:10.732056235 +0000
-@@ -57,6 +57,8 @@
+--- openjdk.orig/jdk/src/windows/native/sun/windows/awt_Window.h	2012-06-08 11:18:48.544782478 +0100
++++ openjdk/jdk/src/windows/native/sun/windows/awt_Window.h	2012-06-08 11:21:24.399337882 +0100
+@@ -56,6 +56,8 @@
      static jfieldID locationByPlatformID;
      static jfieldID screenID; /* screen number passed over from WindowPeer */
      static jfieldID autoRequestFocusID;
 +    static jfieldID securityWarningWidthID;
 +    static jfieldID securityWarningHeightID;
  
-     /* WWindowPeer class */
-     static jclass wwindowPeerCls;
-@@ -69,6 +71,9 @@
+     // The coordinates at the peer.
+     static jfieldID sysXID;
+@@ -63,6 +65,9 @@
      static jfieldID sysWID;
      static jfieldID sysHID;
  
@@ -4831,7 +4820,7 @@
      AwtWindow();
      virtual ~AwtWindow();
  
-@@ -158,6 +163,8 @@
+@@ -152,6 +157,8 @@
      static void SetModalBlocker(HWND window, HWND blocker);
      static void SetAndActivateModalBlocker(HWND window, HWND blocker);
  
@@ -4840,7 +4829,7 @@
      /*
       * Windows message handler functions
       */
-@@ -175,13 +182,13 @@
+@@ -169,13 +176,13 @@
      virtual MsgRouting WmSettingChange(UINT wFlag, LPCTSTR pszSection);
      virtual MsgRouting WmNcCalcSize(BOOL fCalcValidRects,
                                      LPNCCALCSIZE_PARAMS lpncsp, LRESULT& retVal);
@@ -4855,7 +4844,7 @@
  
      virtual MsgRouting HandleEvent(MSG *msg, BOOL synthetic);
      virtual void WindowResized();
-@@ -216,11 +223,22 @@
+@@ -210,11 +217,22 @@
      static void _SetOpacity(void* param);
      static void _SetOpaque(void* param);
      static void _UpdateWindow(void* param);
@@ -4878,7 +4867,7 @@
  private:
      static int ms_instanceCounter;
      static HHOOK ms_hCBTFilter;
-@@ -262,9 +280,56 @@
+@@ -256,9 +274,56 @@
      UINT contentWidth;
      UINT contentHeight;
  
@@ -4936,7 +4925,7 @@
  
  protected:
      BOOL m_isResizable;
-@@ -279,6 +344,12 @@
+@@ -273,6 +338,12 @@
      virtual void FillBackground(HDC hMemoryDC, SIZE &size);
      virtual void FillAlpha(void *bitmapBits, SIZE &size, BYTE alpha);
  
@@ -4950,8 +4939,8 @@
      int m_screenNum;
  
 diff -Nru openjdk.orig/jdk/src/windows/native/sun/windows/ComCtl32Util.cpp openjdk/jdk/src/windows/native/sun/windows/ComCtl32Util.cpp
---- openjdk.orig/jdk/src/windows/native/sun/windows/ComCtl32Util.cpp	2011-01-20 23:54:44.000000000 +0000
-+++ openjdk/jdk/src/windows/native/sun/windows/ComCtl32Util.cpp	2011-02-17 15:50:10.728056549 +0000
+--- openjdk.orig/jdk/src/windows/native/sun/windows/ComCtl32Util.cpp	2011-02-28 16:06:52.000000000 +0000
++++ openjdk/jdk/src/windows/native/sun/windows/ComCtl32Util.cpp	2012-06-08 11:21:24.399337882 +0100
 @@ -32,6 +32,7 @@
      m_lpfnSetWindowSubclass = NULL;
      m_lpfnRemoveWindowSubclass = NULL;
@@ -4969,8 +4958,8 @@
  
  void ComCtl32Util::FreeLibraries() {
 diff -Nru openjdk.orig/jdk/src/windows/native/sun/windows/ComCtl32Util.h openjdk/jdk/src/windows/native/sun/windows/ComCtl32Util.h
---- openjdk.orig/jdk/src/windows/native/sun/windows/ComCtl32Util.h	2011-01-20 23:54:44.000000000 +0000
-+++ openjdk/jdk/src/windows/native/sun/windows/ComCtl32Util.h	2011-02-17 15:50:10.728056549 +0000
+--- openjdk.orig/jdk/src/windows/native/sun/windows/ComCtl32Util.h	2011-02-28 16:06:52.000000000 +0000
++++ openjdk/jdk/src/windows/native/sun/windows/ComCtl32Util.h	2012-06-08 11:21:24.399337882 +0100
 @@ -63,6 +63,10 @@
              return m_bNewSubclassing;
          }
@@ -4993,7 +4982,7 @@
                                                   WPARAM wParam, LPARAM lParam,
 diff -Nru openjdk.orig/jdk/src/windows/native/sun/windows/DllUtil.cpp openjdk/jdk/src/windows/native/sun/windows/DllUtil.cpp
 --- openjdk.orig/jdk/src/windows/native/sun/windows/DllUtil.cpp	1970-01-01 01:00:00.000000000 +0100
-+++ openjdk/jdk/src/windows/native/sun/windows/DllUtil.cpp	2011-02-17 15:50:10.728056549 +0000
++++ openjdk/jdk/src/windows/native/sun/windows/DllUtil.cpp	2012-06-08 11:21:24.399337882 +0100
 @@ -0,0 +1,87 @@
 +/*
 + * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved.
@@ -5084,7 +5073,7 @@
 +
 diff -Nru openjdk.orig/jdk/src/windows/native/sun/windows/DllUtil.h openjdk/jdk/src/windows/native/sun/windows/DllUtil.h
 --- openjdk.orig/jdk/src/windows/native/sun/windows/DllUtil.h	1970-01-01 01:00:00.000000000 +0100
-+++ openjdk/jdk/src/windows/native/sun/windows/DllUtil.h	2011-02-17 15:50:10.728056549 +0000
++++ openjdk/jdk/src/windows/native/sun/windows/DllUtil.h	2012-06-08 11:21:24.399337882 +0100
 @@ -0,0 +1,97 @@
 +/*
 + * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved.
@@ -5185,7 +5174,7 @@
 +
 diff -Nru openjdk.orig/jdk/test/java/awt/Focus/CloseDialogActivateOwnerTest/CloseDialogActivateOwnerTest.java openjdk/jdk/test/java/awt/Focus/CloseDialogActivateOwnerTest/CloseDialogActivateOwnerTest.java
 --- openjdk.orig/jdk/test/java/awt/Focus/CloseDialogActivateOwnerTest/CloseDialogActivateOwnerTest.java	1970-01-01 01:00:00.000000000 +0100
-+++ openjdk/jdk/test/java/awt/Focus/CloseDialogActivateOwnerTest/CloseDialogActivateOwnerTest.java	2011-02-17 15:50:10.732056235 +0000
++++ openjdk/jdk/test/java/awt/Focus/CloseDialogActivateOwnerTest/CloseDialogActivateOwnerTest.java	2012-06-08 11:21:24.399337882 +0100
 @@ -0,0 +1,114 @@
 +/*
 + * Copyright (c) 2008, 2009, Oracle and/or its affiliates. All rights reserved.
@@ -5303,14 +5292,14 @@
 +
 diff -Nru openjdk.orig/jdk/test/java/awt/Focus/CloseDialogActivateOwnerTest/java.policy openjdk/jdk/test/java/awt/Focus/CloseDialogActivateOwnerTest/java.policy
 --- openjdk.orig/jdk/test/java/awt/Focus/CloseDialogActivateOwnerTest/java.policy	1970-01-01 01:00:00.000000000 +0100
-+++ openjdk/jdk/test/java/awt/Focus/CloseDialogActivateOwnerTest/java.policy	2011-02-17 15:50:10.732056235 +0000
++++ openjdk/jdk/test/java/awt/Focus/CloseDialogActivateOwnerTest/java.policy	2012-06-08 11:21:24.399337882 +0100
 @@ -0,0 +1,3 @@
 +grant {
 +	permission java.awt.AWTPermission "createRobot";
 +};
 diff -Nru openjdk.orig/jdk/test/java/awt/Focus/OwnedWindowFocusIMECrashTest/OwnedWindowFocusIMECrashTest.java openjdk/jdk/test/java/awt/Focus/OwnedWindowFocusIMECrashTest/OwnedWindowFocusIMECrashTest.java
 --- openjdk.orig/jdk/test/java/awt/Focus/OwnedWindowFocusIMECrashTest/OwnedWindowFocusIMECrashTest.java	1970-01-01 01:00:00.000000000 +0100
-+++ openjdk/jdk/test/java/awt/Focus/OwnedWindowFocusIMECrashTest/OwnedWindowFocusIMECrashTest.java	2011-02-17 15:50:10.736055921 +0000
++++ openjdk/jdk/test/java/awt/Focus/OwnedWindowFocusIMECrashTest/OwnedWindowFocusIMECrashTest.java	2012-06-08 11:21:24.399337882 +0100
 @@ -0,0 +1,88 @@
 +/*
 + * Copyright (c) 2008, 2009, Oracle and/or its affiliates. All rights reserved.
--- a/patches/openjdk/6766342-AA-simple-shape-performance.patch	Thu May 31 12:40:08 2012 +0200
+++ b/patches/openjdk/6766342-AA-simple-shape-performance.patch	Fri Jun 08 14:23:28 2012 +0100
@@ -1,15 +1,7 @@
-# HG changeset patch
-# User flar
-# Date 1292361929 28800
-# Node ID 4d6f9aaa2600eec36725ab7cd47cb4b652755723
-# Parent  0eeac8ca33e329aab7a9ad0fcfb3a321cd1abd06
-6766342: Improve performance of Ductus rasterizer
-Reviewed-by: jgodinez, prr
-
-diff -r 0eeac8ca33e3 -r 4d6f9aaa2600 make/sun/awt/mapfile-vers
---- openjdk.orig/jdk/make/sun/awt/mapfile-vers	Fri Dec 10 16:14:04 2010 -0800
-+++ openjdk/jdk/make/sun/awt/mapfile-vers	Tue Dec 14 13:25:29 2010 -0800
-@@ -118,6 +118,8 @@
+diff -Nru openjdk.orig/jdk/make/sun/awt/mapfile-vers openjdk/jdk/make/sun/awt/mapfile-vers
+--- openjdk.orig/jdk/make/sun/awt/mapfile-vers	2012-06-08 12:04:25.289301993 +0100
++++ openjdk/jdk/make/sun/awt/mapfile-vers	2012-06-08 12:08:06.220870613 +0100
+@@ -119,6 +119,8 @@
  		Java_sun_java2d_loops_GraphicsPrimitiveMgr_registerNativeLoops;
  		Java_sun_java2d_loops_MaskBlit_MaskBlit;
  		Java_sun_java2d_loops_MaskFill_MaskFill;
@@ -18,9 +10,9 @@
  		Java_sun_java2d_loops_TransformHelper_Transform;
  		Java_sun_java2d_pipe_Region_initIDs;
  		Java_sun_java2d_pipe_SpanClipRenderer_initIDs;
-diff -r 0eeac8ca33e3 -r 4d6f9aaa2600 make/sun/awt/mapfile-vers-linux
---- openjdk.orig/jdk/make/sun/awt/mapfile-vers-linux	Fri Dec 10 16:14:04 2010 -0800
-+++ openjdk/jdk/make/sun/awt/mapfile-vers-linux	Tue Dec 14 13:25:29 2010 -0800
+diff -Nru openjdk.orig/jdk/make/sun/awt/mapfile-vers-linux openjdk/jdk/make/sun/awt/mapfile-vers-linux
+--- openjdk.orig/jdk/make/sun/awt/mapfile-vers-linux	2012-06-08 12:04:24.353286879 +0100
++++ openjdk/jdk/make/sun/awt/mapfile-vers-linux	2012-06-08 12:08:06.220870613 +0100
 @@ -115,6 +115,8 @@
  		Java_sun_java2d_loops_GraphicsPrimitiveMgr_registerNativeLoops;
  		Java_sun_java2d_loops_MaskBlit_MaskBlit;
@@ -28,11 +20,11 @@
 +		Java_sun_java2d_loops_MaskFill_FillAAPgram;
 +		Java_sun_java2d_loops_MaskFill_DrawAAPgram;
                  Java_sun_java2d_pipe_BufferedRenderPipe_fillSpans;
+                 Java_sun_java2d_pipe_RenderBuffer_copyFromArray;
  		Java_sun_java2d_pipe_SpanClipRenderer_initIDs;
- 		sun_awt_image_GifImageDecoder_initIDs;
-diff -r 0eeac8ca33e3 -r 4d6f9aaa2600 src/share/classes/sun/dc/DuctusRenderingEngine.java
---- openjdk.orig/jdk/src/share/classes/sun/dc/DuctusRenderingEngine.java	Fri Dec 10 16:14:04 2010 -0800
-+++ openjdk/jdk/src/share/classes/sun/dc/DuctusRenderingEngine.java	Tue Dec 14 13:25:29 2010 -0800
+diff -Nru openjdk.orig/jdk/src/share/classes/sun/dc/DuctusRenderingEngine.java openjdk/jdk/src/share/classes/sun/dc/DuctusRenderingEngine.java
+--- openjdk.orig/jdk/src/share/classes/sun/dc/DuctusRenderingEngine.java	2011-02-28 16:06:31.000000000 +0000
++++ openjdk/jdk/src/share/classes/sun/dc/DuctusRenderingEngine.java	2012-06-08 12:08:06.220870613 +0100
 @@ -635,6 +635,88 @@
          return r;
      }
@@ -122,9 +114,514 @@
      private void feedConsumer(PathConsumer consumer, PathIterator pi) {
          try {
              consumer.beginPath();
-diff -r 0eeac8ca33e3 -r 4d6f9aaa2600 src/share/classes/sun/java2d/SurfaceData.java
---- openjdk.orig/jdk/src/share/classes/sun/java2d/SurfaceData.java	Fri Dec 10 16:14:04 2010 -0800
-+++ openjdk/jdk/src/share/classes/sun/java2d/SurfaceData.java	Tue Dec 14 13:25:29 2010 -0800
+diff -Nru openjdk.orig/jdk/src/share/classes/sun/java2d/loops/CompositeType.java openjdk/jdk/src/share/classes/sun/java2d/loops/CompositeType.java
+--- openjdk.orig/jdk/src/share/classes/sun/java2d/loops/CompositeType.java	2011-02-28 16:06:33.000000000 +0000
++++ openjdk/jdk/src/share/classes/sun/java2d/loops/CompositeType.java	2012-06-08 12:08:06.228870743 +0100
+@@ -27,6 +27,7 @@
+ 
+ import java.awt.image.BufferedImage;
+ import java.awt.AlphaComposite;
++import java.util.HashMap;
+ 
+ /**
+  * A CompositeType object provides a chained description of a type of
+@@ -51,6 +52,11 @@
+  * the indicated algorithm if all of the more specific searches fail.
+  */
+ public final class CompositeType {
++
++    private static int unusedUID = 1;
++    private static final HashMap<String,Integer> compositeUIDMap =
++        new HashMap<String,Integer>(100);
++
+     /*
+      * CONSTANTS USED BY ALL PRIMITIVES TO DESCRIBE THE COMPOSITING
+      * ALGORITHMS THEY CAN PERFORM
+@@ -153,6 +159,22 @@
+         SrcOverNoEa   = SrcOver.deriveSubType(DESC_SRC_OVER_NO_EA);
+ 
+     /*
++     * A special CompositeType for the case where we are filling in
++     * SrcOverNoEa mode with an opaque color.  In that case then the
++     * best loop for us to use would be a SrcNoEa loop, but what if
++     * there is no such loop?  In that case then we would end up
++     * backing off to a Src loop (which should still be fine) or an
++     * AnyAlpha loop which would be slower than a SrcOver loop in
++     * most cases.
++     * The fix is to use the following chain which looks for loops
++     * in the following order:
++     *    SrcNoEa, Src, SrcOverNoEa, SrcOver, AnyAlpha
++     */
++    public static final CompositeType
++        OpaqueSrcOverNoEa = SrcOverNoEa.deriveSubType(DESC_SRC)
++                                       .deriveSubType(DESC_SRC_NO_EA);
++
++    /*
+      * END OF CompositeType OBJECTS FOR THE VARIOUS CONSTANTS
+      */
+ 
+@@ -210,7 +232,6 @@
+         }
+     }
+ 
+-    private static int unusedUID = 1;
+     private int uniqueID;
+     private String desc;
+     private CompositeType next;
+@@ -218,14 +239,20 @@
+     private CompositeType(CompositeType parent, String desc) {
+         next = parent;
+         this.desc = desc;
+-        this.uniqueID = makeUniqueID();
++        this.uniqueID = makeUniqueID(desc);
+     }
+ 
+-    private synchronized static final int makeUniqueID() {
+-        if (unusedUID > 255) {
+-            throw new InternalError("composite type id overflow");
++    public synchronized static final int makeUniqueID(String desc) {
++        Integer i = compositeUIDMap.get(desc);
++
++        if (i == null) {
++            if (unusedUID > 255) {
++                throw new InternalError("composite type id overflow");
++            }
++            i = unusedUID++;
++            compositeUIDMap.put(desc, i);
+         }
+-        return unusedUID++;
++        return i;
+     }
+ 
+     public int getUniqueID() {
+diff -Nru openjdk.orig/jdk/src/share/classes/sun/java2d/loops/MaskFill.java openjdk/jdk/src/share/classes/sun/java2d/loops/MaskFill.java
+--- openjdk.orig/jdk/src/share/classes/sun/java2d/loops/MaskFill.java	2011-02-28 16:06:33.000000000 +0000
++++ openjdk/jdk/src/share/classes/sun/java2d/loops/MaskFill.java	2012-06-08 12:08:06.228870743 +0100
+@@ -50,6 +50,10 @@
+ public class MaskFill extends GraphicsPrimitive
+ {
+     public static final String methodSignature = "MaskFill(...)".toString();
++    public static final String fillPgramSignature =
++        "FillAAPgram(...)".toString();
++    public static final String drawPgramSignature =
++        "DrawAAPgram(...)".toString();
+ 
+     public static final int primTypeID = makePrimTypeID();
+ 
+@@ -92,6 +96,14 @@
+         return fill;
+     }
+ 
++    protected MaskFill(String alternateSignature,
++                       SurfaceType srctype,
++                       CompositeType comptype,
++                       SurfaceType dsttype)
++    {
++        super(alternateSignature, primTypeID, srctype, comptype, dsttype);
++    }
++
+     protected MaskFill(SurfaceType srctype,
+                        CompositeType comptype,
+                        SurfaceType dsttype)
+@@ -115,6 +127,23 @@
+                                 int x, int y, int w, int h,
+                                 byte[] mask, int maskoff, int maskscan);
+ 
++    public native void FillAAPgram(SunGraphics2D sg2d, SurfaceData sData,
++                                   Composite comp,
++                                   double x, double y,
++                                   double dx1, double dy1,
++                                   double dx2, double dy2);
++
++    public native void DrawAAPgram(SunGraphics2D sg2d, SurfaceData sData,
++                                   Composite comp,
++                                   double x, double y,
++                                   double dx1, double dy1,
++                                   double dx2, double dy2,
++                                   double lw1, double lw2);
++
++    public boolean canDoParallelograms() {
++        return (getNativePrim() != 0);
++    }
++
+     static {
+         GraphicsPrimitiveMgr.registerGeneral(new MaskFill(null, null, null));
+     }
+@@ -182,12 +211,22 @@
+ 
+     private static class TraceMaskFill extends MaskFill {
+         MaskFill target;
++        MaskFill fillPgramTarget;
++        MaskFill drawPgramTarget;
+ 
+         public TraceMaskFill(MaskFill target) {
+             super(target.getSourceType(),
+                   target.getCompositeType(),
+                   target.getDestType());
+             this.target = target;
++            this.fillPgramTarget = new MaskFill(fillPgramSignature,
++                                                target.getSourceType(),
++                                                target.getCompositeType(),
++                                                target.getDestType());
++            this.drawPgramTarget = new MaskFill(drawPgramSignature,
++                                                target.getSourceType(),
++                                                target.getCompositeType(),
++                                                target.getDestType());
+         }
+ 
+         public GraphicsPrimitive traceWrap() {
+@@ -203,5 +242,32 @@
+             target.MaskFill(sg2d, sData, comp, x, y, w, h,
+                             mask, maskoff, maskscan);
+         }
++
++        public void FillAAPgram(SunGraphics2D sg2d, SurfaceData sData,
++                                Composite comp,
++                                double x, double y,
++                                double dx1, double dy1,
++                                double dx2, double dy2)
++        {
++            tracePrimitive(fillPgramTarget);
++            target.FillAAPgram(sg2d, sData, comp,
++                               x, y, dx1, dy1, dx2, dy2);
++        }
++
++        public void DrawAAPgram(SunGraphics2D sg2d, SurfaceData sData,
++                                Composite comp,
++                                double x, double y,
++                                double dx1, double dy1,
++                                double dx2, double dy2,
++                                double lw1, double lw2)
++        {
++            tracePrimitive(drawPgramTarget);
++            target.DrawAAPgram(sg2d, sData, comp,
++                               x, y, dx1, dy1, dx2, dy2, lw1, lw2);
++        }
++
++        public boolean canDoParallelograms() {
++            return target.canDoParallelograms();
++        }
+     }
+ }
+diff -Nru openjdk.orig/jdk/src/share/classes/sun/java2d/pipe/AAShapePipe.java openjdk/jdk/src/share/classes/sun/java2d/pipe/AAShapePipe.java
+--- openjdk.orig/jdk/src/share/classes/sun/java2d/pipe/AAShapePipe.java	2011-02-28 16:06:33.000000000 +0000
++++ openjdk/jdk/src/share/classes/sun/java2d/pipe/AAShapePipe.java	2012-06-08 12:08:06.228870743 +0100
+@@ -28,6 +28,7 @@
+ import java.awt.BasicStroke;
+ import java.awt.Rectangle;
+ import java.awt.Shape;
++import java.awt.geom.Rectangle2D;
+ import java.awt.geom.PathIterator;
+ import sun.awt.SunHints;
+ import sun.java2d.SunGraphics2D;
+@@ -39,7 +40,9 @@
+  * This class sets up the Generator and computes the alpha tiles
+  * and then passes them on to a CompositePipe object for painting.
+  */
+-public class AAShapePipe implements ShapeDrawPipe {
++public class AAShapePipe
++    implements ShapeDrawPipe, ParallelogramPipe
++{
+     static RenderingEngine renderengine = RenderingEngine.getInstance();
+ 
+     CompositePipe outpipe;
+@@ -65,6 +68,59 @@
+         renderPath(sg, s, null);
+     }
+ 
++    private static Rectangle2D computeBBox(double x, double y,
++                                           double dx1, double dy1,
++                                           double dx2, double dy2)
++    {
++        double lox, loy, hix, hiy;
++        lox = hix = x;
++        loy = hiy = y;
++        if (dx1 < 0) { lox += dx1; } else { hix += dx1; }
++        if (dy1 < 0) { loy += dy1; } else { hiy += dy1; }
++        if (dx2 < 0) { lox += dx2; } else { hix += dx2; }
++        if (dy2 < 0) { loy += dy2; } else { hiy += dy2; }
++        return new Rectangle2D.Double(lox, loy, hix-lox, hiy-loy);
++    }
++
++    public void fillParallelogram(SunGraphics2D sg,
++                                  double x, double y,
++                                  double dx1, double dy1,
++                                  double dx2, double dy2)
++    {
++        Region clip = sg.getCompClip();
++        int abox[] = new int[4];
++        AATileGenerator aatg =
++            renderengine.getAATileGenerator(x, y, dx1, dy1, dx2, dy2, 0, 0,
++                                            clip, abox);
++        if (aatg == null) {
++            // Nothing to render
++            return;
++        }
++
++        renderTiles(sg, computeBBox(x, y, dx1, dy1, dx2, dy2), aatg, abox);
++    }
++
++    public void drawParallelogram(SunGraphics2D sg,
++                                  double x, double y,
++                                  double dx1, double dy1,
++                                  double dx2, double dy2,
++                                  double lw1, double lw2)
++    {
++        Region clip = sg.getCompClip();
++        int abox[] = new int[4];
++        AATileGenerator aatg =
++            renderengine.getAATileGenerator(x, y, dx1, dy1, dx2, dy2, 0, 0,
++                                            clip, abox);
++        if (aatg == null) {
++            // Nothing to render
++            return;
++        }
++
++        // Note that bbox is of the original shape, not the wide path.
++        // This is appropriate for handing to Paint methods...
++        renderTiles(sg, computeBBox(x, y, dx1, dy1, dx2, dy2), aatg, abox);
++    }
++
+     private static byte[] theTile;
+ 
+     public synchronized static byte[] getAlphaTile(int len) {
+@@ -85,8 +141,6 @@
+         boolean adjust = (bs != null &&
+                           sg.strokeHint != SunHints.INTVAL_STROKE_PURE);
+         boolean thin = (sg.strokeState <= sg.STROKE_THINDASHED);
+-        Object context = null;
+-        byte alpha[] = null;
+ 
+         Region clip = sg.getCompClip();
+         int abox[] = new int[4];
+@@ -98,6 +152,14 @@
+             return;
+         }
+ 
++        renderTiles(sg, s, aatg, abox);
++    }
++
++    public void renderTiles(SunGraphics2D sg, Shape s,
++                            AATileGenerator aatg, int abox[])
++    {
++        Object context = null;
++        byte alpha[] = null;
+         try {
+             context = outpipe.startSequence(sg, s,
+                                             new Rectangle(abox[0], abox[1],
+diff -Nru openjdk.orig/jdk/src/share/classes/sun/java2d/pipe/AlphaColorPipe.java openjdk/jdk/src/share/classes/sun/java2d/pipe/AlphaColorPipe.java
+--- openjdk.orig/jdk/src/share/classes/sun/java2d/pipe/AlphaColorPipe.java	2011-02-28 16:06:33.000000000 +0000
++++ openjdk/jdk/src/share/classes/sun/java2d/pipe/AlphaColorPipe.java	2012-06-08 12:08:06.228870743 +0100
+@@ -34,7 +34,7 @@
+  * into a destination that supports direct alpha compositing of a solid
+  * color, according to one of the rules in the AlphaComposite class.
+  */
+-public class AlphaColorPipe implements CompositePipe {
++public class AlphaColorPipe implements CompositePipe, ParallelogramPipe {
+     public AlphaColorPipe() {
+     }
+ 
+@@ -64,4 +64,23 @@
+     public void endSequence(Object context) {
+         return;
+     }
++
++    public void fillParallelogram(SunGraphics2D sg,
++                                  double x, double y,
++                                  double dx1, double dy1,
++                                  double dx2, double dy2)
++    {
++        sg.alphafill.FillAAPgram(sg, sg.getSurfaceData(), sg.composite,
++                                 x, y, dx1, dy1, dx2, dy2);
++    }
++
++    public void drawParallelogram(SunGraphics2D sg,
++                                  double x, double y,
++                                  double dx1, double dy1,
++                                  double dx2, double dy2,
++                                  double lw1, double lw2)
++    {
++        sg.alphafill.DrawAAPgram(sg, sg.getSurfaceData(), sg.composite,
++                                 x, y, dx1, dy1, dx2, dy2, lw1, lw2);
++    }
+ }
+diff -Nru openjdk.orig/jdk/src/share/classes/sun/java2d/pipe/RenderingEngine.java openjdk/jdk/src/share/classes/sun/java2d/pipe/RenderingEngine.java
+--- openjdk.orig/jdk/src/share/classes/sun/java2d/pipe/RenderingEngine.java	2011-02-28 16:06:33.000000000 +0000
++++ openjdk/jdk/src/share/classes/sun/java2d/pipe/RenderingEngine.java	2012-06-08 12:08:06.228870743 +0100
+@@ -264,6 +264,72 @@
+                                                        int bbox[]);
+ 
+     /**
++     * Construct an antialiased tile generator for the given parallelogram
++     * store the bounds of the tile iteration in the bbox parameter.
++     * The parallelogram is specified as a starting point and 2 delta
++     * vectors that indicate the slopes of the 2 pairs of sides of the
++     * parallelogram.
++     * The 4 corners of the parallelogram are defined by the 4 points:
++     * <ul>
++     * <li> {@code x}, {@code y}
++     * <li> {@code x+dx1}, {@code y+dy1}
++     * <li> {@code x+dx1+dx2}, {@code y+dy1+dy2}
++     * <li> {@code x+dx2}, {@code y+dy2}
++     * </ul>
++     * The {@code lw1} and {@code lw2} parameters provide a specification
++     * for an optionally stroked parallelogram if they are positive numbers.
++     * The {@code lw1} parameter is the ratio of the length of the {@code dx1},
++     * {@code dx2} delta vector to half of the line width in that same
++     * direction.
++     * The {@code lw2} parameter provides the same ratio for the other delta
++     * vector.
++     * If {@code lw1} and {@code lw2} are both greater than zero, then
++     * the parallelogram figure is doubled by both expanding and contracting
++     * each delta vector by its corresponding {@code lw} value.
++     * If either (@code lw1) or {@code lw2} are also greater than 1, then
++     * the inner (contracted) parallelogram disappears and the figure is
++     * simply a single expanded parallelogram.
++     * The {@code clip} parameter specifies the current clip in effect
++     * in device coordinates and can be used to prune the data for the
++     * operation, but the renderer is not required to perform any
++     * clipping.
++     * <p>
++     * Upon returning, this method will fill the {@code bbox} parameter
++     * with 4 values indicating the bounds of the iteration of the
++     * tile generator.
++     * The iteration order of the tiles will be as specified by the
++     * pseudo-code:
++     * <pre>
++     *     for (y = bbox[1]; y < bbox[3]; y += tileheight) {
++     *         for (x = bbox[0]; x < bbox[2]; x += tilewidth) {
++     *         }
++     *     }
++     * </pre>
++     * If there is no output to be rendered, this method may return
++     * null.
++     *
++     * @param x the X coordinate of the first corner of the parallelogram
++     * @param y the Y coordinate of the first corner of the parallelogram
++     * @param dx1 the X coordinate delta of the first leg of the parallelogram
++     * @param dy1 the Y coordinate delta of the first leg of the parallelogram
++     * @param dx2 the X coordinate delta of the second leg of the parallelogram
++     * @param dy2 the Y coordinate delta of the second leg of the parallelogram
++     * @param lw1 the line width ratio for the first leg of the parallelogram
++     * @param lw2 the line width ratio for the second leg of the parallelogram
++     * @param clip the current clip in effect in device coordinates
++     * @param bbox returns the bounds of the iteration
++     * @return the {@code AATileGenerator} instance to be consulted
++     *         for tile coverages, or null if there is no output to render
++     * @since 1.7
++     */
++    public abstract AATileGenerator getAATileGenerator(double x, double y,
++                                                       double dx1, double dy1,
++                                                       double dx2, double dy2,
++                                                       double lw1, double lw2,
++                                                       Region clip,
++                                                       int bbox[]);
++
++    /**
+      * Returns the minimum pen width that the antialiasing rasterizer
+      * can represent without dropouts occuring.
+      * @since 1.7
+@@ -376,5 +442,24 @@
+                                              bs, thin, normalize,
+                                              bbox);
+         }
++        public AATileGenerator getAATileGenerator(double x, double y,
++                                                  double dx1, double dy1,
++                                                  double dx2, double dy2,
++                                                  double lw1, double lw2,
++                                                  Region clip,
++                                                  int bbox[])
++        {
++            System.out.println(name+".getAATileGenerator("+
++                               x+", "+y+", "+
++                               dx1+", "+dy1+", "+
++                               dx2+", "+dy2+", "+
++                               lw1+", "+lw2+", "+
++                               clip+")");
++            return target.getAATileGenerator(x, y,
++                                             dx1, dy1,
++                                             dx2, dy2,
++                                             lw1, lw2,
++                                             clip, bbox);
++        }
+     }
+ }
+diff -Nru openjdk.orig/jdk/src/share/classes/sun/java2d/pisces/PiscesRenderingEngine.java openjdk/jdk/src/share/classes/sun/java2d/pisces/PiscesRenderingEngine.java
+--- openjdk.orig/jdk/src/share/classes/sun/java2d/pisces/PiscesRenderingEngine.java	2012-06-08 12:04:24.965296763 +0100
++++ openjdk/jdk/src/share/classes/sun/java2d/pisces/PiscesRenderingEngine.java	2012-06-08 12:08:06.228870743 +0100
+@@ -557,6 +557,69 @@
+         return ptg;
+     }
+ 
++    public AATileGenerator getAATileGenerator(double x, double y,
++                                              double dx1, double dy1,
++                                              double dx2, double dy2,
++                                              double lw1, double lw2,
++                                              Region clip,
++                                              int bbox[])
++    {
++        // REMIND: Deal with large coordinates!
++        double ldx1, ldy1, ldx2, ldy2;
++        boolean innerpgram = (lw1 > 0 && lw2 > 0);
++
++        if (innerpgram) {
++            ldx1 = dx1 * lw1;
++            ldy1 = dy1 * lw1;
++            ldx2 = dx2 * lw2;
++            ldy2 = dy2 * lw2;
++            x -= (ldx1 + ldx2) / 2.0;
++            y -= (ldy1 + ldy2) / 2.0;
++            dx1 += ldx1;
++            dy1 += ldy1;
++            dx2 += ldx2;
++            dy2 += ldy2;
++            if (lw1 > 1 && lw2 > 1) {
++                // Inner parallelogram was entirely consumed by stroke...
++                innerpgram = false;
++            }
++        } else {
++            ldx1 = ldy1 = ldx2 = ldy2 = 0;
++        }
++
++        Renderer r = new Renderer(3, 3,
++                                  clip.getLoX(), clip.getLoY(),
++                                  clip.getWidth(), clip.getHeight(),
++                                  PathIterator.WIND_EVEN_ODD);
++
++        r.moveTo((float) x, (float) y);
++        r.lineTo((float) (x+dx1), (float) (y+dy1));
++        r.lineTo((float) (x+dx1+dx2), (float) (y+dy1+dy2));
++        r.lineTo((float) (x+dx2), (float) (y+dy2));
++        r.closePath();
++
++        if (innerpgram) {
++            x += ldx1 + ldx2;
++            y += ldy1 + ldy2;
++            dx1 -= 2.0 * ldx1;
++            dy1 -= 2.0 * ldy1;
++            dx2 -= 2.0 * ldx2;
++            dy2 -= 2.0 * ldy2;
++            r.moveTo((float) x, (float) y);
++            r.lineTo((float) (x+dx1), (float) (y+dy1));
++            r.lineTo((float) (x+dx1+dx2), (float) (y+dy1+dy2));
++            r.lineTo((float) (x+dx2), (float) (y+dy2));
++            r.closePath();
++        }
++
++        r.pathDone();
++
++        r.endRendering();
++        PiscesTileGenerator ptg = new PiscesTileGenerator(r, r.MAX_AA_ALPHA);
++        ptg.getBbox(bbox);
++        return ptg;
++    }
++
+     /**
+      * Returns the minimum pen width that the antialiasing rasterizer
+      * can represent without dropouts occuring.
+diff -Nru openjdk.orig/jdk/src/share/classes/sun/java2d/SurfaceData.java openjdk/jdk/src/share/classes/sun/java2d/SurfaceData.java
+--- openjdk.orig/jdk/src/share/classes/sun/java2d/SurfaceData.java	2012-06-08 12:04:25.293302058 +0100
++++ openjdk/jdk/src/share/classes/sun/java2d/SurfaceData.java	2012-06-08 12:08:06.228870743 +0100
 @@ -367,16 +367,17 @@
      public static final TextPipe aaTextRenderer;
      public static final TextPipe lcdTextRenderer;
@@ -325,514 +822,9 @@
          SurfaceType dst = sg2d.getSurfaceData().getSurfaceType();
  
          Object o = loopcache.get(src, comp, dst);
-diff -r 0eeac8ca33e3 -r 4d6f9aaa2600 src/share/classes/sun/java2d/loops/CompositeType.java
---- openjdk.orig/jdk/src/share/classes/sun/java2d/loops/CompositeType.java	Fri Dec 10 16:14:04 2010 -0800
-+++ openjdk/jdk/src/share/classes/sun/java2d/loops/CompositeType.java	Tue Dec 14 13:25:29 2010 -0800
-@@ -27,6 +27,7 @@
- 
- import java.awt.image.BufferedImage;
- import java.awt.AlphaComposite;
-+import java.util.HashMap;
- 
- /**
-  * A CompositeType object provides a chained description of a type of
-@@ -51,6 +52,11 @@
-  * the indicated algorithm if all of the more specific searches fail.
-  */
- public final class CompositeType {
-+
-+    private static int unusedUID = 1;
-+    private static final HashMap<String,Integer> compositeUIDMap =
-+        new HashMap<String,Integer>(100);
-+
-     /*
-      * CONSTANTS USED BY ALL PRIMITIVES TO DESCRIBE THE COMPOSITING
-      * ALGORITHMS THEY CAN PERFORM
-@@ -153,6 +159,22 @@
-         SrcOverNoEa   = SrcOver.deriveSubType(DESC_SRC_OVER_NO_EA);
- 
-     /*
-+     * A special CompositeType for the case where we are filling in
-+     * SrcOverNoEa mode with an opaque color.  In that case then the
-+     * best loop for us to use would be a SrcNoEa loop, but what if
-+     * there is no such loop?  In that case then we would end up
-+     * backing off to a Src loop (which should still be fine) or an
-+     * AnyAlpha loop which would be slower than a SrcOver loop in
-+     * most cases.
-+     * The fix is to use the following chain which looks for loops
-+     * in the following order:
-+     *    SrcNoEa, Src, SrcOverNoEa, SrcOver, AnyAlpha
-+     */
-+    public static final CompositeType
-+        OpaqueSrcOverNoEa = SrcOverNoEa.deriveSubType(DESC_SRC)
-+                                       .deriveSubType(DESC_SRC_NO_EA);
-+
-+    /*
-      * END OF CompositeType OBJECTS FOR THE VARIOUS CONSTANTS
-      */
- 
-@@ -210,7 +232,6 @@
-         }
-     }
- 
--    private static int unusedUID = 1;
-     private int uniqueID;
-     private String desc;
-     private CompositeType next;
-@@ -218,14 +239,20 @@
-     private CompositeType(CompositeType parent, String desc) {
-         next = parent;
-         this.desc = desc;
--        this.uniqueID = makeUniqueID();
-+        this.uniqueID = makeUniqueID(desc);
-     }
- 
--    private synchronized static final int makeUniqueID() {
--        if (unusedUID > 255) {
--            throw new InternalError("composite type id overflow");
-+    public synchronized static final int makeUniqueID(String desc) {
-+        Integer i = compositeUIDMap.get(desc);
-+
-+        if (i == null) {
-+            if (unusedUID > 255) {
-+                throw new InternalError("composite type id overflow");
-+            }
-+            i = unusedUID++;
-+            compositeUIDMap.put(desc, i);
-         }
--        return unusedUID++;
-+        return i;
-     }
- 
-     public int getUniqueID() {
-diff -r 0eeac8ca33e3 -r 4d6f9aaa2600 src/share/classes/sun/java2d/loops/MaskFill.java
---- openjdk.orig/jdk/src/share/classes/sun/java2d/loops/MaskFill.java	Fri Dec 10 16:14:04 2010 -0800
-+++ openjdk/jdk/src/share/classes/sun/java2d/loops/MaskFill.java	Tue Dec 14 13:25:29 2010 -0800
-@@ -50,6 +50,10 @@
- public class MaskFill extends GraphicsPrimitive
- {
-     public static final String methodSignature = "MaskFill(...)".toString();
-+    public static final String fillPgramSignature =
-+        "FillAAPgram(...)".toString();
-+    public static final String drawPgramSignature =
-+        "DrawAAPgram(...)".toString();
- 
-     public static final int primTypeID = makePrimTypeID();
- 
-@@ -92,6 +96,14 @@
-         return fill;
-     }
- 
-+    protected MaskFill(String alternateSignature,
-+                       SurfaceType srctype,
-+                       CompositeType comptype,
-+                       SurfaceType dsttype)
-+    {
-+        super(alternateSignature, primTypeID, srctype, comptype, dsttype);
-+    }
-+
-     protected MaskFill(SurfaceType srctype,
-                        CompositeType comptype,
-                        SurfaceType dsttype)
-@@ -115,6 +127,23 @@
-                                 int x, int y, int w, int h,
-                                 byte[] mask, int maskoff, int maskscan);
- 
-+    public native void FillAAPgram(SunGraphics2D sg2d, SurfaceData sData,
-+                                   Composite comp,
-+                                   double x, double y,
-+                                   double dx1, double dy1,
-+                                   double dx2, double dy2);
-+
-+    public native void DrawAAPgram(SunGraphics2D sg2d, SurfaceData sData,
-+                                   Composite comp,
-+                                   double x, double y,
-+                                   double dx1, double dy1,
-+                                   double dx2, double dy2,
-+                                   double lw1, double lw2);
-+
-+    public boolean canDoParallelograms() {
-+        return (getNativePrim() != 0);
-+    }
-+
-     static {
-         GraphicsPrimitiveMgr.registerGeneral(new MaskFill(null, null, null));
-     }
-@@ -182,12 +211,22 @@
- 
-     private static class TraceMaskFill extends MaskFill {
-         MaskFill target;
-+        MaskFill fillPgramTarget;
-+        MaskFill drawPgramTarget;
- 
-         public TraceMaskFill(MaskFill target) {
-             super(target.getSourceType(),
-                   target.getCompositeType(),
-                   target.getDestType());
-             this.target = target;
-+            this.fillPgramTarget = new MaskFill(fillPgramSignature,
-+                                                target.getSourceType(),
-+                                                target.getCompositeType(),
-+                                                target.getDestType());
-+            this.drawPgramTarget = new MaskFill(drawPgramSignature,
-+                                                target.getSourceType(),
-+                                                target.getCompositeType(),
-+                                                target.getDestType());
-         }
- 
-         public GraphicsPrimitive traceWrap() {
-@@ -203,5 +242,32 @@
-             target.MaskFill(sg2d, sData, comp, x, y, w, h,
-                             mask, maskoff, maskscan);
-         }
-+
-+        public void FillAAPgram(SunGraphics2D sg2d, SurfaceData sData,
-+                                Composite comp,
-+                                double x, double y,
-+                                double dx1, double dy1,
-+                                double dx2, double dy2)
-+        {
-+            tracePrimitive(fillPgramTarget);
-+            target.FillAAPgram(sg2d, sData, comp,
-+                               x, y, dx1, dy1, dx2, dy2);
-+        }
-+
-+        public void DrawAAPgram(SunGraphics2D sg2d, SurfaceData sData,
-+                                Composite comp,
-+                                double x, double y,
-+                                double dx1, double dy1,
-+                                double dx2, double dy2,
-+                                double lw1, double lw2)
-+        {
-+            tracePrimitive(drawPgramTarget);
-+            target.DrawAAPgram(sg2d, sData, comp,
-+                               x, y, dx1, dy1, dx2, dy2, lw1, lw2);
-+        }
-+
-+        public boolean canDoParallelograms() {
-+            return target.canDoParallelograms();
-+        }
-     }
- }
-diff -r 0eeac8ca33e3 -r 4d6f9aaa2600 src/share/classes/sun/java2d/pipe/AAShapePipe.java
---- openjdk.orig/jdk/src/share/classes/sun/java2d/pipe/AAShapePipe.java	Fri Dec 10 16:14:04 2010 -0800
-+++ openjdk/jdk/src/share/classes/sun/java2d/pipe/AAShapePipe.java	Tue Dec 14 13:25:29 2010 -0800
-@@ -28,6 +28,7 @@
- import java.awt.BasicStroke;
- import java.awt.Rectangle;
- import java.awt.Shape;
-+import java.awt.geom.Rectangle2D;
- import java.awt.geom.PathIterator;
- import sun.awt.SunHints;
- import sun.java2d.SunGraphics2D;
-@@ -39,7 +40,9 @@
-  * This class sets up the Generator and computes the alpha tiles
-  * and then passes them on to a CompositePipe object for painting.
-  */
--public class AAShapePipe implements ShapeDrawPipe {
-+public class AAShapePipe
-+    implements ShapeDrawPipe, ParallelogramPipe
-+{
-     static RenderingEngine renderengine = RenderingEngine.getInstance();
- 
-     CompositePipe outpipe;
-@@ -65,6 +68,59 @@
-         renderPath(sg, s, null);
-     }
- 
-+    private static Rectangle2D computeBBox(double x, double y,
-+                                           double dx1, double dy1,
-+                                           double dx2, double dy2)
-+    {
-+        double lox, loy, hix, hiy;
-+        lox = hix = x;
-+        loy = hiy = y;
-+        if (dx1 < 0) { lox += dx1; } else { hix += dx1; }
-+        if (dy1 < 0) { loy += dy1; } else { hiy += dy1; }
-+        if (dx2 < 0) { lox += dx2; } else { hix += dx2; }
-+        if (dy2 < 0) { loy += dy2; } else { hiy += dy2; }
-+        return new Rectangle2D.Double(lox, loy, hix-lox, hiy-loy);
-+    }
-+
-+    public void fillParallelogram(SunGraphics2D sg,
-+                                  double x, double y,
-+                                  double dx1, double dy1,
-+                                  double dx2, double dy2)
-+    {
-+        Region clip = sg.getCompClip();
-+        int abox[] = new int[4];
-+        AATileGenerator aatg =
-+            renderengine.getAATileGenerator(x, y, dx1, dy1, dx2, dy2, 0, 0,
-+                                            clip, abox);
-+        if (aatg == null) {
-+            // Nothing to render
-+            return;
-+        }
-+
-+        renderTiles(sg, computeBBox(x, y, dx1, dy1, dx2, dy2), aatg, abox);
-+    }
-+
-+    public void drawParallelogram(SunGraphics2D sg,
-+                                  double x, double y,
-+                                  double dx1, double dy1,
-+                                  double dx2, double dy2,
-+                                  double lw1, double lw2)
-+    {
-+        Region clip = sg.getCompClip();
-+        int abox[] = new int[4];
-+        AATileGenerator aatg =
-+            renderengine.getAATileGenerator(x, y, dx1, dy1, dx2, dy2, 0, 0,
-+                                            clip, abox);
-+        if (aatg == null) {
-+            // Nothing to render
-+            return;
-+        }
-+
-+        // Note that bbox is of the original shape, not the wide path.
-+        // This is appropriate for handing to Paint methods...
-+        renderTiles(sg, computeBBox(x, y, dx1, dy1, dx2, dy2), aatg, abox);
-+    }
-+
-     private static byte[] theTile;
- 
-     public synchronized static byte[] getAlphaTile(int len) {
-@@ -85,8 +141,6 @@
-         boolean adjust = (bs != null &&
-                           sg.strokeHint != SunHints.INTVAL_STROKE_PURE);
-         boolean thin = (sg.strokeState <= sg.STROKE_THINDASHED);
--        Object context = null;
--        byte alpha[] = null;
- 
-         Region clip = sg.getCompClip();
-         int abox[] = new int[4];
-@@ -98,6 +152,14 @@
-             return;
-         }
- 
-+        renderTiles(sg, s, aatg, abox);
-+    }
-+
-+    public void renderTiles(SunGraphics2D sg, Shape s,
-+                            AATileGenerator aatg, int abox[])
-+    {
-+        Object context = null;
-+        byte alpha[] = null;
-         try {
-             context = outpipe.startSequence(sg, s,
-                                             new Rectangle(abox[0], abox[1],
-diff -r 0eeac8ca33e3 -r 4d6f9aaa2600 src/share/classes/sun/java2d/pipe/AlphaColorPipe.java
---- openjdk.orig/jdk/src/share/classes/sun/java2d/pipe/AlphaColorPipe.java	Fri Dec 10 16:14:04 2010 -0800
-+++ openjdk/jdk/src/share/classes/sun/java2d/pipe/AlphaColorPipe.java	Tue Dec 14 13:25:29 2010 -0800
-@@ -34,7 +34,7 @@
-  * into a destination that supports direct alpha compositing of a solid
-  * color, according to one of the rules in the AlphaComposite class.
-  */
--public class AlphaColorPipe implements CompositePipe {
-+public class AlphaColorPipe implements CompositePipe, ParallelogramPipe {
-     public AlphaColorPipe() {
-     }
- 
-@@ -64,4 +64,23 @@
-     public void endSequence(Object context) {
-         return;
-     }
-+
-+    public void fillParallelogram(SunGraphics2D sg,
-+                                  double x, double y,
-+                                  double dx1, double dy1,
-+                                  double dx2, double dy2)
-+    {
-+        sg.alphafill.FillAAPgram(sg, sg.getSurfaceData(), sg.composite,
-+                                 x, y, dx1, dy1, dx2, dy2);
-+    }
-+
-+    public void drawParallelogram(SunGraphics2D sg,
-+                                  double x, double y,
-+                                  double dx1, double dy1,
-+                                  double dx2, double dy2,
-+                                  double lw1, double lw2)
-+    {
-+        sg.alphafill.DrawAAPgram(sg, sg.getSurfaceData(), sg.composite,
-+                                 x, y, dx1, dy1, dx2, dy2, lw1, lw2);
-+    }
- }
-diff -r 0eeac8ca33e3 -r 4d6f9aaa2600 src/share/classes/sun/java2d/pipe/RenderingEngine.java
---- openjdk.orig/jdk/src/share/classes/sun/java2d/pipe/RenderingEngine.java	Fri Dec 10 16:14:04 2010 -0800
-+++ openjdk/jdk/src/share/classes/sun/java2d/pipe/RenderingEngine.java	Tue Dec 14 13:25:29 2010 -0800
-@@ -281,6 +281,72 @@
-                                                        int bbox[]);
- 
-     /**
-+     * Construct an antialiased tile generator for the given parallelogram
-+     * store the bounds of the tile iteration in the bbox parameter.
-+     * The parallelogram is specified as a starting point and 2 delta
-+     * vectors that indicate the slopes of the 2 pairs of sides of the
-+     * parallelogram.
-+     * The 4 corners of the parallelogram are defined by the 4 points:
-+     * <ul>
-+     * <li> {@code x}, {@code y}
-+     * <li> {@code x+dx1}, {@code y+dy1}
-+     * <li> {@code x+dx1+dx2}, {@code y+dy1+dy2}
-+     * <li> {@code x+dx2}, {@code y+dy2}
-+     * </ul>
-+     * The {@code lw1} and {@code lw2} parameters provide a specification
-+     * for an optionally stroked parallelogram if they are positive numbers.
-+     * The {@code lw1} parameter is the ratio of the length of the {@code dx1},
-+     * {@code dx2} delta vector to half of the line width in that same
-+     * direction.
-+     * The {@code lw2} parameter provides the same ratio for the other delta
-+     * vector.
-+     * If {@code lw1} and {@code lw2} are both greater than zero, then
-+     * the parallelogram figure is doubled by both expanding and contracting
-+     * each delta vector by its corresponding {@code lw} value.
-+     * If either (@code lw1) or {@code lw2} are also greater than 1, then
-+     * the inner (contracted) parallelogram disappears and the figure is
-+     * simply a single expanded parallelogram.
-+     * The {@code clip} parameter specifies the current clip in effect
-+     * in device coordinates and can be used to prune the data for the
-+     * operation, but the renderer is not required to perform any
-+     * clipping.
-+     * <p>
-+     * Upon returning, this method will fill the {@code bbox} parameter
-+     * with 4 values indicating the bounds of the iteration of the
-+     * tile generator.
-+     * The iteration order of the tiles will be as specified by the
-+     * pseudo-code:
-+     * <pre>
-+     *     for (y = bbox[1]; y < bbox[3]; y += tileheight) {
-+     *         for (x = bbox[0]; x < bbox[2]; x += tilewidth) {
-+     *         }
-+     *     }
-+     * </pre>
-+     * If there is no output to be rendered, this method may return
-+     * null.
-+     *
-+     * @param x the X coordinate of the first corner of the parallelogram
-+     * @param y the Y coordinate of the first corner of the parallelogram
-+     * @param dx1 the X coordinate delta of the first leg of the parallelogram
-+     * @param dy1 the Y coordinate delta of the first leg of the parallelogram
-+     * @param dx2 the X coordinate delta of the second leg of the parallelogram
-+     * @param dy2 the Y coordinate delta of the second leg of the parallelogram
-+     * @param lw1 the line width ratio for the first leg of the parallelogram
-+     * @param lw2 the line width ratio for the second leg of the parallelogram
-+     * @param clip the current clip in effect in device coordinates
-+     * @param bbox returns the bounds of the iteration
-+     * @return the {@code AATileGenerator} instance to be consulted
-+     *         for tile coverages, or null if there is no output to render
-+     * @since 1.7
-+     */
-+    public abstract AATileGenerator getAATileGenerator(double x, double y,
-+                                                       double dx1, double dy1,
-+                                                       double dx2, double dy2,
-+                                                       double lw1, double lw2,
-+                                                       Region clip,
-+                                                       int bbox[]);
-+
-+    /**
-      * Returns the minimum pen width that the antialiasing rasterizer
-      * can represent without dropouts occuring.
-      * @since 1.7
-@@ -393,5 +459,24 @@
-                                              bs, thin, normalize,
-                                              bbox);
-         }
-+        public AATileGenerator getAATileGenerator(double x, double y,
-+                                                  double dx1, double dy1,
-+                                                  double dx2, double dy2,
-+                                                  double lw1, double lw2,
-+                                                  Region clip,
-+                                                  int bbox[])
-+        {
-+            System.out.println(name+".getAATileGenerator("+
-+                               x+", "+y+", "+
-+                               dx1+", "+dy1+", "+
-+                               dx2+", "+dy2+", "+
-+                               lw1+", "+lw2+", "+
-+                               clip+")");
-+            return target.getAATileGenerator(x, y,
-+                                             dx1, dy1,
-+                                             dx2, dy2,
-+                                             lw1, lw2,
-+                                             clip, bbox);
-+        }
-     }
- }
-diff -r 0eeac8ca33e3 -r 4d6f9aaa2600 src/share/classes/sun/java2d/pisces/PiscesRenderingEngine.java
---- openjdk.orig/jdk/src/share/classes/sun/java2d/pisces/PiscesRenderingEngine.java	Fri Dec 10 16:14:04 2010 -0800
-+++ openjdk/jdk/src/share/classes/sun/java2d/pisces/PiscesRenderingEngine.java	Tue Dec 14 13:25:29 2010 -0800
-@@ -557,6 +557,69 @@
-         return ptg;
-     }
- 
-+    public AATileGenerator getAATileGenerator(double x, double y,
-+                                              double dx1, double dy1,
-+                                              double dx2, double dy2,
-+                                              double lw1, double lw2,
-+                                              Region clip,
-+                                              int bbox[])
-+    {
-+        // REMIND: Deal with large coordinates!
-+        double ldx1, ldy1, ldx2, ldy2;
-+        boolean innerpgram = (lw1 > 0 && lw2 > 0);
-+
-+        if (innerpgram) {
-+            ldx1 = dx1 * lw1;
-+            ldy1 = dy1 * lw1;
-+            ldx2 = dx2 * lw2;
-+            ldy2 = dy2 * lw2;
-+            x -= (ldx1 + ldx2) / 2.0;
-+            y -= (ldy1 + ldy2) / 2.0;
-+            dx1 += ldx1;
-+            dy1 += ldy1;
-+            dx2 += ldx2;
-+            dy2 += ldy2;
-+            if (lw1 > 1 && lw2 > 1) {
-+                // Inner parallelogram was entirely consumed by stroke...
-+                innerpgram = false;
-+            }
-+        } else {
-+            ldx1 = ldy1 = ldx2 = ldy2 = 0;
-+        }
-+
-+        Renderer r = new Renderer(3, 3,
-+                                  clip.getLoX(), clip.getLoY(),
-+                                  clip.getWidth(), clip.getHeight(),
-+                                  PathIterator.WIND_EVEN_ODD);
-+
-+        r.moveTo((float) x, (float) y);
-+        r.lineTo((float) (x+dx1), (float) (y+dy1));
-+        r.lineTo((float) (x+dx1+dx2), (float) (y+dy1+dy2));
-+        r.lineTo((float) (x+dx2), (float) (y+dy2));
-+        r.closePath();
-+
-+        if (innerpgram) {
-+            x += ldx1 + ldx2;
-+            y += ldy1 + ldy2;
-+            dx1 -= 2.0 * ldx1;
-+            dy1 -= 2.0 * ldy1;
-+            dx2 -= 2.0 * ldx2;
-+            dy2 -= 2.0 * ldy2;
-+            r.moveTo((float) x, (float) y);
-+            r.lineTo((float) (x+dx1), (float) (y+dy1));
-+            r.lineTo((float) (x+dx1+dx2), (float) (y+dy1+dy2));
-+            r.lineTo((float) (x+dx2), (float) (y+dy2));
-+            r.closePath();
-+        }
-+
-+        r.pathDone();
-+
-+        r.endRendering();
-+        PiscesTileGenerator ptg = new PiscesTileGenerator(r, r.MAX_AA_ALPHA);
-+        ptg.getBbox(bbox);
-+        return ptg;
-+    }
-+
-     /**
-      * Returns the minimum pen width that the antialiasing rasterizer
-      * can represent without dropouts occuring.
-diff -r 0eeac8ca33e3 -r 4d6f9aaa2600 src/share/native/sun/java2d/loops/DrawParallelogram.c
---- openjdk.orig/jdk/src/share/native/sun/java2d/loops/DrawParallelogram.c	Fri Dec 10 16:14:04 2010 -0800
-+++ openjdk/jdk/src/share/native/sun/java2d/loops/DrawParallelogram.c	Tue Dec 14 13:25:29 2010 -0800
+diff -Nru openjdk.orig/jdk/src/share/native/sun/java2d/loops/DrawParallelogram.c openjdk/jdk/src/share/native/sun/java2d/loops/DrawParallelogram.c
+--- openjdk.orig/jdk/src/share/native/sun/java2d/loops/DrawParallelogram.c	2012-06-08 12:04:25.297302124 +0100
++++ openjdk/jdk/src/share/native/sun/java2d/loops/DrawParallelogram.c	2012-06-08 12:08:06.232870807 +0100
 @@ -26,14 +26,11 @@
  #include "math.h"
  #include "GraphicsPrimitiveMgr.h"
@@ -919,9 +911,9 @@
                  // If the line widths are both less than a pixel wide
                  // then we can use a drawline function instead for even
                  // more performance.
-diff -r 0eeac8ca33e3 -r 4d6f9aaa2600 src/share/native/sun/java2d/loops/FillParallelogram.c
---- openjdk.orig/jdk/src/share/native/sun/java2d/loops/FillParallelogram.c	Fri Dec 10 16:14:04 2010 -0800
-+++ openjdk/jdk/src/share/native/sun/java2d/loops/FillParallelogram.c	Tue Dec 14 13:25:29 2010 -0800
+diff -Nru openjdk.orig/jdk/src/share/native/sun/java2d/loops/FillParallelogram.c openjdk/jdk/src/share/native/sun/java2d/loops/FillParallelogram.c
+--- openjdk.orig/jdk/src/share/native/sun/java2d/loops/FillParallelogram.c	2012-06-08 12:04:25.297302124 +0100
++++ openjdk/jdk/src/share/native/sun/java2d/loops/FillParallelogram.c	2012-06-08 12:08:06.232870807 +0100
 @@ -25,31 +25,10 @@
  
  #include "math.h"
@@ -982,9 +974,9 @@
      iy1 = (jint) floor(y0 + 0.5);
      iy2 = (jint) floor(y0 + dy1 + dy2 + 0.5);
  
-diff -r 0eeac8ca33e3 -r 4d6f9aaa2600 src/share/native/sun/java2d/loops/MaskFill.c
---- openjdk.orig/jdk/src/share/native/sun/java2d/loops/MaskFill.c	Fri Dec 10 16:14:04 2010 -0800
-+++ openjdk/jdk/src/share/native/sun/java2d/loops/MaskFill.c	Tue Dec 14 13:25:29 2010 -0800
+diff -Nru openjdk.orig/jdk/src/share/native/sun/java2d/loops/MaskFill.c openjdk/jdk/src/share/native/sun/java2d/loops/MaskFill.c
+--- openjdk.orig/jdk/src/share/native/sun/java2d/loops/MaskFill.c	2011-02-28 16:06:47.000000000 +0000
++++ openjdk/jdk/src/share/native/sun/java2d/loops/MaskFill.c	2012-06-08 12:08:06.232870807 +0100
 @@ -23,7 +23,11 @@
   * questions.
   */
@@ -1672,9 +1664,9 @@
 +        if (pMask != NULL && pMask != localmask) {
 +            free(pMask);
 +        }
-     }
-     SurfaceData_InvokeUnlock(env, sdOps, &rasInfo);
- }
++    }
++    SurfaceData_InvokeUnlock(env, sdOps, &rasInfo);
++}
 +
 +/* Main function to fill a double pair of (inner and outer) parallelograms */
 +static void
@@ -1962,12 +1954,12 @@
 +        if (pMask != NULL && pMask != localmask) {
 +            free(pMask);
 +        }
-+    }
-+    SurfaceData_InvokeUnlock(env, sdOps, &rasInfo);
-+}
-diff -r 0eeac8ca33e3 -r 4d6f9aaa2600 src/share/native/sun/java2d/loops/ParallelogramUtils.h
---- /dev/null	Thu Jan 01 00:00:00 1970 +0000
-+++ openjdk/jdk/src/share/native/sun/java2d/loops/ParallelogramUtils.h	Tue Dec 14 13:25:29 2010 -0800
+     }
+     SurfaceData_InvokeUnlock(env, sdOps, &rasInfo);
+ }
+diff -Nru openjdk.orig/jdk/src/share/native/sun/java2d/loops/ParallelogramUtils.h openjdk/jdk/src/share/native/sun/java2d/loops/ParallelogramUtils.h
+--- openjdk.orig/jdk/src/share/native/sun/java2d/loops/ParallelogramUtils.h	1970-01-01 01:00:00.000000000 +0100
++++ openjdk/jdk/src/share/native/sun/java2d/loops/ParallelogramUtils.h	2012-06-08 12:08:06.232870807 +0100
 @@ -0,0 +1,83 @@
 +/*
 + * Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved.
@@ -2052,9 +2044,9 @@
 +    } while(0)
 +
 +#endif /* ParallelogramUtils_h_Included */
-diff -r 0eeac8ca33e3 -r 4d6f9aaa2600 src/solaris/native/sun/java2d/loops/vis_IntArgbPre_Mask.c
---- openjdk.orig/jdk/src/solaris/native/sun/java2d/loops/vis_IntArgbPre_Mask.c	Fri Dec 10 16:14:04 2010 -0800
-+++ openjdk/jdk/src/solaris/native/sun/java2d/loops/vis_IntArgbPre_Mask.c	Tue Dec 14 13:25:29 2010 -0800
+diff -Nru openjdk.orig/jdk/src/solaris/native/sun/java2d/loops/vis_IntArgbPre_Mask.c openjdk/jdk/src/solaris/native/sun/java2d/loops/vis_IntArgbPre_Mask.c
+--- openjdk.orig/jdk/src/solaris/native/sun/java2d/loops/vis_IntArgbPre_Mask.c	2011-02-28 16:06:50.000000000 +0000
++++ openjdk/jdk/src/solaris/native/sun/java2d/loops/vis_IntArgbPre_Mask.c	2012-06-08 12:08:06.232870807 +0100
 @@ -517,13 +517,15 @@
          ADD_SUFF(AnyIntSetRect)(pRasInfo, 0, 0, width, height,
                                  fgColor, pPrim, pCompInfo);
@@ -2089,9 +2081,9 @@
          return;
      }
  
-diff -r 0eeac8ca33e3 -r 4d6f9aaa2600 src/solaris/native/sun/java2d/loops/vis_SrcMaskFill.c
---- openjdk.orig/jdk/src/solaris/native/sun/java2d/loops/vis_SrcMaskFill.c	Fri Dec 10 16:14:04 2010 -0800
-+++ openjdk/jdk/src/solaris/native/sun/java2d/loops/vis_SrcMaskFill.c	Tue Dec 14 13:25:29 2010 -0800
+diff -Nru openjdk.orig/jdk/src/solaris/native/sun/java2d/loops/vis_SrcMaskFill.c openjdk/jdk/src/solaris/native/sun/java2d/loops/vis_SrcMaskFill.c
+--- openjdk.orig/jdk/src/solaris/native/sun/java2d/loops/vis_SrcMaskFill.c	2011-02-28 16:06:50.000000000 +0000
++++ openjdk/jdk/src/solaris/native/sun/java2d/loops/vis_SrcMaskFill.c	2012-06-08 12:08:06.232870807 +0100
 @@ -150,10 +150,12 @@
      }
  
@@ -2172,16 +2164,16 @@
          return;
      }
  
-diff -r 0eeac8ca33e3 -r 4d6f9aaa2600 test/java/awt/Graphics2D/RenderClipTest/6766342.tests
---- /dev/null	Thu Jan 01 00:00:00 1970 +0000
-+++ openjdk/jdk/test/java/awt/Graphics2D/RenderClipTest/6766342.tests	Tue Dec 14 13:25:29 2010 -0800
+diff -Nru openjdk.orig/jdk/test/java/awt/Graphics2D/RenderClipTest/6766342.tests openjdk/jdk/test/java/awt/Graphics2D/RenderClipTest/6766342.tests
+--- openjdk.orig/jdk/test/java/awt/Graphics2D/RenderClipTest/6766342.tests	1970-01-01 01:00:00.000000000 +0100
++++ openjdk/jdk/test/java/awt/Graphics2D/RenderClipTest/6766342.tests	2012-06-08 12:08:06.232870807 +0100
 @@ -0,0 +1,3 @@
 +Filled AA Pure Rect(5, 29.4, 10, 10)
 +Stroked AA Pure Rect(5, 4.4, 10, 10)
 +Stroked AA Line(20, 20, -10, 20)
-diff -r 0eeac8ca33e3 -r 4d6f9aaa2600 test/java/awt/Graphics2D/RenderClipTest/RenderClipTest.java
---- /dev/null	Thu Jan 01 00:00:00 1970 +0000
-+++ openjdk/jdk/test/java/awt/Graphics2D/RenderClipTest/RenderClipTest.java	Tue Dec 14 13:25:29 2010 -0800
+diff -Nru openjdk.orig/jdk/test/java/awt/Graphics2D/RenderClipTest/RenderClipTest.java openjdk/jdk/test/java/awt/Graphics2D/RenderClipTest/RenderClipTest.java
+--- openjdk.orig/jdk/test/java/awt/Graphics2D/RenderClipTest/RenderClipTest.java	1970-01-01 01:00:00.000000000 +0100
++++ openjdk/jdk/test/java/awt/Graphics2D/RenderClipTest/RenderClipTest.java	2012-06-08 12:08:06.232870807 +0100
 @@ -0,0 +1,1634 @@
 +/*
 + * Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved.
--- a/patches/openjdk/6797139-jbutton_truncation.patch	Thu May 31 12:40:08 2012 +0200
+++ b/patches/openjdk/6797139-jbutton_truncation.patch	Fri Jun 08 14:23:28 2012 +0100
@@ -1,15 +1,19 @@
-# HG changeset patch
-# User alexp
-# Date 1251899239 -14400
-# Node ID 281fbd82a971f05fcf6f2c31cfe7db7ef74909e9
-# Parent  935814bd43a62d1b2c6871f0298c5b59fbf54428
-6797139: JButton title is truncating for some strings irrespective of preferred size.
-Reviewed-by: peterz
-
-diff -r 935814bd43a6 -r 281fbd82a971 src/share/classes/javax/swing/SwingUtilities.java
---- openjdk/jdk/src/share/classes/javax/swing/SwingUtilities.java	Tue Sep 01 18:51:15 2009 +0400
-+++ openjdk/jdk/src/share/classes/javax/swing/SwingUtilities.java	Wed Sep 02 17:47:19 2009 +0400
-@@ -999,24 +999,20 @@
+diff -Nru openjdk.orig/jdk/src/share/classes/javax/swing/plaf/synth/SynthMenuItemLayoutHelper.java openjdk/jdk/src/share/classes/javax/swing/plaf/synth/SynthMenuItemLayoutHelper.java
+--- openjdk.orig/jdk/src/share/classes/javax/swing/plaf/synth/SynthMenuItemLayoutHelper.java	2012-06-08 11:58:34.499639874 +0100
++++ openjdk/jdk/src/share/classes/javax/swing/plaf/synth/SynthMenuItemLayoutHelper.java	2012-06-08 11:59:33.324589336 +0100
+@@ -195,7 +195,7 @@
+                     getHorizontalAlignment(), getVerticalAlignment(),
+                     getHorizontalTextPosition(), getVerticalTextPosition(),
+                     getViewRect(), iconRect, textRect, getGap());
+-            textRect.width += getLeftTextExtraWidth() + getRightTextExtraWidth();
++            textRect.width += getLeftTextExtraWidth();
+             Rectangle labelRect = iconRect.union(textRect);
+             getLabelSize().setHeight(labelRect.height);
+             getLabelSize().setWidth(labelRect.width);
+diff -Nru openjdk.orig/jdk/src/share/classes/javax/swing/SwingUtilities.java openjdk/jdk/src/share/classes/javax/swing/SwingUtilities.java
+--- openjdk.orig/jdk/src/share/classes/javax/swing/SwingUtilities.java	2011-02-28 16:06:28.000000000 +0000
++++ openjdk/jdk/src/share/classes/javax/swing/SwingUtilities.java	2012-06-08 11:59:33.324589336 +0100
+@@ -1000,24 +1000,20 @@
                  textR.height = (int) v.getPreferredSpan(View.Y_AXIS);
              } else {
                  textR.width = SwingUtilities2.stringWidth(c, fm, text);
@@ -44,21 +48,9 @@
                  if (textR.width > availTextWidth) {
                      text = SwingUtilities2.clipString(c, fm, text,
                                                        availTextWidth);
-diff -r 935814bd43a6 -r 281fbd82a971 src/share/classes/javax/swing/plaf/synth/SynthMenuItemLayoutHelper.java
---- openjdk/jdk/src/share/classes/javax/swing/plaf/synth/SynthMenuItemLayoutHelper.java	Tue Sep 01 18:51:15 2009 +0400
-+++ openjdk/jdk/src/share/classes/javax/swing/plaf/synth/SynthMenuItemLayoutHelper.java	Wed Sep 02 17:47:19 2009 +0400
-@@ -195,7 +195,7 @@
-                     getHorizontalAlignment(), getVerticalAlignment(),
-                     getHorizontalTextPosition(), getVerticalTextPosition(),
-                     getViewRect(), iconRect, textRect, getGap());
--            textRect.width += getLeftTextExtraWidth() + getRightTextExtraWidth();
-+            textRect.width += getLeftTextExtraWidth();
-             Rectangle labelRect = iconRect.union(textRect);
-             getLabelSize().setHeight(labelRect.height);
-             getLabelSize().setWidth(labelRect.width);
-diff -r 935814bd43a6 -r 281fbd82a971 src/share/classes/sun/swing/MenuItemLayoutHelper.java
---- openjdk/jdk/src/share/classes/sun/swing/MenuItemLayoutHelper.java	Tue Sep 01 18:51:15 2009 +0400
-+++ openjdk/jdk/src/share/classes/sun/swing/MenuItemLayoutHelper.java	Wed Sep 02 17:47:19 2009 +0400
+diff -Nru openjdk.orig/jdk/src/share/classes/sun/swing/MenuItemLayoutHelper.java openjdk/jdk/src/share/classes/sun/swing/MenuItemLayoutHelper.java
+--- openjdk.orig/jdk/src/share/classes/sun/swing/MenuItemLayoutHelper.java	2012-06-08 11:58:34.499639874 +0100
++++ openjdk/jdk/src/share/classes/sun/swing/MenuItemLayoutHelper.java	2012-06-08 11:59:33.332589466 +0100
 @@ -84,7 +84,6 @@
      private int minTextOffset;
  
@@ -100,7 +92,7 @@
              Rectangle labelRect = iconRect.union(textRect);
              labelSize.height = labelRect.height;
              labelSize.width = labelRect.width;
-@@ -1121,10 +1110,6 @@
+@@ -1158,10 +1147,6 @@
          return leftTextExtraWidth;
      }
  
@@ -111,9 +103,9 @@
      /**
       * Returns false if the component is a JMenu and it is a top
       * level menu (on the menubar).
-diff -r 935814bd43a6 -r 281fbd82a971 src/share/classes/sun/swing/SwingUtilities2.java
---- openjdk/jdk/src/share/classes/sun/swing/SwingUtilities2.java	Tue Sep 01 18:51:15 2009 +0400
-+++ openjdk/jdk/src/share/classes/sun/swing/SwingUtilities2.java	Wed Sep 02 17:47:19 2009 +0400
+diff -Nru openjdk.orig/jdk/src/share/classes/sun/swing/SwingUtilities2.java openjdk/jdk/src/share/classes/sun/swing/SwingUtilities2.java
+--- openjdk.orig/jdk/src/share/classes/sun/swing/SwingUtilities2.java	2011-02-28 16:06:40.000000000 +0000
++++ openjdk/jdk/src/share/classes/sun/swing/SwingUtilities2.java	2012-06-08 11:59:33.332589466 +0100
 @@ -27,7 +27,6 @@
  
  import java.security.*;
@@ -122,9 +114,9 @@
  import java.awt.*;
  import static java.awt.RenderingHints.*;
  import java.awt.event.*;
-@@ -78,17 +77,23 @@
-     public static final Object LAF_STATE_KEY =
-             new StringBuffer("LookAndFeel State");
+@@ -69,17 +68,23 @@
+      */
+     public static final Object LAF_STATE_KEY = new Object(); // LookAndFeel State
  
 -    // Most of applications use 10 or less fonts simultaneously
 -    private static final int STRONG_BEARING_CACHE_SIZE = 10;
@@ -157,7 +149,7 @@
  
      public static final FontRenderContext DEFAULT_FRC =
          new FontRenderContext(null, false, false);
-@@ -183,6 +188,10 @@
+@@ -171,6 +176,10 @@
      private static final Object charsBufferLock = new Object();
      private static char[] charsBuffer = new char[CHAR_BUFFER_SIZE];
  
@@ -168,7 +160,7 @@
      /**
       * checks whether TextLayout is required to handle characters.
       *
-@@ -226,7 +235,9 @@
+@@ -214,7 +223,9 @@
  
      /**
       * Returns the left side bearing of the first character of string. The
@@ -179,7 +171,7 @@
       *
       * @param c JComponent that will display the string
       * @param fm FontMetrics used to measure the String width
-@@ -234,14 +245,11 @@
+@@ -222,14 +233,11 @@
       */
      public static int getLeftSideBearing(JComponent c, FontMetrics fm,
                                           String string) {
@@ -195,16 +187,13 @@
       * left side bearing is calculated from the passed in FontMetrics.
       *
       * @param c JComponent that will display the string
-@@ -250,105 +258,37 @@
+@@ -238,105 +246,37 @@
       */
      public static int getLeftSideBearing(JComponent c, FontMetrics fm,
                                           char firstChar) {
 -        return getBearing(c, fm, firstChar, true);
 -    }
-+        int charIndex = (int) firstChar;
-+        if (charIndex < MAX_CHAR_INDEX && charIndex >= MIN_CHAR_INDEX) {
-+            byte[] lsbs = null;
- 
+-
 -    /**
 -     * Returns the right side bearing of the last character of string. The
 -     * right side bearing is calculated from the passed in FontMetrics.
@@ -220,7 +209,10 @@
 -        }
 -        return getRightSideBearing(c, fm, string.charAt(string.length() - 1));
 -    }
--
++        int charIndex = (int) firstChar;
++        if (charIndex < MAX_CHAR_INDEX && charIndex >= MIN_CHAR_INDEX) {
++            byte[] lsbs = null;
+ 
 -    /**
 -     * Returns the right side bearing of the specified character. The
 -     * right side bearing is calculated from the passed in FontMetrics.
@@ -323,19 +315,20 @@
      }
  
      /**
-@@ -1063,99 +1003,72 @@
+@@ -1054,99 +994,72 @@
      }
  
      /**
 -     * BearingCacheEntry is used to cache left and right character bearings
 -     * for a particular <code>Font</code> and <code>FontRenderContext</code>.
+-     */
+-    private static class BearingCacheEntry {
+-        private FontMetrics fontMetrics;
 +     * LSBCacheEntry is used to cache the left side bearing (lsb) for
 +     * a particular <code>Font</code> and <code>FontRenderContext</code>.
 +     * This only caches characters that fall in the range
 +     * <code>MIN_CHAR_INDEX</code> to <code>MAX_CHAR_INDEX</code>.
-      */
--    private static class BearingCacheEntry {
--        private FontMetrics fontMetrics;
++     */
 +    private static class LSBCacheEntry {
 +        // Used to indicate a particular entry in lsb has not been set.
 +        private static final byte UNSET = Byte.MAX_VALUE;
@@ -355,60 +348,34 @@
 -            this.frc = fontMetrics.getFontRenderContext();
 -            this.cache = new HashMap<Character, Short>();
 -            assert (font != null && frc != null);
-+
-+        public LSBCacheEntry(FontRenderContext frc, Font font) {
-+            lsbCache = new byte[MAX_CHAR_INDEX - MIN_CHAR_INDEX];
-+            reset(frc, font);
-+
-+        }
-+
-+        public void reset(FontRenderContext frc, Font font) {
-+            this.font = font;
-+            this.frc = frc;
-+            for (int counter = lsbCache.length - 1; counter >= 0; counter--) {
-+                lsbCache[counter] = UNSET;
-+            }
-         }
+-        }
  
-         public int getLeftSideBearing(char aChar) {
+-        public int getLeftSideBearing(char aChar) {
 -            Short bearing = cache.get(aChar);
 -            if (bearing == null) {
 -                bearing = calcBearing(aChar);
 -                cache.put(aChar, bearing);
-+            int index = aChar - MIN_CHAR_INDEX;
-+            assert (index >= 0 && index < (MAX_CHAR_INDEX - MIN_CHAR_INDEX));
-+            byte lsb = lsbCache[index];
-+            if (lsb == UNSET) {
-+                oneChar[0] = aChar;
-+                GlyphVector gv = font.createGlyphVector(frc, oneChar);
-+                lsb = (byte) gv.getGlyphPixelBounds(0, frc, 0f, 0f).x;
-+                if (lsb < 0) {
-+                    /* HRGB/HBGR LCD glyph images will always have a pixel
-+                     * on the left used in colour fringe reduction.
-+                     * Text rendering positions this correctly but here
-+                     * we are using the glyph image to adjust that position
-+                     * so must account for it.
-+                     */
-+                    Object aaHint = frc.getAntiAliasingHint();
-+                    if (aaHint == VALUE_TEXT_ANTIALIAS_LCD_HRGB ||
-+                            aaHint == VALUE_TEXT_ANTIALIAS_LCD_HBGR) {
-+                        lsb++;
-+                    }
-+                }
-+                lsbCache[index] = lsb;
-             }
+-            }
 -            return ((0xFF00 & bearing) >>> 8) - 127;
--        }
-+            return lsb;
++        public LSBCacheEntry(FontRenderContext frc, Font font) {
++            lsbCache = new byte[MAX_CHAR_INDEX - MIN_CHAR_INDEX];
++            reset(frc, font);
++
+         }
  
 -        public int getRightSideBearing(char aChar) {
 -            Short bearing = cache.get(aChar);
 -            if (bearing == null) {
 -                bearing = calcBearing(aChar);
 -                cache.put(aChar, bearing);
--            }
++        public void reset(FontRenderContext frc, Font font) {
++            this.font = font;
++            this.frc = frc;
++            for (int counter = lsbCache.length - 1; counter >= 0; counter--) {
++                lsbCache[counter] = UNSET;
+             }
 -            return (0xFF & bearing) - 127;
--        }
+         }
  
 -        /* Calculates left and right side bearings for a character.
 -         * Makes an assumption that bearing is a value between -127 and +127.
@@ -452,8 +419,32 @@
 -            }
 -            if (rsb < -127 || rsb > 127) {
 -                rsb = 0;
--            }
--
++        public int getLeftSideBearing(char aChar) {
++            int index = aChar - MIN_CHAR_INDEX;
++            assert (index >= 0 && index < (MAX_CHAR_INDEX - MIN_CHAR_INDEX));
++            byte lsb = lsbCache[index];
++            if (lsb == UNSET) {
++                oneChar[0] = aChar;
++                GlyphVector gv = font.createGlyphVector(frc, oneChar);
++                lsb = (byte) gv.getGlyphPixelBounds(0, frc, 0f, 0f).x;
++                if (lsb < 0) {
++                    /* HRGB/HBGR LCD glyph images will always have a pixel
++                     * on the left used in colour fringe reduction.
++                     * Text rendering positions this correctly but here
++                     * we are using the glyph image to adjust that position
++                     * so must account for it.
++                     */
++                    Object aaHint = frc.getAntiAliasingHint();
++                    if (aaHint == VALUE_TEXT_ANTIALIAS_LCD_HRGB ||
++                            aaHint == VALUE_TEXT_ANTIALIAS_LCD_HBGR) {
++                        lsb++;
++                    }
++                }
++                lsbCache[index] = lsb;
+             }
++            return lsb;
++
+ 
 -            int bearing = ((lsb + 127) << 8) + (rsb + 127);
 -            return (short)bearing;
          }
@@ -471,7 +462,7 @@
              return (font.equals(oEntry.font) &&
                      frc.equals(oEntry.frc));
          }
-@@ -1172,7 +1085,6 @@
+@@ -1163,7 +1076,6 @@
          }
      }
  
@@ -479,7 +470,7 @@
      /*
       * here goes the fix for 4856343 [Problem with applet interaction
       * with system selection clipboard]
-@@ -1181,36 +1093,34 @@
+@@ -1172,36 +1084,34 @@
       * are to be performed
       */
  
@@ -542,9 +533,9 @@
       * access the system clipboard
       */
      public static boolean canCurrentEventAccessSystemClipboard() {
-diff -r 935814bd43a6 -r 281fbd82a971 test/javax/swing/SwingUtilities/6797139/bug6797139.java
---- /dev/null	Thu Jan 01 00:00:00 1970 +0000
-+++ openjdk/jdk/test/javax/swing/SwingUtilities/6797139/bug6797139.java	Wed Sep 02 17:47:19 2009 +0400
+diff -Nru openjdk.orig/jdk/test/javax/swing/SwingUtilities/6797139/bug6797139.java openjdk/jdk/test/javax/swing/SwingUtilities/6797139/bug6797139.java
+--- openjdk.orig/jdk/test/javax/swing/SwingUtilities/6797139/bug6797139.java	1970-01-01 01:00:00.000000000 +0100
++++ openjdk/jdk/test/javax/swing/SwingUtilities/6797139/bug6797139.java	2012-06-08 11:59:33.332589466 +0100
 @@ -0,0 +1,62 @@
 +/*
 + * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved.
--- a/patches/openjdk/6851973-kerberos.patch	Thu May 31 12:40:08 2012 +0200
+++ b/patches/openjdk/6851973-kerberos.patch	Fri Jun 08 14:23:28 2012 +0100
@@ -1,23 +1,15 @@
-# HG changeset patch
-# User weijun
-# Date 1245405807 -28800
-# Node ID 37ed72fe7561c143a882d03944a7d2240cbafe89
-# Parent  81c176909720561ec1c44fa3d94b18845e350ee9
-6851973: ignore incoming channel binding if acceptor does not set one
-Reviewed-by: valeriep
-
-diff -r 81c176909720 -r 37ed72fe7561 src/share/classes/sun/security/jgss/krb5/InitialToken.java
---- openjdk/jdk/src/share/classes/sun/security/jgss/krb5/InitialToken.java	Thu Jun 18 10:38:21 2009 -0400
-+++ openjdk/jdk/src/share/classes/sun/security/jgss/krb5/InitialToken.java	Fri Jun 19 18:03:27 2009 +0800
+diff -Nru openjdk.orig/jdk/src/share/classes/sun/security/jgss/krb5/InitialToken.java openjdk/jdk/src/share/classes/sun/security/jgss/krb5/InitialToken.java
+--- openjdk.orig/jdk/src/share/classes/sun/security/jgss/krb5/InitialToken.java	2011-02-28 16:06:38.000000000 +0000
++++ openjdk/jdk/src/share/classes/sun/security/jgss/krb5/InitialToken.java	2012-06-08 12:20:25.948833442 +0100
 @@ -33,6 +33,7 @@
  import java.net.Inet6Address;
  import java.security.MessageDigest;
  import java.security.NoSuchAlgorithmException;
 +import java.util.Arrays;
  import sun.security.krb5.*;
- import sun.security.jgss.HttpCaller;
+ import sun.security.jgss.GSSUtil;
  import sun.security.krb5.internal.Krb5;
-@@ -219,43 +220,35 @@
+@@ -225,43 +226,35 @@
                          "Incorrect checksum");
              }
  
@@ -33,6 +25,9 @@
  
 -            if (tokenContainsBindings ||
 -                localBindings != null) {
+-
+-                boolean badBindings = false;
+-                String errorMessage = null;
 +            // Ignore remote channel binding info when not requested at
 +            // local side (RFC 4121 4.1.1.2: the acceptor MAY ignore...).
 +            //
@@ -47,9 +42,6 @@
 +                System.arraycopy(checksumBytes, 4, remoteBindingBytes, 0,
 +                                 CHECKSUM_BINDINGS_SIZE);
  
--                boolean badBindings = false;
--                String errorMessage = null;
--
 -                if (tokenContainsBindings &&
 -                    localBindings != null) {
 +                byte[] noBindings = new byte[CHECKSUM_BINDINGS_SIZE];
@@ -73,19 +65,19 @@
                  } else {
 -                    errorMessage = "Token missing ChannelBinding!";
 -                    badBindings = true;
-+                    throw new GSSException(GSSException.BAD_BINDINGS, -1,
-+                                           "Token missing ChannelBinding!");
-                 }
+-                }
 -
 -                if (badBindings)
--                    throw new GSSException(GSSException.BAD_BINDINGS, -1,
+                     throw new GSSException(GSSException.BAD_BINDINGS, -1,
 -                                           errorMessage);
++                                           "Token missing ChannelBinding!");
++                }
              }
  
              flags = readLittleEndian(checksumBytes, 20, 4);
-diff -r 81c176909720 -r 37ed72fe7561 test/sun/security/krb5/auto/IgnoreChannelBinding.java
---- /dev/null	Thu Jan 01 00:00:00 1970 +0000
-+++ openjdk/jdk/test/sun/security/krb5/auto/IgnoreChannelBinding.java	Fri Jun 19 18:03:27 2009 +0800
+diff -Nru openjdk.orig/jdk/test/sun/security/krb5/auto/IgnoreChannelBinding.java openjdk/jdk/test/sun/security/krb5/auto/IgnoreChannelBinding.java
+--- openjdk.orig/jdk/test/sun/security/krb5/auto/IgnoreChannelBinding.java	1970-01-01 01:00:00.000000000 +0100
++++ openjdk/jdk/test/sun/security/krb5/auto/IgnoreChannelBinding.java	2012-06-08 12:20:25.948833442 +0100
 @@ -0,0 +1,113 @@
 +/*
 + * Copyright 2009 Sun Microsystems, Inc.  All Rights Reserved.
--- a/patches/openjdk/7034464-hugepage.patch	Thu May 31 12:40:08 2012 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,458 +0,0 @@
-# HG changeset patch
-# User iveresov
-# Date 1303344724 25200
-# Node ID 139667d9836ae218ab06a74d5813a5a700a076c9
-# Parent  49a67202bc671d23d719c9e14752d80295a9e8f6
-7034464: Support transparent large pages on Linux
-Summary: Support transparent huge pages on Linux available since 2.6.38
-Reviewed-by: iveresov, ysr
-Contributed-by: aph@redhat.com
-diff -u -r openjdk.patched/hotspot/src/os/linux/vm/globals_linux.hpp openjdk/hotspot/src/os/linux/vm/globals_linux.hpp
---- openjdk.patched/hotspot/src/os/linux/vm/globals_linux.hpp	2011-03-16 02:30:16.000000000 +0000
-+++ openjdk/hotspot/src/os/linux/vm/globals_linux.hpp	2011-05-04 11:57:15.083470027 +0100
-@@ -29,13 +29,19 @@
- // Defines Linux specific flags. They are not available on other platforms.
- //
- #define RUNTIME_OS_FLAGS(develop, develop_pd, product, product_pd, diagnostic, notproduct) \
--  product(bool, UseOprofile, false,                                 \
--        "enable support for Oprofile profiler")                     \
--                                                                    \
--  product(bool, UseLinuxPosixThreadCPUClocks, true,                 \
--          "enable fast Linux Posix clocks where available")
--// NB: The default value of UseLinuxPosixThreadCPUClocks may be
--// overridden in Arguments::parse_each_vm_init_arg.
-+  product(bool, UseOprofile, false,                                     \
-+        "enable support for Oprofile profiler")                         \
-+                                                                        \
-+  product(bool, UseLinuxPosixThreadCPUClocks, true,                     \
-+          "enable fast Linux Posix clocks where available")             \
-+/*  NB: The default value of UseLinuxPosixThreadCPUClocks may be        \
-+    overridden in Arguments::parse_each_vm_init_arg.  */                \
-+                                                                        \
-+  product(bool, UseHugeTLBFS, false,                                    \
-+          "Use MAP_HUGETLB for large pages")                            \
-+                                                                        \
-+  product(bool, UseSHM, false,                                          \
-+          "Use SYSV shared memory for large pages")
- 
- //
- // Defines Linux-specific default values. The flags are available on all
-diff -u -r openjdk.patched/hotspot/src/os/linux/vm/os_linux.cpp openjdk/hotspot/src/os/linux/vm/os_linux.cpp
---- openjdk.patched/hotspot/src/os/linux/vm/os_linux.cpp	2011-05-03 14:32:54.285722656 +0100
-+++ openjdk/hotspot/src/os/linux/vm/os_linux.cpp	2011-05-09 14:31:51.358502774 +0100
-@@ -2495,16 +2495,40 @@
-   return res != (uintptr_t) MAP_FAILED;
- }
- 
-+// Define MAP_HUGETLB here so we can build HotSpot on old systems.
-+#ifndef MAP_HUGETLB
-+#define MAP_HUGETLB 0x40000
-+#endif
-+
-+// Define MADV_HUGEPAGE here so we can build HotSpot on old systems.
-+#ifndef MADV_HUGEPAGE
-+#define MADV_HUGEPAGE 14
-+#endif
-+
- bool os::commit_memory(char* addr, size_t size, size_t alignment_hint,
-                        bool exec) {
-+  if (UseHugeTLBFS && alignment_hint > (size_t)vm_page_size()) {
-+    int prot = exec ? PROT_READ|PROT_WRITE|PROT_EXEC : PROT_READ|PROT_WRITE;
-+    uintptr_t res =
-+      (uintptr_t) ::mmap(addr, size, prot,
-+                         MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS|MAP_HUGETLB,
-+                         -1, 0);
-+    return res != (uintptr_t) MAP_FAILED;
-+  }
-+
-   return commit_memory(addr, size, exec);
- }
- 
--void os::realign_memory(char *addr, size_t bytes, size_t alignment_hint) { }
-+void os::realign_memory(char *addr, size_t bytes, size_t alignment_hint) {
-+  if (UseHugeTLBFS && alignment_hint > (size_t)vm_page_size()) {
-+    // We don't check the return value: madvise(MADV_HUGEPAGE) may not
-+    // be supported or the memory may already be backed by huge pages.
-+    ::madvise(addr, bytes, MADV_HUGEPAGE);
-+  }
-+}
- 
- void os::free_memory(char *addr, size_t bytes) {
--  ::mmap(addr, bytes, PROT_READ | PROT_WRITE,
--         MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0);
-+  ::madvise(addr, bytes, MADV_DONTNEED);
- }
- 
- void os::numa_make_global(char *addr, size_t bytes) {
-@@ -2870,7 +2894,16 @@
- static size_t _large_page_size = 0;
- 
- bool os::large_page_init() {
--  if (!UseLargePages) return false;
-+  if (!UseLargePages) {
-+    UseHugeTLBFS = false;
-+    UseSHM = false;
-+    return false;
-+  }
-+
-+  if (FLAG_IS_DEFAULT(UseHugeTLBFS) && FLAG_IS_DEFAULT(UseSHM)) {
-+    // Our user has not expressed a preference, so we'll try both.
-+    UseHugeTLBFS = UseSHM = true;
-+  }
- 
-   if (LargePageSizeInBytes) {
-     _large_page_size = LargePageSizeInBytes;
-@@ -2915,6 +2948,9 @@
-     }
-   }
- 
-+  // print a warning if any large page related flag is specified on command line
-+  bool warn_on_failure = !FLAG_IS_DEFAULT(UseHugeTLBFS);
-+
-   const size_t default_page_size = (size_t)Linux::page_size();
-   if (_large_page_size > default_page_size) {
-     _page_sizes[0] = _large_page_size;
-@@ -2922,6 +2958,14 @@
-     _page_sizes[2] = 0;
-   }
- 
-+  UseHugeTLBFS = UseHugeTLBFS &&
-+                 Linux::hugetlbfs_sanity_check(warn_on_failure, _large_page_size);
-+
-+  if (UseHugeTLBFS)
-+    UseSHM = false;
-+
-+  UseLargePages = UseHugeTLBFS || UseSHM;
-+
-   // Large page support is available on 2.6 or newer kernel, some vendors
-   // (e.g. Redhat) have backported it to their 2.4 based distributions.
-   // We optimistically assume the support is available. If later it turns out
-@@ -2936,7 +2980,7 @@
- char* os::reserve_memory_special(size_t bytes, char* req_addr, bool exec) {
-   // "exec" is passed in but not used.  Creating the shared image for
-   // the code cache doesn't have an SHM_X executable permission to check.
--  assert(UseLargePages, "only for large pages");
-+  assert(UseLargePages && UseSHM, "only for SHM large pages");
- 
-   key_t key = IPC_PRIVATE;
-   char *addr;
-@@ -3003,19 +3047,19 @@
-   return _large_page_size;
- }
- 
--// Linux does not support anonymous mmap with large page memory. The only way
--// to reserve large page memory without file backing is through SysV shared
--// memory API. The entire memory region is committed and pinned upfront.
--// Hopefully this will change in the future...
-+// HugeTLBFS allows application to commit large page memory on demand;
-+// with SysV SHM the entire memory region must be allocated as shared
-+// memory.
- bool os::can_commit_large_page_memory() {
--  return false;
-+  return UseHugeTLBFS;
- }
- 
- bool os::can_execute_large_page_memory() {
--  return false;
-+  return UseHugeTLBFS;
- }
- 
- // Reserve memory at an arbitrary address, only if that area is
-+// Reserve memory at an arbitrary address, only if that area is
- // available (and not reserved for something else).
- 
- char* os::attempt_reserve_memory_at(size_t bytes, char* requested_addr) {
-@@ -5009,6 +5053,43 @@
- // JSR166
- // -------------------------------------------------------
- 
-+bool os::Linux::hugetlbfs_sanity_check(bool warn, size_t page_size) {
-+  bool result = false;
-+  void *p = mmap (NULL, page_size, PROT_READ|PROT_WRITE,
-+                  MAP_ANONYMOUS|MAP_PRIVATE|MAP_HUGETLB,
-+                  -1, 0);
-+
-+  if (p != (void *) -1) {
-+    // We don't know if this really is a huge page or not.
-+    FILE *fp = fopen("/proc/self/maps", "r");
-+    if (fp) {
-+      while (!feof(fp)) {
-+        char chars[257];
-+        long x = 0;
-+        if (fgets(chars, sizeof(chars), fp)) {
-+          if (sscanf(chars, "%lx-%*lx", &x) == 1
-+              && x == (long)p) {
-+            if (strstr (chars, "hugepage")) {
-+              result = true;
-+              break;
-+            }
-+          }
-+        }
-+      }
-+      fclose(fp);
-+    }
-+    munmap (p, page_size);
-+    if (result)
-+      return true;
-+  }
-+
-+  if (warn) {
-+    warning("HugeTLBFS is not supported by the operating system.");
-+  }
-+
-+  return result;
-+}
-+
- /*
-  * The solaris and linux implementations of park/unpark are fairly
-  * conservative for now, but can be improved. They currently use a
-diff -u -r openjdk.patched/hotspot/src/os/linux/vm/os_linux.cpp.orig openjdk/hotspot/src/os/linux/vm/os_linux.cpp.orig
---- openjdk.patched/hotspot/src/os/linux/vm/os_linux.cpp.orig	2011-05-03 14:32:53.972649764 +0100
-+++ openjdk/hotspot/src/os/linux/vm/os_linux.cpp.orig	2011-05-04 11:57:15.085470494 +0100
-@@ -117,6 +117,10 @@
- # include <inttypes.h>
- # include <sys/ioctl.h>
- 
-+#if __x86_64__
-+#include <asm/vsyscall.h>
-+#endif
-+
- #define MAX_PATH    (2 * K)
- 
- // for timer info max values which include all bits
-@@ -2491,16 +2495,40 @@
-   return res != (uintptr_t) MAP_FAILED;
- }
- 
-+// Define MAP_HUGETLB here so we can build HotSpot on old systems.
-+#ifndef MAP_HUGETLB
-+#define MAP_HUGETLB 0x40000
-+#endif
-+
-+// Define MADV_HUGEPAGE here so we can build HotSpot on old systems.
-+#ifndef MADV_HUGEPAGE
-+#define MADV_HUGEPAGE 14
-+#endif
-+
- bool os::commit_memory(char* addr, size_t size, size_t alignment_hint,
-                        bool exec) {
-+  if (UseHugeTLBFS && alignment_hint > (size_t)vm_page_size()) {
-+    int prot = exec ? PROT_READ|PROT_WRITE|PROT_EXEC : PROT_READ|PROT_WRITE;
-+    uintptr_t res =
-+      (uintptr_t) ::mmap(addr, size, prot,
-+                         MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS|MAP_HUGETLB,
-+                         -1, 0);
-+    return res != (uintptr_t) MAP_FAILED;
-+  }
-+
-   return commit_memory(addr, size, exec);
- }
- 
--void os::realign_memory(char *addr, size_t bytes, size_t alignment_hint) { }
-+void os::realign_memory(char *addr, size_t bytes, size_t alignment_hint) {
-+  if (UseHugeTLBFS && alignment_hint > (size_t)vm_page_size()) {
-+    // We don't check the return value: madvise(MADV_HUGEPAGE) may not
-+    // be supported or the memory may already be backed by huge pages.
-+    ::madvise(addr, bytes, MADV_HUGEPAGE);
-+  }
-+}
- 
- void os::free_memory(char *addr, size_t bytes) {
--  ::mmap(addr, bytes, PROT_READ | PROT_WRITE,
--         MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0);
-+  ::madvise(addr, bytes, MADV_DONTNEED);
- }
- 
- void os::numa_make_global(char *addr, size_t bytes) {
-@@ -2544,6 +2572,21 @@
-   return end;
- }
- 
-+static int sched_getcpu_syscall(void) {
-+  unsigned int cpu;
-+  int retval = -1;
-+
-+#if __x86_64__
-+  typedef long (*vgetcpu_t)(unsigned int *cpu, unsigned int *node, unsigned long *tcache);
-+  vgetcpu_t vgetcpu = (vgetcpu_t)VSYSCALL_ADDR(__NR_vgetcpu);
-+  retval = vgetcpu(&cpu, NULL, NULL);
-+#elif __i386__
-+  retval = syscall(SYS_getcpu, &cpu, NULL, NULL);
-+#endif
-+
-+  return (retval == -1) ? retval : cpu;
-+}
-+
- extern "C" void numa_warn(int number, char *where, ...) { }
- extern "C" void numa_error(char *where) { }
- 
-@@ -2565,6 +2608,10 @@
-   set_sched_getcpu(CAST_TO_FN_PTR(sched_getcpu_func_t,
-                                   dlsym(RTLD_DEFAULT, "sched_getcpu")));
- 
-+  // If it's not, try a direct syscall.
-+  if (sched_getcpu() == -1)
-+    set_sched_getcpu(CAST_TO_FN_PTR(sched_getcpu_func_t, (void*)&sched_getcpu_syscall));
-+
-   if (sched_getcpu() != -1) { // Does it work?
-     void *handle = dlopen("libnuma.so.1", RTLD_LAZY);
-     if (handle != NULL) {
-@@ -2847,7 +2894,16 @@
- static size_t _large_page_size = 0;
- 
- bool os::large_page_init() {
--  if (!UseLargePages) return false;
-+  if (!UseLargePages) {
-+    UseHugeTLBFS = false;
-+    UseSHM = false;
-+    return false;
-+  }
-+
-+  if (FLAG_IS_DEFAULT(UseHugeTLBFS) && FLAG_IS_DEFAULT(UseSHM)) {
-+    // Our user has not expressed a preference, so we'll try both.
-+    UseHugeTLBFS = UseSHM = true;
-+  }
- 
-   if (LargePageSizeInBytes) {
-     _large_page_size = LargePageSizeInBytes;
-@@ -2892,6 +2948,9 @@
-     }
-   }
- 
-+  // print a warning if any large page related flag is specified on command line
-+  bool warn_on_failure = !FLAG_IS_DEFAULT(UseHugeTLBFS);
-+
-   const size_t default_page_size = (size_t)Linux::page_size();
-   if (_large_page_size > default_page_size) {
-     _page_sizes[0] = _large_page_size;
-@@ -2899,6 +2958,14 @@
-     _page_sizes[2] = 0;
-   }
- 
-+  UseHugeTLBFS = UseHugeTLBFS &&
-+                 Linux::hugetlbfs_sanity_check(warn_on_failure, _large_page_size);
-+
-+  if (UseHugeTLBFS)
-+    UseSHM = false;
-+
-+  UseLargePages = UseHugeTLBFS || UseSHM;
-+
-   // Large page support is available on 2.6 or newer kernel, some vendors
-   // (e.g. Redhat) have backported it to their 2.4 based distributions.
-   // We optimistically assume the support is available. If later it turns out
-@@ -2913,7 +2980,7 @@
- char* os::reserve_memory_special(size_t bytes, char* req_addr, bool exec) {
-   // "exec" is passed in but not used.  Creating the shared image for
-   // the code cache doesn't have an SHM_X executable permission to check.
--  assert(UseLargePages, "only for large pages");
-+  assert(UseLargePages && UseSHM, "only for SHM large pages");
- 
-   key_t key = IPC_PRIVATE;
-   char *addr;
-@@ -2980,19 +3047,19 @@
-   return _large_page_size;
- }
- 
--// Linux does not support anonymous mmap with large page memory. The only way
--// to reserve large page memory without file backing is through SysV shared
--// memory API. The entire memory region is committed and pinned upfront.
--// Hopefully this will change in the future...
-+// HugeTLBFS allows application to commit large page memory on demand;
-+// with SysV SHM the entire memory region must be allocated as shared
-+// memory.
- bool os::can_commit_large_page_memory() {
--  return false;
-+  return UseHugeTLBFS;
- }
- 
- bool os::can_execute_large_page_memory() {
--  return false;
-+  return UseHugeTLBFS;
- }
- 
- // Reserve memory at an arbitrary address, only if that area is
-+// Reserve memory at an arbitrary address, only if that area is
- // available (and not reserved for something else).
- 
- char* os::attempt_reserve_memory_at(size_t bytes, char* requested_addr) {
-@@ -4081,6 +4148,23 @@
-         UseNUMA = false;
-       }
-     }
-+    // With SHM large pages we cannot uncommit a page, so there's not way
-+    // we can make the adaptive lgrp chunk resizing work. If the user specified
-+    // both UseNUMA and UseLargePages (or UseSHM) on the command line - warn and
-+    // disable adaptive resizing.
-+    if (UseNUMA && UseLargePages && UseSHM) {
-+      if (!FLAG_IS_DEFAULT(UseNUMA)) {
-+        if (FLAG_IS_DEFAULT(UseLargePages) && FLAG_IS_DEFAULT(UseSHM)) {
-+          UseLargePages = false;
-+        } else {
-+          warning("UseNUMA is not fully compatible with SHM large pages, disabling adaptive resizing");
-+          UseAdaptiveSizePolicy = false;
-+          UseAdaptiveNUMAChunkSizing = false;
-+        }
-+      } else {
-+        UseNUMA = false;
-+      }
-+    }
-     if (!UseNUMA && ForceNUMA) {
-       UseNUMA = true;
-     }
-@@ -4986,6 +5070,43 @@
- // JSR166
- // -------------------------------------------------------
- 
-+bool os::Linux::hugetlbfs_sanity_check(bool warn, size_t page_size) {
-+  bool result = false;
-+  void *p = mmap (NULL, page_size, PROT_READ|PROT_WRITE,
-+                  MAP_ANONYMOUS|MAP_PRIVATE|MAP_HUGETLB,
-+                  -1, 0);
-+
-+  if (p != (void *) -1) {
-+    // We don't know if this really is a huge page or not.
-+    FILE *fp = fopen("/proc/self/maps", "r");
-+    if (fp) {
-+      while (!feof(fp)) {
-+        char chars[257];
-+        long x = 0;
-+        if (fgets(chars, sizeof(chars), fp)) {
-+          if (sscanf(chars, "%lx-%*lx", &x) == 1
-+              && x == (long)p) {
-+            if (strstr (chars, "hugepage")) {
-+              result = true;
-+              break;
-+            }
-+          }
-+<+        }
-+      }
-+      fclose(fp);
-+    }
-+    munmap (p, page_size);
-+    if (result)
-+      return true;
-+  }
-+
-+  if (warn) {
-+    warning("HugeTLBFS is not supported by the operating system.");
-+  }
-+
-+  return result;
-+}
-+
- /*
-  * The solaris and linux implementations of park/unpark are fairly
-  * conservative for now, but can be improved. They currently use a
-diff -u -r openjdk.patched/hotspot/src/os/linux/vm/os_linux.hpp openjdk/hotspot/src/os/linux/vm/os_linux.hpp
---- openjdk.patched/hotspot/src/os/linux/vm/os_linux.hpp	2011-03-16 02:30:16.000000000 +0000
-+++ openjdk/hotspot/src/os/linux/vm/os_linux.hpp	2011-05-04 11:57:15.088471194 +0100
-@@ -86,6 +86,9 @@
- 
-   static void rebuild_cpu_to_node_map();
-   static GrowableArray<int>* cpu_to_node()    { return _cpu_to_node; }
-+
-+  static bool hugetlbfs_sanity_check(bool warn, size_t page_size);
-+
-  public:
-   static void init_thread_fpu_state();
-   static int  get_fpu_control_word();
--- a/patches/openjdk/7102369-7094468-rmiregistry.patch	Thu May 31 12:40:08 2012 +0200
+++ b/patches/openjdk/7102369-7094468-rmiregistry.patch	Fri Jun 08 14:23:28 2012 +0100
@@ -1,15 +1,6 @@
-# HG changeset patch
-# User coffeys
-# Date 1321449297 0
-# Node ID 6b46f3c7c97cb060f88b196171b95d33bff80b7c
-# Parent  020dcd6d69ac9406809aabe8888a0b8d52912e7f
-7102369: remove java.rmi.server.codebase property parsing from registyimpl
-7094468: rmiregistry clean up
-Reviewed-by: smarks
-
-diff -r 020dcd6d69ac -r 6b46f3c7c97c src/share/classes/sun/rmi/registry/RegistryImpl.java
---- openjdk/jdk/src/share/classes/sun/rmi/registry/RegistryImpl.java	Tue Nov 15 16:44:14 2011 -0800
-+++ openjdk/jdk/src/share/classes/sun/rmi/registry/RegistryImpl.java	Wed Nov 16 13:14:57 2011 +0000
+diff -Nru openjdk.orig/jdk/src/share/classes/sun/rmi/registry/RegistryImpl.java openjdk/jdk/src/share/classes/sun/rmi/registry/RegistryImpl.java
+--- openjdk.orig/jdk/src/share/classes/sun/rmi/registry/RegistryImpl.java	2012-06-08 12:16:36.773125012 +0100
++++ openjdk/jdk/src/share/classes/sun/rmi/registry/RegistryImpl.java	2012-06-08 12:17:21.653851103 +0100
 @@ -29,6 +29,7 @@
  import java.util.Hashtable;
  import java.util.MissingResourceException;
@@ -149,9 +140,9 @@
          // begin with permissions granted to all code in current policy
          PermissionCollection perms = AccessController.doPrivileged(
              new java.security.PrivilegedAction<PermissionCollection>() {
-@@ -419,17 +407,15 @@
- 
-         perms.add(new RuntimePermission("accessClassInPackage.sun.*"));
+@@ -417,17 +405,15 @@
+          */
+         perms.add(new SocketPermission("*", "connect,accept"));
  
 -        // add permissions required to load from codebase URL path
 -        LoaderHandler.addPermissionsForURLs(urls, perms, false);
@@ -170,9 +161,9 @@
          return new AccessControlContext(new ProtectionDomain[] { pd });
      }
  }
-diff -r 020dcd6d69ac -r 6b46f3c7c97c src/share/classes/sun/rmi/server/LoaderHandler.java
---- openjdk/jdk/src/share/classes/sun/rmi/server/LoaderHandler.java	Tue Nov 15 16:44:14 2011 -0800
-+++ openjdk/jdk/src/share/classes/sun/rmi/server/LoaderHandler.java	Wed Nov 16 13:14:57 2011 +0000
+diff -Nru openjdk.orig/jdk/src/share/classes/sun/rmi/server/LoaderHandler.java openjdk/jdk/src/share/classes/sun/rmi/server/LoaderHandler.java
+--- openjdk.orig/jdk/src/share/classes/sun/rmi/server/LoaderHandler.java	2012-06-08 12:16:36.773125012 +0100
++++ openjdk/jdk/src/share/classes/sun/rmi/server/LoaderHandler.java	2012-06-08 12:17:21.653851103 +0100
 @@ -1028,7 +1028,7 @@
       * loader.  A given permission is only added to the collection if
       * it is not already implied by the collection.
@@ -182,9 +173,9 @@
                                                PermissionCollection perms,
                                                boolean forLoader)
      {
-diff -r 020dcd6d69ac -r 6b46f3c7c97c test/java/rmi/registry/readTest/readTest.java
---- /dev/null	Thu Jan 01 00:00:00 1970 +0000
-+++ openjdk/jdk/test/java/rmi/registry/readTest/readTest.java	Wed Nov 16 13:14:57 2011 +0000
+diff -Nru openjdk.orig/jdk/test/java/rmi/registry/readTest/readTest.java openjdk/jdk/test/java/rmi/registry/readTest/readTest.java
+--- openjdk.orig/jdk/test/java/rmi/registry/readTest/readTest.java	1970-01-01 01:00:00.000000000 +0100
++++ openjdk/jdk/test/java/rmi/registry/readTest/readTest.java	2012-06-08 12:17:21.673851428 +0100
 @@ -0,0 +1,59 @@
 +/*
 + * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
@@ -245,9 +236,9 @@
 +      
 +    }
 +}
-diff -r 020dcd6d69ac -r 6b46f3c7c97c test/java/rmi/registry/readTest/readTest.sh
---- /dev/null	Thu Jan 01 00:00:00 1970 +0000
-+++ openjdk/jdk/test/java/rmi/registry/readTest/readTest.sh	Wed Nov 16 13:14:57 2011 +0000
+diff -Nru openjdk.orig/jdk/test/java/rmi/registry/readTest/readTest.sh openjdk/jdk/test/java/rmi/registry/readTest/readTest.sh
+--- openjdk.orig/jdk/test/java/rmi/registry/readTest/readTest.sh	1970-01-01 01:00:00.000000000 +0100
++++ openjdk/jdk/test/java/rmi/registry/readTest/readTest.sh	2012-06-08 12:17:21.673851428 +0100
 @@ -0,0 +1,95 @@
 +#
 +# Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
@@ -344,9 +335,9 @@
 +exit ${exitCode}    
 +
 +
-diff -r 020dcd6d69ac -r 6b46f3c7c97c test/java/rmi/registry/readTest/testPkg/Client.java
---- /dev/null	Thu Jan 01 00:00:00 1970 +0000
-+++ openjdk/jdk/test/java/rmi/registry/readTest/testPkg/Client.java	Wed Nov 16 13:14:57 2011 +0000
+diff -Nru openjdk.orig/jdk/test/java/rmi/registry/readTest/testPkg/Client.java openjdk/jdk/test/java/rmi/registry/readTest/testPkg/Client.java
+--- openjdk.orig/jdk/test/java/rmi/registry/readTest/testPkg/Client.java	1970-01-01 01:00:00.000000000 +0100
++++ openjdk/jdk/test/java/rmi/registry/readTest/testPkg/Client.java	2012-06-08 12:17:21.673851428 +0100
 @@ -0,0 +1,48 @@
 +/*
 + * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
@@ -396,9 +387,9 @@
 +        }
 +    }
 +
-diff -r 020dcd6d69ac -r 6b46f3c7c97c test/java/rmi/registry/readTest/testPkg/Hello.java
---- /dev/null	Thu Jan 01 00:00:00 1970 +0000
-+++ openjdk/jdk/test/java/rmi/registry/readTest/testPkg/Hello.java	Wed Nov 16 13:14:57 2011 +0000
+diff -Nru openjdk.orig/jdk/test/java/rmi/registry/readTest/testPkg/Hello.java openjdk/jdk/test/java/rmi/registry/readTest/testPkg/Hello.java
+--- openjdk.orig/jdk/test/java/rmi/registry/readTest/testPkg/Hello.java	1970-01-01 01:00:00.000000000 +0100
++++ openjdk/jdk/test/java/rmi/registry/readTest/testPkg/Hello.java	2012-06-08 12:17:21.673851428 +0100
 @@ -0,0 +1,31 @@
 +/*
 + * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
@@ -431,9 +422,9 @@
 +public interface Hello extends Remote {
 +    String sayHello() throws RemoteException;
 +}
-diff -r 020dcd6d69ac -r 6b46f3c7c97c test/java/rmi/registry/readTest/testPkg/Server.java
---- /dev/null	Thu Jan 01 00:00:00 1970 +0000
-+++ openjdk/jdk/test/java/rmi/registry/readTest/testPkg/Server.java	Wed Nov 16 13:14:57 2011 +0000
+diff -Nru openjdk.orig/jdk/test/java/rmi/registry/readTest/testPkg/Server.java openjdk/jdk/test/java/rmi/registry/readTest/testPkg/Server.java
+--- openjdk.orig/jdk/test/java/rmi/registry/readTest/testPkg/Server.java	1970-01-01 01:00:00.000000000 +0100
++++ openjdk/jdk/test/java/rmi/registry/readTest/testPkg/Server.java	2012-06-08 12:17:21.673851428 +0100
 @@ -0,0 +1,36 @@
 +/*
 + * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
--- a/patches/openjdk/7103224-glibc_name_collision.patch	Thu May 31 12:40:08 2012 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,236 +0,0 @@
-# HG changeset patch
-# User never
-# Date 1319555835 25200
-# Node ID a6eef545f1a2ceca6aeadf688a965df600ffef28
-# Parent  2ec638646e86e455978c31a9d47fc0ec271ed926
-7103224: collision between __LEAF define in interfaceSupport.hpp and /usr/include/sys/cdefs.h with gcc
-Reviewed-by: never
-Contributed-by: Omair Majid <omajid@redhat.com>
-
-diff -r 2ec638646e86 -r a6eef545f1a2 src/share/vm/opto/addnode.cpp
---- openjdk/hotspot/src/share/vm/opto/addnode.cpp	Tue Oct 25 04:07:20 2011 -0700
-+++ openjdk/hotspot/src/share/vm/opto/addnode.cpp	Tue Oct 25 08:17:15 2011 -0700
-@@ -34,8 +34,6 @@
- 
- // Portions of code courtesy of Clifford Click
- 
--#define MAXFLOAT        ((float)3.40282346638528860e+38)
--
- // Classic Add functionality.  This covers all the usual 'add' behaviors for
- // an algebraic ring.  Add-integer, add-float, add-double, and binary-or are
- // all inherited from this class.  The various identity values are supplied
-diff -r 2ec638646e86 -r a6eef545f1a2 src/share/vm/prims/jniCheck.cpp
---- openjdk/hotspot/src/share/vm/prims/jniCheck.cpp	Tue Oct 25 04:07:20 2011 -0700
-+++ openjdk/hotspot/src/share/vm/prims/jniCheck.cpp	Tue Oct 25 08:17:15 2011 -0700
-@@ -107,7 +107,7 @@
-     if (env != xenv) {                                                   \
-       NativeReportJNIFatalError(thr, warn_wrong_jnienv);                 \
-     }                                                                    \
--    __ENTRY(result_type, header, thr)
-+    VM_ENTRY_BASE(result_type, header, thr)
- 
- 
- #define UNCHECKED() (unchecked_jni_NativeInterface)
-diff -r 2ec638646e86 -r a6eef545f1a2 src/share/vm/prims/jvmtiEnter.xsl
---- openjdk/hotspot/src/share/vm/prims/jvmtiEnter.xsl	Tue Oct 25 04:07:20 2011 -0700
-+++ openjdk/hotspot/src/share/vm/prims/jvmtiEnter.xsl	Tue Oct 25 08:17:15 2011 -0700
-@@ -426,7 +426,7 @@
-     <xsl:value-of select="$space"/>
-     <xsl:text>ThreadInVMfromNative __tiv(current_thread);</xsl:text>
-     <xsl:value-of select="$space"/>
--    <xsl:text>__ENTRY(jvmtiError, </xsl:text>
-+    <xsl:text>VM_ENTRY_BASE(jvmtiError, </xsl:text>
-     <xsl:apply-templates select="." mode="functionid"/>
-     <xsl:text> , current_thread)</xsl:text>
-     <xsl:value-of select="$space"/>
-diff -r 2ec638646e86 -r a6eef545f1a2 src/share/vm/prims/jvmtiEnv.cpp
---- openjdk/hotspot/src/share/vm/prims/jvmtiEnv.cpp	Tue Oct 25 04:07:20 2011 -0700
-+++ openjdk/hotspot/src/share/vm/prims/jvmtiEnv.cpp	Tue Oct 25 08:17:15 2011 -0700
-@@ -173,7 +173,7 @@
-     // from native so as to resolve the jthread.
- 
-     ThreadInVMfromNative __tiv(current_thread);
--    __ENTRY(jvmtiError, JvmtiEnv::GetThreadLocalStorage , current_thread)
-+    VM_ENTRY_BASE(jvmtiError, JvmtiEnv::GetThreadLocalStorage , current_thread)
-     debug_only(VMNativeEntryWrapper __vew;)
- 
-     oop thread_oop = JNIHandles::resolve_external_guard(thread);
-diff -r 2ec638646e86 -r a6eef545f1a2 src/share/vm/prims/jvmtiExport.cpp
---- openjdk/hotspot/src/share/vm/prims/jvmtiExport.cpp	Tue Oct 25 04:07:20 2011 -0700
-+++ openjdk/hotspot/src/share/vm/prims/jvmtiExport.cpp	Tue Oct 25 08:17:15 2011 -0700
-@@ -373,7 +373,7 @@
-     JavaThread* current_thread = (JavaThread*) ThreadLocalStorage::thread();
-     // transition code: native to VM
-     ThreadInVMfromNative __tiv(current_thread);
--    __ENTRY(jvmtiEnv*, JvmtiExport::get_jvmti_interface, current_thread)
-+    VM_ENTRY_BASE(jvmtiEnv*, JvmtiExport::get_jvmti_interface, current_thread)
-     debug_only(VMNativeEntryWrapper __vew;)
- 
-     JvmtiEnv *jvmti_env = JvmtiEnv::create_a_jvmti(version);
-diff -r 2ec638646e86 -r a6eef545f1a2 src/share/vm/runtime/interfaceSupport.hpp
---- openjdk/hotspot/src/share/vm/runtime/interfaceSupport.hpp	Tue Oct 25 04:07:20 2011 -0700
-+++ openjdk/hotspot/src/share/vm/runtime/interfaceSupport.hpp	Tue Oct 25 08:17:15 2011 -0700
-@@ -72,9 +72,9 @@
-   }
- };
- 
--// InterfaceSupport provides functionality used by the __LEAF and __ENTRY
--// macros. These macros are used to guard entry points into the VM and
--// perform checks upon leave of the VM.
-+// InterfaceSupport provides functionality used by the VM_LEAF_BASE and
-+// VM_ENTRY_BASE macros. These macros are used to guard entry points into
-+// the VM and perform checks upon leave of the VM.
- 
- 
- class InterfaceSupport: AllStatic {
-@@ -433,7 +433,7 @@
- 
- // LEAF routines do not lock, GC or throw exceptions
- 
--#define __LEAF(result_type, header)                                  \
-+#define VM_LEAF_BASE(result_type, header)                            \
-   TRACE_CALL(result_type, header)                                    \
-   debug_only(NoHandleMark __hm;)                                     \
-   /* begin of body */
-@@ -441,7 +441,7 @@
- 
- // ENTRY routines may lock, GC and throw exceptions
- 
--#define __ENTRY(result_type, header, thread)                         \
-+#define VM_ENTRY_BASE(result_type, header, thread)                   \
-   TRACE_CALL(result_type, header)                                    \
-   HandleMarkCleaner __hm(thread);                                    \
-   Thread* THREAD = thread;                                           \
-@@ -450,7 +450,7 @@
- 
- // QUICK_ENTRY routines behave like ENTRY but without a handle mark
- 
--#define __QUICK_ENTRY(result_type, header, thread)                   \
-+#define VM_QUICK_ENTRY_BASE(result_type, header, thread)             \
-   TRACE_CALL(result_type, header)                                    \
-   debug_only(NoHandleMark __hm;)                                     \
-   Thread* THREAD = thread;                                           \
-@@ -463,20 +463,20 @@
- #define IRT_ENTRY(result_type, header)                               \
-   result_type header {                                               \
-     ThreadInVMfromJava __tiv(thread);                                \
--    __ENTRY(result_type, header, thread)                             \
-+    VM_ENTRY_BASE(result_type, header, thread)                       \
-     debug_only(VMEntryWrapper __vew;)
- 
- 
- #define IRT_LEAF(result_type, header)                                \
-   result_type header {                                               \
--    __LEAF(result_type, header)                                      \
-+    VM_LEAF_BASE(result_type, header)                                \
-     debug_only(No_Safepoint_Verifier __nspv(true);)
- 
- 
- #define IRT_ENTRY_NO_ASYNC(result_type, header)                      \
-   result_type header {                                               \
-     ThreadInVMfromJavaNoAsyncException __tiv(thread);                \
--    __ENTRY(result_type, header, thread)                             \
-+    VM_ENTRY_BASE(result_type, header, thread)                       \
-     debug_only(VMEntryWrapper __vew;)
- 
- // Another special case for nmethod_entry_point so the nmethod that the
-@@ -487,7 +487,7 @@
-   result_type header {                                               \
-     nmethodLocker _nmlock(nm);                                       \
-     ThreadInVMfromJavaNoAsyncException __tiv(thread);                                \
--    __ENTRY(result_type, header, thread)
-+    VM_ENTRY_BASE(result_type, header, thread)
- 
- #define IRT_END }
- 
-@@ -497,20 +497,20 @@
- #define JRT_ENTRY(result_type, header)                               \
-   result_type header {                                               \
-     ThreadInVMfromJava __tiv(thread);                                \
--    __ENTRY(result_type, header, thread)                             \
-+    VM_ENTRY_BASE(result_type, header, thread)                       \
-     debug_only(VMEntryWrapper __vew;)
- 
- 
- #define JRT_LEAF(result_type, header)                                \
-   result_type header {                                               \
--  __LEAF(result_type, header)                                        \
-+  VM_LEAF_BASE(result_type, header)                                  \
-   debug_only(JRT_Leaf_Verifier __jlv;)
- 
- 
- #define JRT_ENTRY_NO_ASYNC(result_type, header)                      \
-   result_type header {                                               \
-     ThreadInVMfromJavaNoAsyncException __tiv(thread);                \
--    __ENTRY(result_type, header, thread)                             \
-+    VM_ENTRY_BASE(result_type, header, thread)                       \
-     debug_only(VMEntryWrapper __vew;)
- 
- // Same as JRT Entry but allows for return value after the safepoint
-@@ -543,11 +543,11 @@
-     assert( !VerifyJNIEnvThread || (thread == Thread::current()), "JNIEnv is only valid in same thread"); \
-     ThreadInVMfromNative __tiv(thread);                              \
-     debug_only(VMNativeEntryWrapper __vew;)                          \
--    __ENTRY(result_type, header, thread)
-+    VM_ENTRY_BASE(result_type, header, thread)
- 
- 
- // Ensure that the VMNativeEntryWrapper constructor, which can cause
--// a GC, is called outside the NoHandleMark (set via __QUICK_ENTRY).
-+// a GC, is called outside the NoHandleMark (set via VM_QUICK_ENTRY_BASE).
- #define JNI_QUICK_ENTRY(result_type, header)                         \
- extern "C" {                                                         \
-   result_type JNICALL header {                                \
-@@ -555,7 +555,7 @@
-     assert( !VerifyJNIEnvThread || (thread == Thread::current()), "JNIEnv is only valid in same thread"); \
-     ThreadInVMfromNative __tiv(thread);                              \
-     debug_only(VMNativeEntryWrapper __vew;)                          \
--    __QUICK_ENTRY(result_type, header, thread)
-+    VM_QUICK_ENTRY_BASE(result_type, header, thread)
- 
- 
- #define JNI_LEAF(result_type, header)                                \
-@@ -563,7 +563,7 @@
-   result_type JNICALL header {                                \
-     JavaThread* thread=JavaThread::thread_from_jni_environment(env); \
-     assert( !VerifyJNIEnvThread || (thread == Thread::current()), "JNIEnv is only valid in same thread"); \
--    __LEAF(result_type, header)
-+    VM_LEAF_BASE(result_type, header)
- 
- 
- // Close the routine and the extern "C"
-@@ -579,7 +579,7 @@
-     JavaThread* thread=JavaThread::thread_from_jni_environment(env); \
-     ThreadInVMfromNative __tiv(thread);                              \
-     debug_only(VMNativeEntryWrapper __vew;)                          \
--    __ENTRY(result_type, header, thread)
-+    VM_ENTRY_BASE(result_type, header, thread)
- 
- 
- #define JVM_ENTRY_NO_ENV(result_type, header)                        \
-@@ -588,7 +588,7 @@
-     JavaThread* thread = (JavaThread*)ThreadLocalStorage::thread();  \
-     ThreadInVMfromNative __tiv(thread);                              \
-     debug_only(VMNativeEntryWrapper __vew;)                          \
--    __ENTRY(result_type, header, thread)
-+    VM_ENTRY_BASE(result_type, header, thread)
- 
- 
- #define JVM_QUICK_ENTRY(result_type, header)                         \
-@@ -597,14 +597,14 @@
-     JavaThread* thread=JavaThread::thread_from_jni_environment(env); \
-     ThreadInVMfromNative __tiv(thread);                              \
-     debug_only(VMNativeEntryWrapper __vew;)                          \
--    __QUICK_ENTRY(result_type, header, thread)
-+    VM_QUICK_ENTRY_BASE(result_type, header, thread)
- 
- 
- #define JVM_LEAF(result_type, header)                                \
- extern "C" {                                                         \
-   result_type JNICALL header {                                       \
-     VM_Exit::block_if_vm_exited();                                   \
--    __LEAF(result_type, header)
-+    VM_LEAF_BASE(result_type, header)
- 
- 
- #define JVM_END } }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/openjdk/hs20/7034464-hugepage.patch	Fri Jun 08 14:23:28 2012 +0100
@@ -0,0 +1,221 @@
+# HG changeset patch
+# User iveresov
+# Date 1303344724 25200
+# Node ID 139667d9836ae218ab06a74d5813a5a700a076c9
+# Parent  49a67202bc671d23d719c9e14752d80295a9e8f6
+7034464: Support transparent large pages on Linux
+Summary: Support transparent huge pages on Linux available since 2.6.38
+Reviewed-by: iveresov, ysr
+Contributed-by: aph@redhat.com
+diff -u -r openjdk.patched/hotspot/src/os/linux/vm/globals_linux.hpp openjdk/hotspot/src/os/linux/vm/globals_linux.hpp
+--- openjdk.patched/hotspot/src/os/linux/vm/globals_linux.hpp	2011-03-16 02:30:16.000000000 +0000
++++ openjdk/hotspot/src/os/linux/vm/globals_linux.hpp	2011-05-04 11:57:15.083470027 +0100
+@@ -29,13 +29,19 @@
+ // Defines Linux specific flags. They are not available on other platforms.
+ //
+ #define RUNTIME_OS_FLAGS(develop, develop_pd, product, product_pd, diagnostic, notproduct) \
+-  product(bool, UseOprofile, false,                                 \
+-        "enable support for Oprofile profiler")                     \
+-                                                                    \
+-  product(bool, UseLinuxPosixThreadCPUClocks, true,                 \
+-          "enable fast Linux Posix clocks where available")
+-// NB: The default value of UseLinuxPosixThreadCPUClocks may be
+-// overridden in Arguments::parse_each_vm_init_arg.
++  product(bool, UseOprofile, false,                                     \
++        "enable support for Oprofile profiler")                         \
++                                                                        \
++  product(bool, UseLinuxPosixThreadCPUClocks, true,                     \
++          "enable fast Linux Posix clocks where available")             \
++/*  NB: The default value of UseLinuxPosixThreadCPUClocks may be        \
++    overridden in Arguments::parse_each_vm_init_arg.  */                \
++                                                                        \
++  product(bool, UseHugeTLBFS, false,                                    \
++          "Use MAP_HUGETLB for large pages")                            \
++                                                                        \
++  product(bool, UseSHM, false,                                          \
++          "Use SYSV shared memory for large pages")
+ 
+ //
+ // Defines Linux-specific default values. The flags are available on all
+diff -u -r openjdk.patched/hotspot/src/os/linux/vm/os_linux.cpp openjdk/hotspot/src/os/linux/vm/os_linux.cpp
+--- openjdk.patched/hotspot/src/os/linux/vm/os_linux.cpp	2011-05-03 14:32:54.285722656 +0100
++++ openjdk/hotspot/src/os/linux/vm/os_linux.cpp	2011-05-09 14:31:51.358502774 +0100
+@@ -2495,16 +2495,40 @@
+   return res != (uintptr_t) MAP_FAILED;
+ }
+ 
++// Define MAP_HUGETLB here so we can build HotSpot on old systems.
++#ifndef MAP_HUGETLB
++#define MAP_HUGETLB 0x40000
++#endif
++
++// Define MADV_HUGEPAGE here so we can build HotSpot on old systems.
++#ifndef MADV_HUGEPAGE
++#define MADV_HUGEPAGE 14
++#endif
++
+ bool os::commit_memory(char* addr, size_t size, size_t alignment_hint,
+                        bool exec) {
++  if (UseHugeTLBFS && alignment_hint > (size_t)vm_page_size()) {
++    int prot = exec ? PROT_READ|PROT_WRITE|PROT_EXEC : PROT_READ|PROT_WRITE;
++    uintptr_t res =
++      (uintptr_t) ::mmap(addr, size, prot,
++                         MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS|MAP_HUGETLB,
++                         -1, 0);
++    return res != (uintptr_t) MAP_FAILED;
++  }
++
+   return commit_memory(addr, size, exec);
+ }
+ 
+-void os::realign_memory(char *addr, size_t bytes, size_t alignment_hint) { }
++void os::realign_memory(char *addr, size_t bytes, size_t alignment_hint) {
++  if (UseHugeTLBFS && alignment_hint > (size_t)vm_page_size()) {
++    // We don't check the return value: madvise(MADV_HUGEPAGE) may not
++    // be supported or the memory may already be backed by huge pages.
++    ::madvise(addr, bytes, MADV_HUGEPAGE);
++  }
++}
+ 
+ void os::free_memory(char *addr, size_t bytes) {
+-  ::mmap(addr, bytes, PROT_READ | PROT_WRITE,
+-         MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0);
++  ::madvise(addr, bytes, MADV_DONTNEED);
+ }
+ 
+ void os::numa_make_global(char *addr, size_t bytes) {
+@@ -2870,7 +2894,16 @@
+ static size_t _large_page_size = 0;
+ 
+ bool os::large_page_init() {
+-  if (!UseLargePages) return false;
++  if (!UseLargePages) {
++    UseHugeTLBFS = false;
++    UseSHM = false;
++    return false;
++  }
++
++  if (FLAG_IS_DEFAULT(UseHugeTLBFS) && FLAG_IS_DEFAULT(UseSHM)) {
++    // Our user has not expressed a preference, so we'll try both.
++    UseHugeTLBFS = UseSHM = true;
++  }
+ 
+   if (LargePageSizeInBytes) {
+     _large_page_size = LargePageSizeInBytes;
+@@ -2915,6 +2948,9 @@
+     }
+   }
+ 
++  // print a warning if any large page related flag is specified on command line
++  bool warn_on_failure = !FLAG_IS_DEFAULT(UseHugeTLBFS);
++
+   const size_t default_page_size = (size_t)Linux::page_size();
+   if (_large_page_size > default_page_size) {
+     _page_sizes[0] = _large_page_size;
+@@ -2922,6 +2958,14 @@
+     _page_sizes[2] = 0;
+   }
+ 
++  UseHugeTLBFS = UseHugeTLBFS &&
++                 Linux::hugetlbfs_sanity_check(warn_on_failure, _large_page_size);
++
++  if (UseHugeTLBFS)
++    UseSHM = false;
++
++  UseLargePages = UseHugeTLBFS || UseSHM;
++
+   // Large page support is available on 2.6 or newer kernel, some vendors
+   // (e.g. Redhat) have backported it to their 2.4 based distributions.
+   // We optimistically assume the support is available. If later it turns out
+@@ -2936,7 +2980,7 @@
+ char* os::reserve_memory_special(size_t bytes, char* req_addr, bool exec) {
+   // "exec" is passed in but not used.  Creating the shared image for
+   // the code cache doesn't have an SHM_X executable permission to check.
+-  assert(UseLargePages, "only for large pages");
++  assert(UseLargePages && UseSHM, "only for SHM large pages");
+ 
+   key_t key = IPC_PRIVATE;
+   char *addr;
+@@ -3003,19 +3047,19 @@
+   return _large_page_size;
+ }
+ 
+-// Linux does not support anonymous mmap with large page memory. The only way
+-// to reserve large page memory without file backing is through SysV shared
+-// memory API. The entire memory region is committed and pinned upfront.
+-// Hopefully this will change in the future...
++// HugeTLBFS allows application to commit large page memory on demand;
++// with SysV SHM the entire memory region must be allocated as shared
++// memory.
+ bool os::can_commit_large_page_memory() {
+-  return false;
++  return UseHugeTLBFS;
+ }
+ 
+ bool os::can_execute_large_page_memory() {
+-  return false;
++  return UseHugeTLBFS;
+ }
+ 
+ // Reserve memory at an arbitrary address, only if that area is
++// Reserve memory at an arbitrary address, only if that area is
+ // available (and not reserved for something else).
+ 
+ char* os::attempt_reserve_memory_at(size_t bytes, char* requested_addr) {
+@@ -5009,6 +5053,43 @@
+ // JSR166
+ // -------------------------------------------------------
+ 
++bool os::Linux::hugetlbfs_sanity_check(bool warn, size_t page_size) {
++  bool result = false;
++  void *p = mmap (NULL, page_size, PROT_READ|PROT_WRITE,
++                  MAP_ANONYMOUS|MAP_PRIVATE|MAP_HUGETLB,
++                  -1, 0);
++
++  if (p != (void *) -1) {
++    // We don't know if this really is a huge page or not.
++    FILE *fp = fopen("/proc/self/maps", "r");
++    if (fp) {
++      while (!feof(fp)) {
++        char chars[257];
++        long x = 0;
++        if (fgets(chars, sizeof(chars), fp)) {
++          if (sscanf(chars, "%lx-%*lx", &x) == 1
++              && x == (long)p) {
++            if (strstr (chars, "hugepage")) {
++              result = true;
++              break;
++            }
++          }
++        }
++      }
++      fclose(fp);
++    }
++    munmap (p, page_size);
++    if (result)
++      return true;
++  }
++
++  if (warn) {
++    warning("HugeTLBFS is not supported by the operating system.");
++  }
++
++  return result;
++}
++
+ /*
+  * The solaris and linux implementations of park/unpark are fairly
+  * conservative for now, but can be improved. They currently use a
+diff -u -r openjdk.patched/hotspot/src/os/linux/vm/os_linux.hpp openjdk/hotspot/src/os/linux/vm/os_linux.hpp
+--- openjdk.patched/hotspot/src/os/linux/vm/os_linux.hpp	2011-03-16 02:30:16.000000000 +0000
++++ openjdk/hotspot/src/os/linux/vm/os_linux.hpp	2011-05-04 11:57:15.088471194 +0100
+@@ -86,6 +86,9 @@
+ 
+   static void rebuild_cpu_to_node_map();
+   static GrowableArray<int>* cpu_to_node()    { return _cpu_to_node; }
++
++  static bool hugetlbfs_sanity_check(bool warn, size_t page_size);
++
+  public:
+   static void init_thread_fpu_state();
+   static int  get_fpu_control_word();
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/openjdk/hs20/7103224-glibc_name_collision.patch	Fri Jun 08 14:23:28 2012 +0100
@@ -0,0 +1,236 @@
+# HG changeset patch
+# User never
+# Date 1319555835 25200
+# Node ID a6eef545f1a2ceca6aeadf688a965df600ffef28
+# Parent  2ec638646e86e455978c31a9d47fc0ec271ed926
+7103224: collision between __LEAF define in interfaceSupport.hpp and /usr/include/sys/cdefs.h with gcc
+Reviewed-by: never
+Contributed-by: Omair Majid <omajid@redhat.com>
+
+diff -r 2ec638646e86 -r a6eef545f1a2 src/share/vm/opto/addnode.cpp
+--- openjdk/hotspot/src/share/vm/opto/addnode.cpp	Tue Oct 25 04:07:20 2011 -0700
++++ openjdk/hotspot/src/share/vm/opto/addnode.cpp	Tue Oct 25 08:17:15 2011 -0700
+@@ -34,8 +34,6 @@
+ 
+ // Portions of code courtesy of Clifford Click
+ 
+-#define MAXFLOAT        ((float)3.40282346638528860e+38)
+-
+ // Classic Add functionality.  This covers all the usual 'add' behaviors for
+ // an algebraic ring.  Add-integer, add-float, add-double, and binary-or are
+ // all inherited from this class.  The various identity values are supplied
+diff -r 2ec638646e86 -r a6eef545f1a2 src/share/vm/prims/jniCheck.cpp
+--- openjdk/hotspot/src/share/vm/prims/jniCheck.cpp	Tue Oct 25 04:07:20 2011 -0700
++++ openjdk/hotspot/src/share/vm/prims/jniCheck.cpp	Tue Oct 25 08:17:15 2011 -0700
+@@ -107,7 +107,7 @@
+     if (env != xenv) {                                                   \
+       NativeReportJNIFatalError(thr, warn_wrong_jnienv);                 \
+     }                                                                    \
+-    __ENTRY(result_type, header, thr)
++    VM_ENTRY_BASE(result_type, header, thr)
+ 
+ 
+ #define UNCHECKED() (unchecked_jni_NativeInterface)
+diff -r 2ec638646e86 -r a6eef545f1a2 src/share/vm/prims/jvmtiEnter.xsl
+--- openjdk/hotspot/src/share/vm/prims/jvmtiEnter.xsl	Tue Oct 25 04:07:20 2011 -0700
++++ openjdk/hotspot/src/share/vm/prims/jvmtiEnter.xsl	Tue Oct 25 08:17:15 2011 -0700
+@@ -426,7 +426,7 @@
+     <xsl:value-of select="$space"/>
+     <xsl:text>ThreadInVMfromNative __tiv(current_thread);</xsl:text>
+     <xsl:value-of select="$space"/>
+-    <xsl:text>__ENTRY(jvmtiError, </xsl:text>
++    <xsl:text>VM_ENTRY_BASE(jvmtiError, </xsl:text>
+     <xsl:apply-templates select="." mode="functionid"/>
+     <xsl:text> , current_thread)</xsl:text>
+     <xsl:value-of select="$space"/>
+diff -r 2ec638646e86 -r a6eef545f1a2 src/share/vm/prims/jvmtiEnv.cpp
+--- openjdk/hotspot/src/share/vm/prims/jvmtiEnv.cpp	Tue Oct 25 04:07:20 2011 -0700
++++ openjdk/hotspot/src/share/vm/prims/jvmtiEnv.cpp	Tue Oct 25 08:17:15 2011 -0700
+@@ -173,7 +173,7 @@
+     // from native so as to resolve the jthread.
+ 
+     ThreadInVMfromNative __tiv(current_thread);
+-    __ENTRY(jvmtiError, JvmtiEnv::GetThreadLocalStorage , current_thread)
++    VM_ENTRY_BASE(jvmtiError, JvmtiEnv::GetThreadLocalStorage , current_thread)
+     debug_only(VMNativeEntryWrapper __vew;)
+ 
+     oop thread_oop = JNIHandles::resolve_external_guard(thread);
+diff -r 2ec638646e86 -r a6eef545f1a2 src/share/vm/prims/jvmtiExport.cpp
+--- openjdk/hotspot/src/share/vm/prims/jvmtiExport.cpp	Tue Oct 25 04:07:20 2011 -0700
++++ openjdk/hotspot/src/share/vm/prims/jvmtiExport.cpp	Tue Oct 25 08:17:15 2011 -0700
+@@ -373,7 +373,7 @@
+     JavaThread* current_thread = (JavaThread*) ThreadLocalStorage::thread();
+     // transition code: native to VM
+     ThreadInVMfromNative __tiv(current_thread);
+-    __ENTRY(jvmtiEnv*, JvmtiExport::get_jvmti_interface, current_thread)
++    VM_ENTRY_BASE(jvmtiEnv*, JvmtiExport::get_jvmti_interface, current_thread)
+     debug_only(VMNativeEntryWrapper __vew;)
+ 
+     JvmtiEnv *jvmti_env = JvmtiEnv::create_a_jvmti(version);
+diff -r 2ec638646e86 -r a6eef545f1a2 src/share/vm/runtime/interfaceSupport.hpp
+--- openjdk/hotspot/src/share/vm/runtime/interfaceSupport.hpp	Tue Oct 25 04:07:20 2011 -0700
++++ openjdk/hotspot/src/share/vm/runtime/interfaceSupport.hpp	Tue Oct 25 08:17:15 2011 -0700
+@@ -72,9 +72,9 @@
+   }
+ };
+ 
+-// InterfaceSupport provides functionality used by the __LEAF and __ENTRY
+-// macros. These macros are used to guard entry points into the VM and
+-// perform checks upon leave of the VM.
++// InterfaceSupport provides functionality used by the VM_LEAF_BASE and
++// VM_ENTRY_BASE macros. These macros are used to guard entry points into
++// the VM and perform checks upon leave of the VM.
+ 
+ 
+ class InterfaceSupport: AllStatic {
+@@ -433,7 +433,7 @@
+ 
+ // LEAF routines do not lock, GC or throw exceptions
+ 
+-#define __LEAF(result_type, header)                                  \
++#define VM_LEAF_BASE(result_type, header)                            \
+   TRACE_CALL(result_type, header)                                    \
+   debug_only(NoHandleMark __hm;)                                     \
+   /* begin of body */
+@@ -441,7 +441,7 @@
+ 
+ // ENTRY routines may lock, GC and throw exceptions
+ 
+-#define __ENTRY(result_type, header, thread)                         \
++#define VM_ENTRY_BASE(result_type, header, thread)                   \
+   TRACE_CALL(result_type, header)                                    \
+   HandleMarkCleaner __hm(thread);                                    \
+   Thread* THREAD = thread;                                           \
+@@ -450,7 +450,7 @@
+ 
+ // QUICK_ENTRY routines behave like ENTRY but without a handle mark
+ 
+-#define __QUICK_ENTRY(result_type, header, thread)                   \
++#define VM_QUICK_ENTRY_BASE(result_type, header, thread)             \
+   TRACE_CALL(result_type, header)                                    \
+   debug_only(NoHandleMark __hm;)                                     \
+   Thread* THREAD = thread;                                           \
+@@ -463,20 +463,20 @@
+ #define IRT_ENTRY(result_type, header)                               \
+   result_type header {                                               \
+     ThreadInVMfromJava __tiv(thread);                                \
+-    __ENTRY(result_type, header, thread)                             \
++    VM_ENTRY_BASE(result_type, header, thread)                       \
+     debug_only(VMEntryWrapper __vew;)
+ 
+ 
+ #define IRT_LEAF(result_type, header)                                \
+   result_type header {                                               \
+-    __LEAF(result_type, header)                                      \
++    VM_LEAF_BASE(result_type, header)                                \
+     debug_only(No_Safepoint_Verifier __nspv(true);)
+ 
+ 
+ #define IRT_ENTRY_NO_ASYNC(result_type, header)                      \
+   result_type header {                                               \
+     ThreadInVMfromJavaNoAsyncException __tiv(thread);                \
+-    __ENTRY(result_type, header, thread)                             \
++    VM_ENTRY_BASE(result_type, header, thread)                       \
+     debug_only(VMEntryWrapper __vew;)
+ 
+ // Another special case for nmethod_entry_point so the nmethod that the
+@@ -487,7 +487,7 @@
+   result_type header {                                               \
+     nmethodLocker _nmlock(nm);                                       \
+     ThreadInVMfromJavaNoAsyncException __tiv(thread);                                \
+-    __ENTRY(result_type, header, thread)
++    VM_ENTRY_BASE(result_type, header, thread)
+ 
+ #define IRT_END }
+ 
+@@ -497,20 +497,20 @@
+ #define JRT_ENTRY(result_type, header)                               \
+   result_type header {                                               \
+     ThreadInVMfromJava __tiv(thread);                                \
+-    __ENTRY(result_type, header, thread)                             \
++    VM_ENTRY_BASE(result_type, header, thread)                       \
+     debug_only(VMEntryWrapper __vew;)
+ 
+ 
+ #define JRT_LEAF(result_type, header)                                \
+   result_type header {                                               \
+-  __LEAF(result_type, header)                                        \
++  VM_LEAF_BASE(result_type, header)                                  \
+   debug_only(JRT_Leaf_Verifier __jlv;)
+ 
+ 
+ #define JRT_ENTRY_NO_ASYNC(result_type, header)                      \
+   result_type header {                                               \
+     ThreadInVMfromJavaNoAsyncException __tiv(thread);                \
+-    __ENTRY(result_type, header, thread)                             \
++    VM_ENTRY_BASE(result_type, header, thread)                       \
+     debug_only(VMEntryWrapper __vew;)
+ 
+ // Same as JRT Entry but allows for return value after the safepoint
+@@ -543,11 +543,11 @@
+     assert( !VerifyJNIEnvThread || (thread == Thread::current()), "JNIEnv is only valid in same thread"); \
+     ThreadInVMfromNative __tiv(thread);                              \
+     debug_only(VMNativeEntryWrapper __vew;)                          \
+-    __ENTRY(result_type, header, thread)
++    VM_ENTRY_BASE(result_type, header, thread)
+ 
+ 
+ // Ensure that the VMNativeEntryWrapper constructor, which can cause
+-// a GC, is called outside the NoHandleMark (set via __QUICK_ENTRY).
++// a GC, is called outside the NoHandleMark (set via VM_QUICK_ENTRY_BASE).
+ #define JNI_QUICK_ENTRY(result_type, header)                         \
+ extern "C" {                                                         \
+   result_type JNICALL header {                                \
+@@ -555,7 +555,7 @@
+     assert( !VerifyJNIEnvThread || (thread == Thread::current()), "JNIEnv is only valid in same thread"); \
+     ThreadInVMfromNative __tiv(thread);                              \
+     debug_only(VMNativeEntryWrapper __vew;)                          \
+-    __QUICK_ENTRY(result_type, header, thread)
++    VM_QUICK_ENTRY_BASE(result_type, header, thread)
+ 
+ 
+ #define JNI_LEAF(result_type, header)                                \
+@@ -563,7 +563,7 @@
+   result_type JNICALL header {                                \
+     JavaThread* thread=JavaThread::thread_from_jni_environment(env); \
+     assert( !VerifyJNIEnvThread || (thread == Thread::current()), "JNIEnv is only valid in same thread"); \
+-    __LEAF(result_type, header)
++    VM_LEAF_BASE(result_type, header)
+ 
+ 
+ // Close the routine and the extern "C"
+@@ -579,7 +579,7 @@
+     JavaThread* thread=JavaThread::thread_from_jni_environment(env); \
+     ThreadInVMfromNative __tiv(thread);                              \
+     debug_only(VMNativeEntryWrapper __vew;)                          \
+-    __ENTRY(result_type, header, thread)
++    VM_ENTRY_BASE(result_type, header, thread)
+ 
+ 
+ #define JVM_ENTRY_NO_ENV(result_type, header)                        \
+@@ -588,7 +588,7 @@
+     JavaThread* thread = (JavaThread*)ThreadLocalStorage::thread();  \
+     ThreadInVMfromNative __tiv(thread);                              \
+     debug_only(VMNativeEntryWrapper __vew;)                          \
+-    __ENTRY(result_type, header, thread)
++    VM_ENTRY_BASE(result_type, header, thread)
+ 
+ 
+ #define JVM_QUICK_ENTRY(result_type, header)                         \
+@@ -597,14 +597,14 @@
+     JavaThread* thread=JavaThread::thread_from_jni_environment(env); \
+     ThreadInVMfromNative __tiv(thread);                              \
+     debug_only(VMNativeEntryWrapper __vew;)                          \
+-    __QUICK_ENTRY(result_type, header, thread)
++    VM_QUICK_ENTRY_BASE(result_type, header, thread)
+ 
+ 
+ #define JVM_LEAF(result_type, header)                                \
+ extern "C" {                                                         \
+   result_type JNICALL header {                                       \
+     VM_Exit::block_if_vm_exited();                                   \
+-    __LEAF(result_type, header)
++    VM_LEAF_BASE(result_type, header)
+ 
+ 
+ #define JVM_END } }
--- a/patches/openjdk/mutter.patch	Thu May 31 12:40:08 2012 +0200
+++ b/patches/openjdk/mutter.patch	Fri Jun 08 14:23:28 2012 +0100
@@ -1,14 +1,7 @@
-# HG changeset patch
-# User Denis Lila <dlila@redhat.com>
-# Date 1305642927 14400
-# Node ID 49098163596b4e2972ddad36550e0b9801d3170b
-# Parent  cf7c64f276c60d1bab5b26b87a4e337dadbb4888
-Add mutter as a window manager.
-
-diff -r cf7c64f276c6 -r 49098163596b src/solaris/classes/sun/awt/X11/XDecoratedPeer.java
---- openjdk.orig/jdk/src/solaris/classes/sun/awt/X11/XDecoratedPeer.java	Wed May 11 11:08:03 2011 -0400
-+++ openjdk/jdk/src/solaris/classes/sun/awt/X11/XDecoratedPeer.java	Tue May 17 10:35:27 2011 -0400
-@@ -721,7 +721,7 @@
+diff -Nru openjdk.orig/jdk/src/solaris/classes/sun/awt/X11/XDecoratedPeer.java openjdk/jdk/src/solaris/classes/sun/awt/X11/XDecoratedPeer.java
+--- openjdk.orig/jdk/src/solaris/classes/sun/awt/X11/XDecoratedPeer.java	2012-06-08 12:14:13.358805320 +0100
++++ openjdk/jdk/src/solaris/classes/sun/awt/X11/XDecoratedPeer.java	2012-06-08 12:14:54.643473010 +0100
+@@ -767,7 +767,7 @@
              // Location, Client size + insets
              newLocation = new Point(xe.get_x() - currentInsets.left, xe.get_y() - currentInsets.top);
          } else {
@@ -17,18 +10,18 @@
              // top or left border, we don't receive synthetic
              // ConfigureNotify, only the one from X with zero
              // coordinates.  This is the workaround to get real
-@@ -731,6 +731,7 @@
+@@ -777,6 +777,7 @@
                  case XWM.MOTIF_WM:
                  case XWM.METACITY_WM:
                  case XWM.SAWFISH_WM:
 +                case XWM.MUTTER_WM:
                  {
                      Point xlocation = queryXLocation();
-                     if (log.isLoggable(PlatformLogger.FINE)) log.fine("New X location: {0}", xlocation);
-diff -r cf7c64f276c6 -r 49098163596b src/solaris/classes/sun/awt/X11/XWM.java
---- openjdk.orig/jdk/src/solaris/classes/sun/awt/X11/XWM.java	Wed May 11 11:08:03 2011 -0400
-+++ openjdk/jdk/src/solaris/classes/sun/awt/X11/XWM.java	Tue May 17 10:35:27 2011 -0400
-@@ -101,7 +101,8 @@
+                     if (log.isLoggable(Level.FINE)) {
+diff -Nru openjdk.orig/jdk/src/solaris/classes/sun/awt/X11/XWM.java openjdk/jdk/src/solaris/classes/sun/awt/X11/XWM.java
+--- openjdk.orig/jdk/src/solaris/classes/sun/awt/X11/XWM.java	2012-06-08 12:14:13.382805708 +0100
++++ openjdk/jdk/src/solaris/classes/sun/awt/X11/XWM.java	2012-06-08 12:14:54.643473010 +0100
+@@ -98,7 +98,8 @@
          ICE_WM = 10,
          METACITY_WM = 11,
          COMPIZ_WM = 12,
@@ -38,7 +31,7 @@
      public String toString() {
          switch  (WMID) {
            case NO_WM:
-@@ -128,6 +129,8 @@
+@@ -125,6 +126,8 @@
                return "Compiz";
            case LG3D_WM:
                return "LookingGlass";
@@ -47,7 +40,7 @@
            case UNDETERMINED_WM:
            default:
                return "Undetermined WM";
-@@ -566,6 +569,12 @@
+@@ -569,6 +572,12 @@
  //                            getIntProperty(XToolkit.getDefaultRootWindow(), XAtom.XA_CARDINAL)) == 0);
      }
  
@@ -60,7 +53,7 @@
      static boolean isNonReparentingWM() {
          return (XWM.getWMID() == XWM.COMPIZ_WM || XWM.getWMID() == XWM.LG3D_WM);
      }
-@@ -735,10 +744,12 @@
+@@ -744,10 +753,12 @@
                  awt_wmgr = XWM.ENLIGHTEN_WM;
              } else if (isMetacity()) {
                  awt_wmgr = XWM.METACITY_WM;
@@ -74,7 +67,7 @@
              } else if (isCompiz()) {
                  awt_wmgr = XWM.COMPIZ_WM;
              } else if (isLookingGlass()) {
-@@ -1036,6 +1047,8 @@
+@@ -1043,6 +1054,8 @@
  
      boolean supportsDynamicLayout() {
          int wm = getWMID();
@@ -83,7 +76,7 @@
          switch (wm) {
            case XWM.ENLIGHTEN_WM:
            case XWM.KDE2_WM:
-@@ -1360,6 +1373,7 @@
+@@ -1379,6 +1392,7 @@
                  return insets;
              }
          }
@@ -91,7 +84,7 @@
          switch(getWMID()) {
            case XWM.KDE2_WM:
                return getInsetsFromProp(window, XA_KDE_NET_WM_FRAME_STRUT);
-@@ -1554,6 +1568,9 @@
+@@ -1573,6 +1587,9 @@
                        correctWM.bottom = correctWM.left;
                        break;
                    }
@@ -100,10 +93,51 @@
 +                      // For now the fallback code is good enough.
                    case XWM.OTHER_WM:
                    default: {                /* this is very similar to the E! case above */
-                       insLog.finest("Getting correct insets for OTHER_WM/default, parent: {0}", parent);
-diff -r cf7c64f276c6 -r 49098163596b test/java/awt/WMSpecificTests/Mutter/MutterMaximizeTest.java
---- /dev/null	Thu Jan 01 00:00:00 1970 +0000
-+++ openjdk/jdk/test/java/awt/WMSpecificTests/Mutter/MutterMaximizeTest.java	Tue May 17 10:35:27 2011 -0400
+                       if (insLog.isLoggable(Level.FINEST)) {
+diff -Nru openjdk.orig/jdk/test/java/awt/regtesthelpers/Util.java openjdk/jdk/test/java/awt/regtesthelpers/Util.java
+--- openjdk.orig/jdk/test/java/awt/regtesthelpers/Util.java	2012-06-08 12:14:12.498791412 +0100
++++ openjdk/jdk/test/java/awt/regtesthelpers/Util.java	2012-06-08 12:14:54.643473010 +0100
+@@ -140,6 +140,13 @@
+         robot.mouseMove(bounds.x + bounds.width / 2, bounds.y + bounds.height / 2);
+     }
+ 
++    public static Point getTitlePoint(Window decoratedWindow) {
++        Point p = decoratedWindow.getLocationOnScreen();
++        Dimension d = decoratedWindow.getSize();
++        return new Point(p.x + (int)(d.getWidth()/2),
++                         p.y + (int)decoratedWindow.getInsets().top/2);
++    }
++
+     /**
+      * Moves mouse pointer in the center of a given {@code comp} component
+      * and performs a left mouse button click using the {@code robot} parameter
+@@ -167,11 +174,9 @@
+      * WARNING: it may fail on some platforms when the window is not wide enough.
+      */
+     public static void clickOnTitle(final Window decoratedWindow, final Robot robot) {
+-        Point p = decoratedWindow.getLocationOnScreen();
+-        Dimension d = decoratedWindow.getSize();
+-
+         if (decoratedWindow instanceof Frame || decoratedWindow instanceof Dialog) {
+-            robot.mouseMove(p.x + (int)(d.getWidth()/2), p.y + (int)decoratedWindow.getInsets().top/2);
++            Point p = getTitlePoint(decoratedWindow);
++            robot.mouseMove(p.x, p.y);
+             robot.delay(50);
+             robot.mousePress(InputEvent.BUTTON1_MASK);
+             robot.delay(50);
+@@ -409,7 +414,8 @@
+         ICE_WM = 10,
+         METACITY_WM = 11,
+         COMPIZ_WM = 12,
+-        LG3D_WM = 13;
++        LG3D_WM = 13,
++        MUTTER_WM = 14;
+ 
+     /*
+      * Returns -1 in case of not X Window or any problems.
+diff -Nru openjdk.orig/jdk/test/java/awt/WMSpecificTests/Mutter/MutterMaximizeTest.java openjdk/jdk/test/java/awt/WMSpecificTests/Mutter/MutterMaximizeTest.java
+--- openjdk.orig/jdk/test/java/awt/WMSpecificTests/Mutter/MutterMaximizeTest.java	1970-01-01 01:00:00.000000000 +0100
++++ openjdk/jdk/test/java/awt/WMSpecificTests/Mutter/MutterMaximizeTest.java	2012-06-08 12:14:54.643473010 +0100
 @@ -0,0 +1,161 @@
 +/*
 + * Copyright 2011 Red Hat, Inc.  All Rights Reserved.
@@ -266,46 +300,3 @@
 +    }
 +}
 +
-diff -r cf7c64f276c6 -r 49098163596b test/java/awt/regtesthelpers/Util.java
---- openjdk.orig/jdk/test/java/awt/regtesthelpers/Util.java	Wed May 11 11:08:03 2011 -0400
-+++ openjdk/jdk/test/java/awt/regtesthelpers/Util.java	Tue May 17 10:35:27 2011 -0400
-@@ -140,6 +140,13 @@
-         robot.mouseMove(bounds.x + bounds.width / 2, bounds.y + bounds.height / 2);
-     }
- 
-+    public static Point getTitlePoint(Window decoratedWindow) {
-+        Point p = decoratedWindow.getLocationOnScreen();
-+        Dimension d = decoratedWindow.getSize();
-+        return new Point(p.x + (int)(d.getWidth()/2),
-+                         p.y + (int)decoratedWindow.getInsets().top/2);
-+    }
-+
-     /**
-      * Moves mouse pointer in the center of a given {@code comp} component
-      * and performs a left mouse button click using the {@code robot} parameter
-@@ -167,11 +174,9 @@
-      * WARNING: it may fail on some platforms when the window is not wide enough.
-      */
-     public static void clickOnTitle(final Window decoratedWindow, final Robot robot) {
--        Point p = decoratedWindow.getLocationOnScreen();
--        Dimension d = decoratedWindow.getSize();
--
-         if (decoratedWindow instanceof Frame || decoratedWindow instanceof Dialog) {
--            robot.mouseMove(p.x + (int)(d.getWidth()/2), p.y + (int)decoratedWindow.getInsets().top/2);
-+            Point p = getTitlePoint(decoratedWindow);
-+            robot.mouseMove(p.x, p.y);
-             robot.delay(50);
-             robot.mousePress(InputEvent.BUTTON1_MASK);
-             robot.delay(50);
-@@ -409,7 +414,8 @@
-         ICE_WM = 10,
-         METACITY_WM = 11,
-         COMPIZ_WM = 12,
--        LG3D_WM = 13;
-+        LG3D_WM = 13,
-+        MUTTER_WM = 14;
- 
-     /*
-      * Returns -1 in case of not X Window or any problems.
-exporting patch:
-<fdopen>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/openjdk/original/7034464-hugepage.patch	Fri Jun 08 14:23:28 2012 +0100
@@ -0,0 +1,212 @@
+diff -Nru openjdk.orig/hotspot/src/os/linux/vm/globals_linux.hpp openjdk/hotspot/src/os/linux/vm/globals_linux.hpp
+--- openjdk.orig/hotspot/src/os/linux/vm/globals_linux.hpp	2011-02-28 16:03:14.000000000 +0000
++++ openjdk/hotspot/src/os/linux/vm/globals_linux.hpp	2012-06-08 12:45:33.593538564 +0100
+@@ -26,13 +26,19 @@
+ // Defines Linux specific flags. They are not available on other platforms.
+ //
+ #define RUNTIME_OS_FLAGS(develop, develop_pd, product, product_pd, diagnostic, notproduct) \
+-  product(bool, UseOprofile, false,                                 \
+-        "enable support for Oprofile profiler")                     \
+-                                                                    \
+-  product(bool, UseLinuxPosixThreadCPUClocks, true,                 \
+-          "enable fast Linux Posix clocks where available")
+-// NB: The default value of UseLinuxPosixThreadCPUClocks may be
+-// overridden in Arguments::parse_each_vm_init_arg.
++  product(bool, UseOprofile, false,                                     \
++        "enable support for Oprofile profiler")                         \
++                                                                        \
++  product(bool, UseLinuxPosixThreadCPUClocks, true,                     \
++          "enable fast Linux Posix clocks where available")             \
++/*  NB: The default value of UseLinuxPosixThreadCPUClocks may be        \
++    overridden in Arguments::parse_each_vm_init_arg.  */                \
++                                                                        \
++  product(bool, UseHugeTLBFS, false,                                    \
++          "Use MAP_HUGETLB for large pages")                            \
++                                                                        \
++  product(bool, UseSHM, false,                                          \
++          "Use SYSV shared memory for large pages")
+ 
+ //
+ // Defines Linux-specific default values. The flags are available on all
+diff -Nru openjdk.orig/hotspot/src/os/linux/vm/os_linux.cpp openjdk/hotspot/src/os/linux/vm/os_linux.cpp
+--- openjdk.orig/hotspot/src/os/linux/vm/os_linux.cpp	2012-06-08 12:43:50.875834747 +0100
++++ openjdk/hotspot/src/os/linux/vm/os_linux.cpp	2012-06-08 12:45:33.593538564 +0100
+@@ -2411,16 +2411,40 @@
+   return res != (uintptr_t) MAP_FAILED;
+ }
+ 
++// Define MAP_HUGETLB here so we can build HotSpot on old systems.
++#ifndef MAP_HUGETLB
++#define MAP_HUGETLB 0x40000
++#endif
++
++// Define MADV_HUGEPAGE here so we can build HotSpot on old systems.
++#ifndef MADV_HUGEPAGE
++#define MADV_HUGEPAGE 14
++#endif
++
+ bool os::commit_memory(char* addr, size_t size, size_t alignment_hint,
+                        bool exec) {
++  if (UseHugeTLBFS && alignment_hint > (size_t)vm_page_size()) {
++    int prot = exec ? PROT_READ|PROT_WRITE|PROT_EXEC : PROT_READ|PROT_WRITE;
++    uintptr_t res =
++      (uintptr_t) ::mmap(addr, size, prot,
++                         MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS|MAP_HUGETLB,
++                         -1, 0);
++    return res != (uintptr_t) MAP_FAILED;
++  }
++
+   return commit_memory(addr, size, exec);
+ }
+ 
+-void os::realign_memory(char *addr, size_t bytes, size_t alignment_hint) { }
++void os::realign_memory(char *addr, size_t bytes, size_t alignment_hint) {
++  if (UseHugeTLBFS && alignment_hint > (size_t)vm_page_size()) {
++    // We don't check the return value: madvise(MADV_HUGEPAGE) may not
++    // be supported or the memory may already be backed by huge pages.
++    ::madvise(addr, bytes, MADV_HUGEPAGE);
++  }
++}
+ 
+ void os::free_memory(char *addr, size_t bytes) {
+-  ::mmap(addr, bytes, PROT_READ | PROT_WRITE,
+-         MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0);
++  ::madvise(addr, bytes, MADV_DONTNEED);
+ }
+ 
+ void os::numa_make_global(char *addr, size_t bytes) {
+@@ -2786,7 +2810,16 @@
+ static size_t _large_page_size = 0;
+ 
+ bool os::large_page_init() {
+-  if (!UseLargePages) return false;
++  if (!UseLargePages) {
++    UseHugeTLBFS = false;
++    UseSHM = false;
++    return false;
++  }
++
++  if (FLAG_IS_DEFAULT(UseHugeTLBFS) && FLAG_IS_DEFAULT(UseSHM)) {
++    // Our user has not expressed a preference, so we'll try both.
++    UseHugeTLBFS = UseSHM = true;
++  }
+ 
+   if (LargePageSizeInBytes) {
+     _large_page_size = LargePageSizeInBytes;
+@@ -2831,6 +2864,9 @@
+     }
+   }
+ 
++  // print a warning if any large page related flag is specified on command line
++  bool warn_on_failure = !FLAG_IS_DEFAULT(UseHugeTLBFS);
++
+   const size_t default_page_size = (size_t)Linux::page_size();
+   if (_large_page_size > default_page_size) {
+     _page_sizes[0] = _large_page_size;
+@@ -2838,6 +2874,14 @@
+     _page_sizes[2] = 0;
+   }
+ 
++  UseHugeTLBFS = UseHugeTLBFS &&
++                 Linux::hugetlbfs_sanity_check(warn_on_failure, _large_page_size);
++
++  if (UseHugeTLBFS)
++    UseSHM = false;
++
++  UseLargePages = UseHugeTLBFS || UseSHM;
++
+   // Large page support is available on 2.6 or newer kernel, some vendors
+   // (e.g. Redhat) have backported it to their 2.4 based distributions.
+   // We optimistically assume the support is available. If later it turns out
+@@ -2852,7 +2896,7 @@
+ char* os::reserve_memory_special(size_t bytes, char* req_addr, bool exec) {
+   // "exec" is passed in but not used.  Creating the shared image for
+   // the code cache doesn't have an SHM_X executable permission to check.
+-  assert(UseLargePages, "only for large pages");
++  assert(UseLargePages && UseSHM, "only for SHM large pages");
+ 
+   key_t key = IPC_PRIVATE;
+   char *addr;
+@@ -2919,19 +2963,19 @@
+   return _large_page_size;
+ }
+ 
+-// Linux does not support anonymous mmap with large page memory. The only way
+-// to reserve large page memory without file backing is through SysV shared
+-// memory API. The entire memory region is committed and pinned upfront.
+-// Hopefully this will change in the future...
++// HugeTLBFS allows application to commit large page memory on demand;
++// with SysV SHM the entire memory region must be allocated as shared
++// memory.
+ bool os::can_commit_large_page_memory() {
+-  return false;
++  return UseHugeTLBFS;
+ }
+ 
+ bool os::can_execute_large_page_memory() {
+-  return false;
++  return UseHugeTLBFS;
+ }
+ 
+ // Reserve memory at an arbitrary address, only if that area is
++// Reserve memory at an arbitrary address, only if that area is
+ // available (and not reserved for something else).
+ 
+ char* os::attempt_reserve_memory_at(size_t bytes, char* requested_addr) {
+@@ -4801,6 +4845,43 @@
+ // JSR166
+ // -------------------------------------------------------
+ 
++bool os::Linux::hugetlbfs_sanity_check(bool warn, size_t page_size) {
++  bool result = false;
++  void *p = mmap (NULL, page_size, PROT_READ|PROT_WRITE,
++                  MAP_ANONYMOUS|MAP_PRIVATE|MAP_HUGETLB,
++                  -1, 0);
++
++  if (p != (void *) -1) {
++    // We don't know if this really is a huge page or not.
++    FILE *fp = fopen("/proc/self/maps", "r");
++    if (fp) {
++      while (!feof(fp)) {
++        char chars[257];
++        long x = 0;
++        if (fgets(chars, sizeof(chars), fp)) {
++          if (sscanf(chars, "%lx-%*lx", &x) == 1
++              && x == (long)p) {
++            if (strstr (chars, "hugepage")) {
++              result = true;
++              break;
++            }
++          }
++        }
++      }
++      fclose(fp);
++    }
++    munmap (p, page_size);
++    if (result)
++      return true;
++  }
++
++  if (warn) {
++    warning("HugeTLBFS is not supported by the operating system.");
++  }
++
++  return result;
++}
++
+ /*
+  * The solaris and linux implementations of park/unpark are fairly
+  * conservative for now, but can be improved. They currently use a
+diff -Nru openjdk.orig/hotspot/src/os/linux/vm/os_linux.hpp openjdk/hotspot/src/os/linux/vm/os_linux.hpp
+--- openjdk.orig/hotspot/src/os/linux/vm/os_linux.hpp	2011-02-28 16:03:14.000000000 +0000
++++ openjdk/hotspot/src/os/linux/vm/os_linux.hpp	2012-06-08 12:45:33.601538696 +0100
+@@ -83,6 +83,9 @@
+ 
+   static void rebuild_cpu_to_node_map();
+   static GrowableArray<int>* cpu_to_node()    { return _cpu_to_node; }
++
++  static bool hugetlbfs_sanity_check(bool warn, size_t page_size);
++
+  public:
+   static void init_thread_fpu_state();
+   static int  get_fpu_control_word();
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/openjdk/original/7103224-glibc_name_collision.patch	Fri Jun 08 14:23:28 2012 +0100
@@ -0,0 +1,227 @@
+diff -Nru openjdk.orig/hotspot/src/share/vm/opto/addnode.cpp openjdk/hotspot/src/share/vm/opto/addnode.cpp
+--- openjdk.orig/hotspot/src/share/vm/opto/addnode.cpp	2011-02-28 16:03:20.000000000 +0000
++++ openjdk/hotspot/src/share/vm/opto/addnode.cpp	2012-06-08 12:50:53.702845760 +0100
+@@ -27,8 +27,6 @@
+ #include "incls/_precompiled.incl"
+ #include "incls/_addnode.cpp.incl"
+ 
+-#define MAXFLOAT        ((float)3.40282346638528860e+38)
+-
+ // Classic Add functionality.  This covers all the usual 'add' behaviors for
+ // an algebraic ring.  Add-integer, add-float, add-double, and binary-or are
+ // all inherited from this class.  The various identity values are supplied
+diff -Nru openjdk.orig/hotspot/src/share/vm/prims/jniCheck.cpp openjdk/hotspot/src/share/vm/prims/jniCheck.cpp
+--- openjdk.orig/hotspot/src/share/vm/prims/jniCheck.cpp	2011-02-28 16:03:20.000000000 +0000
++++ openjdk/hotspot/src/share/vm/prims/jniCheck.cpp	2012-06-08 12:50:53.706845826 +0100
+@@ -80,7 +80,7 @@
+     if (env != xenv) {                                                   \
+       NativeReportJNIFatalError(thr, warn_wrong_jnienv);                 \
+     }                                                                    \
+-    __ENTRY(result_type, header, thr)
++    VM_ENTRY_BASE(result_type, header, thr)
+ 
+ 
+ #define UNCHECKED() (unchecked_jni_NativeInterface)
+diff -Nru openjdk.orig/hotspot/src/share/vm/prims/jvmtiEnter.xsl openjdk/hotspot/src/share/vm/prims/jvmtiEnter.xsl
+--- openjdk.orig/hotspot/src/share/vm/prims/jvmtiEnter.xsl	2011-02-28 16:03:20.000000000 +0000
++++ openjdk/hotspot/src/share/vm/prims/jvmtiEnter.xsl	2012-06-08 12:50:53.706845826 +0100
+@@ -424,7 +424,7 @@
+     <xsl:value-of select="$space"/>
+     <xsl:text>ThreadInVMfromNative __tiv(current_thread);</xsl:text>
+     <xsl:value-of select="$space"/>
+-    <xsl:text>__ENTRY(jvmtiError, </xsl:text>
++    <xsl:text>VM_ENTRY_BASE(jvmtiError, </xsl:text>
+     <xsl:apply-templates select="." mode="functionid"/>
+     <xsl:text> , current_thread)</xsl:text>
+     <xsl:value-of select="$space"/>
+diff -Nru openjdk.orig/hotspot/src/share/vm/prims/jvmtiEnv.cpp openjdk/hotspot/src/share/vm/prims/jvmtiEnv.cpp
+--- openjdk.orig/hotspot/src/share/vm/prims/jvmtiEnv.cpp	2012-06-08 12:49:49.969789411 +0100
++++ openjdk/hotspot/src/share/vm/prims/jvmtiEnv.cpp	2012-06-08 12:50:53.706845826 +0100
+@@ -126,7 +126,7 @@
+     // from native so as to resolve the jthread.
+ 
+     ThreadInVMfromNative __tiv(current_thread);
+-    __ENTRY(jvmtiError, JvmtiEnv::GetThreadLocalStorage , current_thread)
++    VM_ENTRY_BASE(jvmtiError, JvmtiEnv::GetThreadLocalStorage , current_thread)
+     debug_only(VMNativeEntryWrapper __vew;)
+ 
+     oop thread_oop = JNIHandles::resolve_external_guard(thread);
+diff -Nru openjdk.orig/hotspot/src/share/vm/prims/jvmtiExport.cpp openjdk/hotspot/src/share/vm/prims/jvmtiExport.cpp
+--- openjdk.orig/hotspot/src/share/vm/prims/jvmtiExport.cpp	2011-02-28 16:03:21.000000000 +0000
++++ openjdk/hotspot/src/share/vm/prims/jvmtiExport.cpp	2012-06-08 12:50:53.706845826 +0100
+@@ -344,7 +344,7 @@
+     JavaThread* current_thread = (JavaThread*) ThreadLocalStorage::thread();
+     // transition code: native to VM
+     ThreadInVMfromNative __tiv(current_thread);
+-    __ENTRY(jvmtiEnv*, JvmtiExport::get_jvmti_interface, current_thread)
++    VM_ENTRY_BASE(jvmtiEnv*, JvmtiExport::get_jvmti_interface, current_thread)
+     debug_only(VMNativeEntryWrapper __vew;)
+ 
+     JvmtiEnv *jvmti_env = JvmtiEnv::create_a_jvmti(version);
+diff -Nru openjdk.orig/hotspot/src/share/vm/runtime/interfaceSupport.hpp openjdk/hotspot/src/share/vm/runtime/interfaceSupport.hpp
+--- openjdk.orig/hotspot/src/share/vm/runtime/interfaceSupport.hpp	2011-02-28 16:03:21.000000000 +0000
++++ openjdk/hotspot/src/share/vm/runtime/interfaceSupport.hpp	2012-06-08 12:50:53.706845826 +0100
+@@ -46,9 +46,9 @@
+   }
+ };
+ 
+-// InterfaceSupport provides functionality used by the __LEAF and __ENTRY
+-// macros. These macros are used to guard entry points into the VM and
+-// perform checks upon leave of the VM.
++// InterfaceSupport provides functionality used by the VM_LEAF_BASE and
++// VM_ENTRY_BASE macros. These macros are used to guard entry points into
++// the VM and perform checks upon leave of the VM.
+ 
+ 
+ class InterfaceSupport: AllStatic {
+@@ -391,7 +391,7 @@
+ 
+ // LEAF routines do not lock, GC or throw exceptions
+ 
+-#define __LEAF(result_type, header)                                  \
++#define VM_LEAF_BASE(result_type, header)                            \
+   TRACE_CALL(result_type, header)                                    \
+   debug_only(NoHandleMark __hm;)                                     \
+   /* begin of body */
+@@ -399,7 +399,7 @@
+ 
+ // ENTRY routines may lock, GC and throw exceptions
+ 
+-#define __ENTRY(result_type, header, thread)                         \
++#define VM_ENTRY_BASE(result_type, header, thread)                   \
+   TRACE_CALL(result_type, header)                                    \
+   HandleMarkCleaner __hm(thread);                                    \
+   Thread* THREAD = thread;                                           \
+@@ -408,7 +408,7 @@
+ 
+ // QUICK_ENTRY routines behave like ENTRY but without a handle mark
+ 
+-#define __QUICK_ENTRY(result_type, header, thread)                   \
++#define VM_QUICK_ENTRY_BASE(result_type, header, thread)             \
+   TRACE_CALL(result_type, header)                                    \
+   debug_only(NoHandleMark __hm;)                                     \
+   Thread* THREAD = thread;                                           \
+@@ -421,20 +421,20 @@
+ #define IRT_ENTRY(result_type, header)                               \
+   result_type header {                                               \
+     ThreadInVMfromJava __tiv(thread);                                \
+-    __ENTRY(result_type, header, thread)                             \
++    VM_ENTRY_BASE(result_type, header, thread)                       \
+     debug_only(VMEntryWrapper __vew;)
+ 
+ 
+ #define IRT_LEAF(result_type, header)                                \
+   result_type header {                                               \
+-    __LEAF(result_type, header)                                      \
++    VM_LEAF_BASE(result_type, header)                                \
+     debug_only(No_Safepoint_Verifier __nspv(true);)
+ 
+ 
+ #define IRT_ENTRY_NO_ASYNC(result_type, header)                      \
+   result_type header {                                               \
+     ThreadInVMfromJavaNoAsyncException __tiv(thread);                \
+-    __ENTRY(result_type, header, thread)                             \
++    VM_ENTRY_BASE(result_type, header, thread)                       \
+     debug_only(VMEntryWrapper __vew;)
+ 
+ // Another special case for nmethod_entry_point so the nmethod that the
+@@ -445,7 +445,7 @@
+   result_type header {                                               \
+     nmethodLocker _nmlock(nm);                                       \
+     ThreadInVMfromJavaNoAsyncException __tiv(thread);                                \
+-    __ENTRY(result_type, header, thread)
++    VM_ENTRY_BASE(result_type, header, thread)
+ 
+ #define IRT_END }
+ 
+@@ -455,20 +455,20 @@
+ #define JRT_ENTRY(result_type, header)                               \
+   result_type header {                                               \
+     ThreadInVMfromJava __tiv(thread);                                \
+-    __ENTRY(result_type, header, thread)                             \
++    VM_ENTRY_BASE(result_type, header, thread)                       \
+     debug_only(VMEntryWrapper __vew;)
+ 
+ 
+ #define JRT_LEAF(result_type, header)                                \
+   result_type header {                                               \
+-  __LEAF(result_type, header)                                        \
++  VM_LEAF_BASE(result_type, header)                                  \
+   debug_only(JRT_Leaf_Verifier __jlv;)
+ 
+ 
+ #define JRT_ENTRY_NO_ASYNC(result_type, header)                      \
+   result_type header {                                               \
+     ThreadInVMfromJavaNoAsyncException __tiv(thread);                \
+-    __ENTRY(result_type, header, thread)                             \
++    VM_ENTRY_BASE(result_type, header, thread)                       \
+     debug_only(VMEntryWrapper __vew;)
+ 
+ // Same as JRT Entry but allows for return value after the safepoint
+@@ -501,11 +501,11 @@
+     assert( !VerifyJNIEnvThread || (thread == Thread::current()), "JNIEnv is only valid in same thread"); \
+     ThreadInVMfromNative __tiv(thread);                              \
+     debug_only(VMNativeEntryWrapper __vew;)                          \
+-    __ENTRY(result_type, header, thread)
++    VM_ENTRY_BASE(result_type, header, thread)
+ 
+ 
+ // Ensure that the VMNativeEntryWrapper constructor, which can cause
+-// a GC, is called outside the NoHandleMark (set via __QUICK_ENTRY).
++// a GC, is called outside the NoHandleMark (set via VM_QUICK_ENTRY_BASE).
+ #define JNI_QUICK_ENTRY(result_type, header)                         \
+ extern "C" {                                                         \
+   result_type JNICALL header {                                \
+@@ -513,7 +513,7 @@
+     assert( !VerifyJNIEnvThread || (thread == Thread::current()), "JNIEnv is only valid in same thread"); \
+     ThreadInVMfromNative __tiv(thread);                              \
+     debug_only(VMNativeEntryWrapper __vew;)                          \
+-    __QUICK_ENTRY(result_type, header, thread)
++    VM_QUICK_ENTRY_BASE(result_type, header, thread)
+ 
+ 
+ #define JNI_LEAF(result_type, header)                                \
+@@ -521,7 +521,7 @@
+   result_type JNICALL header {                                \
+     JavaThread* thread=JavaThread::thread_from_jni_environment(env); \
+     assert( !VerifyJNIEnvThread || (thread == Thread::current()), "JNIEnv is only valid in same thread"); \
+-    __LEAF(result_type, header)
++    VM_LEAF_BASE(result_type, header)
+ 
+ 
+ // Close the routine and the extern "C"
+@@ -537,7 +537,7 @@
+     JavaThread* thread=JavaThread::thread_from_jni_environment(env); \
+     ThreadInVMfromNative __tiv(thread);                              \
+     debug_only(VMNativeEntryWrapper __vew;)                          \
+-    __ENTRY(result_type, header, thread)
++    VM_ENTRY_BASE(result_type, header, thread)
+ 
+ 
+ #define JVM_ENTRY_NO_ENV(result_type, header)                        \
+@@ -546,7 +546,7 @@
+     JavaThread* thread = (JavaThread*)ThreadLocalStorage::thread();  \
+     ThreadInVMfromNative __tiv(thread);                              \
+     debug_only(VMNativeEntryWrapper __vew;)                          \
+-    __ENTRY(result_type, header, thread)
++    VM_ENTRY_BASE(result_type, header, thread)
+ 
+ 
+ #define JVM_QUICK_ENTRY(result_type, header)                         \
+@@ -555,14 +555,14 @@
+     JavaThread* thread=JavaThread::thread_from_jni_environment(env); \
+     ThreadInVMfromNative __tiv(thread);                              \
+     debug_only(VMNativeEntryWrapper __vew;)                          \
+-    __QUICK_ENTRY(result_type, header, thread)
++    VM_QUICK_ENTRY_BASE(result_type, header, thread)
+ 
+ 
+ #define JVM_LEAF(result_type, header)                                \
+ extern "C" {                                                         \
+   result_type JNICALL header {                                       \
+     VM_Exit::block_if_vm_exited();                                   \
+-    __LEAF(result_type, header)
++    VM_LEAF_BASE(result_type, header)
+ 
+ 
+ #define JVM_END } }
--- a/patches/openjdk/remove-mimpure-option-to-gcc.patch	Thu May 31 12:40:08 2012 +0200
+++ b/patches/openjdk/remove-mimpure-option-to-gcc.patch	Fri Jun 08 14:23:28 2012 +0100
@@ -1,8 +1,8 @@
-diff -ur openjdk.orig/jdk/make/common/shared/Compiler-gcc.gmk openjdk/jdk/make/common/shared/Compiler-gcc.gmk
---- openjdk.orig/jdk/make/common/shared/Compiler-gcc.gmk	2011-11-14 17:11:39.000000000 -0500
-+++ openjdk/jdk/make/common/shared/Compiler-gcc.gmk	2012-01-30 11:27:47.181487274 -0500
-@@ -94,7 +94,7 @@
-   endif
+diff -Nru openjdk.orig/jdk/make/common/shared/Compiler-gcc.gmk openjdk/jdk/make/common/shared/Compiler-gcc.gmk
+--- openjdk.orig/jdk/make/common/shared/Compiler-gcc.gmk	2012-06-08 12:21:43.258084850 +0100
++++ openjdk/jdk/make/common/shared/Compiler-gcc.gmk	2012-06-08 12:22:15.546607565 +0100
+@@ -132,7 +132,7 @@
+     REQUIRED_GCC_VER = 4.0.*
    endif
    # Option used to create a shared library
 -  SHARED_LIBRARY_FLAG = -shared -mimpure-text
@@ -10,9 +10,9 @@
    SUN_COMP_VER := $(shell $(CC) --verbose 2>&1 )
  
  endif
-diff -ur openjdk.orig/jdk/src/share/demo/jvmti/compiledMethodLoad/sample.makefile.txt openjdk/jdk/src/share/demo/jvmti/compiledMethodLoad/sample.makefile.txt
---- openjdk.orig/jdk/src/share/demo/jvmti/compiledMethodLoad/sample.makefile.txt	2011-11-14 17:12:10.000000000 -0500
-+++ openjdk/jdk/src/share/demo/jvmti/compiledMethodLoad/sample.makefile.txt	2012-01-30 11:27:47.186487189 -0500
+diff -Nru openjdk.orig/jdk/src/share/demo/jvmti/compiledMethodLoad/sample.makefile.txt openjdk/jdk/src/share/demo/jvmti/compiledMethodLoad/sample.makefile.txt
+--- openjdk.orig/jdk/src/share/demo/jvmti/compiledMethodLoad/sample.makefile.txt	2011-02-28 16:06:43.000000000 +0000
++++ openjdk/jdk/src/share/demo/jvmti/compiledMethodLoad/sample.makefile.txt	2012-06-08 12:22:15.546607565 +0100
 @@ -90,7 +90,7 @@
      OBJECTS=$(SOURCES:%.c=%.o)
      # Library name and options needed to build it
@@ -22,9 +22,9 @@
      # Libraries we are dependent on
      LIBRARIES=-lc
      # Building a shared library
-diff -ur openjdk.orig/jdk/src/share/demo/jvmti/gctest/sample.makefile.txt openjdk/jdk/src/share/demo/jvmti/gctest/sample.makefile.txt
---- openjdk.orig/jdk/src/share/demo/jvmti/gctest/sample.makefile.txt	2011-11-14 17:12:10.000000000 -0500
-+++ openjdk/jdk/src/share/demo/jvmti/gctest/sample.makefile.txt	2012-01-30 11:27:47.187487172 -0500
+diff -Nru openjdk.orig/jdk/src/share/demo/jvmti/gctest/sample.makefile.txt openjdk/jdk/src/share/demo/jvmti/gctest/sample.makefile.txt
+--- openjdk.orig/jdk/src/share/demo/jvmti/gctest/sample.makefile.txt	2011-02-28 16:06:43.000000000 +0000
++++ openjdk/jdk/src/share/demo/jvmti/gctest/sample.makefile.txt	2012-06-08 12:22:15.562607824 +0100
 @@ -90,7 +90,7 @@
      OBJECTS=$(SOURCES:%.c=%.o)
      # Library name and options needed to build it
@@ -34,9 +34,9 @@
      # Libraries we are dependent on
      LIBRARIES=-lc
      # Building a shared library
-diff -ur openjdk.orig/jdk/src/share/demo/jvmti/heapTracker/sample.makefile.txt openjdk/jdk/src/share/demo/jvmti/heapTracker/sample.makefile.txt
---- openjdk.orig/jdk/src/share/demo/jvmti/heapTracker/sample.makefile.txt	2011-11-14 17:12:10.000000000 -0500
-+++ openjdk/jdk/src/share/demo/jvmti/heapTracker/sample.makefile.txt	2012-01-30 11:27:47.186487189 -0500
+diff -Nru openjdk.orig/jdk/src/share/demo/jvmti/heapTracker/sample.makefile.txt openjdk/jdk/src/share/demo/jvmti/heapTracker/sample.makefile.txt
+--- openjdk.orig/jdk/src/share/demo/jvmti/heapTracker/sample.makefile.txt	2011-02-28 16:06:43.000000000 +0000
++++ openjdk/jdk/src/share/demo/jvmti/heapTracker/sample.makefile.txt	2012-06-08 12:22:15.562607824 +0100
 @@ -94,7 +94,7 @@
      OBJECTS=$(SOURCES:%.c=%.o)
      # Library name and options needed to build it
@@ -46,9 +46,9 @@
      # Libraries we are dependent on
      LIBRARIES=-L $(JDK)/jre/lib/$(LIBARCH) -ljava_crw_demo -lc
      # Building a shared library
-diff -ur openjdk.orig/jdk/src/share/demo/jvmti/heapViewer/sample.makefile.txt openjdk/jdk/src/share/demo/jvmti/heapViewer/sample.makefile.txt
---- openjdk.orig/jdk/src/share/demo/jvmti/heapViewer/sample.makefile.txt	2011-11-14 17:12:10.000000000 -0500
-+++ openjdk/jdk/src/share/demo/jvmti/heapViewer/sample.makefile.txt	2012-01-30 11:27:47.184487223 -0500
+diff -Nru openjdk.orig/jdk/src/share/demo/jvmti/heapViewer/sample.makefile.txt openjdk/jdk/src/share/demo/jvmti/heapViewer/sample.makefile.txt
+--- openjdk.orig/jdk/src/share/demo/jvmti/heapViewer/sample.makefile.txt	2011-02-28 16:06:43.000000000 +0000
++++ openjdk/jdk/src/share/demo/jvmti/heapViewer/sample.makefile.txt	2012-06-08 12:22:15.562607824 +0100
 @@ -90,7 +90,7 @@
      OBJECTS=$(SOURCES:%.c=%.o)
      # Library name and options needed to build it
@@ -58,9 +58,9 @@
      # Libraries we are dependent on
      LIBRARIES=-lc
      # Building a shared library
-diff -ur openjdk.orig/jdk/src/share/demo/jvmti/hprof/sample.makefile.txt openjdk/jdk/src/share/demo/jvmti/hprof/sample.makefile.txt
---- openjdk.orig/jdk/src/share/demo/jvmti/hprof/sample.makefile.txt	2011-11-14 17:12:10.000000000 -0500
-+++ openjdk/jdk/src/share/demo/jvmti/hprof/sample.makefile.txt	2012-01-30 11:27:47.189487139 -0500
+diff -Nru openjdk.orig/jdk/src/share/demo/jvmti/hprof/sample.makefile.txt openjdk/jdk/src/share/demo/jvmti/hprof/sample.makefile.txt
+--- openjdk.orig/jdk/src/share/demo/jvmti/hprof/sample.makefile.txt	2011-02-28 16:06:43.000000000 +0000
++++ openjdk/jdk/src/share/demo/jvmti/hprof/sample.makefile.txt	2012-06-08 12:22:15.562607824 +0100
 @@ -130,7 +130,7 @@
      OBJECTS=$(SOURCES:%.c=%.o)
      # Library name and options needed to build it
@@ -70,9 +70,9 @@
      # Libraries we are dependent on
      LIBRARIES= -lnsl -ldl -lc
      # Building a shared library
-diff -ur openjdk.orig/jdk/src/share/demo/jvmti/index.html openjdk/jdk/src/share/demo/jvmti/index.html
---- openjdk.orig/jdk/src/share/demo/jvmti/index.html	2011-11-14 17:12:10.000000000 -0500
-+++ openjdk/jdk/src/share/demo/jvmti/index.html	2012-01-30 11:27:47.183487240 -0500
+diff -Nru openjdk.orig/jdk/src/share/demo/jvmti/index.html openjdk/jdk/src/share/demo/jvmti/index.html
+--- openjdk.orig/jdk/src/share/demo/jvmti/index.html	2011-02-28 16:06:43.000000000 +0000
++++ openjdk/jdk/src/share/demo/jvmti/index.html	2012-06-08 12:22:15.562607824 +0100
 @@ -308,7 +308,7 @@
  <code><ul>
  gcc -O2 -fPIC -pthread -DLINUX -c <i>*.c</i>
@@ -100,9 +100,9 @@
  <br>
  When building the shared library (-shared option), this option
  allows for maximum portability of the library between different
-diff -ur openjdk.orig/jdk/src/share/demo/jvmti/java_crw_demo/sample.makefile.txt openjdk/jdk/src/share/demo/jvmti/java_crw_demo/sample.makefile.txt
---- openjdk.orig/jdk/src/share/demo/jvmti/java_crw_demo/sample.makefile.txt	2011-11-14 17:12:10.000000000 -0500
-+++ openjdk/jdk/src/share/demo/jvmti/java_crw_demo/sample.makefile.txt	2012-01-30 11:27:47.187487172 -0500
+diff -Nru openjdk.orig/jdk/src/share/demo/jvmti/java_crw_demo/sample.makefile.txt openjdk/jdk/src/share/demo/jvmti/java_crw_demo/sample.makefile.txt
+--- openjdk.orig/jdk/src/share/demo/jvmti/java_crw_demo/sample.makefile.txt	2011-02-28 16:06:43.000000000 +0000
++++ openjdk/jdk/src/share/demo/jvmti/java_crw_demo/sample.makefile.txt	2012-06-08 12:22:15.562607824 +0100
 @@ -90,7 +90,7 @@
      OBJECTS=$(SOURCES:%.c=%.o)
      # Library name and options needed to build it
@@ -112,9 +112,9 @@
      # Libraries we are dependent on
      LIBRARIES=-lc
      # Building a shared library
-diff -ur openjdk.orig/jdk/src/share/demo/jvmti/minst/sample.makefile.txt openjdk/jdk/src/share/demo/jvmti/minst/sample.makefile.txt
---- openjdk.orig/jdk/src/share/demo/jvmti/minst/sample.makefile.txt	2011-11-14 17:12:10.000000000 -0500
-+++ openjdk/jdk/src/share/demo/jvmti/minst/sample.makefile.txt	2012-01-30 11:27:47.187487172 -0500
+diff -Nru openjdk.orig/jdk/src/share/demo/jvmti/minst/sample.makefile.txt openjdk/jdk/src/share/demo/jvmti/minst/sample.makefile.txt
+--- openjdk.orig/jdk/src/share/demo/jvmti/minst/sample.makefile.txt	2011-02-28 16:06:43.000000000 +0000
++++ openjdk/jdk/src/share/demo/jvmti/minst/sample.makefile.txt	2012-06-08 12:22:15.562607824 +0100
 @@ -94,7 +94,7 @@
      OBJECTS=$(SOURCES:%.c=%.o)
      # Library name and options needed to build it
@@ -124,9 +124,9 @@
      # Libraries we are dependent on
      LIBRARIES=-L $(JDK)/jre/lib/$(LIBARCH) -ljava_crw_demo -lc
      # Building a shared library
-diff -ur openjdk.orig/jdk/src/share/demo/jvmti/mtrace/sample.makefile.txt openjdk/jdk/src/share/demo/jvmti/mtrace/sample.makefile.txt
---- openjdk.orig/jdk/src/share/demo/jvmti/mtrace/sample.makefile.txt	2011-11-14 17:12:10.000000000 -0500
-+++ openjdk/jdk/src/share/demo/jvmti/mtrace/sample.makefile.txt	2012-01-30 11:27:47.188487155 -0500
+diff -Nru openjdk.orig/jdk/src/share/demo/jvmti/mtrace/sample.makefile.txt openjdk/jdk/src/share/demo/jvmti/mtrace/sample.makefile.txt
+--- openjdk.orig/jdk/src/share/demo/jvmti/mtrace/sample.makefile.txt	2011-02-28 16:06:43.000000000 +0000
++++ openjdk/jdk/src/share/demo/jvmti/mtrace/sample.makefile.txt	2012-06-08 12:22:15.562607824 +0100
 @@ -94,7 +94,7 @@
      OBJECTS=$(SOURCES:%.c=%.o)
      # Library name and options needed to build it
@@ -136,9 +136,9 @@
      # Libraries we are dependent on
      LIBRARIES=-L $(JDK)/jre/lib/$(LIBARCH) -ljava_crw_demo -lc
      # Building a shared library
-diff -ur openjdk.orig/jdk/src/share/demo/jvmti/versionCheck/sample.makefile.txt openjdk/jdk/src/share/demo/jvmti/versionCheck/sample.makefile.txt
---- openjdk.orig/jdk/src/share/demo/jvmti/versionCheck/sample.makefile.txt	2011-11-14 17:12:10.000000000 -0500
-+++ openjdk/jdk/src/share/demo/jvmti/versionCheck/sample.makefile.txt	2012-01-30 11:27:47.185487206 -0500
+diff -Nru openjdk.orig/jdk/src/share/demo/jvmti/versionCheck/sample.makefile.txt openjdk/jdk/src/share/demo/jvmti/versionCheck/sample.makefile.txt
+--- openjdk.orig/jdk/src/share/demo/jvmti/versionCheck/sample.makefile.txt	2011-02-28 16:06:43.000000000 +0000
++++ openjdk/jdk/src/share/demo/jvmti/versionCheck/sample.makefile.txt	2012-06-08 12:22:15.562607824 +0100
 @@ -90,7 +90,7 @@
      OBJECTS=$(SOURCES:%.c=%.o)
      # Library name and options needed to build it
@@ -148,9 +148,9 @@
      # Libraries we are dependent on
      LIBRARIES=-lc
      # Building a shared library
-diff -ur openjdk.orig/jdk/src/share/demo/jvmti/waiters/sample.makefile.txt openjdk/jdk/src/share/demo/jvmti/waiters/sample.makefile.txt
---- openjdk.orig/jdk/src/share/demo/jvmti/waiters/sample.makefile.txt	2011-11-14 17:12:10.000000000 -0500
-+++ openjdk/jdk/src/share/demo/jvmti/waiters/sample.makefile.txt	2012-01-30 11:27:47.188487155 -0500
+diff -Nru openjdk.orig/jdk/src/share/demo/jvmti/waiters/sample.makefile.txt openjdk/jdk/src/share/demo/jvmti/waiters/sample.makefile.txt
+--- openjdk.orig/jdk/src/share/demo/jvmti/waiters/sample.makefile.txt	2011-02-28 16:06:43.000000000 +0000
++++ openjdk/jdk/src/share/demo/jvmti/waiters/sample.makefile.txt	2012-06-08 12:22:15.562607824 +0100
 @@ -91,7 +91,7 @@
      OBJECTS=$(SOURCES:%.cpp=%.o)
      # Library name and options needed to build it
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/security/20120612/7079902.patch	Fri Jun 08 14:23:28 2012 +0100
@@ -0,0 +1,508 @@
+# HG changeset patch
+# User mbankal
+# Date 1339072594 -3600
+# Node ID 0f2647f201d5879ed294348e36325c2cc2934749
+# Parent  2c6c90dae1670064c856830662ee84b1677d7d1b
+7079902: Refine CORBA data models
+Reviewed-by: asaha, coffeys
+
+diff --git a/src/share/classes/com/sun/corba/se/impl/interceptors/ClientRequestInfoImpl.java b/src/share/classes/com/sun/corba/se/impl/interceptors/ClientRequestInfoImpl.java
+--- openjdk/corba/src/share/classes/com/sun/corba/se/impl/interceptors/ClientRequestInfoImpl.java
++++ openjdk/corba/src/share/classes/com/sun/corba/se/impl/interceptors/ClientRequestInfoImpl.java
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2000, 2003, 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
+@@ -215,7 +215,7 @@
+ 
+     // ClientRequestInfo validity table (see ptc/00-08-06 table 21-1).
+     // Note: These must be in the same order as specified in contants.
+-    protected static final boolean validCall[][] = {
++    private static final boolean validCall[][] = {
+         // LEGEND:
+         // s_req = send_request     r_rep = receive_reply
+         // s_pol = send_poll        r_exc = receive_exception
+diff --git a/src/share/classes/com/sun/corba/se/impl/interceptors/ServerRequestInfoImpl.java b/src/share/classes/com/sun/corba/se/impl/interceptors/ServerRequestInfoImpl.java
+--- openjdk/corba/src/share/classes/com/sun/corba/se/impl/interceptors/ServerRequestInfoImpl.java
++++ openjdk/corba/src/share/classes/com/sun/corba/se/impl/interceptors/ServerRequestInfoImpl.java
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2000, 2003, 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
+@@ -195,7 +195,7 @@
+ 
+     // ServerRequestInfo validity table (see ptc/00-08-06 table 21-2).
+     // Note: These must be in the same order as specified in contants.
+-    protected static final boolean validCall[][] = {
++    private static final boolean validCall[][] = {
+         // LEGEND:
+         // r_rsc = receive_request_service_contexts
+         // r_req = receive_request
+diff --git a/src/share/classes/com/sun/corba/se/impl/javax/rmi/CORBA/Util.java b/src/share/classes/com/sun/corba/se/impl/javax/rmi/CORBA/Util.java
+--- openjdk/corba/src/share/classes/com/sun/corba/se/impl/javax/rmi/CORBA/Util.java
++++ openjdk/corba/src/share/classes/com/sun/corba/se/impl/javax/rmi/CORBA/Util.java
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 1999, 2004, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 1999, 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
+@@ -130,10 +130,23 @@
+     private UtilSystemException utilWrapper = UtilSystemException.get(
+                                                   CORBALogDomains.RPC_ENCODING);
+ 
+-    public static Util instance = null;
++    private static Util instance = null;
+ 
+     public Util() {
+-        instance = this;
++        setInstance(this);
++    }
++
++    private static void setInstance( Util util ) {
++        assert instance == null : "Instance already defined";
++        instance = util;
++    }
++
++    public static Util getInstance() {
++        return instance;
++    }
++
++    public static boolean isInstanceDefined() {
++        return instance != null;
+     }
+ 
+     // Used by TOAFactory.shutdown to unexport all targets for this
+diff --git a/src/share/classes/com/sun/corba/se/impl/oa/poa/POAPolicyMediatorBase_R.java b/src/share/classes/com/sun/corba/se/impl/oa/poa/POAPolicyMediatorBase_R.java
+--- openjdk/corba/src/share/classes/com/sun/corba/se/impl/oa/poa/POAPolicyMediatorBase_R.java
++++ openjdk/corba/src/share/classes/com/sun/corba/se/impl/oa/poa/POAPolicyMediatorBase_R.java
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2002, 2004, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 2002, 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
+@@ -93,7 +93,7 @@
+ 
+         activeObjectMap.putServant( servant, entry ) ;
+ 
+-        if (Util.instance != null) {
++        if (Util.isInstanceDefined()) {
+             POAManagerImpl pm = (POAManagerImpl)poa.the_POAManager() ;
+             POAFactory factory = pm.getFactory() ;
+             factory.registerPOAForServant(poa, servant);
+@@ -133,7 +133,7 @@
+ 
+         activeObjectMap.remove(key);
+ 
+-        if (Util.instance != null) {
++        if (Util.isInstanceDefined()) {
+             POAManagerImpl pm = (POAManagerImpl)poa.the_POAManager() ;
+             POAFactory factory = pm.getFactory() ;
+             factory.unregisterPOAForServant(poa, s);
+diff --git a/src/share/classes/com/sun/corba/se/impl/oa/toa/TOAFactory.java b/src/share/classes/com/sun/corba/se/impl/oa/toa/TOAFactory.java
+--- openjdk/corba/src/share/classes/com/sun/corba/se/impl/oa/toa/TOAFactory.java
++++ openjdk/corba/src/share/classes/com/sun/corba/se/impl/oa/toa/TOAFactory.java
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2002, 2003, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 2002, 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
+@@ -78,8 +78,8 @@
+ 
+     public void shutdown( boolean waitForCompletion )
+     {
+-        if (Util.instance != null) {
+-            Util.instance.unregisterTargetsForORB(orb);
++        if (Util.isInstanceDefined()) {
++            Util.getInstance().unregisterTargetsForORB(orb);
+         }
+     }
+ 
+diff --git a/src/share/classes/com/sun/corba/se/impl/orb/ParserTable.java b/src/share/classes/com/sun/corba/se/impl/orb/ParserTable.java
+--- openjdk/corba/src/share/classes/com/sun/corba/se/impl/orb/ParserTable.java
++++ openjdk/corba/src/share/classes/com/sun/corba/se/impl/orb/ParserTable.java
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2002, 2006, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 2002, 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
+@@ -106,7 +106,9 @@
+ 
+     public ParserData[] getParserData()
+     {
+-        return parserData ;
++        ParserData[] parserArray = new ParserData[parserData.length];
++        System.arraycopy(parserData, 0, parserArray, 0, parserData.length);
++        return parserArray;
+     }
+ 
+     private ParserTable() {
+diff --git a/src/share/classes/com/sun/corba/se/impl/orbutil/RepositoryId_1_3.java b/src/share/classes/com/sun/corba/se/impl/orbutil/RepositoryId_1_3.java
+--- openjdk/corba/src/share/classes/com/sun/corba/se/impl/orbutil/RepositoryId_1_3.java
++++ openjdk/corba/src/share/classes/com/sun/corba/se/impl/orbutil/RepositoryId_1_3.java
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2000, 2002, 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
+@@ -62,7 +62,7 @@
+     // legal use of '.' in a Java name.
+ 
+     public static final RepositoryIdCache_1_3 cache = new RepositoryIdCache_1_3();
+-    public static final byte[] IDL_IDENTIFIER_CHARS = {
++    private static final byte[] IDL_IDENTIFIER_CHARS = {
+ 
+         // 0 1 2 3  4 5 6 7  8 9 a b  c d e f
+         0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, // 00-0f
+@@ -180,7 +180,7 @@
+     public static final String kRemoteTypeStr = "";
+     public static final String kRemoteValueRepID = "";
+ 
+-    public static final Hashtable kSpecialArrayTypeStrings = new Hashtable();
++    private static final Hashtable kSpecialArrayTypeStrings = new Hashtable();
+ 
+     static {
+         kSpecialArrayTypeStrings.put("CORBA.WStringValue", new StringBuffer(java.lang.String.class.getName()));
+@@ -189,7 +189,7 @@
+ 
+     }
+ 
+-    public static final Hashtable kSpecialCasesRepIDs = new Hashtable();
++    private static final Hashtable kSpecialCasesRepIDs = new Hashtable();
+ 
+     static {
+         kSpecialCasesRepIDs.put(java.lang.String.class, kWStringValueRepID);
+@@ -197,7 +197,7 @@
+         kSpecialCasesRepIDs.put(java.rmi.Remote.class, kRemoteValueRepID);
+     }
+ 
+-    public static final Hashtable kSpecialCasesStubValues = new Hashtable();
++    private static final Hashtable kSpecialCasesStubValues = new Hashtable();
+ 
+     static {
+         kSpecialCasesStubValues.put(java.lang.String.class, kWStringStubValue);
+@@ -209,7 +209,7 @@
+     }
+ 
+ 
+-    public static final Hashtable kSpecialCasesVersions = new Hashtable();
++    private static final Hashtable kSpecialCasesVersions = new Hashtable();
+ 
+     static {
+         kSpecialCasesVersions.put(java.lang.String.class, kWStringValueHash);
+@@ -220,7 +220,7 @@
+         kSpecialCasesVersions.put(java.rmi.Remote.class, kRemoteValueHash);
+     }
+ 
+-    public static final Hashtable kSpecialCasesClasses = new Hashtable();
++    private static final Hashtable kSpecialCasesClasses = new Hashtable();
+ 
+     static {
+         kSpecialCasesClasses.put(kWStringTypeStr, java.lang.String.class);
+@@ -232,7 +232,7 @@
+         //kSpecialCasesClasses.put(kRemoteTypeStr, java.rmi.Remote.class);
+     }
+ 
+-    public static final Hashtable kSpecialCasesArrayPrefix = new Hashtable();
++    private static final Hashtable kSpecialCasesArrayPrefix = new Hashtable();
+ 
+     static {
+         kSpecialCasesArrayPrefix.put(java.lang.String.class, kValuePrefix + kSequencePrefix + kCORBAPrefix);
+@@ -243,7 +243,7 @@
+         kSpecialCasesArrayPrefix.put(java.rmi.Remote.class, kValuePrefix + kSequencePrefix + kCORBAPrefix);
+     }
+ 
+-    public static final Hashtable kSpecialPrimitives = new Hashtable();
++    private static final Hashtable kSpecialPrimitives = new Hashtable();
+ 
+     static {
+         kSpecialPrimitives.put("int","long");
+diff --git a/src/share/classes/com/sun/corba/se/impl/orbutil/RepositoryId_1_3_1.java b/src/share/classes/com/sun/corba/se/impl/orbutil/RepositoryId_1_3_1.java
+--- openjdk/corba/src/share/classes/com/sun/corba/se/impl/orbutil/RepositoryId_1_3_1.java
++++ openjdk/corba/src/share/classes/com/sun/corba/se/impl/orbutil/RepositoryId_1_3_1.java
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2001, 2002, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 2001, 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
+@@ -63,7 +63,7 @@
+     // uniformly, and is safe because that is the only
+     // legal use of '.' in a Java name.
+ 
+-    public static final byte[] IDL_IDENTIFIER_CHARS = {
++    private static final byte[] IDL_IDENTIFIER_CHARS = {
+ 
+         // 0 1 2 3  4 5 6 7  8 9 a b  c d e f
+         0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, // 00-0f
+@@ -198,7 +198,7 @@
+     public static final String kRemoteTypeStr = "";
+     public static final String kRemoteValueRepID = "";
+ 
+-    public static final Hashtable kSpecialArrayTypeStrings = new Hashtable();
++    private static final Hashtable kSpecialArrayTypeStrings = new Hashtable();
+ 
+     static {
+         kSpecialArrayTypeStrings.put("CORBA.WStringValue", new StringBuffer(java.lang.String.class.getName()));
+@@ -207,7 +207,7 @@
+ 
+     }
+ 
+-    public static final Hashtable kSpecialCasesRepIDs = new Hashtable();
++    private static final Hashtable kSpecialCasesRepIDs = new Hashtable();
+ 
+     static {
+         kSpecialCasesRepIDs.put(java.lang.String.class, kWStringValueRepID);
+@@ -215,7 +215,7 @@
+         kSpecialCasesRepIDs.put(java.rmi.Remote.class, kRemoteValueRepID);
+     }
+ 
+-    public static final Hashtable kSpecialCasesStubValues = new Hashtable();
++    private static final Hashtable kSpecialCasesStubValues = new Hashtable();
+ 
+     static {
+         kSpecialCasesStubValues.put(java.lang.String.class, kWStringStubValue);
+@@ -227,7 +227,7 @@
+     }
+ 
+ 
+-    public static final Hashtable kSpecialCasesVersions = new Hashtable();
++    private static final Hashtable kSpecialCasesVersions = new Hashtable();
+ 
+     static {
+         kSpecialCasesVersions.put(java.lang.String.class, kWStringValueHash);
+@@ -238,7 +238,7 @@
+         kSpecialCasesVersions.put(java.rmi.Remote.class, kRemoteValueHash);
+     }
+ 
+-    public static final Hashtable kSpecialCasesClasses = new Hashtable();
++    private static final Hashtable kSpecialCasesClasses = new Hashtable();
+ 
+     static {
+         kSpecialCasesClasses.put(kWStringTypeStr, java.lang.String.class);
+@@ -250,7 +250,7 @@
+         //kSpecialCasesClasses.put(kRemoteTypeStr, java.rmi.Remote.class);
+     }
+ 
+-    public static final Hashtable kSpecialCasesArrayPrefix = new Hashtable();
++    private static final Hashtable kSpecialCasesArrayPrefix = new Hashtable();
+ 
+     static {
+         kSpecialCasesArrayPrefix.put(java.lang.String.class, kValuePrefix + kSequencePrefix + kCORBAPrefix);
+@@ -261,7 +261,7 @@
+         kSpecialCasesArrayPrefix.put(java.rmi.Remote.class, kValuePrefix + kSequencePrefix + kCORBAPrefix);
+     }
+ 
+-    public static final Hashtable kSpecialPrimitives = new Hashtable();
++    private static final Hashtable kSpecialPrimitives = new Hashtable();
+ 
+     static {
+         kSpecialPrimitives.put("int","long");
+diff --git a/src/share/classes/com/sun/corba/se/impl/protocol/LocalClientRequestDispatcherBase.java b/src/share/classes/com/sun/corba/se/impl/protocol/LocalClientRequestDispatcherBase.java
+--- openjdk/corba/src/share/classes/com/sun/corba/se/impl/protocol/LocalClientRequestDispatcherBase.java
++++ openjdk/corba/src/share/classes/com/sun/corba/se/impl/protocol/LocalClientRequestDispatcherBase.java
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2002, 2003, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 2002, 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
+@@ -52,7 +52,7 @@
+ 
+     // If isNextIsLocalValid.get() == Boolean.TRUE,
+     // the next call to isLocal should be valid
+-    protected static ThreadLocal isNextCallValid = new ThreadLocal() {
++    private static final ThreadLocal isNextCallValid = new ThreadLocal() {
+             protected synchronized Object initialValue() {
+                 return Boolean.TRUE;
+             }
+diff --git a/src/share/classes/com/sun/corba/se/impl/util/RepositoryId.java b/src/share/classes/com/sun/corba/se/impl/util/RepositoryId.java
+--- openjdk/corba/src/share/classes/com/sun/corba/se/impl/util/RepositoryId.java
++++ openjdk/corba/src/share/classes/com/sun/corba/se/impl/util/RepositoryId.java
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 1998, 2004, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 1998, 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
+@@ -57,7 +57,7 @@
+     // uniformly, and is safe because that is the only
+     // legal use of '.' in a Java name.
+ 
+-    public static final byte[] IDL_IDENTIFIER_CHARS = {
++    private static final byte[] IDL_IDENTIFIER_CHARS = {
+ 
+         // 0 1 2 3  4 5 6 7  8 9 a b  c d e f
+         0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, // 00-0f
+@@ -95,7 +95,7 @@
+     private static IdentityHashtable classIDLToRepStr = new IdentityHashtable();
+     private static IdentityHashtable classSeqToRepStr = new IdentityHashtable();
+ 
+-    private static IdentityHashtable repStrToByteArray = new IdentityHashtable();
++    private static final IdentityHashtable repStrToByteArray = new IdentityHashtable();
+     private static Hashtable repStrToClass = new Hashtable();
+ 
+     private String repId = null;
+@@ -192,7 +192,7 @@
+     public static final String kRemoteTypeStr = "";
+     public static final String kRemoteValueRepID = "";
+ 
+-    public static final Hashtable kSpecialArrayTypeStrings = new Hashtable();
++    private static final Hashtable kSpecialArrayTypeStrings = new Hashtable();
+ 
+     static {
+         kSpecialArrayTypeStrings.put("CORBA.WStringValue", new StringBuffer(java.lang.String.class.getName()));
+@@ -201,7 +201,7 @@
+ 
+     }
+ 
+-    public static final Hashtable kSpecialCasesRepIDs = new Hashtable();
++    private static final Hashtable kSpecialCasesRepIDs = new Hashtable();
+ 
+     static {
+         kSpecialCasesRepIDs.put(java.lang.String.class, kWStringValueRepID);
+@@ -209,7 +209,7 @@
+         kSpecialCasesRepIDs.put(java.rmi.Remote.class, kRemoteValueRepID);
+     }
+ 
+-    public static final Hashtable kSpecialCasesStubValues = new Hashtable();
++    private static final Hashtable kSpecialCasesStubValues = new Hashtable();
+ 
+     static {
+         kSpecialCasesStubValues.put(java.lang.String.class, kWStringStubValue);
+@@ -221,7 +221,7 @@
+     }
+ 
+ 
+-    public static final Hashtable kSpecialCasesVersions = new Hashtable();
++    private static final Hashtable kSpecialCasesVersions = new Hashtable();
+ 
+     static {
+         kSpecialCasesVersions.put(java.lang.String.class, kWStringValueHash);
+@@ -232,7 +232,7 @@
+         kSpecialCasesVersions.put(java.rmi.Remote.class, kRemoteValueHash);
+     }
+ 
+-    public static final Hashtable kSpecialCasesClasses = new Hashtable();
++    private static final Hashtable kSpecialCasesClasses = new Hashtable();
+ 
+     static {
+         kSpecialCasesClasses.put(kWStringTypeStr, java.lang.String.class);
+@@ -244,7 +244,7 @@
+         //kSpecialCasesClasses.put(kRemoteTypeStr, java.rmi.Remote.class);
+     }
+ 
+-    public static final Hashtable kSpecialCasesArrayPrefix = new Hashtable();
++    private static final Hashtable kSpecialCasesArrayPrefix = new Hashtable();
+ 
+     static {
+         kSpecialCasesArrayPrefix.put(java.lang.String.class, kValuePrefix + kSequencePrefix + kCORBAPrefix);
+@@ -255,7 +255,7 @@
+         kSpecialCasesArrayPrefix.put(java.rmi.Remote.class, kValuePrefix + kSequencePrefix + kCORBAPrefix);
+     }
+ 
+-    public static final Hashtable kSpecialPrimitives = new Hashtable();
++    private static final Hashtable kSpecialPrimitives = new Hashtable();
+ 
+     static {
+         kSpecialPrimitives.put("int","long");
+diff --git a/src/share/classes/com/sun/corba/se/spi/logging/CORBALogDomains.java b/src/share/classes/com/sun/corba/se/spi/logging/CORBALogDomains.java
+--- openjdk/corba/src/share/classes/com/sun/corba/se/spi/logging/CORBALogDomains.java
++++ openjdk/corba/src/share/classes/com/sun/corba/se/spi/logging/CORBALogDomains.java
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 2003, 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
+@@ -58,7 +58,7 @@
+     private CORBALogDomains() {}
+ 
+     // Top level log domain for CORBA
+-    public static String TOP_LEVEL_DOMAIN  = "javax.enterprise.resource.corba";
++    public static final String TOP_LEVEL_DOMAIN  = "javax.enterprise.resource.corba";
+ 
+     public static final String RPC              = "rpc" ;
+ 
+diff --git a/src/share/classes/sun/rmi/rmic/iiop/IDLNames.java b/src/share/classes/sun/rmi/rmic/iiop/IDLNames.java
+--- openjdk/corba/src/share/classes/sun/rmi/rmic/iiop/IDLNames.java
++++ openjdk/corba/src/share/classes/sun/rmi/rmic/iiop/IDLNames.java
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 1998, 2007, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 1998, 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
+@@ -71,6 +71,34 @@
+         (byte)'F',
+     };
+ 
++    // Legal IDL Identifier characters (1 = legal). Note
++    // that '.' (2E) is marked as legal even though it is
++    // not legal in IDL. This allows us to treat a fully
++    // qualified Java name with '.' package separators
++    // uniformly, and is safe because that is the only
++    // legal use of '.' in a Java name.
++
++    private static final byte[] IDL_IDENTIFIER_CHARS = {
++
++        // 0 1 2 3  4 5 6 7  8 9 a b  c d e f
++        0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, // 00-0f
++        0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, // 10-1f
++        0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,1,0, // 20-2f
++        1,1,1,1, 1,1,1,1, 1,1,0,0, 0,0,0,0, // 30-3f
++        0,1,1,1, 1,1,1,1, 1,1,1,1, 1,1,1,1, // 40-4f
++        1,1,1,1, 1,1,1,1, 1,1,1,0, 0,0,0,1, // 50-5f
++        0,1,1,1, 1,1,1,1, 1,1,1,1, 1,1,1,1, // 60-6f
++        1,1,1,1, 1,1,1,1, 1,1,1,0, 0,0,0,0, // 70-7f
++        0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, // 80-8f
++        0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, // 90-9f
++        0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, // a0-af
++        0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, // b0-bf
++        1,1,1,1, 1,1,1,1, 1,1,1,1, 1,1,1,1, // c0-cf
++        0,1,1,1, 1,1,1,0, 1,1,1,1, 1,0,0,1, // d0-df
++        1,1,1,1, 1,1,1,1, 1,1,1,1, 1,1,1,1, // e0-ef
++        0,1,1,1, 1,1,1,0, 1,1,1,1, 1,0,0,1, // f0-ff
++    };
++
+     //_____________________________________________________________________
+     // Public Interfaces
+     //_____________________________________________________________________
+@@ -139,7 +167,7 @@
+         result = replace(result,"x\\U","U");
+ 
+         // Now see if we have any remaining illegal characters (see
+-        // RepositoryId.IDL_IDENTIFIER_CHARS array)...
++        // IDL_IDENTIFIER_CHARS array)...
+ 
+         int length = result.length();
+         StringBuffer buffer = null;
+@@ -148,7 +176,7 @@
+ 
+             char c = result.charAt(i);
+ 
+-            if (c > 255 || RepositoryId.IDL_IDENTIFIER_CHARS[c] == 0) {
++            if (c > 255 || IDL_IDENTIFIER_CHARS[c] == 0) {
+ 
+                 // We gotta convert. Have we already started?
+ 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/security/20120612/7143606.patch	Fri Jun 08 14:23:28 2012 +0100
@@ -0,0 +1,640 @@
+diff -Nru openjdk.orig/jdk/src/share/classes/com/sun/java/util/jar/pack/Driver.java openjdk/jdk/src/share/classes/com/sun/java/util/jar/pack/Driver.java
+--- openjdk.orig/jdk/src/share/classes/com/sun/java/util/jar/pack/Driver.java	2011-02-28 16:06:15.000000000 +0000
++++ openjdk/jdk/src/share/classes/com/sun/java/util/jar/pack/Driver.java	2012-06-08 00:21:54.885628274 +0100
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2003, 2005, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 2003, 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
+@@ -354,8 +354,7 @@
+             where = new File(".").getAbsoluteFile();
+ 
+ 
+-        File f = File.createTempFile(prefix, suffix, where);
+-        return f;
++        return sun.misc.IOUtils.createTempFile(prefix, suffix, where);
+     }
+ 
+     static private
+diff -Nru openjdk.orig/jdk/src/share/classes/java/awt/Font.java openjdk/jdk/src/share/classes/java/awt/Font.java
+--- openjdk.orig/jdk/src/share/classes/java/awt/Font.java	2011-02-28 16:06:20.000000000 +0000
++++ openjdk/jdk/src/share/classes/java/awt/Font.java	2012-06-08 00:21:54.893628402 +0100
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 1995, 2010, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 1995, 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
+@@ -809,7 +809,7 @@
+         File f = null;
+         boolean hasPerm = false;
+         try {
+-            f = File.createTempFile("+~JT", ".tmp", null);
++            f = sun.misc.IOUtils.createTempFile("+~JT", ".tmp", null);
+             f.delete();
+             f = null;
+             hasPerm = true;
+@@ -860,7 +860,7 @@
+             final File tFile = AccessController.doPrivileged(
+                 new PrivilegedExceptionAction<File>() {
+                     public File run() throws IOException {
+-                        return File.createTempFile("+~JF", ".tmp", null);
++                        return sun.misc.IOUtils.createTempFile("+~JF", ".tmp", null);
+                     }
+                 }
+             );
+diff -Nru openjdk.orig/jdk/src/share/classes/java/io/File.java openjdk/jdk/src/share/classes/java/io/File.java
+--- openjdk.orig/jdk/src/share/classes/java/io/File.java	2011-02-28 16:06:21.000000000 +0000
++++ openjdk/jdk/src/share/classes/java/io/File.java	2012-06-08 00:21:54.893628402 +0100
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 1994, 2007, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 1994, 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
+@@ -897,7 +897,7 @@
+     public boolean createNewFile() throws IOException {
+         SecurityManager security = System.getSecurityManager();
+         if (security != null) security.checkWrite(path);
+-        return fs.createFileExclusively(path);
++        return fs.createFileExclusively(path, false);
+     }
+ 
+     /**
+@@ -1700,7 +1700,8 @@
+         return new File(dir, prefix + Long.toString(n) + suffix);
+     }
+ 
+-    private static boolean checkAndCreate(String filename, SecurityManager sm)
++    private static boolean checkAndCreate(String filename, SecurityManager sm,
++                                          boolean restrictive)
+         throws IOException
+     {
+         if (sm != null) {
+@@ -1713,7 +1714,29 @@
+                 throw new SecurityException("Unable to create temporary file");
+             }
+         }
+-        return fs.createFileExclusively(filename);
++        return fs.createFileExclusively(filename, restrictive);
++    }
++    
++    // The resulting temporary file may have more restrictive access permission
++    // on some platforms, if restrictive is true.
++    private static File createTempFile0(String prefix, String suffix,
++                                        File directory, boolean restrictive)
++        throws IOException
++    {
++        if (prefix == null) throw new NullPointerException();
++        if (prefix.length() < 3)
++            throw new IllegalArgumentException("Prefix string too short");
++        String s = (suffix == null) ? ".tmp" : suffix;
++        if (directory == null) {
++            String tmpDir = LazyInitialization.temporaryDirectory();
++            directory = new File(tmpDir, fs.prefixLength(tmpDir));
++        }
++        SecurityManager sm = System.getSecurityManager();
++        File f;
++        do {
++            f = generateFile(prefix, s, directory);
++        } while (!checkAndCreate(f.getPath(), sm, restrictive));
++        return f;
+     }
+ 
+     /**
+@@ -1789,20 +1812,7 @@
+                                       File directory)
+         throws IOException
+     {
+-        if (prefix == null) throw new NullPointerException();
+-        if (prefix.length() < 3)
+-            throw new IllegalArgumentException("Prefix string too short");
+-        String s = (suffix == null) ? ".tmp" : suffix;
+-        if (directory == null) {
+-            String tmpDir = LazyInitialization.temporaryDirectory();
+-            directory = new File(tmpDir, fs.prefixLength(tmpDir));
+-        }
+-        SecurityManager sm = System.getSecurityManager();
+-        File f;
+-        do {
+-            f = generateFile(prefix, s, directory);
+-        } while (!checkAndCreate(f.getPath(), sm));
+-        return f;
++        return createTempFile0(prefix, suffix, directory, false);
+     }
+ 
+     /**
+@@ -1837,7 +1847,7 @@
+     public static File createTempFile(String prefix, String suffix)
+         throws IOException
+     {
+-        return createTempFile(prefix, suffix, null);
++        return createTempFile0(prefix, suffix, null, false);
+     }
+ 
+ 
+@@ -1959,6 +1969,15 @@
+             }
+         );
+     }
+-
+-
++    
++    // Set up JavaIOAccess in SharedSecrets
++    static {
++        sun.misc.SharedSecrets.setJavaIOFileAccess(new sun.misc.JavaIOFileAccess() {
++            public File createTempFile(String prefix, String suffix, File directory)
++                throws IOException
++            {
++                return createTempFile0(prefix, suffix, directory, true);
++            }
++        });
++    }
+ }
+diff -Nru openjdk.orig/jdk/src/share/classes/java/io/FileSystem.java openjdk/jdk/src/share/classes/java/io/FileSystem.java
+--- openjdk.orig/jdk/src/share/classes/java/io/FileSystem.java	2011-02-28 16:06:21.000000000 +0000
++++ openjdk/jdk/src/share/classes/java/io/FileSystem.java	2012-06-08 00:21:54.893628402 +0100
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 1998, 2005, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 1998, 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
+@@ -157,8 +157,13 @@
+      * <code>true</code> if the file was created and <code>false</code> if a
+      * file or directory with the given pathname already exists.  Throw an
+      * IOException if an I/O error occurs.
++     *
++     * <p>
++     * The resulting file may have more restrictive access permission
++     * on some platforms, if restrictive is true. 
+      */
+-    public abstract boolean createFileExclusively(String pathname)
++    public abstract boolean createFileExclusively(String pathname,
++                                                  boolean restrictive)
+         throws IOException;
+ 
+     /**
+diff -Nru openjdk.orig/jdk/src/share/classes/javax/imageio/stream/FileCacheImageInputStream.java openjdk/jdk/src/share/classes/javax/imageio/stream/FileCacheImageInputStream.java
+--- openjdk.orig/jdk/src/share/classes/javax/imageio/stream/FileCacheImageInputStream.java	2011-02-28 16:06:25.000000000 +0000
++++ openjdk/jdk/src/share/classes/javax/imageio/stream/FileCacheImageInputStream.java	2012-06-08 00:21:54.893628402 +0100
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2000, 2007, 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
+@@ -98,7 +98,7 @@
+         }
+         this.stream = stream;
+         this.cacheFile =
+-            File.createTempFile("imageio", ".tmp", cacheDir);
++            sun.misc.IOUtils.createTempFile("imageio", ".tmp", cacheDir);
+         this.cache = new RandomAccessFile(cacheFile, "rw");
+ 
+         this.closeAction = StreamCloser.createCloseAction(this);
+diff -Nru openjdk.orig/jdk/src/share/classes/javax/imageio/stream/FileCacheImageOutputStream.java openjdk/jdk/src/share/classes/javax/imageio/stream/FileCacheImageOutputStream.java
+--- openjdk.orig/jdk/src/share/classes/javax/imageio/stream/FileCacheImageOutputStream.java	2011-02-28 16:06:25.000000000 +0000
++++ openjdk/jdk/src/share/classes/javax/imageio/stream/FileCacheImageOutputStream.java	2012-06-08 00:21:54.893628402 +0100
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2000, 2007, 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
+@@ -84,7 +84,7 @@
+         }
+         this.stream = stream;
+         this.cacheFile =
+-            File.createTempFile("imageio", ".tmp", cacheDir);
++            sun.misc.IOUtils.createTempFile("imageio", ".tmp", cacheDir);
+         this.cache = new RandomAccessFile(cacheFile, "rw");
+ 
+         this.closeAction = StreamCloser.createCloseAction(this);
+diff -Nru openjdk.orig/jdk/src/share/classes/javax/management/loading/MLet.java openjdk/jdk/src/share/classes/javax/management/loading/MLet.java
+--- openjdk.orig/jdk/src/share/classes/javax/management/loading/MLet.java	2011-02-28 16:06:25.000000000 +0000
++++ openjdk/jdk/src/share/classes/javax/management/loading/MLet.java	2012-06-08 00:21:54.893628402 +0100
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 1999, 2007, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 1999, 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
+@@ -1152,7 +1152,7 @@
+              if (is != null) {
+                  File directory = new File(libraryDirectory);
+                  directory.mkdirs();
+-                 File file = File.createTempFile(libname + ".", null, directory);
++                 File file = sun.misc.IOUtils.createTempFile(libname + ".", null, directory);
+                  file.deleteOnExit();
+                  FileOutputStream fileOutput = new FileOutputStream(file);
+                  int c;
+diff -Nru openjdk.orig/jdk/src/share/classes/sun/misc/IOUtils.java openjdk/jdk/src/share/classes/sun/misc/IOUtils.java
+--- openjdk.orig/jdk/src/share/classes/sun/misc/IOUtils.java	2011-02-28 16:06:34.000000000 +0000
++++ openjdk/jdk/src/share/classes/sun/misc/IOUtils.java	2012-06-08 00:21:54.893628402 +0100
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 2009, 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
+@@ -30,6 +30,7 @@
+ package sun.misc;
+ 
+ import java.io.EOFException;
++import java.io.File;
+ import java.io.IOException;
+ import java.io.InputStream;
+ import java.util.Arrays;
+@@ -77,4 +78,37 @@
+         }
+         return output;
+     }
++    
++    /*
++     * <p> Creates a new empty file in the specified directory, using the
++     * given prefix and suffix strings to generate its name. The resulting
++     * temporary file may have more restrictive access permission on some
++     * platforms.
++     *
++     * @param  prefix     The prefix string to be used in generating the file's
++     *                    name; must be at least three characters long
++     *
++     * @param  suffix     The suffix string to be used in generating the file's
++     *                    name; may be <code>null</code>, in which case the
++     *                    suffix <code>".tmp"</code> will be used
++     *
++     * @param  directory  The directory in which the file is to be created, or
++     *                    <code>null</code> if the default temporary-file
++     *                    directory is to be used
++     *
++     * @return  An abstract pathname denoting a newly-created empty file
++     *
++     * @see java.io.File#createTempFile(String,String,java.io.File)
++     */
++    public static File createTempFile(String prefix, String suffix, File directory)
++        throws IOException
++    {
++        return SharedSecrets.getJavaIOFileAccess().createTempFile(prefix, suffix, directory);
++    }
++
++    public static File createTempFile(String prefix, String suffix)
++        throws IOException
++    {
++        return SharedSecrets.getJavaIOFileAccess().createTempFile(prefix, suffix, null);
++    }
+ }
+diff -Nru openjdk.orig/jdk/src/share/classes/sun/misc/JavaIOFileAccess.java openjdk/jdk/src/share/classes/sun/misc/JavaIOFileAccess.java
+--- openjdk.orig/jdk/src/share/classes/sun/misc/JavaIOFileAccess.java	1970-01-01 01:00:00.000000000 +0100
++++ openjdk/jdk/src/share/classes/sun/misc/JavaIOFileAccess.java	2012-06-08 00:21:54.893628402 +0100
+@@ -0,0 +1,35 @@
++/*
++ * Copyright (c) 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
++ * under the terms of the GNU General Public License version 2 only, as
++ * published by the Free Software Foundation.  Oracle designates this
++ * particular file as subject to the "Classpath" exception as provided
++ * by Oracle in the LICENSE file that accompanied this code.
++ *
++ * This code is distributed in the hope that it will be useful, but WITHOUT
++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
++ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
++ * version 2 for more details (a copy is included in the LICENSE file that
++ * accompanied this code).
++ *
++ * You should have received a copy of the GNU General Public License version
++ * 2 along with this work; if not, write to the Free Software Foundation,
++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
++ *
++ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
++ * or visit www.oracle.com if you need additional information or have any
++ * questions.
++ */
++
++package sun.misc;
++
++import java.io.File;
++import java.io.IOException;
++
++public interface JavaIOFileAccess {
++    public File createTempFile(String prefix, String suffix, File directory)
++        throws IOException;
++}
++
+diff -Nru openjdk.orig/jdk/src/share/classes/sun/misc/SharedSecrets.java openjdk/jdk/src/share/classes/sun/misc/SharedSecrets.java
+--- openjdk.orig/jdk/src/share/classes/sun/misc/SharedSecrets.java	2012-06-08 00:17:20.965183183 +0100
++++ openjdk/jdk/src/share/classes/sun/misc/SharedSecrets.java	2012-06-08 00:22:15.413961526 +0100
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 2002, 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
+@@ -53,6 +53,7 @@
+     private static JavaSecurityProtectionDomainAccess javaSecurityProtectionDomainAccess;
+     private static JavaSecurityAccess javaSecurityAccess;
+     private static JavaAWTAccess javaAWTAccess;
++    private static JavaIOFileAccess javaIOFileAccess;
+ 
+     public static JavaUtilJarAccess javaUtilJarAccess() {
+         if (javaUtilJarAccess == null) {
+@@ -145,8 +146,16 @@
+     }
+ 
+     public static JavaAWTAccess getJavaAWTAccess() {
+-        // this may return null in which case calling code needs to 
++        // this may return null in which case calling code needs to
+         // provision for.
+         return javaAWTAccess;
+     }
++
++    public static void setJavaIOFileAccess(JavaIOFileAccess access) {
++        javaIOFileAccess = access;
++    }
++
++    public static JavaIOFileAccess getJavaIOFileAccess() {
++        return javaIOFileAccess;
++    }
+ }
+diff -Nru openjdk.orig/jdk/src/share/classes/sun/net/www/protocol/jar/URLJarFile.java openjdk/jdk/src/share/classes/sun/net/www/protocol/jar/URLJarFile.java
+--- openjdk.orig/jdk/src/share/classes/sun/net/www/protocol/jar/URLJarFile.java	2011-02-28 16:06:34.000000000 +0000
++++ openjdk/jdk/src/share/classes/sun/net/www/protocol/jar/URLJarFile.java	2012-06-08 00:21:54.893628402 +0100
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2001, 2006, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 2001, 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
+@@ -219,7 +219,7 @@
+                             OutputStream out = null;
+                             File tmpFile = null;
+                             try {
+-                                tmpFile = File.createTempFile("jar_cache", null);
++                                tmpFile = sun.misc.IOUtils.createTempFile("jar_cache", null);
+                                 tmpFile.deleteOnExit();
+                                 out  = new FileOutputStream(tmpFile);
+                                 int read = 0;
+diff -Nru openjdk.orig/jdk/src/share/classes/sun/print/PSPrinterJob.java openjdk/jdk/src/share/classes/sun/print/PSPrinterJob.java
+--- openjdk.orig/jdk/src/share/classes/sun/print/PSPrinterJob.java	2011-02-28 16:06:37.000000000 +0000
++++ openjdk/jdk/src/share/classes/sun/print/PSPrinterJob.java	2012-06-08 00:21:54.893628402 +0100
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 1998, 2007, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 1998, 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
+@@ -652,7 +652,7 @@
+                      * is not removed for some reason, request that it is
+                      * removed when the VM exits.
+                      */
+-                    spoolFile = File.createTempFile("javaprint", ".ps", null);
++                    spoolFile = sun.misc.IOUtils.createTempFile("javaprint", ".ps", null);
+                     spoolFile.deleteOnExit();
+ 
+                 result = new FileOutputStream(spoolFile);
+diff -Nru openjdk.orig/jdk/src/share/classes/sun/rmi/server/Activation.java openjdk/jdk/src/share/classes/sun/rmi/server/Activation.java
+--- openjdk.orig/jdk/src/share/classes/sun/rmi/server/Activation.java	2011-02-28 16:06:38.000000000 +0000
++++ openjdk/jdk/src/share/classes/sun/rmi/server/Activation.java	2012-06-08 00:21:54.893628402 +0100
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 1997, 2006, 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
+@@ -1916,7 +1916,7 @@
+                     new PrivilegedExceptionAction<Void>() {
+                         public Void run() throws IOException {
+                             File file =
+-                                File.createTempFile("rmid-err", null, null);
++                                sun.misc.IOUtils.createTempFile("rmid-err", null, null);
+                             PrintStream errStream =
+                                 new PrintStream(new FileOutputStream(file));
+                             System.setErr(errStream);
+diff -Nru openjdk.orig/jdk/src/share/classes/sun/tools/jar/Main.java openjdk/jdk/src/share/classes/sun/tools/jar/Main.java
+--- openjdk.orig/jdk/src/share/classes/sun/tools/jar/Main.java	2011-02-28 16:06:41.000000000 +0000
++++ openjdk/jdk/src/share/classes/sun/tools/jar/Main.java	2012-06-08 00:21:54.893628402 +0100
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 1996, 2007, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 1996, 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
+@@ -127,14 +127,14 @@
+ 
+     /**
+      * Creates a new empty temporary file in the same directory as the
+-     * specified file.  A variant of File.createTempFile.
++     * specified file.  A variant of sun.misc.IOUtils.createTempFile.
+      */
+     private static File createTempFileInSameDirectoryAs(File file)
+         throws IOException {
+         File dir = file.getParentFile();
+         if (dir == null)
+             dir = new File(".");
+-        return File.createTempFile("jartmp", null, dir);
++        return sun.misc.IOUtils.createTempFile("jartmp", null, dir);
+     }
+ 
+     private boolean ok;
+diff -Nru openjdk.orig/jdk/src/share/classes/sun/tools/native2ascii/Main.java openjdk/jdk/src/share/classes/sun/tools/native2ascii/Main.java
+--- openjdk.orig/jdk/src/share/classes/sun/tools/native2ascii/Main.java	2011-02-28 16:06:41.000000000 +0000
++++ openjdk/jdk/src/share/classes/sun/tools/native2ascii/Main.java	2012-06-08 00:21:54.893628402 +0100
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 1996, 2007, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 1996, 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
+@@ -237,9 +237,7 @@
+             if (tempDir == null)
+                 tempDir = new File(System.getProperty("user.dir"));
+ 
+-            tempFile = File.createTempFile("_N2A",
+-                                           ".TMP",
+-                                            tempDir);
++            tempFile = sun.misc.IOUtils.createTempFile("_N2A", ".TMP", tempDir);
+             tempFile.deleteOnExit();
+ 
+             try {
+diff -Nru openjdk.orig/jdk/src/solaris/classes/java/io/UnixFileSystem.java openjdk/jdk/src/solaris/classes/java/io/UnixFileSystem.java
+--- openjdk.orig/jdk/src/solaris/classes/java/io/UnixFileSystem.java	2011-02-28 16:06:47.000000000 +0000
++++ openjdk/jdk/src/solaris/classes/java/io/UnixFileSystem.java	2012-06-08 00:21:54.893628402 +0100
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 1998, 2005, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 1998, 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
+@@ -253,7 +253,7 @@
+ 
+     /* -- File operations -- */
+ 
+-    public native boolean createFileExclusively(String path)
++    public native boolean createFileExclusively(String path, boolean restrictive)
+         throws IOException;
+     public boolean delete(File f) {
+         // Keep canonicalization caches in sync after file deletion
+diff -Nru openjdk.orig/jdk/src/solaris/classes/sun/print/UnixPrintJob.java openjdk/jdk/src/solaris/classes/sun/print/UnixPrintJob.java
+--- openjdk.orig/jdk/src/solaris/classes/sun/print/UnixPrintJob.java	2011-02-28 16:06:49.000000000 +0000
++++ openjdk/jdk/src/solaris/classes/sun/print/UnixPrintJob.java	2012-06-08 00:21:54.893628402 +0100
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2000, 2004, 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
+@@ -937,7 +937,7 @@
+                      * is not removed for some reason, request that it is
+                      * removed when the VM exits.
+                      */
+-                    spoolFile = File.createTempFile("javaprint", ".ps", null);
++                    spoolFile = sun.misc.IOUtils.createTempFile("javaprint", ".ps", null);
+                     spoolFile.deleteOnExit();
+                 }
+                 result = new FileOutputStream(spoolFile);
+diff -Nru openjdk.orig/jdk/src/solaris/classes/sun/print/UnixPrintServiceLookup.java openjdk/jdk/src/solaris/classes/sun/print/UnixPrintServiceLookup.java
+--- openjdk.orig/jdk/src/solaris/classes/sun/print/UnixPrintServiceLookup.java	2011-02-28 16:06:49.000000000 +0000
++++ openjdk/jdk/src/solaris/classes/sun/print/UnixPrintServiceLookup.java	2012-06-08 00:21:54.897628467 +0100
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2000, 2006, 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
+@@ -712,7 +712,7 @@
+ 
+                         Process proc;
+                         BufferedReader bufferedReader = null;
+-                        File f = File.createTempFile("prn","xc");
++                        File f = sun.misc.IOUtils.createTempFile("prn","xc");
+                         cmd[2] = cmd[2]+">"+f.getAbsolutePath();
+ 
+                         proc = Runtime.getRuntime().exec(cmd);
+diff -Nru openjdk.orig/jdk/src/solaris/native/java/io/UnixFileSystem_md.c openjdk/jdk/src/solaris/native/java/io/UnixFileSystem_md.c
+--- openjdk.orig/jdk/src/solaris/native/java/io/UnixFileSystem_md.c	2011-02-28 16:06:49.000000000 +0000
++++ openjdk/jdk/src/solaris/native/java/io/UnixFileSystem_md.c	2012-06-08 00:21:54.897628467 +0100
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 1998, 2006, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 1998, 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
+@@ -310,7 +310,8 @@
+ 
+ JNIEXPORT jboolean JNICALL
+ Java_java_io_UnixFileSystem_createFileExclusively(JNIEnv *env, jclass cls,
+-                                                  jstring pathname)
++                                                  jstring pathname,
++                                                  jboolean restrictive)
+ {
+     jboolean rv = JNI_FALSE;
+ 
+@@ -319,7 +320,8 @@
+         if (!strcmp (path, "/")) {
+             fd = JVM_EEXIST;    /* The root directory always exists */
+         } else {
+-            fd = JVM_Open(path, JVM_O_RDWR | JVM_O_CREAT | JVM_O_EXCL, 0666);
++            jint mode = (restrictive == JNI_TRUE) ? 0600 : 0666;
++            fd = JVM_Open(path, JVM_O_RDWR | JVM_O_CREAT | JVM_O_EXCL, mode);
+         }
+         if (fd < 0) {
+             if (fd != JVM_EEXIST) {
+diff -Nru openjdk.orig/jdk/src/windows/classes/java/io/Win32FileSystem.java openjdk/jdk/src/windows/classes/java/io/Win32FileSystem.java
+--- openjdk.orig/jdk/src/windows/classes/java/io/Win32FileSystem.java	2011-02-28 16:06:51.000000000 +0000
++++ openjdk/jdk/src/windows/classes/java/io/Win32FileSystem.java	2012-06-08 00:21:54.897628467 +0100
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 1998, 2005, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 1998, 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
+@@ -510,7 +510,7 @@
+ 
+     /* -- File operations -- */
+ 
+-    public native boolean createFileExclusively(String path)
++    public native boolean createFileExclusively(String path, boolean restrictive)
+         throws IOException;
+     public boolean delete(File f) {
+         // Keep canonicalization caches in sync after file deletion
+diff -Nru openjdk.orig/jdk/src/windows/classes/java/io/WinNTFileSystem.java openjdk/jdk/src/windows/classes/java/io/WinNTFileSystem.java
+--- openjdk.orig/jdk/src/windows/classes/java/io/WinNTFileSystem.java	2011-02-28 16:06:51.000000000 +0000
++++ openjdk/jdk/src/windows/classes/java/io/WinNTFileSystem.java	2012-06-08 00:21:54.897628467 +0100
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2001, 2006, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 2001, 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
+@@ -61,7 +61,7 @@
+ 
+     /* -- File operations -- */
+ 
+-    public native boolean createFileExclusively(String path)
++    public native boolean createFileExclusively(String path, boolean restrictive)
+                                                throws IOException;
+     protected native boolean delete0(File f);
+     public native String[] list(File f);
+diff -Nru openjdk.orig/jdk/src/windows/native/java/io/Win32FileSystem_md.c openjdk/jdk/src/windows/native/java/io/Win32FileSystem_md.c
+--- openjdk.orig/jdk/src/windows/native/java/io/Win32FileSystem_md.c	2011-02-28 16:06:51.000000000 +0000
++++ openjdk/jdk/src/windows/native/java/io/Win32FileSystem_md.c	2012-06-08 00:21:54.897628467 +0100
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 1998, 2006, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 1998, 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
+@@ -262,7 +262,8 @@
+ 
+ JNIEXPORT jboolean JNICALL
+ Java_java_io_Win32FileSystem_createFileExclusively(JNIEnv *env, jclass cls,
+-                                                   jstring pathname)
++                                                   jstring pathname,
++                                                   jboolean restrictive)
+ {
+     jboolean rv = JNI_FALSE;
+     DWORD a;
+diff -Nru openjdk.orig/jdk/src/windows/native/java/io/WinNTFileSystem_md.c openjdk/jdk/src/windows/native/java/io/WinNTFileSystem_md.c
+--- openjdk.orig/jdk/src/windows/native/java/io/WinNTFileSystem_md.c	2011-02-28 16:06:51.000000000 +0000
++++ openjdk/jdk/src/windows/native/java/io/WinNTFileSystem_md.c	2012-06-08 00:21:54.897628467 +0100
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2001, 2006, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 2001, 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
+@@ -349,7 +349,8 @@
+ 
+ JNIEXPORT jboolean JNICALL
+ Java_java_io_WinNTFileSystem_createFileExclusively(JNIEnv *env, jclass cls,
+-                                                   jstring path)
++                                                   jstring path,
++                                                   jboolean restrictive)
+ {
+     HANDLE h = NULL;
+     WCHAR *pathbuf = pathToNTPath(env, path, JNI_FALSE);
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/security/20120612/7143614.patch	Fri Jun 08 14:23:28 2012 +0100
@@ -0,0 +1,165 @@
+# HG changeset patch
+# User rupashka
+# Date 1330366708 -7200
+# Node ID 7047bf04103450562b485e00c622fea18b227eea
+# Parent  fec31f67f89f877945d3fd9c827ecbaf55c6c924
+7143614: SynthLookAndFeel stability improvement
+Reviewed-by: malenkov
+
+diff --git a/src/share/classes/javax/swing/plaf/synth/SynthButtonUI.java b/src/share/classes/javax/swing/plaf/synth/SynthButtonUI.java
+--- openjdk/jdk/src/share/classes/javax/swing/plaf/synth/SynthButtonUI.java
++++ openjdk/jdk/src/share/classes/javax/swing/plaf/synth/SynthButtonUI.java
+@@ -135,8 +135,8 @@
+         if (!c.isEnabled()) {
+             state = DISABLED;
+         }
+-        if (SynthLookAndFeel.selectedUI == this) {
+-            return SynthLookAndFeel.selectedUIState | SynthConstants.ENABLED;
++        if (SynthLookAndFeel.getSelectedUI() == this) {
++            return SynthLookAndFeel.getSelectedUIState() | SynthConstants.ENABLED;
+         }
+         AbstractButton button = (AbstractButton) c;
+         ButtonModel model = button.getModel();
+diff --git a/src/share/classes/javax/swing/plaf/synth/SynthLabelUI.java b/src/share/classes/javax/swing/plaf/synth/SynthLabelUI.java
+--- openjdk/jdk/src/share/classes/javax/swing/plaf/synth/SynthLabelUI.java
++++ openjdk/jdk/src/share/classes/javax/swing/plaf/synth/SynthLabelUI.java
+@@ -94,9 +94,9 @@
+ 
+     private int getComponentState(JComponent c) {
+         int state = SynthLookAndFeel.getComponentState(c);
+-        if (SynthLookAndFeel.selectedUI == this &&
++        if (SynthLookAndFeel.getSelectedUI() == this &&
+                         state == SynthConstants.ENABLED) {
+-            state = SynthLookAndFeel.selectedUIState | SynthConstants.ENABLED;
++            state = SynthLookAndFeel.getSelectedUIState() | SynthConstants.ENABLED;
+         }
+         return state;
+     }
+diff --git a/src/share/classes/javax/swing/plaf/synth/SynthLookAndFeel.java b/src/share/classes/javax/swing/plaf/synth/SynthLookAndFeel.java
+--- openjdk/jdk/src/share/classes/javax/swing/plaf/synth/SynthLookAndFeel.java
++++ openjdk/jdk/src/share/classes/javax/swing/plaf/synth/SynthLookAndFeel.java
+@@ -78,27 +78,25 @@
+     private static final Object STYLE_FACTORY_KEY = new Object(); // com.sun.java.swing.plaf.gtk.StyleCache
+ 
+     /**
++     * AppContext key to get selectedUI.
++     */
++    private static final Object SELECTED_UI_KEY = new StringBuilder("selectedUI");
++
++    /**
++     * AppContext key to get selectedUIState.
++     */
++    private static final Object SELECTED_UI_STATE_KEY = new StringBuilder("selectedUIState");
++
++    /**
+      * The last SynthStyleFactory that was asked for from AppContext
+      * <code>lastContext</code>.
+      */
+     private static SynthStyleFactory lastFactory;
+     /**
+-     * If this is true it indicates there is more than one AppContext active
+-     * and that we need to make sure in getStyleCache the requesting
+-     * AppContext matches that of <code>lastContext</code> before returning
+-     * it.
+-     */
+-    private static boolean multipleApps;
+-    /**
+      * AppContext lastLAF came from.
+      */
+     private static AppContext lastContext;
+ 
+-    // Refer to setSelectedUI
+-    static ComponentUI selectedUI;
+-    // Refer to setSelectedUI
+-    static int selectedUIState;
+-
+     /**
+      * SynthStyleFactory for the this SynthLookAndFeel.
+      */
+@@ -112,6 +110,10 @@
+ 
+     private Handler _handler;
+ 
++    static ComponentUI getSelectedUI() {
++        return (ComponentUI) AppContext.getAppContext().get(SELECTED_UI_KEY);
++    }
++
+     /**
+      * Used by the renderers. For the most part the renderers are implemented
+      * as Labels, which is problematic in so far as they are never selected.
+@@ -123,8 +125,8 @@
+     static void setSelectedUI(ComponentUI uix, boolean selected,
+                               boolean focused, boolean enabled,
+                               boolean rollover) {
+-        selectedUI = uix;
+-        selectedUIState = 0;
++        int selectedUIState = 0;
++
+         if (selected) {
+             selectedUIState = SynthConstants.SELECTED;
+             if (focused) {
+@@ -141,19 +143,32 @@
+         else {
+             if (enabled) {
+                 selectedUIState |= SynthConstants.ENABLED;
+-                selectedUIState = SynthConstants.FOCUSED;
++                if (focused) {
++                    selectedUIState |= SynthConstants.FOCUSED;
++                }
+             }
+             else {
+                 selectedUIState |= SynthConstants.DISABLED;
+             }
+         }
++
++        AppContext context = AppContext.getAppContext();
++
++        context.put(SELECTED_UI_KEY, uix);
++        context.put(SELECTED_UI_STATE_KEY, Integer.valueOf(selectedUIState));
++    }
++
++    static int getSelectedUIState() {
++        Integer result = (Integer) AppContext.getAppContext().get(SELECTED_UI_STATE_KEY);
++
++        return result == null ? 0 : result.intValue();
+     }
+ 
+     /**
+      * Clears out the selected UI that was last set in setSelectedUI.
+      */
+     static void resetSelectedUI() {
+-        selectedUI = null;
++        AppContext.getAppContext().remove(SELECTED_UI_KEY);
+     }
+ 
+ 
+@@ -168,10 +183,6 @@
+         // for a particular AppContext.
+         synchronized(SynthLookAndFeel.class) {
+             AppContext context = AppContext.getAppContext();
+-            if (!multipleApps && context != lastContext &&
+-                                 lastContext != null) {
+-                multipleApps = true;
+-            }
+             lastFactory = cache;
+             lastContext = context;
+             context.put(STYLE_FACTORY_KEY, cache);
+@@ -185,17 +196,13 @@
+      */
+     public static SynthStyleFactory getStyleFactory() {
+         synchronized(SynthLookAndFeel.class) {
+-            if (!multipleApps) {
+-                return lastFactory;
+-            }
+             AppContext context = AppContext.getAppContext();
+ 
+             if (lastContext == context) {
+                 return lastFactory;
+             }
+             lastContext = context;
+-            lastFactory = (SynthStyleFactory)AppContext.getAppContext().get
+-                                           (STYLE_FACTORY_KEY);
++            lastFactory = (SynthStyleFactory) context.get(STYLE_FACTORY_KEY);
+             return lastFactory;
+         }
+     }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/security/20120612/7143617.patch	Fri Jun 08 14:23:28 2012 +0100
@@ -0,0 +1,72 @@
+# HG changeset patch
+# User bae
+# Date 1339077299 -3600
+# Node ID 25e9363d907d3cc5104a5ec47c1638b36b63559c
+# Parent  7047bf04103450562b485e00c622fea18b227eea
+7143617: Improve fontmanager layout lookup operations
+Reviewed-by: prr
+
+diff --git a/src/share/native/sun/font/layout/LookupProcessor.cpp b/src/share/native/sun/font/layout/LookupProcessor.cpp
+--- openjdk/jdk/src/share/native/sun/font/layout/LookupProcessor.cpp
++++ openjdk/jdk/src/share/native/sun/font/layout/LookupProcessor.cpp
+@@ -86,6 +86,10 @@
+ 
+         if (selectMask != 0) {
+             const LookupTable *lookupTable = lookupListTable->getLookupTable(lookup);
++
++            if (!lookupTable)
++                continue;
++
+             le_uint16 lookupFlags = SWAPW(lookupTable->lookupFlags);
+ 
+             glyphIterator.reset(lookupFlags, selectMask);
+@@ -124,6 +128,9 @@
+     for (le_uint16 lookup = 0; lookup < lookupCount; lookup += 1) {
+         le_uint16 lookupListIndex = SWAPW(featureTable->lookupListIndexArray[lookup]);
+ 
++        if (lookupListIndex >= lookupSelectCount)
++            continue;
++
+         lookupSelectArray[lookupListIndex] |= featureMask;
+         lookupOrderArray[store++] = lookupListIndex;
+     }
+@@ -135,7 +142,7 @@
+         Offset scriptListOffset, Offset featureListOffset, Offset lookupListOffset,
+         LETag scriptTag, LETag languageTag, const FeatureMap *featureMap,
+         le_int32 featureMapCount, le_bool orderFeatures)
+-    : lookupListTable(NULL), featureListTable(NULL), lookupSelectArray(NULL),
++    : lookupListTable(NULL), featureListTable(NULL), lookupSelectArray(NULL), lookupSelectCount(0),
+       lookupOrderArray(NULL), lookupOrderCount(0)
+ {
+     const ScriptListTable *scriptListTable = NULL;
+@@ -175,6 +182,8 @@
+         lookupSelectArray[i] = 0;
+     }
+ 
++    lookupSelectCount = lookupListCount;
++
+     le_int32 count, order = 0;
+     le_int32 featureReferences = 0;
+     const FeatureTable *featureTable = NULL;
+@@ -191,6 +200,10 @@
+         le_uint16 featureIndex = SWAPW(langSysTable->featureIndexArray[feature]);
+ 
+         featureTable = featureListTable->getFeatureTable(featureIndex, &featureTag);
++
++        if (!featureTable)
++            continue;
++
+         featureReferences += SWAPW(featureTable->lookupCount);
+     }
+ 
+diff --git a/src/share/native/sun/font/layout/LookupProcessor.h b/src/share/native/sun/font/layout/LookupProcessor.h
+--- openjdk/jdk/src/share/native/sun/font/layout/LookupProcessor.h
++++ openjdk/jdk/src/share/native/sun/font/layout/LookupProcessor.h
+@@ -77,6 +77,7 @@
+     const FeatureListTable  *featureListTable;
+ 
+     FeatureMask             *lookupSelectArray;
++    le_uint32              lookupSelectCount;
+ 
+     le_uint16               *lookupOrderArray;
+     le_uint32               lookupOrderCount;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/security/20120612/7143851.patch	Fri Jun 08 14:23:28 2012 +0100
@@ -0,0 +1,74 @@
+# HG changeset patch
+# User coffeys
+# Date 1330533709 0
+# Node ID a7d40c5a7d44b054b5a1cd8980f1559d32dc6548
+# Parent  0f2647f201d5879ed294348e36325c2cc2934749
+7143851: Improve IIOP stub and tie generation in RMIC
+7149048: Changes to corba rmic stubGenerator class are not used during jdk build process
+Reviewed-by: mschoene, dholmes
+
+diff --git a/src/share/classes/sun/rmi/rmic/iiop/StubGenerator.java b/src/share/classes/sun/rmi/rmic/iiop/StubGenerator.java
+--- openjdk/corba/src/share/classes/sun/rmi/rmic/iiop/StubGenerator.java
++++ openjdk/corba/src/share/classes/sun/rmi/rmic/iiop/StubGenerator.java
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 1998, 2007, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 1998, 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
+@@ -425,7 +425,7 @@
+         // Write the _ids() method...
+ 
+         p.plnI("public String[] _ids() { ");
+-        p.pln("return _type_ids;");
++        p.pln("return (String[]) _type_ids.clone();");
+         p.pOln("}");
+ 
+         // Get all the methods and write each stub method...
+@@ -1860,11 +1860,11 @@
+     {
+         if(POATie){
+         p.plnI("public String[] _all_interfaces(org.omg.PortableServer.POA poa, byte[] objectId){");
+-        p.pln("return _type_ids;");
++        p.pln("return (String[]) _type_ids.clone();");
+         p.pOln("}");
+         } else {
+         p.plnI("public String[] _ids() { ");
+-        p.pln("return _type_ids;");
++        p.pln("return (String[]) _type_ids.clone();");
+         p.pOln("}");
+         }
+     }
+diff --git a/make/com/sun/jmx/Makefile b/make/com/sun/jmx/Makefile
+--- openjdk/jdk/make/com/sun/jmx/Makefile
++++ openjdk/jdk/make/com/sun/jmx/Makefile
+@@ -1,5 +1,5 @@
+ #
+-# Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
++# Copyright (c) 2003, 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
+@@ -98,6 +98,21 @@
+ # so that *_tie classes are generated in package without the prefix
+ # org.omg.stub (6375696)
+ # 
++# To ensure the latest stub generator files are picked up from corba repo
++# when available, we need to run with latest rmic version available. rmic 
++# launch tool not built at this stage but we can invoke via rmi class.
++
++RMIC_JAVA = $(OUTPUTDIR)/bin/java
++# need to treat 64bit solaris differently
++ifeq ($(PLATFORM)-$(LIBARCH), solaris-amd64)
++RMIC_JAVA = $(OUTPUTDIR)/bin/amd64/java
++endif
++ifeq ($(PLATFORM)-$(LIBARCH), solaris-sparcv9)
++RMIC_JAVA = $(OUTPUTDIR)/bin/sparcv9/java
++endif
++
++RMIC = $(RMIC_JAVA) $(JAVA_TOOLS_FLAGS) -cp $(OUTPUTDIR)/classes sun.rmi.rmic.Main
++
+ $(CLASSDESTDIR)/%_Stub.class: $(CLASSDESTDIR)/%.class
+ 	$(prep-target)
+ 	$(RMIC) -classpath "$(CLASSDESTDIR)"    \
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/security/20120612/7143872.patch	Fri Jun 08 14:23:28 2012 +0100
@@ -0,0 +1,400 @@
+# HG changeset patch
+# User weijun
+# Date 1339084321 -3600
+# Node ID a9b797c8d4edb4a8ec93c05c9f5f44a607b36406
+# Parent  04cb18d22fae985680a5fa3b87585485edb3b0fb
+7143872: Improve certificate extension processing
+Reviewed-by: mullan
+
+diff --git a/src/share/classes/sun/security/x509/CRLExtensions.java b/src/share/classes/sun/security/x509/CRLExtensions.java
+--- openjdk/jdk/src/share/classes/sun/security/x509/CRLExtensions.java
++++ openjdk/jdk/src/share/classes/sun/security/x509/CRLExtensions.java
+@@ -32,8 +32,10 @@
+ import java.security.cert.CRLException;
+ import java.security.cert.CertificateException;
+ import java.util.Collection;
++import java.util.Collections;
+ import java.util.Enumeration;
+-import java.util.Hashtable;
++import java.util.Map;
++import java.util.TreeMap;
+ 
+ import sun.security.util.*;
+ import sun.misc.HexDumpEncoder;
+@@ -62,7 +64,8 @@
+  */
+ public class CRLExtensions {
+ 
+-    private Hashtable<String,Extension> map = new Hashtable<String,Extension>();
++    private Map<String,Extension> map = Collections.synchronizedMap(
++            new TreeMap<String,Extension>());
+     private boolean unsupportedCritExt = false;
+ 
+     /**
+@@ -215,7 +218,7 @@
+      * @return an enumeration of the extensions in this CRL.
+      */
+     public Enumeration<Extension> getElements() {
+-        return map.elements();
++        return Collections.enumeration(map.values());
+     }
+ 
+     /**
+diff --git a/src/share/classes/sun/security/x509/CertificateExtensions.java b/src/share/classes/sun/security/x509/CertificateExtensions.java
+--- openjdk/jdk/src/share/classes/sun/security/x509/CertificateExtensions.java
++++ openjdk/jdk/src/share/classes/sun/security/x509/CertificateExtensions.java
+@@ -57,7 +57,8 @@
+ 
+     private static final Debug debug = Debug.getInstance("x509");
+ 
+-    private Hashtable<String,Extension> map = new Hashtable<String,Extension>();
++    private Map<String,Extension> map = Collections.synchronizedMap(
++            new TreeMap<String,Extension>());
+     private boolean unsupportedCritExt = false;
+ 
+     private Map<String,Extension> unparseableExtensions;
+@@ -117,7 +118,7 @@
+             if (ext.isCritical() == false) {
+                 // ignore errors parsing non-critical extensions
+                 if (unparseableExtensions == null) {
+-                    unparseableExtensions = new HashMap<String,Extension>();
++                    unparseableExtensions = new TreeMap<String,Extension>();
+                 }
+                 unparseableExtensions.put(ext.getExtensionId().toString(),
+                         new UnparseableExtension(ext, e));
+@@ -218,6 +219,12 @@
+         return (obj);
+     }
+ 
++    // Similar to get(String), but throw no exception, might return null.
++    // Used in X509CertImpl::getExtension(OID).
++    Extension getExtension(String name) {
++        return map.get(name);
++    }
++
+     /**
+      * Delete the attribute value.
+      * @param name the extension name used in the lookup.
+@@ -236,7 +243,7 @@
+      * attribute.
+      */
+     public Enumeration<Extension> getElements() {
+-        return map.elements();
++        return Collections.enumeration(map.values());
+     }
+ 
+     /**
+diff --git a/src/share/classes/sun/security/x509/X509CRLEntryImpl.java b/src/share/classes/sun/security/x509/X509CRLEntryImpl.java
+--- openjdk/jdk/src/share/classes/sun/security/x509/X509CRLEntryImpl.java
++++ openjdk/jdk/src/share/classes/sun/security/x509/X509CRLEntryImpl.java
+@@ -31,11 +31,7 @@
+ import java.security.cert.CertificateException;
+ import java.security.cert.X509CRLEntry;
+ import java.math.BigInteger;
+-import java.util.Collection;
+-import java.util.Date;
+-import java.util.Enumeration;
+-import java.util.Set;
+-import java.util.HashSet;
++import java.util.*;
+ 
+ import javax.security.auth.x500.X500Principal;
+ 
+@@ -72,7 +68,8 @@
+  * @author Hemma Prafullchandra
+  */
+ 
+-public class X509CRLEntryImpl extends X509CRLEntry {
++public class X509CRLEntryImpl extends X509CRLEntry
++        implements Comparable<X509CRLEntryImpl> {
+ 
+     private SerialNumber serialNumber = null;
+     private Date revocationDate = null;
+@@ -193,9 +190,14 @@
+      * @exception CRLException if an encoding error occurs.
+      */
+     public byte[] getEncoded() throws CRLException {
++        return getEncoded0().clone();
++    }
++
++    // Called internally to avoid clone
++    private byte[] getEncoded0() throws CRLException {
+         if (revokedCert == null)
+             this.encode(new DerOutputStream());
+-        return revokedCert.clone();
++        return revokedCert;
+     }
+ 
+     @Override
+@@ -313,7 +315,7 @@
+         if (extensions == null) {
+             return null;
+         }
+-        Set<String> extSet = new HashSet<String>();
++        Set<String> extSet = new TreeSet<String>();
+         for (Extension ex : extensions.getAllExtensions()) {
+             if (ex.isCritical()) {
+                 extSet.add(ex.getExtensionId().toString());
+@@ -334,7 +336,7 @@
+         if (extensions == null) {
+             return null;
+         }
+-        Set<String> extSet = new HashSet<String>();
++        Set<String> extSet = new TreeSet<String>();
+         for (Extension ex : extensions.getAllExtensions()) {
+             if (!ex.isCritical()) {
+                 extSet.add(ex.getExtensionId().toString());
+@@ -461,4 +463,24 @@
+         return (CertificateIssuerExtension)
+             getExtension(PKIXExtensions.CertificateIssuer_Id);
+     }
++
++    @Override
++    public int compareTo(X509CRLEntryImpl that) {
++        int compSerial = getSerialNumber().compareTo(that.getSerialNumber());
++        if (compSerial != 0) {
++            return compSerial;
++        }
++        try {
++            byte[] thisEncoded = this.getEncoded0();
++            byte[] thatEncoded = that.getEncoded0();
++            for (int i=0; i<thisEncoded.length && i<thatEncoded.length; i++) {
++                int a = thisEncoded[i] & 0xff;
++                int b = thatEncoded[i] & 0xff;
++                if (a != b) return a-b;
++            }
++            return thisEncoded.length -thatEncoded.length;
++        } catch (CRLException ce) {
++            return -1;
++        }
++    }
+ }
+diff --git a/src/share/classes/sun/security/x509/X509CRLImpl.java b/src/share/classes/sun/security/x509/X509CRLImpl.java
+--- openjdk/jdk/src/share/classes/sun/security/x509/X509CRLImpl.java
++++ openjdk/jdk/src/share/classes/sun/security/x509/X509CRLImpl.java
+@@ -53,7 +53,7 @@
+ 
+ /**
+  * <p>
+- * An implmentation for X509 CRL (Certificate Revocation List).
++ * An implementation for X509 CRL (Certificate Revocation List).
+  * <p>
+  * The X.509 v2 CRL format is described below in ASN.1:
+  * <pre>
+@@ -104,7 +104,8 @@
+     private X500Principal    issuerPrincipal = null;
+     private Date             thisUpdate = null;
+     private Date             nextUpdate = null;
+-    private Map<X509IssuerSerial,X509CRLEntry> revokedCerts = new LinkedHashMap<X509IssuerSerial,X509CRLEntry>();
++    private Map<X509IssuerSerial,X509CRLEntry> revokedMap = new TreeMap<X509IssuerSerial,X509CRLEntry>();
++    private List<X509CRLEntry> revokedList = new LinkedList<X509CRLEntry>();
+     private CRLExtensions    extensions = null;
+     private final static boolean isExplicit = true;
+     private static final long YR_2050 = 2524636800000L;
+@@ -223,7 +224,8 @@
+                 badCert.setCertificateIssuer(crlIssuer, badCertIssuer);
+                 X509IssuerSerial issuerSerial = new X509IssuerSerial
+                     (badCertIssuer, badCert.getSerialNumber());
+-                this.revokedCerts.put(issuerSerial, badCert);
++                this.revokedMap.put(issuerSerial, badCert);
++                this.revokedList.add(badCert);
+                 if (badCert.hasExtensions()) {
+                     this.version = 1;
+                 }
+@@ -305,8 +307,8 @@
+                     tmp.putGeneralizedTime(nextUpdate);
+             }
+ 
+-            if (!revokedCerts.isEmpty()) {
+-                for (X509CRLEntry entry : revokedCerts.values()) {
++            if (!revokedList.isEmpty()) {
++                for (X509CRLEntry entry : revokedList) {
+                     ((X509CRLEntryImpl)entry).encode(rCerts);
+                 }
+                 tmp.write(DerValue.tag_Sequence, rCerts);
+@@ -490,14 +492,14 @@
+             sb.append("\nThis Update: " + thisUpdate.toString() + "\n");
+         if (nextUpdate != null)
+             sb.append("Next Update: " + nextUpdate.toString() + "\n");
+-        if (revokedCerts.isEmpty())
++        if (revokedList.isEmpty())
+             sb.append("\nNO certificates have been revoked\n");
+         else {
+-            sb.append("\nRevoked Certificates: " + revokedCerts.size());
++            sb.append("\nRevoked Certificates: " + revokedList.size());
+             int i = 1;
+-            for (Iterator<X509CRLEntry> iter = revokedCerts.values().iterator();
+-                                             iter.hasNext(); i++)
+-                sb.append("\n[" + i + "] " + iter.next().toString());
++            for (X509CRLEntry entry: revokedList) {
++                sb.append("\n[" + i++ + "] " + entry.toString());
++            }
+         }
+         if (extensions != null) {
+             Collection<Extension> allExts = extensions.getAllExtensions();
+@@ -543,12 +545,12 @@
+      * false otherwise.
+      */
+     public boolean isRevoked(Certificate cert) {
+-        if (revokedCerts.isEmpty() || (!(cert instanceof X509Certificate))) {
++        if (revokedMap.isEmpty() || (!(cert instanceof X509Certificate))) {
+             return false;
+         }
+         X509Certificate xcert = (X509Certificate) cert;
+         X509IssuerSerial issuerSerial = new X509IssuerSerial(xcert);
+-        return revokedCerts.containsKey(issuerSerial);
++        return revokedMap.containsKey(issuerSerial);
+     }
+ 
+     /**
+@@ -638,24 +640,24 @@
+      * @see X509CRLEntry
+      */
+     public X509CRLEntry getRevokedCertificate(BigInteger serialNumber) {
+-        if (revokedCerts.isEmpty()) {
++        if (revokedMap.isEmpty()) {
+             return null;
+         }
+         // assume this is a direct CRL entry (cert and CRL issuer are the same)
+         X509IssuerSerial issuerSerial = new X509IssuerSerial
+             (getIssuerX500Principal(), serialNumber);
+-        return revokedCerts.get(issuerSerial);
++        return revokedMap.get(issuerSerial);
+     }
+ 
+     /**
+      * Gets the CRL entry for the given certificate.
+      */
+     public X509CRLEntry getRevokedCertificate(X509Certificate cert) {
+-        if (revokedCerts.isEmpty()) {
++        if (revokedMap.isEmpty()) {
+             return null;
+         }
+         X509IssuerSerial issuerSerial = new X509IssuerSerial(cert);
+-        return revokedCerts.get(issuerSerial);
++        return revokedMap.get(issuerSerial);
+     }
+ 
+     /**
+@@ -667,10 +669,10 @@
+      * @see X509CRLEntry
+      */
+     public Set<X509CRLEntry> getRevokedCertificates() {
+-        if (revokedCerts.isEmpty()) {
++        if (revokedList.isEmpty()) {
+             return null;
+         } else {
+-            return new HashSet<X509CRLEntry>(revokedCerts.values());
++            return new TreeSet<X509CRLEntry>(revokedList);
+         }
+     }
+ 
+@@ -896,7 +898,7 @@
+         if (extensions == null) {
+             return null;
+         }
+-        Set<String> extSet = new HashSet<String>();
++        Set<String> extSet = new TreeSet<String>();
+         for (Extension ex : extensions.getAllExtensions()) {
+             if (ex.isCritical()) {
+                 extSet.add(ex.getExtensionId().toString());
+@@ -917,7 +919,7 @@
+         if (extensions == null) {
+             return null;
+         }
+-        Set<String> extSet = new HashSet<String>();
++        Set<String> extSet = new TreeSet<String>();
+         for (Extension ex : extensions.getAllExtensions()) {
+             if (!ex.isCritical()) {
+                 extSet.add(ex.getExtensionId().toString());
+@@ -1094,7 +1096,8 @@
+                 entry.setCertificateIssuer(crlIssuer, badCertIssuer);
+                 X509IssuerSerial issuerSerial = new X509IssuerSerial
+                     (badCertIssuer, entry.getSerialNumber());
+-                revokedCerts.put(issuerSerial, entry);
++                revokedMap.put(issuerSerial, entry);
++                revokedList.add(entry);
+             }
+         }
+ 
+@@ -1192,7 +1195,8 @@
+     /**
+      * Immutable X.509 Certificate Issuer DN and serial number pair
+      */
+-    private final static class X509IssuerSerial {
++    private final static class X509IssuerSerial
++            implements Comparable<X509IssuerSerial> {
+         final X500Principal issuer;
+         final BigInteger serial;
+         volatile int hashcode = 0;
+@@ -1271,5 +1275,13 @@
+             }
+             return hashcode;
+         }
++
++        @Override
++        public int compareTo(X509IssuerSerial another) {
++            int cissuer = issuer.toString()
++                    .compareTo(another.issuer.toString());
++            if (cissuer != 0) return cissuer;
++            return this.serial.compareTo(another.serial);
++        }
+     }
+ }
+diff --git a/src/share/classes/sun/security/x509/X509CertImpl.java b/src/share/classes/sun/security/x509/X509CertImpl.java
+--- openjdk/jdk/src/share/classes/sun/security/x509/X509CertImpl.java
++++ openjdk/jdk/src/share/classes/sun/security/x509/X509CertImpl.java
+@@ -1214,7 +1214,7 @@
+             if (exts == null) {
+                 return null;
+             }
+-            Set<String> extSet = new HashSet<String>();
++            Set<String> extSet = new TreeSet<String>();
+             for (Extension ex : exts.getAllExtensions()) {
+                 if (ex.isCritical()) {
+                     extSet.add(ex.getExtensionId().toString());
+@@ -1244,7 +1244,7 @@
+             if (exts == null) {
+                 return null;
+             }
+-            Set<String> extSet = new HashSet<String>();
++            Set<String> extSet = new TreeSet<String>();
+             for (Extension ex : exts.getAllExtensions()) {
+                 if (!ex.isCritical()) {
+                     extSet.add(ex.getExtensionId().toString());
+@@ -1278,10 +1278,14 @@
+             if (extensions == null) {
+                 return null;
+             } else {
+-                for (Extension ex : extensions.getAllExtensions()) {
+-                    if (ex.getExtensionId().equals(oid)) {
++                Extension ex = extensions.getExtension(oid.toString());
++                if (ex != null) {
++                    return ex;
++                }
++                for (Extension ex2: extensions.getAllExtensions()) {
++                    if (ex2.getExtensionId().equals((Object)oid)) {
+                         //XXXX May want to consider cloning this
+-                        return ex;
++                        return ex2;
+                     }
+                 }
+                 /* no such extension in this certificate */
+@@ -1480,7 +1484,7 @@
+         if (names.isEmpty()) {
+             return Collections.<List<?>>emptySet();
+         }
+-        Set<List<?>> newNames = new HashSet<List<?>>();
++        List<List<?>> newNames = new ArrayList<List<?>>();
+         for (GeneralName gname : names.names()) {
+             GeneralNameInterface name = gname.getName();
+             List<Object> nameEntry = new ArrayList<Object>(2);
+@@ -1541,7 +1545,7 @@
+             }
+         }
+         if (mustClone) {
+-            Set<List<?>> namesCopy = new HashSet<List<?>>();
++            List<List<?>> namesCopy = new ArrayList<List<?>>();
+             for (List<?> nameEntry : altNames) {
+                 Object nameObject = nameEntry.get(1);
+                 if (nameObject instanceof byte[]) {
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/security/20120612/7145239.patch	Fri Jun 08 14:23:28 2012 +0100
@@ -0,0 +1,68 @@
+# HG changeset patch
+# User mullan
+# Date 1339086824 -3600
+# Node ID bb0caf6041c99873347d12f82d0eb65965afafeb
+# Parent  c4ba973139576dbaeb13a1bb8de26ffd8d1de9a4
+7145239: Finetune package definition restriction
+Reviewed-by: hawtin
+
+diff --git a/src/share/lib/security/java.security b/src/share/lib/security/java.security
+--- openjdk/jdk/src/share/lib/security/java.security
++++ openjdk/jdk/src/share/lib/security/java.security
+@@ -127,7 +127,7 @@
+ # passed to checkPackageAccess unless the
+ # corresponding RuntimePermission ("accessClassInPackage."+package) has
+ # been granted.
+-package.access=sun.,com.sun.xml.internal.ws.,com.sun.xml.internal.bind.,com.sun.imageio.
++package.access=sun.,com.sun.xml.internal.ws.,com.sun.xml.internal.bind.,com.sun.imageio.,com.sun.org.apache.xerces.internal.utils.,com.sun.org.apache.xalan.internal.utils.
+ 
+ #
+ # List of comma-separated packages that start with or equal this string
+@@ -136,10 +136,10 @@
+ # corresponding RuntimePermission ("defineClassInPackage."+package) has
+ # been granted.
+ #
+-# by default, no packages are restricted for definition, and none of
+-# the class loaders supplied with the JDK call checkPackageDefinition.
++# by default, none of the class loaders supplied with the JDK call
++# checkPackageDefinition.
+ #
+-#package.definition=
++package.definition=sun.,com.sun.xml.internal.ws.,com.sun.xml.internal.bind.,com.sun.imageio.,com.sun.org.apache.xerces.internal.utils.,com.sun.org.apache.xalan.internal.utils.
+ 
+ #
+ # Determines whether this properties file can be appended to
+diff --git a/src/share/lib/security/java.security-solaris b/src/share/lib/security/java.security-solaris
+--- openjdk/jdk/src/share/lib/security/java.security-solaris
++++ openjdk/jdk/src/share/lib/security/java.security-solaris
+@@ -137,10 +137,10 @@
+ # corresponding RuntimePermission ("defineClassInPackage."+package) has
+ # been granted.
+ #
+-# by default, no packages are restricted for definition, and none of
+-# the class loaders supplied with the JDK call checkPackageDefinition.
++# by default, none of the class loaders supplied with the JDK call
++# checkPackageDefinition.
+ #
+-#package.definition=
++package.definition=sun.,com.sun.xml.internal.ws.,com.sun.xml.internal.bind.,com.sun.imageio.,com.sun.org.apache.xerces.internal.utils.,com.sun.org.apache.xalan.internal.utils.
+ 
+ #
+ # Determines whether this properties file can be appended to
+diff --git a/src/share/lib/security/java.security-windows b/src/share/lib/security/java.security-windows
+--- openjdk/jdk/src/share/lib/security/java.security-windows
++++ openjdk/jdk/src/share/lib/security/java.security-windows
+@@ -137,10 +137,10 @@
+ # corresponding RuntimePermission ("defineClassInPackage."+package) has
+ # been granted.
+ #
+-# by default, no packages are restricted for definition, and none of
+-# the class loaders supplied with the JDK call checkPackageDefinition.
++# by default, none of the class loaders supplied with the JDK call
++# checkPackageDefinition.
+ #
+-#package.definition=
++package.definition=sun.,com.sun.xml.internal.ws.,com.sun.xml.internal.bind.,com.sun.imageio.,com.sun.org.apache.xerces.internal.utils.,com.sun.org.apache.xalan.internal.utils.
+ 
+ #
+ # Determines whether this properties file can be appended to
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/security/20120612/7157609.patch	Fri Jun 08 14:23:28 2012 +0100
@@ -0,0 +1,56 @@
+diff --git a/build.properties b/build.properties
+--- openjdk/jaxp/build.properties
++++ openjdk/jaxp/build.properties
+@@ -77,6 +77,9 @@
+ # Where patches to drop bundle sources live
+ patches.dir=patches
+ 
++# Patches to apply
++jaxp_src.patch.list=7157609.patch
++
+ # Sanity information
+ sanity.info= Sanity Settings:${line.separator}\
+   ant.home=${ant.home}${line.separator}\
+diff --git a/patches/jaxp_src/7157609.patch b/patches/jaxp_src/7157609.patch
+new file mode 100644
+--- /dev/null
++++ openjdk/jaxp/patches/jaxp_src/7157609.patch
+@@ -0,0 +1,38 @@
++# HG changeset patch
++# User joehw
++# Date 1333729977 25200
++# Node ID abc9f6855a61c74ca11183ec49fcbbb9e4fa29b1
++# Parent  3f8b55667a6f9d093fcaf4a70c784c426b00685b
++7157609: Issues with loop
++Reviewed-by: hawtin, lancea
++
++diff --git a/src/com/sun/org/apache/xerces/internal/impl/XMLScanner.java b/src/com/sun/org/apache/xerces/internal/impl/XMLScanner.java
++--- src/com/sun/org/apache/xerces/internal/impl/XMLScanner.java
+++++ src/com/sun/org/apache/xerces/internal/impl/XMLScanner.java
++@@ -402,6 +402,16 @@ public abstract class XMLScanner
++ 
++         boolean dataFoundForTarget = false;
++         boolean sawSpace = fEntityScanner.skipSpaces();
+++        // since pseudoattributes are *not* attributes,
+++        // their quotes don't need to be preserved in external parameter entities.
+++        // the XMLEntityScanner#scanLiteral method will continue to
+++        // emit -1 in such cases when it finds a quote; this is
+++        // fine for other methods that parse scanned entities,
+++        // but not for the scanning of pseudoattributes.  So,
+++        // temporarily, we must mark the current entity as not being "literal"
+++        Entity.ScannedEntity currEnt = fEntityManager.getCurrentEntity();
+++        boolean currLiteral = currEnt.literal;
+++        currEnt.literal = false;
++         while (fEntityScanner.peekChar() != '?') {
++             dataFoundForTarget = true;
++             String name = scanPseudoAttribute(scanningTextDecl, fString);
++@@ -499,6 +509,9 @@ public abstract class XMLScanner
++             }
++             sawSpace = fEntityScanner.skipSpaces();
++         }
+++        // restore original literal value
+++        if(currLiteral)
+++            currEnt.literal = true;
++         // REVISIT: should we remove this error reporting?
++         if (scanningTextDecl && state != STATE_DONE) {
++             reportFatalError("MorePseudoAttributes", null);
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/security/20120612/7160677.patch	Fri Jun 08 14:23:28 2012 +0100
@@ -0,0 +1,19 @@
+# HG changeset patch
+# User never
+# Date 1334191100 25200
+# Node ID 17aa937e8207323719df4dac99cea86da5d4833f
+# Parent  d998d70cb0e855ba7d867adc6410aaa5777b17ca
+7160677: missing else in fix for 7152811
+Reviewed-by: kvn
+
+diff --git a/src/share/vm/ci/ciField.cpp b/src/share/vm/ci/ciField.cpp
+--- openjdk/hotspot/src/share/vm/ci/ciField.cpp
++++ openjdk/hotspot/src/share/vm/ci/ciField.cpp
+@@ -335,6 +335,7 @@
+     if (_known_to_link_with_put == accessing_klass) {
+       return true;
+     }
++  } else {
+     if (_known_to_link_with_get == accessing_klass) {
+       return true;
+     }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/security/20120612/7160757.patch	Fri Jun 08 14:23:28 2012 +0100
@@ -0,0 +1,26 @@
+# HG changeset patch
+# User kamg
+# Date 1336075036 14400
+# Node ID f64381365f7cdc3cde6d2db3b850e39109ee9764
+# Parent  17aa937e8207323719df4dac99cea86da5d4833f
+7160757: Problem with hotspot/runtime_classfile
+Summary: Allow only current and super invokespecials of <init>
+Reviewed-by: never, coleenp, dcubed
+
+diff --git a/src/share/vm/classfile/verifier.cpp b/src/share/vm/classfile/verifier.cpp
+--- openjdk/hotspot/src/share/vm/classfile/verifier.cpp
++++ openjdk/hotspot/src/share/vm/classfile/verifier.cpp
+@@ -1871,10 +1871,10 @@
+   VerificationType type = current_frame->pop_stack(
+     VerificationType::reference_check(), CHECK_VERIFY(this));
+   if (type == VerificationType::uninitialized_this_type()) {
+-    // The method must be an <init> method of either this class, or one of its
+-    // superclasses
++    // The method must be an <init> method of this class or its superclass
++    klassOop superk = current_class()->super();
+     if (ref_class_type.name() != current_class()->name() &&
+-        !name_in_supers(ref_class_type.name(), current_class())) {
++        ref_class_type.name() != superk->klass_part()->name()) {
+       verify_error(bci, "Bad <init> method call");
+       return;
+     }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/security/20120612/hs20/7110720.patch	Fri Jun 08 14:23:28 2012 +0100
@@ -0,0 +1,129 @@
+# HG changeset patch
+# User kamg
+# Date 1339076892 -3600
+# Node ID aaf8f12b1e038cfe25ed41afb9f91a10dc4ff584
+# Parent  c1fc713e41d83d8872775fb4b76597a806ed9ce2
+7110720: Issue with vm config file loadingIssue with vm config file loading
+Summary: disabling default config files if -XX:-ReadDefaultConfigFiles
+Reviewed-by: phh, jrose, dcubed, dholmes
+
+diff --git a/src/share/vm/compiler/compilerOracle.cpp b/src/share/vm/compiler/compilerOracle.cpp
+--- openjdk/hotspot/src/share/vm/compiler/compilerOracle.cpp
++++ openjdk/hotspot/src/share/vm/compiler/compilerOracle.cpp
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 1998, 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
+@@ -551,13 +551,22 @@
+ }
+ 
+ static const char* cc_file() {
+-  if (CompileCommandFile == NULL)
++#ifdef ASSERT
++  if (CompileCommandFile == NULL) {
+     return ".hotspot_compiler";
++  }
++#endif
+   return CompileCommandFile;
+ }
++
++bool CompilerOracle::has_command_file() {
++  return cc_file() != NULL;
++}
++
+ bool CompilerOracle::_quiet = false;
+ 
+ void CompilerOracle::parse_from_file() {
++  assert(has_command_file(), "command file must be specified");
+   FILE* stream = fopen(cc_file(), "rt");
+   if (stream == NULL) return;
+ 
+@@ -600,6 +609,7 @@
+ }
+ 
+ void CompilerOracle::append_comment_to_file(const char* message) {
++  assert(has_command_file(), "command file must be specified");
+   fileStream stream(fopen(cc_file(), "at"));
+   stream.print("# ");
+   for (int index = 0; message[index] != '\0'; index++) {
+@@ -610,6 +620,7 @@
+ }
+ 
+ void CompilerOracle::append_exclude_to_file(methodHandle method) {
++  assert(has_command_file(), "command file must be specified");
+   fileStream stream(fopen(cc_file(), "at"));
+   stream.print("exclude ");
+   Klass::cast(method->method_holder())->name()->print_symbol_on(&stream);
+@@ -624,7 +635,9 @@
+ void compilerOracle_init() {
+   CompilerOracle::parse_from_string(CompileCommand, CompilerOracle::parse_from_line);
+   CompilerOracle::parse_from_string(CompileOnly, CompilerOracle::parse_compile_only);
+-  CompilerOracle::parse_from_file();
++  if (CompilerOracle::has_command_file()) {
++    CompilerOracle::parse_from_file();
++  }
+   if (lists[PrintCommand] != NULL) {
+     if (PrintAssembly) {
+       warning("CompileCommand and/or .hotspot_compiler file contains 'print' commands, but PrintAssembly is also enabled");
+diff --git a/src/share/vm/compiler/compilerOracle.hpp b/src/share/vm/compiler/compilerOracle.hpp
+--- openjdk/hotspot/src/share/vm/compiler/compilerOracle.hpp
++++ openjdk/hotspot/src/share/vm/compiler/compilerOracle.hpp
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 1998, 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
+@@ -38,6 +38,10 @@
+   static bool _quiet;
+ 
+  public:
++
++  // True if the command file has been specified or is implicit
++  static bool has_command_file();
++
+   // Reads from file and adds to lists
+   static void parse_from_file();
+ 
+diff --git a/src/share/vm/opto/runtime.cpp b/src/share/vm/opto/runtime.cpp
+--- openjdk/hotspot/src/share/vm/opto/runtime.cpp
++++ openjdk/hotspot/src/share/vm/opto/runtime.cpp
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 1998, 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
+@@ -804,7 +804,8 @@
+       methodOop method = ((nmethod*)n)->method();
+       tty->print_cr("# Method where it happened %s.%s ", Klass::cast(method->method_holder())->name()->as_C_string(), method->name()->as_C_string());
+       tty->print_cr("#");
+-      if (ShowMessageBoxOnError && UpdateHotSpotCompilerFileOnError) {
++      if (ShowMessageBoxOnError && UpdateHotSpotCompilerFileOnError &&
++          CompilerOracle::has_command_file()) {
+         const char* title    = "HotSpot Runtime Error";
+         const char* question = "Do you want to exclude compilation of this method in future runs?";
+         if (os::message_box(title, question)) {
+diff --git a/src/share/vm/runtime/arguments.cpp b/src/share/vm/runtime/arguments.cpp
+--- openjdk/hotspot/src/share/vm/runtime/arguments.cpp
++++ openjdk/hotspot/src/share/vm/runtime/arguments.cpp
+@@ -2956,12 +2956,14 @@
+     }
+   }
+ 
++#ifdef ASSERT
+   // Parse default .hotspotrc settings file
+   if (!settings_file_specified) {
+     if (!process_settings_file(".hotspotrc", false, args->ignoreUnrecognized)) {
+       return JNI_EINVAL;
+     }
+   }
++#endif
+ 
+   if (PrintVMOptions) {
+     for (index = 0; index < args->nOptions; index++) {
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/security/20120612/hs20/7152811.patch	Fri Jun 08 14:23:28 2012 +0100
@@ -0,0 +1,107 @@
+# HG changeset patch
+# User never
+# Date 1339076966 -3600
+# Node ID d998d70cb0e855ba7d867adc6410aaa5777b17ca
+# Parent  aaf8f12b1e038cfe25ed41afb9f91a10dc4ff584
+7152811: Issues in client compiler
+Reviewed-by: kvn, jrose
+
+diff --git a/src/share/vm/ci/ciField.cpp b/src/share/vm/ci/ciField.cpp
+--- openjdk/hotspot/src/share/vm/ci/ciField.cpp
++++ openjdk/hotspot/src/share/vm/ci/ciField.cpp
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 1999, 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
+@@ -67,7 +67,7 @@
+ 
+ // ------------------------------------------------------------------
+ // ciField::ciField
+-ciField::ciField(ciInstanceKlass* klass, int index): _known_to_link_with(NULL) {
++ciField::ciField(ciInstanceKlass* klass, int index): _known_to_link_with_put(NULL), _known_to_link_with_get(NULL) {
+   ASSERT_IN_VM;
+   CompilerThread *thread = CompilerThread::current();
+ 
+@@ -143,7 +143,7 @@
+   initialize_from(&field_desc);
+ }
+ 
+-ciField::ciField(fieldDescriptor *fd): _known_to_link_with(NULL) {
++ciField::ciField(fieldDescriptor *fd): _known_to_link_with_put(NULL), _known_to_link_with_get(NULL) {
+   ASSERT_IN_VM;
+ 
+   _cp_index = -1;
+@@ -312,6 +312,10 @@
+ bool ciField::will_link(ciInstanceKlass* accessing_klass,
+                         Bytecodes::Code bc) {
+   VM_ENTRY_MARK;
++  assert(bc == Bytecodes::_getstatic || bc == Bytecodes::_putstatic ||
++         bc == Bytecodes::_getfield  || bc == Bytecodes::_putfield,
++         "unexpected bytecode");
++
+   if (_offset == -1) {
+     // at creation we couldn't link to our holder so we need to
+     // maintain that stance, otherwise there's no safe way to use this
+@@ -319,8 +323,21 @@
+     return false;
+   }
+ 
+-  if (_known_to_link_with == accessing_klass) {
+-    return true;
++  // Check for static/nonstatic mismatch
++  bool is_static = (bc == Bytecodes::_getstatic || bc == Bytecodes::_putstatic);
++  if (is_static != this->is_static()) {
++    return false;
++  }
++
++  // Get and put can have different accessibility rules
++  bool is_put    = (bc == Bytecodes::_putfield  || bc == Bytecodes::_putstatic);
++  if (is_put) {
++    if (_known_to_link_with_put == accessing_klass) {
++      return true;
++    }
++    if (_known_to_link_with_get == accessing_klass) {
++      return true;
++    }
+   }
+ 
+   FieldAccessInfo result;
+@@ -331,8 +348,13 @@
+                               true, false, KILL_COMPILE_ON_FATAL_(false));
+ 
+   // update the hit-cache, unless there is a problem with memory scoping:
+-  if (accessing_klass->is_shared() || !is_shared())
+-    _known_to_link_with = accessing_klass;
++  if (accessing_klass->is_shared() || !is_shared()) {
++    if (is_put) {
++      _known_to_link_with_put = accessing_klass;
++    } else {
++      _known_to_link_with_get = accessing_klass;
++    }
++  }
+ 
+   return true;
+ }
+diff --git a/src/share/vm/ci/ciField.hpp b/src/share/vm/ci/ciField.hpp
+--- openjdk/hotspot/src/share/vm/ci/ciField.hpp
++++ openjdk/hotspot/src/share/vm/ci/ciField.hpp
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 1999, 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
+@@ -49,7 +49,8 @@
+   ciType*          _type;
+   int              _offset;
+   bool             _is_constant;
+-  ciInstanceKlass* _known_to_link_with;
++  ciInstanceKlass* _known_to_link_with_put;
++  ciInstanceKlass* _known_to_link_with_get;
+   ciConstant       _constant_value;
+ 
+   // Used for will_link
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/security/20120612/original/7110720.patch	Fri Jun 08 14:23:28 2012 +0100
@@ -0,0 +1,120 @@
+diff -Nru openjdk.orig/hotspot/src/share/vm/compiler/compilerOracle.cpp openjdk/hotspot/src/share/vm/compiler/compilerOracle.cpp
+--- openjdk.orig/hotspot/src/share/vm/compiler/compilerOracle.cpp	2011-02-28 16:03:18.000000000 +0000
++++ openjdk/hotspot/src/share/vm/compiler/compilerOracle.cpp	2012-06-08 00:15:54.443779814 +0100
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 1998, 2007, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 1998, 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
+@@ -536,13 +536,22 @@
+ }
+ 
+ static const char* cc_file() {
+-  if (CompileCommandFile == NULL)
++#ifdef ASSERT
++  if (CompileCommandFile == NULL) {
+     return ".hotspot_compiler";
++  }
++#endif
+   return CompileCommandFile;
+ }
++
++bool CompilerOracle::has_command_file() {
++  return cc_file() != NULL;
++}
++
+ bool CompilerOracle::_quiet = false;
+ 
+ void CompilerOracle::parse_from_file() {
++  assert(has_command_file(), "command file must be specified");
+   FILE* stream = fopen(cc_file(), "rt");
+   if (stream == NULL) return;
+ 
+@@ -585,6 +594,7 @@
+ }
+ 
+ void CompilerOracle::append_comment_to_file(const char* message) {
++  assert(has_command_file(), "command file must be specified");
+   fileStream stream(fopen(cc_file(), "at"));
+   stream.print("# ");
+   for (int index = 0; message[index] != '\0'; index++) {
+@@ -595,6 +605,7 @@
+ }
+ 
+ void CompilerOracle::append_exclude_to_file(methodHandle method) {
++  assert(has_command_file(), "command file must be specified");
+   fileStream stream(fopen(cc_file(), "at"));
+   stream.print("exclude ");
+   Klass::cast(method->method_holder())->name()->print_symbol_on(&stream);
+@@ -609,7 +620,9 @@
+ void compilerOracle_init() {
+   CompilerOracle::parse_from_string(CompileCommand, CompilerOracle::parse_from_line);
+   CompilerOracle::parse_from_string(CompileOnly, CompilerOracle::parse_compile_only);
+-  CompilerOracle::parse_from_file();
++  if (CompilerOracle::has_command_file()) {
++    CompilerOracle::parse_from_file();
++  }
+   if (lists[PrintCommand] != NULL) {
+     if (PrintAssembly) {
+       warning("CompileCommand and/or .hotspot_compiler file contains 'print' commands, but PrintAssembly is also enabled");
+diff -Nru openjdk.orig/hotspot/src/share/vm/compiler/compilerOracle.hpp openjdk/hotspot/src/share/vm/compiler/compilerOracle.hpp
+--- openjdk.orig/hotspot/src/share/vm/compiler/compilerOracle.hpp	2011-02-28 16:03:18.000000000 +0000
++++ openjdk/hotspot/src/share/vm/compiler/compilerOracle.hpp	2012-06-08 00:16:00.915884779 +0100
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 1998, 2006, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 1998, 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
+@@ -32,6 +32,10 @@
+   static bool _quiet;
+ 
+  public:
++
++  // True if the command file has been specified or is implicit
++  static bool has_command_file();
++
+   // Reads from file and adds to lists
+   static void parse_from_file();
+ 
+diff -Nru openjdk.orig/hotspot/src/share/vm/opto/runtime.cpp openjdk/hotspot/src/share/vm/opto/runtime.cpp
+--- openjdk.orig/hotspot/src/share/vm/opto/runtime.cpp	2011-02-28 16:03:20.000000000 +0000
++++ openjdk/hotspot/src/share/vm/opto/runtime.cpp	2012-06-08 00:13:35.845532462 +0100
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 1998, 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
+@@ -748,7 +748,8 @@
+       methodOop method = ((nmethod*)n)->method();
+       tty->print_cr("# Method where it happened %s.%s ", Klass::cast(method->method_holder())->name()->as_C_string(), method->name()->as_C_string());
+       tty->print_cr("#");
+-      if (ShowMessageBoxOnError && UpdateHotSpotCompilerFileOnError) {
++      if (ShowMessageBoxOnError && UpdateHotSpotCompilerFileOnError &&
++          CompilerOracle::has_command_file()) {
+         const char* title    = "HotSpot Runtime Error";
+         const char* question = "Do you want to exclude compilation of this method in future runs?";
+         if (os::message_box(title, question)) {
+diff -Nru openjdk.orig/hotspot/src/share/vm/runtime/arguments.cpp openjdk/hotspot/src/share/vm/runtime/arguments.cpp
+--- openjdk.orig/hotspot/src/share/vm/runtime/arguments.cpp	2011-02-28 16:03:21.000000000 +0000
++++ openjdk/hotspot/src/share/vm/runtime/arguments.cpp	2012-06-08 00:13:35.849532527 +0100
+@@ -2850,12 +2850,14 @@
+     }
+   }
+ 
++#ifdef ASSERT
+   // Parse default .hotspotrc settings file
+   if (!settings_file_specified) {
+     if (!process_settings_file(".hotspotrc", false, args->ignoreUnrecognized)) {
+       return JNI_EINVAL;
+     }
+   }
++#endif
+ 
+   if (PrintVMOptions) {
+     for (index = 0; index < args->nOptions; index++) {
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/security/20120612/original/7152811.patch	Fri Jun 08 14:23:28 2012 +0100
@@ -0,0 +1,99 @@
+diff -Nru openjdk.orig/hotspot/src/share/vm/ci/ciField.cpp openjdk/hotspot/src/share/vm/ci/ciField.cpp
+--- openjdk.orig/hotspot/src/share/vm/ci/ciField.cpp	2011-02-28 16:03:17.000000000 +0000
++++ openjdk/hotspot/src/share/vm/ci/ciField.cpp	2012-06-08 00:30:01.325505606 +0100
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 1999, 2009, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 1999, 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
+@@ -58,7 +58,7 @@
+ 
+ // ------------------------------------------------------------------
+ // ciField::ciField
+-ciField::ciField(ciInstanceKlass* klass, int index): _known_to_link_with(NULL) {
++ciField::ciField(ciInstanceKlass* klass, int index): _known_to_link_with_put(NULL), _known_to_link_with_get(NULL) {
+   ASSERT_IN_VM;
+   CompilerThread *thread = CompilerThread::current();
+ 
+@@ -134,7 +134,7 @@
+   initialize_from(&field_desc);
+ }
+ 
+-ciField::ciField(fieldDescriptor *fd): _known_to_link_with(NULL) {
++ciField::ciField(fieldDescriptor *fd): _known_to_link_with_put(NULL), _known_to_link_with_get(NULL) {
+   ASSERT_IN_VM;
+ 
+   _cp_index = -1;
+@@ -303,6 +303,10 @@
+ bool ciField::will_link(ciInstanceKlass* accessing_klass,
+                         Bytecodes::Code bc) {
+   VM_ENTRY_MARK;
++  assert(bc == Bytecodes::_getstatic || bc == Bytecodes::_putstatic ||
++         bc == Bytecodes::_getfield  || bc == Bytecodes::_putfield,
++         "unexpected bytecode");
++
+   if (_offset == -1) {
+     // at creation we couldn't link to our holder so we need to
+     // maintain that stance, otherwise there's no safe way to use this
+@@ -310,8 +314,21 @@
+     return false;
+   }
+ 
+-  if (_known_to_link_with == accessing_klass) {
+-    return true;
++  // Check for static/nonstatic mismatch
++  bool is_static = (bc == Bytecodes::_getstatic || bc == Bytecodes::_putstatic);
++  if (is_static != this->is_static()) {
++    return false;
++  }
++
++  // Get and put can have different accessibility rules
++  bool is_put    = (bc == Bytecodes::_putfield  || bc == Bytecodes::_putstatic);
++  if (is_put) {
++    if (_known_to_link_with_put == accessing_klass) {
++      return true;
++    }
++    if (_known_to_link_with_get == accessing_klass) {
++      return true;
++    }
+   }
+ 
+   FieldAccessInfo result;
+@@ -322,8 +339,13 @@
+                               true, false, KILL_COMPILE_ON_FATAL_(false));
+ 
+   // update the hit-cache, unless there is a problem with memory scoping:
+-  if (accessing_klass->is_shared() || !is_shared())
+-    _known_to_link_with = accessing_klass;
++  if (accessing_klass->is_shared() || !is_shared()) {
++    if (is_put) {
++      _known_to_link_with_put = accessing_klass;
++    } else {
++      _known_to_link_with_get = accessing_klass;
++    }
++  }
+ 
+   return true;
+ }
+diff -Nru openjdk.orig/hotspot/src/share/vm/ci/ciField.hpp openjdk/hotspot/src/share/vm/ci/ciField.hpp
+--- openjdk.orig/hotspot/src/share/vm/ci/ciField.hpp	2011-02-28 16:03:17.000000000 +0000
++++ openjdk/hotspot/src/share/vm/ci/ciField.hpp	2012-06-08 00:29:54.557398274 +0100
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 1999, 2008, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 1999, 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
+@@ -41,7 +41,8 @@
+   ciType*          _type;
+   int              _offset;
+   bool             _is_constant;
+-  ciInstanceKlass* _known_to_link_with;
++  ciInstanceKlass* _known_to_link_with_put;
++  ciInstanceKlass* _known_to_link_with_get;
+   ciConstant       _constant_value;
+ 
+   // Used for will_link
--- a/patches/sparc-trapsfix.patch	Thu May 31 12:40:08 2012 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,12 +0,0 @@
---- openjdk/hotspot/src/os_cpu/linux_sparc/vm/assembler_linux_sparc.cpp.orig	2010-01-16 23:19:45.703450297 +0000
-+++ openjdk/hotspot/src/os_cpu/linux_sparc/vm/assembler_linux_sparc.cpp	2010-01-16 23:21:23.942337146 +0000
-@@ -25,7 +25,8 @@
- #include "incls/_precompiled.incl"
- #include "incls/_assembler_linux_sparc.cpp.incl"
- 
--#include <asm-sparc/traps.h>
-+// always found in asm/ with merged sparc/sparc64 headers
-+#include <asm/traps.h>
- 
- void MacroAssembler::read_ccr_trap(Register ccr_save) {
-   // No implementation
--- a/patches/version-hotspot.patch	Thu May 31 12:40:08 2012 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,56 +0,0 @@
-diff -Nru openjdk.orig/hotspot/make/linux/makefiles/vm.make openjdk/hotspot/make/linux/makefiles/vm.make
---- openjdk.orig/hotspot/make/linux/makefiles/vm.make	2010-01-18 22:58:55.000000000 +0000
-+++ openjdk/hotspot/make/linux/makefiles/vm.make	2010-01-20 17:26:22.000000000 +0000
-@@ -86,6 +86,14 @@
-   ${JRE_VERSION}     \
-   ${VM_DISTRO}
- 
-+ifdef DERIVATIVE_ID
-+CPPFLAGS += -DDERIVATIVE_ID="\"$(DERIVATIVE_ID)\""
-+endif
-+
-+ifdef DISTRIBUTION_ID
-+CPPFLAGS += -DDISTRIBUTION_ID="\"$(DISTRIBUTION_ID)\""
-+endif
-+
- # CFLAGS_WARN holds compiler options to suppress/enable warnings.
- CFLAGS += $(CFLAGS_WARN/BYFILE)
- 
-diff -Nru openjdk.orig/hotspot/src/share/vm/runtime/arguments.cpp openjdk/hotspot/src/share/vm/runtime/arguments.cpp
---- openjdk.orig/hotspot/src/share/vm/runtime/arguments.cpp	2010-01-18 23:00:22.000000000 +0000
-+++ openjdk/hotspot/src/share/vm/runtime/arguments.cpp	2010-01-20 17:24:22.000000000 +0000
-@@ -25,7 +25,7 @@
- #include "incls/_precompiled.incl"
- #include "incls/_arguments.cpp.incl"
- 
--#define DEFAULT_VENDOR_URL_BUG "http://java.sun.com/webapps/bugreport/crash.jsp"
-+#define DEFAULT_VENDOR_URL_BUG "http://icedtea.classpath.org/bugzilla"
- #define DEFAULT_JAVA_LAUNCHER  "generic"
- 
- char**  Arguments::_jvm_flags_array             = NULL;
-diff -Nru openjdk.orig/hotspot/src/share/vm/utilities/vmError.cpp openjdk/hotspot/src/share/vm/utilities/vmError.cpp
---- openjdk.orig/hotspot/src/share/vm/utilities/vmError.cpp	2010-01-18 22:56:40.000000000 +0000
-+++ openjdk/hotspot/src/share/vm/utilities/vmError.cpp	2010-01-20 17:25:15.000000000 +0000
-@@ -165,7 +165,8 @@
- 
- static void print_bug_submit_message(outputStream *out, Thread *thread) {
-   if (out == NULL) return;
--  out->print_raw_cr("# If you would like to submit a bug report, please visit:");
-+  out->print_raw_cr("# If you would like to submit a bug report, please include");
-+  out->print_raw_cr("# instructions how to reproduce the bug and visit:");
-   out->print_raw   ("#   ");
-   out->print_raw_cr(Arguments::java_vendor_url_bug());
-   // If the crash is in native code, encourage user to submit a bug to the
-@@ -341,6 +342,12 @@
-                    Abstract_VM_Version::vm_platform_string(),
-                    UseCompressedOops ? "compressed oops" : ""
-                  );
-+#ifdef DERIVATIVE_ID
-+     st->print_cr("# Derivative: %s", DERIVATIVE_ID);
-+#endif
-+#ifdef DISTRIBUTION_ID
-+     st->print_cr("# Distribution: %s", DISTRIBUTION_ID);
-+#endif
- 
-   STEP(60, "(printing problematic frame)")
-