changeset 32886:49cb228fd200

Merge
author duke
date Wed, 05 Jul 2017 20:52:10 +0200
parents 55a3cf13d376 5f9d335c43c3
children 19496425ac55
files hotspot/test/gc/logging/TestPrintReferences.java hotspot/test/gc/startup_warnings/TestDefaultMaxRAMFraction.java hotspot/test/gc/startup_warnings/TestNoParNew.java jdk/src/java.base/share/classes/sun/misc/JavaAWTAccess.java jdk/src/java.base/share/classes/sun/misc/JavaAWTFontAccess.java jdk/src/java.base/share/classes/sun/misc/JavaBeansAccess.java jdk/src/java.base/share/classes/sun/misc/JavaIOAccess.java jdk/src/java.base/share/classes/sun/misc/JavaIOFileDescriptorAccess.java jdk/src/java.base/share/classes/sun/misc/JavaLangAccess.java jdk/src/java.base/share/classes/sun/misc/JavaLangRefAccess.java jdk/src/java.base/share/classes/sun/misc/JavaNetAccess.java jdk/src/java.base/share/classes/sun/misc/JavaNetHttpCookieAccess.java jdk/src/java.base/share/classes/sun/misc/JavaNetInetAddressAccess.java jdk/src/java.base/share/classes/sun/misc/JavaNioAccess.java jdk/src/java.base/share/classes/sun/misc/JavaSecurityAccess.java jdk/src/java.base/share/classes/sun/misc/JavaSecurityProtectionDomainAccess.java jdk/src/java.base/share/classes/sun/misc/JavaUtilJarAccess.java jdk/src/java.base/share/classes/sun/misc/JavaUtilZipFileAccess.java jdk/src/java.base/share/classes/sun/misc/SharedSecrets.java jdk/test/sun/misc/JavaLangAccess/FormatUnsigned.java jdk/test/sun/misc/JavaLangAccess/NewUnsafeString.java
diffstat 657 files changed, 7904 insertions(+), 6169 deletions(-) [+]
line wrap: on
line diff
--- a/.hgtags-top-repo	Tue Oct 06 08:43:02 2015 -0700
+++ b/.hgtags-top-repo	Wed Jul 05 20:52:10 2017 +0200
@@ -326,3 +326,4 @@
 b8afcf91331d78626a583ec1b63164468d6f4181 jdk9-b81
 42b56d1f418523ecb61a49d7493302c80c8009cc jdk9-b82
 ce5c14d97d95084504c32b9320cb33cce4235588 jdk9-b83
+1c8134475511ffe6726677e1418a89a7a45e92d6 jdk9-b84
--- a/common/autoconf/compare.sh.in	Tue Oct 06 08:43:02 2015 -0700
+++ b/common/autoconf/compare.sh.in	Wed Jul 05 20:52:10 2017 +0200
@@ -62,7 +62,7 @@
 export SED="@SED@"
 export SORT="@SORT@"
 export STAT="@STAT@"
-export STRIP="@POST_STRIP_CMD@"
+export STRIP="@STRIP@ @STRIPFLAGS@"
 export TEE="@TEE@"
 export UNIQ="@UNIQ@"
 export UNPACK200="@FIXPATH@ @BOOT_JDK@/bin/unpack200"
--- a/common/autoconf/configure.ac	Tue Oct 06 08:43:02 2015 -0700
+++ b/common/autoconf/configure.ac	Wed Jul 05 20:52:10 2017 +0200
@@ -165,6 +165,11 @@
 # First determine the toolchain type (compiler family)
 TOOLCHAIN_DETERMINE_TOOLCHAIN_TYPE
 
+# User supplied flags should be used when configure detects compilers
+FLAGS_SETUP_USER_SUPPLIED_FLAGS
+# The sysroot cflags are needed for configure to be able to run the compilers
+FLAGS_SETUP_SYSROOT_FLAGS
+
 # Then detect the actual binaries needed
 TOOLCHAIN_PRE_DETECTION
 TOOLCHAIN_DETECT_TOOLCHAIN_CORE
--- a/common/autoconf/flags.m4	Tue Oct 06 08:43:02 2015 -0700
+++ b/common/autoconf/flags.m4	Wed Jul 05 20:52:10 2017 +0200
@@ -23,6 +23,100 @@
 # questions.
 #
 
+# Reset the global CFLAGS/LDFLAGS variables and initialize them with the
+# corresponding configure arguments instead
+AC_DEFUN_ONCE([FLAGS_SETUP_USER_SUPPLIED_FLAGS],
+[
+  if test "x$CFLAGS" != "x${ADDED_CFLAGS}"; then
+    AC_MSG_WARN([Ignoring CFLAGS($CFLAGS) found in environment. Use --with-extra-cflags])
+  fi
+
+  if test "x$CXXFLAGS" != "x${ADDED_CXXFLAGS}"; then
+    AC_MSG_WARN([Ignoring CXXFLAGS($CXXFLAGS) found in environment. Use --with-extra-cxxflags])
+  fi
+
+  if test "x$LDFLAGS" != "x${ADDED_LDFLAGS}"; then
+    AC_MSG_WARN([Ignoring LDFLAGS($LDFLAGS) found in environment. Use --with-extra-ldflags])
+  fi
+
+  AC_ARG_WITH(extra-cflags, [AS_HELP_STRING([--with-extra-cflags],
+      [extra flags to be used when compiling jdk c-files])])
+
+  AC_ARG_WITH(extra-cxxflags, [AS_HELP_STRING([--with-extra-cxxflags],
+      [extra flags to be used when compiling jdk c++-files])])
+
+  AC_ARG_WITH(extra-ldflags, [AS_HELP_STRING([--with-extra-ldflags],
+      [extra flags to be used when linking jdk])])
+
+  EXTRA_CFLAGS="$with_extra_cflags"
+  EXTRA_CXXFLAGS="$with_extra_cxxflags"
+  EXTRA_LDFLAGS="$with_extra_ldflags"
+
+  # Hotspot needs these set in their legacy form
+  LEGACY_EXTRA_CFLAGS="$LEGACY_EXTRA_CFLAGS $EXTRA_CFLAGS"
+  LEGACY_EXTRA_CXXFLAGS="$LEGACY_EXTRA_CXXFLAGS $EXTRA_CXXFLAGS"
+  LEGACY_EXTRA_LDFLAGS="$LEGACY_EXTRA_LDFLAGS $EXTRA_LDFLAGS"
+
+  AC_SUBST(LEGACY_EXTRA_CFLAGS)
+  AC_SUBST(LEGACY_EXTRA_CXXFLAGS)
+  AC_SUBST(LEGACY_EXTRA_LDFLAGS)
+
+  # The global CFLAGS and LDLAGS variables are used by configure tests and
+  # should include the extra parameters
+  CFLAGS="$EXTRA_CFLAGS"
+  CXXFLAGS="$EXTRA_CXXFLAGS"
+  LDFLAGS="$EXTRA_LDFLAGS"
+  CPPFLAGS=""
+])
+
+# Setup the sysroot flags and add them to global CFLAGS and LDFLAGS so
+# that configure can use them while detecting compilers.
+# TOOLCHAIN_TYPE is available here.
+AC_DEFUN_ONCE([FLAGS_SETUP_SYSROOT_FLAGS],
+[
+  if test "x$SYSROOT" != "x"; then
+    if test "x$TOOLCHAIN_TYPE" = xsolstudio; then
+      if test "x$OPENJDK_TARGET_OS" = xsolaris; then
+        # Solaris Studio does not have a concept of sysroot. Instead we must
+        # make sure the default include and lib dirs are appended to each
+        # compile and link command line.
+        SYSROOT_CFLAGS="-I$SYSROOT/usr/include"
+        SYSROOT_LDFLAGS="-L$SYSROOT/usr/lib$OPENJDK_TARGET_CPU_ISADIR \
+            -L$SYSROOT/lib$OPENJDK_TARGET_CPU_ISADIR \
+            -L$SYSROOT/usr/ccs/lib$OPENJDK_TARGET_CPU_ISADIR"
+      fi
+    elif test "x$TOOLCHAIN_TYPE" = xgcc; then
+      SYSROOT_CFLAGS="--sysroot=$SYSROOT"
+      SYSROOT_LDFLAGS="--sysroot=$SYSROOT"
+    elif test "x$TOOLCHAIN_TYPE" = xclang; then
+      SYSROOT_CFLAGS="-isysroot $SYSROOT"
+      SYSROOT_LDFLAGS="-isysroot $SYSROOT"
+    fi
+    # Propagate the sysroot args to hotspot
+    LEGACY_EXTRA_CFLAGS="$LEGACY_EXTRA_CFLAGS $SYSROOT_CFLAGS"
+    LEGACY_EXTRA_CXXFLAGS="$LEGACY_EXTRA_CXXFLAGS $SYSROOT_CFLAGS"
+    LEGACY_EXTRA_LDFLAGS="$LEGACY_EXTRA_LDFLAGS $SYSROOT_LDFLAGS"
+    # The global CFLAGS and LDFLAGS variables need these for configure to function
+    CFLAGS="$CFLAGS $SYSROOT_CFLAGS"
+    CPPFLAGS="$CPPFLAGS $SYSROOT_CFLAGS"
+    CXXFLAGS="$CXXFLAGS $SYSROOT_CFLAGS"
+    LDFLAGS="$LDFLAGS $SYSROOT_LDFLAGS"
+  fi
+
+  if test "x$OPENJDK_TARGET_OS" = xmacosx; then
+    # We also need -iframework<path>/System/Library/Frameworks
+    SYSROOT_CFLAGS="$SYSROOT_CFLAGS -iframework $SYSROOT/System/Library/Frameworks"
+    SYSROOT_LDFLAGS="$SYSROOT_LDFLAGS -iframework $SYSROOT/System/Library/Frameworks"
+    # These always need to be set, or we can't find the frameworks embedded in JavaVM.framework
+    # set this here so it doesn't have to be peppered throughout the forest
+    SYSROOT_CFLAGS="$SYSROOT_CFLAGS -F $SYSROOT/System/Library/Frameworks/JavaVM.framework/Frameworks"
+    SYSROOT_LDFLAGS="$SYSROOT_LDFLAGS -F $SYSROOT/System/Library/Frameworks/JavaVM.framework/Frameworks"
+  fi
+
+  AC_SUBST(SYSROOT_CFLAGS)
+  AC_SUBST(SYSROOT_LDFLAGS)
+])
+
 AC_DEFUN_ONCE([FLAGS_SETUP_INIT_FLAGS],
 [
   # Option used to tell the compiler whether to create 32- or 64-bit executables
@@ -60,10 +154,7 @@
     STRIPFLAGS="-X32_64"
   fi
 
-  if test "x$OPENJDK_TARGET_OS" != xwindows; then
-    POST_STRIP_CMD="$STRIP $STRIPFLAGS"
-  fi
-  AC_SUBST(POST_STRIP_CMD)
+  AC_SUBST(STRIPFLAGS)
 
   if test "x$TOOLCHAIN_TYPE" = xmicrosoft; then
     CC_OUT_OPTION=-Fo
@@ -113,44 +204,6 @@
     # silence copyright notice and other headers.
     COMMON_CCXXFLAGS="$COMMON_CCXXFLAGS -nologo"
   fi
-
-  if test "x$SYSROOT" != "x"; then
-    if test "x$TOOLCHAIN_TYPE" = xsolstudio; then
-      if test "x$OPENJDK_TARGET_OS" = xsolaris; then
-        # Solaris Studio does not have a concept of sysroot. Instead we must
-        # make sure the default include and lib dirs are appended to each
-        # compile and link command line.
-        SYSROOT_CFLAGS="-I$SYSROOT/usr/include"
-        SYSROOT_LDFLAGS="-L$SYSROOT/usr/lib$OPENJDK_TARGET_CPU_ISADIR \
-            -L$SYSROOT/lib$OPENJDK_TARGET_CPU_ISADIR \
-            -L$SYSROOT/usr/ccs/lib$OPENJDK_TARGET_CPU_ISADIR"
-      fi
-    elif test "x$OPENJDK_TARGET_OS" = xmacosx; then
-      # Apple only wants -isysroot <path>, but we also need -iframework<path>/System/Library/Frameworks
-      SYSROOT_CFLAGS="-isysroot \"$SYSROOT\" -iframework\"$SYSROOT/System/Library/Frameworks\""
-      SYSROOT_LDFLAGS=$SYSROOT_CFLAGS
-    elif test "x$TOOLCHAIN_TYPE" = xgcc; then
-      SYSROOT_CFLAGS="--sysroot=$SYSROOT"
-      SYSROOT_LDFLAGS="--sysroot=$SYSROOT"
-    elif test "x$TOOLCHAIN_TYPE" = xclang; then
-      SYSROOT_CFLAGS="-isysroot \"$SYSROOT\""
-      SYSROOT_LDFLAGS="-isysroot \"$SYSROOT\""
-    fi
-    # Propagate the sysroot args to hotspot
-    LEGACY_EXTRA_CFLAGS="$LEGACY_EXTRA_CFLAGS $SYSROOT_CFLAGS"
-    LEGACY_EXTRA_CXXFLAGS="$LEGACY_EXTRA_CXXFLAGS $SYSROOT_CFLAGS"
-    LEGACY_EXTRA_LDFLAGS="$LEGACY_EXTRA_LDFLAGS $SYSROOT_LDFLAGS"
-  fi
-
-  # These always need to be set, or we can't find the frameworks embedded in JavaVM.framework
-  # set this here so it doesn't have to be peppered throughout the forest
-  if test "x$OPENJDK_TARGET_OS" = xmacosx; then
-    SYSROOT_CFLAGS="$SYSROOT_CFLAGS -F\"$SYSROOT/System/Library/Frameworks/JavaVM.framework/Frameworks\""
-    SYSROOT_LDFLAGS="$SYSROOT_LDFLAGS -F\"$SYSROOT/System/Library/Frameworks/JavaVM.framework/Frameworks\""
-  fi
-
-  AC_SUBST(SYSROOT_CFLAGS)
-  AC_SUBST(SYSROOT_LDFLAGS)
 ])
 
 AC_DEFUN_ONCE([FLAGS_SETUP_COMPILER_FLAGS_FOR_LIBS],
@@ -480,39 +533,9 @@
     CXXFLAGS_JDK="${CXXFLAGS_JDK} -qchars=signed -qfullpath -qsaveopt"
   fi
 
-  if test "x$CFLAGS" != "x${ADDED_CFLAGS}"; then
-    AC_MSG_WARN([Ignoring CFLAGS($CFLAGS) found in environment. Use --with-extra-cflags])
-  fi
-
-  if test "x$CXXFLAGS" != "x${ADDED_CXXFLAGS}"; then
-    AC_MSG_WARN([Ignoring CXXFLAGS($CXXFLAGS) found in environment. Use --with-extra-cxxflags])
-  fi
-
-  if test "x$LDFLAGS" != "x${ADDED_LDFLAGS}"; then
-    AC_MSG_WARN([Ignoring LDFLAGS($LDFLAGS) found in environment. Use --with-extra-ldflags])
-  fi
-
-  AC_ARG_WITH(extra-cflags, [AS_HELP_STRING([--with-extra-cflags],
-      [extra flags to be used when compiling jdk c-files])])
-
-  AC_ARG_WITH(extra-cxxflags, [AS_HELP_STRING([--with-extra-cxxflags],
-      [extra flags to be used when compiling jdk c++-files])])
-
-  AC_ARG_WITH(extra-ldflags, [AS_HELP_STRING([--with-extra-ldflags],
-      [extra flags to be used when linking jdk])])
-
-  CFLAGS_JDK="${CFLAGS_JDK} $with_extra_cflags"
-  CXXFLAGS_JDK="${CXXFLAGS_JDK} $with_extra_cxxflags"
-  LDFLAGS_JDK="${LDFLAGS_JDK} $with_extra_ldflags"
-
-  # Hotspot needs these set in their legacy form
-  LEGACY_EXTRA_CFLAGS="$LEGACY_EXTRA_CFLAGS $with_extra_cflags"
-  LEGACY_EXTRA_CXXFLAGS="$LEGACY_EXTRA_CXXFLAGS $with_extra_cxxflags"
-  LEGACY_EXTRA_LDFLAGS="$LEGACY_EXTRA_LDFLAGS $with_extra_ldflags"
-
-  AC_SUBST(LEGACY_EXTRA_CFLAGS)
-  AC_SUBST(LEGACY_EXTRA_CXXFLAGS)
-  AC_SUBST(LEGACY_EXTRA_LDFLAGS)
+  CFLAGS_JDK="${CFLAGS_JDK} $EXTRA_CFLAGS"
+  CXXFLAGS_JDK="${CXXFLAGS_JDK} $EXTRA_CXXFLAGS"
+  LDFLAGS_JDK="${LDFLAGS_JDK} $EXTRA_LDFLAGS"
 
   ###############################################################################
   #
--- a/common/autoconf/generated-configure.sh	Tue Oct 06 08:43:02 2015 -0700
+++ b/common/autoconf/generated-configure.sh	Wed Jul 05 20:52:10 2017 +0200
@@ -705,9 +705,6 @@
 CFLAGS_JDKEXE
 CFLAGS_JDKLIB
 MACOSX_VERSION_MIN
-LEGACY_EXTRA_LDFLAGS
-LEGACY_EXTRA_CXXFLAGS
-LEGACY_EXTRA_CFLAGS
 CXX_O_FLAG_NONE
 CXX_O_FLAG_DEBUG
 CXX_O_FLAG_NORM
@@ -728,14 +725,12 @@
 SET_EXECUTABLE_ORIGIN
 CXX_FLAG_REORDER
 C_FLAG_REORDER
-SYSROOT_LDFLAGS
-SYSROOT_CFLAGS
 RC_FLAGS
 AR_OUT_OPTION
 LD_OUT_OPTION
 EXE_OUT_OPTION
 CC_OUT_OPTION
-POST_STRIP_CMD
+STRIPFLAGS
 ARFLAGS
 COMPILER_TARGET_BITS_FLAG
 JT_HOME
@@ -747,6 +742,8 @@
 HOTSPOT_CXX
 HOTSPOT_RC
 HOTSPOT_MT
+BUILD_SYSROOT_LDFLAGS
+BUILD_SYSROOT_CFLAGS
 BUILD_LD
 BUILD_CXX
 BUILD_CC
@@ -793,6 +790,11 @@
 VS_INCLUDE
 VS_PATH
 CYGWIN_LINK
+SYSROOT_LDFLAGS
+SYSROOT_CFLAGS
+LEGACY_EXTRA_LDFLAGS
+LEGACY_EXTRA_CXXFLAGS
+LEGACY_EXTRA_CFLAGS
 EXE_SUFFIX
 OBJ_SUFFIX
 STATIC_LIBRARY
@@ -1078,11 +1080,11 @@
 with_override_jdk
 with_import_hotspot
 with_toolchain_type
-with_toolchain_version
-with_jtreg
 with_extra_cflags
 with_extra_cxxflags
 with_extra_ldflags
+with_toolchain_version
+with_jtreg
 enable_warnings_as_errors
 enable_debug_symbols
 enable_zip_debug_info
@@ -1937,14 +1939,14 @@
                           source
   --with-toolchain-type   the toolchain type (or family) to use, use '--help'
                           to show possible values [platform dependent]
+  --with-extra-cflags     extra flags to be used when compiling jdk c-files
+  --with-extra-cxxflags   extra flags to be used when compiling jdk c++-files
+  --with-extra-ldflags    extra flags to be used when linking jdk
   --with-toolchain-version
                           the version of the toolchain to look for, use
                           '--help' to show possible values [platform
                           dependent]
   --with-jtreg            Regression Test Harness [probed]
-  --with-extra-cflags     extra flags to be used when compiling jdk c-files
-  --with-extra-cxxflags   extra flags to be used when compiling jdk c++-files
-  --with-extra-ldflags    extra flags to be used when linking jdk
   --with-x                use the X Window System
   --with-cups             specify prefix directory for the cups package
                           (expecting the headers under PATH/include)
@@ -3767,6 +3769,15 @@
 # questions.
 #
 
+# Reset the global CFLAGS/LDFLAGS variables and initialize them with the
+# corresponding configure arguments instead
+
+
+# Setup the sysroot flags and add them to global CFLAGS and LDFLAGS so
+# that configure can use them while detecting compilers.
+# TOOLCHAIN_TYPE is available here.
+
+
 
 
 
@@ -3886,6 +3897,8 @@
 
 apt_help() {
   case $1 in
+    reduced)
+      PKGHANDLER_COMMAND="sudo apt-get install gcc-multilib g++-multilib" ;;
     devkit)
       PKGHANDLER_COMMAND="sudo apt-get install build-essential" ;;
     openjdk)
@@ -4362,7 +4375,7 @@
 #CUSTOM_AUTOCONF_INCLUDE
 
 # Do not change or remove the following line, it is needed for consistency checks:
-DATE_WHEN_GENERATED=1442820958
+DATE_WHEN_GENERATED=1444077934
 
 ###############################################################################
 #
@@ -26825,6 +26838,109 @@
   fi
 
 
+# User supplied flags should be used when configure detects compilers
+
+  if test "x$CFLAGS" != "x${ADDED_CFLAGS}"; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Ignoring CFLAGS($CFLAGS) found in environment. Use --with-extra-cflags" >&5
+$as_echo "$as_me: WARNING: Ignoring CFLAGS($CFLAGS) found in environment. Use --with-extra-cflags" >&2;}
+  fi
+
+  if test "x$CXXFLAGS" != "x${ADDED_CXXFLAGS}"; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Ignoring CXXFLAGS($CXXFLAGS) found in environment. Use --with-extra-cxxflags" >&5
+$as_echo "$as_me: WARNING: Ignoring CXXFLAGS($CXXFLAGS) found in environment. Use --with-extra-cxxflags" >&2;}
+  fi
+
+  if test "x$LDFLAGS" != "x${ADDED_LDFLAGS}"; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Ignoring LDFLAGS($LDFLAGS) found in environment. Use --with-extra-ldflags" >&5
+$as_echo "$as_me: WARNING: Ignoring LDFLAGS($LDFLAGS) found in environment. Use --with-extra-ldflags" >&2;}
+  fi
+
+
+# Check whether --with-extra-cflags was given.
+if test "${with_extra_cflags+set}" = set; then :
+  withval=$with_extra_cflags;
+fi
+
+
+
+# Check whether --with-extra-cxxflags was given.
+if test "${with_extra_cxxflags+set}" = set; then :
+  withval=$with_extra_cxxflags;
+fi
+
+
+
+# Check whether --with-extra-ldflags was given.
+if test "${with_extra_ldflags+set}" = set; then :
+  withval=$with_extra_ldflags;
+fi
+
+
+  EXTRA_CFLAGS="$with_extra_cflags"
+  EXTRA_CXXFLAGS="$with_extra_cxxflags"
+  EXTRA_LDFLAGS="$with_extra_ldflags"
+
+  # Hotspot needs these set in their legacy form
+  LEGACY_EXTRA_CFLAGS="$LEGACY_EXTRA_CFLAGS $EXTRA_CFLAGS"
+  LEGACY_EXTRA_CXXFLAGS="$LEGACY_EXTRA_CXXFLAGS $EXTRA_CXXFLAGS"
+  LEGACY_EXTRA_LDFLAGS="$LEGACY_EXTRA_LDFLAGS $EXTRA_LDFLAGS"
+
+
+
+
+
+  # The global CFLAGS and LDLAGS variables are used by configure tests and
+  # should include the extra parameters
+  CFLAGS="$EXTRA_CFLAGS"
+  CXXFLAGS="$EXTRA_CXXFLAGS"
+  LDFLAGS="$EXTRA_LDFLAGS"
+  CPPFLAGS=""
+
+# The sysroot cflags are needed for configure to be able to run the compilers
+
+  if test "x$SYSROOT" != "x"; then
+    if test "x$TOOLCHAIN_TYPE" = xsolstudio; then
+      if test "x$OPENJDK_TARGET_OS" = xsolaris; then
+        # Solaris Studio does not have a concept of sysroot. Instead we must
+        # make sure the default include and lib dirs are appended to each
+        # compile and link command line.
+        SYSROOT_CFLAGS="-I$SYSROOT/usr/include"
+        SYSROOT_LDFLAGS="-L$SYSROOT/usr/lib$OPENJDK_TARGET_CPU_ISADIR \
+            -L$SYSROOT/lib$OPENJDK_TARGET_CPU_ISADIR \
+            -L$SYSROOT/usr/ccs/lib$OPENJDK_TARGET_CPU_ISADIR"
+      fi
+    elif test "x$TOOLCHAIN_TYPE" = xgcc; then
+      SYSROOT_CFLAGS="--sysroot=$SYSROOT"
+      SYSROOT_LDFLAGS="--sysroot=$SYSROOT"
+    elif test "x$TOOLCHAIN_TYPE" = xclang; then
+      SYSROOT_CFLAGS="-isysroot $SYSROOT"
+      SYSROOT_LDFLAGS="-isysroot $SYSROOT"
+    fi
+    # Propagate the sysroot args to hotspot
+    LEGACY_EXTRA_CFLAGS="$LEGACY_EXTRA_CFLAGS $SYSROOT_CFLAGS"
+    LEGACY_EXTRA_CXXFLAGS="$LEGACY_EXTRA_CXXFLAGS $SYSROOT_CFLAGS"
+    LEGACY_EXTRA_LDFLAGS="$LEGACY_EXTRA_LDFLAGS $SYSROOT_LDFLAGS"
+    # The global CFLAGS and LDFLAGS variables need these for configure to function
+    CFLAGS="$CFLAGS $SYSROOT_CFLAGS"
+    CPPFLAGS="$CPPFLAGS $SYSROOT_CFLAGS"
+    CXXFLAGS="$CXXFLAGS $SYSROOT_CFLAGS"
+    LDFLAGS="$LDFLAGS $SYSROOT_LDFLAGS"
+  fi
+
+  if test "x$OPENJDK_TARGET_OS" = xmacosx; then
+    # We also need -iframework<path>/System/Library/Frameworks
+    SYSROOT_CFLAGS="$SYSROOT_CFLAGS -iframework $SYSROOT/System/Library/Frameworks"
+    SYSROOT_LDFLAGS="$SYSROOT_LDFLAGS -iframework $SYSROOT/System/Library/Frameworks"
+    # These always need to be set, or we can't find the frameworks embedded in JavaVM.framework
+    # set this here so it doesn't have to be peppered throughout the forest
+    SYSROOT_CFLAGS="$SYSROOT_CFLAGS -F $SYSROOT/System/Library/Frameworks/JavaVM.framework/Frameworks"
+    SYSROOT_LDFLAGS="$SYSROOT_LDFLAGS -F $SYSROOT/System/Library/Frameworks/JavaVM.framework/Frameworks"
+  fi
+
+
+
+
+
 # Then detect the actual binaries needed
 
   # FIXME: Is this needed?
@@ -40555,13 +40671,19 @@
     fi
   fi
 
+    BUILD_SYSROOT_CFLAGS=""
+    BUILD_SYSROOT_LDFLAGS=""
   else
     # If we are not cross compiling, use the normal target compilers for
     # building the build platform executables.
     BUILD_CC="$CC"
     BUILD_CXX="$CXX"
     BUILD_LD="$LD"
-  fi
+    BUILD_SYSROOT_CFLAGS="$SYSROOT_CFLAGS"
+    BUILD_SYSROOT_LDFLAGS="$SYSROOT_LDFLAGS"
+  fi
+
+
 
 
 
@@ -41252,9 +41374,6 @@
     STRIPFLAGS="-X32_64"
   fi
 
-  if test "x$OPENJDK_TARGET_OS" != xwindows; then
-    POST_STRIP_CMD="$STRIP $STRIPFLAGS"
-  fi
 
 
   if test "x$TOOLCHAIN_TYPE" = xmicrosoft; then
@@ -41306,44 +41425,6 @@
     COMMON_CCXXFLAGS="$COMMON_CCXXFLAGS -nologo"
   fi
 
-  if test "x$SYSROOT" != "x"; then
-    if test "x$TOOLCHAIN_TYPE" = xsolstudio; then
-      if test "x$OPENJDK_TARGET_OS" = xsolaris; then
-        # Solaris Studio does not have a concept of sysroot. Instead we must
-        # make sure the default include and lib dirs are appended to each
-        # compile and link command line.
-        SYSROOT_CFLAGS="-I$SYSROOT/usr/include"
-        SYSROOT_LDFLAGS="-L$SYSROOT/usr/lib$OPENJDK_TARGET_CPU_ISADIR \
-            -L$SYSROOT/lib$OPENJDK_TARGET_CPU_ISADIR \
-            -L$SYSROOT/usr/ccs/lib$OPENJDK_TARGET_CPU_ISADIR"
-      fi
-    elif test "x$OPENJDK_TARGET_OS" = xmacosx; then
-      # Apple only wants -isysroot <path>, but we also need -iframework<path>/System/Library/Frameworks
-      SYSROOT_CFLAGS="-isysroot \"$SYSROOT\" -iframework\"$SYSROOT/System/Library/Frameworks\""
-      SYSROOT_LDFLAGS=$SYSROOT_CFLAGS
-    elif test "x$TOOLCHAIN_TYPE" = xgcc; then
-      SYSROOT_CFLAGS="--sysroot=$SYSROOT"
-      SYSROOT_LDFLAGS="--sysroot=$SYSROOT"
-    elif test "x$TOOLCHAIN_TYPE" = xclang; then
-      SYSROOT_CFLAGS="-isysroot \"$SYSROOT\""
-      SYSROOT_LDFLAGS="-isysroot \"$SYSROOT\""
-    fi
-    # Propagate the sysroot args to hotspot
-    LEGACY_EXTRA_CFLAGS="$LEGACY_EXTRA_CFLAGS $SYSROOT_CFLAGS"
-    LEGACY_EXTRA_CXXFLAGS="$LEGACY_EXTRA_CXXFLAGS $SYSROOT_CFLAGS"
-    LEGACY_EXTRA_LDFLAGS="$LEGACY_EXTRA_LDFLAGS $SYSROOT_LDFLAGS"
-  fi
-
-  # These always need to be set, or we can't find the frameworks embedded in JavaVM.framework
-  # set this here so it doesn't have to be peppered throughout the forest
-  if test "x$OPENJDK_TARGET_OS" = xmacosx; then
-    SYSROOT_CFLAGS="$SYSROOT_CFLAGS -F\"$SYSROOT/System/Library/Frameworks/JavaVM.framework/Frameworks\""
-    SYSROOT_LDFLAGS="$SYSROOT_LDFLAGS -F\"$SYSROOT/System/Library/Frameworks/JavaVM.framework/Frameworks\""
-  fi
-
-
-
-
 
 # FIXME: Currently we must test this after toolchain but before flags. Fix!
 
@@ -41543,8 +41624,38 @@
     { $as_echo "$as_me:${as_lineno-$LINENO}: Failed to compile stdio.h. This likely implies missing compile dependencies." >&5
 $as_echo "$as_me: Failed to compile stdio.h. This likely implies missing compile dependencies." >&6;}
     if test "x$COMPILE_TYPE" = xreduced; then
-      { $as_echo "$as_me:${as_lineno-$LINENO}: You are doing a reduced build. Check that you have 32-bit libraries installed." >&5
-$as_echo "$as_me: You are doing a reduced build. Check that you have 32-bit libraries installed." >&6;}
+
+  # Print a helpful message on how to acquire the necessary build dependency.
+  # reduced is the help tag: freetype, cups, pulse, alsa etc
+  MISSING_DEPENDENCY=reduced
+
+  if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
+    cygwin_help $MISSING_DEPENDENCY
+  elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
+    msys_help $MISSING_DEPENDENCY
+  else
+    PKGHANDLER_COMMAND=
+
+    case $PKGHANDLER in
+      apt-get)
+        apt_help     $MISSING_DEPENDENCY ;;
+      yum)
+        yum_help     $MISSING_DEPENDENCY ;;
+      port)
+        port_help    $MISSING_DEPENDENCY ;;
+      pkgutil)
+        pkgutil_help $MISSING_DEPENDENCY ;;
+      pkgadd)
+        pkgadd_help  $MISSING_DEPENDENCY ;;
+    esac
+
+    if test "x$PKGHANDLER_COMMAND" != x; then
+      HELP_MSG="You might be able to fix this by running '$PKGHANDLER_COMMAND'."
+    fi
+  fi
+
+      { $as_echo "$as_me:${as_lineno-$LINENO}: You are doing a reduced build. Check that you have 32-bit libraries installed. $HELP_MSG" >&5
+$as_echo "$as_me: You are doing a reduced build. Check that you have 32-bit libraries installed. $HELP_MSG" >&6;}
     elif test "x$COMPILE_TYPE" = xcross; then
       { $as_echo "$as_me:${as_lineno-$LINENO}: You are doing a cross-compilation. Check that you have all target platform libraries installed." >&5
 $as_echo "$as_me: You are doing a cross-compilation. Check that you have all target platform libraries installed." >&6;}
@@ -41603,8 +41714,8 @@
       # Let's try to implicitely set the compilers target architecture and retry the test
       { $as_echo "$as_me:${as_lineno-$LINENO}: The tested number of bits in the target ($TESTED_TARGET_CPU_BITS) differs from the number of bits expected to be found in the target ($OPENJDK_TARGET_CPU_BITS)." >&5
 $as_echo "$as_me: The tested number of bits in the target ($TESTED_TARGET_CPU_BITS) differs from the number of bits expected to be found in the target ($OPENJDK_TARGET_CPU_BITS)." >&6;}
-      { $as_echo "$as_me:${as_lineno-$LINENO}: I'll retry after setting the platforms compiler target bits flag to ${COMPILER_TARGET_BITS_FLAG}${OPENJDK_TARGET_CPU_BITS}" >&5
-$as_echo "$as_me: I'll retry after setting the platforms compiler target bits flag to ${COMPILER_TARGET_BITS_FLAG}${OPENJDK_TARGET_CPU_BITS}" >&6;}
+      { $as_echo "$as_me:${as_lineno-$LINENO}: Retrying with platforms compiler target bits flag to ${COMPILER_TARGET_BITS_FLAG}${OPENJDK_TARGET_CPU_BITS}" >&5
+$as_echo "$as_me: Retrying with platforms compiler target bits flag to ${COMPILER_TARGET_BITS_FLAG}${OPENJDK_TARGET_CPU_BITS}" >&6;}
 
   # When we add flags to the "official" CFLAGS etc, we need to
   # keep track of these additions in ADDED_CFLAGS etc. These
@@ -41667,7 +41778,46 @@
       TESTED_TARGET_CPU_BITS=`expr 8 \* $ac_cv_sizeof_int_p`
 
       if test "x$TESTED_TARGET_CPU_BITS" != "x$OPENJDK_TARGET_CPU_BITS"; then
-        as_fn_error $? "The tested number of bits in the target ($TESTED_TARGET_CPU_BITS) differs from the number of bits expected to be found in the target ($OPENJDK_TARGET_CPU_BITS)" "$LINENO" 5
+        { $as_echo "$as_me:${as_lineno-$LINENO}: The tested number of bits in the target ($TESTED_TARGET_CPU_BITS) differs from the number of bits expected to be found in the target ($OPENJDK_TARGET_CPU_BITS)" >&5
+$as_echo "$as_me: The tested number of bits in the target ($TESTED_TARGET_CPU_BITS) differs from the number of bits expected to be found in the target ($OPENJDK_TARGET_CPU_BITS)" >&6;}
+        if test "x$COMPILE_TYPE" = xreduced; then
+
+  # Print a helpful message on how to acquire the necessary build dependency.
+  # reduced is the help tag: freetype, cups, pulse, alsa etc
+  MISSING_DEPENDENCY=reduced
+
+  if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
+    cygwin_help $MISSING_DEPENDENCY
+  elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
+    msys_help $MISSING_DEPENDENCY
+  else
+    PKGHANDLER_COMMAND=
+
+    case $PKGHANDLER in
+      apt-get)
+        apt_help     $MISSING_DEPENDENCY ;;
+      yum)
+        yum_help     $MISSING_DEPENDENCY ;;
+      port)
+        port_help    $MISSING_DEPENDENCY ;;
+      pkgutil)
+        pkgutil_help $MISSING_DEPENDENCY ;;
+      pkgadd)
+        pkgadd_help  $MISSING_DEPENDENCY ;;
+    esac
+
+    if test "x$PKGHANDLER_COMMAND" != x; then
+      HELP_MSG="You might be able to fix this by running '$PKGHANDLER_COMMAND'."
+    fi
+  fi
+
+          { $as_echo "$as_me:${as_lineno-$LINENO}: You are doing a reduced build. Check that you have 32-bit libraries installed. $HELP_MSG" >&5
+$as_echo "$as_me: You are doing a reduced build. Check that you have 32-bit libraries installed. $HELP_MSG" >&6;}
+        elif test "x$COMPILE_TYPE" = xcross; then
+          { $as_echo "$as_me:${as_lineno-$LINENO}: You are doing a cross-compilation. Check that you have all target platform libraries installed." >&5
+$as_echo "$as_me: You are doing a cross-compilation. Check that you have all target platform libraries installed." >&6;}
+        fi
+        as_fn_error $? "Cannot continue." "$LINENO" 5
       fi
     fi
   fi
@@ -42267,54 +42417,9 @@
     CXXFLAGS_JDK="${CXXFLAGS_JDK} -qchars=signed -qfullpath -qsaveopt"
   fi
 
-  if test "x$CFLAGS" != "x${ADDED_CFLAGS}"; then
-    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Ignoring CFLAGS($CFLAGS) found in environment. Use --with-extra-cflags" >&5
-$as_echo "$as_me: WARNING: Ignoring CFLAGS($CFLAGS) found in environment. Use --with-extra-cflags" >&2;}
-  fi
-
-  if test "x$CXXFLAGS" != "x${ADDED_CXXFLAGS}"; then
-    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Ignoring CXXFLAGS($CXXFLAGS) found in environment. Use --with-extra-cxxflags" >&5
-$as_echo "$as_me: WARNING: Ignoring CXXFLAGS($CXXFLAGS) found in environment. Use --with-extra-cxxflags" >&2;}
-  fi
-
-  if test "x$LDFLAGS" != "x${ADDED_LDFLAGS}"; then
-    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Ignoring LDFLAGS($LDFLAGS) found in environment. Use --with-extra-ldflags" >&5
-$as_echo "$as_me: WARNING: Ignoring LDFLAGS($LDFLAGS) found in environment. Use --with-extra-ldflags" >&2;}
-  fi
-
-
-# Check whether --with-extra-cflags was given.
-if test "${with_extra_cflags+set}" = set; then :
-  withval=$with_extra_cflags;
-fi
-
-
-
-# Check whether --with-extra-cxxflags was given.
-if test "${with_extra_cxxflags+set}" = set; then :
-  withval=$with_extra_cxxflags;
-fi
-
-
-
-# Check whether --with-extra-ldflags was given.
-if test "${with_extra_ldflags+set}" = set; then :
-  withval=$with_extra_ldflags;
-fi
-
-
-  CFLAGS_JDK="${CFLAGS_JDK} $with_extra_cflags"
-  CXXFLAGS_JDK="${CXXFLAGS_JDK} $with_extra_cxxflags"
-  LDFLAGS_JDK="${LDFLAGS_JDK} $with_extra_ldflags"
-
-  # Hotspot needs these set in their legacy form
-  LEGACY_EXTRA_CFLAGS="$LEGACY_EXTRA_CFLAGS $with_extra_cflags"
-  LEGACY_EXTRA_CXXFLAGS="$LEGACY_EXTRA_CXXFLAGS $with_extra_cxxflags"
-  LEGACY_EXTRA_LDFLAGS="$LEGACY_EXTRA_LDFLAGS $with_extra_ldflags"
-
-
-
-
+  CFLAGS_JDK="${CFLAGS_JDK} $EXTRA_CFLAGS"
+  CXXFLAGS_JDK="${CXXFLAGS_JDK} $EXTRA_CXXFLAGS"
+  LDFLAGS_JDK="${LDFLAGS_JDK} $EXTRA_LDFLAGS"
 
   ###############################################################################
   #
--- a/common/autoconf/help.m4	Tue Oct 06 08:43:02 2015 -0700
+++ b/common/autoconf/help.m4	Wed Jul 05 20:52:10 2017 +0200
@@ -97,6 +97,8 @@
 
 apt_help() {
   case $1 in
+    reduced)
+      PKGHANDLER_COMMAND="sudo apt-get install gcc-multilib g++-multilib" ;;
     devkit)
       PKGHANDLER_COMMAND="sudo apt-get install build-essential" ;;
     openjdk)
--- a/common/autoconf/hotspot-spec.gmk.in	Tue Oct 06 08:43:02 2015 -0700
+++ b/common/autoconf/hotspot-spec.gmk.in	Wed Jul 05 20:52:10 2017 +0200
@@ -48,8 +48,8 @@
 
 # The HOSTCC/HOSTCXX is Hotspot terminology for the BUILD_CC/BUILD_CXX, i.e. the
 # compiler that produces code that can be run on the build platform.
-HOSTCC:=@FIXPATH@ @BUILD_CC@
-HOSTCXX:=@FIXPATH@ @BUILD_CXX@
+HOSTCC:=@FIXPATH@ @BUILD_CC@ $(BUILD_SYSROOT_CFLAGS)
+HOSTCXX:=@FIXPATH@ @BUILD_CXX@ $(BUILD_SYSROOT_CFLAGS)
 
 ####################################################
 #
--- a/common/autoconf/platform.m4	Tue Oct 06 08:43:02 2015 -0700
+++ b/common/autoconf/platform.m4	Wed Jul 05 20:52:10 2017 +0200
@@ -489,7 +489,8 @@
   AC_CHECK_HEADERS([stdio.h], , [
     AC_MSG_NOTICE([Failed to compile stdio.h. This likely implies missing compile dependencies.])
     if test "x$COMPILE_TYPE" = xreduced; then
-      AC_MSG_NOTICE([You are doing a reduced build. Check that you have 32-bit libraries installed.])
+      HELP_MSG_MISSING_DEPENDENCY([reduced])
+      AC_MSG_NOTICE([You are doing a reduced build. Check that you have 32-bit libraries installed. $HELP_MSG])
     elif test "x$COMPILE_TYPE" = xcross; then
       AC_MSG_NOTICE([You are doing a cross-compilation. Check that you have all target platform libraries installed.])
     fi
@@ -509,7 +510,7 @@
       # This situation may happen on 64-bit platforms where the compiler by default only generates 32-bit objects
       # Let's try to implicitely set the compilers target architecture and retry the test
       AC_MSG_NOTICE([The tested number of bits in the target ($TESTED_TARGET_CPU_BITS) differs from the number of bits expected to be found in the target ($OPENJDK_TARGET_CPU_BITS).])
-      AC_MSG_NOTICE([I'll retry after setting the platforms compiler target bits flag to ${COMPILER_TARGET_BITS_FLAG}${OPENJDK_TARGET_CPU_BITS}])
+      AC_MSG_NOTICE([Retrying with platforms compiler target bits flag to ${COMPILER_TARGET_BITS_FLAG}${OPENJDK_TARGET_CPU_BITS}])
       PLATFORM_SET_COMPILER_TARGET_BITS_FLAGS
 
       # We have to unset 'ac_cv_sizeof_int_p' first, otherwise AC_CHECK_SIZEOF will use the previously cached value!
@@ -524,7 +525,14 @@
       TESTED_TARGET_CPU_BITS=`expr 8 \* $ac_cv_sizeof_int_p`
 
       if test "x$TESTED_TARGET_CPU_BITS" != "x$OPENJDK_TARGET_CPU_BITS"; then
-        AC_MSG_ERROR([The tested number of bits in the target ($TESTED_TARGET_CPU_BITS) differs from the number of bits expected to be found in the target ($OPENJDK_TARGET_CPU_BITS)])
+        AC_MSG_NOTICE([The tested number of bits in the target ($TESTED_TARGET_CPU_BITS) differs from the number of bits expected to be found in the target ($OPENJDK_TARGET_CPU_BITS)])
+        if test "x$COMPILE_TYPE" = xreduced; then
+          HELP_MSG_MISSING_DEPENDENCY([reduced])
+          AC_MSG_NOTICE([You are doing a reduced build. Check that you have 32-bit libraries installed. $HELP_MSG])
+        elif test "x$COMPILE_TYPE" = xcross; then
+          AC_MSG_NOTICE([You are doing a cross-compilation. Check that you have all target platform libraries installed.])
+        fi
+        AC_MSG_ERROR([Cannot continue.])
       fi
     fi
   fi
--- a/common/autoconf/spec.gmk.in	Tue Oct 06 08:43:02 2015 -0700
+++ b/common/autoconf/spec.gmk.in	Wed Jul 05 20:52:10 2017 +0200
@@ -367,6 +367,8 @@
 # build platform.
 BUILD_CC:=@FIXPATH@ @BUILD_CC@
 BUILD_LD:=@FIXPATH@ @BUILD_LD@
+BUILD_SYSROOT_CFLAGS:=@BUILD_SYSROOT_CFLAGS@
+BUILD_SYSROOT_LDFLAGS:=@BUILD_SYSROOT_LDFLAGS@
 
 AS:=@FIXPATH@ @AS@
 
@@ -421,7 +423,7 @@
 EXE_SUFFIX:=@EXE_SUFFIX@
 OBJ_SUFFIX:=@OBJ_SUFFIX@
 
-POST_STRIP_CMD:=@POST_STRIP_CMD@
+STRIPFLAGS:=@STRIPFLAGS@
 
 JAVA_FLAGS:=@JAVA_FLAGS@
 JAVA_FLAGS_BIG:=@JAVA_FLAGS_BIG@
@@ -461,9 +463,6 @@
 NEW_JAVAC   = $(INTERIM_LANGTOOLS_ARGS) com.sun.tools.javac.Main
 NEW_JAVADOC = $(INTERIM_LANGTOOLS_ARGS) com.sun.tools.javadoc.Main
 
-# The interim corba jar is needed for running rmic
-INTERIM_CORBA_JAR = $(BUILDTOOLS_OUTPUTDIR)/interim_corba.jar
-
 # Base flags for RC
 # Guarding this against resetting value. Legacy make files include spec multiple
 # times.
--- a/common/autoconf/toolchain.m4	Tue Oct 06 08:43:02 2015 -0700
+++ b/common/autoconf/toolchain.m4	Wed Jul 05 20:52:10 2017 +0200
@@ -656,17 +656,23 @@
     BASIC_FIXUP_EXECUTABLE(BUILD_CXX)
     BASIC_PATH_PROGS(BUILD_LD, ld)
     BASIC_FIXUP_EXECUTABLE(BUILD_LD)
+    BUILD_SYSROOT_CFLAGS=""
+    BUILD_SYSROOT_LDFLAGS=""
   else
     # If we are not cross compiling, use the normal target compilers for
     # building the build platform executables.
     BUILD_CC="$CC"
     BUILD_CXX="$CXX"
     BUILD_LD="$LD"
+    BUILD_SYSROOT_CFLAGS="$SYSROOT_CFLAGS"
+    BUILD_SYSROOT_LDFLAGS="$SYSROOT_LDFLAGS"
   fi
 
   AC_SUBST(BUILD_CC)
   AC_SUBST(BUILD_CXX)
   AC_SUBST(BUILD_LD)
+  AC_SUBST(BUILD_SYSROOT_CFLAGS)
+  AC_SUBST(BUILD_SYSROOT_LDFLAGS)
 ])
 
 # Setup legacy variables that are still needed as alternative ways to refer to
--- a/hotspot/.hgtags	Tue Oct 06 08:43:02 2015 -0700
+++ b/hotspot/.hgtags	Wed Jul 05 20:52:10 2017 +0200
@@ -486,3 +486,4 @@
 4142c190cd5ca4fb70ec367b4f97ef936272d8ef jdk9-b81
 1c453a12be3036d482abef1dd470f8aff536b6b9 jdk9-b82
 3ed0df2c553a80e0e26b91a6ce08806ea17a066a jdk9-b83
+184c4328444974edd6b3b490b9d0177ace7e331c jdk9-b84
--- a/hotspot/make/aix/makefiles/mapfile-vers-debug	Tue Oct 06 08:43:02 2015 -0700
+++ b/hotspot/make/aix/makefiles/mapfile-vers-debug	Wed Jul 05 20:52:10 2017 +0200
@@ -26,169 +26,6 @@
 
 SUNWprivate_1.1 {
         global:
-                # JNI
-                JNI_CreateJavaVM;
-                JNI_GetCreatedJavaVMs;
-                JNI_GetDefaultJavaVMInitArgs;
-
-                # JVM
-                JVM_ActiveProcessorCount;
-                JVM_ArrayCopy;
-                JVM_AssertionStatusDirectives;
-                JVM_ClassDepth;
-                JVM_ClassLoaderDepth;
-                JVM_Clone;
-                JVM_ConstantPoolGetClassAt;
-                JVM_ConstantPoolGetClassAtIfLoaded;
-                JVM_ConstantPoolGetDoubleAt;
-                JVM_ConstantPoolGetFieldAt;
-                JVM_ConstantPoolGetFieldAtIfLoaded;
-                JVM_ConstantPoolGetFloatAt;
-                JVM_ConstantPoolGetIntAt;
-                JVM_ConstantPoolGetLongAt;
-                JVM_ConstantPoolGetMethodAt;
-                JVM_ConstantPoolGetMethodAtIfLoaded;
-                JVM_ConstantPoolGetMemberRefInfoAt;
-                JVM_ConstantPoolGetSize;
-                JVM_ConstantPoolGetStringAt;
-                JVM_ConstantPoolGetUTF8At;
-                JVM_CountStackFrames;
-                JVM_CurrentClassLoader;
-                JVM_CurrentLoadedClass;
-                JVM_CurrentThread;
-                JVM_CurrentTimeMillis;
-                JVM_DefineClass;
-                JVM_DefineClassWithSource;
-                JVM_DefineClassWithSourceCond;
-                JVM_DesiredAssertionStatus;
-                JVM_DoPrivileged;
-                JVM_DumpAllStacks;
-                JVM_DumpThreads;
-                JVM_FillInStackTrace;
-                JVM_FindClassFromCaller;
-                JVM_FindClassFromClass;
-                JVM_FindClassFromBootLoader;
-                JVM_FindLibraryEntry;
-                JVM_FindLoadedClass;
-                JVM_FindPrimitiveClass;
-                JVM_FindSignal;
-                JVM_FreeMemory;
-                JVM_GC;
-                JVM_GetAllThreads;
-                JVM_GetArrayElement;
-                JVM_GetArrayLength;
-                JVM_GetCPClassNameUTF;
-                JVM_GetCPFieldClassNameUTF;
-                JVM_GetCPFieldModifiers;
-                JVM_GetCPFieldNameUTF;
-                JVM_GetCPFieldSignatureUTF;
-                JVM_GetCPMethodClassNameUTF;
-                JVM_GetCPMethodModifiers;
-                JVM_GetCPMethodNameUTF;
-                JVM_GetCPMethodSignatureUTF;
-                JVM_GetCallerClass;
-                JVM_GetClassAccessFlags;
-                JVM_GetClassAnnotations;
-                JVM_GetClassCPEntriesCount;
-                JVM_GetClassCPTypes;
-                JVM_GetClassConstantPool;
-                JVM_GetClassContext;
-                JVM_GetClassDeclaredConstructors;
-                JVM_GetClassDeclaredFields;
-                JVM_GetClassDeclaredMethods;
-                JVM_GetClassFieldsCount;
-                JVM_GetClassInterfaces;
-                JVM_GetClassMethodsCount;
-                JVM_GetClassModifiers;
-                JVM_GetClassName;
-                JVM_GetClassNameUTF;
-                JVM_GetClassSignature;
-                JVM_GetClassSigners;
-                JVM_GetClassTypeAnnotations;
-                JVM_GetDeclaredClasses;
-                JVM_GetDeclaringClass;
-                JVM_GetSimpleBinaryName;
-                JVM_GetEnclosingMethodInfo;
-                JVM_GetFieldIxModifiers;
-                JVM_GetFieldTypeAnnotations;
-                JVM_GetInheritedAccessControlContext;
-                JVM_GetInterfaceVersion;
-                JVM_GetManagement;
-                JVM_GetMethodIxArgsSize;
-                JVM_GetMethodIxByteCode;
-                JVM_GetMethodIxByteCodeLength;
-                JVM_GetMethodIxExceptionIndexes;
-                JVM_GetMethodIxExceptionTableEntry;
-                JVM_GetMethodIxExceptionTableLength;
-                JVM_GetMethodIxExceptionsCount;
-                JVM_GetMethodIxLocalsCount;
-                JVM_GetMethodIxMaxStack;
-                JVM_GetMethodIxModifiers;
-                JVM_GetMethodIxNameUTF;
-                JVM_GetMethodIxSignatureUTF;
-                JVM_GetMethodParameters;
-                JVM_GetMethodTypeAnnotations;
-                JVM_GetNanoTimeAdjustment;
-                JVM_GetPrimitiveArrayElement;
-                JVM_GetProtectionDomain;
-                JVM_GetStackAccessControlContext;
-                JVM_GetStackTraceDepth;
-                JVM_GetStackTraceElement;
-                JVM_GetSystemPackage;
-                JVM_GetSystemPackages;
-                JVM_GetTemporaryDirectory;
-                JVM_GetVersionInfo;
-                JVM_Halt;
-                JVM_HoldsLock;
-                JVM_IHashCode;
-                JVM_InitAgentProperties;
-                JVM_InitProperties;
-                JVM_InternString;
-                JVM_Interrupt;
-                JVM_InvokeMethod;
-                JVM_IsArrayClass;
-                JVM_IsConstructorIx;
-                JVM_IsInterface;
-                JVM_IsInterrupted;
-                JVM_IsPrimitiveClass;
-                JVM_IsSameClassPackage;
-                JVM_IsSupportedJNIVersion;
-                JVM_IsThreadAlive;
-                JVM_IsVMGeneratedMethodIx;
-                JVM_LatestUserDefinedLoader;
-                JVM_LoadLibrary;
-                JVM_MaxObjectInspectionAge;
-                JVM_MaxMemory;
-                JVM_MonitorNotify;
-                JVM_MonitorNotifyAll;
-                JVM_MonitorWait;
-                JVM_NanoTime;
-                JVM_NativePath;
-                JVM_NewArray;
-                JVM_NewInstanceFromConstructor;
-                JVM_NewMultiArray;
-                JVM_RaiseSignal;
-                JVM_RawMonitorCreate;
-                JVM_RawMonitorDestroy;
-                JVM_RawMonitorEnter;
-                JVM_RawMonitorExit;
-                JVM_RegisterSignal;
-                JVM_ReleaseUTF;
-                JVM_ResumeThread;
-                JVM_SetArrayElement;
-                JVM_SetClassSigners;
-                JVM_SetNativeThreadName;
-                JVM_SetPrimitiveArrayElement;
-                JVM_SetProtectionDomain;
-                JVM_SetThreadPriority;
-                JVM_Sleep;
-                JVM_StartThread;
-                JVM_StopThread;
-                JVM_SuspendThread;
-                JVM_SupportsCX8;
-                JVM_TotalMemory;
-                JVM_UnloadLibrary;
-                JVM_Yield;
                 JVM_handle_linux_signal;
 
                 # debug JVM
--- a/hotspot/make/aix/makefiles/mapfile-vers-product	Tue Oct 06 08:43:02 2015 -0700
+++ b/hotspot/make/aix/makefiles/mapfile-vers-product	Wed Jul 05 20:52:10 2017 +0200
@@ -26,167 +26,6 @@
 
 SUNWprivate_1.1 {
         global:
-                # JNI
-                JNI_CreateJavaVM;
-                JNI_GetCreatedJavaVMs;
-                JNI_GetDefaultJavaVMInitArgs;
-
-                # JVM
-                JVM_ActiveProcessorCount;
-                JVM_ArrayCopy;
-                JVM_AssertionStatusDirectives;
-                JVM_ClassDepth;
-                JVM_ClassLoaderDepth;
-                JVM_Clone;
-                JVM_ConstantPoolGetClassAt;
-                JVM_ConstantPoolGetClassAtIfLoaded;
-                JVM_ConstantPoolGetDoubleAt;
-                JVM_ConstantPoolGetFieldAt;
-                JVM_ConstantPoolGetFieldAtIfLoaded;
-                JVM_ConstantPoolGetFloatAt;
-                JVM_ConstantPoolGetIntAt;
-                JVM_ConstantPoolGetLongAt;
-                JVM_ConstantPoolGetMethodAt;
-                JVM_ConstantPoolGetMethodAtIfLoaded;
-                JVM_ConstantPoolGetMemberRefInfoAt;
-                JVM_ConstantPoolGetSize;
-                JVM_ConstantPoolGetStringAt;
-                JVM_ConstantPoolGetUTF8At;
-                JVM_CountStackFrames;
-                JVM_CurrentClassLoader;
-                JVM_CurrentLoadedClass;
-                JVM_CurrentThread;
-                JVM_CurrentTimeMillis;
-                JVM_DefineClass;
-                JVM_DefineClassWithSource;
-                JVM_DefineClassWithSourceCond;
-                JVM_DesiredAssertionStatus;
-                JVM_DoPrivileged;
-                JVM_DumpAllStacks;
-                JVM_DumpThreads;
-                JVM_FillInStackTrace;
-                JVM_FindClassFromCaller;
-                JVM_FindClassFromClass;
-                JVM_FindClassFromBootLoader;
-                JVM_FindLibraryEntry;
-                JVM_FindLoadedClass;
-                JVM_FindPrimitiveClass;
-                JVM_FindSignal;
-                JVM_FreeMemory;
-                JVM_GC;
-                JVM_GetAllThreads;
-                JVM_GetArrayElement;
-                JVM_GetArrayLength;
-                JVM_GetCPClassNameUTF;
-                JVM_GetCPFieldClassNameUTF;
-                JVM_GetCPFieldModifiers;
-                JVM_GetCPFieldNameUTF;
-                JVM_GetCPFieldSignatureUTF;
-                JVM_GetCPMethodClassNameUTF;
-                JVM_GetCPMethodModifiers;
-                JVM_GetCPMethodNameUTF;
-                JVM_GetCPMethodSignatureUTF;
-                JVM_GetCallerClass;
-                JVM_GetClassAccessFlags;
-                JVM_GetClassAnnotations;
-                JVM_GetClassCPEntriesCount;
-                JVM_GetClassCPTypes;
-                JVM_GetClassConstantPool;
-                JVM_GetClassContext;
-                JVM_GetClassDeclaredConstructors;
-                JVM_GetClassDeclaredFields;
-                JVM_GetClassDeclaredMethods;
-                JVM_GetClassFieldsCount;
-                JVM_GetClassInterfaces;
-                JVM_GetClassMethodsCount;
-                JVM_GetClassModifiers;
-                JVM_GetClassName;
-                JVM_GetClassNameUTF;
-                JVM_GetClassSignature;
-                JVM_GetClassSigners;
-                JVM_GetClassTypeAnnotations;
-                JVM_GetDeclaredClasses;
-                JVM_GetDeclaringClass;
-                JVM_GetSimpleBinaryName;
-                JVM_GetEnclosingMethodInfo;
-                JVM_GetFieldIxModifiers;
-                JVM_GetInheritedAccessControlContext;
-                JVM_GetInterfaceVersion;
-                JVM_GetManagement;
-                JVM_GetMethodIxArgsSize;
-                JVM_GetMethodIxByteCode;
-                JVM_GetMethodIxByteCodeLength;
-                JVM_GetMethodIxExceptionIndexes;
-                JVM_GetMethodIxExceptionTableEntry;
-                JVM_GetMethodIxExceptionTableLength;
-                JVM_GetMethodIxExceptionsCount;
-                JVM_GetMethodIxLocalsCount;
-                JVM_GetMethodIxMaxStack;
-                JVM_GetMethodIxModifiers;
-                JVM_GetMethodIxNameUTF;
-                JVM_GetMethodIxSignatureUTF;
-                JVM_GetMethodParameters;
-                JVM_GetNanoTimeAdjustment;
-                JVM_GetPrimitiveArrayElement;
-                JVM_GetProtectionDomain;
-                JVM_GetStackAccessControlContext;
-                JVM_GetStackTraceDepth;
-                JVM_GetStackTraceElement;
-                JVM_GetSystemPackage;
-                JVM_GetSystemPackages;
-                JVM_GetTemporaryDirectory;
-                JVM_GetVersionInfo;
-                JVM_Halt;
-                JVM_HoldsLock;
-                JVM_IHashCode;
-                JVM_InitAgentProperties;
-                JVM_InitProperties;
-                JVM_InternString;
-                JVM_Interrupt;
-                JVM_InvokeMethod;
-                JVM_IsArrayClass;
-                JVM_IsConstructorIx;
-                JVM_IsInterface;
-                JVM_IsInterrupted;
-                JVM_IsPrimitiveClass;
-                JVM_IsSameClassPackage;
-                JVM_IsSupportedJNIVersion;
-                JVM_IsThreadAlive;
-                JVM_IsVMGeneratedMethodIx;
-                JVM_LatestUserDefinedLoader;
-                JVM_LoadLibrary;
-                JVM_MaxObjectInspectionAge;
-                JVM_MaxMemory;
-                JVM_MonitorNotify;
-                JVM_MonitorNotifyAll;
-                JVM_MonitorWait;
-                JVM_NanoTime;
-                JVM_NativePath;
-                JVM_NewArray;
-                JVM_NewInstanceFromConstructor;
-                JVM_NewMultiArray;
-                JVM_RaiseSignal;
-                JVM_RawMonitorCreate;
-                JVM_RawMonitorDestroy;
-                JVM_RawMonitorEnter;
-                JVM_RawMonitorExit;
-                JVM_RegisterSignal;
-                JVM_ReleaseUTF;
-                JVM_ResumeThread;
-                JVM_SetArrayElement;
-                JVM_SetClassSigners;
-                JVM_SetNativeThreadName;
-                JVM_SetPrimitiveArrayElement;
-                JVM_SetProtectionDomain;
-                JVM_SetThreadPriority;
-                JVM_Sleep;
-                JVM_StartThread;
-                JVM_StopThread;
-                JVM_SuspendThread;
-                JVM_SupportsCX8;
-                JVM_TotalMemory;
-                JVM_UnloadLibrary;
-                JVM_Yield;
                 JVM_handle_linux_signal;
 
                 # miscellaneous functions
--- a/hotspot/make/aix/makefiles/vm.make	Tue Oct 06 08:43:02 2015 -0700
+++ b/hotspot/make/aix/makefiles/vm.make	Wed Jul 05 20:52:10 2017 +0200
@@ -220,10 +220,12 @@
 
 vm_version.o: $(filter-out vm_version.o,$(JVM_OBJ_FILES))
 
-mapfile : $(MAPFILE) vm.def
+MAPFILE_SHARE  := $(GAMMADIR)/make/share/makefiles/mapfile-vers
+
+mapfile : $(MAPFILE) $(MAPFILE_SHARE) vm.def
 	rm -f $@
 	awk '{ if ($$0 ~ "INSERT VTABLE SYMBOLS HERE")	\
-                 { system ("cat vm.def"); }		\
+                 { system ("cat ${MAPFILE_SHARE} vm.def"); } \
                else					\
                  { print $$0 }				\
              }' > $@ < $(MAPFILE)
--- a/hotspot/make/bsd/makefiles/mapfile-vers-darwin-debug	Tue Oct 06 08:43:02 2015 -0700
+++ b/hotspot/make/bsd/makefiles/mapfile-vers-darwin-debug	Wed Jul 05 20:52:10 2017 +0200
@@ -24,171 +24,9 @@
 # Only used for OSX/Darwin builds
 
 # Define public interface.
-                # _JNI
-                _JNI_CreateJavaVM
-                _JNI_GetCreatedJavaVMs
-                _JNI_GetDefaultJavaVMInitArgs
-
-                # _JVM
-                _JVM_ActiveProcessorCount
-                _JVM_ArrayCopy
-                _JVM_AssertionStatusDirectives
-                _JVM_ClassDepth
-                _JVM_ClassLoaderDepth
-                _JVM_Clone
-                _JVM_ConstantPoolGetClassAt
-                _JVM_ConstantPoolGetClassAtIfLoaded
-                _JVM_ConstantPoolGetDoubleAt
-                _JVM_ConstantPoolGetFieldAt
-                _JVM_ConstantPoolGetFieldAtIfLoaded
-                _JVM_ConstantPoolGetFloatAt
-                _JVM_ConstantPoolGetIntAt
-                _JVM_ConstantPoolGetLongAt
-                _JVM_ConstantPoolGetMethodAt
-                _JVM_ConstantPoolGetMethodAtIfLoaded
-                _JVM_ConstantPoolGetMemberRefInfoAt
-                _JVM_ConstantPoolGetSize
-                _JVM_ConstantPoolGetStringAt
-                _JVM_ConstantPoolGetUTF8At
-                _JVM_CountStackFrames
-                _JVM_CurrentClassLoader
-                _JVM_CurrentLoadedClass
-                _JVM_CurrentThread
-                _JVM_CurrentTimeMillis
-                _JVM_DefineClass
-                _JVM_DefineClassWithSource
-                _JVM_DefineClassWithSourceCond
-                _JVM_DesiredAssertionStatus
-                _JVM_DoPrivileged
-                _JVM_DumpAllStacks
-                _JVM_DumpThreads
-                _JVM_FillInStackTrace
-                _JVM_FindClassFromCaller
-                _JVM_FindClassFromClass
-                _JVM_FindClassFromBootLoader
-                _JVM_FindLibraryEntry
-                _JVM_FindLoadedClass
-                _JVM_FindPrimitiveClass
-                _JVM_FindSignal
-                _JVM_FreeMemory
-                _JVM_GC
-                _JVM_GetAllThreads
-                _JVM_GetArrayElement
-                _JVM_GetArrayLength
-                _JVM_GetCPClassNameUTF
-                _JVM_GetCPFieldClassNameUTF
-                _JVM_GetCPFieldModifiers
-                _JVM_GetCPFieldNameUTF
-                _JVM_GetCPFieldSignatureUTF
-                _JVM_GetCPMethodClassNameUTF
-                _JVM_GetCPMethodModifiers
-                _JVM_GetCPMethodNameUTF
-                _JVM_GetCPMethodSignatureUTF
-                _JVM_GetCallerClass
-                _JVM_GetClassAccessFlags
-                _JVM_GetClassAnnotations
-                _JVM_GetClassCPEntriesCount
-                _JVM_GetClassCPTypes
-                _JVM_GetClassConstantPool
-                _JVM_GetClassContext
-                _JVM_GetClassDeclaredConstructors
-                _JVM_GetClassDeclaredFields
-                _JVM_GetClassDeclaredMethods
-                _JVM_GetClassFieldsCount
-                _JVM_GetClassInterfaces
-                _JVM_GetClassMethodsCount
-                _JVM_GetClassModifiers
-                _JVM_GetClassName
-                _JVM_GetClassNameUTF
-                _JVM_GetClassSignature
-                _JVM_GetClassSigners
-                _JVM_GetClassTypeAnnotations
-                _JVM_GetDeclaredClasses
-                _JVM_GetDeclaringClass
-                _JVM_GetSimpleBinaryName
-                _JVM_GetEnclosingMethodInfo
-                _JVM_GetFieldIxModifiers
-                _JVM_GetFieldTypeAnnotations
-                _JVM_GetInheritedAccessControlContext
-                _JVM_GetInterfaceVersion
-                _JVM_GetManagement
-                _JVM_GetMethodIxArgsSize
-                _JVM_GetMethodIxByteCode
-                _JVM_GetMethodIxByteCodeLength
-                _JVM_GetMethodIxExceptionIndexes
-                _JVM_GetMethodIxExceptionTableEntry
-                _JVM_GetMethodIxExceptionTableLength
-                _JVM_GetMethodIxExceptionsCount
-                _JVM_GetMethodIxLocalsCount
-                _JVM_GetMethodIxMaxStack
-                _JVM_GetMethodIxModifiers
-                _JVM_GetMethodIxNameUTF
-                _JVM_GetMethodIxSignatureUTF
-                _JVM_GetMethodParameters
-                _JVM_GetMethodTypeAnnotations
-                _JVM_GetNanoTimeAdjustment
-                _JVM_GetPrimitiveArrayElement
-                _JVM_GetProtectionDomain
-                _JVM_GetStackAccessControlContext
-                _JVM_GetStackTraceDepth
-                _JVM_GetStackTraceElement
-                _JVM_GetSystemPackage
-                _JVM_GetSystemPackages
-                _JVM_GetTemporaryDirectory
-                _JVM_GetVersionInfo
-                _JVM_Halt
-                _JVM_HoldsLock
-                _JVM_IHashCode
-                _JVM_InitAgentProperties
-                _JVM_InitProperties
-                _JVM_InternString
-                _JVM_Interrupt
-                _JVM_InvokeMethod
-                _JVM_IsArrayClass
-                _JVM_IsConstructorIx
-                _JVM_IsInterface
-                _JVM_IsInterrupted
-                _JVM_IsPrimitiveClass
-                _JVM_IsSameClassPackage
-                _JVM_IsSupportedJNIVersion
-                _JVM_IsThreadAlive
-                _JVM_IsVMGeneratedMethodIx
-                _JVM_LatestUserDefinedLoader
-                _JVM_LoadLibrary
-                _JVM_MaxObjectInspectionAge
-                _JVM_MaxMemory
-                _JVM_MonitorNotify
-                _JVM_MonitorNotifyAll
-                _JVM_MonitorWait
-                _JVM_NanoTime
-                _JVM_NativePath
-                _JVM_NewArray
-                _JVM_NewInstanceFromConstructor
-                _JVM_NewMultiArray
-                _JVM_RaiseSignal
-                _JVM_RawMonitorCreate
-                _JVM_RawMonitorDestroy
-                _JVM_RawMonitorEnter
-                _JVM_RawMonitorExit
-                _JVM_RegisterSignal
-                _JVM_ReleaseUTF
-                _JVM_ResumeThread
-                _JVM_SetArrayElement
-                _JVM_SetClassSigners
-                _JVM_SetNativeThreadName
-                _JVM_SetPrimitiveArrayElement
-                _JVM_SetThreadPriority
-                _JVM_Sleep
-                _JVM_StartThread
-                _JVM_StopThread
-                _JVM_SuspendThread
-                _JVM_SupportsCX8
-                _JVM_TotalMemory
-                _JVM_UnloadLibrary
-                _JVM_Yield
                 _JVM_handle_bsd_signal
 
-				# miscellaneous functions
+		# miscellaneous functions
                 _jio_fprintf
                 _jio_printf
                 _jio_snprintf
--- a/hotspot/make/bsd/makefiles/mapfile-vers-darwin-product	Tue Oct 06 08:43:02 2015 -0700
+++ b/hotspot/make/bsd/makefiles/mapfile-vers-darwin-product	Wed Jul 05 20:52:10 2017 +0200
@@ -24,168 +24,6 @@
 # Only used for OSX/Darwin builds
 
 # Define public interface.
-                # _JNI
-                _JNI_CreateJavaVM
-                _JNI_GetCreatedJavaVMs
-                _JNI_GetDefaultJavaVMInitArgs
-
-                # _JVM
-                _JVM_ActiveProcessorCount
-                _JVM_ArrayCopy
-                _JVM_AssertionStatusDirectives
-                _JVM_ClassDepth
-                _JVM_ClassLoaderDepth
-                _JVM_Clone
-                _JVM_ConstantPoolGetClassAt
-                _JVM_ConstantPoolGetClassAtIfLoaded
-                _JVM_ConstantPoolGetDoubleAt
-                _JVM_ConstantPoolGetFieldAt
-                _JVM_ConstantPoolGetFieldAtIfLoaded
-                _JVM_ConstantPoolGetFloatAt
-                _JVM_ConstantPoolGetIntAt
-                _JVM_ConstantPoolGetLongAt
-                _JVM_ConstantPoolGetMethodAt
-                _JVM_ConstantPoolGetMethodAtIfLoaded
-                _JVM_ConstantPoolGetMemberRefInfoAt
-                _JVM_ConstantPoolGetSize
-                _JVM_ConstantPoolGetStringAt
-                _JVM_ConstantPoolGetUTF8At
-                _JVM_CountStackFrames
-                _JVM_CurrentClassLoader
-                _JVM_CurrentLoadedClass
-                _JVM_CurrentThread
-                _JVM_CurrentTimeMillis
-                _JVM_DefineClass
-                _JVM_DefineClassWithSource
-                _JVM_DefineClassWithSourceCond
-                _JVM_DesiredAssertionStatus
-                _JVM_DoPrivileged
-                _JVM_DumpAllStacks
-                _JVM_DumpThreads
-                _JVM_FillInStackTrace
-                _JVM_FindClassFromCaller
-                _JVM_FindClassFromClass
-                _JVM_FindClassFromBootLoader
-                _JVM_FindLibraryEntry
-                _JVM_FindLoadedClass
-                _JVM_FindPrimitiveClass
-                _JVM_FindSignal
-                _JVM_FreeMemory
-                _JVM_GC
-                _JVM_GetAllThreads
-                _JVM_GetArrayElement
-                _JVM_GetArrayLength
-                _JVM_GetCPClassNameUTF
-                _JVM_GetCPFieldClassNameUTF
-                _JVM_GetCPFieldModifiers
-                _JVM_GetCPFieldNameUTF
-                _JVM_GetCPFieldSignatureUTF
-                _JVM_GetCPMethodClassNameUTF
-                _JVM_GetCPMethodModifiers
-                _JVM_GetCPMethodNameUTF
-                _JVM_GetCPMethodSignatureUTF
-                _JVM_GetCallerClass
-                _JVM_GetClassAccessFlags
-                _JVM_GetClassAnnotations
-                _JVM_GetClassCPEntriesCount
-                _JVM_GetClassCPTypes
-                _JVM_GetClassConstantPool
-                _JVM_GetClassContext
-                _JVM_GetClassDeclaredConstructors
-                _JVM_GetClassDeclaredFields
-                _JVM_GetClassDeclaredMethods
-                _JVM_GetClassFieldsCount
-                _JVM_GetClassInterfaces
-                _JVM_GetClassMethodsCount
-                _JVM_GetClassModifiers
-                _JVM_GetClassName
-                _JVM_GetClassNameUTF
-                _JVM_GetClassSignature
-                _JVM_GetClassSigners
-                _JVM_GetClassTypeAnnotations
-                _JVM_GetDeclaredClasses
-                _JVM_GetDeclaringClass
-                _JVM_GetSimpleBinaryName
-                _JVM_GetEnclosingMethodInfo
-                _JVM_GetFieldIxModifiers
-                _JVM_GetFieldTypeAnnotations
-                _JVM_GetInheritedAccessControlContext
-                _JVM_GetInterfaceVersion
-                _JVM_GetManagement
-                _JVM_GetMethodIxArgsSize
-                _JVM_GetMethodIxByteCode
-                _JVM_GetMethodIxByteCodeLength
-                _JVM_GetMethodIxExceptionIndexes
-                _JVM_GetMethodIxExceptionTableEntry
-                _JVM_GetMethodIxExceptionTableLength
-                _JVM_GetMethodIxExceptionsCount
-                _JVM_GetMethodIxLocalsCount
-                _JVM_GetMethodIxMaxStack
-                _JVM_GetMethodIxModifiers
-                _JVM_GetMethodIxNameUTF
-                _JVM_GetMethodIxSignatureUTF
-                _JVM_GetMethodParameters
-                _JVM_GetMethodTypeAnnotations
-                _JVM_GetNanoTimeAdjustment
-                _JVM_GetPrimitiveArrayElement
-                _JVM_GetProtectionDomain
-                _JVM_GetStackAccessControlContext
-                _JVM_GetStackTraceDepth
-                _JVM_GetStackTraceElement
-                _JVM_GetSystemPackage
-                _JVM_GetSystemPackages
-                _JVM_GetTemporaryDirectory
-                _JVM_GetVersionInfo
-                _JVM_Halt
-                _JVM_HoldsLock
-                _JVM_IHashCode
-                _JVM_InitAgentProperties
-                _JVM_InitProperties
-                _JVM_InternString
-                _JVM_Interrupt
-                _JVM_InvokeMethod
-                _JVM_IsArrayClass
-                _JVM_IsConstructorIx
-                _JVM_IsInterface
-                _JVM_IsInterrupted
-                _JVM_IsPrimitiveClass
-                _JVM_IsSameClassPackage
-                _JVM_IsSupportedJNIVersion
-                _JVM_IsThreadAlive
-                _JVM_IsVMGeneratedMethodIx
-                _JVM_LatestUserDefinedLoader
-                _JVM_LoadLibrary
-                _JVM_MaxObjectInspectionAge
-                _JVM_MaxMemory
-                _JVM_MonitorNotify
-                _JVM_MonitorNotifyAll
-                _JVM_MonitorWait
-                _JVM_NanoTime
-                _JVM_NativePath
-                _JVM_NewArray
-                _JVM_NewInstanceFromConstructor
-                _JVM_NewMultiArray
-                _JVM_RaiseSignal
-                _JVM_RawMonitorCreate
-                _JVM_RawMonitorDestroy
-                _JVM_RawMonitorEnter
-                _JVM_RawMonitorExit
-                _JVM_RegisterSignal
-                _JVM_ReleaseUTF
-                _JVM_ResumeThread
-                _JVM_SetArrayElement
-                _JVM_SetClassSigners
-                _JVM_SetNativeThreadName
-                _JVM_SetPrimitiveArrayElement
-                _JVM_SetThreadPriority
-                _JVM_Sleep
-                _JVM_StartThread
-                _JVM_StopThread
-                _JVM_SuspendThread
-                _JVM_SupportsCX8
-                _JVM_TotalMemory
-                _JVM_UnloadLibrary
-                _JVM_Yield
                 _JVM_handle_bsd_signal
 
                 # miscellaneous functions
--- a/hotspot/make/bsd/makefiles/mapfile-vers-debug	Tue Oct 06 08:43:02 2015 -0700
+++ b/hotspot/make/bsd/makefiles/mapfile-vers-debug	Wed Jul 05 20:52:10 2017 +0200
@@ -26,168 +26,6 @@
 
 SUNWprivate_1.1 {
         global:
-                # JNI
-                JNI_CreateJavaVM;
-                JNI_GetCreatedJavaVMs;
-                JNI_GetDefaultJavaVMInitArgs;
-
-                # JVM
-                JVM_ActiveProcessorCount;
-                JVM_ArrayCopy;
-                JVM_AssertionStatusDirectives;
-                JVM_ClassDepth;
-                JVM_ClassLoaderDepth;
-                JVM_Clone;
-                JVM_ConstantPoolGetClassAt;
-                JVM_ConstantPoolGetClassAtIfLoaded;
-                JVM_ConstantPoolGetDoubleAt;
-                JVM_ConstantPoolGetFieldAt;
-                JVM_ConstantPoolGetFieldAtIfLoaded;
-                JVM_ConstantPoolGetFloatAt;
-                JVM_ConstantPoolGetIntAt;
-                JVM_ConstantPoolGetLongAt;
-                JVM_ConstantPoolGetMethodAt;
-                JVM_ConstantPoolGetMethodAtIfLoaded;
-                JVM_ConstantPoolGetMemberRefInfoAt;
-                JVM_ConstantPoolGetSize;
-                JVM_ConstantPoolGetStringAt;
-                JVM_ConstantPoolGetUTF8At;
-                JVM_CountStackFrames;
-                JVM_CurrentClassLoader;
-                JVM_CurrentLoadedClass;
-                JVM_CurrentThread;
-                JVM_CurrentTimeMillis;
-                JVM_DefineClass;
-                JVM_DefineClassWithSource;
-                JVM_DefineClassWithSourceCond;
-                JVM_DesiredAssertionStatus;
-                JVM_DoPrivileged;
-                JVM_DumpAllStacks;
-                JVM_DumpThreads;
-                JVM_FillInStackTrace;
-                JVM_FindClassFromCaller;
-                JVM_FindClassFromClass;
-                JVM_FindClassFromBootLoader;
-                JVM_FindLibraryEntry;
-                JVM_FindLoadedClass;
-                JVM_FindPrimitiveClass;
-                JVM_FindSignal;
-                JVM_FreeMemory;
-                JVM_GC;
-                JVM_GetAllThreads;
-                JVM_GetArrayElement;
-                JVM_GetArrayLength;
-                JVM_GetCPClassNameUTF;
-                JVM_GetCPFieldClassNameUTF;
-                JVM_GetCPFieldModifiers;
-                JVM_GetCPFieldNameUTF;
-                JVM_GetCPFieldSignatureUTF;
-                JVM_GetCPMethodClassNameUTF;
-                JVM_GetCPMethodModifiers;
-                JVM_GetCPMethodNameUTF;
-                JVM_GetCPMethodSignatureUTF;
-                JVM_GetCallerClass;
-                JVM_GetClassAccessFlags;
-                JVM_GetClassAnnotations;
-                JVM_GetClassCPEntriesCount;
-                JVM_GetClassCPTypes;
-                JVM_GetClassConstantPool;
-                JVM_GetClassContext;
-                JVM_GetClassDeclaredConstructors;
-                JVM_GetClassDeclaredFields;
-                JVM_GetClassDeclaredMethods;
-                JVM_GetClassFieldsCount;
-                JVM_GetClassInterfaces;
-                JVM_GetClassMethodsCount;
-                JVM_GetClassModifiers;
-                JVM_GetClassName;
-                JVM_GetClassNameUTF;
-                JVM_GetClassSignature;
-                JVM_GetClassSigners;
-                JVM_GetClassTypeAnnotations;
-                JVM_GetDeclaredClasses;
-                JVM_GetDeclaringClass;
-                JVM_GetSimpleBinaryName;
-                JVM_GetEnclosingMethodInfo;
-                JVM_GetFieldIxModifiers;
-                JVM_GetFieldTypeAnnotations;
-                JVM_GetInheritedAccessControlContext;
-                JVM_GetInterfaceVersion;
-                JVM_GetManagement;
-                JVM_GetMethodIxArgsSize;
-                JVM_GetMethodIxByteCode;
-                JVM_GetMethodIxByteCodeLength;
-                JVM_GetMethodIxExceptionIndexes;
-                JVM_GetMethodIxExceptionTableEntry;
-                JVM_GetMethodIxExceptionTableLength;
-                JVM_GetMethodIxExceptionsCount;
-                JVM_GetMethodIxLocalsCount;
-                JVM_GetMethodIxMaxStack;
-                JVM_GetMethodIxModifiers;
-                JVM_GetMethodIxNameUTF;
-                JVM_GetMethodIxSignatureUTF;
-                JVM_GetMethodParameters;
-                JVM_GetMethodTypeAnnotations;
-                JVM_GetNanoTimeAdjustment;
-                JVM_GetPrimitiveArrayElement;
-                JVM_GetProtectionDomain;
-                JVM_GetStackAccessControlContext;
-                JVM_GetStackTraceDepth;
-                JVM_GetStackTraceElement;
-                JVM_GetSystemPackage;
-                JVM_GetSystemPackages;
-                JVM_GetTemporaryDirectory;
-                JVM_GetVersionInfo;
-                JVM_Halt;
-                JVM_HoldsLock;
-                JVM_IHashCode;
-                JVM_InitAgentProperties;
-                JVM_InitProperties;
-                JVM_InternString;
-                JVM_Interrupt;
-                JVM_InvokeMethod;
-                JVM_IsArrayClass;
-                JVM_IsConstructorIx;
-                JVM_IsInterface;
-                JVM_IsInterrupted;
-                JVM_IsPrimitiveClass;
-                JVM_IsSameClassPackage;
-                JVM_IsSupportedJNIVersion;
-                JVM_IsThreadAlive;
-                JVM_IsVMGeneratedMethodIx;
-                JVM_LatestUserDefinedLoader;
-                JVM_LoadLibrary;
-                JVM_MaxObjectInspectionAge;
-                JVM_MaxMemory;
-                JVM_MonitorNotify;
-                JVM_MonitorNotifyAll;
-                JVM_MonitorWait;
-                JVM_NanoTime;
-                JVM_NativePath;
-                JVM_NewArray;
-                JVM_NewInstanceFromConstructor;
-                JVM_NewMultiArray;
-                JVM_RaiseSignal;
-                JVM_RawMonitorCreate;
-                JVM_RawMonitorDestroy;
-                JVM_RawMonitorEnter;
-                JVM_RawMonitorExit;
-                JVM_RegisterSignal;
-                JVM_ReleaseUTF;
-                JVM_ResumeThread;
-                JVM_SetArrayElement;
-                JVM_SetClassSigners;
-                JVM_SetNativeThreadName;
-                JVM_SetPrimitiveArrayElement;
-                JVM_SetThreadPriority;
-                JVM_Sleep;
-                JVM_StartThread;
-                JVM_StopThread;
-                JVM_SuspendThread;
-                JVM_SupportsCX8;
-                JVM_TotalMemory;
-                JVM_UnloadLibrary;
-                JVM_Yield;
                 JVM_handle_linux_signal;
 
                 # miscellaneous functions
--- a/hotspot/make/bsd/makefiles/mapfile-vers-product	Tue Oct 06 08:43:02 2015 -0700
+++ b/hotspot/make/bsd/makefiles/mapfile-vers-product	Wed Jul 05 20:52:10 2017 +0200
@@ -26,168 +26,6 @@
 
 SUNWprivate_1.1 {
         global:
-                # JNI
-                JNI_CreateJavaVM;
-                JNI_GetCreatedJavaVMs;
-                JNI_GetDefaultJavaVMInitArgs;
-
-                # JVM
-                JVM_ActiveProcessorCount;
-                JVM_ArrayCopy;
-                JVM_AssertionStatusDirectives;
-                JVM_ClassDepth;
-                JVM_ClassLoaderDepth;
-                JVM_Clone;
-                JVM_ConstantPoolGetClassAt;
-                JVM_ConstantPoolGetClassAtIfLoaded;
-                JVM_ConstantPoolGetDoubleAt;
-                JVM_ConstantPoolGetFieldAt;
-                JVM_ConstantPoolGetFieldAtIfLoaded;
-                JVM_ConstantPoolGetFloatAt;
-                JVM_ConstantPoolGetIntAt;
-                JVM_ConstantPoolGetLongAt;
-                JVM_ConstantPoolGetMethodAt;
-                JVM_ConstantPoolGetMethodAtIfLoaded;
-                JVM_ConstantPoolGetMemberRefInfoAt;
-                JVM_ConstantPoolGetSize;
-                JVM_ConstantPoolGetStringAt;
-                JVM_ConstantPoolGetUTF8At;
-                JVM_CountStackFrames;
-                JVM_CurrentClassLoader;
-                JVM_CurrentLoadedClass;
-                JVM_CurrentThread;
-                JVM_CurrentTimeMillis;
-                JVM_DefineClass;
-                JVM_DefineClassWithSource;
-                JVM_DefineClassWithSourceCond;
-                JVM_DesiredAssertionStatus;
-                JVM_DoPrivileged;
-                JVM_DumpAllStacks;
-                JVM_DumpThreads;
-                JVM_FillInStackTrace;
-                JVM_FindClassFromCaller;
-                JVM_FindClassFromClass;
-                JVM_FindClassFromBootLoader;
-                JVM_FindLibraryEntry;
-                JVM_FindLoadedClass;
-                JVM_FindPrimitiveClass;
-                JVM_FindSignal;
-                JVM_FreeMemory;
-                JVM_GC;
-                JVM_GetAllThreads;
-                JVM_GetArrayElement;
-                JVM_GetArrayLength;
-                JVM_GetCPClassNameUTF;
-                JVM_GetCPFieldClassNameUTF;
-                JVM_GetCPFieldModifiers;
-                JVM_GetCPFieldNameUTF;
-                JVM_GetCPFieldSignatureUTF;
-                JVM_GetCPMethodClassNameUTF;
-                JVM_GetCPMethodModifiers;
-                JVM_GetCPMethodNameUTF;
-                JVM_GetCPMethodSignatureUTF;
-                JVM_GetCallerClass;
-                JVM_GetClassAccessFlags;
-                JVM_GetClassAnnotations;
-                JVM_GetClassCPEntriesCount;
-                JVM_GetClassCPTypes;
-                JVM_GetClassConstantPool;
-                JVM_GetClassContext;
-                JVM_GetClassDeclaredConstructors;
-                JVM_GetClassDeclaredFields;
-                JVM_GetClassDeclaredMethods;
-                JVM_GetClassFieldsCount;
-                JVM_GetClassInterfaces;
-                JVM_GetClassMethodsCount;
-                JVM_GetClassModifiers;
-                JVM_GetClassName;
-                JVM_GetClassNameUTF;
-                JVM_GetClassSignature;
-                JVM_GetClassSigners;
-                JVM_GetClassTypeAnnotations;
-                JVM_GetDeclaredClasses;
-                JVM_GetDeclaringClass;
-                JVM_GetSimpleBinaryName;
-                JVM_GetEnclosingMethodInfo;
-                JVM_GetFieldIxModifiers;
-                JVM_GetFieldTypeAnnotations;
-                JVM_GetInheritedAccessControlContext;
-                JVM_GetInterfaceVersion;
-                JVM_GetManagement;
-                JVM_GetMethodIxArgsSize;
-                JVM_GetMethodIxByteCode;
-                JVM_GetMethodIxByteCodeLength;
-                JVM_GetMethodIxExceptionIndexes;
-                JVM_GetMethodIxExceptionTableEntry;
-                JVM_GetMethodIxExceptionTableLength;
-                JVM_GetMethodIxExceptionsCount;
-                JVM_GetMethodIxLocalsCount;
-                JVM_GetMethodIxMaxStack;
-                JVM_GetMethodIxModifiers;
-                JVM_GetMethodIxNameUTF;
-                JVM_GetMethodIxSignatureUTF;
-                JVM_GetMethodParameters;
-                JVM_GetMethodTypeAnnotations;
-                JVM_GetNanoTimeAdjustment;
-                JVM_GetPrimitiveArrayElement;
-                JVM_GetProtectionDomain;
-                JVM_GetStackAccessControlContext;
-                JVM_GetStackTraceDepth;
-                JVM_GetStackTraceElement;
-                JVM_GetSystemPackage;
-                JVM_GetSystemPackages;
-                JVM_GetTemporaryDirectory;
-                JVM_GetVersionInfo;
-                JVM_Halt;
-                JVM_HoldsLock;
-                JVM_IHashCode;
-                JVM_InitAgentProperties;
-                JVM_InitProperties;
-                JVM_InternString;
-                JVM_Interrupt;
-                JVM_InvokeMethod;
-                JVM_IsArrayClass;
-                JVM_IsConstructorIx;
-                JVM_IsInterface;
-                JVM_IsInterrupted;
-                JVM_IsPrimitiveClass;
-                JVM_IsSameClassPackage;
-                JVM_IsSupportedJNIVersion;
-                JVM_IsThreadAlive;
-                JVM_IsVMGeneratedMethodIx;
-                JVM_LatestUserDefinedLoader;
-                JVM_LoadLibrary;
-                JVM_MaxObjectInspectionAge;
-                JVM_MaxMemory;
-                JVM_MonitorNotify;
-                JVM_MonitorNotifyAll;
-                JVM_MonitorWait;
-                JVM_NanoTime;
-                JVM_NativePath;
-                JVM_NewArray;
-                JVM_NewInstanceFromConstructor;
-                JVM_NewMultiArray;
-                JVM_RaiseSignal;
-                JVM_RawMonitorCreate;
-                JVM_RawMonitorDestroy;
-                JVM_RawMonitorEnter;
-                JVM_RawMonitorExit;
-                JVM_RegisterSignal;
-                JVM_ReleaseUTF;
-                JVM_ResumeThread;
-                JVM_SetArrayElement;
-                JVM_SetClassSigners;
-                JVM_SetNativeThreadName;
-                JVM_SetPrimitiveArrayElement;
-                JVM_SetThreadPriority;
-                JVM_Sleep;
-                JVM_StartThread;
-                JVM_StopThread;
-                JVM_SuspendThread;
-                JVM_SupportsCX8;
-                JVM_TotalMemory;
-                JVM_UnloadLibrary;
-                JVM_Yield;
                 JVM_handle_linux_signal;
 
                 # miscellaneous functions
--- a/hotspot/make/bsd/makefiles/vm.make	Tue Oct 06 08:43:02 2015 -0700
+++ b/hotspot/make/bsd/makefiles/vm.make	Wed Jul 05 20:52:10 2017 +0200
@@ -234,10 +234,29 @@
 
 vm_version.o: $(filter-out vm_version.o,$(JVM_OBJ_FILES))
 
-mapfile : $(MAPFILE) vm.def mapfile_ext
+MAPFILE_SHARE  := $(GAMMADIR)/make/share/makefiles/mapfile-vers
+
+MAPFILE_EXT_SRC := $(HS_ALT_MAKE)/share/makefiles/mapfile-ext
+ifneq ("$(wildcard $(MAPFILE_EXT_SRC))","")
+MAPFILE_EXT     := $(MAPFILE_EXT_SRC)
+endif
+
+# For Darwin: add _ prefix and remove trailing ;
+mapfile_extra: $(MAPFILE_SHARE) $(MAPFILE_EXT)
+	rm -f $@
+ifeq ($(OS_VENDOR), Darwin)
+	cat $(MAPFILE_SHARE) $(MAPFILE_EXT) | \
+	    sed -e 's/#.*//g' -e 's/[ ]*//g' -e 's/;//g' | \
+	    awk '{ if ($$0 ~ ".") { print "\t\t_" $$0 } }' \
+	 > $@
+else
+	cat $(MAPFILE_SHARE) $(MAPFILE_EXT) > $@
+endif
+
+mapfile : $(MAPFILE) mapfile_extra vm.def
 	rm -f $@
 	awk '{ if ($$0 ~ "INSERT VTABLE SYMBOLS HERE")	\
-                 { system ("cat mapfile_ext"); system ("cat vm.def"); } \
+                 { system ("cat mapfile_extra vm.def"); } \
                else					\
                  { print $$0 }				\
              }' > $@ < $(MAPFILE)
--- a/hotspot/make/linux/makefiles/mapfile-vers-debug	Tue Oct 06 08:43:02 2015 -0700
+++ b/hotspot/make/linux/makefiles/mapfile-vers-debug	Wed Jul 05 20:52:10 2017 +0200
@@ -26,168 +26,6 @@
 
 SUNWprivate_1.1 {
         global:
-                # JNI
-                JNI_CreateJavaVM;
-                JNI_GetCreatedJavaVMs;
-                JNI_GetDefaultJavaVMInitArgs;
-
-                # JVM
-                JVM_ActiveProcessorCount;
-                JVM_ArrayCopy;
-                JVM_AssertionStatusDirectives;
-                JVM_ClassDepth;
-                JVM_ClassLoaderDepth;
-                JVM_Clone;
-                JVM_ConstantPoolGetClassAt;
-                JVM_ConstantPoolGetClassAtIfLoaded;
-                JVM_ConstantPoolGetDoubleAt;
-                JVM_ConstantPoolGetFieldAt;
-                JVM_ConstantPoolGetFieldAtIfLoaded;
-                JVM_ConstantPoolGetFloatAt;
-                JVM_ConstantPoolGetIntAt;
-                JVM_ConstantPoolGetLongAt;
-                JVM_ConstantPoolGetMethodAt;
-                JVM_ConstantPoolGetMethodAtIfLoaded;
-                JVM_ConstantPoolGetMemberRefInfoAt;
-                JVM_ConstantPoolGetSize;
-                JVM_ConstantPoolGetStringAt;
-                JVM_ConstantPoolGetUTF8At;
-                JVM_CountStackFrames;
-                JVM_CurrentClassLoader;
-                JVM_CurrentLoadedClass;
-                JVM_CurrentThread;
-                JVM_CurrentTimeMillis;
-                JVM_DefineClass;
-                JVM_DefineClassWithSource;
-                JVM_DefineClassWithSourceCond;
-                JVM_DesiredAssertionStatus;
-                JVM_DoPrivileged;
-                JVM_DumpAllStacks;
-                JVM_DumpThreads;
-                JVM_FillInStackTrace;
-                JVM_FindClassFromCaller;
-                JVM_FindClassFromClass;
-                JVM_FindClassFromBootLoader;
-                JVM_FindLibraryEntry;
-                JVM_FindLoadedClass;
-                JVM_FindPrimitiveClass;
-                JVM_FindSignal;
-                JVM_FreeMemory;
-                JVM_GC;
-                JVM_GetAllThreads;
-                JVM_GetArrayElement;
-                JVM_GetArrayLength;
-                JVM_GetCPClassNameUTF;
-                JVM_GetCPFieldClassNameUTF;
-                JVM_GetCPFieldModifiers;
-                JVM_GetCPFieldNameUTF;
-                JVM_GetCPFieldSignatureUTF;
-                JVM_GetCPMethodClassNameUTF;
-                JVM_GetCPMethodModifiers;
-                JVM_GetCPMethodNameUTF;
-                JVM_GetCPMethodSignatureUTF;
-                JVM_GetCallerClass;
-                JVM_GetClassAccessFlags;
-                JVM_GetClassAnnotations;
-                JVM_GetClassCPEntriesCount;
-                JVM_GetClassCPTypes;
-                JVM_GetClassConstantPool;
-                JVM_GetClassContext;
-                JVM_GetClassDeclaredConstructors;
-                JVM_GetClassDeclaredFields;
-                JVM_GetClassDeclaredMethods;
-                JVM_GetClassFieldsCount;
-                JVM_GetClassInterfaces;
-                JVM_GetClassMethodsCount;
-                JVM_GetClassModifiers;
-                JVM_GetClassName;
-                JVM_GetClassNameUTF;
-                JVM_GetClassSignature;
-                JVM_GetClassSigners;
-                JVM_GetClassTypeAnnotations;
-                JVM_GetDeclaredClasses;
-                JVM_GetDeclaringClass;
-                JVM_GetSimpleBinaryName;
-                JVM_GetEnclosingMethodInfo;
-                JVM_GetFieldIxModifiers;
-                JVM_GetFieldTypeAnnotations;
-                JVM_GetInheritedAccessControlContext;
-                JVM_GetInterfaceVersion;
-                JVM_GetManagement;
-                JVM_GetMethodIxArgsSize;
-                JVM_GetMethodIxByteCode;
-                JVM_GetMethodIxByteCodeLength;
-                JVM_GetMethodIxExceptionIndexes;
-                JVM_GetMethodIxExceptionTableEntry;
-                JVM_GetMethodIxExceptionTableLength;
-                JVM_GetMethodIxExceptionsCount;
-                JVM_GetMethodIxLocalsCount;
-                JVM_GetMethodIxMaxStack;
-                JVM_GetMethodIxModifiers;
-                JVM_GetMethodIxNameUTF;
-                JVM_GetMethodIxSignatureUTF;
-                JVM_GetMethodParameters;
-                JVM_GetMethodTypeAnnotations;
-                JVM_GetNanoTimeAdjustment;
-                JVM_GetPrimitiveArrayElement;
-                JVM_GetProtectionDomain;
-                JVM_GetStackAccessControlContext;
-                JVM_GetStackTraceDepth;
-                JVM_GetStackTraceElement;
-                JVM_GetSystemPackage;
-                JVM_GetSystemPackages;
-                JVM_GetTemporaryDirectory;
-                JVM_GetVersionInfo;
-                JVM_Halt;
-                JVM_HoldsLock;
-                JVM_IHashCode;
-                JVM_InitAgentProperties;
-                JVM_InitProperties;
-                JVM_InternString;
-                JVM_Interrupt;
-                JVM_InvokeMethod;
-                JVM_IsArrayClass;
-                JVM_IsConstructorIx;
-                JVM_IsInterface;
-                JVM_IsInterrupted;
-                JVM_IsPrimitiveClass;
-                JVM_IsSameClassPackage;
-                JVM_IsSupportedJNIVersion;
-                JVM_IsThreadAlive;
-                JVM_IsVMGeneratedMethodIx;
-                JVM_LatestUserDefinedLoader;
-                JVM_LoadLibrary;
-                JVM_MaxObjectInspectionAge;
-                JVM_MaxMemory;
-                JVM_MonitorNotify;
-                JVM_MonitorNotifyAll;
-                JVM_MonitorWait;
-                JVM_NanoTime;
-                JVM_NativePath;
-                JVM_NewArray;
-                JVM_NewInstanceFromConstructor;
-                JVM_NewMultiArray;
-                JVM_RaiseSignal;
-                JVM_RawMonitorCreate;
-                JVM_RawMonitorDestroy;
-                JVM_RawMonitorEnter;
-                JVM_RawMonitorExit;
-                JVM_RegisterSignal;
-                JVM_ReleaseUTF;
-                JVM_ResumeThread;
-                JVM_SetArrayElement;
-                JVM_SetClassSigners;
-                JVM_SetNativeThreadName;
-                JVM_SetPrimitiveArrayElement;
-                JVM_SetThreadPriority;
-                JVM_Sleep;
-                JVM_StartThread;
-                JVM_StopThread;
-                JVM_SuspendThread;
-                JVM_SupportsCX8;
-                JVM_TotalMemory;
-                JVM_UnloadLibrary;
-                JVM_Yield;
                 JVM_handle_linux_signal;
 
                 # miscellaneous functions
--- a/hotspot/make/linux/makefiles/mapfile-vers-product	Tue Oct 06 08:43:02 2015 -0700
+++ b/hotspot/make/linux/makefiles/mapfile-vers-product	Wed Jul 05 20:52:10 2017 +0200
@@ -26,168 +26,6 @@
 
 SUNWprivate_1.1 {
         global:
-                # JNI
-                JNI_CreateJavaVM;
-                JNI_GetCreatedJavaVMs;
-                JNI_GetDefaultJavaVMInitArgs;
-
-                # JVM
-                JVM_ActiveProcessorCount;
-                JVM_ArrayCopy;
-                JVM_AssertionStatusDirectives;
-                JVM_ClassDepth;
-                JVM_ClassLoaderDepth;
-                JVM_Clone;
-                JVM_ConstantPoolGetClassAt;
-                JVM_ConstantPoolGetClassAtIfLoaded;
-                JVM_ConstantPoolGetDoubleAt;
-                JVM_ConstantPoolGetFieldAt;
-                JVM_ConstantPoolGetFieldAtIfLoaded;
-                JVM_ConstantPoolGetFloatAt;
-                JVM_ConstantPoolGetIntAt;
-                JVM_ConstantPoolGetLongAt;
-                JVM_ConstantPoolGetMethodAt;
-                JVM_ConstantPoolGetMethodAtIfLoaded;
-                JVM_ConstantPoolGetMemberRefInfoAt;
-                JVM_ConstantPoolGetSize;
-                JVM_ConstantPoolGetStringAt;
-                JVM_ConstantPoolGetUTF8At;
-                JVM_CountStackFrames;
-                JVM_CurrentClassLoader;
-                JVM_CurrentLoadedClass;
-                JVM_CurrentThread;
-                JVM_CurrentTimeMillis;
-                JVM_DefineClass;
-                JVM_DefineClassWithSource;
-                JVM_DefineClassWithSourceCond;
-                JVM_DesiredAssertionStatus;
-                JVM_DoPrivileged;
-                JVM_DumpAllStacks;
-                JVM_DumpThreads;
-                JVM_FillInStackTrace;
-                JVM_FindClassFromCaller;
-                JVM_FindClassFromClass;
-                JVM_FindClassFromBootLoader;
-                JVM_FindLibraryEntry;
-                JVM_FindLoadedClass;
-                JVM_FindPrimitiveClass;
-                JVM_FindSignal;
-                JVM_FreeMemory;
-                JVM_GC;
-                JVM_GetAllThreads;
-                JVM_GetArrayElement;
-                JVM_GetArrayLength;
-                JVM_GetCPClassNameUTF;
-                JVM_GetCPFieldClassNameUTF;
-                JVM_GetCPFieldModifiers;
-                JVM_GetCPFieldNameUTF;
-                JVM_GetCPFieldSignatureUTF;
-                JVM_GetCPMethodClassNameUTF;
-                JVM_GetCPMethodModifiers;
-                JVM_GetCPMethodNameUTF;
-                JVM_GetCPMethodSignatureUTF;
-                JVM_GetCallerClass;
-                JVM_GetClassAccessFlags;
-                JVM_GetClassAnnotations;
-                JVM_GetClassCPEntriesCount;
-                JVM_GetClassCPTypes;
-                JVM_GetClassConstantPool;
-                JVM_GetClassContext;
-                JVM_GetClassDeclaredConstructors;
-                JVM_GetClassDeclaredFields;
-                JVM_GetClassDeclaredMethods;
-                JVM_GetClassFieldsCount;
-                JVM_GetClassInterfaces;
-                JVM_GetClassMethodsCount;
-                JVM_GetClassModifiers;
-                JVM_GetClassName;
-                JVM_GetClassNameUTF;
-                JVM_GetClassSignature;
-                JVM_GetClassSigners;
-                JVM_GetClassTypeAnnotations;
-                JVM_GetDeclaredClasses;
-                JVM_GetDeclaringClass;
-                JVM_GetSimpleBinaryName;
-                JVM_GetEnclosingMethodInfo;
-                JVM_GetFieldIxModifiers;
-                JVM_GetFieldTypeAnnotations;
-                JVM_GetInheritedAccessControlContext;
-                JVM_GetInterfaceVersion;
-                JVM_GetManagement;
-                JVM_GetMethodIxArgsSize;
-                JVM_GetMethodIxByteCode;
-                JVM_GetMethodIxByteCodeLength;
-                JVM_GetMethodIxExceptionIndexes;
-                JVM_GetMethodIxExceptionTableEntry;
-                JVM_GetMethodIxExceptionTableLength;
-                JVM_GetMethodIxExceptionsCount;
-                JVM_GetMethodIxLocalsCount;
-                JVM_GetMethodIxMaxStack;
-                JVM_GetMethodIxModifiers;
-                JVM_GetMethodIxNameUTF;
-                JVM_GetMethodIxSignatureUTF;
-                JVM_GetMethodParameters;
-                JVM_GetMethodTypeAnnotations;
-                JVM_GetNanoTimeAdjustment;
-                JVM_GetPrimitiveArrayElement;
-                JVM_GetProtectionDomain;
-                JVM_GetStackAccessControlContext;
-                JVM_GetStackTraceDepth;
-                JVM_GetStackTraceElement;
-                JVM_GetSystemPackage;
-                JVM_GetSystemPackages;
-                JVM_GetTemporaryDirectory;
-                JVM_GetVersionInfo;
-                JVM_Halt;
-                JVM_HoldsLock;
-                JVM_IHashCode;
-                JVM_InitAgentProperties;
-                JVM_InitProperties;
-                JVM_InternString;
-                JVM_Interrupt;
-                JVM_InvokeMethod;
-                JVM_IsArrayClass;
-                JVM_IsConstructorIx;
-                JVM_IsInterface;
-                JVM_IsInterrupted;
-                JVM_IsPrimitiveClass;
-                JVM_IsSameClassPackage;
-                JVM_IsSupportedJNIVersion;
-                JVM_IsThreadAlive;
-                JVM_IsVMGeneratedMethodIx;
-                JVM_LatestUserDefinedLoader;
-                JVM_LoadLibrary;
-                JVM_MaxObjectInspectionAge;
-                JVM_MaxMemory;
-                JVM_MonitorNotify;
-                JVM_MonitorNotifyAll;
-                JVM_MonitorWait;
-                JVM_NanoTime;
-                JVM_NativePath;
-                JVM_NewArray;
-                JVM_NewInstanceFromConstructor;
-                JVM_NewMultiArray;
-                JVM_RaiseSignal;
-                JVM_RawMonitorCreate;
-                JVM_RawMonitorDestroy;
-                JVM_RawMonitorEnter;
-                JVM_RawMonitorExit;
-                JVM_RegisterSignal;
-                JVM_ReleaseUTF;
-                JVM_ResumeThread;
-                JVM_SetArrayElement;
-                JVM_SetClassSigners;
-                JVM_SetNativeThreadName;
-                JVM_SetPrimitiveArrayElement;
-                JVM_SetThreadPriority;
-                JVM_Sleep;
-                JVM_StartThread;
-                JVM_StopThread;
-                JVM_SuspendThread;
-                JVM_SupportsCX8;
-                JVM_TotalMemory;
-                JVM_UnloadLibrary;
-                JVM_Yield;
                 JVM_handle_linux_signal;
 
                 # miscellaneous functions
--- a/hotspot/make/linux/makefiles/vm.make	Tue Oct 06 08:43:02 2015 -0700
+++ b/hotspot/make/linux/makefiles/vm.make	Wed Jul 05 20:52:10 2017 +0200
@@ -232,10 +232,17 @@
 
 vm_version.o: $(filter-out vm_version.o,$(JVM_OBJ_FILES))
 
-mapfile : $(MAPFILE) vm.def mapfile_ext
+MAPFILE_SHARE  := $(GAMMADIR)/make/share/makefiles/mapfile-vers
+
+MAPFILE_EXT_SRC := $(HS_ALT_MAKE)/share/makefiles/mapfile-ext
+ifneq ("$(wildcard $(MAPFILE_EXT_SRC))","")
+MAPFILE_EXT     := $(MAPFILE_EXT_SRC)
+endif
+
+mapfile : $(MAPFILE) $(MAPFILE_SHARE) vm.def $(MAPFILE_EXT)
 	rm -f $@
 	awk '{ if ($$0 ~ "INSERT VTABLE SYMBOLS HERE")	\
-                 { system ("cat mapfile_ext"); system ("cat vm.def"); } \
+                 { system ("cat ${MAPFILE_SHARE} $(MAPFILE_EXT) vm.def"); } \
                else					\
                  { print $$0 }				\
              }' > $@ < $(MAPFILE)
@@ -259,13 +266,6 @@
 	cat $(VM_DEF_EXT) >> $@
 endif        
 
-mapfile_ext:
-	rm -f $@
-	touch $@
-	if [ -f $(HS_ALT_MAKE)/linux/makefiles/mapfile-ext ]; then \
-	  cat $(HS_ALT_MAKE)/linux/makefiles/mapfile-ext > $@; \
-	fi
-
 ifeq ($(JVM_VARIANT_ZEROSHARK), true)
   STATIC_CXX = false
 else
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/make/share/makefiles/mapfile-vers	Wed Jul 05 20:52:10 2017 +0200
@@ -0,0 +1,162 @@
+                # JNI
+                JNI_CreateJavaVM;
+                JNI_GetCreatedJavaVMs;
+                JNI_GetDefaultJavaVMInitArgs;
+
+                # JVM
+                JVM_ActiveProcessorCount;
+                JVM_ArrayCopy;
+                JVM_AssertionStatusDirectives;
+                JVM_ClassDepth;
+                JVM_ClassLoaderDepth;
+                JVM_Clone;
+                JVM_ConstantPoolGetClassAt;
+                JVM_ConstantPoolGetClassAtIfLoaded;
+                JVM_ConstantPoolGetDoubleAt;
+                JVM_ConstantPoolGetFieldAt;
+                JVM_ConstantPoolGetFieldAtIfLoaded;
+                JVM_ConstantPoolGetFloatAt;
+                JVM_ConstantPoolGetIntAt;
+                JVM_ConstantPoolGetLongAt;
+                JVM_ConstantPoolGetMethodAt;
+                JVM_ConstantPoolGetMethodAtIfLoaded;
+                JVM_ConstantPoolGetMemberRefInfoAt;
+                JVM_ConstantPoolGetSize;
+                JVM_ConstantPoolGetStringAt;
+                JVM_ConstantPoolGetUTF8At;
+                JVM_CountStackFrames;
+                JVM_CurrentClassLoader;
+                JVM_CurrentLoadedClass;
+                JVM_CurrentThread;
+                JVM_CurrentTimeMillis;
+                JVM_DefineClass;
+                JVM_DefineClassWithSource;
+                JVM_DefineClassWithSourceCond;
+                JVM_DesiredAssertionStatus;
+                JVM_DoPrivileged;
+                JVM_DumpAllStacks;
+                JVM_DumpThreads;
+                JVM_FillInStackTrace;
+                JVM_FindClassFromCaller;
+                JVM_FindClassFromClass;
+                JVM_FindClassFromBootLoader;
+                JVM_FindLibraryEntry;
+                JVM_FindLoadedClass;
+                JVM_FindPrimitiveClass;
+                JVM_FindSignal;
+                JVM_FreeMemory;
+                JVM_GC;
+                JVM_GetAllThreads;
+                JVM_GetArrayElement;
+                JVM_GetArrayLength;
+                JVM_GetCPClassNameUTF;
+                JVM_GetCPFieldClassNameUTF;
+                JVM_GetCPFieldModifiers;
+                JVM_GetCPFieldNameUTF;
+                JVM_GetCPFieldSignatureUTF;
+                JVM_GetCPMethodClassNameUTF;
+                JVM_GetCPMethodModifiers;
+                JVM_GetCPMethodNameUTF;
+                JVM_GetCPMethodSignatureUTF;
+                JVM_GetCallerClass;
+                JVM_GetClassAccessFlags;
+                JVM_GetClassAnnotations;
+                JVM_GetClassCPEntriesCount;
+                JVM_GetClassCPTypes;
+                JVM_GetClassConstantPool;
+                JVM_GetClassContext;
+                JVM_GetClassDeclaredConstructors;
+                JVM_GetClassDeclaredFields;
+                JVM_GetClassDeclaredMethods;
+                JVM_GetClassFieldsCount;
+                JVM_GetClassInterfaces;
+                JVM_GetClassMethodsCount;
+                JVM_GetClassModifiers;
+                JVM_GetClassName;
+                JVM_GetClassNameUTF;
+                JVM_GetClassSignature;
+                JVM_GetClassSigners;
+                JVM_GetClassTypeAnnotations;
+                JVM_GetDeclaredClasses;
+                JVM_GetDeclaringClass;
+                JVM_GetSimpleBinaryName;
+                JVM_GetEnclosingMethodInfo;
+                JVM_GetFieldIxModifiers;
+                JVM_GetFieldTypeAnnotations;
+                JVM_GetInheritedAccessControlContext;
+                JVM_GetInterfaceVersion;
+                JVM_GetManagement;
+                JVM_GetMethodIxArgsSize;
+                JVM_GetMethodIxByteCode;
+                JVM_GetMethodIxByteCodeLength;
+                JVM_GetMethodIxExceptionIndexes;
+                JVM_GetMethodIxExceptionTableEntry;
+                JVM_GetMethodIxExceptionTableLength;
+                JVM_GetMethodIxExceptionsCount;
+                JVM_GetMethodIxLocalsCount;
+                JVM_GetMethodIxMaxStack;
+                JVM_GetMethodIxModifiers;
+                JVM_GetMethodIxNameUTF;
+                JVM_GetMethodIxSignatureUTF;
+                JVM_GetMethodParameters;
+                JVM_GetMethodTypeAnnotations;
+                JVM_GetNanoTimeAdjustment;
+                JVM_GetPrimitiveArrayElement;
+                JVM_GetProtectionDomain;
+                JVM_GetStackAccessControlContext;
+                JVM_GetStackTraceDepth;
+                JVM_GetStackTraceElement;
+                JVM_GetSystemPackage;
+                JVM_GetSystemPackages;
+                JVM_GetTemporaryDirectory;
+                JVM_GetVersionInfo;
+                JVM_Halt;
+                JVM_HoldsLock;
+                JVM_IHashCode;
+                JVM_InitAgentProperties;
+                JVM_InitProperties;
+                JVM_InternString;
+                JVM_Interrupt;
+                JVM_InvokeMethod;
+                JVM_IsArrayClass;
+                JVM_IsConstructorIx;
+                JVM_IsInterface;
+                JVM_IsInterrupted;
+                JVM_IsPrimitiveClass;
+                JVM_IsSameClassPackage;
+                JVM_IsSupportedJNIVersion;
+                JVM_IsThreadAlive;
+                JVM_IsVMGeneratedMethodIx;
+                JVM_LatestUserDefinedLoader;
+                JVM_LoadLibrary;
+                JVM_MaxObjectInspectionAge;
+                JVM_MaxMemory;
+                JVM_MonitorNotify;
+                JVM_MonitorNotifyAll;
+                JVM_MonitorWait;
+                JVM_NanoTime;
+                JVM_NativePath;
+                JVM_NewArray;
+                JVM_NewInstanceFromConstructor;
+                JVM_NewMultiArray;
+                JVM_RaiseSignal;
+                JVM_RawMonitorCreate;
+                JVM_RawMonitorDestroy;
+                JVM_RawMonitorEnter;
+                JVM_RawMonitorExit;
+                JVM_RegisterSignal;
+                JVM_ReleaseUTF;
+                JVM_ResumeThread;
+                JVM_SetArrayElement;
+                JVM_SetClassSigners;
+                JVM_SetNativeThreadName;
+                JVM_SetPrimitiveArrayElement;
+                JVM_SetThreadPriority;
+                JVM_Sleep;
+                JVM_StartThread;
+                JVM_StopThread;
+                JVM_SuspendThread;
+                JVM_SupportsCX8;
+                JVM_TotalMemory;
+                JVM_UnloadLibrary;
+                JVM_Yield;
--- a/hotspot/make/solaris/makefiles/mapfile-vers	Tue Oct 06 08:43:02 2015 -0700
+++ b/hotspot/make/solaris/makefiles/mapfile-vers	Wed Jul 05 20:52:10 2017 +0200
@@ -26,168 +26,6 @@
 
 SUNWprivate_1.1 {
         global:
-                # JNI
-                JNI_CreateJavaVM;
-                JNI_GetCreatedJavaVMs;
-                JNI_GetDefaultJavaVMInitArgs;
-
-                # JVM
-                JVM_ActiveProcessorCount;
-                JVM_ArrayCopy;
-                JVM_AssertionStatusDirectives;
-                JVM_ClassDepth;
-                JVM_ClassLoaderDepth;
-                JVM_Clone;
-                JVM_ConstantPoolGetClassAt;
-                JVM_ConstantPoolGetClassAtIfLoaded;
-                JVM_ConstantPoolGetDoubleAt;
-                JVM_ConstantPoolGetFieldAt;
-                JVM_ConstantPoolGetFieldAtIfLoaded;
-                JVM_ConstantPoolGetFloatAt;
-                JVM_ConstantPoolGetIntAt;
-                JVM_ConstantPoolGetLongAt;
-                JVM_ConstantPoolGetMethodAt;
-                JVM_ConstantPoolGetMethodAtIfLoaded;
-                JVM_ConstantPoolGetMemberRefInfoAt;
-                JVM_ConstantPoolGetSize;
-                JVM_ConstantPoolGetStringAt;
-                JVM_ConstantPoolGetUTF8At;
-                JVM_CountStackFrames;
-                JVM_CurrentClassLoader;
-                JVM_CurrentLoadedClass;
-                JVM_CurrentThread;
-                JVM_CurrentTimeMillis;
-                JVM_DefineClass;
-                JVM_DefineClassWithSource;
-                JVM_DefineClassWithSourceCond;
-                JVM_DesiredAssertionStatus;
-                JVM_DoPrivileged;
-                JVM_DumpAllStacks;
-                JVM_DumpThreads;
-                JVM_FillInStackTrace;
-                JVM_FindClassFromCaller;
-                JVM_FindClassFromClass;
-                JVM_FindClassFromBootLoader;
-                JVM_FindLibraryEntry;
-                JVM_FindLoadedClass;
-                JVM_FindPrimitiveClass;
-                JVM_FindSignal;
-                JVM_FreeMemory;
-                JVM_GC;
-                JVM_GetAllThreads;
-                JVM_GetArrayElement;
-                JVM_GetArrayLength;
-                JVM_GetCPClassNameUTF;
-                JVM_GetCPFieldClassNameUTF;
-                JVM_GetCPFieldModifiers;
-                JVM_GetCPFieldNameUTF;
-                JVM_GetCPFieldSignatureUTF;
-                JVM_GetCPMethodClassNameUTF;
-                JVM_GetCPMethodModifiers;
-                JVM_GetCPMethodNameUTF;
-                JVM_GetCPMethodSignatureUTF;
-                JVM_GetCallerClass;
-                JVM_GetClassAccessFlags;
-                JVM_GetClassAnnotations;
-                JVM_GetClassCPEntriesCount;
-                JVM_GetClassCPTypes;
-                JVM_GetClassConstantPool;
-                JVM_GetClassContext;
-                JVM_GetClassDeclaredConstructors;
-                JVM_GetClassDeclaredFields;
-                JVM_GetClassDeclaredMethods;
-                JVM_GetClassFieldsCount;
-                JVM_GetClassInterfaces;
-                JVM_GetClassMethodsCount;
-                JVM_GetClassModifiers;
-                JVM_GetClassName;
-                JVM_GetClassNameUTF;
-                JVM_GetClassSignature;
-                JVM_GetClassSigners;
-                JVM_GetClassTypeAnnotations;
-                JVM_GetDeclaredClasses;
-                JVM_GetDeclaringClass;
-                JVM_GetSimpleBinaryName;
-                JVM_GetEnclosingMethodInfo;
-                JVM_GetFieldIxModifiers;
-                JVM_GetFieldTypeAnnotations;
-                JVM_GetInheritedAccessControlContext;
-                JVM_GetInterfaceVersion;
-                JVM_GetManagement;
-                JVM_GetMethodIxArgsSize;
-                JVM_GetMethodIxByteCode;
-                JVM_GetMethodIxByteCodeLength;
-                JVM_GetMethodIxExceptionIndexes;
-                JVM_GetMethodIxExceptionTableEntry;
-                JVM_GetMethodIxExceptionTableLength;
-                JVM_GetMethodIxExceptionsCount;
-                JVM_GetMethodIxLocalsCount;
-                JVM_GetMethodIxMaxStack;
-                JVM_GetMethodIxModifiers;
-                JVM_GetMethodIxNameUTF;
-                JVM_GetMethodIxSignatureUTF;
-                JVM_GetMethodParameters;
-                JVM_GetMethodTypeAnnotations;
-                JVM_GetNanoTimeAdjustment;
-                JVM_GetPrimitiveArrayElement;
-                JVM_GetProtectionDomain;
-                JVM_GetStackAccessControlContext;
-                JVM_GetStackTraceDepth;
-                JVM_GetStackTraceElement;
-                JVM_GetSystemPackage;
-                JVM_GetSystemPackages;
-                JVM_GetTemporaryDirectory;
-                JVM_GetVersionInfo;
-                JVM_Halt;
-                JVM_HoldsLock;
-                JVM_IHashCode;
-                JVM_InitAgentProperties;
-                JVM_InitProperties;
-                JVM_InternString;
-                JVM_Interrupt;
-                JVM_InvokeMethod;
-                JVM_IsArrayClass;
-                JVM_IsConstructorIx;
-                JVM_IsInterface;
-                JVM_IsInterrupted;
-                JVM_IsPrimitiveClass;
-                JVM_IsSameClassPackage;
-                JVM_IsSupportedJNIVersion;
-                JVM_IsThreadAlive;
-                JVM_IsVMGeneratedMethodIx;
-                JVM_LatestUserDefinedLoader;
-                JVM_LoadLibrary;
-                JVM_MaxObjectInspectionAge;
-                JVM_MaxMemory;
-                JVM_MonitorNotify;
-                JVM_MonitorNotifyAll;
-                JVM_MonitorWait;
-                JVM_NativePath;
-                JVM_NanoTime;
-                JVM_NewArray;
-                JVM_NewInstanceFromConstructor;
-                JVM_NewMultiArray;
-                JVM_RaiseSignal;
-                JVM_RawMonitorCreate;
-                JVM_RawMonitorDestroy;
-                JVM_RawMonitorEnter;
-                JVM_RawMonitorExit;
-                JVM_RegisterSignal;
-                JVM_ReleaseUTF;
-                JVM_ResumeThread;
-                JVM_SetArrayElement;
-                JVM_SetClassSigners;
-                JVM_SetNativeThreadName;
-                JVM_SetPrimitiveArrayElement;
-                JVM_SetThreadPriority;
-                JVM_Sleep;
-                JVM_StartThread;
-                JVM_StopThread;
-                JVM_SuspendThread;
-                JVM_SupportsCX8;
-                JVM_TotalMemory;
-                JVM_UnloadLibrary;
-                JVM_Yield;
                 JVM_handle_solaris_signal;
 
                 # miscellaneous functions
--- a/hotspot/make/solaris/makefiles/vm.make	Tue Oct 06 08:43:02 2015 -0700
+++ b/hotspot/make/solaris/makefiles/vm.make	Wed Jul 05 20:52:10 2017 +0200
@@ -241,13 +241,19 @@
 
 vm_version.o: $(filter-out vm_version.o,$(JVM_OBJ_FILES))
 
-mapfile : $(MAPFILE) $(MAPFILE_DTRACE_OPT) vm.def mapfile_ext
+MAPFILE_SHARE  := $(GAMMADIR)/make/share/makefiles/mapfile-vers
+
+MAPFILE_EXT_SRC := $(HS_ALT_MAKE)/share/makefiles/mapfile-ext
+ifneq ("$(wildcard $(MAPFILE_EXT_SRC))","")
+MAPFILE_EXT     := $(MAPFILE_EXT_SRC)
+endif
+
+mapfile : $(MAPFILE) $(MAPFILE_SHARE) vm.def $(MAPFILE_EXT)
 	rm -f $@
 	cat $(MAPFILE) $(MAPFILE_DTRACE_OPT) \
 	    | $(NAWK) '{                                         \
 	              if ($$0 ~ "INSERT VTABLE SYMBOLS HERE") {  \
-	                  system ("cat mapfile_ext");            \
-	                  system ("cat vm.def");                 \
+	                  system ("cat ${MAPFILE_SHARE} $(MAPFILE_EXT) vm.def"); \
 	              } else {                                   \
 	                  print $$0;                             \
 	              }                                          \
@@ -260,12 +266,6 @@
 vm.def: $(Obj_Files)
 	sh $(GAMMADIR)/make/solaris/makefiles/build_vm_def.sh *.o > $@
 
-mapfile_ext:
-	rm -f $@
-	touch $@
-	if [ -f $(HS_ALT_MAKE)/solaris/makefiles/mapfile-ext ]; then \
-	  cat $(HS_ALT_MAKE)/solaris/makefiles/mapfile-ext > $@; \
-	fi
 
 ifeq ($(LINK_INTO),AOUT)
   LIBJVM.o                 =
--- a/hotspot/src/cpu/aarch64/vm/interp_masm_aarch64.cpp	Tue Oct 06 08:43:02 2015 -0700
+++ b/hotspot/src/cpu/aarch64/vm/interp_masm_aarch64.cpp	Wed Jul 05 20:52:10 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved.
  * Copyright (c) 2014, Red Hat Inc. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -1608,6 +1608,8 @@
     test_method_data_pointer(mdp, profile_continue);
 
     if (MethodData::profile_return_jsr292_only()) {
+      assert(Method::intrinsic_id_size_in_bytes() == 2, "assuming Method::_intrinsic_id is u2");
+
       // If we don't profile all invoke bytecodes we must make sure
       // it's a bytecode we indeed profile. We can't go back to the
       // begining of the ProfileData we intend to update to check its
@@ -1620,7 +1622,7 @@
       cmp(rscratch1, Bytecodes::_invokehandle);
       br(Assembler::EQ, do_profile);
       get_method(tmp);
-      ldrb(rscratch1, Address(tmp, Method::intrinsic_id_offset_in_bytes()));
+      ldrh(rscratch1, Address(tmp, Method::intrinsic_id_offset_in_bytes()));
       cmp(rscratch1, vmIntrinsics::_compiledLambdaForm);
       br(Assembler::NE, profile_continue);
 
--- a/hotspot/src/cpu/aarch64/vm/methodHandles_aarch64.cpp	Tue Oct 06 08:43:02 2015 -0700
+++ b/hotspot/src/cpu/aarch64/vm/methodHandles_aarch64.cpp	Wed Jul 05 20:52:10 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
  * Copyright (c) 2014, Red Hat Inc. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -188,9 +188,11 @@
   address entry_point = __ pc();
 
   if (VerifyMethodHandles) {
+    assert(Method::intrinsic_id_size_in_bytes() == 2, "assuming Method::_intrinsic_id is u2");
+
     Label L;
     BLOCK_COMMENT("verify_intrinsic_id {");
-    __ ldrb(rscratch1, Address(rmethod, Method::intrinsic_id_offset_in_bytes()));
+    __ ldrh(rscratch1, Address(rmethod, Method::intrinsic_id_offset_in_bytes()));
     __ cmp(rscratch1, (int) iid);
     __ br(Assembler::EQ, L);
     if (iid == vmIntrinsics::_linkToVirtual ||
--- a/hotspot/src/cpu/ppc/vm/interp_masm_ppc_64.cpp	Tue Oct 06 08:43:02 2015 -0700
+++ b/hotspot/src/cpu/ppc/vm/interp_masm_ppc_64.cpp	Wed Jul 05 20:52:10 2017 +0200
@@ -1817,13 +1817,15 @@
     test_method_data_pointer(profile_continue);
 
     if (MethodData::profile_return_jsr292_only()) {
+      assert(Method::intrinsic_id_size_in_bytes() == 2, "assuming Method::_intrinsic_id is u2");
+
       // If we don't profile all invoke bytecodes we must make sure
       // it's a bytecode we indeed profile. We can't go back to the
       // begining of the ProfileData we intend to update to check its
       // type because we're right after it and we don't known its
       // length.
       lbz(tmp1, 0, R14_bcp);
-      lbz(tmp2, Method::intrinsic_id_offset_in_bytes(), R19_method);
+      lhz(tmp2, Method::intrinsic_id_offset_in_bytes(), R19_method);
       cmpwi(CCR0, tmp1, Bytecodes::_invokedynamic);
       cmpwi(CCR1, tmp1, Bytecodes::_invokehandle);
       cror(CCR0, Assembler::equal, CCR1, Assembler::equal);
--- a/hotspot/src/cpu/ppc/vm/methodHandles_ppc.cpp	Tue Oct 06 08:43:02 2015 -0700
+++ b/hotspot/src/cpu/ppc/vm/methodHandles_ppc.cpp	Wed Jul 05 20:52:10 2017 +0200
@@ -224,11 +224,12 @@
   address entry_point = __ pc();
 
   if (VerifyMethodHandles) {
+    assert(Method::intrinsic_id_size_in_bytes() == 2, "assuming Method::_intrinsic_id is u2");
+
     Label L;
     BLOCK_COMMENT("verify_intrinsic_id {");
     __ load_sized_value(temp1, Method::intrinsic_id_offset_in_bytes(), R19_method,
-                        sizeof(u1), /*is_signed*/ false);
-    // assert(sizeof(u1) == sizeof(Method::_intrinsic_id), "");
+                        sizeof(u2), /*is_signed*/ false);
     __ cmpwi(CCR1, temp1, (int) iid);
     __ beq(CCR1, L);
     if (iid == vmIntrinsics::_linkToVirtual ||
--- a/hotspot/src/cpu/sparc/vm/interp_masm_sparc.cpp	Tue Oct 06 08:43:02 2015 -0700
+++ b/hotspot/src/cpu/sparc/vm/interp_masm_sparc.cpp	Wed Jul 05 20:52:10 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2015, 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
@@ -2021,6 +2021,8 @@
     test_method_data_pointer(profile_continue);
 
     if (MethodData::profile_return_jsr292_only()) {
+      assert(Method::intrinsic_id_size_in_bytes() == 2, "assuming Method::_intrinsic_id is u2");
+
       // If we don't profile all invoke bytecodes we must make sure
       // it's a bytecode we indeed profile. We can't go back to the
       // begining of the ProfileData we intend to update to check its
@@ -2031,7 +2033,7 @@
       cmp_and_br_short(tmp1, Bytecodes::_invokedynamic, equal, pn, do_profile);
       cmp(tmp1, Bytecodes::_invokehandle);
       br(equal, false, pn, do_profile);
-      delayed()->ldub(Lmethod, Method::intrinsic_id_offset_in_bytes(), tmp1);
+      delayed()->lduh(Lmethod, Method::intrinsic_id_offset_in_bytes(), tmp1);
       cmp_and_br_short(tmp1, vmIntrinsics::_compiledLambdaForm, notEqual, pt, profile_continue);
 
       bind(do_profile);
--- a/hotspot/src/cpu/sparc/vm/methodHandles_sparc.cpp	Tue Oct 06 08:43:02 2015 -0700
+++ b/hotspot/src/cpu/sparc/vm/methodHandles_sparc.cpp	Wed Jul 05 20:52:10 2017 +0200
@@ -229,9 +229,11 @@
   address entry_point = __ pc();
 
   if (VerifyMethodHandles) {
+    assert(Method::intrinsic_id_size_in_bytes() == 2, "assuming Method::_intrinsic_id is u2");
+
     Label L;
     BLOCK_COMMENT("verify_intrinsic_id {");
-    __ ldub(Address(G5_method, Method::intrinsic_id_offset_in_bytes()), O1_scratch);
+    __ lduh(Address(G5_method, Method::intrinsic_id_offset_in_bytes()), O1_scratch);
     __ cmp_and_br_short(O1_scratch, (int) iid, Assembler::equal, Assembler::pt, L);
     if (iid == vmIntrinsics::_linkToVirtual ||
         iid == vmIntrinsics::_linkToSpecial) {
--- a/hotspot/src/cpu/x86/vm/interp_masm_x86.cpp	Tue Oct 06 08:43:02 2015 -0700
+++ b/hotspot/src/cpu/x86/vm/interp_masm_x86.cpp	Wed Jul 05 20:52:10 2017 +0200
@@ -169,6 +169,8 @@
     test_method_data_pointer(mdp, profile_continue);
 
     if (MethodData::profile_return_jsr292_only()) {
+      assert(Method::intrinsic_id_size_in_bytes() == 2, "assuming Method::_intrinsic_id is u2");
+
       // If we don't profile all invoke bytecodes we must make sure
       // it's a bytecode we indeed profile. We can't go back to the
       // begining of the ProfileData we intend to update to check its
@@ -180,7 +182,7 @@
       cmpb(Address(_bcp_register, 0), Bytecodes::_invokehandle);
       jcc(Assembler::equal, do_profile);
       get_method(tmp);
-      cmpb(Address(tmp, Method::intrinsic_id_offset_in_bytes()), vmIntrinsics::_compiledLambdaForm);
+      cmpw(Address(tmp, Method::intrinsic_id_offset_in_bytes()), vmIntrinsics::_compiledLambdaForm);
       jcc(Assembler::notEqual, profile_continue);
 
       bind(do_profile);
--- a/hotspot/src/cpu/x86/vm/methodHandles_x86.cpp	Tue Oct 06 08:43:02 2015 -0700
+++ b/hotspot/src/cpu/x86/vm/methodHandles_x86.cpp	Wed Jul 05 20:52:10 2017 +0200
@@ -222,9 +222,11 @@
   address entry_point = __ pc();
 
   if (VerifyMethodHandles) {
+    assert(Method::intrinsic_id_size_in_bytes() == 2, "assuming Method::_intrinsic_id is u2");
+
     Label L;
     BLOCK_COMMENT("verify_intrinsic_id {");
-    __ cmpb(Address(rbx_method, Method::intrinsic_id_offset_in_bytes()), (int) iid);
+    __ cmpw(Address(rbx_method, Method::intrinsic_id_offset_in_bytes()), (int) iid);
     __ jcc(Assembler::equal, L);
     if (iid == vmIntrinsics::_linkToVirtual ||
         iid == vmIntrinsics::_linkToSpecial) {
--- a/hotspot/src/share/vm/classfile/classFileParser.cpp	Tue Oct 06 08:43:02 2015 -0700
+++ b/hotspot/src/share/vm/classfile/classFileParser.cpp	Wed Jul 05 20:52:10 2017 +0200
@@ -1989,6 +1989,10 @@
       flags = JVM_ACC_STATIC;
     } else if ((flags & JVM_ACC_STATIC) == JVM_ACC_STATIC) {
       flags &= JVM_ACC_STATIC | JVM_ACC_STRICT;
+    } else {
+      // As of major_version 51, a method named <clinit> without ACC_STATIC is
+      // just another method. So, do a normal method modifer check.
+      verify_legal_method_modifiers(flags, is_interface, name, CHECK_(nullHandle));
     }
   } else {
     verify_legal_method_modifiers(flags, is_interface, name, CHECK_(nullHandle));
--- a/hotspot/src/share/vm/classfile/verificationType.cpp	Tue Oct 06 08:43:02 2015 -0700
+++ b/hotspot/src/share/vm/classfile/verificationType.cpp	Wed Jul 05 20:52:10 2017 +0200
@@ -70,9 +70,12 @@
     if (this_class->is_interface() && (!from_field_is_protected ||
         from.name() != vmSymbols::java_lang_Object())) {
       // If we are not trying to access a protected field or method in
-      // java.lang.Object then we treat interfaces as java.lang.Object,
-      // including java.lang.Cloneable and java.io.Serializable.
-      return true;
+      // java.lang.Object then, for arrays, we only allow assignability
+      // to interfaces java.lang.Cloneable and java.io.Serializable.
+      // Otherwise, we treat interfaces as java.lang.Object.
+      return !from.is_array() ||
+        this_class == SystemDictionary::Cloneable_klass() ||
+        this_class == SystemDictionary::Serializable_klass();
     } else if (from.is_object()) {
       Klass* from_class = SystemDictionary::resolve_or_fail(
           from.name(), Handle(THREAD, klass->class_loader()),
--- a/hotspot/src/share/vm/classfile/verifier.cpp	Tue Oct 06 08:43:02 2015 -0700
+++ b/hotspot/src/share/vm/classfile/verifier.cpp	Wed Jul 05 20:52:10 2017 +0200
@@ -1579,9 +1579,11 @@
             return;
           }
           // Make sure "this" has been initialized if current method is an
-          // <init>
+          // <init>.  Note that "<init>" methods in interfaces are just
+          // normal methods.  Interfaces cannot have ctors.
           if (_method->name() == vmSymbols::object_initializer_name() &&
-              current_frame.flag_this_uninit()) {
+              current_frame.flag_this_uninit() &&
+              !current_class()->is_interface()) {
             verify_error(ErrorContext::bad_code(bci),
                          "Constructor must call super() or this() "
                          "before return");
--- a/hotspot/src/share/vm/gc/g1/g1CollectedHeap.cpp	Tue Oct 06 08:43:02 2015 -0700
+++ b/hotspot/src/share/vm/gc/g1/g1CollectedHeap.cpp	Wed Jul 05 20:52:10 2017 +0200
@@ -73,13 +73,6 @@
 
 size_t G1CollectedHeap::_humongous_object_threshold_in_words = 0;
 
-// turn it on so that the contents of the young list (scan-only /
-// to-be-collected) are printed at "strategic" points before / during
-// / after the collection --- this is useful for debugging
-#define YOUNG_LIST_VERBOSE 0
-// CURRENT STATUS
-// This file is under construction.  Search for "FIXME".
-
 // INVARIANTS/NOTES
 //
 // All allocation activity covered by the G1CollectedHeap interface is
@@ -4079,29 +4072,12 @@
         // the possible verification above.
         double sample_start_time_sec = os::elapsedTime();
 
-#if YOUNG_LIST_VERBOSE
-        gclog_or_tty->print_cr("\nBefore recording pause start.\nYoung_list:");
-        _young_list->print();
-        g1_policy()->print_collection_set(g1_policy()->inc_cset_head(), gclog_or_tty);
-#endif // YOUNG_LIST_VERBOSE
-
         g1_policy()->record_collection_pause_start(sample_start_time_sec);
 
-#if YOUNG_LIST_VERBOSE
-        gclog_or_tty->print_cr("\nAfter recording pause start.\nYoung_list:");
-        _young_list->print();
-#endif // YOUNG_LIST_VERBOSE
-
         if (collector_state()->during_initial_mark_pause()) {
           concurrent_mark()->checkpointRootsInitialPre();
         }
 
-#if YOUNG_LIST_VERBOSE
-        gclog_or_tty->print_cr("\nBefore choosing collection set.\nYoung_list:");
-        _young_list->print();
-        g1_policy()->print_collection_set(g1_policy()->inc_cset_head(), gclog_or_tty);
-#endif // YOUNG_LIST_VERBOSE
-
         double time_remaining_ms = g1_policy()->finalize_young_cset_part(target_pause_time_ms);
         g1_policy()->finalize_old_cset_part(time_remaining_ms);
 
@@ -4157,11 +4133,6 @@
         assert(check_young_list_empty(false /* check_heap */),
           "young list should be empty");
 
-#if YOUNG_LIST_VERBOSE
-        gclog_or_tty->print_cr("Before recording survivors.\nYoung List:");
-        _young_list->print();
-#endif // YOUNG_LIST_VERBOSE
-
         g1_policy()->record_survivor_regions(_young_list->survivor_length(),
                                              _young_list->first_survivor_region(),
                                              _young_list->last_survivor_region());
@@ -4197,12 +4168,6 @@
 
         allocate_dummy_regions();
 
-#if YOUNG_LIST_VERBOSE
-        gclog_or_tty->print_cr("\nEnd of the pause.\nYoung_list:");
-        _young_list->print();
-        g1_policy()->print_collection_set(g1_policy()->inc_cset_head(), gclog_or_tty);
-#endif // YOUNG_LIST_VERBOSE
-
         _allocator->init_mutator_alloc_region();
 
         {
--- a/hotspot/src/share/vm/gc/g1/g1EvacStats.cpp	Tue Oct 06 08:43:02 2015 -0700
+++ b/hotspot/src/share/vm/gc/g1/g1EvacStats.cpp	Wed Jul 05 20:52:10 2017 +0200
@@ -93,7 +93,7 @@
     size_t const used_for_waste_calculation = used() > _region_end_waste ? used() - _region_end_waste : 0;
 
     size_t const total_waste_allowed = used_for_waste_calculation * TargetPLABWastePct;
-    size_t const cur_plab_sz = (double)total_waste_allowed / G1LastPLABAverageOccupancy;
+    size_t const cur_plab_sz = (size_t)((double)total_waste_allowed / G1LastPLABAverageOccupancy);
     // Take historical weighted average
     _filter.sample(cur_plab_sz);
     // Clip from above and below, and align to object boundary
--- a/hotspot/src/share/vm/gc/shared/gcTrace.cpp	Tue Oct 06 08:43:02 2015 -0700
+++ b/hotspot/src/share/vm/gc/shared/gcTrace.cpp	Wed Jul 05 20:52:10 2017 +0200
@@ -88,8 +88,6 @@
   send_reference_stats_event(REF_WEAK, rps.weak_count());
   send_reference_stats_event(REF_FINAL, rps.final_count());
   send_reference_stats_event(REF_PHANTOM, rps.phantom_count());
-  send_reference_stats_event(REF_CLEANER, rps.cleaner_count());
-  send_reference_stats_event(REF_JNI, rps.jni_weak_ref_count());
 }
 
 #if INCLUDE_SERVICES
--- a/hotspot/src/share/vm/gc/shared/referenceProcessor.cpp	Tue Oct 06 08:43:02 2015 -0700
+++ b/hotspot/src/share/vm/gc/shared/referenceProcessor.cpp	Wed Jul 05 20:52:10 2017 +0200
@@ -243,13 +243,10 @@
       process_discovered_reflist(_discoveredPhantomRefs, NULL, false,
                                  is_alive, keep_alive, complete_gc, task_executor);
 
-  }
-
-  // Cleaners
-  size_t cleaner_count = 0;
-  {
-    GCTraceTime tt("Cleaners", trace_time, false, gc_timer, gc_id);
-    cleaner_count =
+    // Process cleaners, but include them in phantom statistics.  We expect
+    // Cleaner references to be temporary, and don't want to deal with
+    // possible incompatibilities arising from making it more visible.
+    phantom_count +=
       process_discovered_reflist(_discoveredCleanerRefs, NULL, true,
                                  is_alive, keep_alive, complete_gc, task_executor);
   }
@@ -259,17 +256,15 @@
   // that is not how the JDK1.2 specification is. See #4126360. Native code can
   // thus use JNI weak references to circumvent the phantom references and
   // resurrect a "post-mortem" object.
-  size_t jni_weak_ref_count = 0;
   {
     GCTraceTime tt("JNI Weak Reference", trace_time, false, gc_timer, gc_id);
     if (task_executor != NULL) {
       task_executor->set_single_threaded_mode();
     }
-    jni_weak_ref_count =
-      process_phaseJNI(is_alive, keep_alive, complete_gc);
+    process_phaseJNI(is_alive, keep_alive, complete_gc);
   }
 
-  return ReferenceProcessorStats(soft_count, weak_count, final_count, phantom_count, cleaner_count, jni_weak_ref_count);
+  return ReferenceProcessorStats(soft_count, weak_count, final_count, phantom_count);
 }
 
 #ifndef PRODUCT
@@ -296,17 +291,17 @@
 }
 #endif
 
-size_t ReferenceProcessor::process_phaseJNI(BoolObjectClosure* is_alive,
-                                            OopClosure*        keep_alive,
-                                            VoidClosure*       complete_gc) {
-  DEBUG_ONLY(size_t check_count = count_jni_refs();)
-  size_t count = JNIHandles::weak_oops_do(is_alive, keep_alive);
-  assert(count == check_count, "Counts didn't match");
+void ReferenceProcessor::process_phaseJNI(BoolObjectClosure* is_alive,
+                                          OopClosure*        keep_alive,
+                                          VoidClosure*       complete_gc) {
+#ifndef PRODUCT
+  if (PrintGCDetails && PrintReferenceGC) {
+    unsigned int count = count_jni_refs();
+    gclog_or_tty->print(", %u refs", count);
+  }
+#endif
+  JNIHandles::weak_oops_do(is_alive, keep_alive);
   complete_gc->do_void();
-  if (PrintGCDetails && PrintReferenceGC) {
-    gclog_or_tty->print(", " SIZE_FORMAT " refs", count);
-  }
-  return count;
 }
 
 
@@ -946,10 +941,9 @@
       list = &_discoveredCleanerRefs[id];
       break;
     case REF_NONE:
-    case REF_JNI:
       // we should not reach here if we are an InstanceRefKlass
     default:
-      guarantee(false, err_msg("rt should not be %d", rt));
+      ShouldNotReachHere();
   }
   if (TraceReferenceGC && PrintGCDetails) {
     gclog_or_tty->print_cr("Thread %d gets list " INTPTR_FORMAT, id, p2i(list));
--- a/hotspot/src/share/vm/gc/shared/referenceProcessor.hpp	Tue Oct 06 08:43:02 2015 -0700
+++ b/hotspot/src/share/vm/gc/shared/referenceProcessor.hpp	Wed Jul 05 20:52:10 2017 +0200
@@ -247,7 +247,7 @@
   DiscoveredList* _discoveredCleanerRefs;
 
  public:
-  static int number_of_subclasses_of_ref() { return REF_LISTS_COUNT; }
+  static int number_of_subclasses_of_ref() { return (REF_CLEANER - REF_OTHER); }
 
   uint num_q()                             { return _num_q; }
   uint max_num_q()                         { return _max_num_q; }
@@ -271,9 +271,9 @@
                                     VoidClosure*                 complete_gc,
                                     AbstractRefProcTaskExecutor* task_executor);
 
-  size_t process_phaseJNI(BoolObjectClosure* is_alive,
-                          OopClosure*        keep_alive,
-                          VoidClosure*       complete_gc);
+  void process_phaseJNI(BoolObjectClosure* is_alive,
+                        OopClosure*        keep_alive,
+                        VoidClosure*       complete_gc);
 
   // Work methods used by the method process_discovered_reflist
   // Phase1: keep alive all those referents that are otherwise
--- a/hotspot/src/share/vm/gc/shared/referenceProcessorStats.hpp	Tue Oct 06 08:43:02 2015 -0700
+++ b/hotspot/src/share/vm/gc/shared/referenceProcessorStats.hpp	Wed Jul 05 20:52:10 2017 +0200
@@ -36,30 +36,22 @@
   size_t _weak_count;
   size_t _final_count;
   size_t _phantom_count;
-  size_t _cleaner_count;
-  size_t _jni_weak_ref_count;
 
  public:
   ReferenceProcessorStats() :
     _soft_count(0),
     _weak_count(0),
     _final_count(0),
-    _phantom_count(0),
-    _cleaner_count(0),
-    _jni_weak_ref_count(0) {}
+    _phantom_count(0) {}
 
   ReferenceProcessorStats(size_t soft_count,
                           size_t weak_count,
                           size_t final_count,
-                          size_t phantom_count,
-                          size_t cleaner_count,
-                          size_t jni_weak_ref_count) :
+                          size_t phantom_count) :
     _soft_count(soft_count),
     _weak_count(weak_count),
     _final_count(final_count),
-    _phantom_count(phantom_count),
-    _cleaner_count(cleaner_count),
-    _jni_weak_ref_count(jni_weak_ref_count)
+    _phantom_count(phantom_count)
   {}
 
   size_t soft_count() const {
@@ -77,13 +69,5 @@
   size_t phantom_count() const {
     return _phantom_count;
   }
-
-  size_t cleaner_count() const {
-    return _cleaner_count;
-  }
-
-  size_t jni_weak_ref_count() const {
-    return _jni_weak_ref_count;
-  }
 };
 #endif
--- a/hotspot/src/share/vm/memory/referenceType.hpp	Tue Oct 06 08:43:02 2015 -0700
+++ b/hotspot/src/share/vm/memory/referenceType.hpp	Wed Jul 05 20:52:10 2017 +0200
@@ -32,15 +32,11 @@
 enum ReferenceType {
   REF_NONE,      // Regular class
   REF_OTHER,     // Subclass of java/lang/ref/Reference, but not subclass of one of the classes below
-  ///////////////// Only the types below have their own discovered lists
   REF_SOFT,      // Subclass of java/lang/ref/SoftReference
   REF_WEAK,      // Subclass of java/lang/ref/WeakReference
   REF_FINAL,     // Subclass of java/lang/ref/FinalReference
   REF_PHANTOM,   // Subclass of java/lang/ref/PhantomReference
-  REF_CLEANER,   // Subclass of sun/misc/Cleaner
-  ///////////////// Only the types in the above range have their own discovered lists
-  REF_JNI,        // JNI weak refs
-  REF_LISTS_COUNT = REF_CLEANER - REF_OTHER  // Number of discovered lists
+  REF_CLEANER    // Subclass of sun/misc/Cleaner
 };
 
 #endif // SHARE_VM_MEMORY_REFERENCETYPE_HPP
--- a/hotspot/src/share/vm/oops/method.hpp	Tue Oct 06 08:43:02 2015 -0700
+++ b/hotspot/src/share/vm/oops/method.hpp	Wed Jul 05 20:52:10 2017 +0200
@@ -72,7 +72,7 @@
   int               _result_index;               // C++ interpreter needs for converting results to/from stack
 #endif
   u2                _method_size;                // size of this object
-  u1                _intrinsic_id;               // vmSymbols::intrinsic_id (0 == _none)
+  u2                _intrinsic_id;               // vmSymbols::intrinsic_id (0 == _none)
 
   // Flags
   enum Flags {
@@ -653,7 +653,7 @@
   // for code generation
   static int method_data_offset_in_bytes()       { return offset_of(Method, _method_data); }
   static int intrinsic_id_offset_in_bytes()      { return offset_of(Method, _intrinsic_id); }
-  static int intrinsic_id_size_in_bytes()        { return sizeof(u1); }
+  static int intrinsic_id_size_in_bytes()        { return sizeof(u2); }
 
   // Static methods that are used to implement member methods where an exposed this pointer
   // is needed due to possible GCs
@@ -777,7 +777,7 @@
 
   // Support for inlining of intrinsic methods
   vmIntrinsics::ID intrinsic_id() const          { return (vmIntrinsics::ID) _intrinsic_id;           }
-  void     set_intrinsic_id(vmIntrinsics::ID id) {                           _intrinsic_id = (u1) id; }
+  void     set_intrinsic_id(vmIntrinsics::ID id) {                           _intrinsic_id = (u2) id; }
 
   // Helper routines for intrinsic_id() and vmIntrinsics::method().
   void init_intrinsic_id();     // updates from _none if a match
--- a/hotspot/src/share/vm/prims/jvmtiExport.cpp	Tue Oct 06 08:43:02 2015 -0700
+++ b/hotspot/src/share/vm/prims/jvmtiExport.cpp	Wed Jul 05 20:52:10 2017 +0200
@@ -2181,8 +2181,8 @@
   JvmtiVMObjectAllocEventCollector::oops_do_for_all_threads(f);
 }
 
-size_t JvmtiExport::weak_oops_do(BoolObjectClosure* is_alive, OopClosure* f) {
-  return JvmtiTagMap::weak_oops_do(is_alive, f);
+void JvmtiExport::weak_oops_do(BoolObjectClosure* is_alive, OopClosure* f) {
+  JvmtiTagMap::weak_oops_do(is_alive, f);
 }
 
 void JvmtiExport::gc_epilogue() {
--- a/hotspot/src/share/vm/prims/jvmtiExport.hpp	Tue Oct 06 08:43:02 2015 -0700
+++ b/hotspot/src/share/vm/prims/jvmtiExport.hpp	Wed Jul 05 20:52:10 2017 +0200
@@ -366,7 +366,7 @@
   static void clear_detected_exception   (JavaThread* thread) NOT_JVMTI_RETURN;
 
   static void oops_do(OopClosure* f) NOT_JVMTI_RETURN;
-  static size_t weak_oops_do(BoolObjectClosure* b, OopClosure* f) NOT_JVMTI_RETURN_(0);
+  static void weak_oops_do(BoolObjectClosure* b, OopClosure* f) NOT_JVMTI_RETURN;
   static void gc_epilogue() NOT_JVMTI_RETURN;
 
   static void transition_pending_onload_raw_monitors() NOT_JVMTI_RETURN;
--- a/hotspot/src/share/vm/prims/jvmtiTagMap.cpp	Tue Oct 06 08:43:02 2015 -0700
+++ b/hotspot/src/share/vm/prims/jvmtiTagMap.cpp	Wed Jul 05 20:52:10 2017 +0200
@@ -3284,35 +3284,32 @@
 }
 
 
-size_t JvmtiTagMap::weak_oops_do(BoolObjectClosure* is_alive, OopClosure* f) {
+void JvmtiTagMap::weak_oops_do(BoolObjectClosure* is_alive, OopClosure* f) {
   // No locks during VM bring-up (0 threads) and no safepoints after main
   // thread creation and before VMThread creation (1 thread); initial GC
   // verification can happen in that window which gets to here.
   assert(Threads::number_of_threads() <= 1 ||
          SafepointSynchronize::is_at_safepoint(),
          "must be executed at a safepoint");
-  size_t count = 0;
   if (JvmtiEnv::environments_might_exist()) {
     JvmtiEnvIterator it;
     for (JvmtiEnvBase* env = it.first(); env != NULL; env = it.next(env)) {
       JvmtiTagMap* tag_map = env->tag_map();
       if (tag_map != NULL && !tag_map->is_empty()) {
-        count += tag_map->do_weak_oops(is_alive, f);
+        tag_map->do_weak_oops(is_alive, f);
       }
     }
   }
-  return count;
 }
 
-size_t JvmtiTagMap::do_weak_oops(BoolObjectClosure* is_alive, OopClosure* f) {
+void JvmtiTagMap::do_weak_oops(BoolObjectClosure* is_alive, OopClosure* f) {
 
   // does this environment have the OBJECT_FREE event enabled
   bool post_object_free = env()->is_enabled(JVMTI_EVENT_OBJECT_FREE);
 
   // counters used for trace message
-  size_t freed = 0;
-  size_t moved = 0;
-  size_t stayed = 0;
+  int freed = 0;
+  int moved = 0;
 
   JvmtiTagHashmap* hashmap = this->hashmap();
 
@@ -3321,7 +3318,7 @@
 
   // if the hashmap is empty then we can skip it
   if (hashmap->_entry_count == 0) {
-    return 0;
+    return;
   }
 
   // now iterate through each entry in the table
@@ -3383,7 +3380,6 @@
         } else {
           // object didn't move
           prev = entry;
-          stayed++;
         }
       }
 
@@ -3402,12 +3398,10 @@
 
   // stats
   if (TraceJVMTIObjectTagging) {
-    size_t post_total = hashmap->_entry_count;
-    size_t pre_total = post_total + freed;
-
-    tty->print_cr("(" SIZE_FORMAT "->" SIZE_FORMAT ", " SIZE_FORMAT " freed, " SIZE_FORMAT " stayed, " SIZE_FORMAT " moved)",
-        pre_total, post_total, freed, stayed, moved);
+    int post_total = hashmap->_entry_count;
+    int pre_total = post_total + freed;
+
+    tty->print_cr("(%d->%d, %d freed, %d total moves)",
+        pre_total, post_total, freed, moved);
   }
-
-  return (freed + stayed + moved);
 }
--- a/hotspot/src/share/vm/prims/jvmtiTagMap.hpp	Tue Oct 06 08:43:02 2015 -0700
+++ b/hotspot/src/share/vm/prims/jvmtiTagMap.hpp	Wed Jul 05 20:52:10 2017 +0200
@@ -60,7 +60,7 @@
   inline Mutex* lock()                      { return &_lock; }
   inline JvmtiEnv* env() const              { return _env; }
 
-  size_t do_weak_oops(BoolObjectClosure* is_alive, OopClosure* f);
+  void do_weak_oops(BoolObjectClosure* is_alive, OopClosure* f);
 
   // iterate over all entries in this tag map
   void entry_iterate(JvmtiTagHashmapEntryClosure* closure);
@@ -122,8 +122,8 @@
                                    jint* count_ptr, jobject** object_result_ptr,
                                    jlong** tag_result_ptr);
 
-  static size_t weak_oops_do(BoolObjectClosure* is_alive,
-                             OopClosure* f) NOT_JVMTI_RETURN_(0);
+  static void weak_oops_do(
+      BoolObjectClosure* is_alive, OopClosure* f) NOT_JVMTI_RETURN;
 };
 
 #endif // SHARE_VM_PRIMS_JVMTITAGMAP_HPP
--- a/hotspot/src/share/vm/runtime/arguments.cpp	Tue Oct 06 08:43:02 2015 -0700
+++ b/hotspot/src/share/vm/runtime/arguments.cpp	Wed Jul 05 20:52:10 2017 +0200
@@ -118,7 +118,7 @@
 // part of the option string.
 static bool match_option(const JavaVMOption *option, const char* name,
                          const char** tail) {
-  int len = (int)strlen(name);
+  size_t len = strlen(name);
   if (strncmp(option->optionString, name, len) == 0) {
     *tail = option->optionString + len;
     return true;
@@ -219,11 +219,9 @@
 void Arguments::init_version_specific_system_properties() {
   enum { bufsz = 16 };
   char buffer[bufsz];
-  const char* spec_vendor = "Sun Microsystems Inc.";
-  uint32_t spec_version = 0;
-
-  spec_vendor = "Oracle Corporation";
-  spec_version = JDK_Version::current().major_version();
+  const char* spec_vendor = "Oracle Corporation";
+  uint32_t spec_version = JDK_Version::current().major_version();
+
   jio_snprintf(buffer, bufsz, "1." UINT32_FORMAT, spec_version);
 
   PropertyList_add(&_system_properties,
@@ -234,75 +232,290 @@
       new SystemProperty("java.vm.vendor", VM_Version::vm_vendor(),  false));
 }
 
-/**
- * Provide a slightly more user-friendly way of eliminating -XX flags.
- * When a flag is eliminated, it can be added to this list in order to
- * continue accepting this flag on the command-line, while issuing a warning
- * and ignoring the value.  Once the JDK version reaches the 'accept_until'
- * limit, we flatly refuse to admit the existence of the flag.  This allows
- * a flag to die correctly over JDK releases using HSX.
- * But now that HSX is no longer supported only options with a future
- * accept_until value need to be listed, and the list can be pruned
- * on each major release.
+/*
+ *  -XX argument processing:
+ *
+ *  -XX arguments are defined in several places, such as:
+ *      globals.hpp, globals_<cpu>.hpp, globals_<os>.hpp, <compiler>_globals.hpp, or <gc>_globals.hpp.
+ *  -XX arguments are parsed in parse_argument().
+ *  -XX argument bounds checking is done in check_vm_args_consistency().
+ *
+ * Over time -XX arguments may change. There are mechanisms to handle common cases:
+ *
+ *      ALIASED: An option that is simply another name for another option. This is often
+ *               part of the process of deprecating a flag, but not all aliases need
+ *               to be deprecated.
+ *
+ *               Create an alias for an option by adding the old and new option names to the
+ *               "aliased_jvm_flags" table. Delete the old variable from globals.hpp (etc).
+ *
+ *   DEPRECATED: An option that is supported, but a warning is printed to let the user know that
+ *               support may be removed in the future. Both regular and aliased options may be
+ *               deprecated.
+ *
+ *               Add a deprecation warning for an option (or alias) by adding an entry in the
+ *               "special_jvm_flags" table and setting the "deprecated_in" field.
+ *               Often an option "deprecated" in one major release will
+ *               be made "obsolete" in the next. In this case the entry should also have it's
+ *               "obsolete_in" field set.
+ *
+ *     OBSOLETE: An option that has been removed (and deleted from globals.hpp), but is still accepted
+ *               on the command line. A warning is printed to let the user know that option might not
+ *               be accepted in the future.
+ *
+ *               Add an obsolete warning for an option by adding an entry in the "special_jvm_flags"
+ *               table and setting the "obsolete_in" field.
+ *
+ *      EXPIRED: A deprecated or obsolete option that has an "accept_until" version less than or equal
+ *               to the current JDK version. The system will flatly refuse to admit the existence of
+ *               the flag. This allows a flag to die automatically over JDK releases.
+ *
+ *               Note that manual cleanup of expired options should be done at major JDK version upgrades:
+ *                  - Newly expired options should be removed from the special_jvm_flags and aliased_jvm_flags tables.
+ *                  - Newly obsolete or expired deprecated options should have their global variable
+ *                    definitions removed (from globals.hpp, etc) and related implementations removed.
+ *
+ * Recommended approach for removing options:
+ *
+ * To remove options commonly used by customers (e.g. product, commercial -XX options), use
+ * the 3-step model adding major release numbers to the deprecate, obsolete and expire columns.
+ *
+ * To remove internal options (e.g. diagnostic, experimental, develop options), use
+ * a 2-step model adding major release numbers to the obsolete and expire columns.
+ *
+ * To change the name of an option, use the alias table as well as a 2-step
+ * model adding major release numbers to the deprecate and expire columns.
+ * Think twice about aliasing commonly used customer options.
+ *
+ * There are times when it is appropriate to leave a future release number as undefined.
+ *
+ * Tests:  Aliases should be tested in VMAliasOptions.java.
+ *         Deprecated options should be tested in VMDeprecatedOptions.java.
  */
+
+// Obsolete or deprecated -XX flag.
 typedef struct {
   const char* name;
-  JDK_Version obsoleted_in; // when the flag went away
-  JDK_Version accept_until; // which version to start denying the existence
-} ObsoleteFlag;
-
-static ObsoleteFlag obsolete_jvm_flags[] = {
-  { "UseOldInlining",                JDK_Version::jdk(9), JDK_Version::jdk(10) },
-  { "SafepointPollOffset",           JDK_Version::jdk(9), JDK_Version::jdk(10) },
-  { "UseBoundThreads",               JDK_Version::jdk(9), JDK_Version::jdk(10) },
-  { "DefaultThreadPriority",         JDK_Version::jdk(9), JDK_Version::jdk(10) },
-  { "NoYieldsInMicrolock",           JDK_Version::jdk(9), JDK_Version::jdk(10) },
-  { "BackEdgeThreshold",             JDK_Version::jdk(9), JDK_Version::jdk(10) },
-  { "UseNewReflection",              JDK_Version::jdk(9), JDK_Version::jdk(10) },
-  { "ReflectionWrapResolutionErrors",JDK_Version::jdk(9), JDK_Version::jdk(10) },
-  { "VerifyReflectionBytecodes",     JDK_Version::jdk(9), JDK_Version::jdk(10) },
-  { "AutoShutdownNMT",               JDK_Version::jdk(9), JDK_Version::jdk(10) },
-  { "NmethodSweepFraction",          JDK_Version::jdk(9), JDK_Version::jdk(10) },
-  { "NmethodSweepCheckInterval",     JDK_Version::jdk(9), JDK_Version::jdk(10) },
-  { "CodeCacheMinimumFreeSpace",     JDK_Version::jdk(9), JDK_Version::jdk(10) },
+  JDK_Version deprecated_in; // When the deprecation warning started (or "undefined").
+  JDK_Version obsolete_in;   // When the obsolete warning started (or "undefined").
+  JDK_Version expired_in;    // When the option expires (or "undefined").
+} SpecialFlag;
+
+// The special_jvm_flags table declares options that are being deprecated and/or obsoleted. The
+// "deprecated_in" or "obsolete_in" fields may be set to "undefined", but not both.
+// When the JDK version reaches 'deprecated_in' limit, the JVM will process this flag on
+// the command-line as usual, but will issue a warning.
+// When the JDK version reaches 'obsolete_in' limit, the JVM will continue accepting this flag on
+// the command-line, while issuing a warning and ignoring the flag value.
+// Once the JDK version reaches 'expired_in' limit, the JVM will flatly refuse to admit the
+// existence of the flag.
+//
+// MANUAL CLEANUP ON JDK VERSION UPDATES:
+// This table ensures that the handling of options will update automatically when the JDK
+// version is incremented, but the source code needs to be cleanup up manually:
+// - As "deprecated" options age into "obsolete" or "expired" options, the associated "globals"
+//   variable should be removed, as well as users of the variable.
+// - As "deprecated" options age into "obsolete" options, move the entry into the
+//   "Obsolete Flags" section of the table.
+// - All expired options should be removed from the table.
+static SpecialFlag const special_jvm_flags[] = {
+  // -------------- Deprecated Flags --------------
+  // --- Non-alias flags - sorted by obsolete_in then expired_in:
+  { "MaxGCMinorPauseMillis",        JDK_Version::jdk(8), JDK_Version::undefined(), JDK_Version::undefined() },
+  { "UseParNewGC",                  JDK_Version::jdk(9), JDK_Version::undefined(), JDK_Version::jdk(10) },
+
+  // --- Deprecated alias flags (see also aliased_jvm_flags) - sorted by obsolete_in then expired_in:
+  { "DefaultMaxRAMFraction",        JDK_Version::jdk(8), JDK_Version::undefined(), JDK_Version::undefined() },
+  { "CreateMinidumpOnCrash",        JDK_Version::jdk(9), JDK_Version::undefined(), JDK_Version::undefined() },
+  { "CMSMarkStackSizeMax",          JDK_Version::jdk(9), JDK_Version::undefined(), JDK_Version::jdk(10) },
+  { "CMSMarkStackSize",             JDK_Version::jdk(9), JDK_Version::undefined(), JDK_Version::jdk(10) },
+  { "G1MarkStackSize",              JDK_Version::jdk(9), JDK_Version::undefined(), JDK_Version::jdk(10) },
+  { "ParallelMarkingThreads",       JDK_Version::jdk(9), JDK_Version::undefined(), JDK_Version::jdk(10) },
+  { "ParallelCMSThreads",           JDK_Version::jdk(9), JDK_Version::undefined(), JDK_Version::jdk(10) },
+
+  // -------------- Obsolete Flags - sorted by expired_in --------------
+  { "UseOldInlining",                JDK_Version::undefined(), JDK_Version::jdk(9), JDK_Version::jdk(10) },
+  { "SafepointPollOffset",           JDK_Version::undefined(), JDK_Version::jdk(9), JDK_Version::jdk(10) },
+  { "UseBoundThreads",               JDK_Version::undefined(), JDK_Version::jdk(9), JDK_Version::jdk(10) },
+  { "DefaultThreadPriority",         JDK_Version::undefined(), JDK_Version::jdk(9), JDK_Version::jdk(10) },
+  { "NoYieldsInMicrolock",           JDK_Version::undefined(), JDK_Version::jdk(9), JDK_Version::jdk(10) },
+  { "BackEdgeThreshold",             JDK_Version::undefined(), JDK_Version::jdk(9), JDK_Version::jdk(10) },
+  { "UseNewReflection",              JDK_Version::undefined(), JDK_Version::jdk(9), JDK_Version::jdk(10) },
+  { "ReflectionWrapResolutionErrors",JDK_Version::undefined(), JDK_Version::jdk(9), JDK_Version::jdk(10) },
+  { "VerifyReflectionBytecodes",     JDK_Version::undefined(), JDK_Version::jdk(9), JDK_Version::jdk(10) },
+  { "AutoShutdownNMT",               JDK_Version::undefined(), JDK_Version::jdk(9), JDK_Version::jdk(10) },
+  { "NmethodSweepFraction",          JDK_Version::undefined(), JDK_Version::jdk(9), JDK_Version::jdk(10) },
+  { "NmethodSweepCheckInterval",     JDK_Version::undefined(), JDK_Version::jdk(9), JDK_Version::jdk(10) },
+  { "CodeCacheMinimumFreeSpace",     JDK_Version::undefined(), JDK_Version::jdk(9), JDK_Version::jdk(10) },
 #ifndef ZERO
-  { "UseFastAccessorMethods",        JDK_Version::jdk(9), JDK_Version::jdk(10) },
-  { "UseFastEmptyMethods",           JDK_Version::jdk(9), JDK_Version::jdk(10) },
+  { "UseFastAccessorMethods",        JDK_Version::undefined(), JDK_Version::jdk(9), JDK_Version::jdk(10) },
+  { "UseFastEmptyMethods",           JDK_Version::undefined(), JDK_Version::jdk(9), JDK_Version::jdk(10) },
 #endif // ZERO
-  { "UseCompilerSafepoints",         JDK_Version::jdk(9), JDK_Version::jdk(10) },
-  { "AdaptiveSizePausePolicy",       JDK_Version::jdk(9), JDK_Version::jdk(10) },
-  { "ParallelGCRetainPLAB",          JDK_Version::jdk(9), JDK_Version::jdk(10) },
-  { "ThreadSafetyMargin",            JDK_Version::jdk(9), JDK_Version::jdk(10) },
-  { "LazyBootClassLoader",           JDK_Version::jdk(9), JDK_Version::jdk(10) },
-  { "StarvationMonitorInterval",     JDK_Version::jdk(9), JDK_Version::jdk(10) },
-  { "PreInflateSpin",                JDK_Version::jdk(9), JDK_Version::jdk(10) },
+  { "UseCompilerSafepoints",         JDK_Version::undefined(), JDK_Version::jdk(9), JDK_Version::jdk(10) },
+  { "AdaptiveSizePausePolicy",       JDK_Version::undefined(), JDK_Version::jdk(9), JDK_Version::jdk(10) },
+  { "ParallelGCRetainPLAB",          JDK_Version::undefined(), JDK_Version::jdk(9), JDK_Version::jdk(10) },
+  { "ThreadSafetyMargin",            JDK_Version::undefined(), JDK_Version::jdk(9), JDK_Version::jdk(10) },
+  { "LazyBootClassLoader",           JDK_Version::undefined(), JDK_Version::jdk(9), JDK_Version::jdk(10) },
+  { "StarvationMonitorInterval",     JDK_Version::undefined(), JDK_Version::jdk(9), JDK_Version::jdk(10) },
+  { "PreInflateSpin",                JDK_Version::undefined(), JDK_Version::jdk(9), JDK_Version::jdk(10) },
+
+#ifdef TEST_VERIFY_SPECIAL_JVM_FLAGS
+  { "dep > obs",                    JDK_Version::jdk(9), JDK_Version::jdk(8), JDK_Version::undefined() },
+  { "dep > exp ",                   JDK_Version::jdk(9), JDK_Version::undefined(), JDK_Version::jdk(8) },
+  { "obs > exp ",                   JDK_Version::undefined(), JDK_Version::jdk(9), JDK_Version::jdk(8) },
+  { "not deprecated or obsolete",   JDK_Version::undefined(), JDK_Version::undefined(), JDK_Version::jdk(9) },
+  { "dup option",                   JDK_Version::jdk(9), JDK_Version::undefined(), JDK_Version::undefined() },
+  { "dup option",                   JDK_Version::jdk(9), JDK_Version::undefined(), JDK_Version::undefined() },
+  { "BytecodeVerificationRemote",   JDK_Version::undefined(), JDK_Version::jdk(9), JDK_Version::undefined() },
+#endif
+
   { NULL, JDK_Version(0), JDK_Version(0) }
 };
 
-// Returns true if the flag is obsolete and fits into the range specified
-// for being ignored.  In the case that the flag is ignored, the 'version'
-// value is filled in with the version number when the flag became
-// obsolete so that that value can be displayed to the user.
-bool Arguments::is_newly_obsolete(const char *s, JDK_Version* version) {
-  int i = 0;
+// Flags that are aliases for other flags.
+typedef struct {
+  const char* alias_name;
+  const char* real_name;
+} AliasedFlag;
+
+static AliasedFlag const aliased_jvm_flags[] = {
+  { "DefaultMaxRAMFraction",    "MaxRAMFraction"    },
+  { "CMSMarkStackSizeMax",      "MarkStackSizeMax"  },
+  { "CMSMarkStackSize",         "MarkStackSize"     },
+  { "G1MarkStackSize",          "MarkStackSize"     },
+  { "ParallelMarkingThreads",   "ConcGCThreads"     },
+  { "ParallelCMSThreads",       "ConcGCThreads"     },
+  { "CreateMinidumpOnCrash",    "CreateCoredumpOnCrash" },
+  { NULL, NULL}
+};
+
+// Return true if "v" is less than "other", where "other" may be "undefined".
+static bool version_less_than(JDK_Version v, JDK_Version other) {
+  assert(!v.is_undefined(), "must be defined");
+  if (!other.is_undefined() && v.compare(other) >= 0) {
+    return false;
+  } else {
+    return true;
+  }
+}
+
+static bool lookup_special_flag(const char *flag_name, SpecialFlag& flag) {
+  for (size_t i = 0; special_jvm_flags[i].name != NULL; i++) {
+    if ((strcmp(special_jvm_flags[i].name, flag_name) == 0)) {
+      flag = special_jvm_flags[i];
+      return true;
+    }
+  }
+  return false;
+}
+
+bool Arguments::is_obsolete_flag(const char *flag_name, JDK_Version* version) {
   assert(version != NULL, "Must provide a version buffer");
-  while (obsolete_jvm_flags[i].name != NULL) {
-    const ObsoleteFlag& flag_status = obsolete_jvm_flags[i];
-    // <flag>=xxx form
-    // [-|+]<flag> form
-    size_t len = strlen(flag_status.name);
-    if ((strncmp(flag_status.name, s, len) == 0) &&
-        (strlen(s) == len)){
-      if (JDK_Version::current().compare(flag_status.accept_until) == -1) {
-          *version = flag_status.obsoleted_in;
-          return true;
+  SpecialFlag flag;
+  if (lookup_special_flag(flag_name, flag)) {
+    if (!flag.obsolete_in.is_undefined()) {
+      if (version_less_than(JDK_Version::current(), flag.expired_in)) {
+        *version = flag.obsolete_in;
+        return true;
       }
     }
-    i++;
   }
   return false;
 }
 
+int Arguments::is_deprecated_flag(const char *flag_name, JDK_Version* version) {
+  assert(version != NULL, "Must provide a version buffer");
+  SpecialFlag flag;
+  if (lookup_special_flag(flag_name, flag)) {
+    if (!flag.deprecated_in.is_undefined()) {
+      if (version_less_than(JDK_Version::current(), flag.obsolete_in) &&
+          version_less_than(JDK_Version::current(), flag.expired_in)) {
+        *version = flag.deprecated_in;
+        return 1;
+      } else {
+        return -1;
+      }
+    }
+  }
+  return 0;
+}
+
+const char* Arguments::real_flag_name(const char *flag_name) {
+  for (size_t i = 0; aliased_jvm_flags[i].alias_name != NULL; i++) {
+    const AliasedFlag& flag_status = aliased_jvm_flags[i];
+    if (strcmp(flag_status.alias_name, flag_name) == 0) {
+        return flag_status.real_name;
+    }
+  }
+  return flag_name;
+}
+
+#ifndef PRODUCT
+static bool lookup_special_flag(const char *flag_name, size_t skip_index) {
+  for (size_t i = 0; special_jvm_flags[i].name != NULL; i++) {
+    if ((i != skip_index) && (strcmp(special_jvm_flags[i].name, flag_name) == 0)) {
+      return true;
+    }
+  }
+  return false;
+}
+
+static bool verify_special_jvm_flags() {
+  bool success = true;
+  for (size_t i = 0; special_jvm_flags[i].name != NULL; i++) {
+    const SpecialFlag& flag = special_jvm_flags[i];
+    if (lookup_special_flag(flag.name, i)) {
+      warning("Duplicate special flag declaration \"%s\"", flag.name);
+      success = false;
+    }
+    if (flag.deprecated_in.is_undefined() &&
+        flag.obsolete_in.is_undefined()) {
+      warning("Special flag entry \"%s\" must declare version deprecated and/or obsoleted in.", flag.name);
+      success = false;
+    }
+
+    if (!flag.deprecated_in.is_undefined()) {
+      if (!version_less_than(flag.deprecated_in, flag.obsolete_in)) {
+        warning("Special flag entry \"%s\" must be deprecated before obsoleted.", flag.name);
+        success = false;
+      }
+
+      if (!version_less_than(flag.deprecated_in, flag.expired_in)) {
+        warning("Special flag entry \"%s\" must be deprecated before expired.", flag.name);
+        success = false;
+      }
+    }
+
+    if (!flag.obsolete_in.is_undefined()) {
+      if (!version_less_than(flag.obsolete_in, flag.expired_in)) {
+        warning("Special flag entry \"%s\" must be obsoleted before expired.", flag.name);
+        success = false;
+      }
+
+      // if flag has become obsolete it should not have a "globals" flag defined anymore.
+      if (!version_less_than(JDK_Version::current(), flag.obsolete_in)) {
+        if (Flag::find_flag(flag.name) != NULL) {
+          warning("Global variable for obsolete special flag entry \"%s\" should be removed", flag.name);
+          success = false;
+        }
+      }
+    }
+
+    if (!flag.expired_in.is_undefined()) {
+      // if flag has become expired it should not have a "globals" flag defined anymore.
+      if (!version_less_than(JDK_Version::current(), flag.expired_in)) {
+        if (Flag::find_flag(flag.name) != NULL) {
+          warning("Global variable for expired flag entry \"%s\" should be removed", flag.name);
+          success = false;
+        }
+      }
+    }
+
+  }
+  return success;
+}
+#endif
+
 // Constructs the system class path (aka boot class path) from the following
 // components, in order:
 //
@@ -571,7 +784,7 @@
   }
 }
 
-static bool set_bool_flag(char* name, bool value, Flag::Flags origin) {
+static bool set_bool_flag(const char* name, bool value, Flag::Flags origin) {
   if (CommandLineFlags::boolAtPut(name, &value, origin) == Flag::SUCCESS) {
     return true;
   } else {
@@ -579,7 +792,7 @@
   }
 }
 
-static bool set_fp_numeric_flag(char* name, char* value, Flag::Flags origin) {
+static bool set_fp_numeric_flag(const char* name, char* value, Flag::Flags origin) {
   double v;
   if (sscanf(value, "%lf", &v) != 1) {
     return false;
@@ -591,7 +804,7 @@
   return false;
 }
 
-static bool set_numeric_flag(char* name, char* value, Flag::Flags origin) {
+static bool set_numeric_flag(const char* name, char* value, Flag::Flags origin) {
   julong v;
   int int_v;
   intx intx_v;
@@ -640,14 +853,14 @@
   return false;
 }
 
-static bool set_string_flag(char* name, const char* value, Flag::Flags origin) {
+static bool set_string_flag(const char* name, const char* value, Flag::Flags origin) {
   if (CommandLineFlags::ccstrAtPut(name, &value, origin) != Flag::SUCCESS) return false;
   // Contract:  CommandLineFlags always returns a pointer that needs freeing.
   FREE_C_HEAP_ARRAY(char, value);
   return true;
 }
 
-static bool append_to_string_flag(char* name, const char* new_value, Flag::Flags origin) {
+static bool append_to_string_flag(const char* name, const char* new_value, Flag::Flags origin) {
   const char* old_value = "";
   if (CommandLineFlags::ccstrAt(name, &old_value) != Flag::SUCCESS) return false;
   size_t old_len = old_value != NULL ? strlen(old_value) : 0;
@@ -675,6 +888,33 @@
   return true;
 }
 
+const char* Arguments::handle_aliases_and_deprecation(const char* arg, bool warn) {
+  const char* real_name = real_flag_name(arg);
+  JDK_Version since = JDK_Version();
+  switch (is_deprecated_flag(arg, &since)) {
+    case -1:
+      return NULL; // obsolete or expired, don't process normally
+    case 0:
+      return real_name;
+    case 1: {
+      if (warn) {
+        char version[256];
+        since.to_string(version, sizeof(version));
+        if (real_name != arg) {
+          warning("Option %s was deprecated in version %s and will likely be removed in a future release. Use option %s instead.",
+                  arg, version, real_name);
+        } else {
+          warning("Option %s was deprecated in version %s and will likely be removed in a future release.",
+                  arg, version);
+        }
+      }
+      return real_name;
+    }
+  }
+  ShouldNotReachHere();
+  return NULL;
+}
+
 bool Arguments::parse_argument(const char* arg, Flag::Flags origin) {
 
   // range of acceptable characters spelled out for portability reasons
@@ -682,27 +922,46 @@
 #define BUFLEN 255
   char name[BUFLEN+1];
   char dummy;
+  const char* real_name;
+  bool warn_if_deprecated = true;
 
   if (sscanf(arg, "-%" XSTR(BUFLEN) NAME_RANGE "%c", name, &dummy) == 1) {
-    return set_bool_flag(name, false, origin);
+    real_name = handle_aliases_and_deprecation(name, warn_if_deprecated);
+    if (real_name == NULL) {
+      return false;
+    }
+    return set_bool_flag(real_name, false, origin);
   }
   if (sscanf(arg, "+%" XSTR(BUFLEN) NAME_RANGE "%c", name, &dummy) == 1) {
-    return set_bool_flag(name, true, origin);
+    real_name = handle_aliases_and_deprecation(name, warn_if_deprecated);
+    if (real_name == NULL) {
+      return false;
+    }
+    return set_bool_flag(real_name, true, origin);
   }
 
   char punct;
   if (sscanf(arg, "%" XSTR(BUFLEN) NAME_RANGE "%c", name, &punct) == 2 && punct == '=') {
     const char* value = strchr(arg, '=') + 1;
-    Flag* flag = Flag::find_flag(name, strlen(name));
+    Flag* flag;
+
+    // this scanf pattern matches both strings (handled here) and numbers (handled later))
+    real_name = handle_aliases_and_deprecation(name, warn_if_deprecated);
+    if (real_name == NULL) {
+      return false;
+    }
+    flag = Flag::find_flag(real_name);
     if (flag != NULL && flag->is_ccstr()) {
       if (flag->ccstr_accumulates()) {
-        return append_to_string_flag(name, value, origin);
+        return append_to_string_flag(real_name, value, origin);
       } else {
         if (value[0] == '\0') {
           value = NULL;
         }
-        return set_string_flag(name, value, origin);
+        return set_string_flag(real_name, value, origin);
       }
+    } else {
+      warn_if_deprecated = false; // if arg is deprecated, we've already done warning...
     }
   }
 
@@ -712,7 +971,11 @@
     if (value[0] == '\0') {
       value = NULL;
     }
-    return set_string_flag(name, value, origin);
+    real_name = handle_aliases_and_deprecation(name, warn_if_deprecated);
+    if (real_name == NULL) {
+      return false;
+    }
+    return set_string_flag(real_name, value, origin);
   }
 
 #define SIGNED_FP_NUMBER_RANGE "[-0123456789.]"
@@ -723,13 +986,21 @@
   if (sscanf(arg, "%" XSTR(BUFLEN) NAME_RANGE "=" "%" XSTR(BUFLEN) SIGNED_NUMBER_RANGE "." "%" XSTR(BUFLEN) NUMBER_RANGE "%c", name, value, value2, &dummy) == 3) {
     // Looks like a floating-point number -- try again with more lenient format string
     if (sscanf(arg, "%" XSTR(BUFLEN) NAME_RANGE "=" "%" XSTR(BUFLEN) SIGNED_FP_NUMBER_RANGE "%c", name, value, &dummy) == 2) {
-      return set_fp_numeric_flag(name, value, origin);
+      real_name = handle_aliases_and_deprecation(name, warn_if_deprecated);
+      if (real_name == NULL) {
+        return false;
+      }
+      return set_fp_numeric_flag(real_name, value, origin);
     }
   }
 
 #define VALUE_RANGE "[-kmgtxKMGTX0123456789abcdefABCDEF]"
   if (sscanf(arg, "%" XSTR(BUFLEN) NAME_RANGE "=" "%" XSTR(BUFLEN) VALUE_RANGE "%c", name, value, &dummy) == 2) {
-    return set_numeric_flag(name, value, origin);
+    real_name = handle_aliases_and_deprecation(name, warn_if_deprecated);
+    if (real_name == NULL) {
+      return false;
+    }
+    return set_numeric_flag(real_name, value, origin);
   }
 
   return false;
@@ -837,8 +1108,8 @@
 }
 
 bool Arguments::process_argument(const char* arg,
-    jboolean ignore_unrecognized, Flag::Flags origin) {
-
+                                 jboolean ignore_unrecognized,
+                                 Flag::Flags origin) {
   JDK_Version since = JDK_Version();
 
   if (parse_argument(arg, origin) || ignore_unrecognized) {
@@ -864,10 +1135,10 @@
     strncpy(stripped_argname, argname, arg_len);
     stripped_argname[arg_len] = '\0';  // strncpy may not null terminate.
 
-    if (is_newly_obsolete(stripped_argname, &since)) {
+    if (is_obsolete_flag(stripped_argname, &since)) {
       char version[256];
       since.to_string(version, sizeof(version));
-      warning("ignoring option %s; support was removed in %s", stripped_argname, version);
+      warning("Ignoring option %s; support was removed in %s", stripped_argname, version);
       return true;
     }
   }
@@ -1235,7 +1506,7 @@
 static void disable_adaptive_size_policy(const char* collector_name) {
   if (UseAdaptiveSizePolicy) {
     if (FLAG_IS_CMDLINE(UseAdaptiveSizePolicy)) {
-      warning("disabling UseAdaptiveSizePolicy; it is incompatible with %s.",
+      warning("Disabling UseAdaptiveSizePolicy; it is incompatible with %s.",
               collector_name);
     }
     FLAG_SET_DEFAULT(UseAdaptiveSizePolicy, false);
@@ -1707,7 +1978,6 @@
   } else if (UseG1GC) {
     set_g1_gc_flags();
   }
-  check_deprecated_gc_flags();
   if (AssumeMP && !UseSerialGC) {
     if (FLAG_IS_DEFAULT(ParallelGCThreads) && ParallelGCThreads == 1) {
       warning("If the number of processors is expected to increase from one, then"
@@ -1737,11 +2007,6 @@
 static const size_t DefaultHeapBaseMinAddress = HeapBaseMinAddress;
 
 void Arguments::set_heap_size() {
-  if (!FLAG_IS_DEFAULT(DefaultMaxRAMFraction)) {
-    // Deprecated flag
-    FLAG_SET_CMDLINE(uintx, MaxRAMFraction, DefaultMaxRAMFraction);
-  }
-
   const julong phys_mem =
     FLAG_IS_DEFAULT(MaxRAM) ? MIN2(os::physical_memory(), (julong)MaxRAM)
                             : (julong)MaxRAM;
@@ -1844,6 +2109,122 @@
   }
 }
 
+// This option inspects the machine and attempts to set various
+// parameters to be optimal for long-running, memory allocation
+// intensive jobs.  It is intended for machines with large
+// amounts of cpu and memory.
+jint Arguments::set_aggressive_heap_flags() {
+  // initHeapSize is needed since _initial_heap_size is 4 bytes on a 32 bit
+  // VM, but we may not be able to represent the total physical memory
+  // available (like having 8gb of memory on a box but using a 32bit VM).
+  // Thus, we need to make sure we're using a julong for intermediate
+  // calculations.
+  julong initHeapSize;
+  julong total_memory = os::physical_memory();
+
+  if (total_memory < (julong) 256 * M) {
+    jio_fprintf(defaultStream::error_stream(),
+            "You need at least 256mb of memory to use -XX:+AggressiveHeap\n");
+    vm_exit(1);
+  }
+
+  // The heap size is half of available memory, or (at most)
+  // all of possible memory less 160mb (leaving room for the OS
+  // when using ISM).  This is the maximum; because adaptive sizing
+  // is turned on below, the actual space used may be smaller.
+
+  initHeapSize = MIN2(total_memory / (julong) 2,
+          total_memory - (julong) 160 * M);
+
+  initHeapSize = limit_by_allocatable_memory(initHeapSize);
+
+  if (FLAG_IS_DEFAULT(MaxHeapSize)) {
+    if (FLAG_SET_CMDLINE(size_t, MaxHeapSize, initHeapSize) != Flag::SUCCESS) {
+      return JNI_EINVAL;
+    }
+    if (FLAG_SET_CMDLINE(size_t, InitialHeapSize, initHeapSize) != Flag::SUCCESS) {
+      return JNI_EINVAL;
+    }
+    // Currently the minimum size and the initial heap sizes are the same.
+    set_min_heap_size(initHeapSize);
+  }
+  if (FLAG_IS_DEFAULT(NewSize)) {
+    // Make the young generation 3/8ths of the total heap.
+    if (FLAG_SET_CMDLINE(size_t, NewSize,
+            ((julong) MaxHeapSize / (julong) 8) * (julong) 3) != Flag::SUCCESS) {
+      return JNI_EINVAL;
+    }
+    if (FLAG_SET_CMDLINE(size_t, MaxNewSize, NewSize) != Flag::SUCCESS) {
+      return JNI_EINVAL;
+    }
+  }
+
+#if !defined(_ALLBSD_SOURCE) && !defined(AIX)  // UseLargePages is not yet supported on BSD and AIX.
+  FLAG_SET_DEFAULT(UseLargePages, true);
+#endif
+
+  // Increase some data structure sizes for efficiency
+  if (FLAG_SET_CMDLINE(size_t, BaseFootPrintEstimate, MaxHeapSize) != Flag::SUCCESS) {
+    return JNI_EINVAL;
+  }
+  if (FLAG_SET_CMDLINE(bool, ResizeTLAB, false) != Flag::SUCCESS) {
+    return JNI_EINVAL;
+  }
+  if (FLAG_SET_CMDLINE(size_t, TLABSize, 256 * K) != Flag::SUCCESS) {
+    return JNI_EINVAL;
+  }
+
+  // See the OldPLABSize comment below, but replace 'after promotion'
+  // with 'after copying'.  YoungPLABSize is the size of the survivor
+  // space per-gc-thread buffers.  The default is 4kw.
+  if (FLAG_SET_CMDLINE(size_t, YoungPLABSize, 256 * K) != Flag::SUCCESS) { // Note: this is in words
+    return JNI_EINVAL;
+  }
+
+  // OldPLABSize is the size of the buffers in the old gen that
+  // UseParallelGC uses to promote live data that doesn't fit in the
+  // survivor spaces.  At any given time, there's one for each gc thread.
+  // The default size is 1kw. These buffers are rarely used, since the
+  // survivor spaces are usually big enough.  For specjbb, however, there
+  // are occasions when there's lots of live data in the young gen
+  // and we end up promoting some of it.  We don't have a definite
+  // explanation for why bumping OldPLABSize helps, but the theory
+  // is that a bigger PLAB results in retaining something like the
+  // original allocation order after promotion, which improves mutator
+  // locality.  A minor effect may be that larger PLABs reduce the
+  // number of PLAB allocation events during gc.  The value of 8kw
+  // was arrived at by experimenting with specjbb.
+  if (FLAG_SET_CMDLINE(size_t, OldPLABSize, 8 * K) != Flag::SUCCESS) { // Note: this is in words
+    return JNI_EINVAL;
+  }
+
+  // Enable parallel GC and adaptive generation sizing
+  if (FLAG_SET_CMDLINE(bool, UseParallelGC, true) != Flag::SUCCESS) {
+    return JNI_EINVAL;
+  }
+  FLAG_SET_DEFAULT(ParallelGCThreads,
+          Abstract_VM_Version::parallel_worker_threads());
+
+  // Encourage steady state memory management
+  if (FLAG_SET_CMDLINE(uintx, ThresholdTolerance, 100) != Flag::SUCCESS) {
+    return JNI_EINVAL;
+  }
+
+  // This appears to improve mutator locality
+  if (FLAG_SET_CMDLINE(bool, ScavengeBeforeFullGC, false) != Flag::SUCCESS) {
+    return JNI_EINVAL;
+  }
+
+  // Get around early Solaris scheduling bug
+  // (affinity vs other jobs on system)
+  // but disallow DR and offlining (5008695).
+  if (FLAG_SET_CMDLINE(bool, BindGCTaskThreadsToCPUs, true) != Flag::SUCCESS) {
+    return JNI_EINVAL;
+  }
+
+  return JNI_OK;
+}
+
 // This must be called after ergonomics.
 void Arguments::set_bytecode_flags() {
   if (!RewriteBytecodes) {
@@ -2027,20 +2408,6 @@
   return true;
 }
 
-void Arguments::check_deprecated_gc_flags() {
-  if (FLAG_IS_CMDLINE(UseParNewGC)) {
-    warning("The UseParNewGC flag is deprecated and will likely be removed in a future release");
-  }
-  if (FLAG_IS_CMDLINE(MaxGCMinorPauseMillis)) {
-    warning("Using MaxGCMinorPauseMillis as minor pause goal is deprecated"
-            "and will likely be removed in future release");
-  }
-  if (FLAG_IS_CMDLINE(DefaultMaxRAMFraction)) {
-    warning("DefaultMaxRAMFraction is deprecated and will likely be removed in a future release. "
-        "Use MaxRAMFraction instead.");
-  }
-}
-
 // Check the consistency of vm_init_args
 bool Arguments::check_vm_args_consistency() {
   // Method for adding checks for flag consistency.
@@ -2576,7 +2943,7 @@
       // All these options are deprecated in JDK 9 and will be removed in a future release
       char version[256];
       JDK_Version::jdk(9).to_string(version, sizeof(version));
-      warning("ignoring option %s; support was removed in %s", option->optionString, version);
+      warning("Ignoring option %s; support was removed in %s", option->optionString, version);
     } else if (match_option(option, "-XX:CodeCacheExpansionSize=", &tail)) {
       julong long_CodeCacheExpansionSize = 0;
       ArgsRange errcode = parse_memory_size(tail, &long_CodeCacheExpansionSize, os::vm_page_size());
@@ -2843,120 +3210,10 @@
       _abort_hook = CAST_TO_FN_PTR(abort_hook_t, option->extraInfo);
     // -XX:+AggressiveHeap
     } else if (match_option(option, "-XX:+AggressiveHeap")) {
-
-      // This option inspects the machine and attempts to set various
-      // parameters to be optimal for long-running, memory allocation
-      // intensive jobs.  It is intended for machines with large
-      // amounts of cpu and memory.
-
-      // initHeapSize is needed since _initial_heap_size is 4 bytes on a 32 bit
-      // VM, but we may not be able to represent the total physical memory
-      // available (like having 8gb of memory on a box but using a 32bit VM).
-      // Thus, we need to make sure we're using a julong for intermediate
-      // calculations.
-      julong initHeapSize;
-      julong total_memory = os::physical_memory();
-
-      if (total_memory < (julong)256*M) {
-        jio_fprintf(defaultStream::error_stream(),
-                    "You need at least 256mb of memory to use -XX:+AggressiveHeap\n");
-        vm_exit(1);
+      jint result = set_aggressive_heap_flags();
+      if (result != JNI_OK) {
+          return result;
       }
-
-      // The heap size is half of available memory, or (at most)
-      // all of possible memory less 160mb (leaving room for the OS
-      // when using ISM).  This is the maximum; because adaptive sizing
-      // is turned on below, the actual space used may be smaller.
-
-      initHeapSize = MIN2(total_memory / (julong)2,
-                          total_memory - (julong)160*M);
-
-      initHeapSize = limit_by_allocatable_memory(initHeapSize);
-
-      if (FLAG_IS_DEFAULT(MaxHeapSize)) {
-         if (FLAG_SET_CMDLINE(size_t, MaxHeapSize, initHeapSize) != Flag::SUCCESS) {
-           return JNI_EINVAL;
-         }
-         if (FLAG_SET_CMDLINE(size_t, InitialHeapSize, initHeapSize) != Flag::SUCCESS) {
-           return JNI_EINVAL;
-         }
-         // Currently the minimum size and the initial heap sizes are the same.
-         set_min_heap_size(initHeapSize);
-      }
-      if (FLAG_IS_DEFAULT(NewSize)) {
-         // Make the young generation 3/8ths of the total heap.
-         if (FLAG_SET_CMDLINE(size_t, NewSize,
-                                ((julong)MaxHeapSize / (julong)8) * (julong)3) != Flag::SUCCESS) {
-           return JNI_EINVAL;
-         }
-         if (FLAG_SET_CMDLINE(size_t, MaxNewSize, NewSize) != Flag::SUCCESS) {
-           return JNI_EINVAL;
-         }
-      }
-
-#if !defined(_ALLBSD_SOURCE) && !defined(AIX)  // UseLargePages is not yet supported on BSD and AIX.
-      FLAG_SET_DEFAULT(UseLargePages, true);
-#endif
-
-      // Increase some data structure sizes for efficiency
-      if (FLAG_SET_CMDLINE(size_t, BaseFootPrintEstimate, MaxHeapSize) != Flag::SUCCESS) {
-        return JNI_EINVAL;
-      }
-      if (FLAG_SET_CMDLINE(bool, ResizeTLAB, false) != Flag::SUCCESS) {
-        return JNI_EINVAL;
-      }
-      if (FLAG_SET_CMDLINE(size_t, TLABSize, 256*K) != Flag::SUCCESS) {
-        return JNI_EINVAL;
-      }
-
-      // See the OldPLABSize comment below, but replace 'after promotion'
-      // with 'after copying'.  YoungPLABSize is the size of the survivor
-      // space per-gc-thread buffers.  The default is 4kw.
-      if (FLAG_SET_CMDLINE(size_t, YoungPLABSize, 256*K) != Flag::SUCCESS) {      // Note: this is in words
-        return JNI_EINVAL;
-      }
-
-      // OldPLABSize is the size of the buffers in the old gen that
-      // UseParallelGC uses to promote live data that doesn't fit in the
-      // survivor spaces.  At any given time, there's one for each gc thread.
-      // The default size is 1kw. These buffers are rarely used, since the
-      // survivor spaces are usually big enough.  For specjbb, however, there
-      // are occasions when there's lots of live data in the young gen
-      // and we end up promoting some of it.  We don't have a definite
-      // explanation for why bumping OldPLABSize helps, but the theory
-      // is that a bigger PLAB results in retaining something like the
-      // original allocation order after promotion, which improves mutator
-      // locality.  A minor effect may be that larger PLABs reduce the
-      // number of PLAB allocation events during gc.  The value of 8kw
-      // was arrived at by experimenting with specjbb.
-      if (FLAG_SET_CMDLINE(size_t, OldPLABSize, 8*K) != Flag::SUCCESS) {  // Note: this is in words
-        return JNI_EINVAL;
-      }
-
-      // Enable parallel GC and adaptive generation sizing
-      if (FLAG_SET_CMDLINE(bool, UseParallelGC, true) != Flag::SUCCESS) {
-        return JNI_EINVAL;
-      }
-      FLAG_SET_DEFAULT(ParallelGCThreads,
-                       Abstract_VM_Version::parallel_worker_threads());
-
-      // Encourage steady state memory management
-      if (FLAG_SET_CMDLINE(uintx, ThresholdTolerance, 100) != Flag::SUCCESS) {
-        return JNI_EINVAL;
-      }
-
-      // This appears to improve mutator locality
-      if (FLAG_SET_CMDLINE(bool, ScavengeBeforeFullGC, false) != Flag::SUCCESS) {
-        return JNI_EINVAL;
-      }
-
-      // Get around early Solaris scheduling bug
-      // (affinity vs other jobs on system)
-      // but disallow DR and offlining (5008695).
-      if (FLAG_SET_CMDLINE(bool, BindGCTaskThreadsToCPUs, true) != Flag::SUCCESS) {
-        return JNI_EINVAL;
-      }
-
     // Need to keep consistency of MaxTenuringThreshold and AlwaysTenure/NeverTenure;
     // and the last option wins.
     } else if (match_option(option, "-XX:+NeverTenure")) {
@@ -3049,52 +3306,6 @@
         return JNI_EINVAL;
       }
 #endif
-    } else if (match_option(option, "-XX:CMSMarkStackSize=", &tail) ||
-               match_option(option, "-XX:G1MarkStackSize=", &tail)) {
-      julong stack_size = 0;
-      ArgsRange errcode = parse_memory_size(tail, &stack_size, 1);
-      if (errcode != arg_in_range) {
-        jio_fprintf(defaultStream::error_stream(),
-                    "Invalid mark stack size: %s\n", option->optionString);
-        describe_range_error(errcode);
-        return JNI_EINVAL;
-      }
-      jio_fprintf(defaultStream::error_stream(),
-        "Please use -XX:MarkStackSize in place of "
-        "-XX:CMSMarkStackSize or -XX:G1MarkStackSize in the future\n");
-      if (FLAG_SET_CMDLINE(size_t, MarkStackSize, stack_size) != Flag::SUCCESS) {
-        return JNI_EINVAL;
-      }
-    } else if (match_option(option, "-XX:CMSMarkStackSizeMax=", &tail)) {
-      julong max_stack_size = 0;
-      ArgsRange errcode = parse_memory_size(tail, &max_stack_size, 1);
-      if (errcode != arg_in_range) {
-        jio_fprintf(defaultStream::error_stream(),
-                    "Invalid maximum mark stack size: %s\n",
-                    option->optionString);
-        describe_range_error(errcode);
-        return JNI_EINVAL;
-      }
-      jio_fprintf(defaultStream::error_stream(),
-         "Please use -XX:MarkStackSizeMax in place of "
-         "-XX:CMSMarkStackSizeMax in the future\n");
-      if (FLAG_SET_CMDLINE(size_t, MarkStackSizeMax, max_stack_size) != Flag::SUCCESS) {
-        return JNI_EINVAL;
-      }
-    } else if (match_option(option, "-XX:ParallelMarkingThreads=", &tail) ||
-               match_option(option, "-XX:ParallelCMSThreads=", &tail)) {
-      uintx conc_threads = 0;
-      if (!parse_uintx(tail, &conc_threads, 1)) {
-        jio_fprintf(defaultStream::error_stream(),
-                    "Invalid concurrent threads: %s\n", option->optionString);
-        return JNI_EINVAL;
-      }
-      jio_fprintf(defaultStream::error_stream(),
-        "Please use -XX:ConcGCThreads in place of "
-        "-XX:ParallelMarkingThreads or -XX:ParallelCMSThreads in the future\n");
-      if (FLAG_SET_CMDLINE(uint, ConcGCThreads, conc_threads) != Flag::SUCCESS) {
-        return JNI_EINVAL;
-      }
     } else if (match_option(option, "-XX:MaxDirectMemorySize=", &tail)) {
       julong max_direct_memory_size = 0;
       ArgsRange errcode = parse_memory_size(tail, &max_direct_memory_size, 0);
@@ -3114,19 +3325,6 @@
           "ManagementServer is not supported in this VM.\n");
         return JNI_ERR;
 #endif // INCLUDE_MANAGEMENT
-    // CreateMinidumpOnCrash is removed, and replaced by CreateCoredumpOnCrash
-    } else if (match_option(option, "-XX:+CreateMinidumpOnCrash")) {
-      if (FLAG_SET_CMDLINE(bool, CreateCoredumpOnCrash, true) != Flag::SUCCESS) {
-        return JNI_EINVAL;
-      }
-      jio_fprintf(defaultStream::output_stream(),
-          "CreateMinidumpOnCrash is replaced by CreateCoredumpOnCrash: CreateCoredumpOnCrash is on\n");
-    } else if (match_option(option, "-XX:-CreateMinidumpOnCrash")) {
-      if (FLAG_SET_CMDLINE(bool, CreateCoredumpOnCrash, false) != Flag::SUCCESS) {
-        return JNI_EINVAL;
-      }
-      jio_fprintf(defaultStream::output_stream(),
-          "CreateMinidumpOnCrash is replaced by CreateCoredumpOnCrash: CreateCoredumpOnCrash is off\n");
     } else if (match_option(option, "-XX:", &tail)) { // -XX:xxxx
       // Skip -XX:Flags= and -XX:VMOptionsFile= since those cases have
       // already been handled
@@ -3623,7 +3821,7 @@
 void Arguments::set_shared_spaces_flags() {
   if (DumpSharedSpaces) {
     if (RequireSharedSpaces) {
-      warning("cannot dump shared archive while using shared archive");
+      warning("Cannot dump shared archive while using shared archive");
     }
     UseSharedSpaces = false;
 #ifdef _LP64
@@ -3848,6 +4046,7 @@
 // Parse entry point called from JNI_CreateJavaVM
 
 jint Arguments::parse(const JavaVMInitArgs* args) {
+  assert(verify_special_jvm_flags(), "deprecated and obsolete flag table inconsistent");
 
   // Initialize ranges and constraints
   CommandLineFlagRangeList::init();
@@ -3984,7 +4183,7 @@
 
   if (ScavengeRootsInCode == 0) {
     if (!FLAG_IS_DEFAULT(ScavengeRootsInCode)) {
-      warning("forcing ScavengeRootsInCode non-zero");
+      warning("Forcing ScavengeRootsInCode non-zero");
     }
     ScavengeRootsInCode = 1;
   }
--- a/hotspot/src/share/vm/runtime/arguments.hpp	Tue Oct 06 08:43:02 2015 -0700
+++ b/hotspot/src/share/vm/runtime/arguments.hpp	Wed Jul 05 20:52:10 2017 +0200
@@ -364,6 +364,8 @@
   // Aggressive optimization flags.
   static jint set_aggressive_opts_flags();
 
+  static jint set_aggressive_heap_flags();
+
   // Argument parsing
   static void do_pd_flag_adjustments();
   static bool parse_argument(const char* arg, Flag::Flags origin);
@@ -427,11 +429,24 @@
     short* methodsNum, short* methodsMax, char*** methods, bool** allClasses
   );
 
-  // Returns true if the string s is in the list of flags that have recently
-  // been made obsolete.  If we detect one of these flags on the command
-  // line, instead of failing we print a warning message and ignore the
-  // flag.  This gives the user a release or so to stop using the flag.
-  static bool is_newly_obsolete(const char* s, JDK_Version* buffer);
+  // Returns true if the flag is obsolete (and not yet expired).
+  // In this case the 'version' buffer is filled in with
+  // the version number when the flag became obsolete.
+  static bool is_obsolete_flag(const char* flag_name, JDK_Version* version);
+
+  // Returns 1 if the flag is deprecated (and not yet obsolete or expired).
+  //     In this case the 'version' buffer is filled in with the version number when
+  //     the flag became deprecated.
+  // Returns -1 if the flag is expired or obsolete.
+  // Returns 0 otherwise.
+  static int is_deprecated_flag(const char* flag_name, JDK_Version* version);
+
+  // Return the real name for the flag passed on the command line (either an alias name or "flag_name").
+  static const char* real_flag_name(const char *flag_name);
+
+  // Return the "real" name for option arg if arg is an alias, and print a warning if arg is deprecated.
+  // Return NULL if the arg has expired.
+  static const char* handle_aliases_and_deprecation(const char* arg, bool warn);
 
   static short  CompileOnlyClassesNum;
   static short  CompileOnlyClassesMax;
@@ -478,7 +493,6 @@
 
   // Check for consistency in the selection of the garbage collector.
   static bool check_gc_consistency();        // Check user-selected gc
-  static void check_deprecated_gc_flags();
   // Check consistency or otherwise of VM argument settings
   static bool check_vm_args_consistency();
   // Used by os_solaris
--- a/hotspot/src/share/vm/runtime/globals.hpp	Tue Oct 06 08:43:02 2015 -0700
+++ b/hotspot/src/share/vm/runtime/globals.hpp	Wed Jul 05 20:52:10 2017 +0200
@@ -1599,7 +1599,7 @@
           "(ParallelGC only)")                                              \
                                                                             \
   product(bool, ScavengeBeforeFullGC, true,                                 \
-          "Scavenge young generation before each full GC.")                 \
+          "Scavenge youngest generation before each full GC.")              \
                                                                             \
   develop(bool, ScavengeWithObjectsInToSpace, false,                        \
           "Allow scavenges to occur when to-space contains objects")        \
@@ -2097,7 +2097,7 @@
           "promotion failure")                                              \
                                                                             \
   notproduct(bool, PromotionFailureALot, false,                             \
-          "Use promotion failure handling on every young generation "       \
+          "Use promotion failure handling on every youngest generation "    \
           "collection")                                                     \
                                                                             \
   develop(uintx, PromotionFailureALotCount, 1000,                           \
@@ -2183,11 +2183,6 @@
           "size")                                                           \
           range(1, max_uintx)                                               \
                                                                             \
-  product(uintx, DefaultMaxRAMFraction, 4,                                  \
-          "Maximum fraction (1/n) of real memory used for maximum heap "    \
-          "size; deprecated: to be renamed to MaxRAMFraction")              \
-          range(1, max_uintx)                                               \
-                                                                            \
   product(uintx, MinRAMFraction, 2,                                         \
           "Minimum fraction (1/n) of real memory used for maximum heap "    \
           "size on systems with small physical memory size")                \
--- a/hotspot/src/share/vm/runtime/java.hpp	Tue Oct 06 08:43:02 2015 -0700
+++ b/hotspot/src/share/vm/runtime/java.hpp	Wed Jul 05 20:52:10 2017 +0200
@@ -137,6 +137,14 @@
     return JDK_Version(major, 0, 0, update_number);
   }
 
+  static JDK_Version undefined() {
+    return JDK_Version(0);
+  }
+
+  bool is_undefined() const {
+    return (_major == 0);
+  }
+
   uint8_t major_version() const          { return _major; }
   uint8_t minor_version() const          { return _minor; }
   uint8_t micro_version() const          { return _micro; }
--- a/hotspot/src/share/vm/runtime/jniHandles.cpp	Tue Oct 06 08:43:02 2015 -0700
+++ b/hotspot/src/share/vm/runtime/jniHandles.cpp	Wed Jul 05 20:52:10 2017 +0200
@@ -124,8 +124,8 @@
 }
 
 
-size_t JNIHandles::weak_oops_do(BoolObjectClosure* is_alive, OopClosure* f) {
-  return _weak_global_handles->weak_oops_do(is_alive, f);
+void JNIHandles::weak_oops_do(BoolObjectClosure* is_alive, OopClosure* f) {
+  _weak_global_handles->weak_oops_do(is_alive, f);
 }
 
 
@@ -380,9 +380,8 @@
 }
 
 
-size_t JNIHandleBlock::weak_oops_do(BoolObjectClosure* is_alive,
-                                    OopClosure* f) {
-  size_t count = 0;
+void JNIHandleBlock::weak_oops_do(BoolObjectClosure* is_alive,
+                                  OopClosure* f) {
   for (JNIHandleBlock* current = this; current != NULL; current = current->_next) {
     assert(current->pop_frame_link() == NULL,
       "blocks holding weak global JNI handles should not have pop frame link set");
@@ -391,7 +390,6 @@
       oop value = *root;
       // traverse heap pointers only, not deleted handles or free list pointers
       if (value != NULL && Universe::heap()->is_in_reserved(value)) {
-        count++;
         if (is_alive->do_object_b(value)) {
           // The weakly referenced object is alive, update pointer
           f->do_oop(root);
@@ -414,9 +412,7 @@
    * JVMTI data structures may also contain weak oops.  The iteration of them
    * is placed here so that we don't need to add it to each of the collectors.
    */
-  count += JvmtiExport::weak_oops_do(is_alive, f);
-
-  return count;
+  JvmtiExport::weak_oops_do(is_alive, f);
 }
 
 
--- a/hotspot/src/share/vm/runtime/jniHandles.hpp	Tue Oct 06 08:43:02 2015 -0700
+++ b/hotspot/src/share/vm/runtime/jniHandles.hpp	Wed Jul 05 20:52:10 2017 +0200
@@ -85,7 +85,7 @@
   // Traversal of regular global handles
   static void oops_do(OopClosure* f);
   // Traversal of weak global handles. Unreachable oops are cleared.
-  static size_t weak_oops_do(BoolObjectClosure* is_alive, OopClosure* f);
+  static void weak_oops_do(BoolObjectClosure* is_alive, OopClosure* f);
 };
 
 
@@ -153,7 +153,7 @@
   // Traversal of regular handles
   void oops_do(OopClosure* f);
   // Traversal of weak handles. Unreachable oops are cleared.
-  size_t weak_oops_do(BoolObjectClosure* is_alive, OopClosure* f);
+  void weak_oops_do(BoolObjectClosure* is_alive, OopClosure* f);
 
   // Checked JNI support
   void set_planned_capacity(size_t planned_capacity) { _planned_capacity = planned_capacity; }
--- a/hotspot/src/share/vm/runtime/vmStructs.cpp	Tue Oct 06 08:43:02 2015 -0700
+++ b/hotspot/src/share/vm/runtime/vmStructs.cpp	Wed Jul 05 20:52:10 2017 +0200
@@ -383,7 +383,7 @@
   nonstatic_field(Method,                      _access_flags,                                 AccessFlags)                           \
   nonstatic_field(Method,                      _vtable_index,                                 int)                                   \
   nonstatic_field(Method,                      _method_size,                                  u2)                                    \
-  nonstatic_field(Method,                      _intrinsic_id,                                 u1)                                    \
+  nonstatic_field(Method,                      _intrinsic_id,                                 u2)                                    \
   nonproduct_nonstatic_field(Method,           _compiled_invocation_count,                    int)                                   \
   volatile_nonstatic_field(Method,             _code,                                         nmethod*)                              \
   nonstatic_field(Method,                      _i2i_entry,                                    address)                               \
--- a/hotspot/test/TEST.groups	Tue Oct 06 08:43:02 2015 -0700
+++ b/hotspot/test/TEST.groups	Wed Jul 05 20:52:10 2017 +0200
@@ -190,7 +190,6 @@
   gc/g1/TestShrinkToOneRegion.java \
   gc/metaspace/G1AddMetaspaceDependency.java \
   gc/startup_warnings/TestCMS.java \
-  gc/startup_warnings/TestDefaultMaxRAMFraction.java \
   gc/startup_warnings/TestDefNewCMS.java \
   gc/startup_warnings/TestParallelGC.java \
   gc/startup_warnings/TestParallelScavengeSerialOld.java \
--- a/hotspot/test/gc/logging/TestPrintReferences.java	Tue Oct 06 08:43:02 2015 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,59 +0,0 @@
-/*
- * Copyright (c) 2015, 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.
- *
- * 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.
- */
-
-/*
- * @test TestPrintReferences
- * @bug 8133818
- * @summary Validate the reference processing logging
- * @key gc
- * @library /testlibrary
- * @modules java.base/sun.misc
- *          java.management
- */
-
-import jdk.test.lib.ProcessTools;
-import jdk.test.lib.OutputAnalyzer;
-
-public class TestPrintReferences {
-  public static void main(String[] args) throws Exception {
-    ProcessBuilder pb_enabled =
-      ProcessTools.createJavaProcessBuilder("-XX:+PrintGCDetails", "-XX:+PrintReferenceGC", "-Xmx10M", GCTest.class.getName());
-    OutputAnalyzer output = new OutputAnalyzer(pb_enabled.start());
-
-    output.shouldMatch(
-      "#[0-9]+: \\[SoftReference, [0-9]+ refs, [0-9]+\\.[0-9]+ secs\\]" +
-      "#[0-9]+: \\[WeakReference, [0-9]+ refs, [0-9]+\\.[0-9]+ secs\\]" +
-      "#[0-9]+: \\[FinalReference, [0-9]+ refs, [0-9]+\\.[0-9]+ secs\\]" +
-      "#[0-9]+: \\[PhantomReference, [0-9]+ refs, [0-9]+\\.[0-9]+ secs\\]" +
-      "#[0-9]+: \\[Cleaners, [0-9]+ refs, [0-9]+\\.[0-9]+ secs\\]" +
-      "#[0-9]+: \\[JNI Weak Reference, [0-9]+ refs, [0-9]+\\.[0-9]+ secs\\]");
-
-    output.shouldHaveExitValue(0);
-  }
-
-  static class GCTest {
-    public static void main(String [] args) {
-      System.gc();
-    }
-  }
-}
--- a/hotspot/test/gc/startup_warnings/TestDefaultMaxRAMFraction.java	Tue Oct 06 08:43:02 2015 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,46 +0,0 @@
-/*
-* Copyright (c) 2013, 2015, 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.
-*
-* 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.
-*/
-
-/*
-* @test TestDefaultMaxRAMFraction
-* @key gc
-* @bug 8021967
-* @summary Test that the deprecated TestDefaultMaxRAMFraction flag print a warning message
-* @library /testlibrary
-* @modules java.base/sun.misc
-*          java.management
-*/
-
-import jdk.test.lib.OutputAnalyzer;
-import jdk.test.lib.ProcessTools;
-
-public class TestDefaultMaxRAMFraction {
-  public static void main(String[] args) throws Exception {
-    ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-XX:DefaultMaxRAMFraction=4", "-version");
-    OutputAnalyzer output = new OutputAnalyzer(pb.start());
-    output.shouldContain("warning: DefaultMaxRAMFraction is deprecated and will likely be removed in a future release. Use MaxRAMFraction instead.");
-    output.shouldNotContain("error");
-    output.shouldHaveExitValue(0);
-  }
-
-}
--- a/hotspot/test/gc/startup_warnings/TestNoParNew.java	Tue Oct 06 08:43:02 2015 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,48 +0,0 @@
-/*
-* Copyright (c) 2014, 2015, 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.
-*
-* 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.
-*/
-
-/*
-* @test TestNoParNew
-* @key gc
-* @bug 8065972
-* @summary Test that specifying -XX:-UseParNewGC on the command line logs a warning message
-* @library /testlibrary
-* @modules java.base/sun.misc
-*          java.management
-*/
-
-import jdk.test.lib.OutputAnalyzer;
-import jdk.test.lib.ProcessTools;
-
-
-public class TestNoParNew {
-
-  public static void main(String args[]) throws Exception {
-    ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-XX:-UseParNewGC", "-version");
-    OutputAnalyzer output = new OutputAnalyzer(pb.start());
-    output.shouldContain("warning: The UseParNewGC flag is deprecated and will likely be removed in a future release");
-    output.shouldNotContain("error");
-    output.shouldHaveExitValue(0);
-  }
-
-}
--- a/hotspot/test/gc/startup_warnings/TestParNewCMS.java	Tue Oct 06 08:43:02 2015 -0700
+++ b/hotspot/test/gc/startup_warnings/TestParNewCMS.java	Wed Jul 05 20:52:10 2017 +0200
@@ -40,7 +40,7 @@
   public static void main(String args[]) throws Exception {
     ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-XX:+UseParNewGC", "-XX:+UseConcMarkSweepGC", "-version");
     OutputAnalyzer output = new OutputAnalyzer(pb.start());
-    output.shouldContain("warning: The UseParNewGC flag is deprecated and will likely be removed in a future release");
+    output.shouldContain("warning: Option UseParNewGC was deprecated in version");
     output.shouldNotContain("error");
     output.shouldHaveExitValue(0);
   }
--- a/hotspot/test/runtime/CommandLine/ObsoleteFlagErrorMessage.java	Tue Oct 06 08:43:02 2015 -0700
+++ b/hotspot/test/runtime/CommandLine/ObsoleteFlagErrorMessage.java	Wed Jul 05 20:52:10 2017 +0200
@@ -46,7 +46,7 @@
         "-XX:NmethodSweepFraction=10", "-version");
 
     OutputAnalyzer output2 = new OutputAnalyzer(pb2.start());
-    output2.shouldContain("ignoring option").shouldContain("support was removed");
+    output2.shouldContain("Ignoring option").shouldContain("support was removed");
     output2.shouldContain("NmethodSweepFraction");
   }
 }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/test/runtime/CommandLine/VMAliasOptions.java	Wed Jul 05 20:52:10 2017 +0200
@@ -0,0 +1,66 @@
+/*
+ * Copyright (c) 2015, 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.
+ *
+ * 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.
+ */
+
+import jdk.test.lib.*;
+import jdk.test.lib.cli.*;
+
+/*
+ * @test
+ * @bug 8061611
+ * @summary Test that various alias options correctly set the target options. See aliased_jvm_flags in arguments.cpp.
+ * @library /testlibrary
+ */
+public class VMAliasOptions {
+
+    /**
+     * each entry is {[0]: alias name, [1]: alias target, [2]: value to set
+     * (true/false/n/string)}.
+     */
+    public static final String[][] ALIAS_OPTIONS = {
+        {"DefaultMaxRAMFraction",   "MaxRAMFraction", "1032"},
+        {"CMSMarkStackSizeMax",     "MarkStackSizeMax", "1032"},
+        {"CMSMarkStackSize",        "MarkStackSize", "1032"},
+        {"G1MarkStackSize",         "MarkStackSize", "1032"},
+        {"ParallelMarkingThreads",  "ConcGCThreads", "2"},
+        {"ParallelCMSThreads",      "ConcGCThreads", "2"},
+        {"CreateMinidumpOnCrash",   "CreateCoredumpOnCrash", "false" },
+    };
+
+    static void testAliases(String[][] optionInfo) throws Throwable {
+        String aliasNames[]     = new String[optionInfo.length];
+        String optionNames[]    = new String[optionInfo.length];
+        String expectedValues[] = new String[optionInfo.length];
+        for (int i = 0; i < optionInfo.length; i++) {
+            aliasNames[i]     = optionInfo[i][0];
+            optionNames[i]    = optionInfo[i][1];
+            expectedValues[i] = optionInfo[i][2];
+        }
+
+        OutputAnalyzer output = CommandLineOptionTest.startVMWithOptions(aliasNames, expectedValues, "-XX:+PrintFlagsFinal");
+        CommandLineOptionTest.verifyOptionValuesFromOutput(output, optionNames, expectedValues);
+    }
+
+    public static void main(String[] args) throws Throwable {
+        testAliases(ALIAS_OPTIONS);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/test/runtime/CommandLine/VMDeprecatedOptions.java	Wed Jul 05 20:52:10 2017 +0200
@@ -0,0 +1,80 @@
+/*
+ * Copyright (c) 2015, 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.
+ *
+ * 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.
+ */
+
+import jdk.test.lib.*;
+import jdk.test.lib.cli.*;
+
+/*
+ * @test
+ * @bug 8066821
+ * @summary Test that various options are deprecated. See deprecated_jvm_flags in arguments.cpp.
+ * @library /testlibrary
+ */
+public class VMDeprecatedOptions {
+
+    /**
+     * each entry is {[0]: option name, [1]: value to set
+     * (true/false/n/string)}.
+     */
+    public static final String[][] DEPRECATED_OPTIONS = {
+        // deprecated non-alias flags:
+        {"MaxGCMinorPauseMillis", "1032"},
+        {"UseParNewGC", "false"},
+
+        // deprecated alias flags (see also aliased_jvm_flags):
+        {"DefaultMaxRAMFraction", "4"},
+        {"CMSMarkStackSizeMax", "1032"},
+        {"CMSMarkStackSize", "1032"},
+        {"G1MarkStackSize", "1032"},
+        {"ParallelMarkingThreads", "2"},
+        {"ParallelCMSThreads", "2"},
+        {"CreateMinidumpOnCrash", "false"}
+    };
+
+    static String getDeprecationString(String optionName) {
+        return "Option " + optionName
+            + " was deprecated in version [\\S]+ and will likely be removed in a future release";
+    }
+
+    static void testDeprecated(String[][] optionInfo) throws Throwable {
+        String optionNames[] = new String[optionInfo.length];
+        String expectedValues[] = new String[optionInfo.length];
+        for (int i = 0; i < optionInfo.length; i++) {
+            optionNames[i] = optionInfo[i][0];
+            expectedValues[i] = optionInfo[i][1];
+        }
+
+        OutputAnalyzer output = CommandLineOptionTest.startVMWithOptions(optionNames, expectedValues);
+
+        // check for option deprecation messages:
+        output.shouldHaveExitValue(0);
+        for (String[] deprecated : optionInfo) {
+            String match = getDeprecationString(deprecated[0]);
+            output.shouldMatch(match);
+        }
+    }
+
+    public static void main(String[] args) throws Throwable {
+        testDeprecated(DEPRECATED_OPTIONS);  // Make sure that each deprecated option is mentioned in the output.
+    }
+}
--- a/hotspot/test/runtime/NMT/AutoshutdownNMT.java	Tue Oct 06 08:43:02 2015 -0700
+++ b/hotspot/test/runtime/NMT/AutoshutdownNMT.java	Wed Jul 05 20:52:10 2017 +0200
@@ -41,6 +41,6 @@
                 "-XX:-AutoShutdownNMT",
                 "-version");
         OutputAnalyzer output = new OutputAnalyzer(pb.start());
-        output.shouldContain("ignoring option AutoShutdownNMT");
+        output.shouldContain("Ignoring option AutoShutdownNMT");
     }
 }
--- a/hotspot/test/testlibrary/jdk/test/lib/cli/CommandLineOptionTest.java	Tue Oct 06 08:43:02 2015 -0700
+++ b/hotspot/test/testlibrary/jdk/test/lib/cli/CommandLineOptionTest.java	Wed Jul 05 20:52:10 2017 +0200
@@ -261,6 +261,73 @@
     }
 
     /**
+     * Start VM with given options and values.
+     * Generates command line option flags from
+     * {@code optionNames} and {@code optionValues}.
+     *
+     * @param optionNames names of options to pass in
+     * @param optionValues  values of option
+     * @param additionalVMOpts additional options that should be
+     *                         passed to JVM.
+     * @return output from vm process
+     */
+    public static OutputAnalyzer startVMWithOptions(String[] optionNames,
+            String[] optionValues,
+            String... additionalVMOpts) throws Throwable {
+        List<String> vmOpts = new ArrayList<>();
+        if (optionNames == null || optionValues == null || optionNames.length != optionValues.length) {
+            throw new IllegalArgumentException("optionNames and/or optionValues");
+        }
+
+        for (int i = 0; i < optionNames.length; i++) {
+          vmOpts.add(prepareFlag(optionNames[i], optionValues[i]));
+        }
+        Collections.addAll(vmOpts, additionalVMOpts);
+        Collections.addAll(vmOpts, "-version");
+
+        ProcessBuilder processBuilder = ProcessTools.createJavaProcessBuilder(
+                vmOpts.toArray(new String[vmOpts.size()]));
+
+        return new OutputAnalyzer(processBuilder.start());
+    }
+
+    /**
+     * Verifies from the output that values of specified JVM options were the same as
+     * expected values.
+     *
+     * @param outputAnalyzer search output for expect options and values.
+     * @param optionNames names of tested options.
+     * @param expectedValues expected values of tested options.
+     * @throws Throwable if verification fails or some other issues occur.
+     */
+    public static void verifyOptionValuesFromOutput(OutputAnalyzer outputAnalyzer,
+            String[] optionNames,
+            String[] expectedValues) throws Throwable {
+        outputAnalyzer.shouldHaveExitValue(0);
+        for (int i = 0; i < optionNames.length; i++) {
+          outputAnalyzer.shouldMatch(String.format(
+                CommandLineOptionTest.PRINT_FLAGS_FINAL_FORMAT,
+                optionNames[i], expectedValues[i]));
+        }
+    }
+
+   /**
+     * Verifies that value of specified JVM options are the same as
+     * expected values.
+     * Generates command line option flags from
+     * {@code optionNames} and {@code expectedValues}.
+     *
+     * @param optionNames names of tested options.
+     * @param expectedValues expected values of tested options.
+     * @throws Throwable if verification fails or some other issues occur.
+     */
+    public static void verifyOptionValues(String[] optionNames,
+            String[] expectedValues) throws Throwable {
+       OutputAnalyzer outputAnalyzer = startVMWithOptions(optionNames, expectedValues, "-XX:+PrintFlagsFinal");
+       verifyOptionValuesFromOutput(outputAnalyzer, optionNames, expectedValues);
+    }
+
+    /**
      * Verifies that value of specified JVM when type of newly started VM
      * is the same as the type of current.
      * This method filter out option with {@code optionName}
@@ -312,6 +379,24 @@
     }
 
     /**
+     * Prepares generic command line flag with name {@code name} by setting
+     * it's value to {@code value}.
+     *
+     * @param name the name of option to be prepared
+     * @param value the value of option ("+" or "-" can be used instead of "true" or "false")
+     * @return prepared command line flag
+     */
+    public static String prepareFlag(String name, String value) {
+        if (value.equals("+") || value.equalsIgnoreCase("true")) {
+          return "-XX:+" + name;
+      } else if (value.equals("-") || value.equalsIgnoreCase("false")) {
+        return "-XX:-" + name;
+      } else {
+        return "-XX:" + name + "=" + value;
+      }
+    }
+
+    /**
      * Returns message that should occur in VM output if option
      * {@code optionName} if unrecognized.
      *
--- a/jdk/.hgtags	Tue Oct 06 08:43:02 2015 -0700
+++ b/jdk/.hgtags	Wed Jul 05 20:52:10 2017 +0200
@@ -326,3 +326,4 @@
 fdc13a2d32867ca3c57b7fa2620c6b59c83168cb jdk9-b81
 b10b64263b563e21f055c881444f625ec618b826 jdk9-b82
 d11f25ce3c545823f53bb978d454a4d2901abac3 jdk9-b83
+757ef7f6d0042934edea3e0bf616fad2c1a22789 jdk9-b84
--- a/jdk/make/data/fontconfig/windows.fontconfig.properties	Tue Oct 06 08:43:02 2015 -0700
+++ b/jdk/make/data/fontconfig/windows.fontconfig.properties	Wed Jul 05 20:52:10 2017 +0200
@@ -40,6 +40,7 @@
 allfonts.dingbats=Wingdings
 allfonts.lucida=Lucida Sans Regular
 allfonts.symbol=Symbol
+allfonts.symbols=Segoe UI Symbol
 allfonts.thai=Lucida Sans Regular
 allfonts.georgian=Sylfaen
 
@@ -236,7 +237,7 @@
 
 sequence.allfonts.x-windows-874=alphabetic,thai,dingbats,symbol
 
-sequence.fallback=lucida,\
+sequence.fallback=lucida,symbols,\
                   chinese-ms950,chinese-hkscs,chinese-ms936,chinese-gb18030,\
                   japanese,korean,chinese-ms950-extb,chinese-ms936-extb,georgian
 
@@ -298,3 +299,4 @@
 filename.Wingdings=WINGDING.TTF
 
 filename.Sylfaen=sylfaen.ttf
+filename.Segoe_UI_Symbol=SEGUISYM.TTF
--- a/jdk/make/data/tzdata/VERSION	Tue Oct 06 08:43:02 2015 -0700
+++ b/jdk/make/data/tzdata/VERSION	Wed Jul 05 20:52:10 2017 +0200
@@ -21,4 +21,4 @@
 # or visit www.oracle.com if you need additional information or have any
 # questions.
 #
-tzdata2015f
+tzdata2015g
--- a/jdk/make/data/tzdata/asia	Tue Oct 06 08:43:02 2015 -0700
+++ b/jdk/make/data/tzdata/asia	Wed Jul 05 20:52:10 2017 +0200
@@ -154,7 +154,8 @@
 # Azerbaijan
 # From Rustam Aliyev of the Azerbaijan Internet Forum (2005-10-23):
 # According to the resolution of Cabinet of Ministers, 1997
-# Resolution available at: http://aif.az/docs/daylight_res.pdf
+# From Paul Eggert (2015-09-17): It was Resolution No. 21 (1997-03-17).
+# http://code.az/files/daylight_res.pdf
 # Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
 Rule	Azer	1997	max	-	Mar	lastSun	 4:00	1:00	S
 Rule	Azer	1997	max	-	Oct	lastSun	 5:00	0	-
@@ -1740,11 +1741,12 @@
 # the 8:30 time zone on August 15, one example:
 # http://www.bbc.com/news/world-asia-33815049
 #
-# From Paul Eggert (2015-08-07):
-# No transition time is specified; assume 00:00.
+# From Paul Eggert (2015-08-15):
+# Bells rang out midnight (00:00) Friday as part of the celebrations.  See:
+# Talmadge E. North Korea celebrates new time zone, 'Pyongyang Time'
+# http://news.yahoo.com/north-korea-celebrates-time-zone-pyongyang-time-164038128.html
 # There is no common English-language abbreviation for this time zone.
-# Use %z rather than invent one.  We can't assume %z works everywhere yet,
-# so for now substitute its output manually.
+# Use KST, as that's what we already use for 1954-1961 in ROK.
 
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone	Asia/Seoul	8:27:52	-	LMT	1908 Apr  1
@@ -1758,7 +1760,7 @@
 			8:30	-	KST	1912 Jan  1
 			9:00	-	JCST	1937 Oct  1
 			9:00	-	JST	1945 Aug 24
-			9:00	-	KST	2015 Aug 15
+			9:00	-	KST	2015 Aug 15 00:00
 			8:30	-	KST
 
 ###############################################################################
--- a/jdk/make/data/tzdata/australasia	Tue Oct 06 08:43:02 2015 -0700
+++ b/jdk/make/data/tzdata/australasia	Wed Jul 05 20:52:10 2017 +0200
@@ -358,10 +358,17 @@
 # DST will start Nov. 2 this year.
 # http://www.fiji.gov.fj/Media-Center/Press-Releases/DAYLIGHT-SAVING-STARTS-ON-SUNDAY,-NOVEMBER-2ND.aspx
 
-# From Paul Eggert (2014-10-20):
+# From a government order dated 2015-08-26 and published as Legal Notice No. 77
+# in the Government of Fiji Gazette Supplement No. 24 (2015-08-28),
+# via Ken Rylander (2015-09-02):
+# the daylight saving period is 1 hour in advance of the standard time
+# commencing at 2.00 am on Sunday 1st November, 2015 and ending at
+# 3.00 am on Sunday 17th January, 2016.
+
+# From Paul Eggert (2015-09-01):
 # For now, guess DST from 02:00 the first Sunday in November to
-# 03:00 the first Sunday on or after January 18.  Although ad hoc, it
-# matches this year's plan and seems more likely to match future
+# 03:00 the third Sunday in January.  Although ad hoc, it matches
+# transitions since late 2014 and seems more likely to match future
 # practice than guessing no DST.
 
 # Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
@@ -374,7 +381,7 @@
 Rule	Fiji	2012	2013	-	Jan	Sun>=18	3:00	0	-
 Rule	Fiji	2014	only	-	Jan	Sun>=18	2:00	0	-
 Rule	Fiji	2014	max	-	Nov	Sun>=1	2:00	1:00	S
-Rule	Fiji	2015	max	-	Jan	Sun>=18	3:00	0	-
+Rule	Fiji	2015	max	-	Jan	Sun>=15	3:00	0	-
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone	Pacific/Fiji	11:55:44 -	LMT	1915 Oct 26 # Suva
 			12:00	Fiji	FJ%sT	# Fiji Time
@@ -533,7 +540,10 @@
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone	Pacific/Norfolk	11:11:52 -	LMT	1901 # Kingston
 			11:12	-	NMT	1951 # Norfolk Mean Time
-			11:30	-	NFT	# Norfolk Time
+			11:30	-	NFT	1974 Oct 27 02:00 # Norfolk T.
+			11:30	1:00	NFST	1975 Mar  2 02:00
+			11:30	-	NFT	2015 Oct  4 02:00
+			11:00	-	NFT
 
 # Palau (Belau)
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
@@ -1573,6 +1583,20 @@
 # started DST on June 3.  Possibly DST was observed other years
 # in Midway, but we have no record of it.
 
+# Norfolk
+
+# From Alexander Krivenyshev (2015-09-23):
+# Norfolk Island will change ... from +1130 to +1100:
+# https://www.comlaw.gov.au/Details/F2015L01483/Explanatory%20Statement/Text
+# ... at 12.30 am (by legal time in New South Wales) on 4 October 2015.
+# http://www.norfolkisland.gov.nf/nia/MediaRelease/Media%20Release%20Norfolk%20Island%20Standard%20Time%20Change.pdf
+
+# From Paul Eggert (2015-09-23):
+# Transitions before 2015 are from timeanddate.com, which consulted
+# the Norfolk Island Museum and the Australian Bureau of Meteorology's
+# Norfolk Island station, and found no record of Norfolk observing DST
+# other than in 1974/5.  See:
+# http://www.timeanddate.com/time/australia/norfolk-island.html
 
 # Pitcairn
 
--- a/jdk/make/data/tzdata/europe	Tue Oct 06 08:43:02 2015 -0700
+++ b/jdk/make/data/tzdata/europe	Wed Jul 05 20:52:10 2017 +0200
@@ -3173,6 +3173,11 @@
 # http://www.balkaneu.com/eventful-elections-turkey/ 2014-03-30.
 # I guess the best we can do is document the official time.
 
+# From Fatih (2015-09-29):
+# It's officially announced now by the Ministry of Energy.
+# Turkey delays winter time to 8th of November 04:00
+# http://www.aa.com.tr/tr/turkiye/yaz-saati-uygulamasi-8-kasimda-sona-erecek/362217
+
 # Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
 Rule	Turkey	1916	only	-	May	 1	0:00	1:00	S
 Rule	Turkey	1916	only	-	Oct	 1	0:00	0	-
@@ -3242,6 +3247,8 @@
 			2:00	-	EET	2011 Mar 28  1:00u
 			2:00	EU	EE%sT	2014 Mar 30  1:00u
 			2:00	-	EET	2014 Mar 31  1:00u
+			2:00	EU	EE%sT	2015 Oct 25  1:00u
+			2:00	1:00	EEST	2015 Nov  8  1:00u
 			2:00	EU	EE%sT
 Link	Europe/Istanbul	Asia/Istanbul	# Istanbul is in both continents.
 
--- a/jdk/make/data/tzdata/northamerica	Tue Oct 06 08:43:02 2015 -0700
+++ b/jdk/make/data/tzdata/northamerica	Wed Jul 05 20:52:10 2017 +0200
@@ -1849,6 +1849,22 @@
 
 # The transition dates (and times) are guesses.
 
+# From Matt Johnson (2015-09-21):
+# Fort Nelson, BC, Canada will cancel DST this year.  So while previously they
+# were aligned with America/Vancouver, they're now aligned with
+# America/Dawson_Creek.
+# http://www.northernrockies.ca/EN/meta/news/archives/2015/northern-rockies-time-change.html
+#
+# From Tim Parenti (2015-09-23):
+# This requires a new zone for the Northern Rockies Regional Municipality,
+# America/Fort_Nelson.  The resolution of 2014-12-08 was reached following a
+# 2014-11-15 poll with nearly 75% support.  Effectively, the municipality has
+# been on MST (-0700) like Dawson Creek since it advanced its clocks on
+# 2015-03-08.
+#
+# From Paul Eggert (2015-09-23):
+# Shanks says Fort Nelson did not observe DST in 1946, unlike Vancouver.
+
 # Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
 Rule	Vanc	1918	only	-	Apr	14	2:00	1:00	D
 Rule	Vanc	1918	only	-	Oct	27	2:00	0	S
@@ -1867,6 +1883,12 @@
 			-8:00	Canada	P%sT	1947
 			-8:00	Vanc	P%sT	1972 Aug 30  2:00
 			-7:00	-	MST
+Zone America/Fort_Nelson	-8:10:47 -	LMT	1884
+			-8:00	Vanc	P%sT	1946
+			-8:00	-	PST	1947
+			-8:00	Vanc	P%sT	1987
+			-8:00	Canada	P%sT	2015 Mar  8  2:00
+			-7:00	-	MST
 Zone America/Creston	-7:46:04 -	LMT	1884
 			-7:00	-	MST	1916 Oct 1
 			-8:00	-	PST	1918 Jun 2
--- a/jdk/make/data/tzdata/zone.tab	Tue Oct 06 08:43:02 2015 -0700
+++ b/jdk/make/data/tzdata/zone.tab	Wed Jul 05 20:52:10 2017 +0200
@@ -152,6 +152,7 @@
 CA	+682059-1334300	America/Inuvik	Mountain Time - west Northwest Territories
 CA	+4906-11631	America/Creston	Mountain Standard Time - Creston, British Columbia
 CA	+5946-12014	America/Dawson_Creek	Mountain Standard Time - Dawson Creek & Fort Saint John, British Columbia
+CA	+5848-12242	America/Fort_Nelson	Mountain Standard Time - Fort Nelson, British Columbia
 CA	+4916-12307	America/Vancouver	Pacific Time - west British Columbia
 CA	+6043-13503	America/Whitehorse	Pacific Time - south Yukon
 CA	+6404-13925	America/Dawson	Pacific Time - north Yukon
--- a/jdk/make/gensrc/GensrcProperties.gmk	Tue Oct 06 08:43:02 2015 -0700
+++ b/jdk/make/gensrc/GensrcProperties.gmk	Wed Jul 05 20:52:10 2017 +0200
@@ -93,8 +93,7 @@
   $$($1_TARGET): $$($1_SRCS) $$($1_JAVAS) $(BUILD_TOOLS_JDK)
 	$(MKDIR) -p $$(@D) $$($1_DIRS)
 	$(ECHO) Compiling $$(words $$($1_SRCS)) properties into resource bundles for $(MODULE)
-	$(RM) $$($1_CMDLINE_FILE)
-	$$(call ListPathsSafely,$1_CMDLINE,\n, >> $$($1_CMDLINE_FILE))
+	$$(eval $$(call ListPathsSafely, $1_CMDLINE, $$($1_CMDLINE_FILE)))
 	$(TOOL_COMPILEPROPERTIES) -quiet @$$($1_CMDLINE_FILE)
 	$(TOUCH) $$@
 
--- a/jdk/make/launcher/Launcher-jdk.scripting.nashorn.shell.gmk	Tue Oct 06 08:43:02 2015 -0700
+++ b/jdk/make/launcher/Launcher-jdk.scripting.nashorn.shell.gmk	Wed Jul 05 20:52:10 2017 +0200
@@ -26,5 +26,6 @@
 include LauncherCommon.gmk
 
 $(eval $(call SetupLauncher,jjs, \
+    -DENABLE_ARG_FILES \
     -DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "jdk.nashorn.tools.jjs.Main"$(COMMA) }'))
 
--- a/jdk/make/lib/Awt2dLibraries.gmk	Tue Oct 06 08:43:02 2015 -0700
+++ b/jdk/make/lib/Awt2dLibraries.gmk	Wed Jul 05 20:52:10 2017 +0200
@@ -959,10 +959,9 @@
           $(X_CFLAGS) \
           $(X_LIBS) \
           $(LIBAWT_LWAWT_CFLAGS), \
-      DISABLED_WARNINGS_clang := incomplete-implementation \
+      DISABLED_WARNINGS_clang := incomplete-implementation enum-conversion \
           deprecated-declarations objc-method-access bitwise-op-parentheses \
           incompatible-pointer-types parentheses-equality extra-tokens, \
-      WARNINGS_AS_ERRORS_clang := false, \
       LDFLAGS := $(LDFLAGS_JDKLIB) \
           $(call SET_SHARED_LIBRARY_ORIGIN) \
           -L$(INSTALL_LIBRARIES_HERE), \
--- a/jdk/make/lib/CoreLibraries.gmk	Tue Oct 06 08:43:02 2015 -0700
+++ b/jdk/make/lib/CoreLibraries.gmk	Wed Jul 05 20:52:10 2017 +0200
@@ -160,6 +160,7 @@
         -framework Security -framework SystemConfiguration, \
     LDFLAGS_SUFFIX_windows := -export:winFileHandleOpen -export:handleLseek \
         -export:getLastErrorString \
+        -export:getErrorString \
         jvm.lib $(BUILD_LIBFDLIBM) $(WIN_VERIFY_LIB) \
         shell32.lib delayimp.lib -DELAYLOAD:shell32.dll \
         advapi32.lib version.lib, \
--- a/jdk/make/mapfiles/libjava/mapfile-vers	Tue Oct 06 08:43:02 2015 -0700
+++ b/jdk/make/mapfiles/libjava/mapfile-vers	Wed Jul 05 20:52:10 2017 +0200
@@ -282,8 +282,9 @@
 
                 # ZipFile.c needs this one
 		throwFileNotFoundException;
-                # zip_util.c needs this one
+                # zip_util.c needs these
 		getLastErrorString;
+		getErrorString;
 
 	# Outcalls from libjvm done using dlsym().
 
--- a/jdk/make/rmic/RmicCommon.gmk	Tue Oct 06 08:43:02 2015 -0700
+++ b/jdk/make/rmic/RmicCommon.gmk	Wed Jul 05 20:52:10 2017 +0200
@@ -31,9 +31,9 @@
 
 ##########################################################################################
 
-BTRMIC_CP := $(call PathList, $(INTERIM_CORBA_JAR) \
+BTRMIC_CP := $(call PathList, \
     $(BUILDTOOLS_OUTPUTDIR)/interim_rmic_classes $(INTERIM_LANGTOOLS_JAR))
-BTRMIC_ARGS := -Xbootclasspath/p:$(BTRMIC_CP) -cp $(BTRMIC_CP)
+BTRMIC_ARGS := -cp $(BTRMIC_CP)
 RMIC := $(JAVA) $(BTRMIC_ARGS) sun.rmi.rmic.Main
 
 CLASSES_DIR := $(JDK_OUTPUTDIR)/modules
--- a/jdk/make/src/classes/build/tools/module/ModuleArchive.java	Tue Oct 06 08:43:02 2015 -0700
+++ b/jdk/make/src/classes/build/tools/module/ModuleArchive.java	Wed Jul 05 20:52:10 2017 +0200
@@ -105,6 +105,7 @@
                     entries.addAll(stream
                             .filter(p -> !Files.isDirectory(p)
                                     && !classes.relativize(p).toString().startsWith("_the.")
+                                    && !classes.relativize(p).toString().endsWith(".bc")
                                     && !classes.relativize(p).toString().equals("javac_state"))
                             .sorted()
                             .map(p -> toEntry(p, classes, EntryType.CLASS_OR_RESOURCE))
--- a/jdk/src/demo/share/applets/MoleculeViewer/XYZApp.java	Tue Oct 06 08:43:02 2015 -0700
+++ b/jdk/src/demo/share/applets/MoleculeViewer/XYZApp.java	Wed Jul 05 20:52:10 2017 +0200
@@ -504,11 +504,11 @@
 
     private static Applet applet;
     private static byte[] data;
-    private final static int R = 40;
-    private final static int hx = 15;
-    private final static int hy = 15;
-    private final static int bgGrey = 192;
-    private final static int nBalls = 16;
+    private static final int R = 40;
+    private static final int hx = 15;
+    private static final int hy = 15;
+    private static final int bgGrey = 192;
+    private static final int nBalls = 16;
     private static int maxr;
     private int Rl;
     private int Gl;
--- a/jdk/src/demo/share/java2d/J2DBench/src/j2dbench/tests/ImageTests.java	Tue Oct 06 08:43:02 2015 -0700
+++ b/jdk/src/demo/share/java2d/J2DBench/src/j2dbench/tests/ImageTests.java	Wed Jul 05 20:52:10 2017 +0200
@@ -771,7 +771,7 @@
         }
     }
 
-    private static abstract class ImageOpTests extends ImageTests {
+    private abstract static class ImageOpTests extends ImageTests {
         ImageOpTests(Group parent, String nodeName, String desc) {
             super(parent, nodeName, desc,
                   new Modifier.Filter() {
--- a/jdk/src/demo/share/java2d/J2DBench/src/j2dbench/tests/PixelTests.java	Tue Oct 06 08:43:02 2015 -0700
+++ b/jdk/src/demo/share/java2d/J2DBench/src/j2dbench/tests/PixelTests.java	Wed Jul 05 20:52:10 2017 +0200
@@ -245,7 +245,7 @@
         }
     }
 
-    public static abstract class BufImgTest extends PixelTests {
+    public abstract static class BufImgTest extends PixelTests {
         public BufImgTest(String nodeName, String description) {
             super(bufimgtestroot, nodeName, description);
         }
@@ -281,7 +281,7 @@
         }
     }
 
-    public static abstract class RasTest extends PixelTests {
+    public abstract static class RasTest extends PixelTests {
         public RasTest(String nodeName, String description) {
             super(rastertestroot, nodeName, description);
         }
@@ -355,7 +355,7 @@
         }
     }
 
-    public static abstract class DataBufTest extends PixelTests {
+    public abstract static class DataBufTest extends PixelTests {
         public DataBufTest(String nodeName, String description) {
             super(dbtestroot, nodeName, description);
         }
--- a/jdk/src/demo/share/java2d/J2DBench/src/j2dbench/tests/iio/InputTests.java	Tue Oct 06 08:43:02 2015 -0700
+++ b/jdk/src/demo/share/java2d/J2DBench/src/j2dbench/tests/iio/InputTests.java	Wed Jul 05 20:52:10 2017 +0200
@@ -161,7 +161,7 @@
         }
     }
 
-    protected static abstract class Context {
+    protected abstract static class Context {
         int size;
         Object input;
         int inputType;
--- a/jdk/src/demo/share/java2d/J2DBench/src/j2dbench/tests/iio/OutputTests.java	Tue Oct 06 08:43:02 2015 -0700
+++ b/jdk/src/demo/share/java2d/J2DBench/src/j2dbench/tests/iio/OutputTests.java	Wed Jul 05 20:52:10 2017 +0200
@@ -156,7 +156,7 @@
         }
     }
 
-    protected static abstract class Context {
+    protected abstract static class Context {
         int size;
         Object output;
         int outputType;
--- a/jdk/src/demo/share/java2d/J2DBench/src/j2dbench/tests/text/TextMeasureTests.java	Tue Oct 06 08:43:02 2015 -0700
+++ b/jdk/src/demo/share/java2d/J2DBench/src/j2dbench/tests/text/TextMeasureTests.java	Wed Jul 05 20:52:10 2017 +0200
@@ -232,7 +232,7 @@
         }
     }
 
-    public static abstract class GVMeasureTest extends TextMeasureTests {
+    public abstract static class GVMeasureTest extends TextMeasureTests {
         protected GVMeasureTest(Group parent, String nodeName, String description) {
             super(parent, nodeName, description);
         }
@@ -431,7 +431,7 @@
         }
     }
 
-    public static abstract class TLMeasureTest extends TextMeasureTests {
+    public abstract static class TLMeasureTest extends TextMeasureTests {
         protected TLMeasureTest(Group parent, String nodeName, String description) {
             super(parent, nodeName, description);
         }
@@ -506,7 +506,7 @@
         }
     }
 
-    public static abstract class TLExtendedMeasureTest extends TLMeasureTest {
+    public abstract static class TLExtendedMeasureTest extends TLMeasureTest {
         protected TLExtendedMeasureTest(Group parent, String nodeName, String description) {
             super(parent, nodeName, description);
         }
--- a/jdk/src/demo/share/jfc/FileChooserDemo/FileChooserDemo.java	Tue Oct 06 08:43:02 2015 -0700
+++ b/jdk/src/demo/share/jfc/FileChooserDemo/FileChooserDemo.java	Wed Jul 05 20:52:10 2017 +0200
@@ -143,11 +143,11 @@
     private JTextField customField;
     private final ExampleFileView fileView;
     private final ExampleFileSystemView fileSystemView;
-    private final static Dimension hpad10 = new Dimension(10, 1);
-    private final static Dimension vpad20 = new Dimension(1, 20);
-    private final static Dimension vpad7 = new Dimension(1, 7);
-    private final static Dimension vpad4 = new Dimension(1, 4);
-    private final static Insets insets = new Insets(5, 10, 0, 10);
+    private static final Dimension hpad10 = new Dimension(10, 1);
+    private static final Dimension vpad20 = new Dimension(1, 20);
+    private static final Dimension vpad7 = new Dimension(1, 7);
+    private static final Dimension vpad4 = new Dimension(1, 4);
+    private static final Insets insets = new Insets(5, 10, 0, 10);
     private final FilePreviewer previewer;
     private final JFileChooser chooser;
 
--- a/jdk/src/demo/share/jfc/Notepad/Notepad.java	Tue Oct 06 08:43:02 2015 -0700
+++ b/jdk/src/demo/share/jfc/Notepad/Notepad.java	Wed Jul 05 20:52:10 2017 +0200
@@ -64,7 +64,7 @@
 
     protected static Properties properties;
     private static ResourceBundle resources;
-    private final static String EXIT_AFTER_PAINT = "-exit";
+    private static final String EXIT_AFTER_PAINT = "-exit";
     private static boolean exitAfterFirstPaint;
 
     private static final String[] MENUBAR_KEYS = {"file", "edit", "debug"};
--- a/jdk/src/java.base/linux/classes/sun/nio/ch/EPollSelectorImpl.java	Tue Oct 06 08:43:02 2015 -0700
+++ b/jdk/src/java.base/linux/classes/sun/nio/ch/EPollSelectorImpl.java	Wed Jul 05 20:52:10 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2015, 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
@@ -65,9 +65,23 @@
         long pipeFds = IOUtil.makePipe(false);
         fd0 = (int) (pipeFds >>> 32);
         fd1 = (int) pipeFds;
-        pollWrapper = new EPollArrayWrapper();
-        pollWrapper.initInterrupt(fd0, fd1);
-        fdToKey = new HashMap<>();
+        try {
+            pollWrapper = new EPollArrayWrapper();
+            pollWrapper.initInterrupt(fd0, fd1);
+            fdToKey = new HashMap<>();
+        } catch (Throwable t) {
+            try {
+                FileDispatcherImpl.closeIntFD(fd0);
+            } catch (IOException ioe0) {
+                t.addSuppressed(ioe0);
+            }
+            try {
+                FileDispatcherImpl.closeIntFD(fd1);
+            } catch (IOException ioe1) {
+                t.addSuppressed(ioe1);
+            }
+            throw t;
+        }
     }
 
     protected int doSelect(long timeout) throws IOException {
--- a/jdk/src/java.base/macosx/classes/sun/nio/ch/KQueueSelectorImpl.java	Tue Oct 06 08:43:02 2015 -0700
+++ b/jdk/src/java.base/macosx/classes/sun/nio/ch/KQueueSelectorImpl.java	Wed Jul 05 20:52:10 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2015, 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,10 +84,24 @@
         long fds = IOUtil.makePipe(false);
         fd0 = (int)(fds >>> 32);
         fd1 = (int)fds;
-        kqueueWrapper = new KQueueArrayWrapper();
-        kqueueWrapper.initInterrupt(fd0, fd1);
-        fdMap = new HashMap<>();
-        totalChannels = 1;
+        try {
+            kqueueWrapper = new KQueueArrayWrapper();
+            kqueueWrapper.initInterrupt(fd0, fd1);
+            fdMap = new HashMap<>();
+            totalChannels = 1;
+        } catch (Throwable t) {
+            try {
+                FileDispatcherImpl.closeIntFD(fd0);
+            } catch (IOException ioe0) {
+                t.addSuppressed(ioe0);
+            }
+            try {
+                FileDispatcherImpl.closeIntFD(fd1);
+            } catch (IOException ioe1) {
+                t.addSuppressed(ioe1);
+            }
+            throw t;
+        }
     }
 
 
--- a/jdk/src/java.base/share/classes/com/sun/java/util/jar/pack/PackerImpl.java	Tue Oct 06 08:43:02 2015 -0700
+++ b/jdk/src/java.base/share/classes/com/sun/java/util/jar/pack/PackerImpl.java	Wed Jul 05 20:52:10 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2015, 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
@@ -34,6 +34,7 @@
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.OutputStream;
+import java.time.ZoneOffset;
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.HashMap;
@@ -41,7 +42,6 @@
 import java.util.ListIterator;
 import java.util.Map;
 import java.util.SortedMap;
-import java.util.TimeZone;
 import java.util.jar.JarEntry;
 import java.util.jar.JarFile;
 import java.util.jar.JarInputStream;
@@ -84,13 +84,8 @@
      */
     public synchronized void pack(JarFile in, OutputStream out) throws IOException {
         assert(Utils.currentInstance.get() == null);
-        TimeZone tz = (props.getBoolean(Utils.PACK_DEFAULT_TIMEZONE))
-                      ? null
-                      : TimeZone.getDefault();
         try {
             Utils.currentInstance.set(this);
-            if (tz != null) TimeZone.setDefault(TimeZone.getTimeZone("UTC"));
-
             if ("0".equals(props.getProperty(Pack200.Packer.EFFORT))) {
                 Utils.copyJarFile(in, out);
             } else {
@@ -98,7 +93,6 @@
             }
         } finally {
             Utils.currentInstance.set(null);
-            if (tz != null) TimeZone.setDefault(tz);
             in.close();
         }
     }
@@ -119,11 +113,8 @@
      */
     public synchronized void pack(JarInputStream in, OutputStream out) throws IOException {
         assert(Utils.currentInstance.get() == null);
-        TimeZone tz = (props.getBoolean(Utils.PACK_DEFAULT_TIMEZONE)) ? null :
-            TimeZone.getDefault();
         try {
             Utils.currentInstance.set(this);
-            if (tz != null) TimeZone.setDefault(TimeZone.getTimeZone("UTC"));
             if ("0".equals(props.getProperty(Pack200.Packer.EFFORT))) {
                 Utils.copyJarFile(in, out);
             } else {
@@ -131,7 +122,6 @@
             }
         } finally {
             Utils.currentInstance.set(null);
-            if (tz != null) TimeZone.setDefault(tz);
             in.close();
         }
     }
@@ -327,7 +317,9 @@
                 this.f = null;
                 this.jf = jf;
                 this.je = je;
-                int timeSecs = getModtime(je.getTime());
+                int timeSecs = (int) je.getTimeLocal()
+                        .atOffset(ZoneOffset.UTC)
+                        .toEpochSecond();
                 if (keepModtime && timeSecs != Constants.NO_MODTIME) {
                      this.modtime = timeSecs;
                 } else if (latestModtime && timeSecs > pkg.default_modtime) {
--- a/jdk/src/java.base/share/classes/com/sun/java/util/jar/pack/PropMap.java	Tue Oct 06 08:43:02 2015 -0700
+++ b/jdk/src/java.base/share/classes/com/sun/java/util/jar/pack/PropMap.java	Wed Jul 05 20:52:10 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2015, 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
@@ -69,10 +69,6 @@
         props.put(Utils.DEBUG_VERBOSE,
                   String.valueOf(Integer.getInteger(Utils.DEBUG_VERBOSE,0)));
 
-        // Set the PACK_TIMEZONE_NO_UTC
-        props.put(Utils.PACK_DEFAULT_TIMEZONE,
-                  String.valueOf(Boolean.getBoolean(Utils.PACK_DEFAULT_TIMEZONE)));
-
         // The segment size is unlimited
         props.put(Pack200.Packer.SEGMENT_LIMIT, "-1");
 
--- a/jdk/src/java.base/share/classes/com/sun/java/util/jar/pack/UnpackerImpl.java	Tue Oct 06 08:43:02 2015 -0700
+++ b/jdk/src/java.base/share/classes/com/sun/java/util/jar/pack/UnpackerImpl.java	Wed Jul 05 20:52:10 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2015, 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,10 +32,11 @@
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.OutputStream;
+import java.time.LocalDateTime;
+import java.time.ZoneOffset;
 import java.util.HashSet;
 import java.util.Set;
 import java.util.SortedMap;
-import java.util.TimeZone;
 import java.util.jar.JarEntry;
 import java.util.jar.JarInputStream;
 import java.util.jar.JarOutputStream;
@@ -95,13 +96,9 @@
             throw new NullPointerException("null output");
         }
         assert(Utils.currentInstance.get() == null);
-        TimeZone tz = (props.getBoolean(Utils.PACK_DEFAULT_TIMEZONE))
-                      ? null
-                      : TimeZone.getDefault();
 
         try {
             Utils.currentInstance.set(this);
-            if (tz != null) TimeZone.setDefault(TimeZone.getTimeZone("UTC"));
             final int verbose = props.getInteger(Utils.DEBUG_VERBOSE);
             BufferedInputStream in0 = new BufferedInputStream(in);
             if (Utils.isJarMagic(Utils.readMagic(in0))) {
@@ -125,7 +122,6 @@
         } finally {
             _nunp = null;
             Utils.currentInstance.set(null);
-            if (tz != null) TimeZone.setDefault(tz);
         }
     }
 
@@ -246,9 +242,9 @@
                     je.setCrc(crc.getValue());
                 }
                 if (keepModtime) {
-                    je.setTime(file.modtime);
-                    // Convert back to milliseconds
-                    je.setTime((long)file.modtime * 1000);
+                    LocalDateTime ldt = LocalDateTime
+                            .ofEpochSecond(file.modtime, 0, ZoneOffset.UTC);
+                    je.setTimeLocal(ldt);
                 } else {
                     je.setTime((long)modtime * 1000);
                 }
--- a/jdk/src/java.base/share/classes/com/sun/java/util/jar/pack/Utils.java	Tue Oct 06 08:43:02 2015 -0700
+++ b/jdk/src/java.base/share/classes/com/sun/java/util/jar/pack/Utils.java	Wed Jul 05 20:52:10 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2015, 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,13 +62,6 @@
     static final String DEBUG_DISABLE_NATIVE = COM_PREFIX+"disable.native";
 
     /*
-     * Use the default working TimeZone instead of UTC.
-     * Note: This has installer unpacker implications.
-     * see: zip.cpp which uses gmtime vs. localtime.
-     */
-    static final String PACK_DEFAULT_TIMEZONE = COM_PREFIX+"default.timezone";
-
-    /*
      * Property indicating that the unpacker should
      * ignore the transmitted PACK_MODIFICATION_TIME,
      * replacing it by the given value. The value can
--- a/jdk/src/java.base/share/classes/com/sun/security/ntlm/NTLM.java	Tue Oct 06 08:43:02 2015 -0700
+++ b/jdk/src/java.base/share/classes/com/sun/security/ntlm/NTLM.java	Wed Jul 05 20:52:10 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2015, 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
@@ -56,7 +56,9 @@
     private final Mac hmac;
     private final MessageDigest md5;
     private static final boolean DEBUG =
-            System.getProperty("ntlm.debug") != null;
+            java.security.AccessController.doPrivileged(
+                    new sun.security.action.GetBooleanAction("ntlm.debug"))
+                        .booleanValue();
 
     final Version v;
 
--- a/jdk/src/java.base/share/classes/java/io/Console.java	Tue Oct 06 08:43:02 2015 -0700
+++ b/jdk/src/java.base/share/classes/java/io/Console.java	Wed Jul 05 20:52:10 2017 +0200
@@ -27,6 +27,8 @@
 
 import java.util.*;
 import java.nio.charset.Charset;
+import jdk.internal.misc.JavaIOAccess;
+import jdk.internal.misc.SharedSecrets;
 import sun.nio.cs.StreamDecoder;
 import sun.nio.cs.StreamEncoder;
 
@@ -519,7 +521,7 @@
         try {
             // Add a shutdown hook to restore console's echo state should
             // it be necessary.
-            sun.misc.SharedSecrets.getJavaLangAccess()
+            SharedSecrets.getJavaLangAccess()
                 .registerShutdownHook(0 /* shutdown hook invocation order */,
                     false /* only register if shutdown is not in progress */,
                     new Runnable() {
@@ -536,7 +538,7 @@
             // by a shutdown hook
         }
 
-        sun.misc.SharedSecrets.setJavaIOAccess(new sun.misc.JavaIOAccess() {
+        SharedSecrets.setJavaIOAccess(new JavaIOAccess() {
             public Console console() {
                 if (istty()) {
                     if (cons == null)
--- a/jdk/src/java.base/share/classes/java/io/DeleteOnExitHook.java	Tue Oct 06 08:43:02 2015 -0700
+++ b/jdk/src/java.base/share/classes/java/io/DeleteOnExitHook.java	Wed Jul 05 20:52:10 2017 +0200
@@ -26,6 +26,7 @@
 
 import java.util.*;
 import java.io.File;
+import jdk.internal.misc.SharedSecrets;
 
 /**
  * This class holds a set of filenames to be deleted on VM exit through a shutdown hook.
@@ -41,7 +42,7 @@
         // delete on exit list and cause the DeleteOnExitHook to be
         // registered during shutdown in progress. So set the
         // registerShutdownInProgress parameter to true.
-        sun.misc.SharedSecrets.getJavaLangAccess()
+        SharedSecrets.getJavaLangAccess()
             .registerShutdownHook(2 /* Shutdown hook invocation order */,
                 true /* register even if shutdown in progress */,
                 new Runnable() {
--- a/jdk/src/java.base/share/classes/java/io/FileOutputStream.java	Tue Oct 06 08:43:02 2015 -0700
+++ b/jdk/src/java.base/share/classes/java/io/FileOutputStream.java	Wed Jul 05 20:52:10 2017 +0200
@@ -27,8 +27,8 @@
 
 import java.nio.channels.FileChannel;
 import java.util.concurrent.atomic.AtomicBoolean;
-import sun.misc.SharedSecrets;
-import sun.misc.JavaIOFileDescriptorAccess;
+import jdk.internal.misc.SharedSecrets;
+import jdk.internal.misc.JavaIOFileDescriptorAccess;
 import sun.nio.ch.FileChannelImpl;
 
 
--- a/jdk/src/java.base/share/classes/java/lang/FdLibm.java	Tue Oct 06 08:43:02 2015 -0700
+++ b/jdk/src/java.base/share/classes/java/lang/FdLibm.java	Wed Jul 05 20:52:10 2017 +0200
@@ -352,15 +352,15 @@
 
             double p_h, p_l, t1, t2;
             // |y| is huge
-            if (y_abs > 0x1.0p31) { // if |y| > 2**31
+            if (y_abs > 0x1.00000_ffff_ffffp31) { // if |y| > ~2**31
                 final double INV_LN2   =  0x1.7154_7652_b82fep0;   //  1.44269504088896338700e+00 = 1/ln2
                 final double INV_LN2_H =  0x1.715476p0;            //  1.44269502162933349609e+00 = 24 bits of 1/ln2
                 final double INV_LN2_L =  0x1.4ae0_bf85_ddf44p-26; //  1.92596299112661746887e-08 = 1/ln2 tail
 
                 // Over/underflow if x is not close to one
-                if (x_abs < 0x1.fffffp-1) // |x| < 0.9999995231628418
+                if (x_abs < 0x1.fffff_0000_0000p-1) // |x| < ~0.9999995231628418
                     return (y < 0.0) ? s * INFINITY : s * 0.0;
-                if (x_abs > 1.0)         // |x| > 1.0
+                if (x_abs > 0x1.00000_ffff_ffffp0)         // |x| > ~1.0
                     return (y > 0.0) ? s * INFINITY : s * 0.0;
                 /*
                  * now |1-x| is tiny <= 2**-20, sufficient to compute
--- a/jdk/src/java.base/share/classes/java/lang/System.java	Tue Oct 06 08:43:02 2015 -0700
+++ b/jdk/src/java.base/share/classes/java/lang/System.java	Wed Jul 05 20:52:10 2017 +0200
@@ -43,6 +43,8 @@
 import sun.security.util.SecurityConstants;
 import sun.reflect.annotation.AnnotationType;
 import jdk.internal.HotSpotIntrinsicCandidate;
+import jdk.internal.misc.JavaLangAccess;;
+import jdk.internal.misc.SharedSecrets;;
 
 /**
  * The <code>System</code> class contains several useful class fields
@@ -212,7 +214,7 @@
      public static Console console() {
          if (cons == null) {
              synchronized (System.class) {
-                 cons = sun.misc.SharedSecrets.getJavaIOAccess().console();
+                 cons = SharedSecrets.getJavaIOAccess().console();
              }
          }
          return cons;
@@ -1216,7 +1218,7 @@
 
     private static void setJavaLangAccess() {
         // Allow privileged classes outside of java.lang
-        sun.misc.SharedSecrets.setJavaLangAccess(new sun.misc.JavaLangAccess(){
+        SharedSecrets.setJavaLangAccess(new JavaLangAccess(){
             public sun.reflect.ConstantPool getConstantPool(Class<?> klass) {
                 return klass.getConstantPool();
             }
--- a/jdk/src/java.base/share/classes/java/lang/Thread.java	Tue Oct 06 08:43:02 2015 -0700
+++ b/jdk/src/java.base/share/classes/java/lang/Thread.java	Wed Jul 05 20:52:10 2017 +0200
@@ -233,7 +233,8 @@
     private volatile Interruptible blocker;
     private final Object blockerLock = new Object();
 
-    /* Set the blocker field; invoked via sun.misc.SharedSecrets from java.nio code
+    /* Set the blocker field; invoked via jdk.internal.misc.SharedSecrets
+     * from java.nio code
      */
     void blockedOn(Interruptible b) {
         synchronized (blockerLock) {
--- a/jdk/src/java.base/share/classes/java/lang/ref/Finalizer.java	Tue Oct 06 08:43:02 2015 -0700
+++ b/jdk/src/java.base/share/classes/java/lang/ref/Finalizer.java	Wed Jul 05 20:52:10 2017 +0200
@@ -27,9 +27,9 @@
 
 import java.security.PrivilegedAction;
 import java.security.AccessController;
-import sun.misc.JavaLangAccess;
+import jdk.internal.misc.JavaLangAccess;
+import jdk.internal.misc.SharedSecrets;
 import sun.misc.ManagedLocalsThread;
-import sun.misc.SharedSecrets;
 import sun.misc.VM;
 
 final class Finalizer extends FinalReference<Object> { /* Package-private; must be in
--- a/jdk/src/java.base/share/classes/java/lang/ref/Reference.java	Tue Oct 06 08:43:02 2015 -0700
+++ b/jdk/src/java.base/share/classes/java/lang/ref/Reference.java	Wed Jul 05 20:52:10 2017 +0200
@@ -26,10 +26,10 @@
 package java.lang.ref;
 
 import sun.misc.Cleaner;
-import sun.misc.JavaLangRefAccess;
+import jdk.internal.HotSpotIntrinsicCandidate;
+import jdk.internal.misc.JavaLangRefAccess;
+import jdk.internal.misc.SharedSecrets;
 import sun.misc.ManagedLocalsThread;
-import sun.misc.SharedSecrets;
-import jdk.internal.HotSpotIntrinsicCandidate;
 
 /**
  * Abstract base class for reference objects.  This class defines the
--- a/jdk/src/java.base/share/classes/java/lang/reflect/Constructor.java	Tue Oct 06 08:43:02 2015 -0700
+++ b/jdk/src/java.base/share/classes/java/lang/reflect/Constructor.java	Wed Jul 05 20:52:10 2017 +0200
@@ -25,6 +25,7 @@
 
 package java.lang.reflect;
 
+import jdk.internal.misc.SharedSecrets;
 import sun.reflect.CallerSensitive;
 import sun.reflect.ConstructorAccessor;
 import sun.reflect.Reflection;
@@ -582,7 +583,7 @@
 
         // A Constructor for an inner class
         return TypeAnnotationParser.buildAnnotatedType(getTypeAnnotationBytes0(),
-                sun.misc.SharedSecrets.getJavaLangAccess().
+                SharedSecrets.getJavaLangAccess().
                     getConstantPool(thisDeclClass),
                 this,
                 thisDeclClass,
--- a/jdk/src/java.base/share/classes/java/lang/reflect/Executable.java	Tue Oct 06 08:43:02 2015 -0700
+++ b/jdk/src/java.base/share/classes/java/lang/reflect/Executable.java	Wed Jul 05 20:52:10 2017 +0200
@@ -28,6 +28,8 @@
 import java.lang.annotation.*;
 import java.util.Map;
 import java.util.Objects;
+
+import jdk.internal.misc.SharedSecrets;
 import sun.reflect.annotation.AnnotationParser;
 import sun.reflect.annotation.AnnotationSupport;
 import sun.reflect.annotation.TypeAnnotationParser;
@@ -79,7 +81,7 @@
     Annotation[][] parseParameterAnnotations(byte[] parameterAnnotations) {
         return AnnotationParser.parseParameterAnnotations(
                parameterAnnotations,
-               sun.misc.SharedSecrets.getJavaLangAccess().
+               SharedSecrets.getJavaLangAccess().
                getConstantPool(getDeclaringClass()),
                getDeclaringClass());
     }
@@ -601,7 +603,7 @@
                     } else {
                         declAnnos = AnnotationParser.parseAnnotations(
                                 getAnnotationBytes(),
-                                sun.misc.SharedSecrets.getJavaLangAccess().
+                                SharedSecrets.getJavaLangAccess().
                                         getConstantPool(getDeclaringClass()),
                                 getDeclaringClass()
                         );
@@ -638,7 +640,7 @@
      */
     AnnotatedType getAnnotatedReturnType0(Type returnType) {
         return TypeAnnotationParser.buildAnnotatedType(getTypeAnnotationBytes0(),
-                sun.misc.SharedSecrets.getJavaLangAccess().
+                SharedSecrets.getJavaLangAccess().
                         getConstantPool(getDeclaringClass()),
                 this,
                 getDeclaringClass(),
@@ -672,7 +674,7 @@
         if (Modifier.isStatic(this.getModifiers()))
             return null;
         return TypeAnnotationParser.buildAnnotatedType(getTypeAnnotationBytes0(),
-                sun.misc.SharedSecrets.getJavaLangAccess().
+                SharedSecrets.getJavaLangAccess().
                         getConstantPool(getDeclaringClass()),
                 this,
                 getDeclaringClass(),
@@ -696,7 +698,7 @@
      */
     public AnnotatedType[] getAnnotatedParameterTypes() {
         return TypeAnnotationParser.buildAnnotatedTypes(getTypeAnnotationBytes0(),
-                sun.misc.SharedSecrets.getJavaLangAccess().
+                SharedSecrets.getJavaLangAccess().
                         getConstantPool(getDeclaringClass()),
                 this,
                 getDeclaringClass(),
@@ -720,7 +722,7 @@
      */
     public AnnotatedType[] getAnnotatedExceptionTypes() {
         return TypeAnnotationParser.buildAnnotatedTypes(getTypeAnnotationBytes0(),
-                sun.misc.SharedSecrets.getJavaLangAccess().
+                SharedSecrets.getJavaLangAccess().
                         getConstantPool(getDeclaringClass()),
                 this,
                 getDeclaringClass(),
--- a/jdk/src/java.base/share/classes/java/lang/reflect/Field.java	Tue Oct 06 08:43:02 2015 -0700
+++ b/jdk/src/java.base/share/classes/java/lang/reflect/Field.java	Wed Jul 05 20:52:10 2017 +0200
@@ -25,6 +25,7 @@
 
 package java.lang.reflect;
 
+import jdk.internal.misc.SharedSecrets;
 import sun.reflect.CallerSensitive;
 import sun.reflect.FieldAccessor;
 import sun.reflect.Reflection;
@@ -1152,7 +1153,7 @@
                     } else {
                         declAnnos = AnnotationParser.parseAnnotations(
                                 annotations,
-                                sun.misc.SharedSecrets.getJavaLangAccess()
+                                SharedSecrets.getJavaLangAccess()
                                         .getConstantPool(getDeclaringClass()),
                                 getDeclaringClass());
                     }
@@ -1175,7 +1176,7 @@
      */
     public AnnotatedType getAnnotatedType() {
         return TypeAnnotationParser.buildAnnotatedType(getTypeAnnotationBytes0(),
-                                                       sun.misc.SharedSecrets.getJavaLangAccess().
+                                                       SharedSecrets.getJavaLangAccess().
                                                            getConstantPool(getDeclaringClass()),
                                                        this,
                                                        getDeclaringClass(),
--- a/jdk/src/java.base/share/classes/java/lang/reflect/Method.java	Tue Oct 06 08:43:02 2015 -0700
+++ b/jdk/src/java.base/share/classes/java/lang/reflect/Method.java	Wed Jul 05 20:52:10 2017 +0200
@@ -26,6 +26,7 @@
 package java.lang.reflect;
 
 import jdk.internal.HotSpotIntrinsicCandidate;
+import jdk.internal.misc.SharedSecrets;
 import sun.reflect.CallerSensitive;
 import sun.reflect.MethodAccessor;
 import sun.reflect.Reflection;
@@ -626,7 +627,7 @@
             getReturnType());
         Object result = AnnotationParser.parseMemberValue(
             memberType, ByteBuffer.wrap(annotationDefault),
-            sun.misc.SharedSecrets.getJavaLangAccess().
+            SharedSecrets.getJavaLangAccess().
                 getConstantPool(getDeclaringClass()),
             getDeclaringClass());
         if (result instanceof sun.reflect.annotation.ExceptionProxy)
--- a/jdk/src/java.base/share/classes/java/net/HttpCookie.java	Tue Oct 06 08:43:02 2015 -0700
+++ b/jdk/src/java.base/share/classes/java/net/HttpCookie.java	Wed Jul 05 20:52:10 2017 +0200
@@ -35,6 +35,8 @@
 import java.util.Date;
 import java.util.Locale;
 import java.util.Objects;
+import jdk.internal.misc.JavaNetHttpCookieAccess;
+import jdk.internal.misc.SharedSecrets;
 
 /**
  * An HttpCookie object represents an HTTP cookie, which carries state
@@ -971,8 +973,8 @@
     }
 
     static {
-        sun.misc.SharedSecrets.setJavaNetHttpCookieAccess(
-            new sun.misc.JavaNetHttpCookieAccess() {
+        SharedSecrets.setJavaNetHttpCookieAccess(
+            new JavaNetHttpCookieAccess() {
                 public List<HttpCookie> parse(String header) {
                     return HttpCookie.parse(header, true);
                 }
--- a/jdk/src/java.base/share/classes/java/net/InetAddress.java	Tue Oct 06 08:43:02 2015 -0700
+++ b/jdk/src/java.base/share/classes/java/net/InetAddress.java	Wed Jul 05 20:52:10 2017 +0200
@@ -43,6 +43,8 @@
 import java.util.concurrent.ConcurrentSkipListSet;
 import java.util.concurrent.atomic.AtomicLong;
 
+import jdk.internal.misc.JavaNetInetAddressAccess;
+import jdk.internal.misc.SharedSecrets;
 import sun.security.action.*;
 import sun.net.InetAddressCachePolicy;
 import sun.net.util.IPAddressUtil;
@@ -215,7 +217,7 @@
          * DNS forging.
          *
          * Oracle JSSE provider is using this original hostname, via
-         * sun.misc.JavaNetAccess, for SSL/TLS endpoint identification.
+         * jdk.internal.misc.JavaNetAccess, for SSL/TLS endpoint identification.
          *
          * Note: May define a new public method in the future if necessary.
          */
@@ -297,8 +299,8 @@
                     return null;
                 }
             });
-        sun.misc.SharedSecrets.setJavaNetInetAddressAccess(
-                new sun.misc.JavaNetInetAddressAccess() {
+        SharedSecrets.setJavaNetInetAddressAccess(
+                new JavaNetInetAddressAccess() {
                     public String getOriginalHostName(InetAddress ia) {
                         return ia.holder.getOriginalHostName();
                     }
--- a/jdk/src/java.base/share/classes/java/net/URLClassLoader.java	Tue Oct 06 08:43:02 2015 -0700
+++ b/jdk/src/java.base/share/classes/java/net/URLClassLoader.java	Wed Jul 05 20:52:10 2017 +0200
@@ -49,6 +49,9 @@
 import java.util.jar.Attributes.Name;
 import java.util.jar.JarFile;
 import java.util.jar.Manifest;
+
+import jdk.internal.misc.JavaNetAccess;
+import jdk.internal.misc.SharedSecrets;
 import sun.misc.Resource;
 import sun.misc.URLClassPath;
 import sun.net.www.ParseUtil;
@@ -769,9 +772,9 @@
     }
 
     static {
-        sun.misc.SharedSecrets.setJavaNetAccess (
-            new sun.misc.JavaNetAccess() {
-                public URLClassPath getURLClassPath (URLClassLoader u) {
+        SharedSecrets.setJavaNetAccess(
+            new JavaNetAccess() {
+                public URLClassPath getURLClassPath(URLClassLoader u) {
                     return u.ucp;
                 }
             }
--- a/jdk/src/java.base/share/classes/java/nio/Bits.java	Tue Oct 06 08:43:02 2015 -0700
+++ b/jdk/src/java.base/share/classes/java/nio/Bits.java	Wed Jul 05 20:52:10 2017 +0200
@@ -29,8 +29,9 @@
 import java.util.concurrent.atomic.AtomicLong;
 import java.util.concurrent.atomic.LongAdder;
 
-import sun.misc.JavaLangRefAccess;
-import sun.misc.SharedSecrets;
+import jdk.internal.misc.JavaNioAccess;
+import jdk.internal.misc.JavaLangRefAccess;
+import jdk.internal.misc.SharedSecrets;
 import sun.misc.Unsafe;
 import sun.misc.VM;
 
@@ -702,11 +703,11 @@
 
     static {
         // setup access to this package in SharedSecrets
-        sun.misc.SharedSecrets.setJavaNioAccess(
-            new sun.misc.JavaNioAccess() {
+        SharedSecrets.setJavaNioAccess(
+            new JavaNioAccess() {
                 @Override
-                public sun.misc.JavaNioAccess.BufferPool getDirectBufferPool() {
-                    return new sun.misc.JavaNioAccess.BufferPool() {
+                public JavaNioAccess.BufferPool getDirectBufferPool() {
+                    return new JavaNioAccess.BufferPool() {
                         @Override
                         public String getName() {
                             return "direct";
--- a/jdk/src/java.base/share/classes/java/nio/channels/spi/AbstractInterruptibleChannel.java	Tue Oct 06 08:43:02 2015 -0700
+++ b/jdk/src/java.base/share/classes/java/nio/channels/spi/AbstractInterruptibleChannel.java	Wed Jul 05 20:52:10 2017 +0200
@@ -34,6 +34,7 @@
 import java.nio.channels.*;
 import java.security.AccessController;
 import java.security.PrivilegedAction;
+import jdk.internal.misc.SharedSecrets;
 import sun.nio.ch.Interruptible;
 
 
@@ -206,9 +207,8 @@
     }
 
 
-    // -- sun.misc.SharedSecrets --
+    // -- jdk.internal.misc.SharedSecrets --
     static void blockedOn(Interruptible intr) {         // package-private
-        sun.misc.SharedSecrets.getJavaLangAccess().blockedOn(Thread.currentThread(),
-                                                             intr);
+        SharedSecrets.getJavaLangAccess().blockedOn(Thread.currentThread(), intr);
     }
 }
--- a/jdk/src/java.base/share/classes/java/security/ProtectionDomain.java	Tue Oct 06 08:43:02 2015 -0700
+++ b/jdk/src/java.base/share/classes/java/security/ProtectionDomain.java	Wed Jul 05 20:52:10 2017 +0200
@@ -34,10 +34,10 @@
 import java.util.Map;
 import java.util.WeakHashMap;
 import java.util.concurrent.ConcurrentHashMap;
-import sun.misc.JavaSecurityAccess;
-import sun.misc.JavaSecurityProtectionDomainAccess;
-import static sun.misc.JavaSecurityProtectionDomainAccess.ProtectionDomainCache;
-import sun.misc.SharedSecrets;
+import jdk.internal.misc.JavaSecurityAccess;
+import jdk.internal.misc.JavaSecurityProtectionDomainAccess;
+import static jdk.internal.misc.JavaSecurityProtectionDomainAccess.ProtectionDomainCache;
+import jdk.internal.misc.SharedSecrets;
 import sun.security.util.Debug;
 import sun.security.util.SecurityConstants;
 
--- a/jdk/src/java.base/share/classes/java/text/SimpleDateFormat.java	Tue Oct 06 08:43:02 2015 -0700
+++ b/jdk/src/java.base/share/classes/java/text/SimpleDateFormat.java	Wed Jul 05 20:52:10 2017 +0200
@@ -1722,7 +1722,7 @@
             }
             return (start + zoneNames[nameIndex].length());
         }
-        return 0;
+        return -start;
     }
 
     /**
--- a/jdk/src/java.base/share/classes/java/util/EnumMap.java	Tue Oct 06 08:43:02 2015 -0700
+++ b/jdk/src/java.base/share/classes/java/util/EnumMap.java	Wed Jul 05 20:52:10 2017 +0200
@@ -26,7 +26,7 @@
 package java.util;
 
 import java.util.Map.Entry;
-import sun.misc.SharedSecrets;
+import jdk.internal.misc.SharedSecrets;
 
 /**
  * A specialized {@link Map} implementation for use with enum type keys.  All
--- a/jdk/src/java.base/share/classes/java/util/EnumSet.java	Tue Oct 06 08:43:02 2015 -0700
+++ b/jdk/src/java.base/share/classes/java/util/EnumSet.java	Wed Jul 05 20:52:10 2017 +0200
@@ -25,7 +25,7 @@
 
 package java.util;
 
-import sun.misc.SharedSecrets;
+import jdk.internal.misc.SharedSecrets;
 
 /**
  * A specialized {@link Set} implementation for use with enum types.  All of
--- a/jdk/src/java.base/share/classes/java/util/StringJoiner.java	Tue Oct 06 08:43:02 2015 -0700
+++ b/jdk/src/java.base/share/classes/java/util/StringJoiner.java	Wed Jul 05 20:52:10 2017 +0200
@@ -24,8 +24,8 @@
  */
 package java.util;
 
-import sun.misc.JavaLangAccess;
-import sun.misc.SharedSecrets;
+import jdk.internal.misc.JavaLangAccess;
+import jdk.internal.misc.SharedSecrets;
 
 /**
  * {@code StringJoiner} is used to construct a sequence of characters separated
--- a/jdk/src/java.base/share/classes/java/util/UUID.java	Tue Oct 06 08:43:02 2015 -0700
+++ b/jdk/src/java.base/share/classes/java/util/UUID.java	Wed Jul 05 20:52:10 2017 +0200
@@ -27,8 +27,8 @@
 
 import java.security.*;
 
-import sun.misc.JavaLangAccess;
-import sun.misc.SharedSecrets;
+import jdk.internal.misc.JavaLangAccess;
+import jdk.internal.misc.SharedSecrets;
 
 /**
  * A class that represents an immutable universally unique identifier (UUID).
--- a/jdk/src/java.base/share/classes/java/util/concurrent/atomic/AtomicBoolean.java	Tue Oct 06 08:43:02 2015 -0700
+++ b/jdk/src/java.base/share/classes/java/util/concurrent/atomic/AtomicBoolean.java	Wed Jul 05 20:52:10 2017 +0200
@@ -34,7 +34,6 @@
  */
 
 package java.util.concurrent.atomic;
-import sun.misc.Unsafe;
 
 /**
  * A {@code boolean} value that may be updated atomically. See the
@@ -49,15 +48,17 @@
  */
 public class AtomicBoolean implements java.io.Serializable {
     private static final long serialVersionUID = 4654671469794556979L;
-    // setup to use Unsafe.compareAndSwapInt for updates
-    private static final Unsafe unsafe = Unsafe.getUnsafe();
-    private static final long valueOffset;
+
+    private static final sun.misc.Unsafe U = sun.misc.Unsafe.getUnsafe();
+    private static final long VALUE;
 
     static {
         try {
-            valueOffset = unsafe.objectFieldOffset
+            VALUE = U.objectFieldOffset
                 (AtomicBoolean.class.getDeclaredField("value"));
-        } catch (Exception ex) { throw new Error(ex); }
+        } catch (ReflectiveOperationException e) {
+            throw new Error(e);
+        }
     }
 
     private volatile int value;
@@ -96,9 +97,9 @@
      * the actual value was not equal to the expected value.
      */
     public final boolean compareAndSet(boolean expect, boolean update) {
-        int e = expect ? 1 : 0;
-        int u = update ? 1 : 0;
-        return unsafe.compareAndSwapInt(this, valueOffset, e, u);
+        return U.compareAndSwapInt(this, VALUE,
+                                   (expect ? 1 : 0),
+                                   (update ? 1 : 0));
     }
 
     /**
@@ -114,9 +115,9 @@
      * @return {@code true} if successful
      */
     public boolean weakCompareAndSet(boolean expect, boolean update) {
-        int e = expect ? 1 : 0;
-        int u = update ? 1 : 0;
-        return unsafe.compareAndSwapInt(this, valueOffset, e, u);
+        return U.compareAndSwapInt(this, VALUE,
+                                   (expect ? 1 : 0),
+                                   (update ? 1 : 0));
     }
 
     /**
@@ -135,8 +136,7 @@
      * @since 1.6
      */
     public final void lazySet(boolean newValue) {
-        int v = newValue ? 1 : 0;
-        unsafe.putOrderedInt(this, valueOffset, v);
+        U.putOrderedInt(this, VALUE, (newValue ? 1 : 0));
     }
 
     /**
--- a/jdk/src/java.base/share/classes/java/util/concurrent/atomic/AtomicInteger.java	Tue Oct 06 08:43:02 2015 -0700
+++ b/jdk/src/java.base/share/classes/java/util/concurrent/atomic/AtomicInteger.java	Wed Jul 05 20:52:10 2017 +0200
@@ -34,9 +34,9 @@
  */
 
 package java.util.concurrent.atomic;
+
+import java.util.function.IntBinaryOperator;
 import java.util.function.IntUnaryOperator;
-import java.util.function.IntBinaryOperator;
-import sun.misc.Unsafe;
 
 /**
  * An {@code int} value that may be updated atomically.  See the
@@ -50,19 +50,20 @@
  *
  * @since 1.5
  * @author Doug Lea
-*/
+ */
 public class AtomicInteger extends Number implements java.io.Serializable {
     private static final long serialVersionUID = 6214790243416807050L;
 
-    // setup to use Unsafe.compareAndSwapInt for updates
-    private static final Unsafe unsafe = Unsafe.getUnsafe();
-    private static final long valueOffset;
+    private static final sun.misc.Unsafe U = sun.misc.Unsafe.getUnsafe();
+    private static final long VALUE;
 
     static {
         try {
-            valueOffset = unsafe.objectFieldOffset
+            VALUE = U.objectFieldOffset
                 (AtomicInteger.class.getDeclaredField("value"));
-        } catch (Exception ex) { throw new Error(ex); }
+        } catch (ReflectiveOperationException e) {
+            throw new Error(e);
+        }
     }
 
     private volatile int value;
@@ -107,7 +108,7 @@
      * @since 1.6
      */
     public final void lazySet(int newValue) {
-        unsafe.putOrderedInt(this, valueOffset, newValue);
+        U.putOrderedInt(this, VALUE, newValue);
     }
 
     /**
@@ -117,7 +118,7 @@
      * @return the previous value
      */
     public final int getAndSet(int newValue) {
-        return unsafe.getAndSetInt(this, valueOffset, newValue);
+        return U.getAndSetInt(this, VALUE, newValue);
     }
 
     /**
@@ -130,7 +131,7 @@
      * the actual value was not equal to the expected value.
      */
     public final boolean compareAndSet(int expect, int update) {
-        return unsafe.compareAndSwapInt(this, valueOffset, expect, update);
+        return U.compareAndSwapInt(this, VALUE, expect, update);
     }
 
     /**
@@ -146,7 +147,7 @@
      * @return {@code true} if successful
      */
     public final boolean weakCompareAndSet(int expect, int update) {
-        return unsafe.compareAndSwapInt(this, valueOffset, expect, update);
+        return U.compareAndSwapInt(this, VALUE, expect, update);
     }
 
     /**
@@ -155,7 +156,7 @@
      * @return the previous value
      */
     public final int getAndIncrement() {
-        return unsafe.getAndAddInt(this, valueOffset, 1);
+        return U.getAndAddInt(this, VALUE, 1);
     }
 
     /**
@@ -164,7 +165,7 @@
      * @return the previous value
      */
     public final int getAndDecrement() {
-        return unsafe.getAndAddInt(this, valueOffset, -1);
+        return U.getAndAddInt(this, VALUE, -1);
     }
 
     /**
@@ -174,7 +175,7 @@
      * @return the previous value
      */
     public final int getAndAdd(int delta) {
-        return unsafe.getAndAddInt(this, valueOffset, delta);
+        return U.getAndAddInt(this, VALUE, delta);
     }
 
     /**
@@ -183,7 +184,7 @@
      * @return the updated value
      */
     public final int incrementAndGet() {
-        return unsafe.getAndAddInt(this, valueOffset, 1) + 1;
+        return U.getAndAddInt(this, VALUE, 1) + 1;
     }
 
     /**
@@ -192,7 +193,7 @@
      * @return the updated value
      */
     public final int decrementAndGet() {
-        return unsafe.getAndAddInt(this, valueOffset, -1) - 1;
+        return U.getAndAddInt(this, VALUE, -1) - 1;
     }
 
     /**
@@ -202,7 +203,7 @@
      * @return the updated value
      */
     public final int addAndGet(int delta) {
-        return unsafe.getAndAddInt(this, valueOffset, delta) + delta;
+        return U.getAndAddInt(this, VALUE, delta) + delta;
     }
 
     /**
@@ -301,6 +302,7 @@
 
     /**
      * Returns the value of this {@code AtomicInteger} as an {@code int}.
+     * Equivalent to {@link #get()}.
      */
     public int intValue() {
         return get();
--- a/jdk/src/java.base/share/classes/java/util/concurrent/atomic/AtomicIntegerArray.java	Tue Oct 06 08:43:02 2015 -0700
+++ b/jdk/src/java.base/share/classes/java/util/concurrent/atomic/AtomicIntegerArray.java	Wed Jul 05 20:52:10 2017 +0200
@@ -34,9 +34,9 @@
  */
 
 package java.util.concurrent.atomic;
+
+import java.util.function.IntBinaryOperator;
 import java.util.function.IntUnaryOperator;
-import java.util.function.IntBinaryOperator;
-import sun.misc.Unsafe;
 
 /**
  * An {@code int} array in which elements may be updated atomically.
@@ -49,16 +49,17 @@
 public class AtomicIntegerArray implements java.io.Serializable {
     private static final long serialVersionUID = 2862133569453604235L;
 
-    private static final Unsafe unsafe = Unsafe.getUnsafe();
-    private static final int base = unsafe.arrayBaseOffset(int[].class);
-    private static final int shift;
+    private static final sun.misc.Unsafe U = sun.misc.Unsafe.getUnsafe();
+    private static final int ABASE;
+    private static final int ASHIFT;
     private final int[] array;
 
     static {
-        int scale = unsafe.arrayIndexScale(int[].class);
+        ABASE = U.arrayBaseOffset(int[].class);
+        int scale = U.arrayIndexScale(int[].class);
         if ((scale & (scale - 1)) != 0)
-            throw new Error("data type scale not a power of two");
-        shift = 31 - Integer.numberOfLeadingZeros(scale);
+            throw new Error("array index scale not a power of two");
+        ASHIFT = 31 - Integer.numberOfLeadingZeros(scale);
     }
 
     private long checkedByteOffset(int i) {
@@ -69,7 +70,7 @@
     }
 
     private static long byteOffset(int i) {
-        return ((long) i << shift) + base;
+        return ((long) i << ASHIFT) + ABASE;
     }
 
     /**
@@ -114,7 +115,7 @@
     }
 
     private int getRaw(long offset) {
-        return unsafe.getIntVolatile(array, offset);
+        return U.getIntVolatile(array, offset);
     }
 
     /**
@@ -124,7 +125,7 @@
      * @param newValue the new value
      */
     public final void set(int i, int newValue) {
-        unsafe.putIntVolatile(array, checkedByteOffset(i), newValue);
+        U.putIntVolatile(array, checkedByteOffset(i), newValue);
     }
 
     /**
@@ -135,7 +136,7 @@
      * @since 1.6
      */
     public final void lazySet(int i, int newValue) {
-        unsafe.putOrderedInt(array, checkedByteOffset(i), newValue);
+        U.putOrderedInt(array, checkedByteOffset(i), newValue);
     }
 
     /**
@@ -147,7 +148,7 @@
      * @return the previous value
      */
     public final int getAndSet(int i, int newValue) {
-        return unsafe.getAndSetInt(array, checkedByteOffset(i), newValue);
+        return U.getAndSetInt(array, checkedByteOffset(i), newValue);
     }
 
     /**
@@ -165,7 +166,7 @@
     }
 
     private boolean compareAndSetRaw(long offset, int expect, int update) {
-        return unsafe.compareAndSwapInt(array, offset, expect, update);
+        return U.compareAndSwapInt(array, offset, expect, update);
     }
 
     /**
@@ -213,7 +214,7 @@
      * @return the previous value
      */
     public final int getAndAdd(int i, int delta) {
-        return unsafe.getAndAddInt(array, checkedByteOffset(i), delta);
+        return U.getAndAddInt(array, checkedByteOffset(i), delta);
     }
 
     /**
@@ -247,7 +248,6 @@
         return getAndAdd(i, delta) + delta;
     }
 
-
     /**
      * Atomically updates the element at index {@code i} with the results
      * of applying the given function, returning the previous value. The
--- a/jdk/src/java.base/share/classes/java/util/concurrent/atomic/AtomicIntegerFieldUpdater.java	Tue Oct 06 08:43:02 2015 -0700
+++ b/jdk/src/java.base/share/classes/java/util/concurrent/atomic/AtomicIntegerFieldUpdater.java	Wed Jul 05 20:52:10 2017 +0200
@@ -34,14 +34,14 @@
  */
 
 package java.util.concurrent.atomic;
-import java.util.function.IntUnaryOperator;
-import java.util.function.IntBinaryOperator;
-import sun.misc.Unsafe;
+
 import java.lang.reflect.Field;
 import java.lang.reflect.Modifier;
 import java.security.AccessController;
+import java.security.PrivilegedActionException;
 import java.security.PrivilegedExceptionAction;
-import java.security.PrivilegedActionException;
+import java.util.function.IntBinaryOperator;
+import java.util.function.IntUnaryOperator;
 import sun.reflect.CallerSensitive;
 import sun.reflect.Reflection;
 
@@ -363,11 +363,11 @@
     }
 
     /**
-     * Standard hotspot implementation using intrinsics
+     * Standard hotspot implementation using intrinsics.
      */
     private static class AtomicIntegerFieldUpdaterImpl<T>
             extends AtomicIntegerFieldUpdater<T> {
-        private static final Unsafe unsafe = Unsafe.getUnsafe();
+        private static final sun.misc.Unsafe U = sun.misc.Unsafe.getUnsafe();
         private final long offset;
         private final Class<T> tclass;
         private final Class<?> cclass;
@@ -391,7 +391,7 @@
                 ClassLoader ccl = caller.getClassLoader();
                 if ((ccl != null) && (ccl != cl) &&
                     ((cl == null) || !isAncestor(cl, ccl))) {
-                  sun.reflect.misc.ReflectUtil.checkPackageAccess(tclass);
+                    sun.reflect.misc.ReflectUtil.checkPackageAccess(tclass);
                 }
             } catch (PrivilegedActionException pae) {
                 throw new RuntimeException(pae.getException());
@@ -409,7 +409,7 @@
             this.cclass = (Modifier.isProtected(modifiers) &&
                            caller != tclass) ? caller : null;
             this.tclass = tclass;
-            offset = unsafe.objectFieldOffset(field);
+            offset = U.objectFieldOffset(field);
         }
 
         /**
@@ -437,32 +437,32 @@
 
         public boolean compareAndSet(T obj, int expect, int update) {
             if (obj == null || obj.getClass() != tclass || cclass != null) fullCheck(obj);
-            return unsafe.compareAndSwapInt(obj, offset, expect, update);
+            return U.compareAndSwapInt(obj, offset, expect, update);
         }
 
         public boolean weakCompareAndSet(T obj, int expect, int update) {
             if (obj == null || obj.getClass() != tclass || cclass != null) fullCheck(obj);
-            return unsafe.compareAndSwapInt(obj, offset, expect, update);
+            return U.compareAndSwapInt(obj, offset, expect, update);
         }
 
         public void set(T obj, int newValue) {
             if (obj == null || obj.getClass() != tclass || cclass != null) fullCheck(obj);
-            unsafe.putIntVolatile(obj, offset, newValue);
+            U.putIntVolatile(obj, offset, newValue);
         }
 
         public void lazySet(T obj, int newValue) {
             if (obj == null || obj.getClass() != tclass || cclass != null) fullCheck(obj);
-            unsafe.putOrderedInt(obj, offset, newValue);
+            U.putOrderedInt(obj, offset, newValue);
         }
 
         public final int get(T obj) {
             if (obj == null || obj.getClass() != tclass || cclass != null) fullCheck(obj);
-            return unsafe.getIntVolatile(obj, offset);
+            return U.getIntVolatile(obj, offset);
         }
 
         public int getAndSet(T obj, int newValue) {
             if (obj == null || obj.getClass() != tclass || cclass != null) fullCheck(obj);
-            return unsafe.getAndSetInt(obj, offset, newValue);
+            return U.getAndSetInt(obj, offset, newValue);
         }
 
         public int getAndIncrement(T obj) {
@@ -475,7 +475,7 @@
 
         public int getAndAdd(T obj, int delta) {
             if (obj == null || obj.getClass() != tclass || cclass != null) fullCheck(obj);
-            return unsafe.getAndAddInt(obj, offset, delta);
+            return U.getAndAddInt(obj, offset, delta);
         }
 
         public int incrementAndGet(T obj) {
@@ -483,7 +483,7 @@
         }
 
         public int decrementAndGet(T obj) {
-             return getAndAdd(obj, -1) - 1;
+            return getAndAdd(obj, -1) - 1;
         }
 
         public int addAndGet(T obj, int delta) {
--- a/jdk/src/java.base/share/classes/java/util/concurrent/atomic/AtomicLong.java	Tue Oct 06 08:43:02 2015 -0700
+++ b/jdk/src/java.base/share/classes/java/util/concurrent/atomic/AtomicLong.java	Wed Jul 05 20:52:10 2017 +0200
@@ -34,9 +34,9 @@
  */
 
 package java.util.concurrent.atomic;
+
+import java.util.function.LongBinaryOperator;
 import java.util.function.LongUnaryOperator;
-import java.util.function.LongBinaryOperator;
-import sun.misc.Unsafe;
 
 /**
  * A {@code long} value that may be updated atomically.  See the
@@ -54,9 +54,8 @@
 public class AtomicLong extends Number implements java.io.Serializable {
     private static final long serialVersionUID = 1927816293512124184L;
 
-    // setup to use Unsafe.compareAndSwapLong for updates
-    private static final Unsafe unsafe = Unsafe.getUnsafe();
-    private static final long valueOffset;
+    private static final sun.misc.Unsafe U = sun.misc.Unsafe.getUnsafe();
+    private static final long VALUE;
 
     /**
      * Records whether the underlying JVM supports lockless
@@ -74,9 +73,11 @@
 
     static {
         try {
-            valueOffset = unsafe.objectFieldOffset
+            VALUE = U.objectFieldOffset
                 (AtomicLong.class.getDeclaredField("value"));
-        } catch (Exception ex) { throw new Error(ex); }
+        } catch (ReflectiveOperationException e) {
+            throw new Error(e);
+        }
     }
 
     private volatile long value;
@@ -111,7 +112,9 @@
      * @param newValue the new value
      */
     public final void set(long newValue) {
-        value = newValue;
+        // Use putLongVolatile instead of ordinary volatile store when
+        // using compareAndSwapLong, for sake of some 32bit systems.
+        U.putLongVolatile(this, VALUE, newValue);
     }
 
     /**
@@ -121,7 +124,7 @@
      * @since 1.6
      */
     public final void lazySet(long newValue) {
-        unsafe.putOrderedLong(this, valueOffset, newValue);
+        U.putOrderedLong(this, VALUE, newValue);
     }
 
     /**
@@ -131,7 +134,7 @@
      * @return the previous value
      */
     public final long getAndSet(long newValue) {
-        return unsafe.getAndSetLong(this, valueOffset, newValue);
+        return U.getAndSetLong(this, VALUE, newValue);
     }
 
     /**
@@ -144,7 +147,7 @@
      * the actual value was not equal to the expected value.
      */
     public final boolean compareAndSet(long expect, long update) {
-        return unsafe.compareAndSwapLong(this, valueOffset, expect, update);
+        return U.compareAndSwapLong(this, VALUE, expect, update);
     }
 
     /**
@@ -160,7 +163,7 @@
      * @return {@code true} if successful
      */
     public final boolean weakCompareAndSet(long expect, long update) {
-        return unsafe.compareAndSwapLong(this, valueOffset, expect, update);
+        return U.compareAndSwapLong(this, VALUE, expect, update);
     }
 
     /**
@@ -169,7 +172,7 @@
      * @return the previous value
      */
     public final long getAndIncrement() {
-        return unsafe.getAndAddLong(this, valueOffset, 1L);
+        return U.getAndAddLong(this, VALUE, 1L);
     }
 
     /**
@@ -178,7 +181,7 @@
      * @return the previous value
      */
     public final long getAndDecrement() {
-        return unsafe.getAndAddLong(this, valueOffset, -1L);
+        return U.getAndAddLong(this, VALUE, -1L);
     }
 
     /**
@@ -188,7 +191,7 @@
      * @return the previous value
      */
     public final long getAndAdd(long delta) {
-        return unsafe.getAndAddLong(this, valueOffset, delta);
+        return U.getAndAddLong(this, VALUE, delta);
     }
 
     /**
@@ -197,7 +200,7 @@
      * @return the updated value
      */
     public final long incrementAndGet() {
-        return unsafe.getAndAddLong(this, valueOffset, 1L) + 1L;
+        return U.getAndAddLong(this, VALUE, 1L) + 1L;
     }
 
     /**
@@ -206,7 +209,7 @@
      * @return the updated value
      */
     public final long decrementAndGet() {
-        return unsafe.getAndAddLong(this, valueOffset, -1L) - 1L;
+        return U.getAndAddLong(this, VALUE, -1L) - 1L;
     }
 
     /**
@@ -216,7 +219,7 @@
      * @return the updated value
      */
     public final long addAndGet(long delta) {
-        return unsafe.getAndAddLong(this, valueOffset, delta) + delta;
+        return U.getAndAddLong(this, VALUE, delta) + delta;
     }
 
     /**
@@ -324,6 +327,7 @@
 
     /**
      * Returns the value of this {@code AtomicLong} as a {@code long}.
+     * Equivalent to {@link #get()}.
      */
     public long longValue() {
         return get();
--- a/jdk/src/java.base/share/classes/java/util/concurrent/atomic/AtomicLongArray.java	Tue Oct 06 08:43:02 2015 -0700
+++ b/jdk/src/java.base/share/classes/java/util/concurrent/atomic/AtomicLongArray.java	Wed Jul 05 20:52:10 2017 +0200
@@ -34,9 +34,9 @@
  */
 
 package java.util.concurrent.atomic;
+
+import java.util.function.LongBinaryOperator;
 import java.util.function.LongUnaryOperator;
-import java.util.function.LongBinaryOperator;
-import sun.misc.Unsafe;
 
 /**
  * A {@code long} array in which elements may be updated atomically.
@@ -48,16 +48,17 @@
 public class AtomicLongArray implements java.io.Serializable {
     private static final long serialVersionUID = -2308431214976778248L;
 
-    private static final Unsafe unsafe = Unsafe.getUnsafe();
-    private static final int base = unsafe.arrayBaseOffset(long[].class);
-    private static final int shift;
+    private static final sun.misc.Unsafe U = sun.misc.Unsafe.getUnsafe();
+    private static final int ABASE;
+    private static final int ASHIFT;
     private final long[] array;
 
     static {
-        int scale = unsafe.arrayIndexScale(long[].class);
+        ABASE = U.arrayBaseOffset(long[].class);
+        int scale = U.arrayIndexScale(long[].class);
         if ((scale & (scale - 1)) != 0)
-            throw new Error("data type scale not a power of two");
-        shift = 31 - Integer.numberOfLeadingZeros(scale);
+            throw new Error("array index scale not a power of two");
+        ASHIFT = 31 - Integer.numberOfLeadingZeros(scale);
     }
 
     private long checkedByteOffset(int i) {
@@ -68,7 +69,7 @@
     }
 
     private static long byteOffset(int i) {
-        return ((long) i << shift) + base;
+        return ((long) i << ASHIFT) + ABASE;
     }
 
     /**
@@ -113,7 +114,7 @@
     }
 
     private long getRaw(long offset) {
-        return unsafe.getLongVolatile(array, offset);
+        return U.getLongVolatile(array, offset);
     }
 
     /**
@@ -123,7 +124,7 @@
      * @param newValue the new value
      */
     public final void set(int i, long newValue) {
-        unsafe.putLongVolatile(array, checkedByteOffset(i), newValue);
+        U.putLongVolatile(array, checkedByteOffset(i), newValue);
     }
 
     /**
@@ -134,7 +135,7 @@
      * @since 1.6
      */
     public final void lazySet(int i, long newValue) {
-        unsafe.putOrderedLong(array, checkedByteOffset(i), newValue);
+        U.putOrderedLong(array, checkedByteOffset(i), newValue);
     }
 
     /**
@@ -146,7 +147,7 @@
      * @return the previous value
      */
     public final long getAndSet(int i, long newValue) {
-        return unsafe.getAndSetLong(array, checkedByteOffset(i), newValue);
+        return U.getAndSetLong(array, checkedByteOffset(i), newValue);
     }
 
     /**
@@ -164,7 +165,7 @@
     }
 
     private boolean compareAndSetRaw(long offset, long expect, long update) {
-        return unsafe.compareAndSwapLong(array, offset, expect, update);
+        return U.compareAndSwapLong(array, offset, expect, update);
     }
 
     /**
@@ -212,7 +213,7 @@
      * @return the previous value
      */
     public final long getAndAdd(int i, long delta) {
-        return unsafe.getAndAddLong(array, checkedByteOffset(i), delta);
+        return U.getAndAddLong(array, checkedByteOffset(i), delta);
     }
 
     /**
--- a/jdk/src/java.base/share/classes/java/util/concurrent/atomic/AtomicLongFieldUpdater.java	Tue Oct 06 08:43:02 2015 -0700
+++ b/jdk/src/java.base/share/classes/java/util/concurrent/atomic/AtomicLongFieldUpdater.java	Wed Jul 05 20:52:10 2017 +0200
@@ -34,14 +34,14 @@
  */
 
 package java.util.concurrent.atomic;
-import java.util.function.LongUnaryOperator;
-import java.util.function.LongBinaryOperator;
-import sun.misc.Unsafe;
+
 import java.lang.reflect.Field;
 import java.lang.reflect.Modifier;
 import java.security.AccessController;
+import java.security.PrivilegedActionException;
 import java.security.PrivilegedExceptionAction;
-import java.security.PrivilegedActionException;
+import java.util.function.LongBinaryOperator;
+import java.util.function.LongUnaryOperator;
 import sun.reflect.CallerSensitive;
 import sun.reflect.Reflection;
 
@@ -366,7 +366,7 @@
     }
 
     private static class CASUpdater<T> extends AtomicLongFieldUpdater<T> {
-        private static final Unsafe unsafe = Unsafe.getUnsafe();
+        private static final sun.misc.Unsafe U = sun.misc.Unsafe.getUnsafe();
         private final long offset;
         private final Class<T> tclass;
         private final Class<?> cclass;
@@ -389,7 +389,7 @@
                 ClassLoader ccl = caller.getClassLoader();
                 if ((ccl != null) && (ccl != cl) &&
                     ((cl == null) || !isAncestor(cl, ccl))) {
-                  sun.reflect.misc.ReflectUtil.checkPackageAccess(tclass);
+                    sun.reflect.misc.ReflectUtil.checkPackageAccess(tclass);
                 }
             } catch (PrivilegedActionException pae) {
                 throw new RuntimeException(pae.getException());
@@ -407,7 +407,7 @@
             this.cclass = (Modifier.isProtected(modifiers) &&
                            caller != tclass) ? caller : null;
             this.tclass = tclass;
-            offset = unsafe.objectFieldOffset(field);
+            offset = U.objectFieldOffset(field);
         }
 
         private void fullCheck(T obj) {
@@ -419,32 +419,32 @@
 
         public boolean compareAndSet(T obj, long expect, long update) {
             if (obj == null || obj.getClass() != tclass || cclass != null) fullCheck(obj);
-            return unsafe.compareAndSwapLong(obj, offset, expect, update);
+            return U.compareAndSwapLong(obj, offset, expect, update);
         }
 
         public boolean weakCompareAndSet(T obj, long expect, long update) {
             if (obj == null || obj.getClass() != tclass || cclass != null) fullCheck(obj);
-            return unsafe.compareAndSwapLong(obj, offset, expect, update);
+            return U.compareAndSwapLong(obj, offset, expect, update);
         }
 
         public void set(T obj, long newValue) {
             if (obj == null || obj.getClass() != tclass || cclass != null) fullCheck(obj);
-            unsafe.putLongVolatile(obj, offset, newValue);
+            U.putLongVolatile(obj, offset, newValue);
         }
 
         public void lazySet(T obj, long newValue) {
             if (obj == null || obj.getClass() != tclass || cclass != null) fullCheck(obj);
-            unsafe.putOrderedLong(obj, offset, newValue);
+            U.putOrderedLong(obj, offset, newValue);
         }
 
         public long get(T obj) {
             if (obj == null || obj.getClass() != tclass || cclass != null) fullCheck(obj);
-            return unsafe.getLongVolatile(obj, offset);
+            return U.getLongVolatile(obj, offset);
         }
 
         public long getAndSet(T obj, long newValue) {
             if (obj == null || obj.getClass() != tclass || cclass != null) fullCheck(obj);
-            return unsafe.getAndSetLong(obj, offset, newValue);
+            return U.getAndSetLong(obj, offset, newValue);
         }
 
         public long getAndIncrement(T obj) {
@@ -457,7 +457,7 @@
 
         public long getAndAdd(T obj, long delta) {
             if (obj == null || obj.getClass() != tclass || cclass != null) fullCheck(obj);
-            return unsafe.getAndAddLong(obj, offset, delta);
+            return U.getAndAddLong(obj, offset, delta);
         }
 
         public long incrementAndGet(T obj) {
@@ -465,7 +465,7 @@
         }
 
         public long decrementAndGet(T obj) {
-             return getAndAdd(obj, -1) - 1;
+            return getAndAdd(obj, -1) - 1;
         }
 
         public long addAndGet(T obj, long delta) {
@@ -490,7 +490,7 @@
 
 
     private static class LockedUpdater<T> extends AtomicLongFieldUpdater<T> {
-        private static final Unsafe unsafe = Unsafe.getUnsafe();
+        private static final sun.misc.Unsafe U = sun.misc.Unsafe.getUnsafe();
         private final long offset;
         private final Class<T> tclass;
         private final Class<?> cclass;
@@ -513,7 +513,7 @@
                 ClassLoader ccl = caller.getClassLoader();
                 if ((ccl != null) && (ccl != cl) &&
                     ((cl == null) || !isAncestor(cl, ccl))) {
-                  sun.reflect.misc.ReflectUtil.checkPackageAccess(tclass);
+                    sun.reflect.misc.ReflectUtil.checkPackageAccess(tclass);
                 }
             } catch (PrivilegedActionException pae) {
                 throw new RuntimeException(pae.getException());
@@ -531,7 +531,7 @@
             this.cclass = (Modifier.isProtected(modifiers) &&
                            caller != tclass) ? caller : null;
             this.tclass = tclass;
-            offset = unsafe.objectFieldOffset(field);
+            offset = U.objectFieldOffset(field);
         }
 
         private void fullCheck(T obj) {
@@ -544,10 +544,10 @@
         public boolean compareAndSet(T obj, long expect, long update) {
             if (obj == null || obj.getClass() != tclass || cclass != null) fullCheck(obj);
             synchronized (this) {
-                long v = unsafe.getLong(obj, offset);
+                long v = U.getLong(obj, offset);
                 if (v != expect)
                     return false;
-                unsafe.putLong(obj, offset, update);
+                U.putLong(obj, offset, update);
                 return true;
             }
         }
@@ -559,7 +559,7 @@
         public void set(T obj, long newValue) {
             if (obj == null || obj.getClass() != tclass || cclass != null) fullCheck(obj);
             synchronized (this) {
-                unsafe.putLong(obj, offset, newValue);
+                U.putLong(obj, offset, newValue);
             }
         }
 
@@ -570,7 +570,7 @@
         public long get(T obj) {
             if (obj == null || obj.getClass() != tclass || cclass != null) fullCheck(obj);
             synchronized (this) {
-                return unsafe.getLong(obj, offset);
+                return U.getLong(obj, offset);
             }
         }
 
@@ -595,7 +595,7 @@
      * classloader's delegation chain.
      * Equivalent to the inaccessible: first.isAncestor(second).
      */
-    private static boolean isAncestor(ClassLoader first, ClassLoader second) {
+    static boolean isAncestor(ClassLoader first, ClassLoader second) {
         ClassLoader acl = first;
         do {
             acl = acl.getParent();
--- a/jdk/src/java.base/share/classes/java/util/concurrent/atomic/AtomicMarkableReference.java	Tue Oct 06 08:43:02 2015 -0700
+++ b/jdk/src/java.base/share/classes/java/util/concurrent/atomic/AtomicMarkableReference.java	Wed Jul 05 20:52:10 2017 +0200
@@ -97,7 +97,7 @@
      * Typical usage is {@code boolean[1] holder; ref = v.get(holder); }.
      *
      * @param markHolder an array of size of at least one. On return,
-     * {@code markholder[0]} will hold the value of the mark.
+     * {@code markHolder[0]} will hold the value of the mark.
      * @return the current value of the reference
      */
     public V get(boolean[] markHolder) {
@@ -190,23 +190,18 @@
 
     // Unsafe mechanics
 
-    private static final sun.misc.Unsafe UNSAFE = sun.misc.Unsafe.getUnsafe();
-    private static final long pairOffset =
-        objectFieldOffset(UNSAFE, "pair", AtomicMarkableReference.class);
+    private static final sun.misc.Unsafe U = sun.misc.Unsafe.getUnsafe();
+    private static final long PAIR;
+    static {
+        try {
+            PAIR = U.objectFieldOffset
+                (AtomicMarkableReference.class.getDeclaredField("pair"));
+        } catch (ReflectiveOperationException e) {
+            throw new Error(e);
+        }
+    }
 
     private boolean casPair(Pair<V> cmp, Pair<V> val) {
-        return UNSAFE.compareAndSwapObject(this, pairOffset, cmp, val);
-    }
-
-    static long objectFieldOffset(sun.misc.Unsafe UNSAFE,
-                                  String field, Class<?> klazz) {
-        try {
-            return UNSAFE.objectFieldOffset(klazz.getDeclaredField(field));
-        } catch (NoSuchFieldException e) {
-            // Convert Exception to corresponding Error
-            NoSuchFieldError error = new NoSuchFieldError(field);
-            error.initCause(e);
-            throw error;
-        }
+        return U.compareAndSwapObject(this, PAIR, cmp, val);
     }
 }
--- a/jdk/src/java.base/share/classes/java/util/concurrent/atomic/AtomicReference.java	Tue Oct 06 08:43:02 2015 -0700
+++ b/jdk/src/java.base/share/classes/java/util/concurrent/atomic/AtomicReference.java	Wed Jul 05 20:52:10 2017 +0200
@@ -34,9 +34,9 @@
  */
 
 package java.util.concurrent.atomic;
+
+import java.util.function.BinaryOperator;
 import java.util.function.UnaryOperator;
-import java.util.function.BinaryOperator;
-import sun.misc.Unsafe;
 
 /**
  * An object reference that may be updated atomically. See the {@link
@@ -49,14 +49,16 @@
 public class AtomicReference<V> implements java.io.Serializable {
     private static final long serialVersionUID = -1848883965231344442L;
 
-    private static final Unsafe unsafe = Unsafe.getUnsafe();
-    private static final long valueOffset;
+    private static final sun.misc.Unsafe U = sun.misc.Unsafe.getUnsafe();
+    private static final long VALUE;
 
     static {
         try {
-            valueOffset = unsafe.objectFieldOffset
+            VALUE = U.objectFieldOffset
                 (AtomicReference.class.getDeclaredField("value"));
-        } catch (Exception ex) { throw new Error(ex); }
+        } catch (ReflectiveOperationException e) {
+            throw new Error(e);
+        }
     }
 
     private volatile V value;
@@ -101,7 +103,7 @@
      * @since 1.6
      */
     public final void lazySet(V newValue) {
-        unsafe.putOrderedObject(this, valueOffset, newValue);
+        U.putOrderedObject(this, VALUE, newValue);
     }
 
     /**
@@ -113,7 +115,7 @@
      * the actual value was not equal to the expected value.
      */
     public final boolean compareAndSet(V expect, V update) {
-        return unsafe.compareAndSwapObject(this, valueOffset, expect, update);
+        return U.compareAndSwapObject(this, VALUE, expect, update);
     }
 
     /**
@@ -129,7 +131,7 @@
      * @return {@code true} if successful
      */
     public final boolean weakCompareAndSet(V expect, V update) {
-        return unsafe.compareAndSwapObject(this, valueOffset, expect, update);
+        return U.compareAndSwapObject(this, VALUE, expect, update);
     }
 
     /**
@@ -140,7 +142,7 @@
      */
     @SuppressWarnings("unchecked")
     public final V getAndSet(V newValue) {
-        return (V)unsafe.getAndSetObject(this, valueOffset, newValue);
+        return (V)U.getAndSetObject(this, VALUE, newValue);
     }
 
     /**
--- a/jdk/src/java.base/share/classes/java/util/concurrent/atomic/AtomicReferenceArray.java	Tue Oct 06 08:43:02 2015 -0700
+++ b/jdk/src/java.base/share/classes/java/util/concurrent/atomic/AtomicReferenceArray.java	Wed Jul 05 20:52:10 2017 +0200
@@ -34,11 +34,11 @@
  */
 
 package java.util.concurrent.atomic;
+
+import java.lang.reflect.Array;
+import java.util.Arrays;
+import java.util.function.BinaryOperator;
 import java.util.function.UnaryOperator;
-import java.util.function.BinaryOperator;
-import java.util.Arrays;
-import java.lang.reflect.Array;
-import sun.misc.Unsafe;
 
 /**
  * An array of object references in which elements may be updated
@@ -52,23 +52,22 @@
 public class AtomicReferenceArray<E> implements java.io.Serializable {
     private static final long serialVersionUID = -6209656149925076980L;
 
-    private static final Unsafe unsafe;
-    private static final int base;
-    private static final int shift;
-    private static final long arrayFieldOffset;
+    private static final sun.misc.Unsafe U = sun.misc.Unsafe.getUnsafe();
+    private static final int ABASE;
+    private static final int ASHIFT;
+    private static final long ARRAY;
     private final Object[] array; // must have exact type Object[]
 
     static {
         try {
-            unsafe = Unsafe.getUnsafe();
-            arrayFieldOffset = unsafe.objectFieldOffset
+            ARRAY = U.objectFieldOffset
                 (AtomicReferenceArray.class.getDeclaredField("array"));
-            base = unsafe.arrayBaseOffset(Object[].class);
-            int scale = unsafe.arrayIndexScale(Object[].class);
+            ABASE = U.arrayBaseOffset(Object[].class);
+            int scale = U.arrayIndexScale(Object[].class);
             if ((scale & (scale - 1)) != 0)
-                throw new Error("data type scale not a power of two");
-            shift = 31 - Integer.numberOfLeadingZeros(scale);
-        } catch (Exception e) {
+                throw new Error("array index scale not a power of two");
+            ASHIFT = 31 - Integer.numberOfLeadingZeros(scale);
+        } catch (ReflectiveOperationException e) {
             throw new Error(e);
         }
     }
@@ -81,7 +80,7 @@
     }
 
     private static long byteOffset(int i) {
-        return ((long) i << shift) + base;
+        return ((long) i << ASHIFT) + ABASE;
     }
 
     /**
@@ -127,7 +126,7 @@
 
     @SuppressWarnings("unchecked")
     private E getRaw(long offset) {
-        return (E) unsafe.getObjectVolatile(array, offset);
+        return (E) U.getObjectVolatile(array, offset);
     }
 
     /**
@@ -137,7 +136,7 @@
      * @param newValue the new value
      */
     public final void set(int i, E newValue) {
-        unsafe.putObjectVolatile(array, checkedByteOffset(i), newValue);
+        U.putObjectVolatile(array, checkedByteOffset(i), newValue);
     }
 
     /**
@@ -148,7 +147,7 @@
      * @since 1.6
      */
     public final void lazySet(int i, E newValue) {
-        unsafe.putOrderedObject(array, checkedByteOffset(i), newValue);
+        U.putOrderedObject(array, checkedByteOffset(i), newValue);
     }
 
     /**
@@ -161,7 +160,7 @@
      */
     @SuppressWarnings("unchecked")
     public final E getAndSet(int i, E newValue) {
-        return (E)unsafe.getAndSetObject(array, checkedByteOffset(i), newValue);
+        return (E)U.getAndSetObject(array, checkedByteOffset(i), newValue);
     }
 
     /**
@@ -179,7 +178,7 @@
     }
 
     private boolean compareAndSetRaw(long offset, E expect, E update) {
-        return unsafe.compareAndSwapObject(array, offset, expect, update);
+        return U.compareAndSwapObject(array, offset, expect, update);
     }
 
     /**
@@ -314,17 +313,20 @@
 
     /**
      * Reconstitutes the instance from a stream (that is, deserializes it).
+     * @param s the stream
+     * @throws ClassNotFoundException if the class of a serialized object
+     *         could not be found
+     * @throws java.io.IOException if an I/O error occurs
      */
     private void readObject(java.io.ObjectInputStream s)
-        throws java.io.IOException, ClassNotFoundException,
-        java.io.InvalidObjectException {
+        throws java.io.IOException, ClassNotFoundException {
         // Note: This must be changed if any additional fields are defined
         Object a = s.readFields().get("array", null);
         if (a == null || !a.getClass().isArray())
             throw new java.io.InvalidObjectException("Not array type");
         if (a.getClass() != Object[].class)
             a = Arrays.copyOf((Object[])a, Array.getLength(a), Object[].class);
-        unsafe.putObjectVolatile(this, arrayFieldOffset, a);
+        U.putObjectVolatile(this, ARRAY, a);
     }
 
 }
--- a/jdk/src/java.base/share/classes/java/util/concurrent/atomic/AtomicReferenceFieldUpdater.java	Tue Oct 06 08:43:02 2015 -0700
+++ b/jdk/src/java.base/share/classes/java/util/concurrent/atomic/AtomicReferenceFieldUpdater.java	Wed Jul 05 20:52:10 2017 +0200
@@ -34,14 +34,14 @@
  */
 
 package java.util.concurrent.atomic;
-import java.util.function.UnaryOperator;
-import java.util.function.BinaryOperator;
-import sun.misc.Unsafe;
+
 import java.lang.reflect.Field;
 import java.lang.reflect.Modifier;
 import java.security.AccessController;
+import java.security.PrivilegedActionException;
 import java.security.PrivilegedExceptionAction;
-import java.security.PrivilegedActionException;
+import java.util.function.BinaryOperator;
+import java.util.function.UnaryOperator;
 import sun.reflect.CallerSensitive;
 import sun.reflect.Reflection;
 
@@ -53,7 +53,7 @@
  * independently subject to atomic updates. For example, a tree node
  * might be declared as
  *
- *  <pre> {@code
+ * <pre> {@code
  * class Node {
  *   private volatile Node left, right;
  *
@@ -62,7 +62,7 @@
  *   private static AtomicReferenceFieldUpdater<Node, Node> rightUpdater =
  *     AtomicReferenceFieldUpdater.newUpdater(Node.class, Node.class, "right");
  *
- *   Node getLeft() { return left;  }
+ *   Node getLeft() { return left; }
  *   boolean compareAndSetLeft(Node expect, Node update) {
  *     return leftUpdater.compareAndSet(this, expect, update);
  *   }
@@ -284,7 +284,7 @@
 
     private static final class AtomicReferenceFieldUpdaterImpl<T,V>
         extends AtomicReferenceFieldUpdater<T,V> {
-        private static final Unsafe unsafe = Unsafe.getUnsafe();
+        private static final sun.misc.Unsafe U = sun.misc.Unsafe.getUnsafe();
         private final long offset;
         private final Class<T> tclass;
         private final Class<V> vclass;
@@ -323,7 +323,7 @@
                 ClassLoader ccl = caller.getClassLoader();
                 if ((ccl != null) && (ccl != cl) &&
                     ((cl == null) || !isAncestor(cl, ccl))) {
-                  sun.reflect.misc.ReflectUtil.checkPackageAccess(tclass);
+                    sun.reflect.misc.ReflectUtil.checkPackageAccess(tclass);
                 }
                 fieldClass = field.getType();
             } catch (PrivilegedActionException pae) {
@@ -347,7 +347,7 @@
                 this.vclass = null;
             else
                 this.vclass = vclass;
-            offset = unsafe.objectFieldOffset(field);
+            offset = U.objectFieldOffset(field);
         }
 
         /**
@@ -386,7 +386,7 @@
                 (update != null && vclass != null &&
                  vclass != update.getClass()))
                 updateCheck(obj, update);
-            return unsafe.compareAndSwapObject(obj, offset, expect, update);
+            return U.compareAndSwapObject(obj, offset, expect, update);
         }
 
         public boolean weakCompareAndSet(T obj, V expect, V update) {
@@ -395,7 +395,7 @@
                 (update != null && vclass != null &&
                  vclass != update.getClass()))
                 updateCheck(obj, update);
-            return unsafe.compareAndSwapObject(obj, offset, expect, update);
+            return U.compareAndSwapObject(obj, offset, expect, update);
         }
 
         public void set(T obj, V newValue) {
@@ -403,7 +403,7 @@
                 (newValue != null && vclass != null &&
                  vclass != newValue.getClass()))
                 updateCheck(obj, newValue);
-            unsafe.putObjectVolatile(obj, offset, newValue);
+            U.putObjectVolatile(obj, offset, newValue);
         }
 
         public void lazySet(T obj, V newValue) {
@@ -411,14 +411,14 @@
                 (newValue != null && vclass != null &&
                  vclass != newValue.getClass()))
                 updateCheck(obj, newValue);
-            unsafe.putOrderedObject(obj, offset, newValue);
+            U.putOrderedObject(obj, offset, newValue);
         }
 
         @SuppressWarnings("unchecked")
         public V get(T obj) {
             if (obj == null || obj.getClass() != tclass || cclass != null)
                 targetCheck(obj);
-            return (V)unsafe.getObjectVolatile(obj, offset);
+            return (V)U.getObjectVolatile(obj, offset);
         }
 
         @SuppressWarnings("unchecked")
@@ -427,7 +427,7 @@
                 (newValue != null && vclass != null &&
                  vclass != newValue.getClass()))
                 updateCheck(obj, newValue);
-            return (V)unsafe.getAndSetObject(obj, offset, newValue);
+            return (V)U.getAndSetObject(obj, offset, newValue);
         }
 
         private void ensureProtectedAccess(T obj) {
--- a/jdk/src/java.base/share/classes/java/util/concurrent/atomic/AtomicStampedReference.java	Tue Oct 06 08:43:02 2015 -0700
+++ b/jdk/src/java.base/share/classes/java/util/concurrent/atomic/AtomicStampedReference.java	Wed Jul 05 20:52:10 2017 +0200
@@ -97,7 +97,7 @@
      * Typical usage is {@code int[1] holder; ref = v.get(holder); }.
      *
      * @param stampHolder an array of size of at least one.  On return,
-     * {@code stampholder[0]} will hold the value of the stamp.
+     * {@code stampHolder[0]} will hold the value of the stamp.
      * @return the current value of the reference
      */
     public V get(int[] stampHolder) {
@@ -190,23 +190,18 @@
 
     // Unsafe mechanics
 
-    private static final sun.misc.Unsafe UNSAFE = sun.misc.Unsafe.getUnsafe();
-    private static final long pairOffset =
-        objectFieldOffset(UNSAFE, "pair", AtomicStampedReference.class);
+    private static final sun.misc.Unsafe U = sun.misc.Unsafe.getUnsafe();
+    private static final long PAIR;
+    static {
+        try {
+            PAIR = U.objectFieldOffset
+                (AtomicStampedReference.class.getDeclaredField("pair"));
+        } catch (ReflectiveOperationException e) {
+            throw new Error(e);
+        }
+    }
 
     private boolean casPair(Pair<V> cmp, Pair<V> val) {
-        return UNSAFE.compareAndSwapObject(this, pairOffset, cmp, val);
-    }
-
-    static long objectFieldOffset(sun.misc.Unsafe UNSAFE,
-                                  String field, Class<?> klazz) {
-        try {
-            return UNSAFE.objectFieldOffset(klazz.getDeclaredField(field));
-        } catch (NoSuchFieldException e) {
-            // Convert Exception to corresponding Error
-            NoSuchFieldError error = new NoSuchFieldError(field);
-            error.initCause(e);
-            throw error;
-        }
+        return U.compareAndSwapObject(this, PAIR, cmp, val);
     }
 }
--- a/jdk/src/java.base/share/classes/java/util/concurrent/atomic/DoubleAccumulator.java	Tue Oct 06 08:43:02 2015 -0700
+++ b/jdk/src/java.base/share/classes/java/util/concurrent/atomic/DoubleAccumulator.java	Wed Jul 05 20:52:10 2017 +0200
@@ -34,6 +34,7 @@
  */
 
 package java.util.concurrent.atomic;
+
 import java.io.Serializable;
 import java.util.function.DoubleBinaryOperator;
 
@@ -126,14 +127,13 @@
      * @return the current value
      */
     public double get() {
-        Cell[] as = cells; Cell a;
+        Cell[] as = cells;
         double result = Double.longBitsToDouble(base);
         if (as != null) {
-            for (int i = 0; i < as.length; ++i) {
-                if ((a = as[i]) != null)
+            for (Cell a : as)
+                if (a != null)
                     result = function.applyAsDouble
                         (result, Double.longBitsToDouble(a.value));
-            }
         }
         return result;
     }
@@ -147,13 +147,12 @@
      * updating.
      */
     public void reset() {
-        Cell[] as = cells; Cell a;
+        Cell[] as = cells;
         base = identity;
         if (as != null) {
-            for (int i = 0; i < as.length; ++i) {
-                if ((a = as[i]) != null)
-                    a.value = identity;
-            }
+            for (Cell a : as)
+                if (a != null)
+                    a.reset(identity);
         }
     }
 
@@ -168,14 +167,14 @@
      * @return the value before reset
      */
     public double getThenReset() {
-        Cell[] as = cells; Cell a;
+        Cell[] as = cells;
         double result = Double.longBitsToDouble(base);
         base = identity;
         if (as != null) {
-            for (int i = 0; i < as.length; ++i) {
-                if ((a = as[i]) != null) {
+            for (Cell a : as) {
+                if (a != null) {
                     double v = Double.longBitsToDouble(a.value);
-                    a.value = identity;
+                    a.reset(identity);
                     result = function.applyAsDouble(result, v);
                 }
             }
@@ -237,21 +236,27 @@
          * @serial
          */
         private final double value;
+
         /**
          * The function used for updates.
          * @serial
          */
         private final DoubleBinaryOperator function;
+
         /**
-         * The identity value
+         * The identity value, represented as a long, as converted by
+         * {@link Double#doubleToRawLongBits}.  The original identity
+         * can be recovered using {@link Double#longBitsToDouble}.
          * @serial
          */
         private final long identity;
 
-        SerializationProxy(DoubleAccumulator a) {
-            function = a.function;
-            identity = a.identity;
-            value = a.get();
+        SerializationProxy(double value,
+                           DoubleBinaryOperator function,
+                           long identity) {
+            this.value = value;
+            this.function = function;
+            this.identity = identity;
         }
 
         /**
@@ -259,7 +264,7 @@
          * held by this proxy.
          *
          * @return a {@code DoubleAccumulator} object with initial state
-         * held by this proxy.
+         * held by this proxy
          */
         private Object readResolve() {
             double d = Double.longBitsToDouble(identity);
@@ -279,7 +284,7 @@
      * representing the state of this instance
      */
     private Object writeReplace() {
-        return new SerializationProxy(this);
+        return new SerializationProxy(get(), function, identity);
     }
 
     /**
--- a/jdk/src/java.base/share/classes/java/util/concurrent/atomic/DoubleAdder.java	Tue Oct 06 08:43:02 2015 -0700
+++ b/jdk/src/java.base/share/classes/java/util/concurrent/atomic/DoubleAdder.java	Wed Jul 05 20:52:10 2017 +0200
@@ -34,6 +34,7 @@
  */
 
 package java.util.concurrent.atomic;
+
 import java.io.Serializable;
 
 /**
@@ -114,13 +115,12 @@
      * @return the sum
      */
     public double sum() {
-        Cell[] as = cells; Cell a;
+        Cell[] as = cells;
         double sum = Double.longBitsToDouble(base);
         if (as != null) {
-            for (int i = 0; i < as.length; ++i) {
-                if ((a = as[i]) != null)
+            for (Cell a : as)
+                if (a != null)
                     sum += Double.longBitsToDouble(a.value);
-            }
         }
         return sum;
     }
@@ -133,13 +133,12 @@
      * known that no threads are concurrently updating.
      */
     public void reset() {
-        Cell[] as = cells; Cell a;
+        Cell[] as = cells;
         base = 0L; // relies on fact that double 0 must have same rep as long
         if (as != null) {
-            for (int i = 0; i < as.length; ++i) {
-                if ((a = as[i]) != null)
-                    a.value = 0L;
-            }
+            for (Cell a : as)
+                if (a != null)
+                    a.reset();
         }
     }
 
@@ -154,14 +153,14 @@
      * @return the sum
      */
     public double sumThenReset() {
-        Cell[] as = cells; Cell a;
+        Cell[] as = cells;
         double sum = Double.longBitsToDouble(base);
         base = 0L;
         if (as != null) {
-            for (int i = 0; i < as.length; ++i) {
-                if ((a = as[i]) != null) {
+            for (Cell a : as) {
+                if (a != null) {
                     long v = a.value;
-                    a.value = 0L;
+                    a.reset();
                     sum += Double.longBitsToDouble(v);
                 }
             }
@@ -233,7 +232,7 @@
          * held by this proxy.
          *
          * @return a {@code DoubleAdder} object with initial state
-         * held by this proxy.
+         * held by this proxy
          */
         private Object readResolve() {
             DoubleAdder a = new DoubleAdder();
--- a/jdk/src/java.base/share/classes/java/util/concurrent/atomic/LongAccumulator.java	Tue Oct 06 08:43:02 2015 -0700
+++ b/jdk/src/java.base/share/classes/java/util/concurrent/atomic/LongAccumulator.java	Wed Jul 05 20:52:10 2017 +0200
@@ -34,6 +34,7 @@
  */
 
 package java.util.concurrent.atomic;
+
 import java.io.Serializable;
 import java.util.function.LongBinaryOperator;
 
@@ -124,13 +125,12 @@
      * @return the current value
      */
     public long get() {
-        Cell[] as = cells; Cell a;
+        Cell[] as = cells;
         long result = base;
         if (as != null) {
-            for (int i = 0; i < as.length; ++i) {
-                if ((a = as[i]) != null)
+            for (Cell a : as)
+                if (a != null)
                     result = function.applyAsLong(result, a.value);
-            }
         }
         return result;
     }
@@ -144,13 +144,12 @@
      * updating.
      */
     public void reset() {
-        Cell[] as = cells; Cell a;
+        Cell[] as = cells;
         base = identity;
         if (as != null) {
-            for (int i = 0; i < as.length; ++i) {
-                if ((a = as[i]) != null)
-                    a.value = identity;
-            }
+            for (Cell a : as)
+                if (a != null)
+                    a.reset(identity);
         }
     }
 
@@ -165,14 +164,14 @@
      * @return the value before reset
      */
     public long getThenReset() {
-        Cell[] as = cells; Cell a;
+        Cell[] as = cells;
         long result = base;
         base = identity;
         if (as != null) {
-            for (int i = 0; i < as.length; ++i) {
-                if ((a = as[i]) != null) {
+            for (Cell a : as) {
+                if (a != null) {
                     long v = a.value;
-                    a.value = identity;
+                    a.reset(identity);
                     result = function.applyAsLong(result, v);
                 }
             }
@@ -234,21 +233,25 @@
          * @serial
          */
         private final long value;
+
         /**
          * The function used for updates.
          * @serial
          */
         private final LongBinaryOperator function;
+
         /**
-         * The identity value
+         * The identity value.
          * @serial
          */
         private final long identity;
 
-        SerializationProxy(LongAccumulator a) {
-            function = a.function;
-            identity = a.identity;
-            value = a.get();
+        SerializationProxy(long value,
+                           LongBinaryOperator function,
+                           long identity) {
+            this.value = value;
+            this.function = function;
+            this.identity = identity;
         }
 
         /**
@@ -256,7 +259,7 @@
          * held by this proxy.
          *
          * @return a {@code LongAccumulator} object with initial state
-         * held by this proxy.
+         * held by this proxy
          */
         private Object readResolve() {
             LongAccumulator a = new LongAccumulator(function, identity);
@@ -275,7 +278,7 @@
      * representing the state of this instance
      */
     private Object writeReplace() {
-        return new SerializationProxy(this);
+        return new SerializationProxy(get(), function, identity);
     }
 
     /**
--- a/jdk/src/java.base/share/classes/java/util/concurrent/atomic/LongAdder.java	Tue Oct 06 08:43:02 2015 -0700
+++ b/jdk/src/java.base/share/classes/java/util/concurrent/atomic/LongAdder.java	Wed Jul 05 20:52:10 2017 +0200
@@ -34,6 +34,7 @@
  */
 
 package java.util.concurrent.atomic;
+
 import java.io.Serializable;
 
 /**
@@ -116,13 +117,12 @@
      * @return the sum
      */
     public long sum() {
-        Cell[] as = cells; Cell a;
+        Cell[] as = cells;
         long sum = base;
         if (as != null) {
-            for (int i = 0; i < as.length; ++i) {
-                if ((a = as[i]) != null)
+            for (Cell a : as)
+                if (a != null)
                     sum += a.value;
-            }
         }
         return sum;
     }
@@ -135,13 +135,12 @@
      * known that no threads are concurrently updating.
      */
     public void reset() {
-        Cell[] as = cells; Cell a;
+        Cell[] as = cells;
         base = 0L;
         if (as != null) {
-            for (int i = 0; i < as.length; ++i) {
-                if ((a = as[i]) != null)
-                    a.value = 0L;
-            }
+            for (Cell a : as)
+                if (a != null)
+                    a.reset();
         }
     }
 
@@ -156,14 +155,14 @@
      * @return the sum
      */
     public long sumThenReset() {
-        Cell[] as = cells; Cell a;
+        Cell[] as = cells;
         long sum = base;
         base = 0L;
         if (as != null) {
-            for (int i = 0; i < as.length; ++i) {
-                if ((a = as[i]) != null) {
+            for (Cell a : as) {
+                if (a != null) {
                     sum += a.value;
-                    a.value = 0L;
+                    a.reset();
                 }
             }
         }
@@ -230,11 +229,11 @@
         }
 
         /**
-         * Return a {@code LongAdder} object with initial state
+         * Returns a {@code LongAdder} object with initial state
          * held by this proxy.
          *
          * @return a {@code LongAdder} object with initial state