changeset 3138:787402b1e556

Merge
author Andrew John Hughes <gnu.andrew@redhat.com>
date Wed, 09 Apr 2014 22:51:45 +0100
parents 2fba937157de (current diff) 1c40103f425f (diff)
children d755adce0a9b
files ChangeLog Makefile.am
diffstat 13 files changed, 1301 insertions(+), 55 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Tue Feb 04 15:30:30 2014 +0000
+++ b/ChangeLog	Wed Apr 09 22:51:45 2014 +0100
@@ -1,3 +1,92 @@
+2014-04-02  Andrew John Hughes  <gnu.andrew@redhat.com>
+
+	* NEWS: Add 1.13.2 release notes.
+
+2014-03-25  Andrew John Hughes  <gnu.andrew@redhat.com>
+
+	* Makefile.am:
+	(UPSTREAMED_PATCHES): Add patches from unreleased upstream.
+	(ICEDTEA_PATCHES): Include UPSTREAMED_PATCHES.
+	* NEWS: Updated.
+	* patches/openjdk/7110396-sound_code_build_fix.patch,
+	* patches/openjdk/8035893-jvm_getversioninfo_zeroing.patch,
+	* patches/openjdk/oj6-29-jdk_version_info_zeroing.patch:
+	Add new patches from upstream.
+
+2014-03-24  Pavel Tisnovsky  <ptisnovs@redhat.com>
+
+	* contrib/jck/compile-native-code.sh:
+	Fixed compilation failure on Aarch64.
+
+2012-08-16  Andrew John Hughes  <gnu_andrew@member.fsf.org>
+
+	PR1712: Allow -Werror to be turned off in the
+	HotSpot build
+	* Makefile.am:
+	(WERROR_STATUS): Set to true or false
+	depending on if ENABLE_WERROR is set or not.
+	(ICEDTEA_ENV): Use WERROR_STATUS to set
+	COMPILER_WARNINGS_FATAL.
+	* acinclude.m4:
+	(IT_ENABLE_WERROR): New macro to enable -Werror.
+	This is disabled by default.
+	* configure.ac: Call IT_ENABLE_WERROR.
+	* javac.in: Handle stripping of arguments which
+	take parameters, specifically -Xmaxwarns.
+	* NEWS: Updated.
+
+2014-02-19  Andrew John Hughes  <gnu.andrew@member.fsf.org>
+
+	PR1714: Update PaX support to detect running PaX
+	kernel and use newer tools
+	* Makefile.am:
+	(clean-local): Remove clean-icedtea, clean-icedtea-debug
+	and clean-icedtea-ecj; pulled in by dependents.
+	(.PHONY): Add clean-runnable-icedtea, clean-runnable-icedtea-debug
+	and clean-runnable-icedtea-ecj.
+	(runnable-icedtea): Depend on icedtea and pax-mark-vm.
+	(clean-runnable-icedtea): Clean stamp.
+	(icedtea-against-icedtea): Depend on runnable-icedtea rather
+	than icedtea and pax-mark-vm.
+	(clean-icedtea-against-icedtea): Depend on clean-runnable-icedtea rather
+	than clean-pax-mark-vm.
+	(runnable-icedtea-debug): Depend on icedtea-debug and pax-mark-vm-debug.
+	(clean-runnable-icedtea-debug): Clean stamp.
+	(icedtea-debug-against-icedtea): Depend on runnable-icedtea-debug rather
+	than icedtea-debug and pax-mark-vm-debug.
+	(clean-icedtea-debug-against-icedtea): Depend on clean-runnable-icedtea-debug
+	rather than clean-pax-mark-vm.
+	(add-archive): Depend on runnable-icedtea as the target executes java.
+	(add-archive-debug): Likewise with runnable-icedtea-debug.
+	(check-crypto): Depend on runnable-icedtea as the target executes java.
+	(check-crypto-debug): Likewise with runnable-icedtea-debug.
+	(runnable-icedtea-ecj): Depend on icedtea-ecj and pax-mark-vm-ecj.
+	(clean-runnable-icedtea-ecj): Clean stamp.
+	(icedtea-against-ecj): Depend on runnable-icedtea-ecj rather
+	than icedtea-ecj and pax-mark-vm-ecj.
+	(clean-icedtea-against-ecj): Depend on clean-runnable-icedtea-ecj
+	rather than clean-pax-mark-vm.
+	(add-archive-ecj): Depend on runnable-icedtea-ecj as the target executes java.
+	(check-crypto-boot): Depend on runnable-icedtea-ecj as the target executes java.
+	* NEWS: Updated.
+	* acinclude.m4:
+	(IT_HAS_PAX): New macro to detect whether the running
+	kernel uses PaX.
+	(IT_WITH_PAX): Rewritten to search for PaX tools -
+	currently paxmark.sh, paxctl-ng, chpax and paxctl -
+	and fail if a tool isn't found and a PaX kernel is
+	being used.
+
+2014-03-17  Andrew John Hughes  <gnu.andrew@redhat.com>
+
+	* Makefile.am:
+	(ICEDTEA_PATCHES): Add new patches.
+	* NEWS: Updated.
+	* patches/openjdk/7151089-numa_should_not_free_shm_large_pages.patch,
+	* patches/openjdk/8013057-detect_mmap_commit_failures.patch,
+	* patches/openjdk/8026887-make_large_page_allocations_easier_to_debug.patch:
+	Backports to improve mmap failure output.
+
 2014-02-01  Andrew John Hughes  <gnu.andrew@redhat.com>
 
 	* patches/linker-libs-order.patch:
--- a/Makefile.am	Tue Feb 04 15:30:30 2014 +0000
+++ b/Makefile.am	Wed Apr 09 22:51:45 2014 +0100
@@ -313,9 +313,15 @@
 	patches/lcms.patch
 endif
 
+UPSTREAMED_PATCHES = \
+	patches/openjdk/7110396-sound_code_build_fix.patch \
+	patches/openjdk/8035893-jvm_getversioninfo_zeroing.patch \
+	patches/openjdk/oj6-29-jdk_version_info_zeroing.patch
+
 ICEDTEA_PATCHES = \
 	$(DROP_PATCHES) \
 	$(SECURITY_PATCHES) \
+	$(UPSTREAMED_PATCHES) \
 	patches/openjdk/6733501-icedtea_lcms_test.patch \
 	$(LCMS_PATCHES) \
 	patches/openjdk/4993545-nativeinlightfixer.patch \
@@ -630,7 +636,10 @@
 	patches/windows-jdk-sizecalc.patch \
 	patches/shark_fixes_from_8003868.patch \
 	patches/8003992_support_6.patch \
-	patches/shark-drop_compile_method_arg_following_7083786.patch
+	patches/shark-drop_compile_method_arg_following_7083786.patch \
+	patches/openjdk/7151089-numa_should_not_free_shm_large_pages.patch \
+	patches/openjdk/8013057-detect_mmap_commit_failures.patch \
+	patches/openjdk/8026887-make_large_page_allocations_easier_to_debug.patch
 
 if WITH_RHINO
 ICEDTEA_PATCHES += \
@@ -775,6 +784,12 @@
 ICEDTEA_PKG = $(EMPTY) (${PKGVERSION})
 endif
 
+if ENABLE_WERROR
+WERROR_STATUS=true
+else
+WERROR_STATUS=false
+endif
+
 ICEDTEA_ENV = \
 	ALT_JDK_IMPORT_PATH="$(BOOT_DIR)" \
 	ANT="$(ANT)" \
@@ -817,7 +832,8 @@
 	ALT_OUTPUTDIR="$(BUILD_OUTPUT_DIR)" \
 	STATIC_CXX="false" \
 	BUILD_GCC=gcc$(GCC_SUFFIX) \
-	BUILD_CXX=g++$(GCC_SUFFIX)
+	BUILD_CXX=g++$(GCC_SUFFIX) \
+	COMPILER_WARNINGS_FATAL="$(WERROR_STATUS)"
 
 if ENABLE_CACAO
 ICEDTEA_ENV += \
@@ -966,8 +982,8 @@
 	fi
 
 clean-local: clean-tests $(PULSE_JAVA_CLEAN_TARGET) \
- clean-icedtea clean-icedtea-debug clean-icedtea-ecj clean-extract clean-ports \
- clean-overlay clean-native-ecj clean-icedtea-against-icedtea clean-icedtea-debug-against-icedtea \
+ clean-extract clean-ports clean-overlay clean-native-ecj \
+ clean-icedtea-against-icedtea clean-icedtea-debug-against-icedtea \
  clean-icedtea-against-ecj clean-extract-ecj clean-generated clean-replace-hotspot \
  clean-rewriter clean-rewrite-rhino clean-rt clean-bootstrap-directory \
  clean-bootstrap-directory-ecj clean-bootstrap-directory-symlink \
@@ -1011,7 +1027,8 @@
 	clean-add-pulseaudio-ecj clean-add-nss-ecj clean-add-tzdata-support-ecj clean-fonts \
 	clean-download-hotspot clean-tests clean-tapset-report jtregcheck clean-pax-mark-vm \
 	clean-pax-mark-vm-debug clean-pax-mark-vm-ecj clean-check-crypto clean-check-crypto-debug \
-	clean-check-crypto-boot clean-cryptocheck
+	clean-check-crypto-boot clean-cryptocheck clean-runnable-icedtea clean-runnable-icedtea-debug \
+	clean-runnable-icedtea-ecj
 
 env:
 	@echo 'unset JAVA_HOME'
@@ -1720,31 +1737,44 @@
 	rm -rf $(DEBUG_BUILD_OUTPUT_DIR)
 	rm -f stamps/icedtea-debug.stamp
 
-stamps/icedtea-against-icedtea.stamp: stamps/icedtea.stamp \
+stamps/runnable-icedtea.stamp: stamps/icedtea.stamp stamps/pax-mark-vm.stamp
+	mkdir -p stamps
+	touch $@
+
+clean-runnable-icedtea: clean-icedtea clean-pax-mark-vm
+	rm -f stamps/runnable-icedtea.stamp
+
+stamps/icedtea-against-icedtea.stamp:  stamps/runnable-icedtea.stamp \
  stamps/add-jamvm.stamp stamps/add-cacao.stamp stamps/add-zero.stamp \
  stamps/add-systemtap.stamp stamps/add-pulseaudio.stamp stamps/add-nss.stamp \
- stamps/add-tzdata-support.stamp stamps/add-archive.stamp stamps/pax-mark-vm.stamp \
- stamps/check-crypto.stamp
+ stamps/add-tzdata-support.stamp stamps/add-archive.stamp stamps/check-crypto.stamp
 	mkdir -p stamps
 	touch $@
 
 clean-icedtea-against-icedtea: clean-add-jamvm clean-add-zero clean-add-cacao \
  clean-add-systemtap clean-add-pulseaudio clean-add-nss clean-add-tzdata-support \
- clean-add-archive clean-pax-mark-vm clean-check-crypto
+ clean-add-archive clean-check-crypto clean-runnable-icedtea
 	rm -f stamps/icedtea-against-icedtea.stamp
 
-stamps/icedtea-debug-against-icedtea.stamp: stamps/icedtea-debug.stamp \
+stamps/runnable-icedtea-debug.stamp: stamps/icedtea-debug.stamp stamps/pax-mark-vm-debug.stamp
+	mkdir -p stamps
+	touch $@
+
+clean-runnable-icedtea-debug: clean-icedtea-debug clean-pax-mark-vm-debug
+	rm -f stamps/runnable-icedtea-debug.stamp
+
+stamps/icedtea-debug-against-icedtea.stamp: stamps/runnable-icedtea-debug.stamp \
  stamps/add-jamvm-debug.stamp stamps/add-cacao-debug.stamp \
  stamps/add-zero-debug.stamp stamps/add-systemtap-debug.stamp stamps/add-pulseaudio-debug.stamp \
  stamps/add-nss-debug.stamp stamps/add-tzdata-support-debug.stamp stamps/add-archive-debug.stamp \
- stamps/pax-mark-vm-debug.stamp stamps/check-crypto-debug.stamp
+ stamps/check-crypto-debug.stamp
 	mkdir -p stamps
 	touch $@
 
 clean-icedtea-debug-against-icedtea: clean-add-zero-debug \
  clean-add-jamvm-debug clean-add-cacao-debug clean-add-systemtap-debug \
  clean-add-pulseaudio-debug clean-add-nss-debug clean-add-tzdata-support-debug \
- clean-add-archive-debug clean-pax-mark-vm-debug clean-check-crypto-debug
+ clean-add-archive-debug clean-runnable-icedtea-debug clean-check-crypto-debug
 	rm -f stamps/icedtea-debug-against-icedtea.stamp
 
 stamps/add-systemtap.stamp: stamps/icedtea.stamp
@@ -1986,7 +2016,7 @@
 	fi
 	rm -f stamps/add-tzdata-support-debug.stamp
 
-stamps/add-archive.stamp: stamps/icedtea.stamp
+stamps/add-archive.stamp: stamps/runnable-icedtea.stamp
 if !ENABLE_JAMVM
 if !ENABLE_CACAO
 if !ZERO_BUILD
@@ -2002,7 +2032,7 @@
 	rm -vf $(BUILD_OUTPUT_DIR)/j2sdk-image/jre/lib/$(INSTALL_ARCH_DIR)/*/*.jsa
 	rm -f stamps/add-archive.stamp
 
-stamps/add-archive-debug.stamp: stamps/icedtea-debug.stamp
+stamps/add-archive-debug.stamp: stamps/runnable-icedtea-debug.stamp
 if !ENABLE_JAMVM
 if !ENABLE_CACAO
 if !ZERO_BUILD
@@ -2036,7 +2066,7 @@
 clean-pax-mark-vm-debug:
 	rm -f stamps/pax-mark-vm-debug.stamp
 
-stamps/check-crypto.stamp: stamps/cryptocheck.stamp stamps/icedtea.stamp
+stamps/check-crypto.stamp: stamps/cryptocheck.stamp stamps/runnable-icedtea.stamp
 	if [ -e $(BUILD_OUTPUT_DIR)/j2sdk-image/bin/java ] ; then \
 	  $(BUILD_OUTPUT_DIR)/j2sdk-image/bin/java -cp $(CRYPTO_CHECK_BUILD_DIR) TestCryptoLevel ; \
 	fi
@@ -2046,7 +2076,7 @@
 clean-check-crypto:
 	rm -f stamps/check-crypto.stamp
 
-stamps/check-crypto-debug.stamp: stamps/cryptocheck.stamp stamps/icedtea-debug.stamp
+stamps/check-crypto-debug.stamp: stamps/cryptocheck.stamp stamps/runnable-icedtea-debug.stamp
 	if [ -e $(DEBUG_BUILD_OUTPUT_DIR)/j2sdk-image/bin/java ] ; then \
 	  $(DEBUG_BUILD_OUTPUT_DIR)/j2sdk-image/bin/java -cp $(CRYPTO_CHECK_BUILD_DIR) TestCryptoLevel ; \
 	fi
@@ -2075,14 +2105,21 @@
 	rm -rf $(ECJ_BUILD_OUTPUT_DIR)
 	rm -f stamps/icedtea-ecj.stamp
 
-stamps/icedtea-against-ecj.stamp: stamps/icedtea-ecj.stamp stamps/add-systemtap-ecj.stamp \
+stamps/runnable-icedtea-ecj.stamp: stamps/icedtea-ecj.stamp stamps/pax-mark-vm-ecj.stamp
+	mkdir -p stamps
+	touch $@
+
+clean-runnable-icedtea-ecj: clean-icedtea-ecj clean-pax-mark-vm-ecj
+	rm -f stamps/runnable-icedtea-ecj.stamp
+
+stamps/icedtea-against-ecj.stamp: stamps/runnable-icedtea-ecj.stamp stamps/add-systemtap-ecj.stamp \
  stamps/add-pulseaudio-ecj.stamp stamps/add-nss-ecj.stamp stamps/add-tzdata-support-ecj.stamp \
- stamps/add-archive-ecj.stamp stamps/pax-mark-vm-ecj.stamp stamps/check-crypto-boot.stamp
+ stamps/add-archive-ecj.stamp stamps/check-crypto-boot.stamp
 	mkdir -p stamps
 	touch $@
 
 clean-icedtea-against-ecj: clean-add-systemtap-ecj clean-add-pulseaudio-ecj clean-add-nss-ecj \
- clean-add-tzdata-support-ecj clean-add-archive-ecj clean-pax-mark-vm-ecj clean-check-crypto-boot
+ clean-add-tzdata-support-ecj clean-add-archive-ecj clean-runnable-icedtea-ecj clean-check-crypto-boot
 	rm -f stamps/icedtea-against-ecj.stamp
 
 stamps/add-systemtap-ecj.stamp: stamps/icedtea-ecj.stamp
@@ -2205,7 +2242,7 @@
 	fi
 	rm -f stamps/add-tzdata-support-ecj.stamp
 
-stamps/add-archive-ecj.stamp: stamps/icedtea-ecj.stamp
+stamps/add-archive-ecj.stamp: stamps/runnable-icedtea-ecj.stamp
 if !ENABLE_JAMVM
 if !ENABLE_CACAO
 if !ZERO_BUILD
@@ -2230,7 +2267,7 @@
 clean-pax-mark-vm-ecj:
 	rm -f stamps/pax-mark-vm-ecj.stamp
 
-stamps/check-crypto-boot.stamp: stamps/cryptocheck.stamp stamps/icedtea-ecj.stamp
+stamps/check-crypto-boot.stamp: stamps/cryptocheck.stamp stamps/runnable-icedtea-ecj.stamp
 	if [ -e $(ECJ_BUILD_OUTPUT_DIR)/j2sdk-image/bin/java ] ; then \
 	  $(ECJ_BUILD_OUTPUT_DIR)/j2sdk-image/bin/java -cp $(CRYPTO_CHECK_BUILD_DIR) TestCryptoLevel ; \
 	fi
--- a/NEWS	Tue Feb 04 15:30:30 2014 +0000
+++ b/NEWS	Wed Apr 09 22:51:45 2014 +0100
@@ -14,6 +14,21 @@
 
 New in release 1.14.0 (201X-XX-XX):
 
+* Backports
+  - S7151089: PS NUMA: NUMA allocator should not attempt to free pages when using SHM large pages
+  - S8013057: Detect mmap() commit failures in Linux and Solaris os::commit_memory() impls and call vm_exit_out_of_memory()
+  - S8026887: Make issues due to failed large pages allocations easier to debug
+
+New in release 1.13.2 (2014-03-28):
+
+* Backports
+  - S7110396: Sound code fails to build with gcc 4.6 on multiarch Linux systems
+  - S8035893: JVM_GetVersionInfo fails to zero structure
+  - OJ29: JDK fails to zero jdk_version_info correctly
+* Bug fixes
+  - PR1714, G498288: Update PaX support to detect running PaX kernel and use newer tools
+  - PR1712, G455426: Allow -Werror to be turned off in the HotSpot build
+
 New in release 1.11.15 (2014-01-21):
 
 * Security fixes
--- a/acinclude.m4	Tue Feb 04 15:30:30 2014 +0000
+++ b/acinclude.m4	Wed Apr 09 22:51:45 2014 +0100
@@ -2139,48 +2139,79 @@
   AM_CONDITIONAL([VM_SUPPORTS_XBOOTCLASSPATH], test x"${it_cv_xbootclasspath_works}" = "xyes")
 ])
 
+AC_DEFUN_ONCE([IT_HAS_PAX],
+[
+  AC_MSG_CHECKING([if a PaX kernel is in use])
+  if cat /proc/self/status | grep '^PaX' >&AS_MESSAGE_LOG_FD 2>&1; then
+    pax_active=yes;
+  else
+    pax_active=no;
+  fi
+  AC_MSG_RESULT([${pax_active}])
+  AM_CONDITIONAL([USING_PAX], test x"${pax_active}" = "xyes")
+])
+
 AC_DEFUN_ONCE([IT_WITH_PAX],
 [
-  AC_MSG_CHECKING([for pax utility to use])
+  AC_REQUIRE([IT_HAS_PAX])
+  PAX_DEFAULT=/usr/sbin/paxmark.sh
+  AC_MSG_CHECKING([if a PaX utility was specified])
   AC_ARG_WITH([pax],
               [AS_HELP_STRING(--with-pax=COMMAND,the command used for pax marking)],
   [
-    PAX_COMMAND=${withval}
-    if test "x${PAX_COMMAND}" = "xno"; then
-      PAX_COMMAND="not specified"
+    if test "x${withval}" = "xyes"; then
+      PAX_COMMAND=no
+    else
+      PAX_COMMAND="${withval}"
     fi
   ],
   [ 
-    PAX_COMMAND="not specified"
+    PAX_COMMAND=no
   ])
-  case "x${PAX_COMMAND}" in
-    xchpax)
-      case "${host_cpu}" in
-        i?86)
-          PAX_COMMAND_ARGS="-msp"
-          ;;
-        *)
-          PAX_COMMAND_ARGS="-m"
-          ;;
-      esac
-      ;;
-    xpaxctl)
-      case "${host_cpu}" in
-        i?86)
-          PAX_COMMAND_ARGS="-msp"
-          ;;
-        *)
-          PAX_COMMAND_ARGS="-m"
-          ;;
-      esac
-      ;;
-    *)
-      PAX_COMMAND="not specified"
-      PAX_COMMAND_ARGS="not specified"
-      ;;
-  esac
+  AC_MSG_RESULT(${PAX_COMMAND})
+  if test "x${PAX_COMMAND}" == "xno"; then
+    PAX_COMMAND=${PAX_DEFAULT}
+  fi
+  AC_MSG_CHECKING([if $PAX_COMMAND is a valid executable file])
+  if test -x "${PAX_COMMAND}" && test -f "${PAX_COMMAND}"; then
+    AC_MSG_RESULT([yes])
+  else
+    AC_MSG_RESULT([no])
+    PAX_COMMAND=""
+    AC_PATH_PROG(PAX_COMMAND, "paxmark.sh")
+    if test -z "${PAX_COMMAND}"; then
+      AC_PATH_PROG(PAX_COMMAND, "paxctl-ng")
+    fi
+    if test -z "${PAX_COMMAND}"; then
+      AC_PATH_PROG(PAX_COMMAND, "chpax")
+    fi
+    if test -z "${PAX_COMMAND}"; then
+      AC_PATH_PROG(PAX_COMMAND, "paxctl")
+    fi
+    if test -z "${PAX_COMMAND}"; then
+      if test "x${pax_active}" = "xyes"; then
+        AC_MSG_ERROR("No PaX utility found and running on a PaX kernel.")
+      else
+        AC_MSG_WARN("No PaX utility found.")
+      fi
+    fi
+  fi
+  if test -z "${PAX_COMMAND}"; then
+    PAX_COMMAND="not specified"
+    PAX_COMMAND_ARGS="not specified"
+  else
+    AC_MSG_CHECKING([which options to pass to ${PAX_COMMAND}])
+    case "${host_cpu}" in
+      i?86)
+        PAX_COMMAND_ARGS="-msp"
+        ;;
+      *)
+        PAX_COMMAND_ARGS="-m"
+        ;;
+    esac
+    AC_MSG_RESULT(${PAX_COMMAND_ARGS})
+  fi
   AM_CONDITIONAL(WITH_PAX, test "x${PAX_COMMAND}" != "xnot specified")
-  AC_MSG_RESULT(${PAX_COMMAND})
   AC_SUBST(PAX_COMMAND)
   AC_SUBST(PAX_COMMAND_ARGS)
 ])
@@ -2264,3 +2295,25 @@
   AC_MSG_RESULT([$enable_jar_compression])
   AM_CONDITIONAL([ENABLE_JAR_COMPRESSION], test x"${enable_jar_compression}" = "xyes")
 ])
+
+AC_DEFUN([IT_ENABLE_WERROR],
+[
+  AC_MSG_CHECKING([whether to enable -Werror])
+  AC_ARG_ENABLE([Werror],
+                [AS_HELP_STRING(--enable-Werror,build with -Werror [[default=no]])],
+  [
+    case "${enableval}" in
+      yes)
+        enable_werror=yes
+        ;;
+      *)
+        enable_werror=no
+        ;;
+    esac
+  ],
+  [
+    enable_werror=no
+  ])
+  AC_MSG_RESULT([$enable_werror])
+  AM_CONDITIONAL([ENABLE_WERROR], test x"${enable_werror}" = "xyes")
+])
--- a/configure.ac	Tue Feb 04 15:30:30 2014 +0000
+++ b/configure.ac	Wed Apr 09 22:51:45 2014 +0100
@@ -283,6 +283,7 @@
 IT_WITH_JAMVM_SRC_ZIP
 
 IT_DISABLE_OPTIMIZATIONS
+IT_ENABLE_WERROR
 IT_ENABLE_JAR_COMPRESSION
 IT_SET_SHARK_BUILD
 IT_ENABLE_ZERO_BUILD
--- a/contrib/jck/compile-native-code.sh	Tue Feb 04 15:30:30 2014 +0000
+++ b/contrib/jck/compile-native-code.sh	Wed Apr 09 22:51:45 2014 +0100
@@ -31,6 +31,9 @@
   x86_64|ppc64|s390x)
     MFLAG=-m64
     ;;
+  aarch64)
+    MFLAG=-march=armv8-a
+    ;;
   *)
     echo 1>&2 "error: unhandled arch '$arch'"
     exit 1
--- a/javac.in	Tue Feb 04 15:30:30 2014 +0000
+++ b/javac.in	Wed Apr 09 22:51:45 2014 +0100
@@ -1,7 +1,8 @@
 #!/usr/bin/perl -w
 use strict;
 use constant NO_DUP_ARGS => qw(-source -target -d -encoding);
-use constant STRIP_ARGS => qw(-Werror -implicit:none -J-Xbootclasspath/p:);
+use constant STRIP_ARGS_1 => qw(-Werror -implicit:none -J-Xbootclasspath/p:);
+use constant STRIP_ARGS_2 => qw(-Xmaxwarns);
 
 my $ECJ_WARNINGS="-nowarn";
 my $JAVAC_WARNINGS="-nowarn";
@@ -49,12 +50,18 @@
 	}
     }
 
-    for my $opt (STRIP_ARGS) 
+    for my $opt (STRIP_ARGS_1)
     {
 	my @indices = reverse grep {$new_args[$_] eq $opt} 0..$#new_args;
 	splice @new_args, $_, 1 for @indices;
     }
 
+    for my $opt (STRIP_ARGS_2) 
+    {
+	my @indices = reverse grep {$new_args[$_] eq $opt} 0..$#new_args;
+	splice @new_args, $_, 2 for @indices;
+    }
+
     return \@new_args;
 }
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/openjdk/7110396-sound_code_build_fix.patch	Wed Apr 09 22:51:45 2014 +0100
@@ -0,0 +1,22 @@
+# HG changeset patch
+# User mr
+# Date 1327351181 28800
+#      Mon Jan 23 12:39:41 2012 -0800
+# Node ID b49e33de40eafc113d3ca822f4abe2fde31d2cc2
+# Parent  07a296eb4c9cb88d2d84561ecfe70e10b167a2ac
+7110396: Sound code fails to build with gcc 4.6 on multiarch Linux systems
+Reviewed-by: ohair
+Contributed-by: edvard.wendelin@oracle.com
+
+diff -r 07a296eb4c9c -r b49e33de40ea make/javax/sound/jsoundalsa/Makefile
+--- openjdk/jdk/make/javax/sound/jsoundalsa/Makefile	Tue Jan 21 13:39:13 2014 -0500
++++ openjdk/jdk/make/javax/sound/jsoundalsa/Makefile	Mon Jan 23 12:39:41 2012 -0800
+@@ -65,7 +65,7 @@
+ 	$(MIDIFILES_export) \
+ 	$(PORTFILES_export)
+ 
+-LDFLAGS += -lasound
++OTHER_LDLIBS += -lasound
+ 
+ CPPFLAGS += \
+ 	-DUSE_DAUDIO=TRUE \
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/openjdk/7151089-numa_should_not_free_shm_large_pages.patch	Wed Apr 09 22:51:45 2014 +0100
@@ -0,0 +1,29 @@
+# HG changeset patch
+# User iveresov
+# Date 1331583127 25200
+#      Mon Mar 12 13:12:07 2012 -0700
+# Node ID 3f0dff7a9cf590ef3e5d7f2dcf6c8247b65c9d10
+# Parent  3442eb7ef2d216d6bf655d537929a2d31a76a321
+7151089: PS NUMA: NUMA allocator should not attempt to free pages when using SHM large pages
+Summary: Don't attempt to uncommit SHM-based large pages
+Reviewed-by: kvn
+
+diff -r 3442eb7ef2d2 -r 3f0dff7a9cf5 src/os/linux/vm/os_linux.cpp
+--- openjdk/hotspot/src/os/linux/vm/os_linux.cpp	Tue Jan 14 20:24:44 2014 -0500
++++ openjdk/hotspot/src/os/linux/vm/os_linux.cpp	Mon Mar 12 13:12:07 2012 -0700
+@@ -2568,7 +2568,14 @@
+ }
+ 
+ void os::free_memory(char *addr, size_t bytes, size_t alignment_hint) {
+-  commit_memory(addr, bytes, alignment_hint, false);
++  // This method works by doing an mmap over an existing mmaping and effectively discarding
++  // the existing pages. However it won't work for SHM-based large pages that cannot be
++  // uncommitted at all. We don't do anything in this case to avoid creating a segment with
++  // small pages on top of the SHM segment. This method always works for small pages, so we
++  // allow that in any case.
++  if (alignment_hint <= (size_t)os::vm_page_size() || !UseSHM) {
++    commit_memory(addr, bytes, alignment_hint, false);
++  }
+ }
+ 
+ void os::numa_make_global(char *addr, size_t bytes) {
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/openjdk/8013057-detect_mmap_commit_failures.patch	Wed Apr 09 22:51:45 2014 +0100
@@ -0,0 +1,867 @@
+# HG changeset patch
+# User dcubed
+# Date 1394474985 0
+#      Mon Mar 10 18:09:45 2014 +0000
+# Node ID cbdd11a54b82eb7731d16abbc6df3c9b4d42c78b
+# Parent  3f0dff7a9cf590ef3e5d7f2dcf6c8247b65c9d10
+8013057: assert(_needs_gc || SafepointSynchronize::is_at_safepoint()) failed: only read at safepoint
+Summary: Detect mmap() commit failures in Linux and Solaris os::commit_memory() impls and call vm_exit_out_of_memory(). Add os::commit_memory_or_exit(). Also tidy up some NMT accounting and some mmap() return value checking.
+Reviewed-by: zgu, stefank, dholmes, dsamersoff
+
+diff -r 3f0dff7a9cf5 -r cbdd11a54b82 src/os/bsd/vm/os_bsd.cpp
+--- openjdk/hotspot/src/os/bsd/vm/os_bsd.cpp	Mon Mar 12 13:12:07 2012 -0700
++++ openjdk/hotspot/src/os/bsd/vm/os_bsd.cpp	Mon Mar 10 18:09:45 2014 +0000
+@@ -2762,6 +2762,13 @@
+   }
+ }
+ 
++static void warn_fail_commit_memory(char* addr, size_t size, bool exec,
++                                    int err) {
++  warning("INFO: os::commit_memory(" PTR_FORMAT ", " SIZE_FORMAT
++          ", %d) failed; error='%s' (errno=%d)", addr, size, exec,
++          strerror(err), err);
++}
++
+ // NOTE: Bsd kernel does not really reserve the pages for us.
+ //       All it does is to check if there are enough free pages
+ //       left at the time of mmap(). This could be a potential
+@@ -2770,12 +2777,22 @@
+   int prot = exec ? PROT_READ|PROT_WRITE|PROT_EXEC : PROT_READ|PROT_WRITE;
+ #ifdef __OpenBSD__
+   // XXX: Work-around mmap/MAP_FIXED bug temporarily on OpenBSD
+-  return ::mprotect(addr, size, prot) == 0;
++  if (::mprotect(addr, size, prot) == 0) {
++    return true;
++  }
+ #else
+   uintptr_t res = (uintptr_t) ::mmap(addr, size, prot,
+                                    MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0);
+-  return res != (uintptr_t) MAP_FAILED;
++  if (res != (uintptr_t) MAP_FAILED) {
++    return true;
++  }
+ #endif
++
++  // Warn about any commit errors we see in non-product builds just
++  // in case mmap() doesn't work as described on the man page.
++  NOT_PRODUCT(warn_fail_commit_memory(addr, size, exec, errno);)
++
++  return false;
+ }
+ 
+ #ifndef _ALLBSD_SOURCE
+@@ -2803,9 +2820,27 @@
+   }
+ #endif
+ 
++  // alignment_hint is ignored on this OS
+   return commit_memory(addr, size, exec);
+ }
+ 
++void os::commit_memory_or_exit(char* addr, size_t size, bool exec,
++			       const char* mesg) {
++  assert(mesg != NULL, "mesg must be specified");
++  if (!pd_commit_memory(addr, size, exec)) {
++    // add extra info in product mode for vm_exit_out_of_memory():
++    PRODUCT_ONLY(warn_fail_commit_memory(addr, size, exec, errno);)
++    vm_exit_out_of_memory(size, mesg);
++  }
++}
++
++void os::commit_memory_or_exit(char* addr, size_t size,
++			       size_t alignment_hint, bool exec,
++			       const char* mesg) {
++  // alignment_hint is ignored on this OS
++  pd_commit_memory_or_exit(addr, size, exec, mesg);
++}
++
+ void os::realign_memory(char *addr, size_t bytes, size_t alignment_hint) {
+ #ifndef _ALLBSD_SOURCE
+   if (UseHugeTLBFS && alignment_hint > (size_t)vm_page_size()) {
+@@ -2970,7 +3005,7 @@
+ }
+ 
+ bool os::create_stack_guard_pages(char* addr, size_t size) {
+-  return os::commit_memory(addr, size);
++  return os::commit_memory(addr, size, !ExecMem);
+ }
+ 
+ // If this is a growable mapping, remove the guard pages entirely by
+@@ -4467,7 +4502,7 @@
+ 
+   if (!UseMembar) {
+     address mem_serialize_page = (address) ::mmap(NULL, Bsd::page_size(), PROT_READ | PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0);
+-    guarantee( mem_serialize_page != NULL, "mmap Failed for memory serialize page");
++    guarantee( mem_serialize_page != MAP_FAILED, "mmap Failed for memory serialize page");
+     os::set_memory_serialize_page( mem_serialize_page );
+ 
+ #ifndef PRODUCT
+diff -r 3f0dff7a9cf5 -r cbdd11a54b82 src/os/bsd/vm/perfMemory_bsd.cpp
+--- openjdk/hotspot/src/os/bsd/vm/perfMemory_bsd.cpp	Mon Mar 12 13:12:07 2012 -0700
++++ openjdk/hotspot/src/os/bsd/vm/perfMemory_bsd.cpp	Mon Mar 10 18:09:45 2014 +0000
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 2001, 2013, 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
+@@ -59,7 +59,7 @@
+   }
+ 
+   // commit memory
+-  if (!os::commit_memory(mapAddress, size)) {
++  if (!os::commit_memory(mapAddress, size, !ExecMem)) {
+     if (PrintMiscellaneous && Verbose) {
+       warning("Could not commit PerfData memory\n");
+     }
+diff -r 3f0dff7a9cf5 -r cbdd11a54b82 src/os/linux/vm/os_linux.cpp
+--- openjdk/hotspot/src/os/linux/vm/os_linux.cpp	Mon Mar 12 13:12:07 2012 -0700
++++ openjdk/hotspot/src/os/linux/vm/os_linux.cpp	Mon Mar 10 18:09:45 2014 +0000
+@@ -2508,11 +2508,49 @@
+   }
+ }
+ 
++static bool recoverable_mmap_error(int err) {
++  // See if the error is one we can let the caller handle. This
++  // list of errno values comes from JBS-6843484. I can't find a
++  // Linux man page that documents this specific set of errno
++  // values so while this list currently matches Solaris, it may
++  // change as we gain experience with this failure mode.
++  switch (err) {
++  case EBADF:
++  case EINVAL:
++  case ENOTSUP:
++    // let the caller deal with these errors
++    return true;
++
++  default:
++    // Any remaining errors on this OS can cause our reserved mapping
++    // to be lost. That can cause confusion where different data
++    // structures think they have the same memory mapped. The worst
++    // scenario is if both the VM and a library think they have the
++    // same memory mapped.
++    return false;
++  }
++}
++
++static void warn_fail_commit_memory(char* addr, size_t size, bool exec,
++                                    int err) {
++  warning("INFO: os::commit_memory(" PTR_FORMAT ", " SIZE_FORMAT
++          ", %d) failed; error='%s' (errno=%d)", addr, size, exec,
++          strerror(err), err);
++}
++
++static void warn_fail_commit_memory(char* addr, size_t size,
++                                    size_t alignment_hint, bool exec,
++                                    int err) {
++  warning("INFO: os::commit_memory(" PTR_FORMAT ", " SIZE_FORMAT
++          ", " SIZE_FORMAT ", %d) failed; error='%s' (errno=%d)", addr, size,
++          alignment_hint, exec, strerror(err), err);
++}
++
+ // NOTE: Linux kernel does not really reserve the pages for us.
+ //       All it does is to check if there are enough free pages
+ //       left at the time of mmap(). This could be a potential
+ //       problem.
+-bool os::commit_memory(char* addr, size_t size, bool exec) {
++int os::Linux::commit_memory_impl(char* addr, size_t size, bool exec) {
+   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, -1, 0);
+@@ -2520,9 +2558,32 @@
+     if (UseNUMAInterleaving) {
+       numa_make_global(addr, size);
+     }
+-    return true;
+-  }
+-  return false;
++    return 0;
++  }
++
++  int err = errno;  // save errno from mmap() call above
++
++  if (!recoverable_mmap_error(err)) {
++    warn_fail_commit_memory(addr, size, exec, err);
++    vm_exit_out_of_memory(size, "committing reserved memory.");
++  }
++
++  return err;
++}
++
++bool os::commit_memory(char* addr, size_t size, bool exec) {
++  return os::Linux::commit_memory_impl(addr, size, exec) == 0;
++}
++
++void os::commit_memory_or_exit(char* addr, size_t size, bool exec,
++                                  const char* mesg) {
++  assert(mesg != NULL, "mesg must be specified");
++  int err = os::Linux::commit_memory_impl(addr, size, exec);
++  if (err != 0) {
++    // the caller wants all commit errors to exit with the specified mesg:
++    warn_fail_commit_memory(addr, size, exec, err);
++    vm_exit_out_of_memory(size, mesg);
++  }
+ }
+ 
+ // Define MAP_HUGETLB here so we can build HotSpot on old systems.
+@@ -2535,8 +2596,9 @@
+ #define MADV_HUGEPAGE 14
+ #endif
+ 
+-bool os::commit_memory(char* addr, size_t size, size_t alignment_hint,
+-                       bool exec) {
++int os::Linux::commit_memory_impl(char* addr, size_t size,
++                                  size_t alignment_hint, bool exec) {
++  int err;
+   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 =
+@@ -2547,16 +2609,45 @@
+       if (UseNUMAInterleaving) {
+         numa_make_global(addr, size);
+       }
+-      return true;
++      return 0;
++    }
++
++    err = errno;  // save errno from mmap() call above
++
++    if (!recoverable_mmap_error(err)) {
++      // However, it is not clear that this loss of our reserved mapping
++      // happens with large pages on Linux or that we cannot recover
++      // from the loss. For now, we just issue a warning and we don't
++      // call vm_exit_out_of_memory(). This issue is being tracked by
++      // JBS-8007074.
++      warn_fail_commit_memory(addr, size, alignment_hint, exec, err);
++//    vm_exit_out_of_memory(size, "committing reserved memory.");
+     }
+     // Fall through and try to use small pages
+   }
+ 
+-  if (commit_memory(addr, size, exec)) {
++  err = os::Linux::commit_memory_impl(addr, size, exec);
++  if (err == 0) {
+     realign_memory(addr, size, alignment_hint);
+-    return true;
+-  }
+-  return false;
++  }
++  return err;
++}
++
++bool os::commit_memory(char* addr, size_t size, size_t alignment_hint,
++                          bool exec) {
++  return os::Linux::commit_memory_impl(addr, size, alignment_hint, exec) == 0;
++}
++
++void os::commit_memory_or_exit(char* addr, size_t size,
++                                  size_t alignment_hint, bool exec,
++                                  const char* mesg) {
++  assert(mesg != NULL, "mesg must be specified");
++  int err = os::Linux::commit_memory_impl(addr, size, alignment_hint, exec);
++  if (err != 0) {
++    // the caller wants all commit errors to exit with the specified mesg:
++    warn_fail_commit_memory(addr, size, alignment_hint, exec, err);
++    vm_exit_out_of_memory(size, mesg);
++  }
+ }
+ 
+ void os::realign_memory(char *addr, size_t bytes, size_t alignment_hint) {
+@@ -2574,7 +2665,7 @@
+   // small pages on top of the SHM segment. This method always works for small pages, so we
+   // allow that in any case.
+   if (alignment_hint <= (size_t)os::vm_page_size() || !UseSHM) {
+-    commit_memory(addr, bytes, alignment_hint, false);
++    commit_memory(addr, bytes, alignment_hint, !ExecMem);
+   }
+ }
+ 
+@@ -2827,7 +2918,7 @@
+       ::munmap((void*)stack_extent, (uintptr_t)addr - stack_extent);
+   }
+ 
+-  return os::commit_memory(addr, size);
++  return os::commit_memory(addr, size, !ExecMem);
+ }
+ 
+ // If this is a growable mapping, remove the guard pages entirely by
+@@ -2948,7 +3039,7 @@
+                   MAP_ANONYMOUS|MAP_PRIVATE|MAP_HUGETLB,
+                   -1, 0);
+ 
+-  if (p != (void *) -1) {
++  if (p != MAP_FAILED) {
+     // We don't know if this really is a huge page or not.
+     FILE *fp = fopen("/proc/self/maps", "r");
+     if (fp) {
+@@ -4225,7 +4316,7 @@
+ 
+   if (!UseMembar) {
+     address mem_serialize_page = (address) ::mmap(NULL, Linux::page_size(), PROT_READ | PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0);
+-    guarantee( mem_serialize_page != NULL, "mmap Failed for memory serialize page");
++    guarantee( mem_serialize_page != MAP_FAILED, "mmap Failed for memory serialize page");
+     os::set_memory_serialize_page( mem_serialize_page );
+ 
+ #ifndef PRODUCT
+diff -r 3f0dff7a9cf5 -r cbdd11a54b82 src/os/linux/vm/os_linux.hpp
+--- openjdk/hotspot/src/os/linux/vm/os_linux.hpp	Mon Mar 12 13:12:07 2012 -0700
++++ openjdk/hotspot/src/os/linux/vm/os_linux.hpp	Mon Mar 10 18:09:45 2014 +0000
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 1999, 2013, 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
+@@ -75,6 +75,10 @@
+   static julong physical_memory() { return _physical_memory; }
+   static void initialize_system_info();
+ 
++  static int commit_memory_impl(char* addr, size_t bytes, bool exec);
++  static int commit_memory_impl(char* addr, size_t bytes,
++                                size_t alignment_hint, bool exec);
++
+   static void set_glibc_version(const char *s)      { _glibc_version = s; }
+   static void set_libpthread_version(const char *s) { _libpthread_version = s; }
+ 
+diff -r 3f0dff7a9cf5 -r cbdd11a54b82 src/os/linux/vm/perfMemory_linux.cpp
+--- openjdk/hotspot/src/os/linux/vm/perfMemory_linux.cpp	Mon Mar 12 13:12:07 2012 -0700
++++ openjdk/hotspot/src/os/linux/vm/perfMemory_linux.cpp	Mon Mar 10 18:09:45 2014 +0000
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 2001, 2013, 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
+@@ -59,7 +59,7 @@
+   }
+ 
+   // commit memory
+-  if (!os::commit_memory(mapAddress, size)) {
++  if (!os::commit_memory(mapAddress, size, !ExecMem)) {
+     if (PrintMiscellaneous && Verbose) {
+       warning("Could not commit PerfData memory\n");
+     }
+diff -r 3f0dff7a9cf5 -r cbdd11a54b82 src/os/solaris/vm/os_solaris.cpp
+--- openjdk/hotspot/src/os/solaris/vm/os_solaris.cpp	Mon Mar 12 13:12:07 2012 -0700
++++ openjdk/hotspot/src/os/solaris/vm/os_solaris.cpp	Mon Mar 10 18:09:45 2014 +0000
+@@ -2769,7 +2769,42 @@
+   return page_size;
+ }
+ 
+-bool os::commit_memory(char* addr, size_t bytes, bool exec) {
++static bool recoverable_mmap_error(int err) {
++  // See if the error is one we can let the caller handle. This
++  // list of errno values comes from the Solaris mmap(2) man page.
++  switch (err) {
++  case EBADF:
++  case EINVAL:
++  case ENOTSUP:
++    // let the caller deal with these errors
++    return true;
++
++  default:
++    // Any remaining errors on this OS can cause our reserved mapping
++    // to be lost. That can cause confusion where different data
++    // structures think they have the same memory mapped. The worst
++    // scenario is if both the VM and a library think they have the
++    // same memory mapped.
++    return false;
++  }
++}
++
++static void warn_fail_commit_memory(char* addr, size_t bytes, bool exec,
++                                    int err) {
++  warning("INFO: os::commit_memory(" PTR_FORMAT ", " SIZE_FORMAT
++          ", %d) failed; error='%s' (errno=%d)", addr, bytes, exec,
++          strerror(err), err);
++}
++
++static void warn_fail_commit_memory(char* addr, size_t bytes,
++                                    size_t alignment_hint, bool exec,
++                                    int err) {
++  warning("INFO: os::commit_memory(" PTR_FORMAT ", " SIZE_FORMAT
++          ", " SIZE_FORMAT ", %d) failed; error='%s' (errno=%d)", addr, bytes,
++          alignment_hint, exec, strerror(err), err);
++}
++
++int os::Solaris::commit_memory_impl(char* addr, size_t bytes, bool exec) {
+   int prot = exec ? PROT_READ|PROT_WRITE|PROT_EXEC : PROT_READ|PROT_WRITE;
+   size_t size = bytes;
+   char *res = Solaris::mmap_chunk(addr, size, MAP_PRIVATE|MAP_FIXED, prot);
+@@ -2777,14 +2812,38 @@
+     if (UseNUMAInterleaving) {
+       numa_make_global(addr, bytes);
+     }
+-    return true;
+-  }
+-  return false;
+-}
+-
+-bool os::commit_memory(char* addr, size_t bytes, size_t alignment_hint,
+-                       bool exec) {
+-  if (commit_memory(addr, bytes, exec)) {
++    return 0;
++  }
++
++  int err = errno;  // save errno from mmap() call in mmap_chunk()
++
++  if (!recoverable_mmap_error(err)) {
++    warn_fail_commit_memory(addr, bytes, exec, err);
++    vm_exit_out_of_memory(bytes, "committing reserved memory.");
++  }
++
++  return err;
++}
++
++bool os::commit_memory(char* addr, size_t bytes, bool exec) {
++  return Solaris::commit_memory_impl(addr, bytes, exec) == 0;
++}
++
++void os::commit_memory_or_exit(char* addr, size_t bytes, bool exec,
++                                  const char* mesg) {
++  assert(mesg != NULL, "mesg must be specified");
++  int err = os::Solaris::commit_memory_impl(addr, bytes, exec);
++  if (err != 0) {
++    // the caller wants all commit errors to exit with the specified mesg:
++    warn_fail_commit_memory(addr, bytes, exec, err);
++    vm_exit_out_of_memory(bytes, mesg);
++  }
++}
++
++int os::Solaris::commit_memory_impl(char* addr, size_t bytes,
++                                    size_t alignment_hint, bool exec) {
++  int err = Solaris::commit_memory_impl(addr, bytes, exec);
++  if (err == 0) {
+     if (UseMPSS && alignment_hint > (size_t)vm_page_size()) {
+       // If the large page size has been set and the VM
+       // is using large pages, use the large page size
+@@ -2806,9 +2865,25 @@
+       // Since this is a hint, ignore any failures.
+       (void)Solaris::set_mpss_range(addr, bytes, page_size);
+     }
+-    return true;
+-  }
+-  return false;
++  }
++  return err;
++}
++
++bool os::commit_memory(char* addr, size_t bytes, size_t alignment_hint,
++                          bool exec) {
++  return Solaris::commit_memory_impl(addr, bytes, alignment_hint, exec) == 0;
++}
++
++void os::commit_memory_or_exit(char* addr, size_t bytes,
++                                  size_t alignment_hint, bool exec,
++                                  const char* mesg) {
++  assert(mesg != NULL, "mesg must be specified");
++  int err = os::Solaris::commit_memory_impl(addr, bytes, alignment_hint, exec);
++  if (err != 0) {
++    // the caller wants all commit errors to exit with the specified mesg:
++    warn_fail_commit_memory(addr, bytes, alignment_hint, exec, err);
++    vm_exit_out_of_memory(bytes, mesg);
++  }
+ }
+ 
+ // Uncommit the pages in a specified region.
+@@ -2820,7 +2895,7 @@
+ }
+ 
+ bool os::create_stack_guard_pages(char* addr, size_t size) {
+-  return os::commit_memory(addr, size);
++  return os::commit_memory(addr, size, !ExecMem);
+ }
+ 
+ bool os::remove_stack_guard_pages(char* addr, size_t size) {
+diff -r 3f0dff7a9cf5 -r cbdd11a54b82 src/os/solaris/vm/os_solaris.hpp
+--- openjdk/hotspot/src/os/solaris/vm/os_solaris.hpp	Mon Mar 12 13:12:07 2012 -0700
++++ openjdk/hotspot/src/os/solaris/vm/os_solaris.hpp	Mon Mar 10 18:09:45 2014 +0000
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 1997, 2013, 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
+@@ -166,6 +166,9 @@
+   static int _dev_zero_fd;
+   static int get_dev_zero_fd() { return _dev_zero_fd; }
+   static void set_dev_zero_fd(int fd) { _dev_zero_fd = fd; }
++  static int commit_memory_impl(char* addr, size_t bytes, bool exec);
++  static int commit_memory_impl(char* addr, size_t bytes,
++                                size_t alignment_hint, bool exec);
+   static char* mmap_chunk(char *addr, size_t size, int flags, int prot);
+   static char* anon_mmap(char* requested_addr, size_t bytes, size_t alignment_hint, bool fixed);
+   static bool mpss_sanity_check(bool warn, size_t * page_size);
+diff -r 3f0dff7a9cf5 -r cbdd11a54b82 src/os/solaris/vm/perfMemory_solaris.cpp
+--- openjdk/hotspot/src/os/solaris/vm/perfMemory_solaris.cpp	Mon Mar 12 13:12:07 2012 -0700
++++ openjdk/hotspot/src/os/solaris/vm/perfMemory_solaris.cpp	Mon Mar 10 18:09:45 2014 +0000
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 2001, 2013, 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 @@
+   }
+ 
+   // commit memory
+-  if (!os::commit_memory(mapAddress, size)) {
++  if (!os::commit_memory(mapAddress, size, !ExecMem)) {
+     if (PrintMiscellaneous && Verbose) {
+       warning("Could not commit PerfData memory\n");
+     }
+diff -r 3f0dff7a9cf5 -r cbdd11a54b82 src/os/windows/vm/os_windows.cpp
+--- openjdk/hotspot/src/os/windows/vm/os_windows.cpp	Mon Mar 12 13:12:07 2012 -0700
++++ openjdk/hotspot/src/os/windows/vm/os_windows.cpp	Mon Mar 10 18:09:45 2014 +0000
+@@ -2410,7 +2410,7 @@
+                   addr = (address)((uintptr_t)addr &
+                          (~((uintptr_t)os::vm_page_size() - (uintptr_t)1)));
+                   os::commit_memory((char *)addr, thread->stack_base() - addr,
+-                                    false );
++                                    !ExecMem);
+                   return EXCEPTION_CONTINUE_EXECUTION;
+           }
+           else
+@@ -3067,6 +3067,15 @@
+ void os::print_statistics() {
+ }
+ 
++static void warn_fail_commit_memory(char* addr, size_t bytes, bool exec) {
++  int err = os::get_last_error();
++  char buf[256];
++  size_t buf_len = os::lasterror(buf, sizeof(buf));
++  warning("INFO: os::commit_memory(" PTR_FORMAT ", " SIZE_FORMAT
++          ", %d) failed; error='%s' (DOS error/errno=%d)", addr, bytes,
++          exec, buf_len != 0 ? buf : "<no_error_string>", err);
++}
++
+ bool os::commit_memory(char* addr, size_t bytes, bool exec) {
+   if (bytes == 0) {
+     // Don't bother the OS with noops.
+@@ -3081,11 +3090,17 @@
+   // is always within a reserve covered by a single VirtualAlloc
+   // in that case we can just do a single commit for the requested size
+   if (!UseNUMAInterleaving) {
+-    if (VirtualAlloc(addr, bytes, MEM_COMMIT, PAGE_READWRITE) == NULL) return false;
++    if (VirtualAlloc(addr, bytes, MEM_COMMIT, PAGE_READWRITE) == NULL) {
++      NOT_PRODUCT(warn_fail_commit_memory(addr, bytes, exec);)
++      return false;
++    }
+     if (exec) {
+       DWORD oldprot;
+       // Windows doc says to use VirtualProtect to get execute permissions
+-      if (!VirtualProtect(addr, bytes, PAGE_EXECUTE_READWRITE, &oldprot)) return false;
++      if (!VirtualProtect(addr, bytes, PAGE_EXECUTE_READWRITE, &oldprot)) {
++        NOT_PRODUCT(warn_fail_commit_memory(addr, bytes, exec);)
++        return false;
++      }
+     }
+     return true;
+   } else {
+@@ -3100,12 +3115,20 @@
+       MEMORY_BASIC_INFORMATION alloc_info;
+       VirtualQuery(next_alloc_addr, &alloc_info, sizeof(alloc_info));
+       size_t bytes_to_rq = MIN2(bytes_remaining, (size_t)alloc_info.RegionSize);
+-      if (VirtualAlloc(next_alloc_addr, bytes_to_rq, MEM_COMMIT, PAGE_READWRITE) == NULL)
++      if (VirtualAlloc(next_alloc_addr, bytes_to_rq, MEM_COMMIT,
++                       PAGE_READWRITE) == NULL) {
++        NOT_PRODUCT(warn_fail_commit_memory(next_alloc_addr, bytes_to_rq,
++                                            exec);)
+         return false;
++      }
+       if (exec) {
+         DWORD oldprot;
+-        if (!VirtualProtect(next_alloc_addr, bytes_to_rq, PAGE_EXECUTE_READWRITE, &oldprot))
++        if (!VirtualProtect(next_alloc_addr, bytes_to_rq,
++                            PAGE_EXECUTE_READWRITE, &oldprot)) {
++          NOT_PRODUCT(warn_fail_commit_memory(next_alloc_addr, bytes_to_rq,
++                                              exec);)
+           return false;
++        }
+       }
+       bytes_remaining -= bytes_to_rq;
+       next_alloc_addr += bytes_to_rq;
+@@ -3117,9 +3140,26 @@
+ 
+ bool os::commit_memory(char* addr, size_t size, size_t alignment_hint,
+                        bool exec) {
++  // alignment_hint is ignored on this OS
+   return commit_memory(addr, size, exec);
+ }
+ 
++void os::commit_memory_or_exit(char* addr, size_t size, bool exec,
++                                  const char* mesg) {
++  assert(mesg != NULL, "mesg must be specified");
++  if (!pd_commit_memory(addr, size, exec)) {
++    warn_fail_commit_memory(addr, size, exec);
++    vm_exit_out_of_memory(size, mesg);
++  }
++}
++
++void os::commit_memory_or_exit(char* addr, size_t size,
++                                  size_t alignment_hint, bool exec,
++                                  const char* mesg) {
++  // alignment_hint is ignored on this OS
++  pd_commit_memory_or_exit(addr, size, exec, mesg);
++}
++
+ bool os::uncommit_memory(char* addr, size_t bytes) {
+   if (bytes == 0) {
+     // Don't bother the OS with noops.
+@@ -3135,7 +3175,7 @@
+ }
+ 
+ bool os::create_stack_guard_pages(char* addr, size_t size) {
+-  return os::commit_memory(addr, size);
++  return os::commit_memory(addr, size, !ExecMem);
+ }
+ 
+ bool os::remove_stack_guard_pages(char* addr, size_t size) {
+@@ -3159,8 +3199,9 @@
+ 
+   // Strange enough, but on Win32 one can change protection only for committed
+   // memory, not a big deal anyway, as bytes less or equal than 64K
+-  if (!is_committed && !commit_memory(addr, bytes, prot == MEM_PROT_RWX)) {
+-    fatal("cannot commit protection page");
++  if (!is_committed) {
++    commit_memory_or_exit(addr, bytes, prot == MEM_PROT_RWX,
++                          "cannot commit protection page");
+   }
+   // One cannot use os::guard_memory() here, as on Win32 guard page
+   // have different (one-shot) semantics, from MSDN on PAGE_GUARD:
+diff -r 3f0dff7a9cf5 -r cbdd11a54b82 src/os/windows/vm/perfMemory_windows.cpp
+--- openjdk/hotspot/src/os/windows/vm/perfMemory_windows.cpp	Mon Mar 12 13:12:07 2012 -0700
++++ openjdk/hotspot/src/os/windows/vm/perfMemory_windows.cpp	Mon Mar 10 18:09:45 2014 +0000
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2001, 2011, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 2001, 2013, 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 @@
+   }
+ 
+   // commit memory
+-  if (!os::commit_memory(mapAddress, size)) {
++  if (!os::commit_memory(mapAddress, size, !ExecMem)) {
+     if (PrintMiscellaneous && Verbose) {
+       warning("Could not commit PerfData memory\n");
+     }
+diff -r 3f0dff7a9cf5 -r cbdd11a54b82 src/share/vm/gc_implementation/parallelScavenge/cardTableExtension.cpp
+--- openjdk/hotspot/src/share/vm/gc_implementation/parallelScavenge/cardTableExtension.cpp	Mon Mar 12 13:12:07 2012 -0700
++++ openjdk/hotspot/src/share/vm/gc_implementation/parallelScavenge/cardTableExtension.cpp	Mon Mar 10 18:09:45 2014 +0000
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 2001, 2013, 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
+@@ -649,11 +649,9 @@
+     if(new_start_aligned < new_end_for_commit) {
+       MemRegion new_committed =
+         MemRegion(new_start_aligned, new_end_for_commit);
+-      if (!os::commit_memory((char*)new_committed.start(),
+-                             new_committed.byte_size())) {
+-        vm_exit_out_of_memory(new_committed.byte_size(),
+-                              "card table expansion");
+-      }
++      os::commit_memory_or_exit((char*)new_committed.start(),
++                                new_committed.byte_size(), !ExecMem,
++                                "card table expansion");
+     }
+     result = true;
+   } else if (new_start_aligned > cur_committed.start()) {
+diff -r 3f0dff7a9cf5 -r cbdd11a54b82 src/share/vm/gc_implementation/parallelScavenge/psVirtualspace.cpp
+--- openjdk/hotspot/src/share/vm/gc_implementation/parallelScavenge/psVirtualspace.cpp	Mon Mar 12 13:12:07 2012 -0700
++++ openjdk/hotspot/src/share/vm/gc_implementation/parallelScavenge/psVirtualspace.cpp	Mon Mar 10 18:09:45 2014 +0000
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 2003, 2013, 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
+@@ -101,7 +101,8 @@
+   }
+ 
+   char* const base_addr = committed_high_addr();
+-  bool result = special() || os::commit_memory(base_addr, bytes, alignment());
++  bool result = special() ||
++         os::commit_memory(base_addr, bytes, alignment(), !ExecMem);
+   if (result) {
+     _committed_high_addr += bytes;
+   }
+@@ -154,7 +155,7 @@
+   if (tmp_bytes > 0) {
+     char* const commit_base = committed_high_addr();
+     if (other_space->special() ||
+-        os::commit_memory(commit_base, tmp_bytes, alignment())) {
++        os::commit_memory(commit_base, tmp_bytes, alignment(), !ExecMem)) {
+       // Reduce the reserved region in the other space.
+       other_space->set_reserved(other_space->reserved_low_addr() + tmp_bytes,
+                                 other_space->reserved_high_addr(),
+@@ -269,7 +270,8 @@
+   }
+ 
+   char* const base_addr = committed_low_addr() - bytes;
+-  bool result = special() || os::commit_memory(base_addr, bytes, alignment());
++  bool result = special() ||
++         os::commit_memory(base_addr, bytes, alignment(), !ExecMem);
+   if (result) {
+     _committed_low_addr -= bytes;
+   }
+@@ -322,7 +324,7 @@
+   if (tmp_bytes > 0) {
+     char* const commit_base = committed_low_addr() - tmp_bytes;
+     if (other_space->special() ||
+-        os::commit_memory(commit_base, tmp_bytes, alignment())) {
++        os::commit_memory(commit_base, tmp_bytes, alignment(), !ExecMem)) {
+       // Reduce the reserved region in the other space.
+       other_space->set_reserved(other_space->reserved_low_addr(),
+                                 other_space->reserved_high_addr() - tmp_bytes,
+diff -r 3f0dff7a9cf5 -r cbdd11a54b82 src/share/vm/memory/cardTableModRefBS.cpp
+--- openjdk/hotspot/src/share/vm/memory/cardTableModRefBS.cpp	Mon Mar 12 13:12:07 2012 -0700
++++ openjdk/hotspot/src/share/vm/memory/cardTableModRefBS.cpp	Mon Mar 10 18:09:45 2014 +0000
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 2000, 2013, 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
+@@ -109,10 +109,8 @@
+   jbyte* guard_card = &_byte_map[_guard_index];
+   uintptr_t guard_page = align_size_down((uintptr_t)guard_card, _page_size);
+   _guard_region = MemRegion((HeapWord*)guard_page, _page_size);
+-  if (!os::commit_memory((char*)guard_page, _page_size, _page_size)) {
+-    // Do better than this for Merlin
+-    vm_exit_out_of_memory(_page_size, "card table last card");
+-  }
++  os::commit_memory_or_exit((char*)guard_page, _page_size, _page_size,
++                            !ExecMem, "card table last card");
+   *guard_card = last_card;
+ 
+    _lowest_non_clean =
+@@ -283,12 +281,9 @@
+         MemRegion(cur_committed.end(), new_end_for_commit);
+ 
+       assert(!new_committed.is_empty(), "Region should not be empty here");
+-      if (!os::commit_memory((char*)new_committed.start(),
+-                             new_committed.byte_size(), _page_size)) {
+-        // Do better than this for Merlin
+-        vm_exit_out_of_memory(new_committed.byte_size(),
+-                "card table expansion");
+-      }
++      os::commit_memory_or_exit((char*)new_committed.start(),
++                                new_committed.byte_size(), _page_size,
++                                !ExecMem, "card table expansion");
+     // Use new_end_aligned (as opposed to new_end_for_commit) because
+     // the cur_committed region may include the guard region.
+     } else if (new_end_aligned < cur_committed.end()) {
+diff -r 3f0dff7a9cf5 -r cbdd11a54b82 src/share/vm/runtime/os.cpp
+--- openjdk/hotspot/src/share/vm/runtime/os.cpp	Mon Mar 12 13:12:07 2012 -0700
++++ openjdk/hotspot/src/share/vm/runtime/os.cpp	Mon Mar 10 18:09:45 2014 +0000
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 1997, 2013, 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
+diff -r 3f0dff7a9cf5 -r cbdd11a54b82 src/share/vm/runtime/os.hpp
+--- openjdk/hotspot/src/share/vm/runtime/os.hpp	Mon Mar 12 13:12:07 2012 -0700
++++ openjdk/hotspot/src/share/vm/runtime/os.hpp	Mon Mar 10 18:09:45 2014 +0000
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 1997, 2013, 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,6 +78,10 @@
+   CriticalPriority = 11      // Critical thread priority
+ };
+ 
++// Executable parameter flag for os::commit_memory() and
++// os::commit_memory_or_exit().
++const bool ExecMem = true;
++
+ // Typedef for structured exception handling support
+ typedef void (*java_call_t)(JavaValue* value, methodHandle* method, JavaCallArguments* args, Thread* thread);
+ 
+@@ -237,10 +241,16 @@
+   static char*  attempt_reserve_memory_at(size_t bytes, char* addr);
+   static void   split_reserved_memory(char *base, size_t size,
+                                       size_t split, bool realloc);
+-  static bool   commit_memory(char* addr, size_t bytes,
+-                              bool executable = false);
++  static bool   commit_memory(char* addr, size_t bytes, bool executable);
+   static bool   commit_memory(char* addr, size_t size, size_t alignment_hint,
+-                              bool executable = false);
++                                 bool executable);
++  // Same as commit_memory() that either succeeds or calls
++  // vm_exit_out_of_memory() with the specified mesg.
++  static void   commit_memory_or_exit(char* addr, size_t bytes,
++				      bool executable, const char* mesg);
++  static void   commit_memory_or_exit(char* addr, size_t size,
++				      size_t alignment_hint,
++				      bool executable, const char* mesg);
+   static bool   uncommit_memory(char* addr, size_t bytes);
+   static bool   release_memory(char* addr, size_t bytes);
+ 
+diff -r 3f0dff7a9cf5 -r cbdd11a54b82 src/share/vm/runtime/virtualspace.cpp
+--- openjdk/hotspot/src/share/vm/runtime/virtualspace.cpp	Mon Mar 12 13:12:07 2012 -0700
++++ openjdk/hotspot/src/share/vm/runtime/virtualspace.cpp	Mon Mar 10 18:09:45 2014 +0000
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 1997, 2013, 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
+@@ -704,11 +704,13 @@
+            lower_high() + lower_needs <= lower_high_boundary(),
+            "must not expand beyond region");
+     if (!os::commit_memory(lower_high(), lower_needs, _executable)) {
+-      debug_only(warning("os::commit_memory failed"));
++      debug_only(warning("INFO: os::commit_memory(" PTR_FORMAT
++                         ", lower_needs=" SIZE_FORMAT ", %d) failed",
++                         lower_high(), lower_needs, _executable);)
+       return false;
+     } else {
+       _lower_high += lower_needs;
+-     }
++    }
+   }
+   if (middle_needs > 0) {
+     assert(lower_high_boundary() <= middle_high() &&
+@@ -716,7 +718,10 @@
+            "must not expand beyond region");
+     if (!os::commit_memory(middle_high(), middle_needs, middle_alignment(),
+                            _executable)) {
+-      debug_only(warning("os::commit_memory failed"));
++      debug_only(warning("INFO: os::commit_memory(" PTR_FORMAT
++                         ", middle_needs=" SIZE_FORMAT ", " SIZE_FORMAT
++                         ", %d) failed", middle_high(), middle_needs,
++                         middle_alignment(), _executable);)
+       return false;
+     }
+     _middle_high += middle_needs;
+@@ -726,7 +731,9 @@
+            upper_high() + upper_needs <= upper_high_boundary(),
+            "must not expand beyond region");
+     if (!os::commit_memory(upper_high(), upper_needs, _executable)) {
+-      debug_only(warning("os::commit_memory failed"));
++      debug_only(warning("INFO: os::commit_memory(" PTR_FORMAT
++                         ", upper_needs=" SIZE_FORMAT ", %d) failed",
++                         upper_high(), upper_needs, _executable);)
+       return false;
+     } else {
+       _upper_high += upper_needs;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/openjdk/8026887-make_large_page_allocations_easier_to_debug.patch	Wed Apr 09 22:51:45 2014 +0100
@@ -0,0 +1,81 @@
+# HG changeset patch
+# User aeriksso
+# Date 1394477299 0
+#      Mon Mar 10 18:48:19 2014 +0000
+# Node ID 24391b7e49b5230d2239a2e48f1f07c08c4fe270
+# Parent  cbdd11a54b82eb7731d16abbc6df3c9b4d42c78b
+8026887: Make issues due to failed large pages allocations easier to debug
+Reviewed-by: stefank, mcastegr, poonam
+
+diff -r cbdd11a54b82 -r 24391b7e49b5 src/os/linux/vm/os_linux.cpp
+--- openjdk/hotspot/src/os/linux/vm/os_linux.cpp	Mon Mar 10 18:09:45 2014 +0000
++++ openjdk/hotspot/src/os/linux/vm/os_linux.cpp	Mon Mar 10 18:48:19 2014 +0000
+@@ -2546,6 +2546,14 @@
+           alignment_hint, exec, strerror(err), err);
+ }
+ 
++static void warn_fail_commit_memory(char* addr, size_t size,
++                                    size_t alignment_hint, bool exec,
++                                    int err, const char* msg) {
++  warning("INFO: os::commit_memory(" PTR_FORMAT ", " SIZE_FORMAT
++          ", " SIZE_FORMAT ", %d) failed; error='%s' (errno=%d); %s", addr, size,
++          alignment_hint, exec, strerror(err), err, msg);
++}
++
+ // NOTE: Linux kernel does not really reserve the pages for us.
+ //       All it does is to check if there are enough free pages
+ //       left at the time of mmap(). This could be a potential
+@@ -2596,6 +2604,8 @@
+ #define MADV_HUGEPAGE 14
+ #endif
+ 
++volatile jint os::Linux::num_largepage_commit_fails = 0;
++
+ int os::Linux::commit_memory_impl(char* addr, size_t size,
+                                   size_t alignment_hint, bool exec) {
+   int err;
+@@ -2620,7 +2630,9 @@
+       // from the loss. For now, we just issue a warning and we don't
+       // call vm_exit_out_of_memory(). This issue is being tracked by
+       // JBS-8007074.
+-      warn_fail_commit_memory(addr, size, alignment_hint, exec, err);
++      Atomic::inc(&os::Linux::num_largepage_commit_fails);
++      warn_fail_commit_memory(addr, size, alignment_hint, exec, err,
++        "Cannot allocate large pages, falling back to regular pages");
+ //    vm_exit_out_of_memory(size, "committing reserved memory.");
+     }
+     // Fall through and try to use small pages
+diff -r cbdd11a54b82 -r 24391b7e49b5 src/os/linux/vm/os_linux.hpp
+--- openjdk/hotspot/src/os/linux/vm/os_linux.hpp	Mon Mar 10 18:09:45 2014 +0000
++++ openjdk/hotspot/src/os/linux/vm/os_linux.hpp	Mon Mar 10 18:48:19 2014 +0000
+@@ -98,6 +98,8 @@
+   static void print_libversion_info(outputStream* st);
+ 
+  public:
++  static volatile jint num_largepage_commit_fails;
++
+   static void init_thread_fpu_state();
+   static int  get_fpu_control_word();
+   static void set_fpu_control_word(int fpu_control);
+diff -r cbdd11a54b82 -r 24391b7e49b5 src/share/vm/utilities/vmError.cpp
+--- openjdk/hotspot/src/share/vm/utilities/vmError.cpp	Mon Mar 10 18:09:45 2014 +0000
++++ openjdk/hotspot/src/share/vm/utilities/vmError.cpp	Mon Mar 10 18:48:19 2014 +0000
+@@ -713,6 +713,18 @@
+        st->cr();
+      }
+ 
++#ifdef LINUX
++  STEP(193, "(printing large pages allocation errors)")
++
++     if (_verbose) {
++       jint largepage_failures = os::Linux::num_largepage_commit_fails;
++       if (largepage_failures > 0) {
++         st->print_cr("Large page allocation failures have occurred " INT32_FORMAT " times", largepage_failures);
++         st->cr();
++       }
++     }
++#endif
++
+   STEP(195, "(printing code cache information)" )
+ 
+      if (_verbose && Universe::is_fully_initialized()) {
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/openjdk/8035893-jvm_getversioninfo_zeroing.patch	Wed Apr 09 22:51:45 2014 +0100
@@ -0,0 +1,21 @@
+# HG changeset patch
+# User igerasim
+# Date 1393588840 -14400
+#      Fri Feb 28 16:00:40 2014 +0400
+# Node ID 72a544aeb89217020b60c10fe167e2567fea3460
+# Parent  9747f83d7a38205a4a26008ee767fd161e1856c2
+8035893: JVM_GetVersionInfo fails to zero structure
+Reviewed-by: sla, zgu
+
+diff -r 9747f83d7a38 -r 72a544aeb892 src/share/vm/prims/jvm.cpp
+--- openjdk/hotspot/src/share/vm/prims/jvm.cpp	Fri Mar 21 20:57:28 2014 +0000
++++ openjdk/hotspot/src/share/vm/prims/jvm.cpp	Fri Feb 28 16:00:40 2014 +0400
+@@ -4534,7 +4534,7 @@
+ 
+ JVM_ENTRY(void, JVM_GetVersionInfo(JNIEnv* env, jvm_version_info* info, size_t info_size))
+ {
+-  memset(info, 0, sizeof(info_size));
++  memset(info, 0, info_size);
+ 
+   info->jvm_version = Abstract_VM_Version::jvm_version();
+   info->update_version = 0;          /* 0 in HotSpot Express VM */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/openjdk/oj6-29-jdk_version_info_zeroing.patch	Wed Apr 09 22:51:45 2014 +0100
@@ -0,0 +1,21 @@
+# HG changeset patch
+# User aph
+# Date 1393513709 0
+#      Thu Feb 27 15:08:29 2014 +0000
+# Node ID 04e4c3ec6516727f01f91a9ce8cb72586a3bc502
+# Parent  942d4ba93be74b1c401d6532f116da80f5466303
+OPENJDK6-29: JDK fails to zero jdk_version_info correctly
+Reviewed-by: andrew
+
+diff -r 942d4ba93be7 -r 04e4c3ec6516 src/share/native/common/jdk_util.c
+--- openjdk/jdk/src/share/native/common/jdk_util.c	Wed Feb 26 18:06:02 2014 +0000
++++ openjdk/jdk/src/share/native/common/jdk_util.c	Thu Feb 27 15:08:29 2014 +0000
+@@ -76,7 +76,7 @@
+     }
+ 
+ 
+-    memset(info, 0, sizeof(info_size));
++    memset(info, 0, info_size);
+     info->jdk_version = ((jdk_major_version & 0xFF) << 24) |
+                         ((jdk_minor_version & 0xFF) << 16) |
+                         ((jdk_micro_version & 0xFF) << 8)  |