Merge
authorduke
Wed, 05 Jul 2017 21:20:03 +0200
changeset 35789 4a0184327358
parent 35788 04c8859c969b (current diff)
parent 35766 e6e6d7d813fa (diff)
child 35791 6be17eac8c18
Merge
--- a/.hgtags-top-repo	Mon Feb 15 14:25:21 2016 +0000
+++ b/.hgtags-top-repo	Wed Jul 05 21:20:03 2017 +0200
@@ -347,3 +347,4 @@
 6406ecf5d39482623225bb1b3098c2cac6f7d450 jdk-9+102
 47d6462e514b2097663305a57d9c844c15d5b609 jdk-9+103
 9a38f8b4ba220708db198d08d82fd2144a64777d jdk-9+104
+be58b02c11f90b88c67e4d0e2cb5e4cf2d9b3c57 jdk-9+105
--- a/common/autoconf/basics.m4	Mon Feb 15 14:25:21 2016 +0000
+++ b/common/autoconf/basics.m4	Wed Jul 05 21:20:03 2017 +0200
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2011, 2016, 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
@@ -36,11 +36,11 @@
 # "ARG_FOO".
 #
 # The generated function can be called like this:
-# MYFUNC(FOO: [foo-val], BAR:
-#     [
+# MYFUNC(FOO: [foo-val],
+#     BAR: [
 #         $ECHO hello world
 #     ])
-#
+# Note that the argument value must start on the same line as the argument name.
 #
 # Argument 1: Name of the function to define
 # Argument 2: List of legal named arguments, with a * prefix for required arguments
--- a/common/autoconf/build-performance.m4	Mon Feb 15 14:25:21 2016 +0000
+++ b/common/autoconf/build-performance.m4	Wed Jul 05 21:20:03 2017 +0200
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2011, 2016, 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
@@ -72,7 +72,7 @@
     FOUND_MEM=yes
   elif test -x /usr/sbin/prtconf; then
     # Looks like a Solaris or AIX system
-    MEMORY_SIZE=`/usr/sbin/prtconf | grep "^Memory [[Ss]]ize" | awk '{ print [$]3 }'`
+    MEMORY_SIZE=`/usr/sbin/prtconf 2> /dev/null | grep "^Memory [[Ss]]ize" | awk '{ print [$]3 }'`
     FOUND_MEM=yes
   elif test -x /usr/sbin/sysctl; then
     # Looks like a MacOSX system
@@ -260,8 +260,8 @@
 #
 AC_DEFUN([BPERF_RUN_ICECC_CREATE_ENV],
 [
-  cd ${CONFIGURESUPPORT_OUTPUTDIR}/icecc \
-      && ${ICECC_CREATE_ENV} $1 > $2 2>&1
+  ( cd ${CONFIGURESUPPORT_OUTPUTDIR}/icecc \
+      && ${ICECC_CREATE_ENV} $1 > $2 2>&1 )
   if test "$?" != "0"; then
     AC_MSG_NOTICE([icecc-create-env output:])
     cat $2
--- a/common/autoconf/compare.sh.in	Mon Feb 15 14:25:21 2016 +0000
+++ b/common/autoconf/compare.sh.in	Wed Jul 05 21:20:03 2017 +0200
@@ -33,6 +33,7 @@
 
 export OPENJDK_TARGET_OS="@OPENJDK_TARGET_OS@"
 export OPENJDK_TARGET_CPU="@OPENJDK_TARGET_CPU@"
+export OPENJDK_TARGET_CPU_LIBDIR="@OPENJDK_TARGET_CPU_LIBDIR@"
 
 export AWK="@AWK@"
 export BASH="@BASH@"
--- a/common/autoconf/configure	Mon Feb 15 14:25:21 2016 +0000
+++ b/common/autoconf/configure	Wed Jul 05 21:20:03 2017 +0200
@@ -1,6 +1,6 @@
 #!/bin/bash
 #
-# Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2012, 2016, 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
@@ -283,8 +283,9 @@
 
 EOT
 
-    # Print list of toolchains. This must be done by the autoconf script.
-    ( CONFIGURE_PRINT_TOOLCHAIN_LIST=true . $conf_script_to_run PRINTF=printf )
+    # Print additional help, e.g. a list of toolchains.
+    # This must be done by the autoconf script.
+    ( CONFIGURE_PRINT_ADDITIONAL_HELP=true . $conf_script_to_run PRINTF=printf )
 
     cat <<EOT
 
--- a/common/autoconf/configure.ac	Mon Feb 15 14:25:21 2016 +0000
+++ b/common/autoconf/configure.ac	Wed Jul 05 21:20:03 2017 +0200
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2011, 2016, 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
@@ -189,8 +189,6 @@
 
 FLAGS_SETUP_INIT_FLAGS
 
-# FIXME: Currently we must test this after toolchain but before flags. Fix!
-
 # Now we can test some aspects on the target using configure macros.
 PLATFORM_SETUP_OPENJDK_TARGET_BITS
 PLATFORM_SETUP_OPENJDK_TARGET_ENDIANNESS
--- a/common/autoconf/flags.m4	Mon Feb 15 14:25:21 2016 +0000
+++ b/common/autoconf/flags.m4	Wed Jul 05 21:20:03 2017 +0200
@@ -206,7 +206,7 @@
   # On Windows, we need to set RC flags.
   if test "x$TOOLCHAIN_TYPE" = xmicrosoft; then
     RC_FLAGS="-nologo -l0x409"
-    if test "x$VARIANT" = xOPT; then
+    if test "x$DEBUG_LEVEL" = xrelease; then
       RC_FLAGS="$RC_FLAGS -DNDEBUG"
     fi
 
@@ -254,7 +254,7 @@
       SET_EXECUTABLE_ORIGIN='-Wl,-rpath,@loader_path/.'
       SET_SHARED_LIBRARY_ORIGIN="$SET_EXECUTABLE_ORIGIN"
       SET_SHARED_LIBRARY_NAME='-Wl,-install_name,@rpath/[$]1'
-      SET_SHARED_LIBRARY_MAPFILE=''
+      SET_SHARED_LIBRARY_MAPFILE='-Wl,-exported_symbols_list,[$]1'
     else
       # Default works for linux, might work on other platforms as well.
       SHARED_LIBRARY_FLAGS='-shared'
@@ -274,7 +274,7 @@
       SET_EXECUTABLE_ORIGIN='-Wl,-rpath,@loader_path/.'
       SET_SHARED_LIBRARY_ORIGIN="$SET_EXECUTABLE_ORIGIN"
       SET_SHARED_LIBRARY_NAME='-Wl,-install_name,@rpath/[$]1'
-      SET_SHARED_LIBRARY_MAPFILE=''
+      SET_SHARED_LIBRARY_MAPFILE='-Wl,-exported_symbols_list,[$]1'
     else
       # Default works for linux, might work on other platforms as well.
       PICFLAG='-fPIC'
@@ -310,7 +310,7 @@
     SET_EXECUTABLE_ORIGIN=''
     SET_SHARED_LIBRARY_ORIGIN=''
     SET_SHARED_LIBRARY_NAME=''
-    SET_SHARED_LIBRARY_MAPFILE=''
+    SET_SHARED_LIBRARY_MAPFILE='-def:[$]1'
   fi
 
   AC_SUBST(C_FLAG_REORDER)
@@ -423,6 +423,10 @@
       # no adjustment
       ;;
     slowdebug )
+      # FIXME: By adding this to C(XX)FLAGS_DEBUG_OPTIONS it
+      # get's added conditionally on whether we produce debug symbols or not.
+      # This is most likely not really correct.
+
       # Add runtime stack smashing and undefined behavior checks.
       # Not all versions of gcc support -fstack-protector
       STACK_PROTECTOR_CFLAG="-fstack-protector-all"
@@ -463,7 +467,7 @@
       CXX_O_FLAG_HIGHEST="-xO4 -Qoption cg -Qrm-s -Qoption cg -Qiselect-T0 $CC_HIGHEST -xprefetch=auto,explicit -xchip=ultra"
       CXX_O_FLAG_HI="-xO4 -Qoption cg -Qrm-s -Qoption cg -Qiselect-T0"
       CXX_O_FLAG_NORM="-xO2 -Qoption cg -Qrm-s -Qoption cg -Qiselect-T0"
-      C_O_FLAG_DEBUG=""
+      CXX_O_FLAG_DEBUG=""
       CXX_O_FLAG_NONE=""
     fi
   else
@@ -646,8 +650,8 @@
     # avoid bundling msvcpNNN.dll. Doesn't work with newer versions of visual
     # studio.
     if test "x$TOOLCHAIN_VERSION" = "x2010"; then
-      COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS_JDK \
-          -D_STATIC_CPPLIB -D_DISABLE_DEPRECATE_STATIC_CPPLIB"
+      STATIC_CPPLIB_FLAGS="-D_STATIC_CPPLIB -D_DISABLE_DEPRECATE_STATIC_CPPLIB"
+      COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS_JDK $STATIC_CPPLIB_FLAGS"
     fi
   fi
 
@@ -715,9 +719,6 @@
   # Set some additional per-OS defines.
   if test "x$OPENJDK_TARGET_OS" = xmacosx; then
     COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS_JDK -D_ALLBSD_SOURCE -D_DARWIN_UNLIMITED_SELECT"
-  elif test "x$OPENJDK_TARGET_OS" = xaix; then
-    # FIXME: PPC64 should not be here.
-    COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS_JDK -DPPC64"
   elif test "x$OPENJDK_TARGET_OS" = xbsd; then
     COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS_JDK -D_ALLBSD_SOURCE"
   fi
@@ -775,36 +776,34 @@
   # Setup LDFLAGS et al.
   #
 
-  # Now this is odd. The JDK native libraries have to link against libjvm.so
-  # On 32-bit machines there is normally two distinct libjvm.so:s, client and server.
-  # Which should we link to? Are we lucky enough that the binary api to the libjvm.so library
-  # is identical for client and server? Yes. Which is picked at runtime (client or server)?
-  # Neither, since the chosen libjvm.so has already been loaded by the launcher, all the following
-  # libraries will link to whatever is in memory. Yuck.
-  #
-  # Thus we offer the compiler to find libjvm.so first in server then in client. It works. Ugh.
   if test "x$TOOLCHAIN_TYPE" = xmicrosoft; then
-    LDFLAGS_JDK="$LDFLAGS_JDK -nologo -opt:ref -incremental:no"
+    LDFLAGS_MICROSOFT="-nologo -opt:ref"
+    LDFLAGS_JDK="$LDFLAGS_JDK $LDFLAGS_MICROSOFT -incremental:no"
     if test "x$OPENJDK_TARGET_CPU_BITS" = "x32"; then
-      LDFLAGS_JDK="$LDFLAGS_JDK -safeseh"
+      LDFLAGS_SAFESH="-safeseh"
+      LDFLAGS_JDK="$LDFLAGS_JDK $LDFLAGS_SAFESH"
     fi
     # TODO: make -debug optional "--disable-full-debug-symbols"
-    LDFLAGS_JDK="$LDFLAGS_JDK -debug"
+    LDFLAGS_MICROSOFT_DEBUG="-debug"
+    LDFLAGS_JDK="$LDFLAGS_JDK $LDFLAGS_MICROSOFT_DEBUG"
   elif test "x$TOOLCHAIN_TYPE" = xgcc; then
     # If this is a --hash-style=gnu system, use --hash-style=both, why?
     # We have previously set HAS_GNU_HASH if this is the case
     if test -n "$HAS_GNU_HASH"; then
-      LDFLAGS_JDK="${LDFLAGS_JDK} -Wl,--hash-style=both"
+      LDFLAGS_HASH_STYLE="-Wl,--hash-style=both"
+      LDFLAGS_JDK="${LDFLAGS_JDK} $LDFLAGS_HASH_STYLE"
     fi
     if test "x$OPENJDK_TARGET_OS" = xlinux; then
       # And since we now know that the linker is gnu, then add -z defs, to forbid
       # undefined symbols in object files.
-      LDFLAGS_JDK="${LDFLAGS_JDK} -Wl,-z,defs"
+      LDFLAGS_NO_UNDEF_SYM="-Wl,-z,defs"
+      LDFLAGS_JDK="${LDFLAGS_JDK} $LDFLAGS_NO_UNDEF_SYM"
       case $DEBUG_LEVEL in
         release )
           # tell linker to optimize libraries.
           # Should this be supplied to the OSS linker as well?
-          LDFLAGS_JDK="${LDFLAGS_JDK} -Wl,-O1"
+          LDFLAGS_DEBUGLEVEL_release="-Wl,-O1"
+          LDFLAGS_JDK="${LDFLAGS_JDK} $LDFLAGS_DEBUGLEVEL_release"
           ;;
         slowdebug )
           if test "x$HAS_LINKER_NOW" = "xtrue"; then
@@ -831,10 +830,13 @@
         esac
     fi
   elif test "x$TOOLCHAIN_TYPE" = xsolstudio; then
-    LDFLAGS_JDK="$LDFLAGS_JDK -Wl,-z,defs -xildoff -ztext"
-    LDFLAGS_CXX_JDK="$LDFLAGS_CXX_JDK -norunpath -xnolib"
+    LDFLAGS_SOLSTUDIO="-Wl,-z,defs"
+    LDFLAGS_JDK="$LDFLAGS_JDK $LDFLAGS_SOLSTUDIO -xildoff -ztext"
+    LDFLAGS_CXX_SOLSTUDIO="-norunpath"
+    LDFLAGS_CXX_JDK="$LDFLAGS_CXX_JDK $LDFLAGS_CXX_SOLSTUDIO -xnolib"
   elif test "x$TOOLCHAIN_TYPE" = xxlc; then
-    LDFLAGS_JDK="${LDFLAGS_JDK} -brtl -bnolibpath -bexpall -bernotok"
+    LDFLAGS_XLC="-brtl -bnolibpath -bexpall -bernotok"
+    LDFLAGS_JDK="${LDFLAGS_JDK} $LDFLAGS_XLC"
   fi
 
   # Customize LDFLAGS for executables
@@ -1048,6 +1050,10 @@
       DISABLE_WARNING_PREFIX="-Wno-"
       CFLAGS_WARNINGS_ARE_ERRORS="-Werror"
       ;;
+    xlc)
+      DISABLE_WARNING_PREFIX="-qsuppress="
+      CFLAGS_WARNINGS_ARE_ERRORS="-qhalt=w"
+      ;;
   esac
   AC_SUBST(DISABLE_WARNING_PREFIX)
   AC_SUBST(CFLAGS_WARNINGS_ARE_ERRORS)
--- a/common/autoconf/generated-configure.sh	Mon Feb 15 14:25:21 2016 +0000
+++ b/common/autoconf/generated-configure.sh	Wed Jul 05 21:20:03 2017 +0200
@@ -784,6 +784,8 @@
 LD
 CXXCPP
 CPP
+CXX_VERSION_NUMBER
+CC_VERSION_NUMBER
 ac_ct_CXX
 CXXFLAGS
 CXX
@@ -860,6 +862,7 @@
 TEST_IN_BUILD
 COPYRIGHT_YEAR
 COMPRESS_JARS
+INCLUDE_SA
 UNLIMITED_CRYPTO
 CACERTS_FILE
 BUILD_HEADLESS
@@ -906,7 +909,6 @@
 VARIANT
 DEBUG_LEVEL
 MACOSX_UNIVERSAL
-INCLUDE_SA
 JVM_VARIANT_CORE
 JVM_VARIANT_ZEROSHARK
 JVM_VARIANT_ZERO
@@ -1926,7 +1928,7 @@
   --with-jvm-variants     JVM variants (separated by commas) to build (server,
                           client, minimal1, zero, zeroshark, core) [server]
   --with-debug-level      set the debug level (release, fastdebug, slowdebug,
-                          optimized (HotSpot build only)) [release]
+                          optimized) [release]
   --with-devkit           use this devkit for compilers, tools and resources
   --with-sys-root         alias for --with-sysroot for backwards compatability
   --with-sysroot          use this directory as sysroot
@@ -2008,7 +2010,7 @@
   --with-jtreg            Regression Test Harness [probed]
   --with-native-debug-symbols
                           set the native debug symbol configuration (none,
-                          internal, external, zipped) [zipped]
+                          internal, external, zipped) [varying]
   --with-stdc++lib=<static>,<dynamic>,<default>
                           force linking of the C++ runtime on Linux to either
                           static or dynamic, default is static with dynamic as
@@ -3424,7 +3426,7 @@
 
 # Include these first...
 #
-# Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2011, 2016, 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
@@ -3461,11 +3463,11 @@
 # "ARG_FOO".
 #
 # The generated function can be called like this:
-# MYFUNC(FOO: [foo-val], BAR:
-#     [
+# MYFUNC(FOO: [foo-val],
+#     BAR: [
 #         $ECHO hello world
 #     ])
-#
+# Note that the argument value must start on the same line as the argument name.
 #
 # Argument 1: Name of the function to define
 # Argument 2: List of legal named arguments, with a * prefix for required arguments
@@ -3774,7 +3776,7 @@
 
 
 #
-# Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2011, 2016, 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
@@ -3927,7 +3929,7 @@
 
 
 #
-# Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2011, 2016, 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
@@ -4059,7 +4061,7 @@
 
 
 #
-# Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2011, 2016, 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
@@ -4117,7 +4119,7 @@
 
 
 #
-# Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2011, 2016, 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
@@ -4625,7 +4627,7 @@
 
 
 #
-# Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2011, 2016, 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
@@ -4676,6 +4678,28 @@
 TOOLCHAIN_DESCRIPTION_solstudio="Oracle Solaris Studio"
 TOOLCHAIN_DESCRIPTION_xlc="IBM XL C/C++"
 
+# Minimum supported versions, empty means unspecified
+TOOLCHAIN_MINIMUM_VERSION_clang="3.2"
+TOOLCHAIN_MINIMUM_VERSION_gcc="4.3"
+TOOLCHAIN_MINIMUM_VERSION_microsoft=""
+TOOLCHAIN_MINIMUM_VERSION_solstudio="5.12"
+TOOLCHAIN_MINIMUM_VERSION_xlc=""
+
+# Prepare the system so that TOOLCHAIN_CHECK_COMPILER_VERSION can be called.
+# Must have CC_VERSION_NUMBER and CXX_VERSION_NUMBER.
+
+
+# Check if the configured compiler (C and C++) is of a specific version or
+# newer. TOOLCHAIN_PREPARE_FOR_VERSION_COMPARISONS must have been called before.
+#
+# Arguments:
+#   VERSION:   The version string to check against the found version
+#   IF_AT_LEAST:   block to run if the compiler is at least this version (>=)
+#   IF_OLDER_THAN:   block to run if the compiler is older than this version (<)
+
+
+
+
 # Setup a number of variables describing how native output files are
 # named on this platform/toolchain.
 
@@ -4836,7 +4860,7 @@
 #CUSTOM_AUTOCONF_INCLUDE
 
 # Do not change or remove the following line, it is needed for consistency checks:
-DATE_WHEN_GENERATED=1454926898
+DATE_WHEN_GENERATED=1455271513
 
 ###############################################################################
 #
@@ -4850,7 +4874,9 @@
 # If we are requested to print additional help, do that and then exit.
 # This must be the very first call.
 
-  if test "x$CONFIGURE_PRINT_TOOLCHAIN_LIST" != x; then
+  if test "x$CONFIGURE_PRINT_ADDITIONAL_HELP" != x; then
+
+    # Print available toolchains
     $PRINTF "The following toolchains are available as arguments to --with-toolchain-type.\n"
     $PRINTF "Which are valid to use depends on the build platform.\n"
     for toolchain in $VALID_TOOLCHAINS_all; do
@@ -15826,21 +15852,6 @@
 
 
 
-  INCLUDE_SA=true
-  if test "x$JVM_VARIANT_ZERO" = xtrue ; then
-    INCLUDE_SA=false
-  fi
-  if test "x$JVM_VARIANT_ZEROSHARK" = xtrue ; then
-    INCLUDE_SA=false
-  fi
-  if test "x$OPENJDK_TARGET_OS" = xaix ; then
-    INCLUDE_SA=false
-  fi
-  if test "x$OPENJDK_TARGET_CPU" = xaarch64; then
-    INCLUDE_SA=false
-  fi
-
-
   if test "x$OPENJDK_TARGET_OS" = "xmacosx"; then
     MACOSX_UNIVERSAL="true"
   fi
@@ -15880,7 +15891,7 @@
       test "x$DEBUG_LEVEL" != xoptimized && \
       test "x$DEBUG_LEVEL" != xfastdebug && \
       test "x$DEBUG_LEVEL" != xslowdebug; then
-    as_fn_error $? "Allowed debug levels are: release, fastdebug and slowdebug" "$LINENO" 5
+    as_fn_error $? "Allowed debug levels are: release, fastdebug, slowdebug and optimized" "$LINENO" 5
   fi
 
 
@@ -23244,6 +23255,22 @@
   fi
 
 
+  # Should we build the serviceability agent (SA)?
+  INCLUDE_SA=true
+  if test "x$JVM_VARIANT_ZERO" = xtrue ; then
+    INCLUDE_SA=false
+  fi
+  if test "x$JVM_VARIANT_ZEROSHARK" = xtrue ; then
+    INCLUDE_SA=false
+  fi
+  if test "x$OPENJDK_TARGET_OS" = xaix ; then
+    INCLUDE_SA=false
+  fi
+  if test "x$OPENJDK_TARGET_CPU" = xaarch64; then
+    INCLUDE_SA=false
+  fi
+
+
   # Compress jars
   COMPRESS_JARS=false
 
@@ -29850,6 +29877,8 @@
   # Use indirect variable referencing
   toolchain_var_name=TOOLCHAIN_DESCRIPTION_$TOOLCHAIN_TYPE
   TOOLCHAIN_DESCRIPTION=${!toolchain_var_name}
+  toolchain_var_name=TOOLCHAIN_MINIMUM_VERSION_$TOOLCHAIN_TYPE
+  TOOLCHAIN_MINIMUM_VERSION=${!toolchain_var_name}
   toolchain_var_name=TOOLCHAIN_CC_BINARY_$TOOLCHAIN_TYPE
   TOOLCHAIN_CC_BINARY=${!toolchain_var_name}
   toolchain_var_name=TOOLCHAIN_CXX_BINARY_$TOOLCHAIN_TYPE
@@ -31483,8 +31512,14 @@
     export INCLUDE="$VS_INCLUDE"
     export LIB="$VS_LIB"
   else
-    # Currently we do not define this for other toolchains. This might change as the need arise.
-    TOOLCHAIN_VERSION=
+    if test "x$XCODE_VERSION_OUTPUT" != x; then
+      # For Xcode, we set the Xcode version as TOOLCHAIN_VERSION
+      TOOLCHAIN_VERSION=`$ECHO $XCODE_VERSION_OUTPUT | $CUT -f 2 -d ' '`
+      TOOLCHAIN_DESCRIPTION="$TOOLCHAIN_DESCRIPTION from Xcode"
+    else
+      # Currently we do not define this for other toolchains. This might change as the need arise.
+      TOOLCHAIN_VERSION=
+    fi
   fi
 
 
@@ -32191,7 +32226,7 @@
     # Collapse compiler output into a single line
     COMPILER_VERSION_STRING=`$ECHO $COMPILER_VERSION_OUTPUT`
     COMPILER_VERSION_NUMBER=`$ECHO $COMPILER_VERSION_OUTPUT | \
-        $SED -e 's/^.*clang version \([1-9][0-9.]*\).*$/\1/'`
+        $SED -e 's/^.* version \([1-9][0-9.]*\).*$/\1/'`
   else
       as_fn_error $? "Unknown toolchain type $TOOLCHAIN_TYPE." "$LINENO" 5
   fi
@@ -33488,7 +33523,7 @@
     # Collapse compiler output into a single line
     COMPILER_VERSION_STRING=`$ECHO $COMPILER_VERSION_OUTPUT`
     COMPILER_VERSION_NUMBER=`$ECHO $COMPILER_VERSION_OUTPUT | \
-        $SED -e 's/^.*clang version \([1-9][0-9.]*\).*$/\1/'`
+        $SED -e 's/^.* version \([1-9][0-9.]*\).*$/\1/'`
   else
       as_fn_error $? "Unknown toolchain type $TOOLCHAIN_TYPE." "$LINENO" 5
   fi
@@ -33760,6 +33795,116 @@
 ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
 
 
+  # This is the compiler version number on the form X.Y[.Z]
+
+
+
+
+  if test "x$CC_VERSION_NUMBER" != "x$CXX_VERSION_NUMBER"; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: C and C++ compiler has different version numbers, $CC_VERSION_NUMBER vs $CXX_VERSION_NUMBER." >&5
+$as_echo "$as_me: WARNING: C and C++ compiler has different version numbers, $CC_VERSION_NUMBER vs $CXX_VERSION_NUMBER." >&2;}
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: This typically indicates a broken setup, and is not supported" >&5
+$as_echo "$as_me: WARNING: This typically indicates a broken setup, and is not supported" >&2;}
+  fi
+
+  # We only check CC_VERSION_NUMBER since we assume CXX_VERSION_NUMBER is equal.
+  if  [[ "$CC_VERSION_NUMBER" =~ (.*\.){3} ]] ; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: C compiler version number has more than three parts (X.Y.Z): $CC_VERSION_NUMBER. Comparisons might be wrong." >&5
+$as_echo "$as_me: WARNING: C compiler version number has more than three parts (X.Y.Z): $CC_VERSION_NUMBER. Comparisons might be wrong." >&2;}
+  fi
+
+  if  [[  "$CC_VERSION_NUMBER" =~ [0-9]{6} ]] ; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: C compiler version number has a part larger than 99999: $CC_VERSION_NUMBER. Comparisons might be wrong." >&5
+$as_echo "$as_me: WARNING: C compiler version number has a part larger than 99999: $CC_VERSION_NUMBER. Comparisons might be wrong." >&2;}
+  fi
+
+  COMPARABLE_ACTUAL_VERSION=`$AWK -F. '{ printf("%05d%05d%05d\n", $1, $2, $3) }' <<< "$CC_VERSION_NUMBER"`
+
+
+  if test "x$TOOLCHAIN_MINIMUM_VERSION" != x; then
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+    # Execute function body
+
+  # Need to assign to a variable since m4 is blocked from modifying parts in [].
+  REFERENCE_VERSION=$TOOLCHAIN_MINIMUM_VERSION
+
+  if  [[ "$REFERENCE_VERSION" =~ (.*\.){3} ]] ; then
+    as_fn_error $? "Internal errror: Cannot compare to $TOOLCHAIN_MINIMUM_VERSION, only three parts (X.Y.Z) is supported" "$LINENO" 5
+  fi
+
+  if  [[ "$REFERENCE_VERSION" =~ [0-9]{6} ]] ; then
+    as_fn_error $? "Internal errror: Cannot compare to $TOOLCHAIN_MINIMUM_VERSION, only parts < 99999 is supported" "$LINENO" 5
+  fi
+
+  # Version comparison method inspired by http://stackoverflow.com/a/24067243
+  COMPARABLE_REFERENCE_VERSION=`$AWK -F. '{ printf("%05d%05d%05d\n", $1, $2, $3) }' <<< "$REFERENCE_VERSION"`
+
+  if test $COMPARABLE_ACTUAL_VERSION -ge $COMPARABLE_REFERENCE_VERSION ; then
+    :
+
+  else
+    :
+
+          { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: You are using $TOOLCHAIN_TYPE older than $TOOLCHAIN_MINIMUM_VERSION. This is not a supported configuration." >&5
+$as_echo "$as_me: WARNING: You are using $TOOLCHAIN_TYPE older than $TOOLCHAIN_MINIMUM_VERSION. This is not a supported configuration." >&2;}
+
+
+  fi
+
+
+
+
+
+
+
+
+
+
+
+
+  fi
+
   #
   # Setup the preprocessor (CPP and CXXCPP)
   #
@@ -45332,7 +45477,7 @@
   # On Windows, we need to set RC flags.
   if test "x$TOOLCHAIN_TYPE" = xmicrosoft; then
     RC_FLAGS="-nologo -l0x409"
-    if test "x$VARIANT" = xOPT; then
+    if test "x$DEBUG_LEVEL" = xrelease; then
       RC_FLAGS="$RC_FLAGS -DNDEBUG"
     fi
 
@@ -45358,8 +45503,6 @@
   fi
 
 
-# FIXME: Currently we must test this after toolchain but before flags. Fix!
-
 # Now we can test some aspects on the target using configure macros.
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5
@@ -46015,7 +46158,7 @@
       SET_EXECUTABLE_ORIGIN='-Wl,-rpath,@loader_path/.'
       SET_SHARED_LIBRARY_ORIGIN="$SET_EXECUTABLE_ORIGIN"
       SET_SHARED_LIBRARY_NAME='-Wl,-install_name,@rpath/$1'
-      SET_SHARED_LIBRARY_MAPFILE=''
+      SET_SHARED_LIBRARY_MAPFILE='-Wl,-exported_symbols_list,$1'
     else
       # Default works for linux, might work on other platforms as well.
       SHARED_LIBRARY_FLAGS='-shared'
@@ -46035,7 +46178,7 @@
       SET_EXECUTABLE_ORIGIN='-Wl,-rpath,@loader_path/.'
       SET_SHARED_LIBRARY_ORIGIN="$SET_EXECUTABLE_ORIGIN"
       SET_SHARED_LIBRARY_NAME='-Wl,-install_name,@rpath/$1'
-      SET_SHARED_LIBRARY_MAPFILE=''
+      SET_SHARED_LIBRARY_MAPFILE='-Wl,-exported_symbols_list,$1'
     else
       # Default works for linux, might work on other platforms as well.
       PICFLAG='-fPIC'
@@ -46071,7 +46214,7 @@
     SET_EXECUTABLE_ORIGIN=''
     SET_SHARED_LIBRARY_ORIGIN=''
     SET_SHARED_LIBRARY_NAME=''
-    SET_SHARED_LIBRARY_MAPFILE=''
+    SET_SHARED_LIBRARY_MAPFILE='-def:$1'
   fi
 
 
@@ -46151,6 +46294,10 @@
       # no adjustment
       ;;
     slowdebug )
+      # FIXME: By adding this to C(XX)FLAGS_DEBUG_OPTIONS it
+      # get's added conditionally on whether we produce debug symbols or not.
+      # This is most likely not really correct.
+
       # Add runtime stack smashing and undefined behavior checks.
       # Not all versions of gcc support -fstack-protector
       STACK_PROTECTOR_CFLAG="-fstack-protector-all"
@@ -46311,7 +46458,7 @@
       CXX_O_FLAG_HIGHEST="-xO4 -Qoption cg -Qrm-s -Qoption cg -Qiselect-T0 $CC_HIGHEST -xprefetch=auto,explicit -xchip=ultra"
       CXX_O_FLAG_HI="-xO4 -Qoption cg -Qrm-s -Qoption cg -Qiselect-T0"
       CXX_O_FLAG_NORM="-xO2 -Qoption cg -Qrm-s -Qoption cg -Qiselect-T0"
-      C_O_FLAG_DEBUG=""
+      CXX_O_FLAG_DEBUG=""
       CXX_O_FLAG_NONE=""
     fi
   else
@@ -46492,8 +46639,8 @@
     # avoid bundling msvcpNNN.dll. Doesn't work with newer versions of visual
     # studio.
     if test "x$TOOLCHAIN_VERSION" = "x2010"; then
-      COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS_JDK \
-          -D_STATIC_CPPLIB -D_DISABLE_DEPRECATE_STATIC_CPPLIB"
+      STATIC_CPPLIB_FLAGS="-D_STATIC_CPPLIB -D_DISABLE_DEPRECATE_STATIC_CPPLIB"
+      COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS_JDK $STATIC_CPPLIB_FLAGS"
     fi
   fi
 
@@ -46561,9 +46708,6 @@
   # Set some additional per-OS defines.
   if test "x$OPENJDK_TARGET_OS" = xmacosx; then
     COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS_JDK -D_ALLBSD_SOURCE -D_DARWIN_UNLIMITED_SELECT"
-  elif test "x$OPENJDK_TARGET_OS" = xaix; then
-    # FIXME: PPC64 should not be here.
-    COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS_JDK -DPPC64"
   elif test "x$OPENJDK_TARGET_OS" = xbsd; then
     COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS_JDK -D_ALLBSD_SOURCE"
   fi
@@ -46621,36 +46765,34 @@
   # Setup LDFLAGS et al.
   #
 
-  # Now this is odd. The JDK native libraries have to link against libjvm.so
-  # On 32-bit machines there is normally two distinct libjvm.so:s, client and server.
-  # Which should we link to? Are we lucky enough that the binary api to the libjvm.so library
-  # is identical for client and server? Yes. Which is picked at runtime (client or server)?
-  # Neither, since the chosen libjvm.so has already been loaded by the launcher, all the following
-  # libraries will link to whatever is in memory. Yuck.
-  #
-  # Thus we offer the compiler to find libjvm.so first in server then in client. It works. Ugh.
   if test "x$TOOLCHAIN_TYPE" = xmicrosoft; then
-    LDFLAGS_JDK="$LDFLAGS_JDK -nologo -opt:ref -incremental:no"
+    LDFLAGS_MICROSOFT="-nologo -opt:ref"
+    LDFLAGS_JDK="$LDFLAGS_JDK $LDFLAGS_MICROSOFT -incremental:no"
     if test "x$OPENJDK_TARGET_CPU_BITS" = "x32"; then
-      LDFLAGS_JDK="$LDFLAGS_JDK -safeseh"
+      LDFLAGS_SAFESH="-safeseh"
+      LDFLAGS_JDK="$LDFLAGS_JDK $LDFLAGS_SAFESH"
     fi
     # TODO: make -debug optional "--disable-full-debug-symbols"
-    LDFLAGS_JDK="$LDFLAGS_JDK -debug"
+    LDFLAGS_MICROSOFT_DEBUG="-debug"
+    LDFLAGS_JDK="$LDFLAGS_JDK $LDFLAGS_MICROSOFT_DEBUG"
   elif test "x$TOOLCHAIN_TYPE" = xgcc; then
     # If this is a --hash-style=gnu system, use --hash-style=both, why?
     # We have previously set HAS_GNU_HASH if this is the case
     if test -n "$HAS_GNU_HASH"; then
-      LDFLAGS_JDK="${LDFLAGS_JDK} -Wl,--hash-style=both"
+      LDFLAGS_HASH_STYLE="-Wl,--hash-style=both"
+      LDFLAGS_JDK="${LDFLAGS_JDK} $LDFLAGS_HASH_STYLE"
     fi
     if test "x$OPENJDK_TARGET_OS" = xlinux; then
       # And since we now know that the linker is gnu, then add -z defs, to forbid
       # undefined symbols in object files.
-      LDFLAGS_JDK="${LDFLAGS_JDK} -Wl,-z,defs"
+      LDFLAGS_NO_UNDEF_SYM="-Wl,-z,defs"
+      LDFLAGS_JDK="${LDFLAGS_JDK} $LDFLAGS_NO_UNDEF_SYM"
       case $DEBUG_LEVEL in
         release )
           # tell linker to optimize libraries.
           # Should this be supplied to the OSS linker as well?
-          LDFLAGS_JDK="${LDFLAGS_JDK} -Wl,-O1"
+          LDFLAGS_DEBUGLEVEL_release="-Wl,-O1"
+          LDFLAGS_JDK="${LDFLAGS_JDK} $LDFLAGS_DEBUGLEVEL_release"
           ;;
         slowdebug )
           if test "x$HAS_LINKER_NOW" = "xtrue"; then
@@ -46677,10 +46819,13 @@
         esac
     fi
   elif test "x$TOOLCHAIN_TYPE" = xsolstudio; then
-    LDFLAGS_JDK="$LDFLAGS_JDK -Wl,-z,defs -xildoff -ztext"
-    LDFLAGS_CXX_JDK="$LDFLAGS_CXX_JDK -norunpath -xnolib"
+    LDFLAGS_SOLSTUDIO="-Wl,-z,defs"
+    LDFLAGS_JDK="$LDFLAGS_JDK $LDFLAGS_SOLSTUDIO -xildoff -ztext"
+    LDFLAGS_CXX_SOLSTUDIO="-norunpath"
+    LDFLAGS_CXX_JDK="$LDFLAGS_CXX_JDK $LDFLAGS_CXX_SOLSTUDIO -xnolib"
   elif test "x$TOOLCHAIN_TYPE" = xxlc; then
-    LDFLAGS_JDK="${LDFLAGS_JDK} -brtl -bnolibpath -bexpall -bernotok"
+    LDFLAGS_XLC="-brtl -bnolibpath -bexpall -bernotok"
+    LDFLAGS_JDK="${LDFLAGS_JDK} $LDFLAGS_XLC"
   fi
 
   # Customize LDFLAGS for executables
@@ -47324,6 +47469,10 @@
       DISABLE_WARNING_PREFIX="-Wno-"
       CFLAGS_WARNINGS_ARE_ERRORS="-Werror"
       ;;
+    xlc)
+      DISABLE_WARNING_PREFIX="-qsuppress="
+      CFLAGS_WARNINGS_ARE_ERRORS="-qhalt=w"
+      ;;
   esac
 
 
@@ -47353,7 +47502,11 @@
           # AIX doesn't support 'zipped' so use 'internal' as default
           with_native_debug_symbols="internal"
         else
-          with_native_debug_symbols="zipped"
+          if test "x$STATIC_BUILD" = xtrue; then
+            with_native_debug_symbols="none"
+          else
+            with_native_debug_symbols="zipped"
+          fi
         fi
 
 fi
@@ -55353,6 +55506,349 @@
 
           fi
 
+          if test "x$OPENJDK_TARGET_OS" = xmacosx; then
+            if test "x$FOUND_FREETYPE" != xyes; then
+              # Due to changes in OSX 10.11 XQuartz now installs to /opt/X11
+              FREETYPE_BASE_DIR="$SYSROOT/opt/X11"
+
+  POTENTIAL_FREETYPE_INCLUDE_PATH="$FREETYPE_BASE_DIR/include"
+  POTENTIAL_FREETYPE_LIB_PATH="$FREETYPE_BASE_DIR/lib"
+  METHOD="well-known location"
+
+  # Let's start with an optimistic view of the world :-)
+  FOUND_FREETYPE=yes
+
+  # First look for the canonical freetype main include file ft2build.h.
+  if ! test -s "$POTENTIAL_FREETYPE_INCLUDE_PATH/ft2build.h"; then
+    # Oh no! Let's try in the freetype2 directory. This is needed at least at Mac OS X Yosemite.
+    POTENTIAL_FREETYPE_INCLUDE_PATH="$POTENTIAL_FREETYPE_INCLUDE_PATH/freetype2"
+    if ! test -s "$POTENTIAL_FREETYPE_INCLUDE_PATH/ft2build.h"; then
+      # Fail.
+      FOUND_FREETYPE=no
+    fi
+  fi
+
+  if test "x$FOUND_FREETYPE" = xyes; then
+    # Include file found, let's continue the sanity check.
+    { $as_echo "$as_me:${as_lineno-$LINENO}: Found freetype include files at $POTENTIAL_FREETYPE_INCLUDE_PATH using $METHOD" >&5
+$as_echo "$as_me: Found freetype include files at $POTENTIAL_FREETYPE_INCLUDE_PATH using $METHOD" >&6;}
+
+    # Reset to default value
+    FREETYPE_BASE_NAME=freetype
+    FREETYPE_LIB_NAME="${LIBRARY_PREFIX}${FREETYPE_BASE_NAME}${SHARED_LIBRARY_SUFFIX}"
+    if ! test -s "$POTENTIAL_FREETYPE_LIB_PATH/$FREETYPE_LIB_NAME"; then
+      if test "x$OPENJDK_TARGET_OS" = xmacosx \
+          && test -s "$POTENTIAL_FREETYPE_LIB_PATH/${LIBRARY_PREFIX}freetype.6${SHARED_LIBRARY_SUFFIX}"; then
+        # On Mac OS X Yosemite, the symlink from libfreetype.dylib to libfreetype.6.dylib disappeared. Check
+        # for the .6 version explicitly.
+        FREETYPE_BASE_NAME=freetype.6
+        FREETYPE_LIB_NAME="${LIBRARY_PREFIX}${FREETYPE_BASE_NAME}${SHARED_LIBRARY_SUFFIX}"
+        { $as_echo "$as_me:${as_lineno-$LINENO}: Compensating for missing symlink by using version 6 explicitly" >&5
+$as_echo "$as_me: Compensating for missing symlink by using version 6 explicitly" >&6;}
+      else
+        { $as_echo "$as_me:${as_lineno-$LINENO}: Could not find $POTENTIAL_FREETYPE_LIB_PATH/$FREETYPE_LIB_NAME. Ignoring location." >&5
+$as_echo "$as_me: Could not find $POTENTIAL_FREETYPE_LIB_PATH/$FREETYPE_LIB_NAME. Ignoring location." >&6;}
+        FOUND_FREETYPE=no
+      fi
+    else
+      if test "x$OPENJDK_TARGET_OS" = xwindows; then
+        # On Windows, we will need both .lib and .dll file.
+        if ! test -s "$POTENTIAL_FREETYPE_LIB_PATH/${FREETYPE_BASE_NAME}.lib"; then
+          { $as_echo "$as_me:${as_lineno-$LINENO}: Could not find $POTENTIAL_FREETYPE_LIB_PATH/${FREETYPE_BASE_NAME}.lib. Ignoring location." >&5
+$as_echo "$as_me: Could not find $POTENTIAL_FREETYPE_LIB_PATH/${FREETYPE_BASE_NAME}.lib. Ignoring location." >&6;}
+          FOUND_FREETYPE=no
+        fi
+      elif test "x$OPENJDK_TARGET_OS" = xsolaris \
+          && test -s "$POTENTIAL_FREETYPE_LIB_PATH$OPENJDK_TARGET_CPU_ISADIR/$FREETYPE_LIB_NAME"; then
+        # Found lib in isa dir, use that instead.
+        POTENTIAL_FREETYPE_LIB_PATH="$POTENTIAL_FREETYPE_LIB_PATH$OPENJDK_TARGET_CPU_ISADIR"
+        { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting to use $POTENTIAL_FREETYPE_LIB_PATH instead" >&5
+$as_echo "$as_me: Rewriting to use $POTENTIAL_FREETYPE_LIB_PATH instead" >&6;}
+      fi
+    fi
+  fi
+
+  if test "x$FOUND_FREETYPE" = xyes; then
+
+  # Only process if variable expands to non-empty
+
+  if test "x$POTENTIAL_FREETYPE_INCLUDE_PATH" != x; then
+    if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
+
+  # Input might be given as Windows format, start by converting to
+  # unix format.
+  path="$POTENTIAL_FREETYPE_INCLUDE_PATH"
+  new_path=`$CYGPATH -u "$path"`
+
+  # Cygwin tries to hide some aspects of the Windows file system, such that binaries are
+  # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered
+  # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then
+  # "foo.exe" is OK but "foo" is an error.
+  #
+  # This test is therefore slightly more accurate than "test -f" to check for file precense.
+  # It is also a way to make sure we got the proper file name for the real test later on.
+  test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null`
+  if test "x$test_shortpath" = x; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is invalid." >&5
+$as_echo "$as_me: The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is invalid." >&6;}
+    as_fn_error $? "Cannot locate the the path of POTENTIAL_FREETYPE_INCLUDE_PATH" "$LINENO" 5
+  fi
+
+  # Call helper function which possibly converts this using DOS-style short mode.
+  # If so, the updated path is stored in $new_path.
+
+  input_path="$new_path"
+  # Check if we need to convert this using DOS-style short mode. If the path
+  # contains just simple characters, use it. Otherwise (spaces, weird characters),
+  # take no chances and rewrite it.
+  # Note: m4 eats our [], so we need to use [ and ] instead.
+  has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]`
+  if test "x$has_forbidden_chars" != x; then
+    # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \)
+    shortmode_path=`$CYGPATH -s -m -a "$input_path"`
+    path_after_shortmode=`$CYGPATH -u "$shortmode_path"`
+    if test "x$path_after_shortmode" != "x$input_to_shortpath"; then
+      # Going to short mode and back again did indeed matter. Since short mode is
+      # case insensitive, let's make it lowercase to improve readability.
+      shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
+      # Now convert it back to Unix-style (cygpath)
+      input_path=`$CYGPATH -u "$shortmode_path"`
+      new_path="$input_path"
+    fi
+  fi
+
+  test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/`
+  if test "x$test_cygdrive_prefix" = x; then
+    # As a simple fix, exclude /usr/bin since it's not a real path.
+    if test "x`$ECHO $new_path | $GREP ^/usr/bin/`" = x; then
+      # The path is in a Cygwin special directory (e.g. /home). We need this converted to
+      # a path prefixed by /cygdrive for fixpath to work.
+      new_path="$CYGWIN_ROOT_PATH$input_path"
+    fi
+  fi
+
+
+  if test "x$path" != "x$new_path"; then
+    POTENTIAL_FREETYPE_INCLUDE_PATH="$new_path"
+    { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting POTENTIAL_FREETYPE_INCLUDE_PATH to \"$new_path\"" >&5
+$as_echo "$as_me: Rewriting POTENTIAL_FREETYPE_INCLUDE_PATH to \"$new_path\"" >&6;}
+  fi
+
+    elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
+
+  path="$POTENTIAL_FREETYPE_INCLUDE_PATH"
+  has_colon=`$ECHO $path | $GREP ^.:`
+  new_path="$path"
+  if test "x$has_colon" = x; then
+    # Not in mixed or Windows style, start by that.
+    new_path=`cmd //c echo $path`
+  fi
+
+
+  input_path="$new_path"
+  # Check if we need to convert this using DOS-style short mode. If the path
+  # contains just simple characters, use it. Otherwise (spaces, weird characters),
+  # take no chances and rewrite it.
+  # Note: m4 eats our [], so we need to use [ and ] instead.
+  has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]`
+  if test "x$has_forbidden_chars" != x; then
+    # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \)
+    new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
+  fi
+
+
+  windows_path="$new_path"
+  if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
+    unix_path=`$CYGPATH -u "$windows_path"`
+    new_path="$unix_path"
+  elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
+    unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'`
+    new_path="$unix_path"
+  fi
+
+  if test "x$path" != "x$new_path"; then
+    POTENTIAL_FREETYPE_INCLUDE_PATH="$new_path"
+    { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting POTENTIAL_FREETYPE_INCLUDE_PATH to \"$new_path\"" >&5
+$as_echo "$as_me: Rewriting POTENTIAL_FREETYPE_INCLUDE_PATH to \"$new_path\"" >&6;}
+  fi
+
+  # Save the first 10 bytes of this path to the storage, so fixpath can work.
+  all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}")
+
+    else
+      # We're on a unix platform. Hooray! :)
+      path="$POTENTIAL_FREETYPE_INCLUDE_PATH"
+      has_space=`$ECHO "$path" | $GREP " "`
+      if test "x$has_space" != x; then
+        { $as_echo "$as_me:${as_lineno-$LINENO}: The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is invalid." >&5
+$as_echo "$as_me: The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is invalid." >&6;}
+        as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5
+      fi
+
+      # Use eval to expand a potential ~
+      eval path="$path"
+      if test ! -f "$path" && test ! -d "$path"; then
+        as_fn_error $? "The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is not found." "$LINENO" 5
+      fi
+
+      if test -d "$path"; then
+        POTENTIAL_FREETYPE_INCLUDE_PATH="`cd "$path"; $THEPWDCMD -L`"
+      else
+        dir="`$DIRNAME "$path"`"
+        base="`$BASENAME "$path"`"
+        POTENTIAL_FREETYPE_INCLUDE_PATH="`cd "$dir"; $THEPWDCMD -L`/$base"
+      fi
+    fi
+  fi
+
+
+  # Only process if variable expands to non-empty
+
+  if test "x$POTENTIAL_FREETYPE_LIB_PATH" != x; then
+    if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
+
+  # Input might be given as Windows format, start by converting to
+  # unix format.
+  path="$POTENTIAL_FREETYPE_LIB_PATH"
+  new_path=`$CYGPATH -u "$path"`
+
+  # Cygwin tries to hide some aspects of the Windows file system, such that binaries are
+  # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered
+  # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then
+  # "foo.exe" is OK but "foo" is an error.
+  #
+  # This test is therefore slightly more accurate than "test -f" to check for file precense.
+  # It is also a way to make sure we got the proper file name for the real test later on.
+  test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null`
+  if test "x$test_shortpath" = x; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is invalid." >&5
+$as_echo "$as_me: The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is invalid." >&6;}
+    as_fn_error $? "Cannot locate the the path of POTENTIAL_FREETYPE_LIB_PATH" "$LINENO" 5
+  fi
+
+  # Call helper function which possibly converts this using DOS-style short mode.
+  # If so, the updated path is stored in $new_path.
+
+  input_path="$new_path"
+  # Check if we need to convert this using DOS-style short mode. If the path
+  # contains just simple characters, use it. Otherwise (spaces, weird characters),
+  # take no chances and rewrite it.
+  # Note: m4 eats our [], so we need to use [ and ] instead.
+  has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]`
+  if test "x$has_forbidden_chars" != x; then
+    # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \)
+    shortmode_path=`$CYGPATH -s -m -a "$input_path"`
+    path_after_shortmode=`$CYGPATH -u "$shortmode_path"`
+    if test "x$path_after_shortmode" != "x$input_to_shortpath"; then
+      # Going to short mode and back again did indeed matter. Since short mode is
+      # case insensitive, let's make it lowercase to improve readability.
+      shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
+      # Now convert it back to Unix-style (cygpath)
+      input_path=`$CYGPATH -u "$shortmode_path"`
+      new_path="$input_path"
+    fi
+  fi
+
+  test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/`
+  if test "x$test_cygdrive_prefix" = x; then
+    # As a simple fix, exclude /usr/bin since it's not a real path.
+    if test "x`$ECHO $new_path | $GREP ^/usr/bin/`" = x; then
+      # The path is in a Cygwin special directory (e.g. /home). We need this converted to
+      # a path prefixed by /cygdrive for fixpath to work.
+      new_path="$CYGWIN_ROOT_PATH$input_path"
+    fi
+  fi
+
+
+  if test "x$path" != "x$new_path"; then
+    POTENTIAL_FREETYPE_LIB_PATH="$new_path"
+    { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting POTENTIAL_FREETYPE_LIB_PATH to \"$new_path\"" >&5
+$as_echo "$as_me: Rewriting POTENTIAL_FREETYPE_LIB_PATH to \"$new_path\"" >&6;}
+  fi
+
+    elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
+
+  path="$POTENTIAL_FREETYPE_LIB_PATH"
+  has_colon=`$ECHO $path | $GREP ^.:`
+  new_path="$path"
+  if test "x$has_colon" = x; then
+    # Not in mixed or Windows style, start by that.
+    new_path=`cmd //c echo $path`
+  fi
+
+
+  input_path="$new_path"
+  # Check if we need to convert this using DOS-style short mode. If the path
+  # contains just simple characters, use it. Otherwise (spaces, weird characters),
+  # take no chances and rewrite it.
+  # Note: m4 eats our [], so we need to use [ and ] instead.
+  has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]`
+  if test "x$has_forbidden_chars" != x; then
+    # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \)
+    new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
+  fi
+
+
+  windows_path="$new_path"
+  if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
+    unix_path=`$CYGPATH -u "$windows_path"`
+    new_path="$unix_path"
+  elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
+    unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'`
+    new_path="$unix_path"
+  fi
+
+  if test "x$path" != "x$new_path"; then
+    POTENTIAL_FREETYPE_LIB_PATH="$new_path"
+    { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting POTENTIAL_FREETYPE_LIB_PATH to \"$new_path\"" >&5
+$as_echo "$as_me: Rewriting POTENTIAL_FREETYPE_LIB_PATH to \"$new_path\"" >&6;}
+  fi
+
+  # Save the first 10 bytes of this path to the storage, so fixpath can work.
+  all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}")
+
+    else
+      # We're on a unix platform. Hooray! :)
+      path="$POTENTIAL_FREETYPE_LIB_PATH"
+      has_space=`$ECHO "$path" | $GREP " "`
+      if test "x$has_space" != x; then
+        { $as_echo "$as_me:${as_lineno-$LINENO}: The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is invalid." >&5
+$as_echo "$as_me: The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is invalid." >&6;}
+        as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5
+      fi
+
+      # Use eval to expand a potential ~
+      eval path="$path"
+      if test ! -f "$path" && test ! -d "$path"; then
+        as_fn_error $? "The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is not found." "$LINENO" 5
+      fi
+
+      if test -d "$path"; then
+        POTENTIAL_FREETYPE_LIB_PATH="`cd "$path"; $THEPWDCMD -L`"
+      else
+        dir="`$DIRNAME "$path"`"
+        base="`$BASENAME "$path"`"
+        POTENTIAL_FREETYPE_LIB_PATH="`cd "$dir"; $THEPWDCMD -L`/$base"
+      fi
+    fi
+  fi
+
+
+    FREETYPE_INCLUDE_PATH="$POTENTIAL_FREETYPE_INCLUDE_PATH"
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for freetype includes" >&5
+$as_echo_n "checking for freetype includes... " >&6; }
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $FREETYPE_INCLUDE_PATH" >&5
+$as_echo "$FREETYPE_INCLUDE_PATH" >&6; }
+    FREETYPE_LIB_PATH="$POTENTIAL_FREETYPE_LIB_PATH"
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for freetype libraries" >&5
+$as_echo_n "checking for freetype libraries... " >&6; }
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $FREETYPE_LIB_PATH" >&5
+$as_echo "$FREETYPE_LIB_PATH" >&6; }
+  fi
+
+            fi
+          fi
+
           if test "x$FOUND_FREETYPE" != xyes; then
             FREETYPE_BASE_DIR="$SYSROOT/usr/sfw"
 
@@ -58396,7 +58892,7 @@
     FOUND_MEM=yes
   elif test -x /usr/sbin/prtconf; then
     # Looks like a Solaris or AIX system
-    MEMORY_SIZE=`/usr/sbin/prtconf | grep "^Memory [Ss]ize" | awk '{ print $3 }'`
+    MEMORY_SIZE=`/usr/sbin/prtconf 2> /dev/null | grep "^Memory [Ss]ize" | awk '{ print $3 }'`
     FOUND_MEM=yes
   elif test -x /usr/sbin/sysctl; then
     # Looks like a MacOSX system
@@ -59224,9 +59720,9 @@
     fi
     if test "x${TOOLCHAIN_TYPE}" = "xgcc"; then
 
-  cd ${CONFIGURESUPPORT_OUTPUTDIR}/icecc \
+  ( cd ${CONFIGURESUPPORT_OUTPUTDIR}/icecc \
       && ${ICECC_CREATE_ENV} ${icecc_gcc_arg} ${CC} ${CXX} > \
-          ${icecc_create_env_log} 2>&1
+          ${icecc_create_env_log} 2>&1 )
   if test "$?" != "0"; then
     { $as_echo "$as_me:${as_lineno-$LINENO}: icecc-create-env output:" >&5
 $as_echo "$as_me: icecc-create-env output:" >&6;}
@@ -59443,8 +59939,8 @@
 
 
 
-  cd ${CONFIGURESUPPORT_OUTPUTDIR}/icecc \
-      && ${ICECC_CREATE_ENV} --clang ${CC} ${ICECC_WRAPPER} > ${icecc_create_env_log} 2>&1
+  ( cd ${CONFIGURESUPPORT_OUTPUTDIR}/icecc \
+      && ${ICECC_CREATE_ENV} --clang ${CC} ${ICECC_WRAPPER} > ${icecc_create_env_log} 2>&1 )
   if test "$?" != "0"; then
     { $as_echo "$as_me:${as_lineno-$LINENO}: icecc-create-env output:" >&5
 $as_echo "$as_me: icecc-create-env output:" >&6;}
@@ -59475,9 +59971,9 @@
       icecc_create_env_log_build="${CONFIGURESUPPORT_OUTPUTDIR}/icecc/icecc_create_env_build.log"
       if test "x${BUILD_CC##*/}" = "xgcc" ||  test "x${BUILD_CC##*/}" = "xcc"; then
 
-  cd ${CONFIGURESUPPORT_OUTPUTDIR}/icecc \
+  ( cd ${CONFIGURESUPPORT_OUTPUTDIR}/icecc \
       && ${ICECC_CREATE_ENV} ${icecc_gcc_arg} ${BUILD_CC} ${BUILD_CXX} > \
-            ${icecc_create_env_log_build} 2>&1
+            ${icecc_create_env_log_build} 2>&1 )
   if test "$?" != "0"; then
     { $as_echo "$as_me:${as_lineno-$LINENO}: icecc-create-env output:" >&5
 $as_echo "$as_me: icecc-create-env output:" >&6;}
@@ -59488,8 +59984,8 @@
 
       elif test "x${BUILD_CC##*/}" = "xclang"; then
 
-  cd ${CONFIGURESUPPORT_OUTPUTDIR}/icecc \
-      && ${ICECC_CREATE_ENV} --clang ${BUILD_CC} ${ICECC_WRAPPER} > ${icecc_create_env_log_build} 2>&1
+  ( cd ${CONFIGURESUPPORT_OUTPUTDIR}/icecc \
+      && ${ICECC_CREATE_ENV} --clang ${BUILD_CC} ${ICECC_WRAPPER} > ${icecc_create_env_log_build} 2>&1 )
   if test "$?" != "0"; then
     { $as_echo "$as_me:${as_lineno-$LINENO}: icecc-create-env output:" >&5
 $as_echo "$as_me: icecc-create-env output:" >&6;}
--- a/common/autoconf/help.m4	Mon Feb 15 14:25:21 2016 +0000
+++ b/common/autoconf/help.m4	Wed Jul 05 21:20:03 2017 +0200
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2011, 2016, 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
@@ -159,7 +159,9 @@
 # called at the very beginning in configure.ac.
 AC_DEFUN_ONCE([HELP_PRINT_ADDITIONAL_HELP_AND_EXIT],
 [
-  if test "x$CONFIGURE_PRINT_TOOLCHAIN_LIST" != x; then
+  if test "x$CONFIGURE_PRINT_ADDITIONAL_HELP" != x; then
+
+    # Print available toolchains
     $PRINTF "The following toolchains are available as arguments to --with-toolchain-type.\n"
     $PRINTF "Which are valid to use depends on the build platform.\n"
     for toolchain in $VALID_TOOLCHAINS_all; do
--- a/common/autoconf/hotspot.m4	Mon Feb 15 14:25:21 2016 +0000
+++ b/common/autoconf/hotspot.m4	Wed Jul 05 21:20:03 2017 +0200
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2011, 2016, 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
@@ -114,21 +114,6 @@
   AC_SUBST(JVM_VARIANT_ZEROSHARK)
   AC_SUBST(JVM_VARIANT_CORE)
 
-  INCLUDE_SA=true
-  if test "x$JVM_VARIANT_ZERO" = xtrue ; then
-    INCLUDE_SA=false
-  fi
-  if test "x$JVM_VARIANT_ZEROSHARK" = xtrue ; then
-    INCLUDE_SA=false
-  fi
-  if test "x$OPENJDK_TARGET_OS" = xaix ; then
-    INCLUDE_SA=false
-  fi
-  if test "x$OPENJDK_TARGET_CPU" = xaarch64; then
-    INCLUDE_SA=false
-  fi
-  AC_SUBST(INCLUDE_SA)
-
   if test "x$OPENJDK_TARGET_OS" = "xmacosx"; then
     MACOSX_UNIVERSAL="true"
   fi
--- a/common/autoconf/jdk-options.m4	Mon Feb 15 14:25:21 2016 +0000
+++ b/common/autoconf/jdk-options.m4	Wed Jul 05 21:20:03 2017 +0200
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2011, 2016, 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
@@ -66,7 +66,7 @@
       ], [ENABLE_DEBUG="no"])
 
   AC_ARG_WITH([debug-level], [AS_HELP_STRING([--with-debug-level],
-      [set the debug level (release, fastdebug, slowdebug, optimized (HotSpot build only)) @<:@release@:>@])],
+      [set the debug level (release, fastdebug, slowdebug, optimized) @<:@release@:>@])],
       [
         DEBUG_LEVEL="${withval}"
         if test "x$ENABLE_DEBUG" = xyes; then
@@ -79,7 +79,7 @@
       test "x$DEBUG_LEVEL" != xoptimized && \
       test "x$DEBUG_LEVEL" != xfastdebug && \
       test "x$DEBUG_LEVEL" != xslowdebug; then
-    AC_MSG_ERROR([Allowed debug levels are: release, fastdebug and slowdebug])
+    AC_MSG_ERROR([Allowed debug levels are: release, fastdebug, slowdebug and optimized])
   fi
 ])
 
@@ -176,6 +176,22 @@
   fi
   AC_SUBST(UNLIMITED_CRYPTO)
 
+  # Should we build the serviceability agent (SA)?
+  INCLUDE_SA=true
+  if test "x$JVM_VARIANT_ZERO" = xtrue ; then
+    INCLUDE_SA=false
+  fi
+  if test "x$JVM_VARIANT_ZEROSHARK" = xtrue ; then
+    INCLUDE_SA=false
+  fi
+  if test "x$OPENJDK_TARGET_OS" = xaix ; then
+    INCLUDE_SA=false
+  fi
+  if test "x$OPENJDK_TARGET_CPU" = xaarch64; then
+    INCLUDE_SA=false
+  fi
+  AC_SUBST(INCLUDE_SA)
+
   # Compress jars
   COMPRESS_JARS=false
 
@@ -222,7 +238,7 @@
   AC_MSG_CHECKING([what type of native debug symbols to use])
   AC_ARG_WITH([native-debug-symbols],
       [AS_HELP_STRING([--with-native-debug-symbols],
-      [set the native debug symbol configuration (none, internal, external, zipped) @<:@zipped@:>@])],
+      [set the native debug symbol configuration (none, internal, external, zipped) @<:@varying@:>@])],
       [
         if test "x$OPENJDK_TARGET_OS" = xaix; then
           if test "x$withval" = xexternal || test "x$withval" = xzipped; then
@@ -235,7 +251,11 @@
           # AIX doesn't support 'zipped' so use 'internal' as default
           with_native_debug_symbols="internal"
         else
-          with_native_debug_symbols="zipped"
+          if test "x$STATIC_BUILD" = xtrue; then
+            with_native_debug_symbols="none"
+          else
+            with_native_debug_symbols="zipped"
+          fi
         fi
       ])
   NATIVE_DEBUG_SYMBOLS=$with_native_debug_symbols
@@ -258,7 +278,7 @@
     # Hotspot legacy support, not relevant with COPY_DEBUG_SYMBOLS=true
     DEBUG_BINARIES=false
     STRIP_POLICY=min_strip
-    
+
   elif test "x$NATIVE_DEBUG_SYMBOLS" = xnone; then
     COMPILE_WITH_DEBUG_SYMBOLS=false
     COPY_DEBUG_SYMBOLS=false
@@ -275,7 +295,7 @@
     DEBUG_BINARIES=true
     STRIP_POLICY=no_strip
     STRIP=""
-    
+
   elif test "x$NATIVE_DEBUG_SYMBOLS" = xexternal; then
 
     if test "x$OPENJDK_TARGET_OS" = xsolaris || test "x$OPENJDK_TARGET_OS" = xlinux; then
@@ -356,7 +376,7 @@
 
 ################################################################################
 #
-# Static build support.  When enabled will generate static 
+# Static build support.  When enabled will generate static
 # libraries instead of shared libraries for all JDK libs.
 #
 AC_DEFUN_ONCE([JDKOPT_SETUP_STATIC_BUILD],
--- a/common/autoconf/lib-freetype.m4	Mon Feb 15 14:25:21 2016 +0000
+++ b/common/autoconf/lib-freetype.m4	Wed Jul 05 21:20:03 2017 +0200
@@ -349,6 +349,14 @@
             LIB_CHECK_POTENTIAL_FREETYPE([$FREETYPE_BASE_DIR/include], [$FREETYPE_BASE_DIR/lib], [well-known location])
           fi
 
+          if test "x$OPENJDK_TARGET_OS" = xmacosx; then
+            if test "x$FOUND_FREETYPE" != xyes; then
+              # Due to changes in OSX 10.11 XQuartz now installs to /opt/X11
+              FREETYPE_BASE_DIR="$SYSROOT/opt/X11"
+              LIB_CHECK_POTENTIAL_FREETYPE([$FREETYPE_BASE_DIR/include], [$FREETYPE_BASE_DIR/lib], [well-known location])
+            fi
+          fi
+
           if test "x$FOUND_FREETYPE" != xyes; then
             FREETYPE_BASE_DIR="$SYSROOT/usr/sfw"
             LIB_CHECK_POTENTIAL_FREETYPE([$FREETYPE_BASE_DIR/include], [$FREETYPE_BASE_DIR/lib], [well-known location])
--- a/common/autoconf/spec.gmk.in	Mon Feb 15 14:25:21 2016 +0000
+++ b/common/autoconf/spec.gmk.in	Wed Jul 05 21:20:03 2017 +0200
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2011, 2016, 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
@@ -36,10 +36,12 @@
 # A self-referential reference to this file.
 SPEC:=@SPEC@
 
-# SPACE is defined in MakeBase.gmk, but it is also used in := rules here for some
-# toolchains, and is needed if MakeBase.gmk is not included before this file.
+# SPACE and COMMA are defined in MakeBase.gmk, but they are also used in
+# some definitions here, and are needed if MakeBase.gmk is not included before
+# this file.
 X:=
 SPACE:=$(X) $(X)
+COMMA:=,
 
 # What make to use for main processing, after bootstrapping top-level Makefile.
 MAKE := @MAKE@
@@ -350,10 +352,8 @@
 CXXFLAGS_JDKEXE:=@CXXFLAGS_JDKEXE@
 
 CXX:=@FIXPATH@ @CCACHE@ @ICECC@ @CXX@
-#CXXFLAGS:=@CXXFLAGS@
 
 CPP:=@FIXPATH@ @CPP@
-#CPPFLAGS:=@CPPFLAGS@
 
 # The linker can be gcc or ld on unix systems, or link.exe on windows systems.
 LD:=@FIXPATH@ @LD@
@@ -501,7 +501,7 @@
 INTERIM_LANGTOOLS_JAR = $(BUILDTOOLS_OUTPUTDIR)/interim_langtools.jar
 INTERIM_LANGTOOLS_ARGS = "-Xbootclasspath/p:$(INTERIM_LANGTOOLS_JAR)" -cp $(INTERIM_LANGTOOLS_JAR)
 NEW_JAVAC   = $(INTERIM_LANGTOOLS_ARGS) com.sun.tools.javac.Main
-NEW_JAVADOC = $(INTERIM_LANGTOOLS_ARGS) jdk.javadoc.internal.tool.Main 
+NEW_JAVADOC = $(INTERIM_LANGTOOLS_ARGS) jdk.javadoc.internal.tool.Main
 
 # Base flags for RC
 # Guarding this against resetting value. Legacy make files include spec multiple
--- a/common/autoconf/toolchain.m4	Mon Feb 15 14:25:21 2016 +0000
+++ b/common/autoconf/toolchain.m4	Wed Jul 05 21:20:03 2017 +0200
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2011, 2016, 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
@@ -50,6 +50,67 @@
 TOOLCHAIN_DESCRIPTION_solstudio="Oracle Solaris Studio"
 TOOLCHAIN_DESCRIPTION_xlc="IBM XL C/C++"
 
+# Minimum supported versions, empty means unspecified
+TOOLCHAIN_MINIMUM_VERSION_clang="3.2"
+TOOLCHAIN_MINIMUM_VERSION_gcc="4.3"
+TOOLCHAIN_MINIMUM_VERSION_microsoft=""
+TOOLCHAIN_MINIMUM_VERSION_solstudio="5.12"
+TOOLCHAIN_MINIMUM_VERSION_xlc=""
+
+# Prepare the system so that TOOLCHAIN_CHECK_COMPILER_VERSION can be called.
+# Must have CC_VERSION_NUMBER and CXX_VERSION_NUMBER.
+AC_DEFUN([TOOLCHAIN_PREPARE_FOR_VERSION_COMPARISONS],
+[
+  if test "x$CC_VERSION_NUMBER" != "x$CXX_VERSION_NUMBER"; then
+    AC_MSG_WARN([C and C++ compiler has different version numbers, $CC_VERSION_NUMBER vs $CXX_VERSION_NUMBER.])
+    AC_MSG_WARN([This typically indicates a broken setup, and is not supported])
+  fi
+
+  # We only check CC_VERSION_NUMBER since we assume CXX_VERSION_NUMBER is equal.
+  if [ [[ "$CC_VERSION_NUMBER" =~ (.*\.){3} ]] ]; then
+    AC_MSG_WARN([C compiler version number has more than three parts (X.Y.Z): $CC_VERSION_NUMBER. Comparisons might be wrong.])
+  fi
+
+  if [ [[  "$CC_VERSION_NUMBER" =~ [0-9]{6} ]] ]; then
+    AC_MSG_WARN([C compiler version number has a part larger than 99999: $CC_VERSION_NUMBER. Comparisons might be wrong.])
+  fi
+
+  COMPARABLE_ACTUAL_VERSION=`$AWK -F. '{ printf("%05d%05d%05d\n", [$]1, [$]2, [$]3) }' <<< "$CC_VERSION_NUMBER"`
+])
+
+# Check if the configured compiler (C and C++) is of a specific version or
+# newer. TOOLCHAIN_PREPARE_FOR_VERSION_COMPARISONS must have been called before.
+#
+# Arguments:
+#   VERSION:   The version string to check against the found version
+#   IF_AT_LEAST:   block to run if the compiler is at least this version (>=)
+#   IF_OLDER_THAN:   block to run if the compiler is older than this version (<)
+BASIC_DEFUN_NAMED([TOOLCHAIN_CHECK_COMPILER_VERSION],
+    [*VERSION IF_AT_LEAST IF_OLDER_THAN], [$@],
+[
+  # Need to assign to a variable since m4 is blocked from modifying parts in [].
+  REFERENCE_VERSION=ARG_VERSION
+
+  if [ [[ "$REFERENCE_VERSION" =~ (.*\.){3} ]] ]; then
+    AC_MSG_ERROR([Internal errror: Cannot compare to ARG_VERSION, only three parts (X.Y.Z) is supported])
+  fi
+
+  if [ [[ "$REFERENCE_VERSION" =~ [0-9]{6} ]] ]; then
+    AC_MSG_ERROR([Internal errror: Cannot compare to ARG_VERSION, only parts < 99999 is supported])
+  fi
+
+  # Version comparison method inspired by http://stackoverflow.com/a/24067243
+  COMPARABLE_REFERENCE_VERSION=`$AWK -F. '{ printf("%05d%05d%05d\n", [$]1, [$]2, [$]3) }' <<< "$REFERENCE_VERSION"`
+
+  if test $COMPARABLE_ACTUAL_VERSION -ge $COMPARABLE_REFERENCE_VERSION ; then
+    :
+    ARG_IF_AT_LEAST
+  else
+    :
+    ARG_IF_OLDER_THAN
+  fi
+])
+
 # Setup a number of variables describing how native output files are
 # named on this platform/toolchain.
 AC_DEFUN([TOOLCHAIN_SETUP_FILENAME_PATTERNS],
@@ -175,6 +236,8 @@
   # Use indirect variable referencing
   toolchain_var_name=TOOLCHAIN_DESCRIPTION_$TOOLCHAIN_TYPE
   TOOLCHAIN_DESCRIPTION=${!toolchain_var_name}
+  toolchain_var_name=TOOLCHAIN_MINIMUM_VERSION_$TOOLCHAIN_TYPE
+  TOOLCHAIN_MINIMUM_VERSION=${!toolchain_var_name}
   toolchain_var_name=TOOLCHAIN_CC_BINARY_$TOOLCHAIN_TYPE
   TOOLCHAIN_CC_BINARY=${!toolchain_var_name}
   toolchain_var_name=TOOLCHAIN_CXX_BINARY_$TOOLCHAIN_TYPE
@@ -217,8 +280,14 @@
     export INCLUDE="$VS_INCLUDE"
     export LIB="$VS_LIB"
   else
-    # Currently we do not define this for other toolchains. This might change as the need arise.
-    TOOLCHAIN_VERSION=
+    if test "x$XCODE_VERSION_OUTPUT" != x; then
+      # For Xcode, we set the Xcode version as TOOLCHAIN_VERSION
+      TOOLCHAIN_VERSION=`$ECHO $XCODE_VERSION_OUTPUT | $CUT -f 2 -d ' '`
+      TOOLCHAIN_DESCRIPTION="$TOOLCHAIN_DESCRIPTION from Xcode"
+    else
+      # Currently we do not define this for other toolchains. This might change as the need arise.
+      TOOLCHAIN_VERSION=
+    fi
   fi
   AC_SUBST(TOOLCHAIN_VERSION)
 
@@ -257,7 +326,7 @@
 #
 # $1 = compiler to test (CC or CXX)
 # $2 = human readable name of compiler (C or C++)
-AC_DEFUN([TOOLCHAIN_CHECK_COMPILER_VERSION],
+AC_DEFUN([TOOLCHAIN_EXTRACT_COMPILER_VERSION],
 [
   COMPILER=[$]$1
   COMPILER_NAME=$2
@@ -354,7 +423,7 @@
     # Collapse compiler output into a single line
     COMPILER_VERSION_STRING=`$ECHO $COMPILER_VERSION_OUTPUT`
     COMPILER_VERSION_NUMBER=`$ECHO $COMPILER_VERSION_OUTPUT | \
-        $SED -e 's/^.*clang version \(@<:@1-9@:>@@<:@0-9.@:>@*\).*$/\1/'`
+        $SED -e 's/^.* version \(@<:@1-9@:>@@<:@0-9.@:>@*\).*$/\1/'`
   else
       AC_MSG_ERROR([Unknown toolchain type $TOOLCHAIN_TYPE.])
   fi
@@ -451,7 +520,7 @@
     fi
   fi
 
-  TOOLCHAIN_CHECK_COMPILER_VERSION([$1], [$COMPILER_NAME])
+  TOOLCHAIN_EXTRACT_COMPILER_VERSION([$1], [$COMPILER_NAME])
 ])
 
 # Detect the core components of the toolchain, i.e. the compilers (CC and CXX),
@@ -471,6 +540,20 @@
   # Now that we have resolved CXX ourself, let autoconf have its go at it
   AC_PROG_CXX([$CXX])
 
+  # This is the compiler version number on the form X.Y[.Z]
+  AC_SUBST(CC_VERSION_NUMBER)
+  AC_SUBST(CXX_VERSION_NUMBER)
+
+  TOOLCHAIN_PREPARE_FOR_VERSION_COMPARISONS
+
+  if test "x$TOOLCHAIN_MINIMUM_VERSION" != x; then
+    TOOLCHAIN_CHECK_COMPILER_VERSION(VERSION: $TOOLCHAIN_MINIMUM_VERSION,
+        IF_OLDER_THAN: [
+          AC_MSG_WARN([You are using $TOOLCHAIN_TYPE older than $TOOLCHAIN_MINIMUM_VERSION. This is not a supported configuration.])
+        ]
+    )
+  fi
+
   #
   # Setup the preprocessor (CPP and CXXCPP)
   #
--- a/common/bin/compare.sh	Mon Feb 15 14:25:21 2016 +0000
+++ b/common/bin/compare.sh	Wed Jul 05 21:20:03 2017 +0200
@@ -1,6 +1,6 @@
 #!/bin/bash
 #
-# Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2012, 2016, 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
@@ -102,32 +102,21 @@
     if test "x$SUFFIX" = "xclass"; then
         # To improve performance when large diffs are found, do a rough filtering of classes
         # elibeble for these exceptions
-        if $GREP -R -e '[0-9]\{4\}_[0-9]\{2\}_[0-9]\{2\}_[0-9]\{2\}_[0-9]\{2\}-b[0-9]\{2\}' \
-                -e '[0-9]\{2\}/[0-9]\{2\}/[0-9]\{4\}' \
+        if $GREP -R -e '[0-9]\{4\}-[0-9]\{2\}-[0-9]\{2\}-[0-9]\{6\}' \
                 -e 'lambda\$[a-zA-Z0-9]*\$[0-9]' ${THIS_FILE} > /dev/null; then
             $JAVAP -c -constants -l -p "${OTHER_FILE}" >  ${OTHER_FILE}.javap
             $JAVAP -c -constants -l -p "${THIS_FILE}" > ${THIS_FILE}.javap
             TMP=$($DIFF ${OTHER_FILE}.javap ${THIS_FILE}.javap | \
                 $GREP '^[<>]' | \
-                $SED -e '/[<>].*[0-9]\{4\}_[0-9]\{2\}_[0-9]\{2\}_[0-9]\{2\}_[0-9]\{2\}-b[0-9]\{2\}.*/d' \
-                     -e '/[0-9]\{2\}\/[0-9]\{2\}\/[0-9]\{4\}/d' \
+                $SED -e '/[<>].*[0-9]\{4\}-[0-9]\{2\}-[0-9]\{2\}-[0-9]\{6\}.*/d' \
                      -e '/[<>].*lambda\$[a-zA-Z0-9]*\$[0-9]*/d')
         fi
     fi
     if test "x$SUFFIX" = "xproperties"; then
-        # Run through nawk to add possibly missing newline at end of file.
-        $CAT $OTHER_FILE | $NAWK '{ print }' | LC_ALL=C $SORT > $OTHER_FILE.cleaned
-# Disable this exception since we aren't changing the properties cleaning method yet.
-#        $CAT $OTHER_FILE | $SED -e 's/\([^\\]\):/\1\\:/g' -e  's/\([^\\]\)=/\1\\=/g' -e 's/#.*/#/g' \
-#            | $SED -f "$SRC_ROOT/common/makefiles/support/unicode2x.sed" \
-#            | $SED -e '/^#/d' -e '/^$/d' \
-#            -e :a -e '/\\$/N; s/\\\n//; ta' \
-#            -e 's/^[ \t]*//;s/[ \t]*$//' \
-#            -e 's/\\=/=/' | LC_ALL=C $SORT > $OTHER_FILE.cleaned
         # Filter out date string differences.
-        TMP=$(LC_ALL=C $DIFF $OTHER_FILE.cleaned $THIS_FILE | \
+        TMP=$(LC_ALL=C $DIFF $OTHER_FILE $THIS_FILE | \
             $GREP '^[<>]' | \
-            $SED -e '/[<>].*[0-9]\{4\}_[0-9]\{2\}_[0-9]\{2\}_[0-9]\{2\}_[0-9]\{2\}-b[0-9]\{2\}.*/d')
+            $SED -e '/[<>].*[0-9]\{4\}-[0-9]\{2\}-[0-9]\{2\}-[0-9]\{6\}.*/d')
     fi
     if test "x$SUFFIX" = "xhtml"; then
 	# Some javadoc versions do not put quotes around font size
@@ -306,7 +295,8 @@
         ! -name "*.lib" ! -name "*.war" ! -name "JavaControlPanel" \
         ! -name "*.obj" ! -name "*.o" ! -name "JavaControlPanelHelper" \
         ! -name "JavaUpdater" ! -name "JavaWSApplicationStub" \
-        ! -name "jspawnhelper" ! -name "*.a" \
+        ! -name "jspawnhelper" ! -name "JavawsLauncher" ! -name "*.a" \
+        ! -name "finish_installation" ! -name "Sparkle" \
         | $GREP -v "./bin/"  | $SORT | $FILTER)
 
     echo Other files with binary differences...
@@ -320,29 +310,28 @@
                 THIS_FILE=$WORK_DIR/$f.this
                 $MKDIR -p $(dirname $OTHER_FILE)
                 $MKDIR -p $(dirname $THIS_FILE)
-                $CAT $OTHER_DIR/$f | $SED 's/\:[0-9a-f]\{12,12\}/:CHANGE/g' > $OTHER_FILE
-                $CAT $THIS_DIR/$f  | $SED 's/\:[0-9a-f]\{12,12\}/:CHANGE/g' > $THIS_FILE
+                RELEASE_FILTER="$SED \
+                    -e 's/\:[0-9a-f]\{12,12\}/:CHANGE/g' \
+                    -e 's/[0-9]\{4\}-[0-9]\{2\}-[0-9]\{2\}-[0-9]\{6\}/<DATE>/g'
+                    "
+                $CAT $OTHER_DIR/$f | eval "$RELEASE_FILTER" > $OTHER_FILE
+                $CAT $THIS_DIR/$f  | eval "$RELEASE_FILTER" > $THIS_FILE
             elif [ "x$SUFFIX" = "xhtml" ]; then
                 # Ignore time stamps in docs files
                 OTHER_FILE=$WORK_DIR/$f.other
                 THIS_FILE=$WORK_DIR/$f.this
-                $MKDIR -p $(dirname $OTHER_FILE)
-                $MKDIR -p $(dirname $THIS_FILE)
+                $MKDIR -p $(dirname $OTHER_FILE) $(dirname $THIS_FILE)
+                # Older versions of compare might have left soft links with
+                # these names.
+                $RM $OTHER_FILE $THIS_FILE
                 #Note that | doesn't work on mac sed.
-                $CAT $OTHER_DIR/$f | $SED -e 's/\(-- Generated by javadoc \).*\( --\)/\1(removed)\2/' \
-                                          -e 's/\(<meta name="date" content="\).*\(">\)/\1(removed)\2/' \
-                                          -e 's/[A-Z][a-z]*, [A-Z][a-z]* [0-9][0-9]*, [12][0-9]* [0-9][0-9:]* [AMP]\{2,2\} [A-Z][A-Z]*/(removed)/' \
-                                          -e 's/[A-Z][a-z]* [A-Z][a-z]* [0-9][0-9] [0-9][0-9:]* [A-Z][A-Z]* [12][0-9]*/(removed)/' \
-                                          -e 's/^\( from \).*\(\.idl\)$/\1(removed)\2/' \
-                                          -e 's/^\(.*\)\( o'"'"'clock \)\([A-Z][A-Z][A-Z]\)/(removed)\2(removed)/' \
-                    > $OTHER_FILE
-                $CAT $THIS_DIR/$f  | $SED -e 's/\(-- Generated by javadoc \).*\( --\)/\1(removed)\2/' \
-                                          -e 's/\(<meta name="date" content="\).*\(">\)/\1(removed)\2/' \
-                                          -e 's/[A-Z][a-z]*, [A-Z][a-z]* [0-9][0-9]*, [12][0-9]* [0-9][0-9:]* [AMP]\{2,2\} [A-Z][A-Z]*/(removed)/' \
-                                          -e 's/[A-Z][a-z]* [A-Z][a-z]* [0-9][0-9] [0-9][0-9:]* [A-Z][A-Z]* [12][0-9]*/(removed)/' \
-                                          -e 's/^\( from \).*\(\.idl\)$/\1(removed)\2/' \
-                                          -e 's/^\(.*\)\( o'"'"'clock \)\([A-Z][A-Z][A-Z]\)/(removed)\2(removed)/' \
-                    > $THIS_FILE
+                HTML_FILTER="$SED \
+                    -e 's/[0-9]\{4\}-[0-9]\{2\}-[0-9]\{2\}-[0-9]\{6\}/<DATE>/g' \
+                    -e 's/\(-- Generated by javadoc \).*\( --\)/\1(removed)\2/' \
+                    -e 's/[A-Z][a-z]*, [A-Z][a-z]* [0-9][0-9]*, [0-9]\{4\} [0-9][0-9:]* [AMP]\{2,2\} [A-Z][A-Z]*/<DATE>/'
+                    "
+                $CAT $OTHER_DIR/$f | eval "$HTML_FILTER" > $OTHER_FILE
+                $CAT $THIS_DIR/$f  | eval "$HTML_FILTER" > $THIS_FILE
             else
                 OTHER_FILE=$OTHER_DIR/$f
                 THIS_FILE=$THIS_DIR/$f
@@ -605,11 +594,17 @@
         OTHER_FILE_BASE=${OTHER_FILE_BASE/.exe/}
         OTHER_FILE_BASE=${OTHER_FILE_BASE/.cpl/}
         DIZ_NAME=$(basename $OTHER_FILE_BASE).diz
-        # java.exe and java.dll diz files will have the same name. Have to
-        # make sure java.exe gets the right one. This is only needed for
-        # OTHER since in the new build, all pdb files are left around.
-        if [ "$NAME" = "java.exe" ] && [ -f "$OTHER/tmp/java/java/obj64/java.diz" ]; then
-            OTHER_DIZ_FILE="$OTHER/tmp/java/java/obj64/java.diz"
+        # Some .exe files have the same name as a .dll file. Make sure the exe
+        # files get the right debug symbols.
+        if [ "$NAME" = "java.exe" ] \
+               && [ -f "$OTHER/support/native/java.base/java_objs/java.diz" ]; then
+            OTHER_DIZ_FILE="$OTHER/support/native/java.base/java_objs/java.diz"
+        elif [ "$NAME" = "jimage.exe" ] \
+               && [ -f "$OTHER/support/native/jdk.dev/jimage_objs/jimage.diz" ]; then
+            OTHER_DIZ_FILE="$OTHER/support/native/jdk.dev/jimage_objs/jimage.diz"
+        elif [ "$NAME" = "javacpl.exe" ] \
+               && [ -f "$OTHER/support/native/jdk.plugin/javacpl/javacpl.diz" ]; then
+            OTHER_DIZ_FILE="$OTHER/support/native/jdk.plugin/javacpl/javacpl.diz"
         elif [ -f "${OTHER_FILE_BASE}.diz" ]; then
             OTHER_DIZ_FILE=${OTHER_FILE_BASE}.diz
         else
@@ -627,9 +622,22 @@
             (cd $FILE_WORK_DIR/other ; $UNARCHIVE -o $OTHER_DIZ_FILE)
             export _NT_SYMBOL_PATH="$FILE_WORK_DIR/other"
         fi
+
         THIS_FILE_BASE=${THIS_FILE/.dll/}
         THIS_FILE_BASE=${THIS_FILE_BASE/.exe/}
-        if [ -f "${THIS_FILE/.dll/}.diz" ]; then
+        THIS_FILE_BASE=${THIS_FILE_BASE/.cpl/}
+        # Some .exe files have the same name as a .dll file. Make sure the exe
+        # files get the right debug symbols.
+        if [ "$NAME" = "java.exe" ] \
+               && [ -f "$THIS/support/native/java.base/java_objs/java.diz" ]; then
+            THIS_DIZ_FILE="$THIS/support/native/java.base/java_objs/java.diz"
+        elif [ "$NAME" = "jimage.exe" ] \
+               && [ -f "$THIS/support/native/jdk.dev/jimage_objs/jimage.diz" ]; then
+            THIS_DIZ_FILE="$THIS/support/native/jdk.dev/jimage_objs/jimage.diz"
+        elif [ "$NAME" = "javacpl.exe" ] \
+               && [ -f "$THIS/support/native/jdk.plugin/javacpl/javacpl.diz" ]; then
+            THIS_DIZ_FILE="$THIS/support/native/jdk.plugin/javacpl/javacpl.diz"
+        elif [ -f "${THIS_FILE_BASE}.diz" ]; then
             THIS_DIZ_FILE=${THIS_FILE/.dll/}.diz
         else
             THIS_DIZ_FILE="$($FIND $THIS_DIR -name $DIZ_NAME | $SED 1q)"
@@ -738,6 +746,9 @@
     elif [ "$OPENJDK_TARGET_OS" = "aix" ]; then
         $OBJDUMP -T $ORIG_OTHER_FILE 2> /dev/null | $GREP -v $NAME | $AWK '{print $2, $3, $4, $5}' | $SYM_SORT_CMD > $WORK_FILE_BASE.symbols.other
         $OBJDUMP -T $ORIG_THIS_FILE  2> /dev/null | $GREP -v $NAME | $AWK '{print $2, $3, $4, $5}' | $SYM_SORT_CMD > $WORK_FILE_BASE.symbols.this
+    elif [ "$OPENJDK_TARGET_OS" = "macosx" ]; then
+        $NM -j $ORIG_OTHER_FILE 2> /dev/null | $SYM_SORT_CMD > $WORK_FILE_BASE.symbols.other
+        $NM -j $ORIG_THIS_FILE  2> /dev/null | $SYM_SORT_CMD > $WORK_FILE_BASE.symbols.this
     else
         $NM -a $ORIG_OTHER_FILE 2> /dev/null | $GREP -v $NAME | $AWK '{print $2, $3, $4, $5}' | $SYM_SORT_CMD > $WORK_FILE_BASE.symbols.other
         $NM -a $ORIG_THIS_FILE  2> /dev/null | $GREP -v $NAME | $AWK '{print $2, $3, $4, $5}' | $SYM_SORT_CMD > $WORK_FILE_BASE.symbols.this
@@ -856,8 +867,15 @@
         if [ -z "$DIS_DIFF_FILTER" ]; then
             DIS_DIFF_FILTER="$GREP -v ' # .* <.*>$' | $SED -r -e 's/(\b|x)([0-9a-fA-F]+)(\b|:|>)/X/g'"
         fi
-        $DIS_CMD $OTHER_FILE | $GREP -v $NAME | eval "$DIS_DIFF_FILTER" > $WORK_FILE_BASE.dis.other 2>&1
-        $DIS_CMD $THIS_FILE  | $GREP -v $NAME | eval "$DIS_DIFF_FILTER" > $WORK_FILE_BASE.dis.this  2>&1
+        if [ "$OPENJDK_TARGET_OS" = "windows" ]; then
+            DIS_GREP_ARG=-a
+        else
+            DIS_GREP_ARG=
+        fi
+        $DIS_CMD $OTHER_FILE | $GREP $DIS_GREP_ARG -v $NAME \
+            | eval "$DIS_DIFF_FILTER" > $WORK_FILE_BASE.dis.other 2>&1
+        $DIS_CMD $THIS_FILE  | $GREP $DIS_GREP_ARG -v $NAME \
+            | eval "$DIS_DIFF_FILTER" > $WORK_FILE_BASE.dis.this  2>&1
 
         LC_ALL=C $DIFF $WORK_FILE_BASE.dis.other $WORK_FILE_BASE.dis.this > $WORK_FILE_BASE.dis.diff
 
@@ -974,6 +992,15 @@
             -o -name '*.jar' -o -name '*.diz' -o -name 'jcontrol' -o -name '*.properties' \
             -o -name '*.data' -o -name '*.bfc' -o -name '*.src' -o -name '*.txt' \
             -o -name '*.cfg' -o -name 'meta-index' -o -name '*.properties.ja' \
+            -o -name '*.xml' -o -name '*.html' -o -name '*.png' -o -name 'README' \
+            -o -name '*.zip' -o -name '*.jimage' -o -name '*.java' -o -name '*.mf' \
+            -o -name '*.jpg' -o -name '*.wsdl' -o -name '*.js' -o -name '*.sh' \
+            -o -name '*.bat' -o -name '*LICENSE' -o -name '*.d' -o -name '*store' \
+            -o -name 'blacklist' -o -name '*certs' -o -name '*.ttf' \
+            -o -name '*.jfc' -o -name '*.dat'  -o -name 'release' -o -name '*.dir'\
+            -o -name '*.sym' -o -name '*.idl' -o -name '*.h' -o -name '*.access' \
+            -o -name '*.template' -o -name '*.policy' -o -name '*.security' \
+            -o -name 'COPYRIGHT' -o -name '*.1' \
             -o -name 'classlist' \) | $SORT | $FILTER)
     fi
 
@@ -996,14 +1023,6 @@
 ################################################################################
 # Initiate configuration
 
-COMPARE_ROOT=/tmp/cimages.$USER
-$MKDIR -p $COMPARE_ROOT
-if [ "$OPENJDK_TARGET_OS" = "windows" ]; then
-    if [ "$(uname -o)" = "Cygwin" ]; then
-        COMPARE_ROOT=$(cygpath -msa $COMPARE_ROOT)
-    fi
-fi
-
 THIS="$SCRIPT_DIR"
 echo "$THIS"
 THIS_SCRIPT="$0"
@@ -1026,6 +1045,7 @@
     echo ""
     echo "--sort-symbols      Sort all symbols before comparing"
     echo "--strip             Strip all binaries before comparing"
+    echo "--clean             Clean all previous comparison results first"
     echo ""
     echo "[FILTER]            List filenames in the image to compare, works for jars, zips, libs and execs"
     echo "Example:"
@@ -1125,6 +1145,9 @@
         --strip)
             STRIP_ALL=true
             ;;
+        --clean)
+            CLEAN_OUTPUT=true
+            ;;
         *)
             CMP_NAMES=false
             CMP_PERMS=false
@@ -1143,6 +1166,23 @@
     shift
 done
 
+if [ "$STRIP_ALL" = "true" ] && [ -z "$STRIP" ]; then
+  echo Warning: Not stripping even with --strip, since strip is missing on this platform
+  STRIP_ALL=false
+fi
+
+COMPARE_ROOT=/tmp/cimages.$USER
+if [ "$CLEAN_OUTPUT" = "true" ]; then
+    echo Cleaning old output in $COMPARE_ROOT.
+    $RM -rf $COMPARE_ROOT
+fi
+$MKDIR -p $COMPARE_ROOT
+if [ "$OPENJDK_TARGET_OS" = "windows" ]; then
+    if [ "$(uname -o)" = "Cygwin" ]; then
+        COMPARE_ROOT=$(cygpath -msa $COMPARE_ROOT)
+    fi
+fi
+
 if [ "$CMP_2_ZIPS" = "true" ]; then
     THIS_DIR="$(dirname $THIS_FILE)"
     THIS_DIR="$(cd "$THIS_DIR" > /dev/null && pwd )"
@@ -1278,6 +1318,15 @@
         echo "  $OTHER_DEPLOY_APPLET_PLUGIN_DIR"
     fi
 
+    if [ -d "$THIS/install/sparkle/Sparkle.framework" ] \
+           && [ -d "$OTHER/install/sparkle/Sparkle.framework" ]; then
+        THIS_SPARKLE_DIR="$THIS/install/sparkle/Sparkle.framework"
+        OTHER_SPARKLE_DIR="$OTHER/install/sparkle/Sparkle.framework"
+        echo "Also comparing install sparkle framework"
+        echo "  $THIS_SPARKLE_DIR"
+        echo "  $OTHER_SPARKLE_DIR"
+    fi
+
     if [ -d "$OTHER/images" ]; then
         OTHER_SEC_DIR="$OTHER/images"
     else
@@ -1298,9 +1347,9 @@
         THIS_JGSS_WINDOWS_BIN="$THIS_SEC_DIR/$JGSS_WINDOWS_BIN"
     fi
 
-    if [ -d "$THIS/docs" ] && [ -d "$OTHER/docs" ]; then
-        THIS_DOCS="$THIS/docs"
-        OTHER_DOCS="$OTHER/docs"
+    if [ -d "$THIS/images/docs" ] && [ -d "$OTHER/images/docs" ]; then
+        THIS_DOCS="$THIS/images/docs"
+        OTHER_DOCS="$OTHER/images/docs"
         echo "Also comparing docs"
     else
         echo "WARNING! Docs haven't been built and won't be compared."
@@ -1314,23 +1363,23 @@
     if [ -n "$THIS_JDK" ] && [ -n "$OTHER_JDK" ]; then
         echo -n "JDK "
         compare_dirs $THIS_JDK $OTHER_JDK $COMPARE_ROOT/jdk
-        echo -n "JRE  "
+        echo -n "JRE "
         compare_dirs $THIS_JRE $OTHER_JRE $COMPARE_ROOT/jre
 
         echo -n "JDK "
         compare_files $THIS_JDK $OTHER_JDK $COMPARE_ROOT/jdk
-        echo -n "JRE  "
+        echo -n "JRE "
         compare_files $THIS_JRE $OTHER_JRE $COMPARE_ROOT/jre
     fi
     if [ -n "$THIS_JDK_BUNDLE" ] && [ -n "$OTHER_JDK_BUNDLE" ]; then
         echo -n "JDK Bundle "
         compare_dirs $THIS_JDK_BUNDLE $OTHER_JDK_BUNDLE $COMPARE_ROOT/jdk-bundle
-        echo -n "JRE  Bundle "
+        echo -n "JRE Bundle "
         compare_dirs $THIS_JRE_BUNDLE $OTHER_JRE_BUNDLE $COMPARE_ROOT/jre-bundle
 
         echo -n "JDK Bundle "
         compare_files $THIS_JDK_BUNDLE $OTHER_JDK_BUNDLE $COMPARE_ROOT/jdk-bundle
-        echo -n "JRE  Bundle "
+        echo -n "JRE Bundle "
         compare_files $THIS_JRE_BUNDLE $OTHER_JRE_BUNDLE $COMPARE_ROOT/jre-bundle
     fi
     if [ -n "$THIS_DOCS" ] && [ -n "$OTHER_DOCS" ]; then
@@ -1349,13 +1398,19 @@
         echo -n "JavaAppletPlugin "
         compare_files $THIS_DEPLOY_APPLET_PLUGIN_DIR $OTHER_DEPLOY_APPLET_PLUGIN_DIR $COMPARE_ROOT/plugin
     fi
+    if [ -n "$THIS_SPARKLE_DIR" ] && [ -n "$OTHER_SPARKLE_DIR" ]; then
+        echo -n "Sparkle.framework "
+        compare_dirs $THIS_SPARKLE_DIR $OTHER_SPARKLE_DIR $COMPARE_ROOT/sparkle
+        echo -n "Sparkle.framework "
+        compare_files $THIS_SPARKLE_DIR $OTHER_SPARKLE_DIR $COMPARE_ROOT/sparkle
+    fi
 fi
 
 if [ "$CMP_PERMS" = "true" ]; then
     if [ -n "$THIS_JDK" ] && [ -n "$OTHER_JDK" ]; then
         echo -n "JDK "
         compare_permissions $THIS_JDK $OTHER_JDK $COMPARE_ROOT/jdk
-        echo -n "JRE  "
+        echo -n "JRE "
         compare_permissions $THIS_JRE $OTHER_JRE $COMPARE_ROOT/jre
     fi
     if [ -n "$THIS_BASE_DIR" ] && [ -n "$OTHER_BASE_DIR" ]; then
@@ -1365,19 +1420,23 @@
         echo -n "JavaAppletPlugin "
         compare_permissions $THIS_DEPLOY_APPLET_PLUGIN_DIR $OTHER_DEPLOY_APPLET_PLUGIN_DIR $COMPARE_ROOT/plugin
     fi
+    if [ -n "$THIS_SPARKLE_DIR" ] && [ -n "$OTHER_SPARKLE_DIR" ]; then
+        echo -n "Sparkle.framework "
+        compare_permissions $THIS_SPARKLE_DIR $OTHER_SPARKLE_DIR $COMPARE_ROOT/sparkle
+    fi
 fi
 
 if [ "$CMP_TYPES" = "true" ]; then
     if [ -n "$THIS_JDK" ] && [ -n "$OTHER_JDK" ]; then
         echo -n "JDK "
         compare_file_types $THIS_JDK $OTHER_JDK $COMPARE_ROOT/jdk
-        echo -n "JRE  "
+        echo -n "JRE "
         compare_file_types $THIS_JRE $OTHER_JRE $COMPARE_ROOT/jre
     fi
     if [ -n "$THIS_JDK_BUNDLE" ] && [ -n "$OTHER_JDK_BUNDLE" ]; then
         echo -n "JDK Bundle "
         compare_file_types $THIS_JDK_BUNDLE $OTHER_JDK_BUNDLE $COMPARE_ROOT/jdk-bundle
-        echo -n "JRE  Bundle "
+        echo -n "JRE Bundle "
         compare_file_types $THIS_JRE_BUNDLE $OTHER_JRE_BUNDLE $COMPARE_ROOT/jre-bundle
     fi
     if [ -n "$THIS_BASE_DIR" ] && [ -n "$OTHER_BASE_DIR" ]; then
@@ -1387,19 +1446,23 @@
         echo -n "JavaAppletPlugin "
         compare_file_types $THIS_DEPLOY_APPLET_PLUGIN_DIR $OTHER_DEPLOY_APPLET_PLUGIN_DIR $COMPARE_ROOT/plugin
     fi
+    if [ -n "$THIS_SPARKLE_DIR" ] && [ -n "$OTHER_SPARKLE_DIR" ]; then
+        echo -n "Sparkle.framework "
+        compare_file_types $THIS_SPARKLE_DIR $OTHER_SPARKLE_DIR $COMPARE_ROOT/sparkle
+    fi
 fi
 
 if [ "$CMP_GENERAL" = "true" ]; then
     if [ -n "$THIS_JDK" ] && [ -n "$OTHER_JDK" ]; then
         echo -n "JDK "
         compare_general_files $THIS_JDK $OTHER_JDK $COMPARE_ROOT/jdk
-        echo -n "JRE  "
+        echo -n "JRE "
         compare_general_files $THIS_JRE $OTHER_JRE $COMPARE_ROOT/jre
     fi
     if [ -n "$THIS_JDK_BUNDLE" ] && [ -n "$OTHER_JDK_BUNDLE" ]; then
         echo -n "JDK Bundle "
         compare_general_files $THIS_JDK_BUNDLE $OTHER_JDK_BUNDLE $COMPARE_ROOT/jdk-bundle
-        echo -n "JRE  Bundle "
+        echo -n "JRE Bundle "
         compare_general_files $THIS_JRE_BUNDLE $OTHER_JRE_BUNDLE $COMPARE_ROOT/jre-bundle
     fi
     if [ -n "$THIS_DOCS" ] && [ -n "$OTHER_DOCS" ]; then
@@ -1413,6 +1476,10 @@
         echo -n "JavaAppletPlugin "
         compare_general_files $THIS_DEPLOY_APPLET_PLUGIN_DIR $OTHER_DEPLOY_APPLET_PLUGIN_DIR $COMPARE_ROOT/plugin
     fi
+    if [ -n "$THIS_SPARKLE_DIR" ] && [ -n "$OTHER_SPARKLE_DIR" ]; then
+        echo -n "Sparkle.framework "
+        compare_general_files $THIS_SPARKLE_DIR $OTHER_SPARKLE_DIR $COMPARE_ROOT/sparkle
+    fi
 fi
 
 if [ "$CMP_ZIPS" = "true" ]; then
@@ -1465,7 +1532,7 @@
         echo -n "JDK "
         compare_all_libs $THIS_JDK $OTHER_JDK $COMPARE_ROOT/jdk
         if [ "$OPENJDK_TARGET_OS" = "macosx" ]; then
-            echo -n "JRE  "
+            echo -n "JRE "
             compare_all_libs $THIS_JRE $OTHER_JRE $COMPARE_ROOT/jre
         fi
     fi
@@ -1476,13 +1543,17 @@
         echo -n "JavaAppletPlugin "
         compare_all_libs $THIS_DEPLOY_APPLET_PLUGIN_DIR $OTHER_DEPLOY_APPLET_PLUGIN_DIR $COMPARE_ROOT/plugin
     fi
+    if [ -n "$THIS_SPARKLE_DIR" ] && [ -n "$OTHER_SPARKLE_DIR" ]; then
+        echo -n "Sparkle.framework "
+        compare_all_libs $THIS_SPARKLE_DIR $OTHER_SPARKLE_DIR $COMPARE_ROOT/sparkle
+    fi
 fi
 
 if [ "$CMP_EXECS" = "true" ]; then
     if [ -n "$THIS_JDK" ] && [ -n "$OTHER_JDK" ]; then
         compare_all_execs $THIS_JDK $OTHER_JDK $COMPARE_ROOT/jdk
         if [ "$OPENJDK_TARGET_OS" = "macosx" ]; then
-            echo -n "JRE  "
+            echo -n "JRE "
             compare_all_execs $THIS_JRE $OTHER_JRE $COMPARE_ROOT/jre
         fi
     fi
@@ -1493,6 +1564,10 @@
         echo -n "JavaAppletPlugin "
         compare_all_execs $THIS_DEPLOY_APPLET_PLUGIN_DIR $OTHER_DEPLOY_APPLET_PLUGIN_DIR $COMPARE_ROOT/plugin
     fi
+    if [ -n "$THIS_SPARKLE_DIR" ] && [ -n "$OTHER_SPARKLE_DIR" ]; then
+        echo -n "Sparkle.framework "
+        compare_all_execs $THIS_SPARKLE_DIR $OTHER_SPARKLE_DIR $COMPARE_ROOT/sparkle
+    fi
 fi
 
 echo
--- a/common/bin/compare_exceptions.sh.incl	Mon Feb 15 14:25:21 2016 +0000
+++ b/common/bin/compare_exceptions.sh.incl	Wed Jul 05 21:20:03 2017 +0200
@@ -35,637 +35,580 @@
 ##########################################################################################
 # Diff exceptions
 
-if [ "$OPENJDK_TARGET_OS" = "linux" ] && [ "$OPENJDK_TARGET_CPU" = "x86" ]; then
-
-STRIP_BEFORE_COMPARE="
-./demo/jvmti/compiledMethodLoad/lib/libcompiledMethodLoad.so
-./demo/jvmti/gctest/lib/libgctest.so
-./demo/jvmti/heapTracker/lib/libheapTracker.so
-./demo/jvmti/heapViewer/lib/libheapViewer.so
-./demo/jvmti/minst/lib/libminst.so
-./demo/jvmti/mtrace/lib/libmtrace.so
-./demo/jvmti/versionCheck/lib/libversionCheck.so
-./demo/jvmti/waiters/lib/libwaiters.so
-"
+if [ "$OPENJDK_TARGET_OS" = "linux" ]; then
 
-ACCEPTED_BIN_DIFF="
-./demo/jvmti/compiledMethodLoad/lib/libcompiledMethodLoad.so
-./demo/jvmti/gctest/lib/libgctest.so
-./demo/jvmti/heapTracker/lib/libheapTracker.so
-./demo/jvmti/heapViewer/lib/libheapViewer.so
-./demo/jvmti/minst/lib/libminst.so
-./demo/jvmti/mtrace/lib/libmtrace.so
-./demo/jvmti/versionCheck/lib/libversionCheck.so
-./demo/jvmti/waiters/lib/libwaiters.so
-./lib/i386/client/libjsig.so
-./lib/i386/client/libjvm.so
-./lib/i386/libattach.so
-./lib/i386/libdt_socket.so
-./lib/i386/libinstrument.so
-./lib/i386/libjsdt.so
-./lib/i386/libjsig.so
-./lib/i386/libmanagement.so
-./lib/i386/libnet.so
-./lib/i386/libnpt.so
-./lib/i386/libverify.so
-./lib/i386/server/libjsig.so
-./lib/i386/server/libjvm.so
-./bin/appletviewer
-./bin/idlj
-./bin/jar
-./bin/jarsigner
-./bin/java
-./bin/javac
-./bin/javadoc
-./bin/javah
-./bin/javap
-./bin/jdeps
-./bin/jcmd
-./bin/jconsole
-./bin/jdb
-./bin/jimage
-./bin/jinfo
-./bin/jjs
-./bin/jmap
-./bin/jps
-./bin/jrunscript
-./bin/jsadebugd
-./bin/jstack
-./bin/jstat
-./bin/jstatd
-./bin/keytool
-./bin/orbd
-./bin/pack200
-./bin/policytool
-./bin/rmic
-./bin/rmid
-./bin/rmiregistry
-./bin/schemagen
-./bin/serialver
-./bin/servertool
-./bin/tnameserv
-./bin/wsgen
-./bin/wsimport
-./bin/xjc
-"
+  STRIP_BEFORE_COMPARE="
+      ./demo/jvmti/compiledMethodLoad/lib/libcompiledMethodLoad.so
+      ./demo/jvmti/gctest/lib/libgctest.so
+      ./demo/jvmti/heapTracker/lib/libheapTracker.so
+      ./demo/jvmti/heapViewer/lib/libheapViewer.so
+      ./demo/jvmti/minst/lib/libminst.so
+      ./demo/jvmti/mtrace/lib/libmtrace.so
+      ./demo/jvmti/versionCheck/lib/libversionCheck.so
+      ./demo/jvmti/waiters/lib/libwaiters.so
+      "
 
-# Issue with __FILE__ usage in generated header files prevent clean fulldump diff of
-# server jvm with old hotspot build.
-KNOWN_FULLDUMP_DIFF="
-./lib/i386/server/libjvm.so
-"
-KNOWN_DIS_DIFF="
-./lib/i386/server/libjvm.so
-"
-DIS_DIFF_FILTER="$SED \
-  -e 's/\(:\t\)\([0-9a-z]\{2,2\} \)\{1,7\}/\1<hex>/g' \
-  -e 's/0x[0-9a-z]\{2,9\}/<hex>/g'"
-fi
-
-if [ "$OPENJDK_TARGET_OS" = "linux" ] && [ "$OPENJDK_TARGET_CPU" = "x86_64" ]; then
-
-STRIP_BEFORE_COMPARE="
-./demo/jvmti/compiledMethodLoad/lib/libcompiledMethodLoad.so
-./demo/jvmti/gctest/lib/libgctest.so
-./demo/jvmti/heapTracker/lib/libheapTracker.so
-./demo/jvmti/heapViewer/lib/libheapViewer.so
-./demo/jvmti/minst/lib/libminst.so
-./demo/jvmti/mtrace/lib/libmtrace.so
-./demo/jvmti/versionCheck/lib/libversionCheck.so
-./demo/jvmti/waiters/lib/libwaiters.so
-"
+  ACCEPTED_BIN_DIFF="
+      ./demo/jvmti/compiledMethodLoad/lib/libcompiledMethodLoad.so
+      ./demo/jvmti/gctest/lib/libgctest.so
+      ./demo/jvmti/heapTracker/lib/libheapTracker.so
+      ./demo/jvmti/heapViewer/lib/libheapViewer.so
+      ./demo/jvmti/minst/lib/libminst.so
+      ./demo/jvmti/mtrace/lib/libmtrace.so
+      ./demo/jvmti/versionCheck/lib/libversionCheck.so
+      ./demo/jvmti/waiters/lib/libwaiters.so
+      ./lib$OPENJDK_TARGET_CPU_LIBDIR/client/libjsig.so
+      ./lib$OPENJDK_TARGET_CPU_LIBDIR/client/libjvm.so
+      ./lib$OPENJDK_TARGET_CPU_LIBDIR/libattach.so
+      ./lib$OPENJDK_TARGET_CPU_LIBDIR/libdt_socket.so
+      ./lib$OPENJDK_TARGET_CPU_LIBDIR/libinstrument.so
+      ./lib$OPENJDK_TARGET_CPU_LIBDIR/libjsdt.so
+      ./lib$OPENJDK_TARGET_CPU_LIBDIR/libjsig.so
+      ./lib$OPENJDK_TARGET_CPU_LIBDIR/libmanagement.so
+      ./lib$OPENJDK_TARGET_CPU_LIBDIR/libnet.so
+      ./lib$OPENJDK_TARGET_CPU_LIBDIR/libnpt.so
+      ./lib$OPENJDK_TARGET_CPU_LIBDIR/libverify.so
+      ./lib$OPENJDK_TARGET_CPU_LIBDIR/minimal/libjsig.so
+      ./lib$OPENJDK_TARGET_CPU_LIBDIR/minimal/libjvm.so
+      ./lib$OPENJDK_TARGET_CPU_LIBDIR/server/libjsig.so
+      ./lib$OPENJDK_TARGET_CPU_LIBDIR/server/libjvm.so
+      ./bin/appletviewer
+      ./bin/idlj
+      ./bin/jar
+      ./bin/jarsigner
+      ./bin/java
+      ./bin/javac
+      ./bin/javadoc
+      ./bin/javah
+      ./bin/javap
+      ./bin/jdeps
+      ./bin/jcmd
+      ./bin/jconsole
+      ./bin/jdb
+      ./bin/jhsdb
+      ./bin/jimage
+      ./bin/jinfo
+      ./bin/jjs
+      ./bin/jmap
+      ./bin/jps
+      ./bin/jrunscript
+      ./bin/jsadebugd
+      ./bin/jshell
+      ./bin/jstack
+      ./bin/jstat
+      ./bin/jstatd
+      ./bin/keytool
+      ./bin/orbd
+      ./bin/pack200
+      ./bin/policytool
+      ./bin/rmic
+      ./bin/rmid
+      ./bin/rmiregistry
+      ./bin/schemagen
+      ./bin/serialver
+      ./bin/servertool
+      ./bin/tnameserv
+      ./bin/wsgen
+      ./bin/wsimport
+      ./bin/xjc
+      "
 
-ACCEPTED_BIN_DIFF="
-./demo/jvmti/compiledMethodLoad/lib/libcompiledMethodLoad.so
-./demo/jvmti/gctest/lib/libgctest.so
-./demo/jvmti/heapTracker/lib/libheapTracker.so
-./demo/jvmti/heapViewer/lib/libheapViewer.so
-./demo/jvmti/minst/lib/libminst.so
-./demo/jvmti/mtrace/lib/libmtrace.so
-./demo/jvmti/versionCheck/lib/libversionCheck.so
-./demo/jvmti/waiters/lib/libwaiters.so
-./lib/amd64/libattach.so
-./lib/amd64/libdt_socket.so
-./lib/amd64/libinstrument.so
-./lib/amd64/libjsdt.so
-./lib/amd64/libjsig.so
-./lib/amd64/libmanagement.so
-./lib/amd64/libnet.so
-./lib/amd64/libnpt.so
-./lib/amd64/libsaproc.so
-./lib/amd64/libverify.so
-./lib/amd64/server/libjsig.so
-./lib/amd64/server/libjvm.so
-./bin/appletviewer
-./bin/idlj
-./bin/jar
-./bin/jarsigner
-./bin/java
-./bin/javac
-./bin/javadoc
-./bin/javah
-./bin/javap
-./bin/jdeps
-./bin/jcmd
-./bin/jconsole
-./bin/jdb
-./bin/jimage
-./bin/jinfo
-./bin/jjs
-./bin/jmap
-./bin/jps
-./bin/jrunscript
-./bin/jsadebugd
-./bin/jstack
-./bin/jstat
-./bin/jstatd
-./bin/keytool
-./bin/orbd
-./bin/pack200
-./bin/policytool
-./bin/rmic
-./bin/rmid
-./bin/rmiregistry
-./bin/schemagen
-./bin/serialver
-./bin/servertool
-./bin/tnameserv
-./bin/wsgen
-./bin/wsimport
-./bin/xjc
-"
+  # Issue with __FILE__ usage in generated header files prevent clean fulldump diff of
+  # server jvm with old hotspot build.
+  KNOWN_FULLDUMP_DIFF="
+      ./lib$OPENJDK_TARGET_CPU_LIBDIR/client/libjvm.so
+      ./lib$OPENJDK_TARGET_CPU_LIBDIR/server/libjvm.so
+      ./lib$OPENJDK_TARGET_CPU_LIBDIR/minimal/libjvm.so
+      "
 
-# Issue with __FILE__ usage in generated header files prevent clean fulldump diff of
-# server jvm with old hotspot build.
-KNOWN_FULLDUMP_DIFF="
-./lib/amd64/server/libjvm.so
-"
-
+  if [ "$OPENJDK_TARGET_CPU" = "x86" ]; then
+    KNOWN_DIS_DIFF="
+        ./lib$OPENJDK_TARGET_CPU_LIBDIR/server/libjvm.so
+        "
+    DIS_DIFF_FILTER="$SED \
+        -e 's/\(:\t\)\([0-9a-z]\{2,2\} \)\{1,7\}/\1<hex>/g' \
+        -e 's/0x[0-9a-z]\{2,9\}/<hex>/g'"
+  fi
 fi
 
 if [ "$OPENJDK_TARGET_OS" = "solaris" ] && [ "$OPENJDK_TARGET_CPU" = "x86_64" ]; then
 
-STRIP_BEFORE_COMPARE="
-./demo/jni/Poller/lib/libPoller.so
-./demo/jvmti/compiledMethodLoad/lib/libcompiledMethodLoad.so
-./demo/jvmti/gctest/lib/libgctest.so
-./demo/jvmti/heapTracker/lib/libheapTracker.so
-./demo/jvmti/heapViewer/lib/libheapViewer.so
-./demo/jvmti/minst/lib/libminst.so
-./demo/jvmti/mtrace/lib/libmtrace.so
-./demo/jvmti/versionCheck/lib/libversionCheck.so
-./demo/jvmti/waiters/lib/libwaiters.so
-"
+  STRIP_BEFORE_COMPARE="
+      ./demo/jni/Poller/lib/libPoller.so
+      ./demo/jvmti/compiledMethodLoad/lib/libcompiledMethodLoad.so
+      ./demo/jvmti/gctest/lib/libgctest.so
+      ./demo/jvmti/heapTracker/lib/libheapTracker.so
+      ./demo/jvmti/heapViewer/lib/libheapViewer.so
+      ./demo/jvmti/minst/lib/libminst.so
+      ./demo/jvmti/mtrace/lib/libmtrace.so
+      ./demo/jvmti/versionCheck/lib/libversionCheck.so
+      ./demo/jvmti/waiters/lib/libwaiters.so
+      "
 
-SORT_SYMBOLS="
-./lib/amd64/server/libjvm.so
-./lib/amd64/libsaproc.so
-"
+  SORT_SYMBOLS="
+      ./lib/amd64/server/libjvm.so
+      ./lib/amd64/libfontmanager.so
+      ./lib/amd64/libjimage.so
+      ./lib/amd64/libsaproc.so
+      ./lib/amd64/libunpack.so
+      ./bin/unpack200
+      "
 
-SKIP_BIN_DIFF="true"
+  SKIP_BIN_DIFF="true"
 
-ACCEPTED_SMALL_SIZE_DIFF="
-./demo/jni/Poller/lib/libPoller.so
-./demo/jvmti/compiledMethodLoad/lib/libcompiledMethodLoad.so
-./demo/jvmti/gctest/lib/libgctest.so
-./demo/jvmti/heapTracker/lib/libheapTracker.so
-./demo/jvmti/heapViewer/lib/libheapViewer.so
-./demo/jvmti/minst/lib/libminst.so
-./demo/jvmti/mtrace/lib/libmtrace.so
-./demo/jvmti/versionCheck/lib/libversionCheck.so
-./demo/jvmti/waiters/lib/libwaiters.so
-./lib/amd64/jli/libjli.so
-./lib/amd64/jspawnhelper
-./lib/amd64/libJdbcOdbc.so
-./lib/amd64/libattach.so
-./lib/amd64/libawt.so
-./lib/amd64/libawt_headless.so
-./lib/amd64/libawt_xawt.so
-./lib/amd64/libdcpr.so
-./lib/amd64/libdt_socket.so
-./lib/amd64/libfontmanager.so
-./lib/amd64/libinstrument.so
-./lib/amd64/libj2gss.so
-./lib/amd64/libj2pcsc.so
-./lib/amd64/libj2pkcs11.so
-./lib/amd64/libj2ucrypto.so
-./lib/amd64/libjaas_unix.so
-./lib/amd64/libjava.so
-./lib/amd64/libjawt.so
-./lib/amd64/libjdwp.so
-./lib/amd64/libjfr.so
-./lib/amd64/libjpeg.so
-./lib/amd64/libjsdt.so
-./lib/amd64/libjsound.so
-./lib/amd64/libkcms.so
-./lib/amd64/liblcms.so
-./lib/amd64/libmanagement.so
-./lib/amd64/libmlib_image.so
-./lib/amd64/libnet.so
-./lib/amd64/libnio.so
-./lib/amd64/libnpt.so
-./lib/amd64/libsctp.so
-./lib/amd64/libsplashscreen.so
-./lib/amd64/libsunec.so
-./lib/amd64/libsunwjdga.so
-./lib/amd64/libt2k.so
-./lib/amd64/libunpack.so
-./lib/amd64/libverify.so
-./lib/amd64/libzip.so
-./lib/amd64/server/64/libjvm_db.so
-./lib/amd64/server/64/libjvm_dtrace.so
-./lib/amd64/server/libjvm.so
-./lib/amd64/server/libjvm_db.so
-./lib/amd64/server/libjvm_dtrace.so
-./bin/appletviewer
-./bin/idlj
-./bin/jar
-./bin/jarsigner
-./bin/java
-./bin/javac
-./bin/javadoc
-./bin/javah
-./bin/javap
-./bin/jdeps
-./bin/jcmd
-./bin/jconsole
-./bin/jdb
-./bin/jimage
-./bin/jinfo
-./bin/jjs
-./bin/jmap
-./bin/jps
-./bin/jrunscript
-./bin/jsadebugd
-./bin/jstack
-./bin/jstat
-./bin/jstatd
-./bin/keytool
-./bin/orbd
-./bin/pack200
-./bin/policytool
-./bin/rmic
-./bin/rmid
-./bin/rmiregistry
-./bin/schemagen
-./bin/serialver
-./bin/servertool
-./bin/tnameserv
-./bin/unpack200
-./bin/wsgen
-./bin/wsimport
-./bin/xjc
-"
+  ACCEPTED_SMALL_SIZE_DIFF="
+      ./demo/jni/Poller/lib/libPoller.so
+      ./demo/jvmti/compiledMethodLoad/lib/libcompiledMethodLoad.so
+      ./demo/jvmti/gctest/lib/libgctest.so
+      ./demo/jvmti/heapTracker/lib/libheapTracker.so
+      ./demo/jvmti/heapViewer/lib/libheapViewer.so
+      ./demo/jvmti/minst/lib/libminst.so
+      ./demo/jvmti/mtrace/lib/libmtrace.so
+      ./demo/jvmti/versionCheck/lib/libversionCheck.so
+      ./demo/jvmti/waiters/lib/libwaiters.so
+      ./lib/amd64/jli/libjli.so
+      ./lib/amd64/jspawnhelper
+      ./lib/amd64/libJdbcOdbc.so
+      ./lib/amd64/libattach.so
+      ./lib/amd64/libawt.so
+      ./lib/amd64/libawt_headless.so
+      ./lib/amd64/libawt_xawt.so
+      ./lib/amd64/libdcpr.so
+      ./lib/amd64/libdt_socket.so
+      ./lib/amd64/libfontmanager.so
+      ./lib/amd64/libinstrument.so
+      ./lib/amd64/libj2gss.so
+      ./lib/amd64/libj2pcsc.so
+      ./lib/amd64/libj2pkcs11.so
+      ./lib/amd64/libj2ucrypto.so
+      ./lib/amd64/libjaas_unix.so
+      ./lib/amd64/libjava.so
+      ./lib/amd64/libjawt.so
+      ./lib/amd64/libjdwp.so
+      ./lib/amd64/libjfr.so
+      ./lib/amd64/libjpeg.so
+      ./lib/amd64/libjsdt.so
+      ./lib/amd64/libjsound.so
+      ./lib/amd64/libkcms.so
+      ./lib/amd64/liblcms.so
+      ./lib/amd64/libmanagement.so
+      ./lib/amd64/libmlib_image.so
+      ./lib/amd64/libnet.so
+      ./lib/amd64/libnio.so
+      ./lib/amd64/libnpt.so
+      ./lib/amd64/libsctp.so
+      ./lib/amd64/libsplashscreen.so
+      ./lib/amd64/libsunec.so
+      ./lib/amd64/libsunwjdga.so
+      ./lib/amd64/libt2k.so
+      ./lib/amd64/libunpack.so
+      ./lib/amd64/libverify.so
+      ./lib/amd64/libzip.so
+      ./lib/amd64/server/64/libjvm_db.so
+      ./lib/amd64/server/64/libjvm_dtrace.so
+      ./lib/amd64/server/libjvm.so
+      ./lib/amd64/server/libjvm_db.so
+      ./lib/amd64/server/libjvm_dtrace.so
+      ./bin/appletviewer
+      ./bin/idlj
+      ./bin/jar
+      ./bin/jarsigner
+      ./bin/java
+      ./bin/javac
+      ./bin/javadoc
+      ./bin/javah
+      ./bin/javap
+      ./bin/jdeps
+      ./bin/jcmd
+      ./bin/jconsole
+      ./bin/jdb
+      ./bin/jimage
+      ./bin/jinfo
+      ./bin/jjs
+      ./bin/jmap
+      ./bin/jps
+      ./bin/jrunscript
+      ./bin/jsadebugd
+      ./bin/jstack
+      ./bin/jstat
+      ./bin/jstatd
+      ./bin/keytool
+      ./bin/orbd
+      ./bin/pack200
+      ./bin/policytool
+      ./bin/rmic
+      ./bin/rmid
+      ./bin/rmiregistry
+      ./bin/schemagen
+      ./bin/serialver
+      ./bin/servertool
+      ./bin/tnameserv
+      ./bin/unpack200
+      ./bin/wsgen
+      ./bin/wsimport
+      ./bin/xjc
+      "
 
-SKIP_FULLDUMP_DIFF="true"
+  SKIP_FULLDUMP_DIFF="true"
 
-# Filter random C++ symbol strings.
-# Some numbers differ randomly.
-DIS_DIFF_FILTER="$SED \
-    -e 's/\.[a-zA-Z0-9_\$]\{15\}/<SYM>/g' \
-    -e 's/\(\# \)[0-9a-f]*\( <\)/\1<HEX>\2/g' \
-    -e 's/0x[0-9a-f]*$/<HEX>/g' \
-    -e 's/0x[0-9a-f]*\([,(>]\)/<HEX>\1/g' \
-    -e 's/:	[0-9a-f][0-9a-f]\( [0-9a-f][0-9a-f]\)\{2,10\}/:	<NUMS>/g' \
-    -e 's/     [\.A-Za-z0-9%@]\{16\}$/     <BIN>/g'"
+  # Filter random C++ symbol strings.
+  # Some numbers differ randomly.
+  DIS_DIFF_FILTER="$SED \
+      -e 's/\.[a-zA-Z0-9_\$]\{15\}/<SYM>/g' \
+      -e 's/\(\# \)[0-9a-f]*\( <\)/\1<HEX>\2/g' \
+      -e 's/0x[0-9a-f]*$/<HEX>/g' \
+      -e 's/0x[0-9a-f]*\([,(>]\)/<HEX>\1/g' \
+      -e 's/:	[0-9a-f][0-9a-f]\( [0-9a-f][0-9a-f]\)\{2,10\}/:	<NUMS>/g' \
+      -e 's/     [\.A-Za-z0-9%@]\{16\}$/     <BIN>/g'"
 
 fi
 
 if [ "$OPENJDK_TARGET_OS" = "solaris" ] && [ "$OPENJDK_TARGET_CPU" = "sparcv9" ]; then
 
-STRIP_BEFORE_COMPARE="
-./demo/jni/Poller/lib/libPoller.so
-./demo/jvmti/compiledMethodLoad/lib/libcompiledMethodLoad.so
-./demo/jvmti/gctest/lib/libgctest.so
-./demo/jvmti/heapTracker/lib/libheapTracker.so
-./demo/jvmti/heapViewer/lib/libheapViewer.so
-./demo/jvmti/minst/lib/libminst.so
-./demo/jvmti/mtrace/lib/libmtrace.so
-./demo/jvmti/versionCheck/lib/libversionCheck.so
-./demo/jvmti/waiters/lib/libwaiters.so
-"
+  STRIP_BEFORE_COMPARE="
+      ./demo/jni/Poller/lib/libPoller.so
+      ./demo/jvmti/compiledMethodLoad/lib/libcompiledMethodLoad.so
+      ./demo/jvmti/gctest/lib/libgctest.so
+      ./demo/jvmti/heapTracker/lib/libheapTracker.so
+      ./demo/jvmti/heapViewer/lib/libheapViewer.so
+      ./demo/jvmti/minst/lib/libminst.so
+      ./demo/jvmti/mtrace/lib/libmtrace.so
+      ./demo/jvmti/versionCheck/lib/libversionCheck.so
+      ./demo/jvmti/waiters/lib/libwaiters.so
+      "
 
-SORT_SYMBOLS="
-./demo/jvmti/waiters/lib/libwaiters.so
-./lib/sparcv9/libjsig.so
-./lib/sparcv9/libsaproc.so
-./lib/sparcv9/server/libjvm.so
-./lib/sparcv9/server/libjvm_dtrace.so
-"
+  SORT_SYMBOLS="
+      ./demo/jvmti/waiters/lib/libwaiters.so
+      ./lib/sparcv9/libjsig.so
+      ./lib/sparcv9/libfontmanager.so
+      ./lib/sparcv9/libjimage.so
+      ./lib/sparcv9/libsaproc.so
+      ./lib/sparcv9/libunpack.so
+      ./lib/sparcv9/server/libjvm.so
+      ./lib/sparcv9/server/libjvm_dtrace.so
+      ./bin/unpack200
+      "
 
-SKIP_BIN_DIFF="true"
+  SKIP_BIN_DIFF="true"
 
-ACCEPTED_SMALL_SIZE_DIFF="
-./demo/jni/Poller/lib/libPoller.so
-./demo/jvmti/compiledMethodLoad/lib/libcompiledMethodLoad.so
-./demo/jvmti/gctest/lib/libgctest.so
-./demo/jvmti/heapTracker/lib/libheapTracker.so
-./demo/jvmti/heapViewer/lib/libheapViewer.so
-./demo/jvmti/minst/lib/libminst.so
-./demo/jvmti/mtrace/lib/libmtrace.so
-./demo/jvmti/versionCheck/lib/libversionCheck.so
-./demo/jvmti/waiters/lib/libwaiters.so
-./lib/sparcv9/client/libjvm.so
-./lib/sparcv9/jli/libjli.so
-./lib/sparcv9/jspawnhelper
-./lib/sparcv9/libJdbcOdbc.so
-./lib/sparcv9/libattach.so
-./lib/sparcv9/libawt.so
-./lib/sparcv9/libawt_headless.so
-./lib/sparcv9/libawt_xawt.so
-./lib/sparcv9/libdcpr.so
-./lib/sparcv9/libdt_socket.so
-./lib/sparcv9/libfontmanager.so
-./lib/sparcv9/libinstrument.so
-./lib/sparcv9/libj2gss.so
-./lib/sparcv9/libj2pcsc.so
-./lib/sparcv9/libj2pkcs11.so
-./lib/sparcv9/libj2ucrypto.so
-./lib/sparcv9/libjaas_unix.so
-./lib/sparcv9/libjava.so
-./lib/sparcv9/libjawt.so
-./lib/sparcv9/libjdwp.so
-./lib/sparcv9/libjfr.so
-./lib/sparcv9/libjpeg.so
-./lib/sparcv9/libjsdt.so
-./lib/sparcv9/libjsound.so
-./lib/sparcv9/libkcms.so
-./lib/sparcv9/liblcms.so
-./lib/sparcv9/libmanagement.so
-./lib/sparcv9/libmlib_image.so
-./lib/sparcv9/libmlib_image_v.so
-./lib/sparcv9/libnet.so
-./lib/sparcv9/libnio.so
-./lib/sparcv9/libnpt.so
-./lib/sparcv9/libsctp.so
-./lib/sparcv9/libsplashscreen.so
-./lib/sparcv9/libsunec.so
-./lib/sparcv9/libsunwjdga.so
-./lib/sparcv9/libt2k.so
-./lib/sparcv9/libunpack.so
-./lib/sparcv9/libverify.so
-./lib/sparcv9/libzip.so
-./lib/sparcv9/server/libjvm.so
-./bin/appletviewer
-./bin/idlj
-./bin/jar
-./bin/jarsigner
-./bin/java
-./bin/javac
-./bin/javadoc
-./bin/javah
-./bin/javap
-./bin/jdeps
-./bin/jcmd
-./bin/jconsole
-./bin/jdb
-./bin/jimage
-./bin/jinfo
-./bin/jjs
-./bin/jmap
-./bin/jps
-./bin/jrunscript
-./bin/jsadebugd
-./bin/jstack
-./bin/jstat
-./bin/jstatd
-./bin/keytool
-./bin/orbd
-./bin/pack200
-./bin/policytool
-./bin/rmic
-./bin/rmid
-./bin/rmiregistry
-./bin/schemagen
-./bin/serialver
-./bin/servertool
-./bin/tnameserv
-./bin/unpack200
-./bin/wsgen
-./bin/wsimport
-./bin/xjc
-"
+  ACCEPTED_SMALL_SIZE_DIFF="
+      ./demo/jni/Poller/lib/libPoller.so
+      ./demo/jvmti/compiledMethodLoad/lib/libcompiledMethodLoad.so
+      ./demo/jvmti/gctest/lib/libgctest.so
+      ./demo/jvmti/heapTracker/lib/libheapTracker.so
+      ./demo/jvmti/heapViewer/lib/libheapViewer.so
+      ./demo/jvmti/minst/lib/libminst.so
+      ./demo/jvmti/mtrace/lib/libmtrace.so
+      ./demo/jvmti/versionCheck/lib/libversionCheck.so
+      ./demo/jvmti/waiters/lib/libwaiters.so
+      ./lib/sparcv9/client/libjvm.so
+      ./lib/sparcv9/jli/libjli.so
+      ./lib/sparcv9/jspawnhelper
+      ./lib/sparcv9/libJdbcOdbc.so
+      ./lib/sparcv9/libattach.so
+      ./lib/sparcv9/libawt.so
+      ./lib/sparcv9/libawt_headless.so
+      ./lib/sparcv9/libawt_xawt.so
+      ./lib/sparcv9/libdcpr.so
+      ./lib/sparcv9/libdt_socket.so
+      ./lib/sparcv9/libfontmanager.so
+      ./lib/sparcv9/libinstrument.so
+      ./lib/sparcv9/libj2gss.so
+      ./lib/sparcv9/libj2pcsc.so
+      ./lib/sparcv9/libj2pkcs11.so
+      ./lib/sparcv9/libj2ucrypto.so
+      ./lib/sparcv9/libjaas_unix.so
+      ./lib/sparcv9/libjava.so
+      ./lib/sparcv9/libjawt.so
+      ./lib/sparcv9/libjdwp.so
+      ./lib/sparcv9/libjfr.so
+      ./lib/sparcv9/libjpeg.so
+      ./lib/sparcv9/libjsdt.so
+      ./lib/sparcv9/libjsound.so
+      ./lib/sparcv9/libkcms.so
+      ./lib/sparcv9/liblcms.so
+      ./lib/sparcv9/libmanagement.so
+      ./lib/sparcv9/libmlib_image.so
+      ./lib/sparcv9/libmlib_image_v.so
+      ./lib/sparcv9/libnet.so
+      ./lib/sparcv9/libnio.so
+      ./lib/sparcv9/libnpt.so
+      ./lib/sparcv9/libsctp.so
+      ./lib/sparcv9/libsplashscreen.so
+      ./lib/sparcv9/libsunec.so
+      ./lib/sparcv9/libsunwjdga.so
+      ./lib/sparcv9/libt2k.so
+      ./lib/sparcv9/libunpack.so
+      ./lib/sparcv9/libverify.so
+      ./lib/sparcv9/libzip.so
+      ./lib/sparcv9/server/libjvm.so
+      ./bin/appletviewer
+      ./bin/idlj
+      ./bin/jar
+      ./bin/jarsigner
+      ./bin/java
+      ./bin/javac
+      ./bin/javadoc
+      ./bin/javah
+      ./bin/javap
+      ./bin/jdeps
+      ./bin/jcmd
+      ./bin/jconsole
+      ./bin/jdb
+      ./bin/jimage
+      ./bin/jinfo
+      ./bin/jjs
+      ./bin/jmap
+      ./bin/jps
+      ./bin/jrunscript
+      ./bin/jsadebugd
+      ./bin/jstack
+      ./bin/jstat
+      ./bin/jstatd
+      ./bin/keytool
+      ./bin/orbd
+      ./bin/pack200
+      ./bin/policytool
+      ./bin/rmic
+      ./bin/rmid
+      ./bin/rmiregistry
+      ./bin/schemagen
+      ./bin/serialver
+      ./bin/servertool
+      ./bin/tnameserv
+      ./bin/unpack200
+      ./bin/wsgen
+      ./bin/wsimport
+      ./bin/xjc
+      "
 
-# Some numbers differ randomly.
-DIS_DIFF_FILTER="$SED \
-    -e 's/\$[a-zA-Z0-9_\$]\{15\}/<SYM>/g' \
-    -e 's/:	[0-9a-f][0-9a-f]\( [0-9a-f][0-9a-f]\)\{2,10\}/:	<NUMS>/g' \
-    -e 's/, [0-9a-fx\-]\{1,8\}/, <CONST>/g' \
-    -e 's/call  [0-9a-f]\{7\}/call  <ADDR>/g' \
-    -e 's/0x[0-9a-f]\{1,8\}/<HEX>/g' \
-    -e 's/\! [0-9a-f]\{1,8\} /! <ADDR> /g'"
+  # Some numbers differ randomly.
+  DIS_DIFF_FILTER="$SED \
+      -e 's/\$[a-zA-Z0-9_\$]\{15\}/<SYM>/g' \
+      -e 's/:	[0-9a-f][0-9a-f]\( [0-9a-f][0-9a-f]\)\{2,10\}/:	<NUMS>/g' \
+      -e 's/, [0-9a-fx\-]\{1,8\}/, <CONST>/g' \
+      -e 's/call  [0-9a-f]\{7\}/call  <ADDR>/g' \
+      -e 's/0x[0-9a-f]\{1,8\}/<HEX>/g' \
+      -e 's/\! [0-9a-f]\{1,8\} /! <ADDR> /g'"
 
-# libjvm.so
-# __FILE__ macro usage in debug.hpp causes differences between old and new
-# hotspot builds in ad_sparc.o and ad_sparc_clone.o. The .o files compare
-# equal when stripped, but at link time differences appear. Removing
-# __FILE__ from ShouldNotCallThis() and ShouldNotReachHere() removes
-# the differences.
-KNOWN_DIS_DIFF="
-./lib/sparcv9/server/libjvm.so
-"
+  # libjvm.so
+  # __FILE__ macro usage in debug.hpp causes differences between old and new
+  # hotspot builds in ad_sparc.o and ad_sparc_clone.o. The .o files compare
+  # equal when stripped, but at link time differences appear. Removing
+  # __FILE__ from ShouldNotCallThis() and ShouldNotReachHere() removes
+  # the differences.
+  KNOWN_DIS_DIFF="
+      ./lib/sparcv9/server/libjvm.so
+      ./lib/sparcv9/libsaproc.so
+  "
 
-SKIP_FULLDUMP_DIFF="true"
+  SKIP_FULLDUMP_DIFF="true"
 
 fi
 
 
 if [ "$OPENJDK_TARGET_OS" = "windows" ]; then
 
-ACCEPTED_JARZIP_CONTENTS="
-/modules_libs/java.security.jgss/w2k_lsa_auth.diz
-/modules_libs/java.security.jgss/w2k_lsa_auth.dll
-"
+  ACCEPTED_JARZIP_CONTENTS="
+      /modules_libs/java.security.jgss/w2k_lsa_auth.diz
+      /modules_libs/java.security.jgss/w2k_lsa_auth.dll
+      "
 
-# Probably should add all libs here
-ACCEPTED_SMALL_SIZE_DIFF="
-./demo/jvmti/gctest/lib/gctest.dll
-./demo/jvmti/heapTracker/lib/heapTracker.dll
-./demo/jvmti/minst/lib/minst.dll
-./bin/attach.dll
-./bin/jsoundds.dll
-./bin/server/jvm.dll
-./bin/appletviewer.exe
-./bin/idlj.exe
-./bin/jar.exe
-./bin/jarsigner.exe
-./bin/java-rmi.exe
-./bin/java.exe
-./bin/javac.exe
-./bin/javadoc.exe
-./bin/javah.exe
-./bin/javap.exe
-./bin/jdeps.exe
-./bin/javaw.exe
-./bin/jcmd.exe
-./bin/jconsole.exe
-./bin/jdb.exe
-./bin/jimage.exe
-./bin/jinfo.exe
-./bin/jjs.exe
-./bin/jmap.exe
-./bin/jps.exe
-./bin/jrunscript.exe
-./bin/jsadebugd.exe
-./bin/jstack.exe
-./bin/jstat.exe
-./bin/jstatd.exe
-./bin/keytool.exe
-./bin/kinit.exe
-./bin/klist.exe
-./bin/ktab.exe
-./bin/orbd.exe
-./bin/pack200.exe
-./bin/policytool.exe
-./bin/rmic.exe
-./bin/rmid.exe
-./bin/rmiregistry.exe
-./bin/schemagen.exe
-./bin/serialver.exe
-./bin/servertool.exe
-./bin/tnameserv.exe
-./bin/unpack200.exe
-./bin/wsgen.exe
-./bin/wsimport.exe
-./bin/xjc.exe
-"
+  # Probably should add all libs here
+  ACCEPTED_SMALL_SIZE_DIFF="
+      ./demo/jvmti/gctest/lib/gctest.dll
+      ./demo/jvmti/heapTracker/lib/heapTracker.dll
+      ./demo/jvmti/minst/lib/minst.dll
+      ./bin/attach.dll
+      ./bin/jsoundds.dll
+      ./bin/server/jvm.dll
+      ./bin/appletviewer.exe
+      ./bin/idlj.exe
+      ./bin/jar.exe
+      ./bin/jarsigner.exe
+      ./bin/java-rmi.exe
+      ./bin/java.exe
+      ./bin/javac.exe
+      ./bin/javadoc.exe
+      ./bin/javah.exe
+      ./bin/javap.exe
+      ./bin/jdeps.exe
+      ./bin/javaw.exe
+      ./bin/jcmd.exe
+      ./bin/jconsole.exe
+      ./bin/jdb.exe
+      ./bin/jimage.exe
+      ./bin/jinfo.exe
+      ./bin/jjs.exe
+      ./bin/jmap.exe
+      ./bin/jps.exe
+      ./bin/jrunscript.exe
+      ./bin/jsadebugd.exe
+      ./bin/jstack.exe
+      ./bin/jstat.exe
+      ./bin/jstatd.exe
+      ./bin/keytool.exe
+      ./bin/kinit.exe
+      ./bin/klist.exe
+      ./bin/ktab.exe
+      ./bin/orbd.exe
+      ./bin/pack200.exe
+      ./bin/policytool.exe
+      ./bin/rmic.exe
+      ./bin/rmid.exe
+      ./bin/rmiregistry.exe
+      ./bin/schemagen.exe
+      ./bin/serialver.exe
+      ./bin/servertool.exe
+      ./bin/tnameserv.exe
+      ./bin/unpack200.exe
+      ./bin/wsgen.exe
+      ./bin/wsimport.exe
+      ./bin/xjc.exe
+      "
 
-# jabswitch.exe is compiled and linked with incremental turned on in the old
-# build. This makes no sense, so it's turned off in the new build.
-ACCEPTED_SIZE_DIFF="
-./bin/jabswitch.exe
-"
-ACCEPTED_DIS_DIFF="
-./bin/jabswitch.exe
-"
+  ACCEPTED_DIS_DIFF="
+      ./bin/jabswitch.exe
+      "
 
-# On windows, there are unavoidable allignment issues making
-# a perfect disasm diff impossible. Filter out the following:
-# * Random parts of C++ symbols (this is a bit greedy, but does the trick)
-#   @XXXXX
-# * Hexadecimal addresses that are sometimes alligned differently.
-# * Dates in version strings XXXX_XX_XX.
-DIS_DIFF_FILTER="$SED \
-    -e 's/^  [0-9A-F]\{16\}: //g' \
-    -e 's/[@?][A-Za-z0-9_]\{1,25\}/<SYM>/g' \
-    -e 's/\([\[+]\)[0-9A-F]\{4,16\}h\]/\1<HEXSTR>]/g' \
-    -e 's/_[0-9]\{4\}_[0-9]\{2\}_[0-9]\{2\}/_<DATE>/g'"
-#DIS_DIFF_FILTER="$CAT"
+  # On windows, there are unavoidable allignment issues making
+  # a perfect disasm diff impossible. Filter out the following:
+  # * Random parts of C++ symbols (this is a bit greedy, but does the trick)
+  #   @XXXXX
+  # * Hexadecimal addresses that are sometimes alligned differently.
+  # * Dates in version strings XXXX_XX_XX.
+  DIS_DIFF_FILTER="$SED \
+      -e 's/^  [0-9A-F]\{16\}: //g' \
+      -e 's/[@?][A-Za-z0-9_]\{1,25\}/<SYM>/g' \
+      -e 's/\([\[+]\)[0-9A-F]\{4,16\}h\]/\1<HEXSTR>]/g' \
+      -e 's/_[0-9]\{4\}_[0-9]\{2\}_[0-9]\{2\}/_<DATE>/g'"
+  #DIS_DIFF_FILTER="$CAT"
 
-SKIP_BIN_DIFF="true"
-SKIP_FULLDUMP_DIFF="true"
+  SKIP_BIN_DIFF="true"
+  SKIP_FULLDUMP_DIFF="true"
 
 fi
 
 
 if [ "$OPENJDK_TARGET_OS" = "macosx" ]; then
-ACCEPTED_JARZIP_CONTENTS="
-/META-INF/INDEX.LIST
-"
+
+  ACCEPTED_JARZIP_CONTENTS="
+      /META-INF/INDEX.LIST
+      "
 
-ACCEPTED_BIN_DIFF="
-./bin/appletviewer
-./bin/idlj
-./bin/jar
-./bin/jarsigner
-./bin/java
-./bin/javac
-./bin/javadoc
-./bin/javah
-./bin/javap
-./bin/javaws
-./bin/jdeps
-./bin/jcmd
-./bin/jconsole
-./bin/jdb
-./bin/jimage
-./bin/jinfo
-./bin/jjs
-./bin/jmap
-./bin/jps
-./bin/jrunscript
-./bin/jsadebugd
-./bin/jstack
-./bin/jstat
-./bin/jstatd
-./bin/keytool
-./bin/orbd
-./bin/pack200
-./bin/policytool
-./bin/rmic
-./bin/rmid
-./bin/rmiregistry
-./bin/schemagen
-./bin/serialver
-./bin/servertool
-./bin/tnameserv
-./bin/wsgen
-./bin/wsimport
-./bin/xjc
-./demo/jvmti/compiledMethodLoad/lib/libcompiledMethodLoad.dylib
-./demo/jvmti/gctest/lib/libgctest.dylib
-./demo/jvmti/heapTracker/lib/libheapTracker.dylib
-./demo/jvmti/heapViewer/lib/libheapViewer.dylib
-./demo/jvmti/minst/lib/libminst.dylib
-./demo/jvmti/mtrace/lib/libmtrace.dylib
-./demo/jvmti/versionCheck/lib/libversionCheck.dylib
-./demo/jvmti/waiters/lib/libwaiters.dylib
-./Contents/Home/bin/_javaws
-./Contents/Home/bin/idlj
-./Contents/Home/bin/servertool
-./Contents/Home/lib/shortcuts/JavaWSApplicationStub
-./Contents/Home/lib/jli/libjli.dylib
-./Contents/Home/lib/libAppleScriptEngine.dylib
-./Contents/Home/lib/libattach.dylib
-./Contents/Home/lib/libawt_lwawt.dylib
-./Contents/Home/lib/libdeploy.dylib
-./Contents/Home/lib/libdt_socket.dylib
-./Contents/Home/lib/libinstrument.dylib
-./Contents/Home/lib/libjdwp.dylib
-./Contents/Home/lib/libjsdt.dylib
-./Contents/Home/lib/libjsig.dylib
-./Contents/Home/lib/libmanagement.dylib
-./Contents/Home/lib/libnpjp2.dylib
-./Contents/Home/lib/libosx.dylib
-./Contents/Home/lib/libosxapp.dylib
-./Contents/Home/lib/libverify.dylib
-./Contents/Home/lib/libsaproc.dylib
-./Contents/Home/lib/libsplashscreen.dylib
-./Contents/Home/lib/server/libjvm.dylib
-./Contents/Home/lib/deploy/JavaControlPanel.prefPane/Contents/MacOS/JavaControlPanel
-./Contents/Resources/JavaControlPanelHelper
-./Contents/Resources/JavaUpdater.app/Contents/MacOS/JavaUpdater
-./lib/shortcuts/JavaWSApplicationStub
-./lib/jli/libjli.dylib
-./lib/libAppleScriptEngine.dylib
-./lib/libattach.dylib
-./lib/libawt_lwawt.dylib
-./lib/libdeploy.dylib
-./lib/libdt_socket.dylib
-./lib/libinstrument.dylib
-./lib/libjdwp.dylib
-./lib/libjsdt.dylib
-./lib/libjsig.dylib
-./lib/libmanagement.dylib
-./lib/libnpjp2.dylib
-./lib/libosx.dylib
-./lib/libosxapp.dylib
-./lib/libverify.dylib
-./lib/libsaproc.dylib
-./lib/libsplashscreen.dylib
-./lib/server/libjvm.dylib
-./lib/deploy/JavaControlPanel.prefPane/Contents/MacOS/JavaControlPanel
-"
+  ACCEPTED_BIN_DIFF="
+      ./bin/appletviewer
+      ./bin/idlj
+      ./bin/jar
+      ./bin/jarsigner
+      ./bin/java
+      ./bin/javac
+      ./bin/javadoc
+      ./bin/javah
+      ./bin/javap
+      ./bin/javaws
+      ./bin/jdeps
+      ./bin/jcmd
+      ./bin/jconsole
+      ./bin/jdb
+      ./bin/jimage
+      ./bin/jinfo
+      ./bin/jjs
+      ./bin/jmap
+      ./bin/jps
+      ./bin/jrunscript
+      ./bin/jsadebugd
+      ./bin/jstack
+      ./bin/jstat
+      ./bin/jstatd
+      ./bin/keytool
+      ./bin/orbd
+      ./bin/pack200
+      ./bin/policytool
+      ./bin/rmic
+      ./bin/rmid
+      ./bin/rmiregistry
+      ./bin/schemagen
+      ./bin/serialver
+      ./bin/servertool
+      ./bin/tnameserv
+      ./bin/wsgen
+      ./bin/wsimport
+      ./bin/xjc
+      ./demo/jvmti/compiledMethodLoad/lib/libcompiledMethodLoad.dylib
+      ./demo/jvmti/gctest/lib/libgctest.dylib
+      ./demo/jvmti/heapTracker/lib/libheapTracker.dylib
+      ./demo/jvmti/heapViewer/lib/libheapViewer.dylib
+      ./demo/jvmti/minst/lib/libminst.dylib
+      ./demo/jvmti/mtrace/lib/libmtrace.dylib
+      ./demo/jvmti/versionCheck/lib/libversionCheck.dylib
+      ./demo/jvmti/waiters/lib/libwaiters.dylib
+      ./Contents/Home/bin/_javaws
+      ./Contents/Home/bin/javaws
+      ./Contents/Home/bin/idlj
+      ./Contents/Home/bin/servertool
+      ./Contents/Home/lib/shortcuts/JavaWSApplicationStub
+      ./Contents/Home/lib/jli/libjli.dylib
+      ./Contents/Home/lib/jspawnhelper
+      ./Contents/Home/lib/libAppleScriptEngine.dylib
+      ./Contents/Home/lib/libattach.dylib
+      ./Contents/Home/lib/libawt_lwawt.dylib
+      ./Contents/Home/lib/libdeploy.dylib
+      ./Contents/Home/lib/libdt_socket.dylib
+      ./Contents/Home/lib/libinstrument.dylib
+      ./Contents/Home/lib/libjdwp.dylib
+      ./Contents/Home/lib/libjsdt.dylib
+      ./Contents/Home/lib/libjsig.dylib
+      ./Contents/Home/lib/libmanagement.dylib
+      ./Contents/Home/lib/libnpjp2.dylib
+      ./Contents/Home/lib/libosx.dylib
+      ./Contents/Home/lib/libosxapp.dylib
+      ./Contents/Home/lib/libosxui.dylib
+      ./Contents/Home/lib/libverify.dylib
+      ./Contents/Home/lib/libsaproc.dylib
+      ./Contents/Home/lib/libsplashscreen.dylib
+      ./Contents/Home/lib/server/libjvm.dylib
+      ./Contents/Home/lib/deploy/JavaControlPanel.prefPane/Contents/MacOS/JavaControlPanel
+      ./Contents/Resources/JavaControlPanelHelper
+      ./Contents/Resources/JavaUpdater.app/Contents/MacOS/JavaUpdater
+      ./Contents/Resources/JavawsLauncher.app/Contents/MacOS/JavawsLauncher
+      ./lib/shortcuts/JavaWSApplicationStub
+      ./lib/jli/libjli.dylib
+      ./lib/jspawnhelper
+      ./lib/libAppleScriptEngine.dylib
+      ./lib/libattach.dylib
+      ./lib/libawt_lwawt.dylib
+      ./lib/libdeploy.dylib
+      ./lib/libdt_socket.dylib
+      ./lib/libinstrument.dylib
+      ./lib/libjdwp.dylib
+      ./lib/libjsdt.dylib
+      ./lib/libjsig.dylib
+      ./lib/libmanagement.dylib
+      ./lib/libnpjp2.dylib
+      ./lib/libosx.dylib
+      ./lib/libosxapp.dylib
+      ./lib/libosxui.dylib
+      ./lib/libverify.dylib
+      ./lib/libsaproc.dylib
+      ./lib/libsplashscreen.dylib
+      ./lib/server/libjvm.dylib
+      ./lib/deploy/JavaControlPanel.prefPane/Contents/MacOS/JavaControlPanel
+      ./Versions/A/Resources/finish_installation.app/Contents/MacOS/finish_installation
+      ./Versions/A/Sparkle
+      "
 
-SORT_SYMBOLS="
-./Contents/Home/lib/libsaproc.dylib
-./lib/libsaproc.dylib
-./lib/libjsig.dylib
-"
+  SORT_SYMBOLS="
+      ./Contents/Home/lib/libsaproc.dylib
+      ./lib/libsaproc.dylib
+      ./lib/libjsig.dylib
+      "
 
-ACCEPTED_SMALL_SIZE_DIFF="$ACCEPTED_BIN_DIFF"
+  ACCEPTED_SMALL_SIZE_DIFF="$ACCEPTED_BIN_DIFF"
 
-DIS_DIFF_FILTER="LANG=C $SED \
-    -e 's/0x[0-9a-f]\{3,16\}/<HEXSTR>/g' -e 's/^[0-9a-f]\{12,20\}/<ADDR>/'"
+  DIS_DIFF_FILTER="LANG=C $SED \
+      -e 's/0x[0-9a-f]\{3,16\}/<HEXSTR>/g' -e 's/^[0-9a-f]\{12,20\}/<ADDR>/' \
+      -e 's/## literal pool for: .Java HotSpot(TM) 64-Bit Server VM.*/<COMMENT>/g'
+      "
 
 fi
--- a/hotspot/.hgtags	Mon Feb 15 14:25:21 2016 +0000
+++ b/hotspot/.hgtags	Wed Jul 05 21:20:03 2017 +0200
@@ -507,3 +507,4 @@
 d5239fc1b69749ae50793c61b899fcdacf3df857 jdk-9+102
 c5f55130b1b69510d9a6f4a3105b58e21cd7ffe1 jdk-9+103
 534c50395957c6025fb6627e93b35756f8d48a08 jdk-9+104
+266fa9bb5297bf02cb2a7b038b10a109817d2b48 jdk-9+105
--- a/hotspot/make/lib/Lib-jdk.hotspot.agent.gmk	Mon Feb 15 14:25:21 2016 +0000
+++ b/hotspot/make/lib/Lib-jdk.hotspot.agent.gmk	Wed Jul 05 21:20:03 2017 +0200
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2015, 2016, 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
@@ -29,6 +29,10 @@
 
 ################################################################################
 
+ifneq ($(findstring $(OPENJDK_TARGET_OS), macosx windows), )
+  DISABLE_MAPFILES := true
+endif
+
 SA_TOPDIR := $(HOTSPOT_TOPDIR)/src/jdk.hotspot.agent
 
 # Defaults for most platforms
--- a/hotspot/src/cpu/aarch64/vm/stubGenerator_aarch64.cpp	Mon Feb 15 14:25:21 2016 +0000
+++ b/hotspot/src/cpu/aarch64/vm/stubGenerator_aarch64.cpp	Wed Jul 05 21:20:03 2017 +0200
@@ -962,7 +962,7 @@
       __ lea(d, Address(d, count, Address::lsl(exact_log2(-step))));
     }
 
-    Label done, tail;
+    Label tail;
 
     __ cmp(count, 16/granularity);
     __ br(Assembler::LO, tail);
@@ -987,7 +987,8 @@
       }
       // rscratch2 is the byte adjustment needed to align s.
       __ cbz(rscratch2, aligned);
-      __ lsr(rscratch2, rscratch2, exact_log2(granularity));
+      int shift = exact_log2(granularity);
+      if (shift)  __ lsr(rscratch2, rscratch2, shift);
       __ sub(count, count, rscratch2);
 
 #if 0
--- a/hotspot/src/cpu/sparc/vm/vm_version_sparc.cpp	Mon Feb 15 14:25:21 2016 +0000
+++ b/hotspot/src/cpu/sparc/vm/vm_version_sparc.cpp	Wed Jul 05 21:20:03 2017 +0200
@@ -45,13 +45,6 @@
   if( cache_line_size > AllocatePrefetchStepSize )
     AllocatePrefetchStepSize = cache_line_size;
 
-  assert(AllocatePrefetchLines > 0, "invalid value");
-  if( AllocatePrefetchLines < 1 )     // set valid value in product VM
-    AllocatePrefetchLines = 3;
-  assert(AllocateInstancePrefetchLines > 0, "invalid value");
-  if( AllocateInstancePrefetchLines < 1 ) // set valid value in product VM
-    AllocateInstancePrefetchLines = 1;
-
   AllocatePrefetchDistance = allocate_prefetch_distance();
   AllocatePrefetchStyle    = allocate_prefetch_style();
 
--- a/hotspot/src/cpu/x86/vm/sharedRuntime_x86_32.cpp	Mon Feb 15 14:25:21 2016 +0000
+++ b/hotspot/src/cpu/x86/vm/sharedRuntime_x86_32.cpp	Wed Jul 05 21:20:03 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2016, 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
@@ -114,15 +114,20 @@
 
 OopMap* RegisterSaver::save_live_registers(MacroAssembler* masm, int additional_frame_words,
                                            int* total_frame_words, bool verify_fpu, bool save_vectors) {
-  int vect_words = 0;
   int num_xmm_regs = XMMRegisterImpl::number_of_registers;
+  int ymm_bytes = num_xmm_regs * 16;
+  int zmm_bytes = num_xmm_regs * 32;
 #ifdef COMPILER2
   if (save_vectors) {
-    assert(UseAVX > 0, "512bit vectors are supported only with EVEX");
-    assert(MaxVectorSize == 64, "only 512bit vectors are supported now");
-    // Save upper half of ZMM/YMM registers :
-    vect_words = 8 * 16 / wordSize;
-    additional_frame_words += vect_words;
+    assert(UseAVX > 0, "up to 512bit vectors are supported with EVEX");
+    assert(MaxVectorSize <= 64, "up to 512bit vectors are supported now");
+    // Save upper half of YMM registers
+    int vect_bytes = ymm_bytes;
+    if (UseAVX > 2) {
+      // Save upper half of ZMM registers as well
+      vect_bytes += zmm_bytes;
+    }
+    additional_frame_words += vect_bytes / wordSize;
   }
 #else
   assert(!save_vectors, "vectors are generated only by C2");
@@ -185,13 +190,14 @@
 
   off = xmm0_off;
   delta = xmm1_off - off;
-  if(UseSSE == 1) {           // Save the XMM state
+  if(UseSSE == 1) {
+    // Save the XMM state
     for (int n = 0; n < num_xmm_regs; n++) {
       __ movflt(Address(rsp, off*wordSize), as_XMMRegister(n));
       off += delta;
     }
   } else if(UseSSE >= 2) {
-    // Save whole 128bit (16 bytes) XMM regiters
+    // Save whole 128bit (16 bytes) XMM registers
     for (int n = 0; n < num_xmm_regs; n++) {
       __ movdqu(Address(rsp, off*wordSize), as_XMMRegister(n));
       off += delta;
@@ -199,13 +205,14 @@
   }
 
   if (save_vectors) {
-    assert(vect_words*wordSize == 128, "");
-    __ subptr(rsp, 128); // Save upper half of YMM registes
+    __ subptr(rsp, ymm_bytes);
+    // Save upper half of YMM registers
     for (int n = 0; n < num_xmm_regs; n++) {
       __ vextractf128h(Address(rsp, n*16), as_XMMRegister(n));
     }
     if (UseAVX > 2) {
-      __ subptr(rsp, 256); // Save upper half of ZMM registes
+      __ subptr(rsp, zmm_bytes);
+      // Save upper half of ZMM registers
       for (int n = 0; n < num_xmm_regs; n++) {
         __ vextractf64x4h(Address(rsp, n*32), as_XMMRegister(n), 1);
       }
@@ -255,48 +262,57 @@
 
 void RegisterSaver::restore_live_registers(MacroAssembler* masm, bool restore_vectors) {
   int num_xmm_regs = XMMRegisterImpl::number_of_registers;
+  int ymm_bytes = num_xmm_regs * 16;
+  int zmm_bytes = num_xmm_regs * 32;
   // Recover XMM & FPU state
   int additional_frame_bytes = 0;
 #ifdef COMPILER2
   if (restore_vectors) {
-    assert(UseAVX > 0, "512bit vectors are supported only with EVEX");
-    assert(MaxVectorSize == 64, "only 512bit vectors are supported now");
-    additional_frame_bytes = 128;
+    assert(UseAVX > 0, "up to 512bit vectors are supported with EVEX");
+    assert(MaxVectorSize <= 64, "up to 512bit vectors are supported now");
+    // Save upper half of YMM registers
+    additional_frame_bytes = ymm_bytes;
+    if (UseAVX > 2) {
+      // Save upper half of ZMM registers as well
+      additional_frame_bytes += zmm_bytes;
+    }
   }
 #else
   assert(!restore_vectors, "vectors are generated only by C2");
 #endif
 
+  int off = xmm0_off;
+  int delta = xmm1_off - off;
+
+  if (UseSSE == 1) {
+    // Restore XMM registers
+    assert(additional_frame_bytes == 0, "");
+    for (int n = 0; n < num_xmm_regs; n++) {
+      __ movflt(as_XMMRegister(n), Address(rsp, off*wordSize));
+      off += delta;
+    }
+  } else if (UseSSE >= 2) {
+    // Restore whole 128bit (16 bytes) XMM registers. Do this before restoring YMM and
+    // ZMM because the movdqu instruction zeros the upper part of the XMM register.
+    for (int n = 0; n < num_xmm_regs; n++) {
+      __ movdqu(as_XMMRegister(n), Address(rsp, off*wordSize+additional_frame_bytes));
+      off += delta;
+    }
+  }
+
   if (restore_vectors) {
-    assert(additional_frame_bytes == 128, "");
     if (UseAVX > 2) {
       // Restore upper half of ZMM registers.
       for (int n = 0; n < num_xmm_regs; n++) {
         __ vinsertf64x4h(as_XMMRegister(n), Address(rsp, n*32), 1);
       }
-      __ addptr(rsp, additional_frame_bytes*2); // Save upper half of ZMM registes
+      __ addptr(rsp, zmm_bytes);
     }
-    // Restore upper half of YMM registes.
+    // Restore upper half of YMM registers.
     for (int n = 0; n < num_xmm_regs; n++) {
       __ vinsertf128h(as_XMMRegister(n), Address(rsp, n*16));
     }
-    __ addptr(rsp, additional_frame_bytes); // Save upper half of YMM registes
-  }
-
-  int off = xmm0_off;
-  int delta = xmm1_off - off;
-
-  if (UseSSE == 1) {
-    for (int n = 0; n < num_xmm_regs; n++) {
-      __ movflt(as_XMMRegister(n), Address(rsp, off*wordSize));
-      off += delta;
-    }
-  } else if (UseSSE >= 2) {
-    // additional_frame_bytes only populated for the restore_vector case, else it is 0
-    for (int n = 0; n < num_xmm_regs; n++) {
-      __ movdqu(as_XMMRegister(n), Address(rsp, off*wordSize+additional_frame_bytes));
-      off += delta;
-    }
+    __ addptr(rsp, ymm_bytes);
   }
 
   __ pop_FPU_state();
@@ -306,7 +322,6 @@
   __ popa();
   // Get the rbp, described implicitly by the frame sender code (no oopMap)
   __ pop(rbp);
-
 }
 
 void RegisterSaver::restore_result_registers(MacroAssembler* masm) {
--- a/hotspot/src/cpu/x86/vm/sharedRuntime_x86_64.cpp	Mon Feb 15 14:25:21 2016 +0000
+++ b/hotspot/src/cpu/x86/vm/sharedRuntime_x86_64.cpp	Wed Jul 05 21:20:03 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2016, 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
@@ -150,8 +150,8 @@
   }
 #if defined(COMPILER2) || INCLUDE_JVMCI
   if (save_vectors) {
-    assert(UseAVX > 0, "512bit vectors are supported only with EVEX");
-    assert(MaxVectorSize == 64, "only 512bit vectors are supported now");
+    assert(UseAVX > 0, "up to 512bit vectors are supported with EVEX");
+    assert(MaxVectorSize <= 64, "up to 512bit vectors are supported now");
   }
 #else
   assert(!save_vectors, "vectors are generated only by C2 and JVMCI");
@@ -176,18 +176,18 @@
 
   // push cpu state handles this on EVEX enabled targets
   if (save_vectors) {
-    // Save upper half of YMM registes(0..15)
+    // Save upper half of YMM registers(0..15)
     int base_addr = XSAVE_AREA_YMM_BEGIN;
     for (int n = 0; n < 16; n++) {
       __ vextractf128h(Address(rsp, base_addr+n*16), as_XMMRegister(n));
     }
     if (VM_Version::supports_evex()) {
-      // Save upper half of ZMM registes(0..15)
+      // Save upper half of ZMM registers(0..15)
       base_addr = XSAVE_AREA_ZMM_BEGIN;
       for (int n = 0; n < 16; n++) {
         __ vextractf64x4h(Address(rsp, base_addr+n*32), as_XMMRegister(n), 1);
       }
-      // Save full ZMM registes(16..num_xmm_regs)
+      // Save full ZMM registers(16..num_xmm_regs)
       base_addr = XSAVE_AREA_UPPERBANK;
       off = 0;
       int vector_len = Assembler::AVX_512bit;
@@ -321,8 +321,8 @@
 
 #if defined(COMPILER2) || INCLUDE_JVMCI
   if (restore_vectors) {
-    assert(UseAVX > 0, "512bit vectors are supported only with EVEX");
-    assert(MaxVectorSize == 64, "only 512bit vectors are supported now");
+    assert(UseAVX > 0, "up to 512bit vectors are supported with EVEX");
+    assert(MaxVectorSize <= 64, "up to 512bit vectors are supported now");
   }
 #else
   assert(!restore_vectors, "vectors are generated only by C2");
@@ -330,18 +330,18 @@
 
   // On EVEX enabled targets everything is handled in pop fpu state
   if (restore_vectors) {
-    // Restore upper half of YMM registes (0..15)
+    // Restore upper half of YMM registers (0..15)
     int base_addr = XSAVE_AREA_YMM_BEGIN;
     for (int n = 0; n < 16; n++) {
       __ vinsertf128h(as_XMMRegister(n), Address(rsp,  base_addr+n*16));
     }
     if (VM_Version::supports_evex()) {
-      // Restore upper half of ZMM registes (0..15)
+      // Restore upper half of ZMM registers (0..15)
       base_addr = XSAVE_AREA_ZMM_BEGIN;
       for (int n = 0; n < 16; n++) {
         __ vinsertf64x4h(as_XMMRegister(n), Address(rsp, base_addr+n*32), 1);
       }
-      // Restore full ZMM registes(16..num_xmm_regs)
+      // Restore full ZMM registers(16..num_xmm_regs)
       base_addr = XSAVE_AREA_UPPERBANK;
       int vector_len = Assembler::AVX_512bit;
       int off = 0;
@@ -351,7 +351,7 @@
     }
   } else {
     if (VM_Version::supports_evex()) {
-      // Restore upper bank of ZMM registes(16..31) for double/float usage
+      // Restore upper bank of ZMM registers(16..31) for double/float usage
       int base_addr = XSAVE_AREA_UPPERBANK;
       int off = 0;
       for (int n = 16; n < num_xmm_regs; n++) {
--- a/hotspot/src/cpu/x86/vm/vm_version_x86.cpp	Mon Feb 15 14:25:21 2016 +0000
+++ b/hotspot/src/cpu/x86/vm/vm_version_x86.cpp	Wed Jul 05 21:20:03 2017 +0200
@@ -1163,13 +1163,6 @@
   if( cache_line_size > AllocatePrefetchStepSize )
     AllocatePrefetchStepSize = cache_line_size;
 
-  assert(AllocatePrefetchLines > 0, "invalid value");
-  if( AllocatePrefetchLines < 1 )     // set valid value in product VM
-    AllocatePrefetchLines = 3;
-  assert(AllocateInstancePrefetchLines > 0, "invalid value");
-  if( AllocateInstancePrefetchLines < 1 ) // set valid value in product VM
-    AllocateInstancePrefetchLines = 1;
-
   AllocatePrefetchDistance = allocate_prefetch_distance();
   AllocatePrefetchStyle    = allocate_prefetch_style();
 
@@ -1183,7 +1176,9 @@
     }
     if (supports_sse4_2() && supports_ht()) { // Nehalem based cpus
       AllocatePrefetchDistance = 192;
-      AllocatePrefetchLines = 4;
+      if (FLAG_IS_DEFAULT(AllocatePrefetchLines)) {
+        FLAG_SET_DEFAULT(AllocatePrefetchLines, 4);
+      }
     }
 #ifdef COMPILER2
     if (supports_sse4_2()) {
--- a/hotspot/src/os/windows/vm/version.rc	Mon Feb 15 14:25:21 2016 +0000
+++ b/hotspot/src/os/windows/vm/version.rc	Wed Jul 05 21:20:03 2017 +0200
@@ -1,5 +1,5 @@
 //
-// Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved.
+// Copyright (c) 2004, 2016, 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
@@ -19,7 +19,7 @@
 // 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.
-//  
+//
 //
 
 #include "winresrc.h"
@@ -36,7 +36,7 @@
 //
 
 VS_VERSION_INFO VERSIONINFO
- FILEVERSION    HS_VER
+ FILEVERSION    JDK_VER
  PRODUCTVERSION JDK_VER
  FILEFLAGSMASK 0x3fL
 #ifdef _DEBUG
@@ -56,7 +56,7 @@
         BEGIN
             VALUE "CompanyName",      XSTR(HS_COMPANY)       "\0"
             VALUE "FileDescription",  XSTR(HS_FILEDESC)      "\0"
-            VALUE "FileVersion",      XSTR(HS_DOTVER)        "\0"
+            VALUE "FileVersion",      XSTR(JDK_DOTVER)        "\0"
             VALUE "Full Version",     XSTR(HS_BUILD_ID)      "\0"
 	    VALUE "InternalName",     XSTR(HS_INTERNAL_NAME) "\0"
             VALUE "LegalCopyright",   XSTR(HS_COPYRIGHT)     "\0"
--- a/hotspot/src/share/vm/ci/ciField.cpp	Mon Feb 15 14:25:21 2016 +0000
+++ b/hotspot/src/share/vm/ci/ciField.cpp	Wed Jul 05 21:20:03 2017 +0200
@@ -72,7 +72,7 @@
 
   assert(ciObjectFactory::is_initialized(), "not a shared field");
 
-  assert(klass->get_instanceKlass()->is_linked(), "must be linked before using its constan-pool");
+  assert(klass->get_instanceKlass()->is_linked(), "must be linked before using its constant-pool");
 
   constantPoolHandle cpool(thread, klass->get_instanceKlass()->constants());
 
@@ -106,10 +106,31 @@
   // even though we may not need to.
   int holder_index = cpool->klass_ref_index_at(index);
   bool holder_is_accessible;
-  ciInstanceKlass* declared_holder =
-    ciEnv::current(thread)->get_klass_by_index(cpool, holder_index,
-                                               holder_is_accessible,
-                                               klass)->as_instance_klass();
+
+  ciKlass* generic_declared_holder = ciEnv::current(thread)->get_klass_by_index(cpool, holder_index,
+                                                                                holder_is_accessible,
+                                                                                klass);
+
+  if (generic_declared_holder->is_array_klass()) {
+    // If the declared holder of the field is an array class, assume that
+    // the canonical holder of that field is java.lang.Object. Arrays
+    // do not have fields; java.lang.Object is the only supertype of an
+    // array type that can declare fields and is therefore the canonical
+    // holder of the array type.
+    //
+    // Furthermore, the compilers assume that java.lang.Object does not
+    // have any fields. Therefore, the field is not looked up. Instead,
+    // the method returns partial information that will trigger special
+    // handling in ciField::will_link and will result in a
+    // java.lang.NoSuchFieldError exception being thrown by the compiled
+    // code (the expected behavior in this case).
+    _holder = ciEnv::current(thread)->Object_klass();
+    _offset = -1;
+    _is_constant = false;
+    return;
+  }
+
+  ciInstanceKlass* declared_holder = generic_declared_holder->as_instance_klass();
 
   // The declared holder of this field may not have been loaded.
   // Bail out with partial field information.
--- a/hotspot/src/share/vm/opto/addnode.cpp	Mon Feb 15 14:25:21 2016 +0000
+++ b/hotspot/src/share/vm/opto/addnode.cpp	Wed Jul 05 21:20:03 2017 +0200
@@ -61,7 +61,7 @@
 
 //------------------------------commute----------------------------------------
 // Commute operands to move loads and constants to the right.
-static bool commute( Node *add, int con_left, int con_right ) {
+static bool commute(Node *add, bool con_left, bool con_right) {
   Node *in1 = add->in(1);
   Node *in2 = add->in(2);
 
@@ -110,8 +110,8 @@
 Node *AddNode::Ideal(PhaseGVN *phase, bool can_reshape) {
   const Type *t1 = phase->type( in(1) );
   const Type *t2 = phase->type( in(2) );
-  int con_left  = t1->singleton();
-  int con_right = t2->singleton();
+  bool con_left  = t1->singleton();
+  bool con_right = t2->singleton();
 
   // Check for commutative operation desired
   if( commute(this,con_left,con_right) ) return this;
--- a/hotspot/src/share/vm/opto/loopTransform.cpp	Mon Feb 15 14:25:21 2016 +0000
+++ b/hotspot/src/share/vm/opto/loopTransform.cpp	Wed Jul 05 21:20:03 2017 +0200
@@ -3048,7 +3048,7 @@
   // state of the loop.  It's safe in this case to replace it with the
   // result_mem.
   _igvn.replace_node(store->in(MemNode::Memory), result_mem);
-  _igvn.replace_node(exit, result_ctrl);
+  lazy_replace(exit, result_ctrl);
   _igvn.replace_node(store, result_mem);
   // Any uses the increment outside of the loop become the loop limit.
   _igvn.replace_node(head->incr(), head->limit());
--- a/hotspot/src/share/vm/opto/loopnode.cpp	Mon Feb 15 14:25:21 2016 +0000
+++ b/hotspot/src/share/vm/opto/loopnode.cpp	Wed Jul 05 21:20:03 2017 +0200
@@ -755,8 +755,8 @@
     set_loop(iff2, get_loop(iffalse));
 
     // Lazy update of 'get_ctrl' mechanism.
-    lazy_replace_proj( iffalse, iff2 );
-    lazy_replace_proj( iftrue,  ift2 );
+    lazy_replace(iffalse, iff2);
+    lazy_replace(iftrue,  ift2);
 
     // Swap names
     iffalse = iff2;
--- a/hotspot/src/share/vm/opto/loopnode.hpp	Mon Feb 15 14:25:21 2016 +0000
+++ b/hotspot/src/share/vm/opto/loopnode.hpp	Wed Jul 05 21:20:03 2017 +0200
@@ -693,13 +693,18 @@
   }
 
 private:
-  Node *get_ctrl_no_update( Node *i ) const {
+  Node *get_ctrl_no_update_helper(Node *i) const {
+    assert(has_ctrl(i), "should be control, not loop");
+    return (Node*)(((intptr_t)_nodes[i->_idx]) & ~1);
+  }
+
+  Node *get_ctrl_no_update(Node *i) const {
     assert( has_ctrl(i), "" );
-    Node *n = (Node*)(((intptr_t)_nodes[i->_idx]) & ~1);
+    Node *n = get_ctrl_no_update_helper(i);
     if (!n->in(0)) {
       // Skip dead CFG nodes
       do {
-        n = (Node*)(((intptr_t)_nodes[n->_idx]) & ~1);
+        n = get_ctrl_no_update_helper(n);
       } while (!n->in(0));
       n = find_non_split_ctrl(n);
     }
@@ -721,22 +726,15 @@
   // from old_node to new_node to support the lazy update.  Reference
   // replaces loop reference, since that is not needed for dead node.
 public:
-  void lazy_update( Node *old_node, Node *new_node ) {
-    assert( old_node != new_node, "no cycles please" );
-    //old_node->set_req( 1, new_node /*NO DU INFO*/ );
-    // Nodes always have DU info now, so re-use the side array slot
-    // for this node to provide the forwarding pointer.
-    _nodes.map( old_node->_idx, (Node*)((intptr_t)new_node + 1) );
+  void lazy_update(Node *old_node, Node *new_node) {
+    assert(old_node != new_node, "no cycles please");
+    // Re-use the side array slot for this node to provide the
+    // forwarding pointer.
+    _nodes.map(old_node->_idx, (Node*)((intptr_t)new_node + 1));
   }
-  void lazy_replace( Node *old_node, Node *new_node ) {
-    _igvn.replace_node( old_node, new_node );
-    lazy_update( old_node, new_node );
-  }
-  void lazy_replace_proj( Node *old_node, Node *new_node ) {
-    assert( old_node->req() == 1, "use this for Projs" );
-    _igvn.hash_delete(old_node); // Must hash-delete before hacking edges
-    old_node->add_req( NULL );
-    lazy_replace( old_node, new_node );
+  void lazy_replace(Node *old_node, Node *new_node) {
+    _igvn.replace_node(old_node, new_node);
+    lazy_update(old_node, new_node);
   }
 
 private:
--- a/hotspot/src/share/vm/opto/macro.cpp	Mon Feb 15 14:25:21 2016 +0000
+++ b/hotspot/src/share/vm/opto/macro.cpp	Wed Jul 05 21:20:03 2017 +0200
@@ -2654,9 +2654,9 @@
   eliminate_macro_nodes();
 
   // Make sure expansion will not cause node limit to be exceeded.
-  // Worst case is a macro node gets expanded into about 50 nodes.
+  // Worst case is a macro node gets expanded into about 200 nodes.
   // Allow 50% more for optimization.
-  if (C->check_node_count(C->macro_count() * 75, "out of nodes before macro expansion" ) )
+  if (C->check_node_count(C->macro_count() * 300, "out of nodes before macro expansion" ) )
     return true;
 
   // Eliminate Opaque and LoopLimit nodes. Do it after all loop optimizations.
--- a/hotspot/src/share/vm/opto/split_if.cpp	Mon Feb 15 14:25:21 2016 +0000
+++ b/hotspot/src/share/vm/opto/split_if.cpp	Wed Jul 05 21:20:03 2017 +0200
@@ -472,7 +472,7 @@
 
     // Replace in the graph with lazy-update mechanism
     new_iff->set_req(0, new_iff); // hook self so it does not go dead
-    lazy_replace_proj( ifp, ifpx );
+    lazy_replace(ifp, ifpx);
     new_iff->set_req(0, region);
 
     // Record bits for later xforms
--- a/hotspot/src/share/vm/opto/subnode.cpp	Mon Feb 15 14:25:21 2016 +0000
+++ b/hotspot/src/share/vm/opto/subnode.cpp	Wed Jul 05 21:20:03 2017 +0200
@@ -1334,6 +1334,65 @@
     return new BoolNode( ncmp, _test.negate() );
   }
 
+  // Change ((x & m) u<= m) or ((m & x) u<= m) to always true
+  // Same with ((x & m) u< m+1) and ((m & x) u< m+1)
+  if (cop == Op_CmpU &&
+      cmp1->Opcode() == Op_AndI) {
+    Node* bound = NULL;
+    if (_test._test == BoolTest::le) {
+      bound = cmp2;
+    } else if (_test._test == BoolTest::lt &&
+               cmp2->Opcode() == Op_AddI &&
+               cmp2->in(2)->find_int_con(0) == 1) {
+      bound = cmp2->in(1);
+    }
+    if (cmp1->in(2) == bound || cmp1->in(1) == bound) {
+      return ConINode::make(1);
+    }
+  }
+
+  // Change ((x & (m - 1)) u< m) into (m > 0)
+  // This is the off-by-one variant of the above
+  if (cop == Op_CmpU &&
+      _test._test == BoolTest::lt &&
+      cmp1->Opcode() == Op_AndI) {
+    Node* l = cmp1->in(1);
+    Node* r = cmp1->in(2);
+    for (int repeat = 0; repeat < 2; repeat++) {
+      bool match = r->Opcode() == Op_AddI && r->in(2)->find_int_con(0) == -1 &&
+                   r->in(1) == cmp2;
+      if (match) {
+        // arraylength known to be non-negative, so a (arraylength != 0) is sufficient,
+        // but to be compatible with the array range check pattern, use (arraylength u> 0)
+        Node* ncmp = cmp2->Opcode() == Op_LoadRange
+                     ? phase->transform(new CmpUNode(cmp2, phase->intcon(0)))
+                     : phase->transform(new CmpINode(cmp2, phase->intcon(0)));
+        return new BoolNode(ncmp, BoolTest::gt);
+      } else {
+        // commute and try again
+        l = cmp1->in(2);
+        r = cmp1->in(1);
+      }
+    }
+  }
+
+  // Change (arraylength <= 0) or (arraylength == 0)
+  //   into (arraylength u<= 0)
+  // Also change (arraylength != 0) into (arraylength u> 0)
+  // The latter version matches the code pattern generated for
+  // array range checks, which will more likely be optimized later.
+  if (cop == Op_CmpI &&
+      cmp1->Opcode() == Op_LoadRange &&
+      cmp2->find_int_con(-1) == 0) {
+    if (_test._test == BoolTest::le || _test._test == BoolTest::eq) {
+      Node* ncmp = phase->transform(new CmpUNode(cmp1, cmp2));
+      return new BoolNode(ncmp, BoolTest::le);
+    } else if (_test._test == BoolTest::ne) {
+      Node* ncmp = phase->transform(new CmpUNode(cmp1, cmp2));
+      return new BoolNode(ncmp, BoolTest::gt);
+    }
+  }
+
   // Change "bool eq/ne (cmp (Conv2B X) 0)" into "bool eq/ne (cmp X 0)".
   // This is a standard idiom for branching on a boolean value.
   Node *c2b = cmp1;
@@ -1496,4 +1555,3 @@
   double d = t1->getd();
   return TypeD::make( StubRoutines::intrinsic_log10( d ) );
 }
-
--- a/hotspot/src/share/vm/runtime/commandLineFlagConstraintsCompiler.cpp	Mon Feb 15 14:25:21 2016 +0000
+++ b/hotspot/src/share/vm/runtime/commandLineFlagConstraintsCompiler.cpp	Wed Jul 05 21:20:03 2017 +0200
@@ -118,27 +118,46 @@
 }
 
 Flag::Error AllocatePrefetchStepSizeConstraintFunc(intx value, bool verbose) {
-  if (value < 1 || value > max_jint) {
+  intx max_value = 512;
+  if (value < 1 || value > max_value) {
     CommandLineError::print(verbose,
                             "AllocatePrefetchStepSize (" INTX_FORMAT ") "
                             "must be between 1 and %d\n",
                             AllocatePrefetchStepSize,
-                            max_jint);
+                            max_value);
     return Flag::VIOLATES_CONSTRAINT;
   }
 
   if (AllocatePrefetchDistance % AllocatePrefetchStepSize != 0) {
-     CommandLineError::print(verbose,
-                             "AllocatePrefetchDistance (" INTX_FORMAT ") "
-                             "%% AllocatePrefetchStepSize (" INTX_FORMAT ") "
-                             "= " INTX_FORMAT " "
-                             "must be 0\n",
-                             AllocatePrefetchDistance, AllocatePrefetchStepSize,
-                             AllocatePrefetchDistance % AllocatePrefetchStepSize);
-     return Flag::VIOLATES_CONSTRAINT;
-   }
+    CommandLineError::print(verbose,
+                            "AllocatePrefetchDistance (" INTX_FORMAT ") "
+                            "%% AllocatePrefetchStepSize (" INTX_FORMAT ") "
+                            "= " INTX_FORMAT " "
+                            "must be 0\n",
+                            AllocatePrefetchDistance, AllocatePrefetchStepSize,
+                            AllocatePrefetchDistance % AllocatePrefetchStepSize);
+    return Flag::VIOLATES_CONSTRAINT;
+  }
 
-   return Flag::SUCCESS;
+  /* The limit of 64 for the quotient of AllocatePrefetchDistance and AllocatePrefetchSize
+   * originates from the limit of 64 for AllocatePrefetchLines/AllocateInstancePrefetchLines.
+   * If AllocatePrefetchStyle == 2, the quotient from above is used in PhaseMacroExpand::prefetch_allocation()
+   * to determine the number of lines to prefetch. For other values of AllocatePrefetchStyle,
+   * AllocatePrefetchDistance and AllocatePrefetchSize is used. For consistency, all these
+   * quantities must have the same limit (64 in this case).
+   */
+  if (AllocatePrefetchDistance / AllocatePrefetchStepSize > 64) {
+    CommandLineError::print(verbose,
+                            "AllocatePrefetchDistance (" INTX_FORMAT ") too large or "
+                            "AllocatePrefetchStepSize (" INTX_FORMAT ") too small; "
+                            "try decreasing/increasing values so that "
+                            "AllocatePrefetchDistance / AllocatePrefetchStepSize <= 64\n",
+                            AllocatePrefetchDistance, AllocatePrefetchStepSize,
+                            AllocatePrefetchDistance % AllocatePrefetchStepSize);
+    return Flag::VIOLATES_CONSTRAINT;
+  }
+
+  return Flag::SUCCESS;
 }
 
 Flag::Error CompileThresholdConstraintFunc(intx value, bool verbose) {
--- a/hotspot/src/share/vm/runtime/globals.hpp	Mon Feb 15 14:25:21 2016 +0000
+++ b/hotspot/src/share/vm/runtime/globals.hpp	Wed Jul 05 21:20:03 2017 +0200
@@ -2966,16 +2966,16 @@
                                                                             \
   product(intx,  AllocatePrefetchLines, 3,                                  \
           "Number of lines to prefetch ahead of array allocation pointer")  \
-          range(1, max_jint / 2)                                            \
+          range(1, 64)                                                      \
                                                                             \
   product(intx,  AllocateInstancePrefetchLines, 1,                          \
           "Number of lines to prefetch ahead of instance allocation "       \
           "pointer")                                                        \
-          range(1, max_jint / 2)                                            \
+          range(1, 64)                                                      \
                                                                             \
   product(intx,  AllocatePrefetchStepSize, 16,                              \
           "Step size in bytes of sequential prefetch instructions")         \
-          range(1, max_jint)                                                \
+          range(1, 512)                                                     \
           constraint(AllocatePrefetchStepSizeConstraintFunc,AfterMemoryInit)\
                                                                             \
   product(intx,  AllocatePrefetchInstr, 0,                                  \
--- a/hotspot/test/compiler/compilercontrol/TestCompilerDirectivesCompatibilityBase.java	Mon Feb 15 14:25:21 2016 +0000
+++ b/hotspot/test/compiler/compilercontrol/TestCompilerDirectivesCompatibilityBase.java	Wed Jul 05 21:20:03 2017 +0200
@@ -24,7 +24,7 @@
 /*
  * @test TestCompilerDirectivesCompatibilityBase
  * @bug 8137167
- * @library /testlibrary /../../test/lib
+ * @library /testlibrary /test/lib
  * @modules java.base/sun.misc
  *          java.compiler
  *          java.management
--- a/hotspot/test/compiler/compilercontrol/TestCompilerDirectivesCompatibilityCommandOff.java	Mon Feb 15 14:25:21 2016 +0000
+++ b/hotspot/test/compiler/compilercontrol/TestCompilerDirectivesCompatibilityCommandOff.java	Wed Jul 05 21:20:03 2017 +0200
@@ -24,7 +24,7 @@
 /*
  * @test TestCompilerDirectivesCompatibilityCommandOff
  * @bug 8137167
- * @library /testlibrary /../../test/lib
+ * @library /testlibrary /test/lib
  * @modules java.base/sun.misc
  *          java.compiler
  *          java.management
--- a/hotspot/test/compiler/compilercontrol/TestCompilerDirectivesCompatibilityCommandOn.java	Mon Feb 15 14:25:21 2016 +0000
+++ b/hotspot/test/compiler/compilercontrol/TestCompilerDirectivesCompatibilityCommandOn.java	Wed Jul 05 21:20:03 2017 +0200
@@ -24,7 +24,7 @@
 /*
  * @test TestCompilerDirectivesCompatibilityCommandOn
  * @bug 8137167
- * @library /testlibrary /../../test/lib
+ * @library /testlibrary /test/lib
  * @modules java.base/sun.misc
  *          java.compiler
  *          java.management
--- a/hotspot/test/compiler/compilercontrol/TestCompilerDirectivesCompatibilityFlag.java	Mon Feb 15 14:25:21 2016 +0000
+++ b/hotspot/test/compiler/compilercontrol/TestCompilerDirectivesCompatibilityFlag.java	Wed Jul 05 21:20:03 2017 +0200
@@ -24,7 +24,7 @@
 /*
  * @test TestCompilerDirectivesCompatibilityFlag
  * @bug 8137167
- * @library /testlibrary /../../test/lib
+ * @library /testlibrary /test/lib
  * @modules java.base/sun.misc
  *          java.compiler
  *          java.management
--- a/hotspot/test/compiler/compilercontrol/commandfile/CompileOnlyTest.java	Mon Feb 15 14:25:21 2016 +0000
+++ b/hotspot/test/compiler/compilercontrol/commandfile/CompileOnlyTest.java	Wed Jul 05 21:20:03 2017 +0200
@@ -25,7 +25,7 @@
  * @test
  * @bug 8137167
  * @summary Tests CompileCommand=compileonly
- * @library /testlibrary /../../test/lib /compiler/testlibrary ../share /
+ * @library /testlibrary /test/lib /compiler/testlibrary ../share /
  * @build compiler.compilercontrol.commandfile.CompileOnlyTest
  *        pool.sub.* pool.subpack.* sun.hotspot.WhiteBox
  *        compiler.testlibrary.CompilerUtils compiler.compilercontrol.share.actions.*
--- a/hotspot/test/compiler/compilercontrol/commandfile/ExcludeTest.java	Mon Feb 15 14:25:21 2016 +0000
+++ b/hotspot/test/compiler/compilercontrol/commandfile/ExcludeTest.java	Wed Jul 05 21:20:03 2017 +0200
@@ -25,7 +25,7 @@
  * @test
  * @bug 8137167
  * @summary Tests CompileCommand=exclude
- * @library /testlibrary /../../test/lib /compiler/testlibrary ../share /
+ * @library /testlibrary /test/lib /compiler/testlibrary ../share /
  * @build compiler.compilercontrol.commandfile.ExcludeTest
  *        pool.sub.* pool.subpack.* sun.hotspot.WhiteBox
  *        compiler.testlibrary.CompilerUtils compiler.compilercontrol.share.actions.*
--- a/hotspot/test/compiler/compilercontrol/commandfile/LogTest.java	Mon Feb 15 14:25:21 2016 +0000
+++ b/hotspot/test/compiler/compilercontrol/commandfile/LogTest.java	Wed Jul 05 21:20:03 2017 +0200
@@ -25,7 +25,7 @@
  * @test
  * @bug 8137167
  * @summary Tests CompileCommand=log
- * @library /testlibrary /../../test/lib /compiler/testlibrary ../share /
+ * @library /testlibrary /test/lib /compiler/testlibrary ../share /
  * @build compiler.compilercontrol.commandfile.LogTest
  *        pool.sub.* pool.subpack.* sun.hotspot.WhiteBox
  *        compiler.testlibrary.CompilerUtils compiler.compilercontrol.share.actions.*
--- a/hotspot/test/compiler/compilercontrol/commandfile/PrintTest.java	Mon Feb 15 14:25:21 2016 +0000
+++ b/hotspot/test/compiler/compilercontrol/commandfile/PrintTest.java	Wed Jul 05 21:20:03 2017 +0200
@@ -25,7 +25,7 @@
  * @test
  * @bug 8137167
  * @summary Tests CompileCommand=print
- * @library /testlibrary /../../test/lib /compiler/testlibrary ../share /
+ * @library /testlibrary /test/lib /compiler/testlibrary ../share /
  * @build compiler.compilercontrol.commandfile.PrintTest
  *        pool.sub.* pool.subpack.* sun.hotspot.WhiteBox
  *        compiler.testlibrary.CompilerUtils compiler.compilercontrol.share.actions.*
--- a/hotspot/test/compiler/compilercontrol/commands/CompileOnlyTest.java	Mon Feb 15 14:25:21 2016 +0000
+++ b/hotspot/test/compiler/compilercontrol/commands/CompileOnlyTest.java	Wed Jul 05 21:20:03 2017 +0200
@@ -25,7 +25,7 @@
  * @test
  * @bug 8137167
  * @summary Tests CompileCommand=compileonly
- * @library /testlibrary /../../test/lib /compiler/testlibrary ../share /
+ * @library /testlibrary /test/lib /compiler/testlibrary ../share /
  * @build compiler.compilercontrol.commands.CompileOnlyTest
  *        pool.sub.* pool.subpack.* sun.hotspot.WhiteBox
  *        compiler.testlibrary.CompilerUtils compiler.compilercontrol.share.actions.*
--- a/hotspot/test/compiler/compilercontrol/commands/ExcludeTest.java	Mon Feb 15 14:25:21 2016 +0000
+++ b/hotspot/test/compiler/compilercontrol/commands/ExcludeTest.java	Wed Jul 05 21:20:03 2017 +0200
@@ -25,7 +25,7 @@
  * @test
  * @bug 8137167
  * @summary Tests CompileCommand=exclude
- * @library /testlibrary /../../test/lib /compiler/testlibrary ../share /
+ * @library /testlibrary /test/lib /compiler/testlibrary ../share /
  * @build compiler.compilercontrol.commands.ExcludeTest
  *        pool.sub.* pool.subpack.* sun.hotspot.WhiteBox
  *        compiler.testlibrary.CompilerUtils compiler.compilercontrol.share.actions.*
--- a/hotspot/test/compiler/compilercontrol/commands/LogTest.java	Mon Feb 15 14:25:21 2016 +0000
+++ b/hotspot/test/compiler/compilercontrol/commands/LogTest.java	Wed Jul 05 21:20:03 2017 +0200
@@ -25,7 +25,7 @@
  * @test
  * @bug 8137167
  * @summary Tests CompileCommand=log
- * @library /testlibrary /../../test/lib /compiler/testlibrary ../share /
+ * @library /testlibrary /test/lib /compiler/testlibrary ../share /
  * @build compiler.compilercontrol.commands.LogTest
  *        pool.sub.* pool.subpack.* sun.hotspot.WhiteBox
  *        compiler.testlibrary.CompilerUtils compiler.compilercontrol.share.actions.*
--- a/hotspot/test/compiler/compilercontrol/commands/PrintTest.java	Mon Feb 15 14:25:21 2016 +0000
+++ b/hotspot/test/compiler/compilercontrol/commands/PrintTest.java	Wed Jul 05 21:20:03 2017 +0200
@@ -25,7 +25,7 @@
  * @test
  * @bug 8137167
  * @summary Tests CompileCommand=print
- * @library /testlibrary /../../test/lib /compiler/testlibrary ../share /
+ * @library /testlibrary /test/lib /compiler/testlibrary ../share /
  * @build compiler.compilercontrol.commands.PrintTest
  *        pool.sub.* pool.subpack.* sun.hotspot.WhiteBox
  *        compiler.testlibrary.CompilerUtils compiler.compilercontrol.share.actions.*
--- a/hotspot/test/compiler/compilercontrol/directives/CompileOnlyTest.java	Mon Feb 15 14:25:21 2016 +0000
+++ b/hotspot/test/compiler/compilercontrol/directives/CompileOnlyTest.java	Wed Jul 05 21:20:03 2017 +0200
@@ -25,7 +25,7 @@
  * @test
  * @bug 8137167
  * @summary Tests directives to be able to compile only specified  methods
- * @library /testlibrary /../../test/lib /compiler/testlibrary ../share /
+ * @library /testlibrary /test/lib /compiler/testlibrary ../share /
  * @build compiler.compilercontrol.directives.CompileOnlyTest
  *        pool.sub.* pool.subpack.* sun.hotspot.WhiteBox
  *        compiler.testlibrary.CompilerUtils compiler.compilercontrol.share.actions.*
--- a/hotspot/test/compiler/compilercontrol/directives/ExcludeTest.java	Mon Feb 15 14:25:21 2016 +0000
+++ b/hotspot/test/compiler/compilercontrol/directives/ExcludeTest.java	Wed Jul 05 21:20:03 2017 +0200
@@ -25,7 +25,7 @@
  * @test
  * @bug 8137167
  * @summary Tests directives to be able to exclude methods from compilation
- * @library /testlibrary /../../test/lib /compiler/testlibrary ../share /
+ * @library /testlibrary /test/lib /compiler/testlibrary ../share /
  * @build compiler.compilercontrol.directives.ExcludeTest
  *        pool.sub.* pool.subpack.* sun.hotspot.WhiteBox
  *        compiler.testlibrary.CompilerUtils compiler.compilercontrol.share.actions.*
--- a/hotspot/test/compiler/compilercontrol/directives/LogTest.java	Mon Feb 15 14:25:21 2016 +0000
+++ b/hotspot/test/compiler/compilercontrol/directives/LogTest.java	Wed Jul 05 21:20:03 2017 +0200
@@ -25,7 +25,7 @@
  * @test
  * @bug 8137167
  * @summary Tests directives to be able to turn on LogCompilation
- * @library /testlibrary /../../test/lib /compiler/testlibrary ../share /
+ * @library /testlibrary /test/lib /compiler/testlibrary ../share /
  * @build compiler.compilercontrol.directives.LogTest
  *        pool.sub.* pool.subpack.* sun.hotspot.WhiteBox
  *        compiler.testlibrary.CompilerUtils compiler.compilercontrol.share.actions.*
--- a/hotspot/test/compiler/compilercontrol/directives/PrintTest.java	Mon Feb 15 14:25:21 2016 +0000
+++ b/hotspot/test/compiler/compilercontrol/directives/PrintTest.java	Wed Jul 05 21:20:03 2017 +0200
@@ -25,7 +25,7 @@
  * @test
  * @bug 8137167
  * @summary Tests directives to be able to turn on print_assembly
- * @library /testlibrary /../../test/lib /compiler/testlibrary ../share /
+ * @library /testlibrary /test/lib /compiler/testlibrary ../share /
  * @build compiler.compilercontrol.directives.PrintTest
  *        pool.sub.* pool.subpack.* sun.hotspot.WhiteBox
  *        compiler.testlibrary.CompilerUtils compiler.compilercontrol.share.actions.*
--- a/hotspot/test/compiler/compilercontrol/jcmd/AddAndRemoveTest.java	Mon Feb 15 14:25:21 2016 +0000
+++ b/hotspot/test/compiler/compilercontrol/jcmd/AddAndRemoveTest.java	Wed Jul 05 21:20:03 2017 +0200
@@ -25,7 +25,7 @@
  * @test
  * @bug 8137167
  * @summary Tests directives to be able to add and remove directives
- * @library /testlibrary /../../test/lib /compiler/testlibrary ../share /
+ * @library /testlibrary /test/lib /compiler/testlibrary ../share /
  * @build compiler.compilercontrol.jcmd.AddAndRemoveTest
  *        pool.sub.* pool.subpack.* sun.hotspot.WhiteBox
  *        compiler.testlibrary.CompilerUtils compiler.compilercontrol.share.actions.*
--- a/hotspot/test/compiler/compilercontrol/jcmd/AddCompileOnlyTest.java	Mon Feb 15 14:25:21 2016 +0000
+++ b/hotspot/test/compiler/compilercontrol/jcmd/AddCompileOnlyTest.java	Wed Jul 05 21:20:03 2017 +0200
@@ -25,7 +25,7 @@
  * @test
  * @bug 8137167
  * @summary Tests jcmd to be able to add a directive to compile only specified methods
- * @library /testlibrary /../../test/lib /compiler/testlibrary ../share /
+ * @library /testlibrary /test/lib /compiler/testlibrary ../share /
  * @build compiler.compilercontrol.jcmd.AddCompileOnlyTest
  *        pool.sub.* pool.subpack.* sun.hotspot.WhiteBox
  *        compiler.testlibrary.CompilerUtils compiler.compilercontrol.share.actions.*
--- a/hotspot/test/compiler/compilercontrol/jcmd/AddExcludeTest.java	Mon Feb 15 14:25:21 2016 +0000
+++ b/hotspot/test/compiler/compilercontrol/jcmd/AddExcludeTest.java	Wed Jul 05 21:20:03 2017 +0200
@@ -25,7 +25,7 @@
  * @test
  * @bug 8137167
  * @summary Tests jcmd to be able to add a directive to exclude only specified methods
- * @library /testlibrary /../../test/lib /compiler/testlibrary ../share /
+ * @library /testlibrary /test/lib /compiler/testlibrary ../share /
  * @build compiler.compilercontrol.jcmd.AddExcludeTest
  *        pool.sub.* pool.subpack.* sun.hotspot.WhiteBox
  *        compiler.testlibrary.CompilerUtils compiler.compilercontrol.share.actions.*
--- a/hotspot/test/compiler/compilercontrol/jcmd/AddLogTest.java	Mon Feb 15 14:25:21 2016 +0000
+++ b/hotspot/test/compiler/compilercontrol/jcmd/AddLogTest.java	Wed Jul 05 21:20:03 2017 +0200
@@ -25,7 +25,7 @@
  * @test
  * @bug 8137167
  * @summary Tests jcmd to be able to add a directive to log only specified methods
- * @library /testlibrary /../../test/lib /compiler/testlibrary ../share /
+ * @library /testlibrary /test/lib /compiler/testlibrary ../share /
  * @build compiler.compilercontrol.jcmd.AddLogTest
  *        pool.sub.* pool.subpack.* sun.hotspot.WhiteBox
  *        compiler.testlibrary.CompilerUtils compiler.compilercontrol.share.actions.*
--- a/hotspot/test/compiler/compilercontrol/jcmd/AddPrintAssemblyTest.java	Mon Feb 15 14:25:21 2016 +0000
+++ b/hotspot/test/compiler/compilercontrol/jcmd/AddPrintAssemblyTest.java	Wed Jul 05 21:20:03 2017 +0200
@@ -26,7 +26,7 @@
  * @bug 8137167
  * @summary Tests jcmd to be able to add a directive to print assembly
  *          only for specified methods
- * @library /testlibrary /../../test/lib /compiler/testlibrary ../share /
+ * @library /testlibrary /test/lib /compiler/testlibrary ../share /
  * @build compiler.compilercontrol.jcmd.AddPrintAssemblyTest
  *        pool.sub.* pool.subpack.* sun.hotspot.WhiteBox
  *        compiler.testlibrary.CompilerUtils compiler.compilercontrol.share.actions.*
--- a/hotspot/test/compiler/compilercontrol/mixed/RandomCommandsTest.java	Mon Feb 15 14:25:21 2016 +0000
+++ b/hotspot/test/compiler/compilercontrol/mixed/RandomCommandsTest.java	Wed Jul 05 21:20:03 2017 +0200
@@ -25,7 +25,7 @@
  * @test
  * @bug 8137167
  * @summary Randomly generates commands with random types
- * @library /testlibrary /../../test/lib /compiler/testlibrary ../share /
+ * @library /testlibrary /test/lib /compiler/testlibrary ../share /
  * @build compiler.compilercontrol.mixed.RandomCommandsTest
  *        pool.sub.* pool.subpack.* sun.hotspot.WhiteBox
  *        compiler.testlibrary.CompilerUtils compiler.compilercontrol.share.actions.*
--- a/hotspot/test/compiler/compilercontrol/mixed/RandomValidCommandsTest.java	Mon Feb 15 14:25:21 2016 +0000
+++ b/hotspot/test/compiler/compilercontrol/mixed/RandomValidCommandsTest.java	Wed Jul 05 21:20:03 2017 +0200
@@ -25,7 +25,7 @@
  * @test
  * @bug 8137167
  * @summary Randomly generates valid commands with random types
- * @library /testlibrary /../../test/lib /compiler/testlibrary ../share /
+ * @library /testlibrary /test/lib /compiler/testlibrary ../share /
  * @build compiler.compilercontrol.mixed.RandomValidCommandsTest
  *        pool.sub.* pool.subpack.* sun.hotspot.WhiteBox
  *        compiler.testlibrary.CompilerUtils compiler.compilercontrol.share.actions.*
--- a/hotspot/test/compiler/compilercontrol/share/scenario/Command.java	Mon Feb 15 14:25:21 2016 +0000
+++ b/hotspot/test/compiler/compilercontrol/share/scenario/Command.java	Wed Jul 05 21:20:03 2017 +0200
@@ -32,8 +32,8 @@
 public enum Command {
     COMPILEONLY("compileonly", ".*", "-Xbatch"),
     EXCLUDE("exclude", "", "-Xbatch"),
-    INLINE("inline", ".*"),
-    DONTINLINE("dontinline", ""),
+    INLINE("inline", ".*", "-Xbatch"),
+    DONTINLINE("dontinline", "", "-Xbatch"),
     LOG("log", "", "-XX:+UnlockDiagnosticVMOptions",
             "-XX:+LogCompilation", "-XX:LogFile=" + LogProcessor.LOG_FILE),
     PRINT("print", ""),
--- a/hotspot/test/compiler/cpuflags/TestAESIntrinsicsOnSupportedConfig.java	Mon Feb 15 14:25:21 2016 +0000
+++ b/hotspot/test/compiler/cpuflags/TestAESIntrinsicsOnSupportedConfig.java	Wed Jul 05 21:20:03 2017 +0200
@@ -27,7 +27,7 @@
 
 /*
  * @test
- * @library /testlibrary /../../test/lib /compiler/whitebox
+ * @library /testlibrary /test/lib /compiler/whitebox
  *          /compiler/testlibrary /compiler/codegen/7184394
  * @modules java.base/sun.misc
  *          java.management
--- a/hotspot/test/compiler/cpuflags/TestAESIntrinsicsOnUnsupportedConfig.java	Mon Feb 15 14:25:21 2016 +0000
+++ b/hotspot/test/compiler/cpuflags/TestAESIntrinsicsOnUnsupportedConfig.java	Wed Jul 05 21:20:03 2017 +0200
@@ -28,7 +28,7 @@
 
 /*
  * @test
- * @library /testlibrary /../../test/lib /compiler/whitebox
+ * @library /testlibrary /test/lib /compiler/whitebox
  *          /compiler/testlibrary /compiler/codegen/7184394
  * @modules java.base/sun.misc
  *          java.management
--- a/hotspot/test/compiler/intrinsics/IntrinsicDisabledTest.java	Mon Feb 15 14:25:21 2016 +0000
+++ b/hotspot/test/compiler/intrinsics/IntrinsicDisabledTest.java	Wed Jul 05 21:20:03 2017 +0200
@@ -24,7 +24,7 @@
 /*
  * @test
  * @bug 8138651
- * @library /testlibrary /../../test/lib
+ * @library /testlibrary /test/lib
  * @build IntrinsicDisabledTest
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
--- a/hotspot/test/compiler/intrinsics/montgomerymultiply/MontgomeryMultiplyTest.java	Mon Feb 15 14:25:21 2016 +0000
+++ b/hotspot/test/compiler/intrinsics/montgomerymultiply/MontgomeryMultiplyTest.java	Wed Jul 05 21:20:03 2017 +0200
@@ -42,7 +42,7 @@
  * @test
  * @bug 8130150 8131779 8139907
  * @summary Verify that the Montgomery multiply and square intrinsic works and correctly checks their arguments.
- * @library /testlibrary /../../test/lib
+ * @library /testlibrary /test/lib
  * @library /testlibrary
  * @build MontgomeryMultiplyTest
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
--- a/hotspot/test/compiler/intrinsics/string/TestStringIntrinsics2.java	Mon Feb 15 14:25:21 2016 +0000
+++ b/hotspot/test/compiler/intrinsics/string/TestStringIntrinsics2.java	Wed Jul 05 21:20:03 2017 +0200
@@ -26,7 +26,7 @@
  * @test
  * @bug 8145336
  * @summary PPC64: fix string intrinsics after CompactStrings change
- * @library /testlibrary /../../test/lib
+ * @library /testlibrary /test/lib
  * @build sun.hotspot.WhiteBox
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/test/compiler/loopopts/TestArraysFillDeadControl.java	Wed Jul 05 21:20:03 2017 +0200
@@ -0,0 +1,53 @@
+/*
+ * Copyright (c) 2016, 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
+ * @bug 8147645
+ * @summary Array.fill intrinsification code doesn't mark replaced control as dead
+ * @run main/othervm  -XX:-TieredCompilation -XX:CompileCommand=dontinline,TestArraysFillDeadControl::dont_inline TestArraysFillDeadControl
+ *
+ */
+
+import java.util.Arrays;
+
+public class TestArraysFillDeadControl {
+
+    static void dont_inline() {
+    }
+
+    static int i = 1;
+
+    public static void main(String[] args) {
+        for (int j = 0; j < 200000; j++) {
+            int[] a = new int[2];
+            int b = i;
+
+            Arrays.fill(a, 1);
+            Arrays.fill(a, 1+b);
+
+            dont_inline();
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/test/compiler/rangechecks/PowerOf2SizedArraysChecks.java	Wed Jul 05 21:20:03 2017 +0200
@@ -0,0 +1,161 @@
+/*
+ * 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
+ * @bug 8003585
+ * @summary strength reduce or eliminate range checks for power-of-two sized arrays
+ * @run main/othervm -XX:CompileCommand=compileonly,PowerOf2SizedArraysChecks::test* -XX:-BackgroundCompilation PowerOf2SizedArraysChecks
+ *
+ */
+
+import java.util.function.*;
+
+public class PowerOf2SizedArraysChecks {
+
+    static void check_result(String name, int x, int m, boolean expected, boolean res) {
+        if (expected != res) {
+            throw new RuntimeException("Bad result in " + name + " for x =  " + x + " m = " + m + " expected " + expected  + " got " + res);
+        }
+    }
+
+    static void helper(String name, BiFunction<Integer, int[], Boolean> test, int[] x_values, int[] m_values, boolean[][] expected) {
+        for (int i = 0; i < x_values.length; i++) {
+            int x = x_values[i];
+            for (int j = 0; j < m_values.length; j++) {
+                int m = m_values[j];
+                int[] array = new int[m];
+                boolean res = test.apply(x, array);
+                check_result(name, x, m, expected[i][j], res);
+            }
+        }
+    }
+
+    static void check_result(String name, int m, boolean expected, boolean res) {
+        if (expected != res) {
+            throw new RuntimeException("Bad result in " + name + " for m = " + m + " expected " + expected  + " got " + res);
+        }
+    }
+
+    static void helper2(String name, Function<int[], Boolean> test, int[] m_values, boolean[] expected) {
+        for (int j = 0; j < m_values.length; j++) {
+            int m = m_values[j];
+            int[] array = new int[m];
+            boolean res = test.apply(array);
+            check_result(name, m, expected[j], res);
+        }
+    }
+
+    // ((x & m) u<= m) is always true
+    static boolean test1(int x, int[] array) {
+        int m = array.length;
+        if ((x & m) < 0 || (x & m) > m) {
+            return false;
+        }
+        return true;
+    }
+
+    // ((x & (m - 1)) u< m) iff (m > 0)
+    static boolean test2(int x, int[] array) {
+        int m = array.length;
+        if ((x & (m-1)) < 0 || (x & (m-1)) >= m) {
+            return false;
+        }
+        return true;
+    }
+
+    static boolean test3(int x, int[] array) {
+        try {
+            int v = array[x & (array.length-1)];
+        } catch(ArrayIndexOutOfBoundsException aioobe) {
+            return false;
+        }
+        return true;
+    }
+
+    // arraylength <= 0 to arraylength u<= 0
+    static boolean test4(int[] array) {
+        if (array.length <= 0) {
+            return false;
+        }
+        return true;
+    }
+
+    // arraylength == 0 to arraylength u<= 0
+    static boolean test5(int[] array) {
+        if (array.length == 0) {
+            return false;
+        }
+        return true;
+    }
+
+    // arraylength != 0 to arraylength u> 0
+    static boolean test6(int[] array) {
+        if (array.length != 0) {
+            return false;
+        }
+        return true;
+    }
+
+    static public void main(String[] args) {
+        int[] x_values = {-10, -5, 0, 5, 8, 16, 100};
+        int[] m_values = { 16, 10, 0 };
+
+        boolean[][] test1_expected = new boolean[x_values.length][m_values.length];
+        for (int i = 0; i < x_values.length; i++) {
+            for (int j = 0; j < m_values.length; j++) {
+                test1_expected[i][j] = true;
+            }
+        }
+
+        boolean[][] test2_expected = new boolean[x_values.length][m_values.length];
+        for (int i = 0; i < x_values.length; i++) {
+            for (int j = 0; j < m_values.length; j++) {
+                test2_expected[i][j] = (m_values[j] > 0);
+            }
+        }
+
+        boolean[] test4_expected = new boolean[m_values.length];
+        for (int i = 0; i < m_values.length; i++) {
+            test4_expected[i] = (m_values[i] > 0);
+        }
+        boolean[] test5_expected = new boolean[m_values.length];
+        for (int i = 0; i < m_values.length; i++) {
+            test5_expected[i] = (m_values[i] != 0);
+        }
+        boolean[] test6_expected = new boolean[m_values.length];
+        for (int i = 0; i < m_values.length; i++) {
+            test6_expected[i] = (m_values[i] == 0);
+        }
+
+        for (int i = 0; i < 20000; i++) {
+            helper("test1", PowerOf2SizedArraysChecks::test1, x_values, m_values, test1_expected);
+            helper("test2", PowerOf2SizedArraysChecks::test2, x_values, m_values, test2_expected);
+            helper("test3", PowerOf2SizedArraysChecks::test3, x_values, m_values, test2_expected);
+            helper2("test4", PowerOf2SizedArraysChecks::test4, m_values, test4_expected);
+            helper2("test5", PowerOf2SizedArraysChecks::test5, m_values, test5_expected);
+            helper2("test6", PowerOf2SizedArraysChecks::test6, m_values, test6_expected);
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/test/compiler/runtime/safepoints/TestRegisterRestoring.java	Wed Jul 05 21:20:03 2017 +0200
@@ -0,0 +1,62 @@
+/*
+ * Copyright (c) 2016, 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
+ * @bug 8148490
+ * @summary Test correct saving and restoring of vector registers at safepoints.
+ * @run main/othervm -Xbatch -XX:-TieredCompilation -XX:CompileCommand=exclude,TestRegisterRestoring::main -XX:+SafepointALot TestRegisterRestoring
+ */
+public class TestRegisterRestoring {
+  public static void main(String args[]) throws Exception {
+    // Initialize
+    float[] array = new float[100];
+    for (int i = 0; i < array.length; ++i) {
+      array[i] = 0;
+    }
+    // Test
+    for (int j = 0; j < 20_000; ++j) {
+      increment(array);
+      // Check result
+      for (int i = 0; i < array.length; i++) {
+        if (array[i] != 10_000) {
+          throw new RuntimeException("Test failed: array[" + i + "] = " + array[i] + " but should be 10.000");
+        }
+        array[i] = 0;
+      }
+    }
+  }
+
+  static void increment(float[] array) {
+    // Loop with safepoint
+    for (long l = 0; l < 10_000; l++) {
+      // Vectorized loop
+      for (int i = 0; i < array.length; ++i) {
+        array[i] += 1;
+      }
+    }
+  }
+}
+
--- a/hotspot/test/compiler/stable/TestStableMemoryBarrier.java	Mon Feb 15 14:25:21 2016 +0000
+++ b/hotspot/test/compiler/stable/TestStableMemoryBarrier.java	Wed Jul 05 21:20:03 2017 +0200
@@ -27,7 +27,7 @@
  * @test TestStableMemoryBarrier
  * @bug 8139758
  * @summary tests memory barrier correctly inserted for stable fields
- * @library /testlibrary /../../test/lib
+ * @library /testlibrary /test/lib
  *
  * @run main/bootclasspath -Xcomp -XX:CompileOnly=::testCompile
  *                   java.lang.invoke.TestStableMemoryBarrier
--- a/hotspot/test/compiler/types/TestMeetIncompatibleInterfaceArrays.java	Mon Feb 15 14:25:21 2016 +0000
+++ b/hotspot/test/compiler/types/TestMeetIncompatibleInterfaceArrays.java	Wed Jul 05 21:20:03 2017 +0200
@@ -27,7 +27,7 @@
  * @summary C2 can not handle returns with inccompatible interface arrays
  * @modules java.base/jdk.internal.org.objectweb.asm
  *          java.base/sun.misc
- * @library /testlibrary /../../test/lib
+ * @library /testlibrary /test/lib
  * @build sun.hotspot.WhiteBox
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
--- a/hotspot/test/compiler/whitebox/AllocationCodeBlobTest.java	Mon Feb 15 14:25:21 2016 +0000
+++ b/hotspot/test/compiler/whitebox/AllocationCodeBlobTest.java	Wed Jul 05 21:20:03 2017 +0200
@@ -92,33 +92,36 @@
 
     private void test() {
         System.out.printf("type %s%n", type);
+
+        // Measure the code cache usage after allocate/free.
         long start = getUsage();
-        long addr = WHITE_BOX.allocateCodeBlob(SIZE, type.id);
-        Asserts.assertNE(0, addr, "allocation failed");
+        long addr1 = WHITE_BOX.allocateCodeBlob(SIZE, type.id);
+        long firstAllocation = getUsage();
+        WHITE_BOX.freeCodeBlob(addr1);
+        long firstFree = getUsage();
+        long addr2 = WHITE_BOX.allocateCodeBlob(SIZE, type.id);
+        long secondAllocation = getUsage();
+        WHITE_BOX.freeCodeBlob(addr2);
 
-        long firstAllocation = getUsage();
+        // The following code may trigger resolving of invokedynamic
+        // instructions and therefore method handle intrinsic creation
+        // in the code cache. Make sure this is executed after measuring
+        // the code cache usage.
+        Asserts.assertNE(0, addr1, "first allocation failed");
+        Asserts.assertNE(0, addr2, "second allocation failed");
         Asserts.assertLTE(start + SIZE, firstAllocation,
                 "allocation should increase memory usage: "
                 + start + " + " + SIZE + " <= " + firstAllocation);
-
-        WHITE_BOX.freeCodeBlob(addr);
-        long firstFree = getUsage();
         Asserts.assertLTE(firstFree, firstAllocation,
                 "free shouldn't increase memory usage: "
                 + firstFree + " <= " + firstAllocation);
-
-        addr = WHITE_BOX.allocateCodeBlob(SIZE, type.id);
-        Asserts.assertNE(0, addr, "allocation failed");
-
-        long secondAllocation = getUsage();
         Asserts.assertEQ(firstAllocation, secondAllocation);
 
-        WHITE_BOX.freeCodeBlob(addr);
         System.out.println("allocating till possible...");
         ArrayList<Long> blobs = new ArrayList<>();
         int size = (int) (CODE_CACHE_SIZE >> 7);
-        while ((addr = WHITE_BOX.allocateCodeBlob(size, type.id)) != 0) {
-            blobs.add(addr);
+        while ((addr1 = WHITE_BOX.allocateCodeBlob(size, type.id)) != 0) {
+            blobs.add(addr1);
         }
         for (Long blob : blobs) {
             WHITE_BOX.freeCodeBlob(blob);
--- a/hotspot/test/gc/g1/TestPLABOutput.java	Mon Feb 15 14:25:21 2016 +0000
+++ b/hotspot/test/gc/g1/TestPLABOutput.java	Wed Jul 05 21:20:03 2017 +0200
@@ -27,7 +27,7 @@
  * @summary Check that G1 does not report empty PLAB statistics in the first evacuation.
  * @requires vm.gc=="G1" | vm.gc=="null"
  * @key gc
- * @library /testlibrary /../../test/lib
+ * @library /testlibrary /test/lib
  * @build sun.hotspot.WhiteBox
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  * @run driver TestPLABOutput
--- a/hotspot/test/testlibrary_tests/whitebox/vm_flags/IntxTest.java	Mon Feb 15 14:25:21 2016 +0000
+++ b/hotspot/test/testlibrary_tests/whitebox/vm_flags/IntxTest.java	Wed Jul 05 21:20:03 2017 +0200
@@ -24,6 +24,7 @@
 /*
  * @test IntxTest
  * @bug 8028756
+ * @ignore 8148758
  * @library /testlibrary /test/lib
  * @modules java.management/sun.management
  * @build IntxTest
--- a/make/Init.gmk	Mon Feb 15 14:25:21 2016 +0000
+++ b/make/Init.gmk	Wed Jul 05 21:20:03 2017 +0200
@@ -319,6 +319,7 @@
 	$(call PrepareCompareBuild)
 
     post-compare-build:
+	$(call WaitForSmartJavacFinish)
 	$(call CleanupCompareBuild)
 	$(call CompareBuildDoComparison)
 
--- a/make/InitSupport.gmk	Mon Feb 15 14:25:21 2016 +0000
+++ b/make/InitSupport.gmk	Wed Jul 05 21:20:03 2017 +0200
@@ -353,14 +353,17 @@
   # Parse COMPARE_BUILD into COMPARE_BUILD_*
   # Syntax: COMPARE_BUILD=CONF=<configure options>:PATCH=<patch file>:
   #         MAKE=<make targets>:COMP_OPTS=<compare script options>:
-  #         COMP_DIR=<compare script base dir>|<default>
+  #         COMP_DIR=<compare script base dir>|<default>:
+  #         FAIL=<bool>
   # If neither CONF or PATCH is given, assume <default> means CONF if it
   # begins with "--", otherwise assume it means PATCH.
   # MAKE and COMP_OPTS can only be used with CONF and/or PATCH specified.
   # If any value contains "+", it will be replaced by space.
+  # FAIL can be set to false to have the return value of compare be ignored.
   define ParseCompareBuild
     ifneq ($$(COMPARE_BUILD), )
       COMPARE_BUILD_OUTPUT_ROOT := $(TOPDIR)/build/compare-build/$(CONF_NAME)
+      COMPARE_BUILD_FAIL := true
 
       ifneq ($$(findstring :, $$(COMPARE_BUILD)), )
         $$(foreach part, $$(subst :, , $$(COMPARE_BUILD)), \
@@ -379,6 +382,9 @@
           $$(if $$(filter COMP_DIR=%, $$(part)), \
             $$(eval COMPARE_BUILD_COMP_DIR=$$(strip $$(subst +, , $$(patsubst COMP_DIR=%, %, $$(part))))) \
           ) \
+          $$(if $$(filter FAIL=%, $$(part)), \
+            $$(eval COMPARE_BUILD_FAIL=$$(strip $$(subst +, , $$(patsubst FAIL=%, %, $$(part))))) \
+          ) \
         )
       else
         # Separate handling for single field case, to allow for spaces in values.
@@ -402,6 +408,9 @@
           $$(error Patch file $$(COMPARE_BUILD_PATCH) does not exist)
         endif
       endif
+      ifneq ($$(COMPARE_BUILD_FAIL), true)
+        COMPARE_BUILD_IGNORE_RESULT := || true
+      endif
     endif
   endef
 
@@ -443,9 +452,10 @@
 	$(ECHO) "Comparing between comparison rebuild (this/new) and baseline (other/old)"
 	$(if $(COMPARE_BUILD_COMP_DIR), \
 	  +(cd $(COMPARE_BUILD_OUTPUT_ROOT) && ./compare.sh $(COMPARE_BUILD_COMP_OPTS) \
-	      -2dirs $(COMPARE_BUILD_OUTPUT_ROOT)/$(COMPARE_BUILD_COMP_DIR) $(OUTPUT_ROOT)/$(COMPARE_BUILD_COMP_DIR) || true), \
+	      -2dirs $(COMPARE_BUILD_OUTPUT_ROOT)/$(COMPARE_BUILD_COMP_DIR) \
+	      $(OUTPUT_ROOT)/$(COMPARE_BUILD_COMP_DIR) $(COMPARE_BUILD_IGNORE_RESULT)), \
 	  +(cd $(COMPARE_BUILD_OUTPUT_ROOT) && ./compare.sh $(COMPARE_BUILD_COMP_OPTS) \
-	      -o $(OUTPUT_ROOT) || true) \
+	      -o $(OUTPUT_ROOT) $(COMPARE_BUILD_IGNORE_RESULT)) \
 	)
   endef
 
--- a/make/Main.gmk	Mon Feb 15 14:25:21 2016 +0000
+++ b/make/Main.gmk	Wed Jul 05 21:20:03 2017 +0200
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2011, 2016, 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
@@ -431,7 +431,7 @@
 
   # The annotation processing for jdk.vm.ci needs java.base classes from the
   # current JDK.
-  jdk.vm.ci-gensrc-hotspot: java.base-java 
+  jdk.vm.ci-gensrc-hotspot: java.base-java
 
   # Explicitly add dependencies for special targets
   java.base-java: unpack-sec
--- a/make/StripBinaries.gmk	Mon Feb 15 14:25:21 2016 +0000
+++ b/make/StripBinaries.gmk	Wed Jul 05 21:20:03 2017 +0200
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -57,8 +57,12 @@
 NO_STRIP_CMDS_FILTER += %.cgi
 
 # Don't include debug info for executables.
+
+# OS X stores symbol information in a .dylib file inside a .dSYM directory -
+# that file should not be stripped, so we prune the tree at the .dSYM directory.
 ALL_CMDS_SRC := $(filter-out %.bc %.debuginfo %.diz %.map %.pdb, \
-    $(shell $(FIND) $(SUPPORT_OUTPUTDIR)/modules_cmds -type f -o -type l))
+    $(shell $(FIND) $(SUPPORT_OUTPUTDIR)/modules_cmds \( -type f -o -type l \) \
+    -print -o -name "*.dSYM" -prune))
 COPY_CMDS_SRC := $(filter $(NO_STRIP_CMDS_FILTER), $(ALL_CMDS_SRC))
 STRIP_CMDS_SRC := $(filter-out $(NO_STRIP_CMDS_FILTER), $(ALL_CMDS_SRC))
 
--- a/make/common/NativeCompilation.gmk	Mon Feb 15 14:25:21 2016 +0000
+++ b/make/common/NativeCompilation.gmk	Wed Jul 05 21:20:03 2017 +0200
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2011, 2016, 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
@@ -187,25 +187,30 @@
   # param 6 = the c++ flags to the compiler
   # param 7 = the c++ compiler
   # param 8 = the flags to the assembler
+  # param 9 = set to disable THIS_FILE
+
+  ifeq ($9, )
+    $1_$2_THIS_FILE = -DTHIS_FILE='"$$(<F)"'
+  endif
 
   ifneq (,$$(filter %.c,$2))
     # Compile as a C file
-    $1_$2_FLAGS=$(CFLAGS_CCACHE) $4 $$($1_$(notdir $2)_CFLAGS) -DTHIS_FILE='"$$(<F)"' -c
+    $1_$2_FLAGS=$(CFLAGS_CCACHE) $4 $$($1_$(notdir $2)_CFLAGS) $$($1_$2_THIS_FILE) -c
     $1_$2_COMP=$5
     $1_$2_DEP_FLAG:=$(C_FLAG_DEPS)
   else ifneq (,$$(filter %.m,$2))
     # Compile as an Objective-C file
-    $1_$2_FLAGS=-x objective-c $(CFLAGS_CCACHE) $4 $$($1_$(notdir $2)_CFLAGS) -DTHIS_FILE='"$$(<F)"' -c
+    $1_$2_FLAGS=-x objective-c $(CFLAGS_CCACHE) $4 $$($1_$(notdir $2)_CFLAGS) $$($1_$2_THIS_FILE) -c
     $1_$2_COMP=$5
     $1_$2_DEP_FLAG:=$(C_FLAG_DEPS)
   else ifneq (,$$(filter %.s %.S,$2))
     # Compile as assembler file
-    $1_$2_FLAGS=$8 -DTHIS_FILE='"$$(<F)"'
+    $1_$2_FLAGS=$8
     $1_$2_COMP=$(AS)
     $1_$2_DEP_FLAG:=
   else ifneq (,$$(filter %.cpp,$2)$$(filter %.cc,$2)$$(filter %.mm,$2))
     # Compile as a C++ or Objective-C++ file
-    $1_$2_FLAGS=$(CFLAGS_CCACHE) $6 $$($1_$(notdir $2)_CXXFLAGS) -DTHIS_FILE='"$$(<F)"' -c
+    $1_$2_FLAGS=$(CFLAGS_CCACHE) $6 $$($1_$(notdir $2)_CXXFLAGS) $$($1_$2_THIS_FILE) -c
     $1_$2_COMP=$7
     $1_$2_DEP_FLAG:=$(CXX_FLAG_DEPS)
   else
@@ -304,8 +309,11 @@
 #   EXTRA_OBJECT_FILES List of extra object files to include when linking
 #   VERSIONINFO_RESOURCE Input file for RC. Setting this implies that RC will be run
 #   RC_FLAGS flags for RC.
+#   EMBED_MANIFEST if true, embed manifest on Windows.
 #   MAPFILE mapfile
 #   REORDER reorder file
+#   USE_MAPFILE_FOR_SYMBOLS if true and this is a STATIC_BUILD, just copy the
+#       mapfile for the output symbols file
 #   CC the compiler to use, default is $(CC)
 #   LD the linker to use, default is $(LD)
 #   OPTIMIZATION sets optimization level to NONE, LOW, HIGH, HIGHEST
@@ -643,8 +651,9 @@
 
       $$($1_RES): $$($1_VERSIONINFO_RESOURCE) $$($1_RES_VARDEPS_FILE)
 		$$(call LogInfo, Compiling resource $$(notdir $$($1_VERSIONINFO_RESOURCE)) (for $$(notdir $$($1_TARGET))))
-		$$($1_RC) $$($1_RC_FLAGS) $$($1_SYSROOT_CFLAGS) $(CC_OUT_OPTION)$$@ \
-		    $$($1_VERSIONINFO_RESOURCE)
+		$$(call ExecuteWithLog, $$@, \
+		    $$($1_RC) $$($1_RC_FLAGS) $$($1_SYSROOT_CFLAGS) $(CC_OUT_OPTION)$$@ \
+		    $$($1_VERSIONINFO_RESOURCE))
                 # Windows RC compiler does not support -showIncludes, so we mis-use CL for this.
 		$$($1_CC) $$($1_RC_FLAGS) $$($1_SYSROOT_CFLAGS) -showIncludes -nologo -TC \
 		    $(CC_OUT_OPTION)$$($1_RES_DEP).obj $$($1_VERSIONINFO_RESOURCE) > $$($1_RES_DEP).raw 2>&1 || true ; \
@@ -654,12 +663,11 @@
     endif
   endif
 
-  # mapfile doesnt seem to be implemented on macosx (yet??)
-  ifneq ($(OPENJDK_TARGET_OS),macosx)
+  ifneq ($(DISABLE_MAPFILES),true)
+    $1_REAL_MAPFILE := $$($1_MAPFILE)
     ifneq ($(OPENJDK_TARGET_OS),windows)
-      $1_REAL_MAPFILE:=$$($1_MAPFILE)
       ifneq (,$$($1_REORDER))
-        $1_REAL_MAPFILE:=$$($1_OBJECT_DIR)/mapfile
+        $1_REAL_MAPFILE := $$($1_OBJECT_DIR)/mapfile
 
         $$($1_REAL_MAPFILE) : $$($1_MAPFILE) $$($1_REORDER)
 		$$(MKDIR) -p $$(@D)
@@ -689,7 +697,8 @@
           # The dependency on TARGET is needed on windows for debuginfo files
           # to be rebuilt properly.
           $$($1_OUTPUT_DIR)/% : $$($1_OBJECT_DIR)/% $$($1_TARGET)
-		$(CP) $$< $$@
+                # Use cp -r since on macosx, the dSYM is a directory
+		$(CP) -r $$< $$@
         endif
 
         # Generate debuginfo files.
@@ -815,13 +824,23 @@
         $$($1_OBJECT_DIR)/$$($1_NOSUFFIX).vardeps)
 
     # Generating a static library, ie object file archive.
-    $$($1_TARGET): $$($1_ALL_OBJS) $$($1_RES) $$($1_VARDEPS_FILE)
+    ifeq ($(STATIC_BUILD), true)
+      ifeq ($$($1_USE_MAPFILE_FOR_SYMBOLS), true)
+        STATIC_MAPFILE_DEP := $$($1_MAPFILE)
+      endif
+    endif
+
+    $$($1_TARGET): $$($1_ALL_OBJS) $$($1_RES) $$($1_VARDEPS_FILE) $$(STATIC_MAPFILE_DEP)
 	$$(call LogInfo, Archiving $$($1_STATIC_LIBRARY))
 	$$(call ExecuteWithLog, $$($1_OBJECT_DIR)/$$($1_SAFE_NAME)_link, \
 	    $$($1_AR) $$($1_ARFLAGS) $(AR_OUT_OPTION)$$($1_TARGET) $$($1_ALL_OBJS) \
 	        $$($1_RES))
         ifeq ($(STATIC_BUILD), true)
-	  $(GetSymbols)
+          ifeq ($$($1_USE_MAPFILE_FOR_SYMBOLS), true)
+	    $(CP) $$($1_MAPFILE) $$(@D)/$$(basename $$(@F)).symbols
+          else
+	    $(GetSymbols)
+          endif
         endif
   endif
 
@@ -836,6 +855,12 @@
     $1_VARDEPS_FILE := $$(call DependOnVariable, $1_VARDEPS, \
         $$($1_OBJECT_DIR)/$$($1_NOSUFFIX).vardeps)
 
+    ifeq ($(OPENJDK_TARGET_OS), windows)
+      ifeq ($$($1_EMBED_MANIFEST), true)
+        $1_EXTRA_LDFLAGS += -manifest:embed
+      endif
+    endif
+
     $$($1_TARGET): $$($1_ALL_OBJS) $$($1_RES) $$($1_MANIFEST) \
         $$($1_VARDEPS_FILE)
 		$$(call LogInfo, Linking executable $$($1_BASENAME))
--- a/make/jprt.properties	Mon Feb 15 14:25:21 2016 +0000
+++ b/make/jprt.properties	Wed Jul 05 21:20:03 2017 +0200
@@ -42,13 +42,63 @@
 
 # Use configure when building
 jprt.build.use.configure=true
+jprt.build.use.jib=true
+jprt.test.use.jib=true
+jprt.jib.launcher=common/bin/jib.sh
 
-# Disable the need for preinstalled Xcode
+# Clear out all the build needs as JIB handles this
+jprt.jdk9.build.needs=
+jprt.macosx.jdk9.build.needs=
+jprt.windows_i586.jdk9.build.needs=
+jprt.windows_x64.jdk9.build.needs=
+jprt.solaris.jdk9.build.needs=
+jprt.linux_i586.jdk9.build.needs=
+jprt.linux_x64.jdk9.build.needs=
+jprt.linux_armv6.jdk9.build.needs=
+jprt.linux_armvh.jdk9.build.needs=
+jprt.linux_arm64.jdk9.build.needs=
+jprt.linux_armsflt.jdk9.build.needs=
+jprt.linux_armvfpsflt.jdk9.build.needs=
+jprt.linux_armvfphflt.jdk9.build.needs=
+jprt.linux_armv6vfphflt.jdk9.build.needs=
+jprt.solaris.client.build.needs=
+jprt.linux.client.build.needs=
+jprt.solaris.jdk9.compiler=
+jprt.linux.jdk9.compiler=
+jprt.jdk9.test.needs=
+
+# Disable the need for preinstalled Visual Studio and Xcode
+jprt.windows.jdk9.compiler=
+jprt.windows.6.2.jdk9.compiler=
+jprt.windows.6.3.jdk9.compiler=
+jprt.windows.jdk9.target.attribute.compilerVS2013.appliesTo.builds=none
 jprt.macosx.jdk9.target.attribute.compilerXcode511.appliesTo.builds=none
 
 # Set up the run flavors (jvm variants)
 jprt.run.flavors=c1,c2,default,${my.additional.run.flavors}
 
+# Setup jib profiles
+jprt.linux_i586.product.build.jib.profile=linux-x86
+jprt.linux_x64.build.jib.profile=linux-x64
+jprt.macosx_x64.build.jib.profile=macosx-x64
+jprt.solaris_sparcv9.build.jib.profile=solaris-sparcv9
+jprt.solaris_x64.build.jib.profile=solaris-x64
+jprt.windows_i586.build.jib.profile=windows-x86
+jprt.windows_x64.build.jib.profile=windows-x64
+
+jprt.linux_i586.fastdebug.build.jib.profile=linux-x86-debug
+jprt.linux_x64.fastdebug.build.jib.profile=linux-x64-debug
+jprt.macosx_x64.fastdebug.build.jib.profile=macosx-x64-debug
+jprt.solaris_sparcv9.fastdebug.build.jib.profile=solaris-sparcv9-debug
+jprt.solaris_x64.fastdebug.build.jib.profile=solaris-x64-debug
+jprt.windows_i586.fastdebug.build.jib.profile=windows-x86-debug
+jprt.windows_x64.fastdebug.build.jib.profile=windows-x64-debug
+
+jprt.solaris_x64.debugOpen.build.jib.profile=solaris-x64-open-debug
+jprt.linux_x64.productOpen.build.jib.profile=linux-x64-open
+
+jprt.test.jib.profile=run-test
+
 # Set make target to use for different build flavors
 jprt.build.flavor.debugOpen.target=jprt_bundle
 jprt.build.flavor.fastdebug.target=jprt_bundle
@@ -58,14 +108,14 @@
 jprt.build.flavor.optimizedOpen.target=jprt_bundle
 
 # Use these configure args to define debug level
-jprt.debug.build.configure.args=--with-debug-level=slowdebug
-jprt.fastdebug.build.configure.args=--with-debug-level=fastdebug --disable-precompiled-headers
-jprt.product.build.configure.args=--with-debug-level=release
+jprt.debug.build.configure.args=
+jprt.fastdebug.build.configure.args=--disable-precompiled-headers
+jprt.product.build.configure.args=
 jprt.optimized.build.configure.args=--with-debug-level=optimized
-jprt.debugOpen.build.configure.args=${jprt.debug.build.configure.args} --enable-openjdk-only
-jprt.fastdebugOpen.build.configure.args=${jprt.fastdebug.build.configure.args} --enable-openjdk-only
-jprt.productOpen.build.configure.args=${jprt.product.build.configure.args} --enable-openjdk-only
-jprt.optimizedOpen.build.configure.args=${jprt.product.build.configure.args} --enable-openjdk-only
+jprt.debugOpen.build.configure.args=${jprt.debug.build.configure.args}
+jprt.fastdebugOpen.build.configure.args=${jprt.fastdebug.build.configure.args}
+jprt.productOpen.build.configure.args=${jprt.product.build.configure.args}
+jprt.optimizedOpen.build.configure.args=${jprt.product.build.configure.args}
 
 
 # hotspot testset has custom build flavors and build targets
@@ -100,54 +150,11 @@
 # Also allows for additional, testset specific configure arguments to be set
 jprt.build.configure.args=						\
     --with-output-sync=recurse						\
-    --with-boot-jdk=$ALT_BOOTDIR					\
     --with-jobs=$ALT_PARALLEL_COMPILE_JOBS				\
-    --with-version-opt=$JPRT_JOB_ID					\
-    MAKE=$JPRT_MAKE                                                     \
+    --with-version-opt=$JPRT_JOB_ID				 	\
     ${my.additional.build.configure.args.${jprt.test.set}}		\
     ${my.custom.build.configure.args}
 
-# i586 is often cross-compiled from 64-bit machines, so need to set target bits explicitly
-jprt.i586.build.configure.args=						\
-    --with-target-bits=32
-
-# i586 platforms have both client and server, but to allow for overriding the exact configuration
-# on a per-build flavor basis the value is set for the individual build flavors
-my.i586.default.build.configure.args=					\
-    --with-jvm-variants=client,server
-jprt.i586.debug.build.configure.args=					\
-    ${my.i586.default.build.configure.args}				\
-    ${jprt.debug.build.configure.args}
-jprt.i586.fastdebug.build.configure.args=				\
-    ${my.i586.default.build.configure.args}				\
-    ${jprt.fastdebug.build.configure.args}
-jprt.i586.product.build.configure.args=					\
-    ${my.i586.default.build.configure.args}				\
-    ${jprt.product.build.configure.args}
-jprt.i586.debugOpen.build.configure.args=				\
-    ${my.i586.default.build.configure.args}				\
-    ${jprt.debugOpen.build.configure.args}
-jprt.i586.fastdebugOpen.build.configure.args=				\
-    ${my.i586.default.build.configure.args}				\
-    ${jprt.fastdebugOpen.build.configure.args}
-jprt.i586.productOpen.build.configure.args=				\
-    ${my.i586.default.build.configure.args}				\
-    ${jprt.productOpen.build.configure.args}
-jprt.linux_i586.build.configure.args=					\
-    --with-devkit=$GCC492_OEL64_HOME					\
-    ${jprt.i586.build.configure.args}
-jprt.linux_x64.build.configure.args=					\
-    --with-devkit=$GCC492_OEL64_HOME
-jprt.macosx_x64.build.configure.args=					\
-    --with-devkit=$XCODE63_MACOSX109_HOME
-jprt.solaris.build.configure.args=					\
-    --with-devkit=$SS124_11u1_HOME
-jprt.windows_i586.build.configure.args=					\
-    --with-devkit=$VS2013SP4_HOME					\
-    ${jprt.i586.build.configure.args}
-jprt.windows_x64.build.configure.args=					\
-    --with-devkit=$VS2013SP4_HOME
-
 ########
 #
 # Build targets and options (default/jdk)
--- a/modules.xml	Mon Feb 15 14:25:21 2016 +0000
+++ b/modules.xml	Wed Jul 05 21:20:03 2017 +0200
@@ -297,7 +297,6 @@
       <to>java.security.jgss</to>
       <to>java.security.sasl</to>
       <to>java.xml</to>
-      <to>java.xml.ws</to>
       <to>jdk.charsets</to>
       <to>jdk.crypto.pkcs11</to>
       <to>jdk.deploy.osx</to>
--- a/test/Makefile	Mon Feb 15 14:25:21 2016 +0000
+++ b/test/Makefile	Wed Jul 05 21:20:03 2017 +0200
@@ -40,8 +40,7 @@
 define SUBDIR_TEST # subdirectory target
 if [ -d $1 ] ; then \
   if [ -r $1/test/Makefile ] ; then \
-    echo "$(MAKE) -k -C $1/test $2" ; \
-    $(MAKE) -k -C $1/test $2 ; \
+    $(MAKE) --no-print-directory -k -C $1/test $2 ; \
   else \
     echo "ERROR: File does not exist: $1/test/Makefile"; \
     exit 1; \