Merge
authorduke
Wed, 05 Jul 2017 21:35:07 +0200
changeset 37302 cf820d974c75
parent 37301 a936b4e01afb (current diff)
parent 37037 4fbd14764fa7 (diff)
child 37374 ee1b8619eddb
Merge
test/failure_handler/src/windows/native/jdk/test/failurehandler/jtreg/GatherProcessInfoTimeoutHandler.c
--- a/.hgtags-top-repo	Fri Apr 15 16:19:15 2016 +0100
+++ b/.hgtags-top-repo	Wed Jul 05 21:35:07 2017 +0200
@@ -356,3 +356,4 @@
 f900d5afd9c83a0df8f36161c27c5e4c86a66f4c jdk-9+111
 03543a758cd5890f2266e4b9678378a925dde22a jdk-9+112
 55b6d550828d1223b364e6ead4a56e56411c56df jdk-9+113
+1d992540870ff33fe6cc550443388588df9b9e4f jdk-9+114
--- a/common/autoconf/boot-jdk.m4	Fri Apr 15 16:19:15 2016 +0100
+++ b/common/autoconf/boot-jdk.m4	Wed Jul 05 21:35:07 2017 +0200
@@ -305,7 +305,7 @@
   BOOT_JDK_SOURCETARGET="-source 8 -target 8"
   AC_SUBST(BOOT_JDK_SOURCETARGET)
 
-  ADD_JVM_ARG_IF_OK([-Xpatch:], dummy, [$JAVA])
+  ADD_JVM_ARG_IF_OK([-Xpatch:foo=bar], dummy, [$JAVA])
   AC_MSG_CHECKING([if Boot JDK supports modules])
   if test "x$JVM_ARG_OK" = "xtrue"; then
     AC_MSG_RESULT([yes])
@@ -444,9 +444,9 @@
         BUILD_JDK_VERSION=`"$BUILD_JDK/bin/java" -version 2>&1 | head -n 1`
 
         # Extra M4 quote needed to protect [] in grep expression.
-        [FOUND_CORRECT_VERSION=`echo $BUILD_JDK_VERSION | grep  '\"1\.[9]\.'`]
+        [FOUND_CORRECT_VERSION=`echo $BUILD_JDK_VERSION | $EGREP '\"9([\.+-].*)?\"'`]
         if test "x$FOUND_CORRECT_VERSION" = x; then
-          AC_MSG_NOTICE([Potential Boot JDK found at $BUILD_JDK is incorrect JDK version ($BUILD_JDK_VERSION); ignoring])
+          AC_MSG_NOTICE([Potential Build JDK found at $BUILD_JDK is incorrect JDK version ($BUILD_JDK_VERSION); ignoring])
           AC_MSG_NOTICE([(Your Build JDK must be version 9)])
           BUILD_JDK_FOUND=no
         else
--- a/common/autoconf/build-performance.m4	Fri Apr 15 16:19:15 2016 +0100
+++ b/common/autoconf/build-performance.m4	Wed Jul 05 21:35:07 2017 +0200
@@ -454,7 +454,7 @@
   AC_MSG_RESULT([$ENABLE_JAVAC_SERVER])
   AC_SUBST(ENABLE_JAVAC_SERVER)
 
-  if test "x$ENABLE_JAVAC_SERVER" = "xyes" || "x$ENABLE_SJAVAC" = "xyes"; then
+  if test "x$ENABLE_JAVAC_SERVER" = "xyes" || test "x$ENABLE_SJAVAC" = "xyes"; then
     # When using a server javac, the small client instances do not need much
     # resources.
     JAVA_FLAGS_JAVAC="$JAVA_FLAGS_SMALL"
--- a/common/autoconf/configure.ac	Fri Apr 15 16:19:15 2016 +0100
+++ b/common/autoconf/configure.ac	Wed Jul 05 21:35:07 2017 +0200
@@ -227,6 +227,7 @@
 
 HOTSPOT_SETUP_BUILD_TWEAKS
 JDKOPT_DETECT_INTREE_EC
+JDKOPT_ENABLE_DISABLE_FAILURE_HANDLER
 
 ###############################################################################
 #
--- a/common/autoconf/generated-configure.sh	Fri Apr 15 16:19:15 2016 +0100
+++ b/common/autoconf/generated-configure.sh	Wed Jul 05 21:35:07 2017 +0200
@@ -650,6 +650,7 @@
 JOBS
 MEMORY_SIZE
 NUM_CORES
+BUILD_FAILURE_HANDLER
 ENABLE_INTREE_EC
 HOTSPOT_MAKE_ARGS
 LIBZIP_CAN_USE_MMAP
@@ -1172,6 +1173,7 @@
 with_dxsdk
 with_dxsdk_lib
 with_dxsdk_include
+enable_jtreg_failure_handler
 with_num_cores
 with_memory_size
 with_jobs
@@ -1940,6 +1942,12 @@
                           disable bundling of the freetype library with the
                           build result [enabled on Windows or when using
                           --with-freetype, disabled otherwise]
+  --enable-jtreg-failure-handler
+                          forces build of the jtreg failure handler to be
+                          enabled, missing dependencies become fatal errors.
+                          Default is auto, where the failure handler is built
+                          if all dependencies are present and otherwise just
+                          disabled.
   --enable-sjavac         use sjavac to do fast incremental compiles
                           [disabled]
   --disable-javac-server  disable javac server [enabled]
@@ -4274,6 +4282,12 @@
 #
 
 
+################################################################################
+#
+# Check if building of the jtreg failure handler should be enabled.
+#
+
+
 #
 # Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -4950,7 +4964,7 @@
 #CUSTOM_AUTOCONF_INCLUDE
 
 # Do not change or remove the following line, it is needed for consistency checks:
-DATE_WHEN_GENERATED=1458755892
+DATE_WHEN_GENERATED=1460963400
 
 ###############################################################################
 #
@@ -29770,13 +29784,13 @@
 
 
 
-  $ECHO "Check if jvm arg is ok: -Xpatch:" >&5
-  $ECHO "Command: $JAVA -Xpatch: -version" >&5
-  OUTPUT=`$JAVA -Xpatch: -version 2>&1`
+  $ECHO "Check if jvm arg is ok: -Xpatch:foo=bar" >&5
+  $ECHO "Command: $JAVA -Xpatch:foo=bar -version" >&5
+  OUTPUT=`$JAVA -Xpatch:foo=bar -version 2>&1`
   FOUND_WARN=`$ECHO "$OUTPUT" | grep -i warn`
   FOUND_VERSION=`$ECHO $OUTPUT | grep " version \""`
   if test "x$FOUND_VERSION" != x && test "x$FOUND_WARN" = x; then
-    dummy="$dummy -Xpatch:"
+    dummy="$dummy -Xpatch:foo=bar"
     JVM_ARG_OK=true
   else
     $ECHO "Arg failed:" >&5
@@ -29856,10 +29870,10 @@
         BUILD_JDK_VERSION=`"$BUILD_JDK/bin/java" -version 2>&1 | head -n 1`
 
         # Extra M4 quote needed to protect [] in grep expression.
-        FOUND_CORRECT_VERSION=`echo $BUILD_JDK_VERSION | grep  '\"1\.[9]\.'`
+        FOUND_CORRECT_VERSION=`echo $BUILD_JDK_VERSION | $EGREP '\"9([\.+-].*)?\"'`
         if test "x$FOUND_CORRECT_VERSION" = x; then
-          { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BUILD_JDK is incorrect JDK version ($BUILD_JDK_VERSION); ignoring" >&5
-$as_echo "$as_me: Potential Boot JDK found at $BUILD_JDK is incorrect JDK version ($BUILD_JDK_VERSION); ignoring" >&6;}
+          { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Build JDK found at $BUILD_JDK is incorrect JDK version ($BUILD_JDK_VERSION); ignoring" >&5
+$as_echo "$as_me: Potential Build JDK found at $BUILD_JDK is incorrect JDK version ($BUILD_JDK_VERSION); ignoring" >&6;}
           { $as_echo "$as_me:${as_lineno-$LINENO}: (Your Build JDK must be version 9)" >&5
 $as_echo "$as_me: (Your Build JDK must be version 9)" >&6;}
           BUILD_JDK_FOUND=no
@@ -62037,6 +62051,45 @@
 
 
 
+  # Check whether --enable-jtreg-failure-handler was given.
+if test "${enable_jtreg_failure_handler+set}" = set; then :
+  enableval=$enable_jtreg_failure_handler;
+fi
+
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking if jtreg failure handler should be built" >&5
+$as_echo_n "checking if jtreg failure handler should be built... " >&6; }
+
+  if test "x$enable_jtreg_failure_handler" = "xyes"; then
+    if test "x$JT_HOME" = "x"; then
+      as_fn_error $? "Cannot enable jtreg failure handler without jtreg." "$LINENO" 5
+    else
+      BUILD_FAILURE_HANDLER=true
+      { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes, forced" >&5
+$as_echo "yes, forced" >&6; }
+    fi
+  elif test "x$enable_jtreg_failure_handler" = "xno"; then
+    BUILD_FAILURE_HANDLER=false
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, forced" >&5
+$as_echo "no, forced" >&6; }
+  elif test "x$enable_jtreg_failure_handler" = "xauto" \
+      || test "x$enable_jtreg_failure_handler" = "x"; then
+    if test "x$JT_HOME" = "x"; then
+      BUILD_FAILURE_HANDLER=false
+      { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, missing jtreg" >&5
+$as_echo "no, missing jtreg" >&6; }
+    else
+      BUILD_FAILURE_HANDLER=true
+      { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes, jtreg present" >&5
+$as_echo "yes, jtreg present" >&6; }
+    fi
+  else
+    as_fn_error $? "Invalid value for --enable-jtreg-failure-handler: $enable_jtreg_failure_handler" "$LINENO" 5
+  fi
+
+
+
+
 ###############################################################################
 #
 # Configure parts of the build that only affect the build performance,
@@ -62510,7 +62563,7 @@
 $as_echo "$ENABLE_JAVAC_SERVER" >&6; }
 
 
-  if test "x$ENABLE_JAVAC_SERVER" = "xyes" || "x$ENABLE_SJAVAC" = "xyes"; then
+  if test "x$ENABLE_JAVAC_SERVER" = "xyes" || test "x$ENABLE_SJAVAC" = "xyes"; then
     # When using a server javac, the small client instances do not need much
     # resources.
     JAVA_FLAGS_JAVAC="$JAVA_FLAGS_SMALL"
--- a/common/autoconf/jdk-options.m4	Fri Apr 15 16:19:15 2016 +0100
+++ b/common/autoconf/jdk-options.m4	Wed Jul 05 21:35:07 2017 +0200
@@ -408,7 +408,7 @@
 
 ################################################################################
 #
-# jlink options. 
+# jlink options.
 # We always keep packaged modules in JDK image.
 #
 AC_DEFUN_ONCE([JDKOPT_SETUP_JLINK_OPTIONS],
@@ -433,3 +433,42 @@
 
   AC_SUBST(JLINK_KEEP_PACKAGED_MODULES)
 ])
+
+################################################################################
+#
+# Check if building of the jtreg failure handler should be enabled.
+#
+AC_DEFUN_ONCE([JDKOPT_ENABLE_DISABLE_FAILURE_HANDLER],
+[
+  AC_ARG_ENABLE([jtreg-failure-handler], [AS_HELP_STRING([--enable-jtreg-failure-handler],
+    [forces build of the jtreg failure handler to be enabled, missing dependencies
+     become fatal errors. Default is auto, where the failure handler is built if all
+     dependencies are present and otherwise just disabled.])])
+
+  AC_MSG_CHECKING([if jtreg failure handler should be built])
+
+  if test "x$enable_jtreg_failure_handler" = "xyes"; then
+    if test "x$JT_HOME" = "x"; then
+      AC_MSG_ERROR([Cannot enable jtreg failure handler without jtreg.])
+    else
+      BUILD_FAILURE_HANDLER=true
+      AC_MSG_RESULT([yes, forced])
+    fi
+  elif test "x$enable_jtreg_failure_handler" = "xno"; then
+    BUILD_FAILURE_HANDLER=false
+    AC_MSG_RESULT([no, forced])
+  elif test "x$enable_jtreg_failure_handler" = "xauto" \
+      || test "x$enable_jtreg_failure_handler" = "x"; then
+    if test "x$JT_HOME" = "x"; then
+      BUILD_FAILURE_HANDLER=false
+      AC_MSG_RESULT([no, missing jtreg])
+    else
+      BUILD_FAILURE_HANDLER=true
+      AC_MSG_RESULT([yes, jtreg present])
+    fi
+  else
+    AC_MSG_ERROR([Invalid value for --enable-jtreg-failure-handler: $enable_jtreg_failure_handler])
+  fi
+
+  AC_SUBST(BUILD_FAILURE_HANDLER)
+])
--- a/common/autoconf/spec.gmk.in	Fri Apr 15 16:19:15 2016 +0100
+++ b/common/autoconf/spec.gmk.in	Wed Jul 05 21:35:07 2017 +0200
@@ -260,6 +260,8 @@
 
 BUILD_HOTSPOT=@BUILD_HOTSPOT@
 
+BUILD_FAILURE_HANDLER := @BUILD_FAILURE_HANDLER@
+
 # The boot jdk to use. This is overridden in bootcycle-spec.gmk. Make sure to keep
 # it in sync.
 BOOT_JDK:=@BOOT_JDK@
--- a/common/bin/compare.sh	Fri Apr 15 16:19:15 2016 +0100
+++ b/common/bin/compare.sh	Wed Jul 05 21:35:07 2017 +0200
@@ -41,7 +41,7 @@
     STAT_PRINT_SIZE="-f %z"
 elif [ "$OPENJDK_TARGET_OS" = "windows" ]; then
     FULLDUMP_CMD="$DUMPBIN -all"
-    LDD_CMD="$DUMPBIN -dependants | $GREP .dll"
+    LDD_CMD="$DUMPBIN -dependents"
     DIS_CMD="$DUMPBIN -disasm:nobytes"
     STAT_PRINT_SIZE="-c %s"
 elif [ "$OPENJDK_TARGET_OS" = "aix" ]; then
@@ -824,12 +824,25 @@
 
     # Check dependencies
     if [ -n "$LDD_CMD" ]; then
-        (cd $FILE_WORK_DIR && $CP $OTHER_FILE . && $LDD_CMD $NAME 2>/dev/null | $AWK '{ print $1;}' | $SORT | $TEE $WORK_FILE_BASE.deps.other | $UNIQ > $WORK_FILE_BASE.deps.other.uniq)
-        (cd $FILE_WORK_DIR && $CP $THIS_FILE . && $LDD_CMD $NAME 2</dev/null | $AWK '{ print $1;}' | $SORT | $TEE $WORK_FILE_BASE.deps.this | $UNIQ > $WORK_FILE_BASE.deps.this.uniq)
+        if [ "$OPENJDK_TARGET_OS" = "windows" ]; then
+            LDD_FILTER="$GREP \.dll"
+        else
+            LDD_FILTER="$CAT"
+        fi
+        (cd $FILE_WORK_DIR && $CP $OTHER_FILE . && $LDD_CMD $NAME 2>/dev/null \
+                    | $LDD_FILTER | $AWK '{ print $1;}' | $SORT \
+                    | $TEE $WORK_FILE_BASE.deps.other \
+                    | $UNIQ > $WORK_FILE_BASE.deps.other.uniq)
+        (cd $FILE_WORK_DIR && $CP $THIS_FILE . && $LDD_CMD $NAME 2</dev/null \
+                    | $LDD_FILTER | $AWK '{ print $1;}' | $SORT \
+                    | $TEE $WORK_FILE_BASE.deps.this \
+                    | $UNIQ > $WORK_FILE_BASE.deps.this.uniq)
         (cd $FILE_WORK_DIR && $RM -f $NAME)
 
-        LC_ALL=C $DIFF $WORK_FILE_BASE.deps.other $WORK_FILE_BASE.deps.this > $WORK_FILE_BASE.deps.diff
-        LC_ALL=C $DIFF $WORK_FILE_BASE.deps.other.uniq $WORK_FILE_BASE.deps.this.uniq > $WORK_FILE_BASE.deps.diff.uniq
+        LC_ALL=C $DIFF $WORK_FILE_BASE.deps.other $WORK_FILE_BASE.deps.this \
+              > $WORK_FILE_BASE.deps.diff
+        LC_ALL=C $DIFF $WORK_FILE_BASE.deps.other.uniq $WORK_FILE_BASE.deps.this.uniq \
+              > $WORK_FILE_BASE.deps.diff.uniq
 
         if [ -s $WORK_FILE_BASE.deps.diff ]; then
             if [ -s $WORK_FILE_BASE.deps.diff.uniq ]; then
--- a/common/conf/jib-profiles.js	Fri Apr 15 16:19:15 2016 +0100
+++ b/common/conf/jib-profiles.js	Wed Jul 05 21:35:07 2017 +0200
@@ -214,7 +214,7 @@
 var getJibProfilesCommon = function (input) {
     var common = {
         dependencies: ["boot_jdk", "gnumake", "jtreg"],
-        configure_args: ["--with-default-make-target=all"],
+        configure_args: ["--with-default-make-target=all", "--enable-jtreg-failure-handler"],
         configure_args_32bit: ["--with-target-bits=32", "--with-jvm-variants=client,server"],
         configure_args_debug: ["--enable-debug"],
         configure_args_slowdebug: ["--with-debug-level=slowdebug"],
--- a/make/CompileJavaModules.gmk	Fri Apr 15 16:19:15 2016 +0100
+++ b/make/CompileJavaModules.gmk	Wed Jul 05 21:35:07 2017 +0200
@@ -469,32 +469,7 @@
 ################################################################################
 # Setup the compilation for the module
 #
-# Order src dirs in order of override with the most important first. Generated
-# source before static source and platform specific source before shared.
-#
-GENERATED_SRC_DIRS += \
-    $(SUPPORT_OUTPUTDIR)/gensrc \
-    #
-
-TOP_SRC_DIRS += \
-    $(HOTSPOT_TOPDIR)/src \
-    $(CORBA_TOPDIR)/src \
-    $(JDK_TOPDIR)/src \
-    $(LANGTOOLS_TOPDIR)/src \
-    $(JAXP_TOPDIR)/src \
-    $(JAXWS_TOPDIR)/src \
-    $(NASHORN_TOPDIR)/src \
-    #
-
-SRC_SUBDIRS += $(OPENJDK_TARGET_OS)/classes
-ifneq ($(OPENJDK_TARGET_OS), $(OPENJDK_TARGET_OS_TYPE))
-  SRC_SUBDIRS += $(OPENJDK_TARGET_OS_TYPE)/classes
-endif
-SRC_SUBDIRS += share/classes
-
-MODULE_SRC_DIRS := $(strip \
-    $(addsuffix /$(MODULE), $(GENERATED_SRC_DIRS) $(IMPORT_MODULES_SRC)) \
-    $(foreach sub, $(SRC_SUBDIRS), $(addsuffix /$(MODULE)/$(sub), $(TOP_SRC_DIRS))))
+MODULE_SRC_DIRS := $(call FindModuleSrcDirs, $(MODULE))
 
 # The JDK_USER_DEFINED_FILTER is a poor man's incremental build: by specifying
 # JDK_FILTER at the make command line, only a subset of the JDK java files will
@@ -502,27 +477,20 @@
 # space separated list.
 JDK_USER_DEFINED_FILTER := $(strip $(subst $(COMMA),$(SPACE), $(JDK_FILTER)))
 
-# Rewrite the MODULE_SRC_DIRS with a wildcard for the module so that all module
-# source dirs are available on the path.
-MODULESOURCEPATH := $(subst $(SPACE),$(PATH_SEP),$(subst $(MODULE),*,$(MODULE_SRC_DIRS)))
+# Get the complete module source path.
+MODULESOURCEPATH := $(call GetModuleSrcPath)
 
-# Add imported modules to the moduleclasspath
-MODULECLASSPATH := $(subst $(SPACE),$(PATH_SEP), $(IMPORT_MODULES_CLASSES))
+# Add imported modules to the modulepath
+MODULEPATH := $(call PathList, $(IMPORT_MODULES_CLASSES))
 
 ifeq ($(MODULE), jdk.vm.ci)
   ## WORKAROUND jdk.vm.ci source structure issue
   JVMCI_MODULESOURCEPATH := $(MODULESOURCEPATH) \
       $(subst /$(MODULE)/,/*/, $(filter-out %processor/src, \
           $(wildcard $(HOTSPOT_TOPDIR)/src/jdk.vm.ci/share/classes/*/src)))
-  MODULESOURCEPATH := $(subst $(SPACE),$(PATH_SEP), $(JVMCI_MODULESOURCEPATH))
+  MODULESOURCEPATH := $(call PathList, $(JVMCI_MODULESOURCEPATH))
 endif
 
-# Make sure the generated source base dirs exist. Not all modules have generated
-# source in all of these directories and because of timing, all of them might not
-# exist at the time this makefile gets called. Javac will complain if there are
-# missing directories in the moduleclasspath.
-$(call MakeDir, $(GENERATED_SRC_DIRS))
-
 $(eval $(call SetupJavaCompilation, $(MODULE), \
     SETUP := $(if $($(MODULE)_SETUP), $($(MODULE)_SETUP), GENERATE_JDKBYTECODE), \
     MODULE := $(MODULE), \
@@ -532,8 +500,8 @@
     HEADERS := $(SUPPORT_OUTPUTDIR)/headers, \
     ADD_JAVAC_FLAGS := \
         $($(MODULE)_ADD_JAVAC_FLAGS) \
-        -modulesourcepath "$(MODULESOURCEPATH)" \
-        $(if $(MODULECLASSPATH), -modulepath "$(MODULECLASSPATH)") \
+        -modulesourcepath $(MODULESOURCEPATH) \
+        -modulepath $(MODULEPATH) \
         -system none, \
 ))
 
@@ -574,8 +542,9 @@
 ifneq ($(wildcard $(IMPORT_MODULES_CLASSES)/$(MODULE)), )
   $(JDK_OUTPUTDIR)/modules/$(MODULE)/_imported.marker: \
       $(call CacheFind, $(IMPORT_MODULES_CLASSES)/$(MODULE))
-	$(RM) -r $(@D)
-	$(MKDIR) -p $(@D)
+	$(call MakeDir, $(@D))
+        # Do not delete marker and build meta data files
+	$(RM) -r $(filter-out $(@D)/_%, $(wildcard $(@D)/*))
 	$(CP) -R $(IMPORT_MODULES_CLASSES)/$(MODULE)/* $(@D)/
 	$(TOUCH) $@
 
--- a/make/GensrcModuleInfo.gmk	Fri Apr 15 16:19:15 2016 +0100
+++ b/make/GensrcModuleInfo.gmk	Wed Jul 05 21:35:07 2017 +0200
@@ -49,7 +49,6 @@
 include $(SPEC)
 include MakeBase.gmk
 include Modules.gmk
-#include TextFileProcessing.gmk
 
 ################################################################################
 # Define this here since jdk/make/Tools.gmk cannot be included from the top
@@ -64,25 +63,8 @@
 # Name of data file. Keep module-info.java.ext until javafx has changed.
 MOD_FILENAME := module-info.java.extra module-info.java.ext
 
-# List all the possible sub directories inside a module source directory where
-# data might be stored.
-CLASSES_SUBDIRS += $(OPENJDK_TARGET_OS)/classes
-ifneq ($(OPENJDK_TARGET_OS), $(OPENJDK_TARGET_OS_TYPE))
-  CLASSES_SUBDIRS += $(OPENJDK_TARGET_OS_TYPE)/classes
-endif
-CLASSES_SUBDIRS += share/classes
-
-# TODO: When the deploy build is better integrated, this will get added globally
-# but for now need to add it here.
-ifeq ($(BUILD_DEPLOY), true)
-  ALL_TOP_SRC_DIRS += $(DEPLOY_TOPDIR)/src
-endif
-
 # Construct all possible src directories for the module.
-MODULE_CLASSES_DIRS := $(strip \
-    $(foreach sub, $(CLASSES_SUBDIRS), \
-        $(addsuffix /$(MODULE)/$(sub), $(ALL_TOP_SRC_DIRS))) \
-    $(addsuffix /$(MODULE), $(IMPORT_MODULES_SRC)))
+MODULE_CLASSES_DIRS := $(call FindModuleSrcDirs, $(MODULE))
 
 # Find all the .extra files in the src dirs.
 MOD_FILES := $(wildcard $(foreach f, $(MOD_FILENAME), $(addsuffix /$(f), \
@@ -125,20 +107,6 @@
     TARGETS += $(SUPPORT_OUTPUTDIR)/gensrc/$(MODULE)/module-info.java
   endif
 
-# This doesn't work because javac only accepts one single exports line per
-# exported package.
-  # Restore the modifications to separate lines with spaces
-#  MODIFICATIONS := $(subst /,$(SPACE),$(MODIFICATIONS))
-
-#  ifneq ($(MODIFICATIONS), )
-#    $(eval $(call SetupTextFileProcessing, PROCESS_MODULE_INFO, \
-#        SOURCE_FILES := $(firstword $(call FindAllModuleInfos, $(MODULE))), \
-#        OUTPUT_FILE := $(SUPPORT_OUTPUTDIR)/gensrc/$(MODULE)/module-info.java, \
-#        REPLACEMENTS := } => $(MODIFICATIONS) }, \
-#    ))
-
-#    TARGETS += $(PROCESS_MODULE_INFO)
-#  endif
 endif
 
 # If no modifications are found for this module, remove any module-info.java
--- a/make/Javadoc.gmk	Fri Apr 15 16:19:15 2016 +0100
+++ b/make/Javadoc.gmk	Wed Jul 05 21:35:07 2017 +0200
@@ -235,6 +235,11 @@
 JRE_API_DOCSDIR = $(DOCSDIR)/jre/api
 PLATFORM_DOCSDIR = $(DOCSDIR)/platform
 
+JAVADOC_ARCHIVE_NAME := jdk-$(VERSION_STRING)-docs.zip
+JAVADOC_ARCHIVE_ASSEMBLY_DIR :=  $(DOCSTMPDIR)/zip-docs
+JAVADOC_ARCHIVE_DIR := $(OUTPUT_ROOT)/bundles
+JAVADOC_ARCHIVE := $(JAVADOC_ARCHIVE_DIR)/$(JAVADOC_ARCHIVE_NAME)
+
 # The core api index file is the target for the core api javadocs rule
 # and needs to be defined early so that all other javadoc rules may
 # depend on it.
@@ -378,6 +383,13 @@
 all: docs
 docs: coredocs otherdocs
 
+#
+# Optional target which bundles all generated javadocs into a zip archive.
+# The dependency on docs is handled in Main.gmk.
+#
+
+zip-docs: $(JAVADOC_ARCHIVE)
+
 #############################################################
 #
 # coredocs
@@ -1671,6 +1683,28 @@
 
 otherdocs: $(ALL_OTHER_TARGETS)
 
+#
+# Add the core docs as prerequisite to the archive to trigger a rebuild
+# if the core docs were rebuilt. Ideally any doc rebuild should trigger
+# this, but the way prerequisites are currently setup in this file, that
+# is hard to achieve.
+#
+
+$(JAVADOC_ARCHIVE): $(COREAPI_INDEX_FILE)
+	$(call LogInfo, Compressing javadoc to single $(JAVADOC_ARCHIVE_NAME))
+	$(MKDIR) -p $(JAVADOC_ARCHIVE_DIR)
+	$(RM) -r $(JAVADOC_ARCHIVE_ASSEMBLY_DIR)
+	$(MKDIR) -p $(JAVADOC_ARCHIVE_ASSEMBLY_DIR)
+	all_roots=`$(FIND) $(DOCSDIR) | $(GREP) index.html | grep -v old/doclet`; \
+	pushd $(JAVADOC_ARCHIVE_ASSEMBLY_DIR); \
+	for index_file in $${all_roots} ; do \
+	  target_dir=`dirname $${index_file}`; \
+	  name=`$(ECHO) $${target_dir} | $(SED) "s;/spec;;" | $(SED) "s;.*/;;"`; \
+	  $(LN) -s $${target_dir}  $${name}; \
+	done; \
+	$(ZIP) -q -r $(JAVADOC_ARCHIVE) * ; \
+	popd ;
+
 #############################################################
 .PHONY: all docs coredocs otherdocs \
-     $(ALL_OTHER_TARGETS)
+     $(ALL_OTHER_TARGETS) zip-docs
--- a/make/Main.gmk	Fri Apr 15 16:19:15 2016 +0100
+++ b/make/Main.gmk	Wed Jul 05 21:35:07 2017 +0200
@@ -333,6 +333,9 @@
 docs-jvmtidoc:
 	+($(CD) $(SRC_ROOT)/make && $(MAKE) $(MAKE_ARGS) -f Javadoc.gmk jvmtidocs)
 
+zip-docs: docs-javadoc docs-jvmtidoc
+	+($(CD) $(SRC_ROOT)/make && $(MAKE) $(MAKE_ARGS) -f Javadoc.gmk zip-docs)
+
 ALL_TARGETS += docs-javadoc docs-jvmtidoc
 
 ################################################################################
@@ -385,9 +388,27 @@
 build-test-lib:
 	+($(CD) $(TOPDIR)/make/test && $(MAKE) $(MAKE_ARGS) -f BuildTestLib.gmk)
 
+ifeq ($(BUILD_FAILURE_HANDLER), true)
+  # Builds the failure handler jtreg extension
+  build-test-failure-handler:
+	+($(CD) $(TOPDIR)/make/test && $(MAKE) $(MAKE_ARGS) \
+	    -f BuildFailureHandler.gmk build)
+
+  # Runs the tests for the failure handler jtreg extension
+  test-failure-handler:
+	+($(CD) $(TOPDIR)/make/test && $(MAKE) $(MAKE_ARGS) \
+	    -f BuildFailureHandler.gmk test)
+
+  # Copies the failure handler jtreg extension into the test image
+  test-image-failure-handler:
+	+($(CD) $(TOPDIR)/make/test && $(MAKE) $(MAKE_ARGS) \
+	     -f BuildFailureHandler.gmk images)
+endif
+
 ALL_TARGETS += prepare-test-image build-test-hotspot-jtreg-native \
     test-image-hotspot-jtreg-native build-test-jdk-jtreg-native \
-    test-image-jdk-jtreg-native build-test-lib
+    test-image-jdk-jtreg-native build-test-lib build-test-failure-handler \
+    test-failure-handler test-image-failure-handler
 
 ################################################################################
 # Run tests
@@ -582,6 +603,12 @@
 
   build-test-lib: java
 
+  build-test-failure-handler: interim-langtools
+
+  test-failure-handler: build-test-failure-handler
+
+  test-image-failure-handler: build-test-failure-handler
+
   build-test-hotspot-jtreg-native: buildtools-jdk
 
   build-test-jdk-jtreg-native: buildtools-jdk
@@ -667,11 +694,11 @@
 endif
 
 # This target builds the documentation image
-docs-image: docs-javadoc docs-jvmtidoc
+docs-image: zip-docs
 
 # This target builds the test image
 test-image: prepare-test-image test-image-hotspot-jtreg-native \
-    test-image-jdk-jtreg-native
+    test-image-jdk-jtreg-native test-image-failure-handler
 
 # all-images is the top-most target, it builds all our deliverables ("images").
 all-images: product-images test-image docs-image
@@ -691,7 +718,7 @@
 docs: docs-image
 all: all-images
 
-ALL_TARGETS += default jdk images docs all
+ALL_TARGETS += default jdk images docs all zip-docs
 
 ################################################################################
 ################################################################################
--- a/make/MainSupport.gmk	Fri Apr 15 16:19:15 2016 +0100
+++ b/make/MainSupport.gmk	Wed Jul 05 21:35:07 2017 +0200
@@ -104,6 +104,7 @@
 	@$(PRINTF) "\n" $(LOG_DEBUG)
 	$(RM) -r $(SUPPORT_OUTPUTDIR)/docs
 	$(RM) -r $(IMAGES_OUTPUTDIR)/docs
+	$(RM) $(OUTPUT_ROOT)/bundles/jdk-*-docs.zip
 	@$(PRINTF) " done\n"
 endef
 
--- a/make/common/MakeBase.gmk	Fri Apr 15 16:19:15 2016 +0100
+++ b/make/common/MakeBase.gmk	Wed Jul 05 21:35:07 2017 +0200
@@ -723,12 +723,13 @@
 endif
 
 ################################################################################
-# Return a string suitable for use after a -classpath option. It will correct and safe to use
-# on all platforms. Arguments are given as space separate classpath entries.
+# Return a string suitable for use after a -classpath or -modulepath option. It
+# will be correct and safe to use on all platforms. Arguments are given as space
+# separate classpath entries. Safe for multiple nested calls.
 # param 1 : A space separated list of classpath entries
 # The surrounding strip is needed to keep additional whitespace out
 PathList = \
-  "$(subst $(SPACE),$(PATH_SEP),$(strip $1))"
+  "$(subst $(SPACE),$(PATH_SEP),$(strip $(subst $(DQUOTE),,$1)))"
 
 ################################################################################
 
--- a/make/common/Modules.gmk	Fri Apr 15 16:19:15 2016 +0100
+++ b/make/common/Modules.gmk	Wed Jul 05 21:35:07 2017 +0200
@@ -138,26 +138,35 @@
 ################################################################################
 # Module list macros
 
-# Use append so that the custom extension may add to this variable
+# Use append so that the custom extension may add to these variables
 
-ALL_TOP_SRC_DIRS += \
+GENERATED_SRC_DIRS += \
+    $(SUPPORT_OUTPUTDIR)/gensrc \
+    #
+
+TOP_SRC_DIRS += \
+    $(CORBA_TOPDIR)/src \
     $(HOTSPOT_TOPDIR)/src \
     $(JDK_TOPDIR)/src \
     $(LANGTOOLS_TOPDIR)/src \
-    $(CORBA_TOPDIR)/src \
     $(JAXP_TOPDIR)/src \
     $(JAXWS_TOPDIR)/src \
     $(NASHORN_TOPDIR)/src \
     #
 
+SRC_SUBDIRS += $(OPENJDK_TARGET_OS)/classes
+ifneq ($(OPENJDK_TARGET_OS), $(OPENJDK_TARGET_OS_TYPE))
+  SRC_SUBDIRS += $(OPENJDK_TARGET_OS_TYPE)/classes
+endif
+SRC_SUBDIRS += share/classes
+
 # Find all module-info.java files for the current build target platform and
 # configuration.
 # Param 1 - Module to find for, set to * for finding all
 FindAllModuleInfos = \
     $(wildcard \
-        $(patsubst %,%/$(strip $1)/$(OPENJDK_TARGET_OS)/classes/module-info.java, $(ALL_TOP_SRC_DIRS)) \
-        $(patsubst %,%/$(strip $1)/$(OPENJDK_TARGET_OS_TYPE)/classes/module-info.java, $(ALL_TOP_SRC_DIRS)) \
-        $(patsubst %,%/$(strip $1)/share/classes/module-info.java, $(ALL_TOP_SRC_DIRS)) \
+        $(foreach sub, $(SRC_SUBDIRS), \
+          $(patsubst %,%/$(strip $1)/$(sub)/module-info.java, $(TOP_SRC_DIRS))) \
         $(patsubst %,%/$(strip $1)/module-info.java, $(IMPORT_MODULES_SRC)))
 
 # Extract the module names from the paths of module-info.java files. The
@@ -178,6 +187,19 @@
 FindImportedModules = \
     $(if $(IMPORT_MODULES_CLASSES), $(notdir $(wildcard $(IMPORT_MODULES_CLASSES)/*)))
 
+# Find all source dirs for a particular module
+# $1 - Module to find source dirs for
+FindModuleSrcDirs = \
+    $(strip $(wildcard \
+        $(addsuffix /$(strip $1), $(GENERATED_SRC_DIRS) $(IMPORT_MODULES_SRC)) \
+        $(foreach sub, $(SRC_SUBDIRS), $(addsuffix /$(strip $1)/$(sub), $(TOP_SRC_DIRS)))))
+
+# Construct the complete module source path
+GetModuleSrcPath = \
+    $(call PathList, \
+        $(addsuffix /*, $(GENERATED_SRC_DIRS) $(IMPORT_MODULES_SRC)) \
+        $(foreach sub, $(SRC_SUBDIRS), $(addsuffix /*/$(sub), $(TOP_SRC_DIRS))))
+
 ################################################################################
 # Extract module dependencies from module-info.java files.
 
--- a/make/jprt.properties	Fri Apr 15 16:19:15 2016 +0100
+++ b/make/jprt.properties	Wed Jul 05 21:35:07 2017 +0200
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2006, 2015, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2006, 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
@@ -311,13 +311,13 @@
 
 # Platforms built for hotspot push jobs
 my.build.targets.hotspot=						\
-    solaris_sparcv9_5.11-{product|fastdebug},			\
+    solaris_sparcv9_5.11-{product|fastdebug},				\
     solaris_x64_5.11-{product|fastdebug},				\
     linux_i586_3.8-{product|fastdebug},					\
-    linux_x64_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},			\
+    windows_x64_6.3-{product|fastdebug},				\
     solaris_x64_5.11-{fastdebugOpen},					\
     linux_x64_3.8-{productOpen},					\
     ${my.additional.build.targets.hotspot}
@@ -346,18 +346,15 @@
     solaris_x64_5.11-{product|fastdebug}-c2-GCBasher_G1
 
 my.test.targets.hotspot.linux.i586=					\
-    linux_i586_3.8-{product|fastdebug}-{c1|c2}-jvm98,			\
+    linux_i586_3.8-{product|fastdebug}-c2-jvm98,			\
     linux_i586_3.8-{product|fastdebug}-c2-jvm98_nontiered,		\
-    linux_i586_3.8-{product|fastdebug}-{c1|c2}-scimark,			\
-    linux_i586_3.8-product-c1-runThese8_Xcomp_lang,			\
-    linux_i586_3.8-product-c1-runThese8_Xcomp_vm,			\
-    linux_i586_3.8-fastdebug-c1-runThese8_Xshare,			\
+    linux_i586_3.8-{product|fastdebug}-c2-scimark,			\
     linux_i586_3.8-fastdebug-c2-runThese8_Xcomp_lang,			\
     linux_i586_3.8-fastdebug-c2-runThese8_Xcomp_vm,			\
-    linux_i586_3.8-{product|fastdebug}-{c1|c2}-GCBasher_SerialGC,	\
-    linux_i586_3.8-{product|fastdebug}-{c1|c2}-GCBasher_ParallelGC,	\
-    linux_i586_3.8-{product|fastdebug}-{c1|c2}-GCBasher_CMS,		\
-    linux_i586_3.8-{product|fastdebug}-{c1|c2}-GCBasher_G1
+    linux_i586_3.8-{product|fastdebug}-c2-GCBasher_SerialGC,		\
+    linux_i586_3.8-{product|fastdebug}-c2-GCBasher_ParallelGC,		\
+    linux_i586_3.8-{product|fastdebug}-c2-GCBasher_CMS,			\
+    linux_i586_3.8-{product|fastdebug}-c2-GCBasher_G1
 
 my.test.targets.hotspot.linux.x64=					\
     linux_x64_3.8-{product|fastdebug}-c2-jvm98,				\
@@ -378,17 +375,16 @@
     macosx_x64_10.9-{product|fastdebug}-c2-GCBasher_G1
 
 my.test.targets.hotspot.windows.i586=					\
-    windows_i586_6.3-{product|fastdebug}-{c1|c2}-jvm98,			\
+    windows_i586_6.3-{product|fastdebug}-c2-jvm98,			\
     windows_i586_6.3-{product|fastdebug}-c2-jvm98_nontiered,		\
-    windows_i586_6.3-{product|fastdebug}-{c1|c2}-scimark,		\
-    windows_i586_6.3-product-{c1|c2}-runThese8,				\
-    windows_i586_6.3-product-{c1|c2}-runThese8_Xcomp_lang,		\
-    windows_i586_6.3-product-{c1|c2}-runThese8_Xcomp_vm,		\
-    windows_i586_6.3-fastdebug-c1-runThese8_Xshare,			\
-    windows_i586_6.3-{product|fastdebug}-{c1|c2}-GCBasher_SerialGC,	\
-    windows_i586_6.3-{product|fastdebug}-{c1|c2}-GCBasher_ParallelGC,	\
-    windows_i586_6.3-{product|fastdebug}-{c1|c2}-GCBasher_CMS,		\
-    windows_i586_6.3-{product|fastdebug}-{c1|c2}-GCBasher_G1
+    windows_i586_6.3-{product|fastdebug}-c2-scimark,			\
+    windows_i586_6.3-product-c2-runThese8,				\
+    windows_i586_6.3-product-c2-runThese8_Xcomp_lang,			\
+    windows_i586_6.3-product-c2-runThese8_Xcomp_vm,			\
+    windows_i586_6.3-{product|fastdebug}-c2-GCBasher_SerialGC,		\
+    windows_i586_6.3-{product|fastdebug}-c2-GCBasher_ParallelGC,	\
+    windows_i586_6.3-{product|fastdebug}-c2-GCBasher_CMS,		\
+    windows_i586_6.3-{product|fastdebug}-c2-GCBasher_G1
 
 my.test.targets.hotspot.windows.x64=					\
     windows_x64_6.3-{product|fastdebug}-c2-jvm98,			\
@@ -443,22 +439,21 @@
   linux_x64_3.8-fastdebug-c2-GROUP,					\
   macosx_x64_10.9-fastdebug-c2-GROUP,					\
   windows_i586_6.3-fastdebug-c2-GROUP,					\
-  windows_x64_6.3-fastdebug-c2-GROUP,					\
-  linux_i586_3.8-fastdebug-c1-GROUP,					\
-  windows_i586_6.3-fastdebug-c1-GROUP
+  windows_x64_6.3-fastdebug-c2-GROUP
 
 # Hotspot jtreg tests
-my.make.rule.test.targets.hotspot.reg=						\
-  ${my.make.rule.test.targets.hotspot.reg.group:GROUP=hotspot_compiler_1},	\
-  ${my.make.rule.test.targets.hotspot.reg.group:GROUP=hotspot_compiler_2},	\
-  ${my.make.rule.test.targets.hotspot.reg.group:GROUP=hotspot_compiler_3},	\
-  ${my.make.rule.test.targets.hotspot.reg.group:GROUP=hotspot_compiler_closed},	\
-  ${my.make.rule.test.targets.hotspot.reg.group:GROUP=hotspot_gc},		\
-  ${my.make.rule.test.targets.hotspot.reg.group:GROUP=hotspot_gc_closed},       \
-  ${my.make.rule.test.targets.hotspot.reg.group:GROUP=hotspot_gc_gcold},        \
-  ${my.make.rule.test.targets.hotspot.reg.group:GROUP=hotspot_runtime},		\
-  ${my.make.rule.test.targets.hotspot.reg.group:GROUP=hotspot_serviceability},	\
-  ${my.make.rule.test.targets.hotspot.reg.group:GROUP=jdk_svc_sanity},		\
+my.make.rule.test.targets.hotspot.reg=							\
+  ${my.make.rule.test.targets.hotspot.reg.group:GROUP=hotspot_fast_compiler_1},		\
+  ${my.make.rule.test.targets.hotspot.reg.group:GROUP=hotspot_fast_compiler_2},		\
+  ${my.make.rule.test.targets.hotspot.reg.group:GROUP=hotspot_fast_compiler_3},		\
+  ${my.make.rule.test.targets.hotspot.reg.group:GROUP=hotspot_fast_compiler_closed},	\
+  ${my.make.rule.test.targets.hotspot.reg.group:GROUP=hotspot_fast_gc_1},		\
+  ${my.make.rule.test.targets.hotspot.reg.group:GROUP=hotspot_fast_gc_2},		\
+  ${my.make.rule.test.targets.hotspot.reg.group:GROUP=hotspot_fast_gc_closed},		\
+  ${my.make.rule.test.targets.hotspot.reg.group:GROUP=hotspot_fast_gc_gcold},		\
+  ${my.make.rule.test.targets.hotspot.reg.group:GROUP=hotspot_fast_runtime},		\
+  ${my.make.rule.test.targets.hotspot.reg.group:GROUP=hotspot_fast_serviceability},	\
+  ${my.make.rule.test.targets.hotspot.reg.group:GROUP=jdk_svc_sanity},			\
   ${my.additional.make.rule.test.targets.hotspot.reg}
 
 # Other Makefile based Hotspot tests
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/make/test/BuildFailureHandler.gmk	Wed Jul 05 21:35:07 2017 +0200
@@ -0,0 +1,128 @@
+#
+# 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: build
+
+include $(SPEC)
+include MakeBase.gmk
+include JavaCompilation.gmk
+include SetupJavaCompilers.gmk
+include NativeCompilation.gmk
+
+TARGETS :=
+
+################################################################################
+
+FH_BASEDIR := $(SRC_ROOT)/test/failure_handler
+FH_SUPPORT := $(SUPPORT_OUTPUTDIR)/test/failure_handler
+FH_JAR := $(FH_SUPPORT)/jtregFailureHandler.jar
+
+JTREG_JAR := $(JT_HOME)/lib/jtreg.jar
+ifeq ($(wildcard $(JTREG_JAR)), )
+  $(error Cannot build failure handler without jtreg)
+endif
+# tools.jar is only needed if it exists in the boot jdk
+TOOLS_JAR := $(wildcard $(BOOT_JDK)/lib/tools.jar)
+
+FH_CLASSPATH := $(call PathList, $(JTREG_JAR) $(TOOLS_JAR))
+
+$(eval $(call SetupJavaCompilation, BUILD_FAILURE_HANDLER, \
+    SETUP := GENERATE_OLDBYTECODE, \
+    SRC := $(FH_BASEDIR)/src/share/classes $(FH_BASEDIR)/src/share/conf, \
+    BIN := $(FH_SUPPORT)/classes, \
+    COPY := .properties, \
+    CLASSPATH := $(JTREG_JAR) $(TOOLS_JAR), \
+    JAR := $(FH_JAR), \
+))
+
+TARGETS += $(BUILD_FAILURE_HANDLER)
+
+################################################################################
+
+ifeq ($(OPENJDK_TARGET_OS), windows)
+
+  $(eval $(call SetupNativeCompilation, BUILD_LIBTIMEOUT_HANDLER, \
+        LIBRARY := timeoutHandler, \
+        SRC := $(FH_BASEDIR)/src/windows/native/libtimeoutHandler, \
+        OBJECT_DIR := $(FH_SUPPORT)/libtimeoutHandler, \
+        OUTPUT_DIR := $(FH_SUPPORT), \
+        CFLAGS := $(CFLAGS_JDKLIB), \
+        LDFLAGS := $(LDFLAGS_JDKLIB), \
+        OPTIMIZATION := LOW, \
+  ))
+
+  TARGETS += $(BUILD_LIBTIMEOUT_HANDLER)
+
+endif
+
+################################################################################
+# Targets for building test-image.
+################################################################################
+
+# Copy to hotspot jtreg test image
+$(eval $(call SetupCopyFiles, COPY_FH, \
+    SRC := $(FH_SUPPORT), \
+    DEST := $(TEST_IMAGE_DIR)/failure_handler, \
+    FILES := $(FH_JAR) $(BUILD_LIBTIMEOUT_HANDLER), \
+))
+
+IMAGES_TARGETS += $(COPY_FH)
+
+################################################################################
+# Test the failure handler itself
+################################################################################
+#
+# Use JTREG_TEST_OPTS for test VM options
+# Use JTREG_TESTS for jtreg tests parameter
+#
+RUN_DIR := $(FH_SUPPORT)/test
+# Add the dir of the dll to the path on windows
+ifeq ($(OPENJDK_TARGET_OS), windows)
+  export PATH := $(PATH);$(FH_SUPPORT)
+endif
+
+test:
+	$(RM) -r $(RUN_DIR)
+	$(MKDIR) -p $(RUN_DIR)
+	$(CD) $(FH_BASEDIR)/test && JT_JAVA=$(BOOT_JDK) $(JTREGEXE) \
+	    -jdk:$(BOOT_JDK) \
+	    $(JTREG_TEST_OPTS) \
+	    -timeout:0.1 -va -retain:all \
+	    -noreport \
+	    -agentvm \
+	    -thd:$(FH_JAR) \
+	    -th:jdk.test.failurehandler.jtreg.GatherProcessInfoTimeoutHandler \
+	    -od:$(FH_JAR) \
+	    -o:jdk.test.failurehandler.jtreg.GatherDiagnosticInfoObserver \
+	    -w:$(RUN_DIR)/JTwork -r:$(RUN_DIR)/JTreport \
+	    $(if $(JTREG_TESTS), $(JTREG_TESTS), .) \
+	    || true
+
+################################################################################
+
+build: $(TARGETS)
+images: $(IMAGES_TARGETS)
+
+.PHONY: all images test
--- a/test/failure_handler/Makefile	Fri Apr 15 16:19:15 2016 +0100
+++ b/test/failure_handler/Makefile	Wed Jul 05 21:35:07 2017 +0200
@@ -29,7 +29,7 @@
 CLASSES_DIR := ${BUILD_DIR}/classes
 IMAGE_DIR := ${BUILD_DIR}/image
 RUN_DIR := $(shell pwd)/run
-
+CLASSPATH := ${JTREG_HOME}/lib/jtreg.jar:${JAVA_HOME}/lib/tools.jar
 SRC_DIR := src/share/classes/
 SOURCES := ${SRC_DIR}/jdk/test/failurehandler/*.java                   \
            ${SRC_DIR}/jdk/test/failurehandler/action/*.java            \
@@ -47,9 +47,12 @@
 ifeq ("${OS_NAME}", "Cygwin")
 BUILD_DIR := $(shell cygpath -m "${BUILD_DIR}")
 CLASSES_DIR := $(shell cygpath -m "${CLASSES_DIR}")
-IMAGE_DIR := $(shell cygpath -m "${IMAGE_DIR}") RUN_DIR := $(shell cygpath -m "${RUN_DIR}")
+IMAGE_DIR := $(shell cygpath -m "${IMAGE_DIR}")
+RUN_DIR := $(shell cygpath -m "${RUN_DIR}")
 SRC_DIR := $(shell cygpath -m "${SRC_DIR}")
+JAVA_HOME := $(shell cygpath -m "${JAVA_HOME}")
 JTREG_HOME := $(shell cygpath -m "${JTREG_HOME}")
+CLASSPATH := $(shell cygpath -pm "${CLASSPATH}")
 CC := "cl.exe"
 endif
 
@@ -57,33 +60,33 @@
 
 native: require_env
 ifeq ("${OS_NAME}", "Cygwin")
-    "${CC}" src/windows/native/jdk/test/failurehandler/jtreg/*.c            \
-        -I"$(shell cygpath -w ${JAVA_HOME}/include)"                        \
-        -I"$(shell cygpath -w ${JAVA_HOME}/include/win32)"                  \
-        /link /MACHINE:X64 /DLL /OUT:timeoutHandler.dll
+	"${CC}" src/windows/native/jdk/test/failurehandler/jtreg/*.c        \
+	-I"$(shell cygpath -w "${JAVA_HOME}/include")"                        \
+	-I"$(shell cygpath -w "${JAVA_HOME}/include/win32")"                  \
+	/link /DLL /OUT:timeoutHandler.dll
 endif
 
 check_defined = $(foreach 1,$1,$(__check_defined))
 __check_defined = $(if $(value $1),, $(error $1 is not set))
 
 classes: require_env
-    mkdir -p ${IMAGE_DIR}/bin ${IMAGE_DIR}/lib ${CLASSES_DIR}
-    "${JAVA_HOME}"/bin/javac -target ${JAVA_RELEASE} -source ${JAVA_RELEASE}  \
-        -sourcepath $(shell pwd)                                              \
-        -classpath ${JTREG_HOME}/lib/jtreg.jar:${JAVA_HOME}/lib/tools.jar     \
-        -d ${CLASSES_DIR}                                                     \
+	mkdir -p ${IMAGE_DIR}/bin ${IMAGE_DIR}/lib ${CLASSES_DIR}
+	"${JAVA_HOME}"/bin/javac -target ${JAVA_RELEASE} -source ${JAVA_RELEASE} \
+		-sourcepath "$(shell pwd)"                                           \
+		-cp "${CLASSPATH}" 													 \
+		-d ${CLASSES_DIR}                                  					 \
         ${SOURCES}
-    "${JAVA_HOME}"/bin/jar cf ${TARGET_JAR} -C ${CLASSES_DIR} .
-    "${JAVA_HOME}"/bin/jar uf ${TARGET_JAR} -C ${CONF_DIR} .
+	"${JAVA_HOME}"/bin/jar cf "${TARGET_JAR}" -C "${CLASSES_DIR}" .
+	"${JAVA_HOME}"/bin/jar uf "${TARGET_JAR}" -C "${CONF_DIR}" .
 
 #
 # Use JTREG_TEST_OPTS for test VM options
 # Use JTREG_TESTS for jtreg tests parameter
 #
 test: require_env build
-    rm -rf ${RUN_DIR}
-    mkdir -p ${RUN_DIR}
-    "${JTREG_HOME}"/bin/jtreg                                               \
+	rm -rf "${RUN_DIR}"
+	mkdir -p "${RUN_DIR}"
+	"${JTREG_HOME}"/bin/jtreg                                               \
         -jdk:"${JAVA_HOME}"                                                 \
         ${JTREG_TEST_OPTS}                                                  \
         -timeout:0.1 -va -retain:all                                        \
@@ -93,7 +96,8 @@
         -th:jdk.test.failurehandler.jtreg.GatherProcessInfoTimeoutHandler   \
         -od:"${TARGET_JAR}"                                                 \
         -o:jdk.test.failurehandler.jtreg.GatherDiagnosticInfoObserver       \
-        -w:${RUN_DIR}/JTwork -r:${RUN_DIR}/JTreport                         \
+        -w:"${RUN_DIR}/JTwork"                                              \
+        -r:"${RUN_DIR}/JTreport"                                            \
         $(if ${JTREG_TESTS}, ${JTREG_TESTS}, test)                          \
         && false || true
 
@@ -101,11 +105,11 @@
 debug: test
 
 require_env:
-    $(call check_defined, JAVA_HOME)
-    $(call check_defined, JTREG_HOME)
+	$(call check_defined, JAVA_HOME)
+	$(call check_defined, JTREG_HOME)
 
 clean:
-    rm -rf "${BUILD_DIR}" "${RUN_DIR}"
+	rm -rf "${BUILD_DIR}" "${RUN_DIR}"
 
 build: classes native
 
--- a/test/failure_handler/README	Fri Apr 15 16:19:15 2016 +0100
+++ b/test/failure_handler/README	Wed Jul 05 21:35:07 2017 +0200
@@ -36,11 +36,9 @@
 
 BUILDING
 
-To build a library, one should simply run make with 'JTREG_HOME' and
-'JAVA_HOME' environment variables set. 'JAVA_HOME' should contain path to JDK,
-'JTREG_HOME' -- path to jtreg.
-
-'image/lib/jtregFailureHandler.jar' is created on successful build.
+The library is built using the top level build-test-failure-handler target and
+is automatically included in the test image and picked up by hotspot and jdk
+test makefiles.
 
 CONFIGURATION
 
--- a/test/failure_handler/src/share/classes/jdk/test/failurehandler/jtreg/GatherProcessInfoTimeoutHandler.java	Fri Apr 15 16:19:15 2016 +0100
+++ b/test/failure_handler/src/share/classes/jdk/test/failurehandler/jtreg/GatherProcessInfoTimeoutHandler.java	Wed Jul 05 21:35:07 2017 +0200
@@ -39,12 +39,16 @@
  * process and its children.
  */
 public class GatherProcessInfoTimeoutHandler extends TimeoutHandler {
+    private static final boolean HAS_NATIVE_LIBRARY;
     static {
+        boolean value = true;
         try {
             System.loadLibrary("timeoutHandler");
         } catch (UnsatisfiedLinkError ignore) {
             // not all os need timeoutHandler native-library
+            value = false;
         }
+        HAS_NATIVE_LIBRARY = value;
     }
     private static final String LOG_FILENAME = "processes.log";
     private static final String OUTPUT_FILENAME = "processes.html";
@@ -105,7 +109,7 @@
         if (result == 0L) {
             /* jtreg didn't find pid, most probably we are on JDK < 9
                there is no Process::getPid */
-            if ("windows".equals(OS.current().family)) {
+            if (HAS_NATIVE_LIBRARY && "windows".equals(OS.current().family)) {
                 try {
                     Field field = process.getClass().getDeclaredField("handle");
                     boolean old = field.isAccessible();
--- a/test/failure_handler/src/windows/native/jdk/test/failurehandler/jtreg/GatherProcessInfoTimeoutHandler.c	Fri Apr 15 16:19:15 2016 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,37 +0,0 @@
-/*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-#include <jni.h>
-#include <windows.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-JNIEXPORT jlong JNICALL Java_jdk_test_failurehandler_jtreg_GatherProcessInfoTimeoutHandler_getWin32Pid
-        (JNIEnv* env, jobject o, jlong handle) {
-    return GetProcessId(handle);
-}
-#ifdef __cplusplus
-}
-#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/failure_handler/src/windows/native/libtimeoutHandler/GatherProcessInfoTimeoutHandler.c	Wed Jul 05 21:35:07 2017 +0200
@@ -0,0 +1,37 @@
+/*
+ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+#include <jni.h>
+#include <windows.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+JNIEXPORT jlong JNICALL Java_jdk_test_failurehandler_jtreg_GatherProcessInfoTimeoutHandler_getWin32Pid
+        (JNIEnv* env, jobject o, jlong handle) {
+    return GetProcessId((HANDLE) handle);
+}
+#ifdef __cplusplus
+}
+#endif
--- a/test/failure_handler/test/sanity/Suicide.java	Fri Apr 15 16:19:15 2016 +0100
+++ b/test/failure_handler/test/sanity/Suicide.java	Wed Jul 05 21:35:07 2017 +0200
@@ -28,7 +28,7 @@
 /*
  * @test
  * @summary Suicide test
- * @run main/othervm Crash
+ * @run main/othervm Suicide
  */
 public class Suicide {
     public static void main(String[] args) {
--- a/test/lib/sun/hotspot/WhiteBox.java	Fri Apr 15 16:19:15 2016 +0100
+++ b/test/lib/sun/hotspot/WhiteBox.java	Wed Jul 05 21:35:07 2017 +0200
@@ -344,7 +344,13 @@
   }
   public native Object[] getCodeBlob(long addr);
 
-  public native void clearInlineCaches();
+  private native void clearInlineCaches0(boolean preserve_static_stubs);
+  public void clearInlineCaches() {
+    clearInlineCaches0(false);
+  }
+  public void clearInlineCaches(boolean preserve_static_stubs) {
+    clearInlineCaches0(preserve_static_stubs);
+  }
 
   // Intered strings
   public native boolean isInStringTable(String str);
--- a/test/make/TestMakeBase.gmk	Fri Apr 15 16:19:15 2016 +0100
+++ b/test/make/TestMakeBase.gmk	Wed Jul 05 21:35:07 2017 +0200
@@ -254,4 +254,14 @@
       but was $(call sequence, 5, 15))
 endif
 
+################################################################################
+# Test that PathList is safe when called multiple nested times.
+
+PATHLIST_INPUT := foo bar baz
+
+$(eval $(call assert-equals, \
+    $(call PathList, $(call PathList, $(PATHLIST_INPUT))), \
+    $(call PathList, $(PATHLIST_INPUT)), \
+    PathList call not safe for calling twice))
+
 all: $(TEST_TARGETS)