changeset 2159:5d2c504ff630

Merge
author jmasa
date Fri, 10 Jun 2016 15:03:10 -0700
parents 114b709abea1 372de3fbcf88
children f66462e24f71
files test/lib/sun/hotspot/WhiteBox.java
diffstat 35 files changed, 1644 insertions(+), 252 deletions(-) [+]
line wrap: on
line diff
--- a/.hgtags	Fri Jun 10 11:40:02 2016 -0700
+++ b/.hgtags	Fri Jun 10 15:03:10 2016 -0700
@@ -361,3 +361,5 @@
 6743a8e0cab7b5f6f4a0575f6664892f0ab740af jdk-9+116
 e882bcdbdac436523f3d5681611d3118a3804ea7 jdk-9+117
 047f95de8f918d8ff5e8cd2636a2abb5c3c8adb8 jdk-9+118
+3463a3f14f0f0e8a68f29ac6405454f2fa2f598a jdk-9+119
+647e0142a5a52749db572b5e6638d561def6479e jdk-9+120
--- a/LICENSE	Fri Jun 10 11:40:02 2016 -0700
+++ b/LICENSE	Fri Jun 10 15:03:10 2016 -0700
@@ -3,7 +3,7 @@
 Version 2, June 1991
 
 Copyright (C) 1989, 1991 Free Software Foundation, Inc.
-59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
 
 Everyone is permitted to copy and distribute verbatim copies of this license
 document, but changing it is not allowed.
@@ -287,8 +287,8 @@
     more details.
 
     You should have received a copy of the GNU General Public License along
-    with this program; if not, write to the Free Software Foundation, Inc., 59
-    Temple Place, Suite 330, Boston, MA 02111-1307 USA
+    with this program; if not, write to the Free Software Foundation, Inc.,
+    51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 
 Also add information on how to contact you by electronic and paper mail.
 
--- a/common/autoconf/basics.m4	Fri Jun 10 11:40:02 2016 -0700
+++ b/common/autoconf/basics.m4	Fri Jun 10 15:03:10 2016 -0700
@@ -484,6 +484,8 @@
   BASIC_REQUIRE_PROGS(FILE, file)
   BASIC_REQUIRE_PROGS(FIND, find)
   BASIC_REQUIRE_PROGS(HEAD, head)
+  BASIC_REQUIRE_PROGS(GUNZIP, gunzip)
+  BASIC_REQUIRE_PROGS(GZIP, pigz gzip)
   BASIC_REQUIRE_PROGS(LN, ln)
   BASIC_REQUIRE_PROGS(LS, ls)
   BASIC_REQUIRE_PROGS(MKDIR, mkdir)
@@ -496,7 +498,7 @@
   BASIC_REQUIRE_PROGS(SH, sh)
   BASIC_REQUIRE_PROGS(SORT, sort)
   BASIC_REQUIRE_PROGS(TAIL, tail)
-  BASIC_REQUIRE_PROGS(TAR, tar)
+  BASIC_REQUIRE_PROGS(TAR, gtar tar)
   BASIC_REQUIRE_PROGS(TEE, tee)
   BASIC_REQUIRE_PROGS(TOUCH, touch)
   BASIC_REQUIRE_PROGS(TR, tr)
@@ -1007,11 +1009,36 @@
   AC_SUBST(FIND_DELETE)
 ])
 
+AC_DEFUN([BASIC_CHECK_TAR],
+[
+  # Test which kind of tar was found
+  if test "x$($TAR --version | $GREP "GNU tar")" != "x"; then
+    TAR_TYPE="gnu"
+  elif test "x$($TAR -v | $GREP "bsdtar")" != "x"; then
+    TAR_TYPE="bsd"
+  elif test "x$OPENJDK_BUILD_OS" = "xsolaris"; then
+    TAR_TYPE="solaris"
+  fi
+  AC_MSG_CHECKING([what type of tar was found])
+  AC_MSG_RESULT([$TAR_TYPE])
+
+  if test "x$TAR_TYPE" = "xgnu"; then
+    TAR_INCLUDE_PARAM="T"
+    TAR_SUPPORTS_TRANSFORM="true"
+  else
+    TAR_INCLUDE_PARAM="I"
+    TAR_SUPPORTS_TRANSFORM="false"
+  fi
+  AC_SUBST(TAR_INCLUDE_PARAM)
+  AC_SUBST(TAR_SUPPORTS_TRANSFORM)
+])
+
 AC_DEFUN_ONCE([BASIC_SETUP_COMPLEX_TOOLS],
 [
   BASIC_CHECK_GNU_MAKE
 
   BASIC_CHECK_FIND_DELETE
+  BASIC_CHECK_TAR
 
   # These tools might not be installed by default,
   # need hint on how to install them.
--- a/common/autoconf/build-performance.m4	Fri Jun 10 11:40:02 2016 -0700
+++ b/common/autoconf/build-performance.m4	Fri Jun 10 15:03:10 2016 -0700
@@ -367,6 +367,9 @@
   elif test "x$TOOLCHAIN_TYPE" = xsolstudio; then
     AC_MSG_RESULT([no, does not work with Solaris Studio])
     USE_PRECOMPILED_HEADER=0
+  elif test "x$TOOLCHAIN_TYPE" = xxlc; then
+    AC_MSG_RESULT([no, does not work with xlc])
+    USE_PRECOMPILED_HEADER=0
   else
     AC_MSG_RESULT([yes])
   fi
--- a/common/autoconf/compare.sh.in	Fri Jun 10 11:40:02 2016 -0700
+++ b/common/autoconf/compare.sh.in	Fri Jun 10 15:03:10 2016 -0700
@@ -48,6 +48,7 @@
 export FILE="@FILE@"
 export FIND="@FIND@"
 export GREP="@GREP@"
+export GUNZIP="@GUNZIP@"
 export LDD="@LDD@"
 export LN="@LN@"
 export MKDIR="@MKDIR@"
@@ -63,10 +64,11 @@
 export SORT="@SORT@"
 export STAT="@STAT@"
 export STRIP="@STRIP@ @STRIPFLAGS@"
+export TAR="@TAR@"
 export TEE="@TEE@"
 export UNIQ="@UNIQ@"
 export UNPACK200="@FIXPATH@ @BOOT_JDK@/bin/unpack200"
-export UNARCHIVE="@UNZIP@ -q"
+export UNARCHIVE="@UNZIP@ -q -o"
 
 export SRC_ROOT="@TOPDIR@"
 export OUTPUT_ROOT="@OUTPUT_ROOT@"
--- a/common/autoconf/configure.ac	Fri Jun 10 11:40:02 2016 -0700
+++ b/common/autoconf/configure.ac	Fri Jun 10 15:03:10 2016 -0700
@@ -207,6 +207,7 @@
 # Need toolchain to setup dtrace
 HOTSPOT_SETUP_DTRACE
 HOTSPOT_SETUP_JVM_FEATURES
+HOTSPOT_ENABLE_DISABLE_GTEST
 
 ###############################################################################
 #
@@ -228,6 +229,7 @@
 
 JDKOPT_DETECT_INTREE_EC
 JDKOPT_ENABLE_DISABLE_FAILURE_HANDLER
+JDKOPT_ENABLE_DISABLE_GENERATE_CLASSLIST
 
 ###############################################################################
 #
--- a/common/autoconf/flags.m4	Fri Jun 10 11:40:02 2016 -0700
+++ b/common/autoconf/flags.m4	Fri Jun 10 15:03:10 2016 -0700
@@ -593,9 +593,9 @@
       fi
       C_O_FLAG_NONE="-O0"
     elif test "x$TOOLCHAIN_TYPE" = xxlc; then
-      C_O_FLAG_HIGHEST_JVM="-O3"
-      C_O_FLAG_HIGHEST="-O3"
-      C_O_FLAG_HI="-O3 -qstrict"
+      C_O_FLAG_HIGHEST_JVM="-O3 -qhot=level=1 -qinline -qinlglue"
+      C_O_FLAG_HIGHEST="-O3 -qhot=level=1 -qinline -qinlglue"
+      C_O_FLAG_HI="-O3 -qinline -qinlglue"
       C_O_FLAG_NORM="-O2"
       C_O_FLAG_DEBUG="-qnoopt"
       # FIXME: Value below not verified.
@@ -911,8 +911,8 @@
   elif test "x$OPENJDK_$1_OS" = xaix; then
     $2JVM_CFLAGS="[$]$2JVM_CFLAGS -DAIX"
     # We may need '-qminimaltoc' or '-qpic=large -bbigtoc' if the TOC overflows.
-    $2JVM_CFLAGS="[$]$2JVM_CFLAGS -qtune=balanced -qhot=level=1 -qinline \
-        -qinlglue -qalias=noansi -qstrict -qtls=default -qlanglvl=c99vla \
+    $2JVM_CFLAGS="[$]$2JVM_CFLAGS -qtune=balanced \
+        -qalias=noansi -qstrict -qtls=default -qlanglvl=c99vla \
         -qlanglvl=noredefmac -qnortti -qnoeh -qignerrno"
   elif test "x$OPENJDK_$1_OS" = xbsd; then
     $2COMMON_CCXXFLAGS_JDK="[$]$2COMMON_CCXXFLAGS_JDK -D_ALLBSD_SOURCE"
--- a/common/autoconf/generated-configure.sh	Fri Jun 10 11:40:02 2016 -0700
+++ b/common/autoconf/generated-configure.sh	Fri Jun 10 15:03:10 2016 -0700
@@ -650,6 +650,7 @@
 JOBS
 MEMORY_SIZE
 NUM_CORES
+ENABLE_GENERATE_CLASSLIST
 BUILD_FAILURE_HANDLER
 ENABLE_INTREE_EC
 STLPORT_LIB
@@ -688,6 +689,7 @@
 STATIC_CXX_SETTING
 FIXPATH_DETACH_FLAG
 FIXPATH
+BUILD_GTEST
 VALID_JVM_FEATURES
 JVM_FEATURES_custom
 JVM_FEATURES_zeroshark
@@ -949,6 +951,8 @@
 LDD
 ZIP
 UNZIP
+TAR_SUPPORTS_TRANSFORM
+TAR_INCLUDE_PARAM
 FIND_DELETE
 OUTPUT_SYNC
 OUTPUT_SYNC_SUPPORTED
@@ -981,6 +985,9 @@
 HOTSPOT_BUILD_CPU
 HOTSPOT_BUILD_OS_TYPE
 HOTSPOT_BUILD_OS
+OPENJDK_BUILD_BUNDLE_PLATFORM
+OPENJDK_BUILD_CPU_BUNDLE
+OPENJDK_BUILD_OS_BUNDLE
 OPENJDK_BUILD_OS_EXPORT_DIR
 OPENJDK_BUILD_CPU_JLI_CFLAGS
 OPENJDK_BUILD_CPU_OSARCH
@@ -995,6 +1002,9 @@
 HOTSPOT_TARGET_OS
 DEFINE_CROSS_COMPILE_ARCH
 LP64
+OPENJDK_TARGET_BUNDLE_PLATFORM
+OPENJDK_TARGET_CPU_BUNDLE
+OPENJDK_TARGET_OS_BUNDLE
 OPENJDK_TARGET_OS_EXPORT_DIR
 OPENJDK_TARGET_CPU_JLI_CFLAGS
 OPENJDK_TARGET_CPU_OSARCH
@@ -1064,6 +1074,8 @@
 MKDIR
 LS
 LN
+GZIP
+GUNZIP
 HEAD
 FIND
 FILE
@@ -1188,6 +1200,7 @@
 enable_dtrace
 with_jvm_features
 with_jvm_interpreter
+enable_hotspot_gtest
 with_stdc__lib
 with_msvcr_dll
 with_msvcp_dll
@@ -1214,6 +1227,7 @@
 with_dxsdk_lib
 with_dxsdk_include
 enable_jtreg_failure_handler
+enable_generate_classlist
 with_num_cores
 with_memory_size
 with_jobs
@@ -1246,6 +1260,8 @@
 FILE
 FIND
 HEAD
+GUNZIP
+GZIP
 LN
 LS
 MKDIR
@@ -1980,6 +1996,7 @@
   --enable-dtrace[=yes/no/auto]
                           enable dtrace. Default is auto, where dtrace is
                           enabled if all dependencies are present.
+  --disable-hotspot-gtest Disables building of the Hotspot unit tests
   --disable-freetype-bundling
                           disable bundling of the freetype library with the
                           build result [enabled on Windows or when using
@@ -1990,6 +2007,10 @@
                           Default is auto, where the failure handler is built
                           if all dependencies are present and otherwise just
                           disabled.
+  --disable-generate-classlist
+                          forces enabling or disabling of the generation of a
+                          CDS classlist at build time. Default is to generate
+                          it when either the server or client JVMs are built.
   --enable-sjavac         use sjavac to do fast incremental compiles
                           [disabled]
   --disable-javac-server  disable javac server [enabled]
@@ -2184,6 +2205,8 @@
   FILE        Override default value for FILE
   FIND        Override default value for FIND
   HEAD        Override default value for HEAD
+  GUNZIP      Override default value for GUNZIP
+  GZIP        Override default value for GZIP
   LN          Override default value for LN
   LS          Override default value for LS
   MKDIR       Override default value for MKDIR
@@ -3686,6 +3709,8 @@
 
 
 
+
+
 # Check if build directory is on local disk. If not possible to determine,
 # we prefer to claim it's local.
 # Argument 1: directory to test
@@ -4282,6 +4307,11 @@
 #
 
 
+################################################################################
+# Check if gtest should be built
+#
+
+
 #
 # Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -4367,6 +4397,12 @@
 #
 
 
+################################################################################
+#
+# Enable or disable generation of the classlist at build time
+#
+
+
 #
 # Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -5056,7 +5092,7 @@
 #CUSTOM_AUTOCONF_INCLUDE
 
 # Do not change or remove the following line, it is needed for consistency checks:
-DATE_WHEN_GENERATED=1463011468
+DATE_WHEN_GENERATED=1465351120
 
 ###############################################################################
 #
@@ -8384,6 +8420,414 @@
   # Publish this variable in the help.
 
 
+  if [ -z "${GUNZIP+x}" ]; then
+    # The variable is not set by user, try to locate tool using the code snippet
+    for ac_prog in gunzip
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_GUNZIP+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $GUNZIP in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_GUNZIP="$GUNZIP" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_path_GUNZIP="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+GUNZIP=$ac_cv_path_GUNZIP
+if test -n "$GUNZIP"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GUNZIP" >&5
+$as_echo "$GUNZIP" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  test -n "$GUNZIP" && break
+done
+
+  else
+    # The variable is set, but is it from the command line or the environment?
+
+    # Try to remove the string !GUNZIP! from our list.
+    try_remove_var=${CONFIGURE_OVERRIDDEN_VARIABLES//!GUNZIP!/}
+    if test "x$try_remove_var" = "x$CONFIGURE_OVERRIDDEN_VARIABLES"; then
+      # If it failed, the variable was not from the command line. Ignore it,
+      # but warn the user (except for BASH, which is always set by the calling BASH).
+      if test "xGUNZIP" != xBASH; then
+        { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Ignoring value of GUNZIP from the environment. Use command line variables instead." >&5
+$as_echo "$as_me: WARNING: Ignoring value of GUNZIP from the environment. Use command line variables instead." >&2;}
+      fi
+      # Try to locate tool using the code snippet
+      for ac_prog in gunzip
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_GUNZIP+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $GUNZIP in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_GUNZIP="$GUNZIP" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_path_GUNZIP="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+GUNZIP=$ac_cv_path_GUNZIP
+if test -n "$GUNZIP"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GUNZIP" >&5
+$as_echo "$GUNZIP" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  test -n "$GUNZIP" && break
+done
+
+    else
+      # If it succeeded, then it was overridden by the user. We will use it
+      # for the tool.
+
+      # First remove it from the list of overridden variables, so we can test
+      # for unknown variables in the end.
+      CONFIGURE_OVERRIDDEN_VARIABLES="$try_remove_var"
+
+      # Check if we try to supply an empty value
+      if test "x$GUNZIP" = x; then
+        { $as_echo "$as_me:${as_lineno-$LINENO}: Setting user supplied tool GUNZIP= (no value)" >&5
+$as_echo "$as_me: Setting user supplied tool GUNZIP= (no value)" >&6;}
+        { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GUNZIP" >&5
+$as_echo_n "checking for GUNZIP... " >&6; }
+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: disabled" >&5
+$as_echo "disabled" >&6; }
+      else
+        # Check if the provided tool contains a complete path.
+        tool_specified="$GUNZIP"
+        tool_basename="${tool_specified##*/}"
+        if test "x$tool_basename" = "x$tool_specified"; then
+          # A command without a complete path is provided, search $PATH.
+          { $as_echo "$as_me:${as_lineno-$LINENO}: Will search for user supplied tool GUNZIP=$tool_basename" >&5
+$as_echo "$as_me: Will search for user supplied tool GUNZIP=$tool_basename" >&6;}
+          # Extract the first word of "$tool_basename", so it can be a program name with args.
+set dummy $tool_basename; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_GUNZIP+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $GUNZIP in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_GUNZIP="$GUNZIP" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_path_GUNZIP="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+GUNZIP=$ac_cv_path_GUNZIP
+if test -n "$GUNZIP"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GUNZIP" >&5
+$as_echo "$GUNZIP" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+          if test "x$GUNZIP" = x; then
+            as_fn_error $? "User supplied tool $tool_basename could not be found" "$LINENO" 5
+          fi
+        else
+          # Otherwise we believe it is a complete path. Use it as it is.
+          { $as_echo "$as_me:${as_lineno-$LINENO}: Will use user supplied tool GUNZIP=$tool_specified" >&5
+$as_echo "$as_me: Will use user supplied tool GUNZIP=$tool_specified" >&6;}
+          { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GUNZIP" >&5
+$as_echo_n "checking for GUNZIP... " >&6; }
+          if test ! -x "$tool_specified"; then
+            { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5
+$as_echo "not found" >&6; }
+            as_fn_error $? "User supplied tool GUNZIP=$tool_specified does not exist or is not executable" "$LINENO" 5
+          fi
+          { $as_echo "$as_me:${as_lineno-$LINENO}: result: $tool_specified" >&5
+$as_echo "$tool_specified" >&6; }
+        fi
+      fi
+    fi
+
+  fi
+
+
+
+  if test "x$GUNZIP" = x; then
+    as_fn_error $? "Could not find required tool for GUNZIP" "$LINENO" 5
+  fi
+
+
+
+
+
+  # Publish this variable in the help.
+
+
+  if [ -z "${GZIP+x}" ]; then
+    # The variable is not set by user, try to locate tool using the code snippet
+    for ac_prog in pigz gzip
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_GZIP+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $GZIP in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_GZIP="$GZIP" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_path_GZIP="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+GZIP=$ac_cv_path_GZIP
+if test -n "$GZIP"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GZIP" >&5
+$as_echo "$GZIP" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  test -n "$GZIP" && break
+done
+
+  else
+    # The variable is set, but is it from the command line or the environment?
+
+    # Try to remove the string !GZIP! from our list.
+    try_remove_var=${CONFIGURE_OVERRIDDEN_VARIABLES//!GZIP!/}
+    if test "x$try_remove_var" = "x$CONFIGURE_OVERRIDDEN_VARIABLES"; then
+      # If it failed, the variable was not from the command line. Ignore it,
+      # but warn the user (except for BASH, which is always set by the calling BASH).
+      if test "xGZIP" != xBASH; then
+        { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Ignoring value of GZIP from the environment. Use command line variables instead." >&5
+$as_echo "$as_me: WARNING: Ignoring value of GZIP from the environment. Use command line variables instead." >&2;}
+      fi
+      # Try to locate tool using the code snippet
+      for ac_prog in pigz gzip
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_GZIP+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $GZIP in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_GZIP="$GZIP" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_path_GZIP="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+GZIP=$ac_cv_path_GZIP
+if test -n "$GZIP"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GZIP" >&5
+$as_echo "$GZIP" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  test -n "$GZIP" && break
+done
+
+    else
+      # If it succeeded, then it was overridden by the user. We will use it
+      # for the tool.
+
+      # First remove it from the list of overridden variables, so we can test
+      # for unknown variables in the end.
+      CONFIGURE_OVERRIDDEN_VARIABLES="$try_remove_var"
+
+      # Check if we try to supply an empty value
+      if test "x$GZIP" = x; then
+        { $as_echo "$as_me:${as_lineno-$LINENO}: Setting user supplied tool GZIP= (no value)" >&5
+$as_echo "$as_me: Setting user supplied tool GZIP= (no value)" >&6;}
+        { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GZIP" >&5
+$as_echo_n "checking for GZIP... " >&6; }
+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: disabled" >&5
+$as_echo "disabled" >&6; }
+      else
+        # Check if the provided tool contains a complete path.
+        tool_specified="$GZIP"
+        tool_basename="${tool_specified##*/}"
+        if test "x$tool_basename" = "x$tool_specified"; then
+          # A command without a complete path is provided, search $PATH.
+          { $as_echo "$as_me:${as_lineno-$LINENO}: Will search for user supplied tool GZIP=$tool_basename" >&5
+$as_echo "$as_me: Will search for user supplied tool GZIP=$tool_basename" >&6;}
+          # Extract the first word of "$tool_basename", so it can be a program name with args.
+set dummy $tool_basename; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_GZIP+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $GZIP in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_GZIP="$GZIP" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_path_GZIP="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+GZIP=$ac_cv_path_GZIP
+if test -n "$GZIP"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GZIP" >&5
+$as_echo "$GZIP" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+          if test "x$GZIP" = x; then
+            as_fn_error $? "User supplied tool $tool_basename could not be found" "$LINENO" 5
+          fi
+        else
+          # Otherwise we believe it is a complete path. Use it as it is.
+          { $as_echo "$as_me:${as_lineno-$LINENO}: Will use user supplied tool GZIP=$tool_specified" >&5
+$as_echo "$as_me: Will use user supplied tool GZIP=$tool_specified" >&6;}
+          { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GZIP" >&5
+$as_echo_n "checking for GZIP... " >&6; }
+          if test ! -x "$tool_specified"; then
+            { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5
+$as_echo "not found" >&6; }
+            as_fn_error $? "User supplied tool GZIP=$tool_specified does not exist or is not executable" "$LINENO" 5
+          fi
+          { $as_echo "$as_me:${as_lineno-$LINENO}: result: $tool_specified" >&5
+$as_echo "$tool_specified" >&6; }
+        fi
+      fi
+    fi
+
+  fi
+
+
+
+  if test "x$GZIP" = x; then
+    as_fn_error $? "Could not find required tool for GZIP" "$LINENO" 5
+  fi
+
+
+
+
+
+  # Publish this variable in the help.
+
+
   if [ -z "${LN+x}" ]; then
     # The variable is not set by user, try to locate tool using the code snippet
     for ac_prog in ln
@@ -10834,7 +11278,7 @@
 
   if [ -z "${TAR+x}" ]; then
     # The variable is not set by user, try to locate tool using the code snippet
-    for ac_prog in tar
+    for ac_prog in gtar tar
 do
   # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
@@ -10892,7 +11336,7 @@
 $as_echo "$as_me: WARNING: Ignoring value of TAR from the environment. Use command line variables instead." >&2;}
       fi
       # Try to locate tool using the code snippet
-      for ac_prog in tar
+      for ac_prog in gtar tar
 do
   # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
@@ -15408,6 +15852,23 @@
   fi
 
 
+  # The new version string in JDK 9 also defined new naming of OS and ARCH for bundles
+  # Macosx is osx and x86_64 is x64
+  if test "x$OPENJDK_TARGET_OS" = xmacosx; then
+    OPENJDK_TARGET_OS_BUNDLE="osx"
+  else
+    OPENJDK_TARGET_OS_BUNDLE="$OPENJDK_TARGET_OS"
+  fi
+  if test "x$OPENJDK_TARGET_CPU" = xx86_64; then
+    OPENJDK_TARGET_CPU_BUNDLE="x64"
+  else
+    OPENJDK_TARGET_CPU_BUNDLE="$OPENJDK_TARGET_CPU"
+  fi
+  OPENJDK_TARGET_BUNDLE_PLATFORM="${OPENJDK_TARGET_OS_BUNDLE}-${OPENJDK_TARGET_CPU_BUNDLE}"
+
+
+
+
   if test "x$OPENJDK_TARGET_CPU_BITS" = x64; then
     A_LP64="LP64:="
     # -D_LP64=1 is only set on linux and mac. Setting on windows causes diff in
@@ -15564,6 +16025,23 @@
   fi
 
 
+  # The new version string in JDK 9 also defined new naming of OS and ARCH for bundles
+  # Macosx is osx and x86_64 is x64
+  if test "x$OPENJDK_BUILD_OS" = xmacosx; then
+    OPENJDK_BUILD_OS_BUNDLE="osx"
+  else
+    OPENJDK_BUILD_OS_BUNDLE="$OPENJDK_TARGET_OS"
+  fi
+  if test "x$OPENJDK_BUILD_CPU" = xx86_64; then
+    OPENJDK_BUILD_CPU_BUNDLE="x64"
+  else
+    OPENJDK_BUILD_CPU_BUNDLE="$OPENJDK_BUILD_CPU"
+  fi
+  OPENJDK_BUILD_BUNDLE_PLATFORM="${OPENJDK_BUILD_OS_BUNDLE}-${OPENJDK_BUILD_CPU_BUNDLE}"
+
+
+
+
   if test "x$OPENJDK_BUILD_CPU_BITS" = x64; then
     A_LP64="LP64:="
     # -D_LP64=1 is only set on linux and mac. Setting on windows causes diff in
@@ -20681,6 +21159,30 @@
 
 
 
+  # Test which kind of tar was found
+  if test "x$($TAR --version | $GREP "GNU tar")" != "x"; then
+    TAR_TYPE="gnu"
+  elif test "x$($TAR -v | $GREP "bsdtar")" != "x"; then
+    TAR_TYPE="bsd"
+  elif test "x$OPENJDK_BUILD_OS" = "xsolaris"; then
+    TAR_TYPE="solaris"
+  fi
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking what type of tar was found" >&5
+$as_echo_n "checking what type of tar was found... " >&6; }
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $TAR_TYPE" >&5
+$as_echo "$TAR_TYPE" >&6; }
+
+  if test "x$TAR_TYPE" = "xgnu"; then
+    TAR_INCLUDE_PARAM="T"
+    TAR_SUPPORTS_TRANSFORM="true"
+  else
+    TAR_INCLUDE_PARAM="I"
+    TAR_SUPPORTS_TRANSFORM="false"
+  fi
+
+
+
+
   # These tools might not be installed by default,
   # need hint on how to install them.
 
@@ -49111,9 +49613,9 @@
       fi
       C_O_FLAG_NONE="-O0"
     elif test "x$TOOLCHAIN_TYPE" = xxlc; then
-      C_O_FLAG_HIGHEST_JVM="-O3"
-      C_O_FLAG_HIGHEST="-O3"
-      C_O_FLAG_HI="-O3 -qstrict"
+      C_O_FLAG_HIGHEST_JVM="-O3 -qhot=level=1 -qinline -qinlglue"
+      C_O_FLAG_HIGHEST="-O3 -qhot=level=1 -qinline -qinlglue"
+      C_O_FLAG_HI="-O3 -qinline -qinlglue"
       C_O_FLAG_NORM="-O2"
       C_O_FLAG_DEBUG="-qnoopt"
       # FIXME: Value below not verified.
@@ -50120,8 +50622,8 @@
   elif test "x$OPENJDK_TARGET_OS" = xaix; then
     JVM_CFLAGS="$JVM_CFLAGS -DAIX"
     # We may need '-qminimaltoc' or '-qpic=large -bbigtoc' if the TOC overflows.
-    JVM_CFLAGS="$JVM_CFLAGS -qtune=balanced -qhot=level=1 -qinline \
-        -qinlglue -qalias=noansi -qstrict -qtls=default -qlanglvl=c99vla \
+    JVM_CFLAGS="$JVM_CFLAGS -qtune=balanced \
+        -qalias=noansi -qstrict -qtls=default -qlanglvl=c99vla \
         -qlanglvl=noredefmac -qnortti -qnoeh -qignerrno"
   elif test "x$OPENJDK_TARGET_OS" = xbsd; then
     COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS_JDK -D_ALLBSD_SOURCE"
@@ -50925,8 +51427,8 @@
   elif test "x$OPENJDK_BUILD_OS" = xaix; then
     OPENJDK_BUILD_JVM_CFLAGS="$OPENJDK_BUILD_JVM_CFLAGS -DAIX"
     # We may need '-qminimaltoc' or '-qpic=large -bbigtoc' if the TOC overflows.
-    OPENJDK_BUILD_JVM_CFLAGS="$OPENJDK_BUILD_JVM_CFLAGS -qtune=balanced -qhot=level=1 -qinline \
-        -qinlglue -qalias=noansi -qstrict -qtls=default -qlanglvl=c99vla \
+    OPENJDK_BUILD_JVM_CFLAGS="$OPENJDK_BUILD_JVM_CFLAGS -qtune=balanced \
+        -qalias=noansi -qstrict -qtls=default -qlanglvl=c99vla \
         -qlanglvl=noredefmac -qnortti -qnoeh -qignerrno"
   elif test "x$OPENJDK_BUILD_OS" = xbsd; then
     OPENJDK_BUILD_COMMON_CCXXFLAGS_JDK="$OPENJDK_BUILD_COMMON_CCXXFLAGS_JDK -D_ALLBSD_SOURCE"
@@ -52927,6 +53429,49 @@
 
 
 
+  # Check whether --enable-hotspot-gtest was given.
+if test "${enable_hotspot_gtest+set}" = set; then :
+  enableval=$enable_hotspot_gtest;
+fi
+
+
+  if test -e "$HOTSPOT_TOPDIR/test/native"; then
+    GTEST_DIR_EXISTS="true"
+  else
+    GTEST_DIR_EXISTS="false"
+  fi
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking if Hotspot gtest unit tests should be built" >&5
+$as_echo_n "checking if Hotspot gtest unit tests should be built... " >&6; }
+  if test "x$enable_hotspot_gtest" = "xyes"; then
+    if test "x$GTEST_DIR_EXISTS" = "xtrue"; then
+      { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes, forced" >&5
+$as_echo "yes, forced" >&6; }
+      BUILD_GTEST="true"
+    else
+      as_fn_error $? "Cannot build gtest without the test source" "$LINENO" 5
+    fi
+  elif test "x$enable_hotspot_gtest" = "xno"; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, forced" >&5
+$as_echo "no, forced" >&6; }
+    BUILD_GTEST="false"
+  elif test "x$enable_hotspot_gtest" = "x"; then
+    if test "x$GTEST_DIR_EXISTS" = "xtrue" && test "x$OPENJDK_TARGET_OS" != "xaix"; then
+      { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+      BUILD_GTEST="true"
+    else
+      { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+      BUILD_GTEST="false"
+    fi
+  else
+    as_fn_error $? "--enable-gtest must be either yes or no" "$LINENO" 5
+  fi
+
+
+
+
 ###############################################################################
 #
 # Check dependencies for external and internal libraries.
@@ -64055,12 +64600,16 @@
 
 
 
-  if test "$OPENJDK_TARGET_OS" = "solaris"; then
+  if test "$OPENJDK_TARGET_OS" = "solaris" && test "x$BUILD_GTEST" = "xtrue"; then
     # Find the root of the Solaris Studio installation from the compiler path
     SOLARIS_STUDIO_DIR="$(dirname $CC)/.."
     STLPORT_LIB="$SOLARIS_STUDIO_DIR/lib/stlport4$OPENJDK_TARGET_CPU_ISADIR/libstlport.so.1"
     { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libstlport.so.1" >&5
 $as_echo_n "checking for libstlport.so.1... " >&6; }
+    if ! test -f "$STLPORT_LIB" && test "x$OPENJDK_TARGET_CPU_ISADIR" = "x/sparcv9"; then
+      # SS12u3 has libstlport under 'stlport4/v9' instead of 'stlport4/sparcv9'
+      STLPORT_LIB="$SOLARIS_STUDIO_DIR/lib/stlport4/v9/libstlport.so.1"
+    fi
     if test -f "$STLPORT_LIB"; then
       { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes, $STLPORT_LIB" >&5
 $as_echo "yes, $STLPORT_LIB" >&6; }
@@ -64279,6 +64828,51 @@
 
 
 
+  # Check whether --enable-generate-classlist was given.
+if test "${enable_generate_classlist+set}" = set; then :
+  enableval=$enable_generate_classlist;
+fi
+
+
+  # Check if it's likely that it's possible to generate the classlist. Depending
+  # on exact jvm configuration it could be possible anyway.
+  if   [[ " $JVM_VARIANTS " =~ " server " ]]   ||   [[ " $JVM_VARIANTS " =~ " client " ]]  ; then
+    ENABLE_GENERATE_CLASSLIST_POSSIBLE="true"
+  else
+    ENABLE_GENERATE_CLASSLIST_POSSIBLE="false"
+  fi
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking if the CDS classlist generation should be enabled" >&5
+$as_echo_n "checking if the CDS classlist generation should be enabled... " >&6; }
+  if test "x$enable_generate_classlist" = "xyes"; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes, forced" >&5
+$as_echo "yes, forced" >&6; }
+    ENABLE_GENERATE_CLASSLIST="true"
+    if test "x$ENABLE_GENERATE_CLASSLIST_POSSIBLE" = "xfalse"; then
+      { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Generation of classlist might not be possible with JVM Variants $JVM_VARIANTS" >&5
+$as_echo "$as_me: WARNING: Generation of classlist might not be possible with JVM Variants $JVM_VARIANTS" >&2;}
+    fi
+  elif test "x$enable_generate_classlist" = "xno"; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, forced" >&5
+$as_echo "no, forced" >&6; }
+    ENABLE_GENERATE_CLASSLIST="false"
+  elif test "x$enable_generate_classlist" = "x"; then
+    if test "x$ENABLE_GENERATE_CLASSLIST_POSSIBLE" = "xtrue"; then
+      { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+      ENABLE_GENERATE_CLASSLIST="true"
+    else
+      { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+      ENABLE_GENERATE_CLASSLIST="false"
+    fi
+  else
+    as_fn_error $? "Invalid value for --enable-generate-classlist: $enable_generate_classlist" "$LINENO" 5
+  fi
+
+
+
+
 ###############################################################################
 #
 # Configure parts of the build that only affect the build performance,
@@ -65530,6 +66124,10 @@
     { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, does not work with Solaris Studio" >&5
 $as_echo "no, does not work with Solaris Studio" >&6; }
     USE_PRECOMPILED_HEADER=0
+  elif test "x$TOOLCHAIN_TYPE" = xxlc; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, does not work with xlc" >&5
+$as_echo "no, does not work with xlc" >&6; }
+    USE_PRECOMPILED_HEADER=0
   else
     { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
 $as_echo "yes" >&6; }
--- a/common/autoconf/hotspot.m4	Fri Jun 10 11:40:02 2016 -0700
+++ b/common/autoconf/hotspot.m4	Fri Jun 10 15:03:10 2016 -0700
@@ -306,3 +306,43 @@
     fi
   done
 ])
+
+################################################################################
+# Check if gtest should be built
+#
+AC_DEFUN_ONCE([HOTSPOT_ENABLE_DISABLE_GTEST],
+[
+  AC_ARG_ENABLE([hotspot-gtest], [AS_HELP_STRING([--disable-hotspot-gtest],
+      [Disables building of the Hotspot unit tests])])
+
+  if test -e "$HOTSPOT_TOPDIR/test/native"; then
+    GTEST_DIR_EXISTS="true"
+  else
+    GTEST_DIR_EXISTS="false"
+  fi
+
+  AC_MSG_CHECKING([if Hotspot gtest unit tests should be built])
+  if test "x$enable_hotspot_gtest" = "xyes"; then
+    if test "x$GTEST_DIR_EXISTS" = "xtrue"; then
+      AC_MSG_RESULT([yes, forced])
+      BUILD_GTEST="true"
+    else
+      AC_MSG_ERROR([Cannot build gtest without the test source])
+    fi
+  elif test "x$enable_hotspot_gtest" = "xno"; then
+    AC_MSG_RESULT([no, forced])
+    BUILD_GTEST="false"
+  elif test "x$enable_hotspot_gtest" = "x"; then
+    if test "x$GTEST_DIR_EXISTS" = "xtrue" && test "x$OPENJDK_TARGET_OS" != "xaix"; then
+      AC_MSG_RESULT([yes])
+      BUILD_GTEST="true"
+    else
+      AC_MSG_RESULT([no])
+      BUILD_GTEST="false"
+    fi
+  else
+    AC_MSG_ERROR([--enable-gtest must be either yes or no])
+  fi
+
+  AC_SUBST(BUILD_GTEST)
+])
--- a/common/autoconf/jdk-options.m4	Fri Jun 10 11:40:02 2016 -0700
+++ b/common/autoconf/jdk-options.m4	Fri Jun 10 15:03:10 2016 -0700
@@ -491,3 +491,46 @@
 
   AC_SUBST(BUILD_FAILURE_HANDLER)
 ])
+
+################################################################################
+#
+# Enable or disable generation of the classlist at build time
+#
+AC_DEFUN_ONCE([JDKOPT_ENABLE_DISABLE_GENERATE_CLASSLIST],
+[
+  AC_ARG_ENABLE([generate-classlist], [AS_HELP_STRING([--disable-generate-classlist],
+      [forces enabling or disabling of the generation of a CDS classlist at build time.
+      Default is to generate it when either the server or client JVMs are built.])])
+
+  # Check if it's likely that it's possible to generate the classlist. Depending
+  # on exact jvm configuration it could be possible anyway.
+  if HOTSPOT_CHECK_JVM_VARIANT(server) || HOTSPOT_CHECK_JVM_VARIANT(client); then
+    ENABLE_GENERATE_CLASSLIST_POSSIBLE="true"
+  else
+    ENABLE_GENERATE_CLASSLIST_POSSIBLE="false"
+  fi
+
+  AC_MSG_CHECKING([if the CDS classlist generation should be enabled])
+  if test "x$enable_generate_classlist" = "xyes"; then
+    AC_MSG_RESULT([yes, forced])
+    ENABLE_GENERATE_CLASSLIST="true"
+    if test "x$ENABLE_GENERATE_CLASSLIST_POSSIBLE" = "xfalse"; then
+      AC_MSG_WARN([Generation of classlist might not be possible with JVM Variants $JVM_VARIANTS])
+    fi
+  elif test "x$enable_generate_classlist" = "xno"; then
+    AC_MSG_RESULT([no, forced])
+    ENABLE_GENERATE_CLASSLIST="false"
+  elif test "x$enable_generate_classlist" = "x"; then
+    if test "x$ENABLE_GENERATE_CLASSLIST_POSSIBLE" = "xtrue"; then
+      AC_MSG_RESULT([yes])
+      ENABLE_GENERATE_CLASSLIST="true"
+    else
+      AC_MSG_RESULT([no])
+      ENABLE_GENERATE_CLASSLIST="false"
+    fi
+  else
+    AC_MSG_ERROR([Invalid value for --enable-generate-classlist: $enable_generate_classlist])
+  fi
+
+  AC_SUBST([ENABLE_GENERATE_CLASSLIST])
+])
--- a/common/autoconf/libraries.m4	Fri Jun 10 11:40:02 2016 -0700
+++ b/common/autoconf/libraries.m4	Fri Jun 10 15:03:10 2016 -0700
@@ -197,11 +197,15 @@
 ################################################################################
 AC_DEFUN_ONCE([LIB_SETUP_SOLARIS_STLPORT],
 [
-  if test "$OPENJDK_TARGET_OS" = "solaris"; then
+  if test "$OPENJDK_TARGET_OS" = "solaris" && test "x$BUILD_GTEST" = "xtrue"; then
     # Find the root of the Solaris Studio installation from the compiler path
     SOLARIS_STUDIO_DIR="$(dirname $CC)/.."
     STLPORT_LIB="$SOLARIS_STUDIO_DIR/lib/stlport4$OPENJDK_TARGET_CPU_ISADIR/libstlport.so.1"
     AC_MSG_CHECKING([for libstlport.so.1])
+    if ! test -f "$STLPORT_LIB" && test "x$OPENJDK_TARGET_CPU_ISADIR" = "x/sparcv9"; then
+      # SS12u3 has libstlport under 'stlport4/v9' instead of 'stlport4/sparcv9'
+      STLPORT_LIB="$SOLARIS_STUDIO_DIR/lib/stlport4/v9/libstlport.so.1"
+    fi
     if test -f "$STLPORT_LIB"; then
       AC_MSG_RESULT([yes, $STLPORT_LIB])
       BASIC_FIXUP_PATH([STLPORT_LIB])
--- a/common/autoconf/platform.m4	Fri Jun 10 11:40:02 2016 -0700
+++ b/common/autoconf/platform.m4	Fri Jun 10 15:03:10 2016 -0700
@@ -366,6 +366,23 @@
   fi
   AC_SUBST(OPENJDK_$1_OS_EXPORT_DIR)
 
+  # The new version string in JDK 9 also defined new naming of OS and ARCH for bundles
+  # Macosx is osx and x86_64 is x64
+  if test "x$OPENJDK_$1_OS" = xmacosx; then
+    OPENJDK_$1_OS_BUNDLE="osx"
+  else
+    OPENJDK_$1_OS_BUNDLE="$OPENJDK_TARGET_OS"
+  fi
+  if test "x$OPENJDK_$1_CPU" = xx86_64; then
+    OPENJDK_$1_CPU_BUNDLE="x64"
+  else
+    OPENJDK_$1_CPU_BUNDLE="$OPENJDK_$1_CPU"
+  fi
+  OPENJDK_$1_BUNDLE_PLATFORM="${OPENJDK_$1_OS_BUNDLE}-${OPENJDK_$1_CPU_BUNDLE}"
+  AC_SUBST(OPENJDK_$1_OS_BUNDLE)
+  AC_SUBST(OPENJDK_$1_CPU_BUNDLE)
+  AC_SUBST(OPENJDK_$1_BUNDLE_PLATFORM)
+
   if test "x$OPENJDK_$1_CPU_BITS" = x64; then
     A_LP64="LP64:="
     # -D_LP64=1 is only set on linux and mac. Setting on windows causes diff in
--- a/common/autoconf/spec.gmk.in	Fri Jun 10 11:40:02 2016 -0700
+++ b/common/autoconf/spec.gmk.in	Fri Jun 10 15:03:10 2016 -0700
@@ -89,6 +89,10 @@
 HOTSPOT_TARGET_CPU_ARCH := @HOTSPOT_TARGET_CPU_ARCH@
 HOTSPOT_TARGET_CPU_DEFINE := @HOTSPOT_TARGET_CPU_DEFINE@
 
+OPENJDK_TARGET_CPU_BUNDLE:=@OPENJDK_TARGET_CPU_BUNDLE@
+OPENJDK_TARGET_OS_BUNDLE:=@OPENJDK_TARGET_OS_BUNDLE@
+OPENJDK_TARGET_BUNDLE_PLATFORM:=@OPENJDK_TARGET_BUNDLE_PLATFORM@
+
 # We are building on this build system.
 # When not cross-compiling, it is the same as the target.
 OPENJDK_BUILD_OS:=@OPENJDK_BUILD_OS@
@@ -233,7 +237,7 @@
 VALID_JVM_VARIANTS := @VALID_JVM_VARIANTS@
 
 # Control wether Hotspot builds gtest tests
-BUILD_GTEST := true
+BUILD_GTEST := @BUILD_GTEST@
 
 # Control use of precompiled header in hotspot libjvm build
 USE_PRECOMPILED_HEADER := @USE_PRECOMPILED_HEADER@
@@ -268,6 +272,7 @@
 HOTSPOT_OUTPUTDIR=$(BUILD_OUTPUT)/hotspot
 JDK_OUTPUTDIR=$(BUILD_OUTPUT)/jdk
 IMAGES_OUTPUTDIR=$(BUILD_OUTPUT)/images
+BUNDLES_OUTPUTDIR=$(BUILD_OUTPUT)/bundles
 TESTMAKE_OUTPUTDIR=$(BUILD_OUTPUT)/test-make
 MAKESUPPORT_OUTPUTDIR=$(BUILD_OUTPUT)/make-support
 # This does not get overridden in a bootcycle build
@@ -280,6 +285,8 @@
 
 BUILD_FAILURE_HANDLER := @BUILD_FAILURE_HANDLER@
 
+ENABLE_GENERATE_CLASSLIST := @ENABLE_GENERATE_CLASSLIST@
+
 # The boot jdk to use. This is overridden in bootcycle-spec.gmk. Make sure to keep
 # it in sync.
 BOOT_JDK:=@BOOT_JDK@
@@ -632,6 +639,7 @@
 EGREP:=@EGREP@
 FGREP:=@FGREP@
 GREP:=@GREP@
+GZIP:=@GZIP@
 HEAD:=@HEAD@
 LS:=@LS@
 LN:=@LN@
@@ -679,6 +687,9 @@
 DTRACE := @DTRACE@
 FIXPATH:=@FIXPATH@
 
+TAR_INCLUDE_PARAM:=@TAR_INCLUDE_PARAM@
+TAR_SUPPORTS_TRANSFORM:=@TAR_SUPPORTS_TRANSFORM@
+
 # Build setup
 ENABLE_JFR=@ENABLE_JFR@
 ENABLE_INTREE_EC=@ENABLE_INTREE_EC@
@@ -785,11 +796,46 @@
 # Interim image
 INTERIM_IMAGE_DIR := $(SUPPORT_OUTPUTDIR)/interim-image
 
+# Docs image
+DOCS_IMAGE_SUBDIR := docs
+DOCS_IMAGE_DIR := $(IMAGES_OUTPUTDIR)/$(DOCS_IMAGE_SUBDIR)
+
 # Macosx bundles directory definitions
-JDK_MACOSX_BUNDLE_SUBDIR=jdk-bundle/jdk-$(VERSION_NUMBER).jdk/Contents
-JRE_MACOSX_BUNDLE_SUBDIR=jre-bundle/jre-$(VERSION_NUMBER).jre/Contents
+JDK_MACOSX_BUNDLE_SUBDIR=jdk-bundle
+JRE_MACOSX_BUNDLE_SUBDIR=jre-bundle
 JDK_MACOSX_BUNDLE_DIR=$(IMAGES_OUTPUTDIR)/$(JDK_MACOSX_BUNDLE_SUBDIR)
 JRE_MACOSX_BUNDLE_DIR=$(IMAGES_OUTPUTDIR)/$(JRE_MACOSX_BUNDLE_SUBDIR)
+JDK_MACOSX_CONTENTS_SUBDIR=jdk-$(VERSION_NUMBER).jdk/Contents
+JRE_MACOSX_CONTENTS_SUBDIR=jre-$(VERSION_NUMBER).jre/Contents
+JDK_MACOSX_CONTENTS_DIR=$(JDK_MACOSX_BUNDLE_DIR)/$(JDK_MACOSX_CONTENTS_SUBDIR)
+JRE_MACOSX_CONTENTS_DIR=$(JRE_MACOSX_BUNDLE_DIR)/$(JRE_MACOSX_CONTENTS_SUBDIR)
+
+# Bundle names
+BASE_NAME := $(VERSION_SHORT)+$(VERSION_BUILD)_$(OPENJDK_TARGET_BUNDLE_PLATFORM)
+ifeq ($(DEBUG_LEVEL), fastdebug)
+  DEBUG_PART := -debug
+else ifneq ($(DEBUG_LEVEL), release)
+  DEBUG_PART := -$(DEBUG_LEVEL)
+endif
+JDK_BUNDLE_NAME := jdk-$(BASE_NAME)_bin$(DEBUG_PART).tar.gz
+JRE_BUNDLE_NAME := jre-$(BASE_NAME)_bin$(DEBUG_PART).tar.gz
+JDK_SYMBOLS_BUNDLE_NAME := jdk-$(BASE_NAME)_bin$(DEBUG_PART)-symbols.tar.gz
+JRE_SYMBOLS_BUNDLE_NAME := jre-$(BASE_NAME)_bin$(DEBUG_PART)-symbols.tar.gz
+ifeq ($(OPENJDK_TARGET_OS), windows)
+  DEMOS_BUNDLE_NAME := jdk-$(BASE_NAME)_demo$(DEBUG_PART).zip
+else
+  DEMOS_BUNDLE_NAME := jdk-$(BASE_NAME)_demo$(DEBUG_PART).tar.gz
+endif
+TEST_BUNDLE_NAME := jdk-$(BASE_NAME)_bin-tests$(DEBUG_PART).tar.gz
+DOCS_BUNDLE_NAME := jdk-$(BASE_NAME)_doc-api-spec$(DEBUG_PART).tar.gz
+
+JDK_BUNDLE := $(BUNDLES_OUTPUTDIR)/$(JDK_BUNDLE_NAME)
+JRE_BUNDLE :=  $(BUNDLES_OUTPUTDIR)/$(JRE_BUNDLE_NAME)
+JDK_SYMBOLS_BUNDLE :=  $(BUNDLES_OUTPUTDIR)/$(JDK_SYMBOLS_BUNDLE_NAME)
+JRE_SYMBOLS_BUNDLE :=  $(BUNDLES_OUTPUTDIR)/$(JRE_SYMBOLS_BUNDLE_NAME)
+DEMOS_BUNDLE :=  $(BUNDLES_OUTPUTDIR)/$(DEMOS_BUNDLE_NAME)
+TEST_BUNDLE :=  $(BUNDLES_OUTPUTDIR)/$(TEST_BUNDLE_NAME)
+DOCS_BUNDLE :=  $(BUNDLES_OUTPUTDIR)/$(DOCS_BUNDLE_NAME)
 
 # This macro is called to allow inclusion of closed source counterparts.
 # Unless overridden in closed sources, it expands to nothing.
--- a/common/bin/compare.sh	Fri Jun 10 11:40:02 2016 -0700
+++ b/common/bin/compare.sh	Fri Jun 10 15:03:10 2016 -0700
@@ -274,14 +274,19 @@
 
     $MKDIR -p $WORK_DIR
 
+    FILE_TYPES_FILTER="$SED \
+        -e 's/BuildID[^,]*//' \
+        -e 's/last modified: .*//' \
+        "
+
     echo -n File types...
     found=""
     for f in `cd $OTHER_DIR && $FIND . ! -type d`
     do
         if [ ! -f ${OTHER_DIR}/$f ]; then continue; fi
         if [ ! -f ${THIS_DIR}/$f ]; then continue; fi
-        OF=`cd ${OTHER_DIR} && $FILE -h $f | $SED 's/BuildID[^,]*//g'`
-        TF=`cd ${THIS_DIR} && $FILE -h $f | $SED 's/BuildID[^,]*//g'`
+        OF=$(cd ${OTHER_DIR} && $FILE -h $f | eval $FILE_TYPES_FILTER)
+        TF=$(cd ${THIS_DIR} && $FILE -h $f | eval $FILE_TYPES_FILTER)
         if [ "$OF" != "$TF" ]
         then
             if [ "`echo $OF | $GREP -c 'Zip archive data'`" -gt 0 ] \
@@ -320,7 +325,7 @@
         ! -name "*.obj" ! -name "*.o" ! -name "JavaControlPanelHelper" \
         ! -name "JavaUpdater" ! -name "JavaWSApplicationStub" \
         ! -name "jspawnhelper" ! -name "JavawsLauncher" ! -name "*.a" \
-        ! -name "finish_installation" ! -name "Sparkle" \
+        ! -name "finish_installation" ! -name "Sparkle" ! -name "*.tar.gz" \
         | $GREP -v "./bin/"  | $SORT | $FILTER)
 
     echo Other files with binary differences...
@@ -423,6 +428,10 @@
     then
         (cd $THIS_UNZIPDIR && $UNARCHIVE $THIS_ZIP)
         (cd $OTHER_UNZIPDIR && $UNARCHIVE $OTHER_ZIP)
+    elif [ "$TYPE" = "gz" ]
+    then
+        (cd $THIS_UNZIPDIR && $GUNZIP -c $THIS_ZIP | $TAR xf -)
+        (cd $OTHER_UNZIPDIR && $GUNZIP -c $OTHER_ZIP | $TAR xf -)
     else
         (cd $THIS_UNZIPDIR && $JIMAGE extract $THIS_ZIP)
         (cd $OTHER_UNZIPDIR && $JIMAGE extract $OTHER_ZIP)
@@ -526,10 +535,11 @@
     OTHER_DIR=$2
     WORK_DIR=$3
 
-    ZIPS=$(cd $THIS_DIR && $FIND . -type f -name "*.zip" | $SORT | $FILTER )
+    ZIPS=$(cd $THIS_DIR && $FIND . -type f -name "*.zip" -o -name "*.tar.gz" \
+        | $SORT | $FILTER )
 
     if [ -n "$ZIPS" ]; then
-        echo Zip files...
+        echo Zip/tar.gz files...
 
         return_value=0
         for f in $ZIPS; do
@@ -913,7 +923,7 @@
             FULLDUMP_MSG="          "
             DIFF_FULLDUMP=
             if [[ "$KNOWN_FULLDUMP_DIFF $ACCEPTED_FULLDUMP_DIFF" = *"$BIN_FILE"* ]]; then
-                FULLDUMP_MSG="    !     "
+                FULLDUMP_MSG="    !    "
             fi
         fi
     fi
--- a/common/bin/idea.sh	Fri Jun 10 11:40:02 2016 -0700
+++ b/common/bin/idea.sh	Fri Jun 10 15:03:10 2016 -0700
@@ -155,6 +155,14 @@
   printf "%s\n" "$mn" >> $IDEA_ANT
 }
 
+JTREG_HOME="        <property name=\"jtreg.home\" value=\"####\" />"
+
+addJtregHome() {
+  DIR=`dirname $SPEC`
+  mn="`echo "$JTREG_HOME" | sed -e s@"\(.*\)####\(.*\)"@"\1$JT_HOME\2"@`"
+  printf "%s\n" "$mn" >> $IDEA_ANT
+}
+
 ### Generate ant.xml
 
 rm -f $IDEA_ANT
@@ -162,6 +170,8 @@
 do
   if echo "$line" | egrep "^ .* <property name=\"module.name\"" > /dev/null ; then
     addModuleName
+  elif echo "$line" | egrep "^ .* <property name=\"jtreg.home\"" > /dev/null ; then
+    addJtregHome
   elif echo "$line" | egrep "^ .* <property name=\"build.target.dir\"" > /dev/null ; then
     addBuildDir
   else
--- a/common/conf/jib-profiles.js	Fri Jun 10 11:40:02 2016 -0700
+++ b/common/conf/jib-profiles.js	Fri Jun 10 15:03:10 2016 -0700
@@ -215,7 +215,7 @@
     var common = {};
 
     common.dependencies = ["boot_jdk", "gnumake", "jtreg"],
-    common.default_make_targets = ["product-images", "test-image"],
+    common.default_make_targets = ["product-bundles", "test-bundles"],
     common.default_make_targets_debug = common.default_make_targets;
     common.default_make_targets_slowdebug = common.default_make_targets;
     common.configure_args = ["--enable-jtreg-failure-handler"],
@@ -245,7 +245,7 @@
             target_cpu: "x64",
             dependencies: concat(common.dependencies, "devkit"),
             configure_args: concat(common.configure_args, "--with-zlib=system"),
-            default_make_targets: concat(common.default_make_targets, "docs-image")
+            default_make_targets: concat(common.default_make_targets, "docs-bundles")
         },
 
         "linux-x86": {
@@ -254,7 +254,7 @@
             build_cpu: "x64",
             dependencies: concat(common.dependencies, "devkit"),
             configure_args: concat(common.configure_args, common.configure_args_32bit,
-                "--with-jvm-variants=minimal,client,server", "--with-zlib=system"),
+                "--with-jvm-variants=minimal,server", "--with-zlib=system"),
             default_make_targets: common.default_make_targets
         },
 
@@ -295,8 +295,7 @@
             target_cpu: "x86",
             build_cpu: "x64",
             dependencies: concat(common.dependencies, "devkit", "freetype"),
-            configure_args: concat(common.configure_args,
-                "--with-jvm-variants=client,server", common.configure_args_32bit),
+            configure_args: concat(common.configure_args, common.configure_args_32bit),
             default_make_targets: common.default_make_targets
         }
     };
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/make/Bundles.gmk	Fri Jun 10 15:03:10 2016 -0700
@@ -0,0 +1,300 @@
+#
+# 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.  Oracle designates this
+# particular file as subject to the "Classpath" exception as provided
+# by Oracle in the LICENSE file that accompanied this code.
+#
+# This code is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+# version 2 for more details (a copy is included in the LICENSE file that
+# accompanied this code).
+#
+# You should have received a copy of the GNU General Public License version
+# 2 along with this work; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+# or visit www.oracle.com if you need additional information or have any
+# questions.
+#
+
+default: all
+
+include $(SPEC)
+include MakeBase.gmk
+
+PRODUCT_TARGETS :=
+TEST_TARGETS :=
+DOCS_TARGETS :=
+
+# On Windows tar frequently complains that "file changed as we read it" for
+# some random source files. This seems to be cause by anti virus scanners and
+# is most likely safe to ignore. When it happens, tar returns '1'.
+ifeq ($(OPENJDK_BUILD_OS), windows)
+  TAR_IGNORE_EXIT_VALUE := || test "$$$$?" = "1"
+endif
+
+# Hook to include the corresponding custom file, if present.
+$(eval $(call IncludeCustomExtension, , Bundles-pre.gmk))
+################################################################################
+# BUNDLE : Name of bundle to create
+# FILES : Files in BASE_DIR to add to bundle
+# SPECIAL_INCLUDES : List of directories inside BASE_DIR to look for additional
+#     files in. These files will not get proper dependency handling. Use when
+#     files or directories may contain spaces.
+# BASE_DIR : Base directory for the root dir in the bundle.
+# SUBDIR : Optional name of root dir in bundle.
+SetupBundleFile = $(NamedParamsMacroTemplate)
+define SetupBundleFileBody
+
+  $1_RELATIVE_FILES := $$(patsubst $$($1_BASE_DIR)/%, ./%, $$($1_FILES))
+
+  ifneq ($$(filter %.tar.gz, $$($1_BUNDLE_NAME)), )
+    $1_TYPE := tar.gz
+  else ifneq ($$(filter %.zip, $$($1_BUNDLE_NAME)), )
+    $1_TYPE := zip
+  else
+    $$(error Unknown bundle type $$($1_BUNDLE_NAME))
+  endif
+
+  $$(call SetIfEmpty, $1_UNZIP_DEBUGINFO, false)
+
+  $(BUNDLES_OUTPUTDIR)/$$($1_BUNDLE_NAME): $$($1_FILES)
+	$$(eval $$(call ListPathsSafely, \
+	    $1_RELATIVE_FILES, \
+	    $(SUPPORT_OUTPUTDIR)/bundles/_$1_files))
+	$$(call MakeDir, $$(@D))
+        ifneq ($$($1_SPECIAL_INCLUDES), )
+	  $$(foreach i, $$($1_SPECIAL_INCLUDES), \
+	      ($(CD) $$($1_BASE_DIR) && $(FIND) ./$$i \
+	          >> $(SUPPORT_OUTPUTDIR)/bundles/_$1_files ) ; )
+        endif
+        ifneq ($$($1_SUBDIR), )
+          ifeq ($$($1_TYPE)-$(TAR_SUPPORTS_TRANSFORM)-$$($1_UNZIP_DEBUGINFO), tar.gz-true-false)
+	    $(CD) $$($1_BASE_DIR) \
+	        && ( $(TAR) cf - -$(TAR_INCLUDE_PARAM) $(SUPPORT_OUTPUTDIR)/bundles/_$1_files \
+	            --transform 's|^|$$($1_SUBDIR)/|' $(TAR_IGNORE_EXIT_VALUE) ) \
+	        | $(GZIP) > $$@
+          else
+            # If a subdir has been specified, copy all files into a temporary
+            # location with this subdir before creating the tar file
+	    $(RM) -r $(SUPPORT_OUTPUTDIR)/bundles/$1/$$($1_SUBDIR)
+	    $(MKDIR) -p $(SUPPORT_OUTPUTDIR)/bundles/$1/$$($1_SUBDIR)
+	    ( $(CD) $$($1_BASE_DIR) \
+	        && $(TAR) cf - -$(TAR_INCLUDE_PARAM) $(SUPPORT_OUTPUTDIR)/bundles/_$1_files \
+	            $(TAR_IGNORE_EXIT_VALUE) ) \
+	        | ( $(CD) $(SUPPORT_OUTPUTDIR)/bundles/$1/$$($1_SUBDIR) && $(TAR) xf - )
+            # Unzip any zipped debuginfo files
+            ifeq ($$($1_UNZIP_DEBUGINFO), true)
+	      for f in `$(FIND) $(SUPPORT_OUTPUTDIR)/bundles/$1/$$($1_SUBDIR) -name "*.diz"`; do \
+	        $(CD) $$$${f%/*} && $(UNZIP) -q $$$${f} && $(RM) $$$${f}; \
+	      done
+            endif
+            ifeq ($$($1_TYPE), tar.gz)
+	      $(CD) $(SUPPORT_OUTPUTDIR)/bundles/$1 && \
+	          ( $(TAR) cf - $$($1_SUBDIR) $(TAR_IGNORE_EXIT_VALUE) ) | $(GZIP) > $$@
+            else ifeq ($$($1_TYPE), zip)
+	      $(CD) $(SUPPORT_OUTPUTDIR)/bundles/$1 && $(ZIP) -qr $$@ .
+            endif
+          endif
+        else
+          ifeq ($$($1_TYPE), tar.gz)
+	    $(CD) $$($1_BASE_DIR) \
+	        && ( $(TAR) cf - -$(TAR_INCLUDE_PARAM) $(SUPPORT_OUTPUTDIR)/bundles/_$1_files \
+	            $(TAR_IGNORE_EXIT_VALUE) ) \
+	        | $(GZIP) > $$@
+          else ifeq ($$($1_TYPE), zip)
+	    $(CD) $$($1_BASE_DIR) \
+	        && $(ZIP) -qr $$@ . -i@$(SUPPORT_OUTPUTDIR)/bundles/_$1_files
+          endif
+        endif
+
+  $1 += $(BUNDLES_OUTPUTDIR)/$$($1_BUNDLE_NAME)
+
+endef
+
+################################################################################
+
+# On Macosx, we bundle up the macosx specific images which already have the
+# correct base directories.
+ifeq ($(OPENJDK_TARGET_OS)-$(DEBUG_LEVEL), macosx-release)
+  JDK_IMAGE_DIR := $(JDK_MACOSX_BUNDLE_DIR)
+  JRE_IMAGE_DIR := $(JRE_MACOSX_BUNDLE_DIR)
+  JDK_IMAGE_HOMEDIR := $(JDK_MACOSX_CONTENTS_DIR)/Home
+  JRE_IMAGE_HOMEDIR := $(JRE_MACOSX_CONTENTS_DIR)/Home
+  JDK_BUNDLE_SUBDIR :=
+  JRE_BUNDLE_SUBDIR :=
+else
+  JDK_IMAGE_HOMEDIR := $(JDK_IMAGE_DIR)
+  JRE_IMAGE_HOMEDIR := $(JRE_IMAGE_DIR)
+  JDK_BUNDLE_SUBDIR := jdk-$(VERSION_NUMBER)
+  JRE_BUNDLE_SUBDIR := jre-$(VERSION_NUMBER)
+  ifneq ($(DEBUG_LEVEL), release)
+    JDK_BUNDLE_SUBDIR := $(JDK_BUNDLE_SUBDIR)/$(DEBUG_LEVEL)
+    JRE_BUNDLE_SUBDIR := $(JRE_BUNDLE_SUBDIR)/$(DEBUG_LEVEL)
+  endif
+endif
+
+################################################################################
+
+ifneq ($(filter product-bundles, $(MAKECMDGOALS)), )
+  $(eval $(call FillCacheFind, $(IMAGES_OUTPUTDIR)))
+
+  SYMBOLS_EXCLUDE_PATTERN := %.debuginfo %.diz %.pdb %.map
+
+  ALL_JDK_FILES := $(call CacheFind, $(JDK_IMAGE_DIR))
+
+  # Create special filter rules when dealing with unzipped .dSYM directories on
+  # macosx
+  ifeq ($(OPENJDK_TARGET_OS), macosx)
+    ifeq ($(ZIP_DEBUGINFO_FILES), false)
+      JDK_SYMBOLS_EXCLUDE_PATTERN := $(addprefix %, \
+          $(call containing, .dSYM/, $(patsubst $(JDK_IMAGE_DIR)/%, %, $(ALL_JDK_FILES))))
+    endif
+  endif
+
+  JDK_BUNDLE_FILES := \
+      $(filter-out \
+          $(JDK_SYMBOLS_EXCLUDE_PATTERN) \
+          $(JDK_EXTRA_EXCLUDES) \
+          $(SYMBOLS_EXCLUDE_PATTERN) \
+          $(JDK_IMAGE_HOMEDIR)/demo/% $(JDK_IMAGE_HOMEDIR)/sample/% \
+          , \
+          $(ALL_JDK_FILES) \
+      )
+  DEMOS_BUNDLE_FILES := \
+      $(filter-out \
+          $(JDK_SYMBOLS_EXCLUDE_PATTERN) \
+          $(SYMBOLS_EXCLUDE_PATTERN) \
+          , \
+          $(filter \
+               $(JDK_IMAGE_HOMEDIR)/demo/% $(JDK_IMAGE_HOMEDIR)/sample/% \
+               $(JDK_IMAGE_HOMEDIR)/release \
+               , \
+               $(ALL_JDK_FILES) \
+          ) \
+      )
+  JDK_SYMBOLS_BUNDLE_FILES := \
+      $(filter \
+          $(JDK_SYMBOLS_EXCLUDE_PATTERN) \
+          $(SYMBOLS_EXCLUDE_PATTERN) \
+          , \
+          $(ALL_JDK_FILES) \
+      ) \
+      $(call CacheFind, $(SYMBOLS_IMAGE_DIR))
+
+  ALL_JRE_FILES := $(call CacheFind, $(JRE_IMAGE_DIR))
+
+  # Create special filter rules when dealing with unzipped .dSYM directories on
+  # macosx
+  ifeq ($(OPENJDK_TARGET_OS), macosx)
+    ifeq ($(ZIP_DEBUGINFO_FILES), false)
+      JRE_SYMBOLS_EXCLUDE_PATTERN := $(addprefix %, \
+          $(call containing, .dSYM/, $(patsubst $(JRE_IMAGE_DIR)/%, %, $(ALL_JRE_FILES))))
+    endif
+  endif
+
+  JRE_BUNDLE_FILES := $(filter-out \
+      $(JRE_SYMBOLS_EXCLUDE_PATTERN) \
+      $(SYMBOLS_EXCLUDE_PATTERN), \
+      $(ALL_JRE_FILES))
+  JRE_SYMBOLS_BUNDLE_FILES := $(filter \
+      $(JRE_SYMBOLS_EXCLUDE_PATTERN) \
+      $(SYMBOLS_EXCLUDE_PATTERN), \
+      $(ALL_JRE_FILES))
+
+  $(eval $(call SetupBundleFile, BUILD_JDK_BUNDLE, \
+      BUNDLE_NAME := $(JDK_BUNDLE_NAME), \
+      FILES := $(JDK_BUNDLE_FILES), \
+      SPECIAL_INCLUDES := $(JDK_SPECIAL_INCLUDES), \
+      BASE_DIR := $(JDK_IMAGE_DIR), \
+      SUBDIR := $(JDK_BUNDLE_SUBDIR), \
+  ))
+
+  PRODUCT_TARGETS += $(BUILD_JDK_BUNDLE)
+
+  $(eval $(call SetupBundleFile, BUILD_JRE_BUNDLE, \
+      BUNDLE_NAME := $(JRE_BUNDLE_NAME), \
+      FILES := $(JRE_BUNDLE_FILES), \
+      BASE_DIR := $(JRE_IMAGE_DIR), \
+      SUBDIR := $(JRE_BUNDLE_SUBDIR), \
+  ))
+
+  PRODUCT_TARGETS += $(BUILD_JRE_BUNDLE)
+
+  $(eval $(call SetupBundleFile, BUILD_JDK_SYMBOLS_BUNDLE, \
+      BUNDLE_NAME := $(JDK_SYMBOLS_BUNDLE_NAME), \
+      FILES := $(JDK_SYMBOLS_BUNDLE_FILES), \
+      BASE_DIR := $(JDK_IMAGE_DIR), \
+      SUBDIR := $(JDK_BUNDLE_SUBDIR), \
+      UNZIP_DEBUGINFO := true, \
+  ))
+
+  PRODUCT_TARGETS += $(BUILD_JDK_SYMBOLS_BUNDLE)
+
+  $(eval $(call SetupBundleFile, BUILD_JRE_SYMBOLS_BUNDLE, \
+      BUNDLE_NAME := $(JRE_SYMBOLS_BUNDLE_NAME), \
+      FILES := $(JRE_SYMBOLS_BUNDLE_FILES), \
+      BASE_DIR := $(JRE_IMAGE_DIR), \
+      SUBDIR := $(JRE_BUNDLE_SUBDIR), \
+      UNZIP_DEBUGINFO := true, \
+  ))
+
+  PRODUCT_TARGETS += $(BUILD_JRE_SYMBOLS_BUNDLE)
+
+  $(eval $(call SetupBundleFile, BUILD_DEMOS_BUNDLE, \
+      BUNDLE_NAME := $(DEMOS_BUNDLE_NAME), \
+      FILES := $(call DoubleDollar, $(DEMOS_BUNDLE_FILES)), \
+      BASE_DIR := $(JDK_IMAGE_DIR), \
+      SUBDIR := $(JDK_BUNDLE_SUBDIR), \
+  ))
+
+  PRODUCT_TARGETS += $(BUILD_DEMOS_BUNDLE)
+endif
+
+################################################################################
+
+ifneq ($(filter test-bundles, $(MAKECMDGOALS)), )
+  TEST_BUNDLE_FILES := $(call CacheFind, $(TEST_IMAGE_DIR))
+
+  $(eval $(call SetupBundleFile, BUILD_TEST_BUNDLE, \
+      BUNDLE_NAME := $(TEST_BUNDLE_NAME), \
+      FILES := $(call DoubleDollar, $(TEST_BUNDLE_FILES)), \
+      BASE_DIR := $(TEST_IMAGE_DIR), \
+  ))
+
+  TEST_TARGETS += $(BUILD_TEST_BUNDLE)
+endif
+
+################################################################################
+
+ifneq ($(filter docs-bundles, $(MAKECMDGOALS)), )
+  DOCS_BUNDLE_FILES := $(call CacheFind, $(DOCS_IMAGE_DIR))
+
+  $(eval $(call SetupBundleFile, BUILD_DOCS_BUNDLE, \
+      BUNDLE_NAME := $(DOCS_BUNDLE_NAME), \
+      FILES := $(DOCS_BUNDLE_FILES), \
+      BASE_DIR := $(DOCS_IMAGE_DIR), \
+      SUBDIR := docs, \
+  ))
+
+  DOCS_TARGETS += $(BUILD_DOCS_BUNDLE)
+endif
+
+################################################################################
+
+# Hook to include the corresponding custom file, if present.
+$(eval $(call IncludeCustomExtension, , Bundles.gmk))
+
+################################################################################
+
+product-bundles: $(PRODUCT_TARGETS)
+test-bundles: $(TEST_TARGETS)
+docs-bundles: $(DOCS_TARGETS)
+
+.PHONY: all default product-bundles test-bundles docs-bundles
--- a/make/CreateJmods.gmk	Fri Jun 10 11:40:02 2016 -0700
+++ b/make/CreateJmods.gmk	Fri Jun 10 15:03:10 2016 -0700
@@ -69,21 +69,13 @@
 # Add dependencies on other jmod files. Only java.base needs access to other
 # jmods.
 ifeq ($(MODULE), java.base)
+  ALL_UPGRADEABLE_MODULES = $(call FindAllUpgradeableModules)
   # When creating a BUILDJDK, we don't need to add hashes to java.base
   ifneq ($(CREATING_BUILDJDK), true)
     DEPS += $(patsubst %, $(JMODS_DIR)/%.jmod, \
-        $(filter-out java.base, $(call FindAllModules)))
+        $(filter-out java.base $(ALL_UPGRADEABLE_MODULES), $(call FindAllModules)))
 
-    # TODO: find modules that directly and indirectly depend on upgradeable
-    # modules
-    EXCLUDE_HASH_MODULES := $(UPGRADEABLE_MODULES) \
-      java.se.ee \
-      jdk.rmic \
-      jdk.xml.bind \
-      jdk.xml.ws \
-      #
-
-    EXCLUDE_PATTERN := $(strip $(subst $(SPACE),|,$(strip $(EXCLUDE_HASH_MODULES))))
+    EXCLUDE_PATTERN := $(strip $(subst $(SPACE),|,$(strip $(ALL_UPGRADEABLE_MODULES))))
 
     JMOD_FLAGS += --modulepath $(JMODS_DIR) \
         --hash-modules '^(?!$(EXCLUDE_PATTERN))'
--- a/make/GensrcModuleInfo.gmk	Fri Jun 10 11:40:02 2016 -0700
+++ b/make/GensrcModuleInfo.gmk	Fri Jun 10 15:03:10 2016 -0700
@@ -85,21 +85,41 @@
   MODS_REST := $(filter-out $(MODS_QUALIFIED_EXPORTS), $(MOD_FILE_CONTENTS))
 
   # Filter the contents for modules that are actually being built
-  MODULES_FILTER := $(addprefix %/, $(addsuffix ;, $(ALL_MODULES)))
-  MODIFICATIONS := $(filter $(MODULES_FILTER), $(MODS_QUALIFIED_EXPORTS)) \
+  ALL_MODULES_FILTER := $(addprefix %/, $(addsuffix ;, $(ALL_MODULES)))
+  MODIFICATIONS := $(filter $(ALL_MODULES_FILTER), $(MODS_QUALIFIED_EXPORTS)) \
       $(MODS_REST)
 
+  # Returns non empty if the package exists in the current module
+  # Param 1 - Name of package with dots
+  PackageExists = \
+      $(strip $(wildcard $(addsuffix $(subst .,/,/$(strip $1)), \
+          $(MODULE_CLASSES_DIRS) \
+          $(addsuffix /$(MODULE), $(IMPORT_MODULES_CLASSES)) \
+      )))
+
   # Convert the modification lines into arguments for the modification tool.
   # Filter out modifications for non existing to-modules.
   $(foreach line, $(MODIFICATIONS), \
     $(eval split_line := $(subst /,$(SPACE),$(line))) \
     $(eval command := $(word 1, $(split_line))) \
-    $(eval package := $(patsubst %;,%,$(word 2, $(split_line)))) \
-    $(eval to_module := $(patsubst %;,%,$(word 4, $(split_line)))) \
-    $(if $(to_module), \
-      $(eval ARGS += -$(command) $(package)/$(to_module)) \
+    $(if $(filter $(command), exports), \
+      $(eval package := $(patsubst %;,%,$(word 2, $(split_line)))) \
+      $(if $(call PackageExists, $(package)), \
+        $(eval to_module := $(patsubst %;,%,$(word 4, $(split_line)))) \
+        $(if $(to_module), \
+          $(eval ARGS += -$(command) $(package)/$(to_module)) \
+        , \
+          $(eval ARGS += -$(command) $(package)) \
+        ) \
+      ) \
     , \
-      $(eval ARGS += -$(command) $(package)) \
+      $(if $(filter $(command), provides), \
+        $(eval provider := $(patsubst %;,%,$(word 2, $(split_line)))) \
+        $(eval class := $(patsubst %;,%,$(word 4, $(split_line)))) \
+        $(eval ARGS += -$(command) $(provider)/$(class)) \
+      , \
+        $(error A module-info.extra in $(MODULE) contains invalid command $(command)) \
+      ) \
     ) \
   )
 
--- a/make/Images.gmk	Fri Jun 10 11:40:02 2016 -0700
+++ b/make/Images.gmk	Fri Jun 10 15:03:10 2016 -0700
@@ -43,8 +43,9 @@
 
 $(eval $(call ReadImportMetaData))
 
-JRE_MODULES += $(filter-out $(MODULES_FILTER), $(BOOT_MODULES) $(PLATFORM_MODULES) $(JRE_TOOL_MODULES))
-JDK_MODULES += $(filter-out $(MODULES_FILTER), $(ALL_MODULES))
+JRE_MODULES += $(filter $(ALL_MODULES), $(BOOT_MODULES) \
+    $(PLATFORM_MODULES) $(JRE_TOOL_MODULES))
+JDK_MODULES += $(ALL_MODULES)
 
 # Compact builds have additional modules
 COMPACT1_EXTRA_MODULES := jdk.localedata jdk.crypto.pkcs11 jdk.crypto.ec
@@ -114,9 +115,12 @@
 # Use this file inside the image as target for make rule
 JIMAGE_TARGET_FILE := bin/java$(EXE_SUFFIX)
 
-JLINK_ORDER_RESOURCES := \
-    *module-info.class* \
-    @$(SUPPORT_OUTPUTDIR)/classlist/classlist,/java.base/java/* \
+JLINK_ORDER_RESOURCES := *module-info.class*
+ifeq ($(ENABLE_GENERATE_CLASSLIST), true)
+  JLINK_ORDER_RESOURCES += @$(SUPPORT_OUTPUTDIR)/classlist/classlist
+endif
+JLINK_ORDER_RESOURCES += \
+    /java.base/java/* \
     /java.base/jdk/* \
     /java.base/sun/* \
     /java.base/com/* \
@@ -124,9 +128,10 @@
     #
 
 JLINK_TOOL := $(JLINK) --modulepath $(IMAGES_OUTPUTDIR)/jmods \
-              --endian $(OPENJDK_BUILD_CPU_ENDIAN) \
-              --order-resources=$(call CommaList, $(JLINK_ORDER_RESOURCES)) \
-              --release-info $(BASE_RELEASE_FILE)
+    --endian $(OPENJDK_BUILD_CPU_ENDIAN) \
+    --release-info $(BASE_RELEASE_FILE) \
+    --order-resources=$(call CommaList, $(JLINK_ORDER_RESOURCES)) \
+    #
 
 ifeq ($(JLINK_KEEP_PACKAGED_MODULES), true)
   JLINK_EXTRA_OPTS := --keep-packaged-modules $(JDK_IMAGE_DIR)/jmods
@@ -368,19 +373,21 @@
 ################################################################################
 # classlist
 
-$(eval $(call SetupCopyFiles, JDK_COPY_CLASSLIST, \
-    FILES := $(SUPPORT_OUTPUTDIR)/classlist/classlist, \
-    DEST := $(JDK_IMAGE_DIR)/lib, \
-))
+ifeq ($(ENABLE_GENERATE_CLASSLIST), true)
+  $(eval $(call SetupCopyFiles, JDK_COPY_CLASSLIST, \
+      FILES := $(SUPPORT_OUTPUTDIR)/classlist/classlist, \
+      DEST := $(JDK_IMAGE_DIR)/lib, \
+  ))
 
-JDK_TARGETS += $(JDK_COPY_CLASSLIST)
+  JDK_TARGETS += $(JDK_COPY_CLASSLIST)
 
-$(eval $(call SetupCopyFiles, JRE_COPY_CLASSLIST, \
-    FILES := $(SUPPORT_OUTPUTDIR)/classlist/classlist, \
-    DEST := $(JRE_IMAGE_DIR)/lib, \
-))
+  $(eval $(call SetupCopyFiles, JRE_COPY_CLASSLIST, \
+      FILES := $(SUPPORT_OUTPUTDIR)/classlist/classlist, \
+      DEST := $(JRE_IMAGE_DIR)/lib, \
+  ))
 
-JRE_TARGETS += $(JRE_COPY_CLASSLIST)
+  JRE_TARGETS += $(JRE_COPY_CLASSLIST)
+endif
 
 ################################################################################
 # /demo dir
--- a/make/Javadoc.gmk	Fri Jun 10 11:40:02 2016 -0700
+++ b/make/Javadoc.gmk	Fri Jun 10 15:03:10 2016 -0700
@@ -44,7 +44,7 @@
 # Definitions for directories
 #
 
-DOCSDIR := $(IMAGES_OUTPUTDIR)/docs
+DOCSDIR := $(DOCS_IMAGE_DIR)
 DOCSTMPDIR = $(SUPPORT_OUTPUTDIR)/docs
 
 HOTSPOT_DOCS_IMPORT_PATH=$(HOTSPOT_OUTPUTDIR)/docs
@@ -1437,7 +1437,6 @@
 	  $(call OptionPair,-windowtitle,$(DYNALINKAPI_WINDOWTITLE) $(DRAFT_WINTITLE)); \
 	  $(call OptionPair,-header,$(DYNALINKAPI_HEADER)$(DRAFT_HEADER)) ; \
 	  $(call OptionPair,-bottom,$(DYNALINKAPI_BOTTOM)$(DRAFT_BOTTOM)) ; \
-	  $(call OptionTrip,-group,$(DYNALINKAPI_GROUPNAME),$(DYNALINKAPI_REGEXP)); \
 	  $(call OptionTrip,-linkoffline,$(DYNALINKAPI2COREAPI),$(COREAPI_DOCSDIR)/); \
 	) >> $@
 
@@ -1634,9 +1633,7 @@
 JLINK_PLUGIN_WINDOWTITLE := JLink Plugin API - EXPERIMENTAL
 JLINK_PLUGIN_HEADER := <strong>JLink Plugin API - EXPERIMENTAL</strong>
 JLINK_PLUGIN_BOTTOM := $(call CommonBottom,$(JLINK_PLUGIN_FIRST_COPYRIGHT_YEAR))
-JLINK_PLUGIN_PKGS = jdk.tools.jlink \
-    jdk.tools.jlink.builder \
-    jdk.tools.jlink.plugin
+JLINK_PLUGIN_PKGS = jdk.tools.jlink.plugin
 
 JLINK_PLUGIN_INDEX_HTML = $(JLINK_PLUGIN_DOCDIR)/index.html
 JLINK_PLUGIN_OPTIONS_FILE = $(DOCSTMPDIR)/jlinkplugins.options
--- a/make/Jprt.gmk	Fri Jun 10 11:40:02 2016 -0700
+++ b/make/Jprt.gmk	Fri Jun 10 15:03:10 2016 -0700
@@ -32,14 +32,6 @@
   ifdef JPRT_ARCHIVE_BUNDLE
     override JPRT_ARCHIVE_BUNDLE := $(shell $(CYGPATH) -u $(JPRT_ARCHIVE_BUNDLE))
   endif
-  ifdef JPRT_ARCHIVE_INSTALL_BUNDLE
-    override JPRT_ARCHIVE_INSTALL_BUNDLE := \
-        $(shell $(CYGPATH) -u $(JPRT_ARCHIVE_INSTALL_BUNDLE))
-  endif
-  ifdef JPRT_ARCHIVE_MODULES_BUNDLE
-    override JPRT_ARCHIVE_MODULES_BUNDLE := \
-        $(shell $(CYGPATH) -u $(JPRT_ARCHIVE_MODULES_BUNDLE))
-  endif
   ifdef JPRT_ARCHIVE_TEST_BUNDLE
     override JPRT_ARCHIVE_TEST_BUNDLE := \
         $(shell $(CYGPATH) -u $(JPRT_ARCHIVE_TEST_BUNDLE))
@@ -55,12 +47,6 @@
 ifndef JPRT_ARCHIVE_BUNDLE
   JPRT_ARCHIVE_BUNDLE=/tmp/jprt_bundles/jdk-image.zip
 endif
-ifndef JPRT_ARCHIVE_INSTALL_BUNDLE
-  JPRT_ARCHIVE_INSTALL_BUNDLE=/tmp/jprt_bundles/product-install.zip
-endif
-ifndef JPRT_ARCHIVE_MODULES_BUNDLE
-  JPRT_ARCHIVE_MODULES_BUNDLE=/tmp/jprt_bundles/modules.zip
-endif
 ifndef JPRT_ARCHIVE_TEST_BUNDLE
   JPRT_ARCHIVE_TEST_BUNDLE=/tmp/jprt_bundles/test-image.zip
 endif
@@ -72,94 +58,51 @@
   jprt_bundle: bootcycle-images
 endif
 
-# This target must be called in the context of a SPEC file
-jprt_bundle: $(JPRT_ARCHIVE_BUNDLE) $(JPRT_ARCHIVE_TEST_BUNDLE) \
-    $(JPRT_ARCHIVE_MODULES_BUNDLE)
+################################################################################
+# JPRT specific bundling targets
+JPRT_TARGET ?= $(DEFAULT_MAKE_TARGET)
+ifeq ($(JPRT_TARGET), $(DEFAULT_MAKE_TARGET))
+  jprt_bundle: $(DEFAULT_MAKE_TARGET) $(JPRT_ARCHIVE_BUNDLE) \
+      $(JPRT_ARCHIVE_TEST_BUNDLE)
 
-ifeq ($(GCOV_ENABLED), true)
-  jprt_bundle: $(JPRT_ARCHIVE_SYMBOLS_BUNDLE)
-endif
+  SRC_JDK_IMAGE_DIR := $(JDK_IMAGE_DIR)
+  SRC_TEST_IMAGE_DIR := $(TEST_IMAGE_DIR)
 
-# This target must be called in the context of a SPEC file
-$(JPRT_ARCHIVE_BUNDLE): bundles
-	$(MKDIR) -p $(@D)
-	$(RM) $@
-	$(CP) $(BUILD_OUTPUT)/bundles/$(JDK_IMAGE_SUBDIR).zip $@
+  # This target must be called in the context of a SPEC file
+  $(JPRT_ARCHIVE_BUNDLE): product-images
+	$(call MakeDir, $(@D))
+	$(CD) $(SRC_JDK_IMAGE_DIR) && $(ZIP) -y -q -r $@ .
 
-$(JPRT_ARCHIVE_MODULES_BUNDLE): bundles
-	$(MKDIR) -p $(@D)
-	$(RM) $@
-	$(CP) $(BUILD_OUTPUT)/bundles/modules.zip $@
+  $(JPRT_ARCHIVE_TEST_BUNDLE): test-image
+	$(call MakeDir, $(@D))
+	$(CD) $(SRC_TEST_IMAGE_DIR) && $(ZIP) -y -q -r $@ .
 
-$(JPRT_ARCHIVE_TEST_BUNDLE): bundles
-	$(MKDIR) -p $(@D)
-	$(RM) $@
-	$(CP) $(BUILD_OUTPUT)/bundles/$(TEST_IMAGE_SUBDIR).zip $@
+  ##############################################################################
+  # Optional symbols bundle
+  ifeq ($(GCOV_ENABLED), true)
+    jprt_bundle: $(JPRT_ARCHIVE_SYMBOLS_BUNDLE)
+    zip-bundles: $(SYMBOLS_ZIP_BUNDLE)
 
-$(JPRT_ARCHIVE_SYMBOLS_BUNDLE): bundles
-	$(MKDIR) -p $(@D)
-	$(RM) $@
-	$(CP) $(BUILD_OUTPUT)/bundles/$(SYMBOLS_IMAGE_SUBDIR).zip $@
+    $(JPRT_ARCHIVE_SYMBOLS_BUNDLE): product-images
+	$(call MakeDir, $(@D))
+	$(CD) $(SYMBOLS_IMAGE_DIR) && $(ZIP) -y -q -r $@ .
 
-SRC_JDK_IMAGE_DIR := $(JDK_IMAGE_DIR)
-SRC_JRE_IMAGE_DIR := $(JRE_IMAGE_DIR)
-SRC_TEST_IMAGE_DIR := $(TEST_IMAGE_DIR)
-SRC_JDK_MACOSX_BUNDLE_DIR := $(JDK_MACOSX_BUNDLE_DIR)
-SRC_JRE_MACOSX_BUNDLE_DIR := $(JRE_MACOSX_BUNDLE_DIR)
+  endif
 
-# Bundle up the images
-JPRT_TARGET ?= default
-ifeq ($(JPRT_TARGET), default)
-  bundles: $(JPRT_TARGET)
+  ##############################################################################
+
+else
+  # Just fake the main bundle to satisfy JPRT
+  jprt_bundle: $(JPRT_TARGET)
 	@$(call TargetEnter)
 	$(MKDIR) -p $(BUILD_OUTPUT)/bundles
-	$(CD) $(SRC_JDK_IMAGE_DIR) && $(ZIP) -y -q -r \
-	    $(BUILD_OUTPUT)/bundles/$(JDK_IMAGE_SUBDIR).zip .
-	$(CD) $(SRC_JRE_IMAGE_DIR) && $(ZIP) -y -q -r \
-	    $(BUILD_OUTPUT)/bundles/$(JRE_IMAGE_SUBDIR).zip .
-	$(CD) $(SRC_TEST_IMAGE_DIR) && $(ZIP) -y -q -r \
-	    $(BUILD_OUTPUT)/bundles/$(TEST_IMAGE_SUBDIR).zip .
-	$(CD) $(IMAGES_OUTPUTDIR)/jmods && $(ZIP) -y -q -r \
-	    $(BUILD_OUTPUT)/bundles/modules.zip .
-	if [ -d $(BUILD_OUTPUT)/install/bundles ] ; then \
-	  $(CD) $(BUILD_OUTPUT)/install/bundles && $(ZIP) -y -q -r \
-	      $(JPRT_ARCHIVE_INSTALL_BUNDLE) . ; \
-	fi
-	if [ -d $(SYMBOLS_IMAGE_DIR) ] ; then \
-	  $(CD) $(SYMBOLS_IMAGE_DIR) && $(ZIP) -y -q -r \
-	      $(BUILD_OUTPUT)/bundles/$(SYMBOLS_IMAGE_SUBDIR).zip . ; \
-	fi
-	@$(call TargetExit)
-else
-  # Just fake the bundles
-  bundles: $(JPRT_TARGET)
-	@$(call TargetEnter)
-	$(MKDIR) -p $(BUILD_OUTPUT)/bundles
-	$(CD) $(TOPDIR) &&  $(ZIP) -y -q -r \
-	    $(BUILD_OUTPUT)/bundles/$(JDK_IMAGE_SUBDIR).zip README
-	$(CD) $(TOPDIR) &&  $(ZIP) -y -q -r \
-	    $(BUILD_OUTPUT)/bundles/$(JRE_IMAGE_SUBDIR).zip README
-	$(CD) $(TOPDIR) &&  $(ZIP) -y -q -r \
-	    $(BUILD_OUTPUT)/bundles/$(TEST_IMAGE_SUBDIR).zip README
-	$(CD) $(TOPDIR) &&  $(ZIP) -y -q -r \
-	    $(BUILD_OUTPUT)/bundles/modules.zip README
+	$(CD) $(TOPDIR) && $(TAR) cf - README | $(GZIP) > \
+	    $(JPRT_ARCHIVE_BUNDLE)
 	@$(call TargetExit)
 endif
 
-# Copy images to one unified location regardless of platform etc.
-final-images: $(JPRT_TARGET)
-	@$(call TargetEnter)
-	$(RM) -r $(BUILD_OUTPUT)/final-images
-	$(MKDIR) -p $(BUILD_OUTPUT)/final-images/$(JDK_IMAGE_SUBDIR)
-	$(MKDIR) -p $(BUILD_OUTPUT)/final-images/$(JRE_IMAGE_SUBDIR)
-	$(CP) -R -P $(SRC_JDK_IMAGE_DIR)/* $(BUILD_OUTPUT)/final-images/$(JDK_IMAGE_SUBDIR)/
-	$(CP) -R -P $(SRC_JRE_IMAGE_DIR)/* $(BUILD_OUTPUT)/final-images/$(JRE_IMAGE_SUBDIR)/
-        ifeq ($(OPENJDK_TARGET_OS),macosx)
-	  $(MKDIR) -p $(BUILD_OUTPUT)/final-images/$(JDK_MACOSX_BUNDLE_SUBDIR)
-	  $(MKDIR) -p $(BUILD_OUTPUT)/final-images/$(JRE_MACOSX_BUNDLE_SUBDIR)
-	  $(CP) -R -P $(SRC_JDK_MACOSX_BUNDLE_DIR)/* $(BUILD_OUTPUT)/final-images/$(JDK_MACOSX_BUNDLE_SUBDIR)/
-	  $(CP) -R -P $(SRC_JRE_MACOSX_BUNDLE_DIR)/* $(BUILD_OUTPUT)/final-images/$(JRE_MACOSX_BUNDLE_SUBDIR)/
-        endif
-	@$(call TargetExit)
+ALL_TARGETS += jprt_bundle
 
-ALL_TARGETS += jprt_bundle bundles final-images
+################################################################################
+
+$(eval $(call IncludeCustomExtension, , Jprt.gmk))
--- a/make/MacBundles.gmk	Fri Jun 10 11:40:02 2016 -0700
+++ b/make/MacBundles.gmk	Fri Jun 10 15:03:10 2016 -0700
@@ -34,7 +34,7 @@
 
   bundles: jre-bundle jdk-bundle
 
-  # JDK_MACOSX_BUNDLE_DIR and JRE_MACOSX_BUNDLE_DIR are defined in SPEC.
+  # JDK_MACOSX_CONTENTS_DIR and JRE_MACOSX_CONTENTS_DIR are defined in SPEC.
 
   MACOSX_PLIST_SRC := $(JDK_TOPDIR)/make/data/bundle
 
@@ -52,27 +52,27 @@
   JDK_FILE_LIST := $(shell $(FIND) $(JDK_IMAGE_DIR))
   JRE_FILE_LIST := $(shell $(FIND) $(JRE_IMAGE_DIR))
 
-  JDK_TARGET_LIST := $(subst $(JDK_IMAGE_DIR)/,$(JDK_MACOSX_BUNDLE_DIR)/Home/,$(JDK_FILE_LIST))
-  JRE_TARGET_LIST := $(subst $(JRE_IMAGE_DIR)/,$(JRE_MACOSX_BUNDLE_DIR)/Home/,$(JRE_FILE_LIST))
+  JDK_TARGET_LIST := $(subst $(JDK_IMAGE_DIR)/,$(JDK_MACOSX_CONTENTS_DIR)/Home/,$(JDK_FILE_LIST))
+  JRE_TARGET_LIST := $(subst $(JRE_IMAGE_DIR)/,$(JRE_MACOSX_CONTENTS_DIR)/Home/,$(JRE_FILE_LIST))
 
   # Copy empty directories (jre/lib/applet).
-  $(JDK_MACOSX_BUNDLE_DIR)/Home/%: $(JDK_IMAGE_DIR)/%
+  $(JDK_MACOSX_CONTENTS_DIR)/Home/%: $(JDK_IMAGE_DIR)/%
 	$(call LogInfo, Copying $(patsubst $(OUTPUT_ROOT)/%,%,$@))
 	$(MKDIR) -p $(@D)
 	if [ -d "$<" ]; then $(MKDIR) -p $@; else $(CP) -f -R -P '$<' '$@'; fi
 
-  $(JRE_MACOSX_BUNDLE_DIR)/Home/%: $(JRE_IMAGE_DIR)/%
+  $(JRE_MACOSX_CONTENTS_DIR)/Home/%: $(JRE_IMAGE_DIR)/%
 	$(call LogInfo, Copying $(patsubst $(OUTPUT_ROOT)/%,%,$@))
 	$(MKDIR) -p $(@D)
 	if [ -d "$<" ]; then $(MKDIR) -p $@; else $(CP) -f -R -P '$<' '$@'; fi
 
-  $(JDK_MACOSX_BUNDLE_DIR)/MacOS/libjli.dylib:
+  $(JDK_MACOSX_CONTENTS_DIR)/MacOS/libjli.dylib:
 	$(call LogInfo, Creating link $(patsubst $(OUTPUT_ROOT)/%,%,$@))
 	$(MKDIR) -p $(@D)
 	$(RM) $@
 	$(LN) -s ../Home/lib/jli/libjli.dylib $@
 
-  $(JRE_MACOSX_BUNDLE_DIR)/MacOS/libjli.dylib:
+  $(JRE_MACOSX_CONTENTS_DIR)/MacOS/libjli.dylib:
 	$(call LogInfo, Creating link $(patsubst $(OUTPUT_ROOT)/%,%,$@))
 	$(MKDIR) -p $(@D)
 	$(RM) $@
@@ -80,7 +80,7 @@
 
   $(eval $(call SetupTextFileProcessing, BUILD_JDK_PLIST, \
       SOURCE_FILES := $(MACOSX_PLIST_SRC)/JDK-Info.plist, \
-      OUTPUT_FILE := $(JDK_MACOSX_BUNDLE_DIR)/Info.plist, \
+      OUTPUT_FILE := $(JDK_MACOSX_CONTENTS_DIR)/Info.plist, \
       REPLACEMENTS := \
           @@ID@@ => $(BUNDLE_ID).jdk ; \
           @@NAME@@ => $(BUNDLE_NAME) ; \
@@ -92,7 +92,7 @@
 
   $(eval $(call SetupTextFileProcessing, BUILD_JRE_PLIST, \
       SOURCE_FILES := $(MACOSX_PLIST_SRC)/JRE-Info.plist, \
-      OUTPUT_FILE := $(JRE_MACOSX_BUNDLE_DIR)/Info.plist, \
+      OUTPUT_FILE := $(JRE_MACOSX_CONTENTS_DIR)/Info.plist, \
       REPLACEMENTS := \
           @@ID@@ => $(BUNDLE_ID).jre ; \
           @@NAME@@ => $(BUNDLE_NAME) ; \
@@ -102,13 +102,13 @@
           @@VENDOR@@ => $(BUNDLE_VENDOR) , \
   ))
 
-  jdk-bundle: $(JDK_TARGET_LIST) $(JDK_MACOSX_BUNDLE_DIR)/MacOS/libjli.dylib \
+  jdk-bundle: $(JDK_TARGET_LIST) $(JDK_MACOSX_CONTENTS_DIR)/MacOS/libjli.dylib \
       $(BUILD_JDK_PLIST)
-	$(SETFILE) -a B $(dir $(JDK_MACOSX_BUNDLE_DIR))
+	$(SETFILE) -a B $(dir $(JDK_MACOSX_CONTENTS_DIR))
 
-  jre-bundle: $(JRE_TARGET_LIST) $(JRE_MACOSX_BUNDLE_DIR)/MacOS/libjli.dylib \
+  jre-bundle: $(JRE_TARGET_LIST) $(JRE_MACOSX_CONTENTS_DIR)/MacOS/libjli.dylib \
       $(BUILD_JRE_PLIST)
-	$(SETFILE) -a B $(dir $(JRE_MACOSX_BUNDLE_DIR))
+	$(SETFILE) -a B $(dir $(JRE_MACOSX_CONTENTS_DIR))
 
 else # Not macosx
 
--- a/make/Main.gmk	Fri Jun 10 11:40:02 2016 -0700
+++ b/make/Main.gmk	Fri Jun 10 15:03:10 2016 -0700
@@ -302,9 +302,13 @@
 
 BOOTCYCLE_TARGET := product-images
 bootcycle-images:
-	@$(ECHO) Boot cycle build step 2: Building a new JDK image using previously built image
-	+$(MAKE) -f $(SRC_ROOT)/make/Init.gmk PARALLEL_TARGETS=$(BOOTCYCLE_TARGET) \
-	    JOBS= SPEC=$(dir $(SPEC))bootcycle-spec.gmk main
+        ifneq ($(COMPILE_TYPE), cross)
+	  $(call LogWarn, Boot cycle build step 2: Building a new JDK image using previously built image)
+	  +$(MAKE) -f $(SRC_ROOT)/make/Init.gmk PARALLEL_TARGETS=$(BOOTCYCLE_TARGET) \
+	      JOBS= SPEC=$(dir $(SPEC))bootcycle-spec.gmk main
+        else
+	  $(call LogWarn, Boot cycle build disabled when cross compiling)
+        endif
 
 zip-security:
 	+($(CD) $(SRC_ROOT)/make && $(MAKE) $(MAKE_ARGS) -f ZipSecurity.gmk)
@@ -369,8 +373,10 @@
 interim-image:
 	+($(CD) $(SRC_ROOT)/make && $(MAKE) $(MAKE_ARGS) -f InterimImage.gmk)
 
-generate-classlist:
+ifeq ($(ENABLE_GENERATE_CLASSLIST), true)
+  generate-classlist:
 	+($(CD) $(JDK_TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f GenerateClasslist.gmk)
+endif
 
 ALL_TARGETS += interim-image generate-classlist
 
@@ -433,25 +439,42 @@
 
 # Run tests specified by $(TEST), or the default test set.
 test:
-	$(call RunTests, $(TEST))
+	$(call RunTests, $(TEST), $(JDK_IMAGE_DIR))
 
 test-hotspot-jtreg:
-	$(call RunTests, "hotspot_all")
+	$(call RunTests, "hotspot_all", $(JDK_IMAGE_DIR))
 
 test-hotspot-jtreg-native:
-	$(call RunTests, "hotspot_native_sanity")
+	$(call RunTests, "hotspot_native_sanity", $(JDK_IMAGE_DIR))
 
 test-hotspot-internal:
-	$(call RunTests, "hotspot_internal")
+	$(call RunTests, "hotspot_internal", $(JDK_OUTPUTDIR))
+
+test-hotspot-gtest:
+	$(call RunTests, "hotspot_gtest", $(JDK_OUTPUTDIR))
 
 test-jdk-jtreg-native:
-	$(call RunTests, "jdk_native_sanity")
+	$(call RunTests, "jdk_native_sanity", $(JDK_IMAGE_DIR))
 
 test-make:
 	($(CD) $(SRC_ROOT)/test/make && $(MAKE) $(MAKE_ARGS) -f TestMake.gmk $(TEST_TARGET))
 
 ALL_TARGETS += test test-hotspot-jtreg test-hotspot-jtreg-native \
-    test-hotspot-internal test-jdk-jtreg-native test-make
+    test-hotspot-internal test-hotspot-gtest test-jdk-jtreg-native test-make
+
+################################################################################
+# Bundles
+
+product-bundles:
+	+($(CD) $(TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f Bundles.gmk product-bundles)
+
+test-bundles:
+	+($(CD) $(TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f Bundles.gmk test-bundles)
+
+docs-bundles:
+	+($(CD) $(TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f Bundles.gmk docs-bundles)
+
+ALL_TARGETS += product-bundles test-bundles docs-bundles
 
 ################################################################################
 # Install targets
@@ -579,7 +602,8 @@
   # When creating a BUILDJDK, we don't need to add hashes to java.base, thus
   # we don't need to depend on all other jmods
   ifneq ($(CREATING_BUILDJDK), true)
-    java.base-jmod: $(filter-out java.base-jmod, $(JMOD_TARGETS))
+    java.base-jmod: $(filter-out java.base-jmod \
+        $(addsuffix -jmod, $(call FindAllUpgradeableModules)), $(JMOD_TARGETS))
   endif
 
   # Declare dependencies from <module>-jmod to all other module targets
@@ -618,18 +642,22 @@
 
   jrtfs-jar: interim-langtools
 
-  ifeq ($(CREATE_BUILDJDK), true)
-    # If creating a buildjdk, the interim image needs to be based on that.
-    generate-classlist: create-buildjdk
-  else ifeq ($(EXTERNAL_BUILDJDK), false)
-    # If an external buildjdk has been provided, we skip generating an
-    # interim-image and just use the external buildjdk for generating
-    # classlist.
-    generate-classlist: interim-image
+  ifeq ($(ENABLE_GENERATE_CLASSLIST), true)
+    ifeq ($(CREATE_BUILDJDK), true)
+      # If creating a buildjdk, the interim image needs to be based on that.
+      generate-classlist: create-buildjdk
+    else ifeq ($(EXTERNAL_BUILDJDK), false)
+      # If an external buildjdk has been provided, we skip generating an
+      # interim-image and just use the external buildjdk for generating
+      # classlist.
+      generate-classlist: interim-image
+    endif
+    generate-classlist: buildtools-jdk
+
+    jimages: generate-classlist
   endif
-  generate-classlist: buildtools-jdk
 
-  jimages: jmods zip-source source-tips demos samples jrtfs-jar generate-classlist
+  jimages: jmods zip-source source-tips demos samples jrtfs-jar
 
   profiles: jmods zip-source source-tips jrtfs-jar
 
@@ -676,8 +704,16 @@
 
   test-hotspot-jtreg: jimages test-image
 
+  test-hotspot-gtest: exploded-image test-image-hotspot-gtest
+
   install: product-images
 
+  product-bundles: product-images
+
+  test-bundles: test-image
+
+  docs-bundles: docs-image
+
   generate-summary: jmods
 
 endif
@@ -758,12 +794,16 @@
 test-image: prepare-test-image test-image-hotspot-jtreg-native \
     test-image-jdk-jtreg-native test-image-failure-handler test-image-hotspot-gtest
 
-# all-images is the top-most target, it builds all our deliverables ("images").
+# all-images builds all our deliverables as images.
 all-images: product-images test-image docs-image
 
+# all-bundles packages all our deliverables as tar.gz bundles.
+all-bundles: product-bundles test-bundles docs-bundles
+
 ALL_TARGETS += buildtools gensrc gendata copy java rmic libs launchers jmods \
     jdk.jdwp.agent-gensrc $(ALL_MODULES) demos samples exploded-image \
-    create-buildjdk mac-bundles product-images docs-image test-image all-images
+    create-buildjdk mac-bundles product-images docs-image test-image all-images \
+    all-bundles
 
 ################################################################################
 
@@ -774,9 +814,10 @@
 jdk: exploded-image
 images: product-images
 docs: docs-image
+bundles: all-bundles
 all: all-images
 
-ALL_TARGETS += default jdk images docs all
+ALL_TARGETS += default jdk images docs bundles all
 
 ################################################################################
 ################################################################################
--- a/make/MainSupport.gmk	Fri Jun 10 11:40:02 2016 -0700
+++ b/make/MainSupport.gmk	Fri Jun 10 15:03:10 2016 -0700
@@ -30,10 +30,10 @@
 ifndef _MAINSUPPORT_GMK
 _MAINSUPPORT_GMK := 1
 
-# Run the tests specified by $1.
+# Run the tests specified by $1, with PRODUCT_HOME specified by $2
 define RunTests
 	($(CD) $(SRC_ROOT)/test && $(MAKE) $(MAKE_ARGS) -j1 -k MAKEFLAGS= \
-	    JT_HOME=$(JT_HOME) PRODUCT_HOME=$(JDK_IMAGE_DIR) \
+	    JT_HOME=$(JT_HOME) PRODUCT_HOME=$(strip $2) \
 	    TEST_IMAGE_DIR=$(TEST_IMAGE_DIR) \
 	    ALT_OUTPUTDIR=$(OUTPUT_ROOT) TEST_JOBS=$(TEST_JOBS) \
 	    JOBS=$(JOBS) $1) || true
--- a/make/common/MakeBase.gmk	Fri Jun 10 11:40:02 2016 -0700
+++ b/make/common/MakeBase.gmk	Fri Jun 10 15:03:10 2016 -0700
@@ -145,7 +145,7 @@
         $$(strip $2),$$(subst $$(SPACE),$$(NEWLINE),$$(strip $$($$(strip $1)))))
   endef
 
-else # HAS_FILE_FUNCTION
+else # HAS_FILE_FUNCTION = false
 
   $(eval compress_paths = \
       $(strip $(shell $(CAT) $(SRC_ROOT)/make/common/support/ListPathsSafely-pre-compress.incl)))
@@ -172,8 +172,8 @@
   # Param 2 - File to print to
   # Param 3 - Set to true to append to file instead of overwriting
   define ListPathsSafely
-    ifneq (,$$(word 10001,$$($1)))
-      $$(error Cannot list safely more than 10000 paths. $1 has $$(words $$($1)) paths!)
+    ifneq (,$$(word 30001,$$($$(strip $1))))
+      $$(error Cannot list safely more than 30000 paths. $1 has $$(words $$($$(strip $1))) paths!)
     endif
     $$(call MakeDir, $$(dir $2))
     ifneq ($$(strip $3), true)
@@ -229,6 +229,106 @@
     $$(call ListPathsSafely_IfPrintf,$1,$2,9251,9500)
     $$(call ListPathsSafely_IfPrintf,$1,$2,9501,9750)
     $$(call ListPathsSafely_IfPrintf,$1,$2,9751,10000)
+
+    $$(call ListPathsSafely_IfPrintf,$1,$2,10001,10250)
+    $$(call ListPathsSafely_IfPrintf,$1,$2,10251,10500)
+    $$(call ListPathsSafely_IfPrintf,$1,$2,10501,10750)
+    $$(call ListPathsSafely_IfPrintf,$1,$2,10751,11000)
+
+    $$(call ListPathsSafely_IfPrintf,$1,$2,11001,11250)
+    $$(call ListPathsSafely_IfPrintf,$1,$2,11251,11500)
+    $$(call ListPathsSafely_IfPrintf,$1,$2,11501,11750)
+    $$(call ListPathsSafely_IfPrintf,$1,$2,11751,12000)
+
+    $$(call ListPathsSafely_IfPrintf,$1,$2,12001,12250)
+    $$(call ListPathsSafely_IfPrintf,$1,$2,12251,12500)
+    $$(call ListPathsSafely_IfPrintf,$1,$2,12501,12750)
+    $$(call ListPathsSafely_IfPrintf,$1,$2,12751,13000)
+
+    $$(call ListPathsSafely_IfPrintf,$1,$2,13001,13250)
+    $$(call ListPathsSafely_IfPrintf,$1,$2,13251,13500)
+    $$(call ListPathsSafely_IfPrintf,$1,$2,13501,13750)
+    $$(call ListPathsSafely_IfPrintf,$1,$2,13751,14000)
+
+    $$(call ListPathsSafely_IfPrintf,$1,$2,14001,14250)
+    $$(call ListPathsSafely_IfPrintf,$1,$2,14251,14500)
+    $$(call ListPathsSafely_IfPrintf,$1,$2,14501,14750)
+    $$(call ListPathsSafely_IfPrintf,$1,$2,14751,15000)
+
+    $$(call ListPathsSafely_IfPrintf,$1,$2,15001,15250)
+    $$(call ListPathsSafely_IfPrintf,$1,$2,15251,15500)
+    $$(call ListPathsSafely_IfPrintf,$1,$2,15501,15750)
+    $$(call ListPathsSafely_IfPrintf,$1,$2,15751,16000)
+
+    $$(call ListPathsSafely_IfPrintf,$1,$2,16001,16250)
+    $$(call ListPathsSafely_IfPrintf,$1,$2,16251,16500)
+    $$(call ListPathsSafely_IfPrintf,$1,$2,16501,16750)
+    $$(call ListPathsSafely_IfPrintf,$1,$2,16751,17000)
+
+    $$(call ListPathsSafely_IfPrintf,$1,$2,17001,17250)
+    $$(call ListPathsSafely_IfPrintf,$1,$2,17251,17500)
+    $$(call ListPathsSafely_IfPrintf,$1,$2,17501,17750)
+    $$(call ListPathsSafely_IfPrintf,$1,$2,17751,18000)
+
+    $$(call ListPathsSafely_IfPrintf,$1,$2,18001,18250)
+    $$(call ListPathsSafely_IfPrintf,$1,$2,18251,18500)
+    $$(call ListPathsSafely_IfPrintf,$1,$2,18501,18750)
+    $$(call ListPathsSafely_IfPrintf,$1,$2,18751,19000)
+
+    $$(call ListPathsSafely_IfPrintf,$1,$2,19001,19250)
+    $$(call ListPathsSafely_IfPrintf,$1,$2,19251,19500)
+    $$(call ListPathsSafely_IfPrintf,$1,$2,19501,19750)
+    $$(call ListPathsSafely_IfPrintf,$1,$2,19751,20000)
+
+    $$(call ListPathsSafely_IfPrintf,$1,$2,20001,20250)
+    $$(call ListPathsSafely_IfPrintf,$1,$2,20251,20500)
+    $$(call ListPathsSafely_IfPrintf,$1,$2,20501,20750)
+    $$(call ListPathsSafely_IfPrintf,$1,$2,20751,21000)
+
+    $$(call ListPathsSafely_IfPrintf,$1,$2,21001,21250)
+    $$(call ListPathsSafely_IfPrintf,$1,$2,21251,21500)
+    $$(call ListPathsSafely_IfPrintf,$1,$2,21501,21750)
+    $$(call ListPathsSafely_IfPrintf,$1,$2,21751,22000)
+
+    $$(call ListPathsSafely_IfPrintf,$1,$2,22001,22250)
+    $$(call ListPathsSafely_IfPrintf,$1,$2,22251,22500)
+    $$(call ListPathsSafely_IfPrintf,$1,$2,22501,22750)
+    $$(call ListPathsSafely_IfPrintf,$1,$2,22751,23000)
+
+    $$(call ListPathsSafely_IfPrintf,$1,$2,23001,23250)
+    $$(call ListPathsSafely_IfPrintf,$1,$2,23251,23500)
+    $$(call ListPathsSafely_IfPrintf,$1,$2,23501,23750)
+    $$(call ListPathsSafely_IfPrintf,$1,$2,23751,24000)
+
+    $$(call ListPathsSafely_IfPrintf,$1,$2,24001,24250)
+    $$(call ListPathsSafely_IfPrintf,$1,$2,24251,24500)
+    $$(call ListPathsSafely_IfPrintf,$1,$2,24501,24750)
+    $$(call ListPathsSafely_IfPrintf,$1,$2,24751,25000)
+
+    $$(call ListPathsSafely_IfPrintf,$1,$2,25001,25250)
+    $$(call ListPathsSafely_IfPrintf,$1,$2,25251,25500)
+    $$(call ListPathsSafely_IfPrintf,$1,$2,25501,25750)
+    $$(call ListPathsSafely_IfPrintf,$1,$2,25751,26000)
+
+    $$(call ListPathsSafely_IfPrintf,$1,$2,26001,26250)
+    $$(call ListPathsSafely_IfPrintf,$1,$2,26251,26500)
+    $$(call ListPathsSafely_IfPrintf,$1,$2,26501,26750)
+    $$(call ListPathsSafely_IfPrintf,$1,$2,26751,27000)
+
+    $$(call ListPathsSafely_IfPrintf,$1,$2,27001,27250)
+    $$(call ListPathsSafely_IfPrintf,$1,$2,27251,27500)
+    $$(call ListPathsSafely_IfPrintf,$1,$2,27501,27750)
+    $$(call ListPathsSafely_IfPrintf,$1,$2,27751,28000)
+
+    $$(call ListPathsSafely_IfPrintf,$1,$2,28001,28250)
+    $$(call ListPathsSafely_IfPrintf,$1,$2,28251,28500)
+    $$(call ListPathsSafely_IfPrintf,$1,$2,28501,28750)
+    $$(call ListPathsSafely_IfPrintf,$1,$2,28751,29000)
+
+    $$(call ListPathsSafely_IfPrintf,$1,$2,29001,29250)
+    $$(call ListPathsSafely_IfPrintf,$1,$2,29251,29500)
+    $$(call ListPathsSafely_IfPrintf,$1,$2,29501,29750)
+    $$(call ListPathsSafely_IfPrintf,$1,$2,29751,30000)
   endef
 endif # HAS_FILE_FUNCTION
 
@@ -420,8 +520,12 @@
   # set. Some files get their write permissions removed after being copied to the
   # output dir. When these are copied again to images, xattr would fail. By only clearing
   # attributes when they are present, failing on this is avoided.
+  #
+  # If copying a soft link to a directory, need to delete the target first to avoid
+  # weird errors.
   define install-file
 	$(MKDIR) -p '$(@D)'
+	$(RM) '$@'
 	$(CP) -fRP '$<' '$@'
 	if [ -n "`$(XATTR) -l '$@'`" ]; then $(XATTR) -c '$@'; fi
   endef
--- a/make/common/Modules.gmk	Fri Jun 10 11:40:02 2016 -0700
+++ b/make/common/Modules.gmk	Fri Jun 10 15:03:10 2016 -0700
@@ -57,7 +57,6 @@
     java.rmi \
     java.security.jgss \
     java.security.sasl \
-    java.sql \
     java.xml \
     java.xml.crypto \
     jdk.httpserver \
@@ -72,8 +71,6 @@
 
 # to be deprivileged
 BOOT_MODULES += \
-    java.scripting \
-    java.sql.rowset \
     java.smartcardio \
     jdk.naming.rmi \
     #
@@ -87,6 +84,10 @@
     java.xml.ws \
     #
 
+# Modules explicitly declared as not being upgradeable even though they require
+# an upgradeable module.
+NON_UPGRADEABLE_MODULES +=
+
 AGGREGATOR_MODULES += \
     java.compact1 \
     java.compact2 \
@@ -102,6 +103,9 @@
 
 PLATFORM_MODULES += \
     java.compiler \
+    java.scripting \
+    java.sql \
+    java.sql.rowset \
     jdk.accessibility \
     jdk.charsets \
     jdk.crypto.ec \
@@ -245,6 +249,19 @@
             $(foreach n, $(call FindDepsForModule, $m), \
                  $(call FindDepsForModule, $n))))
 
+# Upgradeable modules are those that are either defined as upgradeable or that
+# require an upradeable module.
+FindAllUpgradeableModules = \
+    $(filter-out $(MODULES_FILTER) $(NON_UPGRADEABLE_MODULES), \
+        $(sort $(UPGRADEABLE_MODULES) $(foreach m, \
+            $(filter-out $(UPGRADEABLE_MODULES), $(call FindAllModules)), \
+          $(if $(filter $(UPGRADEABLE_MODULES), \
+              $(call FindTransitiveDepsForModule, $m)), \
+            $m \
+          ) \
+        )) \
+    )
+
 ################################################################################
 
 # Param 1 - Name of module
--- a/make/idea/idea.gmk	Fri Jun 10 11:40:02 2016 -0700
+++ b/make/idea/idea.gmk	Fri Jun 10 15:03:10 2016 -0700
@@ -35,5 +35,6 @@
 	$(ECHO) "BOOT_JDK=\"$(BOOT_JDK)\"" >> $(OUT)
 	$(ECHO) "CYGPATH=\"$(CYGPATH)\"" >> $(OUT)
 	$(ECHO) "SPEC=\"$(SPEC)\"" >> $(OUT)
+	$(ECHO) "JT_HOME=\"$(JT_HOME)\"" >> $(OUT)
 
 endif
--- a/make/idea/template/ant.xml	Fri Jun 10 11:40:02 2016 -0700
+++ b/make/idea/template/ant.xml	Fri Jun 10 15:03:10 2016 -0700
@@ -5,9 +5,8 @@
       <properties>
         <property name="boot.java.home" value="$JDKPath$" />
         <property name="jtreg.tests" value="$FilePath$" />
-        <property name="jtreg.home" value="###" />
+        <property name="jtreg.home" value="jtreg.home" />
         <property name="build.target.dir" value="specDir" /> <!-- this will be replaced --> 
-        <property name="jtreg.jpda.jvmargs" value="-agentlib:jdwp=transport=dt_socket,server=n,address=localhost:5900,suspend=y" />
         <property name="module.name" value="java.base" /> <!-- this will be replaced -->
       </properties>
       <executeOn event="afterCompilation" target="post-make" />
--- a/make/idea/template/build.xml	Fri Jun 10 11:40:02 2016 -0700
+++ b/make/idea/template/build.xml	Fri Jun 10 15:03:10 2016 -0700
@@ -16,6 +16,10 @@
         <os family="windows"/>
     </condition>
 
+    <target name="-check-jtreg.home" depends="-def-check">
+        <check name="jtreg" property="jtreg.home" marker="lib/jtreg.jar"/>
+    </target>
+
     <property name="test.dir" value="${basedir}/jdk/test"/>
 
     <macrodef name="call-make">
@@ -29,26 +33,6 @@
             </sequential>
         </macrodef>
 
-    <macrodef name="exec-target">
-        <attribute name="antfile" default="${ant.file}" />
-        <attribute name="target" />
-        <sequential>
-            <java classname="org.apache.tools.ant.Main" fork="true" spawn="true">
-                <arg value="-f"/>
-                <arg value="@{antfile}"/>  
-                <arg value="-Dboot.java.home=${boot.java.home}"/>
-                <arg value="-Dbuild.target.dir=${build.target.dir}"/>
-                <arg value="-Djtreg.home=${jtreg.home}"/>
-                <arg value="-Djtreg.tests=${jtreg.tests}"/>
-                <arg value="-Djtreg.jpda.jvmargs=${jtreg.jpda.jvmargs}"/>
-                <arg value="@{target}"/>
-                <classpath>           
-                    <pathelement path="${java.class.path}"/>
-                </classpath>
-            </java>
-        </sequential>
-    </macrodef>
-
     <target name="post-make" depends="build-module"/>
 
     <!--
@@ -59,7 +43,7 @@
         <echo message="base = ${basedir}"/>
         <call-make dir = "${build.target.dir}" args = "clean"/>
     </target>
-    
+
     <target name="-do-configure">
         <echo message="base = ${basedir}"/>
         <fail message="Not part of a full JDK forest">
@@ -122,5 +106,68 @@
             </sequential>
         </macrodef>
     </target>
+
+    <macrodef name="exec-target">
+        <attribute name="antfile" default="${ant.file}" />
+        <attribute name="target" />
+        <sequential>
+            <java classname="org.apache.tools.ant.Main" fork="true" spawn="true">
+                <arg value="-f"/>
+                <arg value="@{antfile}"/>
+                <arg value="-Dbuild.target.dir=${build.target.dir}"/>
+                <arg value="-Djtreg.home=${jtreg.home}"/>
+                <arg value="-Djtreg.tests=${jtreg.tests}"/>
+                <arg value="-Djtreg.jpda.jvmargs=${jtreg.jpda.jvmargs}"/>
+                <arg value="@{target}"/>
+                <classpath>
+                    <pathelement path="${java.class.path}"/>
+                </classpath>
+            </java>
+        </sequential>
+    </macrodef>
+
+    <target name="jtreg" depends="images,-def-jtreg">
+        <jtreg-tool name="all" tests="${jtreg.tests}"/>
+    </target>
+
+    <target name="-def-jtreg" unless="jtreg.defined" depends="-check-jtreg.home">
+        <taskdef name="jtreg" classname="com.sun.javatest.regtest.Main$$Ant">
+            <classpath>
+                <pathelement location="${jtreg.home}/lib/jtreg.jar"/>
+                <pathelement location="${jtreg.home}/lib/javatest.jar"/>
+            </classpath>
+        </taskdef>
+        <macrodef name="jtreg-tool">
+            <attribute name="name"/>
+            <attribute name="tests"/>
+            <attribute name="jdk" default="${build.target.dir}/images/jdk"/>
+            <attribute name="agentvm" default="true"/>
+            <attribute name="verbose" default="${default.jtreg.verbose}"/>
+            <attribute name="options" default="${other.jtreg.options}"/>
+            <attribute name="keywords" default="-keywords:!ignore"/>
+            <attribute name="jpda.jvmargs" default=""/>
+            <attribute name="extra.jvmargs" default=""/>
+            <attribute name="build.modules" default="${build.modules}"/>
+            <sequential>
+                <property name="coverage.options" value=""/>              <!-- default -->
+                <property name="coverage.classpath" value=""/>            <!-- default -->
+                <property name="default.jtreg.verbose" value="summary"/>  <!-- default -->
+                <property name="other.jtreg.options" value=""/>           <!-- default -->
+                <property name="jtreg.classfiles.to.modules" value="@{agentvm}"/>
+                <jtreg
+                    dir="${test.dir}"
+                    workDir="${build.target.dir}/idea/@{name}/work"
+                    reportDir="${build.target.dir}/idea/@{name}/report"
+                    jdk="@{jdk}"
+                    agentvm="@{agentvm}" verbose="@{verbose}"
+                    failonerror="false" resultproperty="jtreg.@{name}.result">
+                    <arg value="-debug:@{jpda.jvmargs}"/>
+                    <arg line="@{keywords}"/>
+                    <arg line="@{options}"/>
+                    <arg line="@{tests}"/>
+                </jtreg>
+            </sequential>
+        </macrodef>
+        <property name="jtreg.defined" value="true"/>
+    </target>
 </project>
-
--- a/make/idea/template/src/idea/JdkIdeaAntLogger.java	Fri Jun 10 11:40:02 2016 -0700
+++ b/make/idea/template/src/idea/JdkIdeaAntLogger.java	Fri Jun 10 15:03:10 2016 -0700
@@ -99,7 +99,9 @@
         /** jtreg test failure */
         JTREG_TEST_FAILED(StringBinaryPredicate.STARTS_WITH, MSG_ERR, "FAILED: "),
         /** jtreg test error */
-        JTREG_TEST_ERROR(StringBinaryPredicate.STARTS_WITH, MSG_ERR, "Error: ");
+        JTREG_TEST_ERROR(StringBinaryPredicate.STARTS_WITH, MSG_ERR, "Error: "),
+        /** jtreg report */
+        JTREG_TEST_REPORT(StringBinaryPredicate.STARTS_WITH, MSG_INFO, "Report written");
 
         StringBinaryPredicate sbp;
         int priority;
@@ -132,7 +134,7 @@
         MAKE("exec", MessageKind.MAKE_ERROR, MessageKind.MAKE_WARNING, MessageKind.MAKE_NOTE,
                        MessageKind.MAKE_OTHER, MessageKind.JAVAC_CRASH),
         /** jtreg task - invoked during test execution */
-        JTREG("jtreg", MessageKind.JTREG_TEST_PASSED, MessageKind.JTREG_TEST_FAILED, MessageKind.JTREG_TEST_ERROR),
+        JTREG("jtreg", MessageKind.JTREG_TEST_PASSED, MessageKind.JTREG_TEST_FAILED, MessageKind.JTREG_TEST_ERROR, MessageKind.JTREG_TEST_REPORT),
         /** initial synthetic task when the logger is created */
         ROOT("") {
             @Override
--- a/make/idea/template/workspace.xml	Fri Jun 10 11:40:02 2016 -0700
+++ b/make/idea/template/workspace.xml	Fri Jun 10 15:03:10 2016 -0700
@@ -8,6 +8,14 @@
   <component name="StructureViewFactory">
     <option name="ACTIVE_ACTIONS" value=",ALPHA_COMPARATOR" />
   </component>
+  <component name="RunManager" selected="Ant Target.jtreg">
+    <configuration default="false" name="jtreg" type="AntRunConfiguration" factoryName="Ant Target">
+      <antsettings antfile="file://$PROJECT_DIR$/.idea/build.xml" target="jtreg" />
+      <method>
+        <option name="Make" enabled="false" />
+      </method>
+    </configuration>
+  </component>
   <component name="antWorkspaceConfiguration">
     <option name="IS_AUTOSCROLL_TO_SOURCE" value="false" />
     <option name="FILTER_TARGETS" value="false" />
--- a/make/jprt.properties	Fri Jun 10 11:40:02 2016 -0700
+++ b/make/jprt.properties	Fri Jun 10 15:03:10 2016 -0700
@@ -75,7 +75,7 @@
 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}
+jprt.run.flavors=c2,default,${my.additional.run.flavors}
 
 # Setup jib profiles
 jprt.linux_i586.product.build.jib.profile=linux-x86
@@ -194,23 +194,24 @@
 my.build.flavors.default=fastdebug,product
 
 # Standard list of jprt build targets for this source tree
-my.build.targets.default=						\
-    solaris_sparcv9_5.11-{product|fastdebug},				\
-    solaris_x64_5.11-{product|fastdebug},				\
-    linux_i586_3.8-{product|fastdebug},					\
-    linux_x64_3.8-{product|fastdebug},					\
-    macosx_x64_10.9-{product|fastdebug},				\
-    windows_i586_6.3-{product|fastdebug},				\
-    windows_x64_6.3-{product|fastdebug}
+my.build.targets.default= \
+    solaris_sparcv9_5.11-{product|fastdebug}, \
+    solaris_x64_5.11-{product|fastdebug}, \
+    linux_i586_3.8-{product|fastdebug}, \
+    linux_x64_3.8-{product|fastdebug}, \
+    macosx_x64_10.9-{product|fastdebug}, \
+    windows_i586_6.3-{product|fastdebug}, \
+    windows_x64_6.3-{product|fastdebug}, \
+    ${my.additional.build.targets.default}
 
 # Test target list (no fastdebug & limited c2 testing)
 my.test.target.set=							\
     solaris_sparcv9_5.11-product-c2-TESTNAME,				\
     solaris_x64_5.11-product-c2-TESTNAME,				\
-    linux_i586_3.8-product-{c1|c2}-TESTNAME,				\
+    linux_i586_3.8-product-c2-TESTNAME, 				\
     linux_x64_3.8-product-c2-TESTNAME,					\
     macosx_x64_10.9-product-c2-TESTNAME,				\
-    windows_i586_6.3-product-c1-TESTNAME,				\
+    windows_i586_6.3-product-c2-TESTNAME,				\
     windows_x64_6.3-product-c2-TESTNAME
 
 # Default vm test targets (testset=default)
@@ -295,7 +296,7 @@
 my.test.target.set.jck=							\
     solaris_sparcv9_5.11-product-c2-JCK7TESTRULE,			\
     solaris_x64_5.11-product-c2-JCK7TESTRULE,				\
-    linux_i586_3.8-product-c1-JCK7TESTRULE,				\
+    linux_i586_3.8-product-c2-JCK7TESTRULE,				\
     linux_x64_3.8-product-c2-JCK7TESTRULE
 
 # JCK testset targets
--- a/test/lib/sun/hotspot/WhiteBox.java	Fri Jun 10 11:40:02 2016 -0700
+++ b/test/lib/sun/hotspot/WhiteBox.java	Fri Jun 10 15:03:10 2016 -0700
@@ -378,6 +378,12 @@
   public native long metaspaceCapacityUntilGC();
   public native boolean metaspaceShouldConcurrentCollect();
 
+  // Don't use these methods directly
+  // Use sun.hotspot.gc.GC class instead.
+  public native int currentGC();
+  public native int allSupportedGC();
+  public native boolean gcSelectedByErgo();
+
   // Force Young GC
   public native void youngGC();
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/lib/sun/hotspot/gc/GC.java	Fri Jun 10 15:03:10 2016 -0700
@@ -0,0 +1,104 @@
+/*
+ * 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.
+ *
+ */
+
+package sun.hotspot.gc;
+
+import java.util.ArrayList;
+import java.util.List;
+import sun.hotspot.WhiteBox;
+
+/**
+ * API to obtain information about selected and supported Garbage Collectors
+ * retrieved from the VM with the WhiteBox API.
+ */
+public enum GC {
+    Serial(1),
+    Parallel(2),
+    ConcMarkSweep(4),
+    G1(8);
+
+    private static final GC CURRENT_GC;
+    private static final int ALL_GC_CODES;
+    private static final boolean IS_BY_ERGO;
+    static {
+        WhiteBox WB = WhiteBox.getWhiteBox();
+        ALL_GC_CODES = WB.allSupportedGC();
+        IS_BY_ERGO = WB.gcSelectedByErgo();
+
+        int currentCode = WB.currentGC();
+        GC tmp = null;
+        for (GC gc: GC.values()) {
+            if (gc.code == currentCode) {
+                tmp = gc;
+                break;
+            }
+        }
+        if (tmp == null) {
+            throw new Error("Unknown current GC code " + currentCode);
+        }
+        CURRENT_GC = tmp;
+    }
+
+    private final int code;
+    private GC(int code) {
+        this.code = code;
+    }
+
+    /**
+     * @return true if the collector is supported by the VM, false otherwise.
+     */
+    public boolean isSupported() {
+        return (ALL_GC_CODES & code) != 0;
+    }
+
+
+    /**
+     * @return the current collector used by VM.
+     */
+    public static GC current() {
+        return CURRENT_GC;
+    }
+
+    /**
+     * @return true if GC was selected by ergonomic, false if specified
+     * explicitly by the command line flag.
+     */
+    public static boolean currentSetByErgo() {
+        return IS_BY_ERGO;
+    }
+
+    /**
+     * @return List of collectors supported by the VM.
+     */
+    public static List<GC> allSupported() {
+        List<GC> list = new ArrayList<>();
+        for (GC gc: GC.values()) {
+            if (gc.isSupported()) {
+                list.add(gc);
+            }
+        }
+        return list;
+    }
+}
+