Merge
diff --git a/.hgtags-top-repo b/.hgtags-top-repo
index 0fcca9b..ea2309c 100644
--- a/.hgtags-top-repo
+++ b/.hgtags-top-repo
@@ -300,3 +300,4 @@
 0c37a832458f0e0b7d2a3f1a6f69aeae311aeb18 jdk9-b55
 eb7febe45865ba6b81f2ea68082262d0708a0b22 jdk9-b56
 f25ee9f62427a9ba27418e5531a89754791a305b jdk9-b57
+6e78dd9b121037719a065fe8fb25b936babdfecb jdk9-b58
diff --git a/Makefile b/Makefile
index 825bad1..2460cd4 100644
--- a/Makefile
+++ b/Makefile
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2012, 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
@@ -23,200 +23,42 @@
 # questions.
 #
 
-# This must be the first rule
-default:
+###
+### This file is just a very small wrapper needed to run the real make/Init.gmk.
+### It also performs some sanity checks on make.
+###
 
-# Inclusion of this pseudo-target will cause make to execute this file
-# serially, regardless of -j. Recursively called makefiles will not be
-# affected, however. This is required for correct dependency management.
-.NOTPARALLEL:
-
-# The shell code below will be executed on /usr/ccs/bin/make on Solaris, but not in GNU make.
+# The shell code below will be executed on /usr/ccs/bin/make on Solaris, but not in GNU Make.
 # /usr/ccs/bin/make lacks basically every other flow control mechanism.
-.TEST_FOR_NON_GNUMAKE:sh=echo You are not using GNU make/gmake, this is a requirement. Check your path. 1>&2 && exit 1
+.TEST_FOR_NON_GNUMAKE:sh=echo You are not using GNU Make/gmake, this is a requirement. Check your path. 1>&2 && exit 1
 
-# Assume we have GNU make, but check version.
+# The .FEATURES variable is likely to be unique for GNU Make.
+ifeq ($(.FEATURES), )
+  $(info Error: '$(MAKE)' does not seem to be GNU Make, which is a requirement.)
+  $(info Check your path, or upgrade to GNU Make 3.81 or newer.)
+  $(error Cannot continue)
+endif
+
+# Assume we have GNU Make, but check version.
 ifeq ($(strip $(foreach v, 3.81% 3.82% 4.%, $(filter $v, $(MAKE_VERSION)))), )
-  $(error This version of GNU Make is too low ($(MAKE_VERSION)). Check your path, or upgrade to 3.81 or newer.)
+  $(info Error: This version of GNU Make is too low ($(MAKE_VERSION)).)
+  $(info Check your path, or upgrade to GNU Make 3.81 or newer.)
+  $(error Cannot continue)
+endif
+
+# In Cygwin, the MAKE variable gets prepended with the current directory if the
+# make executable is called using a Windows mixed path (c:/cygwin/bin/make.exe).
+ifneq ($(findstring :, $(MAKE)), )
+  MAKE := $(patsubst $(CURDIR)%, %, $(patsubst $(CURDIR)/%, %, $(MAKE)))
 endif
 
 # Locate this Makefile
-ifeq ($(filter /%,$(lastword $(MAKEFILE_LIST))),)
-  makefile_path:=$(CURDIR)/$(lastword $(MAKEFILE_LIST))
+ifeq ($(filter /%, $(lastword $(MAKEFILE_LIST))),)
+  makefile_path := $(CURDIR)/$(strip $(lastword $(MAKEFILE_LIST)))
 else
-  makefile_path:=$(lastword $(MAKEFILE_LIST))
+  makefile_path := $(lastword $(MAKEFILE_LIST))
 endif
-root_dir:=$(patsubst %/,%,$(dir $(makefile_path)))
+topdir := $(strip $(patsubst %/, %, $(dir $(makefile_path))))
 
-ifeq ($(MAIN_TARGETS), )
-  COMMAND_LINE_VARIABLES:=$(subst =command,,$(filter %=command,$(foreach var,$(.VARIABLES),$(var)=$(firstword $(origin $(var))))))
-  MAKE_CONTROL_VARIABLES:=LOG CONF SPEC JOBS TEST IGNORE_OLD_CONFIG
-  UNKNOWN_COMMAND_LINE_VARIABLES:=$(strip $(filter-out $(MAKE_CONTROL_VARIABLES), $(COMMAND_LINE_VARIABLES)))
-  ifneq ($(UNKNOWN_COMMAND_LINE_VARIABLES), )
-    $(info Note: Command line contains non-control variables: $(UNKNOWN_COMMAND_LINE_VARIABLES).)
-    $(info Make sure it is not mistyped, and that you intend to override this variable.)
-    $(info 'make help' will list known control variables)
-  endif
-endif
-
-ifneq ($(findstring qp,$(MAKEFLAGS)),)
-  # When called with -qp, assume an external part (e.g. bash completion) is trying
-  # to understand our targets.
-  # Duplication of global targets, needed before ParseConfAndSpec in case we have
-  # no configurations.
-  help:
-  # If both CONF and SPEC are unset, look for all available configurations by
-  # setting CONF to the empty string.
-  ifeq ($(SPEC), )
-    CONF?=
-  endif
-endif
-
-# ... and then we can include our helper functions
-include $(root_dir)/make/MakeHelpers.gmk
-
-$(eval $(call ParseLogLevel))
-$(eval $(call ParseConfAndSpec))
-
-# Now determine if we have zero, one or several configurations to build.
-ifeq ($(SPEC),)
-  # Since we got past ParseConfAndSpec, we must be building a global target. Do nothing.
-else
-  # In Cygwin, the MAKE variable gets messed up if the make executable is called with
-  # a Windows mixed path (c:/cygwin/bin/make.exe). If that's the case, fix it by removing
-  # the prepended root_dir.
-  ifneq ($(findstring :, $(MAKE)), )
-    MAKE := $(patsubst $(root_dir)%, %, $(MAKE))
-  endif
-
-  # We are potentially building multiple configurations.
-  # First, find out the valid targets
-  # Run the makefile with an arbitrary SPEC using -p -q (quiet dry-run and dump rules) to find
-  # available PHONY targets. Use this list as valid targets to pass on to the repeated calls.
-  all_phony_targets := $(sort $(filter-out $(global_targets), $(strip $(shell \
-      cd $(root_dir)/make && $(MAKE) -f Main.gmk -p -q FRC SPEC=$(firstword $(SPEC)) \
-      -I $(root_dir)/make/common | grep "^.PHONY:" | head -n 1 | cut -d " " -f 2-))))
-
-  # Loop through the configurations and call the main-wrapper for each one. The wrapper
-  # target will execute with a single configuration loaded.
-  $(all_phony_targets):
-	@$(if $(TARGET_RUN),,\
-          $(foreach spec,$(SPEC),\
-            (cd $(root_dir) && $(MAKE) SPEC=$(spec) MAIN_TARGETS="$(call GetRealTarget)" \
-	    $(VERBOSE) VERBOSE=$(VERBOSE) LOG_LEVEL=$(LOG_LEVEL) main-wrapper) &&) true)
-	@echo > /dev/null
-	$(eval TARGET_RUN=true)
-
-  .PHONY: $(all_phony_targets)
-
-  ifneq ($(MAIN_TARGETS), )
-    # The wrapper target was called so we now have a single configuration. Load the spec file
-    # and call the real Main.gmk.
-    include $(SPEC)
-    include $(SRC_ROOT)/make/common/MakeBase.gmk
-
-    ### Clean up from previous run
-    # Remove any build.log from a previous run, if they exist
-    ifneq (,$(BUILD_LOG))
-      ifneq (,$(BUILD_LOG_PREVIOUS))
-        # Rotate old log
-        $(shell $(RM) $(BUILD_LOG_PREVIOUS) 2> /dev/null)
-        $(shell $(MV) $(BUILD_LOG) $(BUILD_LOG_PREVIOUS) 2> /dev/null)
-      else
-        $(shell $(RM) $(BUILD_LOG) 2> /dev/null)
-      endif
-      $(shell $(RM) $(OUTPUT_ROOT)/build-trace-time.log 2> /dev/null)
-    endif
-    # Remove any javac server logs and port files. This
-    # prevents a new make run to reuse the previous servers.
-    ifneq (,$(SJAVAC_SERVER_DIR))
-      $(shell $(MKDIR) -p $(SJAVAC_SERVER_DIR) && $(RM) -rf $(SJAVAC_SERVER_DIR)/*)
-    endif
-
-    # Split out the targets requiring sequential execution. Run these targets separately
-    # from the rest so that the rest may still enjoy full parallel execution.
-    SEQUENTIAL_TARGETS := $(filter dist-clean clean% reconfigure, $(MAIN_TARGETS))
-    PARALLEL_TARGETS := $(filter-out $(SEQUENTIAL_TARGETS), $(MAIN_TARGETS))
-
-    main-wrapper:
-        ifneq ($(SEQUENTIAL_TARGETS), )
-	  (cd $(SRC_ROOT)/make && $(MAKE) -f Main.gmk SPEC=$(SPEC) -j 1 \
-	      $(VERBOSE) VERBOSE=$(VERBOSE) LOG_LEVEL=$(LOG_LEVEL) $(SEQUENTIAL_TARGETS))
-        endif
-        ifneq ($(PARALLEL_TARGETS), )
-	  @$(call AtMakeStart)
-	  (cd $(SRC_ROOT)/make && $(BUILD_LOG_WRAPPER) $(MAKE) -f Main.gmk SPEC=$(SPEC) -j $(JOBS) \
-	      $(VERBOSE) VERBOSE=$(VERBOSE) LOG_LEVEL=$(LOG_LEVEL) $(PARALLEL_TARGETS) \
-	      $(if $(filter true, $(OUTPUT_SYNC_SUPPORTED)), -O$(OUTPUT_SYNC)))
-	  @$(call AtMakeEnd)
-        endif
-
-     .PHONY: main-wrapper
-
-   endif
-endif
-
-# Here are "global" targets, i.e. targets that can be executed without specifying a single configuration.
-# If you add more global targets, please update the variable global_targets in MakeHelpers.
-
-# Helper macro to allow $(info) to properly print strings beginning with spaces.
-_:=
-
-help:
-	$(info )
-	$(info OpenJDK Makefile help)
-	$(info =====================)
-	$(info )
-	$(info Common make targets)
-	$(info $(_) make [default]         # Compile all modules in langtools, hotspot, jdk, jaxws,)
-	$(info $(_)                        # jaxp and corba, and create a runnable "exploded" image)
-	$(info $(_) make all               # Compile everything, all repos, docs and images)
-	$(info $(_) make images            # Create complete j2sdk and j2re images)
-	$(info $(_) make <phase>           # Build the specified phase and everything it depends on)
-	$(info $(_)                        # (gensrc, java, copy, libs, launchers, gendata, rmic))
-	$(info $(_) make *-only            # Applies to most targets and disables compling the)
-	$(info $(_)                        # dependencies for the target. This is faster but may)
-	$(info $(_)                        # result in incorrect build results!)
-	$(info $(_) make docs              # Create all docs)
-	$(info $(_) make docs-javadoc      # Create just javadocs, depends on less than full docs)
-	$(info $(_) make profiles          # Create complete j2re compact profile images)
-	$(info $(_) make bootcycle-images  # Build images twice, second time with newly built JDK)
-	$(info $(_) make install           # Install the generated images locally)
-	$(info $(_) make reconfigure       # Rerun configure with the same arguments as last time)
-	$(info $(_) make help              # Give some help on using make)
-	$(info $(_) make test              # Run tests, default is all tests (see TEST below))
-	$(info )
-	$(info Targets for cleaning)
-	$(info $(_) make clean             # Remove all files generated by make, but not those)
-	$(info $(_)                        # generated by configure)
-	$(info $(_) make dist-clean        # Remove all files, including configuration)
-	$(info $(_) make clean-<outputdir> # Remove the subdir in the output dir with the name)
-	$(info $(_) make clean-<phase>     # Remove all build results related to a certain build)
-	$(info $(_)                        # phase (gensrc, java, libs, launchers))
-	$(info $(_) make clean-<module>    # Remove all build results related to a certain module)
-	$(info $(_) make clean-<module>-<phase> # Remove all build results related to a certain)
-	$(info $(_)                        # module and phase)
-	$(info )
-	$(info Targets for specific modules)
-	$(info $(_) make <module>          # Build <module> and everything it depends on.)
-	$(info $(_) make <module>-<phase>  # Compile the specified phase for the specified module)
-	$(info $(_)                        # and everything it depends on)
-	$(info $(_)                        # (gensrc, java, copy, libs, launchers, gendata, rmic))
-	$(info )
-	$(info Make control variables)
-	$(info $(_) CONF=                  # Build all configurations (note, assignment is empty))
-	$(info $(_) CONF=<substring>       # Build the configuration(s) with a name matching)
-	$(info $(_)                        # <substring>)
-	$(info $(_) SPEC=<spec file>       # Build the configuration given by the spec file)
-	$(info $(_) LOG=<loglevel>         # Change the log level from warn to <loglevel>)
-	$(info $(_)                        # Available log levels are:)
-	$(info $(_)                        # 'warn' (default), 'info', 'debug' and 'trace')
-	$(info $(_)                        # To see executed command lines, use LOG=debug)
-	$(info $(_) JOBS=<n>               # Run <n> parallel make jobs)
-	$(info $(_)                        # Note that -jN does not work as expected!)
-	$(info $(_) IGNORE_OLD_CONFIG=true # Skip tests if spec file is up to date)
-	$(info $(_) make test TEST=<test>  # Only run the given test or tests, e.g.)
-	$(info $(_)                        # make test TEST="jdk_lang jdk_net")
-	$(info )
-
-.PHONY: help
+# ... and then we can include the real makefile
+include $(topdir)/make/Init.gmk
diff --git a/common/autoconf/basics.m4 b/common/autoconf/basics.m4
index 422837a..d9df087 100644
--- a/common/autoconf/basics.m4
+++ b/common/autoconf/basics.m4
@@ -78,7 +78,7 @@
 AC_DEFUN([BASIC_FIXUP_PATH],
 [
   # Only process if variable expands to non-empty
-  
+
   if test "x[$]$1" != x; then
     if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
       BASIC_FIXUP_PATH_CYGWIN($1)
@@ -118,7 +118,7 @@
 AC_DEFUN([BASIC_FIXUP_EXECUTABLE],
 [
   # Only process if variable expands to non-empty
-  
+
   if test "x[$]$1" != x; then
     if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
       BASIC_FIXUP_EXECUTABLE_CYGWIN($1)
@@ -459,12 +459,21 @@
   AC_MSG_RESULT([$TOPDIR])
   AC_SUBST(TOPDIR)
 
+  # Save the original version of TOPDIR for string comparisons
+  ORIGINAL_TOPDIR="$TOPDIR"
+  AC_SUBST(ORIGINAL_TOPDIR)
+
   # We can only call BASIC_FIXUP_PATH after BASIC_CHECK_PATHS_WINDOWS.
   BASIC_FIXUP_PATH(CURDIR)
   BASIC_FIXUP_PATH(TOPDIR)
   # SRC_ROOT is a traditional alias for TOPDIR.
   SRC_ROOT=$TOPDIR
 
+  # Calculate a canonical version of TOPDIR for string comparisons
+  CANONICAL_TOPDIR=$TOPDIR
+  BASIC_REMOVE_SYMBOLIC_LINKS([CANONICAL_TOPDIR])
+  AC_SUBST(CANONICAL_TOPDIR)
+
   # Locate the directory of this script.
   AUTOCONF_DIR=$TOPDIR/common/autoconf
 ])
@@ -709,18 +718,6 @@
   AC_CONFIG_FILES([$OUTPUT_ROOT/Makefile:$AUTOCONF_DIR/Makefile.in])
 ])
 
-AC_DEFUN_ONCE([BASIC_SETUP_LOGGING],
-[
-  # Setup default logging of stdout and stderr to build.log in the output root.
-  BUILD_LOG='$(OUTPUT_ROOT)/build.log'
-  BUILD_LOG_PREVIOUS='$(OUTPUT_ROOT)/build.log.old'
-  BUILD_LOG_WRAPPER='$(BASH) $(SRC_ROOT)/common/bin/logger.sh $(BUILD_LOG)'
-  AC_SUBST(BUILD_LOG)
-  AC_SUBST(BUILD_LOG_PREVIOUS)
-  AC_SUBST(BUILD_LOG_WRAPPER)
-])
-
-
 #%%% Simple tools %%%
 
 # Check if we have found a usable version of make
diff --git a/common/autoconf/configure.ac b/common/autoconf/configure.ac
index 14497a0..29dd146 100644
--- a/common/autoconf/configure.ac
+++ b/common/autoconf/configure.ac
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -88,7 +88,6 @@
 
 # Continue setting up basic stuff. Most remaining code require fundamental tools.
 BASIC_SETUP_PATHS
-BASIC_SETUP_LOGGING
 
 # Check if it's a pure open build or if custom sources are to be used.
 JDKOPT_SETUP_OPEN_OR_CUSTOM
diff --git a/common/autoconf/generated-configure.sh b/common/autoconf/generated-configure.sh
index 54b40ca..137ccd5 100644
--- a/common/autoconf/generated-configure.sh
+++ b/common/autoconf/generated-configure.sh
@@ -907,9 +907,8 @@
 JVM_INTERPRETER
 JDK_VARIANT
 SET_OPENJDK
-BUILD_LOG_WRAPPER
-BUILD_LOG_PREVIOUS
-BUILD_LOG
+CANONICAL_TOPDIR
+ORIGINAL_TOPDIR
 TOPDIR
 PATH_SEP
 ZERO_ARCHDEF
@@ -3471,9 +3470,6 @@
 
 
 
-
-
-
 #%%% Simple tools %%%
 
 # Check if we have found a usable version of make
@@ -14141,6 +14137,10 @@
 $as_echo "$TOPDIR" >&6; }
 
 
+  # Save the original version of TOPDIR for string comparisons
+  ORIGINAL_TOPDIR="$TOPDIR"
+
+
   # We can only call BASIC_FIXUP_PATH after BASIC_CHECK_PATHS_WINDOWS.
 
   # Only process if variable expands to non-empty
@@ -14397,19 +14397,62 @@
   # SRC_ROOT is a traditional alias for TOPDIR.
   SRC_ROOT=$TOPDIR
 
+  # Calculate a canonical version of TOPDIR for string comparisons
+  CANONICAL_TOPDIR=$TOPDIR
+
+  if test "x$OPENJDK_BUILD_OS" != xwindows; then
+    # Follow a chain of symbolic links. Use readlink
+    # where it exists, else fall back to horribly
+    # complicated shell code.
+    if test "x$READLINK_TESTED" != yes; then
+      # On MacOSX there is a readlink tool with a different
+      # purpose than the GNU readlink tool. Check the found readlink.
+      ISGNU=`$READLINK --version 2>&1 | $GREP GNU`
+      if test "x$ISGNU" = x; then
+        # A readlink that we do not know how to use.
+        # Are there other non-GNU readlinks out there?
+        READLINK_TESTED=yes
+        READLINK=
+      fi
+    fi
+
+    if test "x$READLINK" != x; then
+      CANONICAL_TOPDIR=`$READLINK -f $CANONICAL_TOPDIR`
+    else
+      # Save the current directory for restoring afterwards
+      STARTDIR=$PWD
+      COUNTER=0
+      sym_link_dir=`$DIRNAME $CANONICAL_TOPDIR`
+      sym_link_file=`$BASENAME $CANONICAL_TOPDIR`
+      cd $sym_link_dir
+      # Use -P flag to resolve symlinks in directories.
+      cd `$THEPWDCMD -P`
+      sym_link_dir=`$THEPWDCMD -P`
+      # Resolve file symlinks
+      while test $COUNTER -lt 20; do
+        ISLINK=`$LS -l $sym_link_dir/$sym_link_file | $GREP '\->' | $SED -e 's/.*-> \(.*\)/\1/'`
+        if test "x$ISLINK" == x; then
+          # This is not a symbolic link! We are done!
+          break
+        fi
+        # Again resolve directory symlinks since the target of the just found
+        # link could be in a different directory
+        cd `$DIRNAME $ISLINK`
+        sym_link_dir=`$THEPWDCMD -P`
+        sym_link_file=`$BASENAME $ISLINK`
+        let COUNTER=COUNTER+1
+      done
+      cd $STARTDIR
+      CANONICAL_TOPDIR=$sym_link_dir/$sym_link_file
+    fi
+  fi
+
+
+
   # Locate the directory of this script.
   AUTOCONF_DIR=$TOPDIR/common/autoconf
 
 
-  # Setup default logging of stdout and stderr to build.log in the output root.
-  BUILD_LOG='$(OUTPUT_ROOT)/build.log'
-  BUILD_LOG_PREVIOUS='$(OUTPUT_ROOT)/build.log.old'
-  BUILD_LOG_WRAPPER='$(BASH) $(SRC_ROOT)/common/bin/logger.sh $(BUILD_LOG)'
-
-
-
-
-
 # Check if it's a pure open build or if custom sources are to be used.
 
   # Check whether --enable-openjdk-only was given.
diff --git a/common/autoconf/spec.gmk.in b/common/autoconf/spec.gmk.in
index d21ab83..35437b1 100644
--- a/common/autoconf/spec.gmk.in
+++ b/common/autoconf/spec.gmk.in
@@ -55,25 +55,12 @@
 # A self-referential reference to this file.
 SPEC:=@SPEC@
 
-# Specify where the spec file is.
-MAKE_ARGS="SPEC=$(SPEC)"
+# What make to use for main processing, after bootstrapping top-level Makefile.
+MAKE := @MAKE@
 
-MAKE:=@MAKE@
-
-# Pass along the verbosity and log level settings.
-ifeq (,$(findstring VERBOSE=,$(MAKE)))
-  MAKE:=$(MAKE) $(VERBOSE) VERBOSE="$(VERBOSE)" LOG_LEVEL="$(LOG_LEVEL)"
-endif
-
-# No implicit variables or rules!
-ifeq (,$(findstring -R,$(MAKE)))
-  MAKE:=$(MAKE) -R
-endif
-
-# Specify where the common include directory for makefiles is.
-ifeq (,$(findstring -I @TOPDIR@/make/common,$(MAKE)))
-  MAKE:=$(MAKE) -I @TOPDIR@/make/common
-endif
+# The default make arguments
+MAKE_ARGS = $(MAKE_LOG_FLAGS) -R -I $(TOPDIR)/make/common SPEC=$(SPEC) \
+    MAKE_LOG_FLAGS="$(MAKE_LOG_FLAGS)" LOG_LEVEL=$(LOG_LEVEL)
 
 OUTPUT_SYNC_SUPPORTED:=@OUTPUT_SYNC_SUPPORTED@
 OUTPUT_SYNC:=@OUTPUT_SYNC@
@@ -146,6 +133,9 @@
 
 # The top-level directory of the forest (SRC_ROOT is a traditional alias)
 TOPDIR:=@TOPDIR@
+# These two versions of TOPDIR are used in string comparisons
+ORIGINAL_TOPDIR:=@ORIGINAL_TOPDIR@
+CANONICAL_TOPDIR:=@CANONICAL_TOPDIR@
 SRC_ROOT:=@TOPDIR@
 
 OUTPUT_ROOT:=@OUTPUT_ROOT@
@@ -573,18 +563,6 @@
 XCODEBUILD=@XCODEBUILD@
 FIXPATH:=@FIXPATH@
 
-# Where the build output is stored for your convenience.
-BUILD_LOG:=@BUILD_LOG@
-BUILD_LOG_PREVIOUS:=@BUILD_LOG_PREVIOUS@
-# Disable the build log wrapper on sjavac+windows until
-# we have solved how to prevent the log wrapper to wait
-# for the background sjavac server process.
-ifeq (@ENABLE_SJAVAC@X@OPENJDK_BUILD_OS@,yesXwindows)
-  BUILD_LOG_WRAPPER:=
-else
-  BUILD_LOG_WRAPPER:=@BUILD_LOG_WRAPPER@
-endif
-
 # Build setup
 ENABLE_JFR=@ENABLE_JFR@
 ENABLE_INTREE_EC=@ENABLE_INTREE_EC@
diff --git a/configure b/configure
index 4ab8846..af0b5b5 100644
--- a/configure
+++ b/configure
@@ -31,4 +31,5 @@
 
 # Delegate to wrapper, forcing wrapper to believe $0 is this script by using -c.
 # This trick is needed to get autoconf to co-operate properly.
-bash -c ". $this_script_dir/common/autoconf/configure" $this_script_dir/configure CHECKME $this_script_dir "$@"
+# The ${-:+-$-} construction passes on bash options.
+bash ${-:+-$-} -c ". $this_script_dir/common/autoconf/configure" $this_script_dir/configure CHECKME $this_script_dir "$@"
diff --git a/corba/.hgtags b/corba/.hgtags
index 7eefe32..b467c4b 100644
--- a/corba/.hgtags
+++ b/corba/.hgtags
@@ -300,3 +300,4 @@
 734ca5311a225711b79618f3e92f47f07c82154a jdk9-b55
 ef4afd6832b00b8687832c2a36c90e43750ebe40 jdk9-b56
 d8ebf1a5b18ccbc849f5bf0f80aa3d78583eee68 jdk9-b57
+86dd5de1f5cb09073019bd629e22cfcd012d8b4b jdk9-b58
diff --git a/hotspot/.hgtags b/hotspot/.hgtags
index 38f9671..22f9730 100644
--- a/hotspot/.hgtags
+++ b/hotspot/.hgtags
@@ -460,3 +460,4 @@
 be49ab55e5c498c5077bbf58c2737100d1992339 jdk9-b55
 fd2d5ec7e7b16c7bf4043a7fe7cfd8af96b819e2 jdk9-b56
 56a85ffe743d3f9d70ba25d6ce82ddd2ad1bf33c jdk9-b57
+ee878f3d6732856f7725c590312bfbe2ffa52cc7 jdk9-b58
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/VM.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/VM.java
index caf06ea..ee0b541 100644
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/VM.java
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/VM.java
@@ -123,6 +123,7 @@
 
   private static Type intxType;
   private static Type uintxType;
+  private static Type sizetType;
   private static CIntegerType boolType;
   private Boolean sharingEnabled;
   private Boolean compressedOopsEnabled;
@@ -175,7 +176,7 @@
 
      public long getIntx() {
         if (Assert.ASSERTS_ENABLED) {
-           Assert.that(isIntx(), "not a intx flag!");
+           Assert.that(isIntx(), "not an intx flag!");
         }
         return addr.getCIntegerAt(0, intxType.getSize(), false);
      }
@@ -191,6 +192,17 @@
         return addr.getCIntegerAt(0, uintxType.getSize(), true);
      }
 
+     public boolean isSizet() {
+        return type.equals("size_t");
+     }
+
+     public long getSizet() {
+        if (Assert.ASSERTS_ENABLED) {
+           Assert.that(isSizet(), "not a size_t flag!");
+        }
+        return addr.getCIntegerAt(0, sizetType.getSize(), true);
+     }
+
      public String getValue() {
         if (isBool()) {
            return new Boolean(getBool()).toString();
@@ -198,6 +210,8 @@
            return new Long(getIntx()).toString();
         } else if (isUIntx()) {
            return new Long(getUIntx()).toString();
+        } else if (isSizet()) {
+            return new Long(getSizet()).toString();
         } else {
            return null;
         }
@@ -323,6 +337,7 @@
 
     intxType = db.lookupType("intx");
     uintxType = db.lookupType("uintx");
+    sizetType = db.lookupType("size_t");
     boolType = (CIntegerType) db.lookupType("bool");
 
     minObjAlignmentInBytes = getObjectAlignmentInBytes();
diff --git a/hotspot/make/linux/makefiles/gcc.make b/hotspot/make/linux/makefiles/gcc.make
index c1d59e9..85aa5c3 100644
--- a/hotspot/make/linux/makefiles/gcc.make
+++ b/hotspot/make/linux/makefiles/gcc.make
@@ -207,7 +207,7 @@
   WARNINGS_ARE_ERRORS += -Wno-return-type -Wno-empty-body
 endif
 
-WARNING_FLAGS = -Wpointer-arith -Wsign-compare -Wundef -Wunused-function -Wunused-value -Wformat=2 -Wreturn-type
+WARNING_FLAGS = -Wpointer-arith -Wsign-compare -Wundef -Wunused-function -Wunused-value -Wformat=2 -Wreturn-type -Woverloaded-virtual
 
 ifeq ($(USE_CLANG),)
   # Since GCC 4.3, -Wconversion has changed its meanings to warn these implicit
diff --git a/hotspot/src/cpu/aarch64/vm/stubGenerator_aarch64.cpp b/hotspot/src/cpu/aarch64/vm/stubGenerator_aarch64.cpp
index 6663c7f..7e70f8d 100644
--- a/hotspot/src/cpu/aarch64/vm/stubGenerator_aarch64.cpp
+++ b/hotspot/src/cpu/aarch64/vm/stubGenerator_aarch64.cpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved.
  * Copyright (c) 2014, Red Hat Inc. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -673,7 +673,6 @@
   void  gen_write_ref_array_pre_barrier(Register addr, Register count, bool dest_uninitialized) {
     BarrierSet* bs = Universe::heap()->barrier_set();
     switch (bs->kind()) {
-    case BarrierSet::G1SATBCT:
     case BarrierSet::G1SATBCTLogging:
       // With G1, don't generate the call if we statically know that the target in uninitialized
       if (!dest_uninitialized) {
@@ -719,7 +718,6 @@
     assert_different_registers(start, end, scratch);
     BarrierSet* bs = Universe::heap()->barrier_set();
     switch (bs->kind()) {
-      case BarrierSet::G1SATBCT:
       case BarrierSet::G1SATBCTLogging:
 
         {
diff --git a/hotspot/src/cpu/aarch64/vm/templateTable_aarch64.cpp b/hotspot/src/cpu/aarch64/vm/templateTable_aarch64.cpp
index 041d995..19b0b37 100644
--- a/hotspot/src/cpu/aarch64/vm/templateTable_aarch64.cpp
+++ b/hotspot/src/cpu/aarch64/vm/templateTable_aarch64.cpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved.
  * Copyright (c) 2014, Red Hat Inc. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -150,7 +150,6 @@
   assert(val == noreg || val == r0, "parameter is just for looks");
   switch (barrier) {
 #if INCLUDE_ALL_GCS
-    case BarrierSet::G1SATBCT:
     case BarrierSet::G1SATBCTLogging:
       {
         // flatten object address if needed
diff --git a/hotspot/src/cpu/ppc/vm/c2_globals_ppc.hpp b/hotspot/src/cpu/ppc/vm/c2_globals_ppc.hpp
index f031c8a..3b4b9e3 100644
--- a/hotspot/src/cpu/ppc/vm/c2_globals_ppc.hpp
+++ b/hotspot/src/cpu/ppc/vm/c2_globals_ppc.hpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
  * Copyright 2012, 2014 SAP AG. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -49,7 +49,7 @@
 define_pd_global(intx, MinJumpTableSize,             10);
 define_pd_global(intx, INTPRESSURE,                  25);
 define_pd_global(intx, InteriorEntryAlignment,       16);
-define_pd_global(intx, NewSizeThreadIncrease,        ScaleForWordSize(4*K));
+define_pd_global(size_t, NewSizeThreadIncrease,      ScaleForWordSize(4*K));
 define_pd_global(intx, RegisterCostAreaRatio,        16000);
 define_pd_global(bool, UseTLAB,                      true);
 define_pd_global(bool, ResizeTLAB,                   true);
@@ -85,14 +85,14 @@
 define_pd_global(intx, CodeCacheExpansionSize,       64*K);
 
 // Ergonomics related flags
-define_pd_global(uint64_t,MaxRAM,                    4ULL*G);
+define_pd_global(uint64_t, MaxRAM,                   4ULL*G);
 define_pd_global(uintx, CodeCacheMinBlockLength,     4);
 define_pd_global(uintx, CodeCacheMinimumUseSpace,    400*K);
 
 define_pd_global(bool,  TrapBasedRangeChecks,        true);
 
 // Heap related flags
-define_pd_global(uintx,MetaspaceSize,                ScaleForWordSize(16*M));
+define_pd_global(size_t, MetaspaceSize,              ScaleForWordSize(16*M));
 
 // Ergonomics related flags
 define_pd_global(bool, NeverActAsServerClassMachine, false);
diff --git a/hotspot/src/cpu/ppc/vm/globals_ppc.hpp b/hotspot/src/cpu/ppc/vm/globals_ppc.hpp
index 36bdf73..f2391d2 100644
--- a/hotspot/src/cpu/ppc/vm/globals_ppc.hpp
+++ b/hotspot/src/cpu/ppc/vm/globals_ppc.hpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2015, Oracle and/or its affiliates. All rights reserved.
  * Copyright 2012, 2013 SAP AG. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -56,7 +56,7 @@
 define_pd_global(bool, UseMembar,             false);
 
 // GC Ergo Flags
-define_pd_global(uintx, CMSYoungGenPerWorker, 16*M);  // Default max size of CMS young gen, per GC worker thread.
+define_pd_global(size_t, CMSYoungGenPerWorker, 16*M);  // Default max size of CMS young gen, per GC worker thread.
 
 define_pd_global(uintx, TypeProfileLevel, 0);
 
diff --git a/hotspot/src/cpu/ppc/vm/stubGenerator_ppc.cpp b/hotspot/src/cpu/ppc/vm/stubGenerator_ppc.cpp
index 6c08519..c7a9d06 100644
--- a/hotspot/src/cpu/ppc/vm/stubGenerator_ppc.cpp
+++ b/hotspot/src/cpu/ppc/vm/stubGenerator_ppc.cpp
@@ -608,7 +608,6 @@
   void gen_write_ref_array_pre_barrier(Register from, Register to, Register count, bool dest_uninitialized, Register Rtmp1) {
     BarrierSet* const bs = Universe::heap()->barrier_set();
     switch (bs->kind()) {
-      case BarrierSet::G1SATBCT:
       case BarrierSet::G1SATBCTLogging:
         // With G1, don't generate the call if we statically know that the target in uninitialized
         if (!dest_uninitialized) {
@@ -665,7 +664,6 @@
     BarrierSet* const bs = Universe::heap()->barrier_set();
 
     switch (bs->kind()) {
-      case BarrierSet::G1SATBCT:
       case BarrierSet::G1SATBCTLogging:
         {
           if (branchToEnd) {
diff --git a/hotspot/src/cpu/ppc/vm/templateTable_ppc_64.cpp b/hotspot/src/cpu/ppc/vm/templateTable_ppc_64.cpp
index 70d1420..a650533 100644
--- a/hotspot/src/cpu/ppc/vm/templateTable_ppc_64.cpp
+++ b/hotspot/src/cpu/ppc/vm/templateTable_ppc_64.cpp
@@ -66,7 +66,6 @@
 
   switch (barrier) {
 #if INCLUDE_ALL_GCS
-    case BarrierSet::G1SATBCT:
     case BarrierSet::G1SATBCTLogging:
       {
         // Load and record the previous value.
diff --git a/hotspot/src/cpu/sparc/vm/c1_globals_sparc.hpp b/hotspot/src/cpu/sparc/vm/c1_globals_sparc.hpp
index b3f0709..85021bc 100644
--- a/hotspot/src/cpu/sparc/vm/c1_globals_sparc.hpp
+++ b/hotspot/src/cpu/sparc/vm/c1_globals_sparc.hpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 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
@@ -53,10 +53,10 @@
 define_pd_global(intx, CodeCacheExpansionSize,       32*K );
 define_pd_global(uintx, CodeCacheMinBlockLength,     1);
 define_pd_global(uintx, CodeCacheMinimumUseSpace,    400*K);
-define_pd_global(uintx, MetaspaceSize,               12*M );
+define_pd_global(size_t, MetaspaceSize,              12*M );
 define_pd_global(bool, NeverActAsServerClassMachine, true );
-define_pd_global(intx, NewSizeThreadIncrease,        16*K );
-define_pd_global(uint64_t,MaxRAM,                    1ULL*G);
+define_pd_global(size_t, NewSizeThreadIncrease,      16*K );
+define_pd_global(uint64_t, MaxRAM,                   1ULL*G);
 define_pd_global(intx, InitialCodeCacheSize,         160*K);
 #endif // !TIERED
 
diff --git a/hotspot/src/cpu/sparc/vm/c2_globals_sparc.hpp b/hotspot/src/cpu/sparc/vm/c2_globals_sparc.hpp
index f8658f8..3fc18fa 100644
--- a/hotspot/src/cpu/sparc/vm/c2_globals_sparc.hpp
+++ b/hotspot/src/cpu/sparc/vm/c2_globals_sparc.hpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 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
@@ -51,7 +51,7 @@
 define_pd_global(intx, FreqInlineSize,               175);
 define_pd_global(intx, INTPRESSURE,                  48);  // large register set
 define_pd_global(intx, InteriorEntryAlignment,       16);  // = CodeEntryAlignment
-define_pd_global(intx, NewSizeThreadIncrease, ScaleForWordSize(4*K));
+define_pd_global(size_t, NewSizeThreadIncrease,      ScaleForWordSize(4*K));
 define_pd_global(intx, RegisterCostAreaRatio,        12000);
 define_pd_global(bool, UseTLAB,                      true);
 define_pd_global(bool, ResizeTLAB,                   true);
@@ -90,7 +90,7 @@
 define_pd_global(intx, NonNMethodCodeHeapSize,       5*M );
 define_pd_global(intx, CodeCacheExpansionSize,       32*K);
 // Ergonomics related flags
-define_pd_global(uint64_t,MaxRAM,                    4ULL*G);
+define_pd_global(uint64_t, MaxRAM,                   4ULL*G);
 #endif
 define_pd_global(uintx, CodeCacheMinBlockLength,     4);
 define_pd_global(uintx, CodeCacheMinimumUseSpace,    400*K);
@@ -98,7 +98,7 @@
 define_pd_global(bool,  TrapBasedRangeChecks,        false); // Not needed on sparc.
 
 // Heap related flags
-define_pd_global(uintx,MetaspaceSize,    ScaleForWordSize(16*M));
+define_pd_global(size_t, MetaspaceSize,              ScaleForWordSize(16*M));
 
 // Ergonomics related flags
 define_pd_global(bool, NeverActAsServerClassMachine, false);
diff --git a/hotspot/src/cpu/sparc/vm/globals_sparc.hpp b/hotspot/src/cpu/sparc/vm/globals_sparc.hpp
index 95f731a..2873f44 100644
--- a/hotspot/src/cpu/sparc/vm/globals_sparc.hpp
+++ b/hotspot/src/cpu/sparc/vm/globals_sparc.hpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 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
@@ -75,7 +75,7 @@
 define_pd_global(bool, UseMembar,            false);
 
 // GC Ergo Flags
-define_pd_global(uintx, CMSYoungGenPerWorker, 16*M);  // default max size of CMS young gen, per GC worker thread
+define_pd_global(size_t, CMSYoungGenPerWorker, 16*M);  // default max size of CMS young gen, per GC worker thread
 
 define_pd_global(uintx, TypeProfileLevel, 0);
 
diff --git a/hotspot/src/cpu/sparc/vm/stubGenerator_sparc.cpp b/hotspot/src/cpu/sparc/vm/stubGenerator_sparc.cpp
index 196bc8d..2fffa66 100644
--- a/hotspot/src/cpu/sparc/vm/stubGenerator_sparc.cpp
+++ b/hotspot/src/cpu/sparc/vm/stubGenerator_sparc.cpp
@@ -957,7 +957,6 @@
   void gen_write_ref_array_pre_barrier(Register addr, Register count, bool dest_uninitialized) {
     BarrierSet* bs = Universe::heap()->barrier_set();
     switch (bs->kind()) {
-      case BarrierSet::G1SATBCT:
       case BarrierSet::G1SATBCTLogging:
         // With G1, don't generate the call if we statically know that the target in uninitialized
         if (!dest_uninitialized) {
@@ -1005,7 +1004,6 @@
     BarrierSet* bs = Universe::heap()->barrier_set();
 
     switch (bs->kind()) {
-      case BarrierSet::G1SATBCT:
       case BarrierSet::G1SATBCTLogging:
         {
           // Get some new fresh output registers.
diff --git a/hotspot/src/cpu/sparc/vm/templateTable_sparc.cpp b/hotspot/src/cpu/sparc/vm/templateTable_sparc.cpp
index fe58233..342f69b 100644
--- a/hotspot/src/cpu/sparc/vm/templateTable_sparc.cpp
+++ b/hotspot/src/cpu/sparc/vm/templateTable_sparc.cpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -56,7 +56,6 @@
   assert(index == noreg || offset == 0, "only one offset");
   switch (barrier) {
 #if INCLUDE_ALL_GCS
-    case BarrierSet::G1SATBCT:
     case BarrierSet::G1SATBCTLogging:
       {
         // Load and record the previous value.
diff --git a/hotspot/src/cpu/x86/vm/c1_globals_x86.hpp b/hotspot/src/cpu/x86/vm/c1_globals_x86.hpp
index 5651684..2935a24 100644
--- a/hotspot/src/cpu/x86/vm/c1_globals_x86.hpp
+++ b/hotspot/src/cpu/x86/vm/c1_globals_x86.hpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -32,39 +32,39 @@
 // (see c1_globals.hpp)
 
 #ifndef TIERED
-define_pd_global(bool, BackgroundCompilation,        true );
-define_pd_global(bool, UseTLAB,                      true );
-define_pd_global(bool, ResizeTLAB,                   true );
-define_pd_global(bool, InlineIntrinsics,             true );
-define_pd_global(bool, PreferInterpreterNativeStubs, false);
-define_pd_global(bool, ProfileTraps,                 false);
-define_pd_global(bool, UseOnStackReplacement,        true );
-define_pd_global(bool, TieredCompilation,            false);
-define_pd_global(intx, CompileThreshold,             1500 );
+define_pd_global(bool, BackgroundCompilation,          true );
+define_pd_global(bool, UseTLAB,                        true );
+define_pd_global(bool, ResizeTLAB,                     true );
+define_pd_global(bool, InlineIntrinsics,               true );
+define_pd_global(bool, PreferInterpreterNativeStubs,   false);
+define_pd_global(bool, ProfileTraps,                   false);
+define_pd_global(bool, UseOnStackReplacement,          true );
+define_pd_global(bool, TieredCompilation,              false);
+define_pd_global(intx, CompileThreshold,               1500 );
 
-define_pd_global(intx, OnStackReplacePercentage,     933  );
-define_pd_global(intx, FreqInlineSize,               325  );
-define_pd_global(intx, NewSizeThreadIncrease,        4*K  );
-define_pd_global(intx, InitialCodeCacheSize,         160*K);
-define_pd_global(intx, ReservedCodeCacheSize,        32*M );
-define_pd_global(intx, NonProfiledCodeHeapSize,      13*M );
-define_pd_global(intx, ProfiledCodeHeapSize,         14*M );
-define_pd_global(intx, NonNMethodCodeHeapSize,       5*M  );
-define_pd_global(bool, ProfileInterpreter,           false);
-define_pd_global(intx, CodeCacheExpansionSize,       32*K );
-define_pd_global(uintx, CodeCacheMinBlockLength,     1);
-define_pd_global(uintx, CodeCacheMinimumUseSpace,    400*K);
-define_pd_global(uintx, MetaspaceSize,               12*M );
-define_pd_global(bool, NeverActAsServerClassMachine, true );
-define_pd_global(uint64_t,MaxRAM,                    1ULL*G);
-define_pd_global(bool, CICompileOSR,                 true );
+define_pd_global(intx,   OnStackReplacePercentage,     933  );
+define_pd_global(intx,   FreqInlineSize,               325  );
+define_pd_global(size_t, NewSizeThreadIncrease,        4*K  );
+define_pd_global(intx, InitialCodeCacheSize,           160*K);
+define_pd_global(intx, ReservedCodeCacheSize,          32*M );
+define_pd_global(intx, NonProfiledCodeHeapSize,        13*M );
+define_pd_global(intx, ProfiledCodeHeapSize,           14*M );
+define_pd_global(intx, NonNMethodCodeHeapSize,         5*M  );
+define_pd_global(bool,   ProfileInterpreter,           false);
+define_pd_global(intx, CodeCacheExpansionSize,         32*K );
+define_pd_global(uintx, CodeCacheMinBlockLength,       1    );
+define_pd_global(uintx, CodeCacheMinimumUseSpace,      400*K);
+define_pd_global(size_t, MetaspaceSize,                12*M );
+define_pd_global(bool,   NeverActAsServerClassMachine, true );
+define_pd_global(uint64_t, MaxRAM,                    1ULL*G);
+define_pd_global(bool,   CICompileOSR,                 true );
 #endif // !TIERED
-define_pd_global(bool, UseTypeProfile,               false);
-define_pd_global(bool, RoundFPResults,               true );
+define_pd_global(bool, UseTypeProfile,                 false);
+define_pd_global(bool, RoundFPResults,                 true );
 
-define_pd_global(bool, LIRFillDelaySlots,            false);
-define_pd_global(bool, OptimizeSinglePrecision,      true );
-define_pd_global(bool, CSEArrayLength,               false);
-define_pd_global(bool, TwoOperandLIRForm,            true );
+define_pd_global(bool, LIRFillDelaySlots,              false);
+define_pd_global(bool, OptimizeSinglePrecision,        true );
+define_pd_global(bool, CSEArrayLength,                 false);
+define_pd_global(bool, TwoOperandLIRForm,              true );
 
 #endif // CPU_X86_VM_C1_GLOBALS_X86_HPP
diff --git a/hotspot/src/cpu/x86/vm/c2_globals_x86.hpp b/hotspot/src/cpu/x86/vm/c2_globals_x86.hpp
index 461c5d1..a32e0a0 100644
--- a/hotspot/src/cpu/x86/vm/c2_globals_x86.hpp
+++ b/hotspot/src/cpu/x86/vm/c2_globals_x86.hpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 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
@@ -54,25 +54,25 @@
 #ifdef AMD64
 define_pd_global(intx, INTPRESSURE,                  13);
 define_pd_global(intx, InteriorEntryAlignment,       16);
-define_pd_global(intx, NewSizeThreadIncrease, ScaleForWordSize(4*K));
+define_pd_global(size_t, NewSizeThreadIncrease,      ScaleForWordSize(4*K));
 define_pd_global(intx, LoopUnrollLimit,              60);
 // InitialCodeCacheSize derived from specjbb2000 run.
 define_pd_global(intx, InitialCodeCacheSize,         2496*K); // Integral multiple of CodeCacheExpansionSize
 define_pd_global(intx, CodeCacheExpansionSize,       64*K);
 
 // Ergonomics related flags
-define_pd_global(uint64_t,MaxRAM,                    128ULL*G);
+define_pd_global(uint64_t, MaxRAM,                   128ULL*G);
 #else
 define_pd_global(intx, INTPRESSURE,                  6);
 define_pd_global(intx, InteriorEntryAlignment,       4);
-define_pd_global(intx, NewSizeThreadIncrease,        4*K);
+define_pd_global(size_t, NewSizeThreadIncrease,      4*K);
 define_pd_global(intx, LoopUnrollLimit,              50);     // Design center runs on 1.3.1
 // InitialCodeCacheSize derived from specjbb2000 run.
 define_pd_global(intx, InitialCodeCacheSize,         2304*K); // Integral multiple of CodeCacheExpansionSize
 define_pd_global(intx, CodeCacheExpansionSize,       32*K);
 
 // Ergonomics related flags
-define_pd_global(uint64_t,MaxRAM,                    4ULL*G);
+define_pd_global(uint64_t, MaxRAM,                   4ULL*G);
 #endif // AMD64
 define_pd_global(intx, RegisterCostAreaRatio,        16000);
 
@@ -93,7 +93,7 @@
 define_pd_global(bool,  TrapBasedRangeChecks,        false); // Not needed on x86.
 
 // Heap related flags
-define_pd_global(uintx,MetaspaceSize,    ScaleForWordSize(16*M));
+define_pd_global(size_t, MetaspaceSize,              ScaleForWordSize(16*M));
 
 // Ergonomics related flags
 define_pd_global(bool, NeverActAsServerClassMachine, false);
diff --git a/hotspot/src/cpu/x86/vm/globals_x86.hpp b/hotspot/src/cpu/x86/vm/globals_x86.hpp
index 81b3b81..a6d0fbb 100644
--- a/hotspot/src/cpu/x86/vm/globals_x86.hpp
+++ b/hotspot/src/cpu/x86/vm/globals_x86.hpp
@@ -78,7 +78,7 @@
 #endif
 
 // GC Ergo Flags
-define_pd_global(uintx, CMSYoungGenPerWorker, 64*M);  // default max size of CMS young gen, per GC worker thread
+define_pd_global(size_t, CMSYoungGenPerWorker, 64*M);  // default max size of CMS young gen, per GC worker thread
 
 define_pd_global(uintx, TypeProfileLevel, 111);
 
diff --git a/hotspot/src/cpu/x86/vm/stubGenerator_x86_32.cpp b/hotspot/src/cpu/x86/vm/stubGenerator_x86_32.cpp
index 086ac2f..3d8370f 100644
--- a/hotspot/src/cpu/x86/vm/stubGenerator_x86_32.cpp
+++ b/hotspot/src/cpu/x86/vm/stubGenerator_x86_32.cpp
@@ -706,7 +706,6 @@
     assert_different_registers(start, count);
     BarrierSet* bs = Universe::heap()->barrier_set();
     switch (bs->kind()) {
-      case BarrierSet::G1SATBCT:
       case BarrierSet::G1SATBCTLogging:
         // With G1, don't generate the call if we statically know that the target in uninitialized
         if (!uninitialized_target) {
@@ -739,7 +738,6 @@
     BarrierSet* bs = Universe::heap()->barrier_set();
     assert_different_registers(start, count);
     switch (bs->kind()) {
-      case BarrierSet::G1SATBCT:
       case BarrierSet::G1SATBCTLogging:
         {
           __ pusha();                      // push registers
diff --git a/hotspot/src/cpu/x86/vm/stubGenerator_x86_64.cpp b/hotspot/src/cpu/x86/vm/stubGenerator_x86_64.cpp
index 7f6dbc8..122f94b 100644
--- a/hotspot/src/cpu/x86/vm/stubGenerator_x86_64.cpp
+++ b/hotspot/src/cpu/x86/vm/stubGenerator_x86_64.cpp
@@ -1207,7 +1207,6 @@
   void  gen_write_ref_array_pre_barrier(Register addr, Register count, bool dest_uninitialized) {
     BarrierSet* bs = Universe::heap()->barrier_set();
     switch (bs->kind()) {
-      case BarrierSet::G1SATBCT:
       case BarrierSet::G1SATBCTLogging:
         // With G1, don't generate the call if we statically know that the target in uninitialized
         if (!dest_uninitialized) {
@@ -1252,7 +1251,6 @@
     assert_different_registers(start, count, scratch);
     BarrierSet* bs = Universe::heap()->barrier_set();
     switch (bs->kind()) {
-      case BarrierSet::G1SATBCT:
       case BarrierSet::G1SATBCTLogging:
         {
           __ pusha();             // push registers (overkill)
diff --git a/hotspot/src/cpu/x86/vm/templateTable_x86.cpp b/hotspot/src/cpu/x86/vm/templateTable_x86.cpp
index 7b6696e..f43903c 100644
--- a/hotspot/src/cpu/x86/vm/templateTable_x86.cpp
+++ b/hotspot/src/cpu/x86/vm/templateTable_x86.cpp
@@ -156,7 +156,6 @@
   assert(val == noreg || val == rax, "parameter is just for looks");
   switch (barrier) {
 #if INCLUDE_ALL_GCS
-    case BarrierSet::G1SATBCT:
     case BarrierSet::G1SATBCTLogging:
       {
         // flatten object address if needed
diff --git a/hotspot/src/cpu/zero/vm/globals_zero.hpp b/hotspot/src/cpu/zero/vm/globals_zero.hpp
index 7698a7a..9e2020e 100644
--- a/hotspot/src/cpu/zero/vm/globals_zero.hpp
+++ b/hotspot/src/cpu/zero/vm/globals_zero.hpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
  * Copyright 2007, 2008, 2009, 2010, 2011 Red Hat, Inc.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -57,7 +57,7 @@
 define_pd_global(bool,  UseMembar,            true);
 
 // GC Ergo Flags
-define_pd_global(uintx, CMSYoungGenPerWorker, 16*M);  // default max size of CMS young gen, per GC worker thread
+define_pd_global(size_t, CMSYoungGenPerWorker, 16*M);  // default max size of CMS young gen, per GC worker thread
 
 define_pd_global(uintx, TypeProfileLevel, 0);
 
diff --git a/hotspot/src/cpu/zero/vm/shark_globals_zero.hpp b/hotspot/src/cpu/zero/vm/shark_globals_zero.hpp
index 744a6ac..9d47811 100644
--- a/hotspot/src/cpu/zero/vm/shark_globals_zero.hpp
+++ b/hotspot/src/cpu/zero/vm/shark_globals_zero.hpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
  * Copyright 2008, 2009, 2010 Red Hat, Inc.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -50,7 +50,7 @@
 define_pd_global(intx,     OnStackReplacePercentage,     933  );
 define_pd_global(intx,     FreqInlineSize,               325  );
 define_pd_global(uintx,    NewRatio,                     12   );
-define_pd_global(intx,     NewSizeThreadIncrease,        4*K  );
+define_pd_global(size_t,   NewSizeThreadIncrease,        4*K  );
 define_pd_global(intx,     InitialCodeCacheSize,         160*K);
 define_pd_global(intx,     ReservedCodeCacheSize,        32*M );
 define_pd_global(intx,     NonProfiledCodeHeapSize,      13*M );
@@ -61,7 +61,7 @@
 define_pd_global(uintx,    CodeCacheMinBlockLength,      1    );
 define_pd_global(uintx,    CodeCacheMinimumUseSpace,     200*K);
 
-define_pd_global(uintx,    MetaspaceSize,                12*M );
+define_pd_global(size_t,   MetaspaceSize,                12*M );
 define_pd_global(bool,     NeverActAsServerClassMachine, true );
 define_pd_global(uint64_t, MaxRAM,                       1ULL*G);
 define_pd_global(bool,     CICompileOSR,                 true );
diff --git a/hotspot/src/os_cpu/aix_ppc/vm/globals_aix_ppc.hpp b/hotspot/src/os_cpu/aix_ppc/vm/globals_aix_ppc.hpp
index 73ff4b5..eeb6c15 100644
--- a/hotspot/src/os_cpu/aix_ppc/vm/globals_aix_ppc.hpp
+++ b/hotspot/src/os_cpu/aix_ppc/vm/globals_aix_ppc.hpp
@@ -40,13 +40,13 @@
 define_pd_global(intx, CompilerThreadStackSize,  4096);
 
 // Allow extra space in DEBUG builds for asserts.
-define_pd_global(uintx,JVMInvokeMethodSlack,     8192);
+define_pd_global(size_t, JVMInvokeMethodSlack,   8192);
 
 define_pd_global(intx, StackYellowPages,         6);
 define_pd_global(intx, StackRedPages,            1);
 define_pd_global(intx, StackShadowPages,         6 DEBUG_ONLY(+2));
 
 // Only used on 64 bit platforms
-define_pd_global(uintx,HeapBaseMinAddress,       2*G);
+define_pd_global(size_t, HeapBaseMinAddress,     2*G);
 
 #endif // OS_CPU_AIX_OJDKPPC_VM_GLOBALS_AIX_PPC_HPP
diff --git a/hotspot/src/os_cpu/bsd_x86/vm/globals_bsd_x86.hpp b/hotspot/src/os_cpu/bsd_x86/vm/globals_bsd_x86.hpp
index 4bc678e..3711f37 100644
--- a/hotspot/src/os_cpu/bsd_x86/vm/globals_bsd_x86.hpp
+++ b/hotspot/src/os_cpu/bsd_x86/vm/globals_bsd_x86.hpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 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
@@ -43,9 +43,9 @@
 
 define_pd_global(intx, CompilerThreadStackSize,  0);
 
-define_pd_global(uintx, JVMInvokeMethodSlack,    8192);
+define_pd_global(size_t, JVMInvokeMethodSlack,   8192);
 
 // Used on 64 bit platforms for UseCompressedOops base address
-define_pd_global(uintx, HeapBaseMinAddress,      2*G);
+define_pd_global(size_t, HeapBaseMinAddress,     2*G);
 
 #endif // OS_CPU_BSD_X86_VM_GLOBALS_BSD_X86_HPP
diff --git a/hotspot/src/os_cpu/bsd_zero/vm/globals_bsd_zero.hpp b/hotspot/src/os_cpu/bsd_zero/vm/globals_bsd_zero.hpp
index e7b7f55..057d4ac 100644
--- a/hotspot/src/os_cpu/bsd_zero/vm/globals_bsd_zero.hpp
+++ b/hotspot/src/os_cpu/bsd_zero/vm/globals_bsd_zero.hpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
  * Copyright 2007, 2008, 2010 Red Hat, Inc.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -39,9 +39,9 @@
 define_pd_global(intx,  VMThreadStackSize,       512);
 #endif // _LP64
 define_pd_global(intx,  CompilerThreadStackSize, 0);
-define_pd_global(uintx, JVMInvokeMethodSlack,    8192);
+define_pd_global(size_t, JVMInvokeMethodSlack,   8192);
 
 // Used on 64 bit platforms for UseCompressedOops base address
-define_pd_global(uintx, HeapBaseMinAddress,      2*G);
+define_pd_global(size_t, HeapBaseMinAddress,     2*G);
 
 #endif // OS_CPU_BSD_ZERO_VM_GLOBALS_BSD_ZERO_HPP
diff --git a/hotspot/src/os_cpu/linux_aarch64/vm/os_linux_aarch64.cpp b/hotspot/src/os_cpu/linux_aarch64/vm/os_linux_aarch64.cpp
index 11bd2f7..2d116ef 100644
--- a/hotspot/src/os_cpu/linux_aarch64/vm/os_linux_aarch64.cpp
+++ b/hotspot/src/os_cpu/linux_aarch64/vm/os_linux_aarch64.cpp
@@ -116,6 +116,14 @@
 #endif
 }
 
+void os::Linux::ucontext_set_pc(ucontext_t * uc, address pc) {
+#ifdef BUILTIN_SIM
+  uc->uc_mcontext.gregs[REG_PC] = (intptr_t)pc;
+#else
+  uc->uc_mcontext.pc = (intptr_t)pc;
+#endif
+}
+
 intptr_t* os::Linux::ucontext_get_sp(ucontext_t * uc) {
 #ifdef BUILTIN_SIM
   return (intptr_t*)uc->uc_mcontext.gregs[REG_SP];
@@ -311,7 +319,7 @@
     }
 #else
     if (StubRoutines::is_safefetch_fault(pc)) {
-      uc->uc_mcontext.pc = intptr_t(StubRoutines::continuation_for_safefetch_fault(pc));
+      os::Linux::ucontext_set_pc(uc, StubRoutines::continuation_for_safefetch_fault(pc));
       return 1;
     }
 #endif
@@ -432,11 +440,7 @@
     // save all thread context in case we need to restore it
     if (thread != NULL) thread->set_saved_exception_pc(pc);
 
-#ifdef BUILTIN_SIM
-    uc->uc_mcontext.gregs[REG_PC] = (greg_t)stub;
-#else
-    uc->uc_mcontext.pc = (__u64)stub;
-#endif
+    os::Linux::ucontext_set_pc(uc, stub);
     return true;
   }
 
diff --git a/hotspot/src/os_cpu/linux_ppc/vm/globals_linux_ppc.hpp b/hotspot/src/os_cpu/linux_ppc/vm/globals_linux_ppc.hpp
index ae7541e..d9240d2 100644
--- a/hotspot/src/os_cpu/linux_ppc/vm/globals_linux_ppc.hpp
+++ b/hotspot/src/os_cpu/linux_ppc/vm/globals_linux_ppc.hpp
@@ -40,13 +40,13 @@
 define_pd_global(intx, CompilerThreadStackSize,  4096);
 
 // Allow extra space in DEBUG builds for asserts.
-define_pd_global(uintx,JVMInvokeMethodSlack,     8192);
+define_pd_global(size_t, JVMInvokeMethodSlack,   8192);
 
 define_pd_global(intx, StackYellowPages,         6);
 define_pd_global(intx, StackRedPages,            1);
 define_pd_global(intx, StackShadowPages,         6 DEBUG_ONLY(+2));
 
 // Only used on 64 bit platforms
-define_pd_global(uintx,HeapBaseMinAddress,       2*G);
+define_pd_global(size_t, HeapBaseMinAddress,     2*G);
 
 #endif // OS_CPU_LINUX_PPC_VM_GLOBALS_LINUX_PPC_HPP
diff --git a/hotspot/src/os_cpu/linux_sparc/vm/globals_linux_sparc.hpp b/hotspot/src/os_cpu/linux_sparc/vm/globals_linux_sparc.hpp
index b3a215d..bc3c7f0 100644
--- a/hotspot/src/os_cpu/linux_sparc/vm/globals_linux_sparc.hpp
+++ b/hotspot/src/os_cpu/linux_sparc/vm/globals_linux_sparc.hpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 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
@@ -30,10 +30,10 @@
 // runtime system.  (see globals.hpp)
 //
 
-define_pd_global(uintx, JVMInvokeMethodSlack,    12288);
+define_pd_global(size_t, JVMInvokeMethodSlack,   12288);
 define_pd_global(intx, CompilerThreadStackSize,  0);
 
 // Used on 64 bit platforms for UseCompressedOops base address
-define_pd_global(uintx, HeapBaseMinAddress,      CONST64(4)*G);
+define_pd_global(size_t, HeapBaseMinAddress,     CONST64(4)*G);
 
 #endif // OS_CPU_LINUX_SPARC_VM_GLOBALS_LINUX_SPARC_HPP
diff --git a/hotspot/src/os_cpu/linux_x86/vm/globals_linux_x86.hpp b/hotspot/src/os_cpu/linux_x86/vm/globals_linux_x86.hpp
index 4ecaeee..b123d90 100644
--- a/hotspot/src/os_cpu/linux_x86/vm/globals_linux_x86.hpp
+++ b/hotspot/src/os_cpu/linux_x86/vm/globals_linux_x86.hpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 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
@@ -42,9 +42,9 @@
 
 define_pd_global(intx, CompilerThreadStackSize,  0);
 
-define_pd_global(uintx,JVMInvokeMethodSlack,     8192);
+define_pd_global(size_t, JVMInvokeMethodSlack,   8192);
 
 // Used on 64 bit platforms for UseCompressedOops base address
-define_pd_global(uintx,HeapBaseMinAddress,       2*G);
+define_pd_global(size_t, HeapBaseMinAddress,     2*G);
 
 #endif // OS_CPU_LINUX_X86_VM_GLOBALS_LINUX_X86_HPP
diff --git a/hotspot/src/os_cpu/linux_zero/vm/globals_linux_zero.hpp b/hotspot/src/os_cpu/linux_zero/vm/globals_linux_zero.hpp
index 663f0ac..f1b6d21 100644
--- a/hotspot/src/os_cpu/linux_zero/vm/globals_linux_zero.hpp
+++ b/hotspot/src/os_cpu/linux_zero/vm/globals_linux_zero.hpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
  * Copyright 2007, 2008, 2010 Red Hat, Inc.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -39,9 +39,9 @@
 define_pd_global(intx,  VMThreadStackSize,       512);
 #endif // _LP64
 define_pd_global(intx,  CompilerThreadStackSize, 0);
-define_pd_global(uintx, JVMInvokeMethodSlack,    8192);
+define_pd_global(size_t, JVMInvokeMethodSlack,   8192);
 
 // Used on 64 bit platforms for UseCompressedOops base address
-define_pd_global(uintx, HeapBaseMinAddress,      2*G);
+define_pd_global(size_t, HeapBaseMinAddress,     2*G);
 
 #endif // OS_CPU_LINUX_ZERO_VM_GLOBALS_LINUX_ZERO_HPP
diff --git a/hotspot/src/os_cpu/solaris_sparc/vm/globals_solaris_sparc.hpp b/hotspot/src/os_cpu/solaris_sparc/vm/globals_solaris_sparc.hpp
index 30c955d..fa63ce0 100644
--- a/hotspot/src/os_cpu/solaris_sparc/vm/globals_solaris_sparc.hpp
+++ b/hotspot/src/os_cpu/solaris_sparc/vm/globals_solaris_sparc.hpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 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
@@ -30,16 +30,16 @@
 // (see globals.hpp)
 //
 
-define_pd_global(uintx, JVMInvokeMethodSlack,    12288);
+define_pd_global(size_t, JVMInvokeMethodSlack,   12288);
 define_pd_global(intx, CompilerThreadStackSize,  0);
 
 // Used on 64 bit platforms for UseCompressedOops base address
 #ifdef _LP64
 // use 6G as default base address because by default the OS maps the application
 // to 4G on Solaris-Sparc. This leaves at least 2G for the native heap.
-define_pd_global(uintx, HeapBaseMinAddress,      CONST64(6)*G);
+define_pd_global(size_t, HeapBaseMinAddress,     CONST64(6)*G);
 #else
-define_pd_global(uintx, HeapBaseMinAddress,      2*G);
+define_pd_global(size_t, HeapBaseMinAddress,     2*G);
 #endif
 
 
diff --git a/hotspot/src/os_cpu/solaris_x86/vm/globals_solaris_x86.hpp b/hotspot/src/os_cpu/solaris_x86/vm/globals_solaris_x86.hpp
index e6329c2..0c3016e 100644
--- a/hotspot/src/os_cpu/solaris_x86/vm/globals_solaris_x86.hpp
+++ b/hotspot/src/os_cpu/solaris_x86/vm/globals_solaris_x86.hpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -32,18 +32,18 @@
 #ifdef AMD64
 define_pd_global(intx, ThreadStackSize,          1024); // 0 => use system default
 define_pd_global(intx, VMThreadStackSize,        1024);
-define_pd_global(uintx,JVMInvokeMethodSlack,     8*K);
+define_pd_global(size_t, JVMInvokeMethodSlack,   8*K);
 #else
 // ThreadStackSize 320 allows a couple of test cases to run while
 // keeping the number of threads that can be created high.
 define_pd_global(intx, ThreadStackSize,          320);
 define_pd_global(intx, VMThreadStackSize,        512);
-define_pd_global(uintx,JVMInvokeMethodSlack,     10*K);
+define_pd_global(size_t, JVMInvokeMethodSlack,   10*K);
 #endif // AMD64
 
 define_pd_global(intx, CompilerThreadStackSize,  0);
 
 // Used on 64 bit platforms for UseCompressedOops base address
-define_pd_global(uintx,HeapBaseMinAddress,       2*G);
+define_pd_global(size_t, HeapBaseMinAddress,     2*G);
 
 #endif // OS_CPU_SOLARIS_X86_VM_GLOBALS_SOLARIS_X86_HPP
diff --git a/hotspot/src/os_cpu/windows_x86/vm/globals_windows_x86.hpp b/hotspot/src/os_cpu/windows_x86/vm/globals_windows_x86.hpp
index de91c32..aa1734e 100644
--- a/hotspot/src/os_cpu/windows_x86/vm/globals_windows_x86.hpp
+++ b/hotspot/src/os_cpu/windows_x86/vm/globals_windows_x86.hpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 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
@@ -43,9 +43,9 @@
 define_pd_global(intx, CompilerThreadStackSize,  0);
 #endif
 
-define_pd_global(uintx, JVMInvokeMethodSlack,    8192);
+define_pd_global(size_t, JVMInvokeMethodSlack,   8192);
 
 // Used on 64 bit platforms for UseCompressedOops base address
-define_pd_global(uintx, HeapBaseMinAddress,      2*G);
+define_pd_global(size_t, HeapBaseMinAddress,     2*G);
 
 #endif // OS_CPU_WINDOWS_X86_VM_GLOBALS_WINDOWS_X86_HPP
diff --git a/hotspot/src/share/vm/c1/c1_LIRGenerator.cpp b/hotspot/src/share/vm/c1/c1_LIRGenerator.cpp
index ea745dd..d040cca 100644
--- a/hotspot/src/share/vm/c1/c1_LIRGenerator.cpp
+++ b/hotspot/src/share/vm/c1/c1_LIRGenerator.cpp
@@ -1421,7 +1421,6 @@
   // Do the pre-write barrier, if any.
   switch (_bs->kind()) {
 #if INCLUDE_ALL_GCS
-    case BarrierSet::G1SATBCT:
     case BarrierSet::G1SATBCTLogging:
       G1SATBCardTableModRef_pre_barrier(addr_opr, pre_val, do_load, patch, info);
       break;
@@ -1442,7 +1441,6 @@
 void LIRGenerator::post_barrier(LIR_OprDesc* addr, LIR_OprDesc* new_val) {
   switch (_bs->kind()) {
 #if INCLUDE_ALL_GCS
-    case BarrierSet::G1SATBCT:
     case BarrierSet::G1SATBCTLogging:
       G1SATBCardTableModRef_post_barrier(addr,  new_val);
       break;
diff --git a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.cpp b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.cpp
index 2264559..a64ca88 100644
--- a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.cpp
+++ b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.cpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 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
@@ -186,7 +186,7 @@
       cp->space->set_compaction_top(compact_top);
       cp->space = cp->space->next_compaction_space();
       if (cp->space == NULL) {
-        cp->gen = GenCollectedHeap::heap()->prev_gen(cp->gen);
+        cp->gen = GenCollectedHeap::heap()->young_gen();
         assert(cp->gen != NULL, "compaction must succeed");
         cp->space = cp->gen->first_compaction_space();
         assert(cp->space != NULL, "generation must have a first compaction space");
@@ -900,7 +900,6 @@
   }
 }
 
-
 // Callers of this iterator beware: The closure application should
 // be robust in the face of uninitialized objects and should (always)
 // return a correct size so that the next addr + size below gives us a
@@ -2663,8 +2662,8 @@
       // Need to smooth wrt historical average
       if (ResizeOldPLAB) {
         _blocks_to_claim[i].sample(
-          MAX2((size_t)CMSOldPLABMin,
-          MIN2((size_t)CMSOldPLABMax,
+          MAX2(CMSOldPLABMin,
+          MIN2(CMSOldPLABMax,
                _global_num_blocks[i]/(_global_num_workers[i]*CMSOldPLABNumRefills))));
       }
       // Reset counters for next round
diff --git a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.hpp b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.hpp
index b33bdc7..4c6fb3c 100644
--- a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.hpp
+++ b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.hpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 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
@@ -36,7 +36,9 @@
 // space, in this case a CompactibleFreeListSpace.
 
 // Forward declarations
+class CMSCollector;
 class CompactibleFreeListSpace;
+class ConcurrentMarkSweepGeneration;
 class BlkClosure;
 class BlkClosureCareful;
 class FreeChunk;
@@ -396,6 +398,10 @@
   // Resizing support
   void set_end(HeapWord* value);  // override
 
+  // Never mangle CompactibleFreeListSpace
+  void mangle_unused_area() {}
+  void mangle_unused_area_complete() {}
+
   // Mutual exclusion support
   Mutex* freelistLock() const { return &_freelistLock; }
 
diff --git a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp
index c89cbed..e273c20 100644
--- a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp
+++ b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp
@@ -369,7 +369,7 @@
 double CMSStats::time_until_cms_gen_full() const {
   size_t cms_free = _cms_gen->cmsSpace()->free();
   GenCollectedHeap* gch = GenCollectedHeap::heap();
-  size_t expected_promotion = MIN2(gch->get_gen(0)->capacity(),
+  size_t expected_promotion = MIN2(gch->young_gen()->capacity(),
                                    (size_t) _cms_gen->gc_stats()->avg_promoted()->padded_average());
   if (cms_free > expected_promotion) {
     // Start a cms collection if there isn't enough space to promote
@@ -506,7 +506,7 @@
   _collector_policy(cp),
   _should_unload_classes(CMSClassUnloadingEnabled),
   _concurrent_cycles_since_last_unload(0),
-  _roots_scanning_options(SharedHeap::SO_None),
+  _roots_scanning_options(GenCollectedHeap::SO_None),
   _inter_sweep_estimate(CMS_SweepWeight, CMS_SweepPadding),
   _intra_sweep_estimate(CMS_SweepWeight, CMS_SweepPadding),
   _gc_tracer_cm(new (ResourceObj::C_HEAP, mtGC) CMSTracer()),
@@ -626,8 +626,8 @@
 
   // Support for parallelizing young gen rescan
   GenCollectedHeap* gch = GenCollectedHeap::heap();
-  assert(gch->prev_gen(_cmsGen)->kind() == Generation::ParNew, "CMS can only be used with ParNew");
-  _young_gen = (ParNewGeneration*)gch->prev_gen(_cmsGen);
+  assert(gch->young_gen()->kind() == Generation::ParNew, "CMS can only be used with ParNew");
+  _young_gen = (ParNewGeneration*)gch->young_gen();
   if (gch->supports_inline_contig_alloc()) {
     _top_addr = gch->top_addr();
     _end_addr = gch->end_addr();
@@ -869,7 +869,7 @@
       if (prev_level >= 0) {
         size_t prev_size = 0;
         GenCollectedHeap* gch = GenCollectedHeap::heap();
-        Generation* prev_gen = gch->get_gen(prev_level);
+        Generation* prev_gen = gch->young_gen();
         prev_size = prev_gen->capacity();
           gclog_or_tty->print_cr("  Younger gen size "SIZE_FORMAT,
                                  prev_size/1000);
@@ -1049,11 +1049,8 @@
     // expand and retry
     size_t s = _cmsSpace->expansionSpaceRequired(obj_size);  // HeapWords
     expand_for_gc_cause(s*HeapWordSize, MinHeapDeltaBytes, CMSExpansionCause::_satisfy_promotion);
-    // Since there's currently no next generation, we don't try to promote
+    // Since this is the old generation, we don't try to promote
     // into a more senior generation.
-    assert(next_gen() == NULL, "assumption, based upon which no attempt "
-                               "is made to pass on a possibly failing "
-                               "promotion to next generation");
     res = _cmsSpace->promote(obj, obj_size);
   }
   if (res != NULL) {
@@ -2499,7 +2496,7 @@
   gch->gen_process_roots(_cmsGen->level(),
                          true,   // younger gens are roots
                          true,   // activate StrongRootsScope
-                         SharedHeap::ScanningOption(roots_scanning_options()),
+                         GenCollectedHeap::ScanningOption(roots_scanning_options()),
                          should_unload_classes(),
                          &notOlder,
                          NULL,
@@ -2567,7 +2564,7 @@
   gch->gen_process_roots(_cmsGen->level(),
                          true,   // younger gens are roots
                          true,   // activate StrongRootsScope
-                         SharedHeap::ScanningOption(roots_scanning_options()),
+                         GenCollectedHeap::ScanningOption(roots_scanning_options()),
                          should_unload_classes(),
                          &notOlder,
                          NULL,
@@ -2751,7 +2748,7 @@
 void CMSCollector::setup_cms_unloading_and_verification_state() {
   const  bool should_verify =   VerifyBeforeGC || VerifyAfterGC || VerifyDuringGC
                              || VerifyBeforeExit;
-  const  int  rso           =   SharedHeap::SO_AllCodeCache;
+  const  int  rso           =   GenCollectedHeap::SO_AllCodeCache;
 
   // We set the proper root for this CMS cycle here.
   if (should_unload_classes()) {   // Should unload classes this cycle
@@ -3000,7 +2997,6 @@
   report_heap_summary(GCWhen::BeforeGC);
 
   ReferenceProcessor* rp = ref_processor();
-  SpecializationStats::clear();
   assert(_restart_addr == NULL, "Control point invariant");
   {
     // acquire locks for subsequent manipulations
@@ -3011,7 +3007,6 @@
     rp->enable_discovery();
     _collectorState = Marking;
   }
-  SpecializationStats::print();
 }
 
 void CMSCollector::checkpointRootsInitialWork() {
@@ -3092,7 +3087,7 @@
       gch->gen_process_roots(_cmsGen->level(),
                              true,   // younger gens are roots
                              true,   // activate StrongRootsScope
-                             SharedHeap::ScanningOption(roots_scanning_options()),
+                             GenCollectedHeap::ScanningOption(roots_scanning_options()),
                              should_unload_classes(),
                              &notOlder,
                              NULL,
@@ -4329,7 +4324,6 @@
   verify_work_stacks_empty();
   verify_overflow_empty();
 
-  SpecializationStats::clear();
   if (PrintGCDetails) {
     gclog_or_tty->print("[YG occupancy: "SIZE_FORMAT" K ("SIZE_FORMAT" K)]",
                         _young_gen->used() / K,
@@ -4360,7 +4354,6 @@
   }
   verify_work_stacks_empty();
   verify_overflow_empty();
-  SpecializationStats::print();
 }
 
 void CMSCollector::checkpointRootsFinalWork() {
@@ -4528,13 +4521,13 @@
   gch->gen_process_roots(_collector->_cmsGen->level(),
                          false,     // yg was scanned above
                          false,     // this is parallel code
-                         SharedHeap::ScanningOption(_collector->CMSCollector::roots_scanning_options()),
+                         GenCollectedHeap::ScanningOption(_collector->CMSCollector::roots_scanning_options()),
                          _collector->should_unload_classes(),
                          &par_mri_cl,
                          NULL,
                          &cld_closure);
   assert(_collector->should_unload_classes()
-         || (_collector->CMSCollector::roots_scanning_options() & SharedHeap::SO_AllCodeCache),
+         || (_collector->CMSCollector::roots_scanning_options() & GenCollectedHeap::SO_AllCodeCache),
          "if we didn't scan the code cache, we have to be ready to drop nmethods with expired weak oops");
   _timer.stop();
   if (PrintCMSStatistics != 0) {
@@ -4664,14 +4657,14 @@
   gch->gen_process_roots(_collector->_cmsGen->level(),
                          false,     // yg was scanned above
                          false,     // this is parallel code
-                         SharedHeap::ScanningOption(_collector->CMSCollector::roots_scanning_options()),
+                         GenCollectedHeap::ScanningOption(_collector->CMSCollector::roots_scanning_options()),
                          _collector->should_unload_classes(),
                          &par_mrias_cl,
                          NULL,
                          NULL);     // The dirty klasses will be handled below
 
   assert(_collector->should_unload_classes()
-         || (_collector->CMSCollector::roots_scanning_options() & SharedHeap::SO_AllCodeCache),
+         || (_collector->CMSCollector::roots_scanning_options() & GenCollectedHeap::SO_AllCodeCache),
          "if we didn't scan the code cache, we have to be ready to drop nmethods with expired weak oops");
   _timer.stop();
   if (PrintCMSStatistics != 0) {
@@ -5255,14 +5248,14 @@
     gch->gen_process_roots(_cmsGen->level(),
                            true,  // younger gens as roots
                            false, // use the local StrongRootsScope
-                           SharedHeap::ScanningOption(roots_scanning_options()),
+                           GenCollectedHeap::ScanningOption(roots_scanning_options()),
                            should_unload_classes(),
                            &mrias_cl,
                            NULL,
                            NULL); // The dirty klasses will be handled below
 
     assert(should_unload_classes()
-           || (roots_scanning_options() & SharedHeap::SO_AllCodeCache),
+           || (roots_scanning_options() & GenCollectedHeap::SO_AllCodeCache),
            "if we didn't scan the code cache, we have to be ready to drop nmethods with expired weak oops");
   }
 
diff --git a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.hpp b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.hpp
index 98f13cb..c316db8 100644
--- a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.hpp
+++ b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.hpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 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
@@ -25,6 +25,7 @@
 #ifndef SHARE_VM_GC_IMPLEMENTATION_CONCURRENTMARKSWEEP_CONCURRENTMARKSWEEPGENERATION_HPP
 #define SHARE_VM_GC_IMPLEMENTATION_CONCURRENTMARKSWEEP_CONCURRENTMARKSWEEPGENERATION_HPP
 
+#include "gc_implementation/concurrentMarkSweep/cmsOopClosures.hpp"
 #include "gc_implementation/shared/gcHeapSummary.hpp"
 #include "gc_implementation/shared/gSpaceCounters.hpp"
 #include "gc_implementation/shared/gcStats.hpp"
@@ -55,6 +56,7 @@
 // means of a sliding mark-compact.
 
 class AdaptiveSizePolicy;
+class CMSCollector;
 class CMSConcMarkingTask;
 class CMSGCAdaptivePolicyCounters;
 class CMSTracer;
@@ -64,6 +66,7 @@
 class ConcurrentMarkSweepThread;
 class CompactibleFreeListSpace;
 class FreeChunk;
+class ParNewGeneration;
 class PromotionInfo;
 class ScanMarkedObjectsAgainCarefullyClosure;
 class TenuredGeneration;
diff --git a/hotspot/src/share/vm/gc_implementation/g1/concurrentMark.cpp b/hotspot/src/share/vm/gc_implementation/g1/concurrentMark.cpp
index eeaf897..c91b5bc 100644
--- a/hotspot/src/share/vm/gc_implementation/g1/concurrentMark.cpp
+++ b/hotspot/src/share/vm/gc_implementation/g1/concurrentMark.cpp
@@ -696,32 +696,32 @@
   }
 
   if (FLAG_IS_DEFAULT(MarkStackSize)) {
-    uintx mark_stack_size =
+    size_t mark_stack_size =
       MIN2(MarkStackSizeMax,
-          MAX2(MarkStackSize, (uintx) (parallel_marking_threads() * TASKQUEUE_SIZE)));
+          MAX2(MarkStackSize, (size_t) (parallel_marking_threads() * TASKQUEUE_SIZE)));
     // Verify that the calculated value for MarkStackSize is in range.
     // It would be nice to use the private utility routine from Arguments.
     if (!(mark_stack_size >= 1 && mark_stack_size <= MarkStackSizeMax)) {
-      warning("Invalid value calculated for MarkStackSize (" UINTX_FORMAT "): "
-              "must be between " UINTX_FORMAT " and " UINTX_FORMAT,
-              mark_stack_size, (uintx) 1, MarkStackSizeMax);
+      warning("Invalid value calculated for MarkStackSize (" SIZE_FORMAT "): "
+              "must be between 1 and " SIZE_FORMAT,
+              mark_stack_size, MarkStackSizeMax);
       return;
     }
-    FLAG_SET_ERGO(uintx, MarkStackSize, mark_stack_size);
+    FLAG_SET_ERGO(size_t, MarkStackSize, mark_stack_size);
   } else {
     // Verify MarkStackSize is in range.
     if (FLAG_IS_CMDLINE(MarkStackSize)) {
       if (FLAG_IS_DEFAULT(MarkStackSizeMax)) {
         if (!(MarkStackSize >= 1 && MarkStackSize <= MarkStackSizeMax)) {
-          warning("Invalid value specified for MarkStackSize (" UINTX_FORMAT "): "
-                  "must be between " UINTX_FORMAT " and " UINTX_FORMAT,
-                  MarkStackSize, (uintx) 1, MarkStackSizeMax);
+          warning("Invalid value specified for MarkStackSize (" SIZE_FORMAT "): "
+                  "must be between 1 and " SIZE_FORMAT,
+                  MarkStackSize, MarkStackSizeMax);
           return;
         }
       } else if (FLAG_IS_CMDLINE(MarkStackSizeMax)) {
         if (!(MarkStackSize >= 1 && MarkStackSize <= MarkStackSizeMax)) {
-          warning("Invalid value specified for MarkStackSize (" UINTX_FORMAT ")"
-                  " or for MarkStackSizeMax (" UINTX_FORMAT ")",
+          warning("Invalid value specified for MarkStackSize (" SIZE_FORMAT ")"
+                  " or for MarkStackSizeMax (" SIZE_FORMAT ")",
                   MarkStackSize, MarkStackSizeMax);
           return;
         }
@@ -745,7 +745,7 @@
   // so that the assertion in MarkingTaskQueue::task_queue doesn't fail
   _active_tasks = _max_worker_id;
 
-  size_t max_regions = (size_t) _g1h->max_regions();
+  uint max_regions = _g1h->max_regions();
   for (uint i = 0; i < _max_worker_id; ++i) {
     CMTaskQueue* task_queue = new CMTaskQueue();
     task_queue->initialize();
diff --git a/hotspot/src/share/vm/gc_implementation/g1/concurrentMark.hpp b/hotspot/src/share/vm/gc_implementation/g1/concurrentMark.hpp
index c878317..be9773b 100644
--- a/hotspot/src/share/vm/gc_implementation/g1/concurrentMark.hpp
+++ b/hotspot/src/share/vm/gc_implementation/g1/concurrentMark.hpp
@@ -34,6 +34,7 @@
 class G1CollectedHeap;
 class CMBitMap;
 class CMTask;
+class ConcurrentMark;
 typedef GenericTaskQueue<oop, mtGC>            CMTaskQueue;
 typedef GenericTaskQueueSet<CMTaskQueue, mtGC> CMTaskQueueSet;
 
diff --git a/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp b/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp
index 6109605..a9ef5dc 100644
--- a/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp
+++ b/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp
@@ -48,6 +48,7 @@
 #include "gc_implementation/g1/g1ParScanThreadState.inline.hpp"
 #include "gc_implementation/g1/g1RegionToSpaceMapper.hpp"
 #include "gc_implementation/g1/g1RemSet.inline.hpp"
+#include "gc_implementation/g1/g1RootProcessor.hpp"
 #include "gc_implementation/g1/g1StringDedup.hpp"
 #include "gc_implementation/g1/g1YCTypes.hpp"
 #include "gc_implementation/g1/heapRegion.inline.hpp"
@@ -89,18 +90,6 @@
 // apply to TLAB allocation, which is not part of this interface: it
 // is done by clients of this interface.)
 
-// Notes on implementation of parallelism in different tasks.
-//
-// G1ParVerifyTask uses heap_region_par_iterate() for parallelism.
-// The number of GC workers is passed to heap_region_par_iterate().
-// It does use run_task() which sets _n_workers in the task.
-// G1ParTask executes g1_process_roots() ->
-// SharedHeap::process_roots() which calls eventually to
-// CardTableModRefBS::par_non_clean_card_iterate_work() which uses
-// SequentialSubTasksDone.  SharedHeap::process_roots() also
-// directly uses SubTasksDone (_process_strong_tasks field in SharedHeap).
-//
-
 // Local to this file.
 
 class RefineCardTableEntryClosure: public CardTableEntryClosure {
@@ -1767,7 +1756,6 @@
   _is_alive_closure_stw(this),
   _ref_processor_cm(NULL),
   _ref_processor_stw(NULL),
-  _process_strong_tasks(new SubTasksDone(G1H_PS_NumElements)),
   _bot_shared(NULL),
   _evac_failure_scan_stack(NULL),
   _mark_in_progress(false),
@@ -1801,9 +1789,6 @@
   _gc_tracer_cm(new (ResourceObj::C_HEAP, mtGC) G1OldTracer()) {
 
   _g1h = this;
-  if (_process_strong_tasks == NULL || !_process_strong_tasks->valid()) {
-    vm_exit_during_initialization("Failed necessary allocation.");
-  }
 
   _allocator = G1Allocator::create_allocator(_g1h);
   _humongous_object_threshold_in_words = HeapRegion::GrainWords / 2;
@@ -2026,10 +2011,6 @@
                                              Shared_DirtyCardQ_lock,
                                              &JavaThread::dirty_card_queue_set());
 
-  // In case we're keeping closure specialization stats, initialize those
-  // counts and that mechanism.
-  SpecializationStats::clear();
-
   // Here we allocate the dummy HeapRegion that is required by the
   // G1AllocRegion class.
   HeapRegion* dummy_region = _hrm.get_dummy_region();
@@ -2206,11 +2187,11 @@
   hot_card_cache->drain(worker_i, g1_rem_set(), into_cset_dcq);
 
   DirtyCardQueueSet& dcqs = JavaThread::dirty_card_queue_set();
-  int n_completed_buffers = 0;
+  size_t n_completed_buffers = 0;
   while (dcqs.apply_closure_to_completed_buffer(cl, worker_i, 0, true)) {
     n_completed_buffers++;
   }
-  g1_policy()->phase_times()->record_update_rs_processed_buffers(worker_i, n_completed_buffers);
+  g1_policy()->phase_times()->record_thread_work_item(G1GCPhaseTimes::UpdateRS, worker_i, n_completed_buffers);
   dcqs.clear_n_completed_buffers();
   assert(!dcqs.completed_buffers_exist_dirty(), "Completed buffers exist!");
 }
@@ -3111,11 +3092,12 @@
     G1VerifyCodeRootOopClosure codeRootsCl(this, &rootsCl, vo);
     G1VerifyCodeRootBlobClosure blobsCl(&codeRootsCl);
 
-    process_all_roots(true,            // activate StrongRootsScope
-                      SO_AllCodeCache, // roots scanning options
-                      &rootsCl,
-                      &cldCl,
-                      &blobsCl);
+    {
+      G1RootProcessor root_processor(this);
+      root_processor.process_all_roots(&rootsCl,
+                                       &cldCl,
+                                       &blobsCl);
+    }
 
     bool failures = rootsCl.failures() || codeRootsCl.failures();
 
@@ -3321,7 +3303,6 @@
     concurrent_mark()->print_summary_info();
   }
   g1_policy()->print_yg_surv_rate_info();
-  SpecializationStats::print();
 }
 
 #ifndef PRODUCT
@@ -3751,9 +3732,9 @@
 
     TraceCPUTime tcpu(G1Log::finer(), true, gclog_or_tty);
 
-    int active_workers = workers()->active_workers();
+    uint active_workers = workers()->active_workers();
     double pause_start_sec = os::elapsedTime();
-    g1_policy()->phase_times()->note_gc_start(active_workers);
+    g1_policy()->phase_times()->note_gc_start(active_workers, mark_in_progress());
     log_gc_header();
 
     TraceCollectorStats tcs(g1mm()->incremental_collection_counters());
@@ -4365,60 +4346,11 @@
   }
 };
 
-class G1CodeBlobClosure : public CodeBlobClosure {
-  class HeapRegionGatheringOopClosure : public OopClosure {
-    G1CollectedHeap* _g1h;
-    OopClosure* _work;
-    nmethod* _nm;
-
-    template <typename T>
-    void do_oop_work(T* p) {
-      _work->do_oop(p);
-      T oop_or_narrowoop = oopDesc::load_heap_oop(p);
-      if (!oopDesc::is_null(oop_or_narrowoop)) {
-        oop o = oopDesc::decode_heap_oop_not_null(oop_or_narrowoop);
-        HeapRegion* hr = _g1h->heap_region_containing_raw(o);
-        assert(!_g1h->obj_in_cs(o) || hr->rem_set()->strong_code_roots_list_contains(_nm), "if o still in CS then evacuation failed and nm must already be in the remset");
-        hr->add_strong_code_root(_nm);
-      }
-    }
-
-  public:
-    HeapRegionGatheringOopClosure(OopClosure* oc) : _g1h(G1CollectedHeap::heap()), _work(oc), _nm(NULL) {}
-
-    void do_oop(oop* o) {
-      do_oop_work(o);
-    }
-
-    void do_oop(narrowOop* o) {
-      do_oop_work(o);
-    }
-
-    void set_nm(nmethod* nm) {
-      _nm = nm;
-    }
-  };
-
-  HeapRegionGatheringOopClosure _oc;
-public:
-  G1CodeBlobClosure(OopClosure* oc) : _oc(oc) {}
-
-  void do_code_blob(CodeBlob* cb) {
-    nmethod* nm = cb->as_nmethod_or_null();
-    if (nm != NULL) {
-      if (!nm->test_set_oops_do_mark()) {
-        _oc.set_nm(nm);
-        nm->oops_do(&_oc);
-        nm->fix_oop_relocations();
-      }
-    }
-  }
-};
-
 class G1ParTask : public AbstractGangTask {
 protected:
   G1CollectedHeap*       _g1h;
   RefToScanQueueSet      *_queues;
+  G1RootProcessor*       _root_processor;
   ParallelTaskTerminator _terminator;
   uint _n_workers;
 
@@ -4426,10 +4358,11 @@
   Mutex* stats_lock() { return &_stats_lock; }
 
 public:
-  G1ParTask(G1CollectedHeap* g1h, RefToScanQueueSet *task_queues)
+  G1ParTask(G1CollectedHeap* g1h, RefToScanQueueSet *task_queues, G1RootProcessor* root_processor)
     : AbstractGangTask("G1 collection"),
       _g1h(g1h),
       _queues(task_queues),
+      _root_processor(root_processor),
       _terminator(0, _queues),
       _stats_lock(Mutex::leaf, "parallel G1 stats lock", true)
   {}
@@ -4443,13 +4376,7 @@
   ParallelTaskTerminator* terminator() { return &_terminator; }
 
   virtual void set_for_termination(int active_workers) {
-    // This task calls set_n_termination() in par_non_clean_card_iterate_work()
-    // in the young space (_par_seq_tasks) in the G1 heap
-    // for SequentialSubTasksDone.
-    // This task also uses SubTasksDone in SharedHeap and G1CollectedHeap
-    // both of which need setting by set_n_termination().
-    _g1h->SharedHeap::set_n_termination(active_workers);
-    _g1h->set_n_termination(active_workers);
+    _root_processor->set_num_workers(active_workers);
     terminator()->reset_for_reuse(active_workers);
     _n_workers = active_workers;
   }
@@ -4486,8 +4413,7 @@
   void work(uint worker_id) {
     if (worker_id >= _n_workers) return;  // no work needed this round
 
-    double start_time_ms = os::elapsedTime() * 1000.0;
-    _g1h->g1_policy()->phase_times()->record_gc_worker_start_time(worker_id, start_time_ms);
+    _g1h->g1_policy()->phase_times()->record_time_secs(G1GCPhaseTimes::GCWorkerStart, worker_id, os::elapsedTime());
 
     {
       ResourceMark rm;
@@ -4519,24 +4445,21 @@
                                                                                     false, // Process all klasses.
                                                                                     true); // Need to claim CLDs.
 
-      G1CodeBlobClosure scan_only_code_cl(&scan_only_root_cl);
-      G1CodeBlobClosure scan_mark_code_cl(&scan_mark_root_cl);
-      // IM Weak code roots are handled later.
-
       OopClosure* strong_root_cl;
       OopClosure* weak_root_cl;
       CLDClosure* strong_cld_cl;
       CLDClosure* weak_cld_cl;
-      CodeBlobClosure* strong_code_cl;
+
+      bool trace_metadata = false;
 
       if (_g1h->g1_policy()->during_initial_mark_pause()) {
         // We also need to mark copied objects.
         strong_root_cl = &scan_mark_root_cl;
         strong_cld_cl  = &scan_mark_cld_cl;
-        strong_code_cl = &scan_mark_code_cl;
         if (ClassUnloadingWithConcurrentMark) {
           weak_root_cl = &scan_mark_weak_root_cl;
           weak_cld_cl  = &scan_mark_weak_cld_cl;
+          trace_metadata = true;
         } else {
           weak_root_cl = &scan_mark_root_cl;
           weak_cld_cl  = &scan_mark_cld_cl;
@@ -4546,31 +4469,32 @@
         weak_root_cl   = &scan_only_root_cl;
         strong_cld_cl  = &scan_only_cld_cl;
         weak_cld_cl    = &scan_only_cld_cl;
-        strong_code_cl = &scan_only_code_cl;
       }
 
-
-      G1ParPushHeapRSClosure  push_heap_rs_cl(_g1h, &pss);
-
       pss.start_strong_roots();
-      _g1h->g1_process_roots(strong_root_cl,
-                             weak_root_cl,
-                             &push_heap_rs_cl,
-                             strong_cld_cl,
-                             weak_cld_cl,
-                             strong_code_cl,
-                             worker_id);
 
+      _root_processor->evacuate_roots(strong_root_cl,
+                                      weak_root_cl,
+                                      strong_cld_cl,
+                                      weak_cld_cl,
+                                      trace_metadata,
+                                      worker_id);
+
+      G1ParPushHeapRSClosure push_heap_rs_cl(_g1h, &pss);
+      _root_processor->scan_remembered_sets(&push_heap_rs_cl,
+                                            weak_root_cl,
+                                            worker_id);
       pss.end_strong_roots();
 
       {
         double start = os::elapsedTime();
         G1ParEvacuateFollowersClosure evac(_g1h, &pss, _queues, &_terminator);
         evac.do_void();
-        double elapsed_ms = (os::elapsedTime()-start)*1000.0;
-        double term_ms = pss.term_time()*1000.0;
-        _g1h->g1_policy()->phase_times()->add_obj_copy_time(worker_id, elapsed_ms-term_ms);
-        _g1h->g1_policy()->phase_times()->record_termination(worker_id, term_ms, pss.term_attempts());
+        double elapsed_sec = os::elapsedTime() - start;
+        double term_sec = pss.term_time();
+        _g1h->g1_policy()->phase_times()->add_time_secs(G1GCPhaseTimes::ObjCopy, worker_id, elapsed_sec - term_sec);
+        _g1h->g1_policy()->phase_times()->record_time_secs(G1GCPhaseTimes::Termination, worker_id, term_sec);
+        _g1h->g1_policy()->phase_times()->record_thread_work_item(G1GCPhaseTimes::Termination, worker_id, pss.term_attempts());
       }
       _g1h->g1_policy()->record_thread_age_table(pss.age_table());
       _g1h->update_surviving_young_words(pss.surviving_young_words()+1);
@@ -4586,100 +4510,10 @@
       // destructors are executed here and are included as part of the
       // "GC Worker Time".
     }
-
-    double end_time_ms = os::elapsedTime() * 1000.0;
-    _g1h->g1_policy()->phase_times()->record_gc_worker_end_time(worker_id, end_time_ms);
+    _g1h->g1_policy()->phase_times()->record_time_secs(G1GCPhaseTimes::GCWorkerEnd, worker_id, os::elapsedTime());
   }
 };
 
-// *** Common G1 Evacuation Stuff
-
-// This method is run in a GC worker.
-
-void
-G1CollectedHeap::
-g1_process_roots(OopClosure* scan_non_heap_roots,
-                 OopClosure* scan_non_heap_weak_roots,
-                 G1ParPushHeapRSClosure* scan_rs,
-                 CLDClosure* scan_strong_clds,
-                 CLDClosure* scan_weak_clds,
-                 CodeBlobClosure* scan_strong_code,
-                 uint worker_i) {
-
-  // First scan the shared roots.
-  double ext_roots_start = os::elapsedTime();
-  double closure_app_time_sec = 0.0;
-
-  bool during_im = _g1h->g1_policy()->during_initial_mark_pause();
-  bool trace_metadata = during_im && ClassUnloadingWithConcurrentMark;
-
-  BufferingOopClosure buf_scan_non_heap_roots(scan_non_heap_roots);
-  BufferingOopClosure buf_scan_non_heap_weak_roots(scan_non_heap_weak_roots);
-
-  process_roots(false, // no scoping; this is parallel code
-                SharedHeap::SO_None,
-                &buf_scan_non_heap_roots,
-                &buf_scan_non_heap_weak_roots,
-                scan_strong_clds,
-                // Unloading Initial Marks handle the weak CLDs separately.
-                (trace_metadata ? NULL : scan_weak_clds),
-                scan_strong_code);
-
-  // Now the CM ref_processor roots.
-  if (!_process_strong_tasks->is_task_claimed(G1H_PS_refProcessor_oops_do)) {
-    // We need to treat the discovered reference lists of the
-    // concurrent mark ref processor as roots and keep entries
-    // (which are added by the marking threads) on them live
-    // until they can be processed at the end of marking.
-    ref_processor_cm()->weak_oops_do(&buf_scan_non_heap_roots);
-  }
-
-  if (trace_metadata) {
-    // Barrier to make sure all workers passed
-    // the strong CLD and strong nmethods phases.
-    active_strong_roots_scope()->wait_until_all_workers_done_with_threads(n_par_threads());
-
-    // Now take the complement of the strong CLDs.
-    ClassLoaderDataGraph::roots_cld_do(NULL, scan_weak_clds);
-  }
-
-  // Finish up any enqueued closure apps (attributed as object copy time).
-  buf_scan_non_heap_roots.done();
-  buf_scan_non_heap_weak_roots.done();
-
-  double obj_copy_time_sec = buf_scan_non_heap_roots.closure_app_seconds()
-      + buf_scan_non_heap_weak_roots.closure_app_seconds();
-
-  g1_policy()->phase_times()->record_obj_copy_time(worker_i, obj_copy_time_sec * 1000.0);
-
-  double ext_root_time_ms =
-    ((os::elapsedTime() - ext_roots_start) - obj_copy_time_sec) * 1000.0;
-
-  g1_policy()->phase_times()->record_ext_root_scan_time(worker_i, ext_root_time_ms);
-
-  // During conc marking we have to filter the per-thread SATB buffers
-  // to make sure we remove any oops into the CSet (which will show up
-  // as implicitly live).
-  double satb_filtering_ms = 0.0;
-  if (!_process_strong_tasks->is_task_claimed(G1H_PS_filter_satb_buffers)) {
-    if (mark_in_progress()) {
-      double satb_filter_start = os::elapsedTime();
-
-      JavaThread::satb_mark_queue_set().filter_thread_buffers();
-
-      satb_filtering_ms = (os::elapsedTime() - satb_filter_start) * 1000.0;
-    }
-  }
-  g1_policy()->phase_times()->record_satb_filtering_time(worker_i, satb_filtering_ms);
-
-  // Now scan the complement of the collection set.
-  G1CodeBlobClosure scavenge_cs_nmethods(scan_non_heap_weak_roots);
-
-  g1_rem_set()->oops_into_collection_set_do(scan_rs, &scavenge_cs_nmethods, worker_i);
-
-  _process_strong_tasks->all_tasks_completed();
-}
-
 class G1StringSymbolTableUnlinkTask : public AbstractGangTask {
 private:
   BoolObjectClosure* _is_alive;
@@ -5054,14 +4888,13 @@
   G1RedirtyLoggedCardsTask(DirtyCardQueueSet* queue) : AbstractGangTask("Redirty Cards"), _queue(queue) { }
 
   virtual void work(uint worker_id) {
-    double start_time = os::elapsedTime();
+    G1GCPhaseTimes* phase_times = G1CollectedHeap::heap()->g1_policy()->phase_times();
+    G1GCParPhaseTimesTracker x(phase_times, G1GCPhaseTimes::RedirtyCards, worker_id);
 
     RedirtyLoggedCardTableEntryClosure cl;
     _queue->par_apply_closure_to_all_completed_buffers(&cl);
 
-    G1GCPhaseTimes* timer = G1CollectedHeap::heap()->g1_policy()->phase_times();
-    timer->record_redirty_logged_cards_time_ms(worker_id, (os::elapsedTime() - start_time) * 1000.0);
-    timer->record_redirty_logged_cards_processed_cards(worker_id, cl.num_processed());
+    phase_times->record_thread_work_item(G1GCPhaseTimes::RedirtyCards, worker_id, cl.num_processed());
   }
 };
 
@@ -5608,7 +5441,6 @@
   workers()->set_active_workers(n_workers);
   set_par_threads(n_workers);
 
-  G1ParTask g1_par_task(this, _task_queues);
 
   init_for_evac_failure(NULL);
 
@@ -5617,7 +5449,8 @@
   double end_par_time_sec;
 
   {
-    StrongRootsScope srs(this);
+    G1RootProcessor root_processor(this);
+    G1ParTask g1_par_task(this, _task_queues, &root_processor);
     // InitialMark needs claim bits to keep track of the marked-through CLDs.
     if (g1_policy()->during_initial_mark_pause()) {
       ClassLoaderDataGraph::clear_claimed_marks();
@@ -5633,18 +5466,20 @@
     end_par_time_sec = os::elapsedTime();
 
     // Closing the inner scope will execute the destructor
-    // for the StrongRootsScope object. We record the current
+    // for the G1RootProcessor object. We record the current
     // elapsed time before closing the scope so that time
-    // taken for the SRS destructor is NOT included in the
+    // taken for the destructor is NOT included in the
     // reported parallel time.
   }
 
+  G1GCPhaseTimes* phase_times = g1_policy()->phase_times();
+
   double par_time_ms = (end_par_time_sec - start_par_time_sec) * 1000.0;
-  g1_policy()->phase_times()->record_par_time(par_time_ms);
+  phase_times->record_par_time(par_time_ms);
 
   double code_root_fixup_time_ms =
         (os::elapsedTime() - end_par_time_sec) * 1000.0;
-  g1_policy()->phase_times()->record_code_root_fixup_time(code_root_fixup_time_ms);
+  phase_times->record_code_root_fixup_time(code_root_fixup_time_ms);
 
   set_par_threads(0);
 
@@ -5656,9 +5491,14 @@
   process_discovered_references(n_workers);
 
   if (G1StringDedup::is_enabled()) {
+    double fixup_start = os::elapsedTime();
+
     G1STWIsAliveClosure is_alive(this);
     G1KeepAliveClosure keep_alive(this);
-    G1StringDedup::unlink_or_oops_do(&is_alive, &keep_alive);
+    G1StringDedup::unlink_or_oops_do(&is_alive, &keep_alive, true, phase_times);
+
+    double fixup_time_ms = (os::elapsedTime() - fixup_start) * 1000.0;
+    phase_times->record_string_dedup_fixup_time(fixup_time_ms);
   }
 
   _allocator->release_gc_alloc_regions(n_workers, evacuation_info);
diff --git a/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.hpp b/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.hpp
index edf78a1..11955f4 100644
--- a/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.hpp
+++ b/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.hpp
@@ -56,6 +56,7 @@
 class GenerationSpec;
 class OopsInHeapRegionClosure;
 class G1KlassScanClosure;
+class G1ParScanThreadState;
 class ObjectClosure;
 class SpaceClosure;
 class CompactibleSpaceClosure;
@@ -780,22 +781,6 @@
   // statistics or updating free lists.
   void abandon_collection_set(HeapRegion* cs_head);
 
-  // Applies "scan_non_heap_roots" to roots outside the heap,
-  // "scan_rs" to roots inside the heap (having done "set_region" to
-  // indicate the region in which the root resides),
-  // and does "scan_metadata" If "scan_rs" is
-  // NULL, then this step is skipped.  The "worker_i"
-  // param is for use with parallel roots processing, and should be
-  // the "i" of the calling parallel worker thread's work(i) function.
-  // In the sequential case this param will be ignored.
-  void g1_process_roots(OopClosure* scan_non_heap_roots,
-                        OopClosure* scan_non_heap_weak_roots,
-                        G1ParPushHeapRSClosure* scan_rs,
-                        CLDClosure* scan_strong_clds,
-                        CLDClosure* scan_weak_clds,
-                        CodeBlobClosure* scan_strong_code,
-                        uint worker_i);
-
   // The concurrent marker (and the thread it runs in.)
   ConcurrentMark* _cm;
   ConcurrentMarkThread* _cmThread;
@@ -982,21 +967,10 @@
   // of G1CollectedHeap::_gc_time_stamp.
   uint* _worker_cset_start_region_time_stamp;
 
-  enum G1H_process_roots_tasks {
-    G1H_PS_filter_satb_buffers,
-    G1H_PS_refProcessor_oops_do,
-    // Leave this one last.
-    G1H_PS_NumElements
-  };
-
-  SubTasksDone* _process_strong_tasks;
-
   volatile bool _free_regions_coming;
 
 public:
 
-  SubTasksDone* process_strong_tasks() { return _process_strong_tasks; }
-
   void set_refine_cte_cl_concurrency(bool concurrent);
 
   RefToScanQueue *task_queue(int i) const;
@@ -1029,21 +1003,11 @@
   // Initialize weak reference processing.
   virtual void ref_processing_init();
 
-  void set_par_threads(uint t) {
-    SharedHeap::set_par_threads(t);
-    // Done in SharedHeap but oddly there are
-    // two _process_strong_tasks's in a G1CollectedHeap
-    // so do it here too.
-    _process_strong_tasks->set_n_threads(t);
-  }
-
+  // Explicitly import set_par_threads into this scope
+  using SharedHeap::set_par_threads;
   // Set _n_par_threads according to a policy TBD.
   void set_par_threads();
 
-  void set_n_termination(int t) {
-    _process_strong_tasks->set_n_threads(t);
-  }
-
   virtual CollectedHeap::Name kind() const {
     return CollectedHeap::G1CollectedHeap;
   }
@@ -1118,6 +1082,10 @@
   // The number of regions that are completely free.
   uint num_free_regions() const { return _hrm.num_free_regions(); }
 
+  MemoryUsage get_auxiliary_data_memory_usage() const {
+    return _hrm.get_auxiliary_data_memory_usage();
+  }
+
   // The number of regions that are not completely free.
   uint num_used_regions() const { return num_regions() - num_free_regions(); }
 
diff --git a/hotspot/src/share/vm/gc_implementation/g1/g1CollectorPolicy.cpp b/hotspot/src/share/vm/gc_implementation/g1/g1CollectorPolicy.cpp
index fbb52ad..bbb2374 100644
--- a/hotspot/src/share/vm/gc_implementation/g1/g1CollectorPolicy.cpp
+++ b/hotspot/src/share/vm/gc_implementation/g1/g1CollectorPolicy.cpp
@@ -321,7 +321,7 @@
 
 void G1CollectorPolicy::initialize_flags() {
   if (G1HeapRegionSize != HeapRegion::GrainBytes) {
-    FLAG_SET_ERGO(uintx, G1HeapRegionSize, HeapRegion::GrainBytes);
+    FLAG_SET_ERGO(size_t, G1HeapRegionSize, HeapRegion::GrainBytes);
   }
 
   if (SurvivorRatio < 1) {
@@ -335,7 +335,7 @@
   uintx max_regions = G1CollectedHeap::heap()->max_regions();
   size_t max_young_size = (size_t)_young_gen_sizer->max_young_length(max_regions) * HeapRegion::GrainBytes;
   if (max_young_size != MaxNewSize) {
-    FLAG_SET_ERGO(uintx, MaxNewSize, max_young_size);
+    FLAG_SET_ERGO(size_t, MaxNewSize, max_young_size);
   }
 }
 
@@ -1073,7 +1073,7 @@
   if (update_stats) {
     double cost_per_card_ms = 0.0;
     if (_pending_cards > 0) {
-      cost_per_card_ms = phase_times()->average_last_update_rs_time() / (double) _pending_cards;
+      cost_per_card_ms = phase_times()->average_time_ms(G1GCPhaseTimes::UpdateRS) / (double) _pending_cards;
       _cost_per_card_ms_seq->add(cost_per_card_ms);
     }
 
@@ -1081,7 +1081,7 @@
 
     double cost_per_entry_ms = 0.0;
     if (cards_scanned > 10) {
-      cost_per_entry_ms = phase_times()->average_last_scan_rs_time() / (double) cards_scanned;
+      cost_per_entry_ms = phase_times()->average_time_ms(G1GCPhaseTimes::ScanRS) / (double) cards_scanned;
       if (_last_gc_was_young) {
         _cost_per_entry_ms_seq->add(cost_per_entry_ms);
       } else {
@@ -1123,7 +1123,7 @@
     double cost_per_byte_ms = 0.0;
 
     if (copied_bytes > 0) {
-      cost_per_byte_ms = phase_times()->average_last_obj_copy_time() / (double) copied_bytes;
+      cost_per_byte_ms = phase_times()->average_time_ms(G1GCPhaseTimes::ObjCopy) / (double) copied_bytes;
       if (_in_marking_window) {
         _cost_per_byte_ms_during_cm_seq->add(cost_per_byte_ms);
       } else {
@@ -1132,8 +1132,8 @@
     }
 
     double all_other_time_ms = pause_time_ms -
-      (phase_times()->average_last_update_rs_time() + phase_times()->average_last_scan_rs_time()
-      + phase_times()->average_last_obj_copy_time() + phase_times()->average_last_termination_time());
+      (phase_times()->average_time_ms(G1GCPhaseTimes::UpdateRS) + phase_times()->average_time_ms(G1GCPhaseTimes::ScanRS) +
+          phase_times()->average_time_ms(G1GCPhaseTimes::ObjCopy) + phase_times()->average_time_ms(G1GCPhaseTimes::Termination));
 
     double young_other_time_ms = 0.0;
     if (young_cset_region_length() > 0) {
@@ -1174,8 +1174,8 @@
 
   // Note that _mmu_tracker->max_gc_time() returns the time in seconds.
   double update_rs_time_goal_ms = _mmu_tracker->max_gc_time() * MILLIUNITS * G1RSetUpdatingPauseTimePercent / 100.0;
-  adjust_concurrent_refinement(phase_times()->average_last_update_rs_time(),
-                               phase_times()->sum_last_update_rs_processed_buffers(), update_rs_time_goal_ms);
+  adjust_concurrent_refinement(phase_times()->average_time_ms(G1GCPhaseTimes::UpdateRS),
+                               phase_times()->sum_thread_work_items(G1GCPhaseTimes::UpdateRS), update_rs_time_goal_ms);
 
   _collectionSetChooser->verify();
 }
@@ -2114,19 +2114,19 @@
     _other.add(pause_time_ms - phase_times->accounted_time_ms());
     _root_region_scan_wait.add(phase_times->root_region_scan_wait_time_ms());
     _parallel.add(phase_times->cur_collection_par_time_ms());
-    _ext_root_scan.add(phase_times->average_last_ext_root_scan_time());
-    _satb_filtering.add(phase_times->average_last_satb_filtering_times_ms());
-    _update_rs.add(phase_times->average_last_update_rs_time());
-    _scan_rs.add(phase_times->average_last_scan_rs_time());
-    _obj_copy.add(phase_times->average_last_obj_copy_time());
-    _termination.add(phase_times->average_last_termination_time());
+    _ext_root_scan.add(phase_times->average_time_ms(G1GCPhaseTimes::ExtRootScan));
+    _satb_filtering.add(phase_times->average_time_ms(G1GCPhaseTimes::SATBFiltering));
+    _update_rs.add(phase_times->average_time_ms(G1GCPhaseTimes::UpdateRS));
+    _scan_rs.add(phase_times->average_time_ms(G1GCPhaseTimes::ScanRS));
+    _obj_copy.add(phase_times->average_time_ms(G1GCPhaseTimes::ObjCopy));
+    _termination.add(phase_times->average_time_ms(G1GCPhaseTimes::Termination));
 
-    double parallel_known_time = phase_times->average_last_ext_root_scan_time() +
-      phase_times->average_last_satb_filtering_times_ms() +
-      phase_times->average_last_update_rs_time() +
-      phase_times->average_last_scan_rs_time() +
-      phase_times->average_last_obj_copy_time() +
-      + phase_times->average_last_termination_time();
+    double parallel_known_time = phase_times->average_time_ms(G1GCPhaseTimes::ExtRootScan) +
+      phase_times->average_time_ms(G1GCPhaseTimes::SATBFiltering) +
+      phase_times->average_time_ms(G1GCPhaseTimes::UpdateRS) +
+      phase_times->average_time_ms(G1GCPhaseTimes::ScanRS) +
+      phase_times->average_time_ms(G1GCPhaseTimes::ObjCopy) +
+      phase_times->average_time_ms(G1GCPhaseTimes::Termination);
 
     double parallel_other_time = phase_times->cur_collection_par_time_ms() - parallel_known_time;
     _parallel_other.add(parallel_other_time);
diff --git a/hotspot/src/share/vm/gc_implementation/g1/g1GCPhaseTimes.cpp b/hotspot/src/share/vm/gc_implementation/g1/g1GCPhaseTimes.cpp
index f9e892b..24379ff 100644
--- a/hotspot/src/share/vm/gc_implementation/g1/g1GCPhaseTimes.cpp
+++ b/hotspot/src/share/vm/gc_implementation/g1/g1GCPhaseTimes.cpp
@@ -22,13 +22,13 @@
  *
  */
 
-
 #include "precompiled.hpp"
 #include "gc_implementation/g1/g1CollectedHeap.inline.hpp"
 #include "gc_implementation/g1/g1GCPhaseTimes.hpp"
 #include "gc_implementation/g1/g1Log.hpp"
 #include "gc_implementation/g1/g1StringDedup.hpp"
-#include "runtime/atomic.inline.hpp"
+#include "memory/allocation.hpp"
+#include "runtime/os.hpp"
 
 // Helper class for avoiding interleaved logging
 class LineBuffer: public StackObj {
@@ -71,184 +71,258 @@
     va_end(ap);
   }
 
+  void print_cr() {
+    gclog_or_tty->print_cr("%s", _buffer);
+    _cur = _indent_level * INDENT_CHARS;
+  }
+
   void append_and_print_cr(const char* format, ...)  ATTRIBUTE_PRINTF(2, 3) {
     va_list ap;
     va_start(ap, format);
     vappend(format, ap);
     va_end(ap);
-    gclog_or_tty->print_cr("%s", _buffer);
-    _cur = _indent_level * INDENT_CHARS;
+    print_cr();
   }
 };
 
-PRAGMA_DIAG_PUSH
-PRAGMA_FORMAT_NONLITERAL_IGNORED
 template <class T>
-void WorkerDataArray<T>::print(int level, const char* title) {
-  if (_length == 1) {
-    // No need for min, max, average and sum for only one worker
-    LineBuffer buf(level);
-    buf.append("[%s:  ", title);
-    buf.append(_print_format, _data[0]);
-    buf.append_and_print_cr("]");
-    return;
+class WorkerDataArray  : public CHeapObj<mtGC> {
+  friend class G1GCParPhasePrinter;
+  T*          _data;
+  uint        _length;
+  const char* _title;
+  bool        _print_sum;
+  int         _log_level;
+  uint        _indent_level;
+  bool        _enabled;
+
+  WorkerDataArray<size_t>* _thread_work_items;
+
+  NOT_PRODUCT(T uninitialized();)
+
+  // We are caching the sum and average to only have to calculate them once.
+  // This is not done in an MT-safe way. It is intended to allow single
+  // threaded code to call sum() and average() multiple times in any order
+  // without having to worry about the cost.
+  bool   _has_new_data;
+  T      _sum;
+  T      _min;
+  T      _max;
+  double _average;
+
+ public:
+  WorkerDataArray(uint length, const char* title, bool print_sum, int log_level, uint indent_level) :
+    _title(title), _length(0), _print_sum(print_sum), _log_level(log_level), _indent_level(indent_level),
+    _has_new_data(true), _thread_work_items(NULL), _enabled(true) {
+    assert(length > 0, "Must have some workers to store data for");
+    _length = length;
+    _data = NEW_C_HEAP_ARRAY(T, _length, mtGC);
   }
 
-  T min = _data[0];
-  T max = _data[0];
-  T sum = 0;
+  ~WorkerDataArray() {
+    FREE_C_HEAP_ARRAY(T, _data);
+  }
 
-  LineBuffer buf(level);
-  buf.append("[%s:", title);
-  for (uint i = 0; i < _length; ++i) {
-    T val = _data[i];
-    min = MIN2(val, min);
-    max = MAX2(val, max);
-    sum += val;
-    if (G1Log::finest()) {
-      buf.append("  ");
-      buf.append(_print_format, val);
+  void link_thread_work_items(WorkerDataArray<size_t>* thread_work_items) {
+    _thread_work_items = thread_work_items;
+  }
+
+  WorkerDataArray<size_t>* thread_work_items() { return _thread_work_items; }
+
+  void set(uint worker_i, T value) {
+    assert(worker_i < _length, err_msg("Worker %d is greater than max: %d", worker_i, _length));
+    assert(_data[worker_i] == WorkerDataArray<T>::uninitialized(), err_msg("Overwriting data for worker %d in %s", worker_i, _title));
+    _data[worker_i] = value;
+    _has_new_data = true;
+  }
+
+  void set_thread_work_item(uint worker_i, size_t value) {
+    assert(_thread_work_items != NULL, "No sub count");
+    _thread_work_items->set(worker_i, value);
+  }
+
+  T get(uint worker_i) {
+    assert(worker_i < _length, err_msg("Worker %d is greater than max: %d", worker_i, _length));
+    assert(_data[worker_i] != WorkerDataArray<T>::uninitialized(), err_msg("No data added for worker %d", worker_i));
+    return _data[worker_i];
+  }
+
+  void add(uint worker_i, T value) {
+    assert(worker_i < _length, err_msg("Worker %d is greater than max: %d", worker_i, _length));
+    assert(_data[worker_i] != WorkerDataArray<T>::uninitialized(), err_msg("No data to add to for worker %d", worker_i));
+    _data[worker_i] += value;
+    _has_new_data = true;
+  }
+
+  double average(){
+    calculate_totals();
+    return _average;
+  }
+
+  T sum() {
+    calculate_totals();
+    return _sum;
+  }
+
+  T minimum() {
+    calculate_totals();
+    return _min;
+  }
+
+  T maximum() {
+    calculate_totals();
+    return _max;
+  }
+
+  void reset() PRODUCT_RETURN;
+  void verify() PRODUCT_RETURN;
+
+  void set_enabled(bool enabled) { _enabled = enabled; }
+
+  int log_level() { return _log_level;  }
+
+ private:
+
+  void calculate_totals(){
+    if (!_has_new_data) {
+      return;
     }
-  }
 
-  if (G1Log::finest()) {
-    buf.append_and_print_cr("%s", "");
+    _sum = (T)0;
+    _min = _data[0];
+    _max = _min;
+    for (uint i = 0; i < _length; ++i) {
+      T val = _data[i];
+      _sum += val;
+      _min = MIN2(_min, val);
+      _max = MAX2(_max, val);
+    }
+    _average = (double)_sum / (double)_length;
+    _has_new_data = false;
   }
+};
 
-  double avg = (double)sum / (double)_length;
-  buf.append(" Min: ");
-  buf.append(_print_format, min);
-  buf.append(", Avg: ");
-  buf.append("%.1lf", avg); // Always print average as a double
-  buf.append(", Max: ");
-  buf.append(_print_format, max);
-  buf.append(", Diff: ");
-  buf.append(_print_format, max - min);
-  if (_print_sum) {
-    // for things like the start and end times the sum is not
-    // that relevant
-    buf.append(", Sum: ");
-    buf.append(_print_format, sum);
-  }
-  buf.append_and_print_cr("]");
-}
-PRAGMA_DIAG_POP
 
 #ifndef PRODUCT
 
-template <> const int WorkerDataArray<int>::_uninitialized = -1;
-template <> const double WorkerDataArray<double>::_uninitialized = -1.0;
-template <> const size_t WorkerDataArray<size_t>::_uninitialized = (size_t)-1;
+template <>
+size_t WorkerDataArray<size_t>::uninitialized() {
+  return (size_t)-1;
+}
+
+template <>
+double WorkerDataArray<double>::uninitialized() {
+  return -1.0;
+}
 
 template <class T>
 void WorkerDataArray<T>::reset() {
   for (uint i = 0; i < _length; i++) {
-    _data[i] = (T)_uninitialized;
+    _data[i] = WorkerDataArray<T>::uninitialized();
+  }
+  if (_thread_work_items != NULL) {
+    _thread_work_items->reset();
   }
 }
 
 template <class T>
 void WorkerDataArray<T>::verify() {
+  if (!_enabled) {
+    return;
+  }
+
   for (uint i = 0; i < _length; i++) {
-    assert(_data[i] != _uninitialized,
-        err_msg("Invalid data for worker %u, data: %lf, uninitialized: %lf",
-            i, (double)_data[i], (double)_uninitialized));
+    assert(_data[i] != WorkerDataArray<T>::uninitialized(),
+        err_msg("Invalid data for worker %u in '%s'", i, _title));
+  }
+  if (_thread_work_items != NULL) {
+    _thread_work_items->verify();
   }
 }
 
 #endif
 
 G1GCPhaseTimes::G1GCPhaseTimes(uint max_gc_threads) :
-  _max_gc_threads(max_gc_threads),
-  _last_gc_worker_start_times_ms(_max_gc_threads, "%.1lf", false),
-  _last_ext_root_scan_times_ms(_max_gc_threads, "%.1lf"),
-  _last_satb_filtering_times_ms(_max_gc_threads, "%.1lf"),
-  _last_update_rs_times_ms(_max_gc_threads, "%.1lf"),
-  _last_update_rs_processed_buffers(_max_gc_threads, "%d"),
-  _last_scan_rs_times_ms(_max_gc_threads, "%.1lf"),
-  _last_strong_code_root_scan_times_ms(_max_gc_threads, "%.1lf"),
-  _last_obj_copy_times_ms(_max_gc_threads, "%.1lf"),
-  _last_termination_times_ms(_max_gc_threads, "%.1lf"),
-  _last_termination_attempts(_max_gc_threads, SIZE_FORMAT),
-  _last_gc_worker_end_times_ms(_max_gc_threads, "%.1lf", false),
-  _last_gc_worker_times_ms(_max_gc_threads, "%.1lf"),
-  _last_gc_worker_other_times_ms(_max_gc_threads, "%.1lf"),
-  _last_redirty_logged_cards_time_ms(_max_gc_threads, "%.1lf"),
-  _last_redirty_logged_cards_processed_cards(_max_gc_threads, SIZE_FORMAT),
-  _cur_string_dedup_queue_fixup_worker_times_ms(_max_gc_threads, "%.1lf"),
-  _cur_string_dedup_table_fixup_worker_times_ms(_max_gc_threads, "%.1lf")
+  _max_gc_threads(max_gc_threads)
 {
   assert(max_gc_threads > 0, "Must have some GC threads");
+
+  _gc_par_phases[GCWorkerStart] = new WorkerDataArray<double>(max_gc_threads, "GC Worker Start (ms)", false, G1Log::LevelFiner, 2);
+  _gc_par_phases[ExtRootScan] = new WorkerDataArray<double>(max_gc_threads, "Ext Root Scanning (ms)", true, G1Log::LevelFiner, 2);
+
+  // Root scanning phases
+  _gc_par_phases[ThreadRoots] = new WorkerDataArray<double>(max_gc_threads, "Thread Roots (ms)", true, G1Log::LevelFinest, 3);
+  _gc_par_phases[StringTableRoots] = new WorkerDataArray<double>(max_gc_threads, "StringTable Roots (ms)", true, G1Log::LevelFinest, 3);
+  _gc_par_phases[UniverseRoots] = new WorkerDataArray<double>(max_gc_threads, "Universe Roots (ms)", true, G1Log::LevelFinest, 3);
+  _gc_par_phases[JNIRoots] = new WorkerDataArray<double>(max_gc_threads, "JNI Handles Roots (ms)", true, G1Log::LevelFinest, 3);
+  _gc_par_phases[ObjectSynchronizerRoots] = new WorkerDataArray<double>(max_gc_threads, "ObjectSynchronizer Roots (ms)", true, G1Log::LevelFinest, 3);
+  _gc_par_phases[FlatProfilerRoots] = new WorkerDataArray<double>(max_gc_threads, "FlatProfiler Roots (ms)", true, G1Log::LevelFinest, 3);
+  _gc_par_phases[ManagementRoots] = new WorkerDataArray<double>(max_gc_threads, "Management Roots (ms)", true, G1Log::LevelFinest, 3);
+  _gc_par_phases[SystemDictionaryRoots] = new WorkerDataArray<double>(max_gc_threads, "SystemDictionary Roots (ms)", true, G1Log::LevelFinest, 3);
+  _gc_par_phases[CLDGRoots] = new WorkerDataArray<double>(max_gc_threads, "CLDG Roots (ms)", true, G1Log::LevelFinest, 3);
+  _gc_par_phases[JVMTIRoots] = new WorkerDataArray<double>(max_gc_threads, "JVMTI Roots (ms)", true, G1Log::LevelFinest, 3);
+  _gc_par_phases[CodeCacheRoots] = new WorkerDataArray<double>(max_gc_threads, "CodeCache Roots (ms)", true, G1Log::LevelFinest, 3);
+  _gc_par_phases[CMRefRoots] = new WorkerDataArray<double>(max_gc_threads, "CM RefProcessor Roots (ms)", true, G1Log::LevelFinest, 3);
+  _gc_par_phases[WaitForStrongCLD] = new WorkerDataArray<double>(max_gc_threads, "Wait For Strong CLD (ms)", true, G1Log::LevelFinest, 3);
+  _gc_par_phases[WeakCLDRoots] = new WorkerDataArray<double>(max_gc_threads, "Weak CLD Roots (ms)", true, G1Log::LevelFinest, 3);
+  _gc_par_phases[SATBFiltering] = new WorkerDataArray<double>(max_gc_threads, "SATB Filtering (ms)", true, G1Log::LevelFinest, 3);
+
+  _gc_par_phases[UpdateRS] = new WorkerDataArray<double>(max_gc_threads, "Update RS (ms)", true, G1Log::LevelFiner, 2);
+  _gc_par_phases[ScanRS] = new WorkerDataArray<double>(max_gc_threads, "Scan RS (ms)", true, G1Log::LevelFiner, 2);
+  _gc_par_phases[CodeRoots] = new WorkerDataArray<double>(max_gc_threads, "Code Root Scanning (ms)", true, G1Log::LevelFiner, 2);
+  _gc_par_phases[ObjCopy] = new WorkerDataArray<double>(max_gc_threads, "Object Copy (ms)", true, G1Log::LevelFiner, 2);
+  _gc_par_phases[Termination] = new WorkerDataArray<double>(max_gc_threads, "Termination (ms)", true, G1Log::LevelFiner, 2);
+  _gc_par_phases[GCWorkerTotal] = new WorkerDataArray<double>(max_gc_threads, "GC Worker Total (ms)", true, G1Log::LevelFiner, 2);
+  _gc_par_phases[GCWorkerEnd] = new WorkerDataArray<double>(max_gc_threads, "GC Worker End (ms)", false, G1Log::LevelFiner, 2);
+  _gc_par_phases[Other] = new WorkerDataArray<double>(max_gc_threads, "GC Worker Other (ms)", true, G1Log::LevelFiner, 2);
+
+  _update_rs_processed_buffers = new WorkerDataArray<size_t>(max_gc_threads, "Processed Buffers", true, G1Log::LevelFiner, 3);
+  _gc_par_phases[UpdateRS]->link_thread_work_items(_update_rs_processed_buffers);
+
+  _termination_attempts = new WorkerDataArray<size_t>(max_gc_threads, "Termination Attempts", true, G1Log::LevelFinest, 3);
+  _gc_par_phases[Termination]->link_thread_work_items(_termination_attempts);
+
+  _gc_par_phases[StringDedupQueueFixup] = new WorkerDataArray<double>(max_gc_threads, "Queue Fixup (ms)", true, G1Log::LevelFiner, 2);
+  _gc_par_phases[StringDedupTableFixup] = new WorkerDataArray<double>(max_gc_threads, "Table Fixup (ms)", true, G1Log::LevelFiner, 2);
+
+  _gc_par_phases[RedirtyCards] = new WorkerDataArray<double>(max_gc_threads, "Parallel Redirty", true, G1Log::LevelFinest, 3);
+  _redirtied_cards = new WorkerDataArray<size_t>(max_gc_threads, "Redirtied Cards", true, G1Log::LevelFinest, 3);
+  _gc_par_phases[RedirtyCards]->link_thread_work_items(_redirtied_cards);
 }
 
-void G1GCPhaseTimes::note_gc_start(uint active_gc_threads) {
+void G1GCPhaseTimes::note_gc_start(uint active_gc_threads, bool mark_in_progress) {
   assert(active_gc_threads > 0, "The number of threads must be > 0");
-  assert(active_gc_threads <= _max_gc_threads, "The number of active threads must be <= the max nubmer of threads");
+  assert(active_gc_threads <= _max_gc_threads, "The number of active threads must be <= the max number of threads");
   _active_gc_threads = active_gc_threads;
 
-  _last_gc_worker_start_times_ms.reset();
-  _last_ext_root_scan_times_ms.reset();
-  _last_satb_filtering_times_ms.reset();
-  _last_update_rs_times_ms.reset();
-  _last_update_rs_processed_buffers.reset();
-  _last_scan_rs_times_ms.reset();
-  _last_strong_code_root_scan_times_ms.reset();
-  _last_obj_copy_times_ms.reset();
-  _last_termination_times_ms.reset();
-  _last_termination_attempts.reset();
-  _last_gc_worker_end_times_ms.reset();
-  _last_gc_worker_times_ms.reset();
-  _last_gc_worker_other_times_ms.reset();
+  for (int i = 0; i < GCParPhasesSentinel; i++) {
+    _gc_par_phases[i]->reset();
+  }
 
-  _last_redirty_logged_cards_time_ms.reset();
-  _last_redirty_logged_cards_processed_cards.reset();
-
+  _gc_par_phases[StringDedupQueueFixup]->set_enabled(G1StringDedup::is_enabled());
+  _gc_par_phases[StringDedupTableFixup]->set_enabled(G1StringDedup::is_enabled());
 }
 
 void G1GCPhaseTimes::note_gc_end() {
-  _last_gc_worker_start_times_ms.verify();
-  _last_ext_root_scan_times_ms.verify();
-  _last_satb_filtering_times_ms.verify();
-  _last_update_rs_times_ms.verify();
-  _last_update_rs_processed_buffers.verify();
-  _last_scan_rs_times_ms.verify();
-  _last_strong_code_root_scan_times_ms.verify();
-  _last_obj_copy_times_ms.verify();
-  _last_termination_times_ms.verify();
-  _last_termination_attempts.verify();
-  _last_gc_worker_end_times_ms.verify();
-
   for (uint i = 0; i < _active_gc_threads; i++) {
-    double worker_time = _last_gc_worker_end_times_ms.get(i) - _last_gc_worker_start_times_ms.get(i);
-    _last_gc_worker_times_ms.set(i, worker_time);
+    double worker_time = _gc_par_phases[GCWorkerEnd]->get(i) - _gc_par_phases[GCWorkerStart]->get(i);
+    record_time_secs(GCWorkerTotal, i , worker_time);
 
-    double worker_known_time = _last_ext_root_scan_times_ms.get(i) +
-                               _last_satb_filtering_times_ms.get(i) +
-                               _last_update_rs_times_ms.get(i) +
-                               _last_scan_rs_times_ms.get(i) +
-                               _last_strong_code_root_scan_times_ms.get(i) +
-                               _last_obj_copy_times_ms.get(i) +
-                               _last_termination_times_ms.get(i);
+    double worker_known_time =
+        _gc_par_phases[ExtRootScan]->get(i) +
+        _gc_par_phases[SATBFiltering]->get(i) +
+        _gc_par_phases[UpdateRS]->get(i) +
+        _gc_par_phases[ScanRS]->get(i) +
+        _gc_par_phases[CodeRoots]->get(i) +
+        _gc_par_phases[ObjCopy]->get(i) +
+        _gc_par_phases[Termination]->get(i);
 
-    double worker_other_time = worker_time - worker_known_time;
-    _last_gc_worker_other_times_ms.set(i, worker_other_time);
+    record_time_secs(Other, i, worker_time - worker_known_time);
   }
 
-  _last_gc_worker_times_ms.verify();
-  _last_gc_worker_other_times_ms.verify();
-
-  _last_redirty_logged_cards_time_ms.verify();
-  _last_redirty_logged_cards_processed_cards.verify();
-}
-
-void G1GCPhaseTimes::note_string_dedup_fixup_start() {
-  _cur_string_dedup_queue_fixup_worker_times_ms.reset();
-  _cur_string_dedup_table_fixup_worker_times_ms.reset();
-}
-
-void G1GCPhaseTimes::note_string_dedup_fixup_end() {
-  _cur_string_dedup_queue_fixup_worker_times_ms.verify();
-  _cur_string_dedup_table_fixup_worker_times_ms.verify();
+  for (int i = 0; i < GCParPhasesSentinel; i++) {
+    _gc_par_phases[i]->verify();
+  }
 }
 
 void G1GCPhaseTimes::print_stats(int level, const char* str, double value) {
@@ -288,35 +362,172 @@
     return misc_time_ms;
 }
 
+// record the time a phase took in seconds
+void G1GCPhaseTimes::record_time_secs(GCParPhases phase, uint worker_i, double secs) {
+  _gc_par_phases[phase]->set(worker_i, secs);
+}
+
+// add a number of seconds to a phase
+void G1GCPhaseTimes::add_time_secs(GCParPhases phase, uint worker_i, double secs) {
+  _gc_par_phases[phase]->add(worker_i, secs);
+}
+
+void G1GCPhaseTimes::record_thread_work_item(GCParPhases phase, uint worker_i, size_t count) {
+  _gc_par_phases[phase]->set_thread_work_item(worker_i, count);
+}
+
+// return the average time for a phase in milliseconds
+double G1GCPhaseTimes::average_time_ms(GCParPhases phase) {
+  return _gc_par_phases[phase]->average() * 1000.0;
+}
+
+double G1GCPhaseTimes::get_time_ms(GCParPhases phase, uint worker_i) {
+  return _gc_par_phases[phase]->get(worker_i) * 1000.0;
+}
+
+double G1GCPhaseTimes::sum_time_ms(GCParPhases phase) {
+  return _gc_par_phases[phase]->sum() * 1000.0;
+}
+
+double G1GCPhaseTimes::min_time_ms(GCParPhases phase) {
+  return _gc_par_phases[phase]->minimum() * 1000.0;
+}
+
+double G1GCPhaseTimes::max_time_ms(GCParPhases phase) {
+  return _gc_par_phases[phase]->maximum() * 1000.0;
+}
+
+size_t G1GCPhaseTimes::get_thread_work_item(GCParPhases phase, uint worker_i) {
+  assert(_gc_par_phases[phase]->thread_work_items() != NULL, "No sub count");
+  return _gc_par_phases[phase]->thread_work_items()->get(worker_i);
+}
+
+size_t G1GCPhaseTimes::sum_thread_work_items(GCParPhases phase) {
+  assert(_gc_par_phases[phase]->thread_work_items() != NULL, "No sub count");
+  return _gc_par_phases[phase]->thread_work_items()->sum();
+}
+
+double G1GCPhaseTimes::average_thread_work_items(GCParPhases phase) {
+  assert(_gc_par_phases[phase]->thread_work_items() != NULL, "No sub count");
+  return _gc_par_phases[phase]->thread_work_items()->average();
+}
+
+size_t G1GCPhaseTimes::min_thread_work_items(GCParPhases phase) {
+  assert(_gc_par_phases[phase]->thread_work_items() != NULL, "No sub count");
+  return _gc_par_phases[phase]->thread_work_items()->minimum();
+}
+
+size_t G1GCPhaseTimes::max_thread_work_items(GCParPhases phase) {
+  assert(_gc_par_phases[phase]->thread_work_items() != NULL, "No sub count");
+  return _gc_par_phases[phase]->thread_work_items()->maximum();
+}
+
+class G1GCParPhasePrinter : public StackObj {
+  G1GCPhaseTimes* _phase_times;
+ public:
+  G1GCParPhasePrinter(G1GCPhaseTimes* phase_times) : _phase_times(phase_times) {}
+
+  void print(G1GCPhaseTimes::GCParPhases phase_id) {
+    WorkerDataArray<double>* phase = _phase_times->_gc_par_phases[phase_id];
+
+    if (phase->_log_level > G1Log::level() || !phase->_enabled) {
+      return;
+    }
+
+    if (phase->_length == 1) {
+      print_single_length(phase_id, phase);
+    } else {
+      print_multi_length(phase_id, phase);
+    }
+  }
+
+ private:
+
+  void print_single_length(G1GCPhaseTimes::GCParPhases phase_id, WorkerDataArray<double>* phase) {
+    // No need for min, max, average and sum for only one worker
+    LineBuffer buf(phase->_indent_level);
+    buf.append_and_print_cr("[%s:  %.1lf]", phase->_title, _phase_times->get_time_ms(phase_id, 0));
+
+    if (phase->_thread_work_items != NULL) {
+      LineBuffer buf2(phase->_thread_work_items->_indent_level);
+      buf2.append_and_print_cr("[%s:  "SIZE_FORMAT"]", phase->_thread_work_items->_title, _phase_times->sum_thread_work_items(phase_id));
+    }
+  }
+
+  void print_time_values(LineBuffer& buf, G1GCPhaseTimes::GCParPhases phase_id, WorkerDataArray<double>* phase) {
+    for (uint i = 0; i < phase->_length; ++i) {
+      buf.append("  %.1lf", _phase_times->get_time_ms(phase_id, i));
+    }
+    buf.print_cr();
+  }
+
+  void print_count_values(LineBuffer& buf, G1GCPhaseTimes::GCParPhases phase_id, WorkerDataArray<size_t>* thread_work_items) {
+    for (uint i = 0; i < thread_work_items->_length; ++i) {
+      buf.append("  " SIZE_FORMAT, _phase_times->get_thread_work_item(phase_id, i));
+    }
+    buf.print_cr();
+  }
+
+  void print_thread_work_items(G1GCPhaseTimes::GCParPhases phase_id, WorkerDataArray<size_t>* thread_work_items) {
+    LineBuffer buf(thread_work_items->_indent_level);
+    buf.append("[%s:", thread_work_items->_title);
+
+    if (G1Log::finest()) {
+      print_count_values(buf, phase_id, thread_work_items);
+    }
+
+    assert(thread_work_items->_print_sum, err_msg("%s does not have print sum true even though it is a count", thread_work_items->_title));
+
+    buf.append_and_print_cr(" Min: " SIZE_FORMAT ", Avg: %.1lf, Max: " SIZE_FORMAT ", Diff: " SIZE_FORMAT ", Sum: " SIZE_FORMAT "]",
+        _phase_times->min_thread_work_items(phase_id), _phase_times->average_thread_work_items(phase_id), _phase_times->max_thread_work_items(phase_id),
+        _phase_times->max_thread_work_items(phase_id) - _phase_times->min_thread_work_items(phase_id), _phase_times->sum_thread_work_items(phase_id));
+  }
+
+  void print_multi_length(G1GCPhaseTimes::GCParPhases phase_id, WorkerDataArray<double>* phase) {
+    LineBuffer buf(phase->_indent_level);
+    buf.append("[%s:", phase->_title);
+
+    if (G1Log::finest()) {
+      print_time_values(buf, phase_id, phase);
+    }
+
+    buf.append(" Min: %.1lf, Avg: %.1lf, Max: %.1lf, Diff: %.1lf",
+        _phase_times->min_time_ms(phase_id), _phase_times->average_time_ms(phase_id), _phase_times->max_time_ms(phase_id),
+        _phase_times->max_time_ms(phase_id) - _phase_times->min_time_ms(phase_id));
+
+    if (phase->_print_sum) {
+      // for things like the start and end times the sum is not
+      // that relevant
+      buf.append(", Sum: %.1lf", _phase_times->sum_time_ms(phase_id));
+    }
+
+    buf.append_and_print_cr("]");
+
+    if (phase->_thread_work_items != NULL) {
+      print_thread_work_items(phase_id, phase->_thread_work_items);
+    }
+  }
+};
+
 void G1GCPhaseTimes::print(double pause_time_sec) {
+  G1GCParPhasePrinter par_phase_printer(this);
+
   if (_root_region_scan_wait_time_ms > 0.0) {
     print_stats(1, "Root Region Scan Waiting", _root_region_scan_wait_time_ms);
   }
+
   print_stats(1, "Parallel Time", _cur_collection_par_time_ms, _active_gc_threads);
-  _last_gc_worker_start_times_ms.print(2, "GC Worker Start (ms)");
-  _last_ext_root_scan_times_ms.print(2, "Ext Root Scanning (ms)");
-  if (_last_satb_filtering_times_ms.sum() > 0.0) {
-    _last_satb_filtering_times_ms.print(2, "SATB Filtering (ms)");
+  for (int i = 0; i <= GCMainParPhasesLast; i++) {
+    par_phase_printer.print((GCParPhases) i);
   }
-  _last_update_rs_times_ms.print(2, "Update RS (ms)");
-    _last_update_rs_processed_buffers.print(3, "Processed Buffers");
-  _last_scan_rs_times_ms.print(2, "Scan RS (ms)");
-  _last_strong_code_root_scan_times_ms.print(2, "Code Root Scanning (ms)");
-  _last_obj_copy_times_ms.print(2, "Object Copy (ms)");
-  _last_termination_times_ms.print(2, "Termination (ms)");
-  if (G1Log::finest()) {
-    _last_termination_attempts.print(3, "Termination Attempts");
-  }
-  _last_gc_worker_other_times_ms.print(2, "GC Worker Other (ms)");
-  _last_gc_worker_times_ms.print(2, "GC Worker Total (ms)");
-  _last_gc_worker_end_times_ms.print(2, "GC Worker End (ms)");
 
   print_stats(1, "Code Root Fixup", _cur_collection_code_root_fixup_time_ms);
   print_stats(1, "Code Root Purge", _cur_strong_code_root_purge_time_ms);
   if (G1StringDedup::is_enabled()) {
     print_stats(1, "String Dedup Fixup", _cur_string_dedup_fixup_time_ms, _active_gc_threads);
-    _cur_string_dedup_queue_fixup_worker_times_ms.print(2, "Queue Fixup (ms)");
-    _cur_string_dedup_table_fixup_worker_times_ms.print(2, "Table Fixup (ms)");
+    for (int i = StringDedupPhasesFirst; i <= StringDedupPhasesLast; i++) {
+      par_phase_printer.print((GCParPhases) i);
+    }
   }
   print_stats(1, "Clear CT", _cur_clear_ct_time_ms);
   double misc_time_ms = pause_time_sec * MILLIUNITS - accounted_time_ms();
@@ -340,10 +551,7 @@
   print_stats(2, "Ref Proc", _cur_ref_proc_time_ms);
   print_stats(2, "Ref Enq", _cur_ref_enq_time_ms);
   print_stats(2, "Redirty Cards", _recorded_redirty_logged_cards_time_ms);
-  if (G1Log::finest()) {
-    _last_redirty_logged_cards_time_ms.print(3, "Parallel Redirty");
-    _last_redirty_logged_cards_processed_cards.print(3, "Redirtied Cards");
-  }
+  par_phase_printer.print(RedirtyCards);
   if (G1EagerReclaimHumongousObjects) {
     print_stats(2, "Humongous Register", _cur_fast_reclaim_humongous_register_time_ms);
     if (G1Log::finest()) {
@@ -366,3 +574,17 @@
     print_stats(2, "Verify After", _cur_verify_after_time_ms);
   }
 }
+
+G1GCParPhaseTimesTracker::G1GCParPhaseTimesTracker(G1GCPhaseTimes* phase_times, G1GCPhaseTimes::GCParPhases phase, uint worker_id) :
+    _phase_times(phase_times), _phase(phase), _worker_id(worker_id) {
+  if (_phase_times != NULL) {
+    _start_time = os::elapsedTime();
+  }
+}
+
+G1GCParPhaseTimesTracker::~G1GCParPhaseTimesTracker() {
+  if (_phase_times != NULL) {
+    _phase_times->record_time_secs(_phase, _worker_id, os::elapsedTime() - _start_time);
+  }
+}
+
diff --git a/hotspot/src/share/vm/gc_implementation/g1/g1GCPhaseTimes.hpp b/hotspot/src/share/vm/gc_implementation/g1/g1GCPhaseTimes.hpp
index 0c6c331..54165ca 100644
--- a/hotspot/src/share/vm/gc_implementation/g1/g1GCPhaseTimes.hpp
+++ b/hotspot/src/share/vm/gc_implementation/g1/g1GCPhaseTimes.hpp
@@ -26,106 +26,60 @@
 #define SHARE_VM_GC_IMPLEMENTATION_G1_G1GCPHASETIMESLOG_HPP
 
 #include "memory/allocation.hpp"
-#include "gc_interface/gcCause.hpp"
 
-template <class T>
-class WorkerDataArray  : public CHeapObj<mtGC> {
-  T*          _data;
-  uint        _length;
-  const char* _print_format;
-  bool        _print_sum;
+class LineBuffer;
 
-  NOT_PRODUCT(static const T _uninitialized;)
-
-  // We are caching the sum and average to only have to calculate them once.
-  // This is not done in an MT-safe way. It is intended to allow single
-  // threaded code to call sum() and average() multiple times in any order
-  // without having to worry about the cost.
-  bool   _has_new_data;
-  T      _sum;
-  double _average;
-
- public:
-  WorkerDataArray(uint length, const char* print_format, bool print_sum = true) :
-  _length(length), _print_format(print_format), _print_sum(print_sum), _has_new_data(true) {
-    assert(length > 0, "Must have some workers to store data for");
-    _data = NEW_C_HEAP_ARRAY(T, _length, mtGC);
-  }
-
-  ~WorkerDataArray() {
-    FREE_C_HEAP_ARRAY(T, _data);
-  }
-
-  void set(uint worker_i, T value) {
-    assert(worker_i < _length, err_msg("Worker %d is greater than max: %d", worker_i, _length));
-    assert(_data[worker_i] == (T)-1, err_msg("Overwriting data for worker %d", worker_i));
-    _data[worker_i] = value;
-    _has_new_data = true;
-  }
-
-  T get(uint worker_i) {
-    assert(worker_i < _length, err_msg("Worker %d is greater than max: %d", worker_i, _length));
-    assert(_data[worker_i] != (T)-1, err_msg("No data to add to for worker %d", worker_i));
-    return _data[worker_i];
-  }
-
-  void add(uint worker_i, T value) {
-    assert(worker_i < _length, err_msg("Worker %d is greater than max: %d", worker_i, _length));
-    assert(_data[worker_i] != (T)-1, err_msg("No data to add to for worker %d", worker_i));
-    _data[worker_i] += value;
-    _has_new_data = true;
-  }
-
-  double average(){
-    if (_has_new_data) {
-      calculate_totals();
-    }
-    return _average;
-  }
-
-  T sum() {
-    if (_has_new_data) {
-      calculate_totals();
-    }
-    return _sum;
-  }
-
-  void print(int level, const char* title);
-
-  void reset() PRODUCT_RETURN;
-  void verify() PRODUCT_RETURN;
-
- private:
-
-  void calculate_totals(){
-    _sum = (T)0;
-    for (uint i = 0; i < _length; ++i) {
-      _sum += _data[i];
-    }
-    _average = (double)_sum / (double)_length;
-    _has_new_data = false;
-  }
-};
+template <class T> class WorkerDataArray;
 
 class G1GCPhaseTimes : public CHeapObj<mtGC> {
+  friend class G1GCParPhasePrinter;
 
- private:
   uint _active_gc_threads;
   uint _max_gc_threads;
 
-  WorkerDataArray<double> _last_gc_worker_start_times_ms;
-  WorkerDataArray<double> _last_ext_root_scan_times_ms;
-  WorkerDataArray<double> _last_satb_filtering_times_ms;
-  WorkerDataArray<double> _last_update_rs_times_ms;
-  WorkerDataArray<int>    _last_update_rs_processed_buffers;
-  WorkerDataArray<double> _last_scan_rs_times_ms;
-  WorkerDataArray<double> _last_strong_code_root_scan_times_ms;
-  WorkerDataArray<double> _last_obj_copy_times_ms;
-  WorkerDataArray<double> _last_termination_times_ms;
-  WorkerDataArray<size_t> _last_termination_attempts;
-  WorkerDataArray<double> _last_gc_worker_end_times_ms;
-  WorkerDataArray<double> _last_gc_worker_times_ms;
-  WorkerDataArray<double> _last_gc_worker_other_times_ms;
+ public:
+  enum GCParPhases {
+    GCWorkerStart,
+    ExtRootScan,
+    ThreadRoots,
+    StringTableRoots,
+    UniverseRoots,
+    JNIRoots,
+    ObjectSynchronizerRoots,
+    FlatProfilerRoots,
+    ManagementRoots,
+    SystemDictionaryRoots,
+    CLDGRoots,
+    JVMTIRoots,
+    CodeCacheRoots,
+    CMRefRoots,
+    WaitForStrongCLD,
+    WeakCLDRoots,
+    SATBFiltering,
+    UpdateRS,
+    ScanRS,
+    CodeRoots,
+    ObjCopy,
+    Termination,
+    Other,
+    GCWorkerTotal,
+    GCWorkerEnd,
+    StringDedupQueueFixup,
+    StringDedupTableFixup,
+    RedirtyCards,
+    GCParPhasesSentinel
+  };
+
+ private:
+  // Markers for grouping the phases in the GCPhases enum above
+  static const int GCMainParPhasesLast = GCWorkerEnd;
+  static const int StringDedupPhasesFirst = StringDedupQueueFixup;
+  static const int StringDedupPhasesLast = StringDedupTableFixup;
+
+  WorkerDataArray<double>* _gc_par_phases[GCParPhasesSentinel];
+  WorkerDataArray<size_t>* _update_rs_processed_buffers;
+  WorkerDataArray<size_t>* _termination_attempts;
+  WorkerDataArray<size_t>* _redirtied_cards;
 
   double _cur_collection_par_time_ms;
   double _cur_collection_code_root_fixup_time_ms;
@@ -135,9 +89,7 @@
   double _cur_evac_fail_restore_remsets;
   double _cur_evac_fail_remove_self_forwards;
 
-  double                  _cur_string_dedup_fixup_time_ms;
-  WorkerDataArray<double> _cur_string_dedup_queue_fixup_worker_times_ms;
-  WorkerDataArray<double> _cur_string_dedup_table_fixup_worker_times_ms;
+  double _cur_string_dedup_fixup_time_ms;
 
   double _cur_clear_ct_time_ms;
   double _cur_ref_proc_time_ms;
@@ -149,8 +101,6 @@
   double _recorded_young_cset_choice_time_ms;
   double _recorded_non_young_cset_choice_time_ms;
 
-  WorkerDataArray<double> _last_redirty_logged_cards_time_ms;
-  WorkerDataArray<size_t> _last_redirty_logged_cards_processed_cards;
   double _recorded_redirty_logged_cards_time_ms;
 
   double _recorded_young_free_cset_time_ms;
@@ -172,54 +122,34 @@
 
  public:
   G1GCPhaseTimes(uint max_gc_threads);
-  void note_gc_start(uint active_gc_threads);
+  void note_gc_start(uint active_gc_threads, bool mark_in_progress);
   void note_gc_end();
   void print(double pause_time_sec);
 
-  void record_gc_worker_start_time(uint worker_i, double ms) {
-    _last_gc_worker_start_times_ms.set(worker_i, ms);
-  }
+  // record the time a phase took in seconds
+  void record_time_secs(GCParPhases phase, uint worker_i, double secs);
 
-  void record_ext_root_scan_time(uint worker_i, double ms) {
-    _last_ext_root_scan_times_ms.set(worker_i, ms);
-  }
+  // add a number of seconds to a phase
+  void add_time_secs(GCParPhases phase, uint worker_i, double secs);
 
-  void record_satb_filtering_time(uint worker_i, double ms) {
-    _last_satb_filtering_times_ms.set(worker_i, ms);
-  }
+  void record_thread_work_item(GCParPhases phase, uint worker_i, size_t count);
 
-  void record_update_rs_time(uint worker_i, double ms) {
-    _last_update_rs_times_ms.set(worker_i, ms);
-  }
+  // return the average time for a phase in milliseconds
+  double average_time_ms(GCParPhases phase);
 
-  void record_update_rs_processed_buffers(uint worker_i, int processed_buffers) {
-    _last_update_rs_processed_buffers.set(worker_i, processed_buffers);
-  }
+  size_t sum_thread_work_items(GCParPhases phase);
 
-  void record_scan_rs_time(uint worker_i, double ms) {
-    _last_scan_rs_times_ms.set(worker_i, ms);
-  }
+ private:
+  double get_time_ms(GCParPhases phase, uint worker_i);
+  double sum_time_ms(GCParPhases phase);
+  double min_time_ms(GCParPhases phase);
+  double max_time_ms(GCParPhases phase);
+  size_t get_thread_work_item(GCParPhases phase, uint worker_i);
+  double average_thread_work_items(GCParPhases phase);
+  size_t min_thread_work_items(GCParPhases phase);
+  size_t max_thread_work_items(GCParPhases phase);
 
-  void record_strong_code_root_scan_time(uint worker_i, double ms) {
-    _last_strong_code_root_scan_times_ms.set(worker_i, ms);
-  }
-
-  void record_obj_copy_time(uint worker_i, double ms) {
-    _last_obj_copy_times_ms.set(worker_i, ms);
-  }
-
-  void add_obj_copy_time(uint worker_i, double ms) {
-    _last_obj_copy_times_ms.add(worker_i, ms);
-  }
-
-  void record_termination(uint worker_i, double ms, size_t attempts) {
-    _last_termination_times_ms.set(worker_i, ms);
-    _last_termination_attempts.set(worker_i, attempts);
-  }
-
-  void record_gc_worker_end_time(uint worker_i, double ms) {
-    _last_gc_worker_end_times_ms.set(worker_i, ms);
-  }
+ public:
 
   void record_clear_ct_time(double ms) {
     _cur_clear_ct_time_ms = ms;
@@ -249,21 +179,10 @@
     _cur_evac_fail_remove_self_forwards = ms;
   }
 
-  void note_string_dedup_fixup_start();
-  void note_string_dedup_fixup_end();
-
   void record_string_dedup_fixup_time(double ms) {
     _cur_string_dedup_fixup_time_ms = ms;
   }
 
-  void record_string_dedup_queue_fixup_worker_time(uint worker_id, double ms) {
-    _cur_string_dedup_queue_fixup_worker_times_ms.set(worker_id, ms);
-  }
-
-  void record_string_dedup_table_fixup_worker_time(uint worker_id, double ms) {
-    _cur_string_dedup_table_fixup_worker_times_ms.set(worker_id, ms);
-  }
-
   void record_ref_proc_time(double ms) {
     _cur_ref_proc_time_ms = ms;
   }
@@ -303,14 +222,6 @@
     _recorded_non_young_cset_choice_time_ms = time_ms;
   }
 
-  void record_redirty_logged_cards_time_ms(uint worker_i, double time_ms) {
-    _last_redirty_logged_cards_time_ms.set(worker_i, time_ms);
-  }
-
-  void record_redirty_logged_cards_processed_cards(uint worker_i, size_t processed_buffers) {
-    _last_redirty_logged_cards_processed_cards.set(worker_i, processed_buffers);
-  }
-
   void record_redirty_logged_cards_time_ms(double time_ms) {
     _recorded_redirty_logged_cards_time_ms = time_ms;
   }
@@ -364,38 +275,16 @@
   double fast_reclaim_humongous_time_ms() {
     return _cur_fast_reclaim_humongous_time_ms;
   }
+};
 
-  double average_last_update_rs_time() {
-    return _last_update_rs_times_ms.average();
-  }
-
-  int sum_last_update_rs_processed_buffers() {
-    return _last_update_rs_processed_buffers.sum();
-  }
-
-  double average_last_scan_rs_time(){
-    return _last_scan_rs_times_ms.average();
-  }
-
-  double average_last_strong_code_root_scan_time(){
-    return _last_strong_code_root_scan_times_ms.average();
-  }
-
-  double average_last_obj_copy_time() {
-    return _last_obj_copy_times_ms.average();
-  }
-
-  double average_last_termination_time() {
-    return _last_termination_times_ms.average();
-  }
-
-  double average_last_ext_root_scan_time() {
-    return _last_ext_root_scan_times_ms.average();
-  }
-
-  double average_last_satb_filtering_times_ms() {
-    return _last_satb_filtering_times_ms.average();
-  }
+class G1GCParPhaseTimesTracker : public StackObj {
+  double _start_time;
+  G1GCPhaseTimes::GCParPhases _phase;
+  G1GCPhaseTimes* _phase_times;
+  uint _worker_id;
+public:
+  G1GCParPhaseTimesTracker(G1GCPhaseTimes* phase_times, G1GCPhaseTimes::GCParPhases phase, uint worker_id);
+  ~G1GCParPhaseTimesTracker();
 };
 
 #endif // SHARE_VM_GC_IMPLEMENTATION_G1_G1GCPHASETIMESLOG_HPP
diff --git a/hotspot/src/share/vm/gc_implementation/g1/g1Log.hpp b/hotspot/src/share/vm/gc_implementation/g1/g1Log.hpp
index b8da001..6f72c8f 100644
--- a/hotspot/src/share/vm/gc_implementation/g1/g1Log.hpp
+++ b/hotspot/src/share/vm/gc_implementation/g1/g1Log.hpp
@@ -28,6 +28,7 @@
 #include "memory/allocation.hpp"
 
 class G1Log : public AllStatic {
+ public:
   typedef enum {
     LevelNone,
     LevelFine,
@@ -35,6 +36,7 @@
     LevelFinest
   } LogLevel;
 
+ private:
   static LogLevel _level;
 
  public:
@@ -50,6 +52,10 @@
     return _level == LevelFinest;
   }
 
+  static LogLevel level() {
+    return _level;
+  }
+
   static void init();
 };
 
diff --git a/hotspot/src/share/vm/gc_implementation/g1/g1MarkSweep.cpp b/hotspot/src/share/vm/gc_implementation/g1/g1MarkSweep.cpp
index 7ea825d..29020bc 100644
--- a/hotspot/src/share/vm/gc_implementation/g1/g1MarkSweep.cpp
+++ b/hotspot/src/share/vm/gc_implementation/g1/g1MarkSweep.cpp
@@ -31,6 +31,7 @@
 #include "code/icBuffer.hpp"
 #include "gc_implementation/g1/g1Log.hpp"
 #include "gc_implementation/g1/g1MarkSweep.hpp"
+#include "gc_implementation/g1/g1RootProcessor.hpp"
 #include "gc_implementation/g1/g1StringDedup.hpp"
 #include "gc_implementation/shared/gcHeapSummary.hpp"
 #include "gc_implementation/shared/gcTimer.hpp"
@@ -125,21 +126,22 @@
   GCTraceTime tm("phase 1", G1Log::fine() && Verbose, true, gc_timer(), gc_tracer()->gc_id());
   GenMarkSweep::trace(" 1");
 
-  SharedHeap* sh = SharedHeap::heap();
+  G1CollectedHeap* g1h = G1CollectedHeap::heap();
 
   // Need cleared claim bits for the roots processing
   ClassLoaderDataGraph::clear_claimed_marks();
 
   MarkingCodeBlobClosure follow_code_closure(&GenMarkSweep::follow_root_closure, !CodeBlobToOopClosure::FixRelocations);
-  sh->process_strong_roots(true,   // activate StrongRootsScope
-                           SharedHeap::SO_None,
-                           &GenMarkSweep::follow_root_closure,
-                           &GenMarkSweep::follow_cld_closure,
-                           &follow_code_closure);
+  {
+    G1RootProcessor root_processor(g1h);
+    root_processor.process_strong_roots(&GenMarkSweep::follow_root_closure,
+                                        &GenMarkSweep::follow_cld_closure,
+                                        &follow_code_closure);
+  }
 
   // Process reference objects found during marking
   ReferenceProcessor* rp = GenMarkSweep::ref_processor();
-  assert(rp == G1CollectedHeap::heap()->ref_processor_stw(), "Sanity");
+  assert(rp == g1h->ref_processor_stw(), "Sanity");
 
   rp->setup_policy(clear_all_softrefs);
   const ReferenceProcessorStats& stats =
@@ -225,6 +227,12 @@
   }
 };
 
+class G1AlwaysTrueClosure: public BoolObjectClosure {
+public:
+  bool do_object_b(oop p) { return true; }
+};
+static G1AlwaysTrueClosure always_true;
+
 void G1MarkSweep::mark_sweep_phase3() {
   G1CollectedHeap* g1h = G1CollectedHeap::heap();
 
@@ -232,24 +240,23 @@
   GCTraceTime tm("phase 3", G1Log::fine() && Verbose, true, gc_timer(), gc_tracer()->gc_id());
   GenMarkSweep::trace("3");
 
-  SharedHeap* sh = SharedHeap::heap();
-
   // Need cleared claim bits for the roots processing
   ClassLoaderDataGraph::clear_claimed_marks();
 
   CodeBlobToOopClosure adjust_code_closure(&GenMarkSweep::adjust_pointer_closure, CodeBlobToOopClosure::FixRelocations);
-  sh->process_all_roots(true,  // activate StrongRootsScope
-                        SharedHeap::SO_AllCodeCache,
-                        &GenMarkSweep::adjust_pointer_closure,
-                        &GenMarkSweep::adjust_cld_closure,
-                        &adjust_code_closure);
+  {
+    G1RootProcessor root_processor(g1h);
+    root_processor.process_all_roots(&GenMarkSweep::adjust_pointer_closure,
+                                     &GenMarkSweep::adjust_cld_closure,
+                                     &adjust_code_closure);
+  }
 
   assert(GenMarkSweep::ref_processor() == g1h->ref_processor_stw(), "Sanity");
   g1h->ref_processor_stw()->weak_oops_do(&GenMarkSweep::adjust_pointer_closure);
 
   // Now adjust pointers in remaining weak roots.  (All of which should
   // have been cleared if they pointed to non-surviving objects.)
-  sh->process_weak_roots(&GenMarkSweep::adjust_pointer_closure);
+  JNIHandles::weak_oops_do(&always_true, &GenMarkSweep::adjust_pointer_closure);
 
   if (G1StringDedup::is_enabled()) {
     G1StringDedup::oops_do(&GenMarkSweep::adjust_pointer_closure);
diff --git a/hotspot/src/share/vm/gc_implementation/g1/g1OopClosures.hpp b/hotspot/src/share/vm/gc_implementation/g1/g1OopClosures.hpp
index 4f6e655..44a6c12 100644
--- a/hotspot/src/share/vm/gc_implementation/g1/g1OopClosures.hpp
+++ b/hotspot/src/share/vm/gc_implementation/g1/g1OopClosures.hpp
@@ -109,6 +109,18 @@
   template <class T> void do_klass_barrier(T* p, oop new_obj);
 };
 
+enum G1Barrier {
+  G1BarrierNone,
+  G1BarrierEvac,
+  G1BarrierKlass
+};
+
+enum G1Mark {
+  G1MarkNone,
+  G1MarkFromRoot,
+  G1MarkPromotedFromRoot
+};
+
 template <G1Barrier barrier, G1Mark do_mark_object>
 class G1ParCopyClosure : public G1ParCopyHelper {
 private:
diff --git a/hotspot/src/share/vm/gc_implementation/g1/g1ParScanThreadState.cpp b/hotspot/src/share/vm/gc_implementation/g1/g1ParScanThreadState.cpp
index 8849d42..2ec726e 100644
--- a/hotspot/src/share/vm/gc_implementation/g1/g1ParScanThreadState.cpp
+++ b/hotspot/src/share/vm/gc_implementation/g1/g1ParScanThreadState.cpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -226,6 +226,8 @@
   }
 
   assert(obj_ptr != NULL, "when we get here, allocation should have succeeded");
+  assert(_g1h->is_in_reserved(obj_ptr), "Allocated memory should be in the heap");
+
 #ifndef PRODUCT
   // Should this evacuation fail?
   if (_g1h->evacuation_should_fail()) {
diff --git a/hotspot/src/share/vm/gc_implementation/g1/g1RegionToSpaceMapper.hpp b/hotspot/src/share/vm/gc_implementation/g1/g1RegionToSpaceMapper.hpp
index 6b34206..e468777 100644
--- a/hotspot/src/share/vm/gc_implementation/g1/g1RegionToSpaceMapper.hpp
+++ b/hotspot/src/share/vm/gc_implementation/g1/g1RegionToSpaceMapper.hpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -57,6 +57,9 @@
  public:
   MemRegion reserved() { return _storage.reserved(); }
 
+  size_t reserved_size() { return _storage.reserved_size(); }
+  size_t committed_size() { return _storage.committed_size(); }
+
   void set_mapping_changed_listener(G1MappingChangedListener* listener) { _listener = listener; }
 
   virtual ~G1RegionToSpaceMapper() {
diff --git a/hotspot/src/share/vm/gc_implementation/g1/g1RemSet.cpp b/hotspot/src/share/vm/gc_implementation/g1/g1RemSet.cpp
index 010a8dd..eff64c4 100644
--- a/hotspot/src/share/vm/gc_implementation/g1/g1RemSet.cpp
+++ b/hotspot/src/share/vm/gc_implementation/g1/g1RemSet.cpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 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
@@ -79,7 +79,6 @@
     _cards_scanned(NULL), _total_cards_scanned(0),
     _prev_period_summary()
 {
-  _seq_task = new SubTasksDone(NumSeqTasks);
   _cset_rs_update_cl = NEW_C_HEAP_ARRAY(G1ParPushHeapRSClosure*, n_workers(), mtGC);
   for (uint i = 0; i < n_workers(); i++) {
     _cset_rs_update_cl[i] = NULL;
@@ -90,7 +89,6 @@
 }
 
 G1RemSet::~G1RemSet() {
-  delete _seq_task;
   for (uint i = 0; i < n_workers(); i++) {
     assert(_cset_rs_update_cl[i] == NULL, "it should be");
   }
@@ -109,7 +107,7 @@
 
   double _strong_code_root_scan_time_sec;
   uint   _worker_i;
-  int    _block_size;
+  size_t _block_size;
   bool   _try_claimed;
 
 public:
@@ -127,7 +125,7 @@
     _g1h = G1CollectedHeap::heap();
     _bot_shared = _g1h->bot_shared();
     _ct_bs = _g1h->g1_barrier_set();
-    _block_size = MAX2<int>(G1RSetScanBlockSize, 1);
+    _block_size = MAX2<size_t>(G1RSetScanBlockSize, 1);
   }
 
   void set_try_claimed() { _try_claimed = true; }
@@ -248,9 +246,8 @@
   assert(_cards_scanned != NULL, "invariant");
   _cards_scanned[worker_i] = scanRScl.cards_done();
 
-  _g1p->phase_times()->record_scan_rs_time(worker_i, scan_rs_time_sec * 1000.0);
-  _g1p->phase_times()->record_strong_code_root_scan_time(worker_i,
-                                                         scanRScl.strong_code_root_scan_time_sec() * 1000.0);
+  _g1p->phase_times()->record_time_secs(G1GCPhaseTimes::ScanRS, worker_i, scan_rs_time_sec);
+  _g1p->phase_times()->record_time_secs(G1GCPhaseTimes::CodeRoots, worker_i, scanRScl.strong_code_root_scan_time_sec());
 }
 
 // Closure used for updating RSets and recording references that
@@ -287,13 +284,11 @@
 };
 
 void G1RemSet::updateRS(DirtyCardQueue* into_cset_dcq, uint worker_i) {
-  double start = os::elapsedTime();
+  G1GCParPhaseTimesTracker x(_g1p->phase_times(), G1GCPhaseTimes::UpdateRS, worker_i);
   // Apply the given closure to all remaining log entries.
   RefineRecordRefsIntoCSCardTableEntryClosure into_cset_update_rs_cl(_g1, into_cset_dcq);
 
   _g1->iterate_dirty_card_closure(&into_cset_update_rs_cl, into_cset_dcq, false, worker_i);
-
-  _g1p->phase_times()->record_update_rs_time(worker_i, (os::elapsedTime() - start) * 1000.0);
 }
 
 void G1RemSet::cleanupHRRS() {
diff --git a/hotspot/src/share/vm/gc_implementation/g1/g1RemSet.hpp b/hotspot/src/share/vm/gc_implementation/g1/g1RemSet.hpp
index fb9d348..77eed43 100644
--- a/hotspot/src/share/vm/gc_implementation/g1/g1RemSet.hpp
+++ b/hotspot/src/share/vm/gc_implementation/g1/g1RemSet.hpp
@@ -58,7 +58,6 @@
   };
 
   CardTableModRefBS*     _ct_bs;
-  SubTasksDone*          _seq_task;
   G1CollectorPolicy*     _g1p;
 
   ConcurrentG1Refine*    _cg1r;
diff --git a/hotspot/src/share/vm/gc_implementation/g1/g1RootProcessor.cpp b/hotspot/src/share/vm/gc_implementation/g1/g1RootProcessor.cpp
new file mode 100644
index 0000000..0a31dc7
--- /dev/null
+++ b/hotspot/src/share/vm/gc_implementation/g1/g1RootProcessor.cpp
@@ -0,0 +1,337 @@
+/*
+ * 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 "precompiled.hpp"
+
+#include "classfile/stringTable.hpp"
+#include "classfile/systemDictionary.hpp"
+#include "code/codeCache.hpp"
+#include "gc_implementation/g1/bufferingOopClosure.hpp"
+#include "gc_implementation/g1/g1CollectedHeap.inline.hpp"
+#include "gc_implementation/g1/g1CollectorPolicy.hpp"
+#include "gc_implementation/g1/g1GCPhaseTimes.hpp"
+#include "gc_implementation/g1/g1RemSet.inline.hpp"
+#include "gc_implementation/g1/g1RootProcessor.hpp"
+#include "memory/allocation.inline.hpp"
+#include "runtime/fprofiler.hpp"
+#include "runtime/mutex.hpp"
+#include "services/management.hpp"
+
+class G1CodeBlobClosure : public CodeBlobClosure {
+  class HeapRegionGatheringOopClosure : public OopClosure {
+    G1CollectedHeap* _g1h;
+    OopClosure* _work;
+    nmethod* _nm;
+
+    template <typename T>
+    void do_oop_work(T* p) {
+      _work->do_oop(p);
+      T oop_or_narrowoop = oopDesc::load_heap_oop(p);
+      if (!oopDesc::is_null(oop_or_narrowoop)) {
+        oop o = oopDesc::decode_heap_oop_not_null(oop_or_narrowoop);
+        HeapRegion* hr = _g1h->heap_region_containing_raw(o);
+        assert(!_g1h->obj_in_cs(o) || hr->rem_set()->strong_code_roots_list_contains(_nm), "if o still in CS then evacuation failed and nm must already be in the remset");
+        hr->add_strong_code_root(_nm);
+      }
+    }
+
+  public:
+    HeapRegionGatheringOopClosure(OopClosure* oc) : _g1h(G1CollectedHeap::heap()), _work(oc), _nm(NULL) {}
+
+    void do_oop(oop* o) {
+      do_oop_work(o);
+    }
+
+    void do_oop(narrowOop* o) {
+      do_oop_work(o);
+    }
+
+    void set_nm(nmethod* nm) {
+      _nm = nm;
+    }
+  };
+
+  HeapRegionGatheringOopClosure _oc;
+public:
+  G1CodeBlobClosure(OopClosure* oc) : _oc(oc) {}
+
+  void do_code_blob(CodeBlob* cb) {
+    nmethod* nm = cb->as_nmethod_or_null();
+    if (nm != NULL) {
+      if (!nm->test_set_oops_do_mark()) {
+        _oc.set_nm(nm);
+        nm->oops_do(&_oc);
+        nm->fix_oop_relocations();
+      }
+    }
+  }
+};
+
+
+void G1RootProcessor::worker_has_discovered_all_strong_classes() {
+  uint n_workers = _g1h->n_par_threads();
+  assert(ClassUnloadingWithConcurrentMark, "Currently only needed when doing G1 Class Unloading");
+
+  uint new_value = (uint)Atomic::add(1, &_n_workers_discovered_strong_classes);
+  if (new_value == n_workers) {
+    // This thread is last. Notify the others.
+    MonitorLockerEx ml(&_lock, Mutex::_no_safepoint_check_flag);
+    _lock.notify_all();
+  }
+}
+
+void G1RootProcessor::wait_until_all_strong_classes_discovered() {
+  uint n_workers = _g1h->n_par_threads();
+  assert(ClassUnloadingWithConcurrentMark, "Currently only needed when doing G1 Class Unloading");
+
+  if ((uint)_n_workers_discovered_strong_classes != n_workers) {
+    MonitorLockerEx ml(&_lock, Mutex::_no_safepoint_check_flag);
+    while ((uint)_n_workers_discovered_strong_classes != n_workers) {
+      _lock.wait(Mutex::_no_safepoint_check_flag, 0, false);
+    }
+  }
+}
+
+G1RootProcessor::G1RootProcessor(G1CollectedHeap* g1h) :
+    _g1h(g1h),
+    _process_strong_tasks(new SubTasksDone(G1RP_PS_NumElements)),
+    _srs(g1h),
+    _lock(Mutex::leaf, "G1 Root Scanning barrier lock", false, Monitor::_safepoint_check_never),
+    _n_workers_discovered_strong_classes(0) {}
+
+void G1RootProcessor::evacuate_roots(OopClosure* scan_non_heap_roots,
+                                     OopClosure* scan_non_heap_weak_roots,
+                                     CLDClosure* scan_strong_clds,
+                                     CLDClosure* scan_weak_clds,
+                                     bool trace_metadata,
+                                     uint worker_i) {
+  // First scan the shared roots.
+  double ext_roots_start = os::elapsedTime();
+  G1GCPhaseTimes* phase_times = _g1h->g1_policy()->phase_times();
+
+  BufferingOopClosure buf_scan_non_heap_roots(scan_non_heap_roots);
+  BufferingOopClosure buf_scan_non_heap_weak_roots(scan_non_heap_weak_roots);
+
+  OopClosure* const weak_roots = &buf_scan_non_heap_weak_roots;
+  OopClosure* const strong_roots = &buf_scan_non_heap_roots;
+
+  // CodeBlobClosures are not interoperable with BufferingOopClosures
+  G1CodeBlobClosure root_code_blobs(scan_non_heap_roots);
+
+  process_java_roots(strong_roots,
+                     trace_metadata ? scan_strong_clds : NULL,
+                     scan_strong_clds,
+                     trace_metadata ? NULL : scan_weak_clds,
+                     &root_code_blobs,
+                     phase_times,
+                     worker_i);
+
+  // This is the point where this worker thread will not find more strong CLDs/nmethods.
+  // Report this so G1 can synchronize the strong and weak CLDs/nmethods processing.
+  if (trace_metadata) {
+    worker_has_discovered_all_strong_classes();
+  }
+
+  process_vm_roots(strong_roots, weak_roots, phase_times, worker_i);
+
+  {
+    // Now the CM ref_processor roots.
+    G1GCParPhaseTimesTracker x(phase_times, G1GCPhaseTimes::CMRefRoots, worker_i);
+    if (!_process_strong_tasks->is_task_claimed(G1RP_PS_refProcessor_oops_do)) {
+      // We need to treat the discovered reference lists of the
+      // concurrent mark ref processor as roots and keep entries
+      // (which are added by the marking threads) on them live
+      // until they can be processed at the end of marking.
+      _g1h->ref_processor_cm()->weak_oops_do(&buf_scan_non_heap_roots);
+    }
+  }
+
+  if (trace_metadata) {
+    {
+      G1GCParPhaseTimesTracker x(phase_times, G1GCPhaseTimes::WaitForStrongCLD, worker_i);
+      // Barrier to make sure all workers passed
+      // the strong CLD and strong nmethods phases.
+      wait_until_all_strong_classes_discovered();
+    }
+
+    // Now take the complement of the strong CLDs.
+    G1GCParPhaseTimesTracker x(phase_times, G1GCPhaseTimes::WeakCLDRoots, worker_i);
+    ClassLoaderDataGraph::roots_cld_do(NULL, scan_weak_clds);
+  } else {
+    phase_times->record_time_secs(G1GCPhaseTimes::WaitForStrongCLD, worker_i, 0.0);
+    phase_times->record_time_secs(G1GCPhaseTimes::WeakCLDRoots, worker_i, 0.0);
+  }
+
+  // Finish up any enqueued closure apps (attributed as object copy time).
+  buf_scan_non_heap_roots.done();
+  buf_scan_non_heap_weak_roots.done();
+
+  double obj_copy_time_sec = buf_scan_non_heap_roots.closure_app_seconds()
+      + buf_scan_non_heap_weak_roots.closure_app_seconds();
+
+  phase_times->record_time_secs(G1GCPhaseTimes::ObjCopy, worker_i, obj_copy_time_sec);
+
+  double ext_root_time_sec = os::elapsedTime() - ext_roots_start - obj_copy_time_sec;
+
+  phase_times->record_time_secs(G1GCPhaseTimes::ExtRootScan, worker_i, ext_root_time_sec);
+
+  // During conc marking we have to filter the per-thread SATB buffers
+  // to make sure we remove any oops into the CSet (which will show up
+  // as implicitly live).
+  {
+    G1GCParPhaseTimesTracker x(phase_times, G1GCPhaseTimes::SATBFiltering, worker_i);
+    if (!_process_strong_tasks->is_task_claimed(G1RP_PS_filter_satb_buffers) && _g1h->mark_in_progress()) {
+      JavaThread::satb_mark_queue_set().filter_thread_buffers();
+    }
+  }
+
+  _process_strong_tasks->all_tasks_completed();
+}
+
+void G1RootProcessor::process_strong_roots(OopClosure* oops,
+                                           CLDClosure* clds,
+                                           CodeBlobClosure* blobs) {
+
+  process_java_roots(oops, clds, clds, NULL, blobs, NULL, 0);
+  process_vm_roots(oops, NULL, NULL, 0);
+
+  _process_strong_tasks->all_tasks_completed();
+}
+
+void G1RootProcessor::process_all_roots(OopClosure* oops,
+                                        CLDClosure* clds,
+                                        CodeBlobClosure* blobs) {
+
+  process_java_roots(oops, NULL, clds, clds, NULL, NULL, 0);
+  process_vm_roots(oops, oops, NULL, 0);
+
+  if (!_process_strong_tasks->is_task_claimed(G1RP_PS_CodeCache_oops_do)) {
+    CodeCache::blobs_do(blobs);
+  }
+
+  _process_strong_tasks->all_tasks_completed();
+}
+
+void G1RootProcessor::process_java_roots(OopClosure* strong_roots,
+                                         CLDClosure* thread_stack_clds,
+                                         CLDClosure* strong_clds,
+                                         CLDClosure* weak_clds,
+                                         CodeBlobClosure* strong_code,
+                                         G1GCPhaseTimes* phase_times,
+                                         uint worker_i) {
+  assert(thread_stack_clds == NULL || weak_clds == NULL, "There is overlap between those, only one may be set");
+  // Iterating over the CLDG and the Threads are done early to allow us to
+  // first process the strong CLDs and nmethods and then, after a barrier,
+  // let the thread process the weak CLDs and nmethods.
+  {
+    G1GCParPhaseTimesTracker x(phase_times, G1GCPhaseTimes::CLDGRoots, worker_i);
+    if (!_process_strong_tasks->is_task_claimed(G1RP_PS_ClassLoaderDataGraph_oops_do)) {
+      ClassLoaderDataGraph::roots_cld_do(strong_clds, weak_clds);
+    }
+  }
+
+  {
+    G1GCParPhaseTimesTracker x(phase_times, G1GCPhaseTimes::ThreadRoots, worker_i);
+    Threads::possibly_parallel_oops_do(strong_roots, thread_stack_clds, strong_code);
+  }
+}
+
+void G1RootProcessor::process_vm_roots(OopClosure* strong_roots,
+                                       OopClosure* weak_roots,
+                                       G1GCPhaseTimes* phase_times,
+                                       uint worker_i) {
+  {
+    G1GCParPhaseTimesTracker x(phase_times, G1GCPhaseTimes::UniverseRoots, worker_i);
+    if (!_process_strong_tasks->is_task_claimed(G1RP_PS_Universe_oops_do)) {
+      Universe::oops_do(strong_roots);
+    }
+  }
+
+  {
+    G1GCParPhaseTimesTracker x(phase_times, G1GCPhaseTimes::JNIRoots, worker_i);
+    if (!_process_strong_tasks->is_task_claimed(G1RP_PS_JNIHandles_oops_do)) {
+      JNIHandles::oops_do(strong_roots);
+    }
+  }
+
+  {
+    G1GCParPhaseTimesTracker x(phase_times, G1GCPhaseTimes::ObjectSynchronizerRoots, worker_i);
+    if (!_process_strong_tasks-> is_task_claimed(G1RP_PS_ObjectSynchronizer_oops_do)) {
+      ObjectSynchronizer::oops_do(strong_roots);
+    }
+  }
+
+  {
+    G1GCParPhaseTimesTracker x(phase_times, G1GCPhaseTimes::FlatProfilerRoots, worker_i);
+    if (!_process_strong_tasks->is_task_claimed(G1RP_PS_FlatProfiler_oops_do)) {
+      FlatProfiler::oops_do(strong_roots);
+    }
+  }
+
+  {
+    G1GCParPhaseTimesTracker x(phase_times, G1GCPhaseTimes::ManagementRoots, worker_i);
+    if (!_process_strong_tasks->is_task_claimed(G1RP_PS_Management_oops_do)) {
+      Management::oops_do(strong_roots);
+    }
+  }
+
+  {
+    G1GCParPhaseTimesTracker x(phase_times, G1GCPhaseTimes::JVMTIRoots, worker_i);
+    if (!_process_strong_tasks->is_task_claimed(G1RP_PS_jvmti_oops_do)) {
+      JvmtiExport::oops_do(strong_roots);
+    }
+  }
+
+  {
+    G1GCParPhaseTimesTracker x(phase_times, G1GCPhaseTimes::SystemDictionaryRoots, worker_i);
+    if (!_process_strong_tasks->is_task_claimed(G1RP_PS_SystemDictionary_oops_do)) {
+      SystemDictionary::roots_oops_do(strong_roots, weak_roots);
+    }
+  }
+
+  {
+    G1GCParPhaseTimesTracker x(phase_times, G1GCPhaseTimes::StringTableRoots, worker_i);
+    // All threads execute the following. A specific chunk of buckets
+    // from the StringTable are the individual tasks.
+    if (weak_roots != NULL) {
+      StringTable::possibly_parallel_oops_do(weak_roots);
+    }
+  }
+}
+
+void G1RootProcessor::scan_remembered_sets(G1ParPushHeapRSClosure* scan_rs,
+                                           OopClosure* scan_non_heap_weak_roots,
+                                           uint worker_i) {
+  G1GCPhaseTimes* phase_times = _g1h->g1_policy()->phase_times();
+  G1GCParPhaseTimesTracker x(phase_times, G1GCPhaseTimes::CodeCacheRoots, worker_i);
+
+  // Now scan the complement of the collection set.
+  G1CodeBlobClosure scavenge_cs_nmethods(scan_non_heap_weak_roots);
+
+  _g1h->g1_rem_set()->oops_into_collection_set_do(scan_rs, &scavenge_cs_nmethods, worker_i);
+}
+
+void G1RootProcessor::set_num_workers(int active_workers) {
+  _process_strong_tasks->set_n_threads(active_workers);
+}
diff --git a/hotspot/src/share/vm/gc_implementation/g1/g1RootProcessor.hpp b/hotspot/src/share/vm/gc_implementation/g1/g1RootProcessor.hpp
new file mode 100644
index 0000000..ee7b00f
--- /dev/null
+++ b/hotspot/src/share/vm/gc_implementation/g1/g1RootProcessor.hpp
@@ -0,0 +1,121 @@
+/*
+ * 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.
+ *
+ */
+
+#ifndef SHARE_VM_GC_IMPLEMENTATION_G1_ROOTPROCESSOR_HPP
+#define SHARE_VM_GC_IMPLEMENTATION_G1_ROOTPROCESSOR_HPP
+
+#include "memory/allocation.hpp"
+#include "memory/sharedHeap.hpp"
+#include "runtime/mutex.hpp"
+
+class CLDClosure;
+class CodeBlobClosure;
+class G1CollectedHeap;
+class G1GCPhaseTimes;
+class G1ParPushHeapRSClosure;
+class Monitor;
+class OopClosure;
+class SubTasksDone;
+
+// Scoped object to assist in applying oop, CLD and code blob closures to
+// root locations. Handles claiming of different root scanning tasks
+// and takes care of global state for root scanning via a StrongRootsScope.
+// In the parallel case there is a shared G1RootProcessor object where all
+// worker thread call the process_roots methods.
+class G1RootProcessor : public StackObj {
+  G1CollectedHeap* _g1h;
+  SubTasksDone* _process_strong_tasks;
+  SharedHeap::StrongRootsScope _srs;
+
+  // Used to implement the Thread work barrier.
+  Monitor _lock;
+  volatile jint _n_workers_discovered_strong_classes;
+
+  enum G1H_process_roots_tasks {
+    G1RP_PS_Universe_oops_do,
+    G1RP_PS_JNIHandles_oops_do,
+    G1RP_PS_ObjectSynchronizer_oops_do,
+    G1RP_PS_FlatProfiler_oops_do,
+    G1RP_PS_Management_oops_do,
+    G1RP_PS_SystemDictionary_oops_do,
+    G1RP_PS_ClassLoaderDataGraph_oops_do,
+    G1RP_PS_jvmti_oops_do,
+    G1RP_PS_CodeCache_oops_do,
+    G1RP_PS_filter_satb_buffers,
+    G1RP_PS_refProcessor_oops_do,
+    // Leave this one last.
+    G1RP_PS_NumElements
+  };
+
+  void worker_has_discovered_all_strong_classes();
+  void wait_until_all_strong_classes_discovered();
+
+  void process_java_roots(OopClosure* scan_non_heap_roots,
+                          CLDClosure* thread_stack_clds,
+                          CLDClosure* scan_strong_clds,
+                          CLDClosure* scan_weak_clds,
+                          CodeBlobClosure* scan_strong_code,
+                          G1GCPhaseTimes* phase_times,
+                          uint worker_i);
+
+  void process_vm_roots(OopClosure* scan_non_heap_roots,
+                        OopClosure* scan_non_heap_weak_roots,
+                        G1GCPhaseTimes* phase_times,
+                        uint worker_i);
+
+public:
+  G1RootProcessor(G1CollectedHeap* g1h);
+
+  // Apply closures to the strongly and weakly reachable roots in the system
+  // in a single pass.
+  // Record and report timing measurements for sub phases using the worker_i
+  void evacuate_roots(OopClosure* scan_non_heap_roots,
+                      OopClosure* scan_non_heap_weak_roots,
+                      CLDClosure* scan_strong_clds,
+                      CLDClosure* scan_weak_clds,
+                      bool trace_metadata,
+                      uint worker_i);
+
+  // Apply oops, clds and blobs to all strongly reachable roots in the system
+  void process_strong_roots(OopClosure* oops,
+                            CLDClosure* clds,
+                            CodeBlobClosure* blobs);
+
+  // Apply oops, clds and blobs to strongly and weakly reachable roots in the system
+  void process_all_roots(OopClosure* oops,
+                         CLDClosure* clds,
+                         CodeBlobClosure* blobs);
+
+  // Apply scan_rs to all locations in the union of the remembered sets for all
+  // regions in the collection set
+  // (having done "set_region" to indicate the region in which the root resides),
+  void scan_remembered_sets(G1ParPushHeapRSClosure* scan_rs,
+                            OopClosure* scan_non_heap_weak_roots,
+                            uint worker_i);
+
+  // Inform the root processor about the number of worker threads
+  void set_num_workers(int active_workers);
+};
+
+#endif // SHARE_VM_GC_IMPLEMENTATION_G1_ROOTPROCESSOR_HPP
diff --git a/hotspot/src/share/vm/gc_implementation/g1/g1StringDedup.cpp b/hotspot/src/share/vm/gc_implementation/g1/g1StringDedup.cpp
index a929b0f..4b38198 100644
--- a/hotspot/src/share/vm/gc_implementation/g1/g1StringDedup.cpp
+++ b/hotspot/src/share/vm/gc_implementation/g1/g1StringDedup.cpp
@@ -106,7 +106,7 @@
 
 void G1StringDedup::oops_do(OopClosure* keep_alive) {
   assert(is_enabled(), "String deduplication not enabled");
-  unlink_or_oops_do(NULL, keep_alive);
+  unlink_or_oops_do(NULL, keep_alive, true /* allow_resize_and_rehash */);
 }
 
 void G1StringDedup::unlink(BoolObjectClosure* is_alive) {
@@ -123,45 +123,39 @@
 class G1StringDedupUnlinkOrOopsDoTask : public AbstractGangTask {
 private:
   G1StringDedupUnlinkOrOopsDoClosure _cl;
+  G1GCPhaseTimes* _phase_times;
 
 public:
   G1StringDedupUnlinkOrOopsDoTask(BoolObjectClosure* is_alive,
                                   OopClosure* keep_alive,
-                                  bool allow_resize_and_rehash) :
+                                  bool allow_resize_and_rehash,
+                                  G1GCPhaseTimes* phase_times) :
     AbstractGangTask("G1StringDedupUnlinkOrOopsDoTask"),
-    _cl(is_alive, keep_alive, allow_resize_and_rehash) {
-  }
+    _cl(is_alive, keep_alive, allow_resize_and_rehash), _phase_times(phase_times) { }
 
   virtual void work(uint worker_id) {
-    double queue_fixup_start = os::elapsedTime();
-    G1StringDedupQueue::unlink_or_oops_do(&_cl);
-
-    double table_fixup_start = os::elapsedTime();
-    G1StringDedupTable::unlink_or_oops_do(&_cl, worker_id);
-
-    double queue_fixup_time_ms = (table_fixup_start - queue_fixup_start) * 1000.0;
-    double table_fixup_time_ms = (os::elapsedTime() - table_fixup_start) * 1000.0;
-    G1CollectorPolicy* g1p = G1CollectedHeap::heap()->g1_policy();
-    g1p->phase_times()->record_string_dedup_queue_fixup_worker_time(worker_id, queue_fixup_time_ms);
-    g1p->phase_times()->record_string_dedup_table_fixup_worker_time(worker_id, table_fixup_time_ms);
+    {
+      G1GCParPhaseTimesTracker x(_phase_times, G1GCPhaseTimes::StringDedupQueueFixup, worker_id);
+      G1StringDedupQueue::unlink_or_oops_do(&_cl);
+    }
+    {
+      G1GCParPhaseTimesTracker x(_phase_times, G1GCPhaseTimes::StringDedupTableFixup, worker_id);
+      G1StringDedupTable::unlink_or_oops_do(&_cl, worker_id);
+    }
   }
 };
 
-void G1StringDedup::unlink_or_oops_do(BoolObjectClosure* is_alive, OopClosure* keep_alive, bool allow_resize_and_rehash) {
+void G1StringDedup::unlink_or_oops_do(BoolObjectClosure* is_alive,
+                                      OopClosure* keep_alive,
+                                      bool allow_resize_and_rehash,
+                                      G1GCPhaseTimes* phase_times) {
   assert(is_enabled(), "String deduplication not enabled");
-  G1CollectorPolicy* g1p = G1CollectedHeap::heap()->g1_policy();
-  g1p->phase_times()->note_string_dedup_fixup_start();
-  double fixup_start = os::elapsedTime();
 
-  G1StringDedupUnlinkOrOopsDoTask task(is_alive, keep_alive, allow_resize_and_rehash);
+  G1StringDedupUnlinkOrOopsDoTask task(is_alive, keep_alive, allow_resize_and_rehash, phase_times);
   G1CollectedHeap* g1h = G1CollectedHeap::heap();
   g1h->set_par_threads();
   g1h->workers()->run_task(&task);
   g1h->set_par_threads(0);
-
-  double fixup_time_ms = (os::elapsedTime() - fixup_start) * 1000.0;
-  g1p->phase_times()->record_string_dedup_fixup_time(fixup_time_ms);
-  g1p->phase_times()->note_string_dedup_fixup_end();
 }
 
 void G1StringDedup::threads_do(ThreadClosure* tc) {
diff --git a/hotspot/src/share/vm/gc_implementation/g1/g1StringDedup.hpp b/hotspot/src/share/vm/gc_implementation/g1/g1StringDedup.hpp
index 80ee1fd..71c75bc 100644
--- a/hotspot/src/share/vm/gc_implementation/g1/g1StringDedup.hpp
+++ b/hotspot/src/share/vm/gc_implementation/g1/g1StringDedup.hpp
@@ -91,6 +91,7 @@
 class ThreadClosure;
 class outputStream;
 class G1StringDedupTable;
+class G1GCPhaseTimes;
 
 //
 // Main interface for interacting with string deduplication.
@@ -131,7 +132,7 @@
   static void oops_do(OopClosure* keep_alive);
   static void unlink(BoolObjectClosure* is_alive);
   static void unlink_or_oops_do(BoolObjectClosure* is_alive, OopClosure* keep_alive,
-                                bool allow_resize_and_rehash = true);
+                                bool allow_resize_and_rehash, G1GCPhaseTimes* phase_times = NULL);
 
   static void threads_do(ThreadClosure* tc);
   static void print_worker_threads_on(outputStream* st);
diff --git a/hotspot/src/share/vm/gc_implementation/g1/g1_globals.hpp b/hotspot/src/share/vm/gc_implementation/g1/g1_globals.hpp
index 3032968..d1da538 100644
--- a/hotspot/src/share/vm/gc_implementation/g1/g1_globals.hpp
+++ b/hotspot/src/share/vm/gc_implementation/g1/g1_globals.hpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 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
@@ -86,7 +86,7 @@
           "If true, enable reference discovery during concurrent "          \
           "marking and reference processing at the end of remark.")         \
                                                                             \
-  product(intx, G1SATBBufferSize, 1*K,                                      \
+  product(size_t, G1SATBBufferSize, 1*K,                                    \
           "Number of entries in an SATB log buffer.")                       \
                                                                             \
   develop(intx, G1SATBProcessCompletedThreshold, 20,                        \
@@ -112,7 +112,7 @@
             "Prints the liveness information for all regions in the heap "  \
             "at the end of a marking cycle.")                               \
                                                                             \
-  product(intx, G1UpdateBufferSize, 256,                                    \
+  product(size_t, G1UpdateBufferSize, 256,                                  \
           "Size of an update buffer")                                       \
                                                                             \
   product(intx, G1ConcRefinementYellowZone, 0,                              \
@@ -148,7 +148,7 @@
           "Select green, yellow and red zones adaptively to meet the "      \
           "the pause requirements.")                                        \
                                                                             \
-  product(uintx, G1ConcRSLogCacheSize, 10,                                  \
+  product(size_t, G1ConcRSLogCacheSize, 10,                                 \
           "Log base 2 of the length of conc RS hot-card cache.")            \
                                                                             \
   product(uintx, G1ConcRSHotCardLimit, 4,                                   \
@@ -210,7 +210,7 @@
           "When set, G1 will fail when it encounters an FP 'error', "       \
           "so as to allow debugging")                                       \
                                                                             \
-  product(uintx, G1HeapRegionSize, 0,                                       \
+  product(size_t, G1HeapRegionSize, 0,                                      \
           "Size of the G1 regions.")                                        \
                                                                             \
   product(uintx, G1ConcRefinementThreads, 0,                                \
@@ -220,7 +220,7 @@
   develop(bool, G1VerifyCTCleanup, false,                                   \
           "Verify card table cleanup.")                                     \
                                                                             \
-  product(uintx, G1RSetScanBlockSize, 64,                                   \
+  product(size_t, G1RSetScanBlockSize, 64,                                  \
           "Size of a work unit of cards claimed by a worker thread"         \
           "during RSet scanning.")                                          \
                                                                             \
diff --git a/hotspot/src/share/vm/gc_implementation/g1/g1_specialized_oop_closures.hpp b/hotspot/src/share/vm/gc_implementation/g1/g1_specialized_oop_closures.hpp
index 309392c..f3c49d7 100644
--- a/hotspot/src/share/vm/gc_implementation/g1/g1_specialized_oop_closures.hpp
+++ b/hotspot/src/share/vm/gc_implementation/g1/g1_specialized_oop_closures.hpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 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
@@ -30,23 +30,8 @@
 // non-virtually, using a mechanism defined in this file.  Extend these
 // macros in the obvious way to add specializations for new closures.
 
-enum G1Barrier {
-  G1BarrierNone,
-  G1BarrierEvac,
-  G1BarrierKlass
-};
-
-enum G1Mark {
-  G1MarkNone,
-  G1MarkFromRoot,
-  G1MarkPromotedFromRoot
-};
-
 // Forward declarations.
 
-template<G1Barrier barrier, G1Mark do_mark_object>
-class G1ParCopyClosure;
-
 class G1ParScanClosure;
 class G1ParPushHeapRSClosure;
 
@@ -61,26 +46,16 @@
 class G1InvokeIfNotTriggeredClosure;
 class G1UpdateRSOrPushRefOopClosure;
 
-#ifdef FURTHER_SPECIALIZED_OOP_OOP_ITERATE_CLOSURES
-#error "FURTHER_SPECIALIZED_OOP_OOP_ITERATE_CLOSURES already defined."
-#endif
-
-#define FURTHER_SPECIALIZED_OOP_OOP_ITERATE_CLOSURES(f) \
-      f(G1ParScanClosure,_nv)                           \
-      f(G1ParPushHeapRSClosure,_nv)                     \
-      f(FilterIntoCSClosure,_nv)                        \
-      f(FilterOutOfRegionClosure,_nv)                   \
-      f(G1CMOopClosure,_nv)                             \
-      f(G1RootRegionScanClosure,_nv)                    \
-      f(G1Mux2Closure,_nv)                              \
-      f(G1TriggerClosure,_nv)                           \
-      f(G1InvokeIfNotTriggeredClosure,_nv)              \
+#define SPECIALIZED_OOP_OOP_ITERATE_CLOSURES_G1(f) \
+      f(G1ParScanClosure,_nv)                      \
+      f(G1ParPushHeapRSClosure,_nv)                \
+      f(FilterIntoCSClosure,_nv)                   \
+      f(FilterOutOfRegionClosure,_nv)              \
+      f(G1CMOopClosure,_nv)                        \
+      f(G1RootRegionScanClosure,_nv)               \
+      f(G1Mux2Closure,_nv)                         \
+      f(G1TriggerClosure,_nv)                      \
+      f(G1InvokeIfNotTriggeredClosure,_nv)         \
       f(G1UpdateRSOrPushRefOopClosure,_nv)
 
-#ifdef FURTHER_SPECIALIZED_SINCE_SAVE_MARKS_CLOSURES
-#error "FURTHER_SPECIALIZED_SINCE_SAVE_MARKS_CLOSURES already defined."
-#endif
-
-#define FURTHER_SPECIALIZED_SINCE_SAVE_MARKS_CLOSURES(f)
-
 #endif // SHARE_VM_GC_IMPLEMENTATION_G1_G1_SPECIALIZED_OOP_CLOSURES_HPP
diff --git a/hotspot/src/share/vm/gc_implementation/g1/heapRegion.cpp b/hotspot/src/share/vm/gc_implementation/g1/heapRegion.cpp
index 77d8397..0d6c16e 100644
--- a/hotspot/src/share/vm/gc_implementation/g1/heapRegion.cpp
+++ b/hotspot/src/share/vm/gc_implementation/g1/heapRegion.cpp
@@ -106,18 +106,18 @@
 }
 
 void HeapRegion::setup_heap_region_size(size_t initial_heap_size, size_t max_heap_size) {
-  uintx region_size = G1HeapRegionSize;
+  size_t region_size = G1HeapRegionSize;
   if (FLAG_IS_DEFAULT(G1HeapRegionSize)) {
     size_t average_heap_size = (initial_heap_size + max_heap_size) / 2;
     region_size = MAX2(average_heap_size / HeapRegionBounds::target_number(),
-                       (uintx) HeapRegionBounds::min_size());
+                       HeapRegionBounds::min_size());
   }
 
   int region_size_log = log2_long((jlong) region_size);
   // Recalculate the region size to make sure it's a power of
   // 2. This means that region_size is the largest power of 2 that's
   // <= what we've calculated so far.
-  region_size = ((uintx)1 << region_size_log);
+  region_size = ((size_t)1 << region_size_log);
 
   // Now make sure that we don't go over or under our limits.
   if (region_size < HeapRegionBounds::min_size()) {
@@ -139,7 +139,7 @@
   guarantee(GrainBytes == 0, "we should only set it once");
   // The cast to int is safe, given that we've bounded region_size by
   // MIN_REGION_SIZE and MAX_REGION_SIZE.
-  GrainBytes = (size_t)region_size;
+  GrainBytes = region_size;
 
   guarantee(GrainWords == 0, "we should only set it once");
   GrainWords = GrainBytes >> LogHeapWordSize;
@@ -933,6 +933,16 @@
   _offsets.resize(new_end - bottom());
 }
 
+#ifndef PRODUCT
+void G1OffsetTableContigSpace::mangle_unused_area() {
+  mangle_unused_area_complete();
+}
+
+void G1OffsetTableContigSpace::mangle_unused_area_complete() {
+  SpaceMangler::mangle_region(MemRegion(top(), end()));
+}
+#endif
+
 void G1OffsetTableContigSpace::print() const {
   print_short();
   gclog_or_tty->print_cr(" [" INTPTR_FORMAT ", " INTPTR_FORMAT ", "
diff --git a/hotspot/src/share/vm/gc_implementation/g1/heapRegion.hpp b/hotspot/src/share/vm/gc_implementation/g1/heapRegion.hpp
index 1d78eae..ec5fb14 100644
--- a/hotspot/src/share/vm/gc_implementation/g1/heapRegion.hpp
+++ b/hotspot/src/share/vm/gc_implementation/g1/heapRegion.hpp
@@ -27,7 +27,6 @@
 
 #include "gc_implementation/g1/g1AllocationContext.hpp"
 #include "gc_implementation/g1/g1BlockOffsetTable.hpp"
-#include "gc_implementation/g1/g1_specialized_oop_closures.hpp"
 #include "gc_implementation/g1/heapRegionType.hpp"
 #include "gc_implementation/g1/survRateGroup.hpp"
 #include "gc_implementation/shared/ageTable.hpp"
@@ -155,6 +154,9 @@
   void set_bottom(HeapWord* value);
   void set_end(HeapWord* value);
 
+  void mangle_unused_area() PRODUCT_RETURN;
+  void mangle_unused_area_complete() PRODUCT_RETURN;
+
   HeapWord* scan_top() const;
   void record_timestamp();
   void reset_gc_time_stamp() { _gc_time_stamp = 0; }
diff --git a/hotspot/src/share/vm/gc_implementation/g1/heapRegionManager.cpp b/hotspot/src/share/vm/gc_implementation/g1/heapRegionManager.cpp
index 38a41dc..a6c70ef 100644
--- a/hotspot/src/share/vm/gc_implementation/g1/heapRegionManager.cpp
+++ b/hotspot/src/share/vm/gc_implementation/g1/heapRegionManager.cpp
@@ -145,6 +145,24 @@
   }
 }
 
+MemoryUsage HeapRegionManager::get_auxiliary_data_memory_usage() const {
+  size_t used_sz =
+    _prev_bitmap_mapper->committed_size() +
+    _next_bitmap_mapper->committed_size() +
+    _bot_mapper->committed_size() +
+    _cardtable_mapper->committed_size() +
+    _card_counts_mapper->committed_size();
+
+  size_t committed_sz =
+    _prev_bitmap_mapper->reserved_size() +
+    _next_bitmap_mapper->reserved_size() +
+    _bot_mapper->reserved_size() +
+    _cardtable_mapper->reserved_size() +
+    _card_counts_mapper->reserved_size();
+
+  return MemoryUsage(0, used_sz, committed_sz, committed_sz);
+}
+
 uint HeapRegionManager::expand_by(uint num_regions) {
   return expand_at(0, num_regions);
 }
diff --git a/hotspot/src/share/vm/gc_implementation/g1/heapRegionManager.hpp b/hotspot/src/share/vm/gc_implementation/g1/heapRegionManager.hpp
index 10fc349..1ac5386 100644
--- a/hotspot/src/share/vm/gc_implementation/g1/heapRegionManager.hpp
+++ b/hotspot/src/share/vm/gc_implementation/g1/heapRegionManager.hpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 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
@@ -28,6 +28,7 @@
 #include "gc_implementation/g1/g1BiasedArray.hpp"
 #include "gc_implementation/g1/g1RegionToSpaceMapper.hpp"
 #include "gc_implementation/g1/heapRegionSet.hpp"
+#include "services/memoryUsage.hpp"
 
 class HeapRegion;
 class HeapRegionClosure;
@@ -196,6 +197,8 @@
   // Return the maximum number of regions in the heap.
   uint max_length() const { return (uint)_regions.length(); }
 
+  MemoryUsage get_auxiliary_data_memory_usage() const;
+
   MemRegion reserved() const { return MemRegion(heap_bottom(), heap_end()); }
 
   // Expand the sequence to reflect that the heap has grown. Either create new
diff --git a/hotspot/src/share/vm/gc_implementation/parNew/parNewGeneration.cpp b/hotspot/src/share/vm/gc_implementation/parNew/parNewGeneration.cpp
index a54864d..11465b1 100644
--- a/hotspot/src/share/vm/gc_implementation/parNew/parNewGeneration.cpp
+++ b/hotspot/src/share/vm/gc_implementation/parNew/parNewGeneration.cpp
@@ -23,6 +23,7 @@
  */
 
 #include "precompiled.hpp"
+#include "gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.hpp"
 #include "gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.hpp"
 #include "gc_implementation/parNew/parNewGeneration.hpp"
 #include "gc_implementation/parNew/parOopClosures.inline.hpp"
@@ -325,7 +326,7 @@
 private:
   ParallelTaskTerminator& _term;
   ParNewGeneration&       _gen;
-  Generation&             _next_gen;
+  Generation&             _old_gen;
  public:
   bool is_valid(int id) const { return id < length(); }
   ParallelTaskTerminator* terminator() { return &_term; }
@@ -338,7 +339,7 @@
   Stack<oop, mtGC>* overflow_stacks,
   size_t desired_plab_sz, ParallelTaskTerminator& term)
   : ResourceArray(sizeof(ParScanThreadState), num_threads),
-    _gen(gen), _next_gen(old_gen), _term(term)
+    _gen(gen), _old_gen(old_gen), _term(term)
 {
   assert(num_threads > 0, "sanity check!");
   assert(ParGCUseLocalOverflow == (overflow_stacks != NULL),
@@ -471,8 +472,8 @@
     _gen.age_table()->merge(local_table);
 
     // Inform old gen that we're done.
-    _next_gen.par_promote_alloc_done(i);
-    _next_gen.par_oop_since_save_marks_iterate_done(i);
+    _old_gen.par_promote_alloc_done(i);
+    _old_gen.par_oop_since_save_marks_iterate_done(i);
   }
 
   if (UseConcMarkSweepGC) {
@@ -574,10 +575,10 @@
   par_scan_state()->end_term_time();
 }
 
-ParNewGenTask::ParNewGenTask(ParNewGeneration* gen, Generation* next_gen,
-                HeapWord* young_old_boundary, ParScanThreadStateSet* state_set) :
+ParNewGenTask::ParNewGenTask(ParNewGeneration* gen, Generation* old_gen,
+                             HeapWord* young_old_boundary, ParScanThreadStateSet* state_set) :
     AbstractGangTask("ParNewGeneration collection"),
-    _gen(gen), _next_gen(next_gen),
+    _gen(gen), _old_gen(old_gen),
     _young_old_boundary(young_old_boundary),
     _state_set(state_set)
   {}
@@ -601,8 +602,6 @@
   // We would need multiple old-gen queues otherwise.
   assert(gch->n_gens() == 2, "Par young collection currently only works with one older gen.");
 
-  Generation* old_gen = gch->next_gen(_gen);
-
   ParScanThreadState& par_scan_state = _state_set->thread_state(worker_id);
   assert(_state_set->is_valid(worker_id), "Should not have been called");
 
@@ -619,7 +618,7 @@
                          true,  // Process younger gens, if any,
                                 // as strong roots.
                          false, // no scope; this is parallel code
-                         SharedHeap::SO_ScavengeCodeCache,
+                         GenCollectedHeap::SO_ScavengeCodeCache,
                          GenCollectedHeap::StrongAndWeakRoots,
                          &par_scan_state.to_space_root_closure(),
                          &par_scan_state.older_gen_closure(),
@@ -763,8 +762,9 @@
 class ParNewRefProcTaskProxy: public AbstractGangTask {
   typedef AbstractRefProcTaskExecutor::ProcessTask ProcessTask;
 public:
-  ParNewRefProcTaskProxy(ProcessTask& task, ParNewGeneration& gen,
-                         Generation& next_gen,
+  ParNewRefProcTaskProxy(ProcessTask& task,
+                         ParNewGeneration& gen,
+                         Generation& old_gen,
                          HeapWord* young_old_boundary,
                          ParScanThreadStateSet& state_set);
 
@@ -776,20 +776,20 @@
 private:
   ParNewGeneration&      _gen;
   ProcessTask&           _task;
-  Generation&            _next_gen;
+  Generation&            _old_gen;
   HeapWord*              _young_old_boundary;
   ParScanThreadStateSet& _state_set;
 };
 
-ParNewRefProcTaskProxy::ParNewRefProcTaskProxy(
-    ProcessTask& task, ParNewGeneration& gen,
-    Generation& next_gen,
-    HeapWord* young_old_boundary,
-    ParScanThreadStateSet& state_set)
+ParNewRefProcTaskProxy::ParNewRefProcTaskProxy(ProcessTask& task,
+                                               ParNewGeneration& gen,
+                                               Generation& old_gen,
+                                               HeapWord* young_old_boundary,
+                                               ParScanThreadStateSet& state_set)
   : AbstractGangTask("ParNewGeneration parallel reference processing"),
     _gen(gen),
     _task(task),
-    _next_gen(next_gen),
+    _old_gen(old_gen),
     _young_old_boundary(young_old_boundary),
     _state_set(state_set)
 {
@@ -893,7 +893,7 @@
   from()->set_next_compaction_space(to());
   gch->set_incremental_collection_failed();
   // Inform the next generation that a promotion failure occurred.
-  _next_gen->promotion_failure_occurred();
+  _old_gen->promotion_failure_occurred();
 
   // Trace promotion failure in the parallel GC threads
   thread_state_set.trace_promotion_failed(gc_tracer());
@@ -927,7 +927,7 @@
   workers->set_active_workers(active_workers);
   assert(gch->n_gens() == 2,
          "Par collection currently only works with single older gen.");
-  _next_gen = gch->next_gen(this);
+  _old_gen = gch->old_gen();
 
   // If the next generation is too full to accommodate worst-case promotion
   // from this generation, pass on collection; let the next generation
@@ -952,8 +952,6 @@
   // Capture heap used before collection (for printing).
   size_t gch_prev_used = gch->used();
 
-  SpecializationStats::clear();
-
   age_table()->clear();
   to()->clear(SpaceDecorator::Mangle);
 
@@ -968,10 +966,10 @@
   // because only those workers go through the termination protocol.
   ParallelTaskTerminator _term(n_workers, task_queues());
   ParScanThreadStateSet thread_state_set(workers->active_workers(),
-                                         *to(), *this, *_next_gen, *task_queues(),
+                                         *to(), *this, *_old_gen, *task_queues(),
                                          _overflow_stacks, desired_plab_sz(), _term);
 
-  ParNewGenTask tsk(this, _next_gen, reserved().end(), &thread_state_set);
+  ParNewGenTask tsk(this, _old_gen, reserved().end(), &thread_state_set);
   gch->set_par_threads(n_workers);
   gch->rem_set()->prepare_for_younger_refs_iterate(true);
   // It turns out that even when we're using 1 thread, doing the work in a
@@ -1073,8 +1071,6 @@
   jlong now = os::javaTimeNanos() / NANOSECS_PER_MILLISEC;
   update_time_of_last_gc(now);
 
-  SpecializationStats::print();
-
   rp->set_enqueuing_is_done(true);
   if (rp->processing_is_mt()) {
     ParNewRefProcTaskExecutor task_executor(*this, thread_state_set);
@@ -1127,14 +1123,6 @@
   return forward_ptr;
 }
 
-#ifdef ASSERT
-bool ParNewGeneration::is_legal_forward_ptr(oop p) {
-  return
-    (p == ClaimedForwardPtr)
-    || Universe::heap()->is_in_reserved(p);
-}
-#endif
-
 void ParNewGeneration::preserve_mark_if_necessary(oop obj, markOop m) {
   if (m->must_be_preserved_for_promotion_failure(obj)) {
     // We should really have separate per-worker stacks, rather
@@ -1191,8 +1179,8 @@
     }
 
     if (!_promotion_failed) {
-      new_obj = _next_gen->par_promote(par_scan_state->thread_num(),
-                                        old, m, sz);
+      new_obj = _old_gen->par_promote(par_scan_state->thread_num(),
+                                      old, m, sz);
     }
 
     if (new_obj == NULL) {
@@ -1209,6 +1197,7 @@
   } else {
     // Is in to-space; do copying ourselves.
     Copy::aligned_disjoint_words((HeapWord*)old, (HeapWord*)new_obj, sz);
+    assert(Universe::heap()->is_in_reserved(new_obj), "illegal forwarding pointer value.");
     forward_ptr = old->forward_to_atomic(new_obj);
     // Restore the mark word copied above.
     new_obj->set_mark(m);
diff --git a/hotspot/src/share/vm/gc_implementation/parNew/parNewGeneration.hpp b/hotspot/src/share/vm/gc_implementation/parNew/parNewGeneration.hpp
index ef0b058..8e81515 100644
--- a/hotspot/src/share/vm/gc_implementation/parNew/parNewGeneration.hpp
+++ b/hotspot/src/share/vm/gc_implementation/parNew/parNewGeneration.hpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 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
@@ -25,6 +25,7 @@
 #ifndef SHARE_VM_GC_IMPLEMENTATION_PARNEW_PARNEWGENERATION_HPP
 #define SHARE_VM_GC_IMPLEMENTATION_PARNEW_PARNEWGENERATION_HPP
 
+#include "gc_implementation/parNew/parOopClosures.hpp"
 #include "gc_implementation/shared/gcTrace.hpp"
 #include "gc_implementation/shared/parGCAllocBuffer.hpp"
 #include "gc_implementation/shared/copyFailedInfo.hpp"
@@ -233,13 +234,13 @@
 class ParNewGenTask: public AbstractGangTask {
  private:
   ParNewGeneration*            _gen;
-  Generation*                  _next_gen;
+  Generation*                  _old_gen;
   HeapWord*                    _young_old_boundary;
   class ParScanThreadStateSet* _state_set;
 
 public:
   ParNewGenTask(ParNewGeneration*      gen,
-                Generation*            next_gen,
+                Generation*            old_gen,
                 HeapWord*              young_old_boundary,
                 ParScanThreadStateSet* state_set);
 
@@ -419,8 +420,6 @@
   }
 
   static oop real_forwardee(oop obj);
-
-  DEBUG_ONLY(static bool is_legal_forward_ptr(oop p);)
 };
 
 #endif // SHARE_VM_GC_IMPLEMENTATION_PARNEW_PARNEWGENERATION_HPP
diff --git a/hotspot/src/share/vm/gc_implementation/parNew/parOopClosures.inline.hpp b/hotspot/src/share/vm/gc_implementation/parNew/parOopClosures.inline.hpp
index 9658d59..93000ce 100644
--- a/hotspot/src/share/vm/gc_implementation/parNew/parOopClosures.inline.hpp
+++ b/hotspot/src/share/vm/gc_implementation/parNew/parOopClosures.inline.hpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 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
@@ -29,6 +29,7 @@
 #include "gc_implementation/parNew/parOopClosures.hpp"
 #include "memory/cardTableRS.hpp"
 #include "memory/genCollectedHeap.hpp"
+#include "memory/genOopClosures.inline.hpp"
 
 template <class T> inline void ParScanWeakRefClosure::do_oop_work(T* p) {
   assert (!oopDesc::is_null(*p), "null weak reference?");
diff --git a/hotspot/src/share/vm/gc_implementation/parallelScavenge/pcTasks.cpp b/hotspot/src/share/vm/gc_implementation/parallelScavenge/pcTasks.cpp
index bd22eb5..c277038 100644
--- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/pcTasks.cpp
+++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/pcTasks.cpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,6 +25,7 @@
 #include "precompiled.hpp"
 #include "classfile/systemDictionary.hpp"
 #include "code/codeCache.hpp"
+#include "gc_implementation/parallelScavenge/parallelScavengeHeap.hpp"
 #include "gc_implementation/parallelScavenge/pcTasks.hpp"
 #include "gc_implementation/parallelScavenge/psParallelCompact.hpp"
 #include "gc_implementation/shared/gcTimer.hpp"
diff --git a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psMarkSweep.hpp b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psMarkSweep.hpp
index 7b5678d..2c97a15 100644
--- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psMarkSweep.hpp
+++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psMarkSweep.hpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 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
@@ -26,7 +26,7 @@
 #define SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PSMARKSWEEP_HPP
 
 #include "gc_implementation/shared/collectorCounters.hpp"
-#include "gc_implementation/shared/markSweep.inline.hpp"
+#include "gc_implementation/shared/markSweep.hpp"
 #include "utilities/stack.hpp"
 
 class PSAdaptiveSizePolicy;
diff --git a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.hpp b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.hpp
index c098e45..d402309 100644
--- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.hpp
+++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.hpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -29,7 +29,6 @@
 #include "gc_implementation/parallelScavenge/parMarkBitMap.hpp"
 #include "gc_implementation/parallelScavenge/psCompactionManager.hpp"
 #include "gc_implementation/shared/collectorCounters.hpp"
-#include "gc_implementation/shared/markSweep.hpp"
 #include "gc_implementation/shared/mutableSpace.hpp"
 #include "memory/sharedHeap.hpp"
 #include "oops/oop.hpp"
diff --git a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psPromotionManager.cpp b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psPromotionManager.cpp
index 4a6716a..33d300f 100644
--- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psPromotionManager.cpp
+++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psPromotionManager.cpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -34,6 +34,7 @@
 #include "memory/padded.inline.hpp"
 #include "oops/oop.inline.hpp"
 #include "oops/oop.psgc.inline.hpp"
+#include "utilities/stack.inline.hpp"
 
 PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
 
diff --git a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psTasks.cpp b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psTasks.cpp
index df320d8..e944dfe 100644
--- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psTasks.cpp
+++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psTasks.cpp
@@ -40,6 +40,7 @@
 #include "runtime/thread.hpp"
 #include "runtime/vmThread.hpp"
 #include "services/management.hpp"
+#include "utilities/stack.inline.hpp"
 #include "utilities/taskqueue.hpp"
 
 //
diff --git a/hotspot/src/share/vm/gc_implementation/shared/cSpaceCounters.cpp b/hotspot/src/share/vm/gc_implementation/shared/cSpaceCounters.cpp
index 0e40ce7..9b37198 100644
--- a/hotspot/src/share/vm/gc_implementation/shared/cSpaceCounters.cpp
+++ b/hotspot/src/share/vm/gc_implementation/shared/cSpaceCounters.cpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 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
@@ -63,3 +63,20 @@
                                      _space->capacity(), CHECK);
   }
 }
+
+void CSpaceCounters::update_capacity() {
+  _capacity->set_value(_space->capacity());
+}
+
+void CSpaceCounters::update_used() {
+  _used->set_value(_space->used());
+}
+
+void CSpaceCounters::update_all() {
+  update_used();
+  update_capacity();
+}
+
+jlong ContiguousSpaceUsedHelper::take_sample(){
+  return _space->used();
+}
diff --git a/hotspot/src/share/vm/gc_implementation/shared/cSpaceCounters.hpp b/hotspot/src/share/vm/gc_implementation/shared/cSpaceCounters.hpp
index 12d7595..e30044b 100644
--- a/hotspot/src/share/vm/gc_implementation/shared/cSpaceCounters.hpp
+++ b/hotspot/src/share/vm/gc_implementation/shared/cSpaceCounters.hpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 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
@@ -26,7 +26,7 @@
 #define SHARE_VM_GC_IMPLEMENTATION_SHARED_CSPACECOUNTERS_HPP
 
 #include "gc_implementation/shared/generationCounters.hpp"
-#include "memory/space.inline.hpp"
+#include "memory/space.hpp"
 #include "runtime/perfData.hpp"
 
 // A CSpaceCounters is a holder class for performance counters
@@ -56,18 +56,9 @@
       if (_name_space != NULL) FREE_C_HEAP_ARRAY(char, _name_space);
   }
 
-  virtual inline void update_capacity() {
-    _capacity->set_value(_space->capacity());
-  }
-
-  virtual inline void update_used() {
-    _used->set_value(_space->used());
-  }
-
-  virtual inline void update_all() {
-    update_used();
-    update_capacity();
-  }
+  virtual void update_capacity();
+  virtual void update_used();
+  virtual void update_all();
 
   const char* name_space() const        { return _name_space; }
 };
@@ -79,9 +70,7 @@
   public:
     ContiguousSpaceUsedHelper(ContiguousSpace* space) : _space(space) { }
 
-    inline jlong take_sample() {
-      return _space->used();
-    }
+    jlong take_sample();
 };
 
 #endif // SHARE_VM_GC_IMPLEMENTATION_SHARED_CSPACECOUNTERS_HPP
diff --git a/hotspot/src/share/vm/gc_implementation/shared/markSweep.cpp b/hotspot/src/share/vm/gc_implementation/shared/markSweep.cpp
index 309a955..01e7e88 100644
--- a/hotspot/src/share/vm/gc_implementation/shared/markSweep.cpp
+++ b/hotspot/src/share/vm/gc_implementation/shared/markSweep.cpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -84,6 +84,14 @@
 
 void MarkSweep::FollowStackClosure::do_void() { follow_stack(); }
 
+void PreservedMark::adjust_pointer() {
+  MarkSweep::adjust_pointer(&_obj);
+}
+
+void PreservedMark::restore() {
+  _obj->set_mark(_mark);
+}
+
 // We preserve the mark which should be replaced at the end and the location
 // that it will go.  Note that the object that this markOop belongs to isn't
 // currently at that address but it will be after phase4
diff --git a/hotspot/src/share/vm/gc_implementation/shared/markSweep.hpp b/hotspot/src/share/vm/gc_implementation/shared/markSweep.hpp
index 462643e..37928ea 100644
--- a/hotspot/src/share/vm/gc_implementation/shared/markSweep.hpp
+++ b/hotspot/src/share/vm/gc_implementation/shared/markSweep.hpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,7 +26,8 @@
 #define SHARE_VM_GC_IMPLEMENTATION_SHARED_MARKSWEEP_HPP
 
 #include "gc_interface/collectedHeap.hpp"
-#include "memory/universe.hpp"
+#include "memory/genOopClosures.hpp"
+#include "memory/iterator.hpp"
 #include "oops/markOop.hpp"
 #include "oops/oop.hpp"
 #include "runtime/timer.hpp"
@@ -182,13 +183,8 @@
     _mark = mark;
   }
 
-  void adjust_pointer() {
-    MarkSweep::adjust_pointer(&_obj);
-  }
-
-  void restore() {
-    _obj->set_mark(_mark);
-  }
+  void adjust_pointer();
+  void restore();
 };
 
 #endif // SHARE_VM_GC_IMPLEMENTATION_SHARED_MARKSWEEP_HPP
diff --git a/hotspot/src/share/vm/gc_implementation/shared/vmGCOperations.cpp b/hotspot/src/share/vm/gc_implementation/shared/vmGCOperations.cpp
index 3e610f5..dbfbb08 100644
--- a/hotspot/src/share/vm/gc_implementation/shared/vmGCOperations.cpp
+++ b/hotspot/src/share/vm/gc_implementation/shared/vmGCOperations.cpp
@@ -98,7 +98,7 @@
   if (!is_init_completed()) {
     vm_exit_during_initialization(
       err_msg("GC triggered before VM initialization completed. Try increasing "
-              "NewSize, current value " UINTX_FORMAT "%s.",
+              "NewSize, current value " SIZE_FORMAT "%s.",
               byte_size_in_proper_unit(NewSize),
               proper_unit_for_byte_size(NewSize)));
   }
diff --git a/hotspot/src/share/vm/memory/cardTableRS.cpp b/hotspot/src/share/vm/memory/cardTableRS.cpp
index 45e20de..be98f7a 100644
--- a/hotspot/src/share/vm/memory/cardTableRS.cpp
+++ b/hotspot/src/share/vm/memory/cardTableRS.cpp
@@ -27,7 +27,7 @@
 #include "memory/cardTableRS.hpp"
 #include "memory/genCollectedHeap.hpp"
 #include "memory/generation.hpp"
-#include "memory/space.hpp"
+#include "memory/space.inline.hpp"
 #include "oops/oop.inline.hpp"
 #include "runtime/atomic.inline.hpp"
 #include "runtime/java.hpp"
diff --git a/hotspot/src/share/vm/memory/collectorPolicy.cpp b/hotspot/src/share/vm/memory/collectorPolicy.cpp
index 28ef44f..d20c253 100644
--- a/hotspot/src/share/vm/memory/collectorPolicy.cpp
+++ b/hotspot/src/share/vm/memory/collectorPolicy.cpp
@@ -104,15 +104,15 @@
 
   // User inputs from -Xmx and -Xms must be aligned
   _min_heap_byte_size = align_size_up(_min_heap_byte_size, _heap_alignment);
-  uintx aligned_initial_heap_size = align_size_up(InitialHeapSize, _heap_alignment);
-  uintx aligned_max_heap_size = align_size_up(MaxHeapSize, _heap_alignment);
+  size_t aligned_initial_heap_size = align_size_up(InitialHeapSize, _heap_alignment);
+  size_t aligned_max_heap_size = align_size_up(MaxHeapSize, _heap_alignment);
 
   // Write back to flags if the values changed
   if (aligned_initial_heap_size != InitialHeapSize) {
-    FLAG_SET_ERGO(uintx, InitialHeapSize, aligned_initial_heap_size);
+    FLAG_SET_ERGO(size_t, InitialHeapSize, aligned_initial_heap_size);
   }
   if (aligned_max_heap_size != MaxHeapSize) {
-    FLAG_SET_ERGO(uintx, MaxHeapSize, aligned_max_heap_size);
+    FLAG_SET_ERGO(size_t, MaxHeapSize, aligned_max_heap_size);
   }
 
   if (FLAG_IS_CMDLINE(InitialHeapSize) && _min_heap_byte_size != 0 &&
@@ -120,9 +120,9 @@
     vm_exit_during_initialization("Incompatible minimum and initial heap sizes specified");
   }
   if (!FLAG_IS_DEFAULT(InitialHeapSize) && InitialHeapSize > MaxHeapSize) {
-    FLAG_SET_ERGO(uintx, MaxHeapSize, InitialHeapSize);
+    FLAG_SET_ERGO(size_t, MaxHeapSize, InitialHeapSize);
   } else if (!FLAG_IS_DEFAULT(MaxHeapSize) && InitialHeapSize > MaxHeapSize) {
-    FLAG_SET_ERGO(uintx, InitialHeapSize, MaxHeapSize);
+    FLAG_SET_ERGO(size_t, InitialHeapSize, MaxHeapSize);
     if (InitialHeapSize < _min_heap_byte_size) {
       _min_heap_byte_size = InitialHeapSize;
     }
@@ -131,7 +131,7 @@
   _initial_heap_byte_size = InitialHeapSize;
   _max_heap_byte_size = MaxHeapSize;
 
-  FLAG_SET_ERGO(uintx, MinHeapDeltaBytes, align_size_up(MinHeapDeltaBytes, _space_alignment));
+  FLAG_SET_ERGO(size_t, MinHeapDeltaBytes, align_size_up(MinHeapDeltaBytes, _space_alignment));
 
   DEBUG_ONLY(CollectorPolicy::assert_flags();)
 }
@@ -282,18 +282,18 @@
   // All generational heaps have a youngest gen; handle those flags here
 
   // Make sure the heap is large enough for two generations
-  uintx smallest_new_size = young_gen_size_lower_bound();
-  uintx smallest_heap_size = align_size_up(smallest_new_size + align_size_up(_space_alignment, _gen_alignment),
+  size_t smallest_new_size = young_gen_size_lower_bound();
+  size_t smallest_heap_size = align_size_up(smallest_new_size + align_size_up(_space_alignment, _gen_alignment),
                                            _heap_alignment);
   if (MaxHeapSize < smallest_heap_size) {
-    FLAG_SET_ERGO(uintx, MaxHeapSize, smallest_heap_size);
+    FLAG_SET_ERGO(size_t, MaxHeapSize, smallest_heap_size);
     _max_heap_byte_size = MaxHeapSize;
   }
   // If needed, synchronize _min_heap_byte size and _initial_heap_byte_size
   if (_min_heap_byte_size < smallest_heap_size) {
     _min_heap_byte_size = smallest_heap_size;
     if (InitialHeapSize < _min_heap_byte_size) {
-      FLAG_SET_ERGO(uintx, InitialHeapSize, smallest_heap_size);
+      FLAG_SET_ERGO(size_t, InitialHeapSize, smallest_heap_size);
       _initial_heap_byte_size = smallest_heap_size;
     }
   }
@@ -306,8 +306,8 @@
 
   // Now take the actual NewSize into account. We will silently increase NewSize
   // if the user specified a smaller or unaligned value.
-  uintx bounded_new_size = bound_minus_alignment(NewSize, MaxHeapSize);
-  bounded_new_size = MAX2(smallest_new_size, (uintx)align_size_down(bounded_new_size, _gen_alignment));
+  size_t bounded_new_size = bound_minus_alignment(NewSize, MaxHeapSize);
+  bounded_new_size = MAX2(smallest_new_size, (size_t)align_size_down(bounded_new_size, _gen_alignment));
   if (bounded_new_size != NewSize) {
     // Do not use FLAG_SET_ERGO to update NewSize here, since this will override
     // if NewSize was set on the command line or not. This information is needed
@@ -320,21 +320,21 @@
   if (!FLAG_IS_DEFAULT(MaxNewSize)) {
     if (MaxNewSize >= MaxHeapSize) {
       // Make sure there is room for an old generation
-      uintx smaller_max_new_size = MaxHeapSize - _gen_alignment;
+      size_t smaller_max_new_size = MaxHeapSize - _gen_alignment;
       if (FLAG_IS_CMDLINE(MaxNewSize)) {
         warning("MaxNewSize (" SIZE_FORMAT "k) is equal to or greater than the entire "
                 "heap (" SIZE_FORMAT "k).  A new max generation size of " SIZE_FORMAT "k will be used.",
                 MaxNewSize/K, MaxHeapSize/K, smaller_max_new_size/K);
       }
-      FLAG_SET_ERGO(uintx, MaxNewSize, smaller_max_new_size);
+      FLAG_SET_ERGO(size_t, MaxNewSize, smaller_max_new_size);
       if (NewSize > MaxNewSize) {
-        FLAG_SET_ERGO(uintx, NewSize, MaxNewSize);
+        FLAG_SET_ERGO(size_t, NewSize, MaxNewSize);
         _initial_young_size = NewSize;
       }
     } else if (MaxNewSize < _initial_young_size) {
-      FLAG_SET_ERGO(uintx, MaxNewSize, _initial_young_size);
+      FLAG_SET_ERGO(size_t, MaxNewSize, _initial_young_size);
     } else if (!is_size_aligned(MaxNewSize, _gen_alignment)) {
-      FLAG_SET_ERGO(uintx, MaxNewSize, align_size_down(MaxNewSize, _gen_alignment));
+      FLAG_SET_ERGO(size_t, MaxNewSize, align_size_down(MaxNewSize, _gen_alignment));
     }
     _max_young_size = MaxNewSize;
   }
@@ -347,7 +347,7 @@
               "A new max generation size of " SIZE_FORMAT "k will be used.",
               NewSize/K, MaxNewSize/K, NewSize/K);
     }
-    FLAG_SET_ERGO(uintx, MaxNewSize, NewSize);
+    FLAG_SET_ERGO(size_t, MaxNewSize, NewSize);
     _max_young_size = MaxNewSize;
   }
 
@@ -369,9 +369,9 @@
     size_t calculated_heapsize = (OldSize / NewRatio) * (NewRatio + 1);
 
     calculated_heapsize = align_size_up(calculated_heapsize, _heap_alignment);
-    FLAG_SET_ERGO(uintx, MaxHeapSize, calculated_heapsize);
+    FLAG_SET_ERGO(size_t, MaxHeapSize, calculated_heapsize);
     _max_heap_byte_size = MaxHeapSize;
-    FLAG_SET_ERGO(uintx, InitialHeapSize, calculated_heapsize);
+    FLAG_SET_ERGO(size_t, InitialHeapSize, calculated_heapsize);
     _initial_heap_byte_size = InitialHeapSize;
   }
 
@@ -380,19 +380,19 @@
     if (_max_heap_size_cmdline) {
       // Somebody has set a maximum heap size with the intention that we should not
       // exceed it. Adjust New/OldSize as necessary.
-      uintx calculated_size = NewSize + OldSize;
+      size_t calculated_size = NewSize + OldSize;
       double shrink_factor = (double) MaxHeapSize / calculated_size;
-      uintx smaller_new_size = align_size_down((uintx)(NewSize * shrink_factor), _gen_alignment);
-      FLAG_SET_ERGO(uintx, NewSize, MAX2(young_gen_size_lower_bound(), smaller_new_size));
+      size_t smaller_new_size = align_size_down((size_t)(NewSize * shrink_factor), _gen_alignment);
+      FLAG_SET_ERGO(size_t, NewSize, MAX2(young_gen_size_lower_bound(), smaller_new_size));
       _initial_young_size = NewSize;
 
       // OldSize is already aligned because above we aligned MaxHeapSize to
       // _heap_alignment, and we just made sure that NewSize is aligned to
       // _gen_alignment. In initialize_flags() we verified that _heap_alignment
       // is a multiple of _gen_alignment.
-      FLAG_SET_ERGO(uintx, OldSize, MaxHeapSize - NewSize);
+      FLAG_SET_ERGO(size_t, OldSize, MaxHeapSize - NewSize);
     } else {
-      FLAG_SET_ERGO(uintx, MaxHeapSize, align_size_up(NewSize + OldSize, _heap_alignment));
+      FLAG_SET_ERGO(size_t, MaxHeapSize, align_size_up(NewSize + OldSize, _heap_alignment));
       _max_heap_byte_size = MaxHeapSize;
     }
   }
@@ -405,7 +405,7 @@
       // Need to compare against the flag value for max since _max_young_size
       // might not have been set yet.
       if (new_size >= _min_young_size && new_size <= MaxNewSize) {
-        FLAG_SET_ERGO(uintx, NewSize, new_size);
+        FLAG_SET_ERGO(size_t, NewSize, new_size);
         _initial_young_size = NewSize;
       }
     }
@@ -561,15 +561,15 @@
 
   // Write back to flags if necessary.
   if (NewSize != _initial_young_size) {
-    FLAG_SET_ERGO(uintx, NewSize, _initial_young_size);
+    FLAG_SET_ERGO(size_t, NewSize, _initial_young_size);
   }
 
   if (MaxNewSize != _max_young_size) {
-    FLAG_SET_ERGO(uintx, MaxNewSize, _max_young_size);
+    FLAG_SET_ERGO(size_t, MaxNewSize, _max_young_size);
   }
 
   if (OldSize != _initial_old_size) {
-    FLAG_SET_ERGO(uintx, OldSize, _initial_old_size);
+    FLAG_SET_ERGO(size_t, OldSize, _initial_old_size);
   }
 
   if (PrintGCDetails && Verbose) {
@@ -601,7 +601,7 @@
     HandleMark hm; // Discard any handles allocated in each iteration.
 
     // First allocation attempt is lock-free.
-    Generation *young = gch->get_gen(0);
+    Generation *young = gch->young_gen();
     assert(young->supports_inline_contig_alloc(),
       "Otherwise, must do alloc within heap lock");
     if (young->should_allocate(size, is_tlab)) {
@@ -615,8 +615,8 @@
     {
       MutexLocker ml(Heap_lock);
       if (PrintGC && Verbose) {
-        gclog_or_tty->print_cr("TwoGenerationCollectorPolicy::mem_allocate_work:"
-                      " attempting locked slow path allocation");
+        gclog_or_tty->print_cr("GenCollectorPolicy::mem_allocate_work:"
+                               " attempting locked slow path allocation");
       }
       // Note that only large objects get a shot at being
       // allocated in later generations.
@@ -705,7 +705,7 @@
     // Give a warning if we seem to be looping forever.
     if ((QueuedAllocationWarningCount > 0) &&
         (try_count % QueuedAllocationWarningCount == 0)) {
-          warning("TwoGenerationCollectorPolicy::mem_allocate_work retries %d times \n\t"
+          warning("GenCollectorPolicy::mem_allocate_work retries %d times \n\t"
                   " size=" SIZE_FORMAT " %s", try_count, size, is_tlab ? "(TLAB)" : "");
     }
   }
@@ -715,10 +715,14 @@
                                                        bool   is_tlab) {
   GenCollectedHeap *gch = GenCollectedHeap::heap();
   HeapWord* result = NULL;
-  for (int i = number_of_generations() - 1; i >= 0 && result == NULL; i--) {
-    Generation *gen = gch->get_gen(i);
-    if (gen->should_allocate(size, is_tlab)) {
-      result = gen->expand_and_allocate(size, is_tlab);
+  Generation *old = gch->old_gen();
+  if (old->should_allocate(size, is_tlab)) {
+    result = old->expand_and_allocate(size, is_tlab);
+  }
+  if (result == NULL) {
+    Generation *young = gch->young_gen();
+    if (young->should_allocate(size, is_tlab)) {
+      result = young->expand_and_allocate(size, is_tlab);
     }
   }
   assert(result == NULL || gch->is_in_reserved(result), "result not in heap");
@@ -891,7 +895,7 @@
 bool GenCollectorPolicy::should_try_older_generation_allocation(
         size_t word_size) const {
   GenCollectedHeap* gch = GenCollectedHeap::heap();
-  size_t young_capacity = gch->get_gen(0)->capacity_before_gc();
+  size_t young_capacity = gch->young_gen()->capacity_before_gc();
   return    (word_size > heap_word_size(young_capacity))
          || GC_locker::is_active_and_needs_gc()
          || gch->incremental_collection_failed();
@@ -903,7 +907,7 @@
 //
 
 void MarkSweepPolicy::initialize_alignments() {
-  _space_alignment = _gen_alignment = (uintx)Generation::GenGrain;
+  _space_alignment = _gen_alignment = (size_t)Generation::GenGrain;
   _heap_alignment = compute_heap_alignment();
 }
 
@@ -935,18 +939,18 @@
     // for both min and initial young size if less than min heap.
     flag_value = 20 * M;
     set_basic_flag_values();
-    FLAG_SET_CMDLINE(uintx, NewSize, flag_value);
+    FLAG_SET_CMDLINE(size_t, NewSize, flag_value);
     verify_young_min(flag_value);
 
     set_basic_flag_values();
-    FLAG_SET_CMDLINE(uintx, NewSize, flag_value);
+    FLAG_SET_CMDLINE(size_t, NewSize, flag_value);
     verify_young_initial(flag_value);
 
     // If NewSize is set on command line, but is larger than the min
     // heap size, it should only be used for initial young size.
     flag_value = 80 * M;
     set_basic_flag_values();
-    FLAG_SET_CMDLINE(uintx, NewSize, flag_value);
+    FLAG_SET_CMDLINE(size_t, NewSize, flag_value);
     verify_young_initial(flag_value);
 
     // If NewSize has been ergonomically set, the collector policy
@@ -954,11 +958,11 @@
     // using NewRatio.
     flag_value = 20 * M;
     set_basic_flag_values();
-    FLAG_SET_ERGO(uintx, NewSize, flag_value);
+    FLAG_SET_ERGO(size_t, NewSize, flag_value);
     verify_young_min(flag_value);
 
     set_basic_flag_values();
-    FLAG_SET_ERGO(uintx, NewSize, flag_value);
+    FLAG_SET_ERGO(size_t, NewSize, flag_value);
     verify_scaled_young_initial(InitialHeapSize);
 
     restore_flags();
@@ -974,11 +978,11 @@
     // for both min and initial old size if less than min heap.
     flag_value = 20 * M;
     set_basic_flag_values();
-    FLAG_SET_CMDLINE(uintx, OldSize, flag_value);
+    FLAG_SET_CMDLINE(size_t, OldSize, flag_value);
     verify_old_min(flag_value);
 
     set_basic_flag_values();
-    FLAG_SET_CMDLINE(uintx, OldSize, flag_value);
+    FLAG_SET_CMDLINE(size_t, OldSize, flag_value);
     // Calculate what we expect the flag to be.
     size_t expected_old_initial = align_size_up(InitialHeapSize, heap_alignment) - MaxNewSize;
     verify_old_initial(expected_old_initial);
@@ -989,10 +993,10 @@
     // We intentionally set MaxNewSize + OldSize > MaxHeapSize (see over_size).
     flag_value = 30 * M;
     set_basic_flag_values();
-    FLAG_SET_CMDLINE(uintx, OldSize, flag_value);
+    FLAG_SET_CMDLINE(size_t, OldSize, flag_value);
     size_t over_size = 20*M;
     size_t new_size_value = align_size_up(MaxHeapSize, heap_alignment) - flag_value + over_size;
-    FLAG_SET_CMDLINE(uintx, MaxNewSize, new_size_value);
+    FLAG_SET_CMDLINE(size_t, MaxNewSize, new_size_value);
     // Calculate what we expect the flag to be.
     expected_old_initial = align_size_up(MaxHeapSize, heap_alignment) - MaxNewSize;
     verify_old_initial(expected_old_initial);
@@ -1053,11 +1057,11 @@
   static size_t original_OldSize;
 
   static void set_basic_flag_values() {
-    FLAG_SET_ERGO(uintx, MaxHeapSize, 180 * M);
-    FLAG_SET_ERGO(uintx, InitialHeapSize, 100 * M);
-    FLAG_SET_ERGO(uintx, OldSize, 4 * M);
-    FLAG_SET_ERGO(uintx, NewSize, 1 * M);
-    FLAG_SET_ERGO(uintx, MaxNewSize, 80 * M);
+    FLAG_SET_ERGO(size_t, MaxHeapSize, 180 * M);
+    FLAG_SET_ERGO(size_t, InitialHeapSize, 100 * M);
+    FLAG_SET_ERGO(size_t, OldSize, 4 * M);
+    FLAG_SET_ERGO(size_t, NewSize, 1 * M);
+    FLAG_SET_ERGO(size_t, MaxNewSize, 80 * M);
     Arguments::set_min_heap_size(40 * M);
   }
 
diff --git a/hotspot/src/share/vm/memory/defNewGeneration.cpp b/hotspot/src/share/vm/memory/defNewGeneration.cpp
index 053fe03..0f5b223 100644
--- a/hotspot/src/share/vm/memory/defNewGeneration.cpp
+++ b/hotspot/src/share/vm/memory/defNewGeneration.cpp
@@ -226,7 +226,7 @@
 
   compute_space_boundaries(0, SpaceDecorator::Clear, SpaceDecorator::Mangle);
   update_counters();
-  _next_gen = NULL;
+  _old_gen = NULL;
   _tenuring_threshold = MaxTenuringThreshold;
   _pretenure_size_threshold_words = PretenureSizeThreshold >> LogHeapWordSize;
 
@@ -383,8 +383,8 @@
   assert(next_level < gch->_n_gens,
          "DefNewGeneration cannot be an oldest gen");
 
-  Generation* next_gen = gch->get_gen(next_level);
-  size_t old_size = next_gen->capacity();
+  Generation* old_gen = gch->old_gen();
+  size_t old_size = old_gen->capacity();
   size_t new_size_before = _virtual_space.committed_size();
   size_t min_new_size = spec()->init_size();
   size_t max_new_size = reserved().byte_size();
@@ -568,7 +568,7 @@
   DefNewTracer gc_tracer;
   gc_tracer.report_gc_start(gch->gc_cause(), _gc_timer->gc_start());
 
-  _next_gen = gch->next_gen(this);
+  _old_gen = gch->old_gen();
 
   // If the next generation is too full to accommodate promotion
   // from this generation, pass on collection; let the next generation
@@ -590,8 +590,6 @@
 
   gch->trace_heap_before_gc(&gc_tracer);
 
-  SpecializationStats::clear();
-
   // These can be shared for all code paths
   IsAliveClosure is_alive(this);
   ScanWeakRefClosure scan_weak_ref(this);
@@ -628,7 +626,7 @@
                          true,  // Process younger gens, if any,
                                 // as strong roots.
                          true,  // activate StrongRootsScope
-                         SharedHeap::SO_ScavengeCodeCache,
+                         GenCollectedHeap::SO_ScavengeCodeCache,
                          GenCollectedHeap::StrongAndWeakRoots,
                          &fsc_with_no_gc_barrier,
                          &fsc_with_gc_barrier,
@@ -688,7 +686,7 @@
     gch->set_incremental_collection_failed();
 
     // Inform the next generation that a promotion failure occurred.
-    _next_gen->promotion_failure_occurred();
+    _old_gen->promotion_failure_occurred();
     gc_tracer.report_promotion_failed(_promotion_failed_info);
 
     // Reset the PromotionFailureALot counters.
@@ -700,7 +698,6 @@
   // set new iteration safe limit for the survivor spaces
   from()->set_concurrent_iteration_safe_limit(from()->top());
   to()->set_concurrent_iteration_safe_limit(to()->top());
-  SpecializationStats::print();
 
   // We need to use a monotonically non-decreasing time in ms
   // or we will see time-warp warnings and os::javaTimeMillis()
@@ -793,7 +790,7 @@
 
   // Otherwise try allocating obj tenured
   if (obj == NULL) {
-    obj = _next_gen->promote(old, s);
+    obj = _old_gen->promote(old, s);
     if (obj == NULL) {
       handle_promotion_failure(old);
       return old;
@@ -898,11 +895,11 @@
     }
     return false;
   }
-  if (_next_gen == NULL) {
+  if (_old_gen == NULL) {
     GenCollectedHeap* gch = GenCollectedHeap::heap();
-    _next_gen = gch->next_gen(this);
+    _old_gen = gch->old_gen();
   }
-  return _next_gen->promotion_attempt_is_safe(used());
+  return _old_gen->promotion_attempt_is_safe(used());
 }
 
 void DefNewGeneration::gc_epilogue(bool full) {
@@ -1022,8 +1019,7 @@
   return eden();
 }
 
-HeapWord* DefNewGeneration::allocate(size_t word_size,
-                                     bool is_tlab) {
+HeapWord* DefNewGeneration::allocate(size_t word_size, bool is_tlab) {
   // This is the slow-path allocation for the DefNewGeneration.
   // Most allocations are fast-path in compiled code.
   // We try to allocate from the eden.  If that works, we are happy.
@@ -1031,8 +1027,8 @@
   // have to use it here, as well.
   HeapWord* result = eden()->par_allocate(word_size);
   if (result != NULL) {
-    if (CMSEdenChunksRecordAlways && _next_gen != NULL) {
-      _next_gen->sample_eden_chunk();
+    if (CMSEdenChunksRecordAlways && _old_gen != NULL) {
+      _old_gen->sample_eden_chunk();
     }
   } else {
     // If the eden is full and the last collection bailed out, we are running
@@ -1047,8 +1043,8 @@
 HeapWord* DefNewGeneration::par_allocate(size_t word_size,
                                          bool is_tlab) {
   HeapWord* res = eden()->par_allocate(word_size);
-  if (CMSEdenChunksRecordAlways && _next_gen != NULL) {
-    _next_gen->sample_eden_chunk();
+  if (CMSEdenChunksRecordAlways && _old_gen != NULL) {
+    _old_gen->sample_eden_chunk();
   }
   return res;
 }
diff --git a/hotspot/src/share/vm/memory/defNewGeneration.hpp b/hotspot/src/share/vm/memory/defNewGeneration.hpp
index 105c029..4d12a02 100644
--- a/hotspot/src/share/vm/memory/defNewGeneration.hpp
+++ b/hotspot/src/share/vm/memory/defNewGeneration.hpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 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
@@ -29,11 +29,14 @@
 #include "gc_implementation/shared/cSpaceCounters.hpp"
 #include "gc_implementation/shared/generationCounters.hpp"
 #include "gc_implementation/shared/copyFailedInfo.hpp"
+#include "memory/generation.hpp"
 #include "utilities/stack.hpp"
 
 class ContiguousSpace;
 class ScanClosure;
 class STWGCTimer;
+class CSpaceCounters;
+class ScanWeakRefClosure;
 
 // DefNewGeneration is a young generation containing eden, from- and
 // to-space.
@@ -42,7 +45,7 @@
   friend class VMStructs;
 
 protected:
-  Generation* _next_gen;
+  Generation* _old_gen;
   uint        _tenuring_threshold;   // Tenuring threshold for next collection.
   ageTable    _age_table;
   // Size of object to pretenure in words; command line provides bytes
diff --git a/hotspot/src/share/vm/memory/defNewGeneration.inline.hpp b/hotspot/src/share/vm/memory/defNewGeneration.inline.hpp
index d30ad37..111db33 100644
--- a/hotspot/src/share/vm/memory/defNewGeneration.inline.hpp
+++ b/hotspot/src/share/vm/memory/defNewGeneration.inline.hpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 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
@@ -25,8 +25,10 @@
 #ifndef SHARE_VM_MEMORY_DEFNEWGENERATION_INLINE_HPP
 #define SHARE_VM_MEMORY_DEFNEWGENERATION_INLINE_HPP
 
+#include "gc_interface/collectedHeap.hpp"
 #include "memory/cardTableRS.hpp"
 #include "memory/defNewGeneration.hpp"
+#include "memory/genOopClosures.inline.hpp"
 #include "memory/space.hpp"
 
 // Methods of protected closure types
diff --git a/hotspot/src/share/vm/memory/genCollectedHeap.cpp b/hotspot/src/share/vm/memory/genCollectedHeap.cpp
index 58a492c..704291f 100644
--- a/hotspot/src/share/vm/memory/genCollectedHeap.cpp
+++ b/hotspot/src/share/vm/memory/genCollectedHeap.cpp
@@ -26,6 +26,7 @@
 #include "classfile/symbolTable.hpp"
 #include "classfile/systemDictionary.hpp"
 #include "classfile/vmSymbols.hpp"
+#include "code/codeCache.hpp"
 #include "code/icBuffer.hpp"
 #include "gc_implementation/shared/collectorCounters.hpp"
 #include "gc_implementation/shared/gcTrace.hpp"
@@ -47,6 +48,7 @@
 #include "runtime/handles.inline.hpp"
 #include "runtime/java.hpp"
 #include "runtime/vmThread.hpp"
+#include "services/management.hpp"
 #include "services/memoryService.hpp"
 #include "utilities/vmError.hpp"
 #include "utilities/workgroup.hpp"
@@ -61,7 +63,15 @@
 
 // The set of potentially parallel tasks in root scanning.
 enum GCH_strong_roots_tasks {
-  // We probably want to parallelize both of these internally, but for now...
+  GCH_PS_Universe_oops_do,
+  GCH_PS_JNIHandles_oops_do,
+  GCH_PS_ObjectSynchronizer_oops_do,
+  GCH_PS_FlatProfiler_oops_do,
+  GCH_PS_Management_oops_do,
+  GCH_PS_SystemDictionary_oops_do,
+  GCH_PS_ClassLoaderDataGraph_oops_do,
+  GCH_PS_jvmti_oops_do,
+  GCH_PS_CodeCache_oops_do,
   GCH_PS_younger_gens,
   // Leave this one last.
   GCH_PS_NumElements
@@ -71,13 +81,9 @@
   SharedHeap(policy),
   _rem_set(NULL),
   _gen_policy(policy),
-  _gen_process_roots_tasks(new SubTasksDone(GCH_PS_NumElements)),
+  _process_strong_tasks(new SubTasksDone(GCH_PS_NumElements)),
   _full_collections_completed(0)
 {
-  if (_gen_process_roots_tasks == NULL ||
-      !_gen_process_roots_tasks->valid()) {
-    vm_exit_during_initialization("Failed necessary allocation.");
-  }
   assert(policy != NULL, "Sanity check");
 }
 
@@ -177,18 +183,17 @@
   SharedHeap::post_initialize();
   GenCollectorPolicy *policy = (GenCollectorPolicy *)collector_policy();
   guarantee(policy->is_generation_policy(), "Illegal policy type");
-  assert((get_gen(0)->kind() == Generation::DefNew) ||
-         (get_gen(0)->kind() == Generation::ParNew),
+  assert((_young_gen->kind() == Generation::DefNew) ||
+         (_young_gen->kind() == Generation::ParNew),
     "Wrong youngest generation type");
-  DefNewGeneration* def_new_gen = (DefNewGeneration*)get_gen(0);
+  DefNewGeneration* def_new_gen = (DefNewGeneration*)_young_gen;
 
-  Generation* old_gen = get_gen(1);
-  assert(old_gen->kind() == Generation::ConcurrentMarkSweep ||
-         old_gen->kind() == Generation::MarkSweepCompact,
+  assert(_old_gen->kind() == Generation::ConcurrentMarkSweep ||
+         _old_gen->kind() == Generation::MarkSweepCompact,
     "Wrong generation kind");
 
   policy->initialize_size_policy(def_new_gen->eden()->capacity(),
-                                 old_gen->capacity(),
+                                 _old_gen->capacity(),
                                  def_new_gen->from()->capacity());
   policy->initialize_gc_policy_counters();
 }
@@ -570,29 +575,137 @@
 
 void GenCollectedHeap::set_par_threads(uint t) {
   SharedHeap::set_par_threads(t);
-  _gen_process_roots_tasks->set_n_threads(t);
+  set_n_termination(t);
 }
 
-void GenCollectedHeap::
-gen_process_roots(int level,
-                  bool younger_gens_as_roots,
-                  bool activate_scope,
-                  SharedHeap::ScanningOption so,
-                  OopsInGenClosure* not_older_gens,
-                  OopsInGenClosure* weak_roots,
-                  OopsInGenClosure* older_gens,
-                  CLDClosure* cld_closure,
-                  CLDClosure* weak_cld_closure,
-                  CodeBlobClosure* code_closure) {
+void GenCollectedHeap::set_n_termination(uint t) {
+  _process_strong_tasks->set_n_threads(t);
+}
+
+#ifdef ASSERT
+class AssertNonScavengableClosure: public OopClosure {
+public:
+  virtual void do_oop(oop* p) {
+    assert(!Universe::heap()->is_in_partial_collection(*p),
+      "Referent should not be scavengable.");  }
+  virtual void do_oop(narrowOop* p) { ShouldNotReachHere(); }
+};
+static AssertNonScavengableClosure assert_is_non_scavengable_closure;
+#endif
+
+void GenCollectedHeap::process_roots(bool activate_scope,
+                                     ScanningOption so,
+                                     OopClosure* strong_roots,
+                                     OopClosure* weak_roots,
+                                     CLDClosure* strong_cld_closure,
+                                     CLDClosure* weak_cld_closure,
+                                     CodeBlobClosure* code_roots) {
+  StrongRootsScope srs(this, activate_scope);
 
   // General roots.
-  SharedHeap::process_roots(activate_scope, so,
-                            not_older_gens, weak_roots,
-                            cld_closure, weak_cld_closure,
-                            code_closure);
+  assert(_strong_roots_parity != 0, "must have called prologue code");
+  assert(code_roots != NULL, "code root closure should always be set");
+  // _n_termination for _process_strong_tasks should be set up stream
+  // in a method not running in a GC worker.  Otherwise the GC worker
+  // could be trying to change the termination condition while the task
+  // is executing in another GC worker.
+
+  if (!_process_strong_tasks->is_task_claimed(GCH_PS_ClassLoaderDataGraph_oops_do)) {
+    ClassLoaderDataGraph::roots_cld_do(strong_cld_closure, weak_cld_closure);
+  }
+
+  // Some CLDs contained in the thread frames should be considered strong.
+  // Don't process them if they will be processed during the ClassLoaderDataGraph phase.
+  CLDClosure* roots_from_clds_p = (strong_cld_closure != weak_cld_closure) ? strong_cld_closure : NULL;
+  // Only process code roots from thread stacks if we aren't visiting the entire CodeCache anyway
+  CodeBlobClosure* roots_from_code_p = (so & SO_AllCodeCache) ? NULL : code_roots;
+
+  Threads::possibly_parallel_oops_do(strong_roots, roots_from_clds_p, roots_from_code_p);
+
+  if (!_process_strong_tasks->is_task_claimed(GCH_PS_Universe_oops_do)) {
+    Universe::oops_do(strong_roots);
+  }
+  // Global (strong) JNI handles
+  if (!_process_strong_tasks->is_task_claimed(GCH_PS_JNIHandles_oops_do)) {
+    JNIHandles::oops_do(strong_roots);
+  }
+
+  if (!_process_strong_tasks->is_task_claimed(GCH_PS_ObjectSynchronizer_oops_do)) {
+    ObjectSynchronizer::oops_do(strong_roots);
+  }
+  if (!_process_strong_tasks->is_task_claimed(GCH_PS_FlatProfiler_oops_do)) {
+    FlatProfiler::oops_do(strong_roots);
+  }
+  if (!_process_strong_tasks->is_task_claimed(GCH_PS_Management_oops_do)) {
+    Management::oops_do(strong_roots);
+  }
+  if (!_process_strong_tasks->is_task_claimed(GCH_PS_jvmti_oops_do)) {
+    JvmtiExport::oops_do(strong_roots);
+  }
+
+  if (!_process_strong_tasks->is_task_claimed(GCH_PS_SystemDictionary_oops_do)) {
+    SystemDictionary::roots_oops_do(strong_roots, weak_roots);
+  }
+
+  // All threads execute the following. A specific chunk of buckets
+  // from the StringTable are the individual tasks.
+  if (weak_roots != NULL) {
+    if (CollectedHeap::use_parallel_gc_threads()) {
+      StringTable::possibly_parallel_oops_do(weak_roots);
+    } else {
+      StringTable::oops_do(weak_roots);
+    }
+  }
+
+  if (!_process_strong_tasks->is_task_claimed(GCH_PS_CodeCache_oops_do)) {
+    if (so & SO_ScavengeCodeCache) {
+      assert(code_roots != NULL, "must supply closure for code cache");
+
+      // We only visit parts of the CodeCache when scavenging.
+      CodeCache::scavenge_root_nmethods_do(code_roots);
+    }
+    if (so & SO_AllCodeCache) {
+      assert(code_roots != NULL, "must supply closure for code cache");
+
+      // CMSCollector uses this to do intermediate-strength collections.
+      // We scan the entire code cache, since CodeCache::do_unloading is not called.
+      CodeCache::blobs_do(code_roots);
+    }
+    // Verify that the code cache contents are not subject to
+    // movement by a scavenging collection.
+    DEBUG_ONLY(CodeBlobToOopClosure assert_code_is_non_scavengable(&assert_is_non_scavengable_closure, !CodeBlobToOopClosure::FixRelocations));
+    DEBUG_ONLY(CodeCache::asserted_non_scavengable_nmethods_do(&assert_code_is_non_scavengable));
+  }
+
+}
+
+void GenCollectedHeap::gen_process_roots(int level,
+                                         bool younger_gens_as_roots,
+                                         bool activate_scope,
+                                         ScanningOption so,
+                                         bool only_strong_roots,
+                                         OopsInGenClosure* not_older_gens,
+                                         OopsInGenClosure* older_gens,
+                                         CLDClosure* cld_closure) {
+  const bool is_adjust_phase = !only_strong_roots && !younger_gens_as_roots;
+
+  bool is_moving_collection = false;
+  if (level == 0 || is_adjust_phase) {
+    // young collections are always moving
+    is_moving_collection = true;
+  }
+
+  MarkingCodeBlobClosure mark_code_closure(not_older_gens, is_moving_collection);
+  OopsInGenClosure* weak_roots = only_strong_roots ? NULL : not_older_gens;
+  CLDClosure* weak_cld_closure = only_strong_roots ? NULL : cld_closure;
+
+  process_roots(activate_scope, so,
+                not_older_gens, weak_roots,
+                cld_closure, weak_cld_closure,
+                &mark_code_closure);
 
   if (younger_gens_as_roots) {
-    if (!_gen_process_roots_tasks->is_task_claimed(GCH_PS_younger_gens)) {
+    if (!_process_strong_tasks->is_task_claimed(GCH_PS_younger_gens)) {
       if (level == 1) {
         not_older_gens->set_generation(_young_gen);
         _young_gen->oop_iterate(not_older_gens);
@@ -608,43 +721,18 @@
     older_gens->reset_generation();
   }
 
-  _gen_process_roots_tasks->all_tasks_completed();
+  _process_strong_tasks->all_tasks_completed();
 }
 
-void GenCollectedHeap::
-gen_process_roots(int level,
-                  bool younger_gens_as_roots,
-                  bool activate_scope,
-                  SharedHeap::ScanningOption so,
-                  bool only_strong_roots,
-                  OopsInGenClosure* not_older_gens,
-                  OopsInGenClosure* older_gens,
-                  CLDClosure* cld_closure) {
 
-  const bool is_adjust_phase = !only_strong_roots && !younger_gens_as_roots;
-
-  bool is_moving_collection = false;
-  if (level == 0 || is_adjust_phase) {
-    // young collections are always moving
-    is_moving_collection = true;
-  }
-
-  MarkingCodeBlobClosure mark_code_closure(not_older_gens, is_moving_collection);
-  CodeBlobClosure* code_closure = &mark_code_closure;
-
-  gen_process_roots(level,
-                    younger_gens_as_roots,
-                    activate_scope, so,
-                    not_older_gens, only_strong_roots ? NULL : not_older_gens,
-                    older_gens,
-                    cld_closure, only_strong_roots ? NULL : cld_closure,
-                    code_closure);
-
-}
+class AlwaysTrueClosure: public BoolObjectClosure {
+public:
+  bool do_object_b(oop p) { return true; }
+};
+static AlwaysTrueClosure always_true;
 
 void GenCollectedHeap::gen_process_weak_roots(OopClosure* root_closure) {
-  SharedHeap::process_weak_roots(root_closure);
-  // "Local" "weak" refs
+  JNIHandles::weak_oops_do(&always_true, root_closure);
   _young_gen->ref_processor()->weak_oops_do(root_closure);
   _old_gen->ref_processor()->weak_oops_do(root_closure);
 }
@@ -1113,10 +1201,10 @@
 
 void GenCollectedHeap::print_tracing_info() const {
   if (TraceYoungGenTime) {
-    get_gen(0)->print_summary_info();
+    _young_gen->print_summary_info();
   }
   if (TraceOldGenTime) {
-    get_gen(1)->print_summary_info();
+    _old_gen->print_summary_info();
   }
 }
 
diff --git a/hotspot/src/share/vm/memory/genCollectedHeap.hpp b/hotspot/src/share/vm/memory/genCollectedHeap.hpp
index 7de4a46..d619377 100644
--- a/hotspot/src/share/vm/memory/genCollectedHeap.hpp
+++ b/hotspot/src/share/vm/memory/genCollectedHeap.hpp
@@ -85,8 +85,7 @@
 
   // Data structure for claiming the (potentially) parallel tasks in
   // (gen-specific) roots processing.
-  SubTasksDone* _gen_process_roots_tasks;
-  SubTasksDone* gen_process_roots_tasks() { return _gen_process_roots_tasks; }
+  SubTasksDone* _process_strong_tasks;
 
   // Collects the given generation.
   void collect_generation(Generation* gen, bool full, size_t size, bool is_tlab,
@@ -373,27 +372,6 @@
   // collection.
   virtual bool is_maximal_no_gc() const;
 
-  // Return the generation before "gen".
-  Generation* prev_gen(Generation* gen) const {
-    guarantee(gen->level() == 1, "Out of bounds");
-    return _young_gen;
-  }
-
-  // Return the generation after "gen".
-  Generation* next_gen(Generation* gen) const {
-    guarantee(gen->level() == 0, "Out of bounds");
-    return _old_gen;
-  }
-
-  Generation* get_gen(int i) const {
-    guarantee(i == 0 || i == 1, "Out of bounds");
-    if (i == 0) {
-      return _young_gen;
-    } else {
-      return _old_gen;
-    }
-  }
-
   int n_gens() const {
     assert(_n_gens == gen_policy()->number_of_generations(), "Sanity");
     return _n_gens;
@@ -408,6 +386,7 @@
   static GenCollectedHeap* heap();
 
   void set_par_threads(uint t);
+  void set_n_termination(uint t);
 
   // Invoke the "do_oop" method of one of the closures "not_older_gens"
   // or "older_gens" on root locations for the generation at
@@ -421,11 +400,25 @@
   // The "so" argument determines which of the roots
   // the closure is applied to:
   // "SO_None" does none;
+  enum ScanningOption {
+    SO_None                =  0x0,
+    SO_AllCodeCache        =  0x8,
+    SO_ScavengeCodeCache   = 0x10
+  };
+
  private:
+  void process_roots(bool activate_scope,
+                     ScanningOption so,
+                     OopClosure* strong_roots,
+                     OopClosure* weak_roots,
+                     CLDClosure* strong_cld_closure,
+                     CLDClosure* weak_cld_closure,
+                     CodeBlobClosure* code_roots);
+
   void gen_process_roots(int level,
                          bool younger_gens_as_roots,
                          bool activate_scope,
-                         SharedHeap::ScanningOption so,
+                         ScanningOption so,
                          OopsInGenClosure* not_older_gens,
                          OopsInGenClosure* weak_roots,
                          OopsInGenClosure* older_gens,
@@ -440,7 +433,7 @@
   void gen_process_roots(int level,
                          bool younger_gens_as_roots,
                          bool activate_scope,
-                         SharedHeap::ScanningOption so,
+                         ScanningOption so,
                          bool only_strong_roots,
                          OopsInGenClosure* not_older_gens,
                          OopsInGenClosure* older_gens,
@@ -486,7 +479,7 @@
     assert(heap()->collector_policy()->is_generation_policy(),
            "the following definition may not be suitable for an n(>2)-generation system");
     return incremental_collection_failed() ||
-           (consult_young && !get_gen(0)->collection_attempt_is_safe());
+           (consult_young && !_young_gen->collection_attempt_is_safe());
   }
 
   // If a generation bails out of an incremental collection,
diff --git a/hotspot/src/share/vm/memory/genMarkSweep.cpp b/hotspot/src/share/vm/memory/genMarkSweep.cpp
index a85ddf0..ef27079 100644
--- a/hotspot/src/share/vm/memory/genMarkSweep.cpp
+++ b/hotspot/src/share/vm/memory/genMarkSweep.cpp
@@ -50,6 +50,7 @@
 #include "runtime/vmThread.hpp"
 #include "utilities/copy.hpp"
 #include "utilities/events.hpp"
+#include "utilities/stack.inline.hpp"
 
 void GenMarkSweep::invoke_at_safepoint(int level, ReferenceProcessor* rp, bool clear_all_softrefs) {
   guarantee(level == 1, "We always collect both old and young.");
@@ -109,20 +110,16 @@
 
   deallocate_stacks();
 
-  // If compaction completely evacuated all generations younger than this
-  // one, then we can clear the card table.  Otherwise, we must invalidate
+  // If compaction completely evacuated the young generation then we
+  // can clear the card table.  Otherwise, we must invalidate
   // it (consider all cards dirty).  In the future, we might consider doing
   // compaction within generations only, and doing card-table sliding.
-  bool all_empty = true;
-  for (int i = 0; all_empty && i < level; i++) {
-    Generation* g = gch->get_gen(i);
-    all_empty = all_empty && gch->get_gen(i)->used() == 0;
-  }
   GenRemSet* rs = gch->rem_set();
-  Generation* old_gen = gch->get_gen(level);
+  Generation* old_gen = gch->old_gen();
+
   // Clear/invalidate below make use of the "prev_used_regions" saved earlier.
-  if (all_empty) {
-    // We've evacuated all generations below us.
+  if (gch->young_gen()->used() == 0) {
+    // We've evacuated the young generation.
     rs->clear_into_younger(old_gen);
   } else {
     // Invalidate the cards corresponding to the currently used
@@ -157,9 +154,8 @@
 
 void GenMarkSweep::allocate_stacks() {
   GenCollectedHeap* gch = GenCollectedHeap::heap();
-  // Scratch request on behalf of oldest generation; will do no
-  // allocation.
-  ScratchBlock* scratch = gch->gather_scratch(gch->get_gen(gch->_n_gens-1), 0);
+  // Scratch request on behalf of old generation; will do no allocation.
+  ScratchBlock* scratch = gch->gather_scratch(gch->old_gen(), 0);
 
   // $$$ To cut a corner, we'll only use the first scratch block, and then
   // revert to malloc.
@@ -188,7 +184,7 @@
 }
 
 void GenMarkSweep::mark_sweep_phase1(int level,
-                                  bool clear_all_softrefs) {
+                                     bool clear_all_softrefs) {
   // Recursively traverse all live objects and mark them
   GCTraceTime tm("phase 1", PrintGC && Verbose, true, _gc_timer, _gc_tracer->gc_id());
   trace(" 1");
@@ -199,7 +195,8 @@
   // use OopsInGenClosure constructor which takes a generation,
   // as the Universe has not been created when the static constructors
   // are run.
-  follow_root_closure.set_orig_generation(gch->get_gen(level));
+  assert(level == 1, "We don't use mark-sweep on young generations");
+  follow_root_closure.set_orig_generation(gch->old_gen());
 
   // Need new claim bits before marking starts.
   ClassLoaderDataGraph::clear_claimed_marks();
@@ -207,7 +204,7 @@
   gch->gen_process_roots(level,
                          false, // Younger gens are not roots.
                          true,  // activate StrongRootsScope
-                         SharedHeap::SO_None,
+                         GenCollectedHeap::SO_None,
                          GenCollectedHeap::StrongRootsOnly,
                          &follow_root_closure,
                          &follow_root_closure,
@@ -287,12 +284,13 @@
   // use OopsInGenClosure constructor which takes a generation,
   // as the Universe has not been created when the static constructors
   // are run.
-  adjust_pointer_closure.set_orig_generation(gch->get_gen(level));
+  assert(level == 1, "We don't use mark-sweep on young generations.");
+  adjust_pointer_closure.set_orig_generation(gch->old_gen());
 
   gch->gen_process_roots(level,
                          false, // Younger gens are not roots.
                          true,  // activate StrongRootsScope
-                         SharedHeap::SO_AllCodeCache,
+                         GenCollectedHeap::SO_AllCodeCache,
                          GenCollectedHeap::StrongAndWeakRoots,
                          &adjust_pointer_closure,
                          &adjust_pointer_closure,
diff --git a/hotspot/src/share/vm/memory/generation.cpp b/hotspot/src/share/vm/memory/generation.cpp
index b93d142..6bed336 100644
--- a/hotspot/src/share/vm/memory/generation.cpp
+++ b/hotspot/src/share/vm/memory/generation.cpp
@@ -153,9 +153,8 @@
 
 Generation* Generation::next_gen() const {
   GenCollectedHeap* gch = GenCollectedHeap::heap();
-  int next = level() + 1;
-  if (next < gch->_n_gens) {
-    return gch->get_gen(next);
+  if (level() == 0) {
+    return gch->old_gen();
   } else {
     return NULL;
   }
diff --git a/hotspot/src/share/vm/memory/heapInspection.cpp b/hotspot/src/share/vm/memory/heapInspection.cpp
index 4d80912..c4b5ba7 100644
--- a/hotspot/src/share/vm/memory/heapInspection.cpp
+++ b/hotspot/src/share/vm/memory/heapInspection.cpp
@@ -33,6 +33,7 @@
 #include "runtime/os.hpp"
 #include "utilities/globalDefinitions.hpp"
 #include "utilities/macros.hpp"
+#include "utilities/stack.inline.hpp"
 #if INCLUDE_ALL_GCS
 #include "gc_implementation/parallelScavenge/parallelScavengeHeap.hpp"
 #endif // INCLUDE_ALL_GCS
diff --git a/hotspot/src/share/vm/memory/metaspace.cpp b/hotspot/src/share/vm/memory/metaspace.cpp
index c8099b0..8f7476d 100644
--- a/hotspot/src/share/vm/memory/metaspace.cpp
+++ b/hotspot/src/share/vm/memory/metaspace.cpp
@@ -3131,7 +3131,7 @@
 void Metaspace::initialize_class_space(ReservedSpace rs) {
   // The reserved space size may be bigger because of alignment, esp with UseLargePages
   assert(rs.size() >= CompressedClassSpaceSize,
-         err_msg(SIZE_FORMAT " != " UINTX_FORMAT, rs.size(), CompressedClassSpaceSize));
+         err_msg(SIZE_FORMAT " != " SIZE_FORMAT, rs.size(), CompressedClassSpaceSize));
   assert(using_class_space(), "Must be using class space");
   _class_space_list = new VirtualSpaceList(rs);
   _chunk_manager_class = new ChunkManager(SpecializedChunk, ClassSmallChunk, ClassMediumChunk);
diff --git a/hotspot/src/share/vm/memory/metaspaceShared.cpp b/hotspot/src/share/vm/memory/metaspaceShared.cpp
index b66061e..ecfa27f 100644
--- a/hotspot/src/share/vm/memory/metaspaceShared.cpp
+++ b/hotspot/src/share/vm/memory/metaspaceShared.cpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 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
@@ -410,7 +410,7 @@
 
     // Split up and initialize the misc code and data spaces
     ReservedSpace* shared_rs = MetaspaceShared::shared_rs();
-    int metadata_size = SharedReadOnlySize+SharedReadWriteSize;
+    size_t metadata_size = SharedReadOnlySize + SharedReadWriteSize;
     ReservedSpace shared_ro_rw = shared_rs->first_part(metadata_size);
     ReservedSpace misc_section = shared_rs->last_part(metadata_size);
 
diff --git a/hotspot/src/share/vm/memory/sharedHeap.cpp b/hotspot/src/share/vm/memory/sharedHeap.cpp
index d6617af..27672c8 100644
--- a/hotspot/src/share/vm/memory/sharedHeap.cpp
+++ b/hotspot/src/share/vm/memory/sharedHeap.cpp
@@ -32,7 +32,6 @@
 #include "runtime/atomic.inline.hpp"
 #include "runtime/fprofiler.hpp"
 #include "runtime/java.hpp"
-#include "services/management.hpp"
 #include "utilities/copy.hpp"
 #include "utilities/workgroup.hpp"
 
@@ -40,32 +39,12 @@
 
 SharedHeap* SharedHeap::_sh;
 
-// The set of potentially parallel tasks in root scanning.
-enum SH_process_roots_tasks {
-  SH_PS_Universe_oops_do,
-  SH_PS_JNIHandles_oops_do,
-  SH_PS_ObjectSynchronizer_oops_do,
-  SH_PS_FlatProfiler_oops_do,
-  SH_PS_Management_oops_do,
-  SH_PS_SystemDictionary_oops_do,
-  SH_PS_ClassLoaderDataGraph_oops_do,
-  SH_PS_jvmti_oops_do,
-  SH_PS_CodeCache_oops_do,
-  // Leave this one last.
-  SH_PS_NumElements
-};
-
 SharedHeap::SharedHeap(CollectorPolicy* policy_) :
   CollectedHeap(),
   _collector_policy(policy_),
-  _strong_roots_scope(NULL),
   _strong_roots_parity(0),
-  _process_strong_tasks(new SubTasksDone(SH_PS_NumElements)),
   _workers(NULL)
 {
-  if (_process_strong_tasks == NULL || !_process_strong_tasks->valid()) {
-    vm_exit_during_initialization("Failed necessary allocation.");
-  }
   _sh = this;  // ch is static, should be set only once.
   if (UseConcMarkSweepGC || UseG1GC) {
     _workers = new FlexibleWorkGang("GC Thread", ParallelGCThreads,
@@ -79,14 +58,6 @@
   }
 }
 
-int SharedHeap::n_termination() {
-  return _process_strong_tasks->n_threads();
-}
-
-void SharedHeap::set_n_termination(int t) {
-  _process_strong_tasks->set_n_threads(t);
-}
-
 bool SharedHeap::heap_lock_held_for_gc() {
   Thread* t = Thread::current();
   return    Heap_lock->owned_by_self()
@@ -97,31 +68,6 @@
 void SharedHeap::set_par_threads(uint t) {
   assert(t == 0 || !UseSerialGC, "Cannot have parallel threads");
   _n_par_threads = t;
-  _process_strong_tasks->set_n_threads(t);
-}
-
-#ifdef ASSERT
-class AssertNonScavengableClosure: public OopClosure {
-public:
-  virtual void do_oop(oop* p) {
-    assert(!Universe::heap()->is_in_partial_collection(*p),
-      "Referent should not be scavengable.");  }
-  virtual void do_oop(narrowOop* p) { ShouldNotReachHere(); }
-};
-static AssertNonScavengableClosure assert_is_non_scavengable_closure;
-#endif
-
-SharedHeap::StrongRootsScope* SharedHeap::active_strong_roots_scope() const {
-  return _strong_roots_scope;
-}
-void SharedHeap::register_strong_roots_scope(SharedHeap::StrongRootsScope* scope) {
-  assert(_strong_roots_scope == NULL, "Should only have one StrongRootsScope active");
-  assert(scope != NULL, "Illegal argument");
-  _strong_roots_scope = scope;
-}
-void SharedHeap::unregister_strong_roots_scope(SharedHeap::StrongRootsScope* scope) {
-  assert(_strong_roots_scope == scope, "Wrong scope unregistered");
-  _strong_roots_scope = NULL;
 }
 
 void SharedHeap::change_strong_roots_parity() {
@@ -135,174 +81,15 @@
 }
 
 SharedHeap::StrongRootsScope::StrongRootsScope(SharedHeap* heap, bool activate)
-  : MarkScope(activate), _sh(heap), _n_workers_done_with_threads(0)
+  : MarkScope(activate), _sh(heap)
 {
   if (_active) {
-    _sh->register_strong_roots_scope(this);
     _sh->change_strong_roots_parity();
     // Zero the claimed high water mark in the StringTable
     StringTable::clear_parallel_claimed_index();
   }
 }
 
-SharedHeap::StrongRootsScope::~StrongRootsScope() {
-  if (_active) {
-    _sh->unregister_strong_roots_scope(this);
-  }
-}
-
-Monitor* SharedHeap::StrongRootsScope::_lock = new Monitor(Mutex::leaf, "StrongRootsScope lock", false, Monitor::_safepoint_check_never);
-
-void SharedHeap::StrongRootsScope::mark_worker_done_with_threads(uint n_workers) {
-  // The Thread work barrier is only needed by G1 Class Unloading.
-  // No need to use the barrier if this is single-threaded code.
-  if (UseG1GC && ClassUnloadingWithConcurrentMark && n_workers > 0) {
-    uint new_value = (uint)Atomic::add(1, &_n_workers_done_with_threads);
-    if (new_value == n_workers) {
-      // This thread is last. Notify the others.
-      MonitorLockerEx ml(_lock, Mutex::_no_safepoint_check_flag);
-      _lock->notify_all();
-    }
-  }
-}
-
-void SharedHeap::StrongRootsScope::wait_until_all_workers_done_with_threads(uint n_workers) {
-  assert(UseG1GC,                          "Currently only used by G1");
-  assert(ClassUnloadingWithConcurrentMark, "Currently only needed when doing G1 Class Unloading");
-
-  // No need to use the barrier if this is single-threaded code.
-  if (n_workers > 0 && (uint)_n_workers_done_with_threads != n_workers) {
-    MonitorLockerEx ml(_lock, Mutex::_no_safepoint_check_flag);
-    while ((uint)_n_workers_done_with_threads != n_workers) {
-      _lock->wait(Mutex::_no_safepoint_check_flag, 0, false);
-    }
-  }
-}
-
-void SharedHeap::process_roots(bool activate_scope,
-                               ScanningOption so,
-                               OopClosure* strong_roots,
-                               OopClosure* weak_roots,
-                               CLDClosure* strong_cld_closure,
-                               CLDClosure* weak_cld_closure,
-                               CodeBlobClosure* code_roots) {
-  StrongRootsScope srs(this, activate_scope);
-
-  // General roots.
-  assert(_strong_roots_parity != 0, "must have called prologue code");
-  assert(code_roots != NULL, "code root closure should always be set");
-  // _n_termination for _process_strong_tasks should be set up stream
-  // in a method not running in a GC worker.  Otherwise the GC worker
-  // could be trying to change the termination condition while the task
-  // is executing in another GC worker.
-
-  // Iterating over the CLDG and the Threads are done early to allow G1 to
-  // first process the strong CLDs and nmethods and then, after a barrier,
-  // let the thread process the weak CLDs and nmethods.
-
-  if (!_process_strong_tasks->is_task_claimed(SH_PS_ClassLoaderDataGraph_oops_do)) {
-    ClassLoaderDataGraph::roots_cld_do(strong_cld_closure, weak_cld_closure);
-  }
-
-  // Some CLDs contained in the thread frames should be considered strong.
-  // Don't process them if they will be processed during the ClassLoaderDataGraph phase.
-  CLDClosure* roots_from_clds_p = (strong_cld_closure != weak_cld_closure) ? strong_cld_closure : NULL;
-  // Only process code roots from thread stacks if we aren't visiting the entire CodeCache anyway
-  CodeBlobClosure* roots_from_code_p = (so & SO_AllCodeCache) ? NULL : code_roots;
-
-  Threads::possibly_parallel_oops_do(strong_roots, roots_from_clds_p, roots_from_code_p);
-
-  // This is the point where this worker thread will not find more strong CLDs/nmethods.
-  // Report this so G1 can synchronize the strong and weak CLDs/nmethods processing.
-  active_strong_roots_scope()->mark_worker_done_with_threads(n_par_threads());
-
-  if (!_process_strong_tasks->is_task_claimed(SH_PS_Universe_oops_do)) {
-    Universe::oops_do(strong_roots);
-  }
-  // Global (strong) JNI handles
-  if (!_process_strong_tasks->is_task_claimed(SH_PS_JNIHandles_oops_do))
-    JNIHandles::oops_do(strong_roots);
-
-  if (!_process_strong_tasks-> is_task_claimed(SH_PS_ObjectSynchronizer_oops_do))
-    ObjectSynchronizer::oops_do(strong_roots);
-  if (!_process_strong_tasks->is_task_claimed(SH_PS_FlatProfiler_oops_do))
-    FlatProfiler::oops_do(strong_roots);
-  if (!_process_strong_tasks->is_task_claimed(SH_PS_Management_oops_do))
-    Management::oops_do(strong_roots);
-  if (!_process_strong_tasks->is_task_claimed(SH_PS_jvmti_oops_do))
-    JvmtiExport::oops_do(strong_roots);
-
-  if (!_process_strong_tasks->is_task_claimed(SH_PS_SystemDictionary_oops_do)) {
-    SystemDictionary::roots_oops_do(strong_roots, weak_roots);
-  }
-
-  // All threads execute the following. A specific chunk of buckets
-  // from the StringTable are the individual tasks.
-  if (weak_roots != NULL) {
-    if (CollectedHeap::use_parallel_gc_threads()) {
-      StringTable::possibly_parallel_oops_do(weak_roots);
-    } else {
-      StringTable::oops_do(weak_roots);
-    }
-  }
-
-  if (!_process_strong_tasks->is_task_claimed(SH_PS_CodeCache_oops_do)) {
-    if (so & SO_ScavengeCodeCache) {
-      assert(code_roots != NULL, "must supply closure for code cache");
-
-      // We only visit parts of the CodeCache when scavenging.
-      CodeCache::scavenge_root_nmethods_do(code_roots);
-    }
-    if (so & SO_AllCodeCache) {
-      assert(code_roots != NULL, "must supply closure for code cache");
-
-      // CMSCollector uses this to do intermediate-strength collections.
-      // We scan the entire code cache, since CodeCache::do_unloading is not called.
-      CodeCache::blobs_do(code_roots);
-    }
-    // Verify that the code cache contents are not subject to
-    // movement by a scavenging collection.
-    DEBUG_ONLY(CodeBlobToOopClosure assert_code_is_non_scavengable(&assert_is_non_scavengable_closure, !CodeBlobToOopClosure::FixRelocations));
-    DEBUG_ONLY(CodeCache::asserted_non_scavengable_nmethods_do(&assert_code_is_non_scavengable));
-  }
-
-  _process_strong_tasks->all_tasks_completed();
-}
-
-void SharedHeap::process_all_roots(bool activate_scope,
-                                   ScanningOption so,
-                                   OopClosure* roots,
-                                   CLDClosure* cld_closure,
-                                   CodeBlobClosure* code_closure) {
-  process_roots(activate_scope, so,
-                roots, roots,
-                cld_closure, cld_closure,
-                code_closure);
-}
-
-void SharedHeap::process_strong_roots(bool activate_scope,
-                                      ScanningOption so,
-                                      OopClosure* roots,
-                                      CLDClosure* cld_closure,
-                                      CodeBlobClosure* code_closure) {
-  process_roots(activate_scope, so,
-                roots, NULL,
-                cld_closure, NULL,
-                code_closure);
-}
-
-
-class AlwaysTrueClosure: public BoolObjectClosure {
-public:
-  bool do_object_b(oop p) { return true; }
-};
-static AlwaysTrueClosure always_true;
-
-void SharedHeap::process_weak_roots(OopClosure* root_closure) {
-  // Global (weak) JNI handles
-  JNIHandles::weak_oops_do(&always_true, root_closure);
-}
-
 void SharedHeap::set_barrier_set(BarrierSet* bs) {
   _barrier_set = bs;
   // Cached barrier set for fast access in oops
diff --git a/hotspot/src/share/vm/memory/sharedHeap.hpp b/hotspot/src/share/vm/memory/sharedHeap.hpp
index 91735f1..8071752 100644
--- a/hotspot/src/share/vm/memory/sharedHeap.hpp
+++ b/hotspot/src/share/vm/memory/sharedHeap.hpp
@@ -61,18 +61,18 @@
 //    counts the number of tasks that have been done and then reset
 //    the SubTasksDone so that it can be used again.  When the number of
 //    tasks is set to the number of GC workers, then _n_threads must
-//    be set to the number of active GC workers. G1CollectedHeap,
-//    HRInto_G1RemSet, GenCollectedHeap and SharedHeap have SubTasksDone.
-//    This seems too many.
+//    be set to the number of active GC workers. G1RootProcessor and
+//    GenCollectedHeap have SubTasksDone.
 //    3) SequentialSubTasksDone has an _n_threads that is used in
 //    a way similar to SubTasksDone and has the same dependency on the
 //    number of active GC workers.  CompactibleFreeListSpace and Space
 //    have SequentialSubTasksDone's.
-// Example of using SubTasksDone and SequentialSubTasksDone
-// G1CollectedHeap::g1_process_roots()
-//  to SharedHeap::process_roots() and uses
-//  SubTasksDone* _process_strong_tasks to claim tasks.
-//  process_roots() calls
+//
+// Examples of using SubTasksDone and SequentialSubTasksDone:
+//  G1RootProcessor and GenCollectedHeap::process_roots() use
+//  SubTasksDone* _process_strong_tasks to claim tasks for workers
+//
+//  GenCollectedHeap::gen_process_roots() calls
 //      rem_set()->younger_refs_iterate()
 //  to scan the card table and which eventually calls down into
 //  CardTableModRefBS::par_non_clean_card_iterate_work().  This method
@@ -104,10 +104,6 @@
   friend class VM_GC_Operation;
   friend class VM_CGC_Operation;
 
-private:
-  // For claiming strong_roots tasks.
-  SubTasksDone* _process_strong_tasks;
-
 protected:
   // There should be only a single instance of "SharedHeap" in a program.
   // This is enforced with the protected constructor below, which will also
@@ -140,7 +136,6 @@
   static SharedHeap* heap() { return _sh; }
 
   void set_barrier_set(BarrierSet* bs);
-  SubTasksDone* process_strong_tasks() { return _process_strong_tasks; }
 
   // Does operations required after initialization has been done.
   virtual void post_initialize();
@@ -193,69 +188,19 @@
   // strong_roots_prologue calls change_strong_roots_parity, if
   // parallel tasks are enabled.
   class StrongRootsScope : public MarkingCodeBlobClosure::MarkScope {
-    // Used to implement the Thread work barrier.
-    static Monitor* _lock;
-
     SharedHeap*   _sh;
-    volatile jint _n_workers_done_with_threads;
 
    public:
     StrongRootsScope(SharedHeap* heap, bool activate = true);
-    ~StrongRootsScope();
-
-    // Mark that this thread is done with the Threads work.
-    void mark_worker_done_with_threads(uint n_workers);
-    // Wait until all n_workers are done with the Threads work.
-    void wait_until_all_workers_done_with_threads(uint n_workers);
   };
   friend class StrongRootsScope;
 
-  // The current active StrongRootScope
-  StrongRootsScope* _strong_roots_scope;
-
-  StrongRootsScope* active_strong_roots_scope() const;
-
  private:
-  void register_strong_roots_scope(StrongRootsScope* scope);
-  void unregister_strong_roots_scope(StrongRootsScope* scope);
   void change_strong_roots_parity();
 
  public:
-  enum ScanningOption {
-    SO_None                =  0x0,
-    SO_AllCodeCache        =  0x8,
-    SO_ScavengeCodeCache   = 0x10
-  };
-
   FlexibleWorkGang* workers() const { return _workers; }
 
-  // Invoke the "do_oop" method the closure "roots" on all root locations.
-  // The "so" argument determines which roots the closure is applied to:
-  // "SO_None" does none;
-  // "SO_AllCodeCache" applies the closure to all elements of the CodeCache.
-  // "SO_ScavengeCodeCache" applies the closure to elements on the scavenge root list in the CodeCache.
-  void process_roots(bool activate_scope,
-                     ScanningOption so,
-                     OopClosure* strong_roots,
-                     OopClosure* weak_roots,
-                     CLDClosure* strong_cld_closure,
-                     CLDClosure* weak_cld_closure,
-                     CodeBlobClosure* code_roots);
-  void process_all_roots(bool activate_scope,
-                         ScanningOption so,
-                         OopClosure* roots,
-                         CLDClosure* cld_closure,
-                         CodeBlobClosure* code_roots);
-  void process_strong_roots(bool activate_scope,
-                            ScanningOption so,
-                            OopClosure* roots,
-                            CLDClosure* cld_closure,
-                            CodeBlobClosure* code_roots);
-
-
-  // Apply "root_closure" to the JNI weak roots..
-  void process_weak_roots(OopClosure* root_closure);
-
   // The functions below are helper functions that a subclass of
   // "SharedHeap" can use in the implementation of its virtual
   // functions.
@@ -270,9 +215,6 @@
   // (such as process roots) subsequently.
   virtual void set_par_threads(uint t);
 
-  int n_termination();
-  void set_n_termination(int t);
-
   //
   // New methods from CollectedHeap
   //
@@ -284,8 +226,4 @@
                              size_t capacity);
 };
 
-inline SharedHeap::ScanningOption operator|(SharedHeap::ScanningOption so0, SharedHeap::ScanningOption so1) {
-  return static_cast<SharedHeap::ScanningOption>(static_cast<int>(so0) | static_cast<int>(so1));
-}
-
 #endif // SHARE_VM_MEMORY_SHAREDHEAP_HPP
diff --git a/hotspot/src/share/vm/memory/space.cpp b/hotspot/src/share/vm/memory/space.cpp
index 2886377..6e9984f 100644
--- a/hotspot/src/share/vm/memory/space.cpp
+++ b/hotspot/src/share/vm/memory/space.cpp
@@ -26,7 +26,6 @@
 #include "classfile/systemDictionary.hpp"
 #include "classfile/vmSymbols.hpp"
 #include "gc_implementation/shared/liveRange.hpp"
-#include "gc_implementation/shared/markSweep.hpp"
 #include "gc_implementation/shared/spaceDecorator.hpp"
 #include "gc_interface/collectedHeap.inline.hpp"
 #include "memory/blockOffsetTable.inline.hpp"
@@ -353,15 +352,6 @@
 void ContiguousSpace::mangle_unused_area_complete() {
   mangler()->mangle_unused_area_complete();
 }
-void ContiguousSpace::mangle_region(MemRegion mr) {
-  // Although this method uses SpaceMangler::mangle_region() which
-  // is not specific to a space, the when the ContiguousSpace version
-  // is called, it is always with regard to a space and this
-  // bounds checking is appropriate.
-  MemRegion space_mr(bottom(), end());
-  assert(space_mr.contains(mr), "Mangling outside space");
-  SpaceMangler::mangle_region(mr);
-}
 #endif  // NOT_PRODUCT
 
 void CompactibleSpace::initialize(MemRegion mr,
@@ -388,7 +378,7 @@
     cp->space->set_compaction_top(compact_top);
     cp->space = cp->space->next_compaction_space();
     if (cp->space == NULL) {
-      cp->gen = GenCollectedHeap::heap()->prev_gen(cp->gen);
+      cp->gen = GenCollectedHeap::heap()->young_gen();
       assert(cp->gen != NULL, "compaction must succeed");
       cp->space = cp->gen->first_compaction_space();
       assert(cp->space != NULL, "generation must have a first compaction space");
diff --git a/hotspot/src/share/vm/memory/space.hpp b/hotspot/src/share/vm/memory/space.hpp
index 4eb7669..61761ba3 100644
--- a/hotspot/src/share/vm/memory/space.hpp
+++ b/hotspot/src/share/vm/memory/space.hpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -128,11 +128,10 @@
 
   // For detecting GC bugs.  Should only be called at GC boundaries, since
   // some unused space may be used as scratch space during GC's.
-  // Default implementation does nothing. We also call this when expanding
-  // a space to satisfy an allocation request. See bug #4668531
-  virtual void mangle_unused_area() {}
-  virtual void mangle_unused_area_complete() {}
-  virtual void mangle_region(MemRegion mr) {}
+  // We also call this when expanding a space to satisfy an allocation
+  // request. See bug #4668531
+  virtual void mangle_unused_area() = 0;
+  virtual void mangle_unused_area_complete() = 0;
 
   // Testers
   bool is_empty() const              { return used() == 0; }
@@ -196,7 +195,7 @@
   // structure supporting these calls, possibly speeding up future calls.
   // The default implementation, however, is simply to call the const
   // version.
-  inline virtual HeapWord* block_start(const void* p);
+  virtual HeapWord* block_start(const void* p);
 
   // Requires "addr" to be the start of a chunk, and returns its size.
   // "addr + size" is required to be the start of a new chunk, or the end
@@ -559,8 +558,6 @@
   void mangle_unused_area() PRODUCT_RETURN;
   // Mangle [top, end)
   void mangle_unused_area_complete() PRODUCT_RETURN;
-  // Mangle the given MemRegion.
-  void mangle_region(MemRegion mr) PRODUCT_RETURN;
 
   // Do some sparse checking on the area that should have been mangled.
   void check_mangled_unused_area(HeapWord* limit) PRODUCT_RETURN;
diff --git a/hotspot/src/share/vm/memory/specialized_oop_closures.cpp b/hotspot/src/share/vm/memory/specialized_oop_closures.cpp
deleted file mode 100644
index 467eba1..0000000
--- a/hotspot/src/share/vm/memory/specialized_oop_closures.cpp
+++ /dev/null
@@ -1,115 +0,0 @@
-/*
- * Copyright (c) 2001, 2010, 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 "precompiled.hpp"
-#include "memory/specialized_oop_closures.hpp"
-#include "utilities/ostream.hpp"
-
-// For keeping stats on effectiveness.
-#ifndef PRODUCT
-#if ENABLE_SPECIALIZATION_STATS
-
-int SpecializationStats::_numCallsAll;
-
-int SpecializationStats::_numCallsTotal[NUM_Kinds];
-int SpecializationStats::_numCalls_nv[NUM_Kinds];
-
-int SpecializationStats::_numDoOopCallsTotal[NUM_Kinds];
-int SpecializationStats::_numDoOopCalls_nv[NUM_Kinds];
-
-void SpecializationStats::clear() {
-  _numCallsAll = 0;
-  for (int k = ik; k < NUM_Kinds; k++) {
-    _numCallsTotal[k] = 0;
-    _numCalls_nv[k] = 0;
-
-    _numDoOopCallsTotal[k] = 0;
-    _numDoOopCalls_nv[k] = 0;
-  }
-}
-
-void SpecializationStats::print() {
-  const char* header_format = "    %20s %10s %11s %10s";
-  const char* line_format   = "    %20s %10d %11d %9.2f%%";
-  int all_numCallsTotal =
-    _numCallsTotal[ik] + _numCallsTotal[irk] + _numCallsTotal[oa];
-  int all_numCalls_nv =
-    _numCalls_nv[ik] + _numCalls_nv[irk] + _numCalls_nv[oa];
-  gclog_or_tty->print_cr("\nOf %d oop_oop_iterate calls %d (%6.3f%%) are in (ik, irk, oa).",
-                _numCallsAll, all_numCallsTotal,
-                100.0 * (float)all_numCallsTotal / (float)_numCallsAll);
-  // irk calls are double-counted.
-  int real_ik_numCallsTotal = _numCallsTotal[ik] - _numCallsTotal[irk];
-  int real_ik_numCalls_nv   = _numCalls_nv[ik]   - _numCalls_nv[irk];
-  gclog_or_tty->print_cr("");
-  gclog_or_tty->print_cr(header_format, "oop_oop_iterate:", "calls", "non-virtual", "pct");
-  gclog_or_tty->print_cr(header_format,
-                "----------",
-                "----------",
-                "-----------",
-                "----------");
-  gclog_or_tty->print_cr(line_format, "all",
-                all_numCallsTotal,
-                all_numCalls_nv,
-                100.0 * (float)all_numCalls_nv / (float)all_numCallsTotal);
-  gclog_or_tty->print_cr(line_format, "ik",
-                real_ik_numCallsTotal, real_ik_numCalls_nv,
-                100.0 * (float)real_ik_numCalls_nv /
-                (float)real_ik_numCallsTotal);
-  gclog_or_tty->print_cr(line_format, "irk",
-                _numCallsTotal[irk], _numCalls_nv[irk],
-                100.0 * (float)_numCalls_nv[irk] / (float)_numCallsTotal[irk]);
-  gclog_or_tty->print_cr(line_format, "oa",
-                _numCallsTotal[oa], _numCalls_nv[oa],
-                100.0 * (float)_numCalls_nv[oa] / (float)_numCallsTotal[oa]);
-
-
-  gclog_or_tty->print_cr("");
-  gclog_or_tty->print_cr(header_format, "do_oop:", "calls", "non-virtual", "pct");
-  gclog_or_tty->print_cr(header_format,
-                "----------",
-                "----------",
-                "-----------",
-                "----------");
-  int all_numDoOopCallsTotal =
-    _numDoOopCallsTotal[ik] + _numDoOopCallsTotal[irk] + _numDoOopCallsTotal[oa];
-  int all_numDoOopCalls_nv =
-    _numDoOopCalls_nv[ik] + _numDoOopCalls_nv[irk] + _numDoOopCalls_nv[oa];
-  gclog_or_tty->print_cr(line_format, "all",
-                all_numDoOopCallsTotal, all_numDoOopCalls_nv,
-                100.0 * (float)all_numDoOopCalls_nv /
-                (float)all_numDoOopCallsTotal);
-  const char* kind_names[] = { "ik", "irk", "oa" };
-  for (int k = ik; k < NUM_Kinds; k++) {
-    gclog_or_tty->print_cr(line_format, kind_names[k],
-                  _numDoOopCallsTotal[k], _numDoOopCalls_nv[k],
-                  (_numDoOopCallsTotal[k] > 0 ?
-                   100.0 * (float)_numDoOopCalls_nv[k] /
-                   (float)_numDoOopCallsTotal[k]
-                   : 0.0));
-  }
-}
-
-#endif  // ENABLE_SPECIALIZATION_STATS
-#endif  // !PRODUCT
diff --git a/hotspot/src/share/vm/memory/specialized_oop_closures.hpp b/hotspot/src/share/vm/memory/specialized_oop_closures.hpp
index b4e2fa3..5373ad8 100644
--- a/hotspot/src/share/vm/memory/specialized_oop_closures.hpp
+++ b/hotspot/src/share/vm/memory/specialized_oop_closures.hpp
@@ -60,21 +60,15 @@
 // This macro applies an argument macro to all OopClosures for which we
 // want specialized bodies of "oop_oop_iterate".  The arguments to "f" are:
 //   "f(closureType, non_virtual)"
-// where "closureType" is the name of the particular subclass of OopClosure,
+// where "closureType" is the name of the particular subclass of ExtendedOopClosure,
 // and "non_virtual" will be the string "_nv" if the closure type should
 // have its "do_oop" method invoked non-virtually, or else the
-// string "_v".  ("OopClosure" itself will be the only class in the latter
+// string "_v".  ("ExtendedOopClosure" itself will be the only class in the latter
 // category.)
 
 // This is split into several because of a Visual C++ 6.0 compiler bug
 // where very long macros cause the compiler to crash
 
-// Some other heap might define further specialized closures.
-#ifndef FURTHER_SPECIALIZED_OOP_OOP_ITERATE_CLOSURES
-#define FURTHER_SPECIALIZED_OOP_OOP_ITERATE_CLOSURES(f) \
-        /* None */
-#endif
-
 #define SPECIALIZED_OOP_OOP_ITERATE_CLOSURES_S(f)       \
   f(ScanClosure,_nv)                                    \
   f(FastScanClosure,_nv)                                \
@@ -94,7 +88,7 @@
   SPECIALIZED_OOP_OOP_ITERATE_CLOSURES_P(f)
 
 #if INCLUDE_ALL_GCS
-#define SPECIALIZED_OOP_OOP_ITERATE_CLOSURES_2(f)       \
+#define SPECIALIZED_OOP_OOP_ITERATE_CLOSURES_CMS(f)     \
   f(MarkRefsIntoAndScanClosure,_nv)                     \
   f(Par_MarkRefsIntoAndScanClosure,_nv)                 \
   f(PushAndMarkClosure,_nv)                             \
@@ -102,8 +96,13 @@
   f(PushOrMarkClosure,_nv)                              \
   f(Par_PushOrMarkClosure,_nv)                          \
   f(CMSKeepAliveClosure,_nv)                            \
-  f(CMSInnerParMarkAndPushClosure,_nv)                  \
-  FURTHER_SPECIALIZED_OOP_OOP_ITERATE_CLOSURES(f)
+  f(CMSInnerParMarkAndPushClosure,_nv)
+#endif
+
+#if INCLUDE_ALL_GCS
+#define SPECIALIZED_OOP_OOP_ITERATE_CLOSURES_2(f)       \
+  SPECIALIZED_OOP_OOP_ITERATE_CLOSURES_CMS(f)           \
+  SPECIALIZED_OOP_OOP_ITERATE_CLOSURES_G1(f)
 #else  // INCLUDE_ALL_GCS
 #define SPECIALIZED_OOP_OOP_ITERATE_CLOSURES_2(f)
 #endif // INCLUDE_ALL_GCS
@@ -144,13 +143,6 @@
 // The "root_class" is the most general class to define; this may be
 // "OopClosure" in some applications and "OopsInGenClosure" in others.
 
-
-// Some other heap might define further specialized closures.
-#ifndef FURTHER_SPECIALIZED_SINCE_SAVE_MARKS_CLOSURES
-#define FURTHER_SPECIALIZED_SINCE_SAVE_MARKS_CLOSURES(f) \
-        /* None */
-#endif
-
 #define SPECIALIZED_SINCE_SAVE_MARKS_CLOSURES_YOUNG_S(f) \
   f(ScanClosure,_nv)                                     \
   f(FastScanClosure,_nv)
@@ -158,8 +150,7 @@
 #if INCLUDE_ALL_GCS
 #define SPECIALIZED_SINCE_SAVE_MARKS_CLOSURES_YOUNG_P(f) \
   f(ParScanWithBarrierClosure,_nv)                       \
-  f(ParScanWithoutBarrierClosure,_nv)                    \
-  FURTHER_SPECIALIZED_SINCE_SAVE_MARKS_CLOSURES(f)
+  f(ParScanWithoutBarrierClosure,_nv)
 #else  // INCLUDE_ALL_GCS
 #define SPECIALIZED_SINCE_SAVE_MARKS_CLOSURES_YOUNG_P(f)
 #endif // INCLUDE_ALL_GCS
@@ -174,93 +165,9 @@
 // We separate these out, because sometime the general one has
 // a different definition from the specialized ones, and sometimes it
 // doesn't.
-// NOTE:   One of the valid criticisms of this
-// specialize-oop_oop_iterate-for-specific-closures idiom is that it is
-// easy to have a silent performance bug: if you fail to de-virtualize,
-// things still work, just slower.  The "SpecializationStats" mode is
-// intended to at least make such a failure easy to detect.
-// *Not* using the ALL_SINCE_SAVE_MARKS_CLOSURES(f) macro defined
-// below means that *only* closures for which oop_oop_iterate specializations
-// exist above may be applied to "oops_since_save_marks".  That is,
-// this form of the performance bug is caught statically.  When you add
-// a definition for the general type, this property goes away.
-// Make sure you test with SpecializationStats to find such bugs
-// when introducing a new closure where you don't want virtual dispatch.
 
 #define ALL_SINCE_SAVE_MARKS_CLOSURES(f)                \
   f(OopsInGenClosure,_v)                                \
   SPECIALIZED_SINCE_SAVE_MARKS_CLOSURES(f)
 
-// For keeping stats on effectiveness.
-#define ENABLE_SPECIALIZATION_STATS 0
-
-
-class SpecializationStats {
-public:
-  enum Kind {
-    ik,             // InstanceKlass
-    irk,            // InstanceRefKlass
-    oa,             // ObjArrayKlass
-    NUM_Kinds
-  };
-
-#if ENABLE_SPECIALIZATION_STATS
-private:
-  static bool _init;
-  static bool _wrapped;
-  static jint _numCallsAll;
-
-  static jint _numCallsTotal[NUM_Kinds];
-  static jint _numCalls_nv[NUM_Kinds];
-
-  static jint _numDoOopCallsTotal[NUM_Kinds];
-  static jint _numDoOopCalls_nv[NUM_Kinds];
-public:
-#endif
-  static void clear()  PRODUCT_RETURN;
-
-  static inline void record_call()  PRODUCT_RETURN;
-  static inline void record_iterate_call_v(Kind k)  PRODUCT_RETURN;
-  static inline void record_iterate_call_nv(Kind k)  PRODUCT_RETURN;
-  static inline void record_do_oop_call_v(Kind k)  PRODUCT_RETURN;
-  static inline void record_do_oop_call_nv(Kind k)  PRODUCT_RETURN;
-
-  static void print() PRODUCT_RETURN;
-};
-
-#ifndef PRODUCT
-#if ENABLE_SPECIALIZATION_STATS
-
-inline void SpecializationStats::record_call() {
-  Atomic::inc(&_numCallsAll);
-}
-inline void SpecializationStats::record_iterate_call_v(Kind k) {
-  Atomic::inc(&_numCallsTotal[k]);
-}
-inline void SpecializationStats::record_iterate_call_nv(Kind k) {
-  Atomic::inc(&_numCallsTotal[k]);
-  Atomic::inc(&_numCalls_nv[k]);
-}
-
-inline void SpecializationStats::record_do_oop_call_v(Kind k) {
-  Atomic::inc(&_numDoOopCallsTotal[k]);
-}
-inline void SpecializationStats::record_do_oop_call_nv(Kind k) {
-  Atomic::inc(&_numDoOopCallsTotal[k]);
-  Atomic::inc(&_numDoOopCalls_nv[k]);
-}
-
-#else   // !ENABLE_SPECIALIZATION_STATS
-
-inline void SpecializationStats::record_call() {}
-inline void SpecializationStats::record_iterate_call_v(Kind k) {}
-inline void SpecializationStats::record_iterate_call_nv(Kind k) {}
-inline void SpecializationStats::record_do_oop_call_v(Kind k) {}
-inline void SpecializationStats::record_do_oop_call_nv(Kind k) {}
-inline void SpecializationStats::clear() {}
-inline void SpecializationStats::print() {}
-
-#endif  // ENABLE_SPECIALIZATION_STATS
-#endif  // !PRODUCT
-
 #endif // SHARE_VM_MEMORY_SPECIALIZED_OOP_CLOSURES_HPP
diff --git a/hotspot/src/share/vm/memory/tenuredGeneration.cpp b/hotspot/src/share/vm/memory/tenuredGeneration.cpp
index fff7874..e300ee4 100644
--- a/hotspot/src/share/vm/memory/tenuredGeneration.cpp
+++ b/hotspot/src/share/vm/memory/tenuredGeneration.cpp
@@ -178,7 +178,6 @@
                                 bool   is_tlab) {
   GenCollectedHeap* gch = GenCollectedHeap::heap();
 
-  SpecializationStats::clear();
   // Temporarily expand the span of our ref processor, so
   // refs discovery is over the entire heap, not just this generation
   ReferenceProcessorSpanMutator
@@ -195,8 +194,6 @@
   gc_timer->register_gc_end();
 
   gc_tracer->report_gc_end(gc_timer->gc_end(), gc_timer->time_partitions());
-
-  SpecializationStats::print();
 }
 
 HeapWord*
diff --git a/hotspot/src/share/vm/oops/cpCache.cpp b/hotspot/src/share/vm/oops/cpCache.cpp
index f9f73d2..90416b4 100644
--- a/hotspot/src/share/vm/oops/cpCache.cpp
+++ b/hotspot/src/share/vm/oops/cpCache.cpp
@@ -35,9 +35,6 @@
 #include "runtime/handles.inline.hpp"
 #include "runtime/orderAccess.inline.hpp"
 #include "utilities/macros.hpp"
-#if INCLUDE_ALL_GCS
-# include "gc_implementation/parallelScavenge/psPromotionManager.hpp"
-#endif // INCLUDE_ALL_GCS
 
 PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
 
diff --git a/hotspot/src/share/vm/oops/instanceClassLoaderKlass.cpp b/hotspot/src/share/vm/oops/instanceClassLoaderKlass.cpp
index 181db6e..f49e376 100644
--- a/hotspot/src/share/vm/oops/instanceClassLoaderKlass.cpp
+++ b/hotspot/src/share/vm/oops/instanceClassLoaderKlass.cpp
@@ -30,6 +30,7 @@
 #include "memory/genOopClosures.inline.hpp"
 #include "memory/iterator.inline.hpp"
 #include "memory/oopFactory.hpp"
+#include "memory/specialized_oop_closures.hpp"
 #include "oops/instanceKlass.hpp"
 #include "oops/instanceClassLoaderKlass.hpp"
 #include "oops/instanceMirrorKlass.hpp"
@@ -54,7 +55,6 @@
 int InstanceClassLoaderKlass::                                                  \
 oop_oop_iterate##nv_suffix(oop obj, OopClosureType* closure) {                  \
   /* Get size before changing pointers */                                       \
-  SpecializationStats::record_iterate_call##nv_suffix(SpecializationStats::irk);\
   int size = InstanceKlass::oop_oop_iterate##nv_suffix(obj, closure);           \
                                                                                 \
   if_do_metadata_checked(closure, nv_suffix) {                                  \
@@ -74,7 +74,6 @@
 int InstanceClassLoaderKlass::                                                  \
 oop_oop_iterate_backwards##nv_suffix(oop obj, OopClosureType* closure) {        \
   /* Get size before changing pointers */                                       \
-  SpecializationStats::record_iterate_call##nv_suffix(SpecializationStats::irk);\
   int size = InstanceKlass::oop_oop_iterate_backwards##nv_suffix(obj, closure); \
   return size;                                                                  \
 }
@@ -87,8 +86,6 @@
 oop_oop_iterate##nv_suffix##_m(oop obj,                                         \
                                OopClosureType* closure,                         \
                                MemRegion mr) {                                  \
-  SpecializationStats::record_iterate_call##nv_suffix(SpecializationStats::irk);\
-                                                                                \
   int size = InstanceKlass::oop_oop_iterate##nv_suffix##_m(obj, closure, mr);   \
                                                                                 \
   if_do_metadata_checked(closure, nv_suffix) {                                  \
diff --git a/hotspot/src/share/vm/oops/instanceClassLoaderKlass.hpp b/hotspot/src/share/vm/oops/instanceClassLoaderKlass.hpp
index 309ebf9..2cec482 100644
--- a/hotspot/src/share/vm/oops/instanceClassLoaderKlass.hpp
+++ b/hotspot/src/share/vm/oops/instanceClassLoaderKlass.hpp
@@ -25,6 +25,7 @@
 #ifndef SHARE_VM_OOPS_INSTANCECLASSLOADERKLASS_HPP
 #define SHARE_VM_OOPS_INSTANCECLASSLOADERKLASS_HPP
 
+#include "memory/specialized_oop_closures.hpp"
 #include "oops/instanceKlass.hpp"
 #include "utilities/macros.hpp"
 
diff --git a/hotspot/src/share/vm/oops/instanceKlass.cpp b/hotspot/src/share/vm/oops/instanceKlass.cpp
index 45188c4..8d62afe 100644
--- a/hotspot/src/share/vm/oops/instanceKlass.cpp
+++ b/hotspot/src/share/vm/oops/instanceKlass.cpp
@@ -38,6 +38,7 @@
 #include "memory/iterator.inline.hpp"
 #include "memory/metadataFactory.hpp"
 #include "memory/oopFactory.hpp"
+#include "memory/specialized_oop_closures.hpp"
 #include "oops/fieldStreams.hpp"
 #include "oops/instanceClassLoaderKlass.hpp"
 #include "oops/instanceKlass.hpp"
@@ -2209,15 +2210,12 @@
 #define InstanceKlass_OOP_OOP_ITERATE_DEFN(OopClosureType, nv_suffix)        \
                                                                              \
 int InstanceKlass::oop_oop_iterate##nv_suffix(oop obj, OopClosureType* closure) { \
-  SpecializationStats::record_iterate_call##nv_suffix(SpecializationStats::ik);\
   /* header */                                                          \
   if_do_metadata_checked(closure, nv_suffix) {                          \
     closure->do_klass##nv_suffix(obj->klass());                         \
   }                                                                     \
   InstanceKlass_OOP_MAP_ITERATE(                                        \
     obj,                                                                \
-    SpecializationStats::                                               \
-      record_do_oop_call##nv_suffix(SpecializationStats::ik);           \
     (closure)->do_oop##nv_suffix(p),                                    \
     assert_is_in_closed_subset)                                         \
   return size_helper();                                                 \
@@ -2228,14 +2226,11 @@
                                                                                 \
 int InstanceKlass::oop_oop_iterate_backwards##nv_suffix(oop obj,                \
                                               OopClosureType* closure) {        \
-  SpecializationStats::record_iterate_call##nv_suffix(SpecializationStats::ik); \
-                                                                                \
   assert_should_ignore_metadata(closure, nv_suffix);                            \
                                                                                 \
   /* instance variables */                                                      \
   InstanceKlass_OOP_MAP_REVERSE_ITERATE(                                        \
     obj,                                                                        \
-    SpecializationStats::record_do_oop_call##nv_suffix(SpecializationStats::ik);\
     (closure)->do_oop##nv_suffix(p),                                            \
     assert_is_in_closed_subset)                                                 \
    return size_helper();                                                        \
@@ -2247,7 +2242,6 @@
 int InstanceKlass::oop_oop_iterate##nv_suffix##_m(oop obj,              \
                                                   OopClosureType* closure, \
                                                   MemRegion mr) {          \
-  SpecializationStats::record_iterate_call##nv_suffix(SpecializationStats::ik);\
   if_do_metadata_checked(closure, nv_suffix) {                           \
     if (mr.contains(obj)) {                                              \
       closure->do_klass##nv_suffix(obj->klass());                        \
diff --git a/hotspot/src/share/vm/oops/instanceKlass.hpp b/hotspot/src/share/vm/oops/instanceKlass.hpp
index 53c87e8..6e216f9 100644
--- a/hotspot/src/share/vm/oops/instanceKlass.hpp
+++ b/hotspot/src/share/vm/oops/instanceKlass.hpp
@@ -27,6 +27,7 @@
 
 #include "classfile/classLoaderData.hpp"
 #include "memory/referenceType.hpp"
+#include "memory/specialized_oop_closures.hpp"
 #include "oops/annotations.hpp"
 #include "oops/constMethod.hpp"
 #include "oops/fieldInfo.hpp"
diff --git a/hotspot/src/share/vm/oops/instanceMirrorKlass.cpp b/hotspot/src/share/vm/oops/instanceMirrorKlass.cpp
index 09a73f7..73d6e43 100644
--- a/hotspot/src/share/vm/oops/instanceMirrorKlass.cpp
+++ b/hotspot/src/share/vm/oops/instanceMirrorKlass.cpp
@@ -30,6 +30,7 @@
 #include "memory/genOopClosures.inline.hpp"
 #include "memory/iterator.inline.hpp"
 #include "memory/oopFactory.hpp"
+#include "memory/specialized_oop_closures.hpp"
 #include "oops/instanceKlass.hpp"
 #include "oops/instanceMirrorKlass.hpp"
 #include "oops/instanceOop.hpp"
@@ -250,8 +251,6 @@
 int InstanceMirrorKlass::                                                             \
 oop_oop_iterate##nv_suffix(oop obj, OopClosureType* closure) {                        \
   /* Get size before changing pointers */                                             \
-  SpecializationStats::record_iterate_call##nv_suffix(SpecializationStats::irk);      \
-                                                                                      \
   InstanceKlass::oop_oop_iterate##nv_suffix(obj, closure);                            \
                                                                                       \
   if_do_metadata_checked(closure, nv_suffix) {                                        \
@@ -275,8 +274,6 @@
 int InstanceMirrorKlass::                                                             \
 oop_oop_iterate_backwards##nv_suffix(oop obj, OopClosureType* closure) {              \
   /* Get size before changing pointers */                                             \
-  SpecializationStats::record_iterate_call##nv_suffix(SpecializationStats::irk);      \
-                                                                                      \
   InstanceKlass::oop_oop_iterate_backwards##nv_suffix(obj, closure);                  \
                                                                                       \
   if (UseCompressedOops) {                                                            \
@@ -294,8 +291,6 @@
 oop_oop_iterate##nv_suffix##_m(oop obj,                                               \
                                OopClosureType* closure,                               \
                                MemRegion mr) {                                        \
-  SpecializationStats::record_iterate_call##nv_suffix(SpecializationStats::irk);      \
-                                                                                      \
   InstanceKlass::oop_oop_iterate##nv_suffix##_m(obj, closure, mr);                    \
                                                                                       \
   if_do_metadata_checked(closure, nv_suffix) {                                        \
diff --git a/hotspot/src/share/vm/oops/instanceMirrorKlass.hpp b/hotspot/src/share/vm/oops/instanceMirrorKlass.hpp
index b861639..368b41d 100644
--- a/hotspot/src/share/vm/oops/instanceMirrorKlass.hpp
+++ b/hotspot/src/share/vm/oops/instanceMirrorKlass.hpp
@@ -26,6 +26,7 @@
 #define SHARE_VM_OOPS_INSTANCEMIRRORKLASS_HPP
 
 #include "classfile/systemDictionary.hpp"
+#include "memory/specialized_oop_closures.hpp"
 #include "oops/instanceKlass.hpp"
 #include "runtime/handles.hpp"
 #include "utilities/macros.hpp"
diff --git a/hotspot/src/share/vm/oops/instanceRefKlass.cpp b/hotspot/src/share/vm/oops/instanceRefKlass.cpp
index a149893..12804db 100644
--- a/hotspot/src/share/vm/oops/instanceRefKlass.cpp
+++ b/hotspot/src/share/vm/oops/instanceRefKlass.cpp
@@ -30,6 +30,7 @@
 #include "gc_interface/collectedHeap.inline.hpp"
 #include "memory/genCollectedHeap.hpp"
 #include "memory/genOopClosures.inline.hpp"
+#include "memory/specialized_oop_closures.hpp"
 #include "oops/instanceRefKlass.hpp"
 #include "oops/oop.inline.hpp"
 #include "utilities/preserveException.hpp"
@@ -260,7 +261,6 @@
       return size;                                                              \
     } else if (contains(referent_addr)) {                                       \
       /* treat referent as normal oop */                                        \
-      SpecializationStats::record_do_oop_call##nv_suffix(SpecializationStats::irk);\
       closure->do_oop##nv_suffix(referent_addr);                                \
     }                                                                           \
   }                                                                             \
@@ -276,7 +276,6 @@
                                  INTPTR_FORMAT, disc_addr);                     \
         }                                                                       \
       )                                                                         \
-      SpecializationStats::record_do_oop_call##nv_suffix(SpecializationStats::irk);\
       closure->do_oop##nv_suffix(disc_addr);                                    \
     }                                                                           \
   } else {                                                                      \
@@ -293,7 +292,6 @@
   }                                                                             \
   /* treat next as normal oop */                                                \
   if (contains(next_addr)) {                                                    \
-    SpecializationStats::record_do_oop_call##nv_suffix(SpecializationStats::irk); \
     closure->do_oop##nv_suffix(next_addr);                                      \
   }                                                                             \
   return size;                                                                  \
@@ -309,8 +307,6 @@
 int InstanceRefKlass::                                                          \
 oop_oop_iterate##nv_suffix(oop obj, OopClosureType* closure) {                  \
   /* Get size before changing pointers */                                       \
-  SpecializationStats::record_iterate_call##nv_suffix(SpecializationStats::irk);\
-                                                                                \
   int size = InstanceKlass::oop_oop_iterate##nv_suffix(obj, closure);           \
                                                                                 \
   if (UseCompressedOops) {                                                      \
@@ -326,8 +322,6 @@
 int InstanceRefKlass::                                                          \
 oop_oop_iterate_backwards##nv_suffix(oop obj, OopClosureType* closure) {        \
   /* Get size before changing pointers */                                       \
-  SpecializationStats::record_iterate_call##nv_suffix(SpecializationStats::irk);\
-                                                                                \
   int size = InstanceKlass::oop_oop_iterate_backwards##nv_suffix(obj, closure); \
                                                                                 \
   if (UseCompressedOops) {                                                      \
@@ -345,8 +339,6 @@
 oop_oop_iterate##nv_suffix##_m(oop obj,                                         \
                                OopClosureType* closure,                         \
                                MemRegion mr) {                                  \
-  SpecializationStats::record_iterate_call##nv_suffix(SpecializationStats::irk);\
-                                                                                \
   int size = InstanceKlass::oop_oop_iterate##nv_suffix##_m(obj, closure, mr);   \
   if (UseCompressedOops) {                                                      \
     InstanceRefKlass_SPECIALIZED_OOP_ITERATE(narrowOop, nv_suffix, mr.contains); \
diff --git a/hotspot/src/share/vm/oops/instanceRefKlass.hpp b/hotspot/src/share/vm/oops/instanceRefKlass.hpp
index 3140977..2f5b459 100644
--- a/hotspot/src/share/vm/oops/instanceRefKlass.hpp
+++ b/hotspot/src/share/vm/oops/instanceRefKlass.hpp
@@ -25,6 +25,7 @@
 #ifndef SHARE_VM_OOPS_INSTANCEREFKLASS_HPP
 #define SHARE_VM_OOPS_INSTANCEREFKLASS_HPP
 
+#include "memory/specialized_oop_closures.hpp"
 #include "oops/instanceKlass.hpp"
 #include "utilities/macros.hpp"
 
diff --git a/hotspot/src/share/vm/oops/klass.cpp b/hotspot/src/share/vm/oops/klass.cpp
index 295008d..09256c7 100644
--- a/hotspot/src/share/vm/oops/klass.cpp
+++ b/hotspot/src/share/vm/oops/klass.cpp
@@ -39,8 +39,8 @@
 #include "runtime/atomic.inline.hpp"
 #include "runtime/orderAccess.inline.hpp"
 #include "trace/traceMacros.hpp"
-#include "utilities/stack.hpp"
 #include "utilities/macros.hpp"
+#include "utilities/stack.inline.hpp"
 #if INCLUDE_ALL_GCS
 #include "gc_implementation/g1/g1SATBCardTableModRefBS.hpp"
 #include "gc_implementation/parallelScavenge/psParallelCompact.hpp"
diff --git a/hotspot/src/share/vm/oops/objArrayKlass.cpp b/hotspot/src/share/vm/oops/objArrayKlass.cpp
index 002196f..8c2670c 100644
--- a/hotspot/src/share/vm/oops/objArrayKlass.cpp
+++ b/hotspot/src/share/vm/oops/objArrayKlass.cpp
@@ -32,6 +32,7 @@
 #include "memory/iterator.inline.hpp"
 #include "memory/metadataFactory.hpp"
 #include "memory/resourceArea.hpp"
+#include "memory/specialized_oop_closures.hpp"
 #include "memory/universe.inline.hpp"
 #include "oops/instanceKlass.hpp"
 #include "oops/klass.inline.hpp"
@@ -479,7 +480,6 @@
                                                                                 \
 int ObjArrayKlass::oop_oop_iterate##nv_suffix(oop obj,                          \
                                               OopClosureType* closure) {        \
-  SpecializationStats::record_iterate_call##nv_suffix(SpecializationStats::oa); \
   assert (obj->is_array(), "obj must be array");                                \
   objArrayOop a = objArrayOop(obj);                                             \
   /* Get size before changing pointers. */                                      \
@@ -497,7 +497,6 @@
 int ObjArrayKlass::oop_oop_iterate##nv_suffix##_m(oop obj,                      \
                                                   OopClosureType* closure,      \
                                                   MemRegion mr) {               \
-  SpecializationStats::record_iterate_call##nv_suffix(SpecializationStats::oa); \
   assert(obj->is_array(), "obj must be array");                                 \
   objArrayOop a  = objArrayOop(obj);                                            \
   /* Get size before changing pointers. */                                      \
@@ -519,7 +518,6 @@
 int ObjArrayKlass::oop_oop_iterate_range##nv_suffix(oop obj,                    \
                                                   OopClosureType* closure,      \
                                                   int start, int end) {         \
-  SpecializationStats::record_iterate_call##nv_suffix(SpecializationStats::oa); \
   assert(obj->is_array(), "obj must be array");                                 \
   objArrayOop a  = objArrayOop(obj);                                            \
   /* Get size before changing pointers. */                                      \
diff --git a/hotspot/src/share/vm/oops/objArrayOop.cpp b/hotspot/src/share/vm/oops/objArrayOop.cpp
index 2d91b46..a0265ee 100644
--- a/hotspot/src/share/vm/oops/objArrayOop.cpp
+++ b/hotspot/src/share/vm/oops/objArrayOop.cpp
@@ -23,6 +23,7 @@
  */
 
 #include "precompiled.hpp"
+#include "memory/specialized_oop_closures.hpp"
 #include "oops/objArrayKlass.hpp"
 #include "oops/objArrayOop.hpp"
 #include "oops/oop.inline.hpp"
@@ -46,7 +47,6 @@
 #define ObjArrayOop_OOP_ITERATE_DEFN(OopClosureType, nv_suffix)                    \
                                                                                    \
 int objArrayOopDesc::oop_iterate_range(OopClosureType* blk, int start, int end) {  \
-  SpecializationStats::record_call();                                              \
   return ((ObjArrayKlass*)klass())->oop_oop_iterate_range##nv_suffix(this, blk, start, end); \
 }
 
diff --git a/hotspot/src/share/vm/oops/objArrayOop.hpp b/hotspot/src/share/vm/oops/objArrayOop.hpp
index 3b32e5b..5ffc0d7 100644
--- a/hotspot/src/share/vm/oops/objArrayOop.hpp
+++ b/hotspot/src/share/vm/oops/objArrayOop.hpp
@@ -25,6 +25,7 @@
 #ifndef SHARE_VM_OOPS_OBJARRAYOOP_HPP
 #define SHARE_VM_OOPS_OBJARRAYOOP_HPP
 
+#include "memory/specialized_oop_closures.hpp"
 #include "oops/arrayOop.hpp"
 
 // An objArrayOop is an array containing oops.
diff --git a/hotspot/src/share/vm/oops/oop.inline.hpp b/hotspot/src/share/vm/oops/oop.inline.hpp
index 8c9949d..dfc5ac3 100644
--- a/hotspot/src/share/vm/oops/oop.inline.hpp
+++ b/hotspot/src/share/vm/oops/oop.inline.hpp
@@ -630,6 +630,30 @@
   return cas_set_mark(m, compare) == compare;
 }
 
+#if INCLUDE_ALL_GCS
+inline oop oopDesc::forward_to_atomic(oop p) {
+  markOop oldMark = mark();
+  markOop forwardPtrMark = markOopDesc::encode_pointer_as_mark(p);
+  markOop curMark;
+
+  assert(forwardPtrMark->decode_pointer() == p, "encoding must be reversable");
+  assert(sizeof(markOop) == sizeof(intptr_t), "CAS below requires this.");
+
+  while (!oldMark->is_marked()) {
+    curMark = (markOop)Atomic::cmpxchg_ptr(forwardPtrMark, &_mark, oldMark);
+    assert(is_forwarded(), "object should have been forwarded");
+    if (curMark == oldMark) {
+      return NULL;
+    }
+    // If the CAS was unsuccessful then curMark->is_marked()
+    // should return true as another thread has CAS'd in another
+    // forwarding pointer.
+    oldMark = curMark;
+  }
+  return forwardee();
+}
+#endif
+
 // Note that the forwardee is not the same thing as the displaced_mark.
 // The forwardee is used when copying during scavenge and mark-sweep.
 // It does need to clear the low two locking- and GC-related bits.
@@ -692,12 +716,10 @@
 #define OOP_ITERATE_DEFN(OopClosureType, nv_suffix)                        \
                                                                            \
 inline int oopDesc::oop_iterate(OopClosureType* blk) {                     \
-  SpecializationStats::record_call();                                      \
   return klass()->oop_oop_iterate##nv_suffix(this, blk);               \
 }                                                                          \
                                                                            \
 inline int oopDesc::oop_iterate(OopClosureType* blk, MemRegion mr) {       \
-  SpecializationStats::record_call();                                      \
   return klass()->oop_oop_iterate##nv_suffix##_m(this, blk, mr);       \
 }
 
@@ -721,7 +743,6 @@
 #define OOP_ITERATE_BACKWARDS_DEFN(OopClosureType, nv_suffix)              \
                                                                            \
 inline int oopDesc::oop_iterate_backwards(OopClosureType* blk) {           \
-  SpecializationStats::record_call();                                      \
   return klass()->oop_oop_iterate_backwards##nv_suffix(this, blk);     \
 }
 
diff --git a/hotspot/src/share/vm/oops/oop.pcgc.inline.hpp b/hotspot/src/share/vm/oops/oop.pcgc.inline.hpp
index a361e3b..930a770 100644
--- a/hotspot/src/share/vm/oops/oop.pcgc.inline.hpp
+++ b/hotspot/src/share/vm/oops/oop.pcgc.inline.hpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -54,28 +54,4 @@
   klass()->oop_follow_contents(cm, this);
 }
 
-inline oop oopDesc::forward_to_atomic(oop p) {
-  assert(ParNewGeneration::is_legal_forward_ptr(p),
-         "illegal forwarding pointer value.");
-  markOop oldMark = mark();
-  markOop forwardPtrMark = markOopDesc::encode_pointer_as_mark(p);
-  markOop curMark;
-
-  assert(forwardPtrMark->decode_pointer() == p, "encoding must be reversable");
-  assert(sizeof(markOop) == sizeof(intptr_t), "CAS below requires this.");
-
-  while (!oldMark->is_marked()) {
-    curMark = (markOop)Atomic::cmpxchg_ptr(forwardPtrMark, &_mark, oldMark);
-    assert(is_forwarded(), "object should have been forwarded");
-    if (curMark == oldMark) {
-      return NULL;
-    }
-    // If the CAS was unsuccessful then curMark->is_marked()
-    // should return true as another thread has CAS'd in another
-    // forwarding pointer.
-    oldMark = curMark;
-  }
-  return forwardee();
-}
-
 #endif // SHARE_VM_OOPS_OOP_PCGC_INLINE_HPP
diff --git a/hotspot/src/share/vm/opto/graphKit.cpp b/hotspot/src/share/vm/opto/graphKit.cpp
index ad7ffef..a08b6da 100644
--- a/hotspot/src/share/vm/opto/graphKit.cpp
+++ b/hotspot/src/share/vm/opto/graphKit.cpp
@@ -1518,7 +1518,6 @@
   BarrierSet* bs = Universe::heap()->barrier_set();
   set_control(ctl);
   switch (bs->kind()) {
-    case BarrierSet::G1SATBCT:
     case BarrierSet::G1SATBCTLogging:
       g1_write_barrier_pre(do_load, obj, adr, adr_idx, val, val_type, pre_val, bt);
       break;
@@ -1537,7 +1536,6 @@
 bool GraphKit::can_move_pre_barrier() const {
   BarrierSet* bs = Universe::heap()->barrier_set();
   switch (bs->kind()) {
-    case BarrierSet::G1SATBCT:
     case BarrierSet::G1SATBCTLogging:
       return true; // Can move it if no safepoint
 
@@ -1563,7 +1561,6 @@
   BarrierSet* bs = Universe::heap()->barrier_set();
   set_control(ctl);
   switch (bs->kind()) {
-    case BarrierSet::G1SATBCT:
     case BarrierSet::G1SATBCTLogging:
       g1_write_barrier_post(store, obj, adr, adr_idx, val, bt, use_precise);
       break;
diff --git a/hotspot/src/share/vm/precompiled/precompiled.hpp b/hotspot/src/share/vm/precompiled/precompiled.hpp
index 400ad45..e69fdf4 100644
--- a/hotspot/src/share/vm/precompiled/precompiled.hpp
+++ b/hotspot/src/share/vm/precompiled/precompiled.hpp
@@ -135,8 +135,6 @@
 # include "memory/resourceArea.hpp"
 # include "memory/sharedHeap.hpp"
 # include "memory/space.hpp"
-# include "memory/space.inline.hpp"
-# include "memory/specialized_oop_closures.hpp"
 # include "memory/threadLocalAllocBuffer.hpp"
 # include "memory/threadLocalAllocBuffer.inline.hpp"
 # include "memory/universe.hpp"
@@ -310,7 +308,6 @@
 # include "gc_implementation/g1/g1BlockOffsetTable.inline.hpp"
 # include "gc_implementation/g1/g1OopClosures.hpp"
 # include "gc_implementation/g1/g1_globals.hpp"
-# include "gc_implementation/g1/g1_specialized_oop_closures.hpp"
 # include "gc_implementation/g1/ptrQueue.hpp"
 # include "gc_implementation/g1/satbQueue.hpp"
 # include "gc_implementation/parNew/parOopClosures.hpp"
diff --git a/hotspot/src/share/vm/prims/jvm.cpp b/hotspot/src/share/vm/prims/jvm.cpp
index 50f8dc4..e4204b2 100644
--- a/hotspot/src/share/vm/prims/jvm.cpp
+++ b/hotspot/src/share/vm/prims/jvm.cpp
@@ -402,7 +402,7 @@
       PUTPROP(props, "sun.nio.MaxDirectMemorySize", "-1");
     } else {
       char as_chars[256];
-      jio_snprintf(as_chars, sizeof(as_chars), UINTX_FORMAT, MaxDirectMemorySize);
+      jio_snprintf(as_chars, sizeof(as_chars), SIZE_FORMAT, MaxDirectMemorySize);
       PUTPROP(props, "sun.nio.MaxDirectMemorySize", as_chars);
     }
   }
diff --git a/hotspot/src/share/vm/prims/whitebox.cpp b/hotspot/src/share/vm/prims/whitebox.cpp
index 6091f5c..3c833ce 100644
--- a/hotspot/src/share/vm/prims/whitebox.cpp
+++ b/hotspot/src/share/vm/prims/whitebox.cpp
@@ -295,6 +295,12 @@
   return hr->is_humongous();
 WB_END
 
+WB_ENTRY(jlong, WB_G1NumMaxRegions(JNIEnv* env, jobject o))
+  G1CollectedHeap* g1 = G1CollectedHeap::heap();
+  size_t nr = g1->max_regions();
+  return (jlong)nr;
+WB_END
+
 WB_ENTRY(jlong, WB_G1NumFreeRegions(JNIEnv* env, jobject o))
   G1CollectedHeap* g1 = G1CollectedHeap::heap();
   size_t nr = g1->num_free_regions();
@@ -318,6 +324,14 @@
 WB_ENTRY(jint, WB_G1RegionSize(JNIEnv* env, jobject o))
   return (jint)HeapRegion::GrainBytes;
 WB_END
+
+WB_ENTRY(jobject, WB_G1AuxiliaryMemoryUsage(JNIEnv* env))
+  ResourceMark rm(THREAD);
+  G1CollectedHeap* g1h = G1CollectedHeap::heap();
+  MemoryUsage usage = g1h->get_auxiliary_data_memory_usage();
+  Handle h = MemoryService::create_MemoryUsage_obj(usage, CHECK_NULL);
+  return JNIHandles::make_local(env, h());
+WB_END
 #endif // INCLUDE_ALL_GCS
 
 #if INCLUDE_NMT
@@ -1305,9 +1319,12 @@
 #if INCLUDE_ALL_GCS
   {CC"g1InConcurrentMark", CC"()Z",                   (void*)&WB_G1InConcurrentMark},
   {CC"g1IsHumongous",      CC"(Ljava/lang/Object;)Z", (void*)&WB_G1IsHumongous     },
+  {CC"g1NumMaxRegions",    CC"()J",                   (void*)&WB_G1NumMaxRegions  },
   {CC"g1NumFreeRegions",   CC"()J",                   (void*)&WB_G1NumFreeRegions  },
   {CC"g1RegionSize",       CC"()I",                   (void*)&WB_G1RegionSize      },
   {CC"g1StartConcMarkCycle",       CC"()Z",           (void*)&WB_G1StartMarkCycle  },
+  {CC"g1AuxiliaryMemoryUsage", CC"()Ljava/lang/management/MemoryUsage;",
+                                                      (void*)&WB_G1AuxiliaryMemoryUsage  },
 #endif // INCLUDE_ALL_GCS
 #if INCLUDE_NMT
   {CC"NMTMalloc",           CC"(J)J",                 (void*)&WB_NMTMalloc          },
diff --git a/hotspot/src/share/vm/runtime/arguments.cpp b/hotspot/src/share/vm/runtime/arguments.cpp
index f50ed30..320f67e 100644
--- a/hotspot/src/share/vm/runtime/arguments.cpp
+++ b/hotspot/src/share/vm/runtime/arguments.cpp
@@ -67,16 +67,16 @@
   }                                                                   \
 } while(0)
 
-char**  Arguments::_jvm_flags_array             = NULL;
-int     Arguments::_num_jvm_flags               = 0;
-char**  Arguments::_jvm_args_array              = NULL;
-int     Arguments::_num_jvm_args                = 0;
+char** Arguments::_jvm_flags_array              = NULL;
+int    Arguments::_num_jvm_flags                = 0;
+char** Arguments::_jvm_args_array               = NULL;
+int    Arguments::_num_jvm_args                 = 0;
 char*  Arguments::_java_command                 = NULL;
 SystemProperty* Arguments::_system_properties   = NULL;
 const char*  Arguments::_gc_log_filename        = NULL;
 bool   Arguments::_has_profile                  = false;
 size_t Arguments::_conservative_max_heap_alignment = 0;
-uintx  Arguments::_min_heap_size                = 0;
+size_t Arguments::_min_heap_size                = 0;
 uintx  Arguments::_min_heap_free_ratio          = 0;
 uintx  Arguments::_max_heap_free_ratio          = 0;
 Arguments::Mode Arguments::_mode                = _mixed;
@@ -1343,9 +1343,9 @@
     // NewSize was set on the command line and it is larger than
     // preferred_max_new_size.
     if (!FLAG_IS_DEFAULT(NewSize)) {   // NewSize explicitly set at command-line
-      FLAG_SET_ERGO(uintx, MaxNewSize, MAX2(NewSize, preferred_max_new_size));
+      FLAG_SET_ERGO(size_t, MaxNewSize, MAX2(NewSize, preferred_max_new_size));
     } else {
-      FLAG_SET_ERGO(uintx, MaxNewSize, preferred_max_new_size);
+      FLAG_SET_ERGO(size_t, MaxNewSize, preferred_max_new_size);
     }
     if (PrintGCDetails && Verbose) {
       // Too early to use gclog_or_tty
@@ -1368,8 +1368,8 @@
       // Unless explicitly requested otherwise, make young gen
       // at least min_new, and at most preferred_max_new_size.
       if (FLAG_IS_DEFAULT(NewSize)) {
-        FLAG_SET_ERGO(uintx, NewSize, MAX2(NewSize, min_new));
-        FLAG_SET_ERGO(uintx, NewSize, MIN2(preferred_max_new_size, NewSize));
+        FLAG_SET_ERGO(size_t, NewSize, MAX2(NewSize, min_new));
+        FLAG_SET_ERGO(size_t, NewSize, MIN2(preferred_max_new_size, NewSize));
         if (PrintGCDetails && Verbose) {
           // Too early to use gclog_or_tty
           tty->print_cr("CMS ergo set NewSize: " SIZE_FORMAT, NewSize);
@@ -1379,7 +1379,7 @@
       // so it's NewRatio x of NewSize.
       if (FLAG_IS_DEFAULT(OldSize)) {
         if (max_heap > NewSize) {
-          FLAG_SET_ERGO(uintx, OldSize, MIN2(NewRatio*NewSize, max_heap - NewSize));
+          FLAG_SET_ERGO(size_t, OldSize, MIN2(NewRatio*NewSize, max_heap - NewSize));
           if (PrintGCDetails && Verbose) {
             // Too early to use gclog_or_tty
             tty->print_cr("CMS ergo set OldSize: " SIZE_FORMAT, OldSize);
@@ -1410,7 +1410,7 @@
       // OldPLAB sizing manually turned off: Use a larger default setting,
       // unless it was manually specified. This is because a too-low value
       // will slow down scavenges.
-      FLAG_SET_ERGO(uintx, OldPLABSize, CFLS_LAB::_default_static_old_plab_size); // default value before 6631166
+      FLAG_SET_ERGO(size_t, OldPLABSize, CFLS_LAB::_default_static_old_plab_size); // default value before 6631166
     } else {
       FLAG_SET_DEFAULT(OldPLABSize, CFLS_LAB::_default_dynamic_old_plab_size); // old CMSParPromoteBlocksToClaim default
     }
@@ -1612,7 +1612,7 @@
 
 void Arguments::select_gc() {
   if (!gc_selected()) {
-    ArgumentsExt::select_gc_ergonomically();
+    select_gc_ergonomically();
   }
 }
 
@@ -1790,7 +1790,7 @@
 }
 
 // Use static initialization to get the default before parsing
-static const uintx DefaultHeapBaseMinAddress = HeapBaseMinAddress;
+static const size_t DefaultHeapBaseMinAddress = HeapBaseMinAddress;
 
 void Arguments::set_heap_size() {
   if (!FLAG_IS_DEFAULT(DefaultMaxRAMFraction)) {
@@ -1830,14 +1830,14 @@
           // matches compressed oops printing flags
           if (PrintCompressedOopsMode || (PrintMiscellaneous && Verbose)) {
             jio_fprintf(defaultStream::error_stream(),
-                        "HeapBaseMinAddress must be at least " UINTX_FORMAT
-                        " (" UINTX_FORMAT "G) which is greater than value given "
-                        UINTX_FORMAT "\n",
+                        "HeapBaseMinAddress must be at least " SIZE_FORMAT
+                        " (" SIZE_FORMAT "G) which is greater than value given "
+                        SIZE_FORMAT "\n",
                         DefaultHeapBaseMinAddress,
                         DefaultHeapBaseMinAddress/G,
                         HeapBaseMinAddress);
           }
-          FLAG_SET_ERGO(uintx, HeapBaseMinAddress, DefaultHeapBaseMinAddress);
+          FLAG_SET_ERGO(size_t, HeapBaseMinAddress, DefaultHeapBaseMinAddress);
         }
       }
 
@@ -1862,7 +1862,7 @@
       // Cannot use gclog_or_tty yet.
       tty->print_cr("  Maximum heap size " SIZE_FORMAT, (size_t) reasonable_max);
     }
-    FLAG_SET_ERGO(uintx, MaxHeapSize, (uintx)reasonable_max);
+    FLAG_SET_ERGO(size_t, MaxHeapSize, (size_t)reasonable_max);
   }
 
   // If the minimum or initial heap_size have not been set or requested to be set
@@ -1884,14 +1884,14 @@
 
       if (PrintGCDetails && Verbose) {
         // Cannot use gclog_or_tty yet.
-        tty->print_cr("  Initial heap size " SIZE_FORMAT, (uintx)reasonable_initial);
+        tty->print_cr("  Initial heap size " SIZE_FORMAT, (size_t)reasonable_initial);
       }
-      FLAG_SET_ERGO(uintx, InitialHeapSize, (uintx)reasonable_initial);
+      FLAG_SET_ERGO(size_t, InitialHeapSize, (size_t)reasonable_initial);
     }
     // If the minimum heap size has not been set (via -Xms),
     // synchronize with InitialHeapSize to avoid errors with the default value.
     if (min_heap_size() == 0) {
-      set_min_heap_size(MIN2((uintx)reasonable_minimum, InitialHeapSize));
+      set_min_heap_size(MIN2((size_t)reasonable_minimum, InitialHeapSize));
       if (PrintGCDetails && Verbose) {
         // Cannot use gclog_or_tty yet.
         tty->print_cr("  Minimum heap size " SIZE_FORMAT, min_heap_size());
@@ -2037,7 +2037,7 @@
   }
 
   if (UseGCLogFileRotation && (GCLogFileSize != 0) && (GCLogFileSize < 8*K)) {
-    FLAG_SET_CMDLINE(uintx, GCLogFileSize, 8*K);
+    FLAG_SET_CMDLINE(size_t, GCLogFileSize, 8*K);
     jio_fprintf(defaultStream::output_stream(),
                 "GCLogFileSize changed to minimum 8K\n");
   }
@@ -2121,7 +2121,7 @@
 }
 
 // Check consistency of GC selection
-bool Arguments::check_gc_consistency_user() {
+bool Arguments::check_gc_consistency() {
   check_gclog_consistency();
   // Ensure that the user has not selected conflicting sets
   // of collectors.
@@ -2265,7 +2265,7 @@
     FLAG_SET_DEFAULT(UseGCOverheadLimit, false);
   }
 
-  status = status && check_gc_consistency_user();
+  status = status && check_gc_consistency();
   status = status && check_stack_pages();
 
   status = status && verify_percentage(CMSIncrementalSafetyFactor,
@@ -2394,7 +2394,7 @@
 
   status = status && verify_min_value(LogEventsBufferEntries, 1, "LogEventsBufferEntries");
 
-  status = status && verify_min_value(HeapSizePerGCThread, (uintx) os::vm_page_size(), "HeapSizePerGCThread");
+  status = status && verify_min_value(HeapSizePerGCThread, (size_t) os::vm_page_size(), "HeapSizePerGCThread");
 
   status = status && verify_min_value(GCTaskTimeStampEntries, 1, "GCTaskTimeStampEntries");
 
@@ -2809,8 +2809,8 @@
         describe_range_error(errcode);
         return JNI_EINVAL;
       }
-      FLAG_SET_CMDLINE(uintx, MaxNewSize, (uintx)long_initial_young_size);
-      FLAG_SET_CMDLINE(uintx, NewSize, (uintx)long_initial_young_size);
+      FLAG_SET_CMDLINE(size_t, MaxNewSize, (size_t)long_initial_young_size);
+      FLAG_SET_CMDLINE(size_t, NewSize, (size_t)long_initial_young_size);
     // -Xms
     } else if (match_option(option, "-Xms", &tail)) {
       julong long_initial_heap_size = 0;
@@ -2822,10 +2822,10 @@
         describe_range_error(errcode);
         return JNI_EINVAL;
       }
-      set_min_heap_size((uintx)long_initial_heap_size);
+      set_min_heap_size((size_t)long_initial_heap_size);
       // Currently the minimum size and the initial heap sizes are the same.
       // Can be overridden with -XX:InitialHeapSize.
-      FLAG_SET_CMDLINE(uintx, InitialHeapSize, (uintx)long_initial_heap_size);
+      FLAG_SET_CMDLINE(size_t, InitialHeapSize, (size_t)long_initial_heap_size);
     // -Xmx
     } else if (match_option(option, "-Xmx", &tail) || match_option(option, "-XX:MaxHeapSize=", &tail)) {
       julong long_max_heap_size = 0;
@@ -2836,7 +2836,7 @@
         describe_range_error(errcode);
         return JNI_EINVAL;
       }
-      FLAG_SET_CMDLINE(uintx, MaxHeapSize, (uintx)long_max_heap_size);
+      FLAG_SET_CMDLINE(size_t, MaxHeapSize, (size_t)long_max_heap_size);
     // Xmaxf
     } else if (match_option(option, "-Xmaxf", &tail)) {
       char* err;
@@ -2977,7 +2977,7 @@
       FLAG_SET_CMDLINE(bool, BackgroundCompilation, false);
       FLAG_SET_CMDLINE(intx, DeferThrSuspendLoopCount, 1);
       FLAG_SET_CMDLINE(bool, UseTLAB, false);
-      FLAG_SET_CMDLINE(uintx, NewSizeThreadIncrease, 16 * K);  // 20Kb per thread added to new generation
+      FLAG_SET_CMDLINE(size_t, NewSizeThreadIncrease, 16 * K);  // 20Kb per thread added to new generation
 
       // -Xinternalversion
     } else if (match_option(option, "-Xinternalversion")) {
@@ -3138,16 +3138,16 @@
       initHeapSize = limit_by_allocatable_memory(initHeapSize);
 
       if (FLAG_IS_DEFAULT(MaxHeapSize)) {
-         FLAG_SET_CMDLINE(uintx, MaxHeapSize, initHeapSize);
-         FLAG_SET_CMDLINE(uintx, InitialHeapSize, initHeapSize);
+         FLAG_SET_CMDLINE(size_t, MaxHeapSize, initHeapSize);
+         FLAG_SET_CMDLINE(size_t, InitialHeapSize, initHeapSize);
          // Currently the minimum size and the initial heap sizes are the same.
          set_min_heap_size(initHeapSize);
       }
       if (FLAG_IS_DEFAULT(NewSize)) {
          // Make the young generation 3/8ths of the total heap.
-         FLAG_SET_CMDLINE(uintx, NewSize,
+         FLAG_SET_CMDLINE(size_t, NewSize,
                                 ((julong)MaxHeapSize / (julong)8) * (julong)3);
-         FLAG_SET_CMDLINE(uintx, MaxNewSize, NewSize);
+         FLAG_SET_CMDLINE(size_t, MaxNewSize, NewSize);
       }
 
 #ifndef _ALLBSD_SOURCE  // UseLargePages is not yet supported on BSD.
@@ -3155,14 +3155,14 @@
 #endif
 
       // Increase some data structure sizes for efficiency
-      FLAG_SET_CMDLINE(uintx, BaseFootPrintEstimate, MaxHeapSize);
+      FLAG_SET_CMDLINE(size_t, BaseFootPrintEstimate, MaxHeapSize);
       FLAG_SET_CMDLINE(bool, ResizeTLAB, false);
-      FLAG_SET_CMDLINE(uintx, TLABSize, 256*K);
+      FLAG_SET_CMDLINE(size_t, TLABSize, 256*K);
 
       // See the OldPLABSize comment below, but replace 'after promotion'
       // with 'after copying'.  YoungPLABSize is the size of the survivor
       // space per-gc-thread buffers.  The default is 4kw.
-      FLAG_SET_CMDLINE(uintx, YoungPLABSize, 256*K);      // Note: this is in words
+      FLAG_SET_CMDLINE(size_t, YoungPLABSize, 256*K);      // Note: this is in words
 
       // OldPLABSize is the size of the buffers in the old gen that
       // UseParallelGC uses to promote live data that doesn't fit in the
@@ -3177,7 +3177,7 @@
       // locality.  A minor effect may be that larger PLABs reduce the
       // number of PLAB allocation events during gc.  The value of 8kw
       // was arrived at by experimenting with specjbb.
-      FLAG_SET_CMDLINE(uintx, OldPLABSize, 8*K);  // Note: this is in words
+      FLAG_SET_CMDLINE(size_t, OldPLABSize, 8*K);  // Note: this is in words
 
       // Enable parallel GC and adaptive generation sizing
       FLAG_SET_CMDLINE(bool, UseParallelGC, true);
@@ -3256,7 +3256,7 @@
       jio_fprintf(defaultStream::error_stream(),
         "Please use -XX:MarkStackSize in place of "
         "-XX:CMSMarkStackSize or -XX:G1MarkStackSize in the future\n");
-      FLAG_SET_CMDLINE(uintx, MarkStackSize, stack_size);
+      FLAG_SET_CMDLINE(size_t, MarkStackSize, stack_size);
     } else if (match_option(option, "-XX:CMSMarkStackSizeMax=", &tail)) {
       julong max_stack_size = 0;
       ArgsRange errcode = parse_memory_size(tail, &max_stack_size, 1);
@@ -3270,7 +3270,7 @@
       jio_fprintf(defaultStream::error_stream(),
          "Please use -XX:MarkStackSizeMax in place of "
          "-XX:CMSMarkStackSizeMax in the future\n");
-      FLAG_SET_CMDLINE(uintx, MarkStackSizeMax, max_stack_size);
+      FLAG_SET_CMDLINE(size_t, MarkStackSizeMax, max_stack_size);
     } else if (match_option(option, "-XX:ParallelMarkingThreads=", &tail) ||
                match_option(option, "-XX:ParallelCMSThreads=", &tail)) {
       uintx conc_threads = 0;
@@ -3293,7 +3293,7 @@
         describe_range_error(errcode);
         return JNI_EINVAL;
       }
-      FLAG_SET_CMDLINE(uintx, MaxDirectMemorySize, max_direct_memory_size);
+      FLAG_SET_CMDLINE(size_t, MaxDirectMemorySize, max_direct_memory_size);
 #if !INCLUDE_MANAGEMENT
     } else if (match_option(option, "-XX:+ManagementServer")) {
         jio_fprintf(defaultStream::error_stream(),
@@ -3900,7 +3900,7 @@
   set_shared_spaces_flags();
 
   // Check the GC selections again.
-  if (!ArgumentsExt::check_gc_consistency_ergo()) {
+  if (!check_gc_consistency()) {
     return JNI_EINVAL;
   }
 
diff --git a/hotspot/src/share/vm/runtime/arguments.hpp b/hotspot/src/share/vm/runtime/arguments.hpp
index 44831dc..99ecdd0 100644
--- a/hotspot/src/share/vm/runtime/arguments.hpp
+++ b/hotspot/src/share/vm/runtime/arguments.hpp
@@ -477,8 +477,7 @@
   static bool verify_MaxHeapFreeRatio(FormatBuffer<80>& err_msg, uintx max_heap_free_ratio);
 
   // Check for consistency in the selection of the garbage collector.
-  static bool check_gc_consistency_user();        // Check user-selected gc
-  static inline bool check_gc_consistency_ergo(); // Check ergonomic-selected gc
+  static bool check_gc_consistency();        // Check user-selected gc
   static void check_deprecated_gc_flags();
   // Check consistency or otherwise of VM argument settings
   static bool check_vm_args_consistency();
@@ -531,8 +530,8 @@
   static bool has_profile()                 { return _has_profile; }
 
   // -Xms
-  static uintx min_heap_size()              { return _min_heap_size; }
-  static void  set_min_heap_size(uintx v)   { _min_heap_size = v;  }
+  static size_t min_heap_size()             { return _min_heap_size; }
+  static void  set_min_heap_size(size_t v)  { _min_heap_size = v;  }
 
   // Returns the original values of -XX:MinHeapFreeRatio and -XX:MaxHeapFreeRatio
   static uintx min_heap_free_ratio()        { return _min_heap_free_ratio; }
@@ -618,10 +617,6 @@
   return UseConcMarkSweepGC || UseG1GC || UseParallelGC || UseParallelOldGC || UseSerialGC;
 }
 
-bool Arguments::check_gc_consistency_ergo() {
-  return check_gc_consistency_user();
-}
-
 // Disable options not supported in this release, with a warning if they
 // were explicitly requested on the command-line
 #define UNSUPPORTED_OPTION(opt, description)                    \
diff --git a/hotspot/src/share/vm/runtime/arguments_ext.hpp b/hotspot/src/share/vm/runtime/arguments_ext.hpp
index 9c716bc..a43a4b9 100644
--- a/hotspot/src/share/vm/runtime/arguments_ext.hpp
+++ b/hotspot/src/share/vm/runtime/arguments_ext.hpp
@@ -30,9 +30,7 @@
 
 class ArgumentsExt: AllStatic {
 public:
-  static inline void select_gc_ergonomically();
   static inline void set_gc_specific_flags();
-  static inline bool check_gc_consistency_ergo();
   // The argument processing extension. Returns true if there is
   // no additional parsing needed in Arguments::parse() for the option.
   // Otherwise returns false.
@@ -40,16 +38,8 @@
   static inline void report_unsupported_options() { }
 };
 
-void ArgumentsExt::select_gc_ergonomically() {
-  Arguments::select_gc_ergonomically();
-}
-
 void ArgumentsExt::set_gc_specific_flags() {
   Arguments::set_gc_specific_flags();
 }
 
-bool ArgumentsExt::check_gc_consistency_ergo() {
-  return Arguments::check_gc_consistency_ergo();
-}
-
 #endif // SHARE_VM_RUNTIME_ARGUMENTS_EXT_HPP
diff --git a/hotspot/src/share/vm/runtime/globals.hpp b/hotspot/src/share/vm/runtime/globals.hpp
index 62a21a8..51a85a0 100644
--- a/hotspot/src/share/vm/runtime/globals.hpp
+++ b/hotspot/src/share/vm/runtime/globals.hpp
@@ -193,19 +193,19 @@
 define_pd_global(intx, OnStackReplacePercentage,     0);
 define_pd_global(bool, ResizeTLAB,                   false);
 define_pd_global(intx, FreqInlineSize,               0);
-define_pd_global(intx, NewSizeThreadIncrease,        4*K);
+define_pd_global(size_t, NewSizeThreadIncrease,      4*K);
 define_pd_global(intx, InlineClassNatives,           true);
 define_pd_global(intx, InlineUnsafeOps,              true);
 define_pd_global(intx, InitialCodeCacheSize,         160*K);
 define_pd_global(intx, ReservedCodeCacheSize,        32*M);
 define_pd_global(intx, NonProfiledCodeHeapSize,      0);
 define_pd_global(intx, ProfiledCodeHeapSize,         0);
-define_pd_global(intx, NonNMethodCodeHeapSize,        32*M);
+define_pd_global(intx, NonNMethodCodeHeapSize,       32*M);
 
 define_pd_global(intx, CodeCacheExpansionSize,       32*K);
 define_pd_global(intx, CodeCacheMinBlockLength,      1);
 define_pd_global(intx, CodeCacheMinimumUseSpace,     200*K);
-define_pd_global(uintx,MetaspaceSize,    ScaleForWordSize(4*M));
+define_pd_global(size_t, MetaspaceSize,              ScaleForWordSize(4*M));
 define_pd_global(bool, NeverActAsServerClassMachine, true);
 define_pd_global(uint64_t,MaxRAM,                    1ULL*G);
 #define CI_COMPILER_COUNT 0
@@ -468,7 +468,7 @@
 // notproduct flags are settable / visible only during development and are not declared in the PRODUCT version
 
 // A flag must be declared with one of the following types:
-// bool, intx, uintx, ccstr, double, or uint64_t.
+// bool, intx, uintx, size_t, ccstr, double, or uint64_t.
 // The type "ccstr" is an alias for "const char*" and is used
 // only in this file, because the macrology requires single-token type names.
 
@@ -540,7 +540,7 @@
   notproduct(bool, CheckCompressedOops, true,                               \
           "Generate checks in encoding/decoding code in debug VM")          \
                                                                             \
-  product_pd(uintx, HeapBaseMinAddress,                                     \
+  product_pd(size_t, HeapBaseMinAddress,                                    \
           "OS specific low limit for heap base address")                    \
                                                                             \
   product(uintx, HeapSearchSteps, 3 PPC64_ONLY(+17),                        \
@@ -606,7 +606,7 @@
   product(bool, UseNUMAInterleaving, false,                                 \
           "Interleave memory across NUMA nodes if available")               \
                                                                             \
-  product(uintx, NUMAInterleaveGranularity, 2*M,                            \
+  product(size_t, NUMAInterleaveGranularity, 2*M,                           \
           "Granularity to use for NUMA interleaving on Windows OS")         \
                                                                             \
   product(bool, ForceNUMA, false,                                           \
@@ -617,7 +617,7 @@
           "computing exponentially decaying average for "                   \
           "AdaptiveNUMAChunkSizing")                                        \
                                                                             \
-  product(uintx, NUMASpaceResizeRate, 1*G,                                  \
+  product(size_t, NUMASpaceResizeRate, 1*G,                                 \
           "Do not reallocate more than this amount per collection")         \
                                                                             \
   product(bool, UseAdaptiveNUMAChunkSizing, true,                           \
@@ -641,10 +641,10 @@
   product(bool, UseSHA, false,                                              \
           "Control whether SHA instructions can be used on SPARC")          \
                                                                             \
-  product(uintx, LargePageSizeInBytes, 0,                                   \
+  product(size_t, LargePageSizeInBytes, 0,                                  \
           "Large page size (0 to let VM choose the page size)")             \
                                                                             \
-  product(uintx, LargePageHeapSizeThreshold, 128*M,                         \
+  product(size_t, LargePageHeapSizeThreshold, 128*M,                        \
           "Use large pages if maximum heap is at least this big")           \
                                                                             \
   product(bool, ForceTimeHighResolution, false,                             \
@@ -966,11 +966,11 @@
           "directory) of the dump file (defaults to java_pid<pid>.hprof "   \
           "in the working directory)")                                      \
                                                                             \
-  develop(uintx, SegmentedHeapDumpThreshold, 2*G,                           \
+  develop(size_t, SegmentedHeapDumpThreshold, 2*G,                          \
           "Generate a segmented heap dump (JAVA PROFILE 1.0.2 format) "     \
           "when the heap usage is larger than this")                        \
                                                                             \
-  develop(uintx, HeapDumpSegmentSize, 1*G,                                  \
+  develop(size_t, HeapDumpSegmentSize, 1*G,                                 \
           "Approximate segment size when generating a segmented heap dump") \
                                                                             \
   develop(bool, BreakAtWarning, false,                                      \
@@ -1468,7 +1468,7 @@
           "Force dynamic selection of the number of "                       \
           "parallel threads parallel gc will use to aid debugging")         \
                                                                             \
-  product(uintx, HeapSizePerGCThread, ScaleForWordSize(64*M),               \
+  product(size_t, HeapSizePerGCThread, ScaleForWordSize(64*M),              \
           "Size of heap (bytes) per GC thread used in calculating the "     \
           "number of GC threads")                                           \
                                                                             \
@@ -1485,10 +1485,10 @@
   product(uintx, ConcGCThreads, 0,                                          \
           "Number of threads concurrent gc will use")                       \
                                                                             \
-  product(uintx, YoungPLABSize, 4096,                                       \
+  product(size_t, YoungPLABSize, 4096,                                      \
           "Size of young gen promotion LAB's (in HeapWords)")               \
                                                                             \
-  product(uintx, OldPLABSize, 1024,                                         \
+  product(size_t, OldPLABSize, 1024,                                        \
           "Size of old gen promotion LAB's (in HeapWords), or Number        \
           of blocks to attempt to claim when refilling CMS LAB's")          \
                                                                             \
@@ -1607,11 +1607,11 @@
   product(bool, PrintOldPLAB, false,                                        \
           "Print (old gen) promotion LAB's sizing decisions")               \
                                                                             \
-  product(uintx, CMSOldPLABMin, 16,                                         \
+  product(size_t, CMSOldPLABMin, 16,                                        \
           "Minimum size of CMS gen promotion LAB caches per worker "        \
           "per block size")                                                 \
                                                                             \
-  product(uintx, CMSOldPLABMax, 1024,                                       \
+  product(size_t, CMSOldPLABMax, 1024,                                      \
           "Maximum size of CMS gen promotion LAB caches per worker "        \
           "per block size")                                                 \
                                                                             \
@@ -1634,7 +1634,7 @@
   product(bool, AlwaysPreTouch, false,                                      \
           "Force all freshly committed pages to be pre-touched")            \
                                                                             \
-  product_pd(uintx, CMSYoungGenPerWorker,                                   \
+  product_pd(size_t, CMSYoungGenPerWorker,                                  \
           "The maximum size of young gen chosen by default per GC worker "  \
           "thread available")                                               \
                                                                             \
@@ -1726,10 +1726,10 @@
   develop(bool, CMSOverflowEarlyRestoration, false,                         \
           "Restore preserved marks early")                                  \
                                                                             \
-  product(uintx, MarkStackSize, NOT_LP64(32*K) LP64_ONLY(4*M),              \
+  product(size_t, MarkStackSize, NOT_LP64(32*K) LP64_ONLY(4*M),             \
           "Size of marking stack")                                          \
                                                                             \
-  product(uintx, MarkStackSizeMax, NOT_LP64(4*M) LP64_ONLY(512*M),          \
+  product(size_t, MarkStackSizeMax, NOT_LP64(4*M) LP64_ONLY(512*M),         \
           "Maximum size of marking stack")                                  \
                                                                             \
   notproduct(bool, CMSMarkStackOverflowALot, false,                         \
@@ -1752,10 +1752,10 @@
           "Time that we sleep between iterations when not given "           \
           "enough work per iteration")                                      \
                                                                             \
-  product(uintx, CMSRescanMultiple, 32,                                     \
+  product(size_t, CMSRescanMultiple, 32,                                    \
           "Size (in cards) of CMS parallel rescan task")                    \
                                                                             \
-  product(uintx, CMSConcMarkMultiple, 32,                                   \
+  product(size_t, CMSConcMarkMultiple, 32,                                  \
           "Size (in cards) of CMS concurrent MT marking task")              \
                                                                             \
   product(bool, CMSAbortSemantics, false,                                   \
@@ -1822,7 +1822,7 @@
   product(uintx, CMSRemarkVerifyVariant, 1,                                 \
           "Choose variant (1,2) of verification following remark")          \
                                                                             \
-  product(uintx, CMSScheduleRemarkEdenSizeThreshold, 2*M,                   \
+  product(size_t, CMSScheduleRemarkEdenSizeThreshold, 2*M,                  \
           "If Eden size is below this, do not try to schedule remark")      \
                                                                             \
   product(uintx, CMSScheduleRemarkEdenPenetration, 50,                      \
@@ -1856,7 +1856,7 @@
   product(bool, CMSYield, true,                                             \
           "Yield between steps of CMS")                                     \
                                                                             \
-  product(uintx, CMSBitMapYieldQuantum, 10*M,                               \
+  product(size_t, CMSBitMapYieldQuantum, 10*M,                              \
           "Bitmap operations should process at most this many bits "        \
           "between yields")                                                 \
                                                                             \
@@ -2036,7 +2036,7 @@
   product_pd(uint64_t, MaxRAM,                                              \
           "Real memory size (in bytes) used to set maximum heap size")      \
                                                                             \
-  product(uintx, ErgoHeapSizeLimit, 0,                                      \
+  product(size_t, ErgoHeapSizeLimit, 0,                                     \
           "Maximum ergonomically set heap size (in bytes); zero means use " \
           "MaxRAM / MaxRAMFraction")                                        \
                                                                             \
@@ -2179,7 +2179,7 @@
   product(uintx, InitialSurvivorRatio, 8,                                   \
           "Initial ratio of young generation/survivor space size")          \
                                                                             \
-  product(uintx, BaseFootPrintEstimate, 256*M,                              \
+  product(size_t, BaseFootPrintEstimate, 256*M,                             \
           "Estimate of footprint other than Java Heap")                     \
                                                                             \
   product(bool, UseGCOverheadLimit, true,                                   \
@@ -2330,7 +2330,7 @@
   develop(bool, TraceClassLoaderData, false,                                \
           "Trace class loader loader_data lifetime")                        \
                                                                             \
-  product(uintx, InitialBootClassLoaderMetaspaceSize,                       \
+  product(size_t, InitialBootClassLoaderMetaspaceSize,                      \
           NOT_LP64(2200*K) LP64_ONLY(4*M),                                  \
           "Initial size of the boot class loader data metaspace")           \
                                                                             \
@@ -2420,7 +2420,7 @@
           "Number of gclog files in rotation "                              \
           "(default: 0, no rotation)")                                      \
                                                                             \
-  product(uintx, GCLogFileSize, 8*K,                                        \
+  product(size_t, GCLogFileSize, 8*K,                                       \
           "GC log file size, requires UseGCLogFileRotation. "               \
           "Set to 0 to only trigger rotation via jcmd")                     \
                                                                             \
@@ -2958,11 +2958,11 @@
   notproduct(ccstrlist, SuppressErrorAt, "",                                \
           "List of assertions (file:line) to muzzle")                       \
                                                                             \
-  notproduct(uintx, HandleAllocationLimit, 1024,                            \
+  notproduct(size_t, HandleAllocationLimit, 1024,                           \
           "Threshold for HandleMark allocation when +TraceHandleAllocation "\
           "is used")                                                        \
                                                                             \
-  develop(uintx, TotalHandleAllocationLimit, 1024,                          \
+  develop(size_t, TotalHandleAllocationLimit, 1024,                         \
           "Threshold for total handle allocation when "                     \
           "+TraceHandleAllocation is used")                                 \
                                                                             \
@@ -3106,30 +3106,30 @@
           "Number of times to spin wait before inflation")                  \
                                                                             \
   /* gc parameters */                                                       \
-  product(uintx, InitialHeapSize, 0,                                        \
+  product(size_t, InitialHeapSize, 0,                                       \
           "Initial heap size (in bytes); zero means use ergonomics")        \
                                                                             \
-  product(uintx, MaxHeapSize, ScaleForWordSize(96*M),                       \
+  product(size_t, MaxHeapSize, ScaleForWordSize(96*M),                      \
           "Maximum heap size (in bytes)")                                   \
                                                                             \
-  product(uintx, OldSize, ScaleForWordSize(4*M),                            \
+  product(size_t, OldSize, ScaleForWordSize(4*M),                           \
           "Initial tenured generation size (in bytes)")                     \
                                                                             \
-  product(uintx, NewSize, ScaleForWordSize(1*M),                            \
+  product(size_t, NewSize, ScaleForWordSize(1*M),                           \
           "Initial new generation size (in bytes)")                         \
                                                                             \
-  product(uintx, MaxNewSize, max_uintx,                                     \
+  product(size_t, MaxNewSize, max_uintx,                                    \
           "Maximum new generation size (in bytes), max_uintx means set "    \
           "ergonomically")                                                  \
                                                                             \
-  product(uintx, PretenureSizeThreshold, 0,                                 \
+  product(size_t, PretenureSizeThreshold, 0,                                \
           "Maximum size in bytes of objects allocated in DefNew "           \
           "generation; zero means no maximum")                              \
                                                                             \
-  product(uintx, TLABSize, 0,                                               \
+  product(size_t, TLABSize, 0,                                              \
           "Starting TLAB size (in bytes); zero means set ergonomically")    \
                                                                             \
-  product(uintx, MinTLABSize, 2*K,                                          \
+  product(size_t, MinTLABSize, 2*K,                                         \
           "Minimum allowed TLAB size (in bytes)")                           \
                                                                             \
   product(uintx, TLABAllocationWeight, 35,                                  \
@@ -3150,17 +3150,17 @@
   product(uintx, NewRatio, 2,                                               \
           "Ratio of old/new generation sizes")                              \
                                                                             \
-  product_pd(uintx, NewSizeThreadIncrease,                                  \
+  product_pd(size_t, NewSizeThreadIncrease,                                 \
           "Additional size added to desired new generation size per "       \
           "non-daemon thread (in bytes)")                                   \
                                                                             \
-  product_pd(uintx, MetaspaceSize,                                          \
+  product_pd(size_t, MetaspaceSize,                                         \
           "Initial size of Metaspaces (in bytes)")                          \
                                                                             \
-  product(uintx, MaxMetaspaceSize, max_uintx,                               \
+  product(size_t, MaxMetaspaceSize, max_uintx,                              \
           "Maximum size of Metaspaces (in bytes)")                          \
                                                                             \
-  product(uintx, CompressedClassSpaceSize, 1*G,                             \
+  product(size_t, CompressedClassSpaceSize, 1*G,                            \
           "Maximum size of class area in Metaspace when compressed "        \
           "class pointers are used")                                        \
                                                                             \
@@ -3177,10 +3177,10 @@
   product(intx, SoftRefLRUPolicyMSPerMB, 1000,                              \
           "Number of milliseconds per MB of free space in the heap")        \
                                                                             \
-  product(uintx, MinHeapDeltaBytes, ScaleForWordSize(128*K),                \
+  product(size_t, MinHeapDeltaBytes, ScaleForWordSize(128*K),               \
           "The minimum change in heap space due to GC (in bytes)")          \
                                                                             \
-  product(uintx, MinMetaspaceExpansion, ScaleForWordSize(256*K),            \
+  product(size_t, MinMetaspaceExpansion, ScaleForWordSize(256*K),           \
           "The minimum expansion of Metaspace (in bytes)")                  \
                                                                             \
   product(uintx, MinMetaspaceFreeRatio,    40,                              \
@@ -3191,7 +3191,7 @@
           "The maximum percentage of Metaspace free after GC to avoid "     \
           "shrinking")                                                      \
                                                                             \
-  product(uintx, MaxMetaspaceExpansion, ScaleForWordSize(4*M),              \
+  product(size_t, MaxMetaspaceExpansion, ScaleForWordSize(4*M),             \
           "The maximum expansion of Metaspace without full GC (in bytes)")  \
                                                                             \
   product(uintx, QueuedAllocationWarningCount, 0,                           \
@@ -3282,10 +3282,10 @@
   product_pd(intx, CompilerThreadStackSize,                                 \
           "Compiler Thread Stack Size (in Kbytes)")                         \
                                                                             \
-  develop_pd(uintx, JVMInvokeMethodSlack,                                   \
+  develop_pd(size_t, JVMInvokeMethodSlack,                                  \
           "Stack space (bytes) required for JVM_InvokeMethod to complete")  \
                                                                             \
-  product(uintx, ThreadSafetyMargin, 50*M,                                  \
+  product(size_t, ThreadSafetyMargin, 50*M,                                 \
           "Thread safety margin is used on fixed-stack LinuxThreads (on "   \
           "Linux/x86 only) to prevent heap-stack collision. Set to 0 to "   \
           "disable this feature")                                           \
@@ -3673,7 +3673,7 @@
                                                                             \
   /* Properties for Java libraries  */                                      \
                                                                             \
-  product(uintx, MaxDirectMemorySize, 0,                                    \
+  product(size_t, MaxDirectMemorySize, 0,                                   \
           "Maximum total size of NIO direct-buffer allocations")            \
                                                                             \
   /* Flags used for temporary code during development  */                   \
@@ -3777,10 +3777,10 @@
           "If PrintSharedArchiveAndExit is true, also print the shared "    \
           "dictionary")                                                     \
                                                                             \
-  product(uintx, SharedReadWriteSize,  NOT_LP64(12*M) LP64_ONLY(16*M),      \
+  product(size_t, SharedReadWriteSize,  NOT_LP64(12*M) LP64_ONLY(16*M),     \
           "Size of read-write space for metadata (in bytes)")               \
                                                                             \
-  product(uintx, SharedReadOnlySize,  NOT_LP64(12*M) LP64_ONLY(16*M),       \
+  product(size_t, SharedReadOnlySize,  NOT_LP64(12*M) LP64_ONLY(16*M),      \
           "Size of read-only space for metadata (in bytes)")                \
                                                                             \
   product(uintx, SharedMiscDataSize,    NOT_LP64(2*M) LP64_ONLY(4*M),       \
diff --git a/hotspot/src/share/vm/runtime/handles.cpp b/hotspot/src/share/vm/runtime/handles.cpp
index 2e00c93..a9b1dca 100644
--- a/hotspot/src/share/vm/runtime/handles.cpp
+++ b/hotspot/src/share/vm/runtime/handles.cpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -83,7 +83,7 @@
   }
 
   // The thread local handle areas should not get very large
-  if (TraceHandleAllocation && handles_visited > TotalHandleAllocationLimit) {
+  if (TraceHandleAllocation && (size_t)handles_visited > TotalHandleAllocationLimit) {
 #ifdef ASSERT
     warning("%d: Visited in HandleMark : %d",
       _nof_handlemarks, handles_visited);
diff --git a/hotspot/src/share/vm/runtime/thread.cpp b/hotspot/src/share/vm/runtime/thread.cpp
index 622fb5c..7d6596d 100644
--- a/hotspot/src/share/vm/runtime/thread.cpp
+++ b/hotspot/src/share/vm/runtime/thread.cpp
@@ -87,8 +87,9 @@
 #include "utilities/defaultStream.hpp"
 #include "utilities/dtrace.hpp"
 #include "utilities/events.hpp"
-#include "utilities/preserveException.hpp"
 #include "utilities/macros.hpp"
+#include "utilities/preserveException.hpp"
+#include "utilities/workgroup.hpp"
 #if INCLUDE_ALL_GCS
 #include "gc_implementation/concurrentMarkSweep/concurrentMarkSweepThread.hpp"
 #include "gc_implementation/g1/concurrentMarkThread.inline.hpp"
diff --git a/hotspot/src/share/vm/runtime/vmStructs.cpp b/hotspot/src/share/vm/runtime/vmStructs.cpp
index c23abe0..727d3ac 100644
--- a/hotspot/src/share/vm/runtime/vmStructs.cpp
+++ b/hotspot/src/share/vm/runtime/vmStructs.cpp
@@ -536,7 +536,7 @@
   nonstatic_field(ContiguousSpace,             _concurrent_iteration_safe_limit,              HeapWord*)                             \
   nonstatic_field(ContiguousSpace,             _saved_mark_word,                              HeapWord*)                             \
                                                                                                                                      \
-  nonstatic_field(DefNewGeneration,            _next_gen,                                     Generation*)                           \
+  nonstatic_field(DefNewGeneration,            _old_gen,                                      Generation*)                           \
   nonstatic_field(DefNewGeneration,            _tenuring_threshold,                           uint)                                  \
   nonstatic_field(DefNewGeneration,            _age_table,                                    ageTable)                              \
   nonstatic_field(DefNewGeneration,            _eden_space,                                   ContiguousSpace*)                      \
diff --git a/hotspot/src/share/vm/services/heapDumper.cpp b/hotspot/src/share/vm/services/heapDumper.cpp
index 2c5699d..2cee37a 100644
--- a/hotspot/src/share/vm/services/heapDumper.cpp
+++ b/hotspot/src/share/vm/services/heapDumper.cpp
@@ -1721,7 +1721,7 @@
   // Write the file header - use 1.0.2 for large heaps, otherwise 1.0.1
   size_t used = ch->used();
   const char* header;
-  if (used > (size_t)SegmentedHeapDumpThreshold) {
+  if (used > SegmentedHeapDumpThreshold) {
     set_segmented_dump();
     header = "JAVA PROFILE 1.0.2";
   } else {
diff --git a/hotspot/src/share/vm/services/lowMemoryDetector.hpp b/hotspot/src/share/vm/services/lowMemoryDetector.hpp
index 3dda4f1..16c306f 100644
--- a/hotspot/src/share/vm/services/lowMemoryDetector.hpp
+++ b/hotspot/src/share/vm/services/lowMemoryDetector.hpp
@@ -28,6 +28,7 @@
 #include "memory/allocation.hpp"
 #include "services/memoryPool.hpp"
 #include "services/memoryService.hpp"
+#include "services/memoryUsage.hpp"
 
 // Low Memory Detection Support
 // Two memory alarms in the JDK (we called them sensors).
diff --git a/hotspot/src/share/vm/services/memoryPool.cpp b/hotspot/src/share/vm/services/memoryPool.cpp
index 2d686cb..e9bc4d0 100644
--- a/hotspot/src/share/vm/services/memoryPool.cpp
+++ b/hotspot/src/share/vm/services/memoryPool.cpp
@@ -25,7 +25,9 @@
 #include "precompiled.hpp"
 #include "classfile/systemDictionary.hpp"
 #include "classfile/vmSymbols.hpp"
+#include "memory/defNewGeneration.hpp"
 #include "memory/metaspace.hpp"
+#include "memory/space.hpp"
 #include "oops/oop.inline.hpp"
 #include "runtime/handles.inline.hpp"
 #include "runtime/javaCalls.hpp"
@@ -34,8 +36,11 @@
 #include "services/management.hpp"
 #include "services/memoryManager.hpp"
 #include "services/memoryPool.hpp"
-#include "utilities/macros.hpp"
 #include "utilities/globalDefinitions.hpp"
+#include "utilities/macros.hpp"
+#if INCLUDE_ALL_GCS
+#include "gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.hpp"
+#endif
 
 MemoryPool::MemoryPool(const char* name,
                        PoolType type,
@@ -187,6 +192,10 @@
                       support_usage_threshold), _space(space) {
 }
 
+size_t ContiguousSpacePool::used_in_bytes() {
+  return space()->used();
+}
+
 MemoryUsage ContiguousSpacePool::get_memory_usage() {
   size_t maxSize   = (available_for_allocation() ? max_size() : 0);
   size_t used      = used_in_bytes();
@@ -204,6 +213,14 @@
                       support_usage_threshold), _gen(gen) {
 }
 
+size_t SurvivorContiguousSpacePool::used_in_bytes() {
+  return _gen->from()->used();
+}
+
+size_t SurvivorContiguousSpacePool::committed_in_bytes() {
+  return _gen->from()->capacity();
+}
+
 MemoryUsage SurvivorContiguousSpacePool::get_memory_usage() {
   size_t maxSize = (available_for_allocation() ? max_size() : 0);
   size_t used    = used_in_bytes();
@@ -222,6 +239,10 @@
                       support_usage_threshold), _space(space) {
 }
 
+size_t CompactibleFreeListSpacePool::used_in_bytes() {
+  return _space->used();
+}
+
 MemoryUsage CompactibleFreeListSpacePool::get_memory_usage() {
   size_t maxSize   = (available_for_allocation() ? max_size() : 0);
   size_t used      = used_in_bytes();
@@ -239,6 +260,10 @@
                       support_usage_threshold), _gen(gen) {
 }
 
+size_t GenerationPool::used_in_bytes() {
+  return _gen->used();
+}
+
 MemoryUsage GenerationPool::get_memory_usage() {
   size_t used      = used_in_bytes();
   size_t committed = _gen->capacity();
diff --git a/hotspot/src/share/vm/services/memoryPool.hpp b/hotspot/src/share/vm/services/memoryPool.hpp
index 007366e..f9b7a0a 100644
--- a/hotspot/src/share/vm/services/memoryPool.hpp
+++ b/hotspot/src/share/vm/services/memoryPool.hpp
@@ -25,15 +25,9 @@
 #ifndef SHARE_VM_SERVICES_MEMORYPOOL_HPP
 #define SHARE_VM_SERVICES_MEMORYPOOL_HPP
 
-#include "gc_implementation/shared/mutableSpace.hpp"
-#include "memory/defNewGeneration.hpp"
 #include "memory/heap.hpp"
-#include "memory/space.hpp"
 #include "services/memoryUsage.hpp"
 #include "utilities/macros.hpp"
-#if INCLUDE_ALL_GCS
-#include "gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.hpp"
-#endif // INCLUDE_ALL_GCS
 
 // A memory pool represents the memory area that the VM manages.
 // The Java virtual machine has at least one memory pool
@@ -43,6 +37,8 @@
 // both heap and non-heap memory.
 
 // Forward declaration
+class CompactibleFreeListSpace;
+class ContiguousSpace;
 class MemoryManager;
 class SensorInfo;
 class Generation;
@@ -162,7 +158,7 @@
 
   ContiguousSpace* space()              { return _space; }
   MemoryUsage get_memory_usage();
-  size_t used_in_bytes()                { return space()->used(); }
+  size_t used_in_bytes();
 };
 
 class SurvivorContiguousSpacePool : public CollectedMemoryPool {
@@ -178,12 +174,8 @@
 
   MemoryUsage get_memory_usage();
 
-  size_t used_in_bytes() {
-    return _gen->from()->used();
-  }
-  size_t committed_in_bytes() {
-    return _gen->from()->capacity();
-  }
+  size_t used_in_bytes();
+  size_t committed_in_bytes();
 };
 
 #if INCLUDE_ALL_GCS
@@ -198,7 +190,7 @@
                                bool support_usage_threshold);
 
   MemoryUsage get_memory_usage();
-  size_t used_in_bytes()            { return _space->used(); }
+  size_t used_in_bytes();
 };
 #endif // INCLUDE_ALL_GCS
 
@@ -210,7 +202,7 @@
   GenerationPool(Generation* gen, const char* name, PoolType type, bool support_usage_threshold);
 
   MemoryUsage get_memory_usage();
-  size_t used_in_bytes()                { return _gen->used(); }
+  size_t used_in_bytes();
 };
 
 class CodeHeapPool: public MemoryPool {
diff --git a/hotspot/src/share/vm/services/memoryService.cpp b/hotspot/src/share/vm/services/memoryService.cpp
index c2ad06e..794f462 100644
--- a/hotspot/src/share/vm/services/memoryService.cpp
+++ b/hotspot/src/share/vm/services/memoryService.cpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -160,8 +160,8 @@
   _managers_list->append(_minor_gc_manager);
   _managers_list->append(_major_gc_manager);
 
-  add_generation_memory_pool(heap->get_gen(minor), _major_gc_manager, _minor_gc_manager);
-  add_generation_memory_pool(heap->get_gen(major), _major_gc_manager);
+  add_generation_memory_pool(heap->young_gen(), _major_gc_manager, _minor_gc_manager);
+  add_generation_memory_pool(heap->old_gen(), _major_gc_manager);
 }
 
 #if INCLUDE_ALL_GCS
diff --git a/hotspot/src/share/vm/services/memoryService.hpp b/hotspot/src/share/vm/services/memoryService.hpp
index ca2210e..e24cce7 100644
--- a/hotspot/src/share/vm/services/memoryService.hpp
+++ b/hotspot/src/share/vm/services/memoryService.hpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -57,13 +57,6 @@
     init_code_heap_pools_size = 9
   };
 
-  // index for minor and major generations
-  enum {
-    minor = 0,
-    major = 1,
-    n_gens = 2
-  };
-
   static GrowableArray<MemoryPool*>*    _pools_list;
   static GrowableArray<MemoryManager*>* _managers_list;
 
diff --git a/hotspot/src/share/vm/utilities/debug.cpp b/hotspot/src/share/vm/utilities/debug.cpp
index 39a0c60..3a0c9cc 100644
--- a/hotspot/src/share/vm/utilities/debug.cpp
+++ b/hotspot/src/share/vm/utilities/debug.cpp
@@ -273,7 +273,7 @@
 }
 
 void report_insufficient_metaspace(size_t required_size) {
-  warning("\nThe MaxMetaspaceSize of " UINTX_FORMAT " bytes is not large enough.\n"
+  warning("\nThe MaxMetaspaceSize of " SIZE_FORMAT " bytes is not large enough.\n"
           "Either don't specify the -XX:MaxMetaspaceSize=<size>\n"
           "or increase the size to at least " SIZE_FORMAT ".\n",
           MaxMetaspaceSize, required_size);
diff --git a/hotspot/src/share/vm/utilities/debug.hpp b/hotspot/src/share/vm/utilities/debug.hpp
index 381cfd6..4143169 100644
--- a/hotspot/src/share/vm/utilities/debug.hpp
+++ b/hotspot/src/share/vm/utilities/debug.hpp
@@ -222,9 +222,8 @@
 template<bool x> struct STATIC_ASSERT_FAILURE;
 template<> struct STATIC_ASSERT_FAILURE<true> { enum { value = 1 }; };
 
-#define STATIC_ASSERT(Cond)                             \
-  typedef char STATIC_ASSERT_FAILURE_ ## __LINE__ [     \
-    STATIC_ASSERT_FAILURE< (Cond) >::value ]
+#define STATIC_ASSERT(Cond) \
+  typedef char STATIC_ASSERT_DUMMY_TYPE[ STATIC_ASSERT_FAILURE< (Cond) >::value ]
 
 // out of shared space reporting
 enum SharedSpaceType {
diff --git a/hotspot/src/share/vm/utilities/ostream.hpp b/hotspot/src/share/vm/utilities/ostream.hpp
index 5bf1ce4..29cc6b9 100644
--- a/hotspot/src/share/vm/utilities/ostream.hpp
+++ b/hotspot/src/share/vm/utilities/ostream.hpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -250,7 +250,7 @@
   /* If "force" sets true, force log file rotation from outside JVM */
   bool should_rotate(bool force) {
     return force ||
-             ((GCLogFileSize != 0) && ((uintx)_bytes_written >= GCLogFileSize));
+             ((GCLogFileSize != 0) && (_bytes_written >= (jlong)GCLogFileSize));
   }
 };
 
diff --git a/hotspot/test/TEST.ROOT b/hotspot/test/TEST.ROOT
index fc23ac9..c361a5d 100644
--- a/hotspot/test/TEST.ROOT
+++ b/hotspot/test/TEST.ROOT
@@ -32,5 +32,5 @@
 groups=TEST.groups [closed/TEST.groups]
 requires.properties=sun.arch.data.model
 
-# Tests using jtreg 4.1 b10 features
-requiredVersion=4.1 b10
+# Tests using jtreg 4.1 b11 features
+requiredVersion=4.1 b11
diff --git a/hotspot/test/compiler/arguments/CheckCompileThresholdScaling.java b/hotspot/test/compiler/arguments/CheckCompileThresholdScaling.java
index 9c9b94f..2c8621d 100644
--- a/hotspot/test/compiler/arguments/CheckCompileThresholdScaling.java
+++ b/hotspot/test/compiler/arguments/CheckCompileThresholdScaling.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -28,6 +28,8 @@
  * @bug 8059604
  * @summary "Add CompileThresholdScaling flag to control when methods are first compiled (with +/-TieredCompilation)"
  * @library /testlibrary
+ * @modules java.base/sun.misc
+ *          java.management
  * @run main CheckCompileThresholdScaling
  */
 
diff --git a/hotspot/test/compiler/arguments/TestUseBMI1InstructionsOnSupportedCPU.java b/hotspot/test/compiler/arguments/TestUseBMI1InstructionsOnSupportedCPU.java
index 57b324f..800aa8b 100644
--- a/hotspot/test/compiler/arguments/TestUseBMI1InstructionsOnSupportedCPU.java
+++ b/hotspot/test/compiler/arguments/TestUseBMI1InstructionsOnSupportedCPU.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -27,6 +27,8 @@
  * @summary Verify processing of UseBMI1Instructions option on CPU with
  *          BMI1 feature support.
  * @library /testlibrary /../../test/lib
+ * @modules java.base/sun.misc
+ *          java.management
  * @build TestUseBMI1InstructionsOnSupportedCPU
  *        BMISupportedCPUTest
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
diff --git a/hotspot/test/compiler/arguments/TestUseBMI1InstructionsOnUnsupportedCPU.java b/hotspot/test/compiler/arguments/TestUseBMI1InstructionsOnUnsupportedCPU.java
index 06dbd19..81aa36a 100644
--- a/hotspot/test/compiler/arguments/TestUseBMI1InstructionsOnUnsupportedCPU.java
+++ b/hotspot/test/compiler/arguments/TestUseBMI1InstructionsOnUnsupportedCPU.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -27,6 +27,8 @@
  * @summary Verify processing of UseBMI1Instructions option on CPU without
  *          BMI1 feature support.
  * @library /testlibrary /../../test/lib
+ * @modules java.base/sun.misc
+ *          java.management
  * @build TestUseBMI1InstructionsOnUnsupportedCPU
  *        BMIUnsupportedCPUTest
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
diff --git a/hotspot/test/compiler/arguments/TestUseCountLeadingZerosInstructionOnSupportedCPU.java b/hotspot/test/compiler/arguments/TestUseCountLeadingZerosInstructionOnSupportedCPU.java
index 200e6bf..bfbadaf6 100644
--- a/hotspot/test/compiler/arguments/TestUseCountLeadingZerosInstructionOnSupportedCPU.java
+++ b/hotspot/test/compiler/arguments/TestUseCountLeadingZerosInstructionOnSupportedCPU.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -27,6 +27,8 @@
  * @summary Verify processing of UseCountLeadingZerosInstruction option
  *          on CPU with LZCNT support.
  * @library /testlibrary /../../test/lib
+ * @modules java.base/sun.misc
+ *          java.management
  * @build TestUseCountLeadingZerosInstructionOnSupportedCPU
  *        BMISupportedCPUTest
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
diff --git a/hotspot/test/compiler/arguments/TestUseCountLeadingZerosInstructionOnUnsupportedCPU.java b/hotspot/test/compiler/arguments/TestUseCountLeadingZerosInstructionOnUnsupportedCPU.java
index 74e6f62..6414986 100644
--- a/hotspot/test/compiler/arguments/TestUseCountLeadingZerosInstructionOnUnsupportedCPU.java
+++ b/hotspot/test/compiler/arguments/TestUseCountLeadingZerosInstructionOnUnsupportedCPU.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -27,6 +27,8 @@
  * @summary Verify processing of UseCountLeadingZerosInstruction option
  *          on CPU without LZCNT support.
  * @library /testlibrary /../../test/lib
+ * @modules java.base/sun.misc
+ *          java.management
  * @build TestUseCountLeadingZerosInstructionOnUnsupportedCPU
  *        BMIUnsupportedCPUTest
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
diff --git a/hotspot/test/compiler/arguments/TestUseCountTrailingZerosInstructionOnSupportedCPU.java b/hotspot/test/compiler/arguments/TestUseCountTrailingZerosInstructionOnSupportedCPU.java
index aadd318..0286b9e 100644
--- a/hotspot/test/compiler/arguments/TestUseCountTrailingZerosInstructionOnSupportedCPU.java
+++ b/hotspot/test/compiler/arguments/TestUseCountTrailingZerosInstructionOnSupportedCPU.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -27,6 +27,8 @@
  * @summary Verify processing of UseCountTrailingZerosInstruction option
  *          on CPU with TZCNT (BMI1 feature) support.
  * @library /testlibrary /../../test/lib
+ * @modules java.base/sun.misc
+ *          java.management
  * @build TestUseCountTrailingZerosInstructionOnSupportedCPU
  *        BMISupportedCPUTest
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
diff --git a/hotspot/test/compiler/arguments/TestUseCountTrailingZerosInstructionOnUnsupportedCPU.java b/hotspot/test/compiler/arguments/TestUseCountTrailingZerosInstructionOnUnsupportedCPU.java
index 6848389..be3d746 100644
--- a/hotspot/test/compiler/arguments/TestUseCountTrailingZerosInstructionOnUnsupportedCPU.java
+++ b/hotspot/test/compiler/arguments/TestUseCountTrailingZerosInstructionOnUnsupportedCPU.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -27,6 +27,8 @@
  * @summary Verify processing of UseCountTrailingZerosInstruction option
  *          on CPU without TZCNT instruction (BMI1 feature) support.
  * @library /testlibrary /../../test/lib
+ * @modules java.base/sun.misc
+ *          java.management
  * @build TestUseCountTrailingZerosInstructionOnUnsupportedCPU
  *        BMIUnsupportedCPUTest
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
diff --git a/hotspot/test/compiler/arraycopy/TestArrayCopyNoInitDeopt.java b/hotspot/test/compiler/arraycopy/TestArrayCopyNoInitDeopt.java
index 26ebd39..c72ff09 100644
--- a/hotspot/test/compiler/arraycopy/TestArrayCopyNoInitDeopt.java
+++ b/hotspot/test/compiler/arraycopy/TestArrayCopyNoInitDeopt.java
@@ -26,6 +26,8 @@
  * @bug 8072016
  * @summary Infinite deoptimization/recompilation cycles in case of arraycopy with tightly coupled allocation
  * @library /testlibrary /../../test/lib /compiler/whitebox
+ * @modules java.base/sun.misc
+ *          java.management
  * @build TestArrayCopyNoInitDeopt
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  * @run main ClassFileInstaller com.oracle.java.testlibrary.Platform
diff --git a/hotspot/test/compiler/c1/6932496/Test6932496.java b/hotspot/test/compiler/c1/6932496/Test6932496.java
index 7f3c169..3b75dd7 100644
--- a/hotspot/test/compiler/c1/6932496/Test6932496.java
+++ b/hotspot/test/compiler/c1/6932496/Test6932496.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,6 +26,7 @@
  * @test
  * @bug 6932496
  * @summary incorrect deopt of jsr subroutine on 64 bit c1
+ * @modules java.base/jdk.internal.org.objectweb.asm
  * @run main/othervm -Xcomp -XX:CompileOnly=Test.test Test6932496
  */
 import java.lang.reflect.Method;
diff --git a/hotspot/test/compiler/c2/6589834/Test_ia32.java b/hotspot/test/compiler/c2/6589834/Test_ia32.java
index 193ca35..e7942f7 100644
--- a/hotspot/test/compiler/c2/6589834/Test_ia32.java
+++ b/hotspot/test/compiler/c2/6589834/Test_ia32.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 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
@@ -27,6 +27,10 @@
  * @summary Safepoint placed between stack pointer increment and decrement leads
  *          to interpreter's stack corruption after deoptimization.
  * @library /testlibrary /../../test/lib
+ * @modules java.base/sun.misc
+ *          java.compiler
+ *          java.management
+ *          jdk.jvmstat/sun.jvmstat.monitor
  * @build ClassFileInstaller sun.hotspot.WhiteBox com.oracle.java.testlibrary.*
  *        Test_ia32 InlinedArrayCloneTestCase
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
diff --git a/hotspot/test/compiler/c2/6852078/Test6852078.java b/hotspot/test/compiler/c2/6852078/Test6852078.java
index 6c3cecc..274c20b 100644
--- a/hotspot/test/compiler/c2/6852078/Test6852078.java
+++ b/hotspot/test/compiler/c2/6852078/Test6852078.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 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
@@ -27,6 +27,8 @@
  * @bug 6852078
  * @summary Disable SuperWord optimization for unsafe read/write
  *
+ * @modules java.corba/com.sun.corba.se.impl.encoding
+ *          java.corba/com.sun.jndi.toolkit.corba
  * @run main Test6852078
  */
 
diff --git a/hotspot/test/compiler/c2/6857159/Test6857159.java b/hotspot/test/compiler/c2/6857159/Test6857159.java
index c0a0349..8be3319 100644
--- a/hotspot/test/compiler/c2/6857159/Test6857159.java
+++ b/hotspot/test/compiler/c2/6857159/Test6857159.java
@@ -27,6 +27,8 @@
  * @bug 6857159
  * @summary local schedule failed with checkcast of Thread.currentThread()
  * @library /testlibrary
+ * @modules java.base/sun.misc
+ *          java.management
  */
 
 import com.oracle.java.testlibrary.*;
diff --git a/hotspot/test/compiler/c2/6968348/Test6968348.java b/hotspot/test/compiler/c2/6968348/Test6968348.java
index 14568d7..c1af273 100644
--- a/hotspot/test/compiler/c2/6968348/Test6968348.java
+++ b/hotspot/test/compiler/c2/6968348/Test6968348.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -27,6 +27,7 @@
  * @bug 6968348
  * @summary Byteswapped memory access can point to wrong location after JIT
  *
+ * @modules java.base/sun.misc
  * @run main Test6968348
  */
 
diff --git a/hotspot/test/compiler/c2/7047069/Test7047069.java b/hotspot/test/compiler/c2/7047069/Test7047069.java
index 5229d62..fcfee8c 100644
--- a/hotspot/test/compiler/c2/7047069/Test7047069.java
+++ b/hotspot/test/compiler/c2/7047069/Test7047069.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -27,6 +27,7 @@
  * @bug 7047069
  * @summary Array can dynamically change size when assigned to an object field
  *
+ * @modules java.desktop
  * @run main/othervm -Xbatch Test7047069
  */
 
diff --git a/hotspot/test/compiler/c2/7068051/Test7068051.java b/hotspot/test/compiler/c2/7068051/Test7068051.java
index cd35feb..c98475b 100644
--- a/hotspot/test/compiler/c2/7068051/Test7068051.java
+++ b/hotspot/test/compiler/c2/7068051/Test7068051.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -28,6 +28,8 @@
  * @summary SIGSEGV in PhaseIdealLoop::build_loop_late_post on T5440
  * @library /testlibrary
  *
+ * @modules java.base/sun.misc
+ *          java.management
  * @run main/othervm -showversion -Xbatch Test7068051
  */
 
diff --git a/hotspot/test/compiler/c2/7190310/Test7190310_unsafe.java b/hotspot/test/compiler/c2/7190310/Test7190310_unsafe.java
index 3f97f28..d9881d6 100644
--- a/hotspot/test/compiler/c2/7190310/Test7190310_unsafe.java
+++ b/hotspot/test/compiler/c2/7190310/Test7190310_unsafe.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 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
@@ -26,6 +26,7 @@
  * @test
  * @bug 7190310
  * @summary Inlining WeakReference.get(), and hoisting $referent may lead to non-terminating loops
+ * @modules java.base/sun.misc
  * @run main/othervm -Xbatch Test7190310_unsafe
  */
 
diff --git a/hotspot/test/compiler/c2/8004867/TestIntUnsafeCAS.java b/hotspot/test/compiler/c2/8004867/TestIntUnsafeCAS.java
index 9489376..0eb5000 100644
--- a/hotspot/test/compiler/c2/8004867/TestIntUnsafeCAS.java
+++ b/hotspot/test/compiler/c2/8004867/TestIntUnsafeCAS.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -27,6 +27,7 @@
  * @bug 8004867
  * @summary VM crashing with assert "share/vm/opto/node.hpp:357 - assert(i < _max) failed: oob"
  *
+ * @modules java.base/sun.misc
  * @run main/othervm/timeout=300 -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:-TieredCompilation -XX:-OptimizeFill TestIntUnsafeCAS
  * @run main/othervm/timeout=300 -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:-TieredCompilation -XX:+OptimizeFill TestIntUnsafeCAS
  */
diff --git a/hotspot/test/compiler/c2/8004867/TestIntUnsafeOrdered.java b/hotspot/test/compiler/c2/8004867/TestIntUnsafeOrdered.java
index 6588d63..ef932a1 100644
--- a/hotspot/test/compiler/c2/8004867/TestIntUnsafeOrdered.java
+++ b/hotspot/test/compiler/c2/8004867/TestIntUnsafeOrdered.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -27,6 +27,7 @@
  * @bug 8004867
  * @summary VM crashing with assert "share/vm/opto/node.hpp:357 - assert(i < _max) failed: oob"
  *
+ * @modules java.base/sun.misc
  * @run main/othervm/timeout=300 -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:-TieredCompilation -XX:-OptimizeFill TestIntUnsafeOrdered
  * @run main/othervm/timeout=300 -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:-TieredCompilation -XX:+OptimizeFill TestIntUnsafeOrdered
  */
diff --git a/hotspot/test/compiler/c2/8004867/TestIntUnsafeVolatile.java b/hotspot/test/compiler/c2/8004867/TestIntUnsafeVolatile.java
index 84ecd10..dc6639d 100644
--- a/hotspot/test/compiler/c2/8004867/TestIntUnsafeVolatile.java
+++ b/hotspot/test/compiler/c2/8004867/TestIntUnsafeVolatile.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -27,6 +27,7 @@
  * @bug 8004867
  * @summary VM crashing with assert "share/vm/opto/node.hpp:357 - assert(i < _max) failed: oob"
  *
+ * @modules java.base/sun.misc
  * @run main/othervm/timeout=300 -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:-TieredCompilation -XX:-OptimizeFill TestIntUnsafeVolatile
  * @run main/othervm/timeout=300 -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:-TieredCompilation -XX:+OptimizeFill TestIntUnsafeVolatile
  */
diff --git a/hotspot/test/compiler/c2/8005956/PolynomialRoot.java b/hotspot/test/compiler/c2/8005956/PolynomialRoot.java
index 54cc8f3..4470c19 100644
--- a/hotspot/test/compiler/c2/8005956/PolynomialRoot.java
+++ b/hotspot/test/compiler/c2/8005956/PolynomialRoot.java
@@ -14,6 +14,8 @@
 * @bug 8005956
 * @summary C2: assert(!def_outside->member(r)) failed: Use of external LRG overlaps the same LRG defined in this block
 * @library /testlibrary
+* @modules java.base/sun.misc
+*          java.management
 * @run main/timeout=300 PolynomialRoot
 */
 
diff --git a/hotspot/test/compiler/classUnloading/anonymousClass/TestAnonymousClassUnloading.java b/hotspot/test/compiler/classUnloading/anonymousClass/TestAnonymousClassUnloading.java
index d6c3ed0..2db398b 100644
--- a/hotspot/test/compiler/classUnloading/anonymousClass/TestAnonymousClassUnloading.java
+++ b/hotspot/test/compiler/classUnloading/anonymousClass/TestAnonymousClassUnloading.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -34,6 +34,7 @@
  * @bug 8054402
  * @summary "Tests unloading of anonymous classes."
  * @library /testlibrary /../../test/lib
+ * @modules java.base/sun.misc
  * @compile TestAnonymousClassUnloading.java
  * @run main ClassFileInstaller TestAnonymousClassUnloading
  *                              sun.hotspot.WhiteBox
diff --git a/hotspot/test/compiler/codecache/CheckReservedInitialCodeCacheSizeArgOrder.java b/hotspot/test/compiler/codecache/CheckReservedInitialCodeCacheSizeArgOrder.java
index eea5c90..60aa443 100644
--- a/hotspot/test/compiler/codecache/CheckReservedInitialCodeCacheSizeArgOrder.java
+++ b/hotspot/test/compiler/codecache/CheckReservedInitialCodeCacheSizeArgOrder.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -28,6 +28,8 @@
  *          InitialCodeCacheSize are passed to the VM is irrelevant.
  * @library /testlibrary
  *
+ * @modules java.base/sun.misc
+ *          java.management
  */
 import com.oracle.java.testlibrary.*;
 
diff --git a/hotspot/test/compiler/codecache/CheckSegmentedCodeCache.java b/hotspot/test/compiler/codecache/CheckSegmentedCodeCache.java
index 654293b..3ae9b64 100644
--- a/hotspot/test/compiler/codecache/CheckSegmentedCodeCache.java
+++ b/hotspot/test/compiler/codecache/CheckSegmentedCodeCache.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -29,6 +29,8 @@
  * @bug 8015774
  * @library /testlibrary /../../test/lib
  * @summary "Checks VM options related to the segmented code cache"
+ * @modules java.base/sun.misc
+ *          java.management
  * @build CheckSegmentedCodeCache
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
diff --git a/hotspot/test/compiler/codecache/CheckUpperLimit.java b/hotspot/test/compiler/codecache/CheckUpperLimit.java
index e2a2705..4b42a14 100644
--- a/hotspot/test/compiler/codecache/CheckUpperLimit.java
+++ b/hotspot/test/compiler/codecache/CheckUpperLimit.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -27,6 +27,8 @@
  * @summary Test ensures that the ReservedCodeCacheSize is at most MAXINT
  * @library /testlibrary
  *
+ * @modules java.base/sun.misc
+ *          java.management
  */
 import com.oracle.java.testlibrary.*;
 
diff --git a/hotspot/test/compiler/codecache/OverflowCodeCacheTest.java b/hotspot/test/compiler/codecache/OverflowCodeCacheTest.java
index 5ee2855..a1cdf4b 100644
--- a/hotspot/test/compiler/codecache/OverflowCodeCacheTest.java
+++ b/hotspot/test/compiler/codecache/OverflowCodeCacheTest.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -35,6 +35,7 @@
  * @test OverflowCodeCacheTest
  * @bug 8059550
  * @library /testlibrary /../../test/lib
+ * @modules java.management
  * @build OverflowCodeCacheTest
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
diff --git a/hotspot/test/compiler/codecache/cli/TestSegmentedCodeCacheOption.java b/hotspot/test/compiler/codecache/cli/TestSegmentedCodeCacheOption.java
index 525327a..d5af931 100644
--- a/hotspot/test/compiler/codecache/cli/TestSegmentedCodeCacheOption.java
+++ b/hotspot/test/compiler/codecache/cli/TestSegmentedCodeCacheOption.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -31,6 +31,10 @@
  * @bug 8015774
  * @summary Verify SegmentedCodeCache option's processing
  * @library /testlibrary /../../test/lib
+ * @modules java.base/sun.misc
+ *          java.compiler
+ *          java.management
+ *          jdk.jvmstat/sun.jvmstat.monitor
  * @build TestSegmentedCodeCacheOption com.oracle.java.testlibrary.*
  * @run main TestSegmentedCodeCacheOption
  */
diff --git a/hotspot/test/compiler/codecache/cli/codeheapsize/TestCodeHeapSizeOptions.java b/hotspot/test/compiler/codecache/cli/codeheapsize/TestCodeHeapSizeOptions.java
index e125359..dfcbc0f 100644
--- a/hotspot/test/compiler/codecache/cli/codeheapsize/TestCodeHeapSizeOptions.java
+++ b/hotspot/test/compiler/codecache/cli/codeheapsize/TestCodeHeapSizeOptions.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -32,6 +32,10 @@
  * @bug 8015774
  * @summary Verify processing of options related to code heaps sizing.
  * @library /testlibrary .. /../../test/lib
+ * @modules java.base/sun.misc
+ *          java.compiler
+ *          java.management
+ *          jdk.jvmstat/sun.jvmstat.monitor
  * @build TestCodeHeapSizeOptions com.oracle.java.testlibrary.* codeheapsize.*
  *        common.*
  * @run main/timeout=240 codeheapsize.TestCodeHeapSizeOptions
diff --git a/hotspot/test/compiler/codecache/cli/printcodecache/TestPrintCodeCacheOption.java b/hotspot/test/compiler/codecache/cli/printcodecache/TestPrintCodeCacheOption.java
index ae42251..00b4431 100644
--- a/hotspot/test/compiler/codecache/cli/printcodecache/TestPrintCodeCacheOption.java
+++ b/hotspot/test/compiler/codecache/cli/printcodecache/TestPrintCodeCacheOption.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -31,6 +31,10 @@
  * @bug 8015774
  * @summary Verify that PrintCodeCache option print correct information.
  * @library /testlibrary .. /../../test/lib
+ * @modules java.base/sun.misc
+ *          java.compiler
+ *          java.management
+ *          jdk.jvmstat/sun.jvmstat.monitor
  * @build TestPrintCodeCacheOption com.oracle.java.testlibrary.*
  *        printcodecache.* common.*
  * @run main/timeout=240 printcodecache.TestPrintCodeCacheOption
diff --git a/hotspot/test/compiler/codecache/jmx/BeanTypeTest.java b/hotspot/test/compiler/codecache/jmx/BeanTypeTest.java
index 9ce162d..e31b561 100644
--- a/hotspot/test/compiler/codecache/jmx/BeanTypeTest.java
+++ b/hotspot/test/compiler/codecache/jmx/BeanTypeTest.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -28,6 +28,7 @@
 /**
  * @test BeanTypeTest
  * @library /testlibrary /../../test/lib
+ * @modules java.management
  * @build BeanTypeTest
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *     sun.hotspot.WhiteBox$WhiteBoxPermission
diff --git a/hotspot/test/compiler/codecache/jmx/CodeHeapBeanPresenceTest.java b/hotspot/test/compiler/codecache/jmx/CodeHeapBeanPresenceTest.java
index 1ebacf9..a9fb122 100644
--- a/hotspot/test/compiler/codecache/jmx/CodeHeapBeanPresenceTest.java
+++ b/hotspot/test/compiler/codecache/jmx/CodeHeapBeanPresenceTest.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -28,6 +28,7 @@
 /**
  * @test CodeHeapBeanPresenceTest
  * @library /testlibrary /../../test/lib
+ * @modules java.management
  * @build CodeHeapBeanPresenceTest
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *     sun.hotspot.WhiteBox$WhiteBoxPermission
diff --git a/hotspot/test/compiler/codecache/jmx/GetUsageTest.java b/hotspot/test/compiler/codecache/jmx/GetUsageTest.java
index 87139ab..7ce9c79 100644
--- a/hotspot/test/compiler/codecache/jmx/GetUsageTest.java
+++ b/hotspot/test/compiler/codecache/jmx/GetUsageTest.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -30,6 +30,8 @@
 /*
  * @test GetUsageTest
  * @library /testlibrary /../../test/lib
+ * @modules java.base/sun.misc
+ *          java.management
  * @build GetUsageTest
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *     sun.hotspot.WhiteBox$WhiteBoxPermission
diff --git a/hotspot/test/compiler/codecache/jmx/InitialAndMaxUsageTest.java b/hotspot/test/compiler/codecache/jmx/InitialAndMaxUsageTest.java
index eaf137b..ca4fa6e 100644
--- a/hotspot/test/compiler/codecache/jmx/InitialAndMaxUsageTest.java
+++ b/hotspot/test/compiler/codecache/jmx/InitialAndMaxUsageTest.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -30,6 +30,8 @@
 /*
  * @test InitialAndMaxUsageTest
  * @library /testlibrary /../../test/lib
+ * @modules java.base/sun.misc
+ *          java.management
  * @build InitialAndMaxUsageTest
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *     sun.hotspot.WhiteBox$WhiteBoxPermission
diff --git a/hotspot/test/compiler/codecache/jmx/ManagerNamesTest.java b/hotspot/test/compiler/codecache/jmx/ManagerNamesTest.java
index 57be84e..5d89732 100644
--- a/hotspot/test/compiler/codecache/jmx/ManagerNamesTest.java
+++ b/hotspot/test/compiler/codecache/jmx/ManagerNamesTest.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -28,6 +28,7 @@
 /**
  * @test ManagerNamesTest
  * @library /testlibrary /../../test/lib
+ * @modules java.management
  * @build ManagerNamesTest
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *     sun.hotspot.WhiteBox$WhiteBoxPermission
diff --git a/hotspot/test/compiler/codecache/jmx/MemoryPoolsPresenceTest.java b/hotspot/test/compiler/codecache/jmx/MemoryPoolsPresenceTest.java
index d850e92..b2e4683 100644
--- a/hotspot/test/compiler/codecache/jmx/MemoryPoolsPresenceTest.java
+++ b/hotspot/test/compiler/codecache/jmx/MemoryPoolsPresenceTest.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -33,6 +33,7 @@
 /**
  * @test MemoryPoolsPresenceTest
  * @library /testlibrary /../../test/lib
+ * @modules java.management
  * @build MemoryPoolsPresenceTest
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *     sun.hotspot.WhiteBox$WhiteBoxPermission
diff --git a/hotspot/test/compiler/codecache/jmx/PeakUsageTest.java b/hotspot/test/compiler/codecache/jmx/PeakUsageTest.java
index b77e054..c9e0cdb 100644
--- a/hotspot/test/compiler/codecache/jmx/PeakUsageTest.java
+++ b/hotspot/test/compiler/codecache/jmx/PeakUsageTest.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -28,6 +28,8 @@
 /*
  * @test PeakUsageTest
  * @library /testlibrary /../../test/lib
+ * @modules java.base/sun.misc
+ *          java.management
  * @build PeakUsageTest
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *     sun.hotspot.WhiteBox$WhiteBoxPermission
diff --git a/hotspot/test/compiler/codecache/jmx/ThresholdNotificationsTest.java b/hotspot/test/compiler/codecache/jmx/ThresholdNotificationsTest.java
index fea786e..56b26a9 100644
--- a/hotspot/test/compiler/codecache/jmx/ThresholdNotificationsTest.java
+++ b/hotspot/test/compiler/codecache/jmx/ThresholdNotificationsTest.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -35,6 +35,8 @@
 /*
  * @test ThresholdNotificationsTest
  * @library /testlibrary /../../test/lib
+ * @modules java.base/sun.misc
+ *          java.management
  * @build ThresholdNotificationsTest
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *     sun.hotspot.WhiteBox$WhiteBoxPermission
diff --git a/hotspot/test/compiler/codecache/jmx/UsageThresholdExceededSeveralTimesTest.java b/hotspot/test/compiler/codecache/jmx/UsageThresholdExceededSeveralTimesTest.java
index ad2ddc8..ca1e8dc 100644
--- a/hotspot/test/compiler/codecache/jmx/UsageThresholdExceededSeveralTimesTest.java
+++ b/hotspot/test/compiler/codecache/jmx/UsageThresholdExceededSeveralTimesTest.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -24,6 +24,8 @@
 /*
  * @test UsageThresholdExceededSeveralTimesTest
  * @library /testlibrary /../../test/lib
+ * @modules java.base/sun.misc
+ *          java.management
  * @build UsageThresholdExceededTest
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *     sun.hotspot.WhiteBox$WhiteBoxPermission
diff --git a/hotspot/test/compiler/codecache/jmx/UsageThresholdExceededTest.java b/hotspot/test/compiler/codecache/jmx/UsageThresholdExceededTest.java
index 50e45562..dc8a8a0 100644
--- a/hotspot/test/compiler/codecache/jmx/UsageThresholdExceededTest.java
+++ b/hotspot/test/compiler/codecache/jmx/UsageThresholdExceededTest.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -28,6 +28,8 @@
 /*
  * @test UsageThresholdExceededTest
  * @library /testlibrary /../../test/lib
+ * @modules java.base/sun.misc
+ *          java.management
  * @build UsageThresholdExceededTest
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *     sun.hotspot.WhiteBox$WhiteBoxPermission
diff --git a/hotspot/test/compiler/codecache/jmx/UsageThresholdIncreasedTest.java b/hotspot/test/compiler/codecache/jmx/UsageThresholdIncreasedTest.java
index 276ba90..2c68180 100644
--- a/hotspot/test/compiler/codecache/jmx/UsageThresholdIncreasedTest.java
+++ b/hotspot/test/compiler/codecache/jmx/UsageThresholdIncreasedTest.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -28,6 +28,8 @@
 /*
  * @test UsageThresholdIncreasedTest
  * @library /testlibrary /../../test/lib
+ * @modules java.base/sun.misc
+ *          java.management
  * @build UsageThresholdIncreasedTest
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *     sun.hotspot.WhiteBox$WhiteBoxPermission
diff --git a/hotspot/test/compiler/codecache/jmx/UsageThresholdNotExceededTest.java b/hotspot/test/compiler/codecache/jmx/UsageThresholdNotExceededTest.java
index 23fdf9c..b87a7d4 100644
--- a/hotspot/test/compiler/codecache/jmx/UsageThresholdNotExceededTest.java
+++ b/hotspot/test/compiler/codecache/jmx/UsageThresholdNotExceededTest.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -28,6 +28,8 @@
 /*
  * @test UsageThresholdNotExceededTest
  * @library /testlibrary /../../test/lib
+ * @modules java.base/sun.misc
+ *          java.management
  * @build UsageThresholdNotExceededTest
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *     sun.hotspot.WhiteBox$WhiteBoxPermission
diff --git a/hotspot/test/compiler/codecache/stress/OverloadCompileQueueTest.java b/hotspot/test/compiler/codecache/stress/OverloadCompileQueueTest.java
index ec29cf5..3ff2a43 100644
--- a/hotspot/test/compiler/codecache/stress/OverloadCompileQueueTest.java
+++ b/hotspot/test/compiler/codecache/stress/OverloadCompileQueueTest.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -30,6 +30,8 @@
 /*
  * @test OverloadCompileQueueTest
  * @library /testlibrary /../../test/lib
+ * @modules java.base/sun.misc
+ *          java.management
  * @ignore 8071905
  * @build OverloadCompileQueueTest
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
diff --git a/hotspot/test/compiler/codecache/stress/RandomAllocationTest.java b/hotspot/test/compiler/codecache/stress/RandomAllocationTest.java
index 466bcc4..400b99a 100644
--- a/hotspot/test/compiler/codecache/stress/RandomAllocationTest.java
+++ b/hotspot/test/compiler/codecache/stress/RandomAllocationTest.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -29,6 +29,8 @@
 /*
  * @test RandomAllocationTest
  * @library /testlibrary /../../test/lib
+ * @modules java.base/sun.misc
+ *          java.management
  * @build RandomAllocationTest
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
diff --git a/hotspot/test/compiler/codecache/stress/UnexpectedDeoptimizationTest.java b/hotspot/test/compiler/codecache/stress/UnexpectedDeoptimizationTest.java
index f8ff8e5..d7c7f07 100644
--- a/hotspot/test/compiler/codecache/stress/UnexpectedDeoptimizationTest.java
+++ b/hotspot/test/compiler/codecache/stress/UnexpectedDeoptimizationTest.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,6 +25,8 @@
 /*
  * @test UnexpectedDeoptimizationTest
  * @library /testlibrary /../../test/lib
+ * @modules java.base/sun.misc
+ *          java.management
  * @build UnexpectedDeoptimizationTest
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
diff --git a/hotspot/test/compiler/codegen/6896617/Test6896617.java b/hotspot/test/compiler/codegen/6896617/Test6896617.java
index 38835e0..a3650ad 100644
--- a/hotspot/test/compiler/codegen/6896617/Test6896617.java
+++ b/hotspot/test/compiler/codegen/6896617/Test6896617.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,6 +26,9 @@
  * @bug 6896617
  * @summary Optimize sun.nio.cs.ISO_8859_1$Encode.encodeArrayLoop() with SSE instructions on x86
  * @library /testlibrary
+ * @modules java.base/sun.misc
+ *          java.base/sun.nio.cs
+ *          java.management
  * @run main/othervm/timeout=1200 -Xbatch -Xmx256m Test6896617
  *
  */
diff --git a/hotspot/test/compiler/codegen/7100757/Test7100757.java b/hotspot/test/compiler/codegen/7100757/Test7100757.java
index 50ee9e1..0358d7b 100644
--- a/hotspot/test/compiler/codegen/7100757/Test7100757.java
+++ b/hotspot/test/compiler/codegen/7100757/Test7100757.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -27,6 +27,8 @@
  * @bug 7100757
  * @summary The BitSet.nextSetBit() produces incorrect result in 32bit VM on Sparc
  * @library /testlibrary
+ * @modules java.base/sun.misc
+ *          java.management
  * @run main/timeout=300 Test7100757
  */
 
diff --git a/hotspot/test/compiler/codegen/7184394/TestAESMain.java b/hotspot/test/compiler/codegen/7184394/TestAESMain.java
index d09a305..e1fa387 100644
--- a/hotspot/test/compiler/codegen/7184394/TestAESMain.java
+++ b/hotspot/test/compiler/codegen/7184394/TestAESMain.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 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
@@ -28,6 +28,8 @@
  * @summary add intrinsics to use AES instructions
  * @library /testlibrary
  *
+ * @modules java.base/sun.misc
+ *          java.management
  * @run main/othervm/timeout=600 -Xbatch -DcheckOutput=true -Dmode=CBC TestAESMain
  * @run main/othervm/timeout=600 -Xbatch -DcheckOutput=true -Dmode=CBC -DencInputOffset=1 TestAESMain
  * @run main/othervm/timeout=600 -Xbatch -DcheckOutput=true -Dmode=CBC -DencOutputOffset=1 TestAESMain
diff --git a/hotspot/test/compiler/codegen/8011901/Test8011901.java b/hotspot/test/compiler/codegen/8011901/Test8011901.java
index 6ff0a93..a917288 100644
--- a/hotspot/test/compiler/codegen/8011901/Test8011901.java
+++ b/hotspot/test/compiler/codegen/8011901/Test8011901.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,6 +25,7 @@
  * @test
  * @bug 8011901
  * @summary instruct xaddL_no_res shouldn't allow 64 bit constants.
+ * @modules java.base/sun.misc
  * @run main/othervm -XX:-BackgroundCompilation Test8011901
  *
  */
diff --git a/hotspot/test/compiler/cpuflags/RestoreMXCSR.java b/hotspot/test/compiler/cpuflags/RestoreMXCSR.java
index 0e4bce8..098ae0e 100644
--- a/hotspot/test/compiler/cpuflags/RestoreMXCSR.java
+++ b/hotspot/test/compiler/cpuflags/RestoreMXCSR.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,7 +26,8 @@
  * @bug 8020433
  * @summary Crash when using -XX:+RestoreMXCSROnJNICalls
  * @library /testlibrary
- *
+ * @modules java.base/sun.misc
+ *          java.management
  */
 import com.oracle.java.testlibrary.*;
 
diff --git a/hotspot/test/compiler/debug/VerifyAdapterSharing.java b/hotspot/test/compiler/debug/VerifyAdapterSharing.java
index 1aac538..4c26bd7 100644
--- a/hotspot/test/compiler/debug/VerifyAdapterSharing.java
+++ b/hotspot/test/compiler/debug/VerifyAdapterSharing.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,7 +26,8 @@
  * @bug 8030783
  * @summary Regression test for 8026478
  * @library /testlibrary
- *
+ * @modules java.base/sun.misc
+ *          java.management
  */
 import com.oracle.java.testlibrary.*;
 
diff --git a/hotspot/test/compiler/dependencies/MonomorphicObjectCall/TestMonomorphicObjectCall.java b/hotspot/test/compiler/dependencies/MonomorphicObjectCall/TestMonomorphicObjectCall.java
index 8884ce4..c36118f 100644
--- a/hotspot/test/compiler/dependencies/MonomorphicObjectCall/TestMonomorphicObjectCall.java
+++ b/hotspot/test/compiler/dependencies/MonomorphicObjectCall/TestMonomorphicObjectCall.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -32,6 +32,8 @@
  * @bug 8050079
  * @summary Compiles a monomorphic call to finalizeObject() on a modified java.lang.Object to test C1 CHA.
  * @library /testlibrary
+ * @modules java.base/sun.misc
+ *          java.management
  * @compile -XDignore.symbol.file java/lang/Object.java TestMonomorphicObjectCall.java
  * @run main TestMonomorphicObjectCall
  */
diff --git a/hotspot/test/compiler/escapeAnalysis/TestUnsafePutAddressNullObjMustNotEscape.java b/hotspot/test/compiler/escapeAnalysis/TestUnsafePutAddressNullObjMustNotEscape.java
index e016a99..d70ec5c 100644
--- a/hotspot/test/compiler/escapeAnalysis/TestUnsafePutAddressNullObjMustNotEscape.java
+++ b/hotspot/test/compiler/escapeAnalysis/TestUnsafePutAddressNullObjMustNotEscape.java
@@ -25,6 +25,7 @@
  * @test
  * @bug 8038048
  * @summary assert(null_obj->escape_state() == PointsToNode::NoEscape,etc)
+ * @modules java.base/sun.misc
  * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+DoEscapeAnalysis -XX:-TieredCompilation -Xbatch TestUnsafePutAddressNullObjMustNotEscape
  * @author Richard Reingruber richard DOT reingruber AT sap DOT com
  */
diff --git a/hotspot/test/compiler/floatingpoint/TestPow2.java b/hotspot/test/compiler/floatingpoint/TestPow2.java
index 699904b..f46a9a7 100644
--- a/hotspot/test/compiler/floatingpoint/TestPow2.java
+++ b/hotspot/test/compiler/floatingpoint/TestPow2.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,6 +26,7 @@
  * @bug 8063086
  * @summary X^2 special case for C2 yields different result than interpreter
  * @library /testlibrary /../../test/lib /compiler/whitebox
+ * @modules java.management
  * @build TestPow2
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
diff --git a/hotspot/test/compiler/intrinsics/bmi/TestAndnI.java b/hotspot/test/compiler/intrinsics/bmi/TestAndnI.java
index 84d32ff..55d0897 100644
--- a/hotspot/test/compiler/intrinsics/bmi/TestAndnI.java
+++ b/hotspot/test/compiler/intrinsics/bmi/TestAndnI.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -28,6 +28,8 @@
  * @summary Verify that results of computations are the same w/
  *          and w/o usage of ANDN instruction
  * @library /testlibrary /../../test/lib
+ * @modules java.base/sun.misc
+ *          java.management
  * @build TestAndnI BMITestRunner Expr
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
diff --git a/hotspot/test/compiler/intrinsics/bmi/TestAndnL.java b/hotspot/test/compiler/intrinsics/bmi/TestAndnL.java
index d6b33a6..33dd7a1 100644
--- a/hotspot/test/compiler/intrinsics/bmi/TestAndnL.java
+++ b/hotspot/test/compiler/intrinsics/bmi/TestAndnL.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -28,6 +28,8 @@
  * @summary Verify that results of computations are the same w/
  *          and w/o usage of ANDN instruction
  * @library /testlibrary /../../test/lib
+ * @modules java.base/sun.misc
+ *          java.management
  * @build TestAndnL BMITestRunner Expr
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
diff --git a/hotspot/test/compiler/intrinsics/bmi/TestBlsiI.java b/hotspot/test/compiler/intrinsics/bmi/TestBlsiI.java
index d8dfc41..c076812 100644
--- a/hotspot/test/compiler/intrinsics/bmi/TestBlsiI.java
+++ b/hotspot/test/compiler/intrinsics/bmi/TestBlsiI.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -28,6 +28,8 @@
  * @summary Verify that results of computations are the same w/
  *          and w/o usage of BLSI instruction
  * @library /testlibrary /../../test/lib
+ * @modules java.base/sun.misc
+ *          java.management
  * @build TestBlsiI BMITestRunner Expr
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
diff --git a/hotspot/test/compiler/intrinsics/bmi/TestBlsiL.java b/hotspot/test/compiler/intrinsics/bmi/TestBlsiL.java
index 9e0cd01..6515496 100644
--- a/hotspot/test/compiler/intrinsics/bmi/TestBlsiL.java
+++ b/hotspot/test/compiler/intrinsics/bmi/TestBlsiL.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -28,6 +28,8 @@
  * @summary Verify that results of computations are the same w/
  *          and w/o usage of BLSI instruction
  * @library /testlibrary /../../test/lib
+ * @modules java.base/sun.misc
+ *          java.management
  * @build TestBlsiL BMITestRunner Expr
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
diff --git a/hotspot/test/compiler/intrinsics/bmi/TestBlsmskI.java b/hotspot/test/compiler/intrinsics/bmi/TestBlsmskI.java
index 869aff8..efbd0c7 100644
--- a/hotspot/test/compiler/intrinsics/bmi/TestBlsmskI.java
+++ b/hotspot/test/compiler/intrinsics/bmi/TestBlsmskI.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -28,6 +28,8 @@
  * @summary Verify that results of computations are the same w/
  *          and w/o usage of BLSMSK instruction
  * @library /testlibrary /../../test/lib
+ * @modules java.base/sun.misc
+ *          java.management
  * @build TestBlsmskI BMITestRunner Expr
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
diff --git a/hotspot/test/compiler/intrinsics/bmi/TestBlsmskL.java b/hotspot/test/compiler/intrinsics/bmi/TestBlsmskL.java
index 2e8d8ae..c9a4cce 100644
--- a/hotspot/test/compiler/intrinsics/bmi/TestBlsmskL.java
+++ b/hotspot/test/compiler/intrinsics/bmi/TestBlsmskL.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -28,6 +28,8 @@
  * @summary Verify that results of computations are the same w/
  *          and w/o usage of BLSMSK instruction
  * @library /testlibrary /../../test/lib
+ * @modules java.base/sun.misc
+ *          java.management
  * @build TestBlsmskL BMITestRunner Expr
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
diff --git a/hotspot/test/compiler/intrinsics/bmi/TestBlsrI.java b/hotspot/test/compiler/intrinsics/bmi/TestBlsrI.java
index f9dc192..352c524 100644
--- a/hotspot/test/compiler/intrinsics/bmi/TestBlsrI.java
+++ b/hotspot/test/compiler/intrinsics/bmi/TestBlsrI.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -28,6 +28,8 @@
  * @summary Verify that results of computations are the same w/
  *          and w/o usage of BLSR instruction
  * @library /testlibrary /../../test/lib
+ * @modules java.base/sun.misc
+ *          java.management
  * @build TestBlsrI BMITestRunner Expr
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
diff --git a/hotspot/test/compiler/intrinsics/bmi/TestBlsrL.java b/hotspot/test/compiler/intrinsics/bmi/TestBlsrL.java
index c6c2f2d..fe4e0b4 100644
--- a/hotspot/test/compiler/intrinsics/bmi/TestBlsrL.java
+++ b/hotspot/test/compiler/intrinsics/bmi/TestBlsrL.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -28,6 +28,8 @@
  * @summary Verify that results of computations are the same w/
  *          and w/o usage of BLSR instruction
  * @library /testlibrary /../../test/lib
+ * @modules java.base/sun.misc
+ *          java.management
  * @build TestBlsrL BMITestRunner Expr
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
diff --git a/hotspot/test/compiler/intrinsics/bmi/TestLzcntI.java b/hotspot/test/compiler/intrinsics/bmi/TestLzcntI.java
index acd1b16..4fb1a43 100644
--- a/hotspot/test/compiler/intrinsics/bmi/TestLzcntI.java
+++ b/hotspot/test/compiler/intrinsics/bmi/TestLzcntI.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -28,6 +28,8 @@
  * @summary Verify that results of computations are the same w/
  *          and w/o usage of intrinsic
  * @library /testlibrary /../../test/lib
+ * @modules java.base/sun.misc
+ *          java.management
  * @build TestLzcntI BMITestRunner Expr
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
diff --git a/hotspot/test/compiler/intrinsics/bmi/TestLzcntL.java b/hotspot/test/compiler/intrinsics/bmi/TestLzcntL.java
index 63891cd..18f3c66 100644
--- a/hotspot/test/compiler/intrinsics/bmi/TestLzcntL.java
+++ b/hotspot/test/compiler/intrinsics/bmi/TestLzcntL.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -28,6 +28,8 @@
  * @summary Verify that results of computations are the same w/
  *          and w/o usage of intrinsic
  * @library /testlibrary /../../test/lib
+ * @modules java.base/sun.misc
+ *          java.management
  * @build TestLzcntL BMITestRunner Expr
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
diff --git a/hotspot/test/compiler/intrinsics/bmi/TestTzcntI.java b/hotspot/test/compiler/intrinsics/bmi/TestTzcntI.java
index 6e4894a..caf3fb7 100644
--- a/hotspot/test/compiler/intrinsics/bmi/TestTzcntI.java
+++ b/hotspot/test/compiler/intrinsics/bmi/TestTzcntI.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -28,6 +28,8 @@
  * @summary Verify that results of computations are the same w/
  *          and w/o usage of intrinsic
  * @library /testlibrary /../../test/lib
+ * @modules java.base/sun.misc
+ *          java.management
  * @build TestTzcntI BMITestRunner Expr
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
diff --git a/hotspot/test/compiler/intrinsics/bmi/TestTzcntL.java b/hotspot/test/compiler/intrinsics/bmi/TestTzcntL.java
index d2f634c..f56634f 100644
--- a/hotspot/test/compiler/intrinsics/bmi/TestTzcntL.java
+++ b/hotspot/test/compiler/intrinsics/bmi/TestTzcntL.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -28,6 +28,8 @@
  * @summary Verify that results of computations are the same w/
  *          and w/o usage of intrinsic
  * @library /testlibrary /../../test/lib
+ * @modules java.base/sun.misc
+ *          java.management
  * @build TestTzcntL BMITestRunner Expr
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
diff --git a/hotspot/test/compiler/intrinsics/bmi/verifycode/AddnTestI.java b/hotspot/test/compiler/intrinsics/bmi/verifycode/AddnTestI.java
index ea9e6df..04fe2f8 100644
--- a/hotspot/test/compiler/intrinsics/bmi/verifycode/AddnTestI.java
+++ b/hotspot/test/compiler/intrinsics/bmi/verifycode/AddnTestI.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,6 +25,8 @@
  * @test
  * @bug 8031321
  * @library /testlibrary /../../test/lib /compiler/whitebox ..
+ * @modules java.base/sun.misc
+ *          java.management
  * @build AddnTestI
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
diff --git a/hotspot/test/compiler/intrinsics/bmi/verifycode/AddnTestL.java b/hotspot/test/compiler/intrinsics/bmi/verifycode/AddnTestL.java
index 0859ba1..b9647cf 100644
--- a/hotspot/test/compiler/intrinsics/bmi/verifycode/AddnTestL.java
+++ b/hotspot/test/compiler/intrinsics/bmi/verifycode/AddnTestL.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,6 +25,8 @@
  * @test
  * @bug 8031321
  * @library /testlibrary /../../test/lib /compiler/whitebox ..
+ * @modules java.base/sun.misc
+ *          java.management
  * @build AddnTestL
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
diff --git a/hotspot/test/compiler/intrinsics/bmi/verifycode/BlsiTestI.java b/hotspot/test/compiler/intrinsics/bmi/verifycode/BlsiTestI.java
index 8a6aa8b..3a583df 100644
--- a/hotspot/test/compiler/intrinsics/bmi/verifycode/BlsiTestI.java
+++ b/hotspot/test/compiler/intrinsics/bmi/verifycode/BlsiTestI.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,6 +25,8 @@
  * @test
  * @bug 8031321
  * @library /testlibrary /../../test/lib /compiler/whitebox ..
+ * @modules java.base/sun.misc
+ *          java.management
  * @build BlsiTestI
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
diff --git a/hotspot/test/compiler/intrinsics/bmi/verifycode/BlsiTestL.java b/hotspot/test/compiler/intrinsics/bmi/verifycode/BlsiTestL.java
index 9b08726..5569637 100644
--- a/hotspot/test/compiler/intrinsics/bmi/verifycode/BlsiTestL.java
+++ b/hotspot/test/compiler/intrinsics/bmi/verifycode/BlsiTestL.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,6 +25,8 @@
  * @test
  * @bug 8031321
  * @library /testlibrary /../../test/lib /compiler/whitebox ..
+ * @modules java.base/sun.misc
+ *          java.management
  * @build BlsiTestL
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
diff --git a/hotspot/test/compiler/intrinsics/bmi/verifycode/BlsmskTestI.java b/hotspot/test/compiler/intrinsics/bmi/verifycode/BlsmskTestI.java
index 31c747e..aba4b32 100644
--- a/hotspot/test/compiler/intrinsics/bmi/verifycode/BlsmskTestI.java
+++ b/hotspot/test/compiler/intrinsics/bmi/verifycode/BlsmskTestI.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,6 +25,8 @@
  * @test
  * @bug 8031321
  * @library /testlibrary /../../test/lib /compiler/whitebox ..
+ * @modules java.base/sun.misc
+ *          java.management
  * @build BlsmskTestI
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
diff --git a/hotspot/test/compiler/intrinsics/bmi/verifycode/BlsmskTestL.java b/hotspot/test/compiler/intrinsics/bmi/verifycode/BlsmskTestL.java
index 07887bc..b58e7b3 100644
--- a/hotspot/test/compiler/intrinsics/bmi/verifycode/BlsmskTestL.java
+++ b/hotspot/test/compiler/intrinsics/bmi/verifycode/BlsmskTestL.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,6 +25,8 @@
  * @test
  * @bug 8031321
  * @library /testlibrary /../../test/lib /compiler/whitebox ..
+ * @modules java.base/sun.misc
+ *          java.management
  * @build BlsmskTestL
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
diff --git a/hotspot/test/compiler/intrinsics/bmi/verifycode/BlsrTestI.java b/hotspot/test/compiler/intrinsics/bmi/verifycode/BlsrTestI.java
index 2424d93..4b3434d 100644
--- a/hotspot/test/compiler/intrinsics/bmi/verifycode/BlsrTestI.java
+++ b/hotspot/test/compiler/intrinsics/bmi/verifycode/BlsrTestI.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,6 +25,8 @@
  * @test
  * @bug 8031321
  * @library /testlibrary /../../test/lib /compiler/whitebox ..
+ * @modules java.base/sun.misc
+ *          java.management
  * @build BlsrTestI
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
diff --git a/hotspot/test/compiler/intrinsics/bmi/verifycode/BlsrTestL.java b/hotspot/test/compiler/intrinsics/bmi/verifycode/BlsrTestL.java
index 0505203..81b9fa8 100644
--- a/hotspot/test/compiler/intrinsics/bmi/verifycode/BlsrTestL.java
+++ b/hotspot/test/compiler/intrinsics/bmi/verifycode/BlsrTestL.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,6 +25,8 @@
  * @test
  * @bug 8031321
  * @library /testlibrary /../../test/lib /compiler/whitebox ..
+ * @modules java.base/sun.misc
+ *          java.management
  * @build BlsrTestL
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
diff --git a/hotspot/test/compiler/intrinsics/bmi/verifycode/LZcntTestI.java b/hotspot/test/compiler/intrinsics/bmi/verifycode/LZcntTestI.java
index 46892c7..dd45d49 100644
--- a/hotspot/test/compiler/intrinsics/bmi/verifycode/LZcntTestI.java
+++ b/hotspot/test/compiler/intrinsics/bmi/verifycode/LZcntTestI.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,6 +25,8 @@
  * @test
  * @bug 8031321
  * @library /testlibrary /../../test/lib /compiler/whitebox ..
+ * @modules java.base/sun.misc
+ *          java.management
  * @build LZcntTestI
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
diff --git a/hotspot/test/compiler/intrinsics/bmi/verifycode/LZcntTestL.java b/hotspot/test/compiler/intrinsics/bmi/verifycode/LZcntTestL.java
index 64002d9..4515d25 100644
--- a/hotspot/test/compiler/intrinsics/bmi/verifycode/LZcntTestL.java
+++ b/hotspot/test/compiler/intrinsics/bmi/verifycode/LZcntTestL.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,6 +25,8 @@
  * @test
  * @bug 8031321
  * @library /testlibrary /../../test/lib /compiler/whitebox ..
+ * @modules java.base/sun.misc
+ *          java.management
  * @build LZcntTestL
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
diff --git a/hotspot/test/compiler/intrinsics/bmi/verifycode/TZcntTestI.java b/hotspot/test/compiler/intrinsics/bmi/verifycode/TZcntTestI.java
index d9669f6..5d078b6 100644
--- a/hotspot/test/compiler/intrinsics/bmi/verifycode/TZcntTestI.java
+++ b/hotspot/test/compiler/intrinsics/bmi/verifycode/TZcntTestI.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,6 +25,8 @@
  * @test
  * @bug 8031321
  * @library /testlibrary /../../test/lib /compiler/whitebox ..
+ * @modules java.base/sun.misc
+ *          java.management
  * @build TZcntTestI
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
diff --git a/hotspot/test/compiler/intrinsics/bmi/verifycode/TZcntTestL.java b/hotspot/test/compiler/intrinsics/bmi/verifycode/TZcntTestL.java
index 7ba85b3..0758a44 100644
--- a/hotspot/test/compiler/intrinsics/bmi/verifycode/TZcntTestL.java
+++ b/hotspot/test/compiler/intrinsics/bmi/verifycode/TZcntTestL.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,6 +25,8 @@
  * @test
  * @bug 8031321
  * @library /testlibrary /../../test/lib /compiler/whitebox ..
+ * @modules java.base/sun.misc
+ *          java.management
  * @build TZcntTestL
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
diff --git a/hotspot/test/compiler/intrinsics/classcast/NullCheckDroppingsTest.java b/hotspot/test/compiler/intrinsics/classcast/NullCheckDroppingsTest.java
index 9e05df1..3d6eb8a 100644
--- a/hotspot/test/compiler/intrinsics/classcast/NullCheckDroppingsTest.java
+++ b/hotspot/test/compiler/intrinsics/classcast/NullCheckDroppingsTest.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,6 +26,8 @@
  * @bug 8054492
  * @summary "Casting can result in redundant null checks in generated code"
  * @library /testlibrary /../../test/lib /testlibrary/com/oracle/java/testlibrary
+ * @modules java.base/sun.misc
+ *          java.management
  * @build NullCheckDroppingsTest
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
diff --git a/hotspot/test/compiler/intrinsics/mathexact/AddExactIConstantTest.java b/hotspot/test/compiler/intrinsics/mathexact/AddExactIConstantTest.java
index 71e1a97..1507a53 100644
--- a/hotspot/test/compiler/intrinsics/mathexact/AddExactIConstantTest.java
+++ b/hotspot/test/compiler/intrinsics/mathexact/AddExactIConstantTest.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,6 +26,8 @@
  * @bug 8024924
  * @summary Test constant addExact
  * @library /testlibrary
+ * @modules java.base/sun.misc
+ *          java.management
  * @compile AddExactIConstantTest.java Verify.java
  * @run main AddExactIConstantTest
  *
diff --git a/hotspot/test/compiler/intrinsics/mathexact/AddExactILoadTest.java b/hotspot/test/compiler/intrinsics/mathexact/AddExactILoadTest.java
index 81bcc24..f24c241 100644
--- a/hotspot/test/compiler/intrinsics/mathexact/AddExactILoadTest.java
+++ b/hotspot/test/compiler/intrinsics/mathexact/AddExactILoadTest.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,6 +26,8 @@
  * @bug 8024924
  * @summary Test non constant addExact
  * @library /testlibrary
+ * @modules java.base/sun.misc
+ *          java.management
  * @compile AddExactILoadTest.java Verify.java
  * @run main AddExactILoadTest
  *
diff --git a/hotspot/test/compiler/intrinsics/mathexact/AddExactILoopDependentTest.java b/hotspot/test/compiler/intrinsics/mathexact/AddExactILoopDependentTest.java
index f0adb45..b4a22eb 100644
--- a/hotspot/test/compiler/intrinsics/mathexact/AddExactILoopDependentTest.java
+++ b/hotspot/test/compiler/intrinsics/mathexact/AddExactILoopDependentTest.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,6 +26,8 @@
  * @bug 8024924
  * @summary Test non constant addExact
  * @library /testlibrary
+ * @modules java.base/sun.misc
+ *          java.management
  * @compile AddExactILoopDependentTest.java Verify.java
  * @run main AddExactILoopDependentTest
  *
diff --git a/hotspot/test/compiler/intrinsics/mathexact/AddExactINonConstantTest.java b/hotspot/test/compiler/intrinsics/mathexact/AddExactINonConstantTest.java
index 96c0b60..5833d78 100644
--- a/hotspot/test/compiler/intrinsics/mathexact/AddExactINonConstantTest.java
+++ b/hotspot/test/compiler/intrinsics/mathexact/AddExactINonConstantTest.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,6 +26,8 @@
  * @bug 8024924
  * @summary Test non constant addExact
  * @library /testlibrary
+ * @modules java.base/sun.misc
+ *          java.management
  * @compile AddExactINonConstantTest.java Verify.java
  * @run main AddExactINonConstantTest
  *
diff --git a/hotspot/test/compiler/intrinsics/mathexact/AddExactIRepeatTest.java b/hotspot/test/compiler/intrinsics/mathexact/AddExactIRepeatTest.java
index 2ba7268..3e6ae5a 100644
--- a/hotspot/test/compiler/intrinsics/mathexact/AddExactIRepeatTest.java
+++ b/hotspot/test/compiler/intrinsics/mathexact/AddExactIRepeatTest.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,6 +26,8 @@
  * @bug 8025657
  * @summary Test repeating addExact
  * @library /testlibrary
+ * @modules java.base/sun.misc
+ *          java.management
  * @compile AddExactIRepeatTest.java Verify.java
  * @run main AddExactIRepeatTest
  *
diff --git a/hotspot/test/compiler/intrinsics/mathexact/AddExactLConstantTest.java b/hotspot/test/compiler/intrinsics/mathexact/AddExactLConstantTest.java
index f36c925..c42914f 100644
--- a/hotspot/test/compiler/intrinsics/mathexact/AddExactLConstantTest.java
+++ b/hotspot/test/compiler/intrinsics/mathexact/AddExactLConstantTest.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,6 +26,8 @@
  * @bug 8026844
  * @summary Test constant addExact
  * @library /testlibrary
+ * @modules java.base/sun.misc
+ *          java.management
  * @compile AddExactLConstantTest.java Verify.java
  * @run main AddExactLConstantTest
  *
diff --git a/hotspot/test/compiler/intrinsics/mathexact/AddExactLNonConstantTest.java b/hotspot/test/compiler/intrinsics/mathexact/AddExactLNonConstantTest.java
index 01860ba..6f8c898b 100644
--- a/hotspot/test/compiler/intrinsics/mathexact/AddExactLNonConstantTest.java
+++ b/hotspot/test/compiler/intrinsics/mathexact/AddExactLNonConstantTest.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,6 +26,8 @@
  * @bug 8026844
  * @summary Test non constant addExact
  * @library /testlibrary
+ * @modules java.base/sun.misc
+ *          java.management
  * @compile AddExactLNonConstantTest.java Verify.java
  * @run main AddExactLNonConstantTest
  *
diff --git a/hotspot/test/compiler/intrinsics/mathexact/DecExactITest.java b/hotspot/test/compiler/intrinsics/mathexact/DecExactITest.java
index 256aa91..ac769b9 100644
--- a/hotspot/test/compiler/intrinsics/mathexact/DecExactITest.java
+++ b/hotspot/test/compiler/intrinsics/mathexact/DecExactITest.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,6 +26,8 @@
  * @bug 8026844
  * @summary Test decrementExact
  * @library /testlibrary
+ * @modules java.base/sun.misc
+ *          java.management
  * @compile DecExactITest.java Verify.java
  * @run main DecExactITest
  *
diff --git a/hotspot/test/compiler/intrinsics/mathexact/DecExactLTest.java b/hotspot/test/compiler/intrinsics/mathexact/DecExactLTest.java
index 1a9f0c8..416ec96 100644
--- a/hotspot/test/compiler/intrinsics/mathexact/DecExactLTest.java
+++ b/hotspot/test/compiler/intrinsics/mathexact/DecExactLTest.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,6 +26,8 @@
  * @bug 8026844
  * @summary Test decrementExact
  * @library /testlibrary
+ * @modules java.base/sun.misc
+ *          java.management
  * @compile DecExactLTest.java Verify.java
  * @run main DecExactLTest
  *
diff --git a/hotspot/test/compiler/intrinsics/mathexact/IncExactITest.java b/hotspot/test/compiler/intrinsics/mathexact/IncExactITest.java
index 14ab592..6037ddf 100644
--- a/hotspot/test/compiler/intrinsics/mathexact/IncExactITest.java
+++ b/hotspot/test/compiler/intrinsics/mathexact/IncExactITest.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,6 +26,8 @@
  * @bug 8026844
  * @summary Test incrementExact
  * @library /testlibrary
+ * @modules java.base/sun.misc
+ *          java.management
  * @compile IncExactITest.java Verify.java
  * @run main IncExactITest
  *
diff --git a/hotspot/test/compiler/intrinsics/mathexact/IncExactLTest.java b/hotspot/test/compiler/intrinsics/mathexact/IncExactLTest.java
index 5665b80..0dd009c 100644
--- a/hotspot/test/compiler/intrinsics/mathexact/IncExactLTest.java
+++ b/hotspot/test/compiler/intrinsics/mathexact/IncExactLTest.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,6 +26,8 @@
  * @bug 8026844
  * @summary Test incrementExact
  * @library /testlibrary
+ * @modules java.base/sun.misc
+ *          java.management
  * @compile IncExactLTest.java Verify.java
  * @run main IncExactLTest
  *
diff --git a/hotspot/test/compiler/intrinsics/mathexact/MulExactIConstantTest.java b/hotspot/test/compiler/intrinsics/mathexact/MulExactIConstantTest.java
index 3d3f23e..c477944 100644
--- a/hotspot/test/compiler/intrinsics/mathexact/MulExactIConstantTest.java
+++ b/hotspot/test/compiler/intrinsics/mathexact/MulExactIConstantTest.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,6 +26,8 @@
  * @bug 8026844
  * @summary Test constant multiplyExact
  * @library /testlibrary
+ * @modules java.base/sun.misc
+ *          java.management
  * @compile MulExactIConstantTest.java Verify.java
  * @run main MulExactIConstantTest
  *
diff --git a/hotspot/test/compiler/intrinsics/mathexact/MulExactILoadTest.java b/hotspot/test/compiler/intrinsics/mathexact/MulExactILoadTest.java
index 4551e9d..32ea607 100644
--- a/hotspot/test/compiler/intrinsics/mathexact/MulExactILoadTest.java
+++ b/hotspot/test/compiler/intrinsics/mathexact/MulExactILoadTest.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,6 +26,8 @@
  * @bug 8026844
  * @summary Test multiplyExact
  * @library /testlibrary
+ * @modules java.base/sun.misc
+ *          java.management
  * @compile MulExactILoadTest.java Verify.java
  * @run main MulExactILoadTest
  *
diff --git a/hotspot/test/compiler/intrinsics/mathexact/MulExactILoopDependentTest.java b/hotspot/test/compiler/intrinsics/mathexact/MulExactILoopDependentTest.java
index b324135..2a5b3ea 100644
--- a/hotspot/test/compiler/intrinsics/mathexact/MulExactILoopDependentTest.java
+++ b/hotspot/test/compiler/intrinsics/mathexact/MulExactILoopDependentTest.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,6 +26,8 @@
  * @bug 8026844
  * @summary Test loop dependent multiplyExact
  * @library /testlibrary
+ * @modules java.base/sun.misc
+ *          java.management
  * @compile MulExactILoopDependentTest.java Verify.java
  * @run main MulExactILoopDependentTest
  *
diff --git a/hotspot/test/compiler/intrinsics/mathexact/MulExactINonConstantTest.java b/hotspot/test/compiler/intrinsics/mathexact/MulExactINonConstantTest.java
index 5f60c66..ec2ba1e 100644
--- a/hotspot/test/compiler/intrinsics/mathexact/MulExactINonConstantTest.java
+++ b/hotspot/test/compiler/intrinsics/mathexact/MulExactINonConstantTest.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,6 +26,8 @@
  * @bug 8026844
  * @summary Test non constant multiplyExact
  * @library /testlibrary
+ * @modules java.base/sun.misc
+ *          java.management
  * @compile MulExactINonConstantTest.java Verify.java
  * @run main MulExactINonConstantTest
  *
diff --git a/hotspot/test/compiler/intrinsics/mathexact/MulExactIRepeatTest.java b/hotspot/test/compiler/intrinsics/mathexact/MulExactIRepeatTest.java
index 5d1784e..a978a78 100644
--- a/hotspot/test/compiler/intrinsics/mathexact/MulExactIRepeatTest.java
+++ b/hotspot/test/compiler/intrinsics/mathexact/MulExactIRepeatTest.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,6 +26,8 @@
  * @bug 8026844
  * @summary Test repeating multiplyExact
  * @library /testlibrary
+ * @modules java.base/sun.misc
+ *          java.management
  * @compile MulExactIRepeatTest.java Verify.java
  * @run main MulExactIRepeatTest
  *
diff --git a/hotspot/test/compiler/intrinsics/mathexact/MulExactLConstantTest.java b/hotspot/test/compiler/intrinsics/mathexact/MulExactLConstantTest.java
index d830cf5..a0f5e9b 100644
--- a/hotspot/test/compiler/intrinsics/mathexact/MulExactLConstantTest.java
+++ b/hotspot/test/compiler/intrinsics/mathexact/MulExactLConstantTest.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,6 +26,8 @@
  * @bug 8026844
  * @summary Test constant mulExact
  * @library /testlibrary
+ * @modules java.base/sun.misc
+ *          java.management
  * @compile MulExactLConstantTest.java Verify.java
  * @run main MulExactLConstantTest
  *
diff --git a/hotspot/test/compiler/intrinsics/mathexact/MulExactLNonConstantTest.java b/hotspot/test/compiler/intrinsics/mathexact/MulExactLNonConstantTest.java
index c0f97a9..22e475f 100644
--- a/hotspot/test/compiler/intrinsics/mathexact/MulExactLNonConstantTest.java
+++ b/hotspot/test/compiler/intrinsics/mathexact/MulExactLNonConstantTest.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,6 +26,8 @@
  * @bug 8026844
  * @summary Test non constant mulExact
  * @library /testlibrary
+ * @modules java.base/sun.misc
+ *          java.management
  * @compile MulExactLNonConstantTest.java Verify.java
  * @run main MulExactLNonConstantTest
  *
diff --git a/hotspot/test/compiler/intrinsics/mathexact/NegExactIConstantTest.java b/hotspot/test/compiler/intrinsics/mathexact/NegExactIConstantTest.java
index a8e6c7c..c2f77b9 100644
--- a/hotspot/test/compiler/intrinsics/mathexact/NegExactIConstantTest.java
+++ b/hotspot/test/compiler/intrinsics/mathexact/NegExactIConstantTest.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,6 +26,8 @@
  * @bug 8026844
  * @summary Test constant negExact
  * @library /testlibrary
+ * @modules java.base/sun.misc
+ *          java.management
  * @compile NegExactIConstantTest.java Verify.java
  * @run main NegExactIConstantTest
  *
diff --git a/hotspot/test/compiler/intrinsics/mathexact/NegExactILoadTest.java b/hotspot/test/compiler/intrinsics/mathexact/NegExactILoadTest.java
index dfa8ba2..d4a92dc 100644
--- a/hotspot/test/compiler/intrinsics/mathexact/NegExactILoadTest.java
+++ b/hotspot/test/compiler/intrinsics/mathexact/NegExactILoadTest.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,6 +26,8 @@
  * @bug 8026844
  * @summary Test negExact
  * @library /testlibrary
+ * @modules java.base/sun.misc
+ *          java.management
  * @compile NegExactILoadTest.java Verify.java
  * @run main NegExactILoadTest
  *
diff --git a/hotspot/test/compiler/intrinsics/mathexact/NegExactILoopDependentTest.java b/hotspot/test/compiler/intrinsics/mathexact/NegExactILoopDependentTest.java
index 17e4973..3897a1f 100644
--- a/hotspot/test/compiler/intrinsics/mathexact/NegExactILoopDependentTest.java
+++ b/hotspot/test/compiler/intrinsics/mathexact/NegExactILoopDependentTest.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,6 +26,8 @@
  * @bug 8026844
  * @summary Test negExact loop dependent
  * @library /testlibrary
+ * @modules java.base/sun.misc
+ *          java.management
  * @compile NegExactILoopDependentTest.java Verify.java
  * @run main NegExactILoopDependentTest
  *
diff --git a/hotspot/test/compiler/intrinsics/mathexact/NegExactINonConstantTest.java b/hotspot/test/compiler/intrinsics/mathexact/NegExactINonConstantTest.java
index 883dc4f..703cf25 100644
--- a/hotspot/test/compiler/intrinsics/mathexact/NegExactINonConstantTest.java
+++ b/hotspot/test/compiler/intrinsics/mathexact/NegExactINonConstantTest.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,6 +26,8 @@
  * @bug 8026844
  * @summary Test non constant negExact
  * @library /testlibrary
+ * @modules java.base/sun.misc
+ *          java.management
  * @compile NegExactINonConstantTest.java Verify.java
  * @run main NegExactINonConstantTest
  *
diff --git a/hotspot/test/compiler/intrinsics/mathexact/NegExactLConstantTest.java b/hotspot/test/compiler/intrinsics/mathexact/NegExactLConstantTest.java
index 6425f81..52ea8a7 100644
--- a/hotspot/test/compiler/intrinsics/mathexact/NegExactLConstantTest.java
+++ b/hotspot/test/compiler/intrinsics/mathexact/NegExactLConstantTest.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,6 +26,8 @@
  * @bug 8026844
  * @summary Test constant negExact
  * @library /testlibrary
+ * @modules java.base/sun.misc
+ *          java.management
  * @compile NegExactLConstantTest.java Verify.java
  * @run main NegExactLConstantTest
  *
diff --git a/hotspot/test/compiler/intrinsics/mathexact/NegExactLNonConstantTest.java b/hotspot/test/compiler/intrinsics/mathexact/NegExactLNonConstantTest.java
index 105b80d..3932147 100644
--- a/hotspot/test/compiler/intrinsics/mathexact/NegExactLNonConstantTest.java
+++ b/hotspot/test/compiler/intrinsics/mathexact/NegExactLNonConstantTest.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,6 +26,8 @@
  * @bug 8026844
  * @summary Test constant negExact
  * @library /testlibrary
+ * @modules java.base/sun.misc
+ *          java.management
  * @compile NegExactLNonConstantTest.java Verify.java
  * @run main NegExactLNonConstantTest
  *
diff --git a/hotspot/test/compiler/intrinsics/mathexact/SubExactICondTest.java b/hotspot/test/compiler/intrinsics/mathexact/SubExactICondTest.java
index 213aa02..cef5919 100644
--- a/hotspot/test/compiler/intrinsics/mathexact/SubExactICondTest.java
+++ b/hotspot/test/compiler/intrinsics/mathexact/SubExactICondTest.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,6 +26,8 @@
  * @bug 8026844
  * @summary Test subtractExact as condition
  * @library /testlibrary
+ * @modules java.base/sun.misc
+ *          java.management
  * @compile SubExactICondTest.java Verify.java
  * @run main SubExactICondTest
  *
diff --git a/hotspot/test/compiler/intrinsics/mathexact/SubExactIConstantTest.java b/hotspot/test/compiler/intrinsics/mathexact/SubExactIConstantTest.java
index 094b474..96127d1 100644
--- a/hotspot/test/compiler/intrinsics/mathexact/SubExactIConstantTest.java
+++ b/hotspot/test/compiler/intrinsics/mathexact/SubExactIConstantTest.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,6 +26,8 @@
  * @bug 8026844
  * @summary Test constant subtractExact
  * @library /testlibrary
+ * @modules java.base/sun.misc
+ *          java.management
  * @compile SubExactIConstantTest.java Verify.java
  * @run main SubExactIConstantTest
  *
diff --git a/hotspot/test/compiler/intrinsics/mathexact/SubExactILoadTest.java b/hotspot/test/compiler/intrinsics/mathexact/SubExactILoadTest.java
index 976bf9b..7b8f017 100644
--- a/hotspot/test/compiler/intrinsics/mathexact/SubExactILoadTest.java
+++ b/hotspot/test/compiler/intrinsics/mathexact/SubExactILoadTest.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,6 +26,8 @@
  * @bug 8026844
  * @summary Test non constant subtractExact
  * @library /testlibrary
+ * @modules java.base/sun.misc
+ *          java.management
  * @compile SubExactILoadTest.java Verify.java
  * @run main SubExactILoadTest
  *
diff --git a/hotspot/test/compiler/intrinsics/mathexact/SubExactILoopDependentTest.java b/hotspot/test/compiler/intrinsics/mathexact/SubExactILoopDependentTest.java
index 959bbb9..71ea0dc 100644
--- a/hotspot/test/compiler/intrinsics/mathexact/SubExactILoopDependentTest.java
+++ b/hotspot/test/compiler/intrinsics/mathexact/SubExactILoopDependentTest.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,6 +26,8 @@
  * @bug 8026844
  * @summary Test non constant subtractExact
  * @library /testlibrary
+ * @modules java.base/sun.misc
+ *          java.management
  * @compile SubExactILoopDependentTest.java Verify.java
  * @run main SubExactILoopDependentTest
  *
diff --git a/hotspot/test/compiler/intrinsics/mathexact/SubExactINonConstantTest.java b/hotspot/test/compiler/intrinsics/mathexact/SubExactINonConstantTest.java
index 74f41f3..c0de7d3 100644
--- a/hotspot/test/compiler/intrinsics/mathexact/SubExactINonConstantTest.java
+++ b/hotspot/test/compiler/intrinsics/mathexact/SubExactINonConstantTest.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,6 +26,8 @@
  * @bug 8026844
  * @summary Test non constant subtractExact
  * @library /testlibrary
+ * @modules java.base/sun.misc
+ *          java.management
  * @compile SubExactINonConstantTest.java Verify.java
  * @run main SubExactINonConstantTest
  *
diff --git a/hotspot/test/compiler/intrinsics/mathexact/SubExactIRepeatTest.java b/hotspot/test/compiler/intrinsics/mathexact/SubExactIRepeatTest.java
index a7494c7..698b36e 100644
--- a/hotspot/test/compiler/intrinsics/mathexact/SubExactIRepeatTest.java
+++ b/hotspot/test/compiler/intrinsics/mathexact/SubExactIRepeatTest.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,6 +26,8 @@
  * @bug 8026844
  * @summary Test repeating subtractExact
  * @library /testlibrary
+ * @modules java.base/sun.misc
+ *          java.management
  * @compile SubExactIRepeatTest.java Verify.java
  * @run main SubExactIRepeatTest
  *
diff --git a/hotspot/test/compiler/intrinsics/mathexact/SubExactLConstantTest.java b/hotspot/test/compiler/intrinsics/mathexact/SubExactLConstantTest.java
index 6742761..7228868 100644
--- a/hotspot/test/compiler/intrinsics/mathexact/SubExactLConstantTest.java
+++ b/hotspot/test/compiler/intrinsics/mathexact/SubExactLConstantTest.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -27,6 +27,8 @@
  * @bug 8027353
  * @summary Test constant subtractExact
  * @library /testlibrary
+ * @modules java.base/sun.misc
+ *          java.management
  * @compile SubExactLConstantTest.java Verify.java
  * @run main SubExactLConstantTest
  *
diff --git a/hotspot/test/compiler/intrinsics/mathexact/SubExactLNonConstantTest.java b/hotspot/test/compiler/intrinsics/mathexact/SubExactLNonConstantTest.java
index ec68f88..942939e 100644
--- a/hotspot/test/compiler/intrinsics/mathexact/SubExactLNonConstantTest.java
+++ b/hotspot/test/compiler/intrinsics/mathexact/SubExactLNonConstantTest.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -27,6 +27,8 @@
  * @bug 8027353
  * @summary Test non constant subtractExact
  * @library /testlibrary
+ * @modules java.base/sun.misc
+ *          java.management
  * @compile SubExactLNonConstantTest.java Verify.java
  * @run main SubExactLNonConstantTest
  *
diff --git a/hotspot/test/compiler/intrinsics/mathexact/sanity/AddExactIntTest.java b/hotspot/test/compiler/intrinsics/mathexact/sanity/AddExactIntTest.java
index 5db9df2..9994838 100644
--- a/hotspot/test/compiler/intrinsics/mathexact/sanity/AddExactIntTest.java
+++ b/hotspot/test/compiler/intrinsics/mathexact/sanity/AddExactIntTest.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,6 +25,8 @@
  * @test
  * @library /testlibrary /../../test/lib /compiler/whitebox
  *          /compiler/testlibrary
+ * @modules java.base/sun.misc
+ *          java.management
  * @build AddExactIntTest
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
diff --git a/hotspot/test/compiler/intrinsics/mathexact/sanity/AddExactLongTest.java b/hotspot/test/compiler/intrinsics/mathexact/sanity/AddExactLongTest.java
index 7b68e70..f13cabd 100644
--- a/hotspot/test/compiler/intrinsics/mathexact/sanity/AddExactLongTest.java
+++ b/hotspot/test/compiler/intrinsics/mathexact/sanity/AddExactLongTest.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,6 +25,8 @@
  * @test
  * @library /testlibrary /../../test/lib /compiler/whitebox
  *          /compiler/testlibrary
+ * @modules java.base/sun.misc
+ *          java.management
  * @build AddExactLongTest
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
diff --git a/hotspot/test/compiler/intrinsics/mathexact/sanity/DecrementExactIntTest.java b/hotspot/test/compiler/intrinsics/mathexact/sanity/DecrementExactIntTest.java
index a261d4c..1569e13 100644
--- a/hotspot/test/compiler/intrinsics/mathexact/sanity/DecrementExactIntTest.java
+++ b/hotspot/test/compiler/intrinsics/mathexact/sanity/DecrementExactIntTest.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,6 +25,8 @@
  * @test
  * @library /testlibrary /../../test/lib /compiler/whitebox
  *          /compiler/testlibrary
+ * @modules java.base/sun.misc
+ *          java.management
  * @build DecrementExactIntTest
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
diff --git a/hotspot/test/compiler/intrinsics/mathexact/sanity/DecrementExactLongTest.java b/hotspot/test/compiler/intrinsics/mathexact/sanity/DecrementExactLongTest.java
index 527bdc7..7dc1f32 100644
--- a/hotspot/test/compiler/intrinsics/mathexact/sanity/DecrementExactLongTest.java
+++ b/hotspot/test/compiler/intrinsics/mathexact/sanity/DecrementExactLongTest.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,6 +25,8 @@
  * @test
  * @library /testlibrary /../../test/lib /compiler/whitebox
  *          /compiler/testlibrary
+ * @modules java.base/sun.misc
+ *          java.management
  * @build DecrementExactLongTest
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
diff --git a/hotspot/test/compiler/intrinsics/mathexact/sanity/IncrementExactIntTest.java b/hotspot/test/compiler/intrinsics/mathexact/sanity/IncrementExactIntTest.java
index dee345c..f3b9df23 100644
--- a/hotspot/test/compiler/intrinsics/mathexact/sanity/IncrementExactIntTest.java
+++ b/hotspot/test/compiler/intrinsics/mathexact/sanity/IncrementExactIntTest.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,6 +25,8 @@
  * @test
  * @library /testlibrary /../../test/lib /compiler/whitebox
  *          /compiler/testlibrary
+ * @modules java.base/sun.misc
+ *          java.management
  * @build IncrementExactIntTest
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
diff --git a/hotspot/test/compiler/intrinsics/mathexact/sanity/IncrementExactLongTest.java b/hotspot/test/compiler/intrinsics/mathexact/sanity/IncrementExactLongTest.java
index e72ebb2..da230bb 100644
--- a/hotspot/test/compiler/intrinsics/mathexact/sanity/IncrementExactLongTest.java
+++ b/hotspot/test/compiler/intrinsics/mathexact/sanity/IncrementExactLongTest.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,6 +25,8 @@
  * @test
  * @library /testlibrary /../../test/lib /compiler/whitebox
  *          /compiler/testlibrary
+ * @modules java.base/sun.misc
+ *          java.management
  * @build IncrementExactLongTest
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
diff --git a/hotspot/test/compiler/intrinsics/mathexact/sanity/MultiplyExactIntTest.java b/hotspot/test/compiler/intrinsics/mathexact/sanity/MultiplyExactIntTest.java
index 195c00d..f529dfe 100644
--- a/hotspot/test/compiler/intrinsics/mathexact/sanity/MultiplyExactIntTest.java
+++ b/hotspot/test/compiler/intrinsics/mathexact/sanity/MultiplyExactIntTest.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,6 +25,8 @@
  * @test
  * @library /testlibrary /../../test/lib /compiler/whitebox
  *          /compiler/testlibrary
+ * @modules java.base/sun.misc
+ *          java.management
  * @build MultiplyExactIntTest
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
diff --git a/hotspot/test/compiler/intrinsics/mathexact/sanity/MultiplyExactLongTest.java b/hotspot/test/compiler/intrinsics/mathexact/sanity/MultiplyExactLongTest.java
index 3773000..0829f1f 100644
--- a/hotspot/test/compiler/intrinsics/mathexact/sanity/MultiplyExactLongTest.java
+++ b/hotspot/test/compiler/intrinsics/mathexact/sanity/MultiplyExactLongTest.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,6 +25,8 @@
  * @test
  * @library /testlibrary /../../test/lib /compiler/whitebox
  *          /compiler/testlibrary
+ * @modules java.base/sun.misc
+ *          java.management
  * @build MultiplyExactLongTest
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
diff --git a/hotspot/test/compiler/intrinsics/mathexact/sanity/NegateExactIntTest.java b/hotspot/test/compiler/intrinsics/mathexact/sanity/NegateExactIntTest.java
index 1151cf0..c0f07f51e 100644
--- a/hotspot/test/compiler/intrinsics/mathexact/sanity/NegateExactIntTest.java
+++ b/hotspot/test/compiler/intrinsics/mathexact/sanity/NegateExactIntTest.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,6 +25,8 @@
  * @test
  * @library /testlibrary /../../test/lib /compiler/whitebox
  *          /compiler/testlibrary
+ * @modules java.base/sun.misc
+ *          java.management
  * @build NegateExactIntTest
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
diff --git a/hotspot/test/compiler/intrinsics/mathexact/sanity/NegateExactLongTest.java b/hotspot/test/compiler/intrinsics/mathexact/sanity/NegateExactLongTest.java
index c54ce3b..7c8da0e 100644
--- a/hotspot/test/compiler/intrinsics/mathexact/sanity/NegateExactLongTest.java
+++ b/hotspot/test/compiler/intrinsics/mathexact/sanity/NegateExactLongTest.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,6 +25,8 @@
  * @test
  * @library /testlibrary /../../test/lib /compiler/whitebox
  *          /compiler/testlibrary
+ * @modules java.base/sun.misc
+ *          java.management
  * @build NegateExactLongTest
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
diff --git a/hotspot/test/compiler/intrinsics/mathexact/sanity/SubtractExactIntTest.java b/hotspot/test/compiler/intrinsics/mathexact/sanity/SubtractExactIntTest.java
index c9d9bac..23f10d6 100644
--- a/hotspot/test/compiler/intrinsics/mathexact/sanity/SubtractExactIntTest.java
+++ b/hotspot/test/compiler/intrinsics/mathexact/sanity/SubtractExactIntTest.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,6 +25,8 @@
  * @test
  * @library /testlibrary /../../test/lib /compiler/whitebox
  *          /compiler/testlibrary
+ * @modules java.base/sun.misc
+ *          java.management
  * @build SubtractExactIntTest
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
diff --git a/hotspot/test/compiler/intrinsics/mathexact/sanity/SubtractExactLongTest.java b/hotspot/test/compiler/intrinsics/mathexact/sanity/SubtractExactLongTest.java
index ca61982..cf40b14 100644
--- a/hotspot/test/compiler/intrinsics/mathexact/sanity/SubtractExactLongTest.java
+++ b/hotspot/test/compiler/intrinsics/mathexact/sanity/SubtractExactLongTest.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,6 +25,8 @@
  * @test
  * @library /testlibrary /../../test/lib /compiler/whitebox
  *          /compiler/testlibrary
+ * @modules java.base/sun.misc
+ *          java.management
  * @build SubtractExactLongTest
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
diff --git a/hotspot/test/compiler/intrinsics/sha/cli/TestUseSHA1IntrinsicsOptionOnSupportedCPU.java b/hotspot/test/compiler/intrinsics/sha/cli/TestUseSHA1IntrinsicsOptionOnSupportedCPU.java
index ce6de95..335fd0d 100644
--- a/hotspot/test/compiler/intrinsics/sha/cli/TestUseSHA1IntrinsicsOptionOnSupportedCPU.java
+++ b/hotspot/test/compiler/intrinsics/sha/cli/TestUseSHA1IntrinsicsOptionOnSupportedCPU.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,6 +26,8 @@
  * @bug 8035968
  * @summary Verify UseSHA1Intrinsics option processing on supported CPU,
  * @library /testlibrary /../../test/lib /compiler/testlibrary testcases
+ * @modules java.base/sun.misc
+ *          java.management
  * @build TestUseSHA1IntrinsicsOptionOnSupportedCPU
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
diff --git a/hotspot/test/compiler/intrinsics/sha/cli/TestUseSHA1IntrinsicsOptionOnUnsupportedCPU.java b/hotspot/test/compiler/intrinsics/sha/cli/TestUseSHA1IntrinsicsOptionOnUnsupportedCPU.java
index 097d3b2..fe7b61b 100644
--- a/hotspot/test/compiler/intrinsics/sha/cli/TestUseSHA1IntrinsicsOptionOnUnsupportedCPU.java
+++ b/hotspot/test/compiler/intrinsics/sha/cli/TestUseSHA1IntrinsicsOptionOnUnsupportedCPU.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,6 +26,8 @@
  * @bug 8035968
  * @summary Verify UseSHA1Intrinsics option processing on unsupported CPU,
  * @library /testlibrary /../../test/lib /compiler/testlibrary testcases
+ * @modules java.base/sun.misc
+ *          java.management
  * @build TestUseSHA1IntrinsicsOptionOnUnsupportedCPU
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
diff --git a/hotspot/test/compiler/intrinsics/sha/cli/TestUseSHA256IntrinsicsOptionOnSupportedCPU.java b/hotspot/test/compiler/intrinsics/sha/cli/TestUseSHA256IntrinsicsOptionOnSupportedCPU.java
index 576b3e9..fb73192 100644
--- a/hotspot/test/compiler/intrinsics/sha/cli/TestUseSHA256IntrinsicsOptionOnSupportedCPU.java
+++ b/hotspot/test/compiler/intrinsics/sha/cli/TestUseSHA256IntrinsicsOptionOnSupportedCPU.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,6 +26,8 @@
  * @bug 8035968
  * @summary Verify UseSHA256Intrinsics option processing on supported CPU,
  * @library /testlibrary /../../test/lib /compiler/testlibrary testcases
+ * @modules java.base/sun.misc
+ *          java.management
  * @build TestUseSHA256IntrinsicsOptionOnSupportedCPU
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
diff --git a/hotspot/test/compiler/intrinsics/sha/cli/TestUseSHA256IntrinsicsOptionOnUnsupportedCPU.java b/hotspot/test/compiler/intrinsics/sha/cli/TestUseSHA256IntrinsicsOptionOnUnsupportedCPU.java
index 37c76b8..bfe7eb7 100644
--- a/hotspot/test/compiler/intrinsics/sha/cli/TestUseSHA256IntrinsicsOptionOnUnsupportedCPU.java
+++ b/hotspot/test/compiler/intrinsics/sha/cli/TestUseSHA256IntrinsicsOptionOnUnsupportedCPU.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,6 +26,8 @@
  * @bug 8035968
  * @summary Verify UseSHA256Intrinsics option processing on unsupported CPU,
  * @library /testlibrary /../../test/lib /compiler/testlibrary testcases
+ * @modules java.base/sun.misc
+ *          java.management
  * @build TestUseSHA256IntrinsicsOptionOnUnsupportedCPU
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
diff --git a/hotspot/test/compiler/intrinsics/sha/cli/TestUseSHA512IntrinsicsOptionOnSupportedCPU.java b/hotspot/test/compiler/intrinsics/sha/cli/TestUseSHA512IntrinsicsOptionOnSupportedCPU.java
index f030e3f..65c5dc1 100644
--- a/hotspot/test/compiler/intrinsics/sha/cli/TestUseSHA512IntrinsicsOptionOnSupportedCPU.java
+++ b/hotspot/test/compiler/intrinsics/sha/cli/TestUseSHA512IntrinsicsOptionOnSupportedCPU.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,6 +26,8 @@
  * @bug 8035968
  * @summary Verify UseSHA512Intrinsics option processing on supported CPU.
  * @library /testlibrary /../../test/lib /compiler/testlibrary testcases
+ * @modules java.base/sun.misc
+ *          java.management
  * @build TestUseSHA512IntrinsicsOptionOnSupportedCPU
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
diff --git a/hotspot/test/compiler/intrinsics/sha/cli/TestUseSHA512IntrinsicsOptionOnUnsupportedCPU.java b/hotspot/test/compiler/intrinsics/sha/cli/TestUseSHA512IntrinsicsOptionOnUnsupportedCPU.java
index 2c6fb68..d000438 100644
--- a/hotspot/test/compiler/intrinsics/sha/cli/TestUseSHA512IntrinsicsOptionOnUnsupportedCPU.java
+++ b/hotspot/test/compiler/intrinsics/sha/cli/TestUseSHA512IntrinsicsOptionOnUnsupportedCPU.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,6 +26,8 @@
  * @bug 8035968
  * @summary Verify UseSHA512Intrinsics option processing on unsupported CPU,
  * @library /testlibrary /../../test/lib /compiler/testlibrary testcases
+ * @modules java.base/sun.misc
+ *          java.management
  * @build TestUseSHA512IntrinsicsOptionOnUnsupportedCPU
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
diff --git a/hotspot/test/compiler/intrinsics/sha/cli/TestUseSHAOptionOnSupportedCPU.java b/hotspot/test/compiler/intrinsics/sha/cli/TestUseSHAOptionOnSupportedCPU.java
index 68f48be..e6b2400 100644
--- a/hotspot/test/compiler/intrinsics/sha/cli/TestUseSHAOptionOnSupportedCPU.java
+++ b/hotspot/test/compiler/intrinsics/sha/cli/TestUseSHAOptionOnSupportedCPU.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,6 +26,8 @@
  * @bug 8035968
  * @summary Verify UseSHA option processing on supported CPU,
  * @library /testlibrary /../../test/lib /compiler/testlibrary testcases
+ * @modules java.base/sun.misc
+ *          java.management
  * @build TestUseSHAOptionOnSupportedCPU
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
diff --git a/hotspot/test/compiler/intrinsics/sha/cli/TestUseSHAOptionOnUnsupportedCPU.java b/hotspot/test/compiler/intrinsics/sha/cli/TestUseSHAOptionOnUnsupportedCPU.java
index fb666af..3fbcd67 100644
--- a/hotspot/test/compiler/intrinsics/sha/cli/TestUseSHAOptionOnUnsupportedCPU.java
+++ b/hotspot/test/compiler/intrinsics/sha/cli/TestUseSHAOptionOnUnsupportedCPU.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,6 +26,8 @@
  * @bug 8035968
  * @summary Verify UseSHA option processing on unsupported CPU.
  * @library /testlibrary /../../test/lib /compiler/testlibrary testcases
+ * @modules java.base/sun.misc
+ *          java.management
  * @build TestUseSHAOptionOnUnsupportedCPU
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
diff --git a/hotspot/test/compiler/intrinsics/sha/sanity/TestSHA1Intrinsics.java b/hotspot/test/compiler/intrinsics/sha/sanity/TestSHA1Intrinsics.java
index d3e60ee..9423521 100644
--- a/hotspot/test/compiler/intrinsics/sha/sanity/TestSHA1Intrinsics.java
+++ b/hotspot/test/compiler/intrinsics/sha/sanity/TestSHA1Intrinsics.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,6 +26,8 @@
  * @bug 8035968
  * @summary Verify that SHA-1 intrinsic is actually used.
  * @library /testlibrary /../../test/lib /compiler/testlibrary ../
+ * @modules java.base/sun.misc
+ *          java.management
  * @build TestSHA intrinsics.Verifier TestSHA1Intrinsics
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
diff --git a/hotspot/test/compiler/intrinsics/sha/sanity/TestSHA1MultiBlockIntrinsics.java b/hotspot/test/compiler/intrinsics/sha/sanity/TestSHA1MultiBlockIntrinsics.java
index 1fca277..88c5972 100644
--- a/hotspot/test/compiler/intrinsics/sha/sanity/TestSHA1MultiBlockIntrinsics.java
+++ b/hotspot/test/compiler/intrinsics/sha/sanity/TestSHA1MultiBlockIntrinsics.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -28,6 +28,8 @@
  * @bug 8035968
  * @summary Verify that SHA-1 multi block intrinsic is actually used.
  * @library /testlibrary /../../test/lib /compiler/testlibrary ../
+ * @modules java.base/sun.misc
+ *          java.management
  * @build TestSHA intrinsics.Verifier TestSHA1MultiBlockIntrinsics
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
diff --git a/hotspot/test/compiler/intrinsics/sha/sanity/TestSHA256Intrinsics.java b/hotspot/test/compiler/intrinsics/sha/sanity/TestSHA256Intrinsics.java
index 0bc38ae..d579659 100644
--- a/hotspot/test/compiler/intrinsics/sha/sanity/TestSHA256Intrinsics.java
+++ b/hotspot/test/compiler/intrinsics/sha/sanity/TestSHA256Intrinsics.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -28,6 +28,8 @@
  * @bug 8035968
  * @summary Verify that SHA-256 intrinsic is actually used.
  * @library /testlibrary /../../test/lib /compiler/testlibrary ../
+ * @modules java.base/sun.misc
+ *          java.management
  * @build TestSHA intrinsics.Verifier TestSHA256Intrinsics
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
diff --git a/hotspot/test/compiler/intrinsics/sha/sanity/TestSHA256MultiBlockIntrinsics.java b/hotspot/test/compiler/intrinsics/sha/sanity/TestSHA256MultiBlockIntrinsics.java
index 39a5507..665d8d1 100644
--- a/hotspot/test/compiler/intrinsics/sha/sanity/TestSHA256MultiBlockIntrinsics.java
+++ b/hotspot/test/compiler/intrinsics/sha/sanity/TestSHA256MultiBlockIntrinsics.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -28,6 +28,8 @@
  * @bug 8035968
  * @summary Verify that SHA-256 multi block intrinsic is actually used.
  * @library /testlibrary /../../test/lib /compiler/testlibrary ../
+ * @modules java.base/sun.misc
+ *          java.management
  * @build TestSHA intrinsics.Verifier TestSHA256MultiBlockIntrinsics
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
diff --git a/hotspot/test/compiler/intrinsics/sha/sanity/TestSHA512Intrinsics.java b/hotspot/test/compiler/intrinsics/sha/sanity/TestSHA512Intrinsics.java
index e97d3a3..57a1cc9 100644
--- a/hotspot/test/compiler/intrinsics/sha/sanity/TestSHA512Intrinsics.java
+++ b/hotspot/test/compiler/intrinsics/sha/sanity/TestSHA512Intrinsics.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -28,6 +28,8 @@
  * @bug 8035968
  * @summary Verify that SHA-512 intrinsic is actually used.
  * @library /testlibrary /../../test/lib /compiler/testlibrary ../
+ * @modules java.base/sun.misc
+ *          java.management
  * @build TestSHA intrinsics.Verifier TestSHA512Intrinsics
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
diff --git a/hotspot/test/compiler/intrinsics/sha/sanity/TestSHA512MultiBlockIntrinsics.java b/hotspot/test/compiler/intrinsics/sha/sanity/TestSHA512MultiBlockIntrinsics.java
index d096d27..f6958d7 100644
--- a/hotspot/test/compiler/intrinsics/sha/sanity/TestSHA512MultiBlockIntrinsics.java
+++ b/hotspot/test/compiler/intrinsics/sha/sanity/TestSHA512MultiBlockIntrinsics.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -28,6 +28,8 @@
  * @bug 8035968
  * @summary Verify that SHA-512 multi block intrinsic is actually used.
  * @library /testlibrary /../../test/lib /compiler/testlibrary ../
+ * @modules java.base/sun.misc
+ *          java.management
  * @build TestSHA intrinsics.Verifier TestSHA512MultiBlockIntrinsics
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
diff --git a/hotspot/test/compiler/intrinsics/unsafe/UnsafeGetAddressTest.java b/hotspot/test/compiler/intrinsics/unsafe/UnsafeGetAddressTest.java
index 9e5772a..468a99d 100644
--- a/hotspot/test/compiler/intrinsics/unsafe/UnsafeGetAddressTest.java
+++ b/hotspot/test/compiler/intrinsics/unsafe/UnsafeGetAddressTest.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,6 +25,7 @@
  * @test
  * @bug 6653795
  * @summary C2 intrinsic for Unsafe.getAddress performs pointer sign extension on 32-bit systems
+ * @modules java.base/sun.misc
  * @run main UnsafeGetAddressTest
  *
  */
diff --git a/hotspot/test/compiler/jsr292/ConcurrentClassLoadingTest.java b/hotspot/test/compiler/jsr292/ConcurrentClassLoadingTest.java
index 3aa6b06..56b2526 100644
--- a/hotspot/test/compiler/jsr292/ConcurrentClassLoadingTest.java
+++ b/hotspot/test/compiler/jsr292/ConcurrentClassLoadingTest.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,6 +26,8 @@
  * @bug 8022595
  * @summary JSR292: deadlock during class loading of MethodHandles, MethodHandleImpl & MethodHandleNatives
  * @library /testlibrary
+ * @modules java.base/sun.misc
+ *          java.management
  * @run main/othervm ConcurrentClassLoadingTest
  */
 import com.oracle.java.testlibrary.Utils;
diff --git a/hotspot/test/compiler/jsr292/CreatesInterfaceDotEqualsCallInfo.java b/hotspot/test/compiler/jsr292/CreatesInterfaceDotEqualsCallInfo.java
index 0230702..8581064 100644
--- a/hotspot/test/compiler/jsr292/CreatesInterfaceDotEqualsCallInfo.java
+++ b/hotspot/test/compiler/jsr292/CreatesInterfaceDotEqualsCallInfo.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,7 +26,7 @@
  * @test
  * @bug 8026124
  * @summary Javascript file provoked assertion failure in linkResolver.cpp
- *
+ * @modules jdk.scripting.nashorn/jdk.nashorn.tools
  * @run main/othervm CreatesInterfaceDotEqualsCallInfo
  */
 
diff --git a/hotspot/test/compiler/jsr292/RedefineMethodUsedByMultipleMethodHandles.java b/hotspot/test/compiler/jsr292/RedefineMethodUsedByMultipleMethodHandles.java
index 1695c35..deee0ec 100644
--- a/hotspot/test/compiler/jsr292/RedefineMethodUsedByMultipleMethodHandles.java
+++ b/hotspot/test/compiler/jsr292/RedefineMethodUsedByMultipleMethodHandles.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,6 +25,10 @@
  * @test
  * @bug 8042235
  * @summary redefining method used by multiple MethodHandles crashes VM
+ * @modules java.base/jdk.internal.org.objectweb.asm
+ *          java.compiler
+ *          java.instrument
+ *          java.management
  * @compile -XDignore.symbol.file RedefineMethodUsedByMultipleMethodHandles.java
  * @run main RedefineMethodUsedByMultipleMethodHandles
  */
diff --git a/hotspot/test/compiler/jsr292/VMAnonymousClasses.java b/hotspot/test/compiler/jsr292/VMAnonymousClasses.java
index dc8b577..efe252f 100644
--- a/hotspot/test/compiler/jsr292/VMAnonymousClasses.java
+++ b/hotspot/test/compiler/jsr292/VMAnonymousClasses.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -24,6 +24,8 @@
 /**
  * @test
  * @bug 8058828
+ * @modules java.base/jdk.internal.org.objectweb.asm
+ *          java.base/sun.misc
  * @run main/bootclasspath -Xbatch VMAnonymousClasses
  */
 
diff --git a/hotspot/test/compiler/jsr292/methodHandleExceptions/TestAMEnotNPE.java b/hotspot/test/compiler/jsr292/methodHandleExceptions/TestAMEnotNPE.java
index 0e525de..93fe9bd 100644
--- a/hotspot/test/compiler/jsr292/methodHandleExceptions/TestAMEnotNPE.java
+++ b/hotspot/test/compiler/jsr292/methodHandleExceptions/TestAMEnotNPE.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -35,6 +35,7 @@
  * @test @bug 8025260 8016839
  * @summary Ensure that AbstractMethodError and IllegalAccessError are thrown appropriately, not NullPointerException
  *
+ * @modules java.base/jdk.internal.org.objectweb.asm
  * @compile -XDignore.symbol.file TestAMEnotNPE.java ByteClassLoader.java p/C.java p/Dok.java p/E.java p/F.java p/I.java p/Tdirect.java p/Treflect.java
  *
  * @run main/othervm TestAMEnotNPE
diff --git a/hotspot/test/compiler/oracle/CheckCompileCommandOption.java b/hotspot/test/compiler/oracle/CheckCompileCommandOption.java
index 6d69b5e..b78d2ff 100644
--- a/hotspot/test/compiler/oracle/CheckCompileCommandOption.java
+++ b/hotspot/test/compiler/oracle/CheckCompileCommandOption.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -31,6 +31,8 @@
  * @bug 8055286 8056964 8059847 8069035
  * @summary "Checks parsing of -XX:CompileCommand=option"
  * @library /testlibrary
+ * @modules java.base/sun.misc
+ *          java.management
  * @run main CheckCompileCommandOption
  */
 
diff --git a/hotspot/test/compiler/oracle/TestCompileCommand.java b/hotspot/test/compiler/oracle/TestCompileCommand.java
index e2575ed..62c59db 100644
--- a/hotspot/test/compiler/oracle/TestCompileCommand.java
+++ b/hotspot/test/compiler/oracle/TestCompileCommand.java
@@ -31,6 +31,8 @@
  * @bug 8069389
  * @summary "Regression tests of -XX:CompileCommand"
  * @library /testlibrary
+ * @modules java.base/sun.misc
+ *          java.management
  * @run main TestCompileCommand
  */
 
diff --git a/hotspot/test/compiler/osr/TestOSRWithNonEmptyStack.java b/hotspot/test/compiler/osr/TestOSRWithNonEmptyStack.java
index 82bbfc2..516d485 100644
--- a/hotspot/test/compiler/osr/TestOSRWithNonEmptyStack.java
+++ b/hotspot/test/compiler/osr/TestOSRWithNonEmptyStack.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -33,6 +33,7 @@
  * @test
  * @bug 8051344
  * @summary Force OSR compilation with non-empty stack at the OSR entry point.
+ * @modules java.base/jdk.internal.org.objectweb.asm
  * @compile -XDignore.symbol.file TestOSRWithNonEmptyStack.java
  * @run main/othervm -XX:CompileOnly=TestCase.test TestOSRWithNonEmptyStack
  */
diff --git a/hotspot/test/compiler/profiling/spectrapredefineclass/Launcher.java b/hotspot/test/compiler/profiling/spectrapredefineclass/Launcher.java
index 7a645ab..0f6d325 100644
--- a/hotspot/test/compiler/profiling/spectrapredefineclass/Launcher.java
+++ b/hotspot/test/compiler/profiling/spectrapredefineclass/Launcher.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -27,6 +27,9 @@
  * @test
  * @bug 8038636
  * @library /testlibrary
+ * @modules java.base/sun.misc
+ *          java.instrument
+ *          java.management
  * @build Agent
  * @run main ClassFileInstaller Agent
  * @run main Launcher
diff --git a/hotspot/test/compiler/profiling/spectrapredefineclass_classloaders/Launcher.java b/hotspot/test/compiler/profiling/spectrapredefineclass_classloaders/Launcher.java
index 3c49cd5..dc7f693 100644
--- a/hotspot/test/compiler/profiling/spectrapredefineclass_classloaders/Launcher.java
+++ b/hotspot/test/compiler/profiling/spectrapredefineclass_classloaders/Launcher.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -27,6 +27,9 @@
  * @test
  * @bug 8040237
  * @library /testlibrary
+ * @modules java.base/sun.misc
+ *          java.instrument
+ *          java.management
  * @build Agent Test A B
  * @run main ClassFileInstaller Agent
  * @run main Launcher
diff --git a/hotspot/test/compiler/rangechecks/TestRangeCheckSmearing.java b/hotspot/test/compiler/rangechecks/TestRangeCheckSmearing.java
index 4eae380..33ca4c3 100644
--- a/hotspot/test/compiler/rangechecks/TestRangeCheckSmearing.java
+++ b/hotspot/test/compiler/rangechecks/TestRangeCheckSmearing.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,6 +26,8 @@
  * @bug 8066103
  * @summary C2's range check smearing allows out of bound array accesses
  * @library /testlibrary /../../test/lib /compiler/whitebox
+ * @modules java.base/sun.misc
+ *          java.management
  * @build TestRangeCheckSmearing
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  * @run main ClassFileInstaller com.oracle.java.testlibrary.Platform
diff --git a/hotspot/test/compiler/rtm/cli/TestPrintPreciseRTMLockingStatisticsOptionOnSupportedConfig.java b/hotspot/test/compiler/rtm/cli/TestPrintPreciseRTMLockingStatisticsOptionOnSupportedConfig.java
index cf3ebab..5cc7480 100644
--- a/hotspot/test/compiler/rtm/cli/TestPrintPreciseRTMLockingStatisticsOptionOnSupportedConfig.java
+++ b/hotspot/test/compiler/rtm/cli/TestPrintPreciseRTMLockingStatisticsOptionOnSupportedConfig.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -28,6 +28,8 @@
  * @summary Verify PrintPreciseRTMLockingStatistics on CPUs with
  *          rtm support and on VM with rtm locking support,
  * @library /testlibrary /../../test/lib /compiler/testlibrary
+ * @modules java.base/sun.misc
+ *          java.management
  * @build TestPrintPreciseRTMLockingStatisticsOptionOnSupportedConfig
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
diff --git a/hotspot/test/compiler/rtm/cli/TestPrintPreciseRTMLockingStatisticsOptionOnUnsupportedConfig.java b/hotspot/test/compiler/rtm/cli/TestPrintPreciseRTMLockingStatisticsOptionOnUnsupportedConfig.java
index b3e7bbe..afd4949 100644
--- a/hotspot/test/compiler/rtm/cli/TestPrintPreciseRTMLockingStatisticsOptionOnUnsupportedConfig.java
+++ b/hotspot/test/compiler/rtm/cli/TestPrintPreciseRTMLockingStatisticsOptionOnUnsupportedConfig.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -28,6 +28,8 @@
  * @summary Verify PrintPreciseRTMLockingStatistics on CPUs without
  *          rtm support and/or unsupported VM.
  * @library /testlibrary /../../test/lib /compiler/testlibrary
+ * @modules java.base/sun.misc
+ *          java.management
  * @build TestPrintPreciseRTMLockingStatisticsOptionOnUnsupportedConfig
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
diff --git a/hotspot/test/compiler/rtm/cli/TestRTMAbortRatioOptionOnSupportedConfig.java b/hotspot/test/compiler/rtm/cli/TestRTMAbortRatioOptionOnSupportedConfig.java
index a44cf8c..37f9439 100644
--- a/hotspot/test/compiler/rtm/cli/TestRTMAbortRatioOptionOnSupportedConfig.java
+++ b/hotspot/test/compiler/rtm/cli/TestRTMAbortRatioOptionOnSupportedConfig.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -28,6 +28,8 @@
  * @summary Verify RTMAbortRatio option processing on CPU with rtm
  *          support and on VM with rtm locking support.
  * @library /testlibrary /../../test/lib /compiler/testlibrary
+ * @modules java.base/sun.misc
+ *          java.management
  * @build TestRTMAbortRatioOptionOnSupportedConfig
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
diff --git a/hotspot/test/compiler/rtm/cli/TestRTMAbortRatioOptionOnUnsupportedConfig.java b/hotspot/test/compiler/rtm/cli/TestRTMAbortRatioOptionOnUnsupportedConfig.java
index 3dfd893..c110e3c 100644
--- a/hotspot/test/compiler/rtm/cli/TestRTMAbortRatioOptionOnUnsupportedConfig.java
+++ b/hotspot/test/compiler/rtm/cli/TestRTMAbortRatioOptionOnUnsupportedConfig.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -28,6 +28,8 @@
  * @summary Verify RTMAbortRatio option processing on CPU without rtm
  *          support or on VM that does not support rtm locking.
  * @library /testlibrary /../../test/lib /compiler/testlibrary
+ * @modules java.base/sun.misc
+ *          java.management
  * @build TestRTMAbortRatioOptionOnUnsupportedConfig
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
diff --git a/hotspot/test/compiler/rtm/cli/TestRTMAbortThresholdOption.java b/hotspot/test/compiler/rtm/cli/TestRTMAbortThresholdOption.java
index 120d6f9..d43e7c2 100644
--- a/hotspot/test/compiler/rtm/cli/TestRTMAbortThresholdOption.java
+++ b/hotspot/test/compiler/rtm/cli/TestRTMAbortThresholdOption.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -27,6 +27,8 @@
  * @bug 8031320
  * @summary Verify processing of RTMAbortThreshold option.
  * @library /testlibrary
+ * @modules java.base/sun.misc
+ *          java.management
  * @build TestRTMAbortThresholdOption
  * @run main/othervm TestRTMAbortThresholdOption
  */
diff --git a/hotspot/test/compiler/rtm/cli/TestRTMLockingCalculationDelayOption.java b/hotspot/test/compiler/rtm/cli/TestRTMLockingCalculationDelayOption.java
index 90e85e6..7a059c1 100644
--- a/hotspot/test/compiler/rtm/cli/TestRTMLockingCalculationDelayOption.java
+++ b/hotspot/test/compiler/rtm/cli/TestRTMLockingCalculationDelayOption.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -27,6 +27,8 @@
  * @bug 8031320
  * @summary Verify processing of RTMLockingCalculationDelay option.
  * @library /testlibrary
+ * @modules java.base/sun.misc
+ *          java.management
  * @build TestRTMLockingCalculationDelayOption
  * @run main/othervm TestRTMLockingCalculationDelayOption
  */
diff --git a/hotspot/test/compiler/rtm/cli/TestRTMLockingThresholdOption.java b/hotspot/test/compiler/rtm/cli/TestRTMLockingThresholdOption.java
index 81f2e60..9f13b74 100644
--- a/hotspot/test/compiler/rtm/cli/TestRTMLockingThresholdOption.java
+++ b/hotspot/test/compiler/rtm/cli/TestRTMLockingThresholdOption.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -27,6 +27,8 @@
  * @bug 8031320
  * @summary Verify processing of RTMLockingThreshold option.
  * @library /testlibrary
+ * @modules java.base/sun.misc
+ *          java.management
  * @build TestRTMLockingThresholdOption
  * @run main/othervm TestRTMLockingThresholdOption
  */
diff --git a/hotspot/test/compiler/rtm/cli/TestRTMRetryCountOption.java b/hotspot/test/compiler/rtm/cli/TestRTMRetryCountOption.java
index 0d4e52c..f083248 100644
--- a/hotspot/test/compiler/rtm/cli/TestRTMRetryCountOption.java
+++ b/hotspot/test/compiler/rtm/cli/TestRTMRetryCountOption.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -27,6 +27,8 @@
  * @bug 8031320
  * @summary Verify processing of RTMRetryCount option.
  * @library /testlibrary
+ * @modules java.base/sun.misc
+ *          java.management
  * @build TestRTMRetryCountOption
  * @run main/othervm TestRTMRetryCountOption
  */
diff --git a/hotspot/test/compiler/rtm/cli/TestRTMSpinLoopCountOption.java b/hotspot/test/compiler/rtm/cli/TestRTMSpinLoopCountOption.java
index 33015d0..ec59cdb 100644
--- a/hotspot/test/compiler/rtm/cli/TestRTMSpinLoopCountOption.java
+++ b/hotspot/test/compiler/rtm/cli/TestRTMSpinLoopCountOption.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -27,6 +27,8 @@
  * @bug 8031320
  * @summary Verify processing of RTMSpinLoopCount option.
  * @library /testlibrary
+ * @modules java.base/sun.misc
+ *          java.management
  * @build TestRTMSpinLoopCountOption
  * @run main/othervm TestRTMSpinLoopCountOption
  */
diff --git a/hotspot/test/compiler/rtm/cli/TestRTMTotalCountIncrRateOptionOnSupportedConfig.java b/hotspot/test/compiler/rtm/cli/TestRTMTotalCountIncrRateOptionOnSupportedConfig.java
index 3e982c6..93e0222 100644
--- a/hotspot/test/compiler/rtm/cli/TestRTMTotalCountIncrRateOptionOnSupportedConfig.java
+++ b/hotspot/test/compiler/rtm/cli/TestRTMTotalCountIncrRateOptionOnSupportedConfig.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -28,6 +28,8 @@
  * @summary Verify RTMTotalCountIncrRate option processing on CPU with
  *          rtm support and on VM with rtm locking support.
  * @library /testlibrary /../../test/lib /compiler/testlibrary
+ * @modules java.base/sun.misc
+ *          java.management
  * @build TestRTMTotalCountIncrRateOptionOnSupportedConfig
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
diff --git a/hotspot/test/compiler/rtm/cli/TestRTMTotalCountIncrRateOptionOnUnsupportedConfig.java b/hotspot/test/compiler/rtm/cli/TestRTMTotalCountIncrRateOptionOnUnsupportedConfig.java
index 69617d4..1a90eda 100644
--- a/hotspot/test/compiler/rtm/cli/TestRTMTotalCountIncrRateOptionOnUnsupportedConfig.java
+++ b/hotspot/test/compiler/rtm/cli/TestRTMTotalCountIncrRateOptionOnUnsupportedConfig.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -33,6 +33,8 @@
  * @summary Verify RTMTotalCountIncrRate option processing on CPU without
  *          rtm support and/or on VM without rtm locking support.
  * @library /testlibrary /../../test/lib /compiler/testlibrary
+ * @modules java.base/sun.misc
+ *          java.management
  * @build TestRTMTotalCountIncrRateOptionOnUnsupportedConfig
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
diff --git a/hotspot/test/compiler/rtm/cli/TestUseRTMDeoptOptionOnSupportedConfig.java b/hotspot/test/compiler/rtm/cli/TestUseRTMDeoptOptionOnSupportedConfig.java
index de40746..1dbd945 100644
--- a/hotspot/test/compiler/rtm/cli/TestUseRTMDeoptOptionOnSupportedConfig.java
+++ b/hotspot/test/compiler/rtm/cli/TestUseRTMDeoptOptionOnSupportedConfig.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -28,6 +28,8 @@
  * @summary Verify UseRTMDeopt option processing on CPUs with rtm support
  *          when rtm locking is supported by VM.
  * @library /testlibrary /../../test/lib /compiler/testlibrary
+ * @modules java.base/sun.misc
+ *          java.management
  * @build TestUseRTMDeoptOptionOnSupportedConfig
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
diff --git a/hotspot/test/compiler/rtm/cli/TestUseRTMDeoptOptionOnUnsupportedConfig.java b/hotspot/test/compiler/rtm/cli/TestUseRTMDeoptOptionOnUnsupportedConfig.java
index 59f9f45..31a1c62 100644
--- a/hotspot/test/compiler/rtm/cli/TestUseRTMDeoptOptionOnUnsupportedConfig.java
+++ b/hotspot/test/compiler/rtm/cli/TestUseRTMDeoptOptionOnUnsupportedConfig.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -28,6 +28,8 @@
  * @summary Verify UseRTMDeopt option processing on CPUs without rtm support
  *          or on VMs without rtm locking support.
  * @library /testlibrary /../../test/lib /compiler/testlibrary
+ * @modules java.base/sun.misc
+ *          java.management
  * @build TestUseRTMDeoptOptionOnUnsupportedConfig
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
diff --git a/hotspot/test/compiler/rtm/cli/TestUseRTMForStackLocksOptionOnSupportedConfig.java b/hotspot/test/compiler/rtm/cli/TestUseRTMForStackLocksOptionOnSupportedConfig.java
index 692c396..d0227f5 100644
--- a/hotspot/test/compiler/rtm/cli/TestUseRTMForStackLocksOptionOnSupportedConfig.java
+++ b/hotspot/test/compiler/rtm/cli/TestUseRTMForStackLocksOptionOnSupportedConfig.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -28,6 +28,8 @@
  * @summary Verify UseRTMForStackLocks option processing on CPU with
  *          rtm support when VM supports rtm locking.
  * @library /testlibrary /../../test/lib /compiler/testlibrary
+ * @modules java.base/sun.misc
+ *          java.management
  * @build TestUseRTMForStackLocksOptionOnSupportedConfig
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
diff --git a/hotspot/test/compiler/rtm/cli/TestUseRTMForStackLocksOptionOnUnsupportedConfig.java b/hotspot/test/compiler/rtm/cli/TestUseRTMForStackLocksOptionOnUnsupportedConfig.java
index 829cb56..6952b22 100644
--- a/hotspot/test/compiler/rtm/cli/TestUseRTMForStackLocksOptionOnUnsupportedConfig.java
+++ b/hotspot/test/compiler/rtm/cli/TestUseRTMForStackLocksOptionOnUnsupportedConfig.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -28,6 +28,8 @@
  * @summary Verify UseRTMForStackLocks option processing on CPUs without
  *          rtm support and/or on VMs without rtm locking support.
  * @library /testlibrary /../../test/lib /compiler/testlibrary
+ * @modules java.base/sun.misc
+ *          java.management
  * @build TestUseRTMForStackLocksOptionOnUnsupportedConfig
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
diff --git a/hotspot/test/compiler/rtm/cli/TestUseRTMLockingOptionOnSupportedConfig.java b/hotspot/test/compiler/rtm/cli/TestUseRTMLockingOptionOnSupportedConfig.java
index 6012d56..69158c1 100644
--- a/hotspot/test/compiler/rtm/cli/TestUseRTMLockingOptionOnSupportedConfig.java
+++ b/hotspot/test/compiler/rtm/cli/TestUseRTMLockingOptionOnSupportedConfig.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -28,6 +28,8 @@
  * @summary Verify UseRTMLocking option processing on CPU with rtm support and
  *          on VM with rtm-locking support.
  * @library /testlibrary /../../test/lib /compiler/testlibrary
+ * @modules java.base/sun.misc
+ *          java.management
  * @build TestUseRTMLockingOptionOnSupportedConfig
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
diff --git a/hotspot/test/compiler/rtm/cli/TestUseRTMLockingOptionOnUnsupportedCPU.java b/hotspot/test/compiler/rtm/cli/TestUseRTMLockingOptionOnUnsupportedCPU.java
index 3fba16e..63adae5 100644
--- a/hotspot/test/compiler/rtm/cli/TestUseRTMLockingOptionOnUnsupportedCPU.java
+++ b/hotspot/test/compiler/rtm/cli/TestUseRTMLockingOptionOnUnsupportedCPU.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -28,6 +28,8 @@
  * @summary Verify UseRTMLocking option processing on CPU without
  *          rtm support.
  * @library /testlibrary /../../test/lib /compiler/testlibrary
+ * @modules java.base/sun.misc
+ *          java.management
  * @build TestUseRTMLockingOptionOnUnsupportedCPU
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
diff --git a/hotspot/test/compiler/rtm/cli/TestUseRTMLockingOptionOnUnsupportedVM.java b/hotspot/test/compiler/rtm/cli/TestUseRTMLockingOptionOnUnsupportedVM.java
index a031224..75d3930 100644
--- a/hotspot/test/compiler/rtm/cli/TestUseRTMLockingOptionOnUnsupportedVM.java
+++ b/hotspot/test/compiler/rtm/cli/TestUseRTMLockingOptionOnUnsupportedVM.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -28,6 +28,8 @@
  * @summary Verify UseRTMLocking option processing on CPU with rtm support
  *          in case when VM should not support this option.
  * @library /testlibrary /../../test/lib /compiler/testlibrary
+ * @modules java.base/sun.misc
+ *          java.management
  * @build TestUseRTMLockingOptionOnUnsupportedVM
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
diff --git a/hotspot/test/compiler/rtm/cli/TestUseRTMLockingOptionWithBiasedLocking.java b/hotspot/test/compiler/rtm/cli/TestUseRTMLockingOptionWithBiasedLocking.java
index ed82aec..1a7299e 100644
--- a/hotspot/test/compiler/rtm/cli/TestUseRTMLockingOptionWithBiasedLocking.java
+++ b/hotspot/test/compiler/rtm/cli/TestUseRTMLockingOptionWithBiasedLocking.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -28,6 +28,8 @@
  * @summary Verify processing of UseRTMLocking and UseBiasedLocking
  *          options combination on CPU and VM with rtm support.
  * @library /testlibrary /../../test/lib /compiler/testlibrary
+ * @modules java.base/sun.misc
+ *          java.management
  * @build TestUseRTMLockingOptionWithBiasedLocking
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
diff --git a/hotspot/test/compiler/rtm/cli/TestUseRTMXendForLockBusyOption.java b/hotspot/test/compiler/rtm/cli/TestUseRTMXendForLockBusyOption.java
index 0d112ce..af76b83 100644
--- a/hotspot/test/compiler/rtm/cli/TestUseRTMXendForLockBusyOption.java
+++ b/hotspot/test/compiler/rtm/cli/TestUseRTMXendForLockBusyOption.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -27,6 +27,8 @@
  * @bug 8031320
  * @summary Verify processing of UseRTMXendForLockBusy option.
  * @library /testlibrary
+ * @modules java.base/sun.misc
+ *          java.management
  * @build TestUseRTMXendForLockBusyOption
  * @run main/othervm TestUseRTMXendForLockBusyOption
  */
diff --git a/hotspot/test/compiler/rtm/locking/TestRTMAbortRatio.java b/hotspot/test/compiler/rtm/locking/TestRTMAbortRatio.java
index 4a41d37..1d3da36 100644
--- a/hotspot/test/compiler/rtm/locking/TestRTMAbortRatio.java
+++ b/hotspot/test/compiler/rtm/locking/TestRTMAbortRatio.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -28,6 +28,8 @@
  * @summary Verify that RTMAbortRatio affects amount of aborts before
  *          deoptimization.
  * @library /testlibrary /../../test/lib /compiler/testlibrary
+ * @modules java.base/sun.misc
+ *          java.management
  * @build TestRTMAbortRatio
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
diff --git a/hotspot/test/compiler/rtm/locking/TestRTMAbortThreshold.java b/hotspot/test/compiler/rtm/locking/TestRTMAbortThreshold.java
index 7bf1548..f177308 100644
--- a/hotspot/test/compiler/rtm/locking/TestRTMAbortThreshold.java
+++ b/hotspot/test/compiler/rtm/locking/TestRTMAbortThreshold.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -28,6 +28,8 @@
  * @summary Verify that RTMAbortThreshold option affects
  *          amount of aborts after which abort ratio is calculated.
  * @library /testlibrary /../../test/lib /compiler/testlibrary
+ * @modules java.base/sun.misc
+ *          java.management
  * @build TestRTMAbortThreshold
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
diff --git a/hotspot/test/compiler/rtm/locking/TestRTMAfterNonRTMDeopt.java b/hotspot/test/compiler/rtm/locking/TestRTMAfterNonRTMDeopt.java
index 5269a25..1b4647d 100644
--- a/hotspot/test/compiler/rtm/locking/TestRTMAfterNonRTMDeopt.java
+++ b/hotspot/test/compiler/rtm/locking/TestRTMAfterNonRTMDeopt.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -30,6 +30,8 @@
  *          method's RTM state. And if we don't use RTMDeopt, then
  *          RTM state remain the same after such deoptimization.
  * @library /testlibrary /../../test/lib /compiler/testlibrary
+ * @modules java.base/sun.misc
+ *          java.management
  * @build TestRTMAfterNonRTMDeopt
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
diff --git a/hotspot/test/compiler/rtm/locking/TestRTMDeoptOnHighAbortRatio.java b/hotspot/test/compiler/rtm/locking/TestRTMDeoptOnHighAbortRatio.java
index 0362bc9..d10ae07 100644
--- a/hotspot/test/compiler/rtm/locking/TestRTMDeoptOnHighAbortRatio.java
+++ b/hotspot/test/compiler/rtm/locking/TestRTMDeoptOnHighAbortRatio.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -28,6 +28,8 @@
  * @summary Verify that on high abort ratio method will be recompiled
  *          without rtm locking.
  * @library /testlibrary /../../test/lib /compiler/testlibrary
+ * @modules java.base/sun.misc
+ *          java.management
  * @build TestRTMDeoptOnHighAbortRatio
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
diff --git a/hotspot/test/compiler/rtm/locking/TestRTMDeoptOnLowAbortRatio.java b/hotspot/test/compiler/rtm/locking/TestRTMDeoptOnLowAbortRatio.java
index ae39ffb..c3ba476 100644
--- a/hotspot/test/compiler/rtm/locking/TestRTMDeoptOnLowAbortRatio.java
+++ b/hotspot/test/compiler/rtm/locking/TestRTMDeoptOnLowAbortRatio.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -27,6 +27,8 @@
  * @bug 8031320
  * @summary Verify that on low abort ratio method will be recompiled.
  * @library /testlibrary /../../test/lib /compiler/testlibrary
+ * @modules java.base/sun.misc
+ *          java.management
  * @build TestRTMDeoptOnLowAbortRatio
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
diff --git a/hotspot/test/compiler/rtm/locking/TestRTMLockingCalculationDelay.java b/hotspot/test/compiler/rtm/locking/TestRTMLockingCalculationDelay.java
index 6154494..6cb146a 100644
--- a/hotspot/test/compiler/rtm/locking/TestRTMLockingCalculationDelay.java
+++ b/hotspot/test/compiler/rtm/locking/TestRTMLockingCalculationDelay.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -28,6 +28,8 @@
  * @summary Verify that RTMLockingCalculationDelay affect when
  *          abort ratio calculation is started.
  * @library /testlibrary /../../test/lib /compiler/testlibrary
+ * @modules java.base/sun.misc
+ *          java.management
  * @build TestRTMLockingCalculationDelay
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
diff --git a/hotspot/test/compiler/rtm/locking/TestRTMLockingThreshold.java b/hotspot/test/compiler/rtm/locking/TestRTMLockingThreshold.java
index 66daef9..0a2ffa6 100644
--- a/hotspot/test/compiler/rtm/locking/TestRTMLockingThreshold.java
+++ b/hotspot/test/compiler/rtm/locking/TestRTMLockingThreshold.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -28,6 +28,8 @@
  * @summary Verify that RTMLockingThreshold affects rtm state transition
  *          ProfileRTM => UseRTM.
  * @library /testlibrary /../../test/lib /compiler/testlibrary
+ * @modules java.base/sun.misc
+ *          java.management
  * @build TestRTMLockingThreshold
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
diff --git a/hotspot/test/compiler/rtm/locking/TestRTMRetryCount.java b/hotspot/test/compiler/rtm/locking/TestRTMRetryCount.java
index 2c22c41..d4af4ad 100644
--- a/hotspot/test/compiler/rtm/locking/TestRTMRetryCount.java
+++ b/hotspot/test/compiler/rtm/locking/TestRTMRetryCount.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -27,6 +27,8 @@
  * @bug 8031320
  * @summary Verify that RTMRetryCount affects actual amount of retries.
  * @library /testlibrary /../../test/lib /compiler/testlibrary
+ * @modules java.base/sun.misc
+ *          java.management
  * @build TestRTMRetryCount
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
diff --git a/hotspot/test/compiler/rtm/locking/TestRTMSpinLoopCount.java b/hotspot/test/compiler/rtm/locking/TestRTMSpinLoopCount.java
index 121f5d3..dccefd4 100644
--- a/hotspot/test/compiler/rtm/locking/TestRTMSpinLoopCount.java
+++ b/hotspot/test/compiler/rtm/locking/TestRTMSpinLoopCount.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -28,6 +28,8 @@
  * @summary Verify that RTMSpinLoopCount affects time spent
  *          between locking attempts.
  * @library /testlibrary /../../test/lib /compiler/testlibrary
+ * @modules java.base/sun.misc
+ *          java.management
  * @build TestRTMSpinLoopCount
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
diff --git a/hotspot/test/compiler/rtm/locking/TestRTMTotalCountIncrRate.java b/hotspot/test/compiler/rtm/locking/TestRTMTotalCountIncrRate.java
index 56a66d0..9ea2d98 100644
--- a/hotspot/test/compiler/rtm/locking/TestRTMTotalCountIncrRate.java
+++ b/hotspot/test/compiler/rtm/locking/TestRTMTotalCountIncrRate.java
@@ -28,6 +28,8 @@
  * @summary Verify that RTMTotalCountIncrRate option affects
  *          RTM locking statistics.
  * @library /testlibrary /../../test/lib /compiler/testlibrary
+ * @modules java.base/sun.misc
+ *          java.management
  * @build TestRTMTotalCountIncrRate
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
diff --git a/hotspot/test/compiler/rtm/locking/TestUseRTMAfterLockInflation.java b/hotspot/test/compiler/rtm/locking/TestUseRTMAfterLockInflation.java
index a633470..5f33104 100644
--- a/hotspot/test/compiler/rtm/locking/TestUseRTMAfterLockInflation.java
+++ b/hotspot/test/compiler/rtm/locking/TestUseRTMAfterLockInflation.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -28,6 +28,8 @@
  * @summary Verify that rtm locking is used for stack locks before
  *          inflation and after it used for inflated locks.
  * @library /testlibrary /../../test/lib /compiler/testlibrary
+ * @modules java.base/sun.misc
+ *          java.management
  * @build TestUseRTMAfterLockInflation
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
diff --git a/hotspot/test/compiler/rtm/locking/TestUseRTMDeopt.java b/hotspot/test/compiler/rtm/locking/TestUseRTMDeopt.java
index 008e502..22af94d 100644
--- a/hotspot/test/compiler/rtm/locking/TestUseRTMDeopt.java
+++ b/hotspot/test/compiler/rtm/locking/TestUseRTMDeopt.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -28,6 +28,8 @@
  * @summary Verify that UseRTMDeopt affects uncommon trap installation in
  *          copmpiled methods with synchronized block.
  * @library /testlibrary /../../test/lib /compiler/testlibrary
+ * @modules java.base/sun.misc
+ *          java.management
  * @build TestUseRTMDeopt
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
diff --git a/hotspot/test/compiler/rtm/locking/TestUseRTMForInflatedLocks.java b/hotspot/test/compiler/rtm/locking/TestUseRTMForInflatedLocks.java
index 1555939..1f62b7b 100644
--- a/hotspot/test/compiler/rtm/locking/TestUseRTMForInflatedLocks.java
+++ b/hotspot/test/compiler/rtm/locking/TestUseRTMForInflatedLocks.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -27,6 +27,8 @@
  * @bug 8031320
  * @summary Verify that rtm locking is used for inflated locks.
  * @library /testlibrary /../../test/lib /compiler/testlibrary
+ * @modules java.base/sun.misc
+ *          java.management
  * @build TestUseRTMForInflatedLocks
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
diff --git a/hotspot/test/compiler/rtm/locking/TestUseRTMForStackLocks.java b/hotspot/test/compiler/rtm/locking/TestUseRTMForStackLocks.java
index 4c89320..1e8b21c 100644
--- a/hotspot/test/compiler/rtm/locking/TestUseRTMForStackLocks.java
+++ b/hotspot/test/compiler/rtm/locking/TestUseRTMForStackLocks.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -27,6 +27,8 @@
  * @bug 8031320
  * @summary Verify that rtm locking is used for stack locks.
  * @library /testlibrary /../../test/lib /compiler/testlibrary
+ * @modules java.base/sun.misc
+ *          java.management
  * @build TestUseRTMForStackLocks
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
diff --git a/hotspot/test/compiler/rtm/locking/TestUseRTMXendForLockBusy.java b/hotspot/test/compiler/rtm/locking/TestUseRTMXendForLockBusy.java
index f703dc8..4d36b4d 100644
--- a/hotspot/test/compiler/rtm/locking/TestUseRTMXendForLockBusy.java
+++ b/hotspot/test/compiler/rtm/locking/TestUseRTMXendForLockBusy.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -28,6 +28,8 @@
  * @summary Verify that UseRTMXendForLockBusy option affects
  *          method behaviour if lock is busy.
  * @library /testlibrary /../../test/lib /compiler/testlibrary
+ * @modules java.base/sun.misc
+ *          java.management
  * @build TestUseRTMXendForLockBusy
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
diff --git a/hotspot/test/compiler/rtm/method_options/TestNoRTMLockElidingOption.java b/hotspot/test/compiler/rtm/method_options/TestNoRTMLockElidingOption.java
index dc308b5..ff53c5e 100644
--- a/hotspot/test/compiler/rtm/method_options/TestNoRTMLockElidingOption.java
+++ b/hotspot/test/compiler/rtm/method_options/TestNoRTMLockElidingOption.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -28,6 +28,8 @@
  * @summary Verify that NoRTMLockEliding option could be applied to
  *          specified method and that such method will not use rtm.
  * @library /testlibrary /../../test/lib /compiler/testlibrary
+ * @modules java.base/sun.misc
+ *          java.management
  * @build TestNoRTMLockElidingOption
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
diff --git a/hotspot/test/compiler/rtm/method_options/TestUseRTMLockElidingOption.java b/hotspot/test/compiler/rtm/method_options/TestUseRTMLockElidingOption.java
index e2376ba..0fb71a2 100644
--- a/hotspot/test/compiler/rtm/method_options/TestUseRTMLockElidingOption.java
+++ b/hotspot/test/compiler/rtm/method_options/TestUseRTMLockElidingOption.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -29,6 +29,8 @@
  *          specified method and that such method will not be deoptimized
  *          on high abort ratio.
  * @library /testlibrary /../../test/lib /compiler/testlibrary
+ * @modules java.base/sun.misc
+ *          java.management
  * @build TestUseRTMLockElidingOption
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
diff --git a/hotspot/test/compiler/rtm/print/TestPrintPreciseRTMLockingStatistics.java b/hotspot/test/compiler/rtm/print/TestPrintPreciseRTMLockingStatistics.java
index 291d4ca..a93c84e 100644
--- a/hotspot/test/compiler/rtm/print/TestPrintPreciseRTMLockingStatistics.java
+++ b/hotspot/test/compiler/rtm/print/TestPrintPreciseRTMLockingStatistics.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -30,6 +30,8 @@
  *          different types. Test also verify that VM output does not
  *          contain rtm locking statistics when it should not.
  * @library /testlibrary /../../test/lib /compiler/testlibrary
+ * @modules java.base/sun.misc
+ *          java.management
  * @build TestPrintPreciseRTMLockingStatistics
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
diff --git a/hotspot/test/compiler/runtime/8010927/Test8010927.java b/hotspot/test/compiler/runtime/8010927/Test8010927.java
index bb52c4c..c00e814 100644
--- a/hotspot/test/compiler/runtime/8010927/Test8010927.java
+++ b/hotspot/test/compiler/runtime/8010927/Test8010927.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,6 +26,7 @@
  * @bug 8010927
  * @summary Kitchensink crashed with SIGSEGV, Problematic frame: v ~StubRoutines::checkcast_arraycopy
  * @library /../../test/lib /testlibrary
+ * @modules java.base/sun.misc
  * @build Test8010927
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
diff --git a/hotspot/test/compiler/startup/NumCompilerThreadsCheck.java b/hotspot/test/compiler/startup/NumCompilerThreadsCheck.java
index 1cfd757..f13d883 100644
--- a/hotspot/test/compiler/startup/NumCompilerThreadsCheck.java
+++ b/hotspot/test/compiler/startup/NumCompilerThreadsCheck.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,6 +26,8 @@
  * @bug 8034775
  * @summary Ensures correct minimal number of compiler threads (provided by -XX:CICompilerCount=)
  * @library /testlibrary
+ * @modules java.base/sun.misc
+ *          java.management
  */
 import com.oracle.java.testlibrary.*;
 
diff --git a/hotspot/test/compiler/startup/SmallCodeCacheStartup.java b/hotspot/test/compiler/startup/SmallCodeCacheStartup.java
index fa7a8b8..011ba28 100644
--- a/hotspot/test/compiler/startup/SmallCodeCacheStartup.java
+++ b/hotspot/test/compiler/startup/SmallCodeCacheStartup.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2014 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -28,6 +28,8 @@
  *          to initialize all compiler threads. The option -Xcomp gives the VM more time to
  *          trigger the old bug.
  * @library /testlibrary
+ * @modules java.base/sun.misc
+ *          java.management
  */
 import com.oracle.java.testlibrary.*;
 import static com.oracle.java.testlibrary.Asserts.assertTrue;
diff --git a/hotspot/test/compiler/startup/StartupOutput.java b/hotspot/test/compiler/startup/StartupOutput.java
index e4a1b4c..b408f2c 100644
--- a/hotspot/test/compiler/startup/StartupOutput.java
+++ b/hotspot/test/compiler/startup/StartupOutput.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,6 +26,8 @@
  * @bug 8026949
  * @summary Test ensures correct VM output during startup
  * @library /testlibrary
+ * @modules java.base/sun.misc
+ *          java.management
  */
 import com.oracle.java.testlibrary.*;
 
diff --git a/hotspot/test/compiler/tiered/ConstantGettersTransitionsTest.java b/hotspot/test/compiler/tiered/ConstantGettersTransitionsTest.java
index c55207a..3b3271d 100644
--- a/hotspot/test/compiler/tiered/ConstantGettersTransitionsTest.java
+++ b/hotspot/test/compiler/tiered/ConstantGettersTransitionsTest.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -27,6 +27,8 @@
 /**
  * @test ConstantGettersTransitionsTest
  * @library /testlibrary /../../test/lib /compiler/whitebox
+ * @modules java.base/sun.misc
+ *          java.management
  * @build TransitionsTestExecutor ConstantGettersTransitionsTest
  * @run main ClassFileInstaller sun.hotspot.WhiteBox sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm/timeout=240 -Xmixed -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
diff --git a/hotspot/test/compiler/tiered/LevelTransitionTest.java b/hotspot/test/compiler/tiered/LevelTransitionTest.java
index 8520609..26236ea 100644
--- a/hotspot/test/compiler/tiered/LevelTransitionTest.java
+++ b/hotspot/test/compiler/tiered/LevelTransitionTest.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -29,6 +29,8 @@
 /**
  * @test LevelTransitionTest
  * @library /testlibrary /../../test/lib /compiler/whitebox
+ * @modules java.base/sun.misc
+ *          java.management
  * @ignore 8067651
  * @build TransitionsTestExecutor LevelTransitionTest
  * @run main ClassFileInstaller sun.hotspot.WhiteBox sun.hotspot.WhiteBox$WhiteBoxPermission
diff --git a/hotspot/test/compiler/tiered/NonTieredLevelsTest.java b/hotspot/test/compiler/tiered/NonTieredLevelsTest.java
index 51b478f..510d7f6 100644
--- a/hotspot/test/compiler/tiered/NonTieredLevelsTest.java
+++ b/hotspot/test/compiler/tiered/NonTieredLevelsTest.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,6 +26,7 @@
 /**
  * @test NonTieredLevelsTest
  * @library /testlibrary /../../test/lib /compiler/whitebox
+ * @modules java.management
  * @build NonTieredLevelsTest
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
diff --git a/hotspot/test/compiler/tiered/TieredLevelsTest.java b/hotspot/test/compiler/tiered/TieredLevelsTest.java
index 1411a07..92c65c0 100644
--- a/hotspot/test/compiler/tiered/TieredLevelsTest.java
+++ b/hotspot/test/compiler/tiered/TieredLevelsTest.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -24,6 +24,7 @@
 /**
  * @test TieredLevelsTest
  * @library /testlibrary /../../test/lib /compiler/whitebox
+ * @modules java.management
  * @build TieredLevelsTest
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
diff --git a/hotspot/test/compiler/types/correctness/CorrectnessTest.java b/hotspot/test/compiler/types/correctness/CorrectnessTest.java
index c5239df..2d896ea 100644
--- a/hotspot/test/compiler/types/correctness/CorrectnessTest.java
+++ b/hotspot/test/compiler/types/correctness/CorrectnessTest.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,6 +25,8 @@
  * @test CorrectnessTest
  * @bug 8038418
  * @library /testlibrary /../../test/lib
+ * @modules java.base/sun.misc
+ *          java.management
  * @ignore 8066173
  * @compile execution/TypeConflict.java execution/TypeProfile.java
  *          execution/MethodHandleDelegate.java
diff --git a/hotspot/test/compiler/types/correctness/OffTest.java b/hotspot/test/compiler/types/correctness/OffTest.java
index 0125fe7..0c628b1 100644
--- a/hotspot/test/compiler/types/correctness/OffTest.java
+++ b/hotspot/test/compiler/types/correctness/OffTest.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,6 +25,8 @@
  * @test CorrectnessTest
  * @bug 8038418
  * @library /testlibrary /../../test/lib
+ * @modules java.base/sun.misc
+ *          java.management
  * @ignore 8066173
  * @compile execution/TypeConflict.java execution/TypeProfile.java
  *          execution/MethodHandleDelegate.java
diff --git a/hotspot/test/compiler/uncommontrap/TestUnstableIfTrap.java b/hotspot/test/compiler/uncommontrap/TestUnstableIfTrap.java
index 87aaf66..fe78d4c 100644
--- a/hotspot/test/compiler/uncommontrap/TestUnstableIfTrap.java
+++ b/hotspot/test/compiler/uncommontrap/TestUnstableIfTrap.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -41,6 +41,11 @@
  * @test
  * @bug 8030976 8059226
  * @library /testlibrary /compiler/testlibrary /../../test/lib
+ * @modules java.base/jdk.internal.org.objectweb.asm
+ *          java.base/sun.misc
+ *          java.compiler
+ *          java.management
+ *          jdk.jvmstat/sun.jvmstat.monitor
  * @build TestUnstableIfTrap com.oracle.java.testlibrary.* uncommontrap.Verifier
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
diff --git a/hotspot/test/compiler/unsafe/GetUnsafeObjectG1PreBarrier.java b/hotspot/test/compiler/unsafe/GetUnsafeObjectG1PreBarrier.java
index c3f4552..a32769f 100644
--- a/hotspot/test/compiler/unsafe/GetUnsafeObjectG1PreBarrier.java
+++ b/hotspot/test/compiler/unsafe/GetUnsafeObjectG1PreBarrier.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,6 +25,7 @@
  * @test
  * @bug 8016474
  * @summary The bug only happens with C1 and G1 using a different ObjectAlignmentInBytes than KlassAlignmentInBytes (which is 8)
+ * @modules java.base/sun.misc
  * @run main/othervm -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:ObjectAlignmentInBytes=32 GetUnsafeObjectG1PreBarrier
  */
 
diff --git a/hotspot/test/compiler/unsafe/UnsafeRaw.java b/hotspot/test/compiler/unsafe/UnsafeRaw.java
index f2a19ff..d5dda81 100644
--- a/hotspot/test/compiler/unsafe/UnsafeRaw.java
+++ b/hotspot/test/compiler/unsafe/UnsafeRaw.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,6 +26,8 @@
  * @bug 8058744
  * @summary Invalid pattern-matching of address computations in raw unsafe
  * @library /testlibrary
+ * @modules java.base/sun.misc
+ *          java.management
  * @run main/othervm -Xbatch UnsafeRaw
  */
 
diff --git a/hotspot/test/compiler/whitebox/AllocationCodeBlobTest.java b/hotspot/test/compiler/whitebox/AllocationCodeBlobTest.java
index 56def58..8bda23a 100644
--- a/hotspot/test/compiler/whitebox/AllocationCodeBlobTest.java
+++ b/hotspot/test/compiler/whitebox/AllocationCodeBlobTest.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -35,6 +35,7 @@
  * @test AllocationCodeBlobTest
  * @bug 8059624 8064669
  * @library /testlibrary /../../test/lib
+ * @modules java.management
  * @build AllocationCodeBlobTest
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
diff --git a/hotspot/test/compiler/whitebox/ClearMethodStateTest.java b/hotspot/test/compiler/whitebox/ClearMethodStateTest.java
index 8a13a68..be2cbdd 100644
--- a/hotspot/test/compiler/whitebox/ClearMethodStateTest.java
+++ b/hotspot/test/compiler/whitebox/ClearMethodStateTest.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -27,6 +27,7 @@
  * @test ClearMethodStateTest
  * @bug 8006683 8007288 8022832
  * @library /testlibrary /../../test/lib
+ * @modules java.management
  * @build ClearMethodStateTest
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
diff --git a/hotspot/test/compiler/whitebox/DeoptimizeAllTest.java b/hotspot/test/compiler/whitebox/DeoptimizeAllTest.java
index 910eb95..9016971 100644
--- a/hotspot/test/compiler/whitebox/DeoptimizeAllTest.java
+++ b/hotspot/test/compiler/whitebox/DeoptimizeAllTest.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,6 +25,7 @@
  * @test DeoptimizeAllTest
  * @bug 8006683 8007288 8022832
  * @library /testlibrary /../../test/lib
+ * @modules java.management
  * @build DeoptimizeAllTest
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
diff --git a/hotspot/test/compiler/whitebox/DeoptimizeFramesTest.java b/hotspot/test/compiler/whitebox/DeoptimizeFramesTest.java
index 40d7be3..99cec70 100644
--- a/hotspot/test/compiler/whitebox/DeoptimizeFramesTest.java
+++ b/hotspot/test/compiler/whitebox/DeoptimizeFramesTest.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,6 +25,7 @@
  * @test DeoptimizeFramesTest
  * @bug 8028595
  * @library /testlibrary /../../test/lib
+ * @modules java.management
  * @build DeoptimizeFramesTest
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
diff --git a/hotspot/test/compiler/whitebox/DeoptimizeMethodTest.java b/hotspot/test/compiler/whitebox/DeoptimizeMethodTest.java
index 667e3d5..3b08717 100644
--- a/hotspot/test/compiler/whitebox/DeoptimizeMethodTest.java
+++ b/hotspot/test/compiler/whitebox/DeoptimizeMethodTest.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,6 +25,7 @@
  * @test DeoptimizeMethodTest
  * @bug 8006683 8007288 8022832
  * @library /testlibrary /../../test/lib
+ * @modules java.management
  * @build DeoptimizeMethodTest
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
diff --git a/hotspot/test/compiler/whitebox/DeoptimizeMultipleOSRTest.java b/hotspot/test/compiler/whitebox/DeoptimizeMultipleOSRTest.java
index b4d729b..54851c4 100644
--- a/hotspot/test/compiler/whitebox/DeoptimizeMultipleOSRTest.java
+++ b/hotspot/test/compiler/whitebox/DeoptimizeMultipleOSRTest.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -29,6 +29,7 @@
  * @test DeoptimizeMultipleOSRTest
  * @bug 8061817
  * @library /testlibrary /../../test/lib
+ * @modules java.management
  * @build DeoptimizeMultipleOSRTest
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
diff --git a/hotspot/test/compiler/whitebox/EnqueueMethodForCompilationTest.java b/hotspot/test/compiler/whitebox/EnqueueMethodForCompilationTest.java
index f068eeb..2560d81 100644
--- a/hotspot/test/compiler/whitebox/EnqueueMethodForCompilationTest.java
+++ b/hotspot/test/compiler/whitebox/EnqueueMethodForCompilationTest.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,6 +25,7 @@
  * @test EnqueueMethodForCompilationTest
  * @bug 8006683 8007288 8022832
  * @library /testlibrary /../../test/lib
+ * @modules java.management
  * @build EnqueueMethodForCompilationTest
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
diff --git a/hotspot/test/compiler/whitebox/ForceNMethodSweepTest.java b/hotspot/test/compiler/whitebox/ForceNMethodSweepTest.java
index 0f90d89..83f6640 100644
--- a/hotspot/test/compiler/whitebox/ForceNMethodSweepTest.java
+++ b/hotspot/test/compiler/whitebox/ForceNMethodSweepTest.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -35,6 +35,7 @@
  * @test
  * @bug 8059624 8064669
  * @library /testlibrary /../../test/lib
+ * @modules java.management
  * @build ForceNMethodSweepTest
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
diff --git a/hotspot/test/compiler/whitebox/GetCodeHeapEntriesTest.java b/hotspot/test/compiler/whitebox/GetCodeHeapEntriesTest.java
index 9a30363..d247d60 100644
--- a/hotspot/test/compiler/whitebox/GetCodeHeapEntriesTest.java
+++ b/hotspot/test/compiler/whitebox/GetCodeHeapEntriesTest.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -34,6 +34,7 @@
  * @test GetCodeHeapEntriesTest
  * @bug 8059624
  * @library /testlibrary /../../test/lib
+ * @modules java.management
  * @build GetCodeHeapEntriesTest
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
diff --git a/hotspot/test/compiler/whitebox/GetNMethodTest.java b/hotspot/test/compiler/whitebox/GetNMethodTest.java
index 28d0e43..92807b2 100644
--- a/hotspot/test/compiler/whitebox/GetNMethodTest.java
+++ b/hotspot/test/compiler/whitebox/GetNMethodTest.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -30,6 +30,7 @@
  * @test GetNMethodTest
  * @bug 8038240
  * @library /testlibrary /../../test/lib
+ * @modules java.management
  * @build GetNMethodTest
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
diff --git a/hotspot/test/compiler/whitebox/IsMethodCompilableTest.java b/hotspot/test/compiler/whitebox/IsMethodCompilableTest.java
index 0017d0c..97c8961 100644
--- a/hotspot/test/compiler/whitebox/IsMethodCompilableTest.java
+++ b/hotspot/test/compiler/whitebox/IsMethodCompilableTest.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,6 +25,8 @@
  * @test IsMethodCompilableTest
  * @bug 8007270 8006683 8007288 8022832
  * @library /testlibrary /../../test/lib /testlibrary/com/oracle/java/testlibrary
+ * @modules java.base/sun.misc
+ *          java.management
  * @build IsMethodCompilableTest
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
diff --git a/hotspot/test/compiler/whitebox/LockCompilationTest.java b/hotspot/test/compiler/whitebox/LockCompilationTest.java
index 25080fe..a920fcc 100644
--- a/hotspot/test/compiler/whitebox/LockCompilationTest.java
+++ b/hotspot/test/compiler/whitebox/LockCompilationTest.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,6 +25,7 @@
  * @test LockCompilationTest
  * @bug 8059624
  * @library /testlibrary /../../test/lib
+ * @modules java.management
  * @build LockCompilationTest
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
diff --git a/hotspot/test/compiler/whitebox/MakeMethodNotCompilableTest.java b/hotspot/test/compiler/whitebox/MakeMethodNotCompilableTest.java
index ca5ff1f..faac335 100644
--- a/hotspot/test/compiler/whitebox/MakeMethodNotCompilableTest.java
+++ b/hotspot/test/compiler/whitebox/MakeMethodNotCompilableTest.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,6 +25,7 @@
  * @test MakeMethodNotCompilableTest
  * @bug 8012322 8006683 8007288 8022832
  * @library /testlibrary /../../test/lib
+ * @modules java.management
  * @build MakeMethodNotCompilableTest
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
diff --git a/hotspot/test/compiler/whitebox/SetDontInlineMethodTest.java b/hotspot/test/compiler/whitebox/SetDontInlineMethodTest.java
index 0c4ee8d..1638a5e 100644
--- a/hotspot/test/compiler/whitebox/SetDontInlineMethodTest.java
+++ b/hotspot/test/compiler/whitebox/SetDontInlineMethodTest.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,6 +25,7 @@
  * @test SetDontInlineMethodTest
  * @bug 8006683 8007288 8022832
  * @library /testlibrary /../../test/lib
+ * @modules java.management
  * @build SetDontInlineMethodTest
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
diff --git a/hotspot/test/compiler/whitebox/SetForceInlineMethodTest.java b/hotspot/test/compiler/whitebox/SetForceInlineMethodTest.java
index caca0f6..a9e1991 100644
--- a/hotspot/test/compiler/whitebox/SetForceInlineMethodTest.java
+++ b/hotspot/test/compiler/whitebox/SetForceInlineMethodTest.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,6 +25,7 @@
  * @test SetForceInlineMethodTest
  * @bug 8006683 8007288 8022832
  * @library /testlibrary /../../test/lib
+ * @modules java.management
  * @build SetForceInlineMethodTest
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
diff --git a/hotspot/test/gc/6581734/Test6581734.java b/hotspot/test/gc/6581734/Test6581734.java
index 9ec55c8..5201a75 100644
--- a/hotspot/test/gc/6581734/Test6581734.java
+++ b/hotspot/test/gc/6581734/Test6581734.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,6 +26,7 @@
  * @bug 6581734
  * @requires vm.gc=="ConcMarkSweep" | vm.gc=="null"
  * @summary CMS Old Gen's collection usage is zero after GC which is incorrect
+ * @modules java.management
  * @run main/othervm -Xmx512m -verbose:gc -XX:+UseConcMarkSweepGC Test6581734
  *
  */
diff --git a/hotspot/test/gc/6941923/Test6941923.java b/hotspot/test/gc/6941923/Test6941923.java
index 8ba13a8..d667624 100644
--- a/hotspot/test/gc/6941923/Test6941923.java
+++ b/hotspot/test/gc/6941923/Test6941923.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 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
@@ -26,6 +26,8 @@
  * @bug 6941923
  * @summary test flags for gc log rotation
  * @library /testlibrary
+ * @modules java.base/sun.misc
+ *          java.management
  * @run main/othervm/timeout=600 Test6941923
  *
  */
diff --git a/hotspot/test/gc/7072527/TestFullGCCount.java b/hotspot/test/gc/7072527/TestFullGCCount.java
index 96b66c1..fcd422f 100644
--- a/hotspot/test/gc/7072527/TestFullGCCount.java
+++ b/hotspot/test/gc/7072527/TestFullGCCount.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,6 +25,7 @@
  * @test TestFullGCount.java
  * @bug 7072527
  * @summary CMS: JMM GC counters overcount in some cases
+ * @modules java.management
  * @run main/othervm -XX:+PrintGC TestFullGCCount
  */
 import java.util.*;
diff --git a/hotspot/test/gc/TestCardTablePageCommits.java b/hotspot/test/gc/TestCardTablePageCommits.java
index 0dec3d8..d8ceb00 100644
--- a/hotspot/test/gc/TestCardTablePageCommits.java
+++ b/hotspot/test/gc/TestCardTablePageCommits.java
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+* Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 *
 * This code is free software; you can redistribute it and/or modify it
@@ -32,6 +32,8 @@
  * @bug 8059066
  * @summary Tests that the card table does not commit the same page twice
  * @library /testlibrary
+ * @modules java.base/sun.misc
+ *          java.management
  * @run driver TestCardTablePageCommits
  */
 public class TestCardTablePageCommits {
diff --git a/hotspot/test/gc/TestDisableExplicitGC.java b/hotspot/test/gc/TestDisableExplicitGC.java
new file mode 100644
index 0000000..4561956
--- /dev/null
+++ b/hotspot/test/gc/TestDisableExplicitGC.java
@@ -0,0 +1,54 @@
+/*
+ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test TestDisableExplicitGC
+ * @requires vm.opt.DisableExplicitGC == null
+ * @summary Verify GC behavior with DisableExplicitGC flag.
+ * @library /testlibrary
+ * @run main/othervm                             -XX:+PrintGCDetails TestDisableExplicitGC
+ * @run main/othervm/fail -XX:+DisableExplicitGC -XX:+PrintGCDetails TestDisableExplicitGC
+ * @run main/othervm      -XX:-DisableExplicitGC -XX:+PrintGCDetails TestDisableExplicitGC
+ */
+import java.lang.management.GarbageCollectorMXBean;
+import java.util.List;
+import static com.oracle.java.testlibrary.Asserts.*;
+
+public class TestDisableExplicitGC {
+
+    public static void main(String[] args) throws InterruptedException {
+        List<GarbageCollectorMXBean> list = java.lang.management.ManagementFactory.getGarbageCollectorMXBeans();
+        long collectionCountBefore = getCollectionCount(list);
+        System.gc();
+        long collectionCountAfter = getCollectionCount(list);
+        assertLT(collectionCountBefore, collectionCountAfter);
+    }
+
+    private static long getCollectionCount(List<GarbageCollectorMXBean> list) {
+        int collectionCount = 0;
+        for (GarbageCollectorMXBean gcMXBean : list) {
+            collectionCount += gcMXBean.getCollectionCount();
+        }
+        return collectionCount;
+    }
+}
diff --git a/hotspot/test/gc/TestGCLogRotationViaJcmd.java b/hotspot/test/gc/TestGCLogRotationViaJcmd.java
index fd71d36..bcd170a 100644
--- a/hotspot/test/gc/TestGCLogRotationViaJcmd.java
+++ b/hotspot/test/gc/TestGCLogRotationViaJcmd.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,6 +26,8 @@
  * @bug 7090324
  * @summary test for gc log rotation via jcmd
  * @library /testlibrary
+ * @modules java.base/sun.misc
+ *          java.management
  * @run main/othervm -Xloggc:test.log -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=3 TestGCLogRotationViaJcmd
  *
  */
diff --git a/hotspot/test/gc/TestObjectAlignment.java b/hotspot/test/gc/TestObjectAlignment.java
index 8cfc970..674903c 100644
--- a/hotspot/test/gc/TestObjectAlignment.java
+++ b/hotspot/test/gc/TestObjectAlignment.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -27,6 +27,8 @@
  * @bug 8021823
  * @summary G1: Concurrent marking crashes with -XX:ObjectAlignmentInBytes>=32 in 64bit VMs
  * @library /testlibrary
+ * @modules java.base/sun.misc
+ *          java.management
  * @run main/othervm TestObjectAlignment -Xmx20M -XX:+ExplicitGCInvokesConcurrent -XX:+IgnoreUnrecognizedVMOptions -XX:ObjectAlignmentInBytes=8
  * @run main/othervm TestObjectAlignment -Xmx20M -XX:+ExplicitGCInvokesConcurrent -XX:+IgnoreUnrecognizedVMOptions -XX:ObjectAlignmentInBytes=16
  * @run main/othervm TestObjectAlignment -Xmx20M -XX:+ExplicitGCInvokesConcurrent -XX:+IgnoreUnrecognizedVMOptions -XX:ObjectAlignmentInBytes=32
diff --git a/hotspot/test/gc/TestSmallHeap.java b/hotspot/test/gc/TestSmallHeap.java
index 3b05574..32eee64 100644
--- a/hotspot/test/gc/TestSmallHeap.java
+++ b/hotspot/test/gc/TestSmallHeap.java
@@ -29,6 +29,7 @@
  * @requires vm.compMode != "Xcomp"
  * @summary Verify that starting the VM with a small heap works
  * @library /testlibrary /../../test/lib
+ * @modules java.management/sun.management
  * @build TestSmallHeap
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xmx2m -XX:+UseParallelGC TestSmallHeap
diff --git a/hotspot/test/gc/TestSoftReferencesBehaviorOnOOME.java b/hotspot/test/gc/TestSoftReferencesBehaviorOnOOME.java
index abf6f80..860f49d 100644
--- a/hotspot/test/gc/TestSoftReferencesBehaviorOnOOME.java
+++ b/hotspot/test/gc/TestSoftReferencesBehaviorOnOOME.java
@@ -26,6 +26,8 @@
  * @key gc
  * @summary Tests that all SoftReferences has been cleared at time of OOM.
  * @library /testlibrary
+ * @modules java.base/sun.misc
+ *          java.management
  * @ignore 8073669
  * @build TestSoftReferencesBehaviorOnOOME
  * @run main/othervm -Xmx128m TestSoftReferencesBehaviorOnOOME 512 2k
diff --git a/hotspot/test/gc/TestVerifyDuringStartup.java b/hotspot/test/gc/TestVerifyDuringStartup.java
index f4ac347..3bf6388 100644
--- a/hotspot/test/gc/TestVerifyDuringStartup.java
+++ b/hotspot/test/gc/TestVerifyDuringStartup.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,6 +26,8 @@
  * @bug 8010463 8011343 8011898
  * @summary Simple test run with -XX:+VerifyDuringStartup -XX:-UseTLAB to verify 8010463
  * @library /testlibrary
+ * @modules java.base/sun.misc
+ *          java.management
  */
 
 import com.oracle.java.testlibrary.JDKToolFinder;
diff --git a/hotspot/test/gc/TestVerifySilently.java b/hotspot/test/gc/TestVerifySilently.java
index deefd48..52dba6c 100644
--- a/hotspot/test/gc/TestVerifySilently.java
+++ b/hotspot/test/gc/TestVerifySilently.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,6 +26,8 @@
  * @bug 8032771
  * @summary Test silent verification.
  * @library /testlibrary
+ * @modules java.base/sun.misc
+ *          java.management
  */
 
 import com.oracle.java.testlibrary.OutputAnalyzer;
diff --git a/hotspot/test/gc/arguments/TestArrayAllocatorMallocLimit.java b/hotspot/test/gc/arguments/TestArrayAllocatorMallocLimit.java
index 3bbe150..57a717d 100644
--- a/hotspot/test/gc/arguments/TestArrayAllocatorMallocLimit.java
+++ b/hotspot/test/gc/arguments/TestArrayAllocatorMallocLimit.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -28,6 +28,8 @@
  * @bug 8054823
  * @key gc
  * @library /testlibrary
+ * @modules java.base/sun.misc
+ *          java.management
  * @run driver TestArrayAllocatorMallocLimit
  */
 
diff --git a/hotspot/test/gc/arguments/TestCMSHeapSizeFlags.java b/hotspot/test/gc/arguments/TestCMSHeapSizeFlags.java
index 01fed8d..b2b017b 100644
--- a/hotspot/test/gc/arguments/TestCMSHeapSizeFlags.java
+++ b/hotspot/test/gc/arguments/TestCMSHeapSizeFlags.java
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
+* Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 *
 * This code is free software; you can redistribute it and/or modify it
@@ -27,6 +27,8 @@
  * @bug 8006088
  * @summary Tests argument processing for initial and maximum heap size for the CMS collector
  * @library /testlibrary /../../test/lib
+ * @modules java.base/sun.misc
+ *          java.management
  * @build TestCMSHeapSizeFlags TestMaxHeapSizeTools
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
diff --git a/hotspot/test/gc/arguments/TestCompressedClassFlags.java b/hotspot/test/gc/arguments/TestCompressedClassFlags.java
index 4135deb..eefc04a 100644
--- a/hotspot/test/gc/arguments/TestCompressedClassFlags.java
+++ b/hotspot/test/gc/arguments/TestCompressedClassFlags.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -29,6 +29,8 @@
  * @summary Tests that VM prints a warning when -XX:CompressedClassSpaceSize
  *          is used together with -XX:-UseCompressedClassPointers
  * @library /testlibrary
+ * @modules java.base/sun.misc
+ *          java.management
  */
 public class TestCompressedClassFlags {
     public static void main(String[] args) throws Exception {
diff --git a/hotspot/test/gc/arguments/TestDynMaxHeapFreeRatio.java b/hotspot/test/gc/arguments/TestDynMaxHeapFreeRatio.java
index 53728b8..45d0df2 100644
--- a/hotspot/test/gc/arguments/TestDynMaxHeapFreeRatio.java
+++ b/hotspot/test/gc/arguments/TestDynMaxHeapFreeRatio.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -31,6 +31,7 @@
  * @bug 8028391
  * @summary Verify that MaxHeapFreeRatio flag is manageable
  * @library /testlibrary
+ * @modules java.management
  * @run main TestDynMaxHeapFreeRatio
  * @run main/othervm -XX:MinHeapFreeRatio=0 -XX:MaxHeapFreeRatio=100 TestDynMaxHeapFreeRatio
  * @run main/othervm -XX:MinHeapFreeRatio=10 -XX:MaxHeapFreeRatio=50 -XX:-UseAdaptiveSizePolicy TestDynMaxHeapFreeRatio
diff --git a/hotspot/test/gc/arguments/TestDynMinHeapFreeRatio.java b/hotspot/test/gc/arguments/TestDynMinHeapFreeRatio.java
index bbf0ecf..5e696e2 100644
--- a/hotspot/test/gc/arguments/TestDynMinHeapFreeRatio.java
+++ b/hotspot/test/gc/arguments/TestDynMinHeapFreeRatio.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,6 +26,7 @@
  * @bug 8028391
  * @summary Verify that MinHeapFreeRatio flag is manageable
  * @library /testlibrary
+ * @modules java.management
  * @run main TestDynMinHeapFreeRatio
  * @run main/othervm -XX:MinHeapFreeRatio=0 -XX:MaxHeapFreeRatio=100 TestDynMinHeapFreeRatio
  * @run main/othervm -XX:MinHeapFreeRatio=10 -XX:MaxHeapFreeRatio=50 -XX:-UseAdaptiveSizePolicy TestDynMinHeapFreeRatio
diff --git a/hotspot/test/gc/arguments/TestG1ConcRefinementThreads.java b/hotspot/test/gc/arguments/TestG1ConcRefinementThreads.java
index 1d73b1c..86dffc2 100644
--- a/hotspot/test/gc/arguments/TestG1ConcRefinementThreads.java
+++ b/hotspot/test/gc/arguments/TestG1ConcRefinementThreads.java
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+* Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 *
 * This code is free software; you can redistribute it and/or modify it
@@ -27,6 +27,8 @@
  * @bug 8047976
  * @summary Tests argument processing for G1ConcRefinementThreads
  * @library /testlibrary
+ * @modules java.base/sun.misc
+ *          java.management
  */
 
 import com.oracle.java.testlibrary.*;
diff --git a/hotspot/test/gc/arguments/TestG1HeapRegionSize.java b/hotspot/test/gc/arguments/TestG1HeapRegionSize.java
index 41c2e1c..c15a798 100644
--- a/hotspot/test/gc/arguments/TestG1HeapRegionSize.java
+++ b/hotspot/test/gc/arguments/TestG1HeapRegionSize.java
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+* Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 *
 * This code is free software; you can redistribute it and/or modify it
@@ -26,6 +26,7 @@
  * @key gc
  * @bug 8021879
  * @summary Verify that the flag G1HeapRegionSize is updated properly
+ * @modules java.management/sun.management
  * @run main/othervm -Xmx64m TestG1HeapRegionSize 1048576
  * @run main/othervm -XX:G1HeapRegionSize=2m -Xmx64m TestG1HeapRegionSize 2097152
  * @run main/othervm -XX:G1HeapRegionSize=3m -Xmx64m TestG1HeapRegionSize 2097152
diff --git a/hotspot/test/gc/arguments/TestG1HeapSizeFlags.java b/hotspot/test/gc/arguments/TestG1HeapSizeFlags.java
index daa02c4..32c55bd 100644
--- a/hotspot/test/gc/arguments/TestG1HeapSizeFlags.java
+++ b/hotspot/test/gc/arguments/TestG1HeapSizeFlags.java
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
+* Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 *
 * This code is free software; you can redistribute it and/or modify it
@@ -27,6 +27,8 @@
  * @bug 8006088
  * @summary Tests argument processing for initial and maximum heap size for the G1 collector
  * @library /testlibrary /../../test/lib
+ * @modules java.base/sun.misc
+ *          java.management
  * @build TestG1HeapSizeFlags TestMaxHeapSizeTools
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
diff --git a/hotspot/test/gc/arguments/TestG1PercentageOptions.java b/hotspot/test/gc/arguments/TestG1PercentageOptions.java
index f66656f..c641dc5 100644
--- a/hotspot/test/gc/arguments/TestG1PercentageOptions.java
+++ b/hotspot/test/gc/arguments/TestG1PercentageOptions.java
@@ -27,6 +27,8 @@
  * @bug 8068942
  * @summary Test argument processing of various percentage options
  * @library /testlibrary
+ * @modules java.base/sun.misc
+ *          java.management
  * @run driver TestG1PercentageOptions
  */
 
diff --git a/hotspot/test/gc/arguments/TestHeapFreeRatio.java b/hotspot/test/gc/arguments/TestHeapFreeRatio.java
index 11e259d..36e0b95 100644
--- a/hotspot/test/gc/arguments/TestHeapFreeRatio.java
+++ b/hotspot/test/gc/arguments/TestHeapFreeRatio.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -27,6 +27,8 @@
  * @bug 8025661
  * @summary Test parsing of -Xminf and -Xmaxf
  * @library /testlibrary
+ * @modules java.base/sun.misc
+ *          java.management
  * @run main/othervm TestHeapFreeRatio
  */
 
diff --git a/hotspot/test/gc/arguments/TestInitialTenuringThreshold.java b/hotspot/test/gc/arguments/TestInitialTenuringThreshold.java
index 130ff74..65f1f3a 100644
--- a/hotspot/test/gc/arguments/TestInitialTenuringThreshold.java
+++ b/hotspot/test/gc/arguments/TestInitialTenuringThreshold.java
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
+* Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 *
 * This code is free software; you can redistribute it and/or modify it
@@ -27,6 +27,8 @@
  * @bug 8014765
  * @summary Tests argument processing for initial tenuring threshold
  * @library /testlibrary
+ * @modules java.base/sun.misc
+ *          java.management
  * @run main/othervm TestInitialTenuringThreshold
  * @author thomas.schatzl@oracle.com
  */
@@ -72,4 +74,4 @@
     runWithThresholds(16, 8, true);
     runWithThresholds(8, 17, true);
   }
-}
\ No newline at end of file
+}
diff --git a/hotspot/test/gc/arguments/TestMaxNewSize.java b/hotspot/test/gc/arguments/TestMaxNewSize.java
index af20cb8..a49df8a 100644
--- a/hotspot/test/gc/arguments/TestMaxNewSize.java
+++ b/hotspot/test/gc/arguments/TestMaxNewSize.java
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+* Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 *
 * This code is free software; you can redistribute it and/or modify it
@@ -28,6 +28,8 @@
  * @summary Make sure that MaxNewSize always has a useful value after argument
  * processing.
  * @library /testlibrary
+ * @modules java.base/sun.misc
+ *          java.management
  * @build TestMaxNewSize
  * @run main TestMaxNewSize -XX:+UseSerialGC
  * @run main TestMaxNewSize -XX:+UseParallelGC
diff --git a/hotspot/test/gc/arguments/TestMinInitialErgonomics.java b/hotspot/test/gc/arguments/TestMinInitialErgonomics.java
index 3b29726..3310411 100644
--- a/hotspot/test/gc/arguments/TestMinInitialErgonomics.java
+++ b/hotspot/test/gc/arguments/TestMinInitialErgonomics.java
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
+* Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 *
 * This code is free software; you can redistribute it and/or modify it
@@ -27,6 +27,8 @@
  * @bug 8006088
  * @summary Test ergonomics decisions related to minimum and initial heap size.
  * @library /testlibrary /../../test/lib
+ * @modules java.base/sun.misc
+ *          java.management
  * @build TestMinInitialErgonomics TestMaxHeapSizeTools
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
diff --git a/hotspot/test/gc/arguments/TestObjectTenuringFlags.java b/hotspot/test/gc/arguments/TestObjectTenuringFlags.java
index 64ddeb4..c4c7326 100644
--- a/hotspot/test/gc/arguments/TestObjectTenuringFlags.java
+++ b/hotspot/test/gc/arguments/TestObjectTenuringFlags.java
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+* Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 *
 * This code is free software; you can redistribute it and/or modify it
@@ -28,6 +28,8 @@
  * @summary Tests argument processing for NeverTenure, AlwaysTenure,
  * and MaxTenuringThreshold
  * @library /testlibrary
+ * @modules java.base/sun.misc
+ *          java.management
  * @build TestObjectTenuringFlags FlagsValue
  * @run main/othervm TestObjectTenuringFlags
  */
diff --git a/hotspot/test/gc/arguments/TestParallelGCThreads.java b/hotspot/test/gc/arguments/TestParallelGCThreads.java
index f70da25..c7b8122 100644
--- a/hotspot/test/gc/arguments/TestParallelGCThreads.java
+++ b/hotspot/test/gc/arguments/TestParallelGCThreads.java
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+* Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 *
 * This code is free software; you can redistribute it and/or modify it
@@ -27,6 +27,8 @@
  * @bug 8059527
  * @summary Tests argument processing for ParallelGCThreads
  * @library /testlibrary
+ * @modules java.base/sun.misc
+ *          java.management
  * @run driver TestParallelGCThreads
  */
 
diff --git a/hotspot/test/gc/arguments/TestParallelHeapSizeFlags.java b/hotspot/test/gc/arguments/TestParallelHeapSizeFlags.java
index 8276e68..fa12fa1 100644
--- a/hotspot/test/gc/arguments/TestParallelHeapSizeFlags.java
+++ b/hotspot/test/gc/arguments/TestParallelHeapSizeFlags.java
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
+* Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 *
 * This code is free software; you can redistribute it and/or modify it
@@ -28,6 +28,8 @@
  * @summary Tests argument processing for initial and maximum heap size for the
  * parallel collectors.
  * @library /testlibrary /../../test/lib
+ * @modules java.base/sun.misc
+ *          java.management
  * @build TestParallelHeapSizeFlags TestMaxHeapSizeTools
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
diff --git a/hotspot/test/gc/arguments/TestSerialHeapSizeFlags.java b/hotspot/test/gc/arguments/TestSerialHeapSizeFlags.java
index 4e56826..f5e320e 100644
--- a/hotspot/test/gc/arguments/TestSerialHeapSizeFlags.java
+++ b/hotspot/test/gc/arguments/TestSerialHeapSizeFlags.java
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
+* Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 *
 * This code is free software; you can redistribute it and/or modify it
@@ -27,6 +27,8 @@
  * @bug 8006088
  * @summary Tests argument processing for initial and maximum heap size for the Serial collector
  * @library /testlibrary /../../test/lib
+ * @modules java.base/sun.misc
+ *          java.management
  * @build TestSerialHeapSizeFlags TestMaxHeapSizeTools
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
diff --git a/hotspot/test/gc/arguments/TestSurvivorAlignmentInBytesOption.java b/hotspot/test/gc/arguments/TestSurvivorAlignmentInBytesOption.java
index 3841bfb..6e31893 100644
--- a/hotspot/test/gc/arguments/TestSurvivorAlignmentInBytesOption.java
+++ b/hotspot/test/gc/arguments/TestSurvivorAlignmentInBytesOption.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -34,6 +34,8 @@
  *           & vm.opt.UnlockExperimentalVMOptions == null
  *           & (vm.opt.IgnoreUnrecognizedVMOptions == null
  *              | vm.opt.IgnoreUnrecognizedVMOptions == "false")
+ * @modules java.base/sun.misc
+ *          java.management
  * @run main TestSurvivorAlignmentInBytesOption
  */
 public class TestSurvivorAlignmentInBytesOption {
diff --git a/hotspot/test/gc/arguments/TestUnrecognizedVMOptionsHandling.java b/hotspot/test/gc/arguments/TestUnrecognizedVMOptionsHandling.java
index a61b5f3..1e8532e 100644
--- a/hotspot/test/gc/arguments/TestUnrecognizedVMOptionsHandling.java
+++ b/hotspot/test/gc/arguments/TestUnrecognizedVMOptionsHandling.java
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+* Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 *
 * This code is free software; you can redistribute it and/or modify it
@@ -27,6 +27,8 @@
  * @bug 8017611
  * @summary Tests handling unrecognized VM options
  * @library /testlibrary
+ * @modules java.base/sun.misc
+ *          java.management
  * @run main/othervm TestUnrecognizedVMOptionsHandling
  */
 
diff --git a/hotspot/test/gc/arguments/TestUseCompressedOopsErgo.java b/hotspot/test/gc/arguments/TestUseCompressedOopsErgo.java
index 09a54a0..5a2005e 100644
--- a/hotspot/test/gc/arguments/TestUseCompressedOopsErgo.java
+++ b/hotspot/test/gc/arguments/TestUseCompressedOopsErgo.java
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2013, 2014 Oracle and/or its affiliates. All rights reserved.
+* Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 *
 * This code is free software; you can redistribute it and/or modify it
@@ -27,6 +27,8 @@
  * @bug 8010722
  * @summary Tests ergonomics for UseCompressedOops.
  * @library /testlibrary /../../test/lib
+ * @modules java.base/sun.misc
+ *          java.management/sun.management
  * @build TestUseCompressedOopsErgo TestUseCompressedOopsErgoTools
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
diff --git a/hotspot/test/gc/arguments/TestUseNUMAInterleaving.java b/hotspot/test/gc/arguments/TestUseNUMAInterleaving.java
index edc6f9f..831dd1f 100644
--- a/hotspot/test/gc/arguments/TestUseNUMAInterleaving.java
+++ b/hotspot/test/gc/arguments/TestUseNUMAInterleaving.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -28,6 +28,8 @@
  * @bug 8059614
  * @key gc
  * @library /testlibrary
+ * @modules java.base/sun.misc
+ *          java.management
  * @run driver TestUseNUMAInterleaving
  */
 import com.oracle.java.testlibrary.ProcessTools;
diff --git a/hotspot/test/gc/class_unloading/TestCMSClassUnloadingEnabledHWM.java b/hotspot/test/gc/class_unloading/TestCMSClassUnloadingEnabledHWM.java
index c7985df..d51d327 100644
--- a/hotspot/test/gc/class_unloading/TestCMSClassUnloadingEnabledHWM.java
+++ b/hotspot/test/gc/class_unloading/TestCMSClassUnloadingEnabledHWM.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,6 +26,8 @@
  * @key gc
  * @bug 8049831
  * @library /testlibrary /../../test/lib
+ * @modules java.base/sun.misc
+ *          java.management
  * @build TestCMSClassUnloadingEnabledHWM
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
diff --git a/hotspot/test/gc/class_unloading/TestG1ClassUnloadingHWM.java b/hotspot/test/gc/class_unloading/TestG1ClassUnloadingHWM.java
index 374184e..d62670e 100644
--- a/hotspot/test/gc/class_unloading/TestG1ClassUnloadingHWM.java
+++ b/hotspot/test/gc/class_unloading/TestG1ClassUnloadingHWM.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,6 +26,8 @@
  * @key gc
  * @bug 8049831
  * @library /testlibrary /../../test/lib
+ * @modules java.base/sun.misc
+ *          java.management
  * @build TestG1ClassUnloadingHWM
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
diff --git a/hotspot/test/gc/concurrentMarkSweep/GuardShrinkWarning.java b/hotspot/test/gc/concurrentMarkSweep/GuardShrinkWarning.java
index a2d4762..a44da13 100644
--- a/hotspot/test/gc/concurrentMarkSweep/GuardShrinkWarning.java
+++ b/hotspot/test/gc/concurrentMarkSweep/GuardShrinkWarning.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -28,6 +28,8 @@
  * @key gc
  * @key regression
  * @library /testlibrary
+ * @modules java.base/sun.misc
+ *          java.management
  * @run main/othervm GuardShrinkWarning
  * @author jon.masamitsu@oracle.com
  */
diff --git a/hotspot/test/gc/defnew/HeapChangeLogging.java b/hotspot/test/gc/defnew/HeapChangeLogging.java
index e2be82a..8c2066c 100644
--- a/hotspot/test/gc/defnew/HeapChangeLogging.java
+++ b/hotspot/test/gc/defnew/HeapChangeLogging.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,6 +25,8 @@
  * @test HeapChangeLogging.java
  * @bug 8027440
  * @library /testlibrary
+ * @modules java.base/sun.misc
+ *          java.management
  * @build HeapChangeLogging
  * @summary Allocate to get a promotion failure and verify that that heap change logging is present.
  * @run main HeapChangeLogging
diff --git a/hotspot/test/gc/g1/Test2GbHeap.java b/hotspot/test/gc/g1/Test2GbHeap.java
index 6b0cd3b..17391c6e 100644
--- a/hotspot/test/gc/g1/Test2GbHeap.java
+++ b/hotspot/test/gc/g1/Test2GbHeap.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -28,6 +28,8 @@
  * @key gc
  * @key regression
  * @library /testlibrary
+ * @modules java.base/sun.misc
+ *          java.management
  */
 
 import java.util.ArrayList;
diff --git a/hotspot/test/gc/g1/TestEagerReclaimHumongousRegions.java b/hotspot/test/gc/g1/TestEagerReclaimHumongousRegions.java
index b920e7a..3243b73 100644
--- a/hotspot/test/gc/g1/TestEagerReclaimHumongousRegions.java
+++ b/hotspot/test/gc/g1/TestEagerReclaimHumongousRegions.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -28,6 +28,8 @@
  * up the heap with humongous objects that should be eagerly reclaimable to avoid Full GC.
  * @key gc
  * @library /testlibrary
+ * @modules java.base/sun.misc
+ *          java.management
  */
 
 import java.util.regex.Pattern;
diff --git a/hotspot/test/gc/g1/TestEagerReclaimHumongousRegionsClearMarkBits.java b/hotspot/test/gc/g1/TestEagerReclaimHumongousRegionsClearMarkBits.java
index 5b4e694..a61c0d4 100644
--- a/hotspot/test/gc/g1/TestEagerReclaimHumongousRegionsClearMarkBits.java
+++ b/hotspot/test/gc/g1/TestEagerReclaimHumongousRegionsClearMarkBits.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -28,6 +28,8 @@
  * mark bitmaps at reclaim.
  * @key gc
  * @library /testlibrary
+ * @modules java.base/sun.misc
+ *          java.management
  */
 
 import java.util.ArrayList;
diff --git a/hotspot/test/gc/g1/TestEagerReclaimHumongousRegionsWithRefs.java b/hotspot/test/gc/g1/TestEagerReclaimHumongousRegionsWithRefs.java
index d12e25a..1ad3084 100644
--- a/hotspot/test/gc/g1/TestEagerReclaimHumongousRegionsWithRefs.java
+++ b/hotspot/test/gc/g1/TestEagerReclaimHumongousRegionsWithRefs.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -31,6 +31,8 @@
  * should still be eagerly reclaimable to avoid Full GC.
  * @key gc
  * @library /testlibrary
+ * @modules java.base/sun.misc
+ *          java.management
  */
 
 import java.util.regex.Pattern;
diff --git a/hotspot/test/gc/g1/TestG1TraceEagerReclaimHumongousObjects.java b/hotspot/test/gc/g1/TestG1TraceEagerReclaimHumongousObjects.java
index e653554..0a4e915 100644
--- a/hotspot/test/gc/g1/TestG1TraceEagerReclaimHumongousObjects.java
+++ b/hotspot/test/gc/g1/TestG1TraceEagerReclaimHumongousObjects.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -28,6 +28,8 @@
  * includes the expected necessary messages.
  * @key gc
  * @library /testlibrary
+ * @modules java.base/sun.misc
+ *          java.management
  */
 
 import com.oracle.java.testlibrary.ProcessTools;
diff --git a/hotspot/test/gc/g1/TestGCLogMessages.java b/hotspot/test/gc/g1/TestGCLogMessages.java
index 938d17b..7c18289 100644
--- a/hotspot/test/gc/g1/TestGCLogMessages.java
+++ b/hotspot/test/gc/g1/TestGCLogMessages.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,142 +23,172 @@
 
 /*
  * @test TestGCLogMessages
- * @bug 8035406 8027295 8035398 8019342 8027959 8048179
+ * @bug 8035406 8027295 8035398 8019342 8027959 8048179 8027962
  * @summary Ensure that the PrintGCDetails output for a minor GC with G1
  * includes the expected necessary messages.
  * @key gc
  * @library /testlibrary
+ * @modules java.base/sun.misc
+ *          java.management
  */
 
 import com.oracle.java.testlibrary.ProcessTools;
 import com.oracle.java.testlibrary.OutputAnalyzer;
 
 public class TestGCLogMessages {
-  public static void main(String[] args) throws Exception {
-    testNormalLogs();
-    testWithToSpaceExhaustionLogs();
-  }
 
-  private static void testNormalLogs() throws Exception {
-
-    ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-XX:+UseG1GC",
-                                                              "-Xmx10M",
-                                                              GCTest.class.getName());
-
-    OutputAnalyzer output = new OutputAnalyzer(pb.start());
-
-    output.shouldNotContain("[Redirty Cards");
-    output.shouldNotContain("[Parallel Redirty");
-    output.shouldNotContain("[Redirtied Cards");
-    output.shouldNotContain("[Code Root Purge");
-    output.shouldNotContain("[String Dedup Fixup");
-    output.shouldNotContain("[Young Free CSet");
-    output.shouldNotContain("[Non-Young Free CSet");
-    output.shouldNotContain("[Humongous Register");
-    output.shouldNotContain("[Humongous Reclaim");
-    output.shouldHaveExitValue(0);
-
-    pb = ProcessTools.createJavaProcessBuilder("-XX:+UseG1GC",
-                                               "-XX:+UseStringDeduplication",
-                                               "-Xmx10M",
-                                               "-XX:+PrintGCDetails",
-                                               GCTest.class.getName());
-
-    output = new OutputAnalyzer(pb.start());
-
-    output.shouldContain("[Redirty Cards");
-    output.shouldNotContain("[Parallel Redirty");
-    output.shouldNotContain("[Redirtied Cards");
-    output.shouldContain("[Code Root Purge");
-    output.shouldContain("[String Dedup Fixup");
-    output.shouldNotContain("[Young Free CSet");
-    output.shouldNotContain("[Non-Young Free CSet");
-    output.shouldContain("[Humongous Register");
-    output.shouldNotContain("[Humongous Total");
-    output.shouldNotContain("[Humongous Candidate");
-    output.shouldContain("[Humongous Reclaim");
-    output.shouldNotContain("[Humongous Reclaimed");
-    output.shouldHaveExitValue(0);
-
-    pb = ProcessTools.createJavaProcessBuilder("-XX:+UseG1GC",
-                                               "-XX:+UseStringDeduplication",
-                                               "-Xmx10M",
-                                               "-XX:+PrintGCDetails",
-                                               "-XX:+UnlockExperimentalVMOptions",
-                                               "-XX:G1LogLevel=finest",
-                                               GCTest.class.getName());
-
-    output = new OutputAnalyzer(pb.start());
-
-    output.shouldContain("[Redirty Cards");
-    output.shouldContain("[Parallel Redirty");
-    output.shouldContain("[Redirtied Cards");
-    output.shouldContain("[Code Root Purge");
-    output.shouldContain("[String Dedup Fixup");
-    output.shouldContain("[Young Free CSet");
-    output.shouldContain("[Non-Young Free CSet");
-    output.shouldContain("[Humongous Register");
-    output.shouldContain("[Humongous Total");
-    output.shouldContain("[Humongous Candidate");
-    output.shouldContain("[Humongous Reclaim");
-    output.shouldContain("[Humongous Reclaimed");
-    output.shouldHaveExitValue(0);
-  }
-
-  private static void testWithToSpaceExhaustionLogs() throws Exception {
-    ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-XX:+UseG1GC",
-                                               "-Xmx32M",
-                                               "-Xmn16M",
-                                               "-XX:+PrintGCDetails",
-                                               GCTestWithToSpaceExhaustion.class.getName());
-
-    OutputAnalyzer output = new OutputAnalyzer(pb.start());
-    output.shouldContain("[Evacuation Failure");
-    output.shouldNotContain("[Recalculate Used");
-    output.shouldNotContain("[Remove Self Forwards");
-    output.shouldNotContain("[Restore RemSet");
-    output.shouldHaveExitValue(0);
-
-    pb = ProcessTools.createJavaProcessBuilder("-XX:+UseG1GC",
-                                               "-Xmx32M",
-                                               "-Xmn16M",
-                                               "-XX:+PrintGCDetails",
-                                               "-XX:+UnlockExperimentalVMOptions",
-                                               "-XX:G1LogLevel=finest",
-                                               GCTestWithToSpaceExhaustion.class.getName());
-
-    output = new OutputAnalyzer(pb.start());
-    output.shouldContain("[Evacuation Failure");
-    output.shouldContain("[Recalculate Used");
-    output.shouldContain("[Remove Self Forwards");
-    output.shouldContain("[Restore RemSet");
-    output.shouldHaveExitValue(0);
-  }
-
-  static class GCTest {
-    private static byte[] garbage;
-    public static void main(String [] args) {
-      System.out.println("Creating garbage");
-      // create 128MB of garbage. This should result in at least one GC
-      for (int i = 0; i < 1024; i++) {
-        garbage = new byte[128 * 1024];
-      }
-      System.out.println("Done");
+    private enum Level {
+        OFF, FINER, FINEST;
+        public boolean lessOrEqualTo(Level other) {
+            return this.compareTo(other) < 0;
+        }
     }
-  }
 
-  static class GCTestWithToSpaceExhaustion {
-    private static byte[] garbage;
-    private static byte[] largeObject;
-    public static void main(String [] args) {
-      largeObject = new byte[16*1024*1024];
-      System.out.println("Creating garbage");
-      // create 128MB of garbage. This should result in at least one GC,
-      // some of them with to-space exhaustion.
-      for (int i = 0; i < 1024; i++) {
-        garbage = new byte[128 * 1024];
-      }
-      System.out.println("Done");
+    private class LogMessageWithLevel {
+        String message;
+        Level level;
+
+        public LogMessageWithLevel(String message, Level level) {
+            this.message = message;
+            this.level = level;
+        }
+    };
+
+    private LogMessageWithLevel allLogMessages[] = new LogMessageWithLevel[] {
+        // Ext Root Scan
+        new LogMessageWithLevel("Thread Roots (ms)", Level.FINEST),
+        new LogMessageWithLevel("StringTable Roots (ms)", Level.FINEST),
+        new LogMessageWithLevel("Universe Roots (ms)", Level.FINEST),
+        new LogMessageWithLevel("JNI Handles Roots (ms)", Level.FINEST),
+        new LogMessageWithLevel("ObjectSynchronizer Roots (ms)", Level.FINEST),
+        new LogMessageWithLevel("FlatProfiler Roots", Level.FINEST),
+        new LogMessageWithLevel("Management Roots", Level.FINEST),
+        new LogMessageWithLevel("SystemDictionary Roots", Level.FINEST),
+        new LogMessageWithLevel("CLDG Roots", Level.FINEST),
+        new LogMessageWithLevel("JVMTI Roots", Level.FINEST),
+        new LogMessageWithLevel("CodeCache Roots", Level.FINEST),
+        new LogMessageWithLevel("SATB Filtering", Level.FINEST),
+        new LogMessageWithLevel("CM RefProcessor Roots", Level.FINEST),
+        new LogMessageWithLevel("Wait For Strong CLD", Level.FINEST),
+        new LogMessageWithLevel("Weak CLD Roots", Level.FINEST),
+        // Redirty Cards
+        new LogMessageWithLevel("Redirty Cards", Level.FINER),
+        new LogMessageWithLevel("Parallel Redirty", Level.FINEST),
+        new LogMessageWithLevel("Redirtied Cards", Level.FINEST),
+        // Misc Top-level
+        new LogMessageWithLevel("Code Root Purge", Level.FINER),
+        new LogMessageWithLevel("String Dedup Fixup", Level.FINER),
+        // Free CSet
+        new LogMessageWithLevel("Young Free CSet", Level.FINEST),
+        new LogMessageWithLevel("Non-Young Free CSet", Level.FINEST),
+        // Humongous Eager Reclaim
+        new LogMessageWithLevel("Humongous Reclaim", Level.FINER),
+        new LogMessageWithLevel("Humongous Register", Level.FINER),
+    };
+
+    void checkMessagesAtLevel(OutputAnalyzer output, LogMessageWithLevel messages[], Level level) throws Exception {
+        for (LogMessageWithLevel l : messages) {
+            if (level.lessOrEqualTo(l.level)) {
+                output.shouldNotContain(l.message);
+            } else {
+                output.shouldContain(l.message);
+            }
+        }
     }
-  }
+
+    public static void main(String[] args) throws Exception {
+        new TestGCLogMessages().testNormalLogs();
+        new TestGCLogMessages().testWithToSpaceExhaustionLogs();
+    }
+
+    private void testNormalLogs() throws Exception {
+
+        ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-XX:+UseG1GC",
+                                                                  "-Xmx10M",
+                                                                  GCTest.class.getName());
+
+        OutputAnalyzer output = new OutputAnalyzer(pb.start());
+        checkMessagesAtLevel(output, allLogMessages, Level.OFF);
+        output.shouldHaveExitValue(0);
+
+        pb = ProcessTools.createJavaProcessBuilder("-XX:+UseG1GC",
+                                                   "-XX:+UseStringDeduplication",
+                                                   "-Xmx10M",
+                                                   "-XX:+PrintGCDetails",
+                                                   GCTest.class.getName());
+
+        output = new OutputAnalyzer(pb.start());
+        checkMessagesAtLevel(output, allLogMessages, Level.FINER);
+
+        pb = ProcessTools.createJavaProcessBuilder("-XX:+UseG1GC",
+                                                   "-XX:+UseStringDeduplication",
+                                                   "-Xmx10M",
+                                                   "-XX:+PrintGCDetails",
+                                                   "-XX:+UnlockExperimentalVMOptions",
+                                                   "-XX:G1LogLevel=finest",
+                                                   GCTest.class.getName());
+
+        output = new OutputAnalyzer(pb.start());
+        checkMessagesAtLevel(output, allLogMessages, Level.FINEST);
+        output.shouldHaveExitValue(0);
+    }
+
+    LogMessageWithLevel exhFailureMessages[] = new LogMessageWithLevel[] {
+        new LogMessageWithLevel("Evacuation Failure", Level.FINER),
+        new LogMessageWithLevel("Recalculate Used", Level.FINEST),
+        new LogMessageWithLevel("Remove Self Forwards", Level.FINEST),
+        new LogMessageWithLevel("Restore RemSet", Level.FINEST),
+    };
+
+    private void testWithToSpaceExhaustionLogs() throws Exception {
+        ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-XX:+UseG1GC",
+                                                                  "-Xmx32M",
+                                                                  "-Xmn16M",
+                                                                  "-XX:+PrintGCDetails",
+                                                                  GCTestWithToSpaceExhaustion.class.getName());
+
+        OutputAnalyzer output = new OutputAnalyzer(pb.start());
+        checkMessagesAtLevel(output, exhFailureMessages, Level.FINER);
+        output.shouldHaveExitValue(0);
+
+        pb = ProcessTools.createJavaProcessBuilder("-XX:+UseG1GC",
+                                                   "-Xmx32M",
+                                                   "-Xmn16M",
+                                                   "-XX:+PrintGCDetails",
+                                                   "-XX:+UnlockExperimentalVMOptions",
+                                                   "-XX:G1LogLevel=finest",
+                                                   GCTestWithToSpaceExhaustion.class.getName());
+
+        output = new OutputAnalyzer(pb.start());
+        checkMessagesAtLevel(output, exhFailureMessages, Level.FINEST);
+        output.shouldHaveExitValue(0);
+    }
+
+    static class GCTest {
+        private static byte[] garbage;
+        public static void main(String [] args) {
+            System.out.println("Creating garbage");
+            // create 128MB of garbage. This should result in at least one GC
+            for (int i = 0; i < 1024; i++) {
+                garbage = new byte[128 * 1024];
+            }
+            System.out.println("Done");
+        }
+    }
+
+    static class GCTestWithToSpaceExhaustion {
+        private static byte[] garbage;
+        private static byte[] largeObject;
+        public static void main(String [] args) {
+            largeObject = new byte[16*1024*1024];
+            System.out.println("Creating garbage");
+            // create 128MB of garbage. This should result in at least one GC,
+            // some of them with to-space exhaustion.
+            for (int i = 0; i < 1024; i++) {
+                garbage = new byte[128 * 1024];
+            }
+            System.out.println("Done");
+        }
+    }
 }
+
diff --git a/hotspot/test/gc/g1/TestHumongousAllocInitialMark.java b/hotspot/test/gc/g1/TestHumongousAllocInitialMark.java
index b6e5c3d..b8f7b3a 100644
--- a/hotspot/test/gc/g1/TestHumongousAllocInitialMark.java
+++ b/hotspot/test/gc/g1/TestHumongousAllocInitialMark.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 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
@@ -26,6 +26,8 @@
  * @bug 7168848
  * @summary G1: humongous object allocations should initiate marking cycles when necessary
  * @library /testlibrary
+ * @modules java.base/sun.misc
+ *          java.management
  */
 
 import com.oracle.java.testlibrary.*;
diff --git a/hotspot/test/gc/g1/TestHumongousCodeCacheRoots.java b/hotspot/test/gc/g1/TestHumongousCodeCacheRoots.java
index c24b3ec..131ebe5 100644
--- a/hotspot/test/gc/g1/TestHumongousCodeCacheRoots.java
+++ b/hotspot/test/gc/g1/TestHumongousCodeCacheRoots.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -27,6 +27,8 @@
  * @key gc
  * @bug 8027756
  * @library /testlibrary /../../test/lib
+ * @modules java.base/sun.misc
+ *          java.management
  * @build TestHumongousCodeCacheRoots
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
diff --git a/hotspot/test/gc/g1/TestHumongousShrinkHeap.java b/hotspot/test/gc/g1/TestHumongousShrinkHeap.java
index 764cfab..32856ca 100644
--- a/hotspot/test/gc/g1/TestHumongousShrinkHeap.java
+++ b/hotspot/test/gc/g1/TestHumongousShrinkHeap.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -28,6 +28,7 @@
  * @summary Verify that heap shrinks after GC in the presence of fragmentation
  * due to humongous objects
  * @library /testlibrary
+ * @modules java.management/sun.management
  * @run main/othervm -XX:-ExplicitGCInvokesConcurrent -XX:MinHeapFreeRatio=10
  * -XX:MaxHeapFreeRatio=12 -XX:+UseG1GC -XX:G1HeapRegionSize=1M -verbose:gc
  * TestHumongousShrinkHeap
diff --git a/hotspot/test/gc/g1/TestPrintGCDetails.java b/hotspot/test/gc/g1/TestPrintGCDetails.java
index 4280a19..1d07a7d 100644
--- a/hotspot/test/gc/g1/TestPrintGCDetails.java
+++ b/hotspot/test/gc/g1/TestPrintGCDetails.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -28,6 +28,8 @@
  * @key gc
  * @key regression
  * @library /testlibrary
+ * @modules java.base/sun.misc
+ *          java.management
  */
 
 import com.oracle.java.testlibrary.ProcessTools;
diff --git a/hotspot/test/gc/g1/TestPrintRegionRememberedSetInfo.java b/hotspot/test/gc/g1/TestPrintRegionRememberedSetInfo.java
index 6bf4139..97934bf 100644
--- a/hotspot/test/gc/g1/TestPrintRegionRememberedSetInfo.java
+++ b/hotspot/test/gc/g1/TestPrintRegionRememberedSetInfo.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -27,6 +27,8 @@
  * @bug 8014240
  * @summary Test output of G1PrintRegionRememberedSetInfo
  * @library /testlibrary
+ * @modules java.base/sun.misc
+ *          java.management
  * @run main TestPrintRegionRememberedSetInfo
  * @author thomas.schatzl@oracle.com
  */
diff --git a/hotspot/test/gc/g1/TestShrinkAuxiliaryData.java b/hotspot/test/gc/g1/TestShrinkAuxiliaryData.java
index 7ee2316..3145eb6 100644
--- a/hotspot/test/gc/g1/TestShrinkAuxiliaryData.java
+++ b/hotspot/test/gc/g1/TestShrinkAuxiliaryData.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -21,7 +21,7 @@
  * questions.
  */
 
-import static com.oracle.java.testlibrary.Asserts.assertLessThanOrEqual;
+import com.oracle.java.testlibrary.Asserts;
 import com.oracle.java.testlibrary.OutputAnalyzer;
 import com.oracle.java.testlibrary.Platform;
 import com.oracle.java.testlibrary.ProcessTools;
@@ -36,23 +36,29 @@
 import java.util.Collections;
 import java.util.LinkedList;
 import java.util.List;
-import sun.misc.Unsafe;
+import sun.misc.Unsafe; // for ADDRESS_SIZE
+import sun.hotspot.WhiteBox;
 
 public class TestShrinkAuxiliaryData {
 
+    private static final int REGION_SIZE = 1024 * 1024;
+
     private final static String[] initialOpts = new String[]{
         "-XX:MinHeapFreeRatio=10",
         "-XX:MaxHeapFreeRatio=11",
         "-XX:+UseG1GC",
-        "-XX:G1HeapRegionSize=1m",
+        "-XX:G1HeapRegionSize=" + REGION_SIZE,
         "-XX:-ExplicitGCInvokesConcurrent",
-        "-XX:+PrintGCDetails"
+        "-XX:+PrintGCDetails",
+        "-XX:+UnlockDiagnosticVMOptions",
+        "-XX:+WhiteBoxAPI",
+        "-Xbootclasspath/a:.",
     };
 
-    private final int RSetCacheSize;
+    private final int hotCardTableSize;
 
-    protected TestShrinkAuxiliaryData(int RSetCacheSize) {
-        this.RSetCacheSize = RSetCacheSize;
+    protected TestShrinkAuxiliaryData(int hotCardTableSize) {
+        this.hotCardTableSize = hotCardTableSize;
     }
 
     protected void test() throws Exception {
@@ -60,16 +66,16 @@
         Collections.addAll(vmOpts, initialOpts);
 
         int maxCacheSize = Math.max(0, Math.min(31, getMaxCacheSize()));
-        if (maxCacheSize < RSetCacheSize) {
+        if (maxCacheSize < hotCardTableSize) {
             System.out.format("Skiping test for %d cache size due max cache size %d",
-                    RSetCacheSize, maxCacheSize
+                    hotCardTableSize, maxCacheSize
             );
             return;
         }
 
         printTestInfo(maxCacheSize);
 
-        vmOpts.add("-XX:G1ConcRSLogCacheSize=" + RSetCacheSize);
+        vmOpts.add("-XX:G1ConcRSLogCacheSize=" + hotCardTableSize);
         vmOpts.addAll(Arrays.asList(Utils.getTestJavaOpts()));
 
         // for 32 bits ObjectAlignmentInBytes is not a option
@@ -92,11 +98,13 @@
 
     private void performTest(List<String> opts) throws Exception {
         ProcessBuilder pb
-                       = ProcessTools.createJavaProcessBuilder(
-                opts.toArray(new String[opts.size()])
-        );
+                = ProcessTools.createJavaProcessBuilder(
+                        opts.toArray(new String[opts.size()])
+                );
 
         OutputAnalyzer output = new OutputAnalyzer(pb.start());
+        System.out.println(output.getStdout());
+        System.err.println(output.getStderr());
         output.shouldHaveExitValue(0);
     }
 
@@ -107,12 +115,13 @@
         formatSymbols.setGroupingSeparator(' ');
         grouped.setDecimalFormatSymbols(formatSymbols);
 
-        System.out.format("Test will use %s bytes of memory of %s available%n"
+        System.out.format(
+                "Test will use %s bytes of memory of %s available%n"
                 + "Available memory is %s with %d bytes pointer size - can save %s pointers%n"
                 + "Max cache size: 2^%d = %s elements%n",
                 grouped.format(ShrinkAuxiliaryDataTest.getMemoryUsedByTest()),
-                grouped.format(Runtime.getRuntime().freeMemory()),
-                grouped.format(Runtime.getRuntime().freeMemory()
+                grouped.format(Runtime.getRuntime().maxMemory()),
+                grouped.format(Runtime.getRuntime().maxMemory()
                         - ShrinkAuxiliaryDataTest.getMemoryUsedByTest()),
                 Unsafe.ADDRESS_SIZE,
                 grouped.format((Runtime.getRuntime().freeMemory()
@@ -135,6 +144,7 @@
         if (availableMemory <= 0) {
             return 0;
         }
+
         long availablePointersCount = availableMemory / Unsafe.ADDRESS_SIZE;
         return (63 - (int) Long.numberOfLeadingZeros(availablePointersCount));
     }
@@ -142,17 +152,48 @@
     static class ShrinkAuxiliaryDataTest {
 
         public static void main(String[] args) throws IOException {
-            int iterateCount = DEFAULT_ITERATION_COUNT;
 
-            if (args.length > 0) {
-                try {
-                    iterateCount = Integer.parseInt(args[0]);
-                } catch (NumberFormatException e) {
-                    //num_iterate remains default
-                }
+            ShrinkAuxiliaryDataTest testCase = new ShrinkAuxiliaryDataTest();
+
+            if (!testCase.checkEnvApplicability()) {
+                return;
             }
 
-            new ShrinkAuxiliaryDataTest().test(iterateCount);
+            testCase.test();
+        }
+
+        /**
+         * Checks is this environment suitable to run this test
+         * - memory is enough to decommit (page size is not big)
+         * - RSet cache size is not too big
+         *
+         * @return true if test could run, false if test should be skipped
+         */
+        protected boolean checkEnvApplicability() {
+
+            int pageSize = WhiteBox.getWhiteBox().getVMPageSize();
+            System.out.println( "Page size = " + pageSize
+                    + " region size = " + REGION_SIZE
+                    + " aux data ~= " + (REGION_SIZE * 3 / 100));
+            // If auxdata size will be less than page size it wouldn't decommit.
+            // Auxiliary data size is about ~3.6% of heap size.
+            if (pageSize >= REGION_SIZE * 3 / 100) {
+                System.out.format("Skipping test for too large page size = %d",
+                       pageSize
+                );
+                return false;
+            }
+
+            if (REGION_SIZE * REGIONS_TO_ALLOCATE > Runtime.getRuntime().maxMemory()) {
+                System.out.format("Skipping test for too low available memory. "
+                        + "Need %d, available %d",
+                        REGION_SIZE * REGIONS_TO_ALLOCATE,
+                        Runtime.getRuntime().maxMemory()
+                );
+                return false;
+            }
+
+            return true;
         }
 
         class GarbageObject {
@@ -177,41 +218,54 @@
 
         private final List<GarbageObject> garbage = new ArrayList();
 
-        public void test(int num_iterate) throws IOException {
+        public void test() throws IOException {
+
+            MemoryUsage muFull, muFree, muAuxDataFull, muAuxDataFree;
+            float auxFull, auxFree;
 
             allocate();
             link();
             mutate();
+
+            muFull = ManagementFactory.getMemoryMXBean().getHeapMemoryUsage();
+            long numUsedRegions = WhiteBox.getWhiteBox().g1NumMaxRegions()
+                    - WhiteBox.getWhiteBox().g1NumFreeRegions();
+            muAuxDataFull = WhiteBox.getWhiteBox().g1AuxiliaryMemoryUsage();
+            auxFull = (float)muAuxDataFull.getUsed() / numUsedRegions;
+
+            System.out.format("Full aux data  ratio= %f, regions max= %d, used= %d\n",
+                    auxFull, WhiteBox.getWhiteBox().g1NumMaxRegions(), numUsedRegions
+            );
+
             deallocate();
-
-            MemoryUsage muBeforeHeap
-                        = ManagementFactory.getMemoryMXBean().getHeapMemoryUsage();
-            MemoryUsage muBeforeNonHeap
-                        = ManagementFactory.getMemoryMXBean().getNonHeapMemoryUsage();
-
-            for (int i = 0; i < num_iterate; i++) {
-                allocate();
-                link();
-                mutate();
-                deallocate();
-            }
-
             System.gc();
-            MemoryUsage muAfterHeap
-                        = ManagementFactory.getMemoryMXBean().getHeapMemoryUsage();
-            MemoryUsage muAfterNonHeap
-                        = ManagementFactory.getMemoryMXBean().getNonHeapMemoryUsage();
 
-            assertLessThanOrEqual(muAfterHeap.getCommitted(), muBeforeHeap.getCommitted(),
-                    String.format("heap decommit failed - after > before: %d > %d",
-                            muAfterHeap.getCommitted(), muBeforeHeap.getCommitted()
+            muFree = ManagementFactory.getMemoryMXBean().getHeapMemoryUsage();
+            muAuxDataFree = WhiteBox.getWhiteBox().g1AuxiliaryMemoryUsage();
+
+            numUsedRegions = WhiteBox.getWhiteBox().g1NumMaxRegions()
+                    - WhiteBox.getWhiteBox().g1NumFreeRegions();
+            auxFree = (float)muAuxDataFree.getUsed() / numUsedRegions;
+
+            System.out.format("Free aux data ratio= %f, regions max= %d, used= %d\n",
+                    auxFree, WhiteBox.getWhiteBox().g1NumMaxRegions(), numUsedRegions
+            );
+
+            Asserts.assertLessThanOrEqual(muFree.getCommitted(), muFull.getCommitted(),
+                    String.format("heap decommit failed - full > free: %d > %d",
+                            muFree.getCommitted(), muFull.getCommitted()
                     )
             );
 
-            if (muAfterHeap.getCommitted() < muBeforeHeap.getCommitted()) {
-                assertLessThanOrEqual(muAfterNonHeap.getCommitted(), muBeforeNonHeap.getCommitted(),
-                        String.format("non-heap decommit failed - after > before: %d > %d",
-                                muAfterNonHeap.getCommitted(), muBeforeNonHeap.getCommitted()
+            System.out.format("State               used   committed\n");
+            System.out.format("Full aux data: %10d %10d\n", muAuxDataFull.getUsed(), muAuxDataFull.getCommitted());
+            System.out.format("Free aux data: %10d %10d\n", muAuxDataFree.getUsed(), muAuxDataFree.getCommitted());
+
+            // if decommited check that aux data has same ratio
+            if (muFree.getCommitted() < muFull.getCommitted()) {
+                Asserts.assertLessThanOrEqual(auxFree, auxFull,
+                        String.format("auxiliary data decommit failed - full > free: %f > %f",
+                                auxFree, auxFull
                         )
                 );
             }
@@ -238,8 +292,7 @@
                 for (int i = 0; i < NUM_LINKS; i++) {
                     int regionToLink;
                     do {
-                        regionToLink = (int) (Math.random()
-                                * REGIONS_TO_ALLOCATE);
+                        regionToLink = (int) (Math.random() * REGIONS_TO_ALLOCATE);
                     } while (regionToLink == regionNumber);
 
                     // get random garbage object from random region
@@ -265,11 +318,8 @@
             return REGIONS_TO_ALLOCATE * REGION_SIZE;
         }
 
-        private static final int REGION_SIZE = 1024 * 1024;
-        private static final int DEFAULT_ITERATION_COUNT = 1;   // iterate main scenario
-        private static final int REGIONS_TO_ALLOCATE = 5;
+        private static final int REGIONS_TO_ALLOCATE = 100;
         private static final int NUM_OBJECTS_PER_REGION = 10;
         private static final int NUM_LINKS = 20; // how many links create for each object
-
     }
 }
diff --git a/hotspot/test/gc/g1/TestShrinkAuxiliaryData00.java b/hotspot/test/gc/g1/TestShrinkAuxiliaryData00.java
index 7d36e82..a9fed90 100644
--- a/hotspot/test/gc/g1/TestShrinkAuxiliaryData00.java
+++ b/hotspot/test/gc/g1/TestShrinkAuxiliaryData00.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,11 +23,17 @@
 
 /**
  * @test TestShrinkAuxiliaryData00
- * @bug 8038423
+ * @bug 8038423 8061715
  * @summary Checks that decommitment occurs for JVM with different
  * G1ConcRSLogCacheSize and ObjectAlignmentInBytes options values
+ * @requires vm.gc=="G1" | vm.gc=="null"
  * @library /testlibrary /../../test/lib
- * @build TestShrinkAuxiliaryData TestShrinkAuxiliaryData00
+ * @modules java.base/sun.misc
+ *          java.management
+ * @build com.oracle.java.testlibrary.* sun.hotspot.WhiteBox
+ *        TestShrinkAuxiliaryData TestShrinkAuxiliaryData00
+ * @run main ClassFileInstaller sun.hotspot.WhiteBox
+ *                              sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run driver/timeout=720 TestShrinkAuxiliaryData00
  */
 public class TestShrinkAuxiliaryData00 {
diff --git a/hotspot/test/gc/g1/TestShrinkAuxiliaryData05.java b/hotspot/test/gc/g1/TestShrinkAuxiliaryData05.java
index 403b7bf..5a51d23 100644
--- a/hotspot/test/gc/g1/TestShrinkAuxiliaryData05.java
+++ b/hotspot/test/gc/g1/TestShrinkAuxiliaryData05.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,12 +23,17 @@
 
 /**
  * @test TestShrinkAuxiliaryData05
- * @bug 8038423
+ * @bug 8038423 8061715
  * @summary Checks that decommitment occurs for JVM with different
  * G1ConcRSLogCacheSize and ObjectAlignmentInBytes options values
  * @requires vm.gc=="G1" | vm.gc=="null"
  * @library /testlibrary /../../test/lib
- * @build TestShrinkAuxiliaryData TestShrinkAuxiliaryData05
+ * @modules java.base/sun.misc
+ *          java.management
+ * @build com.oracle.java.testlibrary.* sun.hotspot.WhiteBox
+ *        TestShrinkAuxiliaryData TestShrinkAuxiliaryData05
+ * @run main ClassFileInstaller sun.hotspot.WhiteBox
+ *                              sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run driver/timeout=720 TestShrinkAuxiliaryData05
  */
 public class TestShrinkAuxiliaryData05 {
diff --git a/hotspot/test/gc/g1/TestShrinkAuxiliaryData10.java b/hotspot/test/gc/g1/TestShrinkAuxiliaryData10.java
index ad2ab41..48a82b2 100644
--- a/hotspot/test/gc/g1/TestShrinkAuxiliaryData10.java
+++ b/hotspot/test/gc/g1/TestShrinkAuxiliaryData10.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,12 +23,17 @@
 
 /**
  * @test TestShrinkAuxiliaryData10
- * @bug 8038423
+ * @bug 8038423 8061715
  * @summary Checks that decommitment occurs for JVM with different
  * G1ConcRSLogCacheSize and ObjectAlignmentInBytes options values
  * @requires vm.gc=="G1" | vm.gc=="null"
  * @library /testlibrary /../../test/lib
+ * @modules java.base/sun.misc
+ *          java.management
+ * @build com.oracle.java.testlibrary.* sun.hotspot.WhiteBox
  * @build TestShrinkAuxiliaryData TestShrinkAuxiliaryData10
+ * @run main ClassFileInstaller sun.hotspot.WhiteBox
+ *                              sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run driver/timeout=720 TestShrinkAuxiliaryData10
  */
 public class TestShrinkAuxiliaryData10 {
diff --git a/hotspot/test/gc/g1/TestShrinkAuxiliaryData15.java b/hotspot/test/gc/g1/TestShrinkAuxiliaryData15.java
index 76d54ae..2653024 100644
--- a/hotspot/test/gc/g1/TestShrinkAuxiliaryData15.java
+++ b/hotspot/test/gc/g1/TestShrinkAuxiliaryData15.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,12 +23,17 @@
 
 /**
  * @test TestShrinkAuxiliaryData15
- * @bug 8038423
+ * @bug 8038423 8061715
  * @summary Checks that decommitment occurs for JVM with different
  * G1ConcRSLogCacheSize and ObjectAlignmentInBytes options values
  * @requires vm.gc=="G1" | vm.gc=="null"
  * @library /testlibrary /../../test/lib
+ * @modules java.base/sun.misc
+ *          java.management
+ * @build com.oracle.java.testlibrary.* sun.hotspot.WhiteBox
  * @build TestShrinkAuxiliaryData TestShrinkAuxiliaryData15
+ * @run main ClassFileInstaller sun.hotspot.WhiteBox
+ *                              sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run driver/timeout=720 TestShrinkAuxiliaryData15
  */
 public class TestShrinkAuxiliaryData15 {
diff --git a/hotspot/test/gc/g1/TestShrinkAuxiliaryData20.java b/hotspot/test/gc/g1/TestShrinkAuxiliaryData20.java
index 43c349e6..9cc4893 100644
--- a/hotspot/test/gc/g1/TestShrinkAuxiliaryData20.java
+++ b/hotspot/test/gc/g1/TestShrinkAuxiliaryData20.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,12 +23,17 @@
 
 /**
  * @test TestShrinkAuxiliaryData20
- * @bug 8038423
+ * @bug 8038423 8061715
  * @summary Checks that decommitment occurs for JVM with different
  * G1ConcRSLogCacheSize and ObjectAlignmentInBytes options values
  * @requires vm.gc=="G1" | vm.gc=="null"
  * @library /testlibrary /../../test/lib
+ * @modules java.base/sun.misc
+  *          java.management
+ * @build com.oracle.java.testlibrary.* sun.hotspot.WhiteBox
  * @build TestShrinkAuxiliaryData TestShrinkAuxiliaryData20
+ * @run main ClassFileInstaller sun.hotspot.WhiteBox
+ *                              sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run driver/timeout=720 TestShrinkAuxiliaryData20
  */
 public class TestShrinkAuxiliaryData20 {
diff --git a/hotspot/test/gc/g1/TestShrinkAuxiliaryData25.java b/hotspot/test/gc/g1/TestShrinkAuxiliaryData25.java
index e86d75a..2cb0b0d 100644
--- a/hotspot/test/gc/g1/TestShrinkAuxiliaryData25.java
+++ b/hotspot/test/gc/g1/TestShrinkAuxiliaryData25.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,12 +23,17 @@
 
 /**
  * @test TestShrinkAuxiliaryData25
- * @bug 8038423
+ * @bug 8038423 8061715
  * @summary Checks that decommitment occurs for JVM with different
  * G1ConcRSLogCacheSize and ObjectAlignmentInBytes options values
  * @requires vm.gc=="G1" | vm.gc=="null"
  * @library /testlibrary /../../test/lib
+ * @modules java.base/sun.misc
+ *          java.management
+ * @build com.oracle.java.testlibrary.* sun.hotspot.WhiteBox
  * @build TestShrinkAuxiliaryData TestShrinkAuxiliaryData25
+ * @run main ClassFileInstaller sun.hotspot.WhiteBox
+ *                              sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run driver/timeout=720 TestShrinkAuxiliaryData25
  */
 public class TestShrinkAuxiliaryData25 {
diff --git a/hotspot/test/gc/g1/TestShrinkAuxiliaryData30.java b/hotspot/test/gc/g1/TestShrinkAuxiliaryData30.java
index 0890484..a8e6590 100644
--- a/hotspot/test/gc/g1/TestShrinkAuxiliaryData30.java
+++ b/hotspot/test/gc/g1/TestShrinkAuxiliaryData30.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,12 +23,17 @@
 
 /**
  * @test TestShrinkAuxiliaryData30
- * @bug 8038423
+ * @bug 8038423 8061715
  * @summary Checks that decommitment occurs for JVM with different
  * G1ConcRSLogCacheSize and ObjectAlignmentInBytes options values
  * @requires vm.gc=="G1" | vm.gc=="null"
  * @library /testlibrary /../../test/lib
+ * @modules java.base/sun.misc
+ *          java.management
+ * @build com.oracle.java.testlibrary.* sun.hotspot.WhiteBox
  * @build TestShrinkAuxiliaryData TestShrinkAuxiliaryData30
+ * @run main ClassFileInstaller sun.hotspot.WhiteBox
+ *                              sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run driver/timeout=720 TestShrinkAuxiliaryData30
  */
 public class TestShrinkAuxiliaryData30 {
diff --git a/hotspot/test/gc/g1/TestShrinkDefragmentedHeap.java b/hotspot/test/gc/g1/TestShrinkDefragmentedHeap.java
index c23c872..43c35a3 100644
--- a/hotspot/test/gc/g1/TestShrinkDefragmentedHeap.java
+++ b/hotspot/test/gc/g1/TestShrinkDefragmentedHeap.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -32,6 +32,8 @@
  *     3. invoke gc and check that memory returned to the system (amount of committed memory got down)
  *
  * @library /testlibrary
+ * @modules java.base/sun.misc
+ *          java.management/sun.management
  */
 import java.lang.management.ManagementFactory;
 import java.lang.management.MemoryUsage;
diff --git a/hotspot/test/gc/g1/TestStringDeduplicationAgeThreshold.java b/hotspot/test/gc/g1/TestStringDeduplicationAgeThreshold.java
index 8bdac8d..cfa4b1f 100644
--- a/hotspot/test/gc/g1/TestStringDeduplicationAgeThreshold.java
+++ b/hotspot/test/gc/g1/TestStringDeduplicationAgeThreshold.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -27,6 +27,8 @@
  * @bug 8029075
  * @key gc
  * @library /testlibrary
+ * @modules java.base/sun.misc
+ *          java.management
  */
 
 public class TestStringDeduplicationAgeThreshold {
diff --git a/hotspot/test/gc/g1/TestStringDeduplicationFullGC.java b/hotspot/test/gc/g1/TestStringDeduplicationFullGC.java
index 0e47db7..8265f30 100644
--- a/hotspot/test/gc/g1/TestStringDeduplicationFullGC.java
+++ b/hotspot/test/gc/g1/TestStringDeduplicationFullGC.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -27,6 +27,8 @@
  * @bug 8029075
  * @key gc
  * @library /testlibrary
+ * @modules java.base/sun.misc
+ *          java.management
  */
 
 public class TestStringDeduplicationFullGC {
diff --git a/hotspot/test/gc/g1/TestStringDeduplicationInterned.java b/hotspot/test/gc/g1/TestStringDeduplicationInterned.java
index 680fa86..24fcb71 100644
--- a/hotspot/test/gc/g1/TestStringDeduplicationInterned.java
+++ b/hotspot/test/gc/g1/TestStringDeduplicationInterned.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -27,6 +27,8 @@
  * @bug 8029075
  * @key gc
  * @library /testlibrary
+ * @modules java.base/sun.misc
+ *          java.management
  */
 
 public class TestStringDeduplicationInterned {
diff --git a/hotspot/test/gc/g1/TestStringDeduplicationPrintOptions.java b/hotspot/test/gc/g1/TestStringDeduplicationPrintOptions.java
index 5827964..83401a4 100644
--- a/hotspot/test/gc/g1/TestStringDeduplicationPrintOptions.java
+++ b/hotspot/test/gc/g1/TestStringDeduplicationPrintOptions.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -27,6 +27,8 @@
  * @bug 8029075
  * @key gc
  * @library /testlibrary
+ * @modules java.base/sun.misc
+ *          java.management
  */
 
 public class TestStringDeduplicationPrintOptions {
diff --git a/hotspot/test/gc/g1/TestStringDeduplicationTableRehash.java b/hotspot/test/gc/g1/TestStringDeduplicationTableRehash.java
index 9b5d092..0a37b95 100644
--- a/hotspot/test/gc/g1/TestStringDeduplicationTableRehash.java
+++ b/hotspot/test/gc/g1/TestStringDeduplicationTableRehash.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -27,6 +27,8 @@
  * @bug 8029075
  * @key gc
  * @library /testlibrary
+ * @modules java.base/sun.misc
+ *          java.management
  */
 
 public class TestStringDeduplicationTableRehash {
diff --git a/hotspot/test/gc/g1/TestStringDeduplicationTableResize.java b/hotspot/test/gc/g1/TestStringDeduplicationTableResize.java
index 803c63b..7106527 100644
--- a/hotspot/test/gc/g1/TestStringDeduplicationTableResize.java
+++ b/hotspot/test/gc/g1/TestStringDeduplicationTableResize.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -27,6 +27,8 @@
  * @bug 8029075
  * @key gc
  * @library /testlibrary
+ * @modules java.base/sun.misc
+ *          java.management
  */
 
 public class TestStringDeduplicationTableResize {
diff --git a/hotspot/test/gc/g1/TestStringDeduplicationYoungGC.java b/hotspot/test/gc/g1/TestStringDeduplicationYoungGC.java
index c856d01..66c6ee4 100644
--- a/hotspot/test/gc/g1/TestStringDeduplicationYoungGC.java
+++ b/hotspot/test/gc/g1/TestStringDeduplicationYoungGC.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -27,6 +27,8 @@
  * @bug 8029075
  * @key gc
  * @library /testlibrary
+ * @modules java.base/sun.misc
+ *          java.management
  */
 
 public class TestStringDeduplicationYoungGC {
diff --git a/hotspot/test/gc/g1/TestStringSymbolTableStats.java b/hotspot/test/gc/g1/TestStringSymbolTableStats.java
index f95aea8..658aaab 100644
--- a/hotspot/test/gc/g1/TestStringSymbolTableStats.java
+++ b/hotspot/test/gc/g1/TestStringSymbolTableStats.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -27,6 +27,8 @@
  * @summary Ensure that the G1TraceStringSymbolTableScrubbing prints the expected message.
  * @key gc
  * @library /testlibrary
+ * @modules java.base/sun.misc
+ *          java.management
  */
 
 import com.oracle.java.testlibrary.ProcessTools;
diff --git a/hotspot/test/gc/g1/TestSummarizeRSetStats.java b/hotspot/test/gc/g1/TestSummarizeRSetStats.java
index e78e2df..f57a8bd 100644
--- a/hotspot/test/gc/g1/TestSummarizeRSetStats.java
+++ b/hotspot/test/gc/g1/TestSummarizeRSetStats.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,6 +25,8 @@
  * @test TestSummarizeRSetStats.java
  * @bug 8013895
  * @library /testlibrary
+ * @modules java.base/sun.misc
+ *          java.management/sun.management
  * @build TestSummarizeRSetStatsTools TestSummarizeRSetStats
  * @summary Verify output of -XX:+G1SummarizeRSetStats
  * @run main TestSummarizeRSetStats
diff --git a/hotspot/test/gc/g1/TestSummarizeRSetStatsPerRegion.java b/hotspot/test/gc/g1/TestSummarizeRSetStatsPerRegion.java
index 437cbc2..8430060 100644
--- a/hotspot/test/gc/g1/TestSummarizeRSetStatsPerRegion.java
+++ b/hotspot/test/gc/g1/TestSummarizeRSetStatsPerRegion.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,6 +25,8 @@
  * @test TestSummarizeRSetStatsPerRegion.java
  * @bug 8014078
  * @library /testlibrary
+ * @modules java.base/sun.misc
+ *          java.management/sun.management
  * @build TestSummarizeRSetStatsTools TestSummarizeRSetStatsPerRegion
  * @summary Verify output of -XX:+G1SummarizeRSetStats in regards to per-region type output
  * @run main TestSummarizeRSetStatsPerRegion
diff --git a/hotspot/test/gc/g1/TestSummarizeRSetStatsThreads.java b/hotspot/test/gc/g1/TestSummarizeRSetStatsThreads.java
index 2723042..512d88f 100644
--- a/hotspot/test/gc/g1/TestSummarizeRSetStatsThreads.java
+++ b/hotspot/test/gc/g1/TestSummarizeRSetStatsThreads.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -28,6 +28,8 @@
  * refinement threads do not crash the VM.
  * @key gc
  * @library /testlibrary
+ * @modules java.base/sun.misc
+ *          java.management/sun.management
  */
 
 import java.util.regex.Matcher;
diff --git a/hotspot/test/gc/logging/TestGCId.java b/hotspot/test/gc/logging/TestGCId.java
index 98f9491..57e52f4 100644
--- a/hotspot/test/gc/logging/TestGCId.java
+++ b/hotspot/test/gc/logging/TestGCId.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -27,6 +27,8 @@
  * @summary Ensure that the GCId is logged
  * @key gc
  * @library /testlibrary
+ * @modules java.base/sun.misc
+ *          java.management
  */
 
 import com.oracle.java.testlibrary.ProcessTools;
diff --git a/hotspot/test/gc/metaspace/CompressedClassSpaceSizeInJmapHeap.java b/hotspot/test/gc/metaspace/CompressedClassSpaceSizeInJmapHeap.java
index bad06bb..20ea7d1 100644
--- a/hotspot/test/gc/metaspace/CompressedClassSpaceSizeInJmapHeap.java
+++ b/hotspot/test/gc/metaspace/CompressedClassSpaceSizeInJmapHeap.java
@@ -26,6 +26,8 @@
  * @bug 8004924
  * @summary Checks that jmap -heap contains the flag CompressedClassSpaceSize
  * @library /testlibrary
+ * @modules java.base/sun.misc
+ *          java.management
  * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:CompressedClassSpaceSize=50m CompressedClassSpaceSizeInJmapHeap
  */
 
diff --git a/hotspot/test/gc/metaspace/TestCapacityUntilGCWrapAround.java b/hotspot/test/gc/metaspace/TestCapacityUntilGCWrapAround.java
index a95d6f0..279bdd7 100644
--- a/hotspot/test/gc/metaspace/TestCapacityUntilGCWrapAround.java
+++ b/hotspot/test/gc/metaspace/TestCapacityUntilGCWrapAround.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,6 +26,8 @@
  * @key gc
  * @bug 8049831
  * @library /testlibrary /../../test/lib
+ * @modules java.base/sun.misc
+ *          java.management
  * @build TestCapacityUntilGCWrapAround
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
diff --git a/hotspot/test/gc/metaspace/TestMetaspaceMemoryPool.java b/hotspot/test/gc/metaspace/TestMetaspaceMemoryPool.java
index bf9e74c..4170e95 100644
--- a/hotspot/test/gc/metaspace/TestMetaspaceMemoryPool.java
+++ b/hotspot/test/gc/metaspace/TestMetaspaceMemoryPool.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -31,6 +31,8 @@
  * @summary Tests that a MemoryPoolMXBeans is created for metaspace and that a
  *          MemoryManagerMXBean is created.
  * @library /testlibrary
+ * @modules java.base/sun.misc
+ *          java.management
  * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:-UseCompressedOops TestMetaspaceMemoryPool
  * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:-UseCompressedOops -XX:MaxMetaspaceSize=60m TestMetaspaceMemoryPool
  * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+UseCompressedOops -XX:+UseCompressedClassPointers TestMetaspaceMemoryPool
diff --git a/hotspot/test/gc/metaspace/TestMetaspacePerfCounters.java b/hotspot/test/gc/metaspace/TestMetaspacePerfCounters.java
index a02f5b4..173994b 100644
--- a/hotspot/test/gc/metaspace/TestMetaspacePerfCounters.java
+++ b/hotspot/test/gc/metaspace/TestMetaspacePerfCounters.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -33,7 +33,10 @@
  * @library /testlibrary
  * @summary Tests that performance counters for metaspace and compressed class
  *          space exists and works.
- *
+ * @modules java.base/sun.misc
+ *          java.compiler
+ *          java.management
+ *          jdk.jvmstat/sun.jvmstat.monitor
  * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:-UseCompressedOops -XX:-UseCompressedClassPointers -XX:+UsePerfData -XX:+UseSerialGC TestMetaspacePerfCounters
  * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:-UseCompressedOops -XX:-UseCompressedClassPointers -XX:+UsePerfData -XX:+UseParallelGC -XX:+UseParallelOldGC TestMetaspacePerfCounters
  * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:-UseCompressedOops -XX:-UseCompressedClassPointers -XX:+UsePerfData -XX:+UseG1GC TestMetaspacePerfCounters
diff --git a/hotspot/test/gc/metaspace/TestMetaspaceSizeFlags.java b/hotspot/test/gc/metaspace/TestMetaspaceSizeFlags.java
index c67b8dc..d990eeb 100644
--- a/hotspot/test/gc/metaspace/TestMetaspaceSizeFlags.java
+++ b/hotspot/test/gc/metaspace/TestMetaspaceSizeFlags.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -31,6 +31,8 @@
  * @bug 8024650
  * @summary Test that metaspace size flags can be set correctly
  * @library /testlibrary
+ * @modules java.base/sun.misc
+ *          java.management
  */
 public class TestMetaspaceSizeFlags {
   public static final long K = 1024L;
diff --git a/hotspot/test/gc/metaspace/TestPerfCountersAndMemoryPools.java b/hotspot/test/gc/metaspace/TestPerfCountersAndMemoryPools.java
index 4aaa8ac..84a3510 100644
--- a/hotspot/test/gc/metaspace/TestPerfCountersAndMemoryPools.java
+++ b/hotspot/test/gc/metaspace/TestPerfCountersAndMemoryPools.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -33,6 +33,9 @@
  * @requires vm.gc=="Serial" | vm.gc=="null"
  * @summary Tests that a MemoryPoolMXBeans and PerfCounters for metaspace
  *          report the same data.
+ * @modules java.base/sun.misc
+ *          java.management
+ *          jdk.jvmstat/sun.jvmstat.monitor
  * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:-UseCompressedOops -XX:-UseCompressedKlassPointers -XX:+UseSerialGC -XX:+UsePerfData -Xint TestPerfCountersAndMemoryPools
  * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+UseCompressedOops -XX:+UseCompressedKlassPointers -XX:+UseSerialGC -XX:+UsePerfData -Xint TestPerfCountersAndMemoryPools
  */
diff --git a/hotspot/test/gc/parallelScavenge/AdaptiveGCBoundary.java b/hotspot/test/gc/parallelScavenge/AdaptiveGCBoundary.java
index 5712559..589c974 100644
--- a/hotspot/test/gc/parallelScavenge/AdaptiveGCBoundary.java
+++ b/hotspot/test/gc/parallelScavenge/AdaptiveGCBoundary.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -28,6 +28,8 @@
  * @key gc
  * @key regression
  * @library /testlibrary
+ * @modules java.base/sun.misc
+ *          java.management
  * @run main/othervm AdaptiveGCBoundary
  * @author jon.masamitsu@oracle.com
  */
diff --git a/hotspot/test/gc/startup_warnings/TestCMS.java b/hotspot/test/gc/startup_warnings/TestCMS.java
index 93bb563..24deea0 100644
--- a/hotspot/test/gc/startup_warnings/TestCMS.java
+++ b/hotspot/test/gc/startup_warnings/TestCMS.java
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+* Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 *
 * This code is free software; you can redistribute it and/or modify it
@@ -27,6 +27,8 @@
 * @bug 8006398
 * @summary Test that CMS does not print a warning message
 * @library /testlibrary
+* @modules java.base/sun.misc
+*          java.management
 */
 
 import com.oracle.java.testlibrary.OutputAnalyzer;
diff --git a/hotspot/test/gc/startup_warnings/TestDefNewCMS.java b/hotspot/test/gc/startup_warnings/TestDefNewCMS.java
index c17b944..a98e8ed 100644
--- a/hotspot/test/gc/startup_warnings/TestDefNewCMS.java
+++ b/hotspot/test/gc/startup_warnings/TestDefNewCMS.java
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
+* Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 *
 * This code is free software; you can redistribute it and/or modify it
@@ -27,6 +27,8 @@
 * @bug 8065972
 * @summary Test that the unsupported DefNew+CMS combination does not start
 * @library /testlibrary
+* @modules java.base/sun.misc
+*          java.management
 */
 
 import com.oracle.java.testlibrary.OutputAnalyzer;
diff --git a/hotspot/test/gc/startup_warnings/TestDefaultMaxRAMFraction.java b/hotspot/test/gc/startup_warnings/TestDefaultMaxRAMFraction.java
index 059a526..4798302 100644
--- a/hotspot/test/gc/startup_warnings/TestDefaultMaxRAMFraction.java
+++ b/hotspot/test/gc/startup_warnings/TestDefaultMaxRAMFraction.java
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+* Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 *
 * This code is free software; you can redistribute it and/or modify it
@@ -27,6 +27,8 @@
 * @bug 8021967
 * @summary Test that the deprecated TestDefaultMaxRAMFraction flag print a warning message
 * @library /testlibrary
+* @modules java.base/sun.misc
+*          java.management
 */
 
 import com.oracle.java.testlibrary.OutputAnalyzer;
diff --git a/hotspot/test/gc/startup_warnings/TestG1.java b/hotspot/test/gc/startup_warnings/TestG1.java
index b1dfaa4..84ae822 100644
--- a/hotspot/test/gc/startup_warnings/TestG1.java
+++ b/hotspot/test/gc/startup_warnings/TestG1.java
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+* Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 *
 * This code is free software; you can redistribute it and/or modify it
@@ -27,6 +27,8 @@
 * @bug 8006398
 * @summary Test that the G1 collector does not print a warning message
 * @library /testlibrary
+* @modules java.base/sun.misc
+*          java.management
 */
 
 import com.oracle.java.testlibrary.OutputAnalyzer;
diff --git a/hotspot/test/gc/startup_warnings/TestNoParNew.java b/hotspot/test/gc/startup_warnings/TestNoParNew.java
index bc9d8bd..4b10a25 100644
--- a/hotspot/test/gc/startup_warnings/TestNoParNew.java
+++ b/hotspot/test/gc/startup_warnings/TestNoParNew.java
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+* Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 *
 * This code is free software; you can redistribute it and/or modify it
@@ -27,6 +27,8 @@
 * @bug 8065972
 * @summary Test that specifying -XX:-UseParNewGC on the command line logs a warning message
 * @library /testlibrary
+* @modules java.base/sun.misc
+*          java.management
 */
 
 import com.oracle.java.testlibrary.OutputAnalyzer;
diff --git a/hotspot/test/gc/startup_warnings/TestParNewCMS.java b/hotspot/test/gc/startup_warnings/TestParNewCMS.java
index f78b75f..2c5179c 100644
--- a/hotspot/test/gc/startup_warnings/TestParNewCMS.java
+++ b/hotspot/test/gc/startup_warnings/TestParNewCMS.java
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
+* Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 *
 * This code is free software; you can redistribute it and/or modify it
@@ -27,6 +27,8 @@
 * @bug 8065972
 * @summary Test that specifying -XX:+UseParNewGC on the command line logs a warning message
 * @library /testlibrary
+* @modules java.base/sun.misc
+*          java.management
 */
 
 import com.oracle.java.testlibrary.OutputAnalyzer;
diff --git a/hotspot/test/gc/startup_warnings/TestParNewSerialOld.java b/hotspot/test/gc/startup_warnings/TestParNewSerialOld.java
index 8bacb7b..a5a72a8 100644
--- a/hotspot/test/gc/startup_warnings/TestParNewSerialOld.java
+++ b/hotspot/test/gc/startup_warnings/TestParNewSerialOld.java
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2013, 2024, Oracle and/or its affiliates. All rights reserved.
+* Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 *
 * This code is free software; you can redistribute it and/or modify it
@@ -27,6 +27,8 @@
 * @bug 8065972
 * @summary Test that the unsupported ParNew+SerialOld combination does not start
 * @library /testlibrary
+* @modules java.base/sun.misc
+*          java.management
 */
 
 import com.oracle.java.testlibrary.OutputAnalyzer;
diff --git a/hotspot/test/gc/startup_warnings/TestParallelGC.java b/hotspot/test/gc/startup_warnings/TestParallelGC.java
index e216309..b8c36e8 100644
--- a/hotspot/test/gc/startup_warnings/TestParallelGC.java
+++ b/hotspot/test/gc/startup_warnings/TestParallelGC.java
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+* Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 *
 * This code is free software; you can redistribute it and/or modify it
@@ -27,6 +27,8 @@
 * @bug 8006398
 * @summary Test that ParallelGC does not print a warning message
 * @library /testlibrary
+* @modules java.base/sun.misc
+*          java.management
 */
 
 import com.oracle.java.testlibrary.OutputAnalyzer;
diff --git a/hotspot/test/gc/startup_warnings/TestParallelScavengeSerialOld.java b/hotspot/test/gc/startup_warnings/TestParallelScavengeSerialOld.java
index 5d1cbdd..7d2dd7b 100644
--- a/hotspot/test/gc/startup_warnings/TestParallelScavengeSerialOld.java
+++ b/hotspot/test/gc/startup_warnings/TestParallelScavengeSerialOld.java
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+* Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 *
 * This code is free software; you can redistribute it and/or modify it
@@ -27,6 +27,8 @@
 * @bug 8006398
 * @summary Test that the ParallelScavenge+SerialOld combination does not print a warning message
 * @library /testlibrary
+* @modules java.base/sun.misc
+*          java.management
 */
 
 import com.oracle.java.testlibrary.OutputAnalyzer;
diff --git a/hotspot/test/gc/startup_warnings/TestSerialGC.java b/hotspot/test/gc/startup_warnings/TestSerialGC.java
index 4ce1af2..84cd0a4 100644
--- a/hotspot/test/gc/startup_warnings/TestSerialGC.java
+++ b/hotspot/test/gc/startup_warnings/TestSerialGC.java
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+* Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 *
 * This code is free software; you can redistribute it and/or modify it
@@ -27,6 +27,8 @@
 * @bug 8006398
 * @summary Test that SerialGC does not print a warning message
 * @library /testlibrary
+* @modules java.base/sun.misc
+*          java.management
 */
 
 import com.oracle.java.testlibrary.OutputAnalyzer;
diff --git a/hotspot/test/gc/survivorAlignment/TestAllocationInEden.java b/hotspot/test/gc/survivorAlignment/TestAllocationInEden.java
index 61f0c48..0b1b112 100644
--- a/hotspot/test/gc/survivorAlignment/TestAllocationInEden.java
+++ b/hotspot/test/gc/survivorAlignment/TestAllocationInEden.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -27,6 +27,8 @@
  * @summary Verify that object's alignment in eden space is not affected by
  *          SurvivorAlignmentInBytes option.
  * @library /testlibrary /../../test/lib
+ * @modules java.base/sun.misc
+ *          java.management
  * @build TestAllocationInEden SurvivorAlignmentTestMain AlignmentHelper
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
diff --git a/hotspot/test/gc/survivorAlignment/TestPromotionFromEdenToTenured.java b/hotspot/test/gc/survivorAlignment/TestPromotionFromEdenToTenured.java
index d72e78c..6b40f08 100644
--- a/hotspot/test/gc/survivorAlignment/TestPromotionFromEdenToTenured.java
+++ b/hotspot/test/gc/survivorAlignment/TestPromotionFromEdenToTenured.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -27,6 +27,8 @@
  * @summary Verify that objects promoted from eden space to tenured space during
  *          full GC are not aligned to SurvivorAlignmentInBytes value.
  * @library /testlibrary /../../test/lib
+ * @modules java.base/sun.misc
+ *          java.management
  * @build TestPromotionFromEdenToTenured SurvivorAlignmentTestMain
  *        AlignmentHelper
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
diff --git a/hotspot/test/gc/survivorAlignment/TestPromotionFromSurvivorToTenuredAfterFullGC.java b/hotspot/test/gc/survivorAlignment/TestPromotionFromSurvivorToTenuredAfterFullGC.java
index da496c0..ba05dc6 100644
--- a/hotspot/test/gc/survivorAlignment/TestPromotionFromSurvivorToTenuredAfterFullGC.java
+++ b/hotspot/test/gc/survivorAlignment/TestPromotionFromSurvivorToTenuredAfterFullGC.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -27,6 +27,8 @@
  * @summary Verify that objects promoted from survivor space to tenured space
  *          during full GC are not aligned to SurvivorAlignmentInBytes value.
  * @library /testlibrary /../../test/lib
+ * @modules java.base/sun.misc
+ *          java.management
  * @build TestPromotionFromSurvivorToTenuredAfterFullGC
  *        SurvivorAlignmentTestMain AlignmentHelper
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
diff --git a/hotspot/test/gc/survivorAlignment/TestPromotionFromSurvivorToTenuredAfterMinorGC.java b/hotspot/test/gc/survivorAlignment/TestPromotionFromSurvivorToTenuredAfterMinorGC.java
index 754349c9..15c9b1d 100644
--- a/hotspot/test/gc/survivorAlignment/TestPromotionFromSurvivorToTenuredAfterMinorGC.java
+++ b/hotspot/test/gc/survivorAlignment/TestPromotionFromSurvivorToTenuredAfterMinorGC.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -28,6 +28,8 @@
  *          when their age exceeded tenuring threshold are not aligned to
  *          SurvivorAlignmentInBytes value.
  * @library /testlibrary /../../test/lib
+ * @modules java.base/sun.misc
+ *          java.management
  * @build TestPromotionFromSurvivorToTenuredAfterMinorGC
  *        SurvivorAlignmentTestMain AlignmentHelper
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
diff --git a/hotspot/test/gc/survivorAlignment/TestPromotionToSurvivor.java b/hotspot/test/gc/survivorAlignment/TestPromotionToSurvivor.java
index 20407c2..548a8fd 100644
--- a/hotspot/test/gc/survivorAlignment/TestPromotionToSurvivor.java
+++ b/hotspot/test/gc/survivorAlignment/TestPromotionToSurvivor.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -27,6 +27,8 @@
  * @summary Verify that objects promoted from eden space to survivor space after
  *          minor GC are aligned to SurvivorAlignmentInBytes.
  * @library /testlibrary /../../test/lib
+ * @modules java.base/sun.misc
+ *          java.management
  * @build TestPromotionToSurvivor
  *        SurvivorAlignmentTestMain AlignmentHelper
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
diff --git a/hotspot/test/gc/whitebox/TestConcMarkCycleWB.java b/hotspot/test/gc/whitebox/TestConcMarkCycleWB.java
index e7a0483..fb82616 100644
--- a/hotspot/test/gc/whitebox/TestConcMarkCycleWB.java
+++ b/hotspot/test/gc/whitebox/TestConcMarkCycleWB.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,6 +26,10 @@
  * @bug 8065579
  * @requires vm.gc=="null" | vm.gc=="G1"
  * @library /testlibrary /../../test/lib
+ * @modules java.base/sun.misc
+ *          java.compiler
+ *          java.management
+ *          jdk.jvmstat/sun.jvmstat.monitor
  * @build ClassFileInstaller com.oracle.java.testlibrary.* sun.hotspot.WhiteBox TestConcMarkCycleWB
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
diff --git a/hotspot/test/gc/whitebox/TestWBGC.java b/hotspot/test/gc/whitebox/TestWBGC.java
index e10474a..e16d862 100644
--- a/hotspot/test/gc/whitebox/TestWBGC.java
+++ b/hotspot/test/gc/whitebox/TestWBGC.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,6 +26,8 @@
  * @bug 8055098
  * @summary Test verify that WB methods isObjectInOldGen and youngGC works correctly.
  * @library /testlibrary /../../test/lib
+ * @modules java.base/sun.misc
+ *          java.management
  * @build TestWBGC
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  * @run driver TestWBGC
diff --git a/hotspot/test/runtime/6819213/TestBootNativeLibraryPath.java b/hotspot/test/runtime/6819213/TestBootNativeLibraryPath.java
index c31d7b6..95f4c4b 100644
--- a/hotspot/test/runtime/6819213/TestBootNativeLibraryPath.java
+++ b/hotspot/test/runtime/6819213/TestBootNativeLibraryPath.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2008, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 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
@@ -24,6 +24,7 @@
 /*
  * @test TestBootNativeLibraryPath.java
  * @bug 6819213
+ * @modules java.compiler
  * @compile -XDignore.symbol.file TestBootNativeLibraryPath.java
  * @summary verify sun.boot.native.library.path is expandable on 32 bit systems
  * @run main TestBootNativeLibraryPath
diff --git a/hotspot/test/runtime/8003720/Test8003720.java b/hotspot/test/runtime/8003720/Test8003720.java
index 0963628..0fd5ef3 100644
--- a/hotspot/test/runtime/8003720/Test8003720.java
+++ b/hotspot/test/runtime/8003720/Test8003720.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 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
@@ -26,6 +26,8 @@
  * @test
  * @bug 8003720
  * @summary Method in interpreter stack frame can be deallocated
+ * @modules java.base/jdk.internal.org.objectweb.asm
+ *          java.base/sun.misc
  * @compile -XDignore.symbol.file Victim.java
  * @run main/othervm -Xverify:all -Xint Test8003720
  */
diff --git a/hotspot/test/runtime/8026365/InvokeSpecialAnonTest.java b/hotspot/test/runtime/8026365/InvokeSpecialAnonTest.java
index c3de30e..4dd6657 100644
--- a/hotspot/test/runtime/8026365/InvokeSpecialAnonTest.java
+++ b/hotspot/test/runtime/8026365/InvokeSpecialAnonTest.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -27,6 +27,8 @@
  * @summary Test invokespecial of host class method from an anonymous class
  * @author  Robert Field
  * @library /testlibrary
+ * @modules java.base/jdk.internal.org.objectweb.asm
+ *          java.base/sun.misc
  * @compile -XDignore.symbol.file InvokeSpecialAnonTest.java
  * @run main ClassFileInstaller InvokeSpecialAnonTest AnonTester
  * @run main/othervm -Xbootclasspath/a:. -Xverify:all InvokeSpecialAnonTest
diff --git a/hotspot/test/runtime/BadObjectClass/BootstrapRedefine.java b/hotspot/test/runtime/BadObjectClass/BootstrapRedefine.java
index 08ed2f0..6bc38bf 100644
--- a/hotspot/test/runtime/BadObjectClass/BootstrapRedefine.java
+++ b/hotspot/test/runtime/BadObjectClass/BootstrapRedefine.java
@@ -26,6 +26,8 @@
  * @bug 6583051
  * @summary Give error if java.lang.Object has been incompatibly overridden on the bootpath
  * @library /testlibrary
+ * @modules java.base/sun.misc
+ *          java.management
  * @compile Object.java
  * @run main BootstrapRedefine
  */
diff --git a/hotspot/test/runtime/CDSCompressedKPtrs/CDSCompressedKPtrs.java b/hotspot/test/runtime/CDSCompressedKPtrs/CDSCompressedKPtrs.java
index c32c05e..3355f94 100644
--- a/hotspot/test/runtime/CDSCompressedKPtrs/CDSCompressedKPtrs.java
+++ b/hotspot/test/runtime/CDSCompressedKPtrs/CDSCompressedKPtrs.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,6 +26,8 @@
  * @bug 8003424
  * @summary Testing UseCompressedClassPointers with CDS
  * @library /testlibrary
+ * @modules java.base/sun.misc
+ *          java.management
  * @run main CDSCompressedKPtrs
  */
 
diff --git a/hotspot/test/runtime/CDSCompressedKPtrs/CDSCompressedKPtrsError.java b/hotspot/test/runtime/CDSCompressedKPtrs/CDSCompressedKPtrsError.java
index 05b4ac9..38267dc 100644
--- a/hotspot/test/runtime/CDSCompressedKPtrs/CDSCompressedKPtrsError.java
+++ b/hotspot/test/runtime/CDSCompressedKPtrs/CDSCompressedKPtrsError.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,6 +26,8 @@
  * @bug 8003424
  * @summary Test that cannot use CDS if UseCompressedClassPointers is turned off.
  * @library /testlibrary
+ * @modules java.base/sun.misc
+ *          java.management
  * @run main CDSCompressedKPtrsError
  */
 
diff --git a/hotspot/test/runtime/CDSCompressedKPtrs/XShareAuto.java b/hotspot/test/runtime/CDSCompressedKPtrs/XShareAuto.java
index 458a781..6bf45d7 100644
--- a/hotspot/test/runtime/CDSCompressedKPtrs/XShareAuto.java
+++ b/hotspot/test/runtime/CDSCompressedKPtrs/XShareAuto.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,6 +26,8 @@
  * @bug 8005933
  * @summary Test that -Xshare:auto uses CDS when explicitly specified with -server.
  * @library /testlibrary
+ * @modules java.base/sun.misc
+ *          java.management
  * @run main XShareAuto
  */
 
diff --git a/hotspot/test/runtime/ClassFile/JsrRewriting.java b/hotspot/test/runtime/ClassFile/JsrRewriting.java
index 856658f..5e5ed31 100644
--- a/hotspot/test/runtime/ClassFile/JsrRewriting.java
+++ b/hotspot/test/runtime/ClassFile/JsrRewriting.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -34,6 +34,9 @@
  * @bug 7149464
  * @key cte_test
  * @library /testlibrary
+ * @modules java.base/sun.misc
+ *          java.desktop
+ *          java.management
  * @run main JsrRewriting
  */
 
diff --git a/hotspot/test/runtime/ClassFile/OomWhileParsingRepeatedJsr.java b/hotspot/test/runtime/ClassFile/OomWhileParsingRepeatedJsr.java
index ad08b18..4c21b57 100644
--- a/hotspot/test/runtime/ClassFile/OomWhileParsingRepeatedJsr.java
+++ b/hotspot/test/runtime/ClassFile/OomWhileParsingRepeatedJsr.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -34,6 +34,9 @@
  * @bug 7123945
  * @bug 8016029
  * @library /testlibrary
+ * @modules java.base/sun.misc
+ *          java.desktop
+ *          java.management
  * @run main OomWhileParsingRepeatedJsr
  */
 
diff --git a/hotspot/test/runtime/ClassFile/UnsupportedClassFileVersion.java b/hotspot/test/runtime/ClassFile/UnsupportedClassFileVersion.java
index 7978d28..7aef4a2 100644
--- a/hotspot/test/runtime/ClassFile/UnsupportedClassFileVersion.java
+++ b/hotspot/test/runtime/ClassFile/UnsupportedClassFileVersion.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -24,6 +24,9 @@
 /*
  * @test
  * @library /testlibrary
+ * @modules java.base/jdk.internal.org.objectweb.asm
+ *          java.base/sun.misc
+ *          java.management
  * @compile -XDignore.symbol.file UnsupportedClassFileVersion.java
  * @run main UnsupportedClassFileVersion
  */
diff --git a/hotspot/test/runtime/CommandLine/BooleanFlagWithInvalidValue.java b/hotspot/test/runtime/CommandLine/BooleanFlagWithInvalidValue.java
index be035e2..30c9bae 100644
--- a/hotspot/test/runtime/CommandLine/BooleanFlagWithInvalidValue.java
+++ b/hotspot/test/runtime/CommandLine/BooleanFlagWithInvalidValue.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,6 +26,8 @@
  * @bug 8006298
  * @summary Setting an invalid value for a bool argument should result in a useful error message
  * @library /testlibrary
+ * @modules java.base/sun.misc
+ *          java.management
  */
 
 import com.oracle.java.testlibrary.*;
diff --git a/hotspot/test/runtime/CommandLine/CompilerConfigFileWarning.java b/hotspot/test/runtime/CommandLine/CompilerConfigFileWarning.java
index c546272..f8bee37 100644
--- a/hotspot/test/runtime/CommandLine/CompilerConfigFileWarning.java
+++ b/hotspot/test/runtime/CommandLine/CompilerConfigFileWarning.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,6 +26,8 @@
  * @bug 7167142
  * @summary Warn if unused .hotspot_compiler file is present
  * @library /testlibrary
+ * @modules java.base/sun.misc
+ *          java.management
  */
 
 import java.io.PrintWriter;
diff --git a/hotspot/test/runtime/CommandLine/ConfigFileParsing.java b/hotspot/test/runtime/CommandLine/ConfigFileParsing.java
index 10a8c0b..0e80031 100644
--- a/hotspot/test/runtime/CommandLine/ConfigFileParsing.java
+++ b/hotspot/test/runtime/CommandLine/ConfigFileParsing.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,6 +26,8 @@
  * @bug 7158804
  * @summary Improve config file parsing
  * @library /testlibrary
+ * @modules java.base/sun.misc
+ *          java.management
  */
 
 import java.io.PrintWriter;
diff --git a/hotspot/test/runtime/CommandLine/ConfigFileWarning.java b/hotspot/test/runtime/CommandLine/ConfigFileWarning.java
index 8f04a07..11b0688 100644
--- a/hotspot/test/runtime/CommandLine/ConfigFileWarning.java
+++ b/hotspot/test/runtime/CommandLine/ConfigFileWarning.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,6 +26,8 @@
  * @bug 7167142
  * @summary Warn if unused .hotspot_rc file is present
  * @library /testlibrary
+ * @modules java.base/sun.misc
+ *          java.management
  */
 
 import java.io.PrintWriter;
diff --git a/hotspot/test/runtime/CommandLine/FlagWithInvalidValue.java b/hotspot/test/runtime/CommandLine/FlagWithInvalidValue.java
index 22abc53..a3c980a 100644
--- a/hotspot/test/runtime/CommandLine/FlagWithInvalidValue.java
+++ b/hotspot/test/runtime/CommandLine/FlagWithInvalidValue.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,6 +26,8 @@
  * @bug 8006298
  * @summary Setting a flag to an invalid value should print a useful error message
  * @library /testlibrary
+ * @modules java.base/sun.misc
+ *          java.management
  */
 
 import com.oracle.java.testlibrary.*;
diff --git a/hotspot/test/runtime/CommandLine/NonBooleanFlagWithInvalidBooleanPrefix.java b/hotspot/test/runtime/CommandLine/NonBooleanFlagWithInvalidBooleanPrefix.java
index 7933aef..7a69f2b 100644
--- a/hotspot/test/runtime/CommandLine/NonBooleanFlagWithInvalidBooleanPrefix.java
+++ b/hotspot/test/runtime/CommandLine/NonBooleanFlagWithInvalidBooleanPrefix.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,6 +26,8 @@
  * @bug 8006298
  * @summary Using a bool (+/-) prefix on non-bool flag should result in a useful error message
  * @library /testlibrary
+ * @modules java.base/sun.misc
+ *          java.management
  */
 
 import com.oracle.java.testlibrary.*;
diff --git a/hotspot/test/runtime/CommandLine/ObsoleteFlagErrorMessage.java b/hotspot/test/runtime/CommandLine/ObsoleteFlagErrorMessage.java
index 3af8408..05292ba 100644
--- a/hotspot/test/runtime/CommandLine/ObsoleteFlagErrorMessage.java
+++ b/hotspot/test/runtime/CommandLine/ObsoleteFlagErrorMessage.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,6 +26,8 @@
  * @bug 8060449
  * @summary Newly obsolete command line options should still give useful error messages when used improperly.
  * @library /testlibrary
+ * @modules java.base/sun.misc
+ *          java.management
  */
 
 import com.oracle.java.testlibrary.*;
diff --git a/hotspot/test/runtime/CommandLine/TestHexArguments.java b/hotspot/test/runtime/CommandLine/TestHexArguments.java
index f62435e..7dceef2 100644
--- a/hotspot/test/runtime/CommandLine/TestHexArguments.java
+++ b/hotspot/test/runtime/CommandLine/TestHexArguments.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -27,6 +27,8 @@
  * @summary Make sure there is no error using hexadecimal format in vm options
  * @author Yumin Qi
  * @library /testlibrary
+ * @modules java.base/sun.misc
+ *          java.management
  */
 
 import java.io.File;
diff --git a/hotspot/test/runtime/CommandLine/TestNullTerminatedFlags.java b/hotspot/test/runtime/CommandLine/TestNullTerminatedFlags.java
index f439065..87267eb 100644
--- a/hotspot/test/runtime/CommandLine/TestNullTerminatedFlags.java
+++ b/hotspot/test/runtime/CommandLine/TestNullTerminatedFlags.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -28,6 +28,8 @@
  * @bug 6522873
  * @summary Test that the VM don't allow random junk characters at the end of valid command line flags.
  * @library /testlibrary
+ * @modules java.base/sun.misc
+ *          java.management
  * @run driver TestNullTerminatedFlags
  */
 public class TestNullTerminatedFlags {
diff --git a/hotspot/test/runtime/CommandLine/TestVMOptions.java b/hotspot/test/runtime/CommandLine/TestVMOptions.java
index 354c6ed..158d037 100644
--- a/hotspot/test/runtime/CommandLine/TestVMOptions.java
+++ b/hotspot/test/runtime/CommandLine/TestVMOptions.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,6 +26,8 @@
  * @bug 8060256
  * @summary Test various command line options
  * @library /testlibrary
+ * @modules java.base/sun.misc
+ *          java.management
  * @run main TestVMOptions
  */
 
diff --git a/hotspot/test/runtime/CommandLine/TraceExceptionsTest.java b/hotspot/test/runtime/CommandLine/TraceExceptionsTest.java
index f8aa862..b49fb47 100644
--- a/hotspot/test/runtime/CommandLine/TraceExceptionsTest.java
+++ b/hotspot/test/runtime/CommandLine/TraceExceptionsTest.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,6 +26,8 @@
  * @bug 8048933
  * @summary TraceExceptions output should have the exception message - useful for ClassNotFoundExceptions especially
  * @library /testlibrary
+ * @modules java.base/sun.misc
+ *          java.management
  */
 
 import com.oracle.java.testlibrary.*;
diff --git a/hotspot/test/runtime/CommandLine/UnrecognizedVMOption.java b/hotspot/test/runtime/CommandLine/UnrecognizedVMOption.java
index 040704f..dbb7a39 100644
--- a/hotspot/test/runtime/CommandLine/UnrecognizedVMOption.java
+++ b/hotspot/test/runtime/CommandLine/UnrecognizedVMOption.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,6 +26,8 @@
  * @bug 8006298
  * @summary Using an unrecognized VM option should print the name of the option
  * @library /testlibrary
+ * @modules java.base/sun.misc
+ *          java.management
  */
 
 import com.oracle.java.testlibrary.*;
diff --git a/hotspot/test/runtime/CommandLine/VMOptionWarning.java b/hotspot/test/runtime/CommandLine/VMOptionWarning.java
index 164cec0..42e97ba 100644
--- a/hotspot/test/runtime/CommandLine/VMOptionWarning.java
+++ b/hotspot/test/runtime/CommandLine/VMOptionWarning.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,6 +26,8 @@
  * @bug 8027314
  * @summary Warn if diagnostic or experimental vm option is used and -XX:+UnlockDiagnosticVMOptions or -XX:+UnlockExperimentalVMOptions, respectively, isn't specified. Warn if develop or notproduct vm option is used with product version of VM.
  * @library /testlibrary
+ * @modules java.base/sun.misc
+ *          java.management
  */
 
 import com.oracle.java.testlibrary.*;
diff --git a/hotspot/test/runtime/CompressedOops/CompressedClassPointers.java b/hotspot/test/runtime/CompressedOops/CompressedClassPointers.java
index 1ec42fd..25b7d15 100644
--- a/hotspot/test/runtime/CompressedOops/CompressedClassPointers.java
+++ b/hotspot/test/runtime/CompressedOops/CompressedClassPointers.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,6 +26,8 @@
  * @bug 8024927
  * @summary Testing address of compressed class pointer space as best as possible.
  * @library /testlibrary
+ * @modules java.base/sun.misc
+ *          java.management
  */
 
 import com.oracle.java.testlibrary.*;
diff --git a/hotspot/test/runtime/CompressedOops/CompressedClassSpaceSize.java b/hotspot/test/runtime/CompressedOops/CompressedClassSpaceSize.java
index 0a0a553..bc0da65 100644
--- a/hotspot/test/runtime/CompressedOops/CompressedClassSpaceSize.java
+++ b/hotspot/test/runtime/CompressedOops/CompressedClassSpaceSize.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,6 +26,8 @@
  * @bug 8022865
  * @summary Tests for the -XX:CompressedClassSpaceSize command line option
  * @library /testlibrary
+ * @modules java.base/sun.misc
+ *          java.management
  * @run main CompressedClassSpaceSize
  */
 import com.oracle.java.testlibrary.*;
diff --git a/hotspot/test/runtime/CompressedOops/CompressedKlassPointerAndOops.java b/hotspot/test/runtime/CompressedOops/CompressedKlassPointerAndOops.java
index 228d8cb..1b90d7e 100644
--- a/hotspot/test/runtime/CompressedOops/CompressedKlassPointerAndOops.java
+++ b/hotspot/test/runtime/CompressedOops/CompressedKlassPointerAndOops.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -27,6 +27,8 @@
  * @key regression
  * @summary NPG: UseCompressedClassPointers asserts with ObjectAlignmentInBytes=32
  * @library /testlibrary
+ * @modules java.base/sun.misc
+ *          java.management
  */
 
 import com.oracle.java.testlibrary.*;
diff --git a/hotspot/test/runtime/CompressedOops/ObjectAlignment.java b/hotspot/test/runtime/CompressedOops/ObjectAlignment.java
index 63d267ae..9a57fd9 100644
--- a/hotspot/test/runtime/CompressedOops/ObjectAlignment.java
+++ b/hotspot/test/runtime/CompressedOops/ObjectAlignment.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,6 +26,8 @@
  * @bug 8022865
  * @summary Tests for the -XX:ObjectAlignmentInBytes command line option
  * @library /testlibrary
+ * @modules java.base/sun.misc
+ *          java.management
  * @run main ObjectAlignment
  */
 import com.oracle.java.testlibrary.*;
diff --git a/hotspot/test/runtime/CompressedOops/UseCompressedOops.java b/hotspot/test/runtime/CompressedOops/UseCompressedOops.java
index edc3d33..68176d4 100644
--- a/hotspot/test/runtime/CompressedOops/UseCompressedOops.java
+++ b/hotspot/test/runtime/CompressedOops/UseCompressedOops.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,6 +26,8 @@
  * @bug 8022865
  * @summary Tests for different combination of UseCompressedOops options
  * @library /testlibrary
+ * @modules java.base/sun.misc
+ *          java.management
  * @run main UseCompressedOops
  */
 import java.util.ArrayList;
diff --git a/hotspot/test/runtime/EnclosingMethodAttr/EnclMethodAttr.java b/hotspot/test/runtime/EnclosingMethodAttr/EnclMethodAttr.java
index 82b5424..76950d4 100644
--- a/hotspot/test/runtime/EnclosingMethodAttr/EnclMethodAttr.java
+++ b/hotspot/test/runtime/EnclosingMethodAttr/EnclMethodAttr.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,6 +26,8 @@
  * @bug 8044738
  * @library /testlibrary
  * @summary Check attribute_length of EnclosingMethod attribute
+ * @modules java.base/sun.misc
+ *          java.management
  * @run main EnclMethodAttr
  */
 
diff --git a/hotspot/test/runtime/ErrorHandling/ProblematicFrameTest.java b/hotspot/test/runtime/ErrorHandling/ProblematicFrameTest.java
index 2ad3fc1..04cc2a1 100644
--- a/hotspot/test/runtime/ErrorHandling/ProblematicFrameTest.java
+++ b/hotspot/test/runtime/ErrorHandling/ProblematicFrameTest.java
@@ -26,6 +26,10 @@
  * @bug 8050167
  * @summary Test that error is not occurred during printing problematic frame
  * @library /testlibrary
+ * @modules java.base/sun.misc
+ *          java.compiler
+ *          java.management
+ *          jdk.jvmstat/sun.jvmstat.monitor
  * @build com.oracle.java.testlibrary.*
  * @run driver ProblematicFrameTest
  */
diff --git a/hotspot/test/runtime/ErrorHandling/SecondaryErrorTest.java b/hotspot/test/runtime/ErrorHandling/SecondaryErrorTest.java
index 380809b..f3e5e15 100644
--- a/hotspot/test/runtime/ErrorHandling/SecondaryErrorTest.java
+++ b/hotspot/test/runtime/ErrorHandling/SecondaryErrorTest.java
@@ -14,6 +14,8 @@
  * @summary Synchronous signals during error reporting may terminate or hang VM process
  * @library /testlibrary
  * @author Thomas Stuefe (SAP)
+ * @modules java.base/sun.misc
+ *          java.management
  */
 
 public class SecondaryErrorTest {
diff --git a/hotspot/test/runtime/InternalApi/ThreadCpuTimesDeadlock.java b/hotspot/test/runtime/InternalApi/ThreadCpuTimesDeadlock.java
index 3416ce4..0ea4f2c 100644
--- a/hotspot/test/runtime/InternalApi/ThreadCpuTimesDeadlock.java
+++ b/hotspot/test/runtime/InternalApi/ThreadCpuTimesDeadlock.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 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
@@ -27,6 +27,7 @@
  * @bug 7196045
  * @bug 8014294
  * @summary Possible JVM deadlock in ThreadTimesClosure when using HotspotInternal non-public API.
+ * @modules java.management/sun.management
  * @run main/othervm -XX:+UsePerfData -Xmx32m ThreadCpuTimesDeadlock
  */
 
diff --git a/hotspot/test/runtime/LoadClass/LoadClassNegative.java b/hotspot/test/runtime/LoadClass/LoadClassNegative.java
index 43d5a92..a9b4142 100644
--- a/hotspot/test/runtime/LoadClass/LoadClassNegative.java
+++ b/hotspot/test/runtime/LoadClass/LoadClassNegative.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -27,6 +27,8 @@
  * @bug 8020675
  * @summary make sure there is no fatal error if a class is loaded from an invalid jar file which is in the bootclasspath
  * @library /testlibrary
+ * @modules java.base/sun.misc
+ *          java.management
  * @build TestForName
  * @build LoadClassNegative
  * @run main LoadClassNegative
diff --git a/hotspot/test/runtime/LocalVariableTable/TestLVT.java b/hotspot/test/runtime/LocalVariableTable/TestLVT.java
index 337de2c..009898b 100644
--- a/hotspot/test/runtime/LocalVariableTable/TestLVT.java
+++ b/hotspot/test/runtime/LocalVariableTable/TestLVT.java
@@ -26,6 +26,8 @@
  * @bug 8049632
  * @summary Test ClassFileParser::copy_localvariable_table cases
  * @library /testlibrary
+ * @modules java.base/sun.misc
+ *          java.management
  * @compile -g -XDignore.symbol.file TestLVT.java
  * @run main TestLVT
  */
diff --git a/hotspot/test/runtime/Metaspace/FragmentMetaspace.java b/hotspot/test/runtime/Metaspace/FragmentMetaspace.java
index f44bce8..d4423a3 100644
--- a/hotspot/test/runtime/Metaspace/FragmentMetaspace.java
+++ b/hotspot/test/runtime/Metaspace/FragmentMetaspace.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -24,6 +24,7 @@
 /**
  * @test
  * @library /runtime/testlibrary
+ * @modules java.compiler
  * @build GeneratedClassLoader
  * @run main/othervm/timeout=200 -Xmx300m FragmentMetaspace
  */
diff --git a/hotspot/test/runtime/NMT/AutoshutdownNMT.java b/hotspot/test/runtime/NMT/AutoshutdownNMT.java
index 8739dc8..04a75f2 100644
--- a/hotspot/test/runtime/NMT/AutoshutdownNMT.java
+++ b/hotspot/test/runtime/NMT/AutoshutdownNMT.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,6 +26,8 @@
  * @key nmt
  * @summary Test for deprecated message if -XX:-AutoShutdownNMT is specified
  * @library /testlibrary
+ * @modules java.base/sun.misc
+ *          java.management
  */
 
 import com.oracle.java.testlibrary.*;
diff --git a/hotspot/test/runtime/NMT/BaselineWithParameter.java b/hotspot/test/runtime/NMT/BaselineWithParameter.java
index ff10b28..5f14305 100644
--- a/hotspot/test/runtime/NMT/BaselineWithParameter.java
+++ b/hotspot/test/runtime/NMT/BaselineWithParameter.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -27,6 +27,8 @@
  * @key nmt jcmd regression
  * @summary Regression test for invoking a jcmd with baseline=false, result was that the target VM crashed
  * @library /testlibrary
+ * @modules java.base/sun.misc
+ *          java.management
  * @run main/othervm -XX:NativeMemoryTracking=detail BaselineWithParameter
  */
 
diff --git a/hotspot/test/runtime/NMT/CommandLineDetail.java b/hotspot/test/runtime/NMT/CommandLineDetail.java
index 01b0d0d..15bcff8 100644
--- a/hotspot/test/runtime/NMT/CommandLineDetail.java
+++ b/hotspot/test/runtime/NMT/CommandLineDetail.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,6 +26,8 @@
  * @key nmt
  * @summary Running with NMT detail should not result in an error
  * @library /testlibrary
+ * @modules java.base/sun.misc
+ *          java.management
  */
 
 import com.oracle.java.testlibrary.*;
diff --git a/hotspot/test/runtime/NMT/CommandLineEmptyArgument.java b/hotspot/test/runtime/NMT/CommandLineEmptyArgument.java
index 956cdd2..1bc8872 100644
--- a/hotspot/test/runtime/NMT/CommandLineEmptyArgument.java
+++ b/hotspot/test/runtime/NMT/CommandLineEmptyArgument.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,6 +26,8 @@
  * @key nmt
  * @summary Empty argument to NMT should result in an informative error message
  * @library /testlibrary
+ * @modules java.base/sun.misc
+ *          java.management
  */
 
 import com.oracle.java.testlibrary.*;
diff --git a/hotspot/test/runtime/NMT/CommandLineInvalidArgument.java b/hotspot/test/runtime/NMT/CommandLineInvalidArgument.java
index 79cc2de..a3768a6 100644
--- a/hotspot/test/runtime/NMT/CommandLineInvalidArgument.java
+++ b/hotspot/test/runtime/NMT/CommandLineInvalidArgument.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,6 +26,8 @@
  * @key nmt
  * @summary Invalid argument to NMT should result in an informative error message
  * @library /testlibrary
+ * @modules java.base/sun.misc
+ *          java.management
  */
 
 import com.oracle.java.testlibrary.*;
diff --git a/hotspot/test/runtime/NMT/CommandLineSummary.java b/hotspot/test/runtime/NMT/CommandLineSummary.java
index d07bc7e..7c68040 100644
--- a/hotspot/test/runtime/NMT/CommandLineSummary.java
+++ b/hotspot/test/runtime/NMT/CommandLineSummary.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,6 +26,8 @@
  * @key nmt
  * @summary Running with NMT summary should not result in an error
  * @library /testlibrary
+ * @modules java.base/sun.misc
+ *          java.management
  */
 
 import com.oracle.java.testlibrary.*;
diff --git a/hotspot/test/runtime/NMT/CommandLineTurnOffNMT.java b/hotspot/test/runtime/NMT/CommandLineTurnOffNMT.java
index 4193c97..9ad6ff9 100644
--- a/hotspot/test/runtime/NMT/CommandLineTurnOffNMT.java
+++ b/hotspot/test/runtime/NMT/CommandLineTurnOffNMT.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,6 +26,8 @@
  * @key nmt
  * @summary Turning off NMT should not result in an error
  * @library /testlibrary
+ * @modules java.base/sun.misc
+ *          java.management
  */
 
 import com.oracle.java.testlibrary.*;
diff --git a/hotspot/test/runtime/NMT/JcmdBaselineDetail.java b/hotspot/test/runtime/NMT/JcmdBaselineDetail.java
index 501b860..660ccd4 100644
--- a/hotspot/test/runtime/NMT/JcmdBaselineDetail.java
+++ b/hotspot/test/runtime/NMT/JcmdBaselineDetail.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,6 +26,8 @@
  * @key nmt jcmd
  * @summary Verify that jcmd correctly reports that baseline succeeds with NMT enabled with detailed tracking.
  * @library /testlibrary
+ * @modules java.base/sun.misc
+ *          java.management
  * @run main/othervm -XX:NativeMemoryTracking=detail JcmdBaselineDetail
  */
 
diff --git a/hotspot/test/runtime/NMT/JcmdDetailDiff.java b/hotspot/test/runtime/NMT/JcmdDetailDiff.java
index a7c6184..bdef6eb 100644
--- a/hotspot/test/runtime/NMT/JcmdDetailDiff.java
+++ b/hotspot/test/runtime/NMT/JcmdDetailDiff.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,6 +26,8 @@
  * @summary run NMT baseline, allocate memory and verify output from detail.diff
  * @key nmt jcmd
  * @library /testlibrary /../../test/lib
+ * @modules java.base/sun.misc
+ *          java.management
  * @ignore
  * @build JcmdDetailDiff
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
diff --git a/hotspot/test/runtime/NMT/JcmdScale.java b/hotspot/test/runtime/NMT/JcmdScale.java
index 3d8a951..c1a03f8 100644
--- a/hotspot/test/runtime/NMT/JcmdScale.java
+++ b/hotspot/test/runtime/NMT/JcmdScale.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,6 +26,8 @@
  * @key nmt jcmd
  * @summary Test the NMT scale parameter
  * @library /testlibrary
+ * @modules java.base/sun.misc
+ *          java.management
  * @run main/othervm -XX:NativeMemoryTracking=summary JcmdScale
  */
 
diff --git a/hotspot/test/runtime/NMT/JcmdScaleDetail.java b/hotspot/test/runtime/NMT/JcmdScaleDetail.java
index 97c809d..b0ba146 100644
--- a/hotspot/test/runtime/NMT/JcmdScaleDetail.java
+++ b/hotspot/test/runtime/NMT/JcmdScaleDetail.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,6 +26,8 @@
  * @key nmt jcmd
  * @summary Test the NMT scale parameter with detail tracking level
  * @library /testlibrary
+ * @modules java.base/sun.misc
+ *          java.management
  * @run main/othervm -XX:NativeMemoryTracking=detail JcmdScaleDetail
  */
 
diff --git a/hotspot/test/runtime/NMT/JcmdSummaryDiff.java b/hotspot/test/runtime/NMT/JcmdSummaryDiff.java
index 11cb68f..867b487 100644
--- a/hotspot/test/runtime/NMT/JcmdSummaryDiff.java
+++ b/hotspot/test/runtime/NMT/JcmdSummaryDiff.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,6 +26,8 @@
  * @summary run NMT baseline, allocate memory and verify output from summary.diff
  * @key nmt jcmd
  * @library /testlibrary /../../test/lib
+ * @modules java.base/sun.misc
+ *          java.management
  * @build JcmdSummaryDiff
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -XX:NativeMemoryTracking=summary JcmdSummaryDiff
diff --git a/hotspot/test/runtime/NMT/JcmdWithNMTDisabled.java b/hotspot/test/runtime/NMT/JcmdWithNMTDisabled.java
index 9ef3743..cdaaaaf 100644
--- a/hotspot/test/runtime/NMT/JcmdWithNMTDisabled.java
+++ b/hotspot/test/runtime/NMT/JcmdWithNMTDisabled.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,6 +26,8 @@
  * @key nmt jcmd
  * @summary Verify that jcmd correctly reports that NMT is not enabled
  * @library /testlibrary
+ * @modules java.base/sun.misc
+ *          java.management
  * @run main JcmdWithNMTDisabled 1
  */
 
diff --git a/hotspot/test/runtime/NMT/MallocRoundingReportTest.java b/hotspot/test/runtime/NMT/MallocRoundingReportTest.java
index 4827cf0..b2cb988 100644
--- a/hotspot/test/runtime/NMT/MallocRoundingReportTest.java
+++ b/hotspot/test/runtime/NMT/MallocRoundingReportTest.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,6 +26,8 @@
  * @summary Test consistency of NMT by creating allocations of the Test type with various sizes and verifying visibility with jcmd
  * @key nmt jcmd
  * @library /testlibrary /../../test/lib
+ * @modules java.base/sun.misc
+ *          java.management
  * @build MallocRoundingReportTest
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -XX:NativeMemoryTracking=detail MallocRoundingReportTest
diff --git a/hotspot/test/runtime/NMT/MallocStressTest.java b/hotspot/test/runtime/NMT/MallocStressTest.java
index 5471151..5422961 100644
--- a/hotspot/test/runtime/NMT/MallocStressTest.java
+++ b/hotspot/test/runtime/NMT/MallocStressTest.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,6 +26,8 @@
  * @summary Stress test for malloc tracking
  * @key nmt jcmd stress
  * @library /testlibrary /../../test/lib
+ * @modules java.base/sun.misc
+ *          java.management
  * @build MallocStressTest
  * @ignore - This test is disabled since it will stress NMT and timeout during normal testing
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
diff --git a/hotspot/test/runtime/NMT/MallocTestType.java b/hotspot/test/runtime/NMT/MallocTestType.java
index 6142853..b7bf609 100644
--- a/hotspot/test/runtime/NMT/MallocTestType.java
+++ b/hotspot/test/runtime/NMT/MallocTestType.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,6 +26,8 @@
  * @summary Test consistency of NMT by leaking a few select allocations of the Test type and then verify visibility with jcmd
  * @key nmt jcmd
  * @library /testlibrary /../../test/lib
+ * @modules java.base/sun.misc
+ *          java.management
  * @build MallocTestType
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
diff --git a/hotspot/test/runtime/NMT/MallocTrackingVerify.java b/hotspot/test/runtime/NMT/MallocTrackingVerify.java
index 31c4ae7..c609a01 100644
--- a/hotspot/test/runtime/NMT/MallocTrackingVerify.java
+++ b/hotspot/test/runtime/NMT/MallocTrackingVerify.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -27,6 +27,8 @@
  * @summary Test to verify correctness of malloc tracking
  * @key nmt jcmd
  * @library /testlibrary /../../test/lib
+ * @modules java.base/sun.misc
+ *          java.management
  * @build MallocTrackingVerify
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -XX:NativeMemoryTracking=detail MallocTrackingVerify
diff --git a/hotspot/test/runtime/NMT/NMTWithCDS.java b/hotspot/test/runtime/NMT/NMTWithCDS.java
index 1d86561..efbb052 100644
--- a/hotspot/test/runtime/NMT/NMTWithCDS.java
+++ b/hotspot/test/runtime/NMT/NMTWithCDS.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,6 +26,8 @@
  * @bug 8055061
  * @key nmt
  * @library /testlibrary
+ * @modules java.base/sun.misc
+ *          java.management
  * @run main NMTWithCDS
  */
 import com.oracle.java.testlibrary.*;
diff --git a/hotspot/test/runtime/NMT/PrintNMTStatisticsWithNMTDisabled.java b/hotspot/test/runtime/NMT/PrintNMTStatisticsWithNMTDisabled.java
index 1c25f28..1a4ec17 100644
--- a/hotspot/test/runtime/NMT/PrintNMTStatisticsWithNMTDisabled.java
+++ b/hotspot/test/runtime/NMT/PrintNMTStatisticsWithNMTDisabled.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,6 +26,8 @@
  * @key nmt
  * @summary Trying to enable PrintNMTStatistics should result in a warning
  * @library /testlibrary
+ * @modules java.base/sun.misc
+ *          java.management
  */
 
 import com.oracle.java.testlibrary.*;
diff --git a/hotspot/test/runtime/NMT/ReleaseNoCommit.java b/hotspot/test/runtime/NMT/ReleaseNoCommit.java
index 227c1db..6c58993 100644
--- a/hotspot/test/runtime/NMT/ReleaseNoCommit.java
+++ b/hotspot/test/runtime/NMT/ReleaseNoCommit.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,6 +26,8 @@
  * @summary Release uncommitted memory and make sure NMT handles it correctly
  * @key nmt regression
  * @library /testlibrary /../../test/lib
+ * @modules java.base/sun.misc
+ *          java.management
  * @build ReleaseNoCommit
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -XX:NativeMemoryTracking=summary ReleaseNoCommit
diff --git a/hotspot/test/runtime/NMT/ShutdownTwice.java b/hotspot/test/runtime/NMT/ShutdownTwice.java
index 436e0c2..b5b84c7 100644
--- a/hotspot/test/runtime/NMT/ShutdownTwice.java
+++ b/hotspot/test/runtime/NMT/ShutdownTwice.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,6 +26,8 @@
  * @key nmt jcmd
  * @summary Run shutdown twice
  * @library /testlibrary
+ * @modules java.base/sun.misc
+ *          java.management
  * @run main/othervm -XX:NativeMemoryTracking=detail ShutdownTwice
  */
 
diff --git a/hotspot/test/runtime/NMT/SummaryAfterShutdown.java b/hotspot/test/runtime/NMT/SummaryAfterShutdown.java
index ea1f3a6..2832b26 100644
--- a/hotspot/test/runtime/NMT/SummaryAfterShutdown.java
+++ b/hotspot/test/runtime/NMT/SummaryAfterShutdown.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,6 +26,8 @@
  * @key nmt jcmd
  * @summary Verify that jcmd correctly reports that NMT is not enabled after a shutdown
  * @library /testlibrary
+ * @modules java.base/sun.misc
+ *          java.management
  * @run main/othervm -XX:NativeMemoryTracking=detail SummaryAfterShutdown
  */
 
diff --git a/hotspot/test/runtime/NMT/SummarySanityCheck.java b/hotspot/test/runtime/NMT/SummarySanityCheck.java
index 183e791..93e1c95 100644
--- a/hotspot/test/runtime/NMT/SummarySanityCheck.java
+++ b/hotspot/test/runtime/NMT/SummarySanityCheck.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,6 +26,8 @@
  * @key nmt jcmd
  * @summary Sanity check the output of NMT
  * @library /testlibrary /../../test/lib
+ * @modules java.base/sun.misc
+ *          java.management
  * @build SummarySanityCheck
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
diff --git a/hotspot/test/runtime/NMT/ThreadedMallocTestType.java b/hotspot/test/runtime/NMT/ThreadedMallocTestType.java
index c67ea6e..72e55c12 100644
--- a/hotspot/test/runtime/NMT/ThreadedMallocTestType.java
+++ b/hotspot/test/runtime/NMT/ThreadedMallocTestType.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,6 +25,8 @@
  * @test
  * @key nmt jcmd
  * @library /testlibrary /../../test/lib
+ * @modules java.base/sun.misc
+ *          java.management
  * @build ThreadedMallocTestType
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
diff --git a/hotspot/test/runtime/NMT/ThreadedVirtualAllocTestType.java b/hotspot/test/runtime/NMT/ThreadedVirtualAllocTestType.java
index d5e75ca..2188469 100644
--- a/hotspot/test/runtime/NMT/ThreadedVirtualAllocTestType.java
+++ b/hotspot/test/runtime/NMT/ThreadedVirtualAllocTestType.java
@@ -25,6 +25,8 @@
  * @test
  * @key nmt jcmd
  * @library /testlibrary /../../test/lib
+ * @modules java.base/sun.misc
+ *          java.management
  * @build ThreadedVirtualAllocTestType
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
diff --git a/hotspot/test/runtime/NMT/VirtualAllocCommitUncommitRecommit.java b/hotspot/test/runtime/NMT/VirtualAllocCommitUncommitRecommit.java
index ec85616..32074d5 100644
--- a/hotspot/test/runtime/NMT/VirtualAllocCommitUncommitRecommit.java
+++ b/hotspot/test/runtime/NMT/VirtualAllocCommitUncommitRecommit.java
@@ -26,6 +26,8 @@
  * @summary Test reserve/commit/uncommit/release of virtual memory and that we track it correctly
  * @key nmt jcmd
  * @library /testlibrary /../../test/lib
+ * @modules java.base/sun.misc
+ *          java.management
  * @build VirtualAllocCommitUncommitRecommit
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -XX:NativeMemoryTracking=detail VirtualAllocCommitUncommitRecommit
diff --git a/hotspot/test/runtime/NMT/VirtualAllocTestType.java b/hotspot/test/runtime/NMT/VirtualAllocTestType.java
index fe3b0fe..ae7e2b3 100644
--- a/hotspot/test/runtime/NMT/VirtualAllocTestType.java
+++ b/hotspot/test/runtime/NMT/VirtualAllocTestType.java
@@ -26,6 +26,8 @@
  * @summary Test Reserve/Commit/Uncommit/Release of virtual memory and that we track it correctly
  * @key nmt jcmd
  * @library /testlibrary /../../test/lib
+ * @modules java.base/sun.misc
+ *          java.management
  * @build VirtualAllocTestType
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
diff --git a/hotspot/test/runtime/PerfMemDestroy/PerfMemDestroy.java b/hotspot/test/runtime/PerfMemDestroy/PerfMemDestroy.java
index fc46f6b..ce06c6d 100644
--- a/hotspot/test/runtime/PerfMemDestroy/PerfMemDestroy.java
+++ b/hotspot/test/runtime/PerfMemDestroy/PerfMemDestroy.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,6 +26,8 @@
  * @bug 8030955
  * @summary Allow multiple calls to PerfMemory::destroy() without asserting.
  * @library /testlibrary
+ * @modules java.base/sun.misc
+ *          java.management
  * @run main PerfMemDestroy
  */
 
diff --git a/hotspot/test/runtime/RedefineObject/TestRedefineObject.java b/hotspot/test/runtime/RedefineObject/TestRedefineObject.java
index 184c90c..37f702d 100644
--- a/hotspot/test/runtime/RedefineObject/TestRedefineObject.java
+++ b/hotspot/test/runtime/RedefineObject/TestRedefineObject.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -33,6 +33,9 @@
  * @bug 8005056
  * @bug 8009728
  * @library /testlibrary
+ * @modules java.base/sun.misc
+ *          java.instrument
+ *          java.management
  * @build Agent
  * @run main ClassFileInstaller Agent
  * @run main TestRedefineObject
diff --git a/hotspot/test/runtime/RedefineTests/RedefineAnnotations.java b/hotspot/test/runtime/RedefineTests/RedefineAnnotations.java
index eb74b68..3c9c816 100644
--- a/hotspot/test/runtime/RedefineTests/RedefineAnnotations.java
+++ b/hotspot/test/runtime/RedefineTests/RedefineAnnotations.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,6 +25,9 @@
  * @test
  * @library /testlibrary
  * @summary Test that type annotations are retained after a retransform
+ * @modules java.base/jdk.internal.org.objectweb.asm
+ *          java.instrument
+ *          jdk.jartool/sun.tools.jar
  * @run main RedefineAnnotations buildagent
  * @run main/othervm -javaagent:redefineagent.jar RedefineAnnotations
  */
diff --git a/hotspot/test/runtime/RedefineTests/RedefineFinalizer.java b/hotspot/test/runtime/RedefineTests/RedefineFinalizer.java
index 227b9e8..394e31c 100644
--- a/hotspot/test/runtime/RedefineTests/RedefineFinalizer.java
+++ b/hotspot/test/runtime/RedefineTests/RedefineFinalizer.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,6 +26,9 @@
  * @bug 6904403
  * @summary Don't assert if we redefine finalize method
  * @library /testlibrary
+ * @modules java.compiler
+ *          java.instrument
+ *          jdk.jartool/sun.tools.jar
  * @build RedefineClassHelper
  * @run main RedefineClassHelper
  * @run main/othervm -javaagent:redefineagent.jar RedefineFinalizer
diff --git a/hotspot/test/runtime/RedefineTests/RedefineRunningMethods.java b/hotspot/test/runtime/RedefineTests/RedefineRunningMethods.java
index 693ecd9..525d890 100644
--- a/hotspot/test/runtime/RedefineTests/RedefineRunningMethods.java
+++ b/hotspot/test/runtime/RedefineTests/RedefineRunningMethods.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,6 +26,9 @@
  * @bug 8055008
  * @summary Redefine EMCP and non-EMCP methods that are running in an infinite loop
  * @library /testlibrary
+ * @modules java.compiler
+ *          java.instrument
+ *          jdk.jartool/sun.tools.jar
  * @build RedefineClassHelper
  * @run main RedefineClassHelper
  * @run main/othervm -javaagent:redefineagent.jar -XX:TraceRedefineClasses=0x600 RedefineRunningMethods
diff --git a/hotspot/test/runtime/Safepoint/AssertSafepointCheckConsistency1.java b/hotspot/test/runtime/Safepoint/AssertSafepointCheckConsistency1.java
index f9f6434..472845d 100644
--- a/hotspot/test/runtime/Safepoint/AssertSafepointCheckConsistency1.java
+++ b/hotspot/test/runtime/Safepoint/AssertSafepointCheckConsistency1.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,6 +26,8 @@
  * @bug 8047290
  * @summary Ensure that a Monitor::lock_without_safepoint_check fires an assert when it incorrectly acquires a lock which must always have safepoint checks.
  * @library /testlibrary /../../test/lib
+ * @modules java.base/sun.misc
+ *          java.management
  * @build AssertSafepointCheckConsistency1
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
diff --git a/hotspot/test/runtime/Safepoint/AssertSafepointCheckConsistency2.java b/hotspot/test/runtime/Safepoint/AssertSafepointCheckConsistency2.java
index c6df9d7..5c3980b 100644
--- a/hotspot/test/runtime/Safepoint/AssertSafepointCheckConsistency2.java
+++ b/hotspot/test/runtime/Safepoint/AssertSafepointCheckConsistency2.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,6 +26,8 @@
  * @bug 8047290
  * @summary Ensure that a Monitor::lock fires an assert when it incorrectly acquires a lock which must never have safepoint checks.
  * @library /testlibrary /../../test/lib
+ * @modules java.base/sun.misc
+ *          java.management
  * @build AssertSafepointCheckConsistency2
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
diff --git a/hotspot/test/runtime/Safepoint/AssertSafepointCheckConsistency3.java b/hotspot/test/runtime/Safepoint/AssertSafepointCheckConsistency3.java
index a3c79e2..90b67d8 100644
--- a/hotspot/test/runtime/Safepoint/AssertSafepointCheckConsistency3.java
+++ b/hotspot/test/runtime/Safepoint/AssertSafepointCheckConsistency3.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,6 +26,8 @@
  * @bug 8047290
  * @summary Ensure that Monitor::lock_without_safepoint_check does not assert when it correctly acquires a lock which must never have safepoint checks.
  * @library /testlibrary /../../test/lib
+ * @modules java.base/sun.misc
+ *          java.management
  * @build AssertSafepointCheckConsistency3
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
diff --git a/hotspot/test/runtime/Safepoint/AssertSafepointCheckConsistency4.java b/hotspot/test/runtime/Safepoint/AssertSafepointCheckConsistency4.java
index 79096eb..b1615d9 100644
--- a/hotspot/test/runtime/Safepoint/AssertSafepointCheckConsistency4.java
+++ b/hotspot/test/runtime/Safepoint/AssertSafepointCheckConsistency4.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,6 +26,8 @@
  * @bug 8047290
  * @summary Ensure that Monitor::lock does not assert when it correctly acquires a lock which must always have safepoint checks.
  * @library /testlibrary /../../test/lib
+ * @modules java.base/sun.misc
+ *          java.management
  * @build AssertSafepointCheckConsistency4
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
diff --git a/hotspot/test/runtime/SharedArchiveFile/ArchiveDoesNotExist.java b/hotspot/test/runtime/SharedArchiveFile/ArchiveDoesNotExist.java
index ec184bb..08244c7 100644
--- a/hotspot/test/runtime/SharedArchiveFile/ArchiveDoesNotExist.java
+++ b/hotspot/test/runtime/SharedArchiveFile/ArchiveDoesNotExist.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -28,6 +28,8 @@
  *          when sharing mode is ON, and continue w/o sharing if sharing
  *          mode is AUTO.
  * @library /testlibrary
+ * @modules java.base/sun.misc
+ *          java.management
  * @run main ArchiveDoesNotExist
  */
 
diff --git a/hotspot/test/runtime/SharedArchiveFile/CdsDifferentObjectAlignment.java b/hotspot/test/runtime/SharedArchiveFile/CdsDifferentObjectAlignment.java
index 9ecb1da..e1cc78a 100644
--- a/hotspot/test/runtime/SharedArchiveFile/CdsDifferentObjectAlignment.java
+++ b/hotspot/test/runtime/SharedArchiveFile/CdsDifferentObjectAlignment.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -30,6 +30,8 @@
  *          should fail when loading.
  * @library /testlibrary
  * @bug 8025642
+ * @modules java.base/sun.misc
+ *          java.management
  */
 
 import com.oracle.java.testlibrary.*;
diff --git a/hotspot/test/runtime/SharedArchiveFile/CdsSameObjectAlignment.java b/hotspot/test/runtime/SharedArchiveFile/CdsSameObjectAlignment.java
index 5c91f60..763aa84 100644
--- a/hotspot/test/runtime/SharedArchiveFile/CdsSameObjectAlignment.java
+++ b/hotspot/test/runtime/SharedArchiveFile/CdsSameObjectAlignment.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,6 +26,8 @@
  * @summary Testing CDS (class data sharing) using varying object alignment.
  *          Using same object alignment for each dump/load pair
  * @library /testlibrary
+ * @modules java.base/sun.misc
+ *          java.management
  */
 
 import com.oracle.java.testlibrary.*;
diff --git a/hotspot/test/runtime/SharedArchiveFile/DefaultUseWithClient.java b/hotspot/test/runtime/SharedArchiveFile/DefaultUseWithClient.java
index 52cae81..d904448 100644
--- a/hotspot/test/runtime/SharedArchiveFile/DefaultUseWithClient.java
+++ b/hotspot/test/runtime/SharedArchiveFile/DefaultUseWithClient.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,6 +25,8 @@
  * @test DefaultUseWithClient
  * @summary Test default behavior of sharing with -client
  * @library /testlibrary
+ * @modules java.base/sun.misc
+ *          java.management
  * @run main DefaultUseWithClient
  * @bug 8032224
  */
diff --git a/hotspot/test/runtime/SharedArchiveFile/DumpSymbolAndStringTable.java b/hotspot/test/runtime/SharedArchiveFile/DumpSymbolAndStringTable.java
index 0bad2c3..a50e8ba 100644
--- a/hotspot/test/runtime/SharedArchiveFile/DumpSymbolAndStringTable.java
+++ b/hotspot/test/runtime/SharedArchiveFile/DumpSymbolAndStringTable.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,6 +26,8 @@
  * @bug 8059510
  * @summary Test jcmd VM.symboltable and VM.stringtable options
  * @library /testlibrary
+ * @modules java.base/sun.misc
+ *          java.management
  * @run main/othervm -XX:+UnlockDiagnosticVMOptions DumpSymbolAndStringTable
  */
 
diff --git a/hotspot/test/runtime/SharedArchiveFile/LimitSharedSizes.java b/hotspot/test/runtime/SharedArchiveFile/LimitSharedSizes.java
index f38b85a..8f2ebf7 100644
--- a/hotspot/test/runtime/SharedArchiveFile/LimitSharedSizes.java
+++ b/hotspot/test/runtime/SharedArchiveFile/LimitSharedSizes.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -24,6 +24,8 @@
 /* @test LimitSharedSizes
  * @summary Test handling of limits on shared space size
  * @library /testlibrary
+ * @modules java.base/sun.misc
+ *          java.management
  * @run main LimitSharedSizes
  */
 
diff --git a/hotspot/test/runtime/SharedArchiveFile/MaxMetaspaceSize.java b/hotspot/test/runtime/SharedArchiveFile/MaxMetaspaceSize.java
index 9d8c498..abf1ad7 100644
--- a/hotspot/test/runtime/SharedArchiveFile/MaxMetaspaceSize.java
+++ b/hotspot/test/runtime/SharedArchiveFile/MaxMetaspaceSize.java
@@ -26,6 +26,8 @@
  * @bug 8067187
  * @summary Testing CDS dumping with the -XX:MaxMetaspaceSize=<size> option
  * @library /testlibrary
+ * @modules java.base/sun.misc
+ *          java.management
  */
 
 import com.oracle.java.testlibrary.*;
diff --git a/hotspot/test/runtime/SharedArchiveFile/PrintSharedArchiveAndExit.java b/hotspot/test/runtime/SharedArchiveFile/PrintSharedArchiveAndExit.java
index e3e81ca..d3f74a2 100644
--- a/hotspot/test/runtime/SharedArchiveFile/PrintSharedArchiveAndExit.java
+++ b/hotspot/test/runtime/SharedArchiveFile/PrintSharedArchiveAndExit.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,6 +26,8 @@
  * @bug 8066670
  * @summary Testing -XX:+PrintSharedArchiveAndExit option
  * @library /testlibrary
+ * @modules java.base/sun.misc
+ *          java.management
  */
 
 import com.oracle.java.testlibrary.*;
diff --git a/hotspot/test/runtime/SharedArchiveFile/SharedArchiveFile.java b/hotspot/test/runtime/SharedArchiveFile/SharedArchiveFile.java
index 802e251..d8221ef 100644
--- a/hotspot/test/runtime/SharedArchiveFile/SharedArchiveFile.java
+++ b/hotspot/test/runtime/SharedArchiveFile/SharedArchiveFile.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,6 +26,8 @@
  * @bug 8014138
  * @summary Testing new -XX:SharedArchiveFile=<file-name> option
  * @library /testlibrary
+ * @modules java.base/sun.misc
+ *          java.management
  */
 
 import com.oracle.java.testlibrary.*;
diff --git a/hotspot/test/runtime/SharedArchiveFile/SharedBaseAddress.java b/hotspot/test/runtime/SharedArchiveFile/SharedBaseAddress.java
index 388fe7d..e47ce0f 100644
--- a/hotspot/test/runtime/SharedArchiveFile/SharedBaseAddress.java
+++ b/hotspot/test/runtime/SharedArchiveFile/SharedBaseAddress.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,6 +26,8 @@
  * @summary Test variety of values for SharedBaseAddress, making sure
  *          VM handles normal values as well as edge values w/o a crash.
  * @library /testlibrary
+ * @modules java.base/sun.misc
+ *          java.management
  * @run main SharedBaseAddress
  */
 
diff --git a/hotspot/test/runtime/SharedArchiveFile/SharedSymbolTableBucketSize.java b/hotspot/test/runtime/SharedArchiveFile/SharedSymbolTableBucketSize.java
index 1c71e4b..208d834 100644
--- a/hotspot/test/runtime/SharedArchiveFile/SharedSymbolTableBucketSize.java
+++ b/hotspot/test/runtime/SharedArchiveFile/SharedSymbolTableBucketSize.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,6 +26,8 @@
  * @bug 8059510
  * @summary Test SharedSymbolTableBucketSize option
  * @library /testlibrary
+ * @modules java.base/sun.misc
+ *          java.management
  */
 
 import com.oracle.java.testlibrary.*;
diff --git a/hotspot/test/runtime/SharedArchiveFile/SpaceUtilizationCheck.java b/hotspot/test/runtime/SharedArchiveFile/SpaceUtilizationCheck.java
index a95979f..dc5468d 100644
--- a/hotspot/test/runtime/SharedArchiveFile/SpaceUtilizationCheck.java
+++ b/hotspot/test/runtime/SharedArchiveFile/SpaceUtilizationCheck.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,6 +25,8 @@
  * @test SpaceUtilizationCheck
  * @summary Check if the space utilization for shared spaces is adequate
  * @library /testlibrary
+ * @modules java.base/sun.misc
+ *          java.management
  * @run main SpaceUtilizationCheck
  */
 
diff --git a/hotspot/test/runtime/Thread/TestThreadDumpMonitorContention.java b/hotspot/test/runtime/Thread/TestThreadDumpMonitorContention.java
index 979aefc..0cde656 100644
--- a/hotspot/test/runtime/Thread/TestThreadDumpMonitorContention.java
+++ b/hotspot/test/runtime/Thread/TestThreadDumpMonitorContention.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -29,6 +29,8 @@
  *      whether jstack reports "locked" by more than one thread.
  *
  * @library /testlibrary
+ * @modules java.base/sun.misc
+ *          java.management
  * @run main/othervm TestThreadDumpMonitorContention
  */
 
diff --git a/hotspot/test/runtime/Thread/ThreadPriorities.java b/hotspot/test/runtime/Thread/ThreadPriorities.java
index 18a75c1..30374b0 100644
--- a/hotspot/test/runtime/Thread/ThreadPriorities.java
+++ b/hotspot/test/runtime/Thread/ThreadPriorities.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2015 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 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
@@ -28,6 +28,8 @@
  *      whether jstack reports correct priorities for them.
  *
  * @library /testlibrary
+ * @modules java.base/sun.misc
+ *          java.management
  * @run main ThreadPriorities
  */
 
diff --git a/hotspot/test/runtime/Unsafe/AllocateInstance.java b/hotspot/test/runtime/Unsafe/AllocateInstance.java
index 1339572..066be74 100644
--- a/hotspot/test/runtime/Unsafe/AllocateInstance.java
+++ b/hotspot/test/runtime/Unsafe/AllocateInstance.java
@@ -25,6 +25,8 @@
  * @test
  * @summary Verifies the behaviour of Unsafe.allocateInstance
  * @library /testlibrary
+ * @modules java.base/sun.misc
+ *          java.management
  * @run main AllocateInstance
  */
 
diff --git a/hotspot/test/runtime/Unsafe/AllocateMemory.java b/hotspot/test/runtime/Unsafe/AllocateMemory.java
index 9f4cf53..bf52207 100644
--- a/hotspot/test/runtime/Unsafe/AllocateMemory.java
+++ b/hotspot/test/runtime/Unsafe/AllocateMemory.java
@@ -25,6 +25,8 @@
  * @test
  * @summary Verifies behaviour of Unsafe.allocateMemory
  * @library /testlibrary
+ * @modules java.base/sun.misc
+ *          java.management
  * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:MallocMaxTestWords=100m AllocateMemory
  */
 
diff --git a/hotspot/test/runtime/Unsafe/CopyMemory.java b/hotspot/test/runtime/Unsafe/CopyMemory.java
index c5b1ac4..794a20d 100644
--- a/hotspot/test/runtime/Unsafe/CopyMemory.java
+++ b/hotspot/test/runtime/Unsafe/CopyMemory.java
@@ -25,6 +25,8 @@
  * @test
  * @summary Verifies behaviour of Unsafe.copyMemory
  * @library /testlibrary
+ * @modules java.base/sun.misc
+ *          java.management
  * @run main CopyMemory
  */
 
diff --git a/hotspot/test/runtime/Unsafe/DefineClass.java b/hotspot/test/runtime/Unsafe/DefineClass.java
index a22bc57..5837f0b 100644
--- a/hotspot/test/runtime/Unsafe/DefineClass.java
+++ b/hotspot/test/runtime/Unsafe/DefineClass.java
@@ -25,6 +25,9 @@
  * @test
  * @summary Verifies the behaviour of Unsafe.defineClass
  * @library /testlibrary
+ * @modules java.base/sun.misc
+ *          java.compiler
+ *          java.management
  * @run main DefineClass
  */
 
diff --git a/hotspot/test/runtime/Unsafe/FieldOffset.java b/hotspot/test/runtime/Unsafe/FieldOffset.java
index 72b168d..eacc23c 100644
--- a/hotspot/test/runtime/Unsafe/FieldOffset.java
+++ b/hotspot/test/runtime/Unsafe/FieldOffset.java
@@ -25,6 +25,8 @@
  * @test
  * @summary Verifies the behaviour of Unsafe.fieldOffset
  * @library /testlibrary
+ * @modules java.base/sun.misc
+ *          java.management
  * @run main FieldOffset
  */
 
diff --git a/hotspot/test/runtime/Unsafe/GetField.java b/hotspot/test/runtime/Unsafe/GetField.java
index d5e58c9..e35354d 100644
--- a/hotspot/test/runtime/Unsafe/GetField.java
+++ b/hotspot/test/runtime/Unsafe/GetField.java
@@ -25,6 +25,8 @@
  * @test
  * @summary Verifies behaviour of Unsafe.getField
  * @library /testlibrary
+ * @modules java.base/sun.misc
+ *          java.management
  * @run main GetField
  */
 
diff --git a/hotspot/test/runtime/Unsafe/GetPutAddress.java b/hotspot/test/runtime/Unsafe/GetPutAddress.java
index 9bf105b..e21b3f8 100644
--- a/hotspot/test/runtime/Unsafe/GetPutAddress.java
+++ b/hotspot/test/runtime/Unsafe/GetPutAddress.java
@@ -25,6 +25,8 @@
  * @test
  * Verify behaviour of Unsafe.get/putAddress and Unsafe.addressSize
  * @library /testlibrary
+ * @modules java.base/sun.misc
+ *          java.management
  * @run main GetPutAddress
  */
 
diff --git a/hotspot/test/runtime/Unsafe/GetPutBoolean.java b/hotspot/test/runtime/Unsafe/GetPutBoolean.java
index 93f0b3d..aee3b30 100644
--- a/hotspot/test/runtime/Unsafe/GetPutBoolean.java
+++ b/hotspot/test/runtime/Unsafe/GetPutBoolean.java
@@ -25,6 +25,8 @@
  * @test
  * @summary Verify behaviour of Unsafe.get/putBoolean
  * @library /testlibrary
+ * @modules java.base/sun.misc
+ *          java.management
  * @run main GetPutBoolean
  */
 
diff --git a/hotspot/test/runtime/Unsafe/GetPutByte.java b/hotspot/test/runtime/Unsafe/GetPutByte.java
index 44546f9..d046e88 100644
--- a/hotspot/test/runtime/Unsafe/GetPutByte.java
+++ b/hotspot/test/runtime/Unsafe/GetPutByte.java
@@ -25,6 +25,8 @@
  * @test
  * @summary Verify behaviour of Unsafe.get/putByte
  * @library /testlibrary
+ * @modules java.base/sun.misc
+ *          java.management
  * @run main GetPutByte
  */
 
diff --git a/hotspot/test/runtime/Unsafe/GetPutChar.java b/hotspot/test/runtime/Unsafe/GetPutChar.java
index a0c2a0e..3a2d637 100644
--- a/hotspot/test/runtime/Unsafe/GetPutChar.java
+++ b/hotspot/test/runtime/Unsafe/GetPutChar.java
@@ -25,6 +25,8 @@
  * @test
  * @summary Verify behaviour of Unsafe.get/putChar
  * @library /testlibrary
+ * @modules java.base/sun.misc
+ *          java.management
  * @run main GetPutChar
  */
 
diff --git a/hotspot/test/runtime/Unsafe/GetPutDouble.java b/hotspot/test/runtime/Unsafe/GetPutDouble.java
index 17b2bdf..170450b 100644
--- a/hotspot/test/runtime/Unsafe/GetPutDouble.java
+++ b/hotspot/test/runtime/Unsafe/GetPutDouble.java
@@ -25,6 +25,8 @@
  * @test
  * @summary Verify behaviour of Unsafe.get/putDouble
  * @library /testlibrary
+ * @modules java.base/sun.misc
+ *          java.management
  * @run main GetPutDouble
  */
 
diff --git a/hotspot/test/runtime/Unsafe/GetPutFloat.java b/hotspot/test/runtime/Unsafe/GetPutFloat.java
index 239bf10..8d0b537 100644
--- a/hotspot/test/runtime/Unsafe/GetPutFloat.java
+++ b/hotspot/test/runtime/Unsafe/GetPutFloat.java
@@ -25,6 +25,8 @@
  * @test
  * @summary Verify behaviour of Unsafe.get/putFloat
  * @library /testlibrary
+ * @modules java.base/sun.misc
+ *          java.management
  * @run main GetPutFloat
  */
 
diff --git a/hotspot/test/runtime/Unsafe/GetPutInt.java b/hotspot/test/runtime/Unsafe/GetPutInt.java
index e93aeb8..a9cffce 100644
--- a/hotspot/test/runtime/Unsafe/GetPutInt.java
+++ b/hotspot/test/runtime/Unsafe/GetPutInt.java
@@ -24,6 +24,8 @@
 /*
  * @test
  * @library /testlibrary
+ * @modules java.base/sun.misc
+ *          java.management
  * @run main GetPutInt
  */
 
diff --git a/hotspot/test/runtime/Unsafe/GetPutLong.java b/hotspot/test/runtime/Unsafe/GetPutLong.java
index 2ea4a19..96b28e1 100644
--- a/hotspot/test/runtime/Unsafe/GetPutLong.java
+++ b/hotspot/test/runtime/Unsafe/GetPutLong.java
@@ -25,6 +25,8 @@
  * @test
  * @summary Verify behaviour of Unsafe.get/putLong
  * @library /testlibrary
+ * @modules java.base/sun.misc
+ *          java.management
  * @run main GetPutLong
  */
 
diff --git a/hotspot/test/runtime/Unsafe/GetPutObject.java b/hotspot/test/runtime/Unsafe/GetPutObject.java
index bd186bc..5a8071a 100644
--- a/hotspot/test/runtime/Unsafe/GetPutObject.java
+++ b/hotspot/test/runtime/Unsafe/GetPutObject.java
@@ -25,6 +25,8 @@
  * @test
  * @summary Verify behaviour of Unsafe.get/putObject
  * @library /testlibrary
+ * @modules java.base/sun.misc
+ *          java.management
  * @run main GetPutObject
  */
 
diff --git a/hotspot/test/runtime/Unsafe/GetPutShort.java b/hotspot/test/runtime/Unsafe/GetPutShort.java
index d89fcc2..1930e8b 100644
--- a/hotspot/test/runtime/Unsafe/GetPutShort.java
+++ b/hotspot/test/runtime/Unsafe/GetPutShort.java
@@ -25,6 +25,8 @@
  * @test
  * @summary Verify behaviour of Unsafe.get/putShort
  * @library /testlibrary
+ * @modules java.base/sun.misc
+ *          java.management
  * @run main GetPutShort
  */
 
diff --git a/hotspot/test/runtime/Unsafe/GetUnsafe.java b/hotspot/test/runtime/Unsafe/GetUnsafe.java
index 14c6880..334cce2 100644
--- a/hotspot/test/runtime/Unsafe/GetUnsafe.java
+++ b/hotspot/test/runtime/Unsafe/GetUnsafe.java
@@ -25,6 +25,7 @@
  * @test
  * @summary Verifies that getUnsafe() actually throws SecurityException when unsafeAccess is prohibited.
  * @library /testlibrary
+ * @modules java.base/sun.misc
  * @run main GetUnsafe
  */
 
diff --git a/hotspot/test/runtime/Unsafe/PageSize.java b/hotspot/test/runtime/Unsafe/PageSize.java
index 786277c..2ba708d 100644
--- a/hotspot/test/runtime/Unsafe/PageSize.java
+++ b/hotspot/test/runtime/Unsafe/PageSize.java
@@ -25,6 +25,8 @@
  * @test
  * @summary Make sure pageSize() returns a value that is a power of two
  * @library /testlibrary
+ * @modules java.base/sun.misc
+ *          java.management
  * @run main PageSize
  */
 
diff --git a/hotspot/test/runtime/Unsafe/RangeCheck.java b/hotspot/test/runtime/Unsafe/RangeCheck.java
index 4d4ea2e..0051305 100644
--- a/hotspot/test/runtime/Unsafe/RangeCheck.java
+++ b/hotspot/test/runtime/Unsafe/RangeCheck.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,6 +26,8 @@
  * @bug 8001071
  * @summary Add simple range check into VM implemenation of Unsafe access methods
  * @library /testlibrary
+ * @modules java.base/sun.misc
+ *          java.management
  */
 
 import com.oracle.java.testlibrary.*;
diff --git a/hotspot/test/runtime/Unsafe/Reallocate.java b/hotspot/test/runtime/Unsafe/Reallocate.java
index 1944203..4cd3450 100644
--- a/hotspot/test/runtime/Unsafe/Reallocate.java
+++ b/hotspot/test/runtime/Unsafe/Reallocate.java
@@ -25,6 +25,8 @@
  * @test
  * @bug 8058897
  * @library /testlibrary
+ * @modules java.base/sun.misc
+ *          java.management
  * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:MallocMaxTestWords=100m Reallocate
  */
 
diff --git a/hotspot/test/runtime/Unsafe/SetMemory.java b/hotspot/test/runtime/Unsafe/SetMemory.java
index ea7c03f..726479a 100644
--- a/hotspot/test/runtime/Unsafe/SetMemory.java
+++ b/hotspot/test/runtime/Unsafe/SetMemory.java
@@ -25,6 +25,8 @@
  * @test
  * @summary Verifies that setMemory works correctly
  * @library /testlibrary
+ * @modules java.base/sun.misc
+ *          java.management
  * @run main SetMemory
  */
 
diff --git a/hotspot/test/runtime/Unsafe/ThrowException.java b/hotspot/test/runtime/Unsafe/ThrowException.java
index d0347b5..c6fa428 100644
--- a/hotspot/test/runtime/Unsafe/ThrowException.java
+++ b/hotspot/test/runtime/Unsafe/ThrowException.java
@@ -25,6 +25,8 @@
  * @test
  * @summary Verify that throwException() can throw an exception
  * @library /testlibrary
+ * @modules java.base/sun.misc
+ *          java.management
  * @run main ThrowException
  */
 
diff --git a/hotspot/test/runtime/XCheckJniJsig/XCheckJSig.java b/hotspot/test/runtime/XCheckJniJsig/XCheckJSig.java
index ac22b74..e66af04 100644
--- a/hotspot/test/runtime/XCheckJniJsig/XCheckJSig.java
+++ b/hotspot/test/runtime/XCheckJniJsig/XCheckJSig.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,6 +26,8 @@
  * @bug 7051189 8023393
  * @summary Need to suppress info message if -Xcheck:jni is used with libjsig.so
  * @library /testlibrary
+ * @modules java.base/sun.misc
+ *          java.management
  * @run main XCheckJSig
  */
 
diff --git a/hotspot/test/runtime/classFileParserBug/ClassFileParserBug.java b/hotspot/test/runtime/classFileParserBug/ClassFileParserBug.java
index 7da7a87..7ca3925 100644
--- a/hotspot/test/runtime/classFileParserBug/ClassFileParserBug.java
+++ b/hotspot/test/runtime/classFileParserBug/ClassFileParserBug.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,6 +26,8 @@
  * @bug 8040018
  * @library /testlibrary
  * @summary Check for exception instead of assert.
+ * @modules java.base/sun.misc
+ *          java.management
  * @run main ClassFileParserBug
  */
 
diff --git a/hotspot/test/runtime/classFileParserBug/TestEmptyBootstrapMethodsAttr.java b/hotspot/test/runtime/classFileParserBug/TestEmptyBootstrapMethodsAttr.java
index fa33c1e..51aab94 100644
--- a/hotspot/test/runtime/classFileParserBug/TestEmptyBootstrapMethodsAttr.java
+++ b/hotspot/test/runtime/classFileParserBug/TestEmptyBootstrapMethodsAttr.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,6 +26,8 @@
  * @bug 8041918
  * @library /testlibrary
  * @summary Test empty bootstrap_methods table within BootstrapMethods attribute
+ * @modules java.base/sun.misc
+ *          java.management
  * @compile TestEmptyBootstrapMethodsAttr.java
  * @run main TestEmptyBootstrapMethodsAttr
  */
diff --git a/hotspot/test/runtime/contended/Basic.java b/hotspot/test/runtime/contended/Basic.java
index e154614..ddc685e 100644
--- a/hotspot/test/runtime/contended/Basic.java
+++ b/hotspot/test/runtime/contended/Basic.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -42,7 +42,7 @@
  * @test
  * @bug     8003985
  * @summary Support Contended Annotation - JEP 142
- *
+ * @modules java.base/sun.misc
  * @run main/othervm -XX:-RestrictContended Basic
  */
 public class Basic {
diff --git a/hotspot/test/runtime/contended/DefaultValue.java b/hotspot/test/runtime/contended/DefaultValue.java
index 6f60672..05cc698 100644
--- a/hotspot/test/runtime/contended/DefaultValue.java
+++ b/hotspot/test/runtime/contended/DefaultValue.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -43,6 +43,7 @@
  * @bug     8014509
  * @summary \@Contended: explicit default value behaves differently from the implicit value
  *
+ * @modules java.base/sun.misc
  * @run main/othervm -XX:-RestrictContended DefaultValue
  */
 public class DefaultValue {
diff --git a/hotspot/test/runtime/contended/HasNonStatic.java b/hotspot/test/runtime/contended/HasNonStatic.java
index 6792adf..6ff2182 100644
--- a/hotspot/test/runtime/contended/HasNonStatic.java
+++ b/hotspot/test/runtime/contended/HasNonStatic.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -43,6 +43,7 @@
  * @bug     8015270
  * @summary \@Contended: fix multiple issues in the layout code
  *
+ * @modules java.base/sun.misc
  * @run main/othervm -XX:-RestrictContended HasNonStatic
  */
 public class HasNonStatic {
diff --git a/hotspot/test/runtime/contended/Inheritance1.java b/hotspot/test/runtime/contended/Inheritance1.java
index 70b8e4c..e6cf2bd 100644
--- a/hotspot/test/runtime/contended/Inheritance1.java
+++ b/hotspot/test/runtime/contended/Inheritance1.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -43,6 +43,7 @@
  * @bug     8012939
  * @summary \@Contended doesn't work correctly with inheritance
  *
+ * @modules java.base/sun.misc
  * @run main/othervm -XX:-RestrictContended Inheritance1
  */
 public class Inheritance1 {
diff --git a/hotspot/test/runtime/contended/OopMaps.java b/hotspot/test/runtime/contended/OopMaps.java
index 8faa0be..2501ec1 100644
--- a/hotspot/test/runtime/contended/OopMaps.java
+++ b/hotspot/test/runtime/contended/OopMaps.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -44,6 +44,7 @@
  * @bug     8015493
  * @summary \@Contended: fix multiple issues in the layout code
  *
+ * @modules java.base/sun.misc
  * @run main/othervm -XX:-RestrictContended -XX:ContendedPaddingWidth=128 -Xmx128m OopMaps
  */
 public class OopMaps {
diff --git a/hotspot/test/runtime/contended/OopMapsSameGroup.java b/hotspot/test/runtime/contended/OopMapsSameGroup.java
index 4f4bbfe..d17ae1e 100644
--- a/hotspot/test/runtime/contended/OopMapsSameGroup.java
+++ b/hotspot/test/runtime/contended/OopMapsSameGroup.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -43,6 +43,7 @@
  * @bug     8015272
  * @summary \@Contended within the same group to use the same oop map
  *
+ * @modules java.base/sun.misc
  * @run main/othervm -XX:-RestrictContended -XX:ContendedPaddingWidth=128 -Xmx128m OopMapsSameGroup
  */
 public class OopMapsSameGroup {
diff --git a/hotspot/test/runtime/contended/Options.java b/hotspot/test/runtime/contended/Options.java
index 589ec9b..21bd120 100644
--- a/hotspot/test/runtime/contended/Options.java
+++ b/hotspot/test/runtime/contended/Options.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -29,6 +29,8 @@
  * @summary ContendedPaddingWidth should be range-checked
  *
  * @library /testlibrary
+ * @modules java.base/sun.misc
+ *          java.management
  * @run main Options
  */
 public class Options {
diff --git a/hotspot/test/runtime/duplAttributes/DuplAttributesTest.java b/hotspot/test/runtime/duplAttributes/DuplAttributesTest.java
index 8b5235e..f2c708c 100644
--- a/hotspot/test/runtime/duplAttributes/DuplAttributesTest.java
+++ b/hotspot/test/runtime/duplAttributes/DuplAttributesTest.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,6 +26,8 @@
  * @bug 8040292
  * @library /testlibrary
  * @summary Throw exceptions when duplicate attributes are detected.
+ * @modules java.base/sun.misc
+ *          java.management
  * @run main DuplAttributesTest
  */
 
diff --git a/hotspot/test/runtime/finalStatic/FinalStatic.java b/hotspot/test/runtime/finalStatic/FinalStatic.java
index 314b192..20c6ddd 100644
--- a/hotspot/test/runtime/finalStatic/FinalStatic.java
+++ b/hotspot/test/runtime/finalStatic/FinalStatic.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,6 +25,7 @@
  * @test
  * @bug 8028553
  * @summary Test that VerifyError is not thrown when 'overriding' a static method.
+ * @modules java.base/jdk.internal.org.objectweb.asm
  * @run main FinalStatic
  */
 
diff --git a/hotspot/test/runtime/lambda-features/TestConcreteClassWithAbstractMethod.java b/hotspot/test/runtime/lambda-features/TestConcreteClassWithAbstractMethod.java
index 0fd1a42..646a094 100644
--- a/hotspot/test/runtime/lambda-features/TestConcreteClassWithAbstractMethod.java
+++ b/hotspot/test/runtime/lambda-features/TestConcreteClassWithAbstractMethod.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,6 +26,7 @@
  * @test
  * @bug 8032010
  * @summary method lookup on an abstract method in a concrete class should be successful
+ * @modules java.base/jdk.internal.org.objectweb.asm
  * @run main TestConcreteClassWithAbstractMethod
  */
 
diff --git a/hotspot/test/runtime/memory/LargePages/TestLargePageSizeInBytes.java b/hotspot/test/runtime/memory/LargePages/TestLargePageSizeInBytes.java
index 0f90d5f..356acc6 100644
--- a/hotspot/test/runtime/memory/LargePages/TestLargePageSizeInBytes.java
+++ b/hotspot/test/runtime/memory/LargePages/TestLargePageSizeInBytes.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,6 +25,8 @@
  * @summary Tests that the flag -XX:LargePageSizeInBytes does not cause warnings on Solaris
  * @bug 8049536
  * @library /testlibrary
+ * @modules java.base/sun.misc
+ *          java.management
  * @run driver TestLargePageSizeInBytes
  */
 
diff --git a/hotspot/test/runtime/memory/LargePages/TestLargePagesFlags.java b/hotspot/test/runtime/memory/LargePages/TestLargePagesFlags.java
index 58044c6..0320ce5 100644
--- a/hotspot/test/runtime/memory/LargePages/TestLargePagesFlags.java
+++ b/hotspot/test/runtime/memory/LargePages/TestLargePagesFlags.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -24,6 +24,8 @@
 /* @test TestLargePagesFlags
  * @summary Tests how large pages are choosen depending on the given large pages flag combinations.
  * @library /testlibrary
+ * @modules java.base/sun.misc
+ *          java.management
  * @run main TestLargePagesFlags
  */
 
diff --git a/hotspot/test/runtime/memory/ReadFromNoaccessArea.java b/hotspot/test/runtime/memory/ReadFromNoaccessArea.java
index 77ad2de..11e0e01 100644
--- a/hotspot/test/runtime/memory/ReadFromNoaccessArea.java
+++ b/hotspot/test/runtime/memory/ReadFromNoaccessArea.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,6 +25,8 @@
  * @test
  * @summary Test that touching noaccess area in class ReservedHeapSpace results in SIGSEGV/ACCESS_VIOLATION
  * @library /testlibrary /../../test/lib
+ * @modules java.base/sun.misc
+ *          java.management
  * @build ReadFromNoaccessArea
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
diff --git a/hotspot/test/runtime/memory/ReserveMemory.java b/hotspot/test/runtime/memory/ReserveMemory.java
index 76e6c5b..385ad6c 100644
--- a/hotspot/test/runtime/memory/ReserveMemory.java
+++ b/hotspot/test/runtime/memory/ReserveMemory.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -27,6 +27,8 @@
  * @bug 8012015
  * @summary Make sure reserved (but uncommitted) memory is not accessible
  * @library /testlibrary /../../test/lib
+ * @modules java.base/sun.misc
+ *          java.management
  * @build ReserveMemory
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
diff --git a/hotspot/test/runtime/memory/RunUnitTestsConcurrently.java b/hotspot/test/runtime/memory/RunUnitTestsConcurrently.java
index 3457666..2ee2aec 100644
--- a/hotspot/test/runtime/memory/RunUnitTestsConcurrently.java
+++ b/hotspot/test/runtime/memory/RunUnitTestsConcurrently.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,6 +25,8 @@
  * @test
  * @summary Test launches unit tests inside vm concurrently
  * @library /testlibrary /../../test/lib
+ * @modules java.base/sun.misc
+ *          java.management
  * @build RunUnitTestsConcurrently
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
diff --git a/hotspot/test/runtime/verifier/OverriderMsg.java b/hotspot/test/runtime/verifier/OverriderMsg.java
index f8c7155..8056497 100644
--- a/hotspot/test/runtime/verifier/OverriderMsg.java
+++ b/hotspot/test/runtime/verifier/OverriderMsg.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -32,6 +32,9 @@
  * @test OverriderMsg
  * @bug 8026894
  * @library /testlibrary
+ * @modules java.base/jdk.internal.org.objectweb.asm
+ *          java.base/sun.misc
+ *          java.management
  * @compile -XDignore.symbol.file OverriderMsg.java
  * @run main/othervm OverriderMsg
  */
diff --git a/hotspot/test/runtime/verifier/TestANewArray.java b/hotspot/test/runtime/verifier/TestANewArray.java
index e8f58da..d2d9d53 100644
--- a/hotspot/test/runtime/verifier/TestANewArray.java
+++ b/hotspot/test/runtime/verifier/TestANewArray.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -34,6 +34,9 @@
  * @test
  * @summary Test that anewarray bytecode is valid only if it specifies 255 or fewer dimensions.
  * @library /testlibrary
+ * @modules java.base/jdk.internal.org.objectweb.asm
+ *          java.base/sun.misc
+ *          java.management
  * @compile -XDignore.symbol.file TestANewArray.java
  * @run main/othervm TestANewArray 49
  * @run main/othervm TestANewArray 50
diff --git a/hotspot/test/runtime/verifier/TestMultiANewArray.java b/hotspot/test/runtime/verifier/TestMultiANewArray.java
index 52afd43..2d9124a 100644
--- a/hotspot/test/runtime/verifier/TestMultiANewArray.java
+++ b/hotspot/test/runtime/verifier/TestMultiANewArray.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -32,6 +32,9 @@
  * @test TestMultiANewArray
  * @bug 8038076
  * @library /testlibrary
+ * @modules java.base/jdk.internal.org.objectweb.asm
+ *          java.base/sun.misc
+ *          java.management
  * @compile -XDignore.symbol.file TestMultiANewArray.java
  * @run main/othervm TestMultiANewArray 49
  * @run main/othervm TestMultiANewArray 50
diff --git a/hotspot/test/serviceability/attach/AttachSetGetFlag.java b/hotspot/test/serviceability/attach/AttachSetGetFlag.java
index 230ef3c..a878b04 100644
--- a/hotspot/test/serviceability/attach/AttachSetGetFlag.java
+++ b/hotspot/test/serviceability/attach/AttachSetGetFlag.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,6 +26,11 @@
  * @bug 8054823
  * @summary Tests the setFlag and printFlag attach command
  * @library /testlibrary
+ * @modules java.base/sun.misc
+ *          java.compiler
+ *          java.management
+ *          jdk.attach/sun.tools.attach
+ *          jdk.jvmstat/sun.jvmstat.monitor
  * @build com.oracle.java.testlibrary.* AttachSetGetFlag
  * @run driver AttachSetGetFlag
  */
diff --git a/hotspot/test/serviceability/dcmd/compiler/CodeCacheTest.java b/hotspot/test/serviceability/dcmd/compiler/CodeCacheTest.java
index f7b4dd6..4bf8514 100644
--- a/hotspot/test/serviceability/dcmd/compiler/CodeCacheTest.java
+++ b/hotspot/test/serviceability/dcmd/compiler/CodeCacheTest.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,6 +25,10 @@
  * @test CodeCacheTest
  * @bug 8054889
  * @library /testlibrary
+ * @modules java.base/sun.misc
+ *          java.compiler
+ *          java.management
+ *          jdk.jvmstat/sun.jvmstat.monitor
  * @build com.oracle.java.testlibrary.*
  * @build com.oracle.java.testlibrary.dcmd.*
  * @run testng/othervm -XX:+SegmentedCodeCache CodeCacheTest
diff --git a/hotspot/test/serviceability/dcmd/compiler/CodelistTest.java b/hotspot/test/serviceability/dcmd/compiler/CodelistTest.java
index 57f5521..2de0847 100644
--- a/hotspot/test/serviceability/dcmd/compiler/CodelistTest.java
+++ b/hotspot/test/serviceability/dcmd/compiler/CodelistTest.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,6 +25,10 @@
  * @test CodelistTest
  * @bug 8054889
  * @library /testlibrary
+ * @modules java.base/sun.misc
+ *          java.compiler
+ *          java.management
+ *          jdk.jvmstat/sun.jvmstat.monitor
  * @build com.oracle.java.testlibrary.*
  * @build com.oracle.java.testlibrary.dcmd.*
  * @build MethodIdentifierParser
diff --git a/hotspot/test/serviceability/dcmd/compiler/CompilerQueueTest.java b/hotspot/test/serviceability/dcmd/compiler/CompilerQueueTest.java
index 0b15dce..b252e60b 100644
--- a/hotspot/test/serviceability/dcmd/compiler/CompilerQueueTest.java
+++ b/hotspot/test/serviceability/dcmd/compiler/CompilerQueueTest.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,6 +25,10 @@
  * @test CompilerQueueTest
  * @bug 8054889
  * @library /testlibrary
+ * @modules java.base/sun.misc
+ *          java.compiler
+ *          java.management
+ *          jdk.jvmstat/sun.jvmstat.monitor
  * @ignore 8069160
  * @build com.oracle.java.testlibrary.*
  * @build com.oracle.java.testlibrary.dcmd.*
diff --git a/hotspot/test/serviceability/dcmd/framework/HelpTest.java b/hotspot/test/serviceability/dcmd/framework/HelpTest.java
index 323dae7..05e9c84 100644
--- a/hotspot/test/serviceability/dcmd/framework/HelpTest.java
+++ b/hotspot/test/serviceability/dcmd/framework/HelpTest.java
@@ -33,6 +33,10 @@
  * @test
  * @summary Test of diagnostic command help (tests all DCMD executors)
  * @library /testlibrary
+ * @modules java.base/sun.misc
+ *          java.compiler
+ *          java.management
+ *          jdk.jvmstat/sun.jvmstat.monitor
  * @ignore 8072440
  * @build com.oracle.java.testlibrary.*
  * @build com.oracle.java.testlibrary.dcmd.*
diff --git a/hotspot/test/serviceability/dcmd/framework/InvalidCommandTest.java b/hotspot/test/serviceability/dcmd/framework/InvalidCommandTest.java
index 8c5d68c..f198fdb 100644
--- a/hotspot/test/serviceability/dcmd/framework/InvalidCommandTest.java
+++ b/hotspot/test/serviceability/dcmd/framework/InvalidCommandTest.java
@@ -33,6 +33,10 @@
  * @test
  * @summary Test of invalid diagnostic command (tests all DCMD executors)
  * @library /testlibrary
+ * @modules java.base/sun.misc
+ *          java.compiler
+ *          java.management
+ *          jdk.jvmstat/sun.jvmstat.monitor
  * @ignore 8072440
  * @build com.oracle.java.testlibrary.*
  * @build com.oracle.java.testlibrary.dcmd.*
diff --git a/hotspot/test/serviceability/dcmd/framework/VMVersionTest.java b/hotspot/test/serviceability/dcmd/framework/VMVersionTest.java
index 8d0f2ea..d7896d8 100644
--- a/hotspot/test/serviceability/dcmd/framework/VMVersionTest.java
+++ b/hotspot/test/serviceability/dcmd/framework/VMVersionTest.java
@@ -34,6 +34,10 @@
  * @test
  * @summary Test of diagnostic command VM.version (tests all DCMD executors)
  * @library /testlibrary
+ * @modules java.base/sun.misc
+ *          java.compiler
+ *          java.management
+ *          jdk.jvmstat/sun.jvmstat.monitor
  * @ignore 8072440
  * @build com.oracle.java.testlibrary.*
  * @build com.oracle.java.testlibrary.dcmd.*
diff --git a/hotspot/test/serviceability/dcmd/gc/ClassHistogramAllTest.java b/hotspot/test/serviceability/dcmd/gc/ClassHistogramAllTest.java
index f205dec..a59fffd 100644
--- a/hotspot/test/serviceability/dcmd/gc/ClassHistogramAllTest.java
+++ b/hotspot/test/serviceability/dcmd/gc/ClassHistogramAllTest.java
@@ -25,6 +25,10 @@
  * @test
  * @summary Test of diagnostic command GC.class_histogram -all=true
  * @library /testlibrary
+ * @modules java.base/sun.misc
+ *          java.compiler
+ *          java.management
+ *          jdk.jvmstat/sun.jvmstat.monitor
  * @build com.oracle.java.testlibrary.*
  * @build com.oracle.java.testlibrary.dcmd.*
  * @build ClassHistogramTest
diff --git a/hotspot/test/serviceability/dcmd/gc/ClassHistogramTest.java b/hotspot/test/serviceability/dcmd/gc/ClassHistogramTest.java
index a4f618a..a3f19ab 100644
--- a/hotspot/test/serviceability/dcmd/gc/ClassHistogramTest.java
+++ b/hotspot/test/serviceability/dcmd/gc/ClassHistogramTest.java
@@ -33,6 +33,10 @@
  * @test
  * @summary Test of diagnostic command GC.class_histogram
  * @library /testlibrary
+ * @modules java.base/sun.misc
+ *          java.compiler
+ *          java.management
+ *          jdk.jvmstat/sun.jvmstat.monitor
  * @build com.oracle.java.testlibrary.*
  * @build com.oracle.java.testlibrary.dcmd.*
  * @run testng ClassHistogramTest
diff --git a/hotspot/test/serviceability/dcmd/gc/HeapDumpAllTest.java b/hotspot/test/serviceability/dcmd/gc/HeapDumpAllTest.java
index 4894200..0872987 100644
--- a/hotspot/test/serviceability/dcmd/gc/HeapDumpAllTest.java
+++ b/hotspot/test/serviceability/dcmd/gc/HeapDumpAllTest.java
@@ -25,6 +25,10 @@
  * @test
  * @summary Test of diagnostic command GC.heap_dump -all=true
  * @library /testlibrary
+ * @modules java.base/sun.misc
+ *          java.compiler
+ *          java.management
+ *          jdk.jvmstat/sun.jvmstat.monitor
  * @build com.oracle.java.testlibrary.*
  * @build com.oracle.java.testlibrary.dcmd.*
  * @build HeapDumpTest
diff --git a/hotspot/test/serviceability/dcmd/gc/HeapDumpTest.java b/hotspot/test/serviceability/dcmd/gc/HeapDumpTest.java
index 132f9a2..a662cdf 100644
--- a/hotspot/test/serviceability/dcmd/gc/HeapDumpTest.java
+++ b/hotspot/test/serviceability/dcmd/gc/HeapDumpTest.java
@@ -35,6 +35,10 @@
  * @test
  * @summary Test of diagnostic command GC.heap_dump
  * @library /testlibrary
+ * @modules java.base/sun.misc
+ *          java.compiler
+ *          java.management
+ *          jdk.jvmstat/sun.jvmstat.monitor
  * @build com.oracle.java.testlibrary.*
  * @build com.oracle.java.testlibrary.dcmd.*
  * @run testng HeapDumpTest
diff --git a/hotspot/test/serviceability/dcmd/gc/RunFinalizationTest.java b/hotspot/test/serviceability/dcmd/gc/RunFinalizationTest.java
index 6e8f466..48c5987 100644
--- a/hotspot/test/serviceability/dcmd/gc/RunFinalizationTest.java
+++ b/hotspot/test/serviceability/dcmd/gc/RunFinalizationTest.java
@@ -35,6 +35,10 @@
  * @test
  * @summary Test of diagnostic command GC.run_finalization
  * @library /testlibrary
+ * @modules java.base/sun.misc
+ *          java.compiler
+ *          java.management
+ *          jdk.jvmstat/sun.jvmstat.monitor
  * @build com.oracle.java.testlibrary.*
  * @build com.oracle.java.testlibrary.dcmd.*
  * @run testng RunFinalizationTest
diff --git a/hotspot/test/serviceability/dcmd/gc/RunGCTest.java b/hotspot/test/serviceability/dcmd/gc/RunGCTest.java
index ec135bb..7773e1a 100644
--- a/hotspot/test/serviceability/dcmd/gc/RunGCTest.java
+++ b/hotspot/test/serviceability/dcmd/gc/RunGCTest.java
@@ -37,6 +37,10 @@
  * @test
  * @summary Test of diagnostic command GC.run
  * @library /testlibrary
+ * @modules java.base/sun.misc
+ *          java.compiler
+ *          java.management
+ *          jdk.jvmstat/sun.jvmstat.monitor
  * @build com.oracle.java.testlibrary.*
  * @build com.oracle.java.testlibrary.dcmd.*
  * @run testng/othervm -XX:+PrintGCDetails -Xloggc:RunGC.gclog -XX:-ExplicitGCInvokesConcurrent RunGCTest
diff --git a/hotspot/test/serviceability/dcmd/thread/PrintConcurrentLocksTest.java b/hotspot/test/serviceability/dcmd/thread/PrintConcurrentLocksTest.java
index 8d9b8d8..3904f40 100644
--- a/hotspot/test/serviceability/dcmd/thread/PrintConcurrentLocksTest.java
+++ b/hotspot/test/serviceability/dcmd/thread/PrintConcurrentLocksTest.java
@@ -25,6 +25,10 @@
  * @test
  * @summary Test of diagnostic command Thread.print -l=true
  * @library /testlibrary
+ * @modules java.base/sun.misc
+ *          java.compiler
+ *          java.management
+ *          jdk.jvmstat/sun.jvmstat.monitor
  * @build com.oracle.java.testlibrary.*
  * @build com.oracle.java.testlibrary.dcmd.*
  * @build PrintTest
diff --git a/hotspot/test/serviceability/dcmd/thread/PrintTest.java b/hotspot/test/serviceability/dcmd/thread/PrintTest.java
index faf1a71..c678144 100644
--- a/hotspot/test/serviceability/dcmd/thread/PrintTest.java
+++ b/hotspot/test/serviceability/dcmd/thread/PrintTest.java
@@ -38,6 +38,10 @@
  * @test
  * @summary Test of diagnostic command Thread.print
  * @library /testlibrary
+ * @modules java.base/sun.misc
+ *          java.compiler
+ *          java.management
+ *          jdk.jvmstat/sun.jvmstat.monitor
  * @build com.oracle.java.testlibrary.*
  * @build com.oracle.java.testlibrary.dcmd.*
  * @run testng PrintTest
diff --git a/hotspot/test/serviceability/dcmd/vm/ClassHierarchyTest.java b/hotspot/test/serviceability/dcmd/vm/ClassHierarchyTest.java
index e0c9c88..d526406 100644
--- a/hotspot/test/serviceability/dcmd/vm/ClassHierarchyTest.java
+++ b/hotspot/test/serviceability/dcmd/vm/ClassHierarchyTest.java
@@ -25,6 +25,10 @@
  * @test
  * @summary Test of diagnostic command VM.class_hierarchy
  * @library /testlibrary
+ * @modules java.base/sun.misc
+ *          java.compiler
+ *          java.management
+ *          jdk.jvmstat/sun.jvmstat.monitor
  * @build com.oracle.java.testlibrary.*
  * @build com.oracle.java.testlibrary.dcmd.*
  * @run testng ClassHierarchyTest
diff --git a/hotspot/test/serviceability/dcmd/vm/ClassLoaderStatsTest.java b/hotspot/test/serviceability/dcmd/vm/ClassLoaderStatsTest.java
index 50c4f6c..68bda40 100644
--- a/hotspot/test/serviceability/dcmd/vm/ClassLoaderStatsTest.java
+++ b/hotspot/test/serviceability/dcmd/vm/ClassLoaderStatsTest.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,6 +25,10 @@
  * @test
  * @summary Test of diagnostic command VM.classloader_stats
  * @library /testlibrary
+ * @modules java.base/sun.misc
+ *          java.compiler
+ *          java.management
+ *          jdk.jvmstat/sun.jvmstat.monitor
  * @build com.oracle.java.testlibrary.*
  * @build com.oracle.java.testlibrary.dcmd.*
  * @run testng ClassLoaderStatsTest
diff --git a/hotspot/test/serviceability/dcmd/vm/CommandLineTest.java b/hotspot/test/serviceability/dcmd/vm/CommandLineTest.java
index cf22153..0caeba2 100644
--- a/hotspot/test/serviceability/dcmd/vm/CommandLineTest.java
+++ b/hotspot/test/serviceability/dcmd/vm/CommandLineTest.java
@@ -31,6 +31,10 @@
  * @test
  * @summary Test of diagnostic command VM.command_line
  * @library /testlibrary
+ * @modules java.base/sun.misc
+ *          java.compiler
+ *          java.management
+ *          jdk.jvmstat/sun.jvmstat.monitor
  * @build com.oracle.java.testlibrary.*
  * @build com.oracle.java.testlibrary.dcmd.*
  * @run testng/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+ThereShouldNotBeAnyVMOptionNamedLikeThis CommandLineTest
diff --git a/hotspot/test/serviceability/dcmd/vm/DynLibsTest.java b/hotspot/test/serviceability/dcmd/vm/DynLibsTest.java
index 3f8c8ddf..e26d7b0 100644
--- a/hotspot/test/serviceability/dcmd/vm/DynLibsTest.java
+++ b/hotspot/test/serviceability/dcmd/vm/DynLibsTest.java
@@ -33,6 +33,10 @@
  * @test
  * @summary Test of VM.dynlib diagnostic command via MBean
  * @library /testlibrary
+ * @modules java.base/sun.misc
+ *          java.compiler
+ *          java.management
+ *          jdk.jvmstat/sun.jvmstat.monitor
  * @build com.oracle.java.testlibrary.*
  * @build com.oracle.java.testlibrary.dcmd.*
  * @run testng DynLibsTest
diff --git a/hotspot/test/serviceability/dcmd/vm/FlagsTest.java b/hotspot/test/serviceability/dcmd/vm/FlagsTest.java
index 960104e..ed57bfb 100644
--- a/hotspot/test/serviceability/dcmd/vm/FlagsTest.java
+++ b/hotspot/test/serviceability/dcmd/vm/FlagsTest.java
@@ -30,6 +30,10 @@
  * @test
  * @summary Test of diagnostic command VM.flags
  * @library /testlibrary
+ * @modules java.base/sun.misc
+ *          java.compiler
+ *          java.management
+ *          jdk.jvmstat/sun.jvmstat.monitor
  * @build com.oracle.java.testlibrary.*
  * @build com.oracle.java.testlibrary.dcmd.*
  * @run testng/othervm -Xmx129m -XX:+PrintGC -XX:+UnlockDiagnosticVMOptions -XX:+IgnoreUnrecognizedVMOptions -XX:+ThereShouldNotBeAnyVMOptionNamedLikeThis_Right -XX:-TieredCompilation FlagsTest
diff --git a/hotspot/test/serviceability/dcmd/vm/SystemPropertiesTest.java b/hotspot/test/serviceability/dcmd/vm/SystemPropertiesTest.java
index 8b21ae9..cae33cd 100644
--- a/hotspot/test/serviceability/dcmd/vm/SystemPropertiesTest.java
+++ b/hotspot/test/serviceability/dcmd/vm/SystemPropertiesTest.java
@@ -31,6 +31,10 @@
  * @test
  * @summary Test of diagnostic command VM.system_properties
  * @library /testlibrary
+ * @modules java.base/sun.misc
+ *          java.compiler
+ *          java.management
+ *          jdk.jvmstat/sun.jvmstat.monitor
  * @build com.oracle.java.testlibrary.*
  * @build com.oracle.java.testlibrary.dcmd.*
  * @run testng SystemPropertiesTest
diff --git a/hotspot/test/serviceability/dcmd/vm/UptimeTest.java b/hotspot/test/serviceability/dcmd/vm/UptimeTest.java
index b646f57..4da1aad 100644
--- a/hotspot/test/serviceability/dcmd/vm/UptimeTest.java
+++ b/hotspot/test/serviceability/dcmd/vm/UptimeTest.java
@@ -35,6 +35,10 @@
  * @test
  * @summary Test of diagnostic command VM.uptime
  * @library /testlibrary
+ * @modules java.base/sun.misc
+ *          java.compiler
+ *          java.management
+ *          jdk.jvmstat/sun.jvmstat.monitor
  * @build com.oracle.java.testlibrary.*
  * @build com.oracle.java.testlibrary.dcmd.*
  * @run testng UptimeTest
diff --git a/hotspot/test/serviceability/jvmti/GetObjectSizeOverflow.java b/hotspot/test/serviceability/jvmti/GetObjectSizeOverflow.java
index 9acefe5..eeb5dd4 100644
--- a/hotspot/test/serviceability/jvmti/GetObjectSizeOverflow.java
+++ b/hotspot/test/serviceability/jvmti/GetObjectSizeOverflow.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -29,6 +29,11 @@
  * @test
  * @bug 8027230
  * @library /testlibrary
+ * @modules java.base/sun.misc
+ *          java.compiler
+ *          java.instrument
+ *          java.management
+ *          jdk.jvmstat/sun.jvmstat.monitor
  * @build ClassFileInstaller com.oracle.java.testlibrary.* GetObjectSizeOverflowAgent
  * @run main ClassFileInstaller GetObjectSizeOverflowAgent
  * @run main GetObjectSizeOverflow
diff --git a/hotspot/test/serviceability/jvmti/TestLambdaFormRetransformation.java b/hotspot/test/serviceability/jvmti/TestLambdaFormRetransformation.java
index 9ba16d8..6e1777d 100644
--- a/hotspot/test/serviceability/jvmti/TestLambdaFormRetransformation.java
+++ b/hotspot/test/serviceability/jvmti/TestLambdaFormRetransformation.java
@@ -27,6 +27,10 @@
  * @bug 8008678
  * @summary JSR 292: constant pool reconstitution must support pseudo strings
  * @library /testlibrary
+ * @modules java.base/sun.misc
+ *          java.instrument
+ *          java.management
+ *          jdk.jartool/sun.tools.jar
  * @compile -XDignore.symbol.file TestLambdaFormRetransformation.java
  * @run main TestLambdaFormRetransformation
  */
diff --git a/hotspot/test/serviceability/jvmti/TestRedefineWithUnresolvedClass.java b/hotspot/test/serviceability/jvmti/TestRedefineWithUnresolvedClass.java
index 14ffea9..fc62079 100644
--- a/hotspot/test/serviceability/jvmti/TestRedefineWithUnresolvedClass.java
+++ b/hotspot/test/serviceability/jvmti/TestRedefineWithUnresolvedClass.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,6 +26,12 @@
  * @summary Redefine a class with an UnresolvedClass reference in the constant pool.
  * @bug 8035150
  * @library /testlibrary
+ * @modules java.base/sun.misc
+ *          java.compiler
+ *          java.instrument
+ *          java.management
+ *          jdk.jartool/sun.tools.jar
+ *          jdk.jvmstat/sun.jvmstat.monitor
  * @build com.oracle.java.testlibrary.* UnresolvedClassAgent
  * @run main TestRedefineWithUnresolvedClass
  */
diff --git a/hotspot/test/serviceability/sa/jmap-hashcode/Test8028623.java b/hotspot/test/serviceability/sa/jmap-hashcode/Test8028623.java
index 169c043..fd014e3 100644
--- a/hotspot/test/serviceability/sa/jmap-hashcode/Test8028623.java
+++ b/hotspot/test/serviceability/sa/jmap-hashcode/Test8028623.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,6 +26,10 @@
  * @bug 8028623
  * @summary Test hashing of extended characters in Serviceability Agent.
  * @library /testlibrary
+ * @modules java.base/sun.misc
+ *          java.compiler
+ *          java.management
+ *          jdk.jvmstat/sun.jvmstat.monitor
  * @ignore 8044416
  * @build com.oracle.java.testlibrary.*
  * @compile -encoding utf8 Test8028623.java
diff --git a/hotspot/test/serviceability/sa/jmap-hprof/JMapHProfLargeHeapTest.java b/hotspot/test/serviceability/sa/jmap-hprof/JMapHProfLargeHeapTest.java
index eeeecba..47fcc3f 100644
--- a/hotspot/test/serviceability/sa/jmap-hprof/JMapHProfLargeHeapTest.java
+++ b/hotspot/test/serviceability/sa/jmap-hprof/JMapHProfLargeHeapTest.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -44,6 +44,10 @@
  * @key regression
  * @summary Regression test for hprof export issue due to large heaps (>2G)
  * @library /testlibrary
+ * @modules java.base/sun.misc
+ *          java.compiler
+ *          java.management/sun.management
+ *          jdk.jvmstat/sun.jvmstat.monitor
  * @build com.oracle.java.testlibrary.* JMapHProfLargeHeapProc
  * @run main JMapHProfLargeHeapTest
  */
diff --git a/hotspot/test/testlibrary_tests/OutputAnalyzerReportingTest.java b/hotspot/test/testlibrary_tests/OutputAnalyzerReportingTest.java
index 068f193..008f828 100644
--- a/hotspot/test/testlibrary_tests/OutputAnalyzerReportingTest.java
+++ b/hotspot/test/testlibrary_tests/OutputAnalyzerReportingTest.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -28,6 +28,8 @@
  *     such as printing additional diagnostic info
  *     (exit code, stdout, stderr, command line, etc.)
  * @library /testlibrary
+ * @modules java.base/sun.misc
+ *          java.management
  */
 
 import java.io.ByteArrayOutputStream;
diff --git a/hotspot/test/testlibrary_tests/OutputAnalyzerTest.java b/hotspot/test/testlibrary_tests/OutputAnalyzerTest.java
index 2fd6777..463ec98 100644
--- a/hotspot/test/testlibrary_tests/OutputAnalyzerTest.java
+++ b/hotspot/test/testlibrary_tests/OutputAnalyzerTest.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,6 +25,8 @@
  * @test
  * @summary Test the OutputAnalyzer utility class
  * @library /testlibrary
+ * @modules java.base/sun.misc
+ *          java.management
  */
 
 import com.oracle.java.testlibrary.OutputAnalyzer;
diff --git a/hotspot/test/testlibrary_tests/RandomGeneratorTest.java b/hotspot/test/testlibrary_tests/RandomGeneratorTest.java
index 84103c3..253495c 100644
--- a/hotspot/test/testlibrary_tests/RandomGeneratorTest.java
+++ b/hotspot/test/testlibrary_tests/RandomGeneratorTest.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,6 +25,8 @@
  * @test
  * @summary Verify correctnes of the random generator from Utility.java
  * @library /testlibrary
+ * @modules java.base/sun.misc
+ *          java.management
  * @run driver RandomGeneratorTest SAME_SEED
  * @run driver RandomGeneratorTest NO_SEED
  * @run driver RandomGeneratorTest DIFFERENT_SEED
diff --git a/hotspot/test/testlibrary_tests/RedefineClassTest.java b/hotspot/test/testlibrary_tests/RedefineClassTest.java
index e812e43..c57e86e 100644
--- a/hotspot/test/testlibrary_tests/RedefineClassTest.java
+++ b/hotspot/test/testlibrary_tests/RedefineClassTest.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,6 +25,9 @@
  * @test
  * @library /testlibrary
  * @summary Proof of concept test for RedefineClassHelper
+ * @modules java.compiler
+ *          java.instrument
+ *          jdk.jartool/sun.tools.jar
  * @build RedefineClassHelper
  * @run main RedefineClassHelper
  * @run main/othervm -javaagent:redefineagent.jar RedefineClassTest
diff --git a/hotspot/test/testlibrary_tests/TestMutuallyExclusivePlatformPredicates.java b/hotspot/test/testlibrary_tests/TestMutuallyExclusivePlatformPredicates.java
index 1f022a9..bf33c25 100644
--- a/hotspot/test/testlibrary_tests/TestMutuallyExclusivePlatformPredicates.java
+++ b/hotspot/test/testlibrary_tests/TestMutuallyExclusivePlatformPredicates.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -39,6 +39,8 @@
  *          in com.oracle.java.testlibrary.Platform one and only one predicate
  *          evaluates to true.
  * @library /testlibrary
+ * @modules java.base/sun.misc
+ *          java.management
  * @run main TestMutuallyExclusivePlatformPredicates
  */
 public class TestMutuallyExclusivePlatformPredicates {
diff --git a/hotspot/test/testlibrary_tests/TestPlatformIsTieredSupported.java b/hotspot/test/testlibrary_tests/TestPlatformIsTieredSupported.java
index 9caa869..51931dc 100644
--- a/hotspot/test/testlibrary_tests/TestPlatformIsTieredSupported.java
+++ b/hotspot/test/testlibrary_tests/TestPlatformIsTieredSupported.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -29,6 +29,8 @@
  * @test
  * @summary Verifies that Platform::isTieredSupported returns correct value.
  * @library /testlibrary /../../test/lib
+ * @modules java.base/sun.misc
+ *          java.management
  * @build TestPlatformIsTieredSupported
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
diff --git a/hotspot/test/testlibrary_tests/ctw/ClassesDirTest.java b/hotspot/test/testlibrary_tests/ctw/ClassesDirTest.java
index 656f364..dce204f 100644
--- a/hotspot/test/testlibrary_tests/ctw/ClassesDirTest.java
+++ b/hotspot/test/testlibrary_tests/ctw/ClassesDirTest.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,6 +25,9 @@
  * @test
  * @bug 8012447
  * @library /testlibrary /../../test/lib /testlibrary/ctw/src
+ * @modules java.base/sun.misc
+ *          java.base/sun.reflect
+ *          java.management
  * @build ClassFileInstaller sun.hotspot.tools.ctw.CompileTheWorld sun.hotspot.WhiteBox Foo Bar
  * @run main ClassFileInstaller sun.hotspot.WhiteBox Foo Bar
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
diff --git a/hotspot/test/testlibrary_tests/ctw/ClassesListTest.java b/hotspot/test/testlibrary_tests/ctw/ClassesListTest.java
index 8c92fb0..7d33504 100644
--- a/hotspot/test/testlibrary_tests/ctw/ClassesListTest.java
+++ b/hotspot/test/testlibrary_tests/ctw/ClassesListTest.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,6 +25,9 @@
  * @test
  * @bug 8012447
  * @library /testlibrary /../../test/lib /testlibrary/ctw/src
+ * @modules java.base/sun.misc
+ *          java.base/sun.reflect
+ *          java.management
  * @build ClassFileInstaller sun.hotspot.tools.ctw.CompileTheWorld sun.hotspot.WhiteBox Foo Bar
  * @run main ClassFileInstaller sun.hotspot.WhiteBox Foo Bar
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
diff --git a/hotspot/test/testlibrary_tests/ctw/JarDirTest.java b/hotspot/test/testlibrary_tests/ctw/JarDirTest.java
index fef89f8..6d31da6 100644
--- a/hotspot/test/testlibrary_tests/ctw/JarDirTest.java
+++ b/hotspot/test/testlibrary_tests/ctw/JarDirTest.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,6 +25,11 @@
  * @test
  * @bug 8012447
  * @library /testlibrary /../../test/lib /testlibrary/ctw/src
+ * @modules java.base/sun.misc
+ *          java.base/sun.reflect
+ *          java.compiler
+ *          java.management
+ *          jdk.jvmstat/sun.jvmstat.monitor
  * @build ClassFileInstaller com.oracle.java.testlibrary.* sun.hotspot.tools.ctw.CompileTheWorld sun.hotspot.WhiteBox Foo Bar
  * @run main ClassFileInstaller sun.hotspot.WhiteBox Foo Bar
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
diff --git a/hotspot/test/testlibrary_tests/ctw/JarsTest.java b/hotspot/test/testlibrary_tests/ctw/JarsTest.java
index 277cc1f..f58465d 100644
--- a/hotspot/test/testlibrary_tests/ctw/JarsTest.java
+++ b/hotspot/test/testlibrary_tests/ctw/JarsTest.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,6 +25,11 @@
  * @test
  * @bug 8012447
  * @library /testlibrary /../../test/lib /testlibrary/ctw/src
+ * @modules java.base/sun.misc
+ *          java.base/sun.reflect
+ *          java.compiler
+ *          java.management
+ *          jdk.jvmstat/sun.jvmstat.monitor
  * @build ClassFileInstaller com.oracle.java.testlibrary.* sun.hotspot.tools.ctw.CompileTheWorld sun.hotspot.WhiteBox Foo Bar
  * @run main ClassFileInstaller sun.hotspot.WhiteBox Foo Bar
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
diff --git a/hotspot/test/testlibrary_tests/whitebox/vm_flags/BooleanTest.java b/hotspot/test/testlibrary_tests/whitebox/vm_flags/BooleanTest.java
index 1857c58..c6c750f 100644
--- a/hotspot/test/testlibrary_tests/whitebox/vm_flags/BooleanTest.java
+++ b/hotspot/test/testlibrary_tests/whitebox/vm_flags/BooleanTest.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,6 +25,10 @@
  * @test BooleanTest
  * @bug 8028756
  * @library /testlibrary /../../test/lib
+ * @modules java.base/sun.misc
+ *          java.compiler
+ *          java.management/sun.management
+ *          jdk.jvmstat/sun.jvmstat.monitor
  * @build BooleanTest ClassFileInstaller sun.hotspot.WhiteBox com.oracle.java.testlibrary.*
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
diff --git a/hotspot/test/testlibrary_tests/whitebox/vm_flags/DoubleTest.java b/hotspot/test/testlibrary_tests/whitebox/vm_flags/DoubleTest.java
index d9cff2f..2bb93a1 100644
--- a/hotspot/test/testlibrary_tests/whitebox/vm_flags/DoubleTest.java
+++ b/hotspot/test/testlibrary_tests/whitebox/vm_flags/DoubleTest.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,6 +25,7 @@
  * @test DoubleTest
  * @bug 8028756
  * @library /testlibrary /../../test/lib
+ * @modules java.management/sun.management
  * @build DoubleTest
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
diff --git a/hotspot/test/testlibrary_tests/whitebox/vm_flags/IntxTest.java b/hotspot/test/testlibrary_tests/whitebox/vm_flags/IntxTest.java
index dc37d7a..ab49784 100644
--- a/hotspot/test/testlibrary_tests/whitebox/vm_flags/IntxTest.java
+++ b/hotspot/test/testlibrary_tests/whitebox/vm_flags/IntxTest.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,6 +25,7 @@
  * @test IntxTest
  * @bug 8028756
  * @library /testlibrary /../../test/lib
+ * @modules java.management/sun.management
  * @build IntxTest
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
diff --git a/hotspot/test/testlibrary_tests/whitebox/vm_flags/SizeTTest.java b/hotspot/test/testlibrary_tests/whitebox/vm_flags/SizeTTest.java
index 9696bd3..ac910a4 100644
--- a/hotspot/test/testlibrary_tests/whitebox/vm_flags/SizeTTest.java
+++ b/hotspot/test/testlibrary_tests/whitebox/vm_flags/SizeTTest.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,6 +25,8 @@
  * @test SizeTTest
  * @bug 8054823
  * @library /testlibrary /../../test/lib
+ * @modules java.base/sun.misc
+ *          java.management/sun.management
  * @build SizeTTest
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
diff --git a/hotspot/test/testlibrary_tests/whitebox/vm_flags/StringTest.java b/hotspot/test/testlibrary_tests/whitebox/vm_flags/StringTest.java
index ae26e37..e085c69 100644
--- a/hotspot/test/testlibrary_tests/whitebox/vm_flags/StringTest.java
+++ b/hotspot/test/testlibrary_tests/whitebox/vm_flags/StringTest.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,6 +25,7 @@
  * @test StringTest
  * @bug 8028756
  * @library /testlibrary /../../test/lib
+ * @modules java.management/sun.management
  * @build StringTest
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
diff --git a/hotspot/test/testlibrary_tests/whitebox/vm_flags/Uint64Test.java b/hotspot/test/testlibrary_tests/whitebox/vm_flags/Uint64Test.java
index 7ab5f31..c81667e 100644
--- a/hotspot/test/testlibrary_tests/whitebox/vm_flags/Uint64Test.java
+++ b/hotspot/test/testlibrary_tests/whitebox/vm_flags/Uint64Test.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,6 +25,7 @@
  * @test Uint64Test
  * @bug 8028756
  * @library /testlibrary /../../test/lib
+ * @modules java.management/sun.management
  * @build Uint64Test
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
diff --git a/hotspot/test/testlibrary_tests/whitebox/vm_flags/UintxTest.java b/hotspot/test/testlibrary_tests/whitebox/vm_flags/UintxTest.java
index 469ecc2..65ec0c3 100644
--- a/hotspot/test/testlibrary_tests/whitebox/vm_flags/UintxTest.java
+++ b/hotspot/test/testlibrary_tests/whitebox/vm_flags/UintxTest.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,6 +25,8 @@
  * @test UintxTest
  * @bug 8028756
  * @library /testlibrary /../../test/lib
+ * @modules java.base/sun.misc
+ *          java.management/sun.management
  * @build UintxTest
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
diff --git a/jaxp/.hgtags b/jaxp/.hgtags
index b41df1c..a71188f 100644
--- a/jaxp/.hgtags
+++ b/jaxp/.hgtags
@@ -300,3 +300,4 @@
 2a460ce60ed47081f756f0cc0321d8e9ba7cac17 jdk9-b55
 139092a10dedd32bc1155e40c67a6ef682e39873 jdk9-b56
 2c417f7d7b0dc98e887474884aa39f974894f0c2 jdk9-b57
+270fb9a2dcb5ff3ef95da6d529fa35187026af0a jdk9-b58
diff --git a/jaxp/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/runtime/BasisLibrary.java b/jaxp/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/runtime/BasisLibrary.java
index 8d05e9e..242e2ff 100644
--- a/jaxp/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/runtime/BasisLibrary.java
+++ b/jaxp/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/runtime/BasisLibrary.java
@@ -270,7 +270,7 @@
         if (Double.isNaN(start))
             return(EMPTYSTRING);
 
-        final int strlen = value.length();
+        final int strlen = getStringLength(value);
         int istart = (int)Math.round(start) - 1;
 
         if (istart > strlen)
@@ -278,6 +278,7 @@
         if (istart < 1)
             istart = 0;
         try {
+            istart = value.offsetByCodePoints(0, istart);
             return value.substring(istart);
         } catch (IndexOutOfBoundsException e) {
             runTimeError(RUN_TIME_INTERNAL_ERR, "substring()");
@@ -297,24 +298,30 @@
             return(EMPTYSTRING);
 
         int istart = (int)Math.round(start) - 1;
+        int ilength = (int)Math.round(length);
         final int isum;
         if (Double.isInfinite(length))
             isum = Integer.MAX_VALUE;
         else
-            isum = istart + (int)Math.round(length);
+            isum = istart + ilength;
 
-        final int strlen = value.length();
+        final int strlen = getStringLength(value);
         if (isum < 0 || istart > strlen)
                 return(EMPTYSTRING);
 
-        if (istart < 0)
+        if (istart < 0) {
+            ilength += istart;
             istart = 0;
+        }
 
         try {
-            if (isum > strlen)
+            istart = value.offsetByCodePoints(0, istart);
+            if (isum > strlen) {
                 return value.substring(istart);
-            else
-                return value.substring(istart, isum);
+            } else {
+                int offset = value.offsetByCodePoints(istart, ilength);
+                return value.substring(istart, offset);
+            }
         } catch (IndexOutOfBoundsException e) {
             runTimeError(RUN_TIME_INTERNAL_ERR, "substring()");
             return null;
diff --git a/jaxp/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/XMLDTDScannerImpl.java b/jaxp/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/XMLDTDScannerImpl.java
index 74db88c..9bb176c 100644
--- a/jaxp/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/XMLDTDScannerImpl.java
+++ b/jaxp/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/XMLDTDScannerImpl.java
@@ -1417,7 +1417,7 @@
             // AttValue
             boolean isVC = !fStandalone  &&  (fSeenExternalDTD || fSeenExternalPE) ;
             scanAttributeValue(defaultVal, nonNormalizedDefaultVal, atName,
-            fAttributes, 0, isVC);
+            fAttributes, 0, isVC, elName);
         }
         return defaultType;
 
diff --git a/jaxp/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/XMLDocumentFragmentScannerImpl.java b/jaxp/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/XMLDocumentFragmentScannerImpl.java
index 1d599a7..6b49a14 100644
--- a/jaxp/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/XMLDocumentFragmentScannerImpl.java
+++ b/jaxp/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/XMLDocumentFragmentScannerImpl.java
@@ -1547,7 +1547,7 @@
 
         scanAttributeValue(tmpStr, fTempString2,
                 fAttributeQName.rawname, attributes,
-                attIndex, isVC);
+                attIndex, isVC, fCurrentElement.rawname);
 
         // content
         int oldLen = attributes.getLength();
diff --git a/jaxp/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/XMLNSDocumentScannerImpl.java b/jaxp/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/XMLNSDocumentScannerImpl.java
index ab2a341..a4fb84f 100644
--- a/jaxp/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/XMLNSDocumentScannerImpl.java
+++ b/jaxp/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/XMLNSDocumentScannerImpl.java
@@ -437,7 +437,7 @@
         XMLString tmpStr = getString();
         scanAttributeValue(tmpStr, fTempString2,
                 fAttributeQName.rawname, attributes,
-                attrIndex, isVC);
+                attrIndex, isVC, fCurrentElement.rawname);
 
         String value = null;
         //fTempString.toString();
diff --git a/jaxp/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/XMLScanner.java b/jaxp/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/XMLScanner.java
index 58700e2..97e5d2b 100644
--- a/jaxp/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/XMLScanner.java
+++ b/jaxp/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/XMLScanner.java
@@ -811,6 +811,7 @@
      * @param attrIndex The index of the attribute to use from the list.
      * @param checkEntities true if undeclared entities should be reported as VC violation,
      *                      false if undeclared entities should be reported as WFC violation.
+     * @param eleName The name of element to which this attribute belongs.
      *
      * <strong>Note:</strong> This method uses fStringBuffer2, anything in it
      * at the time of calling is lost.
@@ -819,13 +820,13 @@
             XMLString nonNormalizedValue,
             String atName,
             XMLAttributes attributes, int attrIndex,
-            boolean checkEntities)
+            boolean checkEntities, String eleName)
             throws IOException, XNIException {
         XMLStringBuffer stringBuffer = null;
         // quote
         int quote = fEntityScanner.peekChar();
         if (quote != '\'' && quote != '"') {
-            reportFatalError("OpenQuoteExpected", new Object[]{atName});
+            reportFatalError("OpenQuoteExpected", new Object[]{eleName, atName});
         }
 
         fEntityScanner.scanChar();
@@ -951,7 +952,7 @@
                     }
                 } else if (c == '<') {
                     reportFatalError("LessthanInAttValue",
-                            new Object[] { null, atName });
+                            new Object[] { eleName, atName });
                             fEntityScanner.scanChar();
                             if (entityDepth == fEntityDepth && fNeedNonNormalizedValue) {
                                 fStringBuffer2.append((char)c);
@@ -987,7 +988,7 @@
                     }
                 } else if (c != -1 && isInvalidLiteral(c)) {
                     reportFatalError("InvalidCharInAttValue",
-                            new Object[] {Integer.toString(c, 16)});
+                            new Object[] {eleName, atName, Integer.toString(c, 16)});
                             fEntityScanner.scanChar();
                             if (entityDepth == fEntityDepth && fNeedNonNormalizedValue) {
                                 fStringBuffer2.append((char)c);
@@ -1016,7 +1017,7 @@
         // quote
         int cquote = fEntityScanner.scanChar();
         if (cquote != quote) {
-            reportFatalError("CloseQuoteExpected", new Object[]{atName});
+            reportFatalError("CloseQuoteExpected", new Object[]{eleName, atName});
         }
     } // scanAttributeValue()
 
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/parsers/Bug8073385.java b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/parsers/Bug8073385.java
new file mode 100644
index 0000000..1d3aa66
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/parsers/Bug8073385.java
@@ -0,0 +1,93 @@
+/*
+ * 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.
+ */
+
+package javax.xml.parsers;
+
+import java.io.StringReader;
+import java.util.Locale;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.DocumentBuilder;
+import org.xml.sax.SAXException;
+import org.xml.sax.InputSource;
+
+import org.testng.annotations.AfterClass;
+import org.testng.annotations.BeforeClass;
+import org.testng.annotations.DataProvider;
+import org.testng.annotations.Test;
+import static org.testng.Assert.assertTrue;
+
+/**
+ * @bug 8073385
+ * @summary test that invalid XML character exception string contains
+ *     information about character value, element and attribute names
+ */
+public class Bug8073385 {
+
+    private Locale defLoc;
+
+    @BeforeClass
+    private void setup() {
+        defLoc = Locale.getDefault();
+        Locale.setDefault(Locale.ENGLISH);
+    }
+
+    @AfterClass
+    private void cleanup() {
+        Locale.setDefault(defLoc);
+    }
+
+    @DataProvider(name = "illegalCharactersData")
+    public static Object[][] illegalCharactersData() {
+        return new Object[][]{
+            {0x00},
+            {0xFFFE},
+            {0xFFFF}
+        };
+    }
+
+    @Test(dataProvider = "illegalCharactersData")
+    public void test(int character) throws Exception {
+        // Construct the XML document as a String
+        int[] cps = new int[]{character};
+        String txt = new String(cps, 0, cps.length);
+        String inxml = "<topElement attTest=\'" + txt + "\'/>";
+        String exceptionText = "NO EXCEPTION OBSERVED";
+        String hexString = "0x" + Integer.toHexString(character);
+
+        DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
+        dbf.setNamespaceAware(true);
+        dbf.setValidating(false);
+        DocumentBuilder db = dbf.newDocumentBuilder();
+        InputSource isrc = new InputSource(new StringReader(inxml));
+
+        try {
+            db.parse(isrc);
+        } catch (SAXException e) {
+            exceptionText = e.toString();
+        }
+        System.out.println("Got Exception:" + exceptionText);
+        assertTrue(exceptionText.contains("attribute \"attTest\""));
+        assertTrue(exceptionText.contains("element is \"topElement\""));
+        assertTrue(exceptionText.contains("Unicode: " + hexString));
+    }
+}
diff --git a/jaxws/.hgtags b/jaxws/.hgtags
index 6c9ed17..262b4f7 100644
--- a/jaxws/.hgtags
+++ b/jaxws/.hgtags
@@ -303,3 +303,4 @@
 ca481b0492c82cc38fa0e6b746305ed88c26b4fd jdk9-b55
 b4f913b48e699980bd11fe19cce134d0adb4c31c jdk9-b56
 17c4241395e97312bd75e7acd693ffcdd41ae993 jdk9-b57
+1e06b36bb396c0495e0774f1c6b0356d03847659 jdk9-b58
diff --git a/jdk/.hgtags b/jdk/.hgtags
index 87758c2..0a8ca67 100644
--- a/jdk/.hgtags
+++ b/jdk/.hgtags
@@ -300,3 +300,4 @@
 d49e247dade61f29f771f09b2105857492241156 jdk9-b55
 7969f7b6465e47ce4afa77670ca600b04c1d746c jdk9-b56
 c76339e86ea7da5d9ac7856f3fae9ef73eef04a2 jdk9-b57
+36fc65e80d811ee43aedfc69284224b86a403662 jdk9-b58
diff --git a/jdk/make/Makefile b/jdk/make/Makefile
deleted file mode 100644
index ce3a333..0000000
--- a/jdk/make/Makefile
+++ /dev/null
@@ -1,49 +0,0 @@
-#
-# Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# This code is free software; you can redistribute it and/or modify it
-# 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.
-#
-
-# Locate this Makefile
-ifeq ($(filter /%, $(lastword $(MAKEFILE_LIST))), )
-  makefile_path := $(CURDIR)/$(lastword $(MAKEFILE_LIST))
-else
-  makefile_path := $(lastword $(MAKEFILE_LIST))
-endif
-repo_dir := $(patsubst %/make/Makefile, %, $(makefile_path))
-
-# What is the name of this subsystem (langtools, corba, etc)?
-subsystem_name := $(notdir $(repo_dir))
-
-# Try to locate top-level makefile
-top_level_makefile := $(repo_dir)/../Makefile
-ifneq ($(wildcard $(top_level_makefile)), )
-  $(info Will run $(subsystem_name) target on top-level Makefile)
-  $(info WARNING: This is a non-recommended way of building!)
-  $(info ===================================================)
-else
-  $(info Cannot locate top-level Makefile. Is this repo not checked out as part of a complete forest?)
-  $(error Build from top-level Makefile instead)
-endif
-
-all:
-	@$(MAKE) -f $(top_level_makefile) $(subsystem_name)
diff --git a/jdk/make/copy/Copy-java.base.gmk b/jdk/make/copy/Copy-java.base.gmk
index 296442e..f1728f3 100644
--- a/jdk/make/copy/Copy-java.base.gmk
+++ b/jdk/make/copy/Copy-java.base.gmk
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -98,6 +98,8 @@
   JVMCFG_SRC := $(JDK_TOPDIR)/src/java.base/macosx/conf/$(JVMCFG_ARCH)/jvm.cfg
 else
   JVMCFG_SRC := $(JDK_TOPDIR)/src/java.base/$(OPENJDK_TARGET_OS_TYPE)/conf/$(JVMCFG_ARCH)/jvm.cfg
+  # Allow override by ALT_JVMCFG_SRC if it exists
+  JVMCFG_SRC := $(if $(wildcard $(ALT_JVMCFG_SRC)),$(ALT_JVMCFG_SRC),$(JVMCFG_SRC)) 
 endif
 JVMCFG_DIR := $(LIB_DST_DIR)$(OPENJDK_TARGET_CPU_LIBDIR)
 JVMCFG := $(JVMCFG_DIR)/jvm.cfg
diff --git a/jdk/make/data/tzdata/VERSION b/jdk/make/data/tzdata/VERSION
index 034114a..ebd4db7 100644
--- a/jdk/make/data/tzdata/VERSION
+++ b/jdk/make/data/tzdata/VERSION
@@ -21,4 +21,4 @@
 # or visit www.oracle.com if you need additional information or have any
 # questions.
 #
-tzdata2015a
+tzdata2015b
diff --git a/jdk/make/data/tzdata/asia b/jdk/make/data/tzdata/asia
index bff837c..fa4f246 100644
--- a/jdk/make/data/tzdata/asia
+++ b/jdk/make/data/tzdata/asia
@@ -1927,6 +1927,13 @@
 # was at the start of 2008-03-31 (the day of Steffen Thorsen's report);
 # this is almost surely wrong.
 
+# From Ganbold Tsagaankhuu (2015-03-10):
+# It seems like yesterday Mongolian Government meeting has concluded to use
+# daylight saving time in Mongolia....  Starting at 2:00AM of last Saturday of
+# March 2015, daylight saving time starts.  And 00:00AM of last Saturday of
+# September daylight saving time ends.  Source:
+# http://zasag.mn/news/view/8969
+
 # Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
 Rule	Mongol	1983	1984	-	Apr	1	0:00	1:00	S
 Rule	Mongol	1983	only	-	Oct	1	0:00	0	-
@@ -1947,6 +1954,8 @@
 Rule	Mongol	2001	only	-	Apr	lastSat	2:00	1:00	S
 Rule	Mongol	2001	2006	-	Sep	lastSat	2:00	0	-
 Rule	Mongol	2002	2006	-	Mar	lastSat	2:00	1:00	S
+Rule	Mongol	2015	max	-	Mar	lastSat	2:00	1:00	S
+Rule	Mongol	2015	max	-	Sep	lastSat	0:00	0	-
 
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 # Hovd, a.k.a. Chovd, Dund-Us, Dzhargalant, Khovd, Jirgalanta
@@ -2365,13 +2374,19 @@
 # official source...:
 # http://www.palestinecabinet.gov.ps/ar/Views/ViewDetails.aspx?pid=1252
 
-# From Paul Eggert (2013-09-24):
-# For future dates, guess the last Thursday in March at 24:00 through
-# the first Friday on or after September 21 at 00:00.  This is consistent with
-# the predictions in today's editions of the following URLs,
-# which are for Gaza and Hebron respectively:
-# http://www.timeanddate.com/worldclock/timezone.html?n=702
-# http://www.timeanddate.com/worldclock/timezone.html?n=2364
+# From Steffen Thorsen (2015-03-03):
+# Sources such as http://www.alquds.com/news/article/view/id/548257
+# and http://www.raya.ps/ar/news/890705.html say Palestine areas will
+# start DST on 2015-03-28 00:00 which is one day later than expected.
+#
+# From Paul Eggert (2015-03-03):
+# http://www.timeanddate.com/time/change/west-bank/ramallah?year=2014
+# says that the fall 2014 transition was Oct 23 at 24:00.
+# For future dates, guess the last Friday in March at 24:00 through
+# the first Friday on or after October 21 at 00:00.  This is consistent with
+# the predictions in today's editions of the following URLs:
+# http://www.timeanddate.com/time/change/gaza-strip/gaza
+# http://www.timeanddate.com/time/change/west-bank/hebron
 
 # Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
 Rule EgyptAsia	1957	only	-	May	10	0:00	1:00	S
@@ -2397,9 +2412,11 @@
 Rule Palestine	2011	only	-	Aug	 1	0:00	0	-
 Rule Palestine	2011	only	-	Aug	30	0:00	1:00	S
 Rule Palestine	2011	only	-	Sep	30	0:00	0	-
-Rule Palestine	2012	max	-	Mar	lastThu	24:00	1:00	S
+Rule Palestine	2012	2014	-	Mar	lastThu	24:00	1:00	S
 Rule Palestine	2012	only	-	Sep	21	1:00	0	-
-Rule Palestine	2013	max	-	Sep	Fri>=21	0:00	0	-
+Rule Palestine	2013	only	-	Sep	Fri>=21	0:00	0	-
+Rule Palestine	2014	max	-	Oct	Fri>=21	0:00	0	-
+Rule Palestine	2015	max	-	Mar	lastFri	24:00	1:00	S
 
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone	Asia/Gaza	2:17:52	-	LMT	1900 Oct
diff --git a/jdk/make/data/tzdata/australasia b/jdk/make/data/tzdata/australasia
index f2a89e8..ec9f392 100644
--- a/jdk/make/data/tzdata/australasia
+++ b/jdk/make/data/tzdata/australasia
@@ -396,6 +396,7 @@
 			 9:39:00 -	LMT	1901        # Agana
 			10:00	-	GST	2000 Dec 23 # Guam
 			10:00	-	ChST	# Chamorro Standard Time
+Link Pacific/Guam Pacific/Saipan # N Mariana Is
 
 # Kiribati
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
@@ -411,12 +412,7 @@
 			 14:00	-	LINT
 
 # N Mariana Is
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone Pacific/Saipan	-14:17:00 -	LMT	1844 Dec 31
-			 9:43:00 -	LMT	1901
-			 9:00	-	MPT	1969 Oct    # N Mariana Is Time
-			10:00	-	MPT	2000 Dec 23
-			10:00	-	ChST	# Chamorro Standard Time
+# See Pacific/Guam.
 
 # Marshall Is
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
@@ -586,6 +582,7 @@
 			-11:00	-	NST	1967 Apr    # N=Nome
 			-11:00	-	BST	1983 Nov 30 # B=Bering
 			-11:00	-	SST	            # S=Samoa
+Link Pacific/Pago_Pago Pacific/Midway # in US minor outlying islands
 
 # Samoa (formerly and also known as Western Samoa)
 
@@ -767,23 +764,7 @@
 # uninhabited
 
 # Midway
-#
-# From Mark Brader (2005-01-23):
-# [Fallacies and Fantasies of Air Transport History, by R.E.G. Davies,
-# published 1994 by Paladwr Press, McLean, VA, USA; ISBN 0-9626483-5-3]
-# reproduced a Pan American Airways timetable from 1936, for their weekly
-# "Orient Express" flights between San Francisco and Manila, and connecting
-# flights to Chicago and the US East Coast.  As it uses some time zone
-# designations that I've never seen before:....
-# Fri. 6:30A Lv. HONOLOLU (Pearl Harbor), H.I.   H.L.T. Ar. 5:30P Sun.
-#  "   3:00P Ar. MIDWAY ISLAND . . . . . . . . . M.L.T. Lv. 6:00A  "
-#
-Zone Pacific/Midway	-11:49:28 -	LMT	1901
-			-11:00	-	NST	1956 Jun  3
-			-11:00	1:00	NDT	1956 Sep  2
-			-11:00	-	NST	1967 Apr    # N=Nome
-			-11:00	-	BST	1983 Nov 30 # B=Bering
-			-11:00	-	SST	            # S=Samoa
+# See Pacific/Pago_Pago.
 
 # Palmyra
 # uninhabited since World War II; was probably like Pacific/Kiritimati
diff --git a/jdk/make/data/tzdata/europe b/jdk/make/data/tzdata/europe
index 89790f0..008268a 100644
--- a/jdk/make/data/tzdata/europe
+++ b/jdk/make/data/tzdata/europe
@@ -2423,7 +2423,7 @@
 			 4:00	Russia	VOL%sT	1989 Mar 26  2:00s # Volgograd T
 			 3:00	Russia	VOL%sT	1991 Mar 31  2:00s
 			 4:00	-	VOLT	1992 Mar 29  2:00s
-			 3:00	Russia	MSK	2011 Mar 27  2:00s
+			 3:00	Russia	MSK/MSD	2011 Mar 27  2:00s
 			 4:00	-	MSK	2014 Oct 26  2:00s
 			 3:00	-	MSK
 
diff --git a/jdk/make/data/tzdata/northamerica b/jdk/make/data/tzdata/northamerica
index 5943cfe..442a50e 100644
--- a/jdk/make/data/tzdata/northamerica
+++ b/jdk/make/data/tzdata/northamerica
@@ -2335,8 +2335,24 @@
 # "...the new time zone will come into effect at two o'clock on the first Sunday
 # of February, when we will have to advance the clock one hour from its current
 # time..."
-#
 # Also, the new zone will not use DST.
+#
+# From Carlos Raúl Perasso (2015-02-02):
+# The decree that modifies the Mexican Hour System Law has finally
+# been published at the Diario Oficial de la Federación
+# http://www.dof.gob.mx/nota_detalle.php?codigo=5380123&fecha=31/01/2015
+# It establishes 5 zones for Mexico:
+# 1- Zona Centro (Central Zone): Corresponds to longitude 90 W,
+#    includes most of Mexico, excluding what's mentioned below.
+# 2- Zona Pacífico (Pacific Zone): Longitude 105 W, includes the
+#    states of Baja California Sur; Chihuahua; Nayarit (excluding Bahía
+#    de Banderas which lies in Central Zone); Sinaloa and Sonora.
+# 3- Zona Noroeste (Northwest Zone): Longitude 120 W, includes the
+#    state of Baja California.
+# 4- Zona Sureste (Southeast Zone): Longitude 75 W, includes the state
+#    of Quintana Roo.
+# 5- The islands, reefs and keys shall take their timezone from the
+#    longitude they are located at.
 
 # Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
 Rule	Mexico	1939	only	-	Feb	5	0:00	1:00	D
@@ -2531,13 +2547,8 @@
 ###############################################################################
 
 # Anguilla
-# See America/Port_of_Spain.
-
 # Antigua and Barbuda
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone	America/Antigua	-4:07:12 -	LMT	1912 Mar 2
-			-5:00	-	EST	1951
-			-4:00	-	AST
+# See America/Port_of_Spain.
 
 # Bahamas
 #
@@ -2604,10 +2615,7 @@
 			-4:00	US	A%sT
 
 # Cayman Is
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone	America/Cayman	-5:25:32 -	LMT	1890     # Georgetown
-			-5:07:11 -	KMT	1912 Feb # Kingston Mean Time
-			-5:00	-	EST
+# See America/Panama.
 
 # Costa Rica
 
@@ -3130,6 +3138,7 @@
 Zone	America/Panama	-5:18:08 -	LMT	1890
 			-5:19:36 -	CMT	1908 Apr 22 # Colón Mean Time
 			-5:00	-	EST
+Link America/Panama America/Cayman
 
 # Puerto Rico
 # There are too many San Juans elsewhere, so we'll use 'Puerto_Rico'.
diff --git a/jdk/make/data/tzdata/southamerica b/jdk/make/data/tzdata/southamerica
index 02cf121..238ae3d 100644
--- a/jdk/make/data/tzdata/southamerica
+++ b/jdk/make/data/tzdata/southamerica
@@ -1229,10 +1229,13 @@
 # DST Start: first Saturday of September 2014 (Sun 07 Sep 2014 04:00 UTC)
 # http://www.diariooficial.interior.gob.cl//media/2014/02/19/do-20140219.pdf
 
-# From Juan Correa (2015-01-28):
-# ... today the Ministry of Energy announced that Chile will drop DST, will keep
-# "summer time" (UTC -3 / UTC -5) all year round....
-# http://www.minenergia.cl/ministerio/noticias/generales/ministerio-de-energia-anuncia.html
+# From Eduardo Romero Urra (2015-03-03):
+# Today has been published officially that Chile will use the DST time
+# permanently until March 25 of 2017
+# http://www.diariooficial.interior.gob.cl/media/2015/03/03/1-large.jpg
+#
+# From Paul Eggert (2015-03-03):
+# For now, assume that the extension will persist indefinitely.
 
 # NOTE: ChileAQ rules for Antarctic bases are stored separately in the
 # 'antarctica' file.
@@ -1291,7 +1294,7 @@
 			-3:00	-	CLT
 Zone Pacific/Easter	-7:17:44 -	LMT	1890
 			-7:17:28 -	EMT	1932 Sep    # Easter Mean Time
-			-7:00	Chile	EAS%sT	1982 Mar 13 3:00u # Easter Time
+			-7:00	Chile	EAS%sT	1982 Mar 14 3:00u # Easter Time
 			-6:00	Chile	EAS%sT	2015 Apr 26 3:00u
 			-5:00	-	EAST
 #
@@ -1626,6 +1629,7 @@
 
 # These all agree with Trinidad and Tobago since 1970.
 Link America/Port_of_Spain America/Anguilla
+Link America/Port_of_Spain America/Antigua
 Link America/Port_of_Spain America/Dominica
 Link America/Port_of_Spain America/Grenada
 Link America/Port_of_Spain America/Guadeloupe
diff --git a/jdk/make/lib/Awt2dLibraries.gmk b/jdk/make/lib/Awt2dLibraries.gmk
index 5490686..c7ce8d9 100644
--- a/jdk/make/lib/Awt2dLibraries.gmk
+++ b/jdk/make/lib/Awt2dLibraries.gmk
@@ -236,10 +236,6 @@
   LIBAWT_VERSIONINFO_RESOURCE := $(JDK_TOPDIR)/src/java.desktop/windows/native/libawt/windows/awt.rc
 endif
 
-ifeq ($(MILESTONE), internal)
-  LIBAWT_CFLAGS += -DINTERNAL_BUILD
-endif
-
 LIBAWT_MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libawt/mapfile-vers
 ifeq ($(OPENJDK_TARGET_OS), linux)
   LIBAWT_MAPFILE :=
@@ -347,10 +343,6 @@
       endif
     endif
 
-    ifeq ($(MILESTONE), internal)
-      LIBAWT_XAWT_CFLAGS += -DINTERNAL_BUILD
-    endif
-
     LIBAWT_XAWT_LDFLAGS_SUFFIX := $(LIBM) -lawt -lXext -lX11 -lXrender $(LIBDL) -lXtst -lXi -ljava -ljvm -lc
 
     ifeq ($(OPENJDK_TARGET_OS), linux)
diff --git a/jdk/make/lib/CoreLibraries.gmk b/jdk/make/lib/CoreLibraries.gmk
index 678af20..02ea309 100644
--- a/jdk/make/lib/CoreLibraries.gmk
+++ b/jdk/make/lib/CoreLibraries.gmk
@@ -269,7 +269,7 @@
 LIBJLI_EXCLUDE_FILES += $(notdir $(LIBJLI_EXCLUDE_ERGO))
 
 ifeq ($(OPENJDK_TARGET_OS), macosx)
-  LIBJLI_EXCLUDE_FILES += java_md_solinux.c ergo.c
+  LIBJLI_EXCLUDE_FILES += java_md_solinux.c ergo.c ergo_i586.c
 
   BUILD_LIBJLI_java_md_macosx.c_CFLAGS := -x objective-c
   BUILD_LIBJLI_STATIC_java_md_macosx.c_CFLAGS := -x objective-c
@@ -317,12 +317,7 @@
     LANG := C, \
     OPTIMIZATION := HIGH, \
     CFLAGS := $(LIBJLI_CFLAGS), \
-    DISABLED_WARNINGS_gcc := pointer-to-int-cast sign-compare format-nonliteral \
-        parentheses, \
-    DISABLED_WARNINGS_clang := implicit-function-declaration parentheses \
-        int-conversion, \
-    DISABLED_WARNINGS_solstudio := E_ASM_DISABLES_OPTIMIZATION E_NEWLINE_NOT_LAST, \
-    DISABLED_WARNINGS_microsoft := 4244 4047 4267, \
+    DISABLED_WARNINGS_solstudio := E_ASM_DISABLES_OPTIMIZATION, \
     MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libjli/mapfile-vers, \
     LDFLAGS := $(LDFLAGS_JDKLIB) \
         $(call SET_SHARED_LIBRARY_ORIGIN), \
@@ -371,7 +366,6 @@
       LANG := C, \
       OPTIMIZATION := HIGH, \
       CFLAGS := $(STATIC_LIBRARY_FLAGS) $(LIBJLI_CFLAGS), \
-      DISABLED_WARNINGS_microsoft := 4244 4047 4267, \
       ARFLAGS := $(ARFLAGS), \
       OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libjli_static, \
       DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
@@ -392,8 +386,6 @@
       LANG := C, \
       OPTIMIZATION := HIGH, \
       CFLAGS := $(CFLAGS_JDKLIB) $(LIBJLI_CFLAGS), \
-      DISABLED_WARNINGS_clang := implicit-function-declaration parentheses \
-          int-conversion, \
       LDFLAGS := -nostdlib -r, \
       OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libjli_static, \
       DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
diff --git a/jdk/make/mapfiles/libjava/reorder-sparc b/jdk/make/mapfiles/libjava/reorder-sparc
index d100376..5ae7cca 100644
--- a/jdk/make/mapfiles/libjava/reorder-sparc
+++ b/jdk/make/mapfiles/libjava/reorder-sparc
@@ -1,7 +1,6 @@
 data = R0x2000;
 text = LOAD ?RXO;
 # Test Null
-text: .text%init64IO: OUTPUTDIR/UnixFileSystem_md.o;
 text: .text%JNI_OnLoad;
 text: .text%Canonicalize;
 text: .text%canonicalize;
@@ -38,10 +37,9 @@
 text: .text%Java_java_lang_System_identityHashCode;
 text: .text%Java_sun_misc_Signal_findSignal;
 text: .text%Java_sun_misc_Signal_handle0;
-text: .text%Java_java_io_FileSystem_getFileSystem;
 text: .text%JNU_NewObjectByName;
 text: .text%Java_java_io_UnixFileSystem_initIDs;
-text: .text%Java_java_io_UnixFileSystem_canonicalize;
+text: .text%Java_java_io_UnixFileSystem_canonicalize0;
 text: .text%JNU_GetStringPlatformChars;
 text: .text%JNU_ReleaseStringPlatformChars;
 text: .text%Java_java_io_FileInputStream_open0;
@@ -52,27 +50,25 @@
 text: .text%Java_java_io_FileInputStream_close0;
 text: .text%Java_java_lang_System_mapLibraryName;
 text: .text%Java_java_io_UnixFileSystem_getBooleanAttributes0;
-text: .text%statMode: OUTPUTDIR/UnixFileSystem_md.o;
 text: .text%Java_java_lang_ClassLoader_00024NativeLibrary_load;
-text: .text%Java_java_lang_Compiler_registerNatives;
 text: .text%Java_java_lang_ClassLoader_00024NativeLibrary_find;
 text: .text%Java_java_security_AccessController_doPrivileged__Ljava_security_PrivilegedExceptionAction_2;
 text: .text%Java_java_io_UnixFileSystem_list;
 text: .text%JNU_ClassString;
 text: .text%JNU_CopyObjectArray;
 text: .text%Java_java_lang_String_intern;
-text: .text%Java_java_lang_ClassLoader_findLoadedClass;
+text: .text%Java_java_lang_ClassLoader_findLoadedClass0;
 text: .text%Java_java_lang_ClassLoader_findBootstrapClass;
 text: .text%Java_java_lang_Throwable_fillInStackTrace;
 text: .text%Java_java_security_AccessController_doPrivileged__Ljava_security_PrivilegedExceptionAction_2Ljava_security_AccessControlContext_2;
 text: .text%Java_java_io_UnixFileSystem_getLastModifiedTime;
-text: .text%Java_java_lang_Float_floatToIntBits;
-text: .text%Java_java_lang_Double_doubleToLongBits;
+text: .text%Java_java_lang_Float_floatToRawIntBits;
+text: .text%Java_java_lang_Double_doubleToRawLongBits;
 text: .text%Java_java_io_UnixFileSystem_getLength;
 text: .text%Java_java_lang_ClassLoader_defineClass0;
 text: .text%VerifyClassCodes;
 # Test Exit
-text: .text%Java_java_lang_Shutdown_halt;
+text: .text%Java_java_lang_Shutdown_halt0;
 # Test Hello
 text: .text%Java_java_io_FileOutputStream_writeBytes;
 text: .text%writeBytes;
@@ -91,9 +87,7 @@
 text: .text%JNU_CallMethodByName;
 text: .text%JNU_CallMethodByNameV;
 text: .text%Java_java_io_UnixFileSystem_createDirectory;
-text: .text%Java_java_util_prefs_FileSystemPreferences_lockFile0;
 text: .text%Java_java_io_UnixFileSystem_setLastModifiedTime;
-text: .text%Java_java_util_prefs_FileSystemPreferences_unlockFile0;
 # Test LoadJFrame
 text: .text%Java_sun_reflect_NativeMethodAccessorImpl_invoke0;
 text: .text%Java_java_lang_Class_isInstance;
diff --git a/jdk/make/mapfiles/libjava/reorder-sparcv9 b/jdk/make/mapfiles/libjava/reorder-sparcv9
index 2609711..f109866 100644
--- a/jdk/make/mapfiles/libjava/reorder-sparcv9
+++ b/jdk/make/mapfiles/libjava/reorder-sparcv9
@@ -1,7 +1,6 @@
 data = R0x2000;
 text = LOAD ?RXO;
 # Test Null
-text: .text%init64IO: OUTPUTDIR/UnixFileSystem_md.o;
 text: .text%JNI_OnLoad;
 text: .text%Canonicalize;
 text: .text%canonicalize;
@@ -30,9 +29,9 @@
 text: .text%Java_sun_reflect_Reflection_getCallerClass__I;
 text: .text%Java_java_lang_Class_forName0;
 text: .text%Java_java_lang_String_intern;
-text: .text%Java_java_lang_Float_floatToIntBits;
-text: .text%Java_java_lang_Double_doubleToLongBits;
-text: .text%Java_java_lang_ClassLoader_findLoadedClass;
+text: .text%Java_java_lang_Float_floatToRawIntBits;
+text: .text%Java_java_lang_Double_doubleToRawLongBits;
+text: .text%Java_java_lang_ClassLoader_findLoadedClass0;
 text: .text%Java_java_lang_ClassLoader_findBootstrapClass;
 text: .text%VerifyClassCodes;
 text: .text%Java_java_lang_Throwable_fillInStackTrace;
@@ -41,10 +40,9 @@
 text: .text%Java_java_lang_System_identityHashCode;
 text: .text%Java_sun_misc_Signal_findSignal;
 text: .text%Java_sun_misc_Signal_handle0;
-text: .text%Java_java_io_FileSystem_getFileSystem;
 text: .text%JNU_NewObjectByName;
 text: .text%Java_java_io_UnixFileSystem_initIDs;
-text: .text%Java_java_io_UnixFileSystem_canonicalize;
+text: .text%Java_java_io_UnixFileSystem_canonicalize0;
 text: .text%JNU_GetStringPlatformChars;
 text: .text%JNU_ReleaseStringPlatformChars;
 text: .text%Java_java_io_FileInputStream_open0;
@@ -53,13 +51,11 @@
 text: .text%readBytes;
 text: .text%Java_java_io_FileInputStream_available;
 text: .text%Java_java_io_FileInputStream_close0;
-text: .text%Java_java_lang_Compiler_registerNatives;
 text: .text%Java_java_security_AccessController_doPrivileged__Ljava_security_PrivilegedExceptionAction_2;
 text: .text%Java_java_io_UnixFileSystem_list;
 text: .text%JNU_ClassString;
 text: .text%JNU_CopyObjectArray;
 text: .text%Java_java_io_UnixFileSystem_getBooleanAttributes0;
-text: .text%statMode: OUTPUTDIR/UnixFileSystem_md.o;
 text: .text%Java_java_security_AccessController_doPrivileged__Ljava_security_PrivilegedExceptionAction_2Ljava_security_AccessControlContext_2;
 text: .text%Java_java_lang_System_mapLibraryName;
 text: .text%Java_java_lang_ClassLoader_00024NativeLibrary_load;
@@ -68,7 +64,7 @@
 text: .text%Java_java_lang_Object_getClass;
 text: .text%Java_java_lang_ClassLoader_defineClass0;
 # Test Exit
-text: .text%Java_java_lang_Shutdown_halt;
+text: .text%Java_java_lang_Shutdown_halt0;
 # Test Hello
 text: .text%Java_java_io_FileOutputStream_writeBytes;
 text: .text%writeBytes;
@@ -88,9 +84,7 @@
 text: .text%JNU_CallMethodByNameV;
 text: .text%Java_java_io_UnixFileSystem_createDirectory;
 text: .text%Java_java_io_UnixFileSystem_getLastModifiedTime;
-text: .text%Java_java_util_prefs_FileSystemPreferences_lockFile0;
 text: .text%Java_java_io_UnixFileSystem_setLastModifiedTime;
-text: .text%Java_java_util_prefs_FileSystemPreferences_unlockFile0;
 # Test LoadJFrame
 text: .text%Java_java_lang_Class_isAssignableFrom;
 text: .text%Java_java_lang_Class_isInstance;
diff --git a/jdk/make/mapfiles/libjava/reorder-x86 b/jdk/make/mapfiles/libjava/reorder-x86
index b8ea2d4..03609c1 100644
--- a/jdk/make/mapfiles/libjava/reorder-x86
+++ b/jdk/make/mapfiles/libjava/reorder-x86
@@ -2,7 +2,6 @@
 text = LOAD ?RXO;
 # Test Null
 text: .text%_init;
-text: .text%init64IO: OUTPUTDIR/UnixFileSystem_md.o;
 text: .text%JNI_OnLoad;
 text: .text%Canonicalize;
 text: .text%canonicalize;
@@ -36,8 +35,6 @@
 text: .text%Java_java_lang_Throwable_fillInStackTrace;
 text: .text%Java_java_lang_System_setOut0;
 text: .text%Java_java_lang_System_setErr0;
-text: .text%Java_java_lang_Compiler_registerNatives;
-text: .text%Java_java_io_FileSystem_getFileSystem;
 text: .text%JNU_NewObjectByName;
 text: .text%Java_java_io_UnixFileSystem_initIDs;
 text: .text%Java_java_security_AccessController_doPrivileged__Ljava_security_PrivilegedExceptionAction_2;
@@ -46,17 +43,17 @@
 text: .text%JNU_ReleaseStringPlatformChars;
 text: .text%JNU_ClassString;
 text: .text%JNU_CopyObjectArray;
-text: .text%Java_java_io_UnixFileSystem_canonicalize;
+text: .text%Java_java_io_UnixFileSystem_canonicalize0;
 text: .text%Java_java_io_UnixFileSystem_getBooleanAttributes0;
-text: .text%Java_java_lang_ClassLoader_findLoadedClass;
+text: .text%Java_java_lang_ClassLoader_findLoadedClass0;
 text: .text%Java_java_lang_ClassLoader_findBootstrapClass;
 text: .text%Java_java_security_AccessController_doPrivileged__Ljava_security_PrivilegedExceptionAction_2Ljava_security_AccessControlContext_2;
 text: .text%Java_java_lang_System_mapLibraryName;
 text: .text%cpchars: OUTPUTDIR/System.o;
 text: .text%Java_java_lang_ClassLoader_00024NativeLibrary_load;
 text: .text%Java_java_lang_ClassLoader_00024NativeLibrary_find;
-text: .text%Java_java_lang_Float_floatToIntBits;
-text: .text%Java_java_lang_Double_doubleToLongBits;
+text: .text%Java_java_lang_Float_floatToRawIntBits;
+text: .text%Java_java_lang_Double_doubleToRawLongBits;
 text: .text%Java_java_io_FileInputStream_open0;
 text: .text%fileOpen;
 text: .text%Java_java_io_UnixFileSystem_getLength;
@@ -67,7 +64,7 @@
 text: .text%Java_java_lang_ClassLoader_defineClass0;
 text: .text%VerifyClassCodes;
 # Test Exit
-text: .text%Java_java_lang_Shutdown_halt;
+text: .text%Java_java_lang_Shutdown_halt0;
 # Test Hello
 text: .text%Java_java_io_FileOutputStream_writeBytes;
 text: .text%writeBytes;
@@ -93,9 +90,7 @@
 text: .text%Java_java_io_FileOutputStream_open0;
 text: .text%Java_java_io_UnixFileSystem_createDirectory;
 text: .text%Java_java_io_UnixFileSystem_getLastModifiedTime;
-text: .text%Java_java_util_prefs_FileSystemPreferences_lockFile0;
 text: .text%Java_java_io_UnixFileSystem_setLastModifiedTime;
-text: .text%Java_java_util_prefs_FileSystemPreferences_unlockFile0;
 text: .text%Java_java_io_FileOutputStream_close0;
 text: .text%Java_java_util_logging_FileHandler_unlockFile;
 # Test LoadJFrame
diff --git a/jdk/make/mapfiles/libzip/reorder-sparcv9 b/jdk/make/mapfiles/libzip/reorder-sparcv9
index c1e3237..4b72820 100644
--- a/jdk/make/mapfiles/libzip/reorder-sparcv9
+++ b/jdk/make/mapfiles/libzip/reorder-sparcv9
@@ -12,7 +12,6 @@
 text: .text%ZIP_FindEntry;
 text: .text%ZIP_GetEntry;
 text: .text%ZIP_Lock;
-text: .text%readLOC: OUTPUTDIR/zip_util.o;
 text: .text%ZIP_Unlock;
 text: .text%ZIP_FreeEntry;
 text: .text%Java_java_util_zip_ZipFile_initIDs;
@@ -37,7 +36,6 @@
 text: .text%inflate;
 text: .text%Java_java_util_zip_ZipFile_read;
 text: .text%ZIP_Read;
-text: .text%huft_build: OUTPUTDIR/inftrees.o;
 text: .text%zcfree;
 text: .text%Java_java_util_jar_JarFile_getMetaInfEntryNames;
 text: .text%ZIP_ReadEntry;
diff --git a/jdk/make/mapfiles/libzip/reorder-x86 b/jdk/make/mapfiles/libzip/reorder-x86
index f3cf4ff..95c47b6 100644
--- a/jdk/make/mapfiles/libzip/reorder-x86
+++ b/jdk/make/mapfiles/libzip/reorder-x86
@@ -13,7 +13,6 @@
 text: .text%ZIP_FindEntry;
 text: .text%ZIP_GetEntry;
 text: .text%ZIP_Lock;
-text: .text%readLOC: OUTPUTDIR/zip_util.o;
 text: .text%ZIP_Unlock;
 text: .text%ZIP_FreeEntry;
 text: .text%Java_java_util_zip_ZipFile_initIDs;
@@ -38,7 +37,6 @@
 text: .text%inflate;
 text: .text%Java_java_util_zip_ZipFile_read;
 text: .text%ZIP_Read;
-text: .text%huft_build: OUTPUTDIR/inftrees.o;
 text: .text%zcfree;
 text: .text%Java_java_util_jar_JarFile_getMetaInfEntryNames;
 text: .text%ZIP_ReadEntry;
diff --git a/jdk/src/java.base/macosx/native/libjli/java_md_macosx.c b/jdk/src/java.base/macosx/native/libjli/java_md_macosx.c
index eb432c1..d48f525 100644
--- a/jdk/src/java.base/macosx/native/libjli/java_md_macosx.c
+++ b/jdk/src/java.base/macosx/native/libjli/java_md_macosx.c
@@ -852,7 +852,7 @@
     if (pthread_create(&tid, &attr, (void *(*)(void*))continuation, (void*)args) == 0) {
       void * tmp;
       pthread_join(tid, &tmp);
-      rslt = (int)tmp;
+      rslt = (int)(intptr_t)tmp;
     } else {
      /*
       * Continue execution in current thread if for some reason (e.g. out of
diff --git a/jdk/src/java.base/share/classes/java/io/ObjectStreamException.java b/jdk/src/java.base/share/classes/java/io/ObjectStreamException.java
index d87a56f..94fc560 100644
--- a/jdk/src/java.base/share/classes/java/io/ObjectStreamException.java
+++ b/jdk/src/java.base/share/classes/java/io/ObjectStreamException.java
@@ -38,10 +38,10 @@
     /**
      * Create an ObjectStreamException with the specified argument.
      *
-     * @param classname the detailed message for the exception
+     * @param message the detailed message for the exception
      */
-    protected ObjectStreamException(String classname) {
-        super(classname);
+    protected ObjectStreamException(String message) {
+        super(message);
     }
 
     /**
diff --git a/jdk/src/java.base/share/classes/java/net/ProtocolException.java b/jdk/src/java.base/share/classes/java/net/ProtocolException.java
index 828636e..e2bd411 100644
--- a/jdk/src/java.base/share/classes/java/net/ProtocolException.java
+++ b/jdk/src/java.base/share/classes/java/net/ProtocolException.java
@@ -42,10 +42,10 @@
      * Constructs a new {@code ProtocolException} with the
      * specified detail message.
      *
-     * @param   host   the detail message.
+     * @param   message   the detail message.
      */
-    public ProtocolException(String host) {
-        super(host);
+    public ProtocolException(String message) {
+        super(message);
     }
 
     /**
diff --git a/jdk/src/java.base/share/classes/java/net/UnknownHostException.java b/jdk/src/java.base/share/classes/java/net/UnknownHostException.java
index a990f69..9a9fea5 100644
--- a/jdk/src/java.base/share/classes/java/net/UnknownHostException.java
+++ b/jdk/src/java.base/share/classes/java/net/UnknownHostException.java
@@ -41,10 +41,10 @@
      * Constructs a new {@code UnknownHostException} with the
      * specified detail message.
      *
-     * @param   host   the detail message.
+     * @param   message   the detail message.
      */
-    public UnknownHostException(String host) {
-        super(host);
+    public UnknownHostException(String message) {
+        super(message);
     }
 
     /**
diff --git a/jdk/src/java.base/share/classes/java/time/chrono/HijrahChronology.java b/jdk/src/java.base/share/classes/java/time/chrono/HijrahChronology.java
index 0e79b69..3dbbec5 100644
--- a/jdk/src/java.base/share/classes/java/time/chrono/HijrahChronology.java
+++ b/jdk/src/java.base/share/classes/java/time/chrono/HijrahChronology.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 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
@@ -478,7 +478,6 @@
         if (prolepticYear < getMinimumYear() || prolepticYear > getMaximumYear()) {
             return false;
         }
-        int epochMonth = yearToEpochMonth((int) prolepticYear);
         int len = getYearLength((int) prolepticYear);
         return (len > 354);
     }
@@ -659,7 +658,7 @@
     }
 
     /**
-     * Return the maximum supported Hijrah ear.
+     * Return the maximum supported Hijrah year.
      *
      * @return the minimum
      */
diff --git a/jdk/src/java.base/share/classes/java/util/Calendar.java b/jdk/src/java.base/share/classes/java/util/Calendar.java
index ff0f2f7..68deb16 100644
--- a/jdk/src/java.base/share/classes/java/util/Calendar.java
+++ b/jdk/src/java.base/share/classes/java/util/Calendar.java
@@ -2083,17 +2083,33 @@
             return null;
         }
 
+        String calendarType = getCalendarType();
+        int fieldValue = get(field);
         // the standalone and narrow styles are supported only through CalendarDataProviders.
-        if (isStandaloneStyle(style) || isNarrowStyle(style)) {
-            return CalendarDataUtility.retrieveFieldValueName(getCalendarType(),
-                                                              field, get(field),
-                                                              style, locale);
+        if (isStandaloneStyle(style) || isNarrowFormatStyle(style)) {
+            String val = CalendarDataUtility.retrieveFieldValueName(calendarType,
+                                                                    field, fieldValue,
+                                                                    style, locale);
+            // Perform fallback here to follow the CLDR rules
+            if (val == null) {
+                if (isNarrowFormatStyle(style)) {
+                    val = CalendarDataUtility.retrieveFieldValueName(calendarType,
+                                                                     field, fieldValue,
+                                                                     toStandaloneStyle(style),
+                                                                     locale);
+                } else if (isStandaloneStyle(style)) {
+                    val = CalendarDataUtility.retrieveFieldValueName(calendarType,
+                                                                     field, fieldValue,
+                                                                     getBaseStyle(style),
+                                                                     locale);
+                }
+            }
+            return val;
         }
 
         DateFormatSymbols symbols = DateFormatSymbols.getInstance(locale);
         String[] strings = getFieldStrings(field, style, symbols);
         if (strings != null) {
-            int fieldValue = get(field);
             if (fieldValue < strings.length) {
                 return strings[fieldValue];
             }
@@ -2155,10 +2171,26 @@
                                     ERA_MASK|MONTH_MASK|DAY_OF_WEEK_MASK|AM_PM_MASK)) {
             return null;
         }
-        if (style == ALL_STYLES || isStandaloneStyle(style)) {
-            return CalendarDataUtility.retrieveFieldValueNames(getCalendarType(), field, style, locale);
+
+        String calendarType = getCalendarType();
+        if (style == ALL_STYLES || isStandaloneStyle(style) || isNarrowFormatStyle(style)) {
+            Map<String, Integer> map;
+            map = CalendarDataUtility.retrieveFieldValueNames(calendarType, field, style, locale);
+
+            // Perform fallback here to follow the CLDR rules
+            if (map == null) {
+                if (isNarrowFormatStyle(style)) {
+                    map = CalendarDataUtility.retrieveFieldValueNames(calendarType, field,
+                                                                      toStandaloneStyle(style), locale);
+                } else if (style != ALL_STYLES) {
+                    map = CalendarDataUtility.retrieveFieldValueNames(calendarType, field,
+                                                                      getBaseStyle(style), locale);
+                }
+            }
+            return map;
         }
-        // SHORT, LONG, or NARROW
+
+        // SHORT or LONG
         return getDisplayNamesImpl(field, style, locale);
     }
 
@@ -2544,14 +2576,22 @@
         return style & ~STANDALONE_MASK;
     }
 
-    boolean isStandaloneStyle(int style) {
+    private int toStandaloneStyle(int style) {
+        return style | STANDALONE_MASK;
+    }
+
+    private boolean isStandaloneStyle(int style) {
         return (style & STANDALONE_MASK) != 0;
     }
 
-    boolean isNarrowStyle(int style) {
+    private boolean isNarrowStyle(int style) {
         return style == NARROW_FORMAT || style == NARROW_STANDALONE;
     }
 
+    private boolean isNarrowFormatStyle(int style) {
+        return style == NARROW_FORMAT;
+    }
+
     /**
      * Returns the pseudo-time-stamp for two fields, given their
      * individual pseudo-time-stamps.  If either of the fields
diff --git a/jdk/src/java.base/share/classes/java/util/HashMap.java b/jdk/src/java.base/share/classes/java/util/HashMap.java
index d3b1df4..ea56781 100644
--- a/jdk/src/java.base/share/classes/java/util/HashMap.java
+++ b/jdk/src/java.base/share/classes/java/util/HashMap.java
@@ -1082,6 +1082,16 @@
         return null;
     }
 
+    /**
+     * {@inheritDoc}
+     *
+     * <p>This method will, on a best-effort basis, throw a
+     * {@link ConcurrentModificationException} if it is detected that the
+     * mapping function modifies this map during computation.
+     *
+     * @throws ConcurrentModificationException if it is detected that the
+     * mapping function modified this map
+     */
     @Override
     public V computeIfAbsent(K key,
                              Function<? super K, ? extends V> mappingFunction) {
@@ -1115,7 +1125,9 @@
                 return oldValue;
             }
         }
+        int mc = modCount;
         V v = mappingFunction.apply(key);
+        if (mc != modCount) { throw new ConcurrentModificationException(); }
         if (v == null) {
             return null;
         } else if (old != null) {
@@ -1130,12 +1142,23 @@
             if (binCount >= TREEIFY_THRESHOLD - 1)
                 treeifyBin(tab, hash);
         }
-        ++modCount;
+        modCount = mc + 1;
         ++size;
         afterNodeInsertion(true);
         return v;
     }
 
+    /**
+     * {@inheritDoc}
+     *
+     * <p>This method will, on a best-effort basis, throw a
+     * {@link ConcurrentModificationException} if it is detected that the
+     * remapping function modifies this map during computation.
+     *
+     * @throws ConcurrentModificationException if it is detected that the
+     * remapping function modified this map
+     */
+    @Override
     public V computeIfPresent(K key,
                               BiFunction<? super K, ? super V, ? extends V> remappingFunction) {
         if (remappingFunction == null)
@@ -1144,7 +1167,9 @@
         int hash = hash(key);
         if ((e = getNode(hash, key)) != null &&
             (oldValue = e.value) != null) {
+            int mc = modCount;
             V v = remappingFunction.apply(key, oldValue);
+            if (mc != modCount) { throw new ConcurrentModificationException(); }
             if (v != null) {
                 e.value = v;
                 afterNodeAccess(e);
@@ -1156,6 +1181,16 @@
         return null;
     }
 
+    /**
+     * {@inheritDoc}
+     *
+     * <p>This method will, on a best-effort basis, throw a
+     * {@link ConcurrentModificationException} if it is detected that the
+     * remapping function modifies this map during computation.
+     *
+     * @throws ConcurrentModificationException if it is detected that the
+     * remapping function modified this map
+     */
     @Override
     public V compute(K key,
                      BiFunction<? super K, ? super V, ? extends V> remappingFunction) {
@@ -1185,7 +1220,9 @@
             }
         }
         V oldValue = (old == null) ? null : old.value;
+        int mc = modCount;
         V v = remappingFunction.apply(key, oldValue);
+        if (mc != modCount) { throw new ConcurrentModificationException(); }
         if (old != null) {
             if (v != null) {
                 old.value = v;
@@ -1202,13 +1239,23 @@
                 if (binCount >= TREEIFY_THRESHOLD - 1)
                     treeifyBin(tab, hash);
             }
-            ++modCount;
+            modCount = mc + 1;
             ++size;
             afterNodeInsertion(true);
         }
         return v;
     }
 
+    /**
+     * {@inheritDoc}
+     *
+     * <p>This method will, on a best-effort basis, throw a
+     * {@link ConcurrentModificationException} if it is detected that the
+     * remapping function modifies this map during computation.
+     *
+     * @throws ConcurrentModificationException if it is detected that the
+     * remapping function modified this map
+     */
     @Override
     public V merge(K key, V value,
                    BiFunction<? super V, ? super V, ? extends V> remappingFunction) {
@@ -1241,10 +1288,15 @@
         }
         if (old != null) {
             V v;
-            if (old.value != null)
+            if (old.value != null) {
+                int mc = modCount;
                 v = remappingFunction.apply(old.value, value);
-            else
+                if (mc != modCount) {
+                    throw new ConcurrentModificationException();
+                }
+            } else {
                 v = value;
+            }
             if (v != null) {
                 old.value = v;
                 afterNodeAccess(old);
diff --git a/jdk/src/java.base/share/classes/java/util/Hashtable.java b/jdk/src/java.base/share/classes/java/util/Hashtable.java
index 0f1f602..9501ee9 100644
--- a/jdk/src/java.base/share/classes/java/util/Hashtable.java
+++ b/jdk/src/java.base/share/classes/java/util/Hashtable.java
@@ -1000,6 +1000,16 @@
         return null;
     }
 
+    /**
+     * {@inheritDoc}
+     *
+     * <p>This method will, on a best-effort basis, throw a
+     * {@link java.util.ConcurrentModificationException} if the mapping
+     * function modified this map during computation.
+     *
+     * @throws ConcurrentModificationException if it is detected that the
+     * mapping function modified this map
+     */
     @Override
     public synchronized V computeIfAbsent(K key, Function<? super K, ? extends V> mappingFunction) {
         Objects.requireNonNull(mappingFunction);
@@ -1016,7 +1026,9 @@
             }
         }
 
+        int mc = modCount;
         V newValue = mappingFunction.apply(key);
+        if (mc != modCount) { throw new ConcurrentModificationException(); }
         if (newValue != null) {
             addEntry(hash, key, newValue, index);
         }
@@ -1024,6 +1036,16 @@
         return newValue;
     }
 
+    /**
+     * {@inheritDoc}
+     *
+     * <p>This method will, on a best-effort basis, throw a
+     * {@link java.util.ConcurrentModificationException} if the remapping
+     * function modified this map during computation.
+     *
+     * @throws ConcurrentModificationException if it is detected that the
+     * remapping function modified this map
+     */
     @Override
     public synchronized V computeIfPresent(K key, BiFunction<? super K, ? super V, ? extends V> remappingFunction) {
         Objects.requireNonNull(remappingFunction);
@@ -1035,14 +1057,18 @@
         Entry<K,V> e = (Entry<K,V>)tab[index];
         for (Entry<K,V> prev = null; e != null; prev = e, e = e.next) {
             if (e.hash == hash && e.key.equals(key)) {
+                int mc = modCount;
                 V newValue = remappingFunction.apply(key, e.value);
+                if (mc != modCount) {
+                    throw new ConcurrentModificationException();
+                }
                 if (newValue == null) {
                     if (prev != null) {
                         prev.next = e.next;
                     } else {
                         tab[index] = e.next;
                     }
-                    modCount++;
+                    modCount = mc + 1;
                     count--;
                 } else {
                     e.value = newValue;
@@ -1052,7 +1078,16 @@
         }
         return null;
     }
-
+    /**
+     * {@inheritDoc}
+     *
+     * <p>This method will, on a best-effort basis, throw a
+     * {@link java.util.ConcurrentModificationException} if the remapping
+     * function modified this map during computation.
+     *
+     * @throws ConcurrentModificationException if it is detected that the
+     * remapping function modified this map
+     */
     @Override
     public synchronized V compute(K key, BiFunction<? super K, ? super V, ? extends V> remappingFunction) {
         Objects.requireNonNull(remappingFunction);
@@ -1064,14 +1099,18 @@
         Entry<K,V> e = (Entry<K,V>)tab[index];
         for (Entry<K,V> prev = null; e != null; prev = e, e = e.next) {
             if (e.hash == hash && Objects.equals(e.key, key)) {
+                int mc = modCount;
                 V newValue = remappingFunction.apply(key, e.value);
+                if (mc != modCount) {
+                    throw new ConcurrentModificationException();
+                }
                 if (newValue == null) {
                     if (prev != null) {
                         prev.next = e.next;
                     } else {
                         tab[index] = e.next;
                     }
-                    modCount++;
+                    modCount = mc + 1;
                     count--;
                 } else {
                     e.value = newValue;
@@ -1080,7 +1119,9 @@
             }
         }
 
+        int mc = modCount;
         V newValue = remappingFunction.apply(key, null);
+        if (mc != modCount) { throw new ConcurrentModificationException(); }
         if (newValue != null) {
             addEntry(hash, key, newValue, index);
         }
@@ -1088,6 +1129,16 @@
         return newValue;
     }
 
+    /**
+     * {@inheritDoc}
+     *
+     * <p>This method will, on a best-effort basis, throw a
+     * {@link java.util.ConcurrentModificationException} if the remapping
+     * function modified this map during computation.
+     *
+     * @throws ConcurrentModificationException if it is detected that the
+     * remapping function modified this map
+     */
     @Override
     public synchronized V merge(K key, V value, BiFunction<? super V, ? super V, ? extends V> remappingFunction) {
         Objects.requireNonNull(remappingFunction);
@@ -1099,14 +1150,18 @@
         Entry<K,V> e = (Entry<K,V>)tab[index];
         for (Entry<K,V> prev = null; e != null; prev = e, e = e.next) {
             if (e.hash == hash && e.key.equals(key)) {
+                int mc = modCount;
                 V newValue = remappingFunction.apply(e.value, value);
+                if (mc != modCount) {
+                    throw new ConcurrentModificationException();
+                }
                 if (newValue == null) {
                     if (prev != null) {
                         prev.next = e.next;
                     } else {
                         tab[index] = e.next;
                     }
-                    modCount++;
+                    modCount = mc + 1;
                     count--;
                 } else {
                     e.value = newValue;
diff --git a/jdk/src/java.base/share/classes/java/util/Map.java b/jdk/src/java.base/share/classes/java/util/Map.java
index 19840b2..cf9448b 100644
--- a/jdk/src/java.base/share/classes/java/util/Map.java
+++ b/jdk/src/java.base/share/classes/java/util/Map.java
@@ -894,8 +894,8 @@
      * to {@code null}), attempts to compute its value using the given mapping
      * function and enters it into this map unless {@code null}.
      *
-     * <p>If the function returns {@code null} no mapping is recorded. If
-     * the function itself throws an (unchecked) exception, the
+     * <p>If the mapping function returns {@code null}, no mapping is recorded.
+     * If the mapping function itself throws an (unchecked) exception, the
      * exception is rethrown, and no mapping is recorded.  The most
      * common usage is to construct a new object serving as an initial
      * mapped value or memoized result, as in:
@@ -911,6 +911,7 @@
      * map.computeIfAbsent(key, k -> new HashSet<V>()).add(v);
      * }</pre>
      *
+     * <p>The mapping function should not modify this map during computation.
      *
      * @implSpec
      * The default implementation is equivalent to the following steps for this
@@ -925,16 +926,27 @@
      * }
      * }</pre>
      *
+     * <p>The default implementation makes no guarantees about detecting if the
+     * mapping function modifies this map during computation and, if
+     * appropriate, reporting an error. Non-concurrent implementations should
+     * override this method and, on a best-effort basis, throw a
+     * {@code ConcurrentModificationException} if it is detected that the
+     * mapping function modifies this map during computation. Concurrent
+     * implementations should override this method and, on a best-effort basis,
+     * throw an {@code IllegalStateException} if it is detected that the
+     * mapping function modifies this map during computation and as a result
+     * computation would never complete.
+     *
      * <p>The default implementation makes no guarantees about synchronization
      * or atomicity properties of this method. Any implementation providing
      * atomicity guarantees must override this method and document its
      * concurrency properties. In particular, all implementations of
      * subinterface {@link java.util.concurrent.ConcurrentMap} must document
-     * whether the function is applied once atomically only if the value is not
-     * present.
+     * whether the mapping function is applied once atomically only if the value
+     * is not present.
      *
      * @param key key with which the specified value is to be associated
-     * @param mappingFunction the function to compute a value
+     * @param mappingFunction the mapping function to compute a value
      * @return the current (existing or computed) value associated with
      *         the specified key, or null if the computed value is null
      * @throws NullPointerException if the specified key is null and
@@ -967,10 +979,12 @@
      * If the value for the specified key is present and non-null, attempts to
      * compute a new mapping given the key and its current mapped value.
      *
-     * <p>If the function returns {@code null}, the mapping is removed.  If the
-     * function itself throws an (unchecked) exception, the exception is
-     * rethrown, and the current mapping is left unchanged.
-    *
+     * <p>If the remapping function returns {@code null}, the mapping is removed.
+     * If the remapping function itself throws an (unchecked) exception, the
+     * exception is rethrown, and the current mapping is left unchanged.
+     *
+     * <p>The remapping function should not modify this map during computation.
+     *
      * @implSpec
      * The default implementation is equivalent to performing the following
      * steps for this {@code map}, then returning the current value or
@@ -987,16 +1001,27 @@
      * }
      * }</pre>
      *
+     * <p>The default implementation makes no guarantees about detecting if the
+     * remapping function modifies this map during computation and, if
+     * appropriate, reporting an error. Non-concurrent implementations should
+     * override this method and, on a best-effort basis, throw a
+     * {@code ConcurrentModificationException} if it is detected that the
+     * remapping function modifies this map during computation. Concurrent
+     * implementations should override this method and, on a best-effort basis,
+     * throw an {@code IllegalStateException} if it is detected that the
+     * remapping function modifies this map during computation and as a result
+     * computation would never complete.
+     *
      * <p>The default implementation makes no guarantees about synchronization
      * or atomicity properties of this method. Any implementation providing
      * atomicity guarantees must override this method and document its
      * concurrency properties. In particular, all implementations of
      * subinterface {@link java.util.concurrent.ConcurrentMap} must document
-     * whether the function is applied once atomically only if the value is not
-     * present.
+     * whether the remapping function is applied once atomically only if the
+     * value is not present.
      *
      * @param key key with which the specified value is to be associated
-     * @param remappingFunction the function to compute a value
+     * @param remappingFunction the remapping function to compute a value
      * @return the new value associated with the specified key, or null if none
      * @throws NullPointerException if the specified key is null and
      *         this map does not support null keys, or the
@@ -1037,10 +1062,12 @@
      * map.compute(key, (k, v) -> (v == null) ? msg : v.concat(msg))}</pre>
      * (Method {@link #merge merge()} is often simpler to use for such purposes.)
      *
-     * <p>If the function returns {@code null}, the mapping is removed (or
-     * remains absent if initially absent).  If the function itself throws an
-     * (unchecked) exception, the exception is rethrown, and the current mapping
-     * is left unchanged.
+     * <p>If the remapping function returns {@code null}, the mapping is removed
+     * (or remains absent if initially absent).  If the remapping function
+     * itself throws an (unchecked) exception, the exception is rethrown, and
+     * the current mapping is left unchanged.
+     *
+     * <p>The remapping function should not modify this map during computation.
      *
      * @implSpec
      * The default implementation is equivalent to performing the following
@@ -1063,16 +1090,27 @@
      * }
      * }</pre>
      *
+     * <p>The default implementation makes no guarantees about detecting if the
+     * remapping function modifies this map during computation and, if
+     * appropriate, reporting an error. Non-concurrent implementations should
+     * override this method and, on a best-effort basis, throw a
+     * {@code ConcurrentModificationException} if it is detected that the
+     * remapping function modifies this map during computation. Concurrent
+     * implementations should override this method and, on a best-effort basis,
+     * throw an {@code IllegalStateException} if it is detected that the
+     * remapping function modifies this map during computation and as a result
+     * computation would never complete.
+     *
      * <p>The default implementation makes no guarantees about synchronization
      * or atomicity properties of this method. Any implementation providing
      * atomicity guarantees must override this method and document its
      * concurrency properties. In particular, all implementations of
      * subinterface {@link java.util.concurrent.ConcurrentMap} must document
-     * whether the function is applied once atomically only if the value is not
-     * present.
+     * whether the remapping function is applied once atomically only if the
+     * value is not present.
      *
      * @param key key with which the specified value is to be associated
-     * @param remappingFunction the function to compute a value
+     * @param remappingFunction the remapping function to compute a value
      * @return the new value associated with the specified key, or null if none
      * @throws NullPointerException if the specified key is null and
      *         this map does not support null keys, or the
@@ -1121,9 +1159,11 @@
      * map.merge(key, msg, String::concat)
      * }</pre>
      *
-     * <p>If the function returns {@code null} the mapping is removed.  If the
-     * function itself throws an (unchecked) exception, the exception is
-     * rethrown, and the current mapping is left unchanged.
+     * <p>If the remapping function returns {@code null}, the mapping is removed.
+     * If the remapping function itself throws an (unchecked) exception, the
+     * exception is rethrown, and the current mapping is left unchanged.
+     *
+     * <p>The remapping function should not modify this map during computation.
      *
      * @implSpec
      * The default implementation is equivalent to performing the following
@@ -1140,19 +1180,31 @@
      *     map.put(key, newValue);
      * }</pre>
      *
+     * <p>The default implementation makes no guarantees about detecting if the
+     * remapping function modifies this map during computation and, if
+     * appropriate, reporting an error. Non-concurrent implementations should
+     * override this method and, on a best-effort basis, throw a
+     * {@code ConcurrentModificationException} if it is detected that the
+     * remapping function modifies this map during computation. Concurrent
+     * implementations should override this method and, on a best-effort basis,
+     * throw an {@code IllegalStateException} if it is detected that the
+     * remapping function modifies this map during computation and as a result
+     * computation would never complete.
+     *
      * <p>The default implementation makes no guarantees about synchronization
      * or atomicity properties of this method. Any implementation providing
      * atomicity guarantees must override this method and document its
      * concurrency properties. In particular, all implementations of
      * subinterface {@link java.util.concurrent.ConcurrentMap} must document
-     * whether the function is applied once atomically only if the value is not
-     * present.
+     * whether the remapping function is applied once atomically only if the
+     * value is not present.
      *
      * @param key key with which the resulting value is to be associated
      * @param value the non-null value to be merged with the existing value
      *        associated with the key or, if no existing value or a null value
      *        is associated with the key, to be associated with the key
-     * @param remappingFunction the function to recompute a value if present
+     * @param remappingFunction the remapping function to recompute a value if
+     *        present
      * @return the new value associated with the specified key, or null if no
      *         value is associated with the key
      * @throws UnsupportedOperationException if the {@code put} operation
diff --git a/langtools/src/java.base/share/classes/jdk/Exported.java b/jdk/src/java.base/share/classes/jdk/Exported.java
similarity index 100%
rename from langtools/src/java.base/share/classes/jdk/Exported.java
rename to jdk/src/java.base/share/classes/jdk/Exported.java
diff --git a/jdk/src/java.base/share/classes/sun/misc/Unsafe.java b/jdk/src/java.base/share/classes/sun/misc/Unsafe.java
index ef25c51..5ca9cb3 100644
--- a/jdk/src/java.base/share/classes/sun/misc/Unsafe.java
+++ b/jdk/src/java.base/share/classes/sun/misc/Unsafe.java
@@ -631,6 +631,10 @@
     /**
      * Atomically updates Java variable to {@code x} if it is currently
      * holding {@code expected}.
+     *
+     * <p>This operation has memory semantics of a {@code volatile} read
+     * and write.  Corresponds to C11 atomic_compare_exchange_strong.
+     *
      * @return {@code true} if successful
      */
     public final native boolean compareAndSwapObject(Object o, long offset,
@@ -640,6 +644,10 @@
     /**
      * Atomically updates Java variable to {@code x} if it is currently
      * holding {@code expected}.
+     *
+     * <p>This operation has memory semantics of a {@code volatile} read
+     * and write.  Corresponds to C11 atomic_compare_exchange_strong.
+     *
      * @return {@code true} if successful
      */
     public final native boolean compareAndSwapInt(Object o, long offset,
@@ -649,6 +657,10 @@
     /**
      * Atomically updates Java variable to {@code x} if it is currently
      * holding {@code expected}.
+     *
+     * <p>This operation has memory semantics of a {@code volatile} read
+     * and write.  Corresponds to C11 atomic_compare_exchange_strong.
+     *
      * @return {@code true} if successful
      */
     public final native boolean compareAndSwapLong(Object o, long offset,
diff --git a/jdk/src/java.base/share/classes/sun/reflect/misc/FieldUtil.java b/jdk/src/java.base/share/classes/sun/reflect/misc/FieldUtil.java
index d0cb48f..705597c 100644
--- a/jdk/src/java.base/share/classes/sun/reflect/misc/FieldUtil.java
+++ b/jdk/src/java.base/share/classes/sun/reflect/misc/FieldUtil.java
@@ -45,9 +45,4 @@
         ReflectUtil.checkPackageAccess(cls);
         return cls.getFields();
     }
-
-    public static Field[] getDeclaredFields(Class<?> cls) {
-        ReflectUtil.checkPackageAccess(cls);
-        return cls.getDeclaredFields();
-    }
 }
diff --git a/jdk/src/java.base/share/classes/sun/util/calendar/ZoneInfoFile.java b/jdk/src/java.base/share/classes/sun/util/calendar/ZoneInfoFile.java
index 78d9f3e..61efb54 100644
--- a/jdk/src/java.base/share/classes/sun/util/calendar/ZoneInfoFile.java
+++ b/jdk/src/java.base/share/classes/sun/util/calendar/ZoneInfoFile.java
@@ -625,6 +625,15 @@
                     params[2] = 5;
                     params[3] = 86400000;
                 }
+                // Additional check for startDayOfWeek=6 and starTime=86400000
+                // is needed for Asia/Amman; Asia/Gasa and Asia/Hebron
+                if (params[2] == 7 && params[3] == 0 &&
+                     (zoneId.equals("Asia/Amman") ||
+                      zoneId.equals("Asia/Gaza") ||
+                      zoneId.equals("Asia/Hebron"))) {
+                    params[2] = 6;        // Friday
+                    params[3] = 86400000; // 24h
+                }
                 //endDayOfWeek and endTime workaround
                 if (params[7] == 6 && params[8] == 0 &&
                     (zoneId.equals("Africa/Cairo"))) {
diff --git a/jdk/src/java.base/share/native/libjli/java.c b/jdk/src/java.base/share/native/libjli/java.c
index 846e683..fa4c1c9 100644
--- a/jdk/src/java.base/share/native/libjli/java.c
+++ b/jdk/src/java.base/share/native/libjli/java.c
@@ -730,7 +730,7 @@
 static int
 parse_size(const char *s, jlong *result) {
   jlong n = 0;
-  int args_read = sscanf(s, jlong_format_specifier(), &n);
+  int args_read = sscanf(s, JLONG_FORMAT_SPECIFIER, &n);
   if (args_read != 1) {
     return 0;
   }
@@ -798,7 +798,7 @@
              * overflow before the JVM startup code can check to make sure the stack
              * is big enough.
              */
-            if (threadStackSize < STACK_SIZE_MINIMUM) {
+            if (threadStackSize < (jlong)STACK_SIZE_MINIMUM) {
                 threadStackSize = STACK_SIZE_MINIMUM;
             }
         }
diff --git a/jdk/src/java.base/share/native/libjli/java.h b/jdk/src/java.base/share/native/libjli/java.h
index 5cc7608..1bff9a4 100644
--- a/jdk/src/java.base/share/native/libjli/java.h
+++ b/jdk/src/java.base/share/native/libjli/java.h
@@ -144,8 +144,6 @@
 void JLI_ReportExceptionDescription(JNIEnv * env);
 void PrintMachineDependentOptions();
 
-const char *jlong_format_specifier();
-
 /*
  * Block current thread and continue execution in new thread
  */
diff --git a/jdk/src/java.base/share/native/libjli/manifest_info.h b/jdk/src/java.base/share/native/libjli/manifest_info.h
index 5f9773e..1e04058 100644
--- a/jdk/src/java.base/share/native/libjli/manifest_info.h
+++ b/jdk/src/java.base/share/native/libjli/manifest_info.h
@@ -109,6 +109,8 @@
 /*
  * Macros for getting end of central directory header (END) fields
  */
+#define ENDNMD(b) SH(b, 4)          /* number of this disk */
+#define ENDDSK(b) SH(b, 6)          /* disk number of start */
 #define ENDSUB(b) SH(b, 8)          /* number of entries on this disk */
 #define ENDTOT(b) SH(b, 10)         /* total number of entries */
 #define ENDSIZ(b) LG(b, 12)         /* central directory size */
diff --git a/jdk/src/java.base/share/native/libjli/parse_manifest.c b/jdk/src/java.base/share/native/libjli/parse_manifest.c
index 9ce82c1..54f2adf 100644
--- a/jdk/src/java.base/share/native/libjli/parse_manifest.c
+++ b/jdk/src/java.base/share/native/libjli/parse_manifest.c
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -111,52 +111,127 @@
     return (NULL);
 }
 
-static jboolean zip64_present = JNI_FALSE;
+/*
+ * Implementation notes:
+ *
+ * This is a zip format reader for seekable files, that tolerates
+ * leading and trailing garbage, and tolerates having had internal
+ * offsets adjusted for leading garbage (as with Info-Zip's zip -A).
+ *
+ * We find the end header by scanning backwards from the end of the
+ * file for the end signature.  This may fail in the presence of
+ * trailing garbage or a ZIP file comment that contains binary data.
+ * Similarly, the ZIP64 end header may need to be located by scanning
+ * backwards from the end header.  It may be misidentified, but this
+ * is very unlikely to happen in practice without adversarial input.
+ *
+ * The zip file format is documented at:
+ * https://www.pkware.com/documents/casestudies/APPNOTE.TXT
+ *
+ * TODO: more informative error messages
+ */
+
+/** Reads count bytes from fd at position pos into given buffer. */
+static jboolean
+readAt(int fd, jlong pos, unsigned int count, void *buf) {
+    return (pos >= 0
+            && JLI_Lseek(fd, pos, SEEK_SET) == pos
+            && read(fd, buf, count) == (jlong) count);
+}
+
 
 /*
- * Checks to see if we have ZIP64 archive, and save
- * the check for later use
+ * Tells whether given header values (obtained from either ZIP64 or
+ * non-ZIP64 header) appear to be correct, by checking the first LOC
+ * and CEN headers.
+ */
+static jboolean
+is_valid_end_header(int fd, jlong endpos,
+                    jlong censiz, jlong cenoff, jlong entries) {
+    Byte cenhdr[CENHDR];
+    Byte lochdr[LOCHDR];
+    // Expected offset of the first central directory header
+    jlong censtart = endpos - censiz;
+    // Expected position within the file that offsets are relative to
+    jlong base_offset = endpos - (censiz + cenoff);
+    return censtart >= 0 && cenoff >= 0 &&
+        (censiz == 0 ||
+         // Validate first CEN and LOC header signatures.
+         // Central directory must come directly before the end header.
+         (readAt(fd, censtart, CENHDR, cenhdr)
+          && CENSIG_AT(cenhdr)
+          && readAt(fd, base_offset + CENOFF(cenhdr), LOCHDR, lochdr)
+          && LOCSIG_AT(lochdr)
+          && CENNAM(cenhdr) == LOCNAM(lochdr)));
+}
+
+/*
+ * Tells whether p appears to be pointing at a valid ZIP64 end header.
+ * Values censiz, cenoff, and entries are the corresponding values
+ * from the non-ZIP64 end header.  We perform extra checks to avoid
+ * misidentifying data from the last entry as a ZIP64 end header.
+ */
+static jboolean
+is_zip64_endhdr(int fd, const Byte *p, jlong end64pos,
+                jlong censiz, jlong cenoff, jlong entries) {
+    if (ZIP64_ENDSIG_AT(p)) {
+        jlong censiz64 = ZIP64_ENDSIZ(p);
+        jlong cenoff64 = ZIP64_ENDOFF(p);
+        jlong entries64 = ZIP64_ENDTOT(p);
+        return (censiz64 == censiz || censiz == ZIP64_MAGICVAL)
+            && (cenoff64 == cenoff || cenoff == ZIP64_MAGICVAL)
+            && (entries64 == entries || entries == ZIP64_MAGICCOUNT)
+            && is_valid_end_header(fd, end64pos, censiz64, cenoff64, entries64);
+    }
+    return JNI_FALSE;
+}
+
+/*
+ * Given a non-ZIP64 end header located at endhdr and endpos, look for
+ * an adjacent ZIP64 end header, finding the base offset and censtart
+ * from the ZIP64 header if available, else from the non-ZIP64 header.
+ * @return 0 if successful, -1 in case of failure
  */
 static int
-haveZIP64(Byte *p) {
-    jlong cenlen, cenoff, centot;
-    cenlen = ENDSIZ(p);
-    cenoff = ENDOFF(p);
-    centot = ENDTOT(p);
-    zip64_present = (cenlen == ZIP64_MAGICVAL ||
-                     cenoff == ZIP64_MAGICVAL ||
-                     centot == ZIP64_MAGICCOUNT);
-    return zip64_present;
-}
-
-static jlong
-find_end64(int fd, Byte *ep, jlong pos)
+find_positions64(int fd, const Byte * const endhdr, const jlong endpos,
+                 jlong* base_offset, jlong* censtart)
 {
+    jlong censiz = ENDSIZ(endhdr);
+    jlong cenoff = ENDOFF(endhdr);
+    jlong entries = ENDTOT(endhdr);
     jlong end64pos;
-    jlong bytes;
-    if ((end64pos = JLI_Lseek(fd, pos - ZIP64_LOCHDR, SEEK_SET)) < (jlong)0)
-        return -1;
-    if ((bytes = read(fd, ep, ZIP64_LOCHDR)) < 0)
-        return -1;
-    if (ZIP64_LOCSIG_AT(ep))
-       return end64pos;
-    return -1;
+    Byte buf[ZIP64_ENDHDR + ZIP64_LOCHDR];
+    if (censiz + cenoff != endpos
+        && (end64pos = endpos - sizeof(buf)) >= (jlong)0
+        && readAt(fd, end64pos, sizeof(buf), buf)
+        && ZIP64_LOCSIG_AT(buf + ZIP64_ENDHDR)
+        && (jlong) ZIP64_LOCDSK(buf + ZIP64_ENDHDR) == ENDDSK(endhdr)
+        && (is_zip64_endhdr(fd, buf, end64pos, censiz, cenoff, entries)
+            || // A variable sized "zip64 extensible data sector" ?
+            ((end64pos = ZIP64_LOCOFF(buf + ZIP64_ENDHDR)) >= (jlong)0
+             && readAt(fd, end64pos, ZIP64_ENDHDR, buf)
+             && is_zip64_endhdr(fd, buf, end64pos, censiz, cenoff, entries)))
+        ) {
+        *censtart = end64pos - ZIP64_ENDSIZ(buf);
+        *base_offset = *censtart - ZIP64_ENDOFF(buf);
+    } else {
+        if (!is_valid_end_header(fd, endpos, censiz, cenoff, entries))
+            return -1;
+        *censtart = endpos - censiz;
+        *base_offset = *censtart - cenoff;
+    }
+    return 0;
 }
 
 /*
- * A very little used routine to handle the case that zip file has
- * a comment at the end. Believe it or not, the only way to find the
- * END record is to walk backwards, byte by bloody byte looking for
- * the END record signature.
+ * Finds the base offset and censtart of the zip file.
  *
- *      fd:     File descriptor of the jar file.
- *      eb:     Pointer to a buffer to receive a copy of the END header.
- *
- * Returns the offset of the END record in the file on success,
- * -1 on failure.
+ * @param fd file descriptor of the jar file
+ * @param eb scratch buffer
+ * @return 0 if successful, -1 in case of failure
  */
-static jlong
-find_end(int fd, Byte *eb)
+static int
+find_positions(int fd, Byte *eb, jlong* base_offset, jlong* censtart)
 {
     jlong   len;
     jlong   pos;
@@ -174,10 +249,10 @@
      */
     if ((pos = JLI_Lseek(fd, -ENDHDR, SEEK_END)) < (jlong)0)
         return (-1);
-    if ((bytes = read(fd, eb, ENDHDR)) < 0)
+    if (read(fd, eb, ENDHDR) < 0)
         return (-1);
     if (ENDSIG_AT(eb)) {
-        return haveZIP64(eb) ? find_end64(fd, eb, pos) : pos;
+        return find_positions64(fd, eb, pos, base_offset, censtart);
     }
 
     /*
@@ -193,7 +268,13 @@
         return (-1);
     if ((buffer = malloc(END_MAXLEN)) == NULL)
         return (-1);
-    if ((bytes = read(fd, buffer, len)) < 0) {
+
+    /*
+     * read() on windows takes an unsigned int for count. Casting len
+     * to an unsigned int here is safe since it is guaranteed to be
+     * less than END_MAXLEN.
+     */
+    if ((bytes = read(fd, buffer, (unsigned int)len)) < 0) {
         free(buffer);
         return (-1);
     }
@@ -208,7 +289,7 @@
             (void) memcpy(eb, cp, ENDHDR);
             free(buffer);
             pos = flen - (endpos - cp);
-            return haveZIP64(eb) ? find_end64(fd, eb, pos) : pos;
+            return find_positions64(fd, eb, pos, base_offset, censtart);
         }
     free(buffer);
     return (-1);
@@ -218,82 +299,6 @@
 #define MINREAD 1024
 
 /*
- * Computes and positions at the start of the CEN header, ie. the central
- * directory, this will also return the offset if there is a zip file comment
- * at the end of the archive, for most cases this would be 0.
- */
-static jlong
-compute_cen(int fd, Byte *bp)
-{
-    int bytes;
-    Byte *p;
-    jlong base_offset;
-    jlong offset;
-    char buffer[MINREAD];
-    p = (Byte*) buffer;
-    /*
-     * Read the END Header, which is the starting point for ZIP files.
-     * (Clearly designed to make writing a zip file easier than reading
-     * one. Now isn't that precious...)
-     */
-    if ((base_offset = find_end(fd, bp)) == -1) {
-        return (-1);
-    }
-    p = bp;
-    /*
-     * There is a historical, but undocumented, ability to allow for
-     * additional "stuff" to be prepended to the zip/jar file. It seems
-     * that this has been used to prepend an actual java launcher
-     * executable to the jar on Windows.  Although this is just another
-     * form of statically linking a small piece of the JVM to the
-     * application, we choose to continue to support it.  Note that no
-     * guarantees have been made (or should be made) to the customer that
-     * this will continue to work.
-     *
-     * Therefore, calculate the base offset of the zip file (within the
-     * expanded file) by assuming that the central directory is followed
-     * immediately by the end record.
-     */
-    if (zip64_present) {
-        if ((offset = ZIP64_LOCOFF(p)) < (jlong)0) {
-            return -1;
-        }
-        if (JLI_Lseek(fd, offset, SEEK_SET) < (jlong) 0) {
-            return (-1);
-        }
-        if ((bytes = read(fd, buffer, MINREAD)) < 0) {
-            return (-1);
-        }
-        if (!ZIP64_ENDSIG_AT(buffer)) {
-            return -1;
-        }
-        if ((offset = ZIP64_ENDOFF(buffer)) < (jlong)0) {
-            return -1;
-        }
-        if (JLI_Lseek(fd, offset, SEEK_SET) < (jlong)0) {
-            return (-1);
-        }
-        p = (Byte*) buffer;
-        base_offset = base_offset - ZIP64_ENDSIZ(p) - ZIP64_ENDOFF(p) - ZIP64_ENDHDR;
-    } else {
-        base_offset = base_offset - ENDSIZ(p) - ENDOFF(p);
-        /*
-         * The END Header indicates the start of the Central Directory
-         * Headers. Remember that the desired Central Directory Header (CEN)
-         * will almost always be the second one and the first one is a small
-         * directory entry ("META-INF/"). Keep the code optimized for
-         * that case.
-         *
-         * Seek to the beginning of the Central Directory.
-         */
-        if (JLI_Lseek(fd, base_offset + ENDOFF(p), SEEK_SET) < (jlong) 0) {
-            return (-1);
-        }
-    }
-    return base_offset;
-}
-
-/*
  * Locate the manifest file with the zip/jar file.
  *
  *      fd:     File descriptor of the jar file.
@@ -327,7 +332,23 @@
     int     res;
     int     entry_size;
     int     read_size;
+
+    /*
+     * The (imaginary) position within the file relative to which
+     * offsets within the zip file refer.  This is usually the
+     * location of the first local header (the start of the zip data)
+     * (which in turn is usually 0), but if the zip file has content
+     * prepended, then it will be either 0 or the length of the
+     * prepended content, depending on whether or not internal offsets
+     * have been adjusted (via e.g. zip -A).  May be negative if
+     * content is prepended, zip -A is run, then the prefix is
+     * detached!
+     */
     jlong   base_offset;
+
+    /** The position within the file of the start of the central directory. */
+    jlong   censtart;
+
     Byte    *p;
     Byte    *bp;
     Byte    *buffer;
@@ -338,9 +359,11 @@
     }
 
     bp = buffer;
-    base_offset = compute_cen(fd, bp);
-    if (base_offset == -1) {
-        free(buffer);
+
+    if (find_positions(fd, bp, &base_offset, &censtart) == -1) {
+        return -1;
+    }
+    if (JLI_Lseek(fd, censtart, SEEK_SET) < (jlong) 0) {
         return -1;
     }
 
@@ -574,7 +597,7 @@
     info->jre_version = NULL;
     info->jre_restrict_search = 0;
     info->splashscreen_image_file_name = NULL;
-    if (rc = find_file(fd, &entry, manifest_name) != 0) {
+    if ((rc = find_file(fd, &entry, manifest_name)) != 0) {
         close(fd);
         return (-2);
     }
@@ -675,7 +698,7 @@
         return (-1);
     }
 
-    if (rc = find_file(fd, &entry, manifest_name) != 0) {
+    if ((rc = find_file(fd, &entry, manifest_name)) != 0) {
         close(fd);
         return (-2);
     }
diff --git a/jdk/src/java.base/share/native/libjli/splashscreen_stubs.c b/jdk/src/java.base/share/native/libjli/splashscreen_stubs.c
index 9c1f514..f741ccf 100644
--- a/jdk/src/java.base/share/native/libjli/splashscreen_stubs.c
+++ b/jdk/src/java.base/share/native/libjli/splashscreen_stubs.c
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -61,11 +61,11 @@
 #define INVOKEV(name) _INVOKE(name, ,;)
 
 int     DoSplashLoadMemory(void* pdata, int size) {
-    INVOKE(SplashLoadMemory, NULL)(pdata, size);
+    INVOKE(SplashLoadMemory, 0)(pdata, size);
 }
 
 int     DoSplashLoadFile(const char* filename) {
-    INVOKE(SplashLoadFile, NULL)(filename);
+    INVOKE(SplashLoadFile, 0)(filename);
 }
 
 void    DoSplashInit(void) {
@@ -87,4 +87,4 @@
 char*    DoSplashGetScaledImageName(const char* fileName, const char* jarName,
                                     float* scaleFactor) {
     INVOKE(SplashGetScaledImageName, NULL)(fileName, jarName, scaleFactor);
-}
\ No newline at end of file
+}
diff --git a/jdk/src/java.base/share/native/libjli/wildcard.c b/jdk/src/java.base/share/native/libjli/wildcard.c
index 96dac73..d8c9df0 100644
--- a/jdk/src/java.base/share/native/libjli/wildcard.c
+++ b/jdk/src/java.base/share/native/libjli/wildcard.c
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -274,7 +274,7 @@
 }
 
 static void
-FileList_addSubstring(FileList fl, const char *beg, int len)
+FileList_addSubstring(FileList fl, const char *beg, size_t len)
 {
     char *filename = (char *) JLI_MemAlloc(len+1);
     memcpy(filename, beg, len);
@@ -310,7 +310,7 @@
 FileList_split(const char *path, char sep)
 {
     const char *p, *q;
-    int len = (int)JLI_StrLen(path);
+    size_t len = JLI_StrLen(path);
     int count;
     FileList fl;
     for (count = 1, p = path; p < path + len; p++)
diff --git a/jdk/src/java.base/unix/classes/java/lang/ProcessImpl.java b/jdk/src/java.base/unix/classes/java/lang/ProcessImpl.java
index 42d4059..7fa7dfe 100644
--- a/jdk/src/java.base/unix/classes/java/lang/ProcessImpl.java
+++ b/jdk/src/java.base/unix/classes/java/lang/ProcessImpl.java
@@ -285,8 +285,6 @@
      *   1 - fork(2) and exec(2)
      *   2 - posix_spawn(3P)
      *   3 - vfork(2) and exec(2)
-     *
-     *  (4 - clone(2) and exec(2) - obsolete and currently disabled in native code)
      * </pre>
      * @param fds an array of three file descriptors.
      *        Indexes 0, 1, and 2 correspond to standard input,
diff --git a/jdk/src/java.base/unix/conf/arm/jvm.cfg b/jdk/src/java.base/unix/conf/arm/jvm.cfg
deleted file mode 100644
index c462113..0000000
--- a/jdk/src/java.base/unix/conf/arm/jvm.cfg
+++ /dev/null
@@ -1,35 +0,0 @@
-# Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# This code is free software; you can redistribute it and/or modify it
-# 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.
-#
-# List of JVMs that can be used as an option to java, javac, etc.
-# Order is important -- first in this list is the default JVM.
-# NOTE that this both this file and its format are UNSUPPORTED and
-# WILL GO AWAY in a future release.
-#
-# You may also select a JVM in an arbitrary location with the
-# "-XXaltjvm=<jvm_dir>" option, but that too is unsupported
-# and may not be available in a future release.
-#
--client IF_SERVER_CLASS -server
--server KNOWN
--minimal KNOWN
diff --git a/jdk/src/java.base/unix/conf/ppc/jvm.cfg b/jdk/src/java.base/unix/conf/ppc/jvm.cfg
deleted file mode 100644
index e930341..0000000
--- a/jdk/src/java.base/unix/conf/ppc/jvm.cfg
+++ /dev/null
@@ -1,35 +0,0 @@
-# Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# This code is free software; you can redistribute it and/or modify it
-# 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.
-#
-# List of JVMs that can be used as an option to java, javac, etc.
-# Order is important -- first in this list is the default JVM.
-# NOTE that this both this file and its format are UNSUPPORTED and
-# WILL GO AWAY in a future release.
-#
-# You may also select a JVM in an arbitrary location with the
-# "-XXaltjvm=<jvm_dir>" option, but that too is unsupported
-# and may not be available in a future release.
-#
--client KNOWN
--server KNOWN
--minimal KNOWN
diff --git a/jdk/src/java.base/unix/native/libjava/ProcessImpl_md.c b/jdk/src/java.base/unix/native/libjava/ProcessImpl_md.c
index 3a962ab..b2992b5 100644
--- a/jdk/src/java.base/unix/native/libjava/ProcessImpl_md.c
+++ b/jdk/src/java.base/unix/native/libjava/ProcessImpl_md.c
@@ -97,8 +97,7 @@
  *   address space temporarily, before launching the target command.
  *
  * Based on the above analysis, we are currently using vfork() on
- * Linux and spawn() on other Unix systems, but the code to use clone()
- * and fork() remains.
+ * Linux and posix_spawn() on other Unix systems.
  */
 
 
@@ -385,39 +384,13 @@
 }
 
 /**
- * We are unusually paranoid; use of clone/vfork is
+ * We are unusually paranoid; use of vfork is
  * especially likely to tickle gcc/glibc bugs.
  */
 #ifdef __attribute_noinline__  /* See: sys/cdefs.h */
 __attribute_noinline__
 #endif
 
-#define START_CHILD_USE_CLONE 0  /* clone() currently disabled; see above. */
-
-#ifdef START_CHILD_USE_CLONE
-static pid_t
-cloneChild(ChildStuff *c) {
-#ifdef __linux__
-#define START_CHILD_CLONE_STACK_SIZE (64 * 1024)
-    /*
-     * See clone(2).
-     * Instead of worrying about which direction the stack grows, just
-     * allocate twice as much and start the stack in the middle.
-     */
-    if ((c->clone_stack = malloc(2 * START_CHILD_CLONE_STACK_SIZE)) == NULL)
-        /* errno will be set to ENOMEM */
-        return -1;
-    return clone(childProcess,
-                 c->clone_stack + START_CHILD_CLONE_STACK_SIZE,
-                 CLONE_VFORK | CLONE_VM | SIGCHLD, c);
-#else
-/* not available on Solaris / Mac */
-    assert(0);
-    return -1;
-#endif
-}
-#endif
-
 static pid_t
 vforkChild(ChildStuff *c) {
     volatile pid_t resultPid;
@@ -590,12 +563,11 @@
     c->argv = NULL;
     c->envv = NULL;
     c->pdir = NULL;
-    c->clone_stack = NULL;
 
     /* Convert prog + argBlock into a char ** argv.
      * Add one word room for expansion of argv for use by
      * execve_as_traditional_shell_script.
-     * This word is also used when using spawn mode
+     * This word is also used when using posix_spawn mode
      */
     assert(prog != NULL && argBlock != NULL);
     if ((phelperpath = getBytes(env, helperpath))   == NULL) goto Catch;
@@ -654,7 +626,7 @@
             throwIOException(env, errno, "fork failed");
             break;
           case MODE_POSIX_SPAWN:
-            throwIOException(env, errno, "spawn failed");
+            throwIOException(env, errno, "posix_spawn failed");
             break;
         }
         goto Catch;
@@ -677,8 +649,6 @@
     fds[2] = (err[0] != -1) ? err[0] : -1;
 
  Finally:
-    free(c->clone_stack);
-
     /* Always clean up the child's side of the pipes */
     closeSafely(in [0]);
     closeSafely(out[1]);
diff --git a/jdk/src/java.base/unix/native/libjava/childproc.c b/jdk/src/java.base/unix/native/libjava/childproc.c
index 1d183cf..3f2932f 100644
--- a/jdk/src/java.base/unix/native/libjava/childproc.c
+++ b/jdk/src/java.base/unix/native/libjava/childproc.c
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -304,7 +304,7 @@
 }
 
 /**
- * Child process after a successful fork() or clone().
+ * Child process after a successful fork().
  * This function must not return, and must be prepared for either all
  * of its address space to be shared with its parent, or to be a copy.
  * It must not modify global variables such as "environ".
diff --git a/jdk/src/java.base/unix/native/libjava/childproc.h b/jdk/src/java.base/unix/native/libjava/childproc.h
index 4dd129c..4a32b93 100644
--- a/jdk/src/java.base/unix/native/libjava/childproc.h
+++ b/jdk/src/java.base/unix/native/libjava/childproc.h
@@ -101,7 +101,6 @@
     const char **envv;
     const char *pdir;
     int redirectErrorStream;
-    void *clone_stack;
 } ChildStuff;
 
 /* following used in addition when mode is SPAWN */
diff --git a/jdk/src/java.base/unix/native/libjava/jni_util_md.c b/jdk/src/java.base/unix/native/libjava/jni_util_md.c
index 36d3565..e0c479b 100644
--- a/jdk/src/java.base/unix/native/libjava/jni_util_md.c
+++ b/jdk/src/java.base/unix/native/libjava/jni_util_md.c
@@ -55,10 +55,12 @@
 size_t
 getLastErrorString(char *buf, size_t len)
 {
+    char *err;
+    size_t n;
     if (errno == 0 || len < 1) return 0;
 
-    const char *err = strerror(errno);
-    size_t n = strlen(err);
+    err = strerror(errno);
+    n = strlen(err);
     if (n >= len)
         n = len - 1;
 
diff --git a/jdk/src/java.base/unix/native/libjli/java_md.h b/jdk/src/java.base/unix/native/libjli/java_md.h
index 212ae0a..ab99dbb 100644
--- a/jdk/src/java.base/unix/native/libjli/java_md.h
+++ b/jdk/src/java.base/unix/native/libjli/java_md.h
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 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
@@ -43,6 +43,12 @@
 #define MAXNAMELEN              PATH_MAX
 #endif
 
+#ifdef _LP64
+#define JLONG_FORMAT_SPECIFIER "%ld"
+#else
+#define JLONG_FORMAT_SPECIFIER "%lld"
+#endif
+
 int UnsetEnv(char *name);
 char *FindExecName(char *program);
 const char *SetExecname(char **argv);
diff --git a/jdk/src/java.base/unix/native/libjli/java_md_common.c b/jdk/src/java.base/unix/native/libjli/java_md_common.c
index 27d5a2d..48c0d8b 100644
--- a/jdk/src/java.base/unix/native/libjli/java_md_common.c
+++ b/jdk/src/java.base/unix/native/libjli/java_md_common.c
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 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
@@ -269,11 +269,6 @@
     return(borrowed_unsetenv(name));
 }
 
-const char *
-jlong_format_specifier() {
-    return "%lld";
-}
-
 jboolean
 IsJavaw()
 {
diff --git a/jdk/src/java.base/unix/native/libjli/java_md_solinux.c b/jdk/src/java.base/unix/native/libjli/java_md_solinux.c
index c453276b..00b0f69 100644
--- a/jdk/src/java.base/unix/native/libjli/java_md_solinux.c
+++ b/jdk/src/java.base/unix/native/libjli/java_md_solinux.c
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 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
@@ -888,7 +888,7 @@
     if (pthread_create(&tid, &attr, (void *(*)(void*))continuation, (void*)args) == 0) {
       void * tmp;
       pthread_join(tid, &tmp);
-      rslt = (int)tmp;
+      rslt = (int)(intptr_t)tmp;
     } else {
      /*
       * Continue execution in current thread if for some reason (e.g. out of
@@ -906,7 +906,7 @@
     if (thr_create(NULL, stack_size, (void *(*)(void *))continuation, args, flags, &tid) == 0) {
       void * tmp;
       thr_join(tid, NULL, &tmp);
-      rslt = (int)tmp;
+      rslt = (int)(intptr_t)tmp;
     } else {
       /* See above. Continue in current thread if thr_create() failed */
       rslt = continuation(args);
diff --git a/jdk/src/java.base/windows/native/libjli/cmdtoargs.c b/jdk/src/java.base/windows/native/libjli/cmdtoargs.c
index f4f8938..cfc1a46 100644
--- a/jdk/src/java.base/windows/native/libjli/cmdtoargs.c
+++ b/jdk/src/java.base/windows/native/libjli/cmdtoargs.c
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 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
@@ -77,7 +77,7 @@
     USHORT ch = 0;
     int i;
     jboolean done = JNI_FALSE;
-    int charLength;
+    ptrdiff_t charLength;
 
     *wildcard = JNI_FALSE;
     while (!done) {
@@ -208,10 +208,12 @@
         argv = (StdArg*) JLI_MemRealloc(argv, (nargs+1) * sizeof(StdArg));
         argv[nargs].arg = JLI_StringDup(arg);
         argv[nargs].has_wildcard = wildcard;
-        *arg = NULL;
+        *arg = '\0';
         nargs++;
     } while (src != NULL);
 
+    JLI_MemFree(arg);
+
     stdargc = nargs;
     stdargs = argv;
 }
diff --git a/jdk/src/java.base/windows/native/libjli/java_md.c b/jdk/src/java.base/windows/native/libjli/java_md.c
index 2bf50ea..596e263 100644
--- a/jdk/src/java.base/windows/native/libjli/java_md.c
+++ b/jdk/src/java.base/windows/native/libjli/java_md.c
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -107,7 +107,7 @@
  * GetParamValue("theParam", "theParam=value") returns pointer to "value".
  */
 const char * GetParamValue(const char *paramName, const char *arg) {
-    int nameLen = JLI_StrLen(paramName);
+    size_t nameLen = JLI_StrLen(paramName);
     if (JLI_StrNCmp(paramName, arg, nameLen) == 0) {
         /* arg[nameLen] is valid (may contain final NULL) */
         if (arg[nameLen] == '=') {
@@ -561,7 +561,7 @@
     if (rc < 0) {
         /* apply ansi semantics */
         buffer[size - 1] = '\0';
-        return size;
+        return (int)size;
     } else if (rc == size) {
         /* force a null terminator */
         buffer[size - 1] = '\0';
@@ -728,11 +728,6 @@
     }
 }
 
-const char *
-jlong_format_specifier() {
-    return "%I64d";
-}
-
 /*
  * Block current thread and continue execution in a new thread
  */
@@ -882,7 +877,7 @@
     if (hPreloadAwt == NULL) {
         /* awt.dll is not loaded yet */
         char libraryPath[MAXPATHLEN];
-        int jrePathLen = 0;
+        size_t jrePathLen = 0;
         HMODULE hJava = NULL;
         HMODULE hVerify = NULL;
 
@@ -1004,7 +999,8 @@
 jobjectArray
 CreateApplicationArgs(JNIEnv *env, char **strv, int argc)
 {
-    int i, j, idx, tlen;
+    int i, j, idx;
+    size_t tlen;
     jobjectArray outArray, inArray;
     char *ostart, *astart, **nargv;
     jboolean needs_expansion = JNI_FALSE;
diff --git a/jdk/src/java.base/windows/native/libjli/java_md.h b/jdk/src/java.base/windows/native/libjli/java_md.h
index aa9fc2f..76c15ea 100644
--- a/jdk/src/java.base/windows/native/libjli/java_md.h
+++ b/jdk/src/java.base/windows/native/libjli/java_md.h
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 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
@@ -39,6 +39,7 @@
 #define MAXPATHLEN      MAX_PATH
 #define MAXNAMELEN      MAX_PATH
 
+#define JLONG_FORMAT_SPECIFIER "%I64d"
 
 /*
  * Support for doing cheap, accurate interval timing.
diff --git a/jdk/src/java.desktop/macosx/classes/sun/font/CFontManager.java b/jdk/src/java.desktop/macosx/classes/sun/font/CFontManager.java
index e37e9e4..272999e 100644
--- a/jdk/src/java.desktop/macosx/classes/sun/font/CFontManager.java
+++ b/jdk/src/java.desktop/macosx/classes/sun/font/CFontManager.java
@@ -44,7 +44,6 @@
 import sun.lwawt.macosx.*;
 
 public final class CFontManager extends SunFontManager {
-    private FontConfigManager fcManager = null;
     private static Hashtable<String, Font2D> genericFonts = new Hashtable<String, Font2D>();
 
     @Override
@@ -231,15 +230,6 @@
         return font2D;
     }
 
-    /*
-    public synchronized FontConfigManager getFontConfigManager() {
-        if (fcManager  == null) {
-            fcManager = new FontConfigManager();
-        }
-        return fcManager;
-    }
-    */
-
     protected void registerFontsInDir(String dirName, boolean useJavaRasterizer, int fontRank, boolean defer, boolean resolveSymLinks) {
         loadNativeDirFonts(dirName);
         super.registerFontsInDir(dirName, useJavaRasterizer, fontRank, defer, resolveSymLinks);
diff --git a/jdk/src/java.desktop/macosx/classes/sun/font/NativeFont.java b/jdk/src/java.desktop/macosx/classes/sun/font/NativeFont.java
new file mode 100644
index 0000000..0eb6db7
--- /dev/null
+++ b/jdk/src/java.desktop/macosx/classes/sun/font/NativeFont.java
@@ -0,0 +1,107 @@
+/*
+ * 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.  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.
+ */
+
+package sun.font;
+
+import java.awt.FontFormatException;
+import java.awt.font.FontRenderContext;
+import java.awt.geom.GeneralPath;
+import java.awt.geom.Point2D;
+import java.awt.geom.Rectangle2D;
+
+/*
+ * This class should never be invoked on the windows implementation
+ * So the constructor throws a FontFormatException, which is caught
+ * and the font is ignored.
+ */
+
+public class NativeFont extends PhysicalFont {
+
+    /**
+     * Verifies native font is accessible.
+     * @throws FontFormatException - if the font can't be located.
+     */
+    public NativeFont(String platName, boolean isBitmapDelegate)
+        throws FontFormatException {
+
+        throw new FontFormatException("NativeFont not used on OS X");
+    }
+
+    static boolean hasExternalBitmaps(String platName) {
+        return false;
+    }
+
+    public CharToGlyphMapper getMapper() {
+        return null;
+    }
+
+    PhysicalFont getDelegateFont() {
+        return null;
+    }
+
+    FontStrike createStrike(FontStrikeDesc desc) {
+        return null;
+    }
+
+    public Rectangle2D getMaxCharBounds(FontRenderContext frc) {
+        return null;
+    }
+
+    StrikeMetrics getFontMetrics(long pScalerContext) {
+        return null;
+    }
+
+    public GeneralPath getGlyphOutline(long pScalerContext,
+                                       int glyphCode,
+                                       float x, float y) {
+        return null;
+    }
+
+    public  GeneralPath getGlyphVectorOutline(long pScalerContext,
+                                              int[] glyphs, int numGlyphs,
+                                              float x, float y) {
+        return null;
+    }
+
+
+    long getGlyphImage(long pScalerContext, int glyphCode) {
+        return 0L;
+    }
+
+
+    void getGlyphMetrics(long pScalerContext, int glyphCode,
+                         Point2D.Float metrics) {
+    }
+
+
+    float getGlyphAdvance(long pScalerContext, int glyphCode) {
+        return 0f;
+    }
+
+    Rectangle2D.Float getGlyphOutlineBounds(long pScalerContext,
+                                            int glyphCode) {
+        return new Rectangle2D.Float(0f, 0f, 0f, 0f);
+    }
+}
diff --git a/jdk/src/java.desktop/macosx/classes/sun/font/NativeStrike.java b/jdk/src/java.desktop/macosx/classes/sun/font/NativeStrike.java
new file mode 100644
index 0000000..de5c3ac
--- /dev/null
+++ b/jdk/src/java.desktop/macosx/classes/sun/font/NativeStrike.java
@@ -0,0 +1,86 @@
+/*
+ * 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.  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.
+ */
+
+package sun.font;
+
+import java.awt.geom.GeneralPath;
+import java.awt.geom.Point2D;
+import java.awt.Rectangle;
+import java.awt.geom.Rectangle2D;
+
+public class NativeStrike extends PhysicalStrike {
+
+    NativeFont nativeFont;
+
+    NativeStrike(NativeFont nativeFont, FontStrikeDesc desc) {
+        super(nativeFont, desc);
+
+        throw new RuntimeException("NativeFont not used on OS X");
+    }
+
+    NativeStrike(NativeFont nativeFont, FontStrikeDesc desc,
+                 boolean nocache) {
+        super(nativeFont, desc);
+
+        throw new RuntimeException("NativeFont not used on Windows");
+    }
+
+
+    void getGlyphImagePtrs(int[] glyphCodes, long[] images,int  len) {
+    }
+
+    long getGlyphImagePtr(int glyphCode) {
+        return 0L;
+    }
+
+    long getGlyphImagePtrNoCache(int glyphCode) {
+        return 0L;
+    }
+
+    void getGlyphImageBounds(int glyphcode,
+                             Point2D.Float pt,
+                             Rectangle result) {
+    }
+
+    Point2D.Float getGlyphMetrics(int glyphCode) {
+        return null;
+    }
+
+    float getGlyphAdvance(int glyphCode) {
+        return 0f;
+    }
+
+    Rectangle2D.Float getGlyphOutlineBounds(int glyphCode) {
+        return null;
+    }
+    GeneralPath getGlyphOutline(int glyphCode, float x, float y) {
+        return null;
+    }
+
+    GeneralPath getGlyphVectorOutline(int[] glyphs, float x, float y) {
+        return null;
+    }
+
+}
diff --git a/jdk/src/java.desktop/macosx/native/libawt_lwawt/awt/AWTView.m b/jdk/src/java.desktop/macosx/native/libawt_lwawt/awt/AWTView.m
index 34b9979..e7466fc 100644
--- a/jdk/src/java.desktop/macosx/native/libawt_lwawt/awt/AWTView.m
+++ b/jdk/src/java.desktop/macosx/native/libawt_lwawt/awt/AWTView.m
@@ -311,7 +311,10 @@
 }
 
 - (BOOL) performKeyEquivalent: (NSEvent *) event {
-    [self deliverJavaKeyEventHelper: event];
+    // if IM is active key events should be ignored 
+    if (![self hasMarkedText] && !fInPressAndHold) {
+        [self deliverJavaKeyEventHelper: event];
+    }
 
     // Workaround for 8020209: special case for "Cmd =" and "Cmd ." 
     // because Cocoa calls performKeyEquivalent twice for these keystrokes  
diff --git a/jdk/src/java.desktop/macosx/native/libsplashscreen/splashscreen_sys.m b/jdk/src/java.desktop/macosx/native/libsplashscreen/splashscreen_sys.m
index 25b0054..07bbd43 100644
--- a/jdk/src/java.desktop/macosx/native/libsplashscreen/splashscreen_sys.m
+++ b/jdk/src/java.desktop/macosx/native/libsplashscreen/splashscreen_sys.m
@@ -126,14 +126,28 @@
     return buf;
 }
 
+BOOL isSWTRunning() {
+    char envVar[80];
+    // If this property is present we are running SWT
+    snprintf(envVar, sizeof(envVar), "JAVA_STARTED_ON_FIRST_THREAD_%d", getpid());
+    return getenv(envVar) != NULL;
+}
+
 char* SplashGetScaledImageName(const char* jar, const char* file,
                                float *scaleFactor) {
-    NSAutoreleasePool *pool = [NSAutoreleasePool new];
     *scaleFactor = 1;
+
+    if(isSWTRunning()){
+        return nil;
+    }
+
+    NSAutoreleasePool *pool = [NSAutoreleasePool new];
     char* scaledFile = nil;
     __block float screenScaleFactor = 1;
 
     [ThreadUtilities performOnMainThreadWaiting:YES block:^(){
+        // initialize NSApplication and AWT stuff
+        [NSApplicationAWT sharedApplication];
         screenScaleFactor = [SplashNSScreen() backingScaleFactor];
     }];
 
@@ -180,12 +194,8 @@
     splash->screenFormat.byteOrder = 1 ?  BYTE_ORDER_LSBFIRST : BYTE_ORDER_MSBFIRST;
     splash->screenFormat.depthBytes = 4;
 
-    // If this property is present we are running SWT and should not start a runLoop
-    // Can't check if running SWT in webstart, so splash screen in webstart SWT
-    // applications is not supported
-    char envVar[80];
-    snprintf(envVar, sizeof(envVar), "JAVA_STARTED_ON_FIRST_THREAD_%d", getpid());
-    if (getenv(envVar) == NULL) {
+    // If we are running SWT we should not start a runLoop
+    if (!isSWTRunning()) {
         [JNFRunLoop performOnMainThreadWaiting:NO withBlock:^() {
             [NSApplicationAWT runAWTLoopWithApp:[NSApplicationAWT sharedApplication]];
         }];
diff --git a/jdk/src/java.desktop/share/classes/javax/imageio/stream/ImageInputStreamImpl.java b/jdk/src/java.desktop/share/classes/javax/imageio/stream/ImageInputStreamImpl.java
index 5d24840..8cad9a4 100644
--- a/jdk/src/java.desktop/share/classes/javax/imageio/stream/ImageInputStreamImpl.java
+++ b/jdk/src/java.desktop/share/classes/javax/imageio/stream/ImageInputStreamImpl.java
@@ -225,7 +225,7 @@
     }
 
     public short readShort() throws IOException {
-        if (read(byteBuf, 0, 2) < 0) {
+        if (read(byteBuf, 0, 2) != 2) {
             throw new EOFException();
         }
 
@@ -247,7 +247,7 @@
     }
 
     public int readInt() throws IOException {
-        if (read(byteBuf, 0, 4) < 0) {
+        if (read(byteBuf, 0, 4) !=  4) {
             throw new EOFException();
         }
 
diff --git a/jdk/src/java.desktop/share/classes/javax/swing/plaf/synth/SynthSliderUI.java b/jdk/src/java.desktop/share/classes/javax/swing/plaf/synth/SynthSliderUI.java
index 2116e65..912f3f4 100644
--- a/jdk/src/java.desktop/share/classes/javax/swing/plaf/synth/SynthSliderUI.java
+++ b/jdk/src/java.desktop/share/classes/javax/swing/plaf/synth/SynthSliderUI.java
@@ -308,14 +308,14 @@
     public Dimension getPreferredSize(JComponent c)  {
         recalculateIfInsetsChanged();
         Dimension d = new Dimension(contentRect.width, contentRect.height);
+        Insets i = slider.getInsets();
         if (slider.getOrientation() == JSlider.VERTICAL) {
             d.height = 200;
+            d.height += i.top + i.bottom;
         } else {
             d.width = 200;
+            d.width += i.left + i.right;
         }
-        Insets i = slider.getInsets();
-        d.width += i.left + i.right;
-        d.height += i.top + i.bottom;
         return d;
     }
 
diff --git a/jdk/src/java.desktop/share/classes/javax/swing/table/JTableHeader.java b/jdk/src/java.desktop/share/classes/javax/swing/table/JTableHeader.java
index 1fac3ac..fbf742a 100644
--- a/jdk/src/java.desktop/share/classes/javax/swing/table/JTableHeader.java
+++ b/jdk/src/java.desktop/share/classes/javax/swing/table/JTableHeader.java
@@ -439,6 +439,26 @@
         return tip;
     }
 
+    /**
+     * Returns the preferred size of the table header.
+     * This is the size required to display the header and requested for
+     * the viewport.
+     * The returned {@code Dimension} {@code width} will always be calculated by
+     * the underlying TableHeaderUI, regardless of any width specified by
+     * {@link JComponent#setPreferredSize(java.awt.Dimension)}
+     *
+     * @return the size
+     */
+    @Override
+    public Dimension getPreferredSize() {
+        Dimension preferredSize = super.getPreferredSize();
+        if (isPreferredSizeSet() && ui != null) {
+            Dimension size = ui.getPreferredSize(this);
+            if (size != null) preferredSize.width = size.width;
+        }
+        return preferredSize;
+    }
+
 //
 // Managing TableHeaderUI
 //
diff --git a/jdk/src/java.desktop/unix/native/libawt_xawt/awt/gtk2_interface.c b/jdk/src/java.desktop/unix/native/libawt_xawt/awt/gtk2_interface.c
index 2e35e5e..e8a45cb 100644
--- a/jdk/src/java.desktop/unix/native/libawt_xawt/awt/gtk2_interface.c
+++ b/jdk/src/java.desktop/unix/native/libawt_xawt/awt/gtk2_interface.c
@@ -368,9 +368,9 @@
     if (length > CONV_BUFFER_SIZE-1)
     {
         length = CONV_BUFFER_SIZE-1;
-#ifdef INTERNAL_BUILD
+#ifdef DEBUG
         fprintf(stderr, "Note: Detail is too long: %d chars\n", length);
-#endif /* INTERNAL_BUILD */
+#endif /* DEBUG */
     }
 
     (*env)->GetStringUTFRegion(env, val, 0, length, convertionBuffer);
@@ -507,9 +507,9 @@
             }
         }
     } else {
-#ifdef INTERNAL_BUILD
+#ifdef DEBUG
         fprintf(stderr, "Cannot load g_vfs_get_supported_uri_schemes\n");
-#endif /* INTERNAL_BUILD */
+#endif /* DEBUG */
     }
 
 }
@@ -522,23 +522,23 @@
      const char *gtk_version = fp_gtk_check_version(2, 14, 0);
      if (gtk_version != NULL) {
          // The gtk_show_uri is available from GTK+ 2.14
-#ifdef INTERNAL_BUILD
+#ifdef DEBUG
          fprintf (stderr, "The version of GTK is %s. "
              "The gtk_show_uri function is supported "
              "since GTK+ 2.14.\n", gtk_version);
-#endif /* INTERNAL_BUILD */
+#endif /* DEBUG */
      } else {
          // Loading symbols only if the GTK version is 2.14 and higher
          fp_gtk_show_uri = dl_symbol("gtk_show_uri");
          const char *dlsym_error = dlerror();
          if (dlsym_error) {
-#ifdef INTERNAL_BUILD
+#ifdef DEBUG
              fprintf (stderr, "Cannot load symbol: %s \n", dlsym_error);
-#endif /* INTERNAL_BUILD */
+#endif /* DEBUG */
          } else if (fp_gtk_show_uri == NULL) {
-#ifdef INTERNAL_BUILD
+#ifdef DEBUG
              fprintf(stderr, "dlsym(gtk_show_uri) returned NULL\n");
-#endif /* INTERNAL_BUILD */
+#endif /* DEBUG */
         } else {
             update_supported_actions(env);
             success = TRUE;
diff --git a/jdk/src/java.desktop/unix/native/libawt_xawt/xawt/XlibWrapper.c b/jdk/src/java.desktop/unix/native/libawt_xawt/xawt/XlibWrapper.c
index f1d6318..c40200e 100644
--- a/jdk/src/java.desktop/unix/native/libawt_xawt/xawt/XlibWrapper.c
+++ b/jdk/src/java.desktop/unix/native/libawt_xawt/xawt/XlibWrapper.c
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 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
@@ -49,7 +49,7 @@
 
 #include <X11/XKBlib.h>
 
-#if defined(DEBUG) || defined(INTERNAL_BUILD)
+#if defined(DEBUG)
 static jmethodID lockIsHeldMID = NULL;
 
 static void
@@ -2346,4 +2346,3 @@
 
     (*env)->ReleaseIntArrayElements(env, bitmap, values, JNI_ABORT);
 }
-
diff --git a/jdk/src/java.desktop/unix/native/libawt_xawt/xawt/gnome_interface.c b/jdk/src/java.desktop/unix/native/libawt_xawt/xawt/gnome_interface.c
index 90d56de..46c96e1 100644
--- a/jdk/src/java.desktop/unix/native/libawt_xawt/xawt/gnome_interface.c
+++ b/jdk/src/java.desktop/unix/native/libawt_xawt/xawt/gnome_interface.c
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -42,7 +42,7 @@
          // we are trying to load the library without a version suffix
          vfs_handle = dlopen(JNI_LIB_NAME("gnomevfs-2"), RTLD_LAZY);
          if (vfs_handle == NULL) {
- #ifdef INTERNAL_BUILD
+ #ifdef DEBUG
              fprintf(stderr, "can not load libgnomevfs-2.so\n");
  #endif
              return FALSE;
@@ -51,13 +51,13 @@
      dlerror(); /* Clear errors */
      gnome_vfs_init = (GNOME_VFS_INIT_TYPE*)dlsym(vfs_handle, "gnome_vfs_init");
      if (gnome_vfs_init == NULL){
- #ifdef INTERNAL_BUILD
+ #ifdef DEBUG
          fprintf(stderr, "dlsym( gnome_vfs_init) returned NULL\n");
  #endif
          return FALSE;
      }
      if ((errmsg = dlerror()) != NULL) {
- #ifdef INTERNAL_BUILD
+ #ifdef DEBUG
          fprintf(stderr, "can not find symbol gnome_vfs_init %s \n", errmsg);
  #endif
          return FALSE;
@@ -69,7 +69,7 @@
      if (gnome_handle == NULL) {
          gnome_handle = dlopen(JNI_LIB_NAME("gnome-2"), RTLD_LAZY);
          if (gnome_handle == NULL) {
- #ifdef INTERNAL_BUILD
+ #ifdef DEBUG
              fprintf(stderr, "can not load libgnome-2.so\n");
  #endif
              return FALSE;
@@ -78,7 +78,7 @@
      dlerror(); /* Clear errors */
      gnome_url_show = (GNOME_URL_SHOW_TYPE*)dlsym(gnome_handle, "gnome_url_show");
      if ((errmsg = dlerror()) != NULL) {
- #ifdef INTERNAL_BUILD
+ #ifdef DEBUG
          fprintf(stderr, "can not find symble gnome_url_show\n");
  #endif
          return FALSE;
diff --git a/jdk/src/java.desktop/windows/native/libawt/windows/awt.h b/jdk/src/java.desktop/windows/native/libawt/windows/awt.h
index 83c3fcb..0a84f65 100644
--- a/jdk/src/java.desktop/windows/native/libawt/windows/awt.h
+++ b/jdk/src/java.desktop/windows/native/libawt/windows/awt.h
@@ -228,7 +228,7 @@
 /*
  * checks if the current thread is/isn't the toolkit thread
  */
-#if defined(DEBUG) || defined(INTERNAL_BUILD)
+#if defined(DEBUG)
 #define CHECK_IS_TOOLKIT_THREAD() \
   if (GetCurrentThreadId() != AwtToolkit::MainThread())  \
   { JNU_ThrowInternalError(env,"Operation is not permitted on non-toolkit thread!\n"); }
diff --git a/jdk/src/java.logging/share/classes/java/util/logging/LogManager.java b/jdk/src/java.logging/share/classes/java/util/logging/LogManager.java
index b852d8a..0f536b2 100644
--- a/jdk/src/java.logging/share/classes/java/util/logging/LogManager.java
+++ b/jdk/src/java.logging/share/classes/java/util/logging/LogManager.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 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
@@ -31,6 +31,7 @@
 import java.security.*;
 import java.lang.ref.ReferenceQueue;
 import java.lang.ref.WeakReference;
+import java.util.concurrent.ConcurrentHashMap;
 import java.util.concurrent.CopyOnWriteArrayList;
 import sun.misc.JavaAWTAccess;
 import sun.misc.SharedSecrets;
@@ -579,7 +580,8 @@
     // added in the user context.
     class LoggerContext {
         // Table of named Loggers that maps names to Loggers.
-        private final Hashtable<String,LoggerWeakRef> namedLoggers = new Hashtable<>();
+        private final ConcurrentHashMap<String,LoggerWeakRef> namedLoggers =
+                new ConcurrentHashMap<>();
         // Tree of named Loggers
         private final LogNode root;
         private LoggerContext() {
@@ -642,21 +644,44 @@
         }
 
 
-        synchronized Logger findLogger(String name) {
-            // ensure that this context is properly initialized before
-            // looking for loggers.
-            ensureInitialized();
+        Logger findLogger(String name) {
+            // Attempt to find logger without locking.
             LoggerWeakRef ref = namedLoggers.get(name);
-            if (ref == null) {
-                return null;
+            Logger logger = ref == null ? null : ref.get();
+
+            // if logger is not null, then we can return it right away.
+            // if name is "" or "global" and logger is null
+            // we need to fall through and check that this context is
+            // initialized.
+            // if ref is not null and logger is null we also need to
+            // fall through.
+            if (logger != null || (ref == null && !name.isEmpty()
+                    && !name.equals(Logger.GLOBAL_LOGGER_NAME))) {
+                return logger;
             }
-            Logger logger = ref.get();
-            if (logger == null) {
-                // Hashtable holds stale weak reference
-                // to a logger which has been GC-ed.
-                ref.dispose();
+
+            // We either found a stale reference, or we were looking for
+            // "" or "global" and didn't find them.
+            // Make sure context is initialized (has the default loggers),
+            // and look up again, cleaning the stale reference if it hasn't
+            // been cleaned up in between. All this needs to be done inside
+            // a synchronized block.
+            synchronized(this) {
+                // ensure that this context is properly initialized before
+                // looking for loggers.
+                ensureInitialized();
+                ref = namedLoggers.get(name);
+                if (ref == null) {
+                    return null;
+                }
+                logger = ref.get();
+                if (logger == null) {
+                    // The namedLoggers map holds stale weak reference
+                    // to a logger which has been GC-ed.
+                    ref.dispose();
+                }
+                return logger;
             }
-            return logger;
         }
 
         // This method is called before adding a logger to the
@@ -752,7 +777,6 @@
             final LogManager owner = getOwner();
             logger.setLogManager(owner);
             ref = owner.new LoggerWeakRef(logger);
-            namedLoggers.put(name, ref);
 
             // Apply any initial level defined for the new logger, unless
             // the logger's level is already initialized
@@ -789,10 +813,17 @@
             node.walkAndSetParent(logger);
             // new LogNode is ready so tell the LoggerWeakRef about it
             ref.setNode(node);
+
+            // Do not publish 'ref' in namedLoggers before the logger tree
+            // is fully updated - because the named logger will be visible as
+            // soon as it is published in namedLoggers (findLogger takes
+            // benefit of the ConcurrentHashMap implementation of namedLoggers
+            // to avoid synchronizing on retrieval when that is possible).
+            namedLoggers.put(name, ref);
             return true;
         }
 
-        synchronized void removeLoggerRef(String name, LoggerWeakRef ref) {
+        void removeLoggerRef(String name, LoggerWeakRef ref) {
             namedLoggers.remove(name, ref);
         }
 
@@ -800,7 +831,7 @@
             // ensure that this context is properly initialized before
             // returning logger names.
             ensureInitialized();
-            return namedLoggers.keys();
+            return Collections.enumeration(namedLoggers.keySet());
         }
 
         // If logger.getUseParentHandlers() returns 'true' and any of the logger's
@@ -1379,7 +1410,19 @@
         reset();
 
         // Load the properties
-        props.load(ins);
+        try {
+            props.load(ins);
+        } catch (IllegalArgumentException x) {
+            // props.load may throw an IllegalArgumentException if the stream
+            // contains malformed Unicode escape sequences.
+            // We wrap that in an IOException as readConfiguration is
+            // specified to throw IOException if there are problems reading
+            // from the stream.
+            // Note: new IOException(x.getMessage(), x) allow us to get a more
+            // concise error message than new IOException(x);
+            throw new IOException(x.getMessage(), x);
+        }
+
         // Instantiate new configuration objects.
         String names[] = parseClassNames("config");
 
diff --git a/jdk/src/jdk.crypto.pkcs11/share/classes/sun/security/pkcs11/SessionManager.java b/jdk/src/jdk.crypto.pkcs11/share/classes/sun/security/pkcs11/SessionManager.java
index 798624c..571f001 100644
--- a/jdk/src/jdk.crypto.pkcs11/share/classes/sun/security/pkcs11/SessionManager.java
+++ b/jdk/src/jdk.crypto.pkcs11/share/classes/sun/security/pkcs11/SessionManager.java
@@ -90,6 +90,7 @@
 
     // maximum number of active sessions during this invocation, for debugging
     private int maxActiveSessions;
+    private Object maxActiveSessionsLock;
 
     // flags to use in the C_OpenSession() call
     private final long openSessionFlags;
@@ -113,6 +114,9 @@
         this.token = token;
         this.objSessions = new Pool(this);
         this.opSessions = new Pool(this);
+        if (debug != null) {
+            maxActiveSessionsLock = new Object();
+        }
     }
 
     // returns whether only a fairly low number of sessions are
@@ -212,7 +216,7 @@
         Session session = new Session(token, id);
         activeSessions.incrementAndGet();
         if (debug != null) {
-            synchronized(this) {
+            synchronized(maxActiveSessionsLock) {
                 if (activeSessions.get() > maxActiveSessions) {
                     maxActiveSessions = activeSessions.get();
                     if (maxActiveSessions % 10 == 0) {
diff --git a/jdk/src/jdk.zipfs/share/classes/jdk/nio/zipfs/ZipConstants.java b/jdk/src/jdk.zipfs/share/classes/jdk/nio/zipfs/ZipConstants.java
index 0a080a2..211e5a3 100644
--- a/jdk/src/jdk.zipfs/share/classes/jdk/nio/zipfs/ZipConstants.java
+++ b/jdk/src/jdk.zipfs/share/classes/jdk/nio/zipfs/ZipConstants.java
@@ -184,10 +184,19 @@
         return (LG(b, n)) | (LG(b, n + 4) << 32);
     }
 
-    static final long GETSIG(byte[] b) {
-        return LG(b, 0);
+    static long getSig(byte[] b, int n) { return LG(b, n); }
+
+    private static boolean pkSigAt(byte[] b, int n, int b1, int b2) {
+        return b[n] == 'P' & b[n + 1] == 'K' & b[n + 2] == b1 & b[n + 3] == b2;
     }
 
+    static boolean cenSigAt(byte[] b, int n) { return pkSigAt(b, n, 1, 2); }
+    static boolean locSigAt(byte[] b, int n) { return pkSigAt(b, n, 3, 4); }
+    static boolean endSigAt(byte[] b, int n) { return pkSigAt(b, n, 5, 6); }
+    static boolean extSigAt(byte[] b, int n) { return pkSigAt(b, n, 7, 8); }
+    static boolean end64SigAt(byte[] b, int n) { return pkSigAt(b, n, 6, 6); }
+    static boolean locator64SigAt(byte[] b, int n) { return pkSigAt(b, n, 6, 7); }
+
     // local file (LOC) header fields
     static final long LOCSIG(byte[] b) { return LG(b, 0); } // signature
     static final int  LOCVER(byte[] b) { return SH(b, 4); } // version needed to extract
diff --git a/jdk/src/jdk.zipfs/share/classes/jdk/nio/zipfs/ZipFileSystem.java b/jdk/src/jdk.zipfs/share/classes/jdk/nio/zipfs/ZipFileSystem.java
index aa58494..d5cd4cf 100644
--- a/jdk/src/jdk.zipfs/share/classes/jdk/nio/zipfs/ZipFileSystem.java
+++ b/jdk/src/jdk.zipfs/share/classes/jdk/nio/zipfs/ZipFileSystem.java
@@ -1060,7 +1060,7 @@
         int pos = 0;
         int limit = cen.length - ENDHDR;
         while (pos < limit) {
-            if (CENSIG(cen, pos) != CENSIG)
+            if (!cenSigAt(cen, pos))
                 zerror("invalid CEN header (bad signature)");
             int method = CENHOW(cen, pos);
             int nlen   = CENNAM(cen, pos);
@@ -1894,7 +1894,7 @@
             throws IOException
         {
             byte[] cen = zipfs.cen;
-            if (CENSIG(cen, pos) != CENSIG)
+            if (!cenSigAt(cen, pos))
                 zerror("invalid CEN header (bad signature)");
             versionMade = CENVEM(cen, pos);
             version     = CENVER(cen, pos);
@@ -2057,9 +2057,9 @@
             assert (buf.length >= LOCHDR);
             if (zipfs.readFullyAt(buf, 0, LOCHDR , pos) != LOCHDR)
                 throw new ZipException("loc: reading failed");
-            if (LOCSIG(buf) != LOCSIG)
+            if (!locSigAt(buf, 0))
                 throw new ZipException("loc: wrong sig ->"
-                                       + Long.toString(LOCSIG(buf), 16));
+                                       + Long.toString(getSig(buf, 0), 16));
             //startPos = pos;
             version  = LOCVER(buf);
             flag     = LOCFLG(buf);
@@ -2289,9 +2289,9 @@
                     if (zipfs.readFullyAt(buf, 0, buf.length , locoff)
                         != buf.length)
                         throw new ZipException("loc: reading failed");
-                    if (LOCSIG(buf) != LOCSIG)
+                    if (!locSigAt(buf, 0))
                         throw new ZipException("loc: wrong sig ->"
-                                           + Long.toString(LOCSIG(buf), 16));
+                                           + Long.toString(getSig(buf, 0), 16));
 
                     int locElen = LOCEXT(buf);
                     if (locElen < 9)    // EXTT is at lease 9 bytes
diff --git a/jdk/test/TEST.groups b/jdk/test/TEST.groups
index aa80127..94103f5 100644
--- a/jdk/test/TEST.groups
+++ b/jdk/test/TEST.groups
@@ -453,7 +453,6 @@
   java/util/jar/JarInputStream/ExtraFileInMetaInf.java \
   java/util/logging/TestLoggerWeakRefLeak.java \
   java/util/zip/3GBZipFiles.sh \
-  jdk/lambda/FDTest.java \
   jdk/lambda/separate/Compiler.java \
   sun/management/jmxremote/bootstrap/JvmstatCountersTest.java \
   sun/management/jmxremote/bootstrap/LocalManagementTest.java \
diff --git a/jdk/test/java/awt/Focus/ModalExcludedWindowClickTest/ModalExcludedWindowClickTest.html b/jdk/test/java/awt/Focus/ModalExcludedWindowClickTest/ModalExcludedWindowClickTest.html
new file mode 100644
index 0000000..7750289
--- /dev/null
+++ b/jdk/test/java/awt/Focus/ModalExcludedWindowClickTest/ModalExcludedWindowClickTest.html
@@ -0,0 +1,43 @@
+<!--
+ Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved.
+ DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+
+ This code is free software; you can redistribute it and/or modify it
+ 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.
+-->
+
+<html>
+<!--  
+  @test
+  @bug        6271849
+  @summary    Tests that component in modal excluded Window which parent is blocked responses to mouse clicks.
+  @author     anton.tarasov@sun.com: area=awt.focus
+  @run        applet ModalExcludedWindowClickTest.html
+  -->
+<head>
+<title>ModalExcludedWindowClickTest</title>
+</head>
+<body>
+
+<h1>ModalExcludedWindowClickTest<br>Bug ID: 6272324</h1>
+
+<p> See the dialog box (usually in upper left corner) for instructions</p>
+
+<APPLET CODE="ModalExcludedWindowClickTest.class" WIDTH=200 HEIGHT=200></APPLET>
+</body>
+</html>
diff --git a/jdk/test/java/awt/Focus/ModalExcludedWindowClickTest/ModalExcludedWindowClickTest.java b/jdk/test/java/awt/Focus/ModalExcludedWindowClickTest/ModalExcludedWindowClickTest.java
new file mode 100644
index 0000000..70f6d1e
--- /dev/null
+++ b/jdk/test/java/awt/Focus/ModalExcludedWindowClickTest/ModalExcludedWindowClickTest.java
@@ -0,0 +1,291 @@
+/*
+ * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+  test
+  @bug       6271849
+  @summary   Tests that component in modal excluded Window which parent is blocked responses to mouse clicks.
+  @author    anton.tarasov@sun.com: area=awt.focus
+  @run       applet ModalExcludedWindowClickTest.html
+*/
+
+import java.applet.Applet;
+import java.awt.*;
+import java.awt.event.*;
+import java.lang.reflect.*;
+
+public class ModalExcludedWindowClickTest extends Applet {
+    Robot robot;
+    Frame frame = new Frame("Frame");
+    Window w = new Window(frame);
+    Dialog d = new Dialog ((Dialog)null, "NullParentDialog", true);
+    Button button = new Button("Button");
+    boolean actionPerformed = false;
+
+    public static void main (String args[]) {
+        ModalExcludedWindowClickTest app = new ModalExcludedWindowClickTest();
+        app.init();
+        app.start();
+    }
+
+    public void init() {
+        try {
+            robot = new Robot();
+        } catch (AWTException e) {
+            throw new RuntimeException("Error: unable to create robot", e);
+        }
+        // Create instructions for the user here, as well as set up
+        // the environment -- set the layout manager, add buttons,
+        // etc.
+        this.setLayout (new BorderLayout ());
+        Sysout.createDialogWithInstructions(new String[]
+            {"This is an AUTOMATIC test", "simply wait until it is done"});
+    }
+
+    public void start() {
+
+        if ("sun.awt.motif.MToolkit".equals(Toolkit.getDefaultToolkit().getClass().getName())) {
+            Sysout.println("No testing on MToolkit.");
+            return;
+        }
+
+        button.addActionListener(new ActionListener() {
+                public void actionPerformed(ActionEvent e) {
+                    actionPerformed = true;
+                    Sysout.println(e.paramString());
+                }
+            });
+
+        EventQueue.invokeLater(new Runnable() {
+                public void run() {
+                    frame.setSize(200, 200);
+                    frame.setVisible(true);
+
+                    w.setModalExclusionType(Dialog.ModalExclusionType.APPLICATION_EXCLUDE);
+                    w.add(button);
+                    w.setSize(200, 200);
+                    w.setLocation(230, 230);
+                    w.setVisible(true);
+
+                    d.setSize(200, 200);
+                    d.setLocation(0, 230);
+                    d.setVisible(true);
+
+                }
+            });
+
+        waitTillShown(d);
+
+        test();
+    }
+
+    void test() {
+        clickOn(button);
+        waitForIdle();
+        if (!actionPerformed) {
+            throw new RuntimeException("Test failed!");
+        }
+        Sysout.println("Test passed.");
+    }
+
+    void clickOn(Component c) {
+        Point p = c.getLocationOnScreen();
+        Dimension d = c.getSize();
+
+        Sysout.println("Clicking " + c);
+
+        if (c instanceof Frame) {
+            robot.mouseMove(p.x + (int)(d.getWidth()/2), p.y + ((Frame)c).getInsets().top/2);
+        } else {
+            robot.mouseMove(p.x + (int)(d.getWidth()/2), p.y + (int)(d.getHeight()/2));
+        }
+        robot.mousePress(InputEvent.BUTTON1_MASK);
+        robot.mouseRelease(InputEvent.BUTTON1_MASK);
+        waitForIdle();
+    }
+    void waitTillShown(Component c) {
+        while (true) {
+            try {
+                Thread.sleep(100);
+                c.getLocationOnScreen();
+                break;
+            } catch (InterruptedException e) {
+                throw new RuntimeException(e);
+            } catch (IllegalComponentStateException e) {}
+        }
+    }
+    void waitForIdle() {
+        try {
+            robot.waitForIdle();
+            EventQueue.invokeAndWait( new Runnable() {
+                    public void run() {} // Dummy implementation
+                });
+        } catch(InterruptedException ie) {
+            Sysout.println("waitForIdle, non-fatal exception caught:");
+            ie.printStackTrace();
+        } catch(InvocationTargetException ite) {
+            Sysout.println("waitForIdle, non-fatal exception caught:");
+            ite.printStackTrace();
+        }
+
+        // wait longer...
+        robot.delay(200);
+    }
+}
+
+/****************************************************
+ Standard Test Machinery
+ DO NOT modify anything below -- it's a standard
+  chunk of code whose purpose is to make user
+  interaction uniform, and thereby make it simpler
+  to read and understand someone else's test.
+ ****************************************************/
+
+/**
+ This is part of the standard test machinery.
+ It creates a dialog (with the instructions), and is the interface
+  for sending text messages to the user.
+ To print the instructions, send an array of strings to Sysout.createDialog
+  WithInstructions method.  Put one line of instructions per array entry.
+ To display a message for the tester to see, simply call Sysout.println
+  with the string to be displayed.
+ This mimics System.out.println but works within the test harness as well
+  as standalone.
+ */
+
+class Sysout
+{
+    static TestDialog dialog;
+
+    public static void createDialogWithInstructions( String[] instructions )
+    {
+        dialog = new TestDialog( new Frame(), "Instructions" );
+        dialog.printInstructions( instructions );
+        dialog.setVisible(true);
+        println( "Any messages for the tester will display here." );
+    }
+
+    public static void createDialog( )
+    {
+        dialog = new TestDialog( new Frame(), "Instructions" );
+        String[] defInstr = { "Instructions will appear here. ", "" } ;
+        dialog.printInstructions( defInstr );
+        dialog.setVisible(true);
+        println( "Any messages for the tester will display here." );
+    }
+
+
+    public static void printInstructions( String[] instructions )
+    {
+        dialog.printInstructions( instructions );
+    }
+
+
+    public static void println( String messageIn )
+    {
+        dialog.displayMessage( messageIn );
+    }
+
+}// Sysout  class
+
+/**
+  This is part of the standard test machinery.  It provides a place for the
+   test instructions to be displayed, and a place for interactive messages
+   to the user to be displayed.
+  To have the test instructions displayed, see Sysout.
+  To have a message to the user be displayed, see Sysout.
+  Do not call anything in this dialog directly.
+  */
+class TestDialog extends Dialog
+{
+
+    TextArea instructionsText;
+    TextArea messageText;
+    int maxStringLength = 80;
+
+    //DO NOT call this directly, go through Sysout
+    public TestDialog( Frame frame, String name )
+    {
+        super( frame, name );
+        int scrollBoth = TextArea.SCROLLBARS_BOTH;
+        instructionsText = new TextArea( "", 15, maxStringLength, scrollBoth );
+        add( "North", instructionsText );
+
+        messageText = new TextArea( "", 5, maxStringLength, scrollBoth );
+        add("Center", messageText);
+
+        pack();
+
+        setVisible(true);
+    }// TestDialog()
+
+    //DO NOT call this directly, go through Sysout
+    public void printInstructions( String[] instructions )
+    {
+        //Clear out any current instructions
+        instructionsText.setText( "" );
+
+        //Go down array of instruction strings
+
+        String printStr, remainingStr;
+        for( int i=0; i < instructions.length; i++ )
+        {
+            //chop up each into pieces maxSringLength long
+            remainingStr = instructions[ i ];
+            while( remainingStr.length() > 0 )
+            {
+                //if longer than max then chop off first max chars to print
+                if( remainingStr.length() >= maxStringLength )
+                {
+                    //Try to chop on a word boundary
+                    int posOfSpace = remainingStr.
+                        lastIndexOf( ' ', maxStringLength - 1 );
+
+                    if( posOfSpace <= 0 ) posOfSpace = maxStringLength - 1;
+
+                    printStr = remainingStr.substring( 0, posOfSpace + 1 );
+                    remainingStr = remainingStr.substring( posOfSpace + 1 );
+                }
+                //else just print
+                else
+                {
+                    printStr = remainingStr;
+                    remainingStr = "";
+                }
+
+                instructionsText.append( printStr + "\n" );
+
+            }// while
+
+        }// for
+
+    }//printInstructions()
+
+    //DO NOT call this directly, go through Sysout
+    public void displayMessage( String messageIn )
+    {
+        messageText.append( messageIn + "\n" );
+        System.out.println(messageIn);
+    }
+
+}// TestDialog  class
diff --git a/jdk/test/java/awt/Focus/NonFocusableBlockedOwnerTest/NonFocusableBlockedOwnerTest.html b/jdk/test/java/awt/Focus/NonFocusableBlockedOwnerTest/NonFocusableBlockedOwnerTest.html
new file mode 100644
index 0000000..a844c79
--- /dev/null
+++ b/jdk/test/java/awt/Focus/NonFocusableBlockedOwnerTest/NonFocusableBlockedOwnerTest.html
@@ -0,0 +1,43 @@
+<!--
+ Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved.
+ DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+
+ This code is free software; you can redistribute it and/or modify it
+ 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.
+-->
+
+<html>
+<!--  
+  @test
+  @bug        6272324
+  @summary    Modal excluded Window which decorated parent is blocked should be non-focusable.
+  @author     anton.tarasov@sun.com: area=awt.focus
+  @run        applet NonFocusableBlockedOwnerTest.html
+  -->
+<head>
+<title>NonFocusableBlockedOwnerTest</title>
+</head>
+<body>
+
+<h1>NonFocusableBlockedOwnerTest<br>Bug ID: 6272324</h1>
+
+<p> See the dialog box (usually in upper left corner) for instructions</p>
+
+<APPLET CODE="NonFocusableBlockedOwnerTest.class" WIDTH=200 HEIGHT=200></APPLET>
+</body>
+</html>
diff --git a/jdk/test/java/awt/Focus/NonFocusableBlockedOwnerTest/NonFocusableBlockedOwnerTest.java b/jdk/test/java/awt/Focus/NonFocusableBlockedOwnerTest/NonFocusableBlockedOwnerTest.java
new file mode 100644
index 0000000..b98fe3b
--- /dev/null
+++ b/jdk/test/java/awt/Focus/NonFocusableBlockedOwnerTest/NonFocusableBlockedOwnerTest.java
@@ -0,0 +1,288 @@
+/*
+ * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+  test
+  @bug       6272324
+  @summary   Modal excluded Window which decorated parent is blocked should be non-focusable.
+  @author    anton.tarasov@sun.com: area=awt.focus
+  @run       applet NonFocusableBlockedOwnerTest.html
+*/
+
+import java.applet.Applet;
+import java.awt.*;
+import java.awt.event.*;
+import java.lang.reflect.*;
+
+public class NonFocusableBlockedOwnerTest extends Applet {
+    Robot robot;
+    Frame frame = new Frame("Modal Blocked Frame");
+    Dialog dialog = new Dialog(frame, "Modal Dialog", true);
+    Window excluded = new Window(frame);
+    Button button = new Button("button");
+
+    public static void main(String[] args) {
+        NonFocusableBlockedOwnerTest app = new NonFocusableBlockedOwnerTest();
+        app.init();
+        app.start();
+    }
+
+    public void init() {
+        try {
+            robot = new Robot();
+        } catch (AWTException e) {
+            throw new RuntimeException("Error: unable to create robot", e);
+        }
+        // Create instructions for the user here, as well as set up
+        // the environment -- set the layout manager, add buttons,
+        // etc.
+        this.setLayout (new BorderLayout ());
+        Sysout.createDialogWithInstructions(new String[]
+            {"This is an AUTOMATIC test", "simply wait until it is done"});
+    }
+
+    public void start() {
+
+        if ("sun.awt.motif.MToolkit".equals(Toolkit.getDefaultToolkit().getClass().getName())) {
+            Sysout.println("No testing on MToolkit.");
+            return;
+        }
+
+        try {
+            EventQueue.invokeLater(new Runnable() {
+                public void run() {
+                    frame.setSize(300, 200);
+                    frame.setVisible(true);
+
+                    excluded.setSize(300, 200);
+                    excluded.setLocation(0, 400);
+                    excluded.setModalExclusionType(Dialog.ModalExclusionType.TOOLKIT_EXCLUDE);
+                    excluded.setLayout(new FlowLayout());
+                    excluded.add(button);
+                    excluded.setVisible(true);
+
+                    dialog.setSize(200, 100);
+                    dialog.setLocation(0, 250);
+                    dialog.setVisible(true);
+                }
+            });
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+
+        waitTillShown(dialog);
+        clickOn(button);
+        if (frame == KeyboardFocusManager.getCurrentKeyboardFocusManager().getActiveWindow()) {
+            throw new RuntimeException("Test failed!");
+        }
+        if (excluded == KeyboardFocusManager.getCurrentKeyboardFocusManager().getFocusedWindow()) {
+            throw new RuntimeException("Test failed!");
+        }
+        if (button == KeyboardFocusManager.getCurrentKeyboardFocusManager().getFocusOwner()) {
+            throw new RuntimeException("Test failed!");
+        }
+        Sysout.println("Test passed.");
+    }
+
+    void clickOn(Component c) {
+        Point p = c.getLocationOnScreen();
+        Dimension d = c.getSize();
+
+        Sysout.println("Clicking " + c);
+
+        if (c instanceof Frame) {
+            robot.mouseMove(p.x + (int)(d.getWidth()/2), p.y + ((Frame)c).getInsets().top/2);
+        } else {
+            robot.mouseMove(p.x + (int)(d.getWidth()/2), p.y + (int)(d.getHeight()/2));
+        }
+        robot.mousePress(InputEvent.BUTTON1_MASK);
+        robot.mouseRelease(InputEvent.BUTTON1_MASK);
+        waitForIdle();
+    }
+
+    void waitTillShown(Component c) {
+        while (true) {
+            try {
+                Thread.sleep(100);
+                c.getLocationOnScreen();
+                break;
+            } catch (InterruptedException e) {
+                throw new RuntimeException(e);
+            } catch (IllegalComponentStateException e) {}
+        }
+    }
+    void waitForIdle() {
+        try {
+            robot.waitForIdle();
+            EventQueue.invokeAndWait( new Runnable() {
+                    public void run() {} // Dummy implementation
+                });
+        } catch(InterruptedException ie) {
+            Sysout.println("waitForIdle, non-fatal exception caught:");
+            ie.printStackTrace();
+        } catch(InvocationTargetException ite) {
+            Sysout.println("waitForIdle, non-fatal exception caught:");
+            ite.printStackTrace();
+        }
+
+        // wait longer...
+        robot.delay(200);
+    }
+}
+
+/****************************************************
+ Standard Test Machinery
+ DO NOT modify anything below -- it's a standard
+  chunk of code whose purpose is to make user
+  interaction uniform, and thereby make it simpler
+  to read and understand someone else's test.
+ ****************************************************/
+
+/**
+ This is part of the standard test machinery.
+ It creates a dialog (with the instructions), and is the interface
+  for sending text messages to the user.
+ To print the instructions, send an array of strings to Sysout.createDialog
+  WithInstructions method.  Put one line of instructions per array entry.
+ To display a message for the tester to see, simply call Sysout.println
+  with the string to be displayed.
+ This mimics System.out.println but works within the test harness as well
+  as standalone.
+ */
+
+class Sysout
+{
+    static TestDialog dialog;
+
+    public static void createDialogWithInstructions( String[] instructions )
+    {
+        dialog = new TestDialog( new Frame(), "Instructions" );
+        dialog.printInstructions( instructions );
+        dialog.setVisible(true);
+        println( "Any messages for the tester will display here." );
+    }
+
+    public static void createDialog( )
+    {
+        dialog = new TestDialog( new Frame(), "Instructions" );
+        String[] defInstr = { "Instructions will appear here. ", "" } ;
+        dialog.printInstructions( defInstr );
+        dialog.setVisible(true);
+        println( "Any messages for the tester will display here." );
+    }
+
+
+    public static void printInstructions( String[] instructions )
+    {
+        dialog.printInstructions( instructions );
+    }
+
+
+    public static void println( String messageIn )
+    {
+        dialog.displayMessage( messageIn );
+    }
+
+}// Sysout  class
+
+/**
+  This is part of the standard test machinery.  It provides a place for the
+   test instructions to be displayed, and a place for interactive messages
+   to the user to be displayed.
+  To have the test instructions displayed, see Sysout.
+  To have a message to the user be displayed, see Sysout.
+  Do not call anything in this dialog directly.
+  */
+class TestDialog extends Dialog
+{
+
+    TextArea instructionsText;
+    TextArea messageText;
+    int maxStringLength = 80;
+
+    //DO NOT call this directly, go through Sysout
+    public TestDialog( Frame frame, String name )
+    {
+        super( frame, name );
+        int scrollBoth = TextArea.SCROLLBARS_BOTH;
+        instructionsText = new TextArea( "", 15, maxStringLength, scrollBoth );
+        add( "North", instructionsText );
+
+        messageText = new TextArea( "", 5, maxStringLength, scrollBoth );
+        add("Center", messageText);
+
+        pack();
+
+        setVisible(true);
+    }// TestDialog()
+
+    //DO NOT call this directly, go through Sysout
+    public void printInstructions( String[] instructions )
+    {
+        //Clear out any current instructions
+        instructionsText.setText( "" );
+
+        //Go down array of instruction strings
+
+        String printStr, remainingStr;
+        for( int i=0; i < instructions.length; i++ )
+        {
+            //chop up each into pieces maxSringLength long
+            remainingStr = instructions[ i ];
+            while( remainingStr.length() > 0 )
+            {
+                //if longer than max then chop off first max chars to print
+                if( remainingStr.length() >= maxStringLength )
+                {
+                    //Try to chop on a word boundary
+                    int posOfSpace = remainingStr.
+                        lastIndexOf( ' ', maxStringLength - 1 );
+
+                    if( posOfSpace <= 0 ) posOfSpace = maxStringLength - 1;
+
+                    printStr = remainingStr.substring( 0, posOfSpace + 1 );
+                    remainingStr = remainingStr.substring( posOfSpace + 1 );
+                }
+                //else just print
+                else
+                {
+                    printStr = remainingStr;
+                    remainingStr = "";
+                }
+
+                instructionsText.append( printStr + "\n" );
+
+            }// while
+
+        }// for
+
+    }//printInstructions()
+
+    //DO NOT call this directly, go through Sysout
+    public void displayMessage( String messageIn )
+    {
+        messageText.append( messageIn + "\n" );
+        System.out.println(messageIn);
+    }
+
+}// TestDialog  class
diff --git a/jdk/test/java/awt/Focus/WindowUpdateFocusabilityTest/WindowUpdateFocusabilityTest.html b/jdk/test/java/awt/Focus/WindowUpdateFocusabilityTest/WindowUpdateFocusabilityTest.html
new file mode 100644
index 0000000..56b72d5
--- /dev/null
+++ b/jdk/test/java/awt/Focus/WindowUpdateFocusabilityTest/WindowUpdateFocusabilityTest.html
@@ -0,0 +1,43 @@
+<!--
+ Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved.
+ DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+
+ This code is free software; you can redistribute it and/or modify it
+ 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.
+-->
+
+<html>
+<!--
+  @test
+  @bug        6253913
+  @summary    Tests that a Window shown before its owner is focusable.
+  @author     anton.tarasov@sun.com: area=awt-focus
+  @run        applet WindowUpdateFocusabilityTest.html
+  -->
+<head>
+<title>WindowUpdateFocusabilityTest</title>
+</head>
+<body>
+ 
+<h1>WindowUpdateFocusabilityTest<br>Bug ID: 6253913</h1>
+ 
+<p>See the dialog box (usually in upper left corner) for instructions</p>
+ 
+<APPLET CODE=WindowUpdateFocusabilityTest.class WIDTH=200 HEIGHT=200></APPLET>
+</body>
+</html>
diff --git a/jdk/test/java/awt/Focus/WindowUpdateFocusabilityTest/WindowUpdateFocusabilityTest.java b/jdk/test/java/awt/Focus/WindowUpdateFocusabilityTest/WindowUpdateFocusabilityTest.java
new file mode 100644
index 0000000..8070e57
--- /dev/null
+++ b/jdk/test/java/awt/Focus/WindowUpdateFocusabilityTest/WindowUpdateFocusabilityTest.java
@@ -0,0 +1,325 @@
+/*
+ * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+  test
+  @bug       6253913
+  @summary   Tests that a Window shown before its owner is focusable.
+  @author    anton.tarasov@sun.com: area=awt-focus
+  @run       applet WindowUpdateFocusabilityTest.html
+*/
+
+import java.awt.*;
+import java.awt.event.*;
+import java.applet.Applet;
+import java.lang.reflect.*;
+
+public class WindowUpdateFocusabilityTest extends Applet {
+    Robot robot;
+    boolean focusGained = false;
+    final Object monitor = new Object();
+    FocusListener listener = new FocusAdapter () {
+            public void focusGained(FocusEvent e) {
+                Sysout.println(e.toString());
+                synchronized (monitor) {
+                    focusGained = true;
+                    monitor.notifyAll();
+                }
+            }
+        };
+
+    public static void main(String[] args) {
+        WindowUpdateFocusabilityTest app = new WindowUpdateFocusabilityTest();
+        app.init();
+        app.start();
+    }
+
+    public void init() {
+        try {
+            robot = new Robot();
+        } catch (AWTException e) {
+            throw new RuntimeException("Error: couldn't create robot");
+        }
+        // Create instructions for the user here, as well as set up
+        // the environment -- set the layout manager, add buttons,
+        // etc.
+        this.setLayout (new BorderLayout ());
+        Sysout.createDialogWithInstructions(new String[]
+            {"This is an automatic test. Simply wait until it's done."});
+    }
+
+    public void start() {
+        if ("sun.awt.motif.MToolkit".equals(Toolkit.getDefaultToolkit().getClass().getName())) {
+            Sysout.println("No testing on Motif.");
+            return;
+        }
+
+        test(new Frame("Frame owner"));
+        Frame dialog_owner = new Frame("dialog's owner");
+        test(new Dialog(dialog_owner));
+        test(new Dialog(dialog_owner, Dialog.ModalityType.DOCUMENT_MODAL));
+        test(new Dialog(dialog_owner, Dialog.ModalityType.APPLICATION_MODAL));
+        test(new Dialog(dialog_owner, Dialog.ModalityType.TOOLKIT_MODAL));
+        test(new Dialog((Window) null, Dialog.ModalityType.MODELESS));
+        test(new Dialog((Window) null, Dialog.ModalityType.DOCUMENT_MODAL));
+        test(new Dialog((Window) null, Dialog.ModalityType.APPLICATION_MODAL));
+        test(new Dialog((Window) null, Dialog.ModalityType.TOOLKIT_MODAL));
+        dialog_owner.dispose();
+    }
+
+    private void test(final Window owner)
+    {
+        Window window0 = new Window(owner); // will not be shown
+        Window window1 = new Window(window0);
+        Window window2 = new Window(window1);
+        Button button1 = new Button("button1");
+        Button button2 = new Button("button2");
+        button1.addFocusListener(listener);
+        button2.addFocusListener(listener);
+
+        owner.setBounds(800, 0, 100, 100);
+        window1.setBounds(800, 300, 100, 100);
+        window2.setBounds(800, 150, 100, 100);
+
+        window1.add(button1);
+        window2.add(button2);
+
+        window2.setVisible(true);
+        window1.setVisible(true);
+        EventQueue.invokeLater(new Runnable() {
+                public void run() {
+                    owner.setVisible(true);
+                }
+            });
+
+        try {
+            EventQueue.invokeAndWait(new Runnable() {
+                    public void run() {
+                        // do nothing just wait until previous invokeLater will be executed
+                    }
+                });
+        } catch (InterruptedException ie) {
+            throw new RuntimeException(ie);
+        } catch (InvocationTargetException ite) {
+            throw new RuntimeException(ite);
+        }
+
+        robot.delay(1000);
+
+        clickOn(button1);
+
+        if (!isFocusGained()) {
+            throw new RuntimeException("Test failed: window1 is not focusable!");
+        }
+
+        focusGained = false;
+        clickOn(button2);
+
+        if (!isFocusGained()) {
+            throw new RuntimeException("Test failed: window2 is not focusable!");
+        }
+
+        Sysout.println("Test for " + owner.getName() + " passed.");
+        owner.dispose();
+    }
+
+    void clickOn(Component c) {
+        Point p = c.getLocationOnScreen();
+        Dimension d = c.getSize();
+
+        Sysout.println("Clicking " + c);
+
+        robot.mouseMove(p.x + (int)(d.getWidth()/2), p.y + (int)(d.getHeight()/2));
+
+        robot.mousePress(InputEvent.BUTTON1_MASK);
+        robot.mouseRelease(InputEvent.BUTTON1_MASK);
+        waitForIdle();
+    }
+
+    void waitForIdle() {
+        try {
+            robot.waitForIdle();
+            robot.delay(50);
+            EventQueue.invokeAndWait( new Runnable() {
+                    public void run() {} // Dummy implementation
+                });
+        } catch(InterruptedException ie) {
+            Sysout.println("waitForIdle, non-fatal exception caught:");
+            ie.printStackTrace();
+        } catch(InvocationTargetException ite) {
+            Sysout.println("waitForIdle, non-fatal exception caught:");
+            ite.printStackTrace();
+        }
+    }
+
+    boolean isFocusGained() {
+        synchronized (monitor) {
+            if (!focusGained) {
+                try {
+                    monitor.wait(3000);
+                } catch (InterruptedException e) {
+                    Sysout.println("Interrupted unexpectedly!");
+                    throw new RuntimeException(e);
+                }
+            }
+        }
+        return focusGained;
+    }
+}
+
+/****************************************************
+ Standard Test Machinery
+ DO NOT modify anything below -- it's a standard
+  chunk of code whose purpose is to make user
+  interaction uniform, and thereby make it simpler
+  to read and understand someone else's test.
+ ****************************************************/
+
+/**
+ This is part of the standard test machinery.
+ It creates a dialog (with the instructions), and is the interface
+  for sending text messages to the user.
+ To print the instructions, send an array of strings to Sysout.createDialog
+  WithInstructions method.  Put one line of instructions per array entry.
+ To display a message for the tester to see, simply call Sysout.println
+  with the string to be displayed.
+ This mimics System.out.println but works within the test harness as well
+  as standalone.
+ */
+
+class Sysout
+{
+    static TestDialog dialog;
+
+    public static void createDialogWithInstructions( String[] instructions )
+    {
+        dialog = new TestDialog( new Frame(), "Instructions" );
+        dialog.printInstructions( instructions );
+        dialog.setVisible(true);
+        println( "Any messages for the tester will display here." );
+    }
+
+    public static void createDialog( )
+    {
+        dialog = new TestDialog( new Frame(), "Instructions" );
+        String[] defInstr = { "Instructions will appear here. ", "" } ;
+        dialog.printInstructions( defInstr );
+        dialog.setVisible(true);
+        println( "Any messages for the tester will display here." );
+    }
+
+
+    public static void printInstructions( String[] instructions )
+    {
+        dialog.printInstructions( instructions );
+    }
+
+
+    public static void println( String messageIn )
+    {
+        dialog.displayMessage( messageIn );
+    }
+
+}// Sysout  class
+
+/**
+  This is part of the standard test machinery.  It provides a place for the
+   test instructions to be displayed, and a place for interactive messages
+   to the user to be displayed.
+  To have the test instructions displayed, see Sysout.
+  To have a message to the user be displayed, see Sysout.
+  Do not call anything in this dialog directly.
+  */
+class TestDialog extends Dialog
+{
+
+    TextArea instructionsText;
+    TextArea messageText;
+    int maxStringLength = 80;
+
+    //DO NOT call this directly, go through Sysout
+    public TestDialog( Frame frame, String name )
+    {
+        super( frame, name );
+        int scrollBoth = TextArea.SCROLLBARS_BOTH;
+        instructionsText = new TextArea( "", 15, maxStringLength, scrollBoth );
+        add( "North", instructionsText );
+
+        messageText = new TextArea( "", 5, maxStringLength, scrollBoth );
+        add("Center", messageText);
+
+        pack();
+
+        setVisible(true);
+    }// TestDialog()
+
+    //DO NOT call this directly, go through Sysout
+    public void printInstructions( String[] instructions )
+    {
+        //Clear out any current instructions
+        instructionsText.setText( "" );
+
+        //Go down array of instruction strings
+
+        String printStr, remainingStr;
+        for( int i=0; i < instructions.length; i++ )
+        {
+            //chop up each into pieces maxSringLength long
+            remainingStr = instructions[ i ];
+            while( remainingStr.length() > 0 )
+            {
+                //if longer than max then chop off first max chars to print
+                if( remainingStr.length() >= maxStringLength )
+                {
+                    //Try to chop on a word boundary
+                    int posOfSpace = remainingStr.
+                        lastIndexOf( ' ', maxStringLength - 1 );
+
+                    if( posOfSpace <= 0 ) posOfSpace = maxStringLength - 1;
+
+                    printStr = remainingStr.substring( 0, posOfSpace + 1 );
+                    remainingStr = remainingStr.substring( posOfSpace + 1 );
+                }
+                //else just print
+                else
+                {
+                    printStr = remainingStr;
+                    remainingStr = "";
+                }
+
+                instructionsText.append( printStr + "\n" );
+
+            }// while
+
+        }// for
+
+    }//printInstructions()
+
+    //DO NOT call this directly, go through Sysout
+    public void displayMessage( String messageIn )
+    {
+        messageText.append( messageIn + "\n" );
+        System.out.println(messageIn);
+    }
+
+}// TestDialog  class
diff --git a/jdk/test/java/awt/KeyboardFocusmanager/TypeAhead/TestDialogTypeAhead.java b/jdk/test/java/awt/KeyboardFocusmanager/TypeAhead/TestDialogTypeAhead.java
index 7ef6219..8b6d2fe 100644
--- a/jdk/test/java/awt/KeyboardFocusmanager/TypeAhead/TestDialogTypeAhead.java
+++ b/jdk/test/java/awt/KeyboardFocusmanager/TypeAhead/TestDialogTypeAhead.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -192,8 +192,7 @@
     }
     private void waitForIdle() {
         try {
-            Toolkit.getDefaultToolkit().sync();
-            sun.awt.SunToolkit.flushPendingEvents();
+            robot.waitForIdle();
             EventQueue.invokeAndWait( new Runnable() {
                                             public void run() {
                                                 // dummy implementation
diff --git a/jdk/test/java/awt/SplashScreen/MultiResolutionSplash/MultiResolutionSplashTest.java b/jdk/test/java/awt/SplashScreen/MultiResolutionSplash/MultiResolutionSplashTest.java
index a13cd81..4173e9b 100644
--- a/jdk/test/java/awt/SplashScreen/MultiResolutionSplash/MultiResolutionSplashTest.java
+++ b/jdk/test/java/awt/SplashScreen/MultiResolutionSplash/MultiResolutionSplashTest.java
@@ -23,13 +23,16 @@
 
 import java.awt.Color;
 import java.awt.Dialog;
+import java.awt.Frame;
 import java.awt.Graphics;
 import java.awt.Graphics2D;
 import java.awt.Panel;
 import java.awt.Rectangle;
 import java.awt.Robot;
 import java.awt.SplashScreen;
+import java.awt.TextField;
 import java.awt.Window;
+import java.awt.event.KeyEvent;
 import java.awt.image.BufferedImage;
 import java.io.File;
 import javax.imageio.ImageIO;
@@ -37,7 +40,7 @@
 
 /**
  * @test
- * @bug 8043869
+ * @bug 8043869 8075244
  * @author Alexander Scherbatiy
  * @summary [macosx] java -splash does not honor 2x hi dpi notation for retina
  * support
@@ -45,6 +48,7 @@
  * @run main/othervm -splash:splash1.png MultiResolutionSplashTest TEST_SPLASH 0
  * @run main/othervm -splash:splash2 MultiResolutionSplashTest TEST_SPLASH 1
  * @run main/othervm -splash:splash3. MultiResolutionSplashTest TEST_SPLASH 2
+ * @run main/othervm -splash:splash1.png MultiResolutionSplashTest TEST_FOCUS
  */
 public class MultiResolutionSplashTest {
 
@@ -69,6 +73,9 @@
                 int index = Integer.parseInt(args[1]);
                 testSplash(tests[index]);
                 break;
+            case "TEST_FOCUS":
+                testFocus();
+                break;
             default:
                 throw new RuntimeException("Unknown test: " + test);
         }
@@ -92,12 +99,49 @@
         float scaleFactor = getScaleFactor();
         Color testColor = (1 < scaleFactor) ? test.color2x : test.color1x;
 
-        if (!testColor.equals(splashScreenColor)) {
+        if (!compare(testColor, splashScreenColor)) {
             throw new RuntimeException(
                     "Image with wrong resolution is used for splash screen!");
         }
     }
 
+    static void testFocus() throws Exception {
+
+        System.out.println("Focus Test!");
+        Robot robot = new Robot();
+        robot.setAutoDelay(50);
+
+        Frame frame = new Frame();
+        frame.setSize(100, 100);
+        String test = "123";
+        TextField textField = new TextField(test);
+        frame.add(textField);
+        frame.setVisible(true);
+        robot.waitForIdle();
+
+        robot.keyPress(KeyEvent.VK_A);
+        robot.keyRelease(KeyEvent.VK_A);
+        robot.keyPress(KeyEvent.VK_B);
+        robot.keyRelease(KeyEvent.VK_B);
+        robot.waitForIdle();
+
+        frame.dispose();
+
+        if(!textField.getText().equals("ab")){
+            throw new RuntimeException("Focus is lost!");
+        }
+    }
+
+    static boolean compare(Color c1, Color c2){
+        return compare(c1.getRed(), c2.getRed())
+                && compare(c1.getGreen(), c2.getGreen())
+                && compare(c1.getBlue(), c2.getBlue());
+    }
+
+    static boolean compare(int n, int m){
+        return Math.abs(n - m) <= 50;
+    }
+
     static float getScaleFactor() {
 
         final Dialog dialog = new Dialog((Window) null);
diff --git a/jdk/test/java/awt/Window/AlwaysOnTop/AutoTestOnTop.java b/jdk/test/java/awt/Window/AlwaysOnTop/AutoTestOnTop.java
new file mode 100644
index 0000000..07843be
--- /dev/null
+++ b/jdk/test/java/awt/Window/AlwaysOnTop/AutoTestOnTop.java
@@ -0,0 +1,795 @@
+/*
+ * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+  @test
+  @bug 4632143
+  @summary Unit test for the RFE window/frame/dialog always on top
+  @author dom@sparc.spb.su: area=awt.toplevel
+  @run main AutoTestOnTop
+*/
+
+import java.awt.*;
+import java.awt.event.*;
+import java.lang.reflect.*;
+import javax.swing.*;
+import java.util.Vector;
+
+/**
+ * @author tav@sparc.spb.su
+ * @author dom@sparc.spb.su
+ * Tests that always-on-top windows combine correctly with different kinds of window in different styles and conditions.
+ *
+ * !!! WARNING !!!
+ * The test fails sometimes because the toFront() method doesn't guarantee
+ * that after its invocation the frame will be placed above all other windows.
+ */
+public class AutoTestOnTop {
+    static Window topw;
+    static Frame  parentw = new Frame();
+    static Window f;
+    static Frame  parentf = new Frame();
+
+    static Object  uncheckedSrc = new Object(); // used when no need to check event source
+    static Object  eventSrc = uncheckedSrc;
+    static boolean dispatchedCond;
+
+    static Semaphore STATE_SEMA = new Semaphore();
+    static Semaphore VIS_SEMA = new Semaphore();
+    static Vector errors = new Vector();
+
+    static boolean isUnix = false;
+
+    static StringBuffer msgError = new StringBuffer();
+    static StringBuffer msgCase = new StringBuffer();
+    static StringBuffer msgAction = new StringBuffer();
+    static StringBuffer msgFunc = new StringBuffer();
+    static StringBuffer msgVisibility = new StringBuffer();
+
+    static volatile int stageNum;
+    static volatile int actNum;
+    static volatile int testResult = 0;
+
+    static volatile boolean doCheckEvents;
+    static volatile boolean eventsCheckPassed;
+    static boolean[] eventsCheckInitVals = new boolean[] { // Whether events are checked for abcence or precence
+        true, true, true, true, true, false, false, false, false
+    };
+    static String[] msgEventsChecks = new String[] {
+        null, null, null, null, null,
+        "expected WindowEvent.WINDOW_STATE_CHANGED hasn't been generated",
+        "expected WindowEvent.WINDOW_STATE_CHANGED hasn't been generated",
+        "expected WindowEvent.WINDOW_STATE_CHANGED hasn't been generated",
+        "expected WindowEvent.WINDOW_STATE_CHANGED hasn't been generated",
+    };
+
+    static final int stagesCount = 7;
+    static final int actionsCount = 9;
+
+    static Method[] preActions = new Method[actionsCount];
+    static Method[] postActions = new Method[actionsCount];
+    static Method[] isActionsAllowed = new Method[actionsCount];
+    static Method[] checksActionEvents = new Method[actionsCount];
+
+    static Robot robot;
+
+    static boolean doStartTest;
+    static String osName = System.getProperty("os.name");
+
+
+    public static void main(String[] args) {
+        checkTesting();
+
+    }
+
+    public static void performTesting() {
+        isUnix = osName.equals("Linux") || osName.equals("SunOS");
+
+        Toolkit.getDefaultToolkit().addAWTEventListener(new AWTEventListener() {
+                public void eventDispatched(AWTEvent e) {
+                    if (e.getID() == MouseEvent.MOUSE_CLICKED) {
+                        if (eventSrc != null & eventSrc != uncheckedSrc && e.getSource() != eventSrc) {
+                            error("Test failed: stage #" + stageNum + ", action # " + actNum + ": " + msgCase + ": " + msgAction + ": " + msgError);
+                            testResult = -1;
+                        }
+                        synchronized (eventSrc) {
+                            dispatchedCond = true;
+                            eventSrc.notify();
+                        }
+                    }
+
+                    if (doCheckEvents && (e.getSource() == topw || e.getSource() == f)) {
+
+                        //System.err.println("AWTEventListener: catched the event " + e);
+
+                        try {
+                            checksActionEvents[actNum].invoke(null, new Object[] {e});
+                        } catch (InvocationTargetException ite) {
+                            ite.printStackTrace();
+                        } catch (IllegalAccessException iae) {
+                            iae.printStackTrace();
+                        }
+                        return;
+                    }
+                }
+            }, 0xffffffffffffffffL);
+
+        Method[] allMethods;
+
+        try {
+            allMethods = AutoTestOnTop.class.getDeclaredMethods();
+        } catch (SecurityException se) {
+            throw new RuntimeException(se);
+        }
+
+        for (int i = 0; i < allMethods.length; i++) {
+            String name = allMethods[i].getName();
+            if (name.startsWith("preAction")) {
+                preActions[name.charAt(name.length() - 1) - '0'] = allMethods[i];
+            } else if (name.startsWith("postAction")) {
+                postActions[name.charAt(name.length() - 1) - '0'] = allMethods[i];
+            } else if (name.startsWith("isActionAllowed")) {
+                isActionsAllowed[name.charAt(name.length() - 1) - '0'] = allMethods[i];
+            } else if (name.startsWith("checkActionEvents")) {
+                checksActionEvents[name.charAt(name.length() - 1) - '0'] = allMethods[i];
+            }
+        }
+
+        f = new Frame("Auxiliary Frame");
+        f.setBounds(50, 0, 400, 50);
+        f.setVisible(true);
+        waitTillShown(f);
+
+        try {
+            robot = new Robot();
+        } catch (AWTException e) {
+            throw new RuntimeException("Error: unable to create robot", e);
+        }
+
+        mainTest();
+
+        if (testResult != 0) {
+            System.err.println("The following errors were encountered: ");
+            for (int i = 0; i < errors.size(); i++) {
+                System.err.println(errors.get(i).toString());
+            }
+            throw new RuntimeException("Test failed.");
+        } else {
+            System.err.println("Test PASSED.");
+        }
+    }
+
+    public static void mainTest() {
+//         stageNum = 0;
+//         for (int i = 0; i < 5; i++) {
+//             actNum = 2;
+//             System.err.println("************************* A C T I O N " + actNum + " *************************");
+//             doStage(stageNum, actNum);
+// //             pause(500);
+//             actNum = 3;
+//             System.err.println("************************* A C T I O N " + actNum + " *************************");
+//             doStage(stageNum, actNum);
+// //             pause(500);
+//         }
+        for (stageNum = 0; stageNum < stagesCount; stageNum++) {
+            System.err.println("************************* S T A G E " + stageNum + " *************************");
+            for (actNum = 0; actNum < actionsCount; actNum++) {
+                System.err.println("************************* A C T I O N " + actNum + " *************************");
+                doStage(stageNum, actNum);
+            } // for thru actNum
+        } // fow thru stageNum
+
+        eventSrc = null;
+    }
+
+    private static void doStage(int stageNum, int actNum) {
+        try {
+
+            if (!((Boolean)isActionsAllowed[actNum].invoke(null, new Object[0])).booleanValue()) {
+                System.err.println("Action skipped due to a platform limitations");
+                return;
+            }
+
+            STATE_SEMA.reset();
+            createWindow(stageNum);
+
+            //*************************
+            // Set window always-on-top
+            //*************************
+
+            preActions[actNum].invoke(null, new Object[0]);
+            setAlwaysOnTop(topw, true);
+            waitForIdle(true);
+
+            if (!topw.isAlwaysOnTopSupported()) return;
+
+            postActions[actNum].invoke(null, new Object[0]);
+            waitForIdle(false);
+
+            STATE_SEMA.reset();
+
+            testForAlwaysOnTop();
+
+            //*****************************
+            // Set window not always-on-top
+            //*****************************
+
+            preActions[actNum].invoke(null, new Object[0]);
+            setAlwaysOnTop(topw, false);
+            waitForIdle(true);
+            postActions[actNum].invoke(null, new Object[0]);
+            waitForIdle(false);
+            STATE_SEMA.reset();
+
+            testForNotAlwaysOnTop();
+
+        } catch (InvocationTargetException ite) {
+            ite.printStackTrace();
+        } catch (Exception ex) {
+            throw new RuntimeException(ex);
+        }
+    }
+
+    private static void checkTesting() {
+        if (Toolkit.getDefaultToolkit().isAlwaysOnTopSupported()) {
+            performTesting();
+        }
+    }
+
+    public static void testForAlwaysOnTop() {
+        System.err.println("Checking for always-on-top " + topw);
+
+        ensureInitialWinPosition(topw);
+
+        // Check that always-on-top window is topmost.
+        // - Click on always-on-top window on the windows cross area.
+        clickOn(topw, f, 10, 30, "setting " + msgVisibility +
+                " window (1) always-on-top didn't make it topmost");
+
+        // Check that we can't change z-order of always-on-top window.
+        // - a) Try to put the other window on the top.
+        f.toFront();
+        clickOn(uncheckedSrc, f, 190, 30, ""); // coz toFront() works not always
+        pause(300);
+
+        // - b) Click on always-on-top window on the windows cross area.
+        clickOn(topw, f, 10, 30, "setting " + msgVisibility +
+                " window (1) always-on-top didn't make it such");
+
+        // Ask for always-on-top property
+        if (isAlwaysOnTop(topw) != true)
+                error("Test failed: stage #" + stageNum + ", action #" + actNum + ": " + msgCase + ": " + msgAction +
+                                   ": isAlwaysOnTop() returned 'false' for window (1) set always-on-top at state "
+                                   + msgVisibility);
+    }
+
+    public static void testForNotAlwaysOnTop() {
+        System.err.println("Checking for non always-on-top of " + topw);
+        ensureInitialWinPosition(topw);
+
+        if (msgVisibility.equals("visible") && actNum != 2) {
+            // Check that the window remains topmost.
+            // - click on the window on the windows cross area.
+            clickOn(topw, f, 10, 30, "setting " + msgVisibility +
+                    " window (1) not always-on-top didn't keep it topmost");
+        }
+
+        // Check that we can change z-order of not always-on-top window.
+        // - a) try to put the other window on the top.
+        f.toFront();
+        clickOn(uncheckedSrc, f, 190, 30, ""); // coz toFront() works not always
+        pause(300);
+
+        // - b) click on not always-on-top window on the windows cross area.
+        clickOn(f, f, 10, 30, "setting " + msgVisibility +
+                " window (1) not always-on-top didn't make it such");
+
+        // Ask for always-on-top property
+        if (isAlwaysOnTop(topw) != false)
+            error("Test failed: stage #" + stageNum + ", action #" + actNum + ": " + msgCase + ": " + msgAction +
+                               ": isAlwaysOnTop() returned 'true' for window (1) set not always-on-top at state "
+                               + msgVisibility);
+    }
+
+
+    private static void createWindow(int stageNum) {
+        // Free native resourses
+        if (topw != null && topw.isVisible()) {
+            topw.dispose();
+        }
+
+        switch (stageNum) {
+        case 0:
+            topw = new Frame("Top Frame");
+            msgCase.replace(0, msgCase.length(), "Frame (1) over Frame (2)");
+            break;
+        case 1:
+            topw = new JFrame("Top JFrame");
+            msgCase.replace(0, msgCase.length(), "JFrame (1) over Frame (2)");
+            break;
+        case 2:
+            topw = new Dialog(parentw, "Top Dialog");
+            msgCase.replace(0, msgCase.length(), "Dialog (1) over Frame (2)");
+            break;
+        case 3:
+            topw = new JDialog(parentw, "Top JDialog");
+            msgCase.replace(0, msgCase.length(), "JDialog (1) over Frame (2)");
+            break;
+        case 4:
+            topw = new Frame("Top Frame");
+            f.dispose();
+            f = new Dialog(parentf, "Auxiliary Dialog");
+            f.setBounds(50, 0, 250, 50);
+            f.setVisible(true);
+            waitTillShown(f);
+            msgCase.replace(0, msgCase.length(), "Frame (1) over Dialog (2)");
+            break;
+        case 5:
+            topw = new Window(parentw);
+            msgCase.replace(0, msgCase.length(), "Window (1) over Frame (2)");
+            break;
+        case 6:
+            topw = new JWindow(parentw);
+            msgCase.replace(0, msgCase.length(), "JWindow (1) over Frame (2)");
+            break;
+        }
+        topw.addWindowStateListener(new WindowAdapter() {
+                public void windowStateChanged(WindowEvent e) {
+                    System.err.println("* " + e);
+                    STATE_SEMA.raise();
+                }
+            });
+        topw.setSize(200, 50);
+    }
+
+    /**
+     * 0: setting always-on-top to invisible window
+     * 1: setting always-on-top to visible window
+     * 2: always-on-top on visible non-focusable window
+     * 3: always-on-top on visible, dragging topw after that
+     * 4: always-on-top on visible, dragging f after that
+     * 5: always-on-top on (visible, maximized), make normal after that
+     * 6: always-on-top on (visible, iconified), make normal after that
+     * 7: always-on-top on visible, iconify/deiconify after that
+     * 8: always-on-top on visible, maximize/restore after that
+     */
+    public static void preAction_0() {
+        topw.setVisible(false);
+    }
+    public static void postAction_0() {
+        if (topw.isShowing()) {
+            error("Test failed: stage #" + stageNum + ", action #" + actNum + ": " + msgCase +
+                               ": no actions with windows: changing always-on-top property at window (1) state 'invisible' makes window (1) visible");
+        }
+        setWindowVisible("no actions with windows", "invisible");
+    }
+    public static boolean isActionAllowed_0() {
+        // Window on Linux is always always-on-top!
+        return !((stageNum == 5 || stageNum == 6) && isUnix) && (stageNum < stagesCount);
+    }
+    public static void checkActionEvents_0(AWTEvent e) {
+        System.err.println(e.toString());
+   }
+
+    public static void preAction_1() {
+        setWindowVisible("no actions with windows", "visible");
+    }
+    public static void postAction_1() {}
+    public static boolean isActionAllowed_1() {
+        return !((stageNum == 5 || stageNum == 6) && isUnix) && (stageNum < stagesCount );
+    }
+    public static void checkActionEvents_1(AWTEvent e) {
+        System.err.println(e.toString());
+        if (e instanceof PaintEvent) {
+            return;
+        }
+        eventsCheckPassed = false;
+        error("Test failed: stage #" + stageNum + ", action # " + actNum + ": " + msgCase + ": " + msgAction + ": after call " + msgFunc +
+                           ":  unexpected event " + e + " was generated");
+    }
+
+    public static void preAction_2() {
+        setWindowVisible("when window (1) set not focusable", "visible");
+        topw.setFocusableWindowState(false);
+        f.toFront();
+        pause(300);
+    }
+    public static void postAction_2() {}
+    public static boolean isActionAllowed_2() {
+        return !((stageNum == 5 || stageNum == 6) && isUnix) && (stageNum < stagesCount);
+    }
+    public static void checkActionEvents_2(AWTEvent e) {
+        System.err.println(e.toString());
+        if ( (e.getID() >= FocusEvent.FOCUS_FIRST && e.getID() <= FocusEvent.FOCUS_LAST) ||
+             (e.getID() == WindowEvent.WINDOW_LOST_FOCUS && e.getID() == WindowEvent.WINDOW_GAINED_FOCUS)) {
+            eventsCheckPassed = false;
+            error("Test failed: stage #" + stageNum + ", action # " + actNum + ": " + msgCase + ": " +
+                               msgAction + ": after call " + msgFunc +
+                               ": unexpected event " + e + " was generated");
+        }
+    }
+
+    public static void preAction_3() {
+        setWindowVisible("after dragging",  "visible");
+    }
+    public static void postAction_3() {
+        Point p = topw.getLocationOnScreen();
+        int x = p.x + 40, y = p.y + 5;
+
+        try {                      // Take a pause to avoid double click
+            Thread.sleep(500);     // when called one after another.
+        } catch (InterruptedException ie) {
+            ie.printStackTrace();
+        } catch (IllegalComponentStateException e) {
+            e.printStackTrace();
+        }
+
+        // Drag the window.
+        robot.mouseMove(x, y);
+        robot.mousePress(InputEvent.BUTTON1_MASK);
+        robot.mouseMove(200, 50);
+        robot.mouseMove(x, y);
+        robot.mouseRelease(InputEvent.BUTTON1_MASK);
+    }
+    public static boolean isActionAllowed_3() {
+        return (stageNum < 5);
+    }
+    public static void checkActionEvents_3(AWTEvent e) {
+        System.err.println(e.toString());
+    }
+
+    public static void preAction_4() {
+        setWindowVisible("after dragging window (2)",  "visible");
+    }
+    public static void postAction_4() {
+        Point p = f.getLocationOnScreen();
+        int x = p.x + 150, y = p.y + 5;
+
+        try {                      // Take a pause to avoid double click
+            Thread.sleep(500);     // when called one after another.
+        } catch (InterruptedException ie) {
+            ie.printStackTrace();
+        } catch (IllegalComponentStateException e) {
+            e.printStackTrace();
+        }
+
+        // Drag the window.
+        robot.mouseMove(x, y);
+        robot.mousePress(InputEvent.BUTTON1_MASK);
+        robot.mouseMove(200, 50);
+        robot.mouseMove(x, y);
+        robot.mouseRelease(InputEvent.BUTTON1_MASK);
+
+        ensureInitialWinPosition(f);
+    }
+    public static boolean isActionAllowed_4() {
+        return !((stageNum == 5 || stageNum == 6) && isUnix);
+    }
+    public static void checkActionEvents_4(AWTEvent e) {
+        System.err.println(e.toString());
+    }
+
+    // Metacity has a bug not allowing to set a window to NORMAL state!!!
+
+    public static void preAction_5() {
+        setWindowVisible("at state 'maximized'",  "visible");
+        ((Frame)topw).setExtendedState(Frame.MAXIMIZED_BOTH);
+        waitForStateChange();
+    }
+    public static void postAction_5() {
+        ((Frame)topw).setExtendedState(Frame.NORMAL);
+        waitForStateChange();
+    }
+    public static boolean isActionAllowed_5() {
+        return (stageNum < 2);
+    }
+    public static void checkActionEvents_5(AWTEvent e) {
+        System.err.println("=" + e.toString());
+        if (e.getID() == WindowEvent.WINDOW_STATE_CHANGED) {
+            eventsCheckPassed = true;
+        }
+    }
+
+    public static void preAction_6() {
+        setWindowVisible("at state 'iconified'",  "visible");
+        System.err.println("Iconifying " + topw);
+        ((Frame)topw).setExtendedState(Frame.ICONIFIED);
+        if (!waitForStateChange()) {
+            error("Test failed: stage #" + stageNum + ", action # " + actNum + ": " + msgCase + ": " + msgAction + ": after call " + msgFunc +
+                               ":  state change to ICONIFIED hasn't been generated");
+        }
+    }
+    public static void postAction_6() {
+        System.err.println("Restoring " + topw);
+        ((Frame)topw).setExtendedState(Frame.NORMAL);
+        if (!waitForStateChange()) {
+            error("Test failed: stage #" + stageNum + ", action # " + actNum + ": " + msgCase + ": " + msgAction + ": after call " + msgFunc +
+                               ":  state change to NORMAL hasn't been generated");
+        }
+    }
+    public static boolean isActionAllowed_6() {
+        return (stageNum < 2 );
+    }
+    public static void checkActionEvents_6(AWTEvent e) {
+        System.err.println("+" + e.toString());
+        if (e.getID() == WindowEvent.WINDOW_STATE_CHANGED) {
+            eventsCheckPassed = true;
+        }
+    }
+
+    public static void preAction_7() {
+        setWindowVisible("before state 'iconified'",  "visible");
+    }
+    public static void postAction_7() {
+        System.err.println("Setting iconified");
+        ((Frame)topw).setExtendedState(Frame.ICONIFIED);
+        if (!waitForStateChange()) {
+            error("Test failed: stage #" + stageNum + ", action # " + actNum + ": " + msgCase + ": " + msgAction + ": after call " + msgFunc +
+                               ":  state change to ICONIFIED hasn't been generated");
+        }
+        System.err.println("Setting normal");
+        ((Frame)topw).setExtendedState(Frame.NORMAL);
+        if (!waitForStateChange()) {
+            error("Test failed: stage #" + stageNum + ", action # " + actNum + ": " + msgCase + ": " + msgAction + ": after call " + msgFunc +
+                               ":  state change to NORMAL hasn't been generated");
+        }
+    }
+    public static boolean isActionAllowed_7() {
+        return (stageNum < 2);
+    }
+    public static void checkActionEvents_7(AWTEvent e) {
+        System.err.println(e.toString());
+        if (e.getID() == WindowEvent.WINDOW_STATE_CHANGED) {
+            eventsCheckPassed = true;
+        }
+    }
+
+    public static void preAction_8() {
+        setWindowVisible("before state 'maximized'",  "visible");
+    }
+    public static void postAction_8() {
+        ((Frame)topw).setExtendedState(Frame.MAXIMIZED_BOTH);
+        if (!waitForStateChange()) {
+            error("Test failed: stage #" + stageNum + ", action # " + actNum + ": " + msgCase + ": " + msgAction + ": after call " + msgFunc +
+                               ":  state change to MAXIMIZED hasn't been generated");
+        }
+        ((Frame)topw).setExtendedState(Frame.NORMAL);
+        if (!waitForStateChange()) {
+            error("Test failed: stage #" + stageNum + ", action # " + actNum + ": " + msgCase + ": " + msgAction + ": after call " + msgFunc +
+                               ":  state change to NORMAL hasn't been generated");
+        }
+    }
+    public static boolean isActionAllowed_8() {
+        return (stageNum < 2);
+    }
+    public static void checkActionEvents_8(AWTEvent e) {
+        System.err.println(e.toString());
+        if (e.getID() == WindowEvent.WINDOW_STATE_CHANGED) {
+           eventsCheckPassed = true;
+        }
+    }
+
+    //***************************************************************************
+
+    private static void setWindowVisible(String mAction, String mVisibility) {
+        msgAction.replace(0, msgAction.length(), mAction);
+        msgVisibility.replace(0, msgVisibility.length(), mVisibility);
+
+        topw.setVisible(true);
+        pause(100); // Needs for Sawfish
+        topw.setLocation(0, 0);
+        waitTillShown(topw);
+        f.toFront();
+        pause(300);
+    }
+
+    private static void clickOn(Object src, Window relwin, int x, int y, String errorStr) {
+        Point p = relwin.getLocationOnScreen();
+        int counter = 10;
+        while (--counter > 0) {
+            eventSrc = src;
+            msgError.replace(0, msgError.length(), errorStr);
+
+            robot.mouseMove(p.x + x, p.y + y);
+            robot.mousePress(InputEvent.BUTTON1_MASK);
+            robot.mouseRelease(InputEvent.BUTTON1_MASK);
+
+            synchronized (eventSrc) {
+                if (!dispatchedCond) {
+                    try {
+                        eventSrc.wait(1000);
+                    } catch (InterruptedException e) {
+                        e.printStackTrace();
+                    }
+                }
+                if (!dispatchedCond) {
+                    //System.err.println("clickOn: MOUSE_CLICKED event losed, trying to generate it again...");
+                    continue;
+                }
+                dispatchedCond = false;
+            }
+            break;
+        } // end while
+        if (counter <= 0) {
+            eventSrc = uncheckedSrc;
+            error("Test: internal error: could't catch MOUSE_CLICKED event. Skip testing this stage");
+        }
+    }
+
+    private static void setAlwaysOnTop(Window w, boolean value) {
+        System.err.println("Setting always on top on " + w + " to " + value);
+        robot.mouseMove(0, 100); // Move out of the window
+        msgFunc.replace(0, msgCase.length(), "setAlwaysOnTop()");
+        try {
+            w.setAlwaysOnTop(value);
+        } catch (Exception e) {
+            error("Test failed: stage#" + stageNum + "action #" + actNum + ": " + msgCase + ": " + msgAction +
+                               ": setAlwaysOnTop(" + value + ") called at state " + msgVisibility +
+                               " threw exeption " + e);
+        }
+    }
+
+    private static boolean isAlwaysOnTop(Window w) {
+        robot.mouseMove(0, 100); // Move out of the window
+        msgFunc.replace(0, msgCase.length(), "isAlwaysOnTop()");
+        boolean result = false;
+        try {
+            result = w.isAlwaysOnTop();
+        } catch (Exception e) {
+            error("Test failed: stage #" + stageNum + ", action # " + actNum + ": " + msgCase + ": " + msgAction +
+                               ": isAlwaysOnTop() called at state " + msgVisibility +
+                               " threw exeption " + e);
+        }
+        return result;
+    }
+
+    private static void waitTillShown(Component c) {
+        while (true) {
+            try {
+                Thread.sleep(100);
+                c.getLocationOnScreen();
+                break;
+            } catch (InterruptedException e) {
+                e.printStackTrace();
+                break;
+            }
+        }
+    }
+
+    private static void waitForIdle(boolean doCheck) {
+        try {
+            robot.waitForIdle();
+            EventQueue.invokeAndWait( new Runnable() {
+                    public void run() {} // Dummy implementation
+                } );
+        } catch(InterruptedException ite) {
+            System.err.println("waitForIdle, non-fatal exception caught:");
+            ite.printStackTrace();
+        } catch(InvocationTargetException ine) {
+            System.err.println("waitForIdle, non-fatal exception caught:");
+            ine.printStackTrace();
+        }
+        doCheckEvents = doCheck;
+
+        if (doCheck) {
+            eventsCheckPassed = eventsCheckInitVals[actNum]; // Initialize
+        } else if (!eventsCheckPassed &&
+                 msgEventsChecks[actNum] != null) {
+
+
+            // Some expected event hasn't been catched,
+            // so give it one more chance...
+            doCheckEvents = true;
+            pause(500);
+            doCheckEvents = false;
+
+            if (!eventsCheckPassed) {
+                testResult = -1;
+                error("Test failed: stage #" + stageNum + ", action # " + actNum + ": " + msgCase + ": " + msgAction + ": after call "
+                                   + msgFunc + ": " + msgEventsChecks[actNum]);
+            }
+        }
+    }
+
+    private static boolean waitForStateChange() {
+        System.err.println("------- Waiting for state change");
+        try {
+            STATE_SEMA.doWait(3000);
+        } catch (InterruptedException ie) {
+            System.err.println("Wait interrupted: " + ie);
+        }
+        boolean state = STATE_SEMA.getState();
+        STATE_SEMA.reset();
+        return state;
+    }
+
+    private static void ensureInitialWinPosition(Window w) {
+        int counter = 30;
+        while (w.getLocationOnScreen().y != 0 && --counter > 0) {
+            try {
+                Thread.sleep(100);
+            } catch (InterruptedException e) {
+                e.printStackTrace();
+                break;
+            }
+        }
+        if (counter <= 0) {
+            w.setLocation(0, 0);
+            pause(100);
+            System.err.println("Test: window set to initial position forcedly");
+        }
+    }
+
+    private static void pause(int mls) {
+        try {
+            Thread.sleep(mls);
+        } catch (InterruptedException e) {
+            e.printStackTrace();
+        }
+    }
+
+    private static void error(String msg) {
+        errors.add(msg);
+        System.err.println(msg);
+    }
+}
+
+class Semaphore {
+    boolean state = false;
+    int waiting = 0;
+    public Semaphore() {
+    }
+    public synchronized void doWait() throws InterruptedException {
+        if (state) {
+            return;
+        }
+        waiting++;
+        wait();
+        waiting--;
+    }
+    public synchronized void doWait(int timeout) throws InterruptedException {
+        if (state) {
+            return;
+        }
+        waiting++;
+        wait(timeout);
+        waiting--;
+    }
+    public synchronized void raise() {
+        state = true;
+        if (waiting > 0) {
+            notifyAll();
+        }
+    }
+
+    public synchronized void doNotify() {
+        notifyAll();
+    }
+    public synchronized boolean getState() {
+        return state;
+    }
+
+    public synchronized void reset() {
+        state = false;
+    }
+}
diff --git a/jdk/test/java/awt/event/ComponentEvent/MovedResizedTardyEventTest/MovedResizedTardyEventTest.html b/jdk/test/java/awt/event/ComponentEvent/MovedResizedTardyEventTest/MovedResizedTardyEventTest.html
new file mode 100644
index 0000000..39bbfca
--- /dev/null
+++ b/jdk/test/java/awt/event/ComponentEvent/MovedResizedTardyEventTest/MovedResizedTardyEventTest.html
@@ -0,0 +1,43 @@
+<!--
+ Copyright (c) 2004, 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.
+-->
+
+<html>
+<!--  
+  @test
+  @bug          4985250
+  @summary      COMPONENT_MOVED/RESIZED tardy events shouldn't be generated.
+  @author       tav@sparc.spb.su
+  @run applet MovedResizedTardyEventTest.html
+  -->
+<head>
+<title>MovedResizedTardyEventTest</title>
+</head>
+<body>
+
+<h1>MovedResizedTardyEventTest<br>Bug ID: 4985250</h1>
+
+<p> See the dialog box (usually in upper left corner) for instructions</p>
+
+<APPLET CODE="MovedResizedTardyEventTest.class" WIDTH=200 HEIGHT=200></APPLET>
+</body>
+</html>
diff --git a/jdk/test/java/awt/event/ComponentEvent/MovedResizedTardyEventTest/MovedResizedTardyEventTest.java b/jdk/test/java/awt/event/ComponentEvent/MovedResizedTardyEventTest/MovedResizedTardyEventTest.java
new file mode 100644
index 0000000..4c77511
--- /dev/null
+++ b/jdk/test/java/awt/event/ComponentEvent/MovedResizedTardyEventTest/MovedResizedTardyEventTest.java
@@ -0,0 +1,97 @@
+/*
+ * Copyright (c) 2004, 2015, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+  test
+  @bug      4985250
+  @summary  COMPONENT_MOVED/RESIZED tardy events shouldn't be generated.
+  @author   tav@sparc.spb.su
+  @run applet MovedResizedTardyEventTest.html
+*/
+
+import java.awt.*;
+import java.awt.event.*;
+import java.applet.Applet;
+import java.lang.reflect.InvocationTargetException;
+
+public class MovedResizedTardyEventTest extends Applet {
+    Frame f1 = new Frame("F-1");
+    Frame f2 = new Frame("F-2");
+
+    boolean eventFlag = false;
+
+    public static void main(String[] args) {
+        Applet a = new MovedResizedTardyEventTest();
+        a.start();
+    }
+
+    public void start() {
+        f1.setVisible(true);
+        f2.setVisible(true);
+
+        try {
+            Thread.sleep(500);
+        } catch (InterruptedException e) {}
+
+        f1.addComponentListener(new ComponentAdapter() {
+                public void componentMoved(ComponentEvent e) {
+                    MovedResizedTardyEventTest.this.eventFlag = true;
+                    System.err.println(e);
+                }
+                public void componentResized(ComponentEvent e) {
+                    MovedResizedTardyEventTest.this.eventFlag = true;
+                    System.err.println(e);
+                }
+            });
+
+        f1.toFront();
+
+        waitForIdle();
+
+        try { // wait more...
+            Thread.sleep(500);
+        } catch (InterruptedException e) {}
+
+        if (eventFlag) {
+            throw new RuntimeException("Test failed!");
+        }
+    }
+
+    void waitForIdle() {
+        try {
+            (new Robot()).waitForIdle();
+            EventQueue.invokeAndWait( new Runnable() {
+                    public void run() {} // Dummy implementation
+                });
+        } catch(InterruptedException ie) {
+            System.err.println("waitForIdle, non-fatal exception caught:");
+            ie.printStackTrace();
+        } catch(InvocationTargetException ite) {
+            System.err.println("waitForIdle, non-fatal exception caught:");
+            ite.printStackTrace();
+        } catch(AWTException rex) {
+            rex.printStackTrace();
+            throw new RuntimeException("unexpected exception");
+        }
+    }
+}
diff --git a/jdk/test/java/awt/event/KeyEvent/AltCharAcceleratorTest/AltCharAcceleratorTest.java b/jdk/test/java/awt/event/KeyEvent/AltCharAcceleratorTest/AltCharAcceleratorTest.java
index 6a5a26f..741c481 100644
--- a/jdk/test/java/awt/event/KeyEvent/AltCharAcceleratorTest/AltCharAcceleratorTest.java
+++ b/jdk/test/java/awt/event/KeyEvent/AltCharAcceleratorTest/AltCharAcceleratorTest.java
@@ -29,8 +29,6 @@
 @run main AltCharAcceleratorTest
 */
 
-import sun.awt.SunToolkit;
-
 import javax.swing.*;
 import java.awt.*;
 import java.awt.event.*;
@@ -103,12 +101,11 @@
     }
 
     void test() throws Exception {
-        ((SunToolkit) Toolkit.getDefaultToolkit()).realSync();
-
-        focusLatch.await(5, TimeUnit.SECONDS);
-
         Robot robot = new Robot();
         robot.setAutoDelay(100);
+        robot.waitForIdle();
+
+        focusLatch.await(5, TimeUnit.SECONDS);
 
         robot.keyPress(KeyEvent.VK_ALT);
         robot.keyPress(KeyEvent.VK_T);
@@ -133,4 +130,4 @@
         AltCharAcceleratorTest t = new AltCharAcceleratorTest();
         t.test();
     }
-}
\ No newline at end of file
+}
diff --git a/jdk/test/java/awt/keyboard/EqualKeyCode/EqualKeyCode.java b/jdk/test/java/awt/keyboard/EqualKeyCode/EqualKeyCode.java
index d4acc95..9f8598c 100644
--- a/jdk/test/java/awt/keyboard/EqualKeyCode/EqualKeyCode.java
+++ b/jdk/test/java/awt/keyboard/EqualKeyCode/EqualKeyCode.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -24,18 +24,14 @@
 /*
   @test
   @bug 6799551
-  @library ../../regtesthelpers
-  @build Util Sysout
   @summary Extended key codes for small letters undefined
   @author Andrei Dmitriev: area=awt.keyboard
   @run main EqualKeyCode
 */
 
 
-import sun.awt.*;
 import java.awt.*;
-import test.java.awt.regtesthelpers.Util;
-import test.java.awt.regtesthelpers.Sysout;
+import java.awt.event.KeyEvent;
 
 public class EqualKeyCode {
 
@@ -46,13 +42,13 @@
             char cSmall = LETTERS.charAt(i);
             char cLarge = Character.toUpperCase(cSmall);
 
-            int iSmall = ExtendedKeyCodes.getExtendedKeyCodeForChar(cSmall);
-            int iLarge = ExtendedKeyCodes.getExtendedKeyCodeForChar(cLarge);
+            int iSmall = KeyEvent.getExtendedKeyCodeForChar(cSmall);
+            int iLarge = KeyEvent.getExtendedKeyCodeForChar(cLarge);
 
             System.out.print(" " + cSmall + ":" + iSmall + " ---- ");
             System.out.println(" " + cLarge + " : " + iLarge);
-            if (ExtendedKeyCodes.getExtendedKeyCodeForChar(cSmall) !=
-                ExtendedKeyCodes.getExtendedKeyCodeForChar(cLarge))
+            if (KeyEvent.getExtendedKeyCodeForChar(cSmall) !=
+                KeyEvent.getExtendedKeyCodeForChar(cLarge))
             {
                 throw new RuntimeException("ExtendedKeyCode doesn't exist or doesn't match between capital and small letters.");
             }
diff --git a/jdk/test/java/nio/channels/DatagramChannel/MulticastSendReceiveTests.java b/jdk/test/java/nio/channels/DatagramChannel/MulticastSendReceiveTests.java
index 8f0f9a5..848f282 100644
--- a/jdk/test/java/nio/channels/DatagramChannel/MulticastSendReceiveTests.java
+++ b/jdk/test/java/nio/channels/DatagramChannel/MulticastSendReceiveTests.java
@@ -97,7 +97,7 @@
                 // no datagram received
                 if (sa == null) {
                     if (expectedSender != null) {
-                        throw new RuntimeException("Expected message not recieved");
+                        throw new RuntimeException("Expected message not received");
                     }
                     System.out.println("No message received (correct)");
                     return;
@@ -109,10 +109,15 @@
                 buf.flip();
                 byte[] bytes = new byte[buf.remaining()];
                 buf.get(bytes);
-                int receivedId = Integer.parseInt(new String(bytes));
-
-                System.out.format("Received message from %s (id=0x%x)\n",
-                    sender, receivedId);
+                String s = new String(bytes, "UTF-8");
+                int receivedId = -1;
+                try {
+                    receivedId = Integer.parseInt(s);
+                    System.out.format("Received message from %s (id=0x%x)\n",
+                            sender, receivedId);
+                } catch (NumberFormatException x) {
+                    System.out.format("Received message from %s (msg=%s)\n", sender, s);
+                }
 
                 if (expectedSender == null) {
                     if (receivedId == id)
diff --git a/jdk/test/java/util/Calendar/Bug8075548.java b/jdk/test/java/util/Calendar/Bug8075548.java
new file mode 100644
index 0000000..121a28b
--- /dev/null
+++ b/jdk/test/java/util/Calendar/Bug8075548.java
@@ -0,0 +1,108 @@
+/*
+ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * @test
+ * @bug 8075548
+ * @summary Make sure that the format form of month names are produced when there are
+ *          no stand-alone ones available.
+ */
+
+import java.text.*;
+import java.util.*;
+import static java.util.Calendar.*;
+
+public class Bug8075548 {
+    static int errors = 0;
+
+    public static void main(String[] args) throws Throwable {
+        Date date = new SimpleDateFormat("yyyy-MM-dd", Locale.US).parse("2010-09-15");
+        String[][] FORMAT_PAIRS = {
+            { "LLLL", "MMMM" },
+            { "LLL",  "MMM" }
+        };
+        Locale[] LOCALES = {
+            Locale.ENGLISH, Locale.FRENCH, Locale.GERMAN, Locale.JAPANESE
+        };
+
+        for (Locale locale : LOCALES) {
+            for (String[] formats : FORMAT_PAIRS) {
+                String el = new SimpleDateFormat(formats[0], locale).format(date);
+                String em = new SimpleDateFormat(formats[1], locale).format(date);
+                if (!el.equals(em)) {
+                    errors++;
+                    System.err.println(locale + ": " +
+                                       formats[0] + " -> " + el + ", " +
+                                       formats[1] + " -> " + em);
+                }
+            }
+        }
+
+        // Test Calendar.getDisplayName() and .getDisplayNames().
+        for (Locale locale : LOCALES) {
+            testDisplayNames(locale, LONG_FORMAT, LONG_STANDALONE);
+            testDisplayNames(locale, SHORT_FORMAT, SHORT_STANDALONE);
+            testDisplayNames(locale, NARROW_FORMAT, NARROW_STANDALONE);
+        }
+
+        if (errors > 0) {
+            throw new RuntimeException("Failed");
+        }
+    }
+
+    private static void testDisplayNames(Locale locale, int formatStyle, int standaloneStyle) {
+        Map<String, Integer> map = new HashMap<>();
+        for (int month = JANUARY; month <= DECEMBER; month++) {
+            Calendar cal = new GregorianCalendar(2015, month, 1);
+            String format = cal.getDisplayName(MONTH, formatStyle, locale);
+            String standalone = cal.getDisplayName(MONTH, standaloneStyle, locale);
+            if (!format.equals(standalone)) {
+                System.err.println("Calendar.getDisplayName: " + (month+1) +
+                                   ", locale=" + locale +
+                                   ", format=" + format + ", standalone=" + standalone);
+                errors++;
+            }
+            if (standalone != null) {
+                map.put(standalone, month);
+            }
+        }
+        if (formatStyle == NARROW_FORMAT) {
+            // Narrow styles don't support unique names.
+            // (e.g., "J" for JANUARY, JUNE, and JULY)
+            return;
+        }
+        Calendar cal = new GregorianCalendar(2015, JANUARY, 1);
+        Map<String, Integer> mapStandalone = cal.getDisplayNames(MONTH, standaloneStyle, locale);
+        if (!map.equals(mapStandalone)) {
+            System.err.printf("Calendar.getDisplayNames: locale=%s%n    map=%s%n    mapStandalone=%s%n",
+                              locale, map, mapStandalone);
+            errors++;
+        }
+        Map<String, Integer> mapAll = cal.getDisplayNames(MONTH, ALL_STYLES, locale);
+        if (!mapAll.entrySet().containsAll(map.entrySet())) {
+            System.err.printf("Calendar.getDisplayNames: locale=%s%n    map=%s%n    mapAll=%s%n",
+                              locale, map, mapAll);
+            errors++;
+        }
+    }
+}
diff --git a/jdk/test/java/util/Calendar/NarrowNamesTest.java b/jdk/test/java/util/Calendar/NarrowNamesTest.java
index 7338792..1df0476 100644
--- a/jdk/test/java/util/Calendar/NarrowNamesTest.java
+++ b/jdk/test/java/util/Calendar/NarrowNamesTest.java
@@ -86,7 +86,19 @@
                 "\u6728",
                 "\u91d1",
                 "\u571f");
-        testMap(THTH, MONTH, NARROW_FORMAT); // expect null
+        testMap(THTH, MONTH, NARROW_FORMAT,
+                "\u0e21.\u0e04.",
+                "\u0e01.\u0e1e.",
+                "\u0e21\u0e35.\u0e04.",
+                "\u0e40\u0e21.\u0e22.",
+                "\u0e1e.\u0e04.",
+                "\u0e21\u0e34.\u0e22",  // no last dot
+                "\u0e01.\u0e04.",
+                "\u0e2a.\u0e04.",
+                "\u0e01.\u0e22.",
+                "\u0e15.\u0e04.",
+                "\u0e1e.\u0e22.",
+                "\u0e18.\u0e04.");
         testMap(THTH, MONTH, NARROW_STANDALONE,
                 "\u0e21.\u0e04.",
                 "\u0e01.\u0e1e.",
@@ -146,7 +158,7 @@
         Calendar cal = Calendar.getInstance(locale);
         Map<String, Integer> got = cal.getDisplayNames(field, style, locale);
         if (!(expectedMap == null && got == null)
-            && !expectedMap.equals(got)) {
+            && !(expectedMap != null && expectedMap.equals(got))) {
             System.err.printf("testMap: locale=%s, field=%d, style=%d, expected=%s, got=%s%n",
                               locale, field, style, expectedMap, got);
             errors++;
diff --git a/jdk/test/java/util/Map/FunctionalCMEs.java b/jdk/test/java/util/Map/FunctionalCMEs.java
new file mode 100644
index 0000000..499261b
--- /dev/null
+++ b/jdk/test/java/util/Map/FunctionalCMEs.java
@@ -0,0 +1,147 @@
+/*
+ * 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.  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.
+ */
+import java.util.Arrays;
+import java.util.ConcurrentModificationException;
+import java.util.HashMap;
+import java.util.Hashtable;
+import java.util.Iterator;
+import java.util.LinkedHashMap;
+import java.util.Map;
+import java.util.function.BiFunction;
+
+import org.testng.annotations.Test;
+import org.testng.annotations.DataProvider;
+
+/**
+ * @test
+ * @bug 8071667
+ * @summary Ensure that ConcurrentModificationExceptions are thrown as specified from Map methods that accept Functions
+ * @author bchristi
+ * @build Defaults
+ * @run testng FunctionalCMEs
+ */
+public class FunctionalCMEs {
+    final static String KEY = "key";
+
+    @DataProvider(name = "Maps", parallel = true)
+    private static Iterator<Object[]> makeMaps() {
+        return Arrays.asList(
+                // Test maps that CME
+                new Object[]{new HashMap<>(), true},
+                new Object[]{new Hashtable<>(), true},
+                new Object[]{new LinkedHashMap<>(), true},
+                // Test default Map methods - no CME
+                new Object[]{new Defaults.ExtendsAbstractMap<>(), false}
+        ).iterator();
+    }
+
+    @Test(dataProvider = "Maps")
+    public void testComputeIfAbsent(Map<String,String> map, boolean expectCME) {
+        checkCME(() -> {
+            map.computeIfAbsent(KEY, k -> {
+                putToForceRehash(map);
+                return "computedValue";
+            });
+        }, expectCME);
+    }
+
+    @Test(dataProvider = "Maps")
+    public void testCompute(Map<String,String> map, boolean expectCME) {
+        checkCME(() -> {
+            map.compute(KEY, mkBiFunc(map));
+        }, expectCME);
+    }
+
+    @Test(dataProvider = "Maps")
+    public void testComputeWithKeyMapped(Map<String,String> map, boolean expectCME) {
+        map.put(KEY, "firstValue");
+        checkCME(() -> {
+            map.compute(KEY, mkBiFunc(map));
+        }, expectCME);
+    }
+
+    @Test(dataProvider = "Maps")
+    public void testComputeIfPresent(Map<String,String> map, boolean expectCME) {
+        map.put(KEY, "firstValue");
+        checkCME(() -> {
+           map.computeIfPresent(KEY, mkBiFunc(map));
+        }, expectCME);
+    }
+
+    @Test(dataProvider = "Maps")
+    public void testMerge(Map<String,String> map, boolean expectCME) {
+        map.put(KEY, "firstValue");
+        checkCME(() -> {
+            map.merge(KEY, "nextValue", mkBiFunc(map));
+        }, expectCME);
+    }
+
+    @Test(dataProvider = "Maps")
+    public void testForEach(Map<String,String> map, boolean ignored) {
+        checkCME(() -> {
+            map.put(KEY, "firstValue");
+            putToForceRehash(map);
+            map.forEach((k,v) -> {
+                map.remove(KEY);
+            });
+        }, true);
+    }
+
+    @Test(dataProvider = "Maps")
+    public void testReplaceAll(Map<String,String> map, boolean ignored) {
+        checkCME(() -> {
+            map.put(KEY, "firstValue");
+            putToForceRehash(map);
+            map.replaceAll((k,v) -> {
+                map.remove(KEY);
+                return "computedValue";
+            });
+        },true);
+    }
+
+    private static void checkCME(Runnable code, boolean expectCME) {
+        try {
+            code.run();
+        } catch (ConcurrentModificationException cme) {
+            if (expectCME) { return; } else { throw cme; }
+        }
+        if (expectCME) {
+            throw new RuntimeException("Expected CME, but wasn't thrown");
+        }
+    }
+
+    private static BiFunction<String,String,String> mkBiFunc(Map<String,String> map) {
+        return (k,v) -> {
+            putToForceRehash(map);
+            return "computedValue";
+        };
+    }
+
+    private static void putToForceRehash(Map<String,String> map) {
+        for (int i = 0; i < 64; ++i) {
+            map.put(i + "", "value");
+        }
+    }
+}
diff --git a/jdk/test/java/util/logging/LogManager/Configuration/InvalidEscapeConfigurationTest.java b/jdk/test/java/util/logging/LogManager/Configuration/InvalidEscapeConfigurationTest.java
new file mode 100644
index 0000000..62ca74b
--- /dev/null
+++ b/jdk/test/java/util/logging/LogManager/Configuration/InvalidEscapeConfigurationTest.java
@@ -0,0 +1,164 @@
+/*
+ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.UncheckedIOException;
+import java.io.UnsupportedEncodingException;
+import java.nio.file.Files;
+import java.nio.file.Paths;
+import java.util.Properties;
+import java.util.logging.LogManager;
+
+
+/**
+ * @test
+ * @bug 8075810
+ * @run main/othervm InvalidEscapeConfigurationTest
+ * @author danielfuchs
+ */
+public class InvalidEscapeConfigurationTest {
+
+    public static void main(String[] args)
+            throws UnsupportedEncodingException, IOException {
+        String[] validEscapes = {
+            "com.f\\u006fo.level = INF\\u004f",
+            "com.f\\u006fo.level = INFO",
+            "com.foo.level = INF\\u004f"
+        };
+        String[] invalidEscapes = {
+            "com.fo\\u0O6f.level = INF\\u0O4f",
+            "com.fo\\u0O6f.level = INFO",
+            "com.foo.level = INF\\u0O4f"
+        };
+        for (String line : validEscapes) {
+            test(line, true);
+        }
+        for (String line : invalidEscapes) {
+            test(line, false);
+        }
+        try {
+            Properties props = new Properties();
+            props.load((InputStream)null);
+            throw new RuntimeException("Properties.load(null): "
+                    + "NullPointerException exception not raised");
+        } catch (NullPointerException x) {
+            System.out.println("Properties.load(null): "
+                    + "got expected exception: " + x);
+        }
+        try {
+            LogManager.getLogManager().readConfiguration(null);
+            throw new RuntimeException("LogManager.readConfiguration(null): "
+                    + "NullPointerException exception not raised");
+        } catch (NullPointerException x) {
+            System.out.println("LogManager.readConfiguration(null): "
+                    + "got expected exception: " + x);
+        }
+
+
+    }
+
+    public static void test(String line, boolean valid) throws IOException {
+        String test = (valid ? "valid" : "invalid")
+                + " line \"" +line + "\"";
+        System.out.println("Testing " + test);
+
+        // First verify that we get the expected result from Properties.load()
+        try {
+            ByteArrayInputStream bais =
+                    new ByteArrayInputStream(line.getBytes("UTF-8"));
+            Properties props = new Properties();
+            props.load(bais);
+            if (!valid) {
+                throw new RuntimeException(test
+                        + "\n\tProperties.load: expected exception not raised");
+            } else {
+                System.out.println("Properties.load passed for " + test);
+            }
+        } catch(IllegalArgumentException x) {
+            if (!valid) {
+                System.out.println(
+                        "Properties.load: Got expected exception: "
+                        + x + "\n\tfor " + test);
+            } else {
+                throw x;
+            }
+        }
+
+        // Then verify that we get the expected result from
+        // LogManager.readConfiguration
+        try {
+            String content = defaultConfiguration() + '\n' + line + '\n';
+            ByteArrayInputStream bais =
+                    new ByteArrayInputStream(content.getBytes("UTF-8"));
+            LogManager.getLogManager().readConfiguration(bais);
+            if (!valid) {
+                throw new RuntimeException(test
+                        + "\n\tLogManager.readConfiguration: "
+                        + "expected exception not raised");
+            } else {
+                System.out.println("LogManager.readConfiguration passed for "
+                        + test);
+            }
+        } catch(IOException x) {
+            if (!valid) {
+                System.out.println(
+                        "LogManager.readConfiguration: Got expected exception: "
+                        + x + "\n\tfor " + test);
+            } else {
+                throw x;
+            }
+        }
+    }
+
+    static String getConfigurationFileName() {
+        String fname = System.getProperty("java.util.logging.config.file");
+        if (fname == null) {
+            fname = System.getProperty("java.home");
+            if (fname == null) {
+                throw new Error("Can't find java.home ??");
+            }
+            fname = Paths.get(fname, "conf", "logging.properties")
+                    .toAbsolutePath().normalize().toString();
+        }
+        return fname;
+    }
+
+    static String defaultConfiguration() throws IOException {
+        Properties props = new Properties();
+        String fileName = getConfigurationFileName();
+        if (Files.exists(Paths.get(fileName))) {
+            try (InputStream is = new FileInputStream(fileName);) {
+                props.load(is);
+            } catch(IOException x) {
+                throw new UncheckedIOException(x);
+            }
+        }
+        ByteArrayOutputStream bos = new ByteArrayOutputStream();
+        props.store(bos, null);
+        return bos.toString();
+    }
+
+}
diff --git a/jdk/test/java/util/logging/LogManager/TestLoggerNames.java b/jdk/test/java/util/logging/LogManager/TestLoggerNames.java
new file mode 100644
index 0000000..0ddb2fd
--- /dev/null
+++ b/jdk/test/java/util/logging/LogManager/TestLoggerNames.java
@@ -0,0 +1,239 @@
+/*
+ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+import java.util.Collections;
+import java.util.Enumeration;
+import java.util.Iterator;
+import java.util.List;
+import java.util.concurrent.CopyOnWriteArrayList;
+import java.util.concurrent.Phaser;
+import java.util.concurrent.Semaphore;
+import java.util.logging.Handler;
+import java.util.logging.LogManager;
+import java.util.logging.Logger;
+
+
+/**
+ * @test
+ * @bug 7113878
+ * @summary This is not a test that will check that 7113878 is fixed, but
+ *          rather a test that will invoke the modified code & try to verify
+ *          that fixing 7113878 has not introduced some big regression.
+ *          This test should pass, whether 7113878 is there or not.
+ * @run main/othervm TestLoggerNames
+ * @author danielfuchs
+ */
+public class TestLoggerNames {
+
+    static final class TestLogger extends java.util.logging.Logger {
+
+        final Semaphore sem = new Semaphore(0);
+        final Semaphore wait = new Semaphore(0);
+
+        public TestLogger(String name, String resourceBundleName) {
+            super(name, resourceBundleName);
+        }
+
+        @Override
+        public Handler[] getHandlers() {
+           boolean found = false;
+           try {
+                System.out.println("Entering "+getName()+" getHandlers()");
+                for (StackTraceElement ste : Thread.currentThread().getStackTrace()) {
+                    if (LogManager.class.getName().equals(ste.getClassName())
+                            && "reset".equals(ste.getMethodName())) {
+                        found = true;
+                        System.out.println(getName()+" getHandlers() called by " + ste);
+                    }
+                }
+                sem.release();
+                try {
+                    System.out.println("TestLogger: Acquiring wait for "+getName());
+                    wait.acquire();
+                    try {
+                        System.out.println("TestLogger: Acquired wait for "+getName());
+                        return super.getHandlers();
+                    } finally {
+                        System.out.println("TestLogger: Releasing wait for "+getName());
+                        wait.release();
+                    }
+                } finally {
+                    System.out.println("Unblocking "+getName());
+                    sem.acquire();
+                    System.out.println("Unblocked "+getName());
+                    if (found) {
+                        System.out.println("Reset will proceed...");
+                    }
+                }
+            } catch (InterruptedException x) {
+                throw new IllegalStateException(x);
+            }
+        }
+    }
+
+    static volatile boolean stop;
+    static volatile Throwable resetFailed;
+    static volatile Throwable checkLoggerNamesFailed;
+    static volatile Phaser phaser = new Phaser(2);
+
+
+    static void checkLoggerNames(List<Logger> loggers) {
+        Enumeration<String> names = LogManager.getLogManager().getLoggerNames();
+        if (names instanceof Iterator) {
+            for (Iterator<?> it = Iterator.class.cast(names); it.hasNext(); ) {
+                try {
+                    it.remove();
+                    throw new RuntimeException("Iterator supports remove!");
+                } catch (UnsupportedOperationException x) {
+                    System.out.println("OK: Iterator doesn't support remove.");
+                }
+            }
+        }
+        List<String> loggerNames = Collections.list(names);
+        if (!loggerNames.contains("")) {
+            throw new RuntimeException("\"\"" +
+                    " not found in " + loggerNames);
+        }
+        if (!loggerNames.contains("global")) {
+            throw new RuntimeException("global" +
+                    " not found in " + loggerNames);
+        }
+        for (Logger l : loggers) {
+            if (!loggerNames.contains(l.getName())) {
+                throw new RuntimeException(l.getName() +
+                        " not found in " + loggerNames);
+            }
+        }
+        System.out.println("Got all expected logger names");
+    }
+
+
+    public static void main(String[] args) throws InterruptedException {
+        LogManager.getLogManager().addLogger(new TestLogger("com.foo.bar.zzz", null));
+        try {
+            Logger.getLogger(null);
+            throw new RuntimeException("Logger.getLogger(null) didn't throw expected NPE");
+        } catch (NullPointerException x) {
+            System.out.println("Got expected NullPointerException for Logger.getLogger(null)");
+        }
+        List<Logger> loggers = new CopyOnWriteArrayList<>();
+        loggers.add(Logger.getLogger("one.two.addMeAChild"));
+        loggers.add(Logger.getLogger("aaa.bbb.replaceMe"));
+        loggers.add(Logger.getLogger("bbb.aaa.addMeAChild"));
+        TestLogger test = (TestLogger)Logger.getLogger("com.foo.bar.zzz");
+        loggers.add(Logger.getLogger("ddd.aaa.addMeAChild"));
+
+        checkLoggerNames(loggers);
+
+        Thread loggerNamesThread = new Thread(() -> {
+            try {
+                while (!stop) {
+                    checkLoggerNames(loggers);
+                    Thread.sleep(10);
+                    if (!stop) {
+                        phaser.arriveAndAwaitAdvance();
+                    }
+                }
+            } catch (Throwable t) {
+                t.printStackTrace(System.err);
+                checkLoggerNamesFailed = t;
+            }
+        }, "loggerNames");
+
+        Thread resetThread = new Thread(() -> {
+            try {
+                System.out.println("Calling reset...");
+                LogManager.getLogManager().reset();
+                System.out.println("Reset done...");
+                System.out.println("Reset again...");
+                LogManager.getLogManager().reset();
+                System.out.println("Reset done...");
+            } catch(Throwable t) {
+                resetFailed = t;
+                System.err.println("Unexpected exception or error in reset Thread");
+                t.printStackTrace(System.err);
+            }
+        }, "reset");
+
+        resetThread.setDaemon(true);
+        resetThread.start();
+
+        System.out.println("Waiting for reset to get handlers");
+        test.sem.acquire();
+        try {
+            loggerNamesThread.start();
+            System.out.println("Reset has called getHandlers on " + test.getName());
+            int i = 0;
+            for (Enumeration<String> e = LogManager.getLogManager().getLoggerNames();
+                e.hasMoreElements();) {
+                String name = e.nextElement();
+                if (name.isEmpty()) continue;
+                if (name.endsWith(".addMeAChild")) {
+                    Logger l =  Logger.getLogger(name+".child");
+                    loggers.add(l);
+                    System.out.println("*** Added " + l.getName());
+                    i++;
+                } else if (name.endsWith("replaceMe")) {
+                    Logger l = Logger.getLogger(name);
+                    loggers.remove(l);
+                    l = Logger.getLogger(name.replace("replaceMe", "meReplaced"));
+                    loggers.add(l);
+                    System.gc();
+                    if (LogManager.getLogManager().getLogger(name) == null) {
+                        System.out.println("*** "+ name + " successfully replaced with " + l.getName());
+                    }
+                    i++;
+                } else {
+                    System.out.println("Nothing to do for logger: " + name);
+                }
+                phaser.arriveAndAwaitAdvance();
+                if (i >= 3 && i++ == 3) {
+                    System.out.println("Loggers are now: " +
+                            Collections.list(LogManager.getLogManager().getLoggerNames()));
+                    test.wait.release();
+                    test.sem.release();
+                    System.out.println("Joining " + resetThread);
+                    resetThread.join();
+                }
+            }
+        } catch (RuntimeException | InterruptedException | Error x) {
+            test.wait.release();
+            test.sem.release();
+            throw x;
+        } finally {
+            stop = true;
+            phaser.arriveAndDeregister();
+            loggerNamesThread.join();
+            loggers.clear();
+        }
+
+
+        if (resetFailed != null || checkLoggerNamesFailed != null) {
+            RuntimeException r = new RuntimeException("Some of the concurrent threads failed");
+            if (resetFailed != null) r.addSuppressed(resetFailed);
+            if (checkLoggerNamesFailed != null) r.addSuppressed(checkLoggerNamesFailed);
+            throw r;
+        }
+
+    }
+
+}
diff --git a/jdk/test/java/util/zip/EntryCount64k.java b/jdk/test/java/util/zip/EntryCount64k.java
index c815efdd..b59980f 100644
--- a/jdk/test/java/util/zip/EntryCount64k.java
+++ b/jdk/test/java/util/zip/EntryCount64k.java
@@ -24,33 +24,76 @@
 /**
  * @test
  * @summary Test java.util.zip behavior with ~64k entries
+ * @library /lib/testlibrary
  * @run main/othervm EntryCount64k
  * @run main/othervm -Djdk.util.zip.inhibitZip64=true EntryCount64k
  * @run main/othervm -Djdk.util.zip.inhibitZip64=false EntryCount64k
  */
 
-import java.io.*;
-import java.util.*;
-import java.util.zip.*;
+import java.io.BufferedInputStream;
+import java.io.BufferedOutputStream;
+import java.io.File;
+import java.nio.file.Files;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.io.RandomAccessFile;
+import java.nio.file.Paths;
+import java.util.Enumeration;
+import java.util.zip.ZipEntry;
+import java.util.zip.ZipFile;
+import java.util.zip.ZipInputStream;
+import java.util.zip.ZipOutputStream;
+
+import jdk.testlibrary.OutputAnalyzer;
+import jdk.testlibrary.ProcessTools;
 
 public class EntryCount64k {
+    public static class Main {
+        public static void main(String[] args) {
+            System.out.print("Main");
+        }
+    }
 
-    public static void main(String[] args) throws Exception {
-        for (int i = (1 << 16) - 2; i < (1 << 16) + 2; i++)
+    static final String MAIN_CLASS = "EntryCount64k$Main";
+    static final String THIS_CLASS = "EntryCount64k";
+    static final String[] SPECIAL_CLASSES = { MAIN_CLASS, THIS_CLASS };
+    // static final String[] SPECIAL_CLASSES = { MAIN_CLASS };
+    static final int SPECIAL_COUNT = 1 + SPECIAL_CLASSES.length;
+
+    public static void main(String[] args) throws Throwable {
+        for (int i = (1 << 16) - 3; i < (1 << 16) + 2; i++)
             test(i);
     }
 
-    static void test(int entryCount) throws Exception {
+    static void test(int entryCount) throws Throwable {
         File zipFile = new File("EntryCount64k-tmp.zip");
         zipFile.delete();
 
-        try (ZipOutputStream zos =
-             new ZipOutputStream(
-                new BufferedOutputStream(
-                    new FileOutputStream(zipFile)))) {
-            for (int i = 0; i < entryCount; i++) {
-                ZipEntry e = new ZipEntry(Integer.toString(i));
-                zos.putNextEntry(e);
+        try (FileOutputStream fos = new FileOutputStream(zipFile);
+             BufferedOutputStream bos = new BufferedOutputStream(fos);
+             ZipOutputStream zos = new ZipOutputStream(bos)) {
+
+            // Add entries to allow the zip file to be used with "java -jar"
+            zos.putNextEntry(new ZipEntry("META-INF/MANIFEST.MF"));
+            for (String line : new String[] {
+                     "Manifest-Version: 1.0",
+                     "Main-Class: " + MAIN_CLASS,
+                 })
+                zos.write((line + "\n").getBytes("US-ASCII"));
+            zos.closeEntry();
+
+            String testClasses = System.getProperty("test.classes");
+            for (String className : SPECIAL_CLASSES) {
+                String baseName = className + ".class";
+                ZipEntry ze = new ZipEntry(baseName);
+                File file = new File(testClasses, baseName);
+                zos.putNextEntry(ze);
+                Files.copy(file.toPath(), zos);
+                zos.closeEntry();
+            }
+
+            for (int i = SPECIAL_COUNT; i < entryCount; i++) {
+                zos.putNextEntry(new ZipEntry(Integer.toString(i)));
                 zos.closeEntry();
             }
         }
@@ -86,16 +129,16 @@
         return false;
     }
 
-    static void checkCanRead(File zipFile, int entryCount) throws Exception {
+    static void checkCanRead(File zipFile, int entryCount) throws Throwable {
         // Check ZipInputStream API
-        try (ZipInputStream zis =
-             new ZipInputStream(
-                 new BufferedInputStream(
-                     new FileInputStream(zipFile)))) {
+        try (FileInputStream fis = new FileInputStream(zipFile);
+             BufferedInputStream bis = new BufferedInputStream(fis);
+             ZipInputStream zis = new ZipInputStream(bis)) {
             for (int i = 0; i < entryCount; i++) {
                 ZipEntry e = zis.getNextEntry();
-                if (Integer.parseInt(e.getName()) != i)
-                    throw new AssertionError();
+                if (i >= SPECIAL_COUNT) // skip special entries
+                    if (Integer.parseInt(e.getName()) != i)
+                        throw new AssertionError(e.getName());
             }
             if (zis.getNextEntry() != null)
                 throw new AssertionError();
@@ -106,8 +149,9 @@
             Enumeration<? extends ZipEntry> en = zf.entries();
             for (int i = 0; i < entryCount; i++) {
                 ZipEntry e = en.nextElement();
-                if (Integer.parseInt(e.getName()) != i)
-                    throw new AssertionError();
+                if (i >= SPECIAL_COUNT) // skip special entries
+                    if (Integer.parseInt(e.getName()) != i)
+                        throw new AssertionError();
             }
             if (en.hasMoreElements()
                 || (zf.size() != entryCount)
@@ -115,5 +159,15 @@
                 || (zf.getEntry(Integer.toString(entryCount)) != null))
                 throw new AssertionError();
         }
+
+        // Check java -jar
+        String javaHome = System.getProperty("java.home");
+        String java = Paths.get(javaHome, "bin", "java").toString();
+        String[] cmd = { java, "-jar", zipFile.getName() };
+        ProcessBuilder pb = new ProcessBuilder(cmd);
+        OutputAnalyzer a = ProcessTools.executeProcess(pb);
+        a.shouldHaveExitValue(0);
+        a.stdoutShouldMatch("\\AMain\\Z");
+        a.stderrShouldMatch("\\A\\Z");
     }
 }
diff --git a/jdk/test/javax/imageio/stream/ShortStreamTest.java b/jdk/test/javax/imageio/stream/ShortStreamTest.java
new file mode 100644
index 0000000..2b133a5
--- /dev/null
+++ b/jdk/test/javax/imageio/stream/ShortStreamTest.java
@@ -0,0 +1,127 @@
+/*
+ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * @test
+ * @bug     8074954
+ * @summary Test verifies that an IOException is triggered if input stream
+ *          does not contain enough data to read a multi-byte type.
+ *
+ * @run     main ShortStreamTest
+ */
+
+import javax.imageio.ImageIO;
+import javax.imageio.stream.ImageInputStream;
+import java.io.ByteArrayInputStream;
+import java.io.IOException;
+
+public class ShortStreamTest {
+    public static void main(String[] args) throws IOException {
+        TestCase[]  tests = createTests();
+
+        for (TestCase t : tests) {
+            t.test();
+        }
+    }
+
+    private static abstract class TestCase {
+        abstract void testRead(ImageInputStream iis) throws IOException;
+
+        public void test() {
+            boolean gotException = false;
+
+            ImageInputStream iis = createShortStream();
+
+            try {
+                testRead(iis);
+            } catch (IOException e) {
+                e.printStackTrace(System.out);
+                gotException = true;
+            }
+
+            if (!gotException) {
+                throw new RuntimeException("Test failed.");
+            }
+            System.out.println("Test PASSED");
+        }
+    }
+
+
+    private static ImageInputStream createShortStream() {
+        try {
+            byte[] integerTestArray = new byte[] { 80 };
+            ByteArrayInputStream bais = new ByteArrayInputStream(integerTestArray);
+
+            return ImageIO.createImageInputStream(bais);
+        } catch (IOException e) {
+            return null;
+        }
+    }
+
+    private static TestCase[] createTests() {
+        return new TestCase[]{
+                new TestCase() {
+                    @Override
+                    void testRead(ImageInputStream iis) throws IOException {
+                        iis.readInt();
+                    }
+                },
+                new TestCase() {
+                    @Override
+                    void testRead(ImageInputStream iis) throws IOException {
+                        iis.readShort();
+                    }
+                },
+                new TestCase() {
+                    @Override
+                    void testRead(ImageInputStream iis) throws IOException {
+                        iis.readDouble();
+                    }
+                },
+                new TestCase() {
+                    @Override
+                    void testRead(ImageInputStream iis) throws IOException {
+                        iis.readFloat();
+                    }
+                },
+                new TestCase() {
+                    @Override
+                    void testRead(ImageInputStream iis) throws IOException {
+                        iis.readLong();
+                    }
+                },
+                new TestCase() {
+                    @Override
+                    void testRead(ImageInputStream iis) throws IOException {
+                        iis.readUnsignedInt();
+                    }
+                },
+                new TestCase() {
+                    @Override
+                    void testRead(ImageInputStream iis) throws IOException {
+                        iis.readUnsignedShort();
+                    }
+                }
+        };
+    }
+}
diff --git a/jdk/test/javax/swing/JTableHeader/4473075/bug4473075.java b/jdk/test/javax/swing/JTableHeader/4473075/bug4473075.java
new file mode 100644
index 0000000..a45cd16
--- /dev/null
+++ b/jdk/test/javax/swing/JTableHeader/4473075/bug4473075.java
@@ -0,0 +1,106 @@
+/*
+ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/* @test
+   @bug 4473075
+   @summary JTable header rendering problem (after setting preferred size)
+   @author Semyon Sadetsky
+*/
+
+import javax.swing.*;
+import javax.swing.table.DefaultTableModel;
+import java.awt.*;
+import java.awt.event.InputEvent;
+
+public class bug4473075 {
+    public static final int USER_HEADER_HEIGHT = 40;
+    private static JTable table;
+    private static JScrollPane scpScroll;
+    private static Point point;
+    private static JFrame frame;
+
+    public static void main(String[] args) throws Exception {
+        Robot robot = new Robot();
+        robot.setAutoDelay(20);
+        SwingUtilities.invokeAndWait(new Runnable() {
+            public void run() {
+                frame = new JFrame();
+                frame.setUndecorated(true);
+                frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
+                table = new JTable();
+                String t = "a cell text";
+                table.setModel(new DefaultTableModel(
+                        new Object[][]{new Object[]{t, t, t, t, t}},
+                        new Object[]{t, t, t, t, t}));
+                table.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
+                scpScroll = new JScrollPane(table);
+
+                // Manually set preferred size of header...
+                Dimension preferredSize = new Dimension(table.getSize().width,
+                        USER_HEADER_HEIGHT);
+                table.getTableHeader().setPreferredSize(preferredSize);
+
+                frame.setContentPane(scpScroll);
+                frame.setSize(250, 480);
+                frame.setLocationRelativeTo(null);
+                frame.setVisible(true);
+                point = scpScroll.getHorizontalScrollBar()
+                        .getLocationOnScreen();
+            }
+        });
+        robot.waitForIdle();
+
+        robot.mouseMove(point.x + 100, point.y + 5);
+        robot.mousePress(InputEvent.BUTTON1_MASK);
+        robot.mouseMove(point.x + 150, point.y + 5);
+        robot.mouseRelease(InputEvent.BUTTON1_MASK);
+
+        int headerH = table.getTableHeader().getHeight();
+        if (headerH != USER_HEADER_HEIGHT) {
+            throw new RuntimeException("TableHeader height was not set: "
+                    + headerH + " !=" + USER_HEADER_HEIGHT);
+        }
+
+        double tableX = table.getX();
+        int headerX = table.getTableHeader().getX();
+        if (tableX != headerX) {
+            throw new RuntimeException("TableHeader X position is wrong: "
+                    + tableX + " !=" + headerX);
+        }
+
+        double tableW = table.getWidth();
+        int headerW = table.getTableHeader().getWidth();
+        if (tableW != headerW) {
+            throw new RuntimeException("TableHeader width is wrong: "
+                    + tableW + " !=" + headerW);
+        }
+
+        SwingUtilities.invokeLater(new Runnable() {
+            @Override
+            public void run() {
+                frame.dispose();
+            }
+        });
+        System.out.println("ok");
+    }
+}
diff --git a/jdk/test/javax/swing/ToolTipManager/7123767/bug7123767.java b/jdk/test/javax/swing/ToolTipManager/7123767/bug7123767.java
index 4c7402d..1435038 100644
--- a/jdk/test/javax/swing/ToolTipManager/7123767/bug7123767.java
+++ b/jdk/test/javax/swing/ToolTipManager/7123767/bug7123767.java
@@ -28,8 +28,6 @@
    @run main bug7123767
 */
 
-import sun.awt.SunToolkit;
-
 import javax.swing.*;
 import javax.swing.plaf.metal.MetalLookAndFeel;
 import java.awt.*;
@@ -160,8 +158,10 @@
 
     // Moves mouse pointer to the corners of every GraphicsConfiguration
     private static void testToolTip() throws AWTException {
-        SunToolkit toolkit = (SunToolkit) Toolkit.getDefaultToolkit();
-        toolkit.realSync();
+
+        robot = new Robot();
+        robot.setAutoDelay(20);
+        robot.waitForIdle();
 
         GraphicsEnvironment environment = GraphicsEnvironment.getLocalGraphicsEnvironment();
         GraphicsDevice[] devices = environment.getScreenDevices();
@@ -169,28 +169,28 @@
             GraphicsConfiguration[] configs = device.getConfigurations();
             for (GraphicsConfiguration config : configs) {
                 Rectangle rect = config.getBounds();
-                Insets insets = toolkit.getScreenInsets(config);
+                Insets insets = Toolkit.getDefaultToolkit().getScreenInsets(config);
                 adjustInsets(rect, insets);
 
                 // Upper left
                 glide(rect.x + rect.width / 2, rect.y + rect.height / 2,
                         rect.x + MARGIN, rect.y + MARGIN);
-                toolkit.realSync();
+                robot.waitForIdle();
 
                 // Lower left
                 glide(rect.x + rect.width / 2, rect.y + rect.height / 2,
                         rect.x + MARGIN, rect.y + rect.height - MARGIN);
-                toolkit.realSync();
+                robot.waitForIdle();
 
                 // Upper right
                 glide(rect.x + rect.width / 2, rect.y + rect.height / 2,
                         rect.x + rect.width - MARGIN, rect.y + MARGIN);
-                toolkit.realSync();
+                robot.waitForIdle();
 
                 // Lower right
                 glide(rect.x + rect.width / 2, rect.y + rect.height / 2,
                         rect.x + rect.width - MARGIN, rect.y + rect.height - MARGIN);
-                toolkit.realSync();
+                robot.waitForIdle();
             }
         }
     }
diff --git a/jdk/test/javax/swing/plaf/synth/8040328/bug8040328.java b/jdk/test/javax/swing/plaf/synth/8040328/bug8040328.java
new file mode 100644
index 0000000..72a0e46
--- /dev/null
+++ b/jdk/test/javax/swing/plaf/synth/8040328/bug8040328.java
@@ -0,0 +1,98 @@
+/*
+ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/* @test
+   @bug 8040328
+   @summary JSlider has wrong preferred size with Synth LAF
+   @author Semyon Sadetsky
+*/
+
+import javax.swing.*;
+import javax.swing.plaf.synth.SynthLookAndFeel;
+import java.awt.*;
+import java.io.ByteArrayInputStream;
+
+public class bug8040328 {
+    private static String synthXml = "<synth>" +
+            " <style id=\"all\">" +
+            " <font name=\"Segoe UI\" size=\"12\"/>" +
+            " </style>" +
+            " <bind style=\"all\" type=\"REGION\" key=\".*\"/>" +
+            " <style id=\"slider\">" +
+            " <insets top=\"10\" left=\"5\" bottom=\"10\" right=\"5\"/>" +
+            " </style>" +
+            " <bind style=\"slider\" type=\"region\" key=\"Slider\"/>" +
+            "</synth>";
+
+    public static void main(String[] args) throws Exception {
+        SynthLookAndFeel lookAndFeel = new SynthLookAndFeel();
+        lookAndFeel.load(new ByteArrayInputStream(synthXml.getBytes("UTF8")),
+                bug8040328.class);
+        UIManager.setLookAndFeel(lookAndFeel);
+        SwingUtilities.invokeAndWait(new Runnable() {
+            public void run() {
+                final JFrame frame = new JFrame();
+                try {
+                    frame.setUndecorated(true);
+                    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
+                    frame.setVisible(true);
+                    test(frame);
+                } finally {
+                    frame.dispose();
+                }
+            }
+        });
+        System.out.println("ok");
+    }
+
+    static void test(JFrame frame) {
+        JSlider hslider = new JSlider(JSlider.HORIZONTAL);
+        hslider.setBackground(Color.DARK_GRAY);
+        frame.getContentPane().add(hslider, BorderLayout.CENTER);
+        frame.getContentPane().setBackground(Color.CYAN);
+        frame.pack();
+        Insets insets = hslider.getInsets();
+        if (hslider.getWidth() != 200 + insets.left + insets.right) {
+            throw new RuntimeException(
+                    "Horizontal slider width is wrong " + hslider.getWidth());
+        }
+        if (hslider.getHeight() != hslider.getMinimumSize().height) {
+            throw new RuntimeException(
+                    "Horizontal slider height is wrong " + hslider.getHeight());
+        }
+        frame.getContentPane().remove(hslider);
+
+        JSlider vslider = new JSlider(JSlider.VERTICAL);
+        frame.getContentPane().add(vslider);
+        frame.pack();
+        insets = vslider.getInsets();
+        if (vslider.getWidth() != vslider.getMinimumSize().width) {
+            throw new RuntimeException(
+                    "Verical slider width is wrong " + vslider.getWidth());
+        }
+        if (vslider.getHeight() != 200 + insets.top + insets.bottom) {
+            throw new RuntimeException(
+                    "Verical slider height is wrong " + vslider.getHeight());
+        }
+    }
+}
diff --git a/jdk/test/javax/xml/jaxp/transform/8062923/XslSubstringTest.java b/jdk/test/javax/xml/jaxp/transform/8062923/XslSubstringTest.java
index fcc36ae..cb3594b 100644
--- a/jdk/test/javax/xml/jaxp/transform/8062923/XslSubstringTest.java
+++ b/jdk/test/javax/xml/jaxp/transform/8062923/XslSubstringTest.java
@@ -23,10 +23,11 @@
 
 /**
  * @test
- * @bug 8062923 8062924
+ * @bug 8062923 8062924 8074297 8076290
  * @run testng XslSubstringTest
  * @summary Test xsl substring function with negative, Inf and
- * NaN length and few other use cases
+ * NaN length and few other use cases. Also test proper
+ * processing of supplementary characters by substring function.
  */
 
 import java.io.StringReader;
@@ -39,6 +40,7 @@
 import javax.xml.transform.stream.StreamSource;
 
 import static org.testng.Assert.assertEquals;
+import org.testng.annotations.DataProvider;
 import org.testng.annotations.Test;
 
 public class XslSubstringTest {
@@ -50,6 +52,36 @@
             + "<xsl:template match='/'><t>";
     final String xslPost = "</t></xsl:template></xsl:stylesheet>";
 
+    @DataProvider(name = "GeneralTestsData")
+    private Object[][] xmls() {
+        return new Object[][] {
+            { "|<xsl:value-of select=\"substring('asdf',2, 1)\"/>|", "<t>|s|</t>"},
+            { "|<xsl:value-of select=\"substring('asdf',2, 1 div 0)\"/>|", "<t>|sdf|</t>"},
+            { "|<xsl:value-of select=\"substring('asdf',2, -0 div 0)\"/>|", "<t>||</t>" },
+            { "|<xsl:value-of select=\"substring('asdf',2, 1 div 0)\"/>|", "<t>|sdf|</t>" },
+            // 8076290 bug test case
+            { "|<xsl:value-of select=\"substring('123', 0, 3)\"/>|", "<t>|12|</t>"},
+        };
+    }
+
+    @DataProvider(name = "SupplementaryCharactersTestData")
+    private Object[][] dataSupplementaryCharacters() {
+        return new Object[][] {
+            // 8074297 bug test cases
+            { "|<xsl:value-of select=\"substring('&#131083;ABC', 3)\"/>|",    "<t>|BC|</t>"},
+            { "|<xsl:value-of select=\"substring('&#131083;ABC', 3, 1)\"/>|", "<t>|B|</t>" },
+            { "|<xsl:value-of select=\"substring('&#131083;ABC', 2, 2)\"/>|", "<t>|AB|</t>"},
+            { "|<xsl:value-of select=\"substring('&#131083;ABC', 3, 2)\"/>|", "<t>|BC|</t>"},
+            { "|<xsl:value-of select=\"substring('&#131083;ABC', 3, 4)\"/>|", "<t>|BC|</t>"},
+            { "|<xsl:value-of select=\"substring('&#131083;ABC', 1, 1)\"/>|", "<t>|&#131083;|</t>"},
+            { "|<xsl:value-of select=\"substring('&#131083;ABC', 2, 1)\"/>|", "<t>|A|</t>"},
+            { "|<xsl:value-of select=\"substring('&#131083;ABC', 1, 1 div 0)\"/>|", "<t>|&#131083;ABC|</t>"},
+            { "|<xsl:value-of select=\"substring('&#131083;ABC', -10, 1 div 0)\"/>|", "<t>|&#131083;ABC|</t>"},
+            // 8076290 bug test case
+            { "|<xsl:value-of select=\"substring('&#131083;ABC', 0, 2)\"/>|", "<t>|&#131083;|</t>"},
+        };
+    }
+
     private String testTransform(String xsl) throws Exception {
         //Prepare sources for transormation
         Source src = new StreamSource(new StringReader(xml));
@@ -78,27 +110,14 @@
                 "<t>||</t>");
     }
 
-    @Test
-    public void testGeneral1() throws Exception {
-        assertEquals(testTransform("|<xsl:value-of select=\"substring('asdf',2, 1)\"/>|"),
-                "<t>|s|</t>");
+    @Test(dataProvider = "GeneralTestsData")
+    public void testGeneralAll(String xsl, String result) throws Exception {
+        assertEquals(testTransform(xsl), result);
     }
 
-    @Test
-    public void testGeneral2() throws Exception {
-        assertEquals(testTransform("|<xsl:value-of select=\"substring('asdf',2, 1 div 0)\"/>|"),
-                "<t>|sdf|</t>");
+    @Test(dataProvider = "SupplementaryCharactersTestData")
+    public void testSupplementCharacters(String xsl, String result) throws Exception {
+        assertEquals(testTransform(xsl), result);
     }
 
-    @Test
-    public void testGeneral3() throws Exception {
-        assertEquals(testTransform("|<xsl:value-of select=\"substring('asdf',2, -0 div 0)\"/>|"),
-                "<t>||</t>");
-    }
-
-    @Test
-    public void testGeneral4() throws Exception {
-        assertEquals(testTransform("|<xsl:value-of select=\"substring('asdf',2, 0 div 0)\"/>|"),
-                "<t>||</t>");
-    }
 }
diff --git a/jdk/test/jdk/lambda/FDTest.java b/jdk/test/jdk/lambda/FDTest.java
deleted file mode 100644
index c207a61..0000000
--- a/jdk/test/jdk/lambda/FDTest.java
+++ /dev/null
@@ -1,192 +0,0 @@
-/*
- * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-
-import shapegen.*;
-
-import com.sun.source.util.JavacTask;
-import com.sun.tools.javac.util.Pair;
-
-import java.net.URI;
-import java.util.Arrays;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.List;
-
-import javax.tools.Diagnostic;
-import javax.tools.JavaCompiler;
-import javax.tools.JavaFileObject;
-import javax.tools.SimpleJavaFileObject;
-import javax.tools.StandardJavaFileManager;
-import javax.tools.ToolProvider;
-
-import org.testng.annotations.Test;
-import org.testng.annotations.BeforeSuite;
-import org.testng.annotations.DataProvider;
-import static org.testng.Assert.*;
-
-public class FDTest {
-
-    public enum TestKind {
-        POSITIVE,
-        NEGATIVE;
-
-        Collection<Hierarchy> getHierarchy(HierarchyGenerator hg) {
-            return this == POSITIVE ?
-                    hg.getOK() : hg.getErr();
-        }
-    }
-
-    public static JavaCompiler comp;
-    public static StandardJavaFileManager fm;
-
-    @BeforeSuite
-    static void init() {
-        // create default shared JavaCompiler - reused across multiple
-        // compilations
-
-        comp = ToolProvider.getSystemJavaCompiler();
-        fm = comp.getStandardFileManager(null, null, null);
-    }
-
-    public static void main(String[] args) throws Exception {
-        init();
-
-        for (Pair<TestKind,Hierarchy> fdtest : generateCases()) {
-            runTest(fdtest.fst, fdtest.snd, comp, fm);
-        }
-    }
-
-    @Test(dataProvider = "fdCases")
-    public void testOneCase(TestKind tk, Hierarchy hs)
-            throws Exception {
-        FDTest.runTest(tk, hs, comp, fm);
-    }
-
-    @DataProvider(name = "fdCases")
-    public Object[][] caseGenerator() {
-        List<Pair<TestKind, Hierarchy>> cases = generateCases();
-        Object[][] fdCases = new Object[cases.size()][];
-        for (int i = 0; i < cases.size(); ++i) {
-            fdCases[i] = new Object[2];
-            fdCases[i][0] = cases.get(i).fst;
-            fdCases[i][1] = cases.get(i).snd;
-        }
-        return fdCases;
-    }
-
-    public static List<Pair<TestKind, Hierarchy>> generateCases() {
-        ArrayList<Pair<TestKind,Hierarchy>> list = new ArrayList<>();
-        HierarchyGenerator hg = new HierarchyGenerator();
-        for (TestKind tk : TestKind.values()) {
-            for (Hierarchy hs : tk.getHierarchy(hg)) {
-                list.add(new Pair<>(tk, hs));
-            }
-        }
-        return list;
-    }
-
-    public static void runTest(TestKind tk, Hierarchy hs,
-            JavaCompiler comp, StandardJavaFileManager fm) throws Exception {
-        new FDTest(tk, hs).run(comp, fm);
-    }
-
-    TestKind tk;
-    Hierarchy hs;
-    DefenderTestSource source;
-    DiagnosticChecker diagChecker;
-
-    public FDTest() {}
-
-    FDTest(TestKind tk, Hierarchy hs) {
-        this.tk = tk;
-        this.hs = hs;
-        this.source = new DefenderTestSource();
-        this.diagChecker = new DiagnosticChecker();
-    }
-
-    void run(JavaCompiler tool, StandardJavaFileManager fm) throws Exception {
-        JavacTask ct = (JavacTask)tool.getTask(null, fm, diagChecker,
-                null, null, Arrays.asList(source));
-        try {
-            ct.analyze();
-        } catch (Throwable ex) {
-            fail("Error thrown when analyzing the following source:\n" + source.getCharContent(true));
-        }
-        check();
-    }
-
-    void check() {
-        boolean errorExpected = tk == TestKind.NEGATIVE;
-        if (errorExpected != diagChecker.errorFound) {
-            fail("problem in source: \n" +
-                 "\nerror found = " + diagChecker.errorFound +
-                 "\nerror expected = " + errorExpected +
-                 "\n" + dumpHierarchy() +
-                 "\n" + source.getCharContent(true));
-        }
-    }
-
-    String dumpHierarchy() {
-        StringBuilder buf = new StringBuilder();
-        buf.append("root = " + hs.root + "\n");
-        for (ClassCase cc : hs.all) {
-            buf.append("  class name = " + cc.getName() + "\n");
-            buf.append("    class OK = " + cc.get_OK() + "\n");
-            buf.append("    prov = " + cc.get_mprov() + "\n");
-
-        }
-        return buf.toString();
-    }
-
-    class DefenderTestSource extends SimpleJavaFileObject {
-
-        String source;
-
-        public DefenderTestSource() {
-            super(URI.create("myfo:/Test.java"), JavaFileObject.Kind.SOURCE);
-            StringBuilder buf = new StringBuilder();
-            List<ClassCase> defaultRef = new ArrayList<>();
-            for (ClassCase cc : hs.all) {
-                Hierarchy.genClassDef(buf, cc, null, defaultRef);
-            }
-            source = buf.toString();
-        }
-
-        @Override
-        public CharSequence getCharContent(boolean ignoreEncodingErrors) {
-            return source;
-        }
-    }
-
-    static class DiagnosticChecker implements javax.tools.DiagnosticListener<JavaFileObject> {
-
-        boolean errorFound;
-
-        public void report(Diagnostic<? extends JavaFileObject> diagnostic) {
-            if (diagnostic.getKind() == Diagnostic.Kind.ERROR) {
-                errorFound = true;
-            }
-        }
-    }
-}
diff --git a/jdk/test/jdk/lambda/LambdaTranslationInInterface.java b/jdk/test/jdk/lambda/LambdaTranslationInInterface.java
deleted file mode 100644
index 65d3f07..0000000
--- a/jdk/test/jdk/lambda/LambdaTranslationInInterface.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-import static org.testng.Assert.assertEquals;
-import org.testng.annotations.Test;
-
-/**
- * @author Robert Field
- */
-
-interface LTII {
-
-    interface ILsp1 {
-        String m();
-    }
-
-    interface ILsp2 {
-        String m(String x);
-    }
-
-    default ILsp1 t1() {
-        return () -> { return "yo"; };
-    }
-
-    default ILsp2 t2() {
-        return (x) -> { return "snur" + x; };
-    }
-
-}
-
-@Test
-public class LambdaTranslationInInterface implements LTII {
-
-    public void testLambdaInDefaultMethod() {
-        assertEquals(t1().m(), "yo");
-        assertEquals(t2().m("p"), "snurp");
-    }
-
-}
diff --git a/jdk/test/jdk/lambda/LambdaTranslationInnerConstructor.java b/jdk/test/jdk/lambda/LambdaTranslationInnerConstructor.java
deleted file mode 100644
index 17e6ad1..0000000
--- a/jdk/test/jdk/lambda/LambdaTranslationInnerConstructor.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-import static org.testng.Assert.assertEquals;
-import org.testng.annotations.Test;
-
-/**
- * @author Robert Field
- */
-
-@Test
-public class LambdaTranslationInnerConstructor  {
-
-    public void testLambdaWithInnerConstructor() {
-        assertEquals(seq1().m().toString(), "Cbl:nada");
-        assertEquals(seq2().m("rats").toString(), "Cbl:rats");
-    }
-
-    Ib1 seq1() {
-        return () -> { return new Cbl(); };
-    }
-
-    Ib2 seq2() {
-        return (x) -> { return new Cbl(x); };
-    }
-
-    class Cbl {
-        String val;
-
-        Cbl() {
-            this.val = "nada";
-        }
-
-        Cbl(String z) {
-            this.val = z;
-        }
-
-        public String toString() {
-            return "Cbl:" + val;
-        }
-    }
-
-    interface Ib1 {
-        Object m();
-    }
-
-    interface Ib2 {
-        Object m(String x);
-    }
-}
\ No newline at end of file
diff --git a/jdk/test/jdk/lambda/MethodReferenceTestFDCCE.java b/jdk/test/jdk/lambda/MethodReferenceTestFDCCE.java
deleted file mode 100644
index dd5b2c8..0000000
--- a/jdk/test/jdk/lambda/MethodReferenceTestFDCCE.java
+++ /dev/null
@@ -1,146 +0,0 @@
-/*
- * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-import org.testng.annotations.Test;
-import java.lang.reflect.Array;
-
-import static org.testng.Assert.assertEquals;
-import static org.testng.Assert.assertTrue;
-import static org.testng.Assert.fail;
-
-/**
- * Method references and raw types.
- * @author Robert Field
- */
-
-@Test
-@SuppressWarnings({"rawtypes", "unchecked"})
-public class MethodReferenceTestFDCCE {
-
-    static void assertCCE(Throwable t) {
-        assertEquals(t.getClass().getName(), "java.lang.ClassCastException");
-    }
-
-    interface Pred<T> { boolean accept(T x); }
-
-    interface Ps { boolean accept(short x); }
-
-    interface Oo { Object too(int x); }
-
-    interface Reto<T> { T m(); }
-
-    class A {}
-    class B extends A {}
-
-    static boolean isMinor(int x) {
-        return x < 18;
-    }
-
-    static boolean tst(A x) {
-        return true;
-    }
-
-    static Object otst(Object x) {
-        return x;
-    }
-
-    static boolean stst(Short x) {
-        return x < 18;
-    }
-
-    static short ritst() {
-        return 123;
-    }
-
-    public void testMethodReferenceFDPrim1() {
-        Pred<Byte> p = MethodReferenceTestFDCCE::isMinor;
-        Pred p2 = p;
-        assertTrue(p2.accept((Byte)(byte)15));
-    }
-
-    public void testMethodReferenceFDPrim2() {
-        Pred<Byte> p = MethodReferenceTestFDCCE::isMinor;
-        Pred p2 = p;
-        assertTrue(p2.accept((byte)15));
-    }
-
-    public void testMethodReferenceFDPrimICCE() {
-        Pred<Byte> p = MethodReferenceTestFDCCE::isMinor;
-        Pred p2 = p;
-        try {
-            p2.accept(15); // should throw CCE
-            fail("Exception should have been thrown");
-        } catch (Throwable t) {
-            assertCCE(t);
-        }
-    }
-
-    public void testMethodReferenceFDPrimOCCE() {
-        Pred<Byte> p = MethodReferenceTestFDCCE::isMinor;
-        Pred p2 = p;
-        try {
-            p2.accept(new Object()); // should throw CCE
-            fail("Exception should have been thrown");
-        } catch (Throwable t) {
-            assertCCE(t);
-        }
-    }
-
-    public void testMethodReferenceFDRef() {
-        Pred<B> p = MethodReferenceTestFDCCE::tst;
-        Pred p2 = p;
-        assertTrue(p2.accept(new B()));
-    }
-
-    public void testMethodReferenceFDRefCCE() {
-        Pred<B> p = MethodReferenceTestFDCCE::tst;
-        Pred p2 = p;
-        try {
-            p2.accept(new A()); // should throw CCE
-            fail("Exception should have been thrown");
-        } catch (Throwable t) {
-            assertCCE(t);
-        }
-    }
-
-    public void testMethodReferenceFDPrimPrim() {
-        Ps p = MethodReferenceTestFDCCE::isMinor;
-        assertTrue(p.accept((byte)15));
-    }
-
-    public void testMethodReferenceFDPrimBoxed() {
-        Ps p = MethodReferenceTestFDCCE::stst;
-        assertTrue(p.accept((byte)15));
-    }
-
-    public void testMethodReferenceFDPrimRef() {
-        Oo p = MethodReferenceTestFDCCE::otst;
-        assertEquals(p.too(15).getClass().getName(), "java.lang.Integer");
-    }
-
-    public void testMethodReferenceFDRet1() {
-        Reto<Short> p = MethodReferenceTestFDCCE::ritst;
-        assertEquals(p.m(), (Short)(short)123);
-    }
-
-}
\ No newline at end of file
diff --git a/jdk/test/jdk/lambda/MethodReferenceTestInnerDefault.java b/jdk/test/jdk/lambda/MethodReferenceTestInnerDefault.java
deleted file mode 100644
index 1074bdb..0000000
--- a/jdk/test/jdk/lambda/MethodReferenceTestInnerDefault.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-import org.testng.annotations.Test;
-
-import static org.testng.Assert.assertEquals;
-
-/**
- * @author Robert Field
- */
-
-interface IDSs { String m(String a); }
-
-interface InDefA {
-    default String xsA__(String s) {
-        return "A__xsA:" + s;
-    }
-
-    default String xsAB_(String s) {
-        return "AB_xsA:" + s;
-    }
-
-}
-
-interface InDefB extends InDefA {
-
-    default String xsAB_(String s) {
-        return "AB_xsB:" + s;
-    }
-
-    default String xs_B_(String s) {
-        return "_B_xsB:" + s;
-    }
-}
-
-@Test
-public class MethodReferenceTestInnerDefault implements InDefB {
-
-    public void testMethodReferenceInnerDefault() {
-        (new In()).testMethodReferenceInnerDefault();
-    }
-
-    class In {
-
-        public void testMethodReferenceInnerDefault() {
-            IDSs q;
-
-            q = MethodReferenceTestInnerDefault.this::xsA__;
-            assertEquals(q.m("*"), "A__xsA:*");
-
-            q = MethodReferenceTestInnerDefault.this::xsAB_;
-            assertEquals(q.m("*"), "AB_xsB:*");
-
-            q = MethodReferenceTestInnerDefault.this::xs_B_;
-            assertEquals(q.m("*"), "_B_xsB:*");
-        }
-    }
-
-}
diff --git a/jdk/test/jdk/lambda/MethodReferenceTestInnerInstance.java b/jdk/test/jdk/lambda/MethodReferenceTestInnerInstance.java
deleted file mode 100644
index 0f1a138..0000000
--- a/jdk/test/jdk/lambda/MethodReferenceTestInnerInstance.java
+++ /dev/null
@@ -1,86 +0,0 @@
-/*
- * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-import org.testng.annotations.Test;
-
-import static org.testng.Assert.assertEquals;
-
-/**
- * @author Robert Field
- */
-
-@Test
-public class MethodReferenceTestInnerInstance {
-
-    public void testMethodReferenceInnerInstance() {
-        cia().cib().testMethodReferenceInstance();
-    }
-
-    public void testMethodReferenceInnerExternal() {
-        cia().cib().testMethodReferenceExternal();
-    }
-
-    interface SI {
-        String m(Integer a);
-    }
-
-    class CIA {
-
-        String xI(Integer i) {
-            return "xI:" + i;
-        }
-
-        public class CIB {
-
-            public void testMethodReferenceInstance() {
-                SI q;
-
-                q = CIA.this::xI;
-                assertEquals(q.m(55), "xI:55");
-            }
-
-            public void testMethodReferenceExternal() {
-                SI q;
-
-                q = (new E())::xI;
-                assertEquals(q.m(77), "ExI:77");
-            }
-        }
-
-        CIB cib() {
-            return new CIB();
-        }
-
-        class E {
-
-            String xI(Integer i) {
-                return "ExI:" + i;
-            }
-        }
-
-    }
-
-    CIA cia() {
-        return new CIA();
-    }
-}
diff --git a/jdk/test/jdk/lambda/MethodReferenceTestInnerVarArgsThis.java b/jdk/test/jdk/lambda/MethodReferenceTestInnerVarArgsThis.java
deleted file mode 100644
index beac6f5..0000000
--- a/jdk/test/jdk/lambda/MethodReferenceTestInnerVarArgsThis.java
+++ /dev/null
@@ -1,241 +0,0 @@
-/*
- * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-import org.testng.annotations.Test;
-import java.lang.reflect.Array;
-
-import static org.testng.Assert.assertEquals;
-
-/**
- * @author Robert Field
- */
-
-@Test
-public class MethodReferenceTestInnerVarArgsThis {
-
-    interface NsII {
-
-        String m(Integer a, Integer b);
-    }
-
-    interface Nsiii {
-
-        String m(int a, int b, int c);
-    }
-
-    interface Nsi {
-
-        String m(int a);
-    }
-
-    interface NsaO {
-
-        String m(Object[] a);
-    }
-
-    interface Nsai {
-
-        String m(int[] a);
-    }
-
-    interface Nsvi {
-
-        String m(int... va);
-    }
-
-    class CIA {
-
-        String xvI(Integer... vi) {
-            StringBuilder sb = new StringBuilder("xvI:");
-            for (Integer i : vi) {
-                sb.append(i);
-                sb.append("-");
-            }
-            return sb.toString();
-        }
-
-        String xIvI(Integer f, Integer... vi) {
-            StringBuilder sb = new StringBuilder("xIvI:");
-            sb.append(f);
-            for (Integer i : vi) {
-                sb.append(i);
-                sb.append("-");
-            }
-            return sb.toString();
-        }
-
-        String xvi(int... vi) {
-            int sum = 0;
-            for (int i : vi) {
-                sum += i;
-            }
-            return "xvi:" + sum;
-        }
-
-        String xIvi(Integer f, int... vi) {
-            int sum = 0;
-            for (int i : vi) {
-                sum += i;
-            }
-            return "xIvi:(" + f + ")" + sum;
-        }
-
-        String xvO(Object... vi) {
-            StringBuilder sb = new StringBuilder("xvO:");
-            for (Object i : vi) {
-                if (i.getClass().isArray()) {
-                    sb.append("[");
-                    int len = Array.getLength(i);
-                    for (int x = 0; x < len; ++x) {
-                        sb.append(Array.get(i, x));
-                        sb.append(",");
-                    }
-                    sb.append("]");
-
-                } else {
-                    sb.append(i);
-                }
-                sb.append("*");
-            }
-            return sb.toString();
-        }
-
-        public class CIB {
-
-            // These should be processed as var args
-            public void testVarArgsNsSuperclass() {
-                NsII q;
-
-                q = CIA.this::xvO;
-                assertEquals(q.m(55, 66), "xvO:55*66*");
-            }
-
-            public void testVarArgsNsArray() {
-                Nsai q;
-
-                q = CIA.this::xvO;
-                assertEquals(q.m(new int[]{55, 66}), "xvO:[55,66,]*");
-            }
-
-            public void testVarArgsNsII() {
-                NsII q;
-
-                q = CIA.this::xvI;
-                assertEquals(q.m(33, 7), "xvI:33-7-");
-
-                q = CIA.this::xIvI;
-                assertEquals(q.m(50, 40), "xIvI:5040-");
-
-                q = CIA.this::xvi;
-                assertEquals(q.m(100, 23), "xvi:123");
-
-                q = CIA.this::xIvi;
-                assertEquals(q.m(9, 21), "xIvi:(9)21");
-            }
-
-            public void testVarArgsNsiii() {
-                Nsiii q;
-
-                q = CIA.this::xvI;
-                assertEquals(q.m(3, 2, 1), "xvI:3-2-1-");
-
-                q = CIA.this::xIvI;
-                assertEquals(q.m(888, 99, 2), "xIvI:88899-2-");
-
-                q = CIA.this::xvi;
-                assertEquals(q.m(900, 80, 7), "xvi:987");
-
-                q = CIA.this::xIvi;
-                assertEquals(q.m(333, 27, 72), "xIvi:(333)99");
-            }
-
-            public void testVarArgsNsi() {
-                Nsi q;
-
-                q = CIA.this::xvI;
-                assertEquals(q.m(3), "xvI:3-");
-
-                q = CIA.this::xIvI;
-                assertEquals(q.m(888), "xIvI:888");
-
-                q = CIA.this::xvi;
-                assertEquals(q.m(900), "xvi:900");
-
-                q = CIA.this::xIvi;
-                assertEquals(q.m(333), "xIvi:(333)0");
-            }
-
-            // These should NOT be processed as var args
-            public void testVarArgsNsaO() {
-                NsaO q;
-
-                q = CIA.this::xvO;
-                assertEquals(q.m(new String[]{"yo", "there", "dude"}), "xvO:yo*there*dude*");
-            }
-        }
-
-        CIB cib() {
-            return new CIB();
-        }
-
-        class E {
-
-            String xI(Integer i) {
-                return "ExI:" + i;
-            }
-        }
-    }
-
-    CIA cia() {
-        return new CIA();
-    }
-
-    // These should be processed as var args
-    public void testVarArgsNsSuperclass() {
-        cia().cib().testVarArgsNsSuperclass();
-    }
-
-    public void testVarArgsNsArray() {
-        cia().cib().testVarArgsNsArray();
-    }
-
-    public void testVarArgsNsII() {
-        cia().cib().testVarArgsNsII();
-    }
-
-    public void testVarArgsNsiii() {
-        cia().cib().testVarArgsNsiii();
-    }
-
-    public void testVarArgsNsi() {
-        cia().cib().testVarArgsNsi();
-    }
-
-    // These should NOT be processed as var args
-
-    public void testVarArgsNsaO() {
-        cia().cib().testVarArgsNsaO();
-    }
-
-
-}
diff --git a/jdk/test/jdk/lambda/MethodReferenceTestInstance.java b/jdk/test/jdk/lambda/MethodReferenceTestInstance.java
deleted file mode 100644
index f8bb048..0000000
--- a/jdk/test/jdk/lambda/MethodReferenceTestInstance.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-import org.testng.annotations.Test;
-
-import static org.testng.Assert.assertEquals;
-
-/**
- * @author Robert Field
- */
-
-class MethodReferenceTestInstance_E {
-    String xI(Integer i) {
-        return "ExI:" + i;
-    }
-}
-
-@Test
-public class MethodReferenceTestInstance {
-
-    interface SI { String m(Integer a); }
-
-    String xI(Integer i) {
-        return "xI:" + i;
-    }
-
-    public void testMethodReferenceInstance() {
-        SI q;
-
-        q = this::xI;
-        assertEquals(q.m(55), "xI:55");
-    }
-
-    public void testMethodReferenceExternal() {
-        SI q;
-
-        q = (new MethodReferenceTestInstance_E())::xI;
-        assertEquals(q.m(77), "ExI:77");
-    }
-
-}
diff --git a/jdk/test/jdk/lambda/MethodReferenceTestKinds.java b/jdk/test/jdk/lambda/MethodReferenceTestKinds.java
deleted file mode 100644
index dc45735..0000000
--- a/jdk/test/jdk/lambda/MethodReferenceTestKinds.java
+++ /dev/null
@@ -1,173 +0,0 @@
-/*
- * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-
-import org.testng.annotations.Test;
-
-import static org.testng.Assert.assertEquals;
-
-/**
- * @author Robert Field
- */
-
-@Test
-public class MethodReferenceTestKinds extends MethodReferenceTestKindsSup {
-
-    interface S0 { String get(); }
-    interface S1 { String get(MethodReferenceTestKinds x); }
-    interface S2 { String get(MethodReferenceTestKinds x, MethodReferenceTestKinds y); }
-
-    interface SXN0 { MethodReferenceTestKindsBase make(MethodReferenceTestKinds x); }
-    interface SXN1 { MethodReferenceTestKindsBase make(MethodReferenceTestKinds x, String str); }
-
-    interface SN0 { MethodReferenceTestKindsBase make(); }
-    interface SN1 { MethodReferenceTestKindsBase make(String x); }
-
-    class In extends MethodReferenceTestKindsBase {
-        In(String val) {
-            this.val = val;
-        }
-
-        In() {
-            this("blank");
-        }
-    }
-
-    String instanceMethod0() { return "IM:0-" + this; }
-    String instanceMethod1(MethodReferenceTestKinds x) { return "IM:1-" + this + x; }
-
-    static String staticMethod0() { return "SM:0"; }
-    static String staticMethod1(MethodReferenceTestKinds x) { return "SM:1-" + x; }
-
-    MethodReferenceTestKinds(String val) {
-        super(val);
-    }
-
-    MethodReferenceTestKinds() {
-        super("blank");
-    }
-
-    MethodReferenceTestKinds inst(String val) {
-        return new MethodReferenceTestKinds(val);
-    }
-
-    public void testMRBound() {
-        S0 var = this::instanceMethod0;
-        assertEquals(var.get(), "IM:0-MethodReferenceTestKinds(blank)");
-    }
-
-    public void testMRBoundArg() {
-        S1 var = this::instanceMethod1;
-        assertEquals(var.get(inst("arg")), "IM:1-MethodReferenceTestKinds(blank)MethodReferenceTestKinds(arg)");
-    }
-
-    public void testMRUnbound() {
-        S1 var = MethodReferenceTestKinds::instanceMethod0;
-        assertEquals(var.get(inst("rcvr")), "IM:0-MethodReferenceTestKinds(rcvr)");
-    }
-
-    public void testMRUnboundArg() {
-        S2 var = MethodReferenceTestKinds::instanceMethod1;
-        assertEquals(var.get(inst("rcvr"), inst("arg")), "IM:1-MethodReferenceTestKinds(rcvr)MethodReferenceTestKinds(arg)");
-    }
-
-    public void testMRSuper() {
-        S0 var = super::instanceMethod0;
-        assertEquals(var.get(), "SIM:0-MethodReferenceTestKinds(blank)");
-    }
-
-    public void testMRSuperArg() {
-        S1 var = super::instanceMethod1;
-        assertEquals(var.get(inst("arg")), "SIM:1-MethodReferenceTestKinds(blank)MethodReferenceTestKinds(arg)");
-    }
-
-    public void testMRStatic() {
-        S0 var = MethodReferenceTestKinds::staticMethod0;
-        assertEquals(var.get(), "SM:0");
-    }
-
-    public void testMRStaticArg() {
-        S1 var = MethodReferenceTestKinds::staticMethod1;
-        assertEquals(var.get(inst("arg")), "SM:1-MethodReferenceTestKinds(arg)");
-    }
-
-    public void testMRTopLevel() {
-        SN0 var = MethodReferenceTestKindsBase::new;
-        assertEquals(var.make().toString(), "MethodReferenceTestKindsBase(blank)");
-    }
-
-    public void testMRTopLevelArg() {
-        SN1 var = MethodReferenceTestKindsBase::new;
-        assertEquals(var.make("name").toString(), "MethodReferenceTestKindsBase(name)");
-    }
-/* unbound inner case not supported anymore (dropped by EG)
-    public void testMRUnboundInner() {
-        SXN0 var = MethodReferenceTestKinds.In::new;
-        assertEquals(var.make(inst("out")).toString(), "In(blank)");
-    }
-
-   public void testMRUnboundInnerArg() {
-        SXN1 var = MethodReferenceTestKinds.In::new;
-        assertEquals(var.make(inst("out"), "name").toString(), "In(name)");
-    }
-*/
-    public void testMRImplicitInner() {
-        SN0 var = MethodReferenceTestKinds.In::new;
-        assertEquals(var.make().toString(), "In(blank)");
-    }
-
-    public void testMRImplicitInnerArg() {
-        SN1 var = MethodReferenceTestKinds.In::new;
-        assertEquals(var.make("name").toString(), "In(name)");
-    }
-
-}
-
-
-class MethodReferenceTestKindsBase {
-    String val = "unset";
-
-    public String toString() {
-        return getClass().getSimpleName() + "(" + val + ")";
-    }
-
-    MethodReferenceTestKindsBase(String val) {
-        this.val = val;
-    }
-
-    MethodReferenceTestKindsBase() {
-        this("blank");
-    }
-
-}
-
-class MethodReferenceTestKindsSup extends MethodReferenceTestKindsBase {
-    String instanceMethod0() { return "SIM:0-" + this; }
-    String instanceMethod1(MethodReferenceTestKinds x) { return "SIM:1-" + this + x; }
-
-    MethodReferenceTestKindsSup(String val) {
-        super(val);
-    }
-
-}
-
diff --git a/jdk/test/jdk/lambda/MethodReferenceTestNew.java b/jdk/test/jdk/lambda/MethodReferenceTestNew.java
deleted file mode 100644
index baec244..0000000
--- a/jdk/test/jdk/lambda/MethodReferenceTestNew.java
+++ /dev/null
@@ -1,130 +0,0 @@
-/*
- * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-import org.testng.annotations.Test;
-
-import static org.testng.Assert.assertEquals;
-
-/**
- * @author Robert Field
- */
-
-@Test
-public class MethodReferenceTestNew {
-
-    interface M0<T> {
-
-        T m();
-    }
-
-    static class N0 {
-
-        N0() {
-        }
-    }
-
-    interface M1<T> {
-
-        T m(Integer a);
-    }
-
-    static class N1 {
-
-        int i;
-
-        N1(int i) {
-            this.i = i;
-        }
-    }
-
-    interface M2<T> {
-
-        T m(Integer n, String o);
-    }
-
-    static class N2 {
-
-        Number n;
-        Object o;
-
-        N2(Number n, Object o) {
-            this.n = n;
-            this.o = o;
-        }
-
-        public String toString() {
-            return "N2(" + n + "," + o + ")";
-        }
-    }
-
-    interface MV {
-
-        NV m(Integer ai, int i);
-    }
-
-    static class NV {
-
-        int i;
-
-        NV(int... v) {
-            i = 0;
-            for (int x : v) {
-                i += x;
-            }
-        }
-
-        public String toString() {
-            return "NV(" + i + ")";
-        }
-    }
-
-    public void testConstructorReference0() {
-        M0<N0> q;
-
-        q = N0::new;
-        assertEquals(q.m().getClass().getSimpleName(), "N0");
-    }
-
-    public void testConstructorReference1() {
-        M1<N1> q;
-
-        q = N1::new;
-        assertEquals(q.m(14).getClass().getSimpleName(), "N1");
-    }
-
-    public void testConstructorReference2() {
-        M2<N2> q;
-
-        q = N2::new;
-        assertEquals(q.m(7, "hi").toString(), "N2(7,hi)");
-    }
-
-    public void testConstructorReferenceVarArgs() {
-        MV q;
-
-        q = NV::new;
-        assertEquals(q.m(5, 45).toString(), "NV(50)");
-    }
-
-}
-
diff --git a/jdk/test/jdk/lambda/MethodReferenceTestNewInner.java b/jdk/test/jdk/lambda/MethodReferenceTestNewInner.java
deleted file mode 100644
index a4f17d0..0000000
--- a/jdk/test/jdk/lambda/MethodReferenceTestNewInner.java
+++ /dev/null
@@ -1,150 +0,0 @@
-/*
- * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-import org.testng.annotations.Test;
-
-import static org.testng.Assert.assertEquals;
-
-/**
- * @author Robert Field
- */
-
-@Test
-public class MethodReferenceTestNewInner {
-
-    String note = "NO NOTE";
-
-    interface M0<T> {
-
-        T m();
-    }
-
-    interface MP<T> {
-
-        T m(MethodReferenceTestNewInner m);
-    }
-
-    class N0 {
-
-        N0() {
-        }
-    }
-
-    interface M1<T> {
-
-        T m(Integer a);
-    }
-
-    class N1 {
-
-        int i;
-
-        N1(int i) {
-            this.i = i;
-        }
-    }
-
-    interface M2<T> {
-
-        T m(Integer n, String o);
-    }
-
-    class N2 {
-
-        Number n;
-        Object o;
-
-        N2(Number n, Object o) {
-            this.n = n;
-            this.o = o;
-        }
-
-        public String toString() {
-            return note + ":N2(" + n + "," + o + ")";
-        }
-    }
-
-    interface MV {
-
-        NV m(Integer ai, int i);
-    }
-
-    class NV {
-
-        int i;
-
-        NV(int... v) {
-            i = 0;
-            for (int x : v) {
-                i += x;
-            }
-        }
-
-        public String toString() {
-            return note + ":NV(" + i + ")";
-        }
-    }
-
-/* unbound constructor case not supported anymore (dropped by EG)
-    public static void testConstructorReferenceP() {
-        MP<N0> q;
-
-        q = N0::new;
-        assertEquals(q.m(new MethodReferenceTestNewInner()).getClass().getSimpleName(), "N0");
-    }
-*/
-    public void testConstructorReference0() {
-        M0<N0> q;
-
-        q = N0::new;
-        assertEquals(q.m().getClass().getSimpleName(), "N0");
-    }
-
-    public void testConstructorReference1() {
-        M1<N1> q;
-
-        q = N1::new;
-        assertEquals(q.m(14).getClass().getSimpleName(), "N1");
-    }
-
-    public void testConstructorReference2() {
-        M2<N2> q;
-
-        note = "T2";
-        q = N2::new;
-        assertEquals(q.m(7, "hi").toString(), "T2:N2(7,hi)");
-    }
-
-    /***
-    public void testConstructorReferenceVarArgs() {
-        MV q;
-
-        note = "TVA";
-        q = NV::new;
-        assertEquals(q.m(5, 45).toString(), "TNV:NV(50)");
-    }
-    ***/
-
-}
-
-
diff --git a/jdk/test/jdk/lambda/MethodReferenceTestSueCase1.java b/jdk/test/jdk/lambda/MethodReferenceTestSueCase1.java
deleted file mode 100644
index b6bbfa6..0000000
--- a/jdk/test/jdk/lambda/MethodReferenceTestSueCase1.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-
-import org.testng.annotations.Test;
-
-import static org.testng.Assert.assertEquals;
-
-/**
- * @author Robert Field
- */
-
-@Test
-public class MethodReferenceTestSueCase1 {
-
-    public interface Sam2<T> { public String get(T target, String s); }
-
-    String instanceMethod(String s) { return "2"; }
-    Sam2<MethodReferenceTestSueCase1> var = MethodReferenceTestSueCase1::instanceMethod;
-
-    String m() {  return var.get(new MethodReferenceTestSueCase1(), ""); }
-
-    public void testSueCase1() {
-        assertEquals(m(), "2");
-    }
-}
\ No newline at end of file
diff --git a/jdk/test/jdk/lambda/MethodReferenceTestSueCase2.java b/jdk/test/jdk/lambda/MethodReferenceTestSueCase2.java
deleted file mode 100644
index dcb2a69..0000000
--- a/jdk/test/jdk/lambda/MethodReferenceTestSueCase2.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-
-import org.testng.annotations.Test;
-
-import static org.testng.Assert.assertEquals;
-
-/**
- * @author Robert Field
- */
-
-@Test
-public class MethodReferenceTestSueCase2 {
-
-    public interface Sam2<T> { public String get(T target, String s); }
-
-    String instanceMethod(String s) { return "2"; }
-    static Sam2<MethodReferenceTestSueCase2> var = MethodReferenceTestSueCase2::instanceMethod;
-
-    String m() {  return var.get(new MethodReferenceTestSueCase2(), ""); }
-
-    public void testSueCase2() {
-        assertEquals(m(), "2");
-    }
-
-}
\ No newline at end of file
diff --git a/jdk/test/jdk/lambda/MethodReferenceTestSueCase4.java b/jdk/test/jdk/lambda/MethodReferenceTestSueCase4.java
deleted file mode 100644
index eb54df6..0000000
--- a/jdk/test/jdk/lambda/MethodReferenceTestSueCase4.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-
-import org.testng.annotations.Test;
-
-import static org.testng.Assert.assertEquals;
-
-/**
- * @author Robert Field
- */
-
-@Test
-public class MethodReferenceTestSueCase4 {
-
-    public interface Sam2<T> { public String get(T target, String s); }
-
-    Sam2<Target> var = new Object().equals(new Object()) ? Target::instanceMethod : Target::instanceMethod;
-
-    String m() {
-        return var.get(new Target(), "");
-    }
-
-    static class Target {
-        String instanceMethod(String s) { return "2"; }
-    }
-
-    public void testSueCase4() {
-        assertEquals(m(), "2");
-    }
-
-}
\ No newline at end of file
diff --git a/jdk/test/jdk/lambda/MethodReferenceTestSuper.java b/jdk/test/jdk/lambda/MethodReferenceTestSuper.java
deleted file mode 100644
index 211afb1..0000000
--- a/jdk/test/jdk/lambda/MethodReferenceTestSuper.java
+++ /dev/null
@@ -1,113 +0,0 @@
-/*
- * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-import org.testng.annotations.Test;
-
-import static org.testng.Assert.assertEquals;
-
-
-
-/**
- * @author Robert Field
- */
-
-interface SPRI { String m(String a); }
-
-class SPRA {
-    String xsA__(String s) {
-        return "A__xsA:" + s;
-    }
-
-    String xsA_M(String s) {
-        return "A_MxsA:" + s;
-    }
-
-    String xsAB_(String s) {
-        return "AB_xsA:" + s;
-    }
-
-    String xsABM(String s) {
-        return "ABMxsA:" + s;
-    }
-
-}
-
-class SPRB extends SPRA {
-
-    String xsAB_(String s) {
-        return "AB_xsB:" + s;
-    }
-
-    String xsABM(String s) {
-        return "ABMxsB:" + s;
-    }
-
-    String xs_B_(String s) {
-        return "_B_xsB:" + s;
-    }
-
-    String xs_BM(String s) {
-        return "_BMxsB:" + s;
-    }
-
-}
-
-@Test
-public class MethodReferenceTestSuper extends SPRB {
-
-    String xsA_M(String s) {
-        return "A_MxsM:" + s;
-    }
-
-
-    String xsABM(String s) {
-        return "ABMxsM:" + s;
-    }
-
-    String xs_BM(String s) {
-        return "_BMxsM:" + s;
-    }
-
-    public void testMethodReferenceSuper() {
-        SPRI q;
-
-        q = super::xsA__;
-        assertEquals(q.m("*"), "A__xsA:*");
-
-        q = super::xsA_M;
-        assertEquals(q.m("*"), "A_MxsA:*");
-
-        q = super::xsAB_;
-        assertEquals(q.m("*"), "AB_xsB:*");
-
-        q = super::xsABM;
-        assertEquals(q.m("*"), "ABMxsB:*");
-
-        q = super::xs_B_;
-        assertEquals(q.m("*"), "_B_xsB:*");
-
-        q = super::xs_BM;
-        assertEquals(q.m("*"), "_BMxsB:*");
-    }
-
-}
diff --git a/jdk/test/jdk/lambda/MethodReferenceTestSuperDefault.java b/jdk/test/jdk/lambda/MethodReferenceTestSuperDefault.java
deleted file mode 100644
index f2e2c18..0000000
--- a/jdk/test/jdk/lambda/MethodReferenceTestSuperDefault.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-import org.testng.annotations.Test;
-
-import static org.testng.Assert.assertEquals;
-
-
-/**
- * @author Robert Field
- */
-
-interface DSPRI { String m(String a); }
-
-interface DSPRA {
-    default String xsA__(String s) {
-        return "A__xsA:" + s;
-    }
-
-    default String xsAB_(String s) {
-        return "AB_xsA:" + s;
-    }
-
-}
-
-interface DSPRB extends DSPRA {
-
-    default String xsAB_(String s) {
-        return "AB_xsB:" + s;
-    }
-
-    default String xs_B_(String s) {
-        return "_B_xsB:" + s;
-    }
-
-}
-
-@Test
-public class MethodReferenceTestSuperDefault implements DSPRB {
-
-    public void testMethodReferenceSuper() {
-        DSPRI q;
-
-        q = DSPRB.super::xsA__;
-        assertEquals(q.m("*"), "A__xsA:*");
-
-        q = DSPRB.super::xsAB_;
-        assertEquals(q.m("*"), "AB_xsB:*");
-
-        q = DSPRB.super::xs_B_;
-        assertEquals(q.m("*"), "_B_xsB:*");
-    }
-
-}
diff --git a/jdk/test/jdk/lambda/MethodReferenceTestTypeConversion.java b/jdk/test/jdk/lambda/MethodReferenceTestTypeConversion.java
deleted file mode 100644
index e36b724..0000000
--- a/jdk/test/jdk/lambda/MethodReferenceTestTypeConversion.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-import org.testng.annotations.Test;
-
-import static org.testng.Assert.assertEquals;
-
-/**
- * @author Robert Field
- */
-
-class MethodReferenceTestTypeConversion_E<T> {
-    T xI(T t) { return t; }
-}
-
-@Test
-public class MethodReferenceTestTypeConversion {
-
-    interface ISi { int m(Short a); }
-
-    interface ICc { char m(Character a); }
-
-    public void testUnboxObjectToNumberWiden() {
-        ISi q = (new MethodReferenceTestTypeConversion_E<Short>())::xI;
-        assertEquals(q.m((short)77), (short)77);
-    }
-
-    public void testUnboxObjectToChar() {
-        ICc q = (new MethodReferenceTestTypeConversion_E<Character>())::xI;
-        assertEquals(q.m('@'), '@');
-    }
-
-}
diff --git a/jdk/test/jdk/lambda/MethodReferenceTestVarArgs.java b/jdk/test/jdk/lambda/MethodReferenceTestVarArgs.java
deleted file mode 100644
index d2926f0..0000000
--- a/jdk/test/jdk/lambda/MethodReferenceTestVarArgs.java
+++ /dev/null
@@ -1,195 +0,0 @@
-/*
- * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-import org.testng.annotations.Test;
-import java.lang.reflect.Array;
-
-import static org.testng.Assert.assertEquals;
-
-/**
- * @author Robert Field
- */
-
-@Test
-public class MethodReferenceTestVarArgs {
-
-    interface SII {
-
-        String m(Integer a, Integer b);
-    }
-
-    interface Siii {
-
-        String m(int a, int b, int c);
-    }
-
-    interface Si {
-
-        String m(int a);
-    }
-
-    interface SaO {
-
-        String m(Object[] a);
-    }
-
-    interface Sai {
-
-        String m(int[] a);
-    }
-
-    interface Svi {
-
-        String m(int... va);
-    }
-
-    // These should be processed as var args
-
-    static String xvI(Integer... vi) {
-        StringBuilder sb = new StringBuilder("xvI:");
-        for (Integer i : vi) {
-            sb.append(i);
-            sb.append("-");
-        }
-        return sb.toString();
-    }
-
-    static String xIvI(Integer f, Integer... vi) {
-        StringBuilder sb = new StringBuilder("xIvI:");
-        sb.append(f);
-        for (Integer i : vi) {
-            sb.append(i);
-            sb.append("-");
-        }
-        return sb.toString();
-    }
-
-    static String xvi(int... vi) {
-        int sum = 0;
-        for (int i : vi) {
-            sum += i;
-        }
-        return "xvi:" + sum;
-    }
-
-    static String xIvi(Integer f, int... vi) {
-        int sum = 0;
-        for (int i : vi) {
-            sum += i;
-        }
-        return "xIvi:(" + f + ")" + sum;
-    }
-
-    static String xvO(Object... vi) {
-        StringBuilder sb = new StringBuilder("xvO:");
-        for (Object i : vi) {
-            if (i.getClass().isArray()) {
-                sb.append("[");
-                int len = Array.getLength(i);
-                for (int x = 0; x < len; ++x)  {
-                    sb.append(Array.get(i, x));
-                    sb.append(",");
-                }
-                sb.append("]");
-
-            } else {
-                sb.append(i);
-            }
-            sb.append("*");
-        }
-        return sb.toString();
-    }
-
-    public void testVarArgsSuperclass() {
-        SII q;
-
-        q = MethodReferenceTestVarArgs::xvO;
-        assertEquals(q.m(55,66), "xvO:55*66*");
-    }
-
-    public void testVarArgsArray() {
-        Sai q;
-
-        q = MethodReferenceTestVarArgs::xvO;
-        assertEquals(q.m(new int[] { 55,66 } ), "xvO:[55,66,]*");
-    }
-
-    public void testVarArgsII() {
-        SII q;
-
-        q = MethodReferenceTestVarArgs::xvI;
-        assertEquals(q.m(33,7), "xvI:33-7-");
-
-        q = MethodReferenceTestVarArgs::xIvI;
-        assertEquals(q.m(50,40), "xIvI:5040-");
-
-        q = MethodReferenceTestVarArgs::xvi;
-        assertEquals(q.m(100,23), "xvi:123");
-
-        q = MethodReferenceTestVarArgs::xIvi;
-        assertEquals(q.m(9,21), "xIvi:(9)21");
-    }
-
-    public void testVarArgsiii() {
-        Siii q;
-
-        q = MethodReferenceTestVarArgs::xvI;
-        assertEquals(q.m(3, 2, 1), "xvI:3-2-1-");
-
-        q = MethodReferenceTestVarArgs::xIvI;
-        assertEquals(q.m(888, 99, 2), "xIvI:88899-2-");
-
-        q = MethodReferenceTestVarArgs::xvi;
-        assertEquals(q.m(900,80,7), "xvi:987");
-
-        q = MethodReferenceTestVarArgs::xIvi;
-        assertEquals(q.m(333,27, 72), "xIvi:(333)99");
-    }
-
-    public void testVarArgsi() {
-        Si q;
-
-        q = MethodReferenceTestVarArgs::xvI;
-        assertEquals(q.m(3), "xvI:3-");
-
-        q = MethodReferenceTestVarArgs::xIvI;
-        assertEquals(q.m(888), "xIvI:888");
-
-        q = MethodReferenceTestVarArgs::xvi;
-        assertEquals(q.m(900), "xvi:900");
-
-        q = MethodReferenceTestVarArgs::xIvi;
-        assertEquals(q.m(333), "xIvi:(333)0");
-    }
-
-    // These should NOT be processed as var args
-
-    public void testVarArgsaO() {
-        SaO q;
-
-        q = MethodReferenceTestVarArgs::xvO;
-        assertEquals(q.m(new String[] { "yo", "there", "dude" }), "xvO:yo*there*dude*");
-    }
-
-
-}
diff --git a/jdk/test/jdk/lambda/MethodReferenceTestVarArgsExt.java b/jdk/test/jdk/lambda/MethodReferenceTestVarArgsExt.java
deleted file mode 100644
index a3a967c..0000000
--- a/jdk/test/jdk/lambda/MethodReferenceTestVarArgsExt.java
+++ /dev/null
@@ -1,182 +0,0 @@
-/*
- * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-import org.testng.annotations.Test;
-import java.lang.reflect.Array;
-
-import static org.testng.Assert.assertEquals;
-
-/**
- * @author Robert Field
- */
-
-interface NXII { String m(Integer a, Integer b); }
-
-interface NXiii { String m(int a, int b, int c); }
-
-interface NXi { String m(int a); }
-
-interface NXaO { String m(Object[] a); }
-
-interface NXai { String m(int[] a); }
-
-interface NXvi { String m(int... va); }
-
-@Test
-public class MethodReferenceTestVarArgsExt {
-
-    // These should be processed as var args
-
-    public void testVarArgsNXSuperclass() {
-        NXII q;
-
-        q = (new Ext())::xvO;
-        assertEquals(q.m(55,66), "xvO:55*66*");
-    }
-
-    public void testVarArgsNXArray() {
-        NXai q;
-
-        q = (new Ext())::xvO;
-        assertEquals(q.m(new int[] { 55,66 } ), "xvO:[55,66,]*");
-    }
-
-    public void testVarArgsNXII() {
-        NXII q;
-
-        q = (new Ext())::xvI;
-        assertEquals(q.m(33,7), "xvI:33-7-");
-
-        q = (new Ext())::xIvI;
-        assertEquals(q.m(50,40), "xIvI:5040-");
-
-        q = (new Ext())::xvi;
-        assertEquals(q.m(100,23), "xvi:123");
-
-        q = (new Ext())::xIvi;
-        assertEquals(q.m(9,21), "xIvi:(9)21");
-    }
-
-    public void testVarArgsNXiii() {
-        NXiii q;
-
-        q = (new Ext())::xvI;
-        assertEquals(q.m(3, 2, 1), "xvI:3-2-1-");
-
-        q = (new Ext())::xIvI;
-        assertEquals(q.m(888, 99, 2), "xIvI:88899-2-");
-
-        q = (new Ext())::xvi;
-        assertEquals(q.m(900,80,7), "xvi:987");
-
-        q = (new Ext())::xIvi;
-        assertEquals(q.m(333,27, 72), "xIvi:(333)99");
-    }
-
-    public void testVarArgsNXi() {
-        NXi q;
-
-        q = (new Ext())::xvI;
-        assertEquals(q.m(3), "xvI:3-");
-
-        q = (new Ext())::xIvI;
-        assertEquals(q.m(888), "xIvI:888");
-
-        q = (new Ext())::xvi;
-        assertEquals(q.m(900), "xvi:900");
-
-        q = (new Ext())::xIvi;
-        assertEquals(q.m(333), "xIvi:(333)0");
-    }
-
-    // These should NOT be processed as var args
-
-    public void testVarArgsNXaO() {
-        NXaO q;
-
-        q = (new Ext())::xvO;
-        assertEquals(q.m(new String[] { "yo", "there", "dude" }), "xvO:yo*there*dude*");
-    }
-
-
-}
-
-class Ext {
-
-    String xvI(Integer... vi) {
-        StringBuilder sb = new StringBuilder("xvI:");
-        for (Integer i : vi) {
-            sb.append(i);
-            sb.append("-");
-        }
-        return sb.toString();
-    }
-
-    String xIvI(Integer f, Integer... vi) {
-        StringBuilder sb = new StringBuilder("xIvI:");
-        sb.append(f);
-        for (Integer i : vi) {
-            sb.append(i);
-            sb.append("-");
-        }
-        return sb.toString();
-    }
-
-    String xvi(int... vi) {
-        int sum = 0;
-        for (int i : vi) {
-            sum += i;
-        }
-        return "xvi:" + sum;
-    }
-
-    String xIvi(Integer f, int... vi) {
-        int sum = 0;
-        for (int i : vi) {
-            sum += i;
-        }
-        return "xIvi:(" + f + ")" + sum;
-    }
-
-    String xvO(Object... vi) {
-        StringBuilder sb = new StringBuilder("xvO:");
-        for (Object i : vi) {
-            if (i.getClass().isArray()) {
-                sb.append("[");
-                int len = Array.getLength(i);
-                for (int x = 0; x < len; ++x)  {
-                    sb.append(Array.get(i, x));
-                    sb.append(",");
-                }
-                sb.append("]");
-
-            } else {
-                sb.append(i);
-            }
-            sb.append("*");
-        }
-        return sb.toString();
-    }
-
-
-}
diff --git a/jdk/test/jdk/lambda/MethodReferenceTestVarArgsSuper.java b/jdk/test/jdk/lambda/MethodReferenceTestVarArgsSuper.java
deleted file mode 100644
index 82e417c..0000000
--- a/jdk/test/jdk/lambda/MethodReferenceTestVarArgsSuper.java
+++ /dev/null
@@ -1,200 +0,0 @@
-/*
- * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-import org.testng.annotations.Test;
-import java.lang.reflect.Array;
-
-import static org.testng.Assert.assertEquals;
-
-
-/**
- * @author Robert Field
- */
-
-class MethodReferenceTestVarArgsSuper_Sub {
-
-    String xvI(Integer... vi) {
-        StringBuilder sb = new StringBuilder("xvI:");
-        for (Integer i : vi) {
-            sb.append(i);
-            sb.append("-");
-        }
-        return sb.toString();
-    }
-
-    String xIvI(Integer f, Integer... vi) {
-        StringBuilder sb = new StringBuilder("xIvI:");
-        sb.append(f);
-        for (Integer i : vi) {
-            sb.append(i);
-            sb.append("-");
-        }
-        return sb.toString();
-    }
-
-    String xvi(int... vi) {
-        int sum = 0;
-        for (int i : vi) {
-            sum += i;
-        }
-        return "xvi:" + sum;
-    }
-
-    String xIvi(Integer f, int... vi) {
-        int sum = 0;
-        for (int i : vi) {
-            sum += i;
-        }
-        return "xIvi:(" + f + ")" + sum;
-    }
-
-    String xvO(Object... vi) {
-        StringBuilder sb = new StringBuilder("xvO:");
-        for (Object i : vi) {
-            if (i.getClass().isArray()) {
-                sb.append("[");
-                int len = Array.getLength(i);
-                for (int x = 0; x < len; ++x)  {
-                    sb.append(Array.get(i, x));
-                    sb.append(",");
-                }
-                sb.append("]");
-
-            } else {
-                sb.append(i);
-            }
-            sb.append("*");
-        }
-        return sb.toString();
-    }
-}
-
-@Test
-public class MethodReferenceTestVarArgsSuper extends MethodReferenceTestVarArgsSuper_Sub {
-
-    interface SPRII { String m(Integer a, Integer b); }
-
-    interface SPRiii { String m(int a, int b, int c); }
-
-    interface SPRi { String m(int a); }
-
-    interface SPRaO { String m(Object[] a); }
-
-    interface SPRai { String m(int[] a); }
-
-    interface SPRvi { String m(int... va); }
-
-    String xvI(Integer... vi) {
-        return "ERROR";
-    }
-
-    String xIvI(Integer f, Integer... vi) {
-        return "ERROR";
-    }
-
-    String xvi(int... vi) {
-        return "ERROR";
-    }
-
-    String xIvi(Integer f, int... vi) {
-        return "ERROR";
-   }
-
-    String xvO(Object... vi) {
-        return "ERROR";
-    }
-
-    // These should be processed as var args
-
-    public void testVarArgsSPRSuperclass() {
-        SPRII q;
-
-        q = super::xvO;
-        assertEquals(q.m(55,66), "xvO:55*66*");
-    }
-
-    public void testVarArgsSPRArray() {
-        SPRai q;
-
-        q = super::xvO;
-        assertEquals(q.m(new int[] { 55,66 } ), "xvO:[55,66,]*");
-    }
-
-    public void testVarArgsSPRII() {
-        SPRII q;
-
-        q = super::xvI;
-        assertEquals(q.m(33,7), "xvI:33-7-");
-
-        q = super::xIvI;
-        assertEquals(q.m(50,40), "xIvI:5040-");
-
-        q = super::xvi;
-        assertEquals(q.m(100,23), "xvi:123");
-
-        q = super::xIvi;
-        assertEquals(q.m(9,21), "xIvi:(9)21");
-    }
-
-    public void testVarArgsSPRiii() {
-        SPRiii q;
-
-        q = super::xvI;
-        assertEquals(q.m(3, 2, 1), "xvI:3-2-1-");
-
-        q = super::xIvI;
-        assertEquals(q.m(888, 99, 2), "xIvI:88899-2-");
-
-        q = super::xvi;
-        assertEquals(q.m(900,80,7), "xvi:987");
-
-        q = super::xIvi;
-        assertEquals(q.m(333,27, 72), "xIvi:(333)99");
-    }
-
-    public void testVarArgsSPRi() {
-        SPRi q;
-
-        q = super::xvI;
-        assertEquals(q.m(3), "xvI:3-");
-
-        q = super::xIvI;
-        assertEquals(q.m(888), "xIvI:888");
-
-        q = super::xvi;
-        assertEquals(q.m(900), "xvi:900");
-
-        q = super::xIvi;
-        assertEquals(q.m(333), "xIvi:(333)0");
-    }
-
-    // These should NOT be processed as var args
-
-    public void testVarArgsSPRaO() {
-        SPRaO q;
-
-        q = super::xvO;
-        assertEquals(q.m(new String[] { "yo", "there", "dude" }), "xvO:yo*there*dude*");
-    }
-}
-
diff --git a/jdk/test/jdk/lambda/MethodReferenceTestVarArgsSuperDefault.java b/jdk/test/jdk/lambda/MethodReferenceTestVarArgsSuperDefault.java
deleted file mode 100644
index 8388b60..0000000
--- a/jdk/test/jdk/lambda/MethodReferenceTestVarArgsSuperDefault.java
+++ /dev/null
@@ -1,181 +0,0 @@
-/*
- * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-import org.testng.annotations.Test;
-import java.lang.reflect.Array;
-
-import static org.testng.Assert.assertEquals;
-
-/**
- * @author Robert Field
- */
-
-interface MethodReferenceTestVarArgsSuperDefault_I {
-
-    default String xvI(Integer... vi) {
-        StringBuilder sb = new StringBuilder("xvI:");
-        for (Integer i : vi) {
-            sb.append(i);
-            sb.append("-");
-        }
-        return sb.toString();
-    }
-
-    default String xIvI(Integer f, Integer... vi) {
-        StringBuilder sb = new StringBuilder("xIvI:");
-        sb.append(f);
-        for (Integer i : vi) {
-            sb.append(i);
-            sb.append("-");
-        }
-        return sb.toString();
-    }
-
-    default String xvi(int... vi) {
-        int sum = 0;
-        for (int i : vi) {
-            sum += i;
-        }
-        return "xvi:" + sum;
-    }
-
-    default String xIvi(Integer f, int... vi) {
-        int sum = 0;
-        for (int i : vi) {
-            sum += i;
-        }
-        return "xIvi:(" + f + ")" + sum;
-    }
-
-    default String xvO(Object... vi) {
-        StringBuilder sb = new StringBuilder("xvO:");
-        for (Object i : vi) {
-            if (i.getClass().isArray()) {
-                sb.append("[");
-                int len = Array.getLength(i);
-                for (int x = 0; x < len; ++x)  {
-                    sb.append(Array.get(i, x));
-                    sb.append(",");
-                }
-                sb.append("]");
-
-            } else {
-                sb.append(i);
-            }
-            sb.append("*");
-        }
-        return sb.toString();
-    }
-}
-
-@Test
-public class MethodReferenceTestVarArgsSuperDefault implements MethodReferenceTestVarArgsSuperDefault_I {
-
-    interface DSPRII { String m(Integer a, Integer b); }
-
-    interface DSPRiii { String m(int a, int b, int c); }
-
-    interface DSPRi { String m(int a); }
-
-    interface DSPRaO { String m(Object[] a); }
-
-    interface DSPRai { String m(int[] a); }
-
-    interface DSPRvi { String m(int... va); }
-
-    // These should be processed as var args
-
-    public void testVarArgsSPRSuperclass() {
-        DSPRII q;
-
-        q = MethodReferenceTestVarArgsSuperDefault_I.super::xvO;
-        assertEquals(q.m(55,66), "xvO:55*66*");
-    }
-
-    public void testVarArgsSPRArray() {
-        DSPRai q;
-
-        q = MethodReferenceTestVarArgsSuperDefault_I.super::xvO;
-        assertEquals(q.m(new int[] { 55,66 } ), "xvO:[55,66,]*");
-    }
-
-    public void testVarArgsSPRII() {
-        DSPRII q;
-
-        q = MethodReferenceTestVarArgsSuperDefault_I.super::xvI;
-        assertEquals(q.m(33,7), "xvI:33-7-");
-
-        q = MethodReferenceTestVarArgsSuperDefault_I.super::xIvI;
-        assertEquals(q.m(50,40), "xIvI:5040-");
-
-        q = MethodReferenceTestVarArgsSuperDefault_I.super::xvi;
-        assertEquals(q.m(100,23), "xvi:123");
-
-        q = MethodReferenceTestVarArgsSuperDefault_I.super::xIvi;
-        assertEquals(q.m(9,21), "xIvi:(9)21");
-    }
-
-    public void testVarArgsSPRiii() {
-        DSPRiii q;
-
-        q = MethodReferenceTestVarArgsSuperDefault_I.super::xvI;
-        assertEquals(q.m(3, 2, 1), "xvI:3-2-1-");
-
-        q = MethodReferenceTestVarArgsSuperDefault_I.super::xIvI;
-        assertEquals(q.m(888, 99, 2), "xIvI:88899-2-");
-
-        q = MethodReferenceTestVarArgsSuperDefault_I.super::xvi;
-        assertEquals(q.m(900,80,7), "xvi:987");
-
-        q = MethodReferenceTestVarArgsSuperDefault_I.super::xIvi;
-        assertEquals(q.m(333,27, 72), "xIvi:(333)99");
-    }
-
-    public void testVarArgsSPRi() {
-        DSPRi q;
-
-        q = MethodReferenceTestVarArgsSuperDefault_I.super::xvI;
-        assertEquals(q.m(3), "xvI:3-");
-
-        q = MethodReferenceTestVarArgsSuperDefault_I.super::xIvI;
-        assertEquals(q.m(888), "xIvI:888");
-
-        q = MethodReferenceTestVarArgsSuperDefault_I.super::xvi;
-        assertEquals(q.m(900), "xvi:900");
-
-        q = MethodReferenceTestVarArgsSuperDefault_I.super::xIvi;
-        assertEquals(q.m(333), "xIvi:(333)0");
-    }
-
-    // These should NOT be processed as var args
-
-    public void testVarArgsSPRaO() {
-        DSPRaO q;
-
-        q = MethodReferenceTestVarArgsSuperDefault_I.super::xvO;
-        assertEquals(q.m(new String[] { "yo", "there", "dude" }), "xvO:yo*there*dude*");
-    }
-
-
-}
-
diff --git a/jdk/test/jdk/lambda/MethodReferenceTestVarArgsThis.java b/jdk/test/jdk/lambda/MethodReferenceTestVarArgsThis.java
deleted file mode 100644
index 2681a22..0000000
--- a/jdk/test/jdk/lambda/MethodReferenceTestVarArgsThis.java
+++ /dev/null
@@ -1,177 +0,0 @@
-/*
- * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-import org.testng.annotations.Test;
-import java.lang.reflect.Array;
-
-import static org.testng.Assert.assertEquals;
-
-/**
- * @author Robert Field
- */
-
-interface NsII { String m(Integer a, Integer b); }
-
-interface Nsiii { String m(int a, int b, int c); }
-
-interface Nsi { String m(int a); }
-
-interface NsaO { String m(Object[] a); }
-
-interface Nsai { String m(int[] a); }
-
-interface Nsvi { String m(int... va); }
-
-@Test
-public class MethodReferenceTestVarArgsThis {
-
-    // These should be processed as var args
-
-    String xvI(Integer... vi) {
-        StringBuilder sb = new StringBuilder("xvI:");
-        for (Integer i : vi) {
-            sb.append(i);
-            sb.append("-");
-        }
-        return sb.toString();
-    }
-
-    String xIvI(Integer f, Integer... vi) {
-        StringBuilder sb = new StringBuilder("xIvI:");
-        sb.append(f);
-        for (Integer i : vi) {
-            sb.append(i);
-            sb.append("-");
-        }
-        return sb.toString();
-    }
-
-    String xvi(int... vi) {
-        int sum = 0;
-        for (int i : vi) {
-            sum += i;
-        }
-        return "xvi:" + sum;
-    }
-
-    String xIvi(Integer f, int... vi) {
-        int sum = 0;
-        for (int i : vi) {
-            sum += i;
-        }
-        return "xIvi:(" + f + ")" + sum;
-    }
-
-    String xvO(Object... vi) {
-        StringBuilder sb = new StringBuilder("xvO:");
-        for (Object i : vi) {
-            if (i.getClass().isArray()) {
-                sb.append("[");
-                int len = Array.getLength(i);
-                for (int x = 0; x < len; ++x)  {
-                    sb.append(Array.get(i, x));
-                    sb.append(",");
-                }
-                sb.append("]");
-
-            } else {
-                sb.append(i);
-            }
-            sb.append("*");
-        }
-        return sb.toString();
-    }
-
-    public void testVarArgsNsSuperclass() {
-        NsII q;
-
-        q = this::xvO;
-        assertEquals(q.m(55,66), "xvO:55*66*");
-    }
-
-    public void testVarArgsNsArray() {
-        Nsai q;
-
-        q = this::xvO;
-        assertEquals(q.m(new int[] { 55,66 } ), "xvO:[55,66,]*");
-    }
-
-    public void testVarArgsNsII() {
-        NsII q;
-
-        q = this::xvI;
-        assertEquals(q.m(33,7), "xvI:33-7-");
-
-        q = this::xIvI;
-        assertEquals(q.m(50,40), "xIvI:5040-");
-
-        q = this::xvi;
-        assertEquals(q.m(100,23), "xvi:123");
-
-        q = this::xIvi;
-        assertEquals(q.m(9,21), "xIvi:(9)21");
-    }
-
-    public void testVarArgsNsiii() {
-        Nsiii q;
-
-        q = this::xvI;
-        assertEquals(q.m(3, 2, 1), "xvI:3-2-1-");
-
-        q = this::xIvI;
-        assertEquals(q.m(888, 99, 2), "xIvI:88899-2-");
-
-        q = this::xvi;
-        assertEquals(q.m(900,80,7), "xvi:987");
-
-        q = this::xIvi;
-        assertEquals(q.m(333,27, 72), "xIvi:(333)99");
-    }
-
-    public void testVarArgsNsi() {
-        Nsi q;
-
-        q = this::xvI;
-        assertEquals(q.m(3), "xvI:3-");
-
-        q = this::xIvI;
-        assertEquals(q.m(888), "xIvI:888");
-
-        q = this::xvi;
-        assertEquals(q.m(900), "xvi:900");
-
-        q = this::xIvi;
-        assertEquals(q.m(333), "xIvi:(333)0");
-    }
-
-    // These should NOT be processed as var args
-
-    public void testVarArgsNsaO() {
-        NsaO q;
-
-        q = this::xvO;
-        assertEquals(q.m(new String[] { "yo", "there", "dude" }), "xvO:yo*there*dude*");
-    }
-
-
-}
diff --git a/jdk/test/jdk/lambda/shapegen/ClassCase.java b/jdk/test/jdk/lambda/shapegen/ClassCase.java
deleted file mode 100644
index 85e942d..0000000
--- a/jdk/test/jdk/lambda/shapegen/ClassCase.java
+++ /dev/null
@@ -1,310 +0,0 @@
-/*
- * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * 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 shapegen;
-
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-/**
- *
- * @author Robert Field
- */
-public class ClassCase {
-
-    public enum Kind {
-        IVAC        (true,  "v"),
-        IPRESENT    (true,  "p"),
-        IDEFAULT    (true,  "d"),
-        CNONE       (false, "n"),
-        CABSTRACT   (false, "a"),
-        CCONCRETE   (false, "c");
-
-        private final String prefix;
-        public final boolean isInterface;
-
-        Kind(boolean isInterface, String prefix) {
-            this.isInterface = isInterface;
-            this.prefix = prefix;
-        }
-
-        public String getPrefix() { return prefix; }
-    }
-
-    public final Kind kind;
-    private final ClassCase superclass;
-    private final List<ClassCase> supertypes;
-
-    private String name;
-    private boolean _OK;
-    private boolean _HasClassMethod;
-    private Set<ClassCase> _mprov;
-    private boolean _IsConcrete;
-    private boolean _HasDefault;
-    private ClassCase _mres;
-    private ClassCase _mdefend;
-
-    private Set<RuleGroup> executed = new HashSet<RuleGroup>();
-
-    public ClassCase(Kind kind, ClassCase superclass, List<ClassCase> interfaces) {
-        this.kind = kind;
-        this.superclass = superclass;
-
-        // Set supertypes from superclass (if any) and interfaces
-        List<ClassCase> lc;
-        if (superclass == null) {
-            lc = interfaces;
-        } else {
-            lc = new ArrayList<>();
-            lc.add(superclass);
-            lc.addAll(interfaces);
-        }
-        this.supertypes = lc;
-    }
-
-    public final boolean isInterface() { return kind.isInterface; }
-    public final boolean isClass() { return !kind.isInterface; }
-
-    public Set<ClassCase> get_mprov() {
-        exec(RuleGroup.PROVENENCE);
-        return _mprov;
-    }
-
-    public void set_mprov(ClassCase cc) {
-        Set<ClassCase> s = new HashSet<>();
-        s.add(cc);
-        _mprov = s;
-    }
-
-    public void set_mprov(Set<ClassCase> s) {
-        _mprov = s;
-    }
-
-    public ClassCase get_mres() {
-        exec(RuleGroup.RESOLUTION);
-        return _mres;
-    }
-
-    public void set_mres(ClassCase cc) {
-        _mres = cc;
-    }
-
-    public ClassCase get_mdefend() {
-        exec(RuleGroup.DEFENDER);
-        return _mdefend;
-    }
-
-    public void set_mdefend(ClassCase cc) {
-        _mdefend = cc;
-    }
-
-    public boolean get_HasClassMethod() {
-        exec(RuleGroup.PROVENENCE);
-        return _HasClassMethod;
-    }
-
-    public void set_HasClassMethod(boolean bool) {
-        _HasClassMethod = bool;
-    }
-
-    public boolean get_HasDefault() {
-        exec(RuleGroup.MARKER);
-        return _HasDefault;
-    }
-
-    public void set_HasDefault(boolean bool) {
-        _HasDefault = bool;
-    }
-
-    public boolean get_IsConcrete() {
-        exec(RuleGroup.MARKER);
-        return _IsConcrete;
-    }
-
-    public void set_IsConcrete(boolean bool) {
-        _IsConcrete = bool;
-    }
-
-    public boolean get_OK() {
-        exec(RuleGroup.CHECKING);
-        return _OK;
-    }
-
-    public void set_OK(boolean bool) {
-        _OK = bool;
-    }
-
-    public boolean isMethodDefined() {
-        for (ClassCase cc : supertypes) {
-            if (cc.isMethodDefined()) {
-                return true;
-            }
-        }
-        switch (kind) {
-            case CCONCRETE:
-            case CABSTRACT:
-            case IPRESENT:
-            case IDEFAULT:
-                return true;
-            default:
-                return false;
-        }
-    }
-
-    public boolean isAbstract() {
-        return isMethodDefined() && (get_mres()==null);
-    }
-
-    public boolean hasSuperclass() {
-        return superclass != null;
-    }
-
-    public ClassCase getSuperclass() {
-        return superclass;
-    }
-
-    public List<ClassCase> getSupertypes() {
-        return supertypes;
-    }
-
-    public List<ClassCase> getInterfaces() {
-        if (superclass != null) {
-            if (supertypes.get(0) != superclass) {
-                throw new AssertionError("superclass missing from supertypes");
-            }
-            return supertypes.subList(1, supertypes.size());
-        } else {
-            return supertypes;
-        }
-    }
-
-    public boolean isSubtypeOf(ClassCase cc) {
-        // S-Refl
-        if (cc.equals(this)) {
-            return true;
-        }
-
-        // S-Def
-        for (ClassCase sp : getSupertypes()) {
-            if (cc.equals(sp)) {
-                return true;
-            }
-        }
-
-        // _S-Trans
-        for (ClassCase sp : getSupertypes()) {
-            if (sp.isSubtypeOf(cc)) {
-                return true;
-            }
-        }
-
-        return false;
-    }
-
-    public void init(Map<String, Integer> namingContext) {
-        if (name != null) {
-            return; // Already inited
-        }
-
-        for (ClassCase sup : supertypes) {
-            sup.init(namingContext);
-        }
-
-        // Build name
-        StringBuilder sb = new StringBuilder();
-        if (!supertypes.isEmpty()) {
-            sb.append(isInterface() ? "I" : "C");
-            for (ClassCase cc : supertypes) {
-                sb.append(cc.getName());
-            }
-            sb.append(kind.isInterface ? "i" : "c");
-        }
-        sb.append(kind.prefix);
-        String pname = sb.toString();
-        Integer icnt = namingContext.get(pname);
-        int cnt = icnt == null ? 0 : icnt;
-        ++cnt;
-        namingContext.put(pname, cnt);
-        if (cnt > 1) {
-            sb.append(cnt);
-        }
-        this.name = sb.toString();
-    }
-
-    public boolean isa(Kind... kinds) {
-        for (Kind k : kinds) {
-            if (kind == k) {
-                return true;
-            }
-        }
-        return false;
-    }
-
-    private void exec(RuleGroup rg ) {
-        if (!executed.contains(rg)) {
-            rg.exec(this);
-            executed.add(rg);
-        }
-    }
-
-    public void collectClasses(Set<ClassCase> seen) {
-        seen.add(this);
-        for (ClassCase cc : supertypes) {
-            cc.collectClasses(seen);
-        }
-    }
-
-    public String getID() {
-        if (name == null) {
-            throw new Error("Access to uninitialized ClassCase");
-        } else {
-            return name;
-        }
-    }
-
-    public final String getName() {
-        if (name == null) {
-            return "ClassCase uninited@" + hashCode();
-        } else {
-            return name;
-        }
-    }
-
-    @Override
-    public boolean equals(Object obj) {
-        return obj instanceof ClassCase && getID().equals(((ClassCase)obj).getID());
-    }
-
-    @Override
-    public int hashCode() {
-        return getID().hashCode();
-    }
-
-    @Override
-    public String toString() {
-        return getName();
-    }
-}
diff --git a/jdk/test/jdk/lambda/shapegen/Hierarchy.java b/jdk/test/jdk/lambda/shapegen/Hierarchy.java
deleted file mode 100644
index 64443d6..0000000
--- a/jdk/test/jdk/lambda/shapegen/Hierarchy.java
+++ /dev/null
@@ -1,207 +0,0 @@
-/*
- * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * 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 shapegen;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Map;
-import java.util.Set;
-
-import static shapegen.ClassCase.Kind.*;
-
-/**
- *
- * @author Robert Field
- */
-public class Hierarchy {
-
-    public final ClassCase root;
-    public final Set<ClassCase> all;
-
-    public Hierarchy(ClassCase root) {
-        this.root = root;
-        root.init(new HashMap<String,Integer>());
-        Set<ClassCase> allClasses = new HashSet<>();
-        root.collectClasses(allClasses);
-        this.all = allClasses;
-    }
-
-    public boolean anyDefaults() {
-        for (ClassCase cc : all) {
-            if (cc.kind == IDEFAULT) {
-                return true;
-            }
-        }
-        return false;
-    }
-
-    public boolean get_OK() {
-        return root.get_OK();
-    }
-
-    public String testName() {
-        return root + "Test";
-    }
-
-    private static void genInterfaceList(StringBuilder buf, String prefix, List<ClassCase> interfaces) {
-            if (!interfaces.isEmpty()) {
-                buf.append(" ");
-                buf.append(prefix);
-                buf.append(" ");
-                buf.append(interfaces.get(0));
-                for (int i = 1; i < interfaces.size(); ++i) {
-                    buf.append(", " + interfaces.get(i));
-                }
-            }
-    }
-
-    public static void genClassDef(StringBuilder buf, ClassCase cc, String implClass, List<ClassCase> defaultRef) {
-        if (cc.isInterface()) {
-            buf.append("interface ");
-            buf.append(cc.getName() + " ");
-            genInterfaceList(buf, "extends", cc.getInterfaces());
-            buf.append(" {\n");
-
-            switch (cc.kind) {
-                case IDEFAULT:
-                    buf.append("    default String m() { return \"\"; }\n");
-                    defaultRef.add(cc);
-                    break;
-                case IPRESENT:
-                    buf.append("    String m();\n");
-                    break;
-                case IVAC:
-                    break;
-                default:
-                    throw new AssertionError("Unexpected kind");
-            }
-            buf.append("}\n\n");
-        } else {
-            buf.append((cc.isAbstract()? "abstract " : ""));
-            buf.append(" class " + cc.getName());
-            if (cc.getSuperclass() != null) {
-                buf.append(" extends " + cc.getSuperclass());
-            }
-
-            genInterfaceList(buf, "implements", cc.getInterfaces());
-            buf.append(" {\n");
-
-            switch (cc.kind) {
-                case CCONCRETE:
-                    buf.append("   public String m() { return \"\"; }\n");
-                    break;
-                case CABSTRACT:
-                    buf.append("   public abstract String m();\n");
-                    break;
-                case CNONE:
-                    break;
-                default:
-                    throw new AssertionError("Unexpected kind");
-            }
-            buf.append("}\n\n");
-        }
-    }
-
-    @Override
-    public boolean equals(Object obj) {
-        return obj instanceof Hierarchy && root.getID().equals(((Hierarchy)obj).root.getID());
-    }
-
-    @Override
-    public int hashCode() {
-        return root.getID().hashCode();
-    }
-
-    @Override
-    public String toString() {
-        return root.getName();
-    }
-
-    private static String classNames[] = {
-        "C", "D", "E", "F", "G", "H", "S", "T", "U", "V"
-    };
-
-    private static String interfaceNames[] = {
-        "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R"
-    };
-
-    private static int CLASS_INDEX = 0;
-    private static int INTERFACE_INDEX = 1;
-    private static int NUM_INDICIES = 2;
-
-    public List<String> getDescription() {
-        Map<ClassCase,String> nameMap = new HashMap<>();
-        assignNames(root, new int[NUM_INDICIES], nameMap);
-
-        ArrayList<String> res = new ArrayList<>();
-        if (root.getSupertypes().size() == 0) {
-           res.add(nameMap.get(root) + root.kind.getPrefix() + "()");
-        } else {
-            genCaseDescription(root, res, new HashSet<ClassCase>(), nameMap);
-        }
-        return res;
-    }
-
-    private static void assignNames(
-            ClassCase cc, int indices[], Map<ClassCase,String> names) {
-        String name = names.get(cc);
-        if (name == null) {
-            if (cc.isInterface()) {
-                names.put(cc, interfaceNames[indices[INTERFACE_INDEX]++]);
-            } else {
-                names.put(cc, classNames[indices[CLASS_INDEX]++]);
-            }
-            for (int i = 0; i < cc.getSupertypes().size(); ++i) {
-                assignNames(cc.getSupertypes().get(i), indices, names);
-            }
-        }
-    }
-
-    private static void genCaseDescription(
-            ClassCase cc, List<String> res, Set<ClassCase> alreadyDone,
-            Map<ClassCase,String> nameMap) {
-        if (!alreadyDone.contains(cc)) {
-            if (cc.getSupertypes().size() > 0) {
-                StringBuilder sb = new StringBuilder();
-                sb.append(nameMap.get(cc));
-                sb.append(cc.kind.getPrefix());
-                sb.append("(");
-                for (int i = 0; i < cc.getSupertypes().size(); ++i) {
-                    ClassCase supertype = cc.getSupertypes().get(i);
-                    if (i != 0) {
-                        sb.append(",");
-                    }
-                    genCaseDescription(supertype, res, alreadyDone, nameMap);
-                    sb.append(nameMap.get(supertype));
-                    sb.append(supertype.kind.getPrefix());
-                }
-                sb.append(")");
-                res.add(sb.toString());
-            }
-        }
-        alreadyDone.add(cc);
-    }
-}
diff --git a/jdk/test/jdk/lambda/shapegen/HierarchyGenerator.java b/jdk/test/jdk/lambda/shapegen/HierarchyGenerator.java
deleted file mode 100644
index 9511c41..0000000
--- a/jdk/test/jdk/lambda/shapegen/HierarchyGenerator.java
+++ /dev/null
@@ -1,190 +0,0 @@
-/*
- * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * 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 shapegen;
-
-import shapegen.ClassCase.Kind;
-
-import java.util.Collection;
-import java.util.Set;
-import java.util.HashSet;
-import java.util.Collections;
-import java.util.ArrayList;
-import java.util.List;
-
-import static shapegen.ClassCase.Kind.*;
-
-import static java.lang.Math.pow;
-
-/**
- *
- * @author Robert Field
- */
-public final class HierarchyGenerator {
-
-    private int okcnt = 0;
-    private int errcnt = 0;
-    private Set<Hierarchy> uniqueOK = new HashSet<>();
-    private Set<Hierarchy> uniqueErr = new HashSet<>();
-
-    /**
-     * @param args the command line arguments
-     */
-    public HierarchyGenerator() {
-        organize("exhaustive interface", iExhaustive(2));
-        organize("exhaustive class", cExhaustive());
-        organize("shapes interface", iShapes());
-        organize("shapes class/interface", ciShapes());
-
-        System.out.printf("\nExpect OK:    %d -- unique %d",   okcnt,  uniqueOK.size());
-        System.out.printf("\nExpect Error: %d -- unique %d\n", errcnt, uniqueErr.size());
-    }
-
-    public Collection<Hierarchy> getOK() {
-        return uniqueOK;
-    }
-
-    public Collection<Hierarchy> getErr() {
-        return uniqueErr;
-    }
-
-    private void organize(String tname, List<Hierarchy> totest) {
-        System.out.printf("\nGenerating %s....\n", tname);
-        int nodefault = 0;
-        List<Hierarchy> ok = new ArrayList<>();
-        List<Hierarchy> err = new ArrayList<>();
-        for (Hierarchy cc : totest) {
-            if (cc.anyDefaults()) {
-                //System.out.printf("  %s\n", cc);
-                if (cc.get_OK()) {
-                    ok.add(cc);
-                } else {
-                    err.add(cc);
-                }
-            } else {
-                ++nodefault;
-            }
-        }
-
-        errcnt += err.size();
-        okcnt += ok.size();
-        uniqueErr.addAll(err);
-        uniqueOK.addAll(ok);
-
-        System.out.printf("  %5d No default\n  %5d Error\n  %5d OK\n  %5d Total\n",
-                nodefault, err.size(), ok.size(), totest.size());
-    }
-
-    public List<Hierarchy> iExhaustive(int idepth) {
-        List<ClassCase> current = new ArrayList<>();
-        for (int i = 0; i < idepth; ++i) {
-            current = ilayer(current);
-        }
-        return wrapInClassAndHierarchy(current);
-    }
-
-    private List<ClassCase> ilayer(List<ClassCase> srcLayer) {
-        List<ClassCase> lay = new ArrayList<>();
-        for (int i = (int) pow(2, srcLayer.size()) - 1; i >= 0; --i) {
-            List<ClassCase> itfs = new ArrayList<>();
-            for (int b = srcLayer.size() - 1; b >= 0; --b) {
-                if ((i & (1<<b)) != 0) {
-                    itfs.add(srcLayer.get(b));
-                }
-            }
-            lay.add(new ClassCase(IVAC, null, itfs));
-            lay.add(new ClassCase(IPRESENT, null, itfs));
-            lay.add(new ClassCase(IDEFAULT, null, itfs));
-            lay.add(new ClassCase(IDEFAULT, null, itfs));
-        }
-        return lay;
-    }
-
-    public List<Hierarchy> cExhaustive() {
-        final Kind[] iKinds = new Kind[]{IDEFAULT, IVAC, IPRESENT, null};
-        final Kind[] cKinds = new Kind[]{CNONE, CABSTRACT, CCONCRETE};
-        List<Hierarchy> totest = new ArrayList<>();
-        for (int i1 = 0; i1 < iKinds.length; ++i1) {
-            for (int i2 = 0; i2 < iKinds.length; ++i2) {
-                for (int i3 = 0; i3 < iKinds.length; ++i3) {
-                    for (int c1 = 0; c1 < cKinds.length; ++c1) {
-                        for (int c2 = 0; c2 < cKinds.length; ++c2) {
-                            for (int c3 = 0; c3 < cKinds.length; ++c3) {
-                                totest.add( new Hierarchy(
-                                        new ClassCase(cKinds[c1],
-                                            new ClassCase(cKinds[c2],
-                                                new ClassCase(cKinds[c3],
-                                                    null,
-                                                    iList(iKinds[i1])
-                                                ),
-                                                iList(iKinds[i2])
-                                            ),
-                                            iList(iKinds[i3])
-                                        )));
-                            }
-                        }
-                    }
-                }
-            }
-        }
-        return totest;
-    }
-
-    public static final List<ClassCase> EMPTY_LIST = new ArrayList<>();
-
-    private List<ClassCase> iList(Kind kind) {
-        if (kind == null) {
-            return EMPTY_LIST;
-        } else {
-            List<ClassCase> itfs = new ArrayList<>();
-            itfs.add(new ClassCase(kind, null, EMPTY_LIST));
-            return itfs;
-        }
-    }
-
-    public List<Hierarchy> ciShapes() {
-        return wrapInHierarchy(TTShape.allCases(true));
-    }
-
-    public List<Hierarchy> iShapes() {
-        return wrapInClassAndHierarchy(TTShape.allCases(false));
-    }
-
-    public List<Hierarchy> wrapInClassAndHierarchy(List<ClassCase> ihs) {
-        List<Hierarchy> totest = new ArrayList<>();
-        for (ClassCase cc : ihs) {
-            List<ClassCase> interfaces = new ArrayList<>();
-            interfaces.add(cc);
-            totest.add(new Hierarchy(new ClassCase(CNONE, null, interfaces)));
-        }
-        return totest;
-    }
-
-    public List<Hierarchy> wrapInHierarchy(List<ClassCase> ihs) {
-        List<Hierarchy> totest = new ArrayList<>();
-        for (ClassCase cc : ihs) {
-            totest.add(new Hierarchy(cc));
-        }
-        return totest;
-    }
-}
diff --git a/jdk/test/jdk/lambda/shapegen/RuleGroup.java b/jdk/test/jdk/lambda/shapegen/RuleGroup.java
deleted file mode 100644
index ef194ab..0000000
--- a/jdk/test/jdk/lambda/shapegen/RuleGroup.java
+++ /dev/null
@@ -1,204 +0,0 @@
-/*
- * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * 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 shapegen;
-
-import java.util.HashSet;
-import java.util.Set;
-
-import static shapegen.ClassCase.Kind.*;
-
-/**
- *
- * @author Robert Field
- */
-public class RuleGroup {
-
-    final String name;
-    private final Rule[] rules;
-
-    public RuleGroup(String name, Rule[] rules) {
-        this.name = name;
-        this.rules = rules;
-    }
-
-    public boolean exec(ClassCase cc) {
-        boolean found = false;
-        for (Rule rule : rules) {
-            if (rule.guard(cc)) {
-                if (found) {
-                    throw new RuntimeException("Bad rules -- multiple matches " + toString() + " for " + cc);
-                } else {
-                    rule.eval(cc);
-                    found = true;
-                }
-            }
-        }
-        return found;
-    }
-
-    @Override
-    public String toString() {
-        return name;
-    }
-
-    public static RuleGroup PROVENENCE = new RuleGroup("Provenence", new Rule[] {
-      new Rule("P-CDeclare") {
-          boolean guard(ClassCase cc) {
-              return cc.isa(CCONCRETE, CABSTRACT);
-          }
-
-          void eval(ClassCase cc) {
-              cc.set_mprov(cc);
-              cc.set_HasClassMethod(true);
-          }
-      },
-
-      new Rule("P-IDeclare") {
-          boolean guard(ClassCase cc) {
-              return cc.isa(IDEFAULT, IPRESENT);
-          }
-
-          void eval(ClassCase cc) {
-              cc.set_mprov(cc);
-          }
-      },
-
-      new Rule("P-IntfInh") {
-          boolean guard(ClassCase cc) {
-              return cc.isa(IVAC, CNONE) && !(cc.hasSuperclass() && cc.getSuperclass().get_HasClassMethod());
-          }
-
-          void eval(ClassCase cc) {
-              Set<ClassCase> _S = new HashSet<>();
-              for (ClassCase t : cc.getSupertypes()) {
-                  _S.addAll(t.get_mprov());
-              }
-              Set<ClassCase> tops = new HashSet<>();
-              for (ClassCase _W : _S) {
-                  for (ClassCase _V : _S) {
-                      if (_V.equals(_W) || !(_V.isSubtypeOf(_W))) {
-                          tops.add(_W);
-                      }
-                  }
-              }
-              cc.set_mprov(tops);
-          }
-      },
-
-      new Rule("P-ClassInh") {
-          boolean guard(ClassCase cc) {
-              return cc.isa(CNONE) && (cc.hasSuperclass() && cc.getSuperclass().get_HasClassMethod());
-          }
-
-          void eval(ClassCase cc) {
-              cc.set_mprov(cc.getSuperclass());
-              cc.set_HasClassMethod(true);
-          }
-      },
-
-    });
-
-    public static RuleGroup MARKER = new RuleGroup("Marker", new Rule[] {
-      new Rule("M-Default") {
-          boolean guard(ClassCase cc) {
-              return cc.isa(IDEFAULT);
-          }
-
-          void eval(ClassCase cc) {
-              cc.set_HasDefault(true);
-          }
-      },
-
-      new Rule("M-Conc") {
-          boolean guard(ClassCase cc) {
-            return cc.isa(CCONCRETE);
-          }
-
-          void eval(ClassCase cc) {
-              cc.set_IsConcrete(true);
-          }
-      },
-
-    });
-
-    public static RuleGroup RESOLUTION = new RuleGroup("Resolution", new Rule[] {
-      new Rule("R-Resolve") {
-          boolean guard(ClassCase cc) {
-              if (!(cc.isClass() && cc.get_mprov().size() == 1)) {
-                  return false;
-              }
-              ClassCase _V = cc.get_mprov().iterator().next();
-              return _V.get_IsConcrete() || _V.get_HasDefault();
-          }
-
-          void eval(ClassCase cc) {
-              ClassCase _V = cc.get_mprov().iterator().next();
-              cc.set_mres(_V);
-          }
-      },
-
-    });
-
-    public static RuleGroup DEFENDER = new RuleGroup("Defender", new Rule[] {
-      new Rule("D-Defend") {
-          boolean guard(ClassCase cc) {
-              ClassCase mresSuper = cc.hasSuperclass() ? cc.getSuperclass().get_mres() : null;
-              boolean eq = cc.get_mres() == null ? mresSuper == null : cc.get_mres().equals(mresSuper);
-              return cc.isa(CNONE) && !eq;
-          }
-
-          void eval(ClassCase cc) {
-              cc.set_mdefend(cc.get_mres());
-          }
-      },
-
-    });
-
-    public static RuleGroup CHECKING = new RuleGroup("Checking", new Rule[] {
-      new Rule("C-Check") {
-          boolean guard(ClassCase cc) {
-              for (ClassCase t : cc.getSupertypes()) {
-                  if (! t.get_OK()) {
-                      return false;
-                  }
-              }
-              int defenderCount = 0;
-              int provCount = 0;
-              for (ClassCase prov : cc.get_mprov()) {
-                  if (prov.get_HasDefault()) {
-                      defenderCount++;
-                  }
-                  provCount++;
-              }
-              return provCount <= 1 || defenderCount == 0;
-          }
-
-          void eval(ClassCase cc) {
-              cc.set_OK(true);
-          }
-      },
-
-    });
-
-}
diff --git a/jdk/test/jdk/lambda/shapegen/TTNode.java b/jdk/test/jdk/lambda/shapegen/TTNode.java
deleted file mode 100644
index 48310df..0000000
--- a/jdk/test/jdk/lambda/shapegen/TTNode.java
+++ /dev/null
@@ -1,124 +0,0 @@
-/*
- * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * 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 shapegen;
-
-import shapegen.ClassCase.Kind;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Set;
-
-import static shapegen.ClassCase.Kind.*;
-
-/**
- * Type Template Node
- *
- * @author Robert Field
- */
-public class TTNode {
-
-    final List<TTNode> supertypes;
-    final boolean canBeClass;
-
-    private int currentKindIndex;
-    private Kind[] kinds;
-
-    public TTNode(List<TTNode> subtypes, boolean canBeClass) {
-        this.supertypes = subtypes;
-        this.canBeClass = canBeClass;
-    }
-
-    public void start(boolean includeClasses) {
-        kinds =
-             supertypes.isEmpty()?
-                (new Kind[]{IDEFAULT, IPRESENT})
-             :  ((includeClasses && canBeClass)?
-                  new Kind[]{CNONE, IVAC, IDEFAULT, IPRESENT}
-                : new Kind[]{IVAC, IDEFAULT, IPRESENT});
-        currentKindIndex = 0;
-
-        for (TTNode sub : supertypes) {
-            sub.start(includeClasses);
-        }
-    }
-
-    public boolean next() {
-        ++currentKindIndex;
-        if (currentKindIndex >= kinds.length) {
-            currentKindIndex = 0;
-            return false;
-        } else {
-            return true;
-        }
-    }
-
-    public void collectAllSubtypes(Set<TTNode> subs) {
-        subs.add(this);
-        for (TTNode n : supertypes) {
-            n.collectAllSubtypes(subs);
-        }
-    }
-
-    private Kind getKind() {
-        return kinds[currentKindIndex];
-    }
-
-    boolean isInterface() {
-        return getKind().isInterface;
-    }
-
-    boolean isClass() {
-        return !isInterface();
-    }
-
-    boolean hasDefault() {
-        return getKind() == IDEFAULT;
-    }
-
-    public boolean isValid() {
-        for (TTNode n : supertypes) {
-            if (!n.isValid() || (isInterface() && n.isClass())) {
-                return false;
-            }
-        }
-        return true;
-    }
-
-    public ClassCase genCase() {
-        ClassCase subclass;
-        List<TTNode> ttintfs;
-        if (isClass() && !supertypes.isEmpty() && supertypes.get(0).isClass()) {
-            subclass = supertypes.get(0).genCase();
-            ttintfs = supertypes.subList(1, supertypes.size());
-        } else {
-            subclass = null;
-            ttintfs = supertypes;
-        }
-        List<ClassCase> intfs = new ArrayList<>();
-        for (TTNode node : ttintfs) {
-            intfs.add(node.genCase());
-        }
-        return new ClassCase(getKind(), subclass, intfs);
-    }
-}
diff --git a/jdk/test/jdk/lambda/shapegen/TTParser.java b/jdk/test/jdk/lambda/shapegen/TTParser.java
deleted file mode 100644
index ffabee5..0000000
--- a/jdk/test/jdk/lambda/shapegen/TTParser.java
+++ /dev/null
@@ -1,98 +0,0 @@
-/*
- * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * 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 shapegen;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.io.IOException;
-import java.io.StringReader;
-
-import static java.lang.Character.isLetter;
-import static java.lang.Character.isUpperCase;
-import static java.lang.Character.isWhitespace;
-
-/**
- * Parse a type template definition string
- *
- *   input     :: classDef
- *   classDef  :: letter [ ( classDef* ) ]
- *
- * @author Robert Field
- */
-public class TTParser extends StringReader {
-
-    private Map<Character, TTNode> letterMap = new HashMap<>();
-    private char ch;
-
-    private final String def;
-
-    public TTParser(String s) {
-        super(s);
-        this.def = s;
-    }
-
-    private void advance() throws IOException {
-        do {
-            ch = (char)read();
-        } while (isWhitespace(ch));
-    }
-
-    public TTNode parse() {
-        try {
-            advance();
-            return classDef();
-        } catch (IOException t) {
-            throw new RuntimeException(t);
-        }
-    }
-
-    private TTNode classDef() throws IOException {
-        if (!isLetter(ch)) {
-            if (ch == (char)-1) {
-                throw new IOException("Unexpected end of type template in " + def);
-            } else {
-                throw new IOException("Unexpected character in type template: " + (Character)ch + " in " + def);
-            }
-        }
-        char nodeCh = ch;
-        TTNode node = letterMap.get(nodeCh);
-        boolean canBeClass = isUpperCase(nodeCh);
-        advance();
-        if (node == null) {
-            List<TTNode> subtypes = new ArrayList<>();
-            if (ch == '(') {
-                advance();
-                while (ch != ')') {
-                    subtypes.add(classDef());
-                }
-                advance();
-            }
-            node = new TTNode(subtypes, canBeClass);
-            letterMap.put(nodeCh, node);
-        }
-        return node;
-    }
-}
diff --git a/jdk/test/jdk/lambda/shapegen/TTShape.java b/jdk/test/jdk/lambda/shapegen/TTShape.java
deleted file mode 100644
index 07b84e2..0000000
--- a/jdk/test/jdk/lambda/shapegen/TTShape.java
+++ /dev/null
@@ -1,102 +0,0 @@
-/*
- * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * 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 shapegen;
-
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-
-/**
- *
- * @author Robert Field
- */
-public class TTShape {
-
-    private final TTNode root;
-    private final TTNode[] nodes;
-
-    TTShape(TTNode root) {
-        this.root = root;
-        Set<TTNode> subs = new HashSet<>();
-        root.collectAllSubtypes(subs);
-        nodes = subs.toArray(new TTNode[subs.size()]);
-    }
-
-    private List<ClassCase> toCases(boolean includeClasses) {
-        List<ClassCase> ccs = new ArrayList<>();
-        root.start(includeClasses);
-        int i;
-        outer:
-        while (true) {
-            if (root.isValid()) {
-                ClassCase cc = root.genCase();
-                //System.out.println(cc);
-                ccs.add(cc);
-            }
-
-            i = 0;
-            do {
-                if (i >= nodes.length) {
-                    break outer;
-                }
-            } while(!nodes[i++].next());
-        }
-        return ccs;
-    }
-
-   public static List<ClassCase> allCases(boolean includeClasses) {
-        List<ClassCase> ccs = new ArrayList<>();
-        for (TTShape shape : SHAPES) {
-            ccs.addAll(shape.toCases(includeClasses));
-        }
-        return ccs;
-    }
-
-    public static TTShape parse(String s) {
-        return new TTShape(new TTParser(s).parse());
-    }
-
-    public static final TTShape[] SHAPES = new TTShape[] {
-        parse("a"),
-        parse("a(b)"),
-        parse("A(bb)"),
-        parse("A(B(d)c(d))"),
-        parse("A(b(c))"),
-        parse("A(B(cd)d)"),
-        parse("A(B(c)c)"),
-        parse("A(B(Ce)d(e))"),
-        parse("A(B(C)d(e))"),
-        parse("A(Bc(d))"),
-        parse("A(B(d)dc)"),
-        parse("A(B(dc)dc)"),
-        parse("A(B(c(d))d)"),
-        parse("A(B(C(d))d)"),
-        parse("A(B(C(e)d(e))e)"),
-        parse("A(B(c(d))c)"),
-        parse("A(B(dc(d))c)"),
-        parse("A(B(C(d))d)"),
-    };
-
-}
diff --git a/jdk/test/sun/util/calendar/zi/tzdata/VERSION b/jdk/test/sun/util/calendar/zi/tzdata/VERSION
index 034114a..ebd4db7 100644
--- a/jdk/test/sun/util/calendar/zi/tzdata/VERSION
+++ b/jdk/test/sun/util/calendar/zi/tzdata/VERSION
@@ -21,4 +21,4 @@
 # or visit www.oracle.com if you need additional information or have any
 # questions.
 #
-tzdata2015a
+tzdata2015b
diff --git a/jdk/test/sun/util/calendar/zi/tzdata/asia b/jdk/test/sun/util/calendar/zi/tzdata/asia
index bff837c..fa4f246 100644
--- a/jdk/test/sun/util/calendar/zi/tzdata/asia
+++ b/jdk/test/sun/util/calendar/zi/tzdata/asia
@@ -1927,6 +1927,13 @@
 # was at the start of 2008-03-31 (the day of Steffen Thorsen's report);
 # this is almost surely wrong.
 
+# From Ganbold Tsagaankhuu (2015-03-10):
+# It seems like yesterday Mongolian Government meeting has concluded to use
+# daylight saving time in Mongolia....  Starting at 2:00AM of last Saturday of
+# March 2015, daylight saving time starts.  And 00:00AM of last Saturday of
+# September daylight saving time ends.  Source:
+# http://zasag.mn/news/view/8969
+
 # Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
 Rule	Mongol	1983	1984	-	Apr	1	0:00	1:00	S
 Rule	Mongol	1983	only	-	Oct	1	0:00	0	-
@@ -1947,6 +1954,8 @@
 Rule	Mongol	2001	only	-	Apr	lastSat	2:00	1:00	S
 Rule	Mongol	2001	2006	-	Sep	lastSat	2:00	0	-
 Rule	Mongol	2002	2006	-	Mar	lastSat	2:00	1:00	S
+Rule	Mongol	2015	max	-	Mar	lastSat	2:00	1:00	S
+Rule	Mongol	2015	max	-	Sep	lastSat	0:00	0	-
 
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 # Hovd, a.k.a. Chovd, Dund-Us, Dzhargalant, Khovd, Jirgalanta
@@ -2365,13 +2374,19 @@
 # official source...:
 # http://www.palestinecabinet.gov.ps/ar/Views/ViewDetails.aspx?pid=1252
 
-# From Paul Eggert (2013-09-24):
-# For future dates, guess the last Thursday in March at 24:00 through
-# the first Friday on or after September 21 at 00:00.  This is consistent with
-# the predictions in today's editions of the following URLs,
-# which are for Gaza and Hebron respectively:
-# http://www.timeanddate.com/worldclock/timezone.html?n=702
-# http://www.timeanddate.com/worldclock/timezone.html?n=2364
+# From Steffen Thorsen (2015-03-03):
+# Sources such as http://www.alquds.com/news/article/view/id/548257
+# and http://www.raya.ps/ar/news/890705.html say Palestine areas will
+# start DST on 2015-03-28 00:00 which is one day later than expected.
+#
+# From Paul Eggert (2015-03-03):
+# http://www.timeanddate.com/time/change/west-bank/ramallah?year=2014
+# says that the fall 2014 transition was Oct 23 at 24:00.
+# For future dates, guess the last Friday in March at 24:00 through
+# the first Friday on or after October 21 at 00:00.  This is consistent with
+# the predictions in today's editions of the following URLs:
+# http://www.timeanddate.com/time/change/gaza-strip/gaza
+# http://www.timeanddate.com/time/change/west-bank/hebron
 
 # Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
 Rule EgyptAsia	1957	only	-	May	10	0:00	1:00	S
@@ -2397,9 +2412,11 @@
 Rule Palestine	2011	only	-	Aug	 1	0:00	0	-
 Rule Palestine	2011	only	-	Aug	30	0:00	1:00	S
 Rule Palestine	2011	only	-	Sep	30	0:00	0	-
-Rule Palestine	2012	max	-	Mar	lastThu	24:00	1:00	S
+Rule Palestine	2012	2014	-	Mar	lastThu	24:00	1:00	S
 Rule Palestine	2012	only	-	Sep	21	1:00	0	-
-Rule Palestine	2013	max	-	Sep	Fri>=21	0:00	0	-
+Rule Palestine	2013	only	-	Sep	Fri>=21	0:00	0	-
+Rule Palestine	2014	max	-	Oct	Fri>=21	0:00	0	-
+Rule Palestine	2015	max	-	Mar	lastFri	24:00	1:00	S
 
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone	Asia/Gaza	2:17:52	-	LMT	1900 Oct
diff --git a/jdk/test/sun/util/calendar/zi/tzdata/australasia b/jdk/test/sun/util/calendar/zi/tzdata/australasia
index f2a89e8..ec9f392 100644
--- a/jdk/test/sun/util/calendar/zi/tzdata/australasia
+++ b/jdk/test/sun/util/calendar/zi/tzdata/australasia
@@ -396,6 +396,7 @@
 			 9:39:00 -	LMT	1901        # Agana
 			10:00	-	GST	2000 Dec 23 # Guam
 			10:00	-	ChST	# Chamorro Standard Time
+Link Pacific/Guam Pacific/Saipan # N Mariana Is
 
 # Kiribati
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
@@ -411,12 +412,7 @@
 			 14:00	-	LINT
 
 # N Mariana Is
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone Pacific/Saipan	-14:17:00 -	LMT	1844 Dec 31
-			 9:43:00 -	LMT	1901
-			 9:00	-	MPT	1969 Oct    # N Mariana Is Time
-			10:00	-	MPT	2000 Dec 23
-			10:00	-	ChST	# Chamorro Standard Time
+# See Pacific/Guam.
 
 # Marshall Is
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
@@ -586,6 +582,7 @@
 			-11:00	-	NST	1967 Apr    # N=Nome
 			-11:00	-	BST	1983 Nov 30 # B=Bering
 			-11:00	-	SST	            # S=Samoa
+Link Pacific/Pago_Pago Pacific/Midway # in US minor outlying islands
 
 # Samoa (formerly and also known as Western Samoa)
 
@@ -767,23 +764,7 @@
 # uninhabited
 
 # Midway
-#
-# From Mark Brader (2005-01-23):
-# [Fallacies and Fantasies of Air Transport History, by R.E.G. Davies,
-# published 1994 by Paladwr Press, McLean, VA, USA; ISBN 0-9626483-5-3]
-# reproduced a Pan American Airways timetable from 1936, for their weekly
-# "Orient Express" flights between San Francisco and Manila, and connecting
-# flights to Chicago and the US East Coast.  As it uses some time zone
-# designations that I've never seen before:....
-# Fri. 6:30A Lv. HONOLOLU (Pearl Harbor), H.I.   H.L.T. Ar. 5:30P Sun.
-#  "   3:00P Ar. MIDWAY ISLAND . . . . . . . . . M.L.T. Lv. 6:00A  "
-#
-Zone Pacific/Midway	-11:49:28 -	LMT	1901
-			-11:00	-	NST	1956 Jun  3
-			-11:00	1:00	NDT	1956 Sep  2
-			-11:00	-	NST	1967 Apr    # N=Nome
-			-11:00	-	BST	1983 Nov 30 # B=Bering
-			-11:00	-	SST	            # S=Samoa
+# See Pacific/Pago_Pago.
 
 # Palmyra
 # uninhabited since World War II; was probably like Pacific/Kiritimati
diff --git a/jdk/test/sun/util/calendar/zi/tzdata/europe b/jdk/test/sun/util/calendar/zi/tzdata/europe
index 89790f0..008268a 100644
--- a/jdk/test/sun/util/calendar/zi/tzdata/europe
+++ b/jdk/test/sun/util/calendar/zi/tzdata/europe
@@ -2423,7 +2423,7 @@
 			 4:00	Russia	VOL%sT	1989 Mar 26  2:00s # Volgograd T
 			 3:00	Russia	VOL%sT	1991 Mar 31  2:00s
 			 4:00	-	VOLT	1992 Mar 29  2:00s
-			 3:00	Russia	MSK	2011 Mar 27  2:00s
+			 3:00	Russia	MSK/MSD	2011 Mar 27  2:00s
 			 4:00	-	MSK	2014 Oct 26  2:00s
 			 3:00	-	MSK
 
diff --git a/jdk/test/sun/util/calendar/zi/tzdata/northamerica b/jdk/test/sun/util/calendar/zi/tzdata/northamerica
index 5943cfe..442a50e 100644
--- a/jdk/test/sun/util/calendar/zi/tzdata/northamerica
+++ b/jdk/test/sun/util/calendar/zi/tzdata/northamerica
@@ -2335,8 +2335,24 @@
 # "...the new time zone will come into effect at two o'clock on the first Sunday
 # of February, when we will have to advance the clock one hour from its current
 # time..."
-#
 # Also, the new zone will not use DST.
+#
+# From Carlos Raúl Perasso (2015-02-02):
+# The decree that modifies the Mexican Hour System Law has finally
+# been published at the Diario Oficial de la Federación
+# http://www.dof.gob.mx/nota_detalle.php?codigo=5380123&fecha=31/01/2015
+# It establishes 5 zones for Mexico:
+# 1- Zona Centro (Central Zone): Corresponds to longitude 90 W,
+#    includes most of Mexico, excluding what's mentioned below.
+# 2- Zona Pacífico (Pacific Zone): Longitude 105 W, includes the
+#    states of Baja California Sur; Chihuahua; Nayarit (excluding Bahía
+#    de Banderas which lies in Central Zone); Sinaloa and Sonora.
+# 3- Zona Noroeste (Northwest Zone): Longitude 120 W, includes the
+#    state of Baja California.
+# 4- Zona Sureste (Southeast Zone): Longitude 75 W, includes the state
+#    of Quintana Roo.
+# 5- The islands, reefs and keys shall take their timezone from the
+#    longitude they are located at.
 
 # Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
 Rule	Mexico	1939	only	-	Feb	5	0:00	1:00	D
@@ -2531,13 +2547,8 @@
 ###############################################################################
 
 # Anguilla
-# See America/Port_of_Spain.
-
 # Antigua and Barbuda
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone	America/Antigua	-4:07:12 -	LMT	1912 Mar 2
-			-5:00	-	EST	1951
-			-4:00	-	AST
+# See America/Port_of_Spain.
 
 # Bahamas
 #
@@ -2604,10 +2615,7 @@
 			-4:00	US	A%sT
 
 # Cayman Is
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone	America/Cayman	-5:25:32 -	LMT	1890     # Georgetown
-			-5:07:11 -	KMT	1912 Feb # Kingston Mean Time
-			-5:00	-	EST
+# See America/Panama.
 
 # Costa Rica
 
@@ -3130,6 +3138,7 @@
 Zone	America/Panama	-5:18:08 -	LMT	1890
 			-5:19:36 -	CMT	1908 Apr 22 # Colón Mean Time
 			-5:00	-	EST
+Link America/Panama America/Cayman
 
 # Puerto Rico
 # There are too many San Juans elsewhere, so we'll use 'Puerto_Rico'.
diff --git a/jdk/test/sun/util/calendar/zi/tzdata/southamerica b/jdk/test/sun/util/calendar/zi/tzdata/southamerica
index 02cf121..238ae3d 100644
--- a/jdk/test/sun/util/calendar/zi/tzdata/southamerica
+++ b/jdk/test/sun/util/calendar/zi/tzdata/southamerica
@@ -1229,10 +1229,13 @@
 # DST Start: first Saturday of September 2014 (Sun 07 Sep 2014 04:00 UTC)
 # http://www.diariooficial.interior.gob.cl//media/2014/02/19/do-20140219.pdf
 
-# From Juan Correa (2015-01-28):
-# ... today the Ministry of Energy announced that Chile will drop DST, will keep
-# "summer time" (UTC -3 / UTC -5) all year round....
-# http://www.minenergia.cl/ministerio/noticias/generales/ministerio-de-energia-anuncia.html
+# From Eduardo Romero Urra (2015-03-03):
+# Today has been published officially that Chile will use the DST time
+# permanently until March 25 of 2017
+# http://www.diariooficial.interior.gob.cl/media/2015/03/03/1-large.jpg
+#
+# From Paul Eggert (2015-03-03):
+# For now, assume that the extension will persist indefinitely.
 
 # NOTE: ChileAQ rules for Antarctic bases are stored separately in the
 # 'antarctica' file.
@@ -1291,7 +1294,7 @@
 			-3:00	-	CLT
 Zone Pacific/Easter	-7:17:44 -	LMT	1890
 			-7:17:28 -	EMT	1932 Sep    # Easter Mean Time
-			-7:00	Chile	EAS%sT	1982 Mar 13 3:00u # Easter Time
+			-7:00	Chile	EAS%sT	1982 Mar 14 3:00u # Easter Time
 			-6:00	Chile	EAS%sT	2015 Apr 26 3:00u
 			-5:00	-	EAST
 #
@@ -1626,6 +1629,7 @@
 
 # These all agree with Trinidad and Tobago since 1970.
 Link America/Port_of_Spain America/Anguilla
+Link America/Port_of_Spain America/Antigua
 Link America/Port_of_Spain America/Dominica
 Link America/Port_of_Spain America/Grenada
 Link America/Port_of_Spain America/Guadeloupe
diff --git a/langtools/.hgtags b/langtools/.hgtags
index 39fcbb9..3793d46 100644
--- a/langtools/.hgtags
+++ b/langtools/.hgtags
@@ -300,3 +300,4 @@
 32a2e724988499e6f68611a65168c5f2fde0f6b9 jdk9-b55
 5ee7bba6ef41447f921184e8522da36734aec089 jdk9-b56
 ec977a00cecbf0007b0fa26c7af2852d57a79cad jdk9-b57
+07ce89fec30165a2f1212047bd23b30086ed1e74 jdk9-b58
diff --git a/langtools/make/CompileInterim.gmk b/langtools/make/CompileInterim.gmk
index d3c7827..c957a90 100644
--- a/langtools/make/CompileInterim.gmk
+++ b/langtools/make/CompileInterim.gmk
@@ -43,7 +43,6 @@
       $(LANGTOOLS_TOPDIR)/src/jdk.compiler/share/classes \
       $(LANGTOOLS_TOPDIR)/src/jdk.dev/share/classes \
       $(LANGTOOLS_TOPDIR)/src/jdk.javadoc/share/classes \
-      $(LANGTOOLS_TOPDIR)/src/java.base/share/classes \
       $(SUPPORT_OUTPUTDIR)/gensrc/jdk.compiler \
       $(SUPPORT_OUTPUTDIR)/gensrc/jdk.dev \
       $(SUPPORT_OUTPUTDIR)/gensrc/jdk.javadoc, \
diff --git a/langtools/make/Makefile b/langtools/make/Makefile
deleted file mode 100644
index ce3a333..0000000
--- a/langtools/make/Makefile
+++ /dev/null
@@ -1,49 +0,0 @@
-#
-# Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# This code is free software; you can redistribute it and/or modify it
-# 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.
-#
-
-# Locate this Makefile
-ifeq ($(filter /%, $(lastword $(MAKEFILE_LIST))), )
-  makefile_path := $(CURDIR)/$(lastword $(MAKEFILE_LIST))
-else
-  makefile_path := $(lastword $(MAKEFILE_LIST))
-endif
-repo_dir := $(patsubst %/make/Makefile, %, $(makefile_path))
-
-# What is the name of this subsystem (langtools, corba, etc)?
-subsystem_name := $(notdir $(repo_dir))
-
-# Try to locate top-level makefile
-top_level_makefile := $(repo_dir)/../Makefile
-ifneq ($(wildcard $(top_level_makefile)), )
-  $(info Will run $(subsystem_name) target on top-level Makefile)
-  $(info WARNING: This is a non-recommended way of building!)
-  $(info ===================================================)
-else
-  $(info Cannot locate top-level Makefile. Is this repo not checked out as part of a complete forest?)
-  $(error Build from top-level Makefile instead)
-endif
-
-all:
-	@$(MAKE) -f $(top_level_makefile) $(subsystem_name)
diff --git a/langtools/make/build.properties b/langtools/make/build.properties
index 2a12dbe..dd902e0 100644
--- a/langtools/make/build.properties
+++ b/langtools/make/build.properties
@@ -47,12 +47,11 @@
 boot.javac.target = 8
 
 #configuration of submodules (share by both the bootstrap and normal compilation):
-langtools.modules=java.base:java.compiler:jdk.compiler:jdk.dev:jdk.javadoc
-java.base.dependencies=
-java.compiler.dependencies=java.base
-jdk.compiler.dependencies=java.base:java.compiler
-jdk.javadoc.dependencies=java.base:java.compiler:jdk.compiler
-jdk.dev.dependencies=java.base:java.compiler:jdk.compiler
+langtools.modules=java.compiler:jdk.compiler:jdk.dev:jdk.javadoc
+java.compiler.dependencies=
+jdk.compiler.dependencies=java.compiler
+jdk.javadoc.dependencies=java.compiler:jdk.compiler
+jdk.dev.dependencies=java.compiler:jdk.compiler
 
 javac.resource.includes = \
         com/sun/tools/javac/resources/compiler.properties
diff --git a/langtools/make/build.xml b/langtools/make/build.xml
index bdaae28..e88cf9e 100644
--- a/langtools/make/build.xml
+++ b/langtools/make/build.xml
@@ -254,7 +254,6 @@
             warningsProperty="findbugs.all.warnings"
             jvm="${target.java.home}/bin/java"
             jvmargs="-Xmx512M">
-            <class location="${build.dir}/java.base/classes"/>
             <class location="${build.dir}/java.compiler/classes"/>
             <class location="${build.dir}/jdk.compiler/classes"/>
             <class location="${build.dir}/jdk.javadoc/classes"/>
@@ -461,7 +460,6 @@
         <macrodef name="build-all-module-jars">
             <attribute name="compilation.kind" default=""/>
             <sequential>
-                <build-module-jar module.name="java.base" compilation.kind="@{compilation.kind}" />
                 <build-module-jar module.name="java.compiler" compilation.kind="@{compilation.kind}" />
                 <build-module-jar module.name="jdk.compiler" compilation.kind="@{compilation.kind}" />
                 <build-module-jar module.name="jdk.javadoc" compilation.kind="@{compilation.kind}" />
@@ -522,8 +520,6 @@
         <macrodef name="build-all-module-classes">
             <attribute name="compilation.kind" default=""/>
             <sequential>
-                <build-module-classes module.name="java.base"
-                                      compilation.kind="@{compilation.kind}" />
                 <build-module-classes module.name="java.compiler"
                                       compilation.kind="@{compilation.kind}" />
                 <build-module-classes module.name="jdk.compiler"
diff --git a/langtools/make/intellij/langtools.iml b/langtools/make/intellij/langtools.iml
index 88c815f..9619571 100644
--- a/langtools/make/intellij/langtools.iml
+++ b/langtools/make/intellij/langtools.iml
@@ -4,13 +4,11 @@
     <output url="file://$MODULE_DIR$/build" />
     <output-test url="file://$MODULE_DIR$/build" />
     <content url="file://$MODULE_DIR$">
-      <sourceFolder url="file://$MODULE_DIR$/src/java.base/share/classes" isTestSource="false" />
       <sourceFolder url="file://$MODULE_DIR$/src/java.compiler/share/classes" isTestSource="false" />
       <sourceFolder url="file://$MODULE_DIR$/src/jdk.compiler/share/classes" isTestSource="false" />
       <sourceFolder url="file://$MODULE_DIR$/src/jdk.dev/share/classes" isTestSource="false" />
       <sourceFolder url="file://$MODULE_DIR$/src/jdk.javadoc/share/classes" isTestSource="false" />
       <sourceFolder url="file://$MODULE_DIR$/test" isTestSource="true" />
-      <sourceFolder url="file://$MODULE_DIR$/build/bootstrap/java.base/gensrc" isTestSource="false" />
       <sourceFolder url="file://$MODULE_DIR$/build/bootstrap/java.compiler/gensrc" isTestSource="false" />
       <sourceFolder url="file://$MODULE_DIR$/build/bootstrap/jdk.compiler/gensrc" isTestSource="false" />
       <sourceFolder url="file://$MODULE_DIR$/build/bootstrap/jdk.dev/gensrc" isTestSource="false" />
diff --git a/langtools/make/intellij/workspace.xml b/langtools/make/intellij/workspace.xml
index bff7ec0..135f05a 100644
--- a/langtools/make/intellij/workspace.xml
+++ b/langtools/make/intellij/workspace.xml
@@ -10,7 +10,7 @@
     <!-- standard tools -->
     <configuration default="false" name="javac" type="Application" factoryName="Application">
       <option name="MAIN_CLASS_NAME" value="com.sun.tools.javac.Main" />
-      <option name="VM_PARAMETERS" value="-Xbootclasspath/p:build@FILE_SEP@java.compiler@FILE_SEP@classes@PATH_SEP@build@FILE_SEP@jdk.compiler@FILE_SEP@classes@PATH_SEP@build@FILE_SEP@java.base@FILE_SEP@classes@PATH_SEP@build@FILE_SEP@jdk.javadoc@FILE_SEP@classes@PATH_SEP@build@FILE_SEP@jdk.dev@FILE_SEP@classes" />
+      <option name="VM_PARAMETERS" value="-Xbootclasspath/p:build@FILE_SEP@java.compiler@FILE_SEP@classes@PATH_SEP@build@FILE_SEP@jdk.compiler@FILE_SEP@classes@PATH_SEP@build@FILE_SEP@jdk.javadoc@FILE_SEP@classes@PATH_SEP@build@FILE_SEP@jdk.dev@FILE_SEP@classes" />
       <option name="PROGRAM_PARAMETERS" value="" />
       <option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$" />
       <option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
@@ -29,7 +29,7 @@
     </configuration>
     <configuration default="false" name="javadoc" type="Application" factoryName="Application">
       <option name="MAIN_CLASS_NAME" value="com.sun.tools.javadoc.Main" />
-      <option name="VM_PARAMETERS" value="-Xbootclasspath/p:build@FILE_SEP@java.compiler@FILE_SEP@classes@PATH_SEP@build@FILE_SEP@jdk.compiler@FILE_SEP@classes@PATH_SEP@build@FILE_SEP@java.base@FILE_SEP@classes@PATH_SEP@build@FILE_SEP@jdk.javadoc@FILE_SEP@classes@PATH_SEP@build@FILE_SEP@jdk.dev@FILE_SEP@classes" />
+      <option name="VM_PARAMETERS" value="-Xbootclasspath/p:build@FILE_SEP@java.compiler@FILE_SEP@classes@PATH_SEP@build@FILE_SEP@jdk.compiler@FILE_SEP@classes@PATH_SEP@build@FILE_SEP@jdk.javadoc@FILE_SEP@classes@PATH_SEP@build@FILE_SEP@jdk.dev@FILE_SEP@classes" />
       <option name="PROGRAM_PARAMETERS" value="" />
       <option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$" />
       <option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
@@ -48,7 +48,7 @@
     </configuration>
     <configuration default="false" name="javap" type="Application" factoryName="Application">
       <option name="MAIN_CLASS_NAME" value="com.sun.tools.javap.Main" />
-      <option name="VM_PARAMETERS" value="-Xbootclasspath/p:build@FILE_SEP@java.compiler@FILE_SEP@classes@PATH_SEP@build@FILE_SEP@jdk.compiler@FILE_SEP@classes@PATH_SEP@build@FILE_SEP@java.base@FILE_SEP@classes@PATH_SEP@build@FILE_SEP@jdk.javadoc@FILE_SEP@classes@PATH_SEP@build@FILE_SEP@jdk.dev@FILE_SEP@classes" />
+      <option name="VM_PARAMETERS" value="-Xbootclasspath/p:build@FILE_SEP@java.compiler@FILE_SEP@classes@PATH_SEP@build@FILE_SEP@jdk.compiler@FILE_SEP@classes@PATH_SEP@build@FILE_SEP@jdk.javadoc@FILE_SEP@classes@PATH_SEP@build@FILE_SEP@jdk.dev@FILE_SEP@classes" />
       <option name="PROGRAM_PARAMETERS" value="" />
       <option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$" />
       <option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
@@ -67,7 +67,7 @@
     </configuration>
     <configuration default="false" name="javah" type="Application" factoryName="Application">
       <option name="MAIN_CLASS_NAME" value="com.sun.tools.javah.Main" />
-      <option name="VM_PARAMETERS" value="-Xbootclasspath/p:build@FILE_SEP@java.compiler@FILE_SEP@classes@PATH_SEP@build@FILE_SEP@jdk.compiler@FILE_SEP@classes@PATH_SEP@build@FILE_SEP@java.base@FILE_SEP@classes@PATH_SEP@build@FILE_SEP@jdk.javadoc@FILE_SEP@classes@PATH_SEP@build@FILE_SEP@jdk.dev@FILE_SEP@classes" />
+      <option name="VM_PARAMETERS" value="-Xbootclasspath/p:build@FILE_SEP@java.compiler@FILE_SEP@classes@PATH_SEP@build@FILE_SEP@jdk.compiler@FILE_SEP@classes@PATH_SEP@build@FILE_SEP@jdk.javadoc@FILE_SEP@classes@PATH_SEP@build@FILE_SEP@jdk.dev@FILE_SEP@classes" />
       <option name="PROGRAM_PARAMETERS" value="" />
       <option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$" />
       <option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
@@ -86,7 +86,7 @@
     </configuration>
     <configuration default="false" name="sjavac" type="Application" factoryName="Application">
       <option name="MAIN_CLASS_NAME" value="com.sun.tools.sjavac.Main" />
-      <option name="VM_PARAMETERS" value="-Xbootclasspath/p:build@FILE_SEP@java.compiler@FILE_SEP@classes@PATH_SEP@build@FILE_SEP@jdk.compiler@FILE_SEP@classes@PATH_SEP@build@FILE_SEP@java.base@FILE_SEP@classes@PATH_SEP@build@FILE_SEP@jdk.javadoc@FILE_SEP@classes@PATH_SEP@build@FILE_SEP@jdk.dev@FILE_SEP@classes" />
+      <option name="VM_PARAMETERS" value="-Xbootclasspath/p:build@FILE_SEP@java.compiler@FILE_SEP@classes@PATH_SEP@build@FILE_SEP@jdk.compiler@FILE_SEP@classes@PATH_SEP@build@FILE_SEP@jdk.javadoc@FILE_SEP@classes@PATH_SEP@build@FILE_SEP@jdk.dev@FILE_SEP@classes" />
       <option name="PROGRAM_PARAMETERS" value="" />
       <option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$" />
       <option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
@@ -106,7 +106,7 @@
     <!-- bootstrap javac -->
     <configuration default="false" name="javac (bootstrap)" type="Application" factoryName="Application">
       <option name="MAIN_CLASS_NAME" value="com.sun.tools.javac.Main" />
-      <option name="VM_PARAMETERS" value="-Xbootclasspath/p:build@FILE_SEP@bootstrap@FILE_SEP@java.compiler@FILE_SEP@classes@PATH_SEP@build@FILE_SEP@bootstrap@FILE_SEP@jdk.compiler@FILE_SEP@classes@PATH_SEP@build@FILE_SEP@bootstrap@FILE_SEP@java.base@FILE_SEP@classes@PATH_SEP@build@FILE_SEP@bootstrap@FILE_SEP@jdk.javadoc@FILE_SEP@classes@PATH_SEP@build@FILE_SEP@bootstrap@FILE_SEP@jdk.dev@FILE_SEP@classes" />
+      <option name="VM_PARAMETERS" value="-Xbootclasspath/p:build@FILE_SEP@bootstrap@FILE_SEP@java.compiler@FILE_SEP@classes@PATH_SEP@build@FILE_SEP@bootstrap@FILE_SEP@jdk.compiler@FILE_SEP@classes@PATH_SEP@build@FILE_SEP@bootstrap@FILE_SEP@jdk.javadoc@FILE_SEP@classes@PATH_SEP@build@FILE_SEP@bootstrap@FILE_SEP@jdk.dev@FILE_SEP@classes" />
       <option name="PROGRAM_PARAMETERS" value="" />
       <option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$" />
       <option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
diff --git a/langtools/make/netbeans/langtools/nbproject/project.xml b/langtools/make/netbeans/langtools/nbproject/project.xml
index 806e335..95c39e8 100644
--- a/langtools/make/netbeans/langtools/nbproject/project.xml
+++ b/langtools/make/netbeans/langtools/nbproject/project.xml
@@ -57,11 +57,6 @@
                     <location>${root}/make</location>
                 </source-folder>
                 <source-folder>
-                    <label>Source files - java.base</label>
-                    <type>java</type>
-                    <location>${root}/src/java.base/share/classes</location>
-                </source-folder>
-                <source-folder>
                     <label>Source files - java.compiler</label>
                     <type>java</type>
                     <location>${root}/src/java.compiler/share/classes</location>
@@ -107,19 +102,6 @@
                 </action>
                 <action name="compile.single">
                     <target>compile-single</target>
-                    <property name="module.name">java.base</property>
-                    <context>
-                        <property>includes</property>
-                        <folder>${root}/src/java.base/share/classes</folder>
-                        <pattern>\.java$</pattern>
-                        <format>relative-path</format>
-                        <arity>
-                            <separated-files>,</separated-files>
-                        </arity>
-                    </context>
-                </action>
-                <action name="compile.single">
-                    <target>compile-single</target>
                     <property name="module.name">java.compiler</property>
                     <context>
                         <property>includes</property>
@@ -259,18 +241,6 @@
                     <target>debug-single</target>
                     <context>
                         <property>debug.classname</property>
-                        <folder>${root}/src/java.base/share/classes</folder>
-                        <pattern>\.java$</pattern>
-                        <format>java-name</format>
-                        <arity>
-                            <one-file-only/>
-                        </arity>
-                    </context>
-                </action>
-                <action name="debug.single">
-                    <target>debug-single</target>
-                    <context>
-                        <property>debug.classname</property>
                         <folder>${root}/src/java.compiler/share/classes</folder>
                         <pattern>\.java$</pattern>
                         <format>java-name</format>
@@ -333,19 +303,6 @@
                 </action>
                 <action name="debug.fix">
                     <target>debug-fix</target>
-                    <property name="module.name">java.base</property>
-                    <context>
-                        <property>class</property>
-                        <folder>${root}/src/java.base/share/classes</folder>
-                        <pattern>\.java$</pattern>
-                        <format>relative-path-noext</format>
-                        <arity>
-                            <one-file-only/>
-                        </arity>
-                    </context>
-                </action>
-                <action name="debug.fix">
-                    <target>debug-fix</target>
                     <property name="module.name">java.compiler</property>
                     <context>
                         <property>class</property>
@@ -417,10 +374,6 @@
             <view>
                 <items>
                     <source-folder style="tree">
-                        <label>Source files - java.base</label>
-                        <location>${root}/src/java.base/share/classes</location>
-                    </source-folder>
-                    <source-folder style="tree">
                         <label>Source files - java.compiler</label>
                         <location>${root}/src/java.compiler/share/classes</location>
                     </source-folder>
@@ -477,36 +430,29 @@
         </general-data>
         <java-data xmlns="http://www.netbeans.org/ns/freeform-project-java/4">
             <compilation-unit>
-                <package-root>${root}/src/java.base/share/classes</package-root>
-                <package-root>${root}/build/bootstrap/java.base/gensrc</package-root>
-                <built-to>${root}/build/java.base/classes</built-to>
-                <source-level>1.8</source-level>
-            </compilation-unit>
-            <compilation-unit>
                 <package-root>${root}/src/java.compiler/share/classes</package-root>
                 <package-root>${root}/build/bootstrap/java.compiler/gensrc</package-root>
-                <classpath mode="compile">${root}/build/java.base/classes</classpath>
                 <built-to>${root}/build/java.compiler/classes</built-to>
                 <source-level>1.8</source-level>
             </compilation-unit>
             <compilation-unit>
                 <package-root>${root}/src/jdk.compiler/share/classes</package-root>
                 <package-root>${root}/build/bootstrap/jdk.compiler/gensrc</package-root>
-                <classpath mode="compile">${root}/build/java.base/classes:${root}/build/java.compiler/classes</classpath>
+                <classpath mode="compile">${root}/build/java.compiler/classes</classpath>
                 <built-to>${root}/build/jdk.compiler/classes</built-to>
                 <source-level>1.8</source-level>
             </compilation-unit>
             <compilation-unit>
                 <package-root>${root}/src/jdk.dev/share/classes</package-root>
                 <package-root>${root}/build/bootstrap/jdk.dev/gensrc</package-root>
-                <classpath mode="compile">${root}/build/java.base/classes:${root}/build/java.compiler/classes:${root}/build/jdk.compiler/classes</classpath>
+                <classpath mode="compile">${root}/build/java.compiler/classes:${root}/build/jdk.compiler/classes</classpath>
                 <built-to>${root}/build/jdk.dev/classes</built-to>
                 <source-level>1.8</source-level>
             </compilation-unit>
             <compilation-unit>
                 <package-root>${root}/src/jdk.javadoc/share/classes</package-root>
                 <package-root>${root}/build/bootstrap/jdk.javadoc/gensrc</package-root>
-                <classpath mode="compile">${root}/build/java.base/classes:${root}/build/java.compiler/classes:${root}/build/jdk.compiler/classes</classpath>
+                <classpath mode="compile">${root}/build/java.compiler/classes:${root}/build/jdk.compiler/classes</classpath>
                 <built-to>${root}/build/jdk.javadoc/classes</built-to>
                 <source-level>1.8</source-level>
             </compilation-unit>
diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/api/JavacTaskImpl.java b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/api/JavacTaskImpl.java
index 20dc416..f51b575 100644
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/api/JavacTaskImpl.java
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/api/JavacTaskImpl.java
@@ -40,6 +40,7 @@
 import com.sun.tools.javac.code.*;
 import com.sun.tools.javac.code.Symbol.ClassSymbol;
 import com.sun.tools.javac.comp.*;
+import com.sun.tools.javac.file.BaseFileManager;
 import com.sun.tools.javac.main.*;
 import com.sun.tools.javac.main.JavaCompiler;
 import com.sun.tools.javac.parser.Parser;
diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/api/JavacTool.java b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/api/JavacTool.java
index b7811f5..99b7982 100644
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/api/JavacTool.java
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/api/JavacTool.java
@@ -44,7 +44,7 @@
 import com.sun.tools.javac.file.JavacFileManager;
 import com.sun.tools.javac.main.Arguments;
 import com.sun.tools.javac.main.Option;
-import com.sun.tools.javac.util.BaseFileManager;
+import com.sun.tools.javac.file.BaseFileManager;
 import com.sun.tools.javac.util.ClientCodeException;
 import com.sun.tools.javac.util.Context;
 import com.sun.tools.javac.util.DefinedBy;
diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Kinds.java b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Kinds.java
index c29549a..263d0c5 100644
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Kinds.java
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Kinds.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -66,22 +66,22 @@
         MTH(Category.BASIC, KindName.METHOD, KindSelector.MTH),
         POLY(Category.BASIC, KindSelector.POLY),
         ERR(Category.ERROR, KindSelector.ERR),
-        AMBIGUOUS(Category.OVERLOAD),
-        HIDDEN(Category.OVERLOAD),
-        STATICERR(Category.OVERLOAD),
-        MISSING_ENCL(Category.OVERLOAD),
-        ABSENT_VAR(Category.OVERLOAD, KindName.VAR),
-        WRONG_MTHS(Category.OVERLOAD, KindName.METHOD),
-        WRONG_MTH(Category.OVERLOAD, KindName.METHOD),
-        ABSENT_MTH(Category.OVERLOAD, KindName.METHOD),
-        ABSENT_TYP(Category.OVERLOAD, KindName.CLASS);
+        AMBIGUOUS(Category.RESOLUTION_TARGET),                         // overloaded       target
+        HIDDEN(Category.RESOLUTION_TARGET),                            // not overloaded   non-target
+        STATICERR(Category.RESOLUTION_TARGET),                         // overloaded?      target
+        MISSING_ENCL(Category.RESOLUTION),                             // not overloaded   non-target
+        ABSENT_VAR(Category.RESOLUTION_TARGET, KindName.VAR),          // not overloaded   non-target
+        WRONG_MTHS(Category.RESOLUTION_TARGET, KindName.METHOD),       // overloaded       target
+        WRONG_MTH(Category.RESOLUTION_TARGET, KindName.METHOD),        // not overloaded   target
+        ABSENT_MTH(Category.RESOLUTION_TARGET, KindName.METHOD),       // not overloaded   non-target
+        ABSENT_TYP(Category.RESOLUTION_TARGET, KindName.CLASS);        // not overloaded   non-target
 
         // There are essentially two "levels" to the Kind datatype.
         // The first is a totally-ordered set of categories of
         // solutions.  Within each category, we have more
         // possibilities.
         private enum Category {
-            BASIC, ERROR, OVERLOAD;
+            BASIC, ERROR, RESOLUTION, RESOLUTION_TARGET;
         }
 
         private final KindName kindName;
@@ -127,8 +127,12 @@
             return selector.contains(kindSelectors);
         }
 
-        public boolean isOverloadError() {
-            return category == Category.OVERLOAD;
+        public boolean isResolutionError() {
+            return category == Category.RESOLUTION || category == Category.RESOLUTION_TARGET;
+        }
+
+        public boolean isResolutionTargetError() {
+            return category == Category.RESOLUTION_TARGET;
         }
 
         public boolean isValid() {
diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Source.java b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Source.java
index 5f2dd39..6870123 100644
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Source.java
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Source.java
@@ -209,6 +209,9 @@
     public boolean allowPrivateSafeVarargs() {
         return compareTo(JDK1_9) >= 0;
     }
+    public boolean allowDiamondWithAnonymousClassCreation() {
+        return compareTo(JDK1_9) >= 0;
+    }
     public boolean allowUnderscoreIdentifier() {
         return compareTo(JDK1_8) <= 0;
     }
diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Analyzer.java b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Analyzer.java
index 1eb1ab4..f597577 100644
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Analyzer.java
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Analyzer.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -90,6 +90,7 @@
     final DeferredAttr deferredAttr;
     final TreeMaker make;
     final Names names;
+    private final boolean allowDiamondWithAnonymousClassCreation;
 
     final EnumSet<AnalyzerMode> analyzerModes;
 
@@ -112,6 +113,7 @@
         String findOpt = options.get("find");
         //parse modes
         Source source = Source.instance(context);
+        allowDiamondWithAnonymousClassCreation = source.allowDiamondWithAnonymousClassCreation();
         analyzerModes = AnalyzerMode.getAnalyzerModes(findOpt, source);
     }
 
@@ -210,7 +212,7 @@
         boolean match(JCNewClass tree) {
             return tree.clazz.hasTag(TYPEAPPLY) &&
                     !TreeInfo.isDiamond(tree) &&
-                    tree.def == null;
+                    (tree.def == null || allowDiamondWithAnonymousClassCreation);
         }
 
         @Override
diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Attr.java b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Attr.java
index c3b467d..36a9c6b 100644
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Attr.java
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Attr.java
@@ -46,6 +46,10 @@
 import com.sun.tools.javac.comp.Infer.InferenceContext;
 import com.sun.tools.javac.comp.Infer.FreeTypeListener;
 import com.sun.tools.javac.jvm.*;
+import static com.sun.tools.javac.resources.CompilerProperties.Fragments.Diamond;
+import static com.sun.tools.javac.resources.CompilerProperties.Fragments.DiamondInvalidArg;
+import static com.sun.tools.javac.resources.CompilerProperties.Fragments.DiamondInvalidArgs;
+import com.sun.tools.javac.resources.CompilerProperties.Errors;
 import com.sun.tools.javac.resources.CompilerProperties.Fragments;
 import com.sun.tools.javac.tree.*;
 import com.sun.tools.javac.tree.JCTree.*;
@@ -54,6 +58,7 @@
 import com.sun.tools.javac.util.DefinedBy.Api;
 import com.sun.tools.javac.util.Dependencies.AttributionKind;
 import com.sun.tools.javac.util.JCDiagnostic.DiagnosticPosition;
+import com.sun.tools.javac.util.JCDiagnostic.Fragment;
 import com.sun.tools.javac.util.List;
 import static com.sun.tools.javac.code.Flags.*;
 import static com.sun.tools.javac.code.Flags.ANNOTATION;
@@ -219,6 +224,26 @@
                final Type found,
                final KindSelector ownkind,
                final ResultInfo resultInfo) {
+        return check(tree, found, ownkind, resultInfo, true);
+    }
+    /** Check kind and type of given tree against protokind and prototype.
+     *  If check succeeds, store type in tree and return it.
+     *  If check fails, store errType in tree and return it.
+     *  No checks are performed if the prototype is a method type.
+     *  It is not necessary in this case since we know that kind and type
+     *  are correct.
+     *
+     *  @param tree     The tree whose kind and type is checked
+     *  @param found    The computed type of the tree
+     *  @param ownkind  The computed kind of the tree
+     *  @param resultInfo  The expected result of the tree
+     *  @param recheckPostInference If true and inference is underway, arrange to recheck the tree after inference finishes.
+     */
+    Type check(final JCTree tree,
+               final Type found,
+               final KindSelector ownkind,
+               final ResultInfo resultInfo,
+               boolean recheckPostInference) {
         InferenceContext inferenceContext = resultInfo.checkContext.inferenceContext();
         Type owntype;
         boolean shouldCheck = !found.hasTag(ERROR) &&
@@ -233,12 +258,14 @@
             //delay the check if there are inference variables in the found type
             //this means we are dealing with a partially inferred poly expression
             owntype = shouldCheck ? resultInfo.pt : found;
-            inferenceContext.addFreeTypeListener(List.of(found, resultInfo.pt),
-                    instantiatedContext -> {
-                        ResultInfo pendingResult =
-                                resultInfo.dup(inferenceContext.asInstType(resultInfo.pt));
-                        check(tree, inferenceContext.asInstType(found), ownkind, pendingResult);
-                    });
+            if (recheckPostInference) {
+                inferenceContext.addFreeTypeListener(List.of(found, resultInfo.pt),
+                        instantiatedContext -> {
+                            ResultInfo pendingResult =
+                                    resultInfo.dup(inferenceContext.asInstType(resultInfo.pt));
+                            check(tree, inferenceContext.asInstType(found), ownkind, pendingResult, false);
+                        });
+            }
         } else {
             owntype = shouldCheck ?
             resultInfo.check(tree, found) :
@@ -862,7 +889,7 @@
             } else {
                 chk.checkOverrideClashes(tree.pos(), env.enclClass.type, m);
             }
-            chk.checkOverride(tree, m);
+            chk.checkOverride(env, tree, m);
 
             if (isDefaultMethod && types.overridesObjectMethod(m.enclClass(), m)) {
                 log.error(tree, "default.overrides.object.member", m.name, Kinds.kindName(m.location()), m.location());
@@ -1969,11 +1996,16 @@
                  (((JCVariableDecl) env.tree).mods.flags & Flags.ENUM) == 0 ||
                  ((JCVariableDecl) env.tree).init != tree))
                 log.error(tree.pos(), "enum.cant.be.instantiated");
+
+            boolean isSpeculativeDiamondInferenceRound = TreeInfo.isDiamond(tree) &&
+                    resultInfo.checkContext.deferredAttrContext().mode == DeferredAttr.AttrMode.SPECULATIVE;
+            boolean skipNonDiamondPath = false;
             // Check that class is not abstract
-            if (cdef == null &&
+            if (cdef == null && !isSpeculativeDiamondInferenceRound && // class body may be nulled out in speculative tree copy
                 (clazztype.tsym.flags() & (ABSTRACT | INTERFACE)) != 0) {
                 log.error(tree.pos(), "abstract.cant.be.instantiated",
                           clazztype.tsym);
+                skipNonDiamondPath = true;
             } else if (cdef != null && clazztype.tsym.isInterface()) {
                 // Check that no constructor arguments are given to
                 // anonymous classes implementing an interface
@@ -1986,7 +2018,9 @@
                 // Error recovery: pretend no arguments were supplied.
                 argtypes = List.nil();
                 typeargtypes = List.nil();
-            } else if (TreeInfo.isDiamond(tree)) {
+                skipNonDiamondPath = true;
+            }
+            if (TreeInfo.isDiamond(tree)) {
                 ClassType site = new ClassType(clazztype.getEnclosingType(),
                             clazztype.tsym.type.getTypeArguments(),
                                                clazztype.tsym,
@@ -2022,7 +2056,7 @@
 
                 tree.clazz.type = types.createErrorType(clazztype);
                 if (!constructorType.isErroneous()) {
-                    tree.clazz.type = clazztype = constructorType.getReturnType();
+                    tree.clazz.type = clazz.type = constructorType.getReturnType();
                     tree.constructorType = types.createMethodTypeWithReturn(constructorType, syms.voidType);
                 }
                 clazztype = chk.checkClassType(tree.clazz, tree.clazz.type, true);
@@ -2031,7 +2065,7 @@
             // Resolve the called constructor under the assumption
             // that we are referring to a superclass instance of the
             // current instance (JLS ???).
-            else {
+            else if (!skipNonDiamondPath) {
                 //the following code alters some of the fields in the current
                 //AttrContext - hence, the current context must be dup'ed in
                 //order to avoid downstream failures
@@ -2052,70 +2086,8 @@
             }
 
             if (cdef != null) {
-                // We are seeing an anonymous class instance creation.
-                // In this case, the class instance creation
-                // expression
-                //
-                //    E.new <typeargs1>C<typargs2>(args) { ... }
-                //
-                // is represented internally as
-                //
-                //    E . new <typeargs1>C<typargs2>(args) ( class <empty-name> { ... } )  .
-                //
-                // This expression is then *transformed* as follows:
-                //
-                // (1) add an extends or implements clause
-                // (2) add a constructor.
-                //
-                // For instance, if C is a class, and ET is the type of E,
-                // the expression
-                //
-                //    E.new <typeargs1>C<typargs2>(args) { ... }
-                //
-                // is translated to (where X is a fresh name and typarams is the
-                // parameter list of the super constructor):
-                //
-                //   new <typeargs1>X(<*nullchk*>E, args) where
-                //     X extends C<typargs2> {
-                //       <typarams> X(ET e, args) {
-                //         e.<typeargs1>super(args)
-                //       }
-                //       ...
-                //     }
-
-                if (clazztype.tsym.isInterface()) {
-                    cdef.implementing = List.of(clazz);
-                } else {
-                    cdef.extending = clazz;
-                }
-
-                if (resultInfo.checkContext.deferredAttrContext().mode == DeferredAttr.AttrMode.CHECK &&
-                    isSerializable(clazztype)) {
-                    localEnv.info.isSerializable = true;
-                }
-
-                attribStat(cdef, localEnv);
-
-                // If an outer instance is given,
-                // prefix it to the constructor arguments
-                // and delete it from the new expression
-                if (tree.encl != null && !clazztype.tsym.isInterface()) {
-                    tree.args = tree.args.prepend(makeNullCheck(tree.encl));
-                    argtypes = argtypes.prepend(tree.encl.type);
-                    tree.encl = null;
-                }
-
-                // Reassign clazztype and recompute constructor.
-                clazztype = cdef.sym.type;
-                Symbol sym = tree.constructor = rs.resolveConstructor(
-                    tree.pos(), localEnv, clazztype, argtypes, typeargtypes);
-                Assert.check(!sym.kind.isOverloadError());
-                tree.constructor = sym;
-                tree.constructorType = checkId(noCheckTree,
-                    clazztype,
-                    tree.constructor,
-                    localEnv,
-                    new ResultInfo(pkind, newMethodTemplate(syms.voidType, argtypes, typeargtypes)));
+                visitAnonymousClassDefinition(tree, clazz, clazztype, cdef, localEnv, argtypes, typeargtypes, pkind);
+                return;
             }
 
             if (tree.constructor != null && tree.constructor.kind == MTH)
@@ -2133,6 +2105,125 @@
         chk.validate(tree.typeargs, localEnv);
     }
 
+        // where
+        private void visitAnonymousClassDefinition(JCNewClass tree, JCExpression clazz, Type clazztype,
+                                                   JCClassDecl cdef, Env<AttrContext> localEnv,
+                                                   List<Type> argtypes, List<Type> typeargtypes,
+                                                   KindSelector pkind) {
+            // We are seeing an anonymous class instance creation.
+            // In this case, the class instance creation
+            // expression
+            //
+            //    E.new <typeargs1>C<typargs2>(args) { ... }
+            //
+            // is represented internally as
+            //
+            //    E . new <typeargs1>C<typargs2>(args) ( class <empty-name> { ... } )  .
+            //
+            // This expression is then *transformed* as follows:
+            //
+            // (1) add an extends or implements clause
+            // (2) add a constructor.
+            //
+            // For instance, if C is a class, and ET is the type of E,
+            // the expression
+            //
+            //    E.new <typeargs1>C<typargs2>(args) { ... }
+            //
+            // is translated to (where X is a fresh name and typarams is the
+            // parameter list of the super constructor):
+            //
+            //   new <typeargs1>X(<*nullchk*>E, args) where
+            //     X extends C<typargs2> {
+            //       <typarams> X(ET e, args) {
+            //         e.<typeargs1>super(args)
+            //       }
+            //       ...
+            //     }
+            InferenceContext inferenceContext = resultInfo.checkContext.inferenceContext();
+            final boolean isDiamond = TreeInfo.isDiamond(tree);
+            if (isDiamond
+                    && ((tree.constructorType != null && inferenceContext.free(tree.constructorType))
+                    || (tree.clazz.type != null && inferenceContext.free(tree.clazz.type)))) {
+                inferenceContext.addFreeTypeListener(List.of(tree.constructorType, tree.clazz.type),
+                        instantiatedContext -> {
+                            tree.constructorType = instantiatedContext.asInstType(tree.constructorType);
+                            clazz.type = instantiatedContext.asInstType(clazz.type);
+                            visitAnonymousClassDefinition(tree, clazz, clazz.type, cdef, localEnv, argtypes, typeargtypes, pkind);
+                        });
+            } else {
+                if (isDiamond && clazztype.hasTag(CLASS)) {
+                    List<Type> invalidDiamondArgs = chk.checkDiamondDenotable((ClassType)clazztype);
+                    if (!clazztype.isErroneous() && invalidDiamondArgs.nonEmpty()) {
+                        // One or more types inferred in the previous steps is non-denotable.
+                        Fragment fragment = Diamond(clazztype.tsym);
+                        log.error(tree.clazz.pos(),
+                                Errors.CantApplyDiamond1(
+                                        fragment,
+                                        invalidDiamondArgs.size() > 1 ?
+                                                DiamondInvalidArgs(invalidDiamondArgs, fragment) :
+                                                DiamondInvalidArg(invalidDiamondArgs, fragment)));
+                    }
+                    // For <>(){}, inferred types must also be accessible.
+                    for (Type t : clazztype.getTypeArguments()) {
+                        rs.checkAccessibleType(env, t);
+                    }
+                }
+
+                // If we already errored, be careful to avoid a further avalanche. ErrorType answers
+                // false for isInterface call even when the original type is an interface.
+                boolean implementing = clazztype.tsym.isInterface() ||
+                        clazztype.isErroneous() && clazztype.getOriginalType().tsym.isInterface();
+
+                if (implementing) {
+                    cdef.implementing = List.of(clazz);
+                } else {
+                    cdef.extending = clazz;
+                }
+
+                if (resultInfo.checkContext.deferredAttrContext().mode == DeferredAttr.AttrMode.CHECK &&
+                    isSerializable(clazztype)) {
+                    localEnv.info.isSerializable = true;
+                }
+
+                attribStat(cdef, localEnv);
+
+                List<Type> finalargtypes;
+                // If an outer instance is given,
+                // prefix it to the constructor arguments
+                // and delete it from the new expression
+                if (tree.encl != null && !clazztype.tsym.isInterface()) {
+                    tree.args = tree.args.prepend(makeNullCheck(tree.encl));
+                    finalargtypes = argtypes.prepend(tree.encl.type);
+                    tree.encl = null;
+                } else {
+                    finalargtypes = argtypes;
+                }
+
+                // Reassign clazztype and recompute constructor. As this necessarily involves
+                // another attribution pass for deferred types in the case of <>, replicate
+                // them. Original arguments have right decorations already.
+                if (isDiamond && pkind.contains(KindSelector.POLY)) {
+                    finalargtypes = finalargtypes.map(deferredAttr.deferredCopier);
+                }
+
+                clazztype = cdef.sym.type;
+                Symbol sym = tree.constructor = rs.resolveConstructor(
+                        tree.pos(), localEnv, clazztype, finalargtypes, typeargtypes);
+                Assert.check(!sym.kind.isResolutionError());
+                tree.constructor = sym;
+                tree.constructorType = checkId(noCheckTree,
+                        clazztype,
+                        tree.constructor,
+                        localEnv,
+                        new ResultInfo(pkind, newMethodTemplate(syms.voidType, finalargtypes, typeargtypes)));
+            }
+            Type owntype = (tree.constructor != null && tree.constructor.kind == MTH) ?
+                                clazztype : types.createErrorType(tree.type);
+            result = check(tree, owntype, KindSelector.VAL, resultInfo, false);
+            chk.validate(tree.typeargs, localEnv);
+        }
+
     /** Make an attributed null check tree.
      */
     public JCExpression makeNullCheck(JCExpression arg) {
@@ -2647,17 +2738,20 @@
             Symbol refSym = refResult.fst;
             Resolve.ReferenceLookupHelper lookupHelper = refResult.snd;
 
+            /** this switch will need to go away and be replaced by the new RESOLUTION_TARGET testing
+             *  JDK-8075541
+             */
             if (refSym.kind != MTH) {
                 boolean targetError;
                 switch (refSym.kind) {
                     case ABSENT_MTH:
+                    case MISSING_ENCL:
                         targetError = false;
                         break;
                     case WRONG_MTH:
                     case WRONG_MTHS:
                     case AMBIGUOUS:
                     case HIDDEN:
-                    case MISSING_ENCL:
                     case STATICERR:
                         targetError = true;
                         break;
diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/AttrContext.java b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/AttrContext.java
index db812ff..84d4a53 100644
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/AttrContext.java
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/AttrContext.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -63,6 +63,11 @@
      */
     boolean isSpeculative = false;
 
+    /**
+     *  Is this an attribution environment for an anonymous class instantiated using <> ?
+     */
+    boolean isAnonymousDiamond = false;
+
     /** Are arguments to current function applications boxed into an array for varargs?
      */
     Resolve.MethodResolutionPhase pendingResolutionPhase = null;
@@ -100,6 +105,7 @@
         info.defaultSuperCallSite = defaultSuperCallSite;
         info.isSerializable = isSerializable;
         info.isSpeculative = isSpeculative;
+        info.isAnonymousDiamond = isAnonymousDiamond;
         return info;
     }
 
diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Check.java b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Check.java
index b2af981..2f74ea4 100644
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Check.java
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Check.java
@@ -32,6 +32,8 @@
 import com.sun.tools.javac.code.*;
 import com.sun.tools.javac.code.Attribute.Compound;
 import com.sun.tools.javac.jvm.*;
+import com.sun.tools.javac.resources.CompilerProperties.Errors;
+import com.sun.tools.javac.resources.CompilerProperties.Fragments;
 import com.sun.tools.javac.tree.*;
 import com.sun.tools.javac.util.*;
 import com.sun.tools.javac.util.JCDiagnostic.DiagnosticPosition;
@@ -84,6 +86,7 @@
     private boolean suppressAbortOnBadClassFile;
     private boolean enableSunApiLintControl;
     private final JavaFileManager fileManager;
+    private final Source source;
     private final Profile profile;
     private final boolean warnOnAccessToSensitiveMembers;
 
@@ -122,11 +125,12 @@
         lint = Lint.instance(context);
         fileManager = context.get(JavaFileManager.class);
 
-        Source source = Source.instance(context);
+        source = Source.instance(context);
         allowSimplifiedVarargs = source.allowSimplifiedVarargs();
         allowDefaultMethods = source.allowDefaultMethods();
         allowStrictMethodClashCheck = source.allowStrictMethodClashCheck();
         allowPrivateSafeVarargs = source.allowPrivateSafeVarargs();
+        allowDiamondWithAnonymousClassCreation = source.allowDiamondWithAnonymousClassCreation();
         complexInference = options.isSet("complexinference");
         warnOnSyntheticConflicts = options.isSet("warnOnSyntheticConflicts");
         suppressAbortOnBadClassFile = options.isSet("suppressAbortOnBadClassFile");
@@ -169,6 +173,10 @@
      */
     boolean allowPrivateSafeVarargs;
 
+    /** Switch: can diamond inference be used in anonymous instance creation ?
+     */
+    boolean allowDiamondWithAnonymousClassCreation;
+
     /** Switch: -complexinference option set?
      */
     boolean complexInference;
@@ -773,10 +781,9 @@
         if (!TreeInfo.isDiamond(tree) ||
                 t.isErroneous()) {
             return checkClassType(tree.clazz.pos(), t, true);
-        } else if (tree.def != null) {
+        } else if (tree.def != null && !allowDiamondWithAnonymousClassCreation) {
             log.error(tree.clazz.pos(),
-                    "cant.apply.diamond.1",
-                    t, diags.fragment("diamond.and.anon.class", t));
+                    Errors.CantApplyDiamond1(t, Fragments.DiamondAndAnonClassNotSupportedInSource(source.name)));
             return types.createErrorType(t);
         } else if (t.tsym.type.getTypeArguments().isEmpty()) {
             log.error(tree.clazz.pos(),
@@ -794,6 +801,59 @@
         }
     }
 
+    /** Check that the type inferred using the diamond operator does not contain
+     *  non-denotable types such as captured types or intersection types.
+     *  @param t the type inferred using the diamond operator
+     *  @return  the (possibly empty) list of non-denotable types.
+     */
+    List<Type> checkDiamondDenotable(ClassType t) {
+        ListBuffer<Type> buf = new ListBuffer<>();
+        for (Type arg : t.getTypeArguments()) {
+            if (!diamondTypeChecker.visit(arg, null)) {
+                buf.append(arg);
+            }
+        }
+        return buf.toList();
+    }
+        // where
+
+        /** diamondTypeChecker: A type visitor that descends down the given type looking for non-denotable
+         *  types. The visit methods return false as soon as a non-denotable type is encountered and true
+         *  otherwise.
+         */
+        private static final Types.SimpleVisitor<Boolean, Void> diamondTypeChecker = new Types.SimpleVisitor<Boolean, Void>() {
+            @Override
+            public Boolean visitType(Type t, Void s) {
+                return true;
+            }
+            @Override
+            public Boolean visitClassType(ClassType t, Void s) {
+                if (t.isCompound()) {
+                    return false;
+                }
+                for (Type targ : t.getTypeArguments()) {
+                    if (!visit(targ, s)) {
+                        return false;
+                    }
+                }
+                return true;
+            }
+            @Override
+            public Boolean visitCapturedType(CapturedType t, Void s) {
+                return false;
+            }
+
+            @Override
+            public Boolean visitArrayType(ArrayType t, Void s) {
+                return visit(t.elemtype, s);
+            }
+
+            @Override
+            public Boolean visitWildcardType(WildcardType t, Void s) {
+                return visit(t.type, s);
+            }
+        };
+
     void checkVarargsMethodDecl(Env<AttrContext> env, JCMethodDecl tree) {
         MethodSymbol m = tree.sym;
         if (!allowSimplifiedVarargs) return;
@@ -1917,7 +1977,7 @@
      *                      for errors.
      *  @param m            The overriding method.
      */
-    void checkOverride(JCMethodDecl tree, MethodSymbol m) {
+    void checkOverride(Env<AttrContext> env, JCMethodDecl tree, MethodSymbol m) {
         ClassSymbol origin = (ClassSymbol)m.owner;
         if ((origin.flags() & ENUM) != 0 && names.finalize.equals(m.name))
             if (m.overrides(syms.enumFinalFinalize, origin, types, false)) {
@@ -1934,7 +1994,12 @@
             }
         }
 
-        if (m.attribute(syms.overrideType.tsym) != null && !isOverrider(m)) {
+        // Check if this method must override a super method due to being annotated with @Override
+        // or by virtue of being a member of a diamond inferred anonymous class. Latter case is to
+        // be treated "as if as they were annotated" with @Override.
+        boolean mustOverride = m.attribute(syms.overrideType.tsym) != null ||
+                (env.info.isAnonymousDiamond && !m.isConstructor() && !m.isPrivate());
+        if (mustOverride && !isOverrider(m)) {
             DiagnosticPosition pos = tree.pos();
             for (JCAnnotation a : tree.getModifiers().annotations) {
                 if (a.annotationType.type.tsym == syms.overrideType.tsym) {
diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/DeferredAttr.java b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/DeferredAttr.java
index 8a71561..9cb73b3 100644
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/DeferredAttr.java
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/DeferredAttr.java
@@ -26,6 +26,7 @@
 package com.sun.tools.javac.comp;
 
 import com.sun.source.tree.LambdaExpressionTree.BodyKind;
+import com.sun.source.tree.NewClassTree;
 import com.sun.tools.javac.code.*;
 import com.sun.tools.javac.code.Type.TypeMapping;
 import com.sun.tools.javac.comp.Resolve.ResolveError;
@@ -81,6 +82,8 @@
     final Log log;
     final Symtab syms;
     final TreeMaker make;
+    final TreeCopier<Void> treeCopier;
+    final TypeMapping<Void> deferredCopier;
     final Types types;
     final Flow flow;
     final Names names;
@@ -125,6 +128,35 @@
                     return "Empty deferred context!";
                 }
             };
+
+        // For speculative attribution, skip the class definition in <>.
+        treeCopier =
+            new TreeCopier<Void>(make) {
+                @Override @DefinedBy(Api.COMPILER_TREE)
+                public JCTree visitNewClass(NewClassTree node, Void p) {
+                    JCNewClass t = (JCNewClass) node;
+                    if (TreeInfo.isDiamond(t)) {
+                        JCExpression encl = copy(t.encl, p);
+                        List<JCExpression> typeargs = copy(t.typeargs, p);
+                        JCExpression clazz = copy(t.clazz, p);
+                        List<JCExpression> args = copy(t.args, p);
+                        JCClassDecl def = null;
+                        return make.at(t.pos).NewClass(encl, typeargs, clazz, args, def);
+                    } else {
+                        return super.visitNewClass(node, p);
+                    }
+                }
+            };
+        deferredCopier = new TypeMapping<Void> () {
+                @Override
+                public Type visitType(Type t, Void v) {
+                    if (t.hasTag(DEFERRED)) {
+                        DeferredType dt = (DeferredType) t;
+                        return new DeferredType(treeCopier.copy(dt.tree), dt.env);
+                    }
+                    return t;
+                }
+            };
     }
 
     /** shared tree for stuck expressions */
@@ -364,7 +396,7 @@
      * disabled during speculative type-checking.
      */
     JCTree attribSpeculative(JCTree tree, Env<AttrContext> env, ResultInfo resultInfo) {
-        return attribSpeculative(tree, env, resultInfo, new TreeCopier<>(make),
+        return attribSpeculative(tree, env, resultInfo, treeCopier,
                 (newTree)->new DeferredAttrDiagHandler(log, newTree));
     }
 
@@ -1209,8 +1241,8 @@
                     rs.getMemberReference(tree, localEnv, mref2,
                         exprTree.type, tree.name);
             tree.sym = res;
-            if (res.kind.isOverloadError() ||
-                    res.type.hasTag(FORALL) ||
+            if (res.kind.isResolutionTargetError() ||
+                    res.type != null && res.type.hasTag(FORALL) ||
                     (res.flags() & Flags.VARARGS) != 0 ||
                     (TreeInfo.isStaticSelector(exprTree, tree.name.table.names) &&
                     exprTree.type.isRaw())) {
diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Enter.java b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Enter.java
index d8abe3b..177dbf8 100644
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Enter.java
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Enter.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -192,6 +192,7 @@
         localEnv.info.isSelfCall = false;
         localEnv.info.lint = null; // leave this to be filled in by Attr,
                                    // when annotations have been processed
+        localEnv.info.isAnonymousDiamond = TreeInfo.isDiamond(env.tree);
         return localEnv;
     }
 
diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/LambdaToMethod.java b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/LambdaToMethod.java
index 933950c..1b0b7d1 100644
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/LambdaToMethod.java
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/LambdaToMethod.java
@@ -1885,7 +1885,7 @@
              * Translate a symbol of a given kind into something suitable for the
              * synthetic lambda body
              */
-            Symbol translate(Name name, final Symbol sym, LambdaSymbolKind skind) {
+            Symbol translate(final Symbol sym, LambdaSymbolKind skind) {
                 Symbol ret;
                 switch (skind) {
                     case CAPTURED_THIS:
@@ -1893,7 +1893,7 @@
                         break;
                     case TYPE_VAR:
                         // Just erase the type var
-                        ret = new VarSymbol(sym.flags(), name,
+                        ret = new VarSymbol(sym.flags(), sym.name,
                                 types.erasure(sym.type), sym.owner);
 
                         /* this information should also be kept for LVT generation at Gen
@@ -1902,7 +1902,7 @@
                         ((VarSymbol)ret).pos = ((VarSymbol)sym).pos;
                         break;
                     case CAPTURED_VAR:
-                        ret = new VarSymbol(SYNTHETIC | FINAL | PARAMETER, name, types.erasure(sym.type), translatedSym) {
+                        ret = new VarSymbol(SYNTHETIC | FINAL | PARAMETER, sym.name, types.erasure(sym.type), translatedSym) {
                             @Override
                             public Symbol baseSymbol() {
                                 //keep mapping with original captured symbol
@@ -1911,16 +1911,16 @@
                         };
                         break;
                     case LOCAL_VAR:
-                        ret = new VarSymbol(sym.flags() & FINAL, name, sym.type, translatedSym);
+                        ret = new VarSymbol(sym.flags() & FINAL, sym.name, sym.type, translatedSym);
                         ((VarSymbol) ret).pos = ((VarSymbol) sym).pos;
                         break;
                     case PARAM:
-                        ret = new VarSymbol((sym.flags() & FINAL) | PARAMETER, name, types.erasure(sym.type), translatedSym);
+                        ret = new VarSymbol((sym.flags() & FINAL) | PARAMETER, sym.name, types.erasure(sym.type), translatedSym);
                         ((VarSymbol) ret).pos = ((VarSymbol) sym).pos;
                         break;
                     default:
-                        ret = makeSyntheticVar(FINAL, name, types.erasure(sym.type), translatedSym);
-                        ((VarSymbol) ret).pos = ((VarSymbol) sym).pos;
+                        Assert.error(skind.name());
+                        throw new AssertionError();
                 }
                 if (ret != sym) {
                     ret.setDeclarationAttributes(sym.getRawAttributes());
@@ -1931,27 +1931,8 @@
 
             void addSymbol(Symbol sym, LambdaSymbolKind skind) {
                 Map<Symbol, Symbol> transMap = getSymbolMap(skind);
-                Name preferredName;
-                switch (skind) {
-                    case CAPTURED_THIS:
-                        preferredName = names.fromString("encl$" + transMap.size());
-                        break;
-                    case CAPTURED_VAR:
-                        preferredName = names.fromString("cap$" + transMap.size());
-                        break;
-                    case LOCAL_VAR:
-                        preferredName = sym.name;
-                        break;
-                    case PARAM:
-                        preferredName = sym.name;
-                        break;
-                    case TYPE_VAR:
-                        preferredName = sym.name;
-                        break;
-                    default: throw new AssertionError();
-                }
                 if (!transMap.containsKey(sym)) {
-                    transMap.put(sym, translate(preferredName, sym, skind));
+                    transMap.put(sym, translate(sym, skind));
                 }
             }
 
diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Resolve.java b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Resolve.java
index 5e1fb9e..ba0e01d 100644
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Resolve.java
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Resolve.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -194,7 +194,7 @@
 
     void reportVerboseResolutionDiagnostic(DiagnosticPosition dpos, Name name, Type site,
             List<Type> argtypes, List<Type> typeargtypes, Symbol bestSoFar) {
-        boolean success = !bestSoFar.kind.isOverloadError();
+        boolean success = !bestSoFar.kind.isResolutionError();
 
         if (success && !verboseResolutionMode.contains(VerboseResolutionMode.SUCCESS)) {
             return;
@@ -1389,7 +1389,7 @@
                 if (currentSymbol.kind != VAR)
                     continue;
                 // invariant: sym.kind == Symbol.Kind.VAR
-                if (!bestSoFar.kind.isOverloadError() &&
+                if (!bestSoFar.kind.isResolutionError() &&
                     currentSymbol.owner != bestSoFar.owner)
                     return new AmbiguityError(bestSoFar, currentSymbol);
                 else if (!bestSoFar.kind.betterThan(VAR)) {
@@ -1432,11 +1432,11 @@
                 !sym.isInheritedIn(site.tsym, types)) {
             return bestSoFar;
         } else if (useVarargs && (sym.flags() & VARARGS) == 0) {
-            return bestSoFar.kind.isOverloadError() ?
+            return bestSoFar.kind.isResolutionError() ?
                     new BadVarargsMethod((ResolveError)bestSoFar.baseSymbol()) :
                     bestSoFar;
         }
-        Assert.check(!sym.kind.isOverloadError());
+        Assert.check(!sym.kind.isResolutionError());
         try {
             Type mt = rawInstantiate(env, site, sym, null, argtypes, typeargtypes,
                                allowBoxing, useVarargs, types.noWarnings);
@@ -1457,7 +1457,7 @@
                 ? new AccessError(env, site, sym)
                 : bestSoFar;
         }
-        return (bestSoFar.kind.isOverloadError() && bestSoFar.kind != AMBIGUOUS)
+        return (bestSoFar.kind.isResolutionError() && bestSoFar.kind != AMBIGUOUS)
             ? sym
             : mostSpecific(argtypes, sym, bestSoFar, env, site, useVarargs);
     }
@@ -1939,8 +1939,8 @@
              bestSoFar.kind != AMBIGUOUS && l.nonEmpty();
              l = l.tail) {
             sym = findMemberType(env, site, name, l.head.tsym);
-            if (!bestSoFar.kind.isOverloadError() &&
-                !sym.kind.isOverloadError() &&
+            if (!bestSoFar.kind.isResolutionError() &&
+                !sym.kind.isResolutionError() &&
                 sym.owner != bestSoFar.owner)
                 bestSoFar = new AmbiguityError(bestSoFar, sym);
             else
@@ -2176,7 +2176,7 @@
                   List<Type> argtypes,
                   List<Type> typeargtypes,
                   LogResolveHelper logResolveHelper) {
-        if (sym.kind.isOverloadError()) {
+        if (sym.kind.isResolutionError()) {
             ResolveError errSym = (ResolveError)sym.baseSymbol();
             sym = errSym.access(name, qualified ? site.tsym : syms.noSymbol);
             argtypes = logResolveHelper.getArgumentTypes(errSym, sym, name, argtypes);
@@ -2366,7 +2366,7 @@
             }
             @Override
             Symbol access(Env<AttrContext> env, DiagnosticPosition pos, Symbol location, Symbol sym) {
-                if (sym.kind.isOverloadError()) {
+                if (sym.kind.isResolutionError()) {
                     sym = super.access(env, pos, location, sym);
                 } else if (allowMethodHandles) {
                     MethodSymbol msym = (MethodSymbol)sym;
@@ -2523,7 +2523,7 @@
                     }
                     @Override
                     Symbol access(Env<AttrContext> env, DiagnosticPosition pos, Symbol location, Symbol sym) {
-                        if (sym.kind.isOverloadError()) {
+                        if (sym.kind.isResolutionError()) {
                             if (sym.kind != WRONG_MTH &&
                                 sym.kind != WRONG_MTHS) {
                                 sym = super.access(env, pos, location, sym);
@@ -2555,7 +2555,8 @@
                               boolean allowBoxing,
                               boolean useVarargs) {
         Symbol bestSoFar = methodNotFound;
-        for (final Symbol sym : site.tsym.members().getSymbolsByName(names.init)) {
+        TypeSymbol tsym = site.tsym.isInterface() ? syms.objectType.tsym : site.tsym;
+        for (final Symbol sym : tsym.members().getSymbolsByName(names.init)) {
             //- System.out.println(" e " + e.sym);
             if (sym.kind == MTH &&
                 (sym.flags_field & SYNTHETIC) == 0) {
@@ -2933,7 +2934,7 @@
          */
         final boolean shouldStop(Symbol sym, MethodResolutionPhase phase) {
             return phase.ordinal() > maxPhase.ordinal() ||
-                !sym.kind.isOverloadError() || sym.kind == AMBIGUOUS;
+                !sym.kind.isResolutionError() || sym.kind == AMBIGUOUS;
         }
 
         /**
@@ -2979,7 +2980,7 @@
 
         @Override
         Symbol access(Env<AttrContext> env, DiagnosticPosition pos, Symbol location, Symbol sym) {
-            if (sym.kind.isOverloadError()) {
+            if (sym.kind.isResolutionError()) {
                 //if nothing is found return the 'first' error
                 sym = accessMethod(sym, pos, location, site, name, true, argtypes, typeargtypes);
             }
@@ -3321,7 +3322,7 @@
 
     boolean hasEnclosingInstance(Env<AttrContext> env, Type type) {
         Symbol encl = resolveSelfContainingInternal(env, type.tsym, false);
-        return encl != null && !encl.kind.isOverloadError();
+        return encl != null && !encl.kind.isResolutionError();
     }
 
     private Symbol resolveSelfContainingInternal(Env<AttrContext> env,
@@ -3503,7 +3504,7 @@
 
         @Override
         public Symbol access(Name name, TypeSymbol location) {
-            if (!sym.kind.isOverloadError() && sym.kind.matches(KindSelector.TYP))
+            if (!sym.kind.isResolutionError() && sym.kind.matches(KindSelector.TYP))
                 return types.createErrorType(name, location, sym.type).tsym;
             else
                 return sym;
@@ -4053,7 +4054,7 @@
             } else {
                 key = "bad.instance.method.in.unbound.lookup";
             }
-            return sym.kind.isOverloadError() ?
+            return sym.kind.isResolutionError() ?
                     ((ResolveError)sym).getDiagnostic(dkind, pos, location, site, name, argtypes, typeargtypes) :
                     diags.create(dkind, log.currentSource(), pos, key, Kinds.kindName(sym), sym);
         }
@@ -4232,8 +4233,8 @@
             @Override
             public Symbol mergeResults(Symbol bestSoFar, Symbol sym) {
                 //Check invariants (see {@code LookupHelper.shouldStop})
-                Assert.check(bestSoFar.kind.isOverloadError() && bestSoFar.kind != AMBIGUOUS);
-                if (!sym.kind.isOverloadError()) {
+                Assert.check(bestSoFar.kind.isResolutionError() && bestSoFar.kind != AMBIGUOUS);
+                if (!sym.kind.isResolutionError()) {
                     //varargs resolution successful
                     return sym;
                 } else {
diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/util/BaseFileManager.java b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/file/BaseFileManager.java
similarity index 98%
rename from langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/util/BaseFileManager.java
rename to langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/file/BaseFileManager.java
index 93a5c68..26d2336 100644
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/util/BaseFileManager.java
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/file/BaseFileManager.java
@@ -23,7 +23,7 @@
  * questions.
  */
 
-package com.sun.tools.javac.util;
+package com.sun.tools.javac.file;
 
 import java.io.ByteArrayOutputStream;
 import java.io.IOException;
@@ -60,8 +60,12 @@
 import com.sun.tools.javac.main.Option;
 import com.sun.tools.javac.main.OptionHelper;
 import com.sun.tools.javac.main.OptionHelper.GrumpyHelper;
+import com.sun.tools.javac.util.Context;
+import com.sun.tools.javac.util.DefinedBy;
 import com.sun.tools.javac.util.DefinedBy.Api;
 import com.sun.tools.javac.util.JCDiagnostic.SimpleDiagnosticPosition;
+import com.sun.tools.javac.util.Log;
+import com.sun.tools.javac.util.Options;
 
 /**
  * Utility methods for building a filemanager.
diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/file/BaseFileObject.java b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/file/BaseFileObject.java
index a14881b..71c869f 100644
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/file/BaseFileObject.java
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/file/BaseFileObject.java
@@ -38,7 +38,6 @@
 import javax.tools.FileObject;
 import javax.tools.JavaFileObject;
 
-import com.sun.tools.javac.util.BaseFileManager;
 import com.sun.tools.javac.util.DefinedBy;
 import com.sun.tools.javac.util.DefinedBy.Api;
 
diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/file/JRTIndex.java b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/file/JRTIndex.java
index 889ef82..85752a2 100644
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/file/JRTIndex.java
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/file/JRTIndex.java
@@ -48,7 +48,6 @@
 import javax.tools.FileObject;
 
 import com.sun.tools.javac.file.RelativePath.RelativeDirectory;
-import com.sun.tools.javac.nio.PathFileObject;
 import com.sun.tools.javac.util.Context;
 
 /**
diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/file/JavacFileManager.java b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/file/JavacFileManager.java
index d513e37..bf9dec5 100644
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/file/JavacFileManager.java
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/file/JavacFileManager.java
@@ -63,8 +63,6 @@
 
 import com.sun.tools.javac.file.RelativePath.RelativeDirectory;
 import com.sun.tools.javac.file.RelativePath.RelativeFile;
-import com.sun.tools.javac.nio.PathFileObject;
-import com.sun.tools.javac.util.BaseFileManager;
 import com.sun.tools.javac.util.Context;
 import com.sun.tools.javac.util.DefinedBy;
 import com.sun.tools.javac.util.DefinedBy.Api;
@@ -73,8 +71,6 @@
 
 import static javax.tools.StandardLocation.*;
 
-import static com.sun.tools.javac.util.BaseFileManager.getKind;
-
 /**
  * This class provides access to the source, class and other files
  * used by the compiler and related tools.
diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/file/Locations.java b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/file/Locations.java
index 4192482..b45aa9b 100644
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/file/Locations.java
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/file/Locations.java
@@ -108,37 +108,23 @@
     // Locations can use Paths.get(URI.create("jrt:"))
     static final Path JRT_MARKER_FILE = Paths.get("JRT_MARKER_FILE");
 
-    public Locations() {
+    Locations() {
         initHandlers();
     }
 
     // could replace Lint by "boolean warn"
-    public void update(Log log, Lint lint, FSInfo fsInfo) {
+    void update(Log log, Lint lint, FSInfo fsInfo) {
         this.log = log;
         warn = lint.isEnabled(Lint.LintCategory.PATH);
         this.fsInfo = fsInfo;
     }
 
-    public Collection<Path> bootClassPath() {
-        return getLocation(PLATFORM_CLASS_PATH);
-    }
-
-    public boolean isDefaultBootClassPath() {
+    boolean isDefaultBootClassPath() {
         BootClassPathLocationHandler h
                 = (BootClassPathLocationHandler) getHandler(PLATFORM_CLASS_PATH);
         return h.isDefault();
     }
 
-    public Collection<Path> userClassPath() {
-        return getLocation(CLASS_PATH);
-    }
-
-    public Collection<Path> sourcePath() {
-        Collection<Path> p = getLocation(SOURCE_PATH);
-        // TODO: this should be handled by the LocationHandler
-        return p == null || p.isEmpty() ? null : p;
-    }
-
     /**
      * Split a search path into its elements. Empty path elements will be ignored.
      *
@@ -753,7 +739,7 @@
         }
     }
 
-    public boolean handleOption(Option option, String value) {
+    boolean handleOption(Option option, String value) {
         LocationHandler h = handlersForOption.get(option);
         return (h == null ? false : h.handleOption(option, value));
     }
diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/nio/PathFileObject.java b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/file/PathFileObject.java
similarity index 99%
rename from langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/nio/PathFileObject.java
rename to langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/file/PathFileObject.java
index 36bd816..5a5c376 100644
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/nio/PathFileObject.java
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/file/PathFileObject.java
@@ -23,7 +23,7 @@
  * questions.
  */
 
-package com.sun.tools.javac.nio;
+package com.sun.tools.javac.file;
 
 import java.io.IOException;
 import java.io.InputStream;
@@ -40,11 +40,11 @@
 import java.nio.file.LinkOption;
 import java.nio.file.Path;
 import java.util.Objects;
+
 import javax.lang.model.element.Modifier;
 import javax.lang.model.element.NestingKind;
 import javax.tools.JavaFileObject;
 
-import com.sun.tools.javac.util.BaseFileManager;
 import com.sun.tools.javac.util.DefinedBy;
 import com.sun.tools.javac.util.DefinedBy.Api;
 
diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/Code.java b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/Code.java
index 329deb8..305847f 100644
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/Code.java
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/Code.java
@@ -497,13 +497,9 @@
         case aaload: {
             state.pop(1);// index
             Type a = state.stack[state.stacksize-1];
+            Assert.check(!a.hasTag(BOT)); // null type as is cannot be indexed.
             state.pop(1);
-            //sometimes 'null type' is treated as a one-dimensional array type
-            //see Gen.visitLiteral - we should handle this case accordingly
-            Type stackType = a.hasTag(BOT) ?
-                syms.objectType :
-                types.erasure(types.elemtype(a));
-            state.push(stackType); }
+            state.push(types.erasure(types.elemtype(a))); }
             break;
         case goto_:
             markDead();
@@ -2166,7 +2162,11 @@
         boolean keepLocalVariables = varDebugInfo ||
             (var.sym.isExceptionParameter() && var.sym.hasTypeAnnotations());
         if (!keepLocalVariables) return;
-        if ((var.sym.flags() & Flags.SYNTHETIC) != 0) return;
+        //don't keep synthetic vars, unless they are lambda method parameters
+        boolean ignoredSyntheticVar = (var.sym.flags() & Flags.SYNTHETIC) != 0 &&
+                ((var.sym.owner.flags() & Flags.LAMBDA_METHOD) == 0 ||
+                 (var.sym.flags() & Flags.PARAMETER) == 0);
+        if (ignoredSyntheticVar) return;
         if (varBuffer == null)
             varBuffer = new LocalVar[20];
         else
diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/Gen.java b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/Gen.java
index 67f47e6..402ae13 100644
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/Gen.java
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/Gen.java
@@ -1860,6 +1860,13 @@
     public void visitAssign(JCAssign tree) {
         Item l = genExpr(tree.lhs, tree.lhs.type);
         genExpr(tree.rhs, tree.lhs.type).load();
+        if (tree.rhs.type.hasTag(BOT)) {
+            /* This is just a case of widening reference conversion that per 5.1.5 simply calls
+               for "regarding a reference as having some other type in a manner that can be proved
+               correct at compile time."
+            */
+            code.state.forceStackTop(tree.lhs.type);
+        }
         result = items.makeAssignItem(l);
     }
 
@@ -2272,12 +2279,7 @@
     public void visitLiteral(JCLiteral tree) {
         if (tree.type.hasTag(BOT)) {
             code.emitop0(aconst_null);
-            if (types.dimensions(pt) > 1) {
-                code.emitop2(checkcast, makeRef(tree.pos(), pt));
-                result = items.makeStackItem(pt);
-            } else {
-                result = items.makeStackItem(tree.type);
-            }
+            result = items.makeStackItem(tree.type);
         }
         else
             result = items.makeImmediateItem(tree.type, tree.value);
diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/main/Arguments.java b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/main/Arguments.java
index a37f37a..c08b59f 100644
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/main/Arguments.java
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/main/Arguments.java
@@ -42,7 +42,7 @@
 import com.sun.tools.javac.jvm.Profile;
 import com.sun.tools.javac.jvm.Target;
 import com.sun.tools.javac.main.OptionHelper.GrumpyHelper;
-import com.sun.tools.javac.util.BaseFileManager;
+import com.sun.tools.javac.file.BaseFileManager;
 import com.sun.tools.javac.util.Context;
 import com.sun.tools.javac.util.List;
 import com.sun.tools.javac.util.ListBuffer;
diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/main/Main.java b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/main/Main.java
index 909cb2b..46d591e 100644
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/main/Main.java
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/main/Main.java
@@ -39,6 +39,7 @@
 
 import com.sun.tools.javac.api.BasicJavacTask;
 import com.sun.tools.javac.file.CacheFSInfo;
+import com.sun.tools.javac.file.BaseFileManager;
 import com.sun.tools.javac.file.JavacFileManager;
 import com.sun.tools.javac.processing.AnnotationProcessingError;
 import com.sun.tools.javac.util.*;
diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/nio/JavacPathFileManager.java b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/nio/JavacPathFileManager.java
deleted file mode 100644
index 3161afe..0000000
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/nio/JavacPathFileManager.java
+++ /dev/null
@@ -1,547 +0,0 @@
-/*
- * Copyright (c) 2009, 2014, 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.
- */
-
-package com.sun.tools.javac.nio;
-
-import java.io.File;
-import java.io.IOException;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.nio.charset.Charset;
-import java.nio.file.FileSystem;
-import java.nio.file.FileSystems;
-import java.nio.file.FileVisitOption;
-import java.nio.file.FileVisitResult;
-import java.nio.file.Files;
-import java.nio.file.Path;
-import java.nio.file.Paths;
-import java.nio.file.SimpleFileVisitor;
-import java.nio.file.attribute.BasicFileAttributes;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.EnumSet;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.LinkedHashSet;
-import java.util.Map;
-import java.util.Set;
-
-import javax.lang.model.SourceVersion;
-import javax.tools.FileObject;
-import javax.tools.JavaFileManager;
-import javax.tools.JavaFileObject;
-import javax.tools.JavaFileObject.Kind;
-import javax.tools.StandardLocation;
-
-import com.sun.tools.javac.util.BaseFileManager;
-import com.sun.tools.javac.util.Context;
-import com.sun.tools.javac.util.DefinedBy;
-import com.sun.tools.javac.util.DefinedBy.Api;
-import com.sun.tools.javac.util.List;
-import com.sun.tools.javac.util.ListBuffer;
-
-import static java.nio.file.FileVisitOption.*;
-
-import static javax.tools.StandardLocation.*;
-
-import static com.sun.tools.javac.main.Option.*;
-
-
-// NOTE the imports carefully for this compilation unit.
-//
-// Path:  java.nio.file.Path -- the new NIO type for which this file manager exists
-//
-// Paths: com.sun.tools.javac.file.Paths -- legacy javac type for handling path options
-//      The other Paths (java.nio.file.Paths) is not used
-
-// NOTE this and related classes depend on new API in JDK 7.
-// This requires special handling while bootstrapping the JDK build,
-// when these classes might not yet have been compiled. To workaround
-// this, the build arranges to make stubs of these classes available
-// when compiling this and related classes. The set of stub files
-// is specified in make/build.properties.
-
-/**
- *  Implementation of PathFileManager: a JavaFileManager based on the use
- *  of java.nio.file.Path.
- *
- *  <p>Just as a Path is somewhat analagous to a File, so too is this
- *  JavacPathFileManager analogous to JavacFileManager, as it relates to the
- *  support of FileObjects based on File objects (i.e. just RegularFileObject,
- *  not ZipFileObject and its variants.)
- *
- *  <p>The default values for the standard locations supported by this file
- *  manager are the same as the default values provided by JavacFileManager --
- *  i.e. as determined by the javac.file.Paths class. To override these values,
- *  call {@link #setLocation}.
- *
- *  <p>To reduce confusion with Path objects, the locations such as "class path",
- *  "source path", etc, are generically referred to here as "search paths".
- *
- *  <p><b>This is NOT part of any supported API.
- *  If you write code that depends on this, you do so at your own risk.
- *  This code and its internal interfaces are subject to change or
- *  deletion without notice.</b>
- */
-public class JavacPathFileManager extends BaseFileManager implements PathFileManager {
-    protected FileSystem defaultFileSystem;
-
-    /**
-     * Create a JavacPathFileManager using a given context, optionally registering
-     * it as the JavaFileManager for that context.
-     */
-    public JavacPathFileManager(Context context, boolean register, Charset charset) {
-        super(charset);
-        if (register)
-            context.put(JavaFileManager.class, this);
-        pathsForLocation = new HashMap<>();
-        fileSystems = new HashMap<>();
-        setContext(context);
-    }
-
-    /**
-     * Set the context for JavacPathFileManager.
-     */
-    @Override
-    public void setContext(Context context) {
-        super.setContext(context);
-    }
-
-    @Override
-    public FileSystem getDefaultFileSystem() {
-        if (defaultFileSystem == null)
-            defaultFileSystem = FileSystems.getDefault();
-        return defaultFileSystem;
-    }
-
-    @Override
-    public void setDefaultFileSystem(FileSystem fs) {
-        defaultFileSystem = fs;
-    }
-
-    @Override @DefinedBy(Api.COMPILER)
-    public void flush() throws IOException {
-        contentCache.clear();
-    }
-
-    @Override @DefinedBy(Api.COMPILER)
-    public void close() throws IOException {
-        for (FileSystem fs: fileSystems.values())
-            fs.close();
-    }
-
-    @Override @DefinedBy(Api.COMPILER)
-    public ClassLoader getClassLoader(Location location) {
-        nullCheck(location);
-        Iterable<? extends Path> path = getLocation(location);
-        if (path == null)
-            return null;
-        ListBuffer<URL> lb = new ListBuffer<>();
-        for (Path p: path) {
-            try {
-                lb.append(p.toUri().toURL());
-            } catch (MalformedURLException e) {
-                throw new AssertionError(e);
-            }
-        }
-
-        return getClassLoader(lb.toArray(new URL[lb.size()]));
-    }
-
-    // <editor-fold defaultstate="collapsed" desc="Location handling">
-
-    @DefinedBy(Api.COMPILER)
-    public boolean hasLocation(Location location) {
-        return (getLocation(location) != null);
-    }
-
-    public Iterable<? extends Path> getLocation(Location location) {
-        nullCheck(location);
-        lazyInitSearchPaths();
-        PathsForLocation path = pathsForLocation.get(location);
-        if (path == null && !pathsForLocation.containsKey(location)) {
-            setDefaultForLocation(location);
-            path = pathsForLocation.get(location);
-        }
-        return path;
-    }
-
-    private Path getOutputLocation(Location location) {
-        Iterable<? extends Path> paths = getLocation(location);
-        return (paths == null ? null : paths.iterator().next());
-    }
-
-    public void setLocation(Location location, Iterable<? extends Path> searchPath)
-            throws IOException
-    {
-        nullCheck(location);
-        lazyInitSearchPaths();
-        if (searchPath == null) {
-            setDefaultForLocation(location);
-        } else {
-            if (location.isOutputLocation())
-                checkOutputPath(searchPath);
-            PathsForLocation pl = new PathsForLocation();
-            for (Path p: searchPath)
-                pl.add(p);  // TODO -Xlint:path warn if path not found
-            pathsForLocation.put(location, pl);
-        }
-    }
-
-    private void checkOutputPath(Iterable<? extends Path> searchPath) throws IOException {
-        Iterator<? extends Path> pathIter = searchPath.iterator();
-        if (!pathIter.hasNext())
-            throw new IllegalArgumentException("empty path for directory");
-        Path path = pathIter.next();
-        if (pathIter.hasNext())
-            throw new IllegalArgumentException("path too long for directory");
-        if (!isDirectory(path))
-            throw new IOException(path + ": not a directory");
-    }
-
-    private void setDefaultForLocation(Location locn) {
-        Collection<Path> files = null;
-        if (locn instanceof StandardLocation) {
-            switch ((StandardLocation) locn) {
-                case CLASS_PATH:
-                    files = locations.userClassPath();
-                    break;
-                case PLATFORM_CLASS_PATH:
-                    files = locations.bootClassPath();
-                    break;
-                case SOURCE_PATH:
-                    files = locations.sourcePath();
-                    break;
-                case CLASS_OUTPUT: {
-                    String arg = options.get(D);
-                    files = (arg == null ? null : Collections.singleton(Paths.get(arg)));
-                    break;
-                }
-                case SOURCE_OUTPUT: {
-                    String arg = options.get(S);
-                    files = (arg == null ? null : Collections.singleton(Paths.get(arg)));
-                    break;
-                }
-            }
-        }
-
-        PathsForLocation pl = new PathsForLocation();
-        if (files != null) {
-            for (Path f: files)
-                pl.add(f);
-        }
-        if (!pl.isEmpty())
-            pathsForLocation.put(locn, pl);
-    }
-
-    private void lazyInitSearchPaths() {
-        if (!inited) {
-            setDefaultForLocation(PLATFORM_CLASS_PATH);
-            setDefaultForLocation(CLASS_PATH);
-            setDefaultForLocation(SOURCE_PATH);
-            inited = true;
-        }
-    }
-    // where
-        private boolean inited = false;
-
-    private Map<Location, PathsForLocation> pathsForLocation;
-
-    private static class PathsForLocation extends LinkedHashSet<Path> {
-        private static final long serialVersionUID = 6788510222394486733L;
-    }
-
-    // </editor-fold>
-
-    // <editor-fold defaultstate="collapsed" desc="FileObject handling">
-
-    @Override
-    public Path getPath(FileObject fo) {
-        nullCheck(fo);
-        if (!(fo instanceof PathFileObject))
-            throw new IllegalArgumentException();
-        return ((PathFileObject) fo).getPath();
-    }
-
-    @Override @DefinedBy(Api.COMPILER)
-    public boolean isSameFile(FileObject a, FileObject b) {
-        nullCheck(a);
-        nullCheck(b);
-        if (!(a instanceof PathFileObject))
-            throw new IllegalArgumentException("Not supported: " + a);
-        if (!(b instanceof PathFileObject))
-            throw new IllegalArgumentException("Not supported: " + b);
-        return ((PathFileObject) a).isSameFile((PathFileObject) b);
-    }
-
-    @Override @DefinedBy(Api.COMPILER)
-    public Iterable<JavaFileObject> list(Location location,
-            String packageName, Set<Kind> kinds, boolean recurse)
-            throws IOException {
-        // validatePackageName(packageName);
-        nullCheck(packageName);
-        nullCheck(kinds);
-
-        Iterable<? extends Path> paths = getLocation(location);
-        if (paths == null)
-            return List.nil();
-        ListBuffer<JavaFileObject> results = new ListBuffer<>();
-
-        for (Path path : paths)
-            list(path, packageName, kinds, recurse, results);
-
-        return results.toList();
-    }
-
-    private void list(Path path, String packageName, final Set<Kind> kinds,
-            boolean recurse, final ListBuffer<JavaFileObject> results)
-            throws IOException {
-        if (!Files.exists(path))
-            return;
-
-        final Path pathDir;
-        if (isDirectory(path))
-            pathDir = path;
-        else {
-            FileSystem fs = getFileSystem(path);
-            if (fs == null)
-                return;
-            pathDir = fs.getRootDirectories().iterator().next();
-        }
-        String sep = path.getFileSystem().getSeparator();
-        Path packageDir = packageName.isEmpty() ? pathDir
-                : pathDir.resolve(packageName.replace(".", sep));
-        if (!Files.exists(packageDir))
-            return;
-
-/* Alternate impl of list, superceded by use of Files.walkFileTree */
-//        Deque<Path> queue = new LinkedList<Path>();
-//        queue.add(packageDir);
-//
-//        Path dir;
-//        while ((dir = queue.poll()) != null) {
-//            DirectoryStream<Path> ds = dir.newDirectoryStream();
-//            try {
-//                for (Path p: ds) {
-//                    String name = p.getFileName().toString();
-//                    if (isDirectory(p)) {
-//                        if (recurse && SourceVersion.isIdentifier(name)) {
-//                            queue.add(p);
-//                        }
-//                    } else {
-//                        if (kinds.contains(getKind(name))) {
-//                            JavaFileObject fe =
-//                                PathFileObject.createDirectoryPathFileObject(this, p, pathDir);
-//                            results.append(fe);
-//                        }
-//                    }
-//                }
-//            } finally {
-//                ds.close();
-//            }
-//        }
-        int maxDepth = (recurse ? Integer.MAX_VALUE : 1);
-        Set<FileVisitOption> opts = EnumSet.of(FOLLOW_LINKS);
-        Files.walkFileTree(packageDir, opts, maxDepth,
-                new SimpleFileVisitor<Path>() {
-            @Override
-            public FileVisitResult preVisitDirectory(Path dir, BasicFileAttributes attrs) {
-                Path name = dir.getFileName();
-                if (name == null || SourceVersion.isIdentifier(name.toString()))
-                    return FileVisitResult.CONTINUE;
-                else
-                    return FileVisitResult.SKIP_SUBTREE;
-            }
-
-            @Override
-            public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) {
-                if (attrs.isRegularFile() && kinds.contains(getKind(file.getFileName().toString()))) {
-                    // WORKAROUND for .jimage files
-                    if (!file.isAbsolute())
-                        file = pathDir.resolve(file);
-                    JavaFileObject fe =
-                        PathFileObject.createDirectoryPathFileObject(
-                            JavacPathFileManager.this, file, pathDir);
-                    results.append(fe);
-                }
-                return FileVisitResult.CONTINUE;
-            }
-        });
-    }
-
-    @Override
-    public Iterable<? extends JavaFileObject> getJavaFileObjectsFromPaths(
-        Iterable<? extends Path> paths) {
-        ArrayList<PathFileObject> result;
-        if (paths instanceof Collection<?>)
-            result = new ArrayList<>(((Collection<?>)paths).size());
-        else
-            result = new ArrayList<>();
-        for (Path p: paths)
-            result.add(PathFileObject.createSimplePathFileObject(this, nullCheck(p)));
-        return result;
-    }
-
-    @Override
-    public Iterable<? extends JavaFileObject> getJavaFileObjects(Path... paths) {
-        return getJavaFileObjectsFromPaths(Arrays.asList(nullCheck(paths)));
-    }
-
-    @Override @DefinedBy(Api.COMPILER)
-    public JavaFileObject getJavaFileForInput(Location location,
-            String className, Kind kind) throws IOException {
-        return getFileForInput(location, getRelativePath(className, kind));
-    }
-
-    @Override @DefinedBy(Api.COMPILER)
-    public FileObject getFileForInput(Location location,
-            String packageName, String relativeName) throws IOException {
-        return getFileForInput(location, getRelativePath(packageName, relativeName));
-    }
-
-    private JavaFileObject getFileForInput(Location location, String relativePath)
-            throws IOException {
-        for (Path p: getLocation(location)) {
-            if (isDirectory(p)) {
-                Path f = resolve(p, relativePath);
-                if (Files.exists(f))
-                    return PathFileObject.createDirectoryPathFileObject(this, f, p);
-            } else {
-                FileSystem fs = getFileSystem(p);
-                if (fs != null) {
-                    Path file = getPath(fs, relativePath);
-                    if (Files.exists(file))
-                        return PathFileObject.createJarPathFileObject(this, file);
-                }
-            }
-        }
-        return null;
-    }
-
-    @Override @DefinedBy(Api.COMPILER)
-    public JavaFileObject getJavaFileForOutput(Location location,
-            String className, Kind kind, FileObject sibling) throws IOException {
-        return getFileForOutput(location, getRelativePath(className, kind), sibling);
-    }
-
-    @Override @DefinedBy(Api.COMPILER)
-    public FileObject getFileForOutput(Location location, String packageName,
-            String relativeName, FileObject sibling)
-            throws IOException {
-        return getFileForOutput(location, getRelativePath(packageName, relativeName), sibling);
-    }
-
-    private JavaFileObject getFileForOutput(Location location,
-            String relativePath, FileObject sibling) {
-        Path dir = getOutputLocation(location);
-        if (dir == null) {
-            if (location == CLASS_OUTPUT) {
-                Path siblingDir = null;
-                if (sibling != null && sibling instanceof PathFileObject) {
-                    siblingDir = ((PathFileObject) sibling).getPath().getParent();
-                }
-                return PathFileObject.createSiblingPathFileObject(this,
-                        siblingDir.resolve(getBaseName(relativePath)),
-                        relativePath);
-            } else if (location == SOURCE_OUTPUT) {
-                dir = getOutputLocation(CLASS_OUTPUT);
-            }
-        }
-
-        Path file;
-        if (dir != null) {
-            file = resolve(dir, relativePath);
-            return PathFileObject.createDirectoryPathFileObject(this, file, dir);
-        } else {
-            file = getPath(getDefaultFileSystem(), relativePath);
-            return PathFileObject.createSimplePathFileObject(this, file);
-        }
-
-    }
-
-    @Override @DefinedBy(Api.COMPILER)
-    public String inferBinaryName(Location location, JavaFileObject fo) {
-        nullCheck(fo);
-        // Need to match the path semantics of list(location, ...)
-        Iterable<? extends Path> paths = getLocation(location);
-        if (paths == null) {
-            return null;
-        }
-
-        if (!(fo instanceof PathFileObject))
-            throw new IllegalArgumentException(fo.getClass().getName());
-
-        return ((PathFileObject) fo).inferBinaryName(paths);
-    }
-
-    private FileSystem getFileSystem(Path p) throws IOException {
-        FileSystem fs = fileSystems.get(p);
-        if (fs == null) {
-            fs = FileSystems.newFileSystem(p, null);
-            fileSystems.put(p, fs);
-        }
-        return fs;
-    }
-
-    private Map<Path,FileSystem> fileSystems;
-
-    // </editor-fold>
-
-    // <editor-fold defaultstate="collapsed" desc="Utility methods">
-
-    private static String getRelativePath(String className, Kind kind) {
-        return className.replace(".", "/") + kind.extension;
-    }
-
-    private static String getRelativePath(String packageName, String relativeName) {
-        return packageName.isEmpty()
-                ? relativeName : packageName.replace(".", "/") + "/" + relativeName;
-    }
-
-    private static String getBaseName(String relativePath) {
-        int lastSep = relativePath.lastIndexOf("/");
-        return relativePath.substring(lastSep + 1); // safe if "/" not found
-    }
-
-    private static boolean isDirectory(Path path) throws IOException {
-        BasicFileAttributes attrs = Files.readAttributes(path, BasicFileAttributes.class);
-        return attrs.isDirectory();
-    }
-
-    private static Path getPath(FileSystem fs, String relativePath) {
-        return fs.getPath(relativePath.replace("/", fs.getSeparator()));
-    }
-
-    private static Path resolve(Path base, String relativePath) {
-        FileSystem fs = base.getFileSystem();
-        Path rp = fs.getPath(relativePath.replace("/", fs.getSeparator()));
-        return base.resolve(rp);
-    }
-
-    // </editor-fold>
-
-}
diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/nio/PathFileManager.java b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/nio/PathFileManager.java
deleted file mode 100644
index 762b8ed..0000000
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/nio/PathFileManager.java
+++ /dev/null
@@ -1,126 +0,0 @@
-/*
- * Copyright (c) 2009, 2012, 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.
- */
-
-package com.sun.tools.javac.nio;
-
-import java.io.IOException;
-import java.nio.file.FileSystem;
-import java.nio.file.FileSystems;
-import java.nio.file.Path;
-import javax.tools.FileObject;
-import javax.tools.JavaFileManager;
-import javax.tools.JavaFileObject;
-
-/**
- *  File manager based on {@link java.nio.file.Path}.
- *
- *  Eventually, this should be moved to javax.tools.
- *  Also, JavaCompiler might reasonably provide a method getPathFileManager,
- *  similar to {@link javax.tools.JavaCompiler#getStandardFileManager
- *  getStandardFileManager}. However, would need to be handled carefully
- *  as another forward reference from langtools to jdk.
- *
- *  <p><b>This is NOT part of any supported API.
- *  If you write code that depends on this, you do so at your own risk.
- *  This code and its internal interfaces are subject to change or
- *  deletion without notice.</b>
- */
-public interface PathFileManager extends JavaFileManager {
-    /**
-     * Get the default file system used to create paths. If no value has been
-     * set, the default file system is {@link FileSystems#getDefault}.
-     */
-    FileSystem getDefaultFileSystem();
-
-    /**
-     * Set the default file system used to create paths.
-     * @param fs the default file system used to create any new paths.
-     */
-    void setDefaultFileSystem(FileSystem fs);
-
-    /**
-     * Get file objects representing the given files.
-     *
-     * @param paths a list of paths
-     * @return a list of file objects
-     * @throws IllegalArgumentException if the list of paths includes
-     * a directory
-     */
-    Iterable<? extends JavaFileObject> getJavaFileObjectsFromPaths(
-        Iterable<? extends Path> paths);
-
-    /**
-     * Get file objects representing the given paths.
-     * Convenience method equivalent to:
-     *
-     * <pre>
-     *     getJavaFileObjectsFromPaths({@linkplain java.util.Arrays#asList Arrays.asList}(paths))
-     * </pre>
-     *
-     * @param paths an array of paths
-     * @return a list of file objects
-     * @throws IllegalArgumentException if the array of files includes
-     * a directory
-     * @throws NullPointerException if the given array contains null
-     * elements
-     */
-    Iterable<? extends JavaFileObject> getJavaFileObjects(Path... paths);
-
-    /**
-     * Return the Path for a file object that has been obtained from this
-     * file manager.
-     *
-     * @param fo A file object that has been obtained from this file manager.
-     * @return The underlying Path object.
-     * @throws IllegalArgumentException is the file object was not obtained from
-     * from this file manager.
-     */
-    Path getPath(FileObject fo);
-
-    /**
-     * Get the search path associated with the given location.
-     *
-     * @param location a location
-     * @return a list of paths or {@code null} if this location has no
-     * associated search path
-     * @see #setLocation
-     */
-    Iterable<? extends Path> getLocation(Location location);
-
-    /**
-     * Associate the given search path with the given location.  Any
-     * previous value will be discarded.
-     *
-     * @param location a location
-     * @param searchPath a list of files, if {@code null} use the default
-     * search path for this location
-     * @see #getLocation
-     * @throws IllegalArgumentException if location is an output
-     * location and searchpath does not contain exactly one element
-     * @throws IOException if location is an output location and searchpath
-     * does not represent an existing directory
-     */
-    void setLocation(Location location, Iterable<? extends Path> searchPath) throws IOException;
-}
diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/parser/DocCommentParser.java b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/parser/DocCommentParser.java
index 17409cc..1dee684 100644
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/parser/DocCommentParser.java
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/parser/DocCommentParser.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 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
@@ -797,7 +797,7 @@
         loop:
         while (isIdentifierStart(ch)) {
             int namePos = bp;
-            Name name = readIdentifier();
+            Name name = readAttributeName();
             skipWhitespace();
             List<DCTree> value = null;
             ValueKind vkind = ValueKind.EMPTY;
@@ -905,6 +905,14 @@
         return names.fromChars(buf, start, bp - start);
     }
 
+    protected Name readAttributeName() {
+        int start = bp;
+        nextChar();
+        while (bp < buflen && (Character.isUnicodeIdentifierPart(ch) || ch == '-'))
+            nextChar();
+        return names.fromChars(buf, start, bp - start);
+    }
+
     protected Name readTagName() {
         int start = bp;
         nextChar();
diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/resources/compiler.properties b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/resources/compiler.properties
index c3a8900..6dc4674 100644
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/resources/compiler.properties
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/resources/compiler.properties
@@ -2010,6 +2010,16 @@
 compiler.misc.diamond.non.generic=\
     cannot use ''<>'' with non-generic class {0}
 
+# 0: list of type, 1: message segment
+compiler.misc.diamond.invalid.arg=\
+    type argument {0} inferred for {1} is not allowed in this context\n\
+    inferred argument is not expressible in the Signature attribute
+
+# 0: list of type, 1: message segment
+compiler.misc.diamond.invalid.args=\
+    type arguments {0} inferred for {1} are not allowed in this context\n\
+    inferred arguments are not expressible in the Signature attribute
+
 # 0: unused
 compiler.misc.diamond.and.explicit.params=\
     cannot use ''<>'' with explicit type parameters for constructor
@@ -2271,10 +2281,6 @@
 compiler.misc.varargs.clash.with=\
     {0} in {1} overrides {2} in {3}
 
-# 0: unused
-compiler.misc.diamond.and.anon.class=\
-    cannot use ''<>'' with anonymous inner classes
-
 # 0: symbol kind, 1: symbol, 2: symbol, 3: message segment
 compiler.misc.inapplicable.method=\
     {0} {1}.{2} is not applicable\n\
@@ -2284,6 +2290,11 @@
 # Diagnostics for language feature changes
 ########################################
 # 0: string
+compiler.misc.diamond.and.anon.class.not.supported.in.source=\
+    cannot use ''<>'' with anonymous inner classes in -source {0}\n\
+    (use -source 9 or higher to enable ''<>'' with anonymous inner classes)
+
+# 0: string
 compiler.err.unsupported.binary.lit=\
     binary literals are not supported in -source {0}\n\
     (use -source 7 or higher to enable binary literals)
diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/tree/TreeInfo.java b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/tree/TreeInfo.java
index b97af97..af23690 100644
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/tree/TreeInfo.java
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/tree/TreeInfo.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -190,6 +190,18 @@
         }
     }
 
+    /** Return true if the given tree represents a type elided anonymous class instance creation. */
+    public static boolean isAnonymousDiamond(JCTree tree) {
+        switch(tree.getTag()) {
+            case NEWCLASS:  {
+                JCNewClass nc = (JCNewClass)tree;
+                return nc.def != null && isDiamond(nc.clazz);
+            }
+            case ANNOTATED_TYPE: return isAnonymousDiamond(((JCAnnotatedType)tree).underlyingType);
+            default: return false;
+        }
+    }
+
     public static boolean isEnumInit(JCTree tree) {
         switch (tree.getTag()) {
             case VARDEF:
diff --git a/langtools/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/util/DocFileFactory.java b/langtools/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/util/DocFileFactory.java
index af11b18..db34c5c 100644
--- a/langtools/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/util/DocFileFactory.java
+++ b/langtools/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/util/DocFileFactory.java
@@ -56,17 +56,10 @@
         DocFileFactory f = factories.get(configuration);
         if (f == null) {
             JavaFileManager fm = configuration.getFileManager();
-            if (fm instanceof StandardJavaFileManager)
+            if (fm instanceof StandardJavaFileManager) {
                 f = new StandardDocFileFactory(configuration);
-            else {
-                try {
-                    Class<?> pathFileManagerClass =
-                            Class.forName("com.sun.tools.javac.nio.PathFileManager");
-                    if (pathFileManagerClass.isAssignableFrom(fm.getClass()))
-                        f = new PathDocFileFactory(configuration);
-                } catch (Throwable t) {
-                    throw new IllegalStateException(t);
-                }
+            } else {
+                throw new IllegalStateException();
             }
             factories.put(configuration, f);
         }
diff --git a/langtools/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/util/PathDocFileFactory.java b/langtools/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/util/PathDocFileFactory.java
deleted file mode 100644
index 8d208aa..0000000
--- a/langtools/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/util/PathDocFileFactory.java
+++ /dev/null
@@ -1,320 +0,0 @@
-/*
- * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * 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.
- */
-package com.sun.tools.doclets.internal.toolkit.util;
-
-
-import java.io.BufferedInputStream;
-import java.io.BufferedOutputStream;
-import java.io.BufferedWriter;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.io.OutputStreamWriter;
-import java.io.UnsupportedEncodingException;
-import java.io.Writer;
-import java.nio.file.DirectoryStream;
-import java.nio.file.Files;
-import java.nio.file.Path;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.LinkedHashSet;
-import java.util.List;
-import java.util.Set;
-
-import javax.tools.DocumentationTool;
-import javax.tools.FileObject;
-import javax.tools.JavaFileManager.Location;
-import javax.tools.JavaFileObject;
-import javax.tools.StandardLocation;
-
-import com.sun.tools.doclets.internal.toolkit.Configuration;
-import com.sun.tools.javac.nio.PathFileManager;
-
-
-/**
- * Implementation of DocFileFactory using a {@link PathFileManager}.
- *
- *  <p><b>This is NOT part of any supported API.
- *  If you write code that depends on this, you do so at your own risk.
- *  This code and its internal interfaces are subject to change or
- *  deletion without notice.</b>
- *
- * @since 1.8
- */
-class PathDocFileFactory extends DocFileFactory {
-    private final PathFileManager fileManager;
-    private final Path destDir;
-
-    public PathDocFileFactory(Configuration configuration) {
-        super(configuration);
-        fileManager = (PathFileManager) configuration.getFileManager();
-
-        if (!configuration.destDirName.isEmpty()
-                || !fileManager.hasLocation(DocumentationTool.Location.DOCUMENTATION_OUTPUT)) {
-            try {
-                String dirName = configuration.destDirName.isEmpty() ? "." : configuration.destDirName;
-                Path dir = fileManager.getDefaultFileSystem().getPath(dirName);
-                fileManager.setLocation(DocumentationTool.Location.DOCUMENTATION_OUTPUT, Arrays.asList(dir));
-            } catch (IOException e) {
-                throw new DocletAbortException(e);
-            }
-        }
-
-        destDir = fileManager.getLocation(DocumentationTool.Location.DOCUMENTATION_OUTPUT).iterator().next();
-    }
-
-    public DocFile createFileForDirectory(String file) {
-        return new StandardDocFile(fileManager.getDefaultFileSystem().getPath(file));
-    }
-
-    public DocFile createFileForInput(String file) {
-        return new StandardDocFile(fileManager.getDefaultFileSystem().getPath(file));
-    }
-
-    public DocFile createFileForOutput(DocPath path) {
-        return new StandardDocFile(DocumentationTool.Location.DOCUMENTATION_OUTPUT, path);
-    }
-
-    @Override
-    Iterable<DocFile> list(Location location, DocPath path) {
-        if (location != StandardLocation.SOURCE_PATH)
-            throw new IllegalArgumentException();
-
-        Set<DocFile> files = new LinkedHashSet<>();
-        if (fileManager.hasLocation(location)) {
-            for (Path f: fileManager.getLocation(location)) {
-                if (Files.isDirectory(f)) {
-                    f = f.resolve(path.getPath());
-                    if (Files.exists(f))
-                        files.add(new StandardDocFile(f));
-                }
-            }
-        }
-        return files;
-    }
-
-    class StandardDocFile extends DocFile {
-        private Path file;
-
-        /** Create a StandardDocFile for a given file. */
-        private StandardDocFile(Path file) {
-            super(configuration);
-            this.file = file;
-        }
-
-        /** Create a StandardDocFile for a given location and relative path. */
-        private StandardDocFile(Location location, DocPath path) {
-            super(configuration, location, path);
-            this.file = destDir.resolve(path.getPath());
-        }
-
-        /** Open an input stream for the file. */
-        public InputStream openInputStream() throws IOException {
-            JavaFileObject fo = getJavaFileObjectForInput(file);
-            return new BufferedInputStream(fo.openInputStream());
-        }
-
-        /**
-         * Open an output stream for the file.
-         * The file must have been created with a location of
-         * {@link DocumentationTool.Location#DOCUMENTATION_OUTPUT} and a corresponding relative path.
-         */
-        public OutputStream openOutputStream() throws IOException, UnsupportedEncodingException {
-            if (location != DocumentationTool.Location.DOCUMENTATION_OUTPUT)
-                throw new IllegalStateException();
-
-            OutputStream out = getFileObjectForOutput(path).openOutputStream();
-            return new BufferedOutputStream(out);
-        }
-
-        /**
-         * Open an writer for the file, using the encoding (if any) given in the
-         * doclet configuration.
-         * The file must have been created with a location of
-         * {@link DocumentationTool.Location#DOCUMENTATION_OUTPUT} and a corresponding relative path.
-         */
-        public Writer openWriter() throws IOException, UnsupportedEncodingException {
-            if (location != DocumentationTool.Location.DOCUMENTATION_OUTPUT)
-                throw new IllegalStateException();
-
-            OutputStream out = getFileObjectForOutput(path).openOutputStream();
-            if (configuration.docencoding == null) {
-                return new BufferedWriter(new OutputStreamWriter(out));
-            } else {
-                return new BufferedWriter(new OutputStreamWriter(out, configuration.docencoding));
-            }
-        }
-
-        /** Return true if the file can be read. */
-        public boolean canRead() {
-            return Files.isReadable(file);
-        }
-
-        /** Return true if the file can be written. */
-        public boolean canWrite() {
-            return Files.isWritable(file);
-        }
-
-        /** Return true if the file exists. */
-        public boolean exists() {
-            return Files.exists(file);
-        }
-
-        /** Return the base name (last component) of the file name. */
-        public String getName() {
-            return file.getFileName().toString();
-        }
-
-        /** Return the file system path for this file. */
-        public String getPath() {
-            return file.toString();
-        }
-
-        /** Return true is file has an absolute path name. */
-        public boolean isAbsolute() {
-            return file.isAbsolute();
-        }
-
-        /** Return true is file identifies a directory. */
-        public boolean isDirectory() {
-            return Files.isDirectory(file);
-        }
-
-        /** Return true is file identifies a file. */
-        public boolean isFile() {
-            return Files.isRegularFile(file);
-        }
-
-        /** Return true if this file is the same as another. */
-        public boolean isSameFile(DocFile other) {
-            if (!(other instanceof StandardDocFile))
-                return false;
-
-            try {
-                return Files.isSameFile(file, ((StandardDocFile) other).file);
-            } catch (IOException e) {
-                return false;
-            }
-        }
-
-        /** If the file is a directory, list its contents. */
-        public Iterable<DocFile> list() throws IOException {
-            List<DocFile> files = new ArrayList<>();
-            try (DirectoryStream<Path> ds = Files.newDirectoryStream(file)) {
-                for (Path f: ds) {
-                    files.add(new StandardDocFile(f));
-                }
-            }
-            return files;
-        }
-
-        /** Create the file as a directory, including any parent directories. */
-        public boolean mkdirs() {
-            try {
-                Files.createDirectories(file);
-                return true;
-            } catch (IOException e) {
-                return false;
-            }
-        }
-
-        /**
-         * Derive a new file by resolving a relative path against this file.
-         * The new file will inherit the configuration and location of this file
-         * If this file has a path set, the new file will have a corresponding
-         * new path.
-         */
-        public DocFile resolve(DocPath p) {
-            return resolve(p.getPath());
-        }
-
-        /**
-         * Derive a new file by resolving a relative path against this file.
-         * The new file will inherit the configuration and location of this file
-         * If this file has a path set, the new file will have a corresponding
-         * new path.
-         */
-        public DocFile resolve(String p) {
-            if (location == null && path == null) {
-                return new StandardDocFile(file.resolve(p));
-            } else {
-                return new StandardDocFile(location, path.resolve(p));
-            }
-        }
-
-        /**
-         * Resolve a relative file against the given output location.
-         * @param locn Currently, only
-         * {@link DocumentationTool.Location.DOCUMENTATION_OUTPUT} is supported.
-         */
-        public DocFile resolveAgainst(Location locn) {
-            if (locn != DocumentationTool.Location.DOCUMENTATION_OUTPUT)
-                throw new IllegalArgumentException();
-            return new StandardDocFile(destDir.resolve(file));
-        }
-
-        /** Return a string to identify the contents of this object,
-         * for debugging purposes.
-         */
-        @Override
-        public String toString() {
-            StringBuilder sb = new StringBuilder();
-            sb.append("PathDocFile[");
-            if (location != null)
-                sb.append("locn:").append(location).append(",");
-            if (path != null)
-                sb.append("path:").append(path.getPath()).append(",");
-            sb.append("file:").append(file);
-            sb.append("]");
-            return sb.toString();
-        }
-
-        private JavaFileObject getJavaFileObjectForInput(Path file) {
-            return fileManager.getJavaFileObjects(file).iterator().next();
-        }
-
-        private FileObject getFileObjectForOutput(DocPath path) throws IOException {
-            // break the path into a package-part and the rest, by finding
-            // the position of the last '/' before an invalid character for a
-            // package name, such as the "." before an extension or the "-"
-            // in filenames like package-summary.html, doc-files or src-html.
-            String p = path.getPath();
-            int lastSep = -1;
-            for (int i = 0; i < p.length(); i++) {
-                char ch = p.charAt(i);
-                if (ch == '/') {
-                    lastSep = i;
-                } else if (i == lastSep + 1 && !Character.isJavaIdentifierStart(ch)
-                        || !Character.isJavaIdentifierPart(ch)) {
-                    break;
-                }
-            }
-            String pkg = (lastSep == -1) ? "" : p.substring(0, lastSep);
-            String rest = p.substring(lastSep + 1);
-            return fileManager.getFileForOutput(location, pkg, rest, null);
-        }
-    }
-
-}
diff --git a/langtools/src/jdk.javadoc/share/classes/com/sun/tools/javadoc/Start.java b/langtools/src/jdk.javadoc/share/classes/com/sun/tools/javadoc/Start.java
index 7b8aa70..0d893a6 100644
--- a/langtools/src/jdk.javadoc/share/classes/com/sun/tools/javadoc/Start.java
+++ b/langtools/src/jdk.javadoc/share/classes/com/sun/tools/javadoc/Start.java
@@ -42,7 +42,7 @@
 import com.sun.tools.javac.file.JavacFileManager;
 import com.sun.tools.javac.main.CommandLine;
 import com.sun.tools.javac.main.Option;
-import com.sun.tools.javac.util.BaseFileManager;
+import com.sun.tools.javac.file.BaseFileManager;
 import com.sun.tools.javac.util.ClientCodeException;
 import com.sun.tools.javac.util.Context;
 import com.sun.tools.javac.util.List;
diff --git a/langtools/src/jdk.javadoc/share/classes/com/sun/tools/javadoc/api/JavadocTool.java b/langtools/src/jdk.javadoc/share/classes/com/sun/tools/javadoc/api/JavadocTool.java
index eb63a51..2aa5c16 100644
--- a/langtools/src/jdk.javadoc/share/classes/com/sun/tools/javadoc/api/JavadocTool.java
+++ b/langtools/src/jdk.javadoc/share/classes/com/sun/tools/javadoc/api/JavadocTool.java
@@ -46,7 +46,7 @@
 
 import com.sun.tools.javac.api.ClientCodeWrapper;
 import com.sun.tools.javac.file.JavacFileManager;
-import com.sun.tools.javac.util.BaseFileManager;
+import com.sun.tools.javac.file.BaseFileManager;
 import com.sun.tools.javac.util.ClientCodeException;
 import com.sun.tools.javac.util.Context;
 import com.sun.tools.javac.util.DefinedBy;
diff --git a/langtools/test/tools/javac/MethodParameters/LambdaTest.out b/langtools/test/tools/javac/MethodParameters/LambdaTest.out
index 2349dd0..d836793 100644
--- a/langtools/test/tools/javac/MethodParameters/LambdaTest.out
+++ b/langtools/test/tools/javac/MethodParameters/LambdaTest.out
@@ -2,6 +2,6 @@
 LambdaTest.<init>()
 LambdaTest.foo(i)
 LambdaTest.lambda$static$1(x1/*synthetic*/)/*synthetic*/
-LambdaTest.lambda$null$0(final cap$0/*synthetic*/, x2/*synthetic*/)/*synthetic*/
+LambdaTest.lambda$null$0(final x1/*synthetic*/, x2/*synthetic*/)/*synthetic*/
 static interface LambdaTest$I -- inner
 LambdaTest$I.m(x)
diff --git a/langtools/test/tools/javac/T7040592/CoerceNullToMoreSpecificTypeTest.java b/langtools/test/tools/javac/T7040592/CoerceNullToMoreSpecificTypeTest.java
new file mode 100644
index 0000000..ba84ef5
--- /dev/null
+++ b/langtools/test/tools/javac/T7040592/CoerceNullToMoreSpecificTypeTest.java
@@ -0,0 +1,66 @@
+/*
+ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 7040592
+ * @summary Test that the assertion in State.forceStackTop does not fail at compile time.
+ */
+
+import java.lang.reflect.Field;
+import java.util.ArrayList;
+import org.w3c.dom.Element;
+
+public class CoerceNullToMoreSpecificTypeTest {
+    abstract class NodeImpl {
+    }
+
+    NodeImpl ownerNode;
+
+    public Element getElement() {
+        return (Element) (isOwned() ? ownerNode : null);
+    }
+
+    boolean isOwned() {
+        return true;
+    }
+
+    static void processArrays(boolean expectNulls, Object [] nulla, Object [][] nullaa) {
+        if (expectNulls) {
+            if (nulla != null || nullaa != null) {
+                throw new AssertionError("Null actual, but not null formal");
+            }
+        } else {
+            if (nulla.length != 123 || nullaa.length != 321)
+                throw new AssertionError("Wrong arrays received");
+        }
+    }
+
+    public static void main(String[] args) {
+        ArrayList<Class<?>> typeList = new ArrayList<>();
+        Field rf = null;
+        typeList.add((rf != null) ? rf.getType() : null);
+        processArrays(true, null, null);
+        processArrays(false, new Object[123], new Object[321][]);
+    }
+}
diff --git a/langtools/test/tools/javac/T7040592/T7040592.java b/langtools/test/tools/javac/T7040592/T7040592.java
new file mode 100644
index 0000000..04939cb
--- /dev/null
+++ b/langtools/test/tools/javac/T7040592/T7040592.java
@@ -0,0 +1,74 @@
+/*
+ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 7040592
+ * @summary Verify that null can be assigned freely to array types without a checkcast
+ */
+
+import java.io.PrintWriter;
+import java.io.StringWriter;
+import java.nio.file.Paths;
+
+public class T7040592 {
+
+    private static final String assertionErrorMsg =
+            "null should be assignable to array type without a checkcast";
+
+    public static void main(String[] args) {
+        new T7040592().run();
+    }
+
+    void run() {
+        check("-c", Paths.get(System.getProperty("test.classes"),
+                "T7040592_01.class").toString());
+    }
+
+    void check(String... params) {
+        StringWriter s;
+        String out;
+        try (PrintWriter pw = new PrintWriter(s = new StringWriter())) {
+            com.sun.tools.javap.Main.run(params, pw);
+            out = s.toString();
+        }
+        if (out.contains("checkcast")) {
+            throw new AssertionError(assertionErrorMsg);
+        }
+    }
+
+}
+
+class T7040592_01 {
+    static void handleArrays(Object [] a, Object [][] b, Object [][][] c) {
+    }
+    public static void main(String[] args) {
+        Object a[];
+        Object o = (a = null)[0];
+        Object b[][];
+        o = (b = null)[0][0];
+        Object c[][][];
+        o = (c = null)[0][0][0];
+        handleArrays(null, null, null);
+    }
+}
diff --git a/langtools/test/tools/javac/classfiles/attributes/innerclasses/InnerClassesInAnonymousClassTest.java b/langtools/test/tools/javac/classfiles/attributes/innerclasses/InnerClassesInAnonymousClassTest.java
index 78a5287..04a563c 100644
--- a/langtools/test/tools/javac/classfiles/attributes/innerclasses/InnerClassesInAnonymousClassTest.java
+++ b/langtools/test/tools/javac/classfiles/attributes/innerclasses/InnerClassesInAnonymousClassTest.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,7 +23,7 @@
 
 /*
  * @test
- * @bug 8042251
+ * @bug 8042251 8062373
  * @summary Testing InnerClasses_attribute of inner classes in anonymous class.
  * @library /tools/lib /tools/javac/lib ../lib
  * @build InnerClassesTestBase TestResult TestBase InMemoryFileManager ToolBox
@@ -73,6 +73,6 @@
     public void getAdditionalFlags(Map<String, Set<String>> class2Flags, ClassType type, Modifier... flags) {
         super.getAdditionalFlags(class2Flags, type, flags);
         class2Flags.put("Anonymous", getFlags(currentClassType, Arrays.asList(flags)));
-        class2Flags.put("1", new HashSet<>());
+        class2Flags.put("1", new HashSet<>() {});
     }
 }
diff --git a/langtools/test/tools/javac/diags/examples/CantAccessInnerClsConstr.java b/langtools/test/tools/javac/diags/examples/CantAccessInnerClsConstr.java
index ce4f323..112862c 100644
--- a/langtools/test/tools/javac/diags/examples/CantAccessInnerClsConstr.java
+++ b/langtools/test/tools/javac/diags/examples/CantAccessInnerClsConstr.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 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
@@ -21,9 +21,8 @@
  * questions.
  */
 
-// key: compiler.err.prob.found.req
 // key: compiler.misc.cant.access.inner.cls.constr
-// key: compiler.misc.invalid.mref
+// key: compiler.err.invalid.mref
 
 class CantAccessInnerClsConstructor {
 
diff --git a/langtools/test/tools/javac/diags/examples/DiamondAndAnonClass.java b/langtools/test/tools/javac/diags/examples/DiamondAndAnonClass.java
index 26ef5e7..8e94de0 100644
--- a/langtools/test/tools/javac/diags/examples/DiamondAndAnonClass.java
+++ b/langtools/test/tools/javac/diags/examples/DiamondAndAnonClass.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2015 Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -21,8 +21,10 @@
  * questions.
  */
 
-// key: compiler.misc.diamond.and.anon.class
+// key: compiler.misc.diamond.and.anon.class.not.supported.in.source
 // key: compiler.err.cant.apply.diamond.1
+// key: compiler.warn.source.no.bootclasspath
+// options: -source 8
 
 import java.util.*;
 
diff --git a/jdk/test/jdk/lambda/shapegen/Rule.java b/langtools/test/tools/javac/diags/examples/DiamondAndNonDenotableTypes.java
similarity index 62%
copy from jdk/test/jdk/lambda/shapegen/Rule.java
copy to langtools/test/tools/javac/diags/examples/DiamondAndNonDenotableTypes.java
index 7ff02e0..0f2650d 100644
--- a/jdk/test/jdk/lambda/shapegen/Rule.java
+++ b/langtools/test/tools/javac/diags/examples/DiamondAndNonDenotableTypes.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
+ * 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
@@ -21,26 +21,22 @@
  * questions.
  */
 
-package shapegen;
+// key: compiler.misc.diamond
+// key: compiler.err.cant.apply.diamond.1
+// key: compiler.misc.diamond.invalid.arg
+// key: compiler.misc.diamond.invalid.args
 
-/**
- *
- * @author Robert Field
- */
-public abstract class Rule {
+import java.util.*;
 
-    public final String name;
+class DiamondAndNonDenotableType<T> {
+    DiamondAndNonDenotableType(T t) {}
+}
 
-    public Rule(String name) {
-        this.name = name;
-    }
-
-    abstract boolean guard(ClassCase cc);
-
-    abstract void eval(ClassCase cc);
-
-    @Override
-    public String toString() {
-        return name;
-    }
+class DiamondAndNonDenotableTypes<T, S> {
+    DiamondAndNonDenotableTypes(T t, S s) {}
+    void m() {
+        List<?> wl = null;
+        new DiamondAndNonDenotableTypes<>(wl, wl) {};
+        new DiamondAndNonDenotableType<>(wl) {};
+    };
 }
diff --git a/langtools/test/tools/javac/doctree/AttrTest.java b/langtools/test/tools/javac/doctree/AttrTest.java
index 2e13a16..9eace13 100644
--- a/langtools/test/tools/javac/doctree/AttrTest.java
+++ b/langtools/test/tools/javac/doctree/AttrTest.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 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
@@ -23,7 +23,7 @@
 
 /*
  * @test
- * @bug 7021614
+ * @bug 7021614 8076026
  * @summary extend com.sun.source API to support parsing javadoc comments
  * @build DocCommentTester
  * @run main DocCommentTester AttrTest.java
@@ -55,6 +55,30 @@
 */
 
     /**
+     * <a name-test=hyphened>foo</a>
+     */
+    void hyphened_attr() { }
+/*
+DocComment[DOC_COMMENT, pos:1
+  firstSentence: 3
+    StartElement[START_ELEMENT, pos:1
+      name:a
+      attributes: 1
+        Attribute[ATTRIBUTE, pos:4
+          name: name-test
+          vkind: UNQUOTED
+          value: 1
+            Text[TEXT, pos:14, hyphened]
+        ]
+    ]
+    Text[TEXT, pos:23, foo]
+    EndElement[END_ELEMENT, pos:26, a]
+  body: empty
+  block tags: empty
+]
+*/
+
+    /**
      * <a name="double_quoted">foo</a>
      */
     void double_quoted_attr() { }
diff --git a/langtools/test/tools/javac/failover/CheckAttributedTree.java b/langtools/test/tools/javac/failover/CheckAttributedTree.java
index 34222c8..66f91ee 100644
--- a/langtools/test/tools/javac/failover/CheckAttributedTree.java
+++ b/langtools/test/tools/javac/failover/CheckAttributedTree.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,7 +23,7 @@
 
 /*
  * @test
- * @bug 6970584 8006694
+ * @bug 6970584 8006694 8062373
  * @summary assorted position errors in compiler syntax trees
  *  temporarily workaround combo tests are causing time out in several platforms
  * @library ../lib
@@ -290,7 +290,7 @@
             }
             public void finished(TaskEvent e) { }
         });
-
+        int i = 0;
         try {
             Iterable<? extends CompilationUnitTree> trees = task.parse();
 //            JavaCompiler c = JavaCompiler.instance(((JavacTaskImpl) task).getContext());
@@ -308,7 +308,7 @@
                    if (def.hasTag(CLASSDEF) &&
                            analyzedElems.contains(((JCTree.JCClassDecl)def).sym)) {
                        //System.err.println("Adding pair..." + cu.sourcefile + " " + ((JCTree.JCClassDecl) def).name);
-                       res.add(new Pair<>(cu, def));
+                       res.add((i++ % 2) == 0 ? new Pair<>(cu, def) {} : new Pair<>(cu, def));
                    }
                }
             }
diff --git a/langtools/test/tools/javac/generics/diamond/6939780/T6939780.java b/langtools/test/tools/javac/generics/diamond/6939780/T6939780.java
index 6d7ef0d..603d48b 100644
--- a/langtools/test/tools/javac/generics/diamond/6939780/T6939780.java
+++ b/langtools/test/tools/javac/generics/diamond/6939780/T6939780.java
@@ -1,11 +1,12 @@
 /*
  * @test /nodynamiccopyright/
- * @bug 6939780 7020044 8009459 8021338 8064365
+ * @bug 6939780 7020044 8009459 8021338 8064365 8062373
  *
- * @summary  add a warning to detect diamond sites
+ * @summary  add a warning to detect diamond sites (including anonymous class instance creation at source >= 9)
  * @author mcimadamore
  * @compile/ref=T6939780_7.out -Xlint:-options -source 7 T6939780.java -XDrawDiagnostics -XDfind=diamond
- * @compile/ref=T6939780_8.out T6939780.java -XDrawDiagnostics -XDfind=diamond
+ * @compile/ref=T6939780_8.out -Xlint:-options -source 8 T6939780.java -XDrawDiagnostics -XDfind=diamond
+ * @compile/ref=T6939780_9.out -Xlint:-options -source 9 T6939780.java -XDrawDiagnostics -XDfind=diamond
  *
  */
 
diff --git a/langtools/test/tools/javac/generics/diamond/6939780/T6939780_7.out b/langtools/test/tools/javac/generics/diamond/6939780/T6939780_7.out
index 52d621d..fbf2fe6 100644
--- a/langtools/test/tools/javac/generics/diamond/6939780/T6939780_7.out
+++ b/langtools/test/tools/javac/generics/diamond/6939780/T6939780_7.out
@@ -1,5 +1,5 @@
-T6939780.java:21:28: compiler.warn.diamond.redundant.args
-T6939780.java:22:28: compiler.warn.diamond.redundant.args.1: T6939780.Foo<java.lang.Integer>, T6939780.Foo<java.lang.Number>
-T6939780.java:30:19: compiler.warn.diamond.redundant.args
-T6939780.java:31:19: compiler.warn.diamond.redundant.args.1: T6939780.Foo<java.lang.Integer>, T6939780.Foo<java.lang.Number>
+T6939780.java:22:28: compiler.warn.diamond.redundant.args
+T6939780.java:23:28: compiler.warn.diamond.redundant.args.1: T6939780.Foo<java.lang.Integer>, T6939780.Foo<java.lang.Number>
+T6939780.java:31:19: compiler.warn.diamond.redundant.args
+T6939780.java:32:19: compiler.warn.diamond.redundant.args.1: T6939780.Foo<java.lang.Integer>, T6939780.Foo<java.lang.Number>
 4 warnings
diff --git a/langtools/test/tools/javac/generics/diamond/6939780/T6939780_8.out b/langtools/test/tools/javac/generics/diamond/6939780/T6939780_8.out
index 3d979d1..76e2ea0 100644
--- a/langtools/test/tools/javac/generics/diamond/6939780/T6939780_8.out
+++ b/langtools/test/tools/javac/generics/diamond/6939780/T6939780_8.out
@@ -1,7 +1,7 @@
-T6939780.java:20:33: compiler.warn.diamond.redundant.args
-T6939780.java:21:28: compiler.warn.diamond.redundant.args
-T6939780.java:22:28: compiler.warn.diamond.redundant.args.1: T6939780.Foo<java.lang.Integer>, T6939780.Foo<java.lang.Number>
-T6939780.java:29:19: compiler.warn.diamond.redundant.args
+T6939780.java:21:33: compiler.warn.diamond.redundant.args
+T6939780.java:22:28: compiler.warn.diamond.redundant.args
+T6939780.java:23:28: compiler.warn.diamond.redundant.args.1: T6939780.Foo<java.lang.Integer>, T6939780.Foo<java.lang.Number>
 T6939780.java:30:19: compiler.warn.diamond.redundant.args
-T6939780.java:31:19: compiler.warn.diamond.redundant.args.1: T6939780.Foo<java.lang.Integer>, T6939780.Foo<java.lang.Number>
+T6939780.java:31:19: compiler.warn.diamond.redundant.args
+T6939780.java:32:19: compiler.warn.diamond.redundant.args.1: T6939780.Foo<java.lang.Integer>, T6939780.Foo<java.lang.Number>
 6 warnings
diff --git a/langtools/test/tools/javac/generics/diamond/6939780/T6939780_9.out b/langtools/test/tools/javac/generics/diamond/6939780/T6939780_9.out
new file mode 100644
index 0000000..3088515
--- /dev/null
+++ b/langtools/test/tools/javac/generics/diamond/6939780/T6939780_9.out
@@ -0,0 +1,13 @@
+T6939780.java:21:33: compiler.warn.diamond.redundant.args
+T6939780.java:22:28: compiler.warn.diamond.redundant.args
+T6939780.java:23:28: compiler.warn.diamond.redundant.args.1: T6939780.Foo<java.lang.Integer>, T6939780.Foo<java.lang.Number>
+T6939780.java:24:33: compiler.warn.diamond.redundant.args
+T6939780.java:25:28: compiler.warn.diamond.redundant.args
+T6939780.java:26:28: compiler.warn.diamond.redundant.args
+T6939780.java:30:19: compiler.warn.diamond.redundant.args
+T6939780.java:31:19: compiler.warn.diamond.redundant.args
+T6939780.java:32:19: compiler.warn.diamond.redundant.args.1: T6939780.Foo<java.lang.Integer>, T6939780.Foo<java.lang.Number>
+T6939780.java:33:19: compiler.warn.diamond.redundant.args
+T6939780.java:34:19: compiler.warn.diamond.redundant.args
+T6939780.java:35:19: compiler.warn.diamond.redundant.args
+12 warnings
diff --git a/langtools/test/tools/javac/generics/diamond/6996914/T6996914a.java b/langtools/test/tools/javac/generics/diamond/6996914/T6996914a.java
index 47e7f98..b0f4232 100644
--- a/langtools/test/tools/javac/generics/diamond/6996914/T6996914a.java
+++ b/langtools/test/tools/javac/generics/diamond/6996914/T6996914a.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,7 +23,7 @@
 
 /*
  * @test
- * @bug 6996914 7020044
+ * @bug 6996914 7020044 8062373
  * @summary  Diamond inference: problem when accessing protected constructor
  * @run main T6996914a
  */
@@ -53,6 +53,17 @@
         }
     }
 
+    enum DiamondKind {
+        STANDARD("new Foo<>();"),
+        ANON("new Foo<>() {};");
+
+        String expr;
+
+        DiamondKind(String expr) {
+            this.expr = expr;
+        }
+    }
+
     enum ConstructorKind {
         PACKAGE(""),
         PROTECTED("protected"),
@@ -93,14 +104,14 @@
         final static String sourceStub =
                         "#I\n" +
                         "class Test {\n" +
-                        "  Foo<String> fs = new Foo<>();\n" +
+                        "  Foo<String> fs = #D\n" +
                         "}\n";
 
         String source;
 
-        public ClientClass(PackageKind pk) {
+        public ClientClass(PackageKind pk, DiamondKind dk) {
             super(URI.create("myfo:/Test.java"), JavaFileObject.Kind.SOURCE);
-            source = sourceStub.replace("#I", pk.importDecl);
+            source = sourceStub.replace("#I", pk.importDecl).replace("#D", dk.expr);
         }
 
         @Override
@@ -112,20 +123,22 @@
     public static void main(String... args) throws Exception {
         for (PackageKind pk : PackageKind.values()) {
             for (ConstructorKind ck : ConstructorKind.values()) {
-                    compileAndCheck(pk, ck);
+                for (DiamondKind dk : DiamondKind.values()) {
+                    compileAndCheck(pk, ck, dk);
+                }
             }
         }
     }
 
-    static void compileAndCheck(PackageKind pk, ConstructorKind ck) throws Exception {
+    static void compileAndCheck(PackageKind pk, ConstructorKind ck, DiamondKind dk) throws Exception {
         FooClass foo = new FooClass(pk, ck);
-        ClientClass client = new ClientClass(pk);
+        ClientClass client = new ClientClass(pk, dk);
         final JavaCompiler tool = ToolProvider.getSystemJavaCompiler();
         ErrorListener el = new ErrorListener();
         JavacTask ct = (JavacTask)tool.getTask(null, null, el,
                 null, null, Arrays.asList(foo, client));
         ct.analyze();
-        if (el.errors > 0 == check(pk, ck)) {
+        if (el.errors > 0 == check(pk, ck, dk)) {
             String msg = el.errors > 0 ?
                 "Error compiling files" :
                 "No error when compiling files";
@@ -133,9 +146,10 @@
         }
     }
 
-    static boolean check(PackageKind pk, ConstructorKind ck) {
+    static boolean check(PackageKind pk, ConstructorKind ck, DiamondKind dk) {
         switch (pk) {
-            case A: return ck == ConstructorKind.PUBLIC;
+            case A: return ck == ConstructorKind.PUBLIC ||
+                    (ck  == ConstructorKind.PROTECTED && dk == DiamondKind.ANON);
             case DEFAULT: return ck != ConstructorKind.PRIVATE;
             default: throw new AssertionError("Unknown package kind");
         }
diff --git a/langtools/test/tools/javac/generics/diamond/6996914/T6996914b.java b/langtools/test/tools/javac/generics/diamond/6996914/T6996914b.java
index 42339db..651ce36 100644
--- a/langtools/test/tools/javac/generics/diamond/6996914/T6996914b.java
+++ b/langtools/test/tools/javac/generics/diamond/6996914/T6996914b.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,7 +23,7 @@
 
 /*
  * @test
- * @bug 6996914 7020044
+ * @bug 6996914 7020044 8062373
  * @summary  Diamond inference: problem when accessing protected constructor
  * @compile T6996914b.java
  */
@@ -35,4 +35,5 @@
 
 class Test {
     Super<String,Integer> ssi1 = new Super<>(1, "", 2);
+    Super<String,Integer> ssi2 = new Super<>(1, "", 2) {};
 }
diff --git a/langtools/test/tools/javac/generics/diamond/8065986/T8065986b.java b/langtools/test/tools/javac/generics/diamond/8065986/T8065986b.java
index 40a6a8b..9793363 100644
--- a/langtools/test/tools/javac/generics/diamond/8065986/T8065986b.java
+++ b/langtools/test/tools/javac/generics/diamond/8065986/T8065986b.java
@@ -1,6 +1,6 @@
 /*
  * @test /nodynamiccopyright/
- * @bug 8065986
+ * @bug 8065986 8062373
  *
  * @summary Compiler fails to NullPointerException when calling super with Object<>()
  * @compile/fail/ref=T8065986b.out T8065986b.java -XDrawDiagnostics
@@ -29,5 +29,12 @@
         this(cond ? o1 : o2);
     }
 
+    T8065986b(int x) {
+        this(new Object<>() {});
+    }
+
+    T8065986b(int x, int y) {
+        this(new ArrayList<>() {});
+    }
     static void m() { }
 }
diff --git a/langtools/test/tools/javac/generics/diamond/8065986/T8065986b.out b/langtools/test/tools/javac/generics/diamond/8065986/T8065986b.out
index 30bcfb6..ec65f48 100644
--- a/langtools/test/tools/javac/generics/diamond/8065986/T8065986b.out
+++ b/langtools/test/tools/javac/generics/diamond/8065986/T8065986b.out
@@ -1,6 +1,8 @@
 T8065986b.java:13:24: compiler.err.cant.apply.diamond.1: java.lang.Object, (compiler.misc.diamond.non.generic: java.lang.Object)
-T8065986b.java:17:9: compiler.err.cant.apply.symbols: kindname.constructor, T8065986b, java.util.ArrayList<java.lang.Object>,{(compiler.misc.inapplicable.method: kindname.constructor, T8065986b, T8065986b(), (compiler.misc.arg.length.mismatch)),(compiler.misc.inapplicable.method: kindname.constructor, T8065986b, T8065986b(boolean), (compiler.misc.no.conforming.assignment.exists: (compiler.misc.cant.apply.diamond.1: (compiler.misc.diamond: java.util.ArrayList), (compiler.misc.infer.no.conforming.instance.exists: E, java.util.ArrayList<E>, boolean)))),(compiler.misc.inapplicable.method: kindname.constructor, T8065986b, T8065986b(boolean,boolean), (compiler.misc.arg.length.mismatch)),(compiler.misc.inapplicable.method: kindname.constructor, T8065986b, T8065986b(boolean,boolean,boolean), (compiler.misc.arg.length.mismatch)),(compiler.misc.inapplicable.method: kindname.constructor, T8065986b, T8065986b(boolean,java.lang.Object,java.lang.Object), (compiler.misc.arg.length.mismatch))}
-T8065986b.java:21:9: compiler.err.cant.apply.symbols: kindname.constructor, T8065986b, @435,{(compiler.misc.inapplicable.method: kindname.constructor, T8065986b, T8065986b(), (compiler.misc.arg.length.mismatch)),(compiler.misc.inapplicable.method: kindname.constructor, T8065986b, T8065986b(boolean), (compiler.misc.no.conforming.assignment.exists: (compiler.misc.not.a.functional.intf: boolean))),(compiler.misc.inapplicable.method: kindname.constructor, T8065986b, T8065986b(boolean,boolean), (compiler.misc.arg.length.mismatch)),(compiler.misc.inapplicable.method: kindname.constructor, T8065986b, T8065986b(boolean,boolean,boolean), (compiler.misc.arg.length.mismatch)),(compiler.misc.inapplicable.method: kindname.constructor, T8065986b, T8065986b(boolean,java.lang.Object,java.lang.Object), (compiler.misc.arg.length.mismatch))}
-T8065986b.java:25:9: compiler.err.cant.apply.symbols: kindname.constructor, T8065986b, @516,{(compiler.misc.inapplicable.method: kindname.constructor, T8065986b, T8065986b(), (compiler.misc.arg.length.mismatch)),(compiler.misc.inapplicable.method: kindname.constructor, T8065986b, T8065986b(boolean), (compiler.misc.no.conforming.assignment.exists: (compiler.misc.not.a.functional.intf: boolean))),(compiler.misc.inapplicable.method: kindname.constructor, T8065986b, T8065986b(boolean,boolean), (compiler.misc.arg.length.mismatch)),(compiler.misc.inapplicable.method: kindname.constructor, T8065986b, T8065986b(boolean,boolean,boolean), (compiler.misc.arg.length.mismatch)),(compiler.misc.inapplicable.method: kindname.constructor, T8065986b, T8065986b(boolean,java.lang.Object,java.lang.Object), (compiler.misc.arg.length.mismatch))}
-T8065986b.java:29:9: compiler.err.cant.apply.symbols: kindname.constructor, T8065986b, @603,{(compiler.misc.inapplicable.method: kindname.constructor, T8065986b, T8065986b(), (compiler.misc.arg.length.mismatch)),(compiler.misc.inapplicable.method: kindname.constructor, T8065986b, T8065986b(boolean), (compiler.misc.no.conforming.assignment.exists: (compiler.misc.incompatible.type.in.conditional: (compiler.misc.inconvertible.types: java.lang.Object, boolean)))),(compiler.misc.inapplicable.method: kindname.constructor, T8065986b, T8065986b(boolean,boolean), (compiler.misc.arg.length.mismatch)),(compiler.misc.inapplicable.method: kindname.constructor, T8065986b, T8065986b(boolean,boolean,boolean), (compiler.misc.arg.length.mismatch)),(compiler.misc.inapplicable.method: kindname.constructor, T8065986b, T8065986b(boolean,java.lang.Object,java.lang.Object), (compiler.misc.arg.length.mismatch))}
-5 errors
+T8065986b.java:17:9: compiler.err.cant.apply.symbols: kindname.constructor, T8065986b, java.util.ArrayList<java.lang.Object>,{(compiler.misc.inapplicable.method: kindname.constructor, T8065986b, T8065986b(), (compiler.misc.arg.length.mismatch)),(compiler.misc.inapplicable.method: kindname.constructor, T8065986b, T8065986b(boolean), (compiler.misc.no.conforming.assignment.exists: (compiler.misc.cant.apply.diamond.1: (compiler.misc.diamond: java.util.ArrayList), (compiler.misc.infer.no.conforming.instance.exists: E, java.util.ArrayList<E>, boolean)))),(compiler.misc.inapplicable.method: kindname.constructor, T8065986b, T8065986b(boolean,boolean), (compiler.misc.arg.length.mismatch)),(compiler.misc.inapplicable.method: kindname.constructor, T8065986b, T8065986b(boolean,boolean,boolean), (compiler.misc.arg.length.mismatch)),(compiler.misc.inapplicable.method: kindname.constructor, T8065986b, T8065986b(boolean,java.lang.Object,java.lang.Object), (compiler.misc.arg.length.mismatch)),(compiler.misc.inapplicable.method: kindname.constructor, T8065986b, T8065986b(int), (compiler.misc.no.conforming.assignment.exists: (compiler.misc.cant.apply.diamond.1: (compiler.misc.diamond: java.util.ArrayList), (compiler.misc.infer.no.conforming.instance.exists: E, java.util.ArrayList<E>, int)))),(compiler.misc.inapplicable.method: kindname.constructor, T8065986b, T8065986b(int,int), (compiler.misc.arg.length.mismatch))}
+T8065986b.java:21:9: compiler.err.cant.apply.symbols: kindname.constructor, T8065986b, @443,{(compiler.misc.inapplicable.method: kindname.constructor, T8065986b, T8065986b(), (compiler.misc.arg.length.mismatch)),(compiler.misc.inapplicable.method: kindname.constructor, T8065986b, T8065986b(boolean), (compiler.misc.no.conforming.assignment.exists: (compiler.misc.not.a.functional.intf: boolean))),(compiler.misc.inapplicable.method: kindname.constructor, T8065986b, T8065986b(boolean,boolean), (compiler.misc.arg.length.mismatch)),(compiler.misc.inapplicable.method: kindname.constructor, T8065986b, T8065986b(boolean,boolean,boolean), (compiler.misc.arg.length.mismatch)),(compiler.misc.inapplicable.method: kindname.constructor, T8065986b, T8065986b(boolean,java.lang.Object,java.lang.Object), (compiler.misc.arg.length.mismatch)),(compiler.misc.inapplicable.method: kindname.constructor, T8065986b, T8065986b(int), (compiler.misc.no.conforming.assignment.exists: (compiler.misc.not.a.functional.intf: int))),(compiler.misc.inapplicable.method: kindname.constructor, T8065986b, T8065986b(int,int), (compiler.misc.arg.length.mismatch))}
+T8065986b.java:25:9: compiler.err.cant.apply.symbols: kindname.constructor, T8065986b, @524,{(compiler.misc.inapplicable.method: kindname.constructor, T8065986b, T8065986b(), (compiler.misc.arg.length.mismatch)),(compiler.misc.inapplicable.method: kindname.constructor, T8065986b, T8065986b(boolean), (compiler.misc.no.conforming.assignment.exists: (compiler.misc.not.a.functional.intf: boolean))),(compiler.misc.inapplicable.method: kindname.constructor, T8065986b, T8065986b(boolean,boolean), (compiler.misc.arg.length.mismatch)),(compiler.misc.inapplicable.method: kindname.constructor, T8065986b, T8065986b(boolean,boolean,boolean), (compiler.misc.arg.length.mismatch)),(compiler.misc.inapplicable.method: kindname.constructor, T8065986b, T8065986b(boolean,java.lang.Object,java.lang.Object), (compiler.misc.arg.length.mismatch)),(compiler.misc.inapplicable.method: kindname.constructor, T8065986b, T8065986b(int), (compiler.misc.no.conforming.assignment.exists: (compiler.misc.not.a.functional.intf: int))),(compiler.misc.inapplicable.method: kindname.constructor, T8065986b, T8065986b(int,int), (compiler.misc.arg.length.mismatch))}
+T8065986b.java:29:9: compiler.err.cant.apply.symbols: kindname.constructor, T8065986b, @611,{(compiler.misc.inapplicable.method: kindname.constructor, T8065986b, T8065986b(), (compiler.misc.arg.length.mismatch)),(compiler.misc.inapplicable.method: kindname.constructor, T8065986b, T8065986b(boolean), (compiler.misc.no.conforming.assignment.exists: (compiler.misc.incompatible.type.in.conditional: (compiler.misc.inconvertible.types: java.lang.Object, boolean)))),(compiler.misc.inapplicable.method: kindname.constructor, T8065986b, T8065986b(boolean,boolean), (compiler.misc.arg.length.mismatch)),(compiler.misc.inapplicable.method: kindname.constructor, T8065986b, T8065986b(boolean,boolean,boolean), (compiler.misc.arg.length.mismatch)),(compiler.misc.inapplicable.method: kindname.constructor, T8065986b, T8065986b(boolean,java.lang.Object,java.lang.Object), (compiler.misc.arg.length.mismatch)),(compiler.misc.inapplicable.method: kindname.constructor, T8065986b, T8065986b(int), (compiler.misc.no.conforming.assignment.exists: (compiler.misc.incompatible.type.in.conditional: (compiler.misc.inconvertible.types: java.lang.Object, int)))),(compiler.misc.inapplicable.method: kindname.constructor, T8065986b, T8065986b(int,int), (compiler.misc.arg.length.mismatch))}
+T8065986b.java:33:24: compiler.err.cant.apply.diamond.1: java.lang.Object, (compiler.misc.diamond.non.generic: java.lang.Object)
+T8065986b.java:37:9: compiler.err.cant.apply.symbols: kindname.constructor, T8065986b, java.util.ArrayList<java.lang.Object>,{(compiler.misc.inapplicable.method: kindname.constructor, T8065986b, T8065986b(), (compiler.misc.arg.length.mismatch)),(compiler.misc.inapplicable.method: kindname.constructor, T8065986b, T8065986b(boolean), (compiler.misc.no.conforming.assignment.exists: (compiler.misc.cant.apply.diamond.1: (compiler.misc.diamond: java.util.ArrayList), (compiler.misc.infer.no.conforming.instance.exists: E, java.util.ArrayList<E>, boolean)))),(compiler.misc.inapplicable.method: kindname.constructor, T8065986b, T8065986b(boolean,boolean), (compiler.misc.arg.length.mismatch)),(compiler.misc.inapplicable.method: kindname.constructor, T8065986b, T8065986b(boolean,boolean,boolean), (compiler.misc.arg.length.mismatch)),(compiler.misc.inapplicable.method: kindname.constructor, T8065986b, T8065986b(boolean,java.lang.Object,java.lang.Object), (compiler.misc.arg.length.mismatch)),(compiler.misc.inapplicable.method: kindname.constructor, T8065986b, T8065986b(int), (compiler.misc.no.conforming.assignment.exists: (compiler.misc.cant.apply.diamond.1: (compiler.misc.diamond: java.util.ArrayList), (compiler.misc.infer.no.conforming.instance.exists: E, java.util.ArrayList<E>, int)))),(compiler.misc.inapplicable.method: kindname.constructor, T8065986b, T8065986b(int,int), (compiler.misc.arg.length.mismatch))}
+7 errors
diff --git a/jdk/test/jdk/lambda/shapegen/Rule.java b/langtools/test/tools/javac/generics/diamond/MultipleInferenceHooksTest.java
similarity index 67%
copy from jdk/test/jdk/lambda/shapegen/Rule.java
copy to langtools/test/tools/javac/generics/diamond/MultipleInferenceHooksTest.java
index 7ff02e0..af3f943 100644
--- a/jdk/test/jdk/lambda/shapegen/Rule.java
+++ b/langtools/test/tools/javac/generics/diamond/MultipleInferenceHooksTest.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
+ * 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
@@ -21,26 +21,18 @@
  * questions.
  */
 
-package shapegen;
-
-/**
- *
- * @author Robert Field
+/*
+ * @test
+ * @bug 8062373
+ * @summary Test that <>(){} works fine without verify error when there are multiple post inference hooks.
  */
-public abstract class Rule {
 
-    public final String name;
+import java.util.Collections;
+import java.util.IdentityHashMap;
+import java.util.Set;
 
-    public Rule(String name) {
-        this.name = name;
-    }
-
-    abstract boolean guard(ClassCase cc);
-
-    abstract void eval(ClassCase cc);
-
-    @Override
-    public String toString() {
-        return name;
+public class MultipleInferenceHooksTest {
+    public static void main(String[] args) {
+        Set<String> result = Collections.newSetFromMap(new IdentityHashMap<>() {});
     }
 }
diff --git a/langtools/test/tools/javac/generics/diamond/neg/Neg01.java b/langtools/test/tools/javac/generics/diamond/neg/Neg01.java
index acbb06c..f0e9839 100644
--- a/langtools/test/tools/javac/generics/diamond/neg/Neg01.java
+++ b/langtools/test/tools/javac/generics/diamond/neg/Neg01.java
@@ -1,6 +1,6 @@
 /*
  * @test /nodynamiccopyright/
- * @bug 6939620 7020044
+ * @bug 6939620 7020044 8062373
  *
  * @summary  Check that diamond fails when inference violates declared bounds
  *           (basic test with nested class, generic/non-generic constructors)
@@ -25,5 +25,16 @@
         Neg01<? extends String> n6 = new Neg01<>("", "");
         Neg01<?> n7 = new Neg01<>("", "");
         Foo<? super String> n8 = new Neg01<>("", "");
+
+        Neg01<String> n9 = new Neg01<>("", ""){};
+        Neg01<? extends String> n10 = new Neg01<>("", ""){};
+        Neg01<?> n11 = new Neg01<>("", ""){};
+        Neg01<? super String> n12 = new Neg01<>("", ""){};
+
+        Neg01<String> n13 = new Neg01<>(""){};
+        Neg01<? extends String> n14 = new Neg01<>(""){};
+        Neg01<?> n15 = new Neg01<>(""){};
+        Neg01<? super String> n16 = new Neg01<>(""){};
+
     }
 }
diff --git a/langtools/test/tools/javac/generics/diamond/neg/Neg01.out b/langtools/test/tools/javac/generics/diamond/neg/Neg01.out
index c2bbf4c..4f54718d 100644
--- a/langtools/test/tools/javac/generics/diamond/neg/Neg01.out
+++ b/langtools/test/tools/javac/generics/diamond/neg/Neg01.out
@@ -12,4 +12,18 @@
 Neg01.java:26:23: compiler.err.cant.apply.diamond: (compiler.misc.diamond: Neg01), null
 Neg01.java:27:9: compiler.err.cant.resolve.location: kindname.class, Foo, , , (compiler.misc.location: kindname.class, Neg01<X>, null)
 Neg01.java:27:34: compiler.err.cant.apply.diamond: (compiler.misc.diamond: Neg01), null
-14 errors
+Neg01.java:29:15: compiler.err.not.within.bounds: java.lang.String, X
+Neg01.java:29:28: compiler.err.cant.apply.diamond: (compiler.misc.diamond: Neg01), null
+Neg01.java:30:15: compiler.err.not.within.bounds: ? extends java.lang.String, X
+Neg01.java:30:39: compiler.err.cant.apply.diamond: (compiler.misc.diamond: Neg01), null
+Neg01.java:31:24: compiler.err.cant.apply.diamond: (compiler.misc.diamond: Neg01), null
+Neg01.java:32:15: compiler.err.not.within.bounds: ? super java.lang.String, X
+Neg01.java:32:37: compiler.err.cant.apply.diamond: (compiler.misc.diamond: Neg01), null
+Neg01.java:34:15: compiler.err.not.within.bounds: java.lang.String, X
+Neg01.java:34:29: compiler.err.cant.apply.diamond: (compiler.misc.diamond: Neg01), null
+Neg01.java:35:15: compiler.err.not.within.bounds: ? extends java.lang.String, X
+Neg01.java:35:39: compiler.err.cant.apply.diamond: (compiler.misc.diamond: Neg01), null
+Neg01.java:36:24: compiler.err.cant.apply.diamond: (compiler.misc.diamond: Neg01), null
+Neg01.java:37:15: compiler.err.not.within.bounds: ? super java.lang.String, X
+Neg01.java:37:37: compiler.err.cant.apply.diamond: (compiler.misc.diamond: Neg01), null
+28 errors
diff --git a/langtools/test/tools/javac/generics/diamond/neg/Neg02.java b/langtools/test/tools/javac/generics/diamond/neg/Neg02.java
index ac4cc2c..26ff47d 100644
--- a/langtools/test/tools/javac/generics/diamond/neg/Neg02.java
+++ b/langtools/test/tools/javac/generics/diamond/neg/Neg02.java
@@ -1,6 +1,6 @@
 /*
  * @test /nodynamiccopyright/
- * @bug 6939620 7020044
+ * @bug 6939620 7020044 8062373
  *
  * @summary  Check that diamond fails when inference violates declared bounds
  *           (test with nested class, qualified/simple type expressions)
@@ -26,6 +26,16 @@
         Foo<? extends String> f6 = new Foo<>("", "");
         Foo<?> f7 = new Foo<>("", "");
         Foo<? super String> f8 = new Foo<>("", "");
+
+        Foo<String> f9 = new Foo<>(""){};
+        Foo<? extends String> f10 = new Foo<>(""){};
+        Foo<?> f11 = new Foo<>(""){};
+        Foo<? super String> f12 = new Foo<>(""){};
+
+        Foo<String> f13 = new Foo<>("", ""){};
+        Foo<? extends String> f14 = new Foo<>("", ""){};
+        Foo<?> f15 = new Foo<>("", ""){};
+        Foo<? super String> f16 = new Foo<>("", ""){};
     }
 
     void testQualified() {
@@ -38,5 +48,15 @@
         Foo<? extends String> f6 = new Neg02.Foo<>("", "");
         Foo<?> f7 = new Neg02.Foo<>("", "");
         Foo<? super String> f8 = new Neg02.Foo<>("", "");
+
+        Foo<String> f9 = new Neg02.Foo<>(""){};
+        Foo<? extends String> f10 = new Neg02.Foo<>(""){};
+        Foo<?> f11 = new Neg02.Foo<>(""){};
+        Foo<? super String> f12 = new Neg02.Foo<>(""){};
+
+        Foo<String> f13 = new Neg02.Foo<>("", ""){};
+        Foo<? extends String> f14 = new Neg02.Foo<>("", ""){};
+        Foo<?> f15 = new Neg02.Foo<>("", ""){};
+        Foo<? super String> f16 = new Neg02.Foo<>("", ""){};
     }
 }
diff --git a/langtools/test/tools/javac/generics/diamond/neg/Neg02.out b/langtools/test/tools/javac/generics/diamond/neg/Neg02.out
index 4e3d7d2..73126ec 100644
--- a/langtools/test/tools/javac/generics/diamond/neg/Neg02.out
+++ b/langtools/test/tools/javac/generics/diamond/neg/Neg02.out
@@ -12,18 +12,46 @@
 Neg02.java:27:21: compiler.err.cant.apply.diamond: (compiler.misc.diamond: Neg02.Foo), null
 Neg02.java:28:13: compiler.err.not.within.bounds: ? super java.lang.String, X
 Neg02.java:28:34: compiler.err.cant.apply.diamond: (compiler.misc.diamond: Neg02.Foo), null
-Neg02.java:32:13: compiler.err.not.within.bounds: java.lang.String, X
-Neg02.java:32:26: compiler.err.cant.apply.diamond: (compiler.misc.diamond: Neg02.Foo), null
-Neg02.java:33:13: compiler.err.not.within.bounds: ? extends java.lang.String, X
-Neg02.java:33:36: compiler.err.cant.apply.diamond: (compiler.misc.diamond: Neg02.Foo), null
-Neg02.java:34:21: compiler.err.cant.apply.diamond: (compiler.misc.diamond: Neg02.Foo), null
-Neg02.java:35:13: compiler.err.not.within.bounds: ? super java.lang.String, X
-Neg02.java:35:34: compiler.err.cant.apply.diamond: (compiler.misc.diamond: Neg02.Foo), null
-Neg02.java:37:13: compiler.err.not.within.bounds: java.lang.String, X
-Neg02.java:37:26: compiler.err.cant.apply.diamond: (compiler.misc.diamond: Neg02.Foo), null
-Neg02.java:38:13: compiler.err.not.within.bounds: ? extends java.lang.String, X
-Neg02.java:38:36: compiler.err.cant.apply.diamond: (compiler.misc.diamond: Neg02.Foo), null
-Neg02.java:39:21: compiler.err.cant.apply.diamond: (compiler.misc.diamond: Neg02.Foo), null
-Neg02.java:40:13: compiler.err.not.within.bounds: ? super java.lang.String, X
-Neg02.java:40:34: compiler.err.cant.apply.diamond: (compiler.misc.diamond: Neg02.Foo), null
-28 errors
+Neg02.java:30:13: compiler.err.not.within.bounds: java.lang.String, X
+Neg02.java:30:26: compiler.err.cant.apply.diamond: (compiler.misc.diamond: Neg02.Foo), null
+Neg02.java:31:13: compiler.err.not.within.bounds: ? extends java.lang.String, X
+Neg02.java:31:37: compiler.err.cant.apply.diamond: (compiler.misc.diamond: Neg02.Foo), null
+Neg02.java:32:22: compiler.err.cant.apply.diamond: (compiler.misc.diamond: Neg02.Foo), null
+Neg02.java:33:13: compiler.err.not.within.bounds: ? super java.lang.String, X
+Neg02.java:33:35: compiler.err.cant.apply.diamond: (compiler.misc.diamond: Neg02.Foo), null
+Neg02.java:35:13: compiler.err.not.within.bounds: java.lang.String, X
+Neg02.java:35:27: compiler.err.cant.apply.diamond: (compiler.misc.diamond: Neg02.Foo), null
+Neg02.java:36:13: compiler.err.not.within.bounds: ? extends java.lang.String, X
+Neg02.java:36:37: compiler.err.cant.apply.diamond: (compiler.misc.diamond: Neg02.Foo), null
+Neg02.java:37:22: compiler.err.cant.apply.diamond: (compiler.misc.diamond: Neg02.Foo), null
+Neg02.java:38:13: compiler.err.not.within.bounds: ? super java.lang.String, X
+Neg02.java:38:35: compiler.err.cant.apply.diamond: (compiler.misc.diamond: Neg02.Foo), null
+Neg02.java:42:13: compiler.err.not.within.bounds: java.lang.String, X
+Neg02.java:42:26: compiler.err.cant.apply.diamond: (compiler.misc.diamond: Neg02.Foo), null
+Neg02.java:43:13: compiler.err.not.within.bounds: ? extends java.lang.String, X
+Neg02.java:43:36: compiler.err.cant.apply.diamond: (compiler.misc.diamond: Neg02.Foo), null
+Neg02.java:44:21: compiler.err.cant.apply.diamond: (compiler.misc.diamond: Neg02.Foo), null
+Neg02.java:45:13: compiler.err.not.within.bounds: ? super java.lang.String, X
+Neg02.java:45:34: compiler.err.cant.apply.diamond: (compiler.misc.diamond: Neg02.Foo), null
+Neg02.java:47:13: compiler.err.not.within.bounds: java.lang.String, X
+Neg02.java:47:26: compiler.err.cant.apply.diamond: (compiler.misc.diamond: Neg02.Foo), null
+Neg02.java:48:13: compiler.err.not.within.bounds: ? extends java.lang.String, X
+Neg02.java:48:36: compiler.err.cant.apply.diamond: (compiler.misc.diamond: Neg02.Foo), null
+Neg02.java:49:21: compiler.err.cant.apply.diamond: (compiler.misc.diamond: Neg02.Foo), null
+Neg02.java:50:13: compiler.err.not.within.bounds: ? super java.lang.String, X
+Neg02.java:50:34: compiler.err.cant.apply.diamond: (compiler.misc.diamond: Neg02.Foo), null
+Neg02.java:52:13: compiler.err.not.within.bounds: java.lang.String, X
+Neg02.java:52:26: compiler.err.cant.apply.diamond: (compiler.misc.diamond: Neg02.Foo), null
+Neg02.java:53:13: compiler.err.not.within.bounds: ? extends java.lang.String, X
+Neg02.java:53:37: compiler.err.cant.apply.diamond: (compiler.misc.diamond: Neg02.Foo), null
+Neg02.java:54:22: compiler.err.cant.apply.diamond: (compiler.misc.diamond: Neg02.Foo), null
+Neg02.java:55:13: compiler.err.not.within.bounds: ? super java.lang.String, X
+Neg02.java:55:35: compiler.err.cant.apply.diamond: (compiler.misc.diamond: Neg02.Foo), null
+Neg02.java:57:13: compiler.err.not.within.bounds: java.lang.String, X
+Neg02.java:57:27: compiler.err.cant.apply.diamond: (compiler.misc.diamond: Neg02.Foo), null
+Neg02.java:58:13: compiler.err.not.within.bounds: ? extends java.lang.String, X
+Neg02.java:58:37: compiler.err.cant.apply.diamond: (compiler.misc.diamond: Neg02.Foo), null
+Neg02.java:59:22: compiler.err.cant.apply.diamond: (compiler.misc.diamond: Neg02.Foo), null
+Neg02.java:60:13: compiler.err.not.within.bounds: ? super java.lang.String, X
+Neg02.java:60:35: compiler.err.cant.apply.diamond: (compiler.misc.diamond: Neg02.Foo), null
+56 errors
diff --git a/langtools/test/tools/javac/generics/diamond/neg/Neg03.java b/langtools/test/tools/javac/generics/diamond/neg/Neg03.java
index 83994b3..54e6812 100644
--- a/langtools/test/tools/javac/generics/diamond/neg/Neg03.java
+++ b/langtools/test/tools/javac/generics/diamond/neg/Neg03.java
@@ -1,6 +1,6 @@
 /*
  * @test /nodynamiccopyright/
- * @bug 6939620 7020044
+ * @bug 6939620 7020044 8062373
  *
  * @summary  Check that diamond fails when inference violates declared bounds
  *           (test with inner class, qualified/simple type expressions)
@@ -26,6 +26,16 @@
         Foo<? extends String> f6 = new Foo<>("", "");
         Foo<?> f7 = new Foo<>("", "");
         Foo<? super String> f8 = new Foo<>("", "");
+
+        Foo<String> f9 = new Foo<>(""){};
+        Foo<? extends String> f10 = new Foo<>(""){};
+        Foo<?> f11 = new Foo<>(""){};
+        Foo<? super String> f12 = new Foo<>(""){};
+
+        Foo<String> f13 = new Foo<>("", ""){};
+        Foo<? extends String> f14 = new Foo<>("", ""){};
+        Foo<?> f15 = new Foo<>("", ""){};
+        Foo<? super String> f16 = new Foo<>("", ""){};
     }
 
     void testQualified_1() {
@@ -38,6 +48,16 @@
         Foo<? extends String> f6 = new Neg03<U>.Foo<>("", "");
         Foo<?> f7 = new Neg03<U>.Foo<>("", "");
         Foo<? super String> f8 = new Neg03<U>.Foo<>("", "");
+
+        Foo<String> f9 = new Neg03<U>.Foo<>(""){};
+        Foo<? extends String> f10 = new Neg03<U>.Foo<>(""){};
+        Foo<?> f11 = new Neg03<U>.Foo<>(""){};
+        Foo<? super String> f12 = new Neg03<U>.Foo<>(""){};
+
+        Foo<String> f13 = new Neg03<U>.Foo<>("", ""){};
+        Foo<? extends String> f14 = new Neg03<U>.Foo<>("", ""){};
+        Foo<?> f15 = new Neg03<U>.Foo<>("", ""){};
+        Foo<? super String> f16 = new Neg03<U>.Foo<>("", ""){};
     }
 
     void testQualified_2(Neg03<U> n) {
@@ -50,5 +70,15 @@
         Foo<? extends String> f6 = n.new Foo<>("", "");
         Foo<?> f7 = n.new Foo<>("", "");
         Foo<? super String> f8 = n.new Foo<>("", "");
+
+        Foo<String> f9 = n.new Foo<>(""){};
+        Foo<? extends String> f10 = n.new Foo<>(""){};
+        Foo<?> f11 = n.new Foo<>(""){};
+        Foo<? super String> f12 = n.new Foo<>(""){};
+
+        Foo<String> f13 = n.new Foo<>("", ""){};
+        Foo<? extends String> f14 = n.new Foo<>("", ""){};
+        Foo<?> f15 = n.new Foo<>("", ""){};
+        Foo<? super String> f16 = n.new Foo<>("", ""){};
     }
 }
diff --git a/langtools/test/tools/javac/generics/diamond/neg/Neg03.out b/langtools/test/tools/javac/generics/diamond/neg/Neg03.out
index b255fca..20ecb6c 100644
--- a/langtools/test/tools/javac/generics/diamond/neg/Neg03.out
+++ b/langtools/test/tools/javac/generics/diamond/neg/Neg03.out
@@ -12,32 +12,74 @@
 Neg03.java:27:21: compiler.err.cant.apply.diamond: (compiler.misc.diamond: Neg03.Foo), null
 Neg03.java:28:13: compiler.err.not.within.bounds: ? super java.lang.String, V
 Neg03.java:28:34: compiler.err.cant.apply.diamond: (compiler.misc.diamond: Neg03.Foo), null
-Neg03.java:32:13: compiler.err.not.within.bounds: java.lang.String, V
-Neg03.java:32:26: compiler.err.cant.apply.diamond: (compiler.misc.diamond: Neg03.Foo), null
-Neg03.java:33:13: compiler.err.not.within.bounds: ? extends java.lang.String, V
-Neg03.java:33:36: compiler.err.cant.apply.diamond: (compiler.misc.diamond: Neg03.Foo), null
-Neg03.java:34:21: compiler.err.cant.apply.diamond: (compiler.misc.diamond: Neg03.Foo), null
-Neg03.java:35:13: compiler.err.not.within.bounds: ? super java.lang.String, V
-Neg03.java:35:34: compiler.err.cant.apply.diamond: (compiler.misc.diamond: Neg03.Foo), null
-Neg03.java:37:13: compiler.err.not.within.bounds: java.lang.String, V
-Neg03.java:37:26: compiler.err.cant.apply.diamond: (compiler.misc.diamond: Neg03.Foo), null
-Neg03.java:38:13: compiler.err.not.within.bounds: ? extends java.lang.String, V
-Neg03.java:38:36: compiler.err.cant.apply.diamond: (compiler.misc.diamond: Neg03.Foo), null
-Neg03.java:39:21: compiler.err.cant.apply.diamond: (compiler.misc.diamond: Neg03.Foo), null
-Neg03.java:40:13: compiler.err.not.within.bounds: ? super java.lang.String, V
-Neg03.java:40:34: compiler.err.cant.apply.diamond: (compiler.misc.diamond: Neg03.Foo), null
-Neg03.java:44:13: compiler.err.not.within.bounds: java.lang.String, V
-Neg03.java:44:28: compiler.err.cant.apply.diamond: (compiler.misc.diamond: Neg03.Foo), null
-Neg03.java:45:13: compiler.err.not.within.bounds: ? extends java.lang.String, V
-Neg03.java:45:38: compiler.err.cant.apply.diamond: (compiler.misc.diamond: Neg03.Foo), null
-Neg03.java:46:23: compiler.err.cant.apply.diamond: (compiler.misc.diamond: Neg03.Foo), null
-Neg03.java:47:13: compiler.err.not.within.bounds: ? super java.lang.String, V
-Neg03.java:47:36: compiler.err.cant.apply.diamond: (compiler.misc.diamond: Neg03.Foo), null
-Neg03.java:49:13: compiler.err.not.within.bounds: java.lang.String, V
-Neg03.java:49:28: compiler.err.cant.apply.diamond: (compiler.misc.diamond: Neg03.Foo), null
-Neg03.java:50:13: compiler.err.not.within.bounds: ? extends java.lang.String, V
-Neg03.java:50:38: compiler.err.cant.apply.diamond: (compiler.misc.diamond: Neg03.Foo), null
-Neg03.java:51:23: compiler.err.cant.apply.diamond: (compiler.misc.diamond: Neg03.Foo), null
-Neg03.java:52:13: compiler.err.not.within.bounds: ? super java.lang.String, V
-Neg03.java:52:36: compiler.err.cant.apply.diamond: (compiler.misc.diamond: Neg03.Foo), null
-42 errors
+Neg03.java:30:13: compiler.err.not.within.bounds: java.lang.String, V
+Neg03.java:30:26: compiler.err.cant.apply.diamond: (compiler.misc.diamond: Neg03.Foo), null
+Neg03.java:31:13: compiler.err.not.within.bounds: ? extends java.lang.String, V
+Neg03.java:31:37: compiler.err.cant.apply.diamond: (compiler.misc.diamond: Neg03.Foo), null
+Neg03.java:32:22: compiler.err.cant.apply.diamond: (compiler.misc.diamond: Neg03.Foo), null
+Neg03.java:33:13: compiler.err.not.within.bounds: ? super java.lang.String, V
+Neg03.java:33:35: compiler.err.cant.apply.diamond: (compiler.misc.diamond: Neg03.Foo), null
+Neg03.java:35:13: compiler.err.not.within.bounds: java.lang.String, V
+Neg03.java:35:27: compiler.err.cant.apply.diamond: (compiler.misc.diamond: Neg03.Foo), null
+Neg03.java:36:13: compiler.err.not.within.bounds: ? extends java.lang.String, V
+Neg03.java:36:37: compiler.err.cant.apply.diamond: (compiler.misc.diamond: Neg03.Foo), null
+Neg03.java:37:22: compiler.err.cant.apply.diamond: (compiler.misc.diamond: Neg03.Foo), null
+Neg03.java:38:13: compiler.err.not.within.bounds: ? super java.lang.String, V
+Neg03.java:38:35: compiler.err.cant.apply.diamond: (compiler.misc.diamond: Neg03.Foo), null
+Neg03.java:42:13: compiler.err.not.within.bounds: java.lang.String, V
+Neg03.java:42:26: compiler.err.cant.apply.diamond: (compiler.misc.diamond: Neg03.Foo), null
+Neg03.java:43:13: compiler.err.not.within.bounds: ? extends java.lang.String, V
+Neg03.java:43:36: compiler.err.cant.apply.diamond: (compiler.misc.diamond: Neg03.Foo), null
+Neg03.java:44:21: compiler.err.cant.apply.diamond: (compiler.misc.diamond: Neg03.Foo), null
+Neg03.java:45:13: compiler.err.not.within.bounds: ? super java.lang.String, V
+Neg03.java:45:34: compiler.err.cant.apply.diamond: (compiler.misc.diamond: Neg03.Foo), null
+Neg03.java:47:13: compiler.err.not.within.bounds: java.lang.String, V
+Neg03.java:47:26: compiler.err.cant.apply.diamond: (compiler.misc.diamond: Neg03.Foo), null
+Neg03.java:48:13: compiler.err.not.within.bounds: ? extends java.lang.String, V
+Neg03.java:48:36: compiler.err.cant.apply.diamond: (compiler.misc.diamond: Neg03.Foo), null
+Neg03.java:49:21: compiler.err.cant.apply.diamond: (compiler.misc.diamond: Neg03.Foo), null
+Neg03.java:50:13: compiler.err.not.within.bounds: ? super java.lang.String, V
+Neg03.java:50:34: compiler.err.cant.apply.diamond: (compiler.misc.diamond: Neg03.Foo), null
+Neg03.java:52:13: compiler.err.not.within.bounds: java.lang.String, V
+Neg03.java:52:26: compiler.err.cant.apply.diamond: (compiler.misc.diamond: Neg03.Foo), null
+Neg03.java:53:13: compiler.err.not.within.bounds: ? extends java.lang.String, V
+Neg03.java:53:37: compiler.err.cant.apply.diamond: (compiler.misc.diamond: Neg03.Foo), null
+Neg03.java:54:22: compiler.err.cant.apply.diamond: (compiler.misc.diamond: Neg03.Foo), null
+Neg03.java:55:13: compiler.err.not.within.bounds: ? super java.lang.String, V
+Neg03.java:55:35: compiler.err.cant.apply.diamond: (compiler.misc.diamond: Neg03.Foo), null
+Neg03.java:57:13: compiler.err.not.within.bounds: java.lang.String, V
+Neg03.java:57:27: compiler.err.cant.apply.diamond: (compiler.misc.diamond: Neg03.Foo), null
+Neg03.java:58:13: compiler.err.not.within.bounds: ? extends java.lang.String, V
+Neg03.java:58:37: compiler.err.cant.apply.diamond: (compiler.misc.diamond: Neg03.Foo), null
+Neg03.java:59:22: compiler.err.cant.apply.diamond: (compiler.misc.diamond: Neg03.Foo), null
+Neg03.java:60:13: compiler.err.not.within.bounds: ? super java.lang.String, V
+Neg03.java:60:35: compiler.err.cant.apply.diamond: (compiler.misc.diamond: Neg03.Foo), null
+Neg03.java:64:13: compiler.err.not.within.bounds: java.lang.String, V
+Neg03.java:64:28: compiler.err.cant.apply.diamond: (compiler.misc.diamond: Neg03.Foo), null
+Neg03.java:65:13: compiler.err.not.within.bounds: ? extends java.lang.String, V
+Neg03.java:65:38: compiler.err.cant.apply.diamond: (compiler.misc.diamond: Neg03.Foo), null
+Neg03.java:66:23: compiler.err.cant.apply.diamond: (compiler.misc.diamond: Neg03.Foo), null
+Neg03.java:67:13: compiler.err.not.within.bounds: ? super java.lang.String, V
+Neg03.java:67:36: compiler.err.cant.apply.diamond: (compiler.misc.diamond: Neg03.Foo), null
+Neg03.java:69:13: compiler.err.not.within.bounds: java.lang.String, V
+Neg03.java:69:28: compiler.err.cant.apply.diamond: (compiler.misc.diamond: Neg03.Foo), null
+Neg03.java:70:13: compiler.err.not.within.bounds: ? extends java.lang.String, V
+Neg03.java:70:38: compiler.err.cant.apply.diamond: (compiler.misc.diamond: Neg03.Foo), null
+Neg03.java:71:23: compiler.err.cant.apply.diamond: (compiler.misc.diamond: Neg03.Foo), null
+Neg03.java:72:13: compiler.err.not.within.bounds: ? super java.lang.String, V
+Neg03.java:72:36: compiler.err.cant.apply.diamond: (compiler.misc.diamond: Neg03.Foo), null
+Neg03.java:74:13: compiler.err.not.within.bounds: java.lang.String, V
+Neg03.java:74:28: compiler.err.cant.apply.diamond: (compiler.misc.diamond: Neg03.Foo), null
+Neg03.java:75:13: compiler.err.not.within.bounds: ? extends java.lang.String, V
+Neg03.java:75:39: compiler.err.cant.apply.diamond: (compiler.misc.diamond: Neg03.Foo), null
+Neg03.java:76:24: compiler.err.cant.apply.diamond: (compiler.misc.diamond: Neg03.Foo), null
+Neg03.java:77:13: compiler.err.not.within.bounds: ? super java.lang.String, V
+Neg03.java:77:37: compiler.err.cant.apply.diamond: (compiler.misc.diamond: Neg03.Foo), null
+Neg03.java:79:13: compiler.err.not.within.bounds: java.lang.String, V
+Neg03.java:79:29: compiler.err.cant.apply.diamond: (compiler.misc.diamond: Neg03.Foo), null
+Neg03.java:80:13: compiler.err.not.within.bounds: ? extends java.lang.String, V
+Neg03.java:80:39: compiler.err.cant.apply.diamond: (compiler.misc.diamond: Neg03.Foo), null
+Neg03.java:81:24: compiler.err.cant.apply.diamond: (compiler.misc.diamond: Neg03.Foo), null
+Neg03.java:82:13: compiler.err.not.within.bounds: ? super java.lang.String, V
+Neg03.java:82:37: compiler.err.cant.apply.diamond: (compiler.misc.diamond: Neg03.Foo), null
+84 errors
diff --git a/langtools/test/tools/javac/generics/diamond/neg/Neg04.java b/langtools/test/tools/javac/generics/diamond/neg/Neg04.java
index 94aa8d6..28b01b4 100644
--- a/langtools/test/tools/javac/generics/diamond/neg/Neg04.java
+++ b/langtools/test/tools/javac/generics/diamond/neg/Neg04.java
@@ -1,6 +1,6 @@
 /*
  * @test /nodynamiccopyright/
- * @bug 6939620 7020044
+ * @bug 6939620 7020044 8062373
  *
  * @summary  Check that diamond fails when inference violates declared bounds
  *           (test with local class, qualified/simple type expressions)
@@ -25,5 +25,15 @@
         Foo<? extends String> n6 = new Foo<>("", "");
         Foo<?> n7 = new Foo<>("", "");
         Foo<? super String> n8 = new Foo<>("", "");
+
+        Foo<String> n9 = new Foo<>(""){};
+        Foo<? extends String> n10 = new Foo<>(""){};
+        Foo<?> n11 = new Foo<>(""){};
+        Foo<? super String> n12 = new Foo<>(""){};
+
+        Foo<String> n13 = new Foo<>("", ""){};
+        Foo<? extends String> n14 = new Foo<>("", ""){};
+        Foo<?> n15 = new Foo<>("", ""){};
+        Foo<? super String> n16 = new Foo<>("", ""){};
     }
 }
diff --git a/langtools/test/tools/javac/generics/diamond/neg/Neg04.out b/langtools/test/tools/javac/generics/diamond/neg/Neg04.out
index 656d268..d8d7512 100644
--- a/langtools/test/tools/javac/generics/diamond/neg/Neg04.out
+++ b/langtools/test/tools/javac/generics/diamond/neg/Neg04.out
@@ -12,4 +12,18 @@
 Neg04.java:26:21: compiler.err.cant.apply.diamond: (compiler.misc.diamond: Foo), null
 Neg04.java:27:13: compiler.err.not.within.bounds: ? super java.lang.String, V
 Neg04.java:27:34: compiler.err.cant.apply.diamond: (compiler.misc.diamond: Foo), null
-14 errors
+Neg04.java:29:13: compiler.err.not.within.bounds: java.lang.String, V
+Neg04.java:29:26: compiler.err.cant.apply.diamond: (compiler.misc.diamond: Foo), null
+Neg04.java:30:13: compiler.err.not.within.bounds: ? extends java.lang.String, V
+Neg04.java:30:37: compiler.err.cant.apply.diamond: (compiler.misc.diamond: Foo), null
+Neg04.java:31:22: compiler.err.cant.apply.diamond: (compiler.misc.diamond: Foo), null
+Neg04.java:32:13: compiler.err.not.within.bounds: ? super java.lang.String, V
+Neg04.java:32:35: compiler.err.cant.apply.diamond: (compiler.misc.diamond: Foo), null
+Neg04.java:34:13: compiler.err.not.within.bounds: java.lang.String, V
+Neg04.java:34:27: compiler.err.cant.apply.diamond: (compiler.misc.diamond: Foo), null
+Neg04.java:35:13: compiler.err.not.within.bounds: ? extends java.lang.String, V
+Neg04.java:35:37: compiler.err.cant.apply.diamond: (compiler.misc.diamond: Foo), null
+Neg04.java:36:22: compiler.err.cant.apply.diamond: (compiler.misc.diamond: Foo), null
+Neg04.java:37:13: compiler.err.not.within.bounds: ? super java.lang.String, V
+Neg04.java:37:35: compiler.err.cant.apply.diamond: (compiler.misc.diamond: Foo), null
+28 errors
diff --git a/langtools/test/tools/javac/generics/diamond/neg/Neg05.java b/langtools/test/tools/javac/generics/diamond/neg/Neg05.java
index 53ee397..960f572 100644
--- a/langtools/test/tools/javac/generics/diamond/neg/Neg05.java
+++ b/langtools/test/tools/javac/generics/diamond/neg/Neg05.java
@@ -1,6 +1,6 @@
 /*
  * @test /nodynamiccopyright/
- * @bug 6939620 7020044
+ * @bug 6939620 7020044 8062373
  *
  * @summary  Check that usage of rare types doesn't cause spurious diamond diagnostics
  * @author mcimadamore
@@ -25,6 +25,16 @@
         Neg05<?>.Foo<? extends String> f6 = new Neg05.Foo<>("", "");
         Neg05<?>.Foo<?> f7 = new Neg05.Foo<>("", "");
         Neg05<?>.Foo<? super String> f8 = new Neg05.Foo<>("", "");
+
+        Neg05<?>.Foo<String> f9 = new Neg05.Foo<>(""){};
+        Neg05<?>.Foo<? extends String> f10 = new Neg05.Foo<>(""){};
+        Neg05<?>.Foo<?> f11 = new Neg05.Foo<>(""){};
+        Neg05<?>.Foo<? super String> f12 = new Neg05.Foo<>(""){};
+
+        Neg05<?>.Foo<String> f13 = new Neg05.Foo<>("", ""){};
+        Neg05<?>.Foo<? extends String> f14 = new Neg05.Foo<>("", ""){};
+        Neg05<?>.Foo<?> f15 = new Neg05.Foo<>("", ""){};
+        Neg05<?>.Foo<? super String> f16 = new Neg05.Foo<>("", ""){};
     }
 
     void testRare_2(Neg05 n) {
@@ -37,5 +47,15 @@
         Neg05<?>.Foo<? extends String> f6 = n.new Foo<>("", "");
         Neg05<?>.Foo<?> f7 = n.new Foo<>("", "");
         Neg05<?>.Foo<? super String> f8 = n.new Foo<>("", "");
+
+        Neg05<?>.Foo<String> f9 = n.new Foo<>(""){};
+        Neg05<?>.Foo<? extends String> f10 = n.new Foo<>(""){};
+        Neg05<?>.Foo<?> f11 = n.new Foo<>(""){};
+        Neg05<?>.Foo<? super String> f12 = n.new Foo<>(""){};
+
+        Neg05<?>.Foo<String> f13 = n.new Foo<>("", ""){};
+        Neg05<?>.Foo<? extends String> f14 = n.new Foo<>("", ""){};
+        Neg05<?>.Foo<?> f15 = n.new Foo<>("", ""){};
+        Neg05<?>.Foo<? super String> f16 = n.new Foo<>("", ""){};
     }
 }
diff --git a/langtools/test/tools/javac/generics/diamond/neg/Neg05.out b/langtools/test/tools/javac/generics/diamond/neg/Neg05.out
index 7ab2ece..8f31285 100644
--- a/langtools/test/tools/javac/generics/diamond/neg/Neg05.out
+++ b/langtools/test/tools/javac/generics/diamond/neg/Neg05.out
@@ -6,20 +6,52 @@
 Neg05.java:25:58: compiler.err.improperly.formed.type.inner.raw.param
 Neg05.java:26:43: compiler.err.improperly.formed.type.inner.raw.param
 Neg05.java:27:56: compiler.err.improperly.formed.type.inner.raw.param
-Neg05.java:31:37: compiler.err.improperly.formed.type.inner.raw.param
-Neg05.java:31:44: compiler.err.prob.found.req: (compiler.misc.cant.apply.diamond.1: (compiler.misc.diamond: Neg05.Foo), (compiler.misc.infer.no.conforming.instance.exists: V, Neg05.Foo<V>, Neg05<?>.Foo<java.lang.String>))
-Neg05.java:32:47: compiler.err.improperly.formed.type.inner.raw.param
-Neg05.java:32:54: compiler.err.prob.found.req: (compiler.misc.cant.apply.diamond.1: (compiler.misc.diamond: Neg05.Foo), (compiler.misc.infer.no.conforming.instance.exists: V, Neg05.Foo<V>, Neg05<?>.Foo<? extends java.lang.String>))
-Neg05.java:33:32: compiler.err.improperly.formed.type.inner.raw.param
-Neg05.java:33:39: compiler.err.prob.found.req: (compiler.misc.cant.apply.diamond.1: (compiler.misc.diamond: Neg05.Foo), (compiler.misc.infer.no.conforming.instance.exists: V, Neg05.Foo<V>, Neg05<?>.Foo<?>))
-Neg05.java:34:45: compiler.err.improperly.formed.type.inner.raw.param
-Neg05.java:34:52: compiler.err.prob.found.req: (compiler.misc.cant.apply.diamond.1: (compiler.misc.diamond: Neg05.Foo), (compiler.misc.infer.no.conforming.instance.exists: V, Neg05.Foo<V>, Neg05<?>.Foo<? super java.lang.String>))
-Neg05.java:36:37: compiler.err.improperly.formed.type.inner.raw.param
-Neg05.java:36:44: compiler.err.prob.found.req: (compiler.misc.cant.apply.diamond.1: (compiler.misc.diamond: Neg05.Foo), (compiler.misc.infer.no.conforming.instance.exists: V,Z, Neg05.Foo<V>, Neg05<?>.Foo<java.lang.String>))
-Neg05.java:37:47: compiler.err.improperly.formed.type.inner.raw.param
-Neg05.java:37:54: compiler.err.prob.found.req: (compiler.misc.cant.apply.diamond.1: (compiler.misc.diamond: Neg05.Foo), (compiler.misc.infer.no.conforming.instance.exists: V,Z, Neg05.Foo<V>, Neg05<?>.Foo<? extends java.lang.String>))
-Neg05.java:38:32: compiler.err.improperly.formed.type.inner.raw.param
-Neg05.java:38:39: compiler.err.prob.found.req: (compiler.misc.cant.apply.diamond.1: (compiler.misc.diamond: Neg05.Foo), (compiler.misc.infer.no.conforming.instance.exists: V,Z, Neg05.Foo<V>, Neg05<?>.Foo<?>))
-Neg05.java:39:45: compiler.err.improperly.formed.type.inner.raw.param
-Neg05.java:39:52: compiler.err.prob.found.req: (compiler.misc.cant.apply.diamond.1: (compiler.misc.diamond: Neg05.Foo), (compiler.misc.infer.no.conforming.instance.exists: V,Z, Neg05.Foo<V>, Neg05<?>.Foo<? super java.lang.String>))
-24 errors
+Neg05.java:29:48: compiler.err.improperly.formed.type.inner.raw.param
+Neg05.java:29:35: compiler.err.cant.apply.symbol: kindname.constructor, , V, java.lang.String, kindname.class, compiler.misc.anonymous.class: <any>, (compiler.misc.no.conforming.assignment.exists: (compiler.misc.inconvertible.types: java.lang.String, V))
+Neg05.java:30:59: compiler.err.improperly.formed.type.inner.raw.param
+Neg05.java:30:46: compiler.err.cant.apply.symbol: kindname.constructor, , V, java.lang.String, kindname.class, compiler.misc.anonymous.class: <any>, (compiler.misc.no.conforming.assignment.exists: (compiler.misc.inconvertible.types: java.lang.String, V))
+Neg05.java:31:44: compiler.err.improperly.formed.type.inner.raw.param
+Neg05.java:31:31: compiler.err.cant.apply.symbol: kindname.constructor, , V, java.lang.String, kindname.class, compiler.misc.anonymous.class: <any>, (compiler.misc.no.conforming.assignment.exists: (compiler.misc.inconvertible.types: java.lang.String, V))
+Neg05.java:32:57: compiler.err.improperly.formed.type.inner.raw.param
+Neg05.java:32:44: compiler.err.cant.apply.symbol: kindname.constructor, , V, java.lang.String, kindname.class, compiler.misc.anonymous.class: <any>, (compiler.misc.no.conforming.assignment.exists: (compiler.misc.inconvertible.types: java.lang.String, V))
+Neg05.java:34:49: compiler.err.improperly.formed.type.inner.raw.param
+Neg05.java:34:36: compiler.err.cant.apply.symbol: kindname.constructor, , V,Z, java.lang.String,java.lang.String, kindname.class, compiler.misc.anonymous.class: <any>, (compiler.misc.infer.no.conforming.assignment.exists: Z, (compiler.misc.inconvertible.types: java.lang.String, V))
+Neg05.java:35:59: compiler.err.improperly.formed.type.inner.raw.param
+Neg05.java:35:46: compiler.err.cant.apply.symbol: kindname.constructor, , V,Z, java.lang.String,java.lang.String, kindname.class, compiler.misc.anonymous.class: <any>, (compiler.misc.infer.no.conforming.assignment.exists: Z, (compiler.misc.inconvertible.types: java.lang.String, V))
+Neg05.java:36:44: compiler.err.improperly.formed.type.inner.raw.param
+Neg05.java:36:31: compiler.err.cant.apply.symbol: kindname.constructor, , V,Z, java.lang.String,java.lang.String, kindname.class, compiler.misc.anonymous.class: <any>, (compiler.misc.infer.no.conforming.assignment.exists: Z, (compiler.misc.inconvertible.types: java.lang.String, V))
+Neg05.java:37:57: compiler.err.improperly.formed.type.inner.raw.param
+Neg05.java:37:44: compiler.err.cant.apply.symbol: kindname.constructor, , V,Z, java.lang.String,java.lang.String, kindname.class, compiler.misc.anonymous.class: <any>, (compiler.misc.infer.no.conforming.assignment.exists: Z, (compiler.misc.inconvertible.types: java.lang.String, V))
+Neg05.java:41:37: compiler.err.improperly.formed.type.inner.raw.param
+Neg05.java:41:44: compiler.err.prob.found.req: (compiler.misc.cant.apply.diamond.1: (compiler.misc.diamond: Neg05.Foo), (compiler.misc.infer.no.conforming.instance.exists: V, Neg05.Foo<V>, Neg05<?>.Foo<java.lang.String>))
+Neg05.java:42:47: compiler.err.improperly.formed.type.inner.raw.param
+Neg05.java:42:54: compiler.err.prob.found.req: (compiler.misc.cant.apply.diamond.1: (compiler.misc.diamond: Neg05.Foo), (compiler.misc.infer.no.conforming.instance.exists: V, Neg05.Foo<V>, Neg05<?>.Foo<? extends java.lang.String>))
+Neg05.java:43:32: compiler.err.improperly.formed.type.inner.raw.param
+Neg05.java:43:39: compiler.err.prob.found.req: (compiler.misc.cant.apply.diamond.1: (compiler.misc.diamond: Neg05.Foo), (compiler.misc.infer.no.conforming.instance.exists: V, Neg05.Foo<V>, Neg05<?>.Foo<?>))
+Neg05.java:44:45: compiler.err.improperly.formed.type.inner.raw.param
+Neg05.java:44:52: compiler.err.prob.found.req: (compiler.misc.cant.apply.diamond.1: (compiler.misc.diamond: Neg05.Foo), (compiler.misc.infer.no.conforming.instance.exists: V, Neg05.Foo<V>, Neg05<?>.Foo<? super java.lang.String>))
+Neg05.java:46:37: compiler.err.improperly.formed.type.inner.raw.param
+Neg05.java:46:44: compiler.err.prob.found.req: (compiler.misc.cant.apply.diamond.1: (compiler.misc.diamond: Neg05.Foo), (compiler.misc.infer.no.conforming.instance.exists: V,Z, Neg05.Foo<V>, Neg05<?>.Foo<java.lang.String>))
+Neg05.java:47:47: compiler.err.improperly.formed.type.inner.raw.param
+Neg05.java:47:54: compiler.err.prob.found.req: (compiler.misc.cant.apply.diamond.1: (compiler.misc.diamond: Neg05.Foo), (compiler.misc.infer.no.conforming.instance.exists: V,Z, Neg05.Foo<V>, Neg05<?>.Foo<? extends java.lang.String>))
+Neg05.java:48:32: compiler.err.improperly.formed.type.inner.raw.param
+Neg05.java:48:39: compiler.err.prob.found.req: (compiler.misc.cant.apply.diamond.1: (compiler.misc.diamond: Neg05.Foo), (compiler.misc.infer.no.conforming.instance.exists: V,Z, Neg05.Foo<V>, Neg05<?>.Foo<?>))
+Neg05.java:49:45: compiler.err.improperly.formed.type.inner.raw.param
+Neg05.java:49:52: compiler.err.prob.found.req: (compiler.misc.cant.apply.diamond.1: (compiler.misc.diamond: Neg05.Foo), (compiler.misc.infer.no.conforming.instance.exists: V,Z, Neg05.Foo<V>, Neg05<?>.Foo<? super java.lang.String>))
+Neg05.java:51:37: compiler.err.improperly.formed.type.inner.raw.param
+Neg05.java:51:44: compiler.err.prob.found.req: (compiler.misc.cant.apply.diamond.1: (compiler.misc.diamond: Neg05.Foo), (compiler.misc.infer.no.conforming.instance.exists: V, Neg05.Foo<V>, Neg05<?>.Foo<java.lang.String>))
+Neg05.java:52:48: compiler.err.improperly.formed.type.inner.raw.param
+Neg05.java:52:55: compiler.err.prob.found.req: (compiler.misc.cant.apply.diamond.1: (compiler.misc.diamond: Neg05.Foo), (compiler.misc.infer.no.conforming.instance.exists: V, Neg05.Foo<V>, Neg05<?>.Foo<? extends java.lang.String>))
+Neg05.java:53:33: compiler.err.improperly.formed.type.inner.raw.param
+Neg05.java:53:40: compiler.err.prob.found.req: (compiler.misc.cant.apply.diamond.1: (compiler.misc.diamond: Neg05.Foo), (compiler.misc.infer.no.conforming.instance.exists: V, Neg05.Foo<V>, Neg05<?>.Foo<?>))
+Neg05.java:54:46: compiler.err.improperly.formed.type.inner.raw.param
+Neg05.java:54:53: compiler.err.prob.found.req: (compiler.misc.cant.apply.diamond.1: (compiler.misc.diamond: Neg05.Foo), (compiler.misc.infer.no.conforming.instance.exists: V, Neg05.Foo<V>, Neg05<?>.Foo<? super java.lang.String>))
+Neg05.java:56:38: compiler.err.improperly.formed.type.inner.raw.param
+Neg05.java:56:45: compiler.err.prob.found.req: (compiler.misc.cant.apply.diamond.1: (compiler.misc.diamond: Neg05.Foo), (compiler.misc.infer.no.conforming.instance.exists: V,Z, Neg05.Foo<V>, Neg05<?>.Foo<java.lang.String>))
+Neg05.java:57:48: compiler.err.improperly.formed.type.inner.raw.param
+Neg05.java:57:55: compiler.err.prob.found.req: (compiler.misc.cant.apply.diamond.1: (compiler.misc.diamond: Neg05.Foo), (compiler.misc.infer.no.conforming.instance.exists: V,Z, Neg05.Foo<V>, Neg05<?>.Foo<? extends java.lang.String>))
+Neg05.java:58:33: compiler.err.improperly.formed.type.inner.raw.param
+Neg05.java:58:40: compiler.err.prob.found.req: (compiler.misc.cant.apply.diamond.1: (compiler.misc.diamond: Neg05.Foo), (compiler.misc.infer.no.conforming.instance.exists: V,Z, Neg05.Foo<V>, Neg05<?>.Foo<?>))
+Neg05.java:59:46: compiler.err.improperly.formed.type.inner.raw.param
+Neg05.java:59:53: compiler.err.prob.found.req: (compiler.misc.cant.apply.diamond.1: (compiler.misc.diamond: Neg05.Foo), (compiler.misc.infer.no.conforming.instance.exists: V,Z, Neg05.Foo<V>, Neg05<?>.Foo<? super java.lang.String>))
+56 errors
diff --git a/langtools/test/tools/javac/generics/diamond/neg/Neg06.java b/langtools/test/tools/javac/generics/diamond/neg/Neg06.java
index 73aae17..e4f98dc 100644
--- a/langtools/test/tools/javac/generics/diamond/neg/Neg06.java
+++ b/langtools/test/tools/javac/generics/diamond/neg/Neg06.java
@@ -1,6 +1,6 @@
 /*
  * @test /nodynamiccopyright/
- * @bug 6939620 7020044
+ * @bug 6939620 7020044 8062373
  *
  * @summary  Check that diamond works where LHS is supertype of RHS (nilary constructor)
  * @author mcimadamore
@@ -9,9 +9,13 @@
  */
 
 class Neg06 {
+   interface ISuperFoo<X> {}
+   interface IFoo<X extends Number> extends ISuperFoo<X> {}
 
    static class CSuperFoo<X> {}
    static class CFoo<X extends Number> extends CSuperFoo<X> {}
 
+   ISuperFoo<String> isf = new IFoo<>() {};
    CSuperFoo<String> csf1 = new CFoo<>();
+   CSuperFoo<String> csf2 = new CFoo<>() {};
 }
diff --git a/langtools/test/tools/javac/generics/diamond/neg/Neg06.out b/langtools/test/tools/javac/generics/diamond/neg/Neg06.out
index bf439f7..c085b5e 100644
--- a/langtools/test/tools/javac/generics/diamond/neg/Neg06.out
+++ b/langtools/test/tools/javac/generics/diamond/neg/Neg06.out
@@ -1,2 +1,6 @@
-Neg06.java:16:37: compiler.err.prob.found.req: (compiler.misc.cant.apply.diamond.1: (compiler.misc.diamond: Neg06.CFoo), (compiler.misc.incompatible.eq.upper.bounds: X, java.lang.String, java.lang.Number))
-1 error
+Neg06.java:18:36: compiler.err.prob.found.req: (compiler.misc.cant.apply.diamond.1: (compiler.misc.diamond: Neg06.IFoo), (compiler.misc.incompatible.eq.upper.bounds: X, java.lang.String, java.lang.Number))
+Neg06.java:18:28: compiler.err.prob.found.req: (compiler.misc.inconvertible.types: compiler.misc.anonymous.class: java.lang.Object, Neg06.ISuperFoo<java.lang.String>)
+Neg06.java:19:37: compiler.err.prob.found.req: (compiler.misc.cant.apply.diamond.1: (compiler.misc.diamond: Neg06.CFoo), (compiler.misc.incompatible.eq.upper.bounds: X, java.lang.String, java.lang.Number))
+Neg06.java:20:37: compiler.err.prob.found.req: (compiler.misc.cant.apply.diamond.1: (compiler.misc.diamond: Neg06.CFoo), (compiler.misc.incompatible.eq.upper.bounds: X, java.lang.String, java.lang.Number))
+Neg06.java:20:29: compiler.err.prob.found.req: (compiler.misc.inconvertible.types: compiler.misc.anonymous.class: <any>, Neg06.CSuperFoo<java.lang.String>)
+5 errors
diff --git a/langtools/test/tools/javac/generics/diamond/neg/Neg07.java b/langtools/test/tools/javac/generics/diamond/neg/Neg07.java
index f65bee8..199a2e8 100644
--- a/langtools/test/tools/javac/generics/diamond/neg/Neg07.java
+++ b/langtools/test/tools/javac/generics/diamond/neg/Neg07.java
@@ -1,6 +1,6 @@
 /*
  * @test /nodynamiccopyright/
- * @bug 6939620 7020044
+ * @bug 6939620 7020044 8062373
  *
  * @summary  Check that diamond works where LHS is supertype of RHS (1-ary constructor)
  * @author mcimadamore
@@ -15,4 +15,5 @@
    }
 
    SuperFoo<String> sf1 = new Foo<>("");
+   SuperFoo<String> sf2 = new Foo<>("") {};
 }
diff --git a/langtools/test/tools/javac/generics/diamond/neg/Neg07.out b/langtools/test/tools/javac/generics/diamond/neg/Neg07.out
index 59c3789..8bec602 100644
--- a/langtools/test/tools/javac/generics/diamond/neg/Neg07.out
+++ b/langtools/test/tools/javac/generics/diamond/neg/Neg07.out
@@ -1,2 +1,3 @@
 Neg07.java:17:27: compiler.err.cant.apply.diamond.1: (compiler.misc.diamond: Neg07.Foo), (compiler.misc.inferred.do.not.conform.to.upper.bounds: java.lang.String, java.lang.Number)
-1 error
+Neg07.java:18:27: compiler.err.cant.apply.diamond.1: (compiler.misc.diamond: Neg07.Foo), (compiler.misc.inferred.do.not.conform.to.upper.bounds: java.lang.String, java.lang.Number)
+2 errors
diff --git a/langtools/test/tools/javac/generics/diamond/neg/Neg09.java b/langtools/test/tools/javac/generics/diamond/neg/Neg09.java
index 4a85619..729a3f1 100644
--- a/langtools/test/tools/javac/generics/diamond/neg/Neg09.java
+++ b/langtools/test/tools/javac/generics/diamond/neg/Neg09.java
@@ -1,10 +1,10 @@
 /*
  * @test /nodynamiccopyright/
- * @bug 7020044
+ * @bug 7020044 8062373
  *
- * @summary  Check that diamond is not allowed with anonymous inner class expressions
+ * @summary  Check that diamond is not allowed with anonymous inner class expressions at source < 9
  * @author Maurizio Cimadamore
- * @compile/fail/ref=Neg09.out Neg09.java -XDrawDiagnostics
+ * @compile/fail/ref=Neg09.out Neg09.java -source 8 -XDrawDiagnostics
  *
  */
 
diff --git a/langtools/test/tools/javac/generics/diamond/neg/Neg09.out b/langtools/test/tools/javac/generics/diamond/neg/Neg09.out
index 5893555..af5238b 100644
--- a/langtools/test/tools/javac/generics/diamond/neg/Neg09.out
+++ b/langtools/test/tools/javac/generics/diamond/neg/Neg09.out
@@ -1,5 +1,7 @@
-Neg09.java:17:34: compiler.err.cant.apply.diamond.1: Neg09.Member<X>, (compiler.misc.diamond.and.anon.class: Neg09.Member<X>)
-Neg09.java:18:34: compiler.err.cant.apply.diamond.1: Neg09.Nested<X>, (compiler.misc.diamond.and.anon.class: Neg09.Nested<X>)
-Neg09.java:22:39: compiler.err.cant.apply.diamond.1: Neg09.Member<X>, (compiler.misc.diamond.and.anon.class: Neg09.Member<X>)
-Neg09.java:23:40: compiler.err.cant.apply.diamond.1: Neg09.Nested<X>, (compiler.misc.diamond.and.anon.class: Neg09.Nested<X>)
+- compiler.warn.source.no.bootclasspath: 1.8
+Neg09.java:17:34: compiler.err.cant.apply.diamond.1: Neg09.Member<X>, (compiler.misc.diamond.and.anon.class.not.supported.in.source: 1.8)
+Neg09.java:18:34: compiler.err.cant.apply.diamond.1: Neg09.Nested<X>, (compiler.misc.diamond.and.anon.class.not.supported.in.source: 1.8)
+Neg09.java:22:39: compiler.err.cant.apply.diamond.1: Neg09.Member<X>, (compiler.misc.diamond.and.anon.class.not.supported.in.source: 1.8)
+Neg09.java:23:40: compiler.err.cant.apply.diamond.1: Neg09.Nested<X>, (compiler.misc.diamond.and.anon.class.not.supported.in.source: 1.8)
 4 errors
+1 warning
diff --git a/langtools/test/tools/javac/generics/diamond/neg/Neg12.java b/langtools/test/tools/javac/generics/diamond/neg/Neg12.java
new file mode 100644
index 0000000..526f846
--- /dev/null
+++ b/langtools/test/tools/javac/generics/diamond/neg/Neg12.java
@@ -0,0 +1,33 @@
+/*
+ * @test /nodynamiccopyright/
+ * @bug 8062373
+ *
+ * @summary  Test diamond + anonymous classes with non-denotable types
+ * @author mcimadamore
+ * @compile/fail/ref=Neg12.out Neg12.java -XDrawDiagnostics
+ *
+ */
+
+ class Neg12 {
+    static class Foo<X> {
+        Foo(X x) {  }
+    }
+
+    static class DoubleFoo<X,Y> {
+        DoubleFoo(X x,Y y) {  }
+    }
+
+    static class TripleFoo<X,Y,Z> {
+        TripleFoo(X x,Y y,Z z) {  }
+    }
+
+    Foo<? extends Integer> fi = new Foo<>(1);
+    Foo<?> fw = new Foo<>(fi) {}; // Error.
+    Foo<?> fw1 = new Foo<>(fi); // OK.
+    Foo<? extends Double> fd = new Foo<>(3.0);
+    DoubleFoo<?,?> dw = new DoubleFoo<>(fi,fd) {}; // Error.
+    DoubleFoo<?,?> dw1 = new DoubleFoo<>(fi,fd); // OK.
+    Foo<String> fs = new Foo<>("one");
+    TripleFoo<?,?,?> tw = new TripleFoo<>(fi,fd,fs) {}; // Error.
+    TripleFoo<?,?,?> tw1 = new TripleFoo<>(fi,fd,fs); // OK.
+ }
diff --git a/langtools/test/tools/javac/generics/diamond/neg/Neg12.out b/langtools/test/tools/javac/generics/diamond/neg/Neg12.out
new file mode 100644
index 0000000..aaa54b3
--- /dev/null
+++ b/langtools/test/tools/javac/generics/diamond/neg/Neg12.out
@@ -0,0 +1,4 @@
+Neg12.java:25:24: compiler.err.cant.apply.diamond.1: (compiler.misc.diamond: Neg12.Foo), (compiler.misc.diamond.invalid.arg: Neg12.Foo<compiler.misc.type.captureof: 1, ? extends java.lang.Integer>, (compiler.misc.diamond: Neg12.Foo))
+Neg12.java:28:38: compiler.err.cant.apply.diamond.1: (compiler.misc.diamond: Neg12.DoubleFoo), (compiler.misc.diamond.invalid.args: Neg12.Foo<compiler.misc.type.captureof: 1, ? extends java.lang.Integer>,Neg12.Foo<compiler.misc.type.captureof: 2, ? extends java.lang.Double>, (compiler.misc.diamond: Neg12.DoubleFoo))
+Neg12.java:31:40: compiler.err.cant.apply.diamond.1: (compiler.misc.diamond: Neg12.TripleFoo), (compiler.misc.diamond.invalid.args: Neg12.Foo<compiler.misc.type.captureof: 1, ? extends java.lang.Integer>,Neg12.Foo<compiler.misc.type.captureof: 2, ? extends java.lang.Double>, (compiler.misc.diamond: Neg12.TripleFoo))
+3 errors
diff --git a/langtools/test/tools/javac/generics/diamond/neg/Neg13.java b/langtools/test/tools/javac/generics/diamond/neg/Neg13.java
new file mode 100644
index 0000000..45c6eca
--- /dev/null
+++ b/langtools/test/tools/javac/generics/diamond/neg/Neg13.java
@@ -0,0 +1,49 @@
+/*
+ * @test /nodynamiccopyright/
+ * @bug 8062373
+ *
+ * @summary  Test diamond + anonymous classes with abstract super type
+ * @author sadayapalam
+ * @compile/fail/ref=Neg13.out Neg13.java -XDrawDiagnostics
+ *
+ */
+class Neg13 {
+
+    static abstract class A<T> {
+        abstract void foo();
+    }
+
+    static void foo(A<String> as) {}
+
+    public static void main(String[] args) {
+
+        // Method invocation context - good <>(){}
+        foo(new A<>() {
+            public void foo() {}
+        });
+
+        // Assignment context - good <>(){}
+        A<?> aq = new A<>() {
+            public void foo() {}
+        };
+
+        // When the anonymous type subtypes an abstract class but is missing definitions for
+        // abstract methods, expect no overload resolution error, but an attribution error
+        // while attributing anonymous class body.
+
+
+        // Method invocation context - bad <>(){}
+        foo(new A<>() {
+        });
+
+        // Assignment invocation context - bad <>(){}
+        aq = new A<>() {
+        };
+
+        // Method invocation context - bad <>()
+        foo(new A<>());
+
+        // Assignment invocation context - bad <>()
+        aq = new A<>();
+    }
+}
diff --git a/langtools/test/tools/javac/generics/diamond/neg/Neg13.out b/langtools/test/tools/javac/generics/diamond/neg/Neg13.out
new file mode 100644
index 0000000..a179a77
--- /dev/null
+++ b/langtools/test/tools/javac/generics/diamond/neg/Neg13.out
@@ -0,0 +1,5 @@
+Neg13.java:36:23: compiler.err.does.not.override.abstract: compiler.misc.anonymous.class: Neg13$3, foo(), Neg13.A
+Neg13.java:40:24: compiler.err.does.not.override.abstract: compiler.misc.anonymous.class: Neg13$4, foo(), Neg13.A
+Neg13.java:44:13: compiler.err.abstract.cant.be.instantiated: Neg13.A
+Neg13.java:47:14: compiler.err.abstract.cant.be.instantiated: Neg13.A
+4 errors
diff --git a/langtools/test/tools/javac/generics/diamond/neg/Neg14.java b/langtools/test/tools/javac/generics/diamond/neg/Neg14.java
new file mode 100644
index 0000000..0ad9114
--- /dev/null
+++ b/langtools/test/tools/javac/generics/diamond/neg/Neg14.java
@@ -0,0 +1,49 @@
+/*
+ * @test /nodynamiccopyright/
+ * @bug 8062373
+ *
+ * @summary  Test diamond + anonymous classes with super type being an interface.
+ * @author sadayapalam
+ * @compile/fail/ref=Neg14.out Neg14.java -XDrawDiagnostics
+ *
+ */
+class Neg14 {
+
+    static interface A<T> {
+        void foo();
+    }
+
+    static void foo(A<String> as) {}
+
+    public static void main(String[] args) {
+
+        // Method invocation context - good <>(){}
+        foo(new A<>() {
+            public void foo() {}
+        });
+
+        // Assignment context - good <>(){}
+        A<?> aq = new A<>() {
+            public void foo() {}
+        };
+
+        // When the anonymous type subtypes an interface but is missing definitions for
+        // abstract methods, expect no overload resolution error, but an attribution error
+        // while attributing anonymous class body.
+
+
+        // Method invocation context - bad <>(){}
+        foo(new A<>() {
+        });
+
+        // Assignment invocation context - bad <>(){}
+        aq = new A<>() {
+        };
+
+        // Method invocation context - bad <>()
+        foo(new A<>());
+
+        // Assignment invocation context - bad <>()
+        aq = new A<>();
+    }
+}
diff --git a/langtools/test/tools/javac/generics/diamond/neg/Neg14.out b/langtools/test/tools/javac/generics/diamond/neg/Neg14.out
new file mode 100644
index 0000000..8b05140
--- /dev/null
+++ b/langtools/test/tools/javac/generics/diamond/neg/Neg14.out
@@ -0,0 +1,5 @@
+Neg14.java:36:23: compiler.err.does.not.override.abstract: compiler.misc.anonymous.class: Neg14$3, foo(), Neg14.A
+Neg14.java:40:24: compiler.err.does.not.override.abstract: compiler.misc.anonymous.class: Neg14$4, foo(), Neg14.A
+Neg14.java:44:13: compiler.err.abstract.cant.be.instantiated: Neg14.A
+Neg14.java:47:14: compiler.err.abstract.cant.be.instantiated: Neg14.A
+4 errors
diff --git a/langtools/test/tools/javac/generics/diamond/neg/Neg15.java b/langtools/test/tools/javac/generics/diamond/neg/Neg15.java
new file mode 100644
index 0000000..2c0d286
--- /dev/null
+++ b/langtools/test/tools/javac/generics/diamond/neg/Neg15.java
@@ -0,0 +1,66 @@
+/*
+ * @test /nodynamiccopyright/
+ * @bug 8062373
+ *
+ * @summary  Test that javac complains when a <> inferred class contains a public method that does override a supertype method.
+ * @author sadayapalam
+ * @compile/fail/ref=Neg15.out Neg15.java -XDrawDiagnostics
+ *
+ */
+
+class Neg15 {
+
+    interface Predicate<T> {
+        default boolean test(T t) {
+            System.out.println("Default method");
+            return false;
+        }
+    }
+
+
+    static void someMethod(Predicate<? extends Number> p) {
+        if (!p.test(null))
+            throw new Error("Blew it");
+    }
+
+    public static void main(String[] args) {
+
+        someMethod(new Predicate<Integer>() {
+            public boolean test(Integer n) {
+                System.out.println("Override");
+                return true;
+            }
+            boolean test(Integer n, int i) {
+                System.out.println("Override");
+                return true;
+            }
+            protected boolean test(Integer n, int i, int j) {
+                System.out.println("Override");
+                return true;
+            }
+            private boolean test(Integer n, int i, long j) {
+                System.out.println("Override");
+                return true;
+            }
+        });
+
+        someMethod(new Predicate<>() {
+            public boolean test(Integer n) { // bad.
+                System.out.println("Override");
+                return true;
+            }
+            boolean test(Integer n, int i) { // bad, package access.
+                System.out.println("Override");
+                return true;
+            }
+            protected boolean test(Integer n, int i, int j) { // bad, protected access.
+                System.out.println("Override");
+                return true;
+            }
+            private boolean test(Integer n, int i, long j) { // OK, private method.
+                System.out.println("Override");
+                return true;
+            }
+        });
+    }
+}
diff --git a/langtools/test/tools/javac/generics/diamond/neg/Neg15.out b/langtools/test/tools/javac/generics/diamond/neg/Neg15.out
new file mode 100644
index 0000000..1e6f1ef
--- /dev/null
+++ b/langtools/test/tools/javac/generics/diamond/neg/Neg15.out
@@ -0,0 +1,4 @@
+Neg15.java:48:28: compiler.err.method.does.not.override.superclass
+Neg15.java:52:21: compiler.err.method.does.not.override.superclass
+Neg15.java:56:31: compiler.err.method.does.not.override.superclass
+3 errors
diff --git a/langtools/test/tools/javac/generics/diamond/neg/Neg16.java b/langtools/test/tools/javac/generics/diamond/neg/Neg16.java
new file mode 100644
index 0000000..775c172
--- /dev/null
+++ b/langtools/test/tools/javac/generics/diamond/neg/Neg16.java
@@ -0,0 +1,36 @@
+/*
+ * @test /nodynamiccopyright/
+ * @bug 8062373
+ * @summary Test that javac does not recommend a diamond site that would result in error.
+ * @compile/ref=Neg16.out -Xlint:-options Neg16.java -XDrawDiagnostics -XDfind=diamond
+ */
+
+class Neg16 {
+
+   interface Predicate<T> {
+        default boolean test(T t) {
+            System.out.println("Default method");
+            return false;
+        }
+    }
+
+    static void someMethod(Predicate<? extends Number> p) {
+        if (!p.test(null))
+            throw new Error("Blew it");
+    }
+
+    public static void main(String[] args) {
+        someMethod(new Predicate<Integer>() { // cannot convert to diamond
+            public boolean test(Integer n) {
+                System.out.println("Override");
+                return true;
+            }
+        });
+        someMethod(new Predicate<Number>() { // can convert to diamond.
+            public boolean test(Number n) {
+                System.out.println("Override");
+                return true;
+            }
+        });
+    }
+}
diff --git a/langtools/test/tools/javac/generics/diamond/neg/Neg16.out b/langtools/test/tools/javac/generics/diamond/neg/Neg16.out
new file mode 100644
index 0000000..712aa4f
--- /dev/null
+++ b/langtools/test/tools/javac/generics/diamond/neg/Neg16.out
@@ -0,0 +1,2 @@
+Neg16.java:29:33: compiler.warn.diamond.redundant.args
+1 warning
diff --git a/langtools/test/tools/javac/generics/diamond/neg/Neg17.java b/langtools/test/tools/javac/generics/diamond/neg/Neg17.java
new file mode 100644
index 0000000..960fbd7
--- /dev/null
+++ b/langtools/test/tools/javac/generics/diamond/neg/Neg17.java
@@ -0,0 +1,21 @@
+/*
+ * @test /nodynamiccopyright/
+ * @bug 8062373
+ * @summary Test that the anonymous class constructor appears to returns a Foo<T>, when it actually returns a Anon$1. (status as of now - may change in future)
+ * @compile/fail/ref=Neg17.out Neg17.java -XDrawDiagnostics
+ */
+
+import java.util.Collections;
+
+abstract class Neg17<T> {
+
+   abstract void m();
+
+   public static void main(String[] args) {
+       Collections.singletonList(new Neg17<>() { void m() {} }).get(0).m(); // good.
+       Collections.singletonList(new Neg17<>() {
+                 void m() {}
+                 private void n() {}
+           }).get(0).n(); // bad unknown method n()
+   }
+}
diff --git a/langtools/test/tools/javac/generics/diamond/neg/Neg17.out b/langtools/test/tools/javac/generics/diamond/neg/Neg17.out
new file mode 100644
index 0000000..aeb7601
--- /dev/null
+++ b/langtools/test/tools/javac/generics/diamond/neg/Neg17.out
@@ -0,0 +1,2 @@
+Neg17.java:19:21: compiler.err.cant.resolve.location.args: kindname.method, n, , , (compiler.misc.location: kindname.class, Neg17<java.lang.Object>, null)
+1 error
diff --git a/langtools/test/tools/javac/generics/diamond/neg/Neg18.java b/langtools/test/tools/javac/generics/diamond/neg/Neg18.java
new file mode 100644
index 0000000..4acb7ef
--- /dev/null
+++ b/langtools/test/tools/javac/generics/diamond/neg/Neg18.java
@@ -0,0 +1,16 @@
+/*
+ * @test /nodynamiccopyright/
+ * @bug 8062373
+ * @summary Test that inaccessible vararg element type triggers an error during diamond inferred anonymous class instance creation.
+ * @compile/fail/ref=Neg18.out Neg18.java -XDrawDiagnostics
+ */
+
+import java.util.Collections;
+import pkg.Neg18_01;
+
+class Neg18 {
+
+   public static void main(String[] args) {
+        new Neg18_01<>() {};
+   }
+}
diff --git a/langtools/test/tools/javac/generics/diamond/neg/Neg18.out b/langtools/test/tools/javac/generics/diamond/neg/Neg18.out
new file mode 100644
index 0000000..edbff10
--- /dev/null
+++ b/langtools/test/tools/javac/generics/diamond/neg/Neg18.out
@@ -0,0 +1,3 @@
+Neg18.java:14:21: compiler.err.prob.found.req: (compiler.misc.cant.apply.diamond.1: (compiler.misc.diamond: pkg.Neg18_01), (compiler.misc.inaccessible.varargs.type: pkg.Neg18_01.PkgPrivate, kindname.class, Neg18))
+Neg18.java:14:26: compiler.err.not.def.public.cant.access: pkg.Neg18_01.PkgPrivate, pkg.Neg18_01
+2 errors
diff --git a/langtools/test/tools/javac/generics/diamond/neg/Neg19.java b/langtools/test/tools/javac/generics/diamond/neg/Neg19.java
new file mode 100644
index 0000000..173a72a
--- /dev/null
+++ b/langtools/test/tools/javac/generics/diamond/neg/Neg19.java
@@ -0,0 +1,21 @@
+/*
+ * @test /nodynamiccopyright/
+ * @bug 8062373
+ * @summary Test that when inaccessible types constitute the inferred types of <> the compiler complains.
+ * @compile/fail/ref=Neg19.out Neg19.java -XDrawDiagnostics
+ */
+
+
+
+class Neg19 {
+    public static void main(String[] args) {
+        new Neg19_01<Neg19>().foo(new Neg19_01<>()); // OK.
+        new Neg19_01<Neg19>().foo(new Neg19_01<>() {}); // ERROR.
+    }
+}
+
+class Neg19_01<T> {
+    private class Private {}
+    Neg19_01() {}
+    void foo(Neg19_01<Private> p) {}
+}
diff --git a/langtools/test/tools/javac/generics/diamond/neg/Neg19.out b/langtools/test/tools/javac/generics/diamond/neg/Neg19.out
new file mode 100644
index 0000000..aaba880
--- /dev/null
+++ b/langtools/test/tools/javac/generics/diamond/neg/Neg19.out
@@ -0,0 +1,2 @@
+Neg19.java:13:34: compiler.err.report.access: Neg19_01.Private, private, Neg19_01
+1 error
diff --git a/jdk/test/jdk/lambda/shapegen/Rule.java b/langtools/test/tools/javac/generics/diamond/neg/pkg/Neg18_01.java
similarity index 69%
rename from jdk/test/jdk/lambda/shapegen/Rule.java
rename to langtools/test/tools/javac/generics/diamond/neg/pkg/Neg18_01.java
index 7ff02e0..5690960 100644
--- a/jdk/test/jdk/lambda/shapegen/Rule.java
+++ b/langtools/test/tools/javac/generics/diamond/neg/pkg/Neg18_01.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
+ * 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
@@ -21,26 +21,9 @@
  * questions.
  */
 
-package shapegen;
+package pkg;
 
-/**
- *
- * @author Robert Field
- */
-public abstract class Rule {
-
-    public final String name;
-
-    public Rule(String name) {
-        this.name = name;
-    }
-
-    abstract boolean guard(ClassCase cc);
-
-    abstract void eval(ClassCase cc);
-
-    @Override
-    public String toString() {
-        return name;
-    }
+public class Neg18_01<T> {
+    static class PkgPrivate {}
+    public Neg18_01 (PkgPrivate ... pp) {}
 }
diff --git a/langtools/test/tools/javac/generics/diamond/pos/Pos01.java b/langtools/test/tools/javac/generics/diamond/pos/Pos01.java
index 1ae7f9b..9a60314 100644
--- a/langtools/test/tools/javac/generics/diamond/pos/Pos01.java
+++ b/langtools/test/tools/javac/generics/diamond/pos/Pos01.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,7 +23,7 @@
 
 /*
  * @test
- * @bug 6939620 7020044
+ * @bug 6939620 7020044 8062373
  *
  * @summary  basic test for diamond (generic/non-generic constructors)
  * @author mcimadamore
@@ -48,7 +48,17 @@
         Pos01<? extends Integer> p6 = new Pos01<>(1, "");
         Pos01<?> p7 = new Pos01<>(1, "");
         Pos01<? super Integer> p8 = new Pos01<>(1, "");
-    }
+
+        Pos01<Integer> p9 = new Pos01<>(1){};
+        Pos01<? extends Integer> p10 = new Pos01<>(1){};
+        Pos01<?> p11 = new Pos01<>(1){};
+        Pos01<? super Integer> p12 = new Pos01<>(1){};
+
+        Pos01<Integer> p13 = new Pos01<>(1, ""){};
+        Pos01<? extends Integer> p14= new Pos01<>(1, ""){};
+        Pos01<?> p15 = new Pos01<>(1, ""){};
+        Pos01<? super Integer> p16 = new Pos01<>(1, ""){};
+   }
 
     public static void main(String[] args) {
         Pos01<String> p1 = new Pos01<>("");
diff --git a/langtools/test/tools/javac/generics/diamond/pos/Pos02.java b/langtools/test/tools/javac/generics/diamond/pos/Pos02.java
index 835020c..72800e1 100644
--- a/langtools/test/tools/javac/generics/diamond/pos/Pos02.java
+++ b/langtools/test/tools/javac/generics/diamond/pos/Pos02.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,7 +23,7 @@
 
 /*
  * @test
- * @bug 6939620 7020044
+ * @bug 6939620 7020044 8062373
  *
  * @summary  basic test for diamond (simple/qualified type-expressions)
  * @author mcimadamore
@@ -48,6 +48,16 @@
         Foo<? extends Integer> f6 = new Foo<>(1, "");
         Foo<?> f7 = new Foo<>(1, "");
         Foo<? super Integer> f8 = new Foo<>(1, "");
+
+        Foo<Integer> f9 = new Foo<>(1){};
+        Foo<? extends Integer> f10 = new Foo<>(1){};
+        Foo<?> f11 = new Foo<>(1){};
+        Foo<? super Integer> f12 = new Foo<>(1){};
+
+        Foo<Integer> f13 = new Foo<>(1, ""){};
+        Foo<? extends Integer> f14 = new Foo<>(1, ""){};
+        Foo<?> f15 = new Foo<>(1, ""){};
+        Foo<? super Integer> f16 = new Foo<>(1, ""){};
     }
 
     void testQualified() {
@@ -60,6 +70,16 @@
         Foo<? extends Integer> f6 = new Pos02.Foo<>(1, "");
         Foo<?> f7 = new Pos02.Foo<>(1, "");
         Foo<? super Integer> f8 = new Pos02.Foo<>(1, "");
+
+        Foo<Integer> f9 = new Pos02.Foo<>(1){};
+        Foo<? extends Integer> f10 = new Pos02.Foo<>(1){};
+        Foo<?> f11 = new Pos02.Foo<>(1){};
+        Foo<? super Integer> f12 = new Pos02.Foo<>(1){};
+
+        Foo<Integer> f13 = new Pos02.Foo<>(1, ""){};
+        Foo<? extends Integer> f14 = new Pos02.Foo<>(1, ""){};
+        Foo<?> f15 = new Pos02.Foo<>(1, ""){};
+        Foo<? super Integer> f16 = new Pos02.Foo<>(1, ""){};
     }
 
     public static void main(String[] args) {
diff --git a/langtools/test/tools/javac/generics/diamond/pos/Pos03.java b/langtools/test/tools/javac/generics/diamond/pos/Pos03.java
index 9f975cf..aa7fed2 100644
--- a/langtools/test/tools/javac/generics/diamond/pos/Pos03.java
+++ b/langtools/test/tools/javac/generics/diamond/pos/Pos03.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,7 +23,7 @@
 
 /*
  * @test
- * @bug 6939620 7020044
+ * @bug 6939620 7020044 8062373
  *
  * @summary  basic test for diamond (simple/qualified type-expressions, member inner)
  * @author mcimadamore
@@ -49,6 +49,16 @@
         Foo<? extends Integer> f6 = new Foo<>(1, "");
         Foo<?> f7 = new Foo<>(1, "");
         Foo<? super Integer> f8 = new Foo<>(1, "");
+
+        Foo<Integer> f9 = new Foo<>(1){};
+        Foo<? extends Integer> f10 = new Foo<>(1){};
+        Foo<?> f11 = new Foo<>(1){};
+        Foo<? super Integer> f12 = new Foo<>(1){};
+
+        Foo<Integer> f13 = new Foo<>(1, ""){};
+        Foo<? extends Integer> f14 = new Foo<>(1, ""){};
+        Foo<?> f15 = new Foo<>(1, ""){};
+        Foo<? super Integer> f16 = new Foo<>(1, ""){};
     }
 
     void testQualified_1() {
@@ -61,6 +71,16 @@
         Foo<? extends Integer> f6 = new Pos03<U>.Foo<>(1, "");
         Foo<?> f7 = new Pos03<U>.Foo<>(1, "");
         Foo<? super Integer> f8 = new Pos03<U>.Foo<>(1, "");
+
+        Foo<Integer> f9 = new Pos03<U>.Foo<>(1){};
+        Foo<? extends Integer> f10 = new Pos03<U>.Foo<>(1){};
+        Foo<?> f11 = new Pos03<U>.Foo<>(1){};
+        Foo<? super Integer> f12 = new Pos03<U>.Foo<>(1){};
+
+        Foo<Integer> f13 = new Pos03<U>.Foo<>(1, ""){};
+        Foo<? extends Integer> f14 = new Pos03<U>.Foo<>(1, ""){};
+        Foo<?> f15 = new Pos03<U>.Foo<>(1, ""){};
+        Foo<? super Integer> f16 = new Pos03<U>.Foo<>(1, ""){};
     }
 
     void testQualified_2(Pos03<U> p) {
@@ -73,6 +93,16 @@
         Foo<? extends Integer> f6 = p.new Foo<>(1, "");
         Foo<?> f7 = p.new Foo<>(1, "");
         Foo<? super Integer> f8 = p.new Foo<>(1, "");
+
+        Foo<Integer> f9 = p.new Foo<>(1){};
+        Foo<? extends Integer> f10 = p.new Foo<>(1){};
+        Foo<?> f11 = p.new Foo<>(1){};
+        Foo<? super Integer> f12 = p.new Foo<>(1){};
+
+        Foo<Integer> f13 = p.new Foo<>(1, ""){};
+        Foo<? extends Integer> f14 = p.new Foo<>(1, ""){};
+        Foo<?> f15 = p.new Foo<>(1, ""){};
+        Foo<? super Integer> f16 = p.new Foo<>(1, ""){};
     }
 
     public static void main(String[] args) {
diff --git a/langtools/test/tools/javac/generics/diamond/pos/Pos04.java b/langtools/test/tools/javac/generics/diamond/pos/Pos04.java
index c0a3516..664cfa1 100644
--- a/langtools/test/tools/javac/generics/diamond/pos/Pos04.java
+++ b/langtools/test/tools/javac/generics/diamond/pos/Pos04.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,7 +23,7 @@
 
 /*
  * @test
- * @bug 6939620 7020044
+ * @bug 6939620 7020044 8062373
  *
  * @summary  basic test for diamond (simple/qualified type-expressions, local class)
  * @author mcimadamore
@@ -48,6 +48,16 @@
         Foo<? extends Integer> p6 = new Foo<>(1, "");
         Foo<?> p7 = new Foo<>(1, "");
         Foo<? super Integer> p8 = new Foo<>(1, "");
+
+        Foo<Integer> p9 = new Foo<>(1){};
+        Foo<? extends Integer> p10 = new Foo<>(1){};
+        Foo<?> p11 = new Foo<>(1){};
+        Foo<? super Integer> p12 = new Foo<>(1){};
+
+        Foo<Integer> p13 = new Foo<>(1, ""){};
+        Foo<? extends Integer> p14 = new Foo<>(1, ""){};
+        Foo<?> p15 = new Foo<>(1, ""){};
+        Foo<? super Integer> p16 = new Foo<>(1, ""){};
     }
 
     public static void main(String[] args) {
diff --git a/langtools/test/tools/javac/generics/diamond/pos/Pos05.java b/langtools/test/tools/javac/generics/diamond/pos/Pos05.java
index 9223ae8..74fc84c 100644
--- a/langtools/test/tools/javac/generics/diamond/pos/Pos05.java
+++ b/langtools/test/tools/javac/generics/diamond/pos/Pos05.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,11 +23,10 @@
 
 /*
  * @test
- * @bug 6939620 7020044
+ * @bug 6939620 7020044 8062373
  *
  * @summary  Check that 'complex' inference sometimes works in method context
  * @author mcimadamore
- * @compile Pos05.java
  *
  */
 
@@ -41,5 +40,11 @@
 
     void test() {
         m(new Foo<>(1));
+        m(new Foo<>(1) {});
     }
+
+    public static void main(String [] args) {
+        new Pos05().test();
+    }
+
 }
diff --git a/langtools/test/tools/javac/generics/inference/5073060/GenericsAndPackages.java b/langtools/test/tools/javac/generics/inference/5073060/GenericsAndPackages.java
index 15e9a1c..0779e9d 100644
--- a/langtools/test/tools/javac/generics/inference/5073060/GenericsAndPackages.java
+++ b/langtools/test/tools/javac/generics/inference/5073060/GenericsAndPackages.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2006, 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
@@ -23,7 +23,7 @@
 
 /**
  * @test
- * @bug     5073060
+ * @bug     5073060 8075610
  * @summary Package private members not found for intersection types
  * @author  Bruce Eckel
  * see      http://www.artima.com/forums/flat.jsp?forum=106&thread=136204
@@ -33,7 +33,7 @@
 package code;
 
 interface HasColor {
-    java.awt.Color getColor();
+    String getColor();
 }
 
 class Dimension {
@@ -44,6 +44,6 @@
     T item;
     ColoredDimension(T item) { this.item = item; }
     T getItem() { return item; }
-    java.awt.Color f() { return item.getColor(); }
+    String f() { return item.getColor(); }
     int getX() { return item.x; }
 }
diff --git a/langtools/test/tools/javac/generics/inference/8055963/T8055963.java b/langtools/test/tools/javac/generics/inference/8055963/T8055963.java
index 82f0027..0d4e120 100644
--- a/langtools/test/tools/javac/generics/inference/8055963/T8055963.java
+++ b/langtools/test/tools/javac/generics/inference/8055963/T8055963.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,11 +25,10 @@
 
 /**
  * @test
- * @bug 8055963
+ * @bug 8055963 8062373
  * @summary Inference failure with nested invocation
- * @compile T8055963.java
  */
-class T8055963 {
+public class T8055963 {
 
     static class C<T> {}
 
@@ -38,4 +37,8 @@
     void test() {
         C<String> cs = choose(new C<String>(), new C<>());
     }
+
+    public static void main(String [] args) {
+      new T8055963().test();
+    }
 }
diff --git a/langtools/test/tools/javac/lambda/8066974/T8066974.java b/langtools/test/tools/javac/lambda/8066974/T8066974.java
index 8f47277..fd8119d 100644
--- a/langtools/test/tools/javac/lambda/8066974/T8066974.java
+++ b/langtools/test/tools/javac/lambda/8066974/T8066974.java
@@ -1,6 +1,6 @@
 /*
  * @test /nodynamiccopyright/
- * @bug 8066974
+ * @bug 8066974 8062373
  * @summary Compiler doesn't infer method's generic type information in lambda body
  * @compile/fail/ref=T8066974.out -XDrawDiagnostics T8066974.java
  */
@@ -34,11 +34,13 @@
         map(p->p.m(rt));
         map(mapper(rt));
         map(new ThrowingMapper<>(rt));
+        map(new ThrowingMapper<>(rt) {});
     }
 
     void testChecked(CheckedThrowing ct) {
         map(p->p.m(ct));
         map(mapper(ct));
         map(new ThrowingMapper<>(ct));
+        map(new ThrowingMapper<>(ct) {});
     }
 }
diff --git a/langtools/test/tools/javac/lambda/8066974/T8066974.out b/langtools/test/tools/javac/lambda/8066974/T8066974.out
index 59772fc..101a18a 100644
--- a/langtools/test/tools/javac/lambda/8066974/T8066974.out
+++ b/langtools/test/tools/javac/lambda/8066974/T8066974.out
@@ -1,4 +1,5 @@
-T8066974.java:40:19: compiler.err.unreported.exception.need.to.catch.or.throw: java.lang.Exception
 T8066974.java:41:19: compiler.err.unreported.exception.need.to.catch.or.throw: java.lang.Exception
-T8066974.java:42:13: compiler.err.unreported.exception.need.to.catch.or.throw: java.lang.Exception
-3 errors
+T8066974.java:42:19: compiler.err.unreported.exception.need.to.catch.or.throw: java.lang.Exception
+T8066974.java:43:13: compiler.err.unreported.exception.need.to.catch.or.throw: java.lang.Exception
+T8066974.java:44:13: compiler.err.unreported.exception.need.to.catch.or.throw: java.lang.Exception
+4 errors
diff --git a/langtools/test/tools/javac/lambda/LocalVariableTable.java b/langtools/test/tools/javac/lambda/LocalVariableTable.java
index 8a4d04a..b70bc73 100644
--- a/langtools/test/tools/javac/lambda/LocalVariableTable.java
+++ b/langtools/test/tools/javac/lambda/LocalVariableTable.java
@@ -23,7 +23,7 @@
 
 /*
  * @test
- * @bug 8025998 8026749
+ * @bug 8025998 8026749 8054220 8058227
  * @summary Missing LV table in lambda bodies
  * @compile -g LocalVariableTable.java
  * @run main LocalVariableTable
@@ -183,7 +183,7 @@
         Run1 r = (a) -> { int x = a; };
     }
 
-    @Expect({ "a", "x" })
+    @Expect({ "a", "x", "v" })
     static class Lambda_Args1_Local1_Captured1 {
         void m() {
             int v = 0;
@@ -191,7 +191,7 @@
         }
     }
 
-    @Expect({ "a1", "a2", "x1", "x2", "this" })
+    @Expect({ "a1", "a2", "x1", "x2", "this", "v1", "v2" })
     static class Lambda_Args2_Local2_Captured2_this {
         int v;
         void m() {
@@ -204,7 +204,7 @@
         }
     }
 
-    @Expect({ "e" })
+    @Expect({ "e", "c" })
     static class Lambda_Try_Catch {
         private static Runnable asUncheckedRunnable(Closeable c) {
             return () -> {
diff --git a/langtools/test/tools/javac/lambda/MethodReference23.java b/langtools/test/tools/javac/lambda/MethodReference23.java
index b761038..2ac0e04 100644
--- a/langtools/test/tools/javac/lambda/MethodReference23.java
+++ b/langtools/test/tools/javac/lambda/MethodReference23.java
@@ -1,6 +1,6 @@
 /*
  * @test /nodynamiccopyright/
- * @bug 8003280
+ * @bug 8003280 8075184
  * @summary Add lambda tests
  *  check that pair of bound/non-bound constructor references is flagged as ambiguous
  * @author  Maurizio Cimadamore
diff --git a/langtools/test/tools/javac/lambda/MethodReference23.out b/langtools/test/tools/javac/lambda/MethodReference23.out
index 462a751..456a002 100644
--- a/langtools/test/tools/javac/lambda/MethodReference23.out
+++ b/langtools/test/tools/javac/lambda/MethodReference23.out
@@ -1,6 +1,6 @@
-MethodReference23.java:52:19: compiler.err.prob.found.req: (compiler.misc.invalid.mref: kindname.constructor, (compiler.misc.cant.access.inner.cls.constr: Inner1, MethodReference23, MethodReference23))
-MethodReference23.java:53:15: compiler.err.cant.apply.symbol: kindname.method, call11, MethodReference23.SAM11, @1140, kindname.class, MethodReference23, (compiler.misc.no.conforming.assignment.exists: (compiler.misc.invalid.mref: kindname.constructor, (compiler.misc.cant.access.inner.cls.constr: Inner1, MethodReference23, MethodReference23)))
-MethodReference23.java:57:19: compiler.err.prob.found.req: (compiler.misc.invalid.mref: kindname.constructor, (compiler.misc.cant.access.inner.cls.constr: Inner1, , MethodReference23))
-MethodReference23.java:58:15: compiler.err.cant.apply.symbol: kindname.method, call12, MethodReference23.SAM12, @1282, kindname.class, MethodReference23, (compiler.misc.no.conforming.assignment.exists: (compiler.misc.invalid.mref: kindname.constructor, (compiler.misc.cant.access.inner.cls.constr: Inner1, , MethodReference23)))
+MethodReference23.java:52:19: compiler.err.invalid.mref: kindname.constructor, (compiler.misc.cant.access.inner.cls.constr: Inner1, MethodReference23, MethodReference23)
+MethodReference23.java:53:16: compiler.err.invalid.mref: kindname.constructor, (compiler.misc.cant.access.inner.cls.constr: Inner1, MethodReference23, MethodReference23)
+MethodReference23.java:57:19: compiler.err.invalid.mref: kindname.constructor, (compiler.misc.cant.access.inner.cls.constr: Inner1, , MethodReference23)
+MethodReference23.java:58:16: compiler.err.invalid.mref: kindname.constructor, (compiler.misc.cant.access.inner.cls.constr: Inner1, , MethodReference23)
 MethodReference23.java:72:9: compiler.err.ref.ambiguous: call3, kindname.method, call3(MethodReference23.SAM21), MethodReference23, kindname.method, call3(MethodReference23.SAM22), MethodReference23
 5 errors
diff --git a/langtools/test/tools/javac/lambda/TargetType46.java b/langtools/test/tools/javac/lambda/TargetType46.java
index da37123..680ff3a 100644
--- a/langtools/test/tools/javac/lambda/TargetType46.java
+++ b/langtools/test/tools/javac/lambda/TargetType46.java
@@ -1,6 +1,6 @@
 /*
  * @test /nodynamiccopyright/
- * @bug 8003280
+ * @bug 8003280 8062373
  * @summary Add lambda tests
  *  compiler doesn't report accessibility problem due to inaccessible target
  * @compile/fail/ref=TargetType46.out -XDrawDiagnostics TargetType46.java
@@ -22,6 +22,7 @@
         outer.m(()->{}); //access error
         outer.m(this::g); //access error
         outer.m(new ArrayList<>()); //ok
+        outer.m(new ArrayList<>() {}); // access error
         outer.m(Collections.emptyList()); //ok
     }
 
diff --git a/langtools/test/tools/javac/lambda/TargetType46.out b/langtools/test/tools/javac/lambda/TargetType46.out
index ac3a125..30cd703 100644
--- a/langtools/test/tools/javac/lambda/TargetType46.out
+++ b/langtools/test/tools/javac/lambda/TargetType46.out
@@ -1,3 +1,4 @@
 TargetType46.java:22:17: compiler.err.report.access: TargetType46Outer.PI, private, TargetType46Outer
 TargetType46.java:23:17: compiler.err.report.access: TargetType46Outer.PI, private, TargetType46Outer
-2 errors
+TargetType46.java:25:16: compiler.err.report.access: TargetType46Outer.PI, private, TargetType46Outer
+3 errors
diff --git a/langtools/test/tools/javac/lambda/TargetType68.java b/langtools/test/tools/javac/lambda/TargetType68.java
index 92ce99b..13cad4f 100644
--- a/langtools/test/tools/javac/lambda/TargetType68.java
+++ b/langtools/test/tools/javac/lambda/TargetType68.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,9 +23,9 @@
 
 /*
  * @test
- * @bug 8010303
+ * @bug 8010303 8062373
  * @summary Graph inference: missing incorporation step causes spurious inference error
- * @compile TargetType68.java
+ * @compile/fail/ref=TargetType68.out -XDrawDiagnostics TargetType68.java
  */
 import java.util.*;
 
@@ -58,6 +58,6 @@
             List<XYChart.Data<Number, Number>> data_2 = new ArrayList<>();
             numberChart.getData().setAll(
                     Arrays.asList(new XYChart.Series<>("Data", FXCollections.observableList(data_1)),
-                    new XYChart.Series<>("Data", FXCollections.observableList(data_2))));
+                    new XYChart.Series<>("Data", FXCollections.observableList(data_2)) {}));
     }
 }
diff --git a/langtools/test/tools/javac/lambda/TargetType68.out b/langtools/test/tools/javac/lambda/TargetType68.out
new file mode 100644
index 0000000..6dd8e49
--- /dev/null
+++ b/langtools/test/tools/javac/lambda/TargetType68.out
@@ -0,0 +1,3 @@
+TargetType68.java:61:32: compiler.err.cant.inherit.from.final: TargetType68.XYChart.Series
+TargetType68.java:61:39: compiler.err.cant.inherit.from.final: TargetType68.XYChart.Series
+2 errors
diff --git a/langtools/test/tools/javac/lambda/TargetType69.java b/langtools/test/tools/javac/lambda/TargetType69.java
index 065c1e9..46b7a22 100644
--- a/langtools/test/tools/javac/lambda/TargetType69.java
+++ b/langtools/test/tools/javac/lambda/TargetType69.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,7 +23,7 @@
 
 /*
  * @test
- * @bug 8010303
+ * @bug 8010303 8062373
  * @summary Graph inference: missing incorporation step causes spurious inference error
  * @compile TargetType69.java
  */
@@ -47,5 +47,6 @@
 
     void test(Function<Integer, Integer> classifier, Function<Integer, Map<Integer, List<Integer>>> coll) {
         exerciseMapTabulation(coll, new GroupedMapAssertion<>(classifier));
+        exerciseMapTabulation(coll, new GroupedMapAssertion<>(classifier) {});
     }
 }
diff --git a/langtools/test/tools/javac/lambda/methodReferenceExecution/MethodReferenceNullCheckTest.java b/langtools/test/tools/javac/lambda/methodReferenceExecution/MethodReferenceNullCheckTest.java
index fd2bf65..c0fcedd 100644
--- a/langtools/test/tools/javac/lambda/methodReferenceExecution/MethodReferenceNullCheckTest.java
+++ b/langtools/test/tools/javac/lambda/methodReferenceExecution/MethodReferenceNullCheckTest.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,12 +25,11 @@
 
 /**
  * @test
- * @bug 8024696
+ * @bug 8024696 8075752
  * @summary Missing null check in bound method reference capture
  */
 
-import com.sun.tools.javac.util.Assert;
-import java.util.function.*;
+import java.util.function.Supplier;
 
 public class MethodReferenceNullCheckTest {
     public static void main(String[] args) {
@@ -41,7 +40,8 @@
         } catch (NullPointerException npe) {
             npeFired = true;
         } finally {
-            Assert.check(npeFired, "NPE should have been thrown");
+            if (!npeFired)
+                throw new AssertionError("NPE should have been thrown");
         }
     }
 }
diff --git a/langtools/test/tools/javac/lambdaShapes/org/openjdk/tests/javac/FDTest.java b/langtools/test/tools/javac/lambdaShapes/org/openjdk/tests/javac/FDTest.java
index d63f773..813c588 100644
--- a/langtools/test/tools/javac/lambdaShapes/org/openjdk/tests/javac/FDTest.java
+++ b/langtools/test/tools/javac/lambdaShapes/org/openjdk/tests/javac/FDTest.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 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
@@ -108,9 +108,10 @@
     public static List<Pair<TestKind, Hierarchy>> generateCases() {
         ArrayList<Pair<TestKind,Hierarchy>> list = new ArrayList<>();
         HierarchyGenerator hg = new HierarchyGenerator();
+        int i = 0;
         for (TestKind tk : TestKind.values()) {
             for (Hierarchy hs : tk.getHierarchy(hg)) {
-                list.add(new Pair<>(tk, hs));
+                list.add((i++ % 2) == 0 ? new Pair<>(tk, hs) {} : new Pair<>(tk, hs));
             }
         }
         return list;
diff --git a/langtools/test/tools/javac/scope/DupUnsharedTest.java b/langtools/test/tools/javac/scope/DupUnsharedTest.java
index 7506648..b60a2d1 100644
--- a/langtools/test/tools/javac/scope/DupUnsharedTest.java
+++ b/langtools/test/tools/javac/scope/DupUnsharedTest.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015 Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -68,7 +68,7 @@
     }
 
     void runScopeContentTest() throws Exception {
-        Set<Symbol> expected = Collections.newSetFromMap(new IdentityHashMap<>());
+        Set<Symbol> expected = Collections.newSetFromMap(new IdentityHashMap<>() {});
         Set<Symbol> notExpected = Collections.newSetFromMap(new IdentityHashMap<>());
         WriteableScope s1 = WriteableScope.create(symtab.rootPackage);
         ClassSymbol acceptSym = symtab.arrayClass;
@@ -105,7 +105,7 @@
     }
 
     Set<Symbol> toSet(Iterable<Symbol> it) {
-        Set<Symbol> result = Collections.newSetFromMap(new IdentityHashMap<>());
+        Set<Symbol> result = Collections.newSetFromMap(new IdentityHashMap<>() {});
 
         for (Symbol sym : it) {
             result.add(sym);
diff --git a/langtools/test/tools/javadoc/api/basic/GetTask_FileManagerTest.java b/langtools/test/tools/javadoc/api/basic/GetTask_FileManagerTest.java
index d5b34bd..c86bdc5 100644
--- a/langtools/test/tools/javadoc/api/basic/GetTask_FileManagerTest.java
+++ b/langtools/test/tools/javadoc/api/basic/GetTask_FileManagerTest.java
@@ -45,8 +45,6 @@
 import javax.tools.ToolProvider;
 
 import com.sun.tools.javac.file.JavacFileManager;
-import com.sun.tools.javac.nio.JavacPathFileManager;
-import com.sun.tools.javac.nio.PathFileManager;
 import com.sun.tools.javac.util.Context;
 
 /**
@@ -59,7 +57,7 @@
 
     /**
      * Verify that an alternate file manager can be specified:
-     * in this case, a PathFileManager.
+     * in this case, a TestFileManager.
      */
     @Test
     public void testFileManager() throws Exception {
diff --git a/make/CompileJavaModules.gmk b/make/CompileJavaModules.gmk
index 0668026..e0ad0f6 100644
--- a/make/CompileJavaModules.gmk
+++ b/make/CompileJavaModules.gmk
@@ -151,9 +151,19 @@
 
 ifeq ($(OPENJDK_TARGET_OS), macosx)
   # exclude all X11 on Mac.
-  java.desktop_EXCLUDES += sun/awt/X11
+  java.desktop_EXCLUDES += \
+      sun/awt/X11 \
+      sun/java2d/x11 \
+      sun/java2d/jules \
+      sun/java2d/xr \
+      com/sun/java/swing/plaf/gtk \
+      #
   java.desktop_EXCLUDE_FILES += \
-      $(JDK_TOPDIR)/src/java.desktop/unix/classes/sun/java2d/BackBufferCapsProvider.java \
+      $(wildcard $(JDK_TOPDIR)/src/java.desktop/unix/classes/sun/java2d/*.java) \
+      $(wildcard $(JDK_TOPDIR)/src/java.desktop/unix/classes/sun/java2d/opengl/*.java) \
+      $(wildcard $(JDK_TOPDIR)/src/java.desktop/unix/classes/sun/awt/*.java) \
+      $(wildcard $(JDK_TOPDIR)/src/java.desktop/unix/classes/sun/awt/motif/*.java) \
+      $(wildcard $(JDK_TOPDIR)/src/java.desktop/unix/classes/sun/font/*.java) \
       #
 else
   # TBD: figure out how to eliminate this long list
diff --git a/make/Help.gmk b/make/Help.gmk
new file mode 100644
index 0000000..4f2dae1
--- /dev/null
+++ b/make/Help.gmk
@@ -0,0 +1,115 @@
+#
+# Copyright (c) 2012, 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.  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.
+#
+
+###
+### Global targets for printing help etc.
+###
+
+# Helper macro to allow $(info) to properly print strings beginning with spaces.
+_:=
+
+help:
+	$(info )
+	$(info OpenJDK Makefile help)
+	$(info =====================)
+	$(info )
+	$(info Common make targets)
+	$(info $(_) make [default]         # Compile all modules in langtools, hotspot, jdk, jaxws,)
+	$(info $(_)                        # jaxp and corba, and create a runnable "exploded" image)
+	$(info $(_) make all               # Compile everything, all repos, docs and images)
+	$(info $(_) make images            # Create complete jdk and jre images)
+	$(info $(_) make <phase>           # Build the specified phase and everything it depends on)
+	$(info $(_)                        # (gensrc, java, copy, libs, launchers, gendata, rmic))
+	$(info $(_) make *-only            # Applies to most targets and disables compling the)
+	$(info $(_)                        # dependencies for the target. This is faster but may)
+	$(info $(_)                        # result in incorrect build results!)
+	$(info $(_) make docs              # Create all docs)
+	$(info $(_) make docs-javadoc      # Create just javadocs, depends on less than full docs)
+	$(info $(_) make profiles          # Create complete jre compact profile images)
+	$(info $(_) make bootcycle-images  # Build images twice, second time with newly built JDK)
+	$(info $(_) make install           # Install the generated images locally)
+	$(info $(_) make reconfigure       # Rerun configure with the same arguments as last time)
+	$(info $(_) make help              # Give some help on using make)
+	$(info $(_) make test              # Run tests, default is all tests (see TEST below))
+	$(info )
+	$(info Targets for cleaning)
+	$(info $(_) make clean             # Remove all files generated by make, but not those)
+	$(info $(_)                        # generated by configure)
+	$(info $(_) make dist-clean        # Remove all files, including configuration)
+	$(info $(_) make clean-<outputdir> # Remove the subdir in the output dir with the name)
+	$(info $(_) make clean-<phase>     # Remove all build results related to a certain build)
+	$(info $(_)                        # phase (gensrc, java, libs, launchers))
+	$(info $(_) make clean-<module>    # Remove all build results related to a certain module)
+	$(info $(_) make clean-<module>-<phase> # Remove all build results related to a certain)
+	$(info $(_)                        # module and phase)
+	$(info )
+	$(info Targets for specific modules)
+	$(info $(_) make <module>          # Build <module> and everything it depends on)
+	$(info $(_) make <module>-<phase>  # Compile the specified phase for the specified module)
+	$(info $(_)                        # and everything it depends on)
+	$(info $(_)                        # (gensrc, java, copy, libs, launchers, gendata, rmic))
+	$(info )
+	$(info Make control variables)
+	$(info $(_) CONF=                  # Build all configurations (note, assignment is empty))
+	$(info $(_) CONF=<substring>       # Build the configuration(s) with a name matching)
+	$(info $(_)                        # <substring>)
+	$(info $(_) SPEC=<spec file>       # Build the configuration given by the spec file)
+	$(info $(_) LOG=<loglevel>         # Change the log level from warn to <loglevel>)
+	$(info $(_)                        # Available log levels are:)
+	$(info $(_)                        # 'warn' (default), 'info', 'debug' and 'trace')
+	$(info $(_)                        # To see executed command lines, use LOG=debug)
+	$(info $(_) JOBS=<n>               # Run <n> parallel make jobs)
+	$(info $(_)                        # Note that -jN does not work as expected!)
+	$(info $(_) CONF_CHECK=<method>    # What to do if spec file is out of date)
+	$(info $(_)                        # method is 'auto', 'ignore' or 'fail' (default))
+	$(info $(_) make test TEST=<test>  # Only run the given test or tests, e.g.)
+	$(info $(_)                        # make test TEST="jdk_lang jdk_net")
+	$(info )
+	$(if $(all_confs), $(info Available configurations in $(build_dir):) $(foreach var,$(all_confs),$(info * $(var))),\
+	    $(info No configurations were found in $(build_dir).) $(info Run 'bash configure' to create a configuration))
+        # We need a dummy rule otherwise make will complain
+	@true
+
+print-targets:
+	$(if $(any_spec_file), ,\
+	  @echo "Note: More targets will be available when at least one configuration exists." 1>&2\
+	)
+	@echo $(ALL_TARGETS)
+
+print-modules:
+	$(if $(any_spec_file), \
+	  @$(MAKE) -s -f $(topdir)/make/Main.gmk -I $(topdir)/make/common SPEC=$(any_spec_file) print-modules \
+	, \
+	  @echo print-modules can currently only be run when at least one configuration exists \
+	)
+
+print-configurations:
+	$(foreach var, $(all_confs), $(info $(var)))
+        # We need a dummy rule otherwise make will complain
+	@true
+
+ALL_GLOBAL_TARGETS := help print-modules print-targets print-configurations
+
+.PHONY: $(ALL_GLOBAL_TARGETS)
diff --git a/make/HotspotWrapper.gmk b/make/HotspotWrapper.gmk
index 0677deb..e5ec544 100644
--- a/make/HotspotWrapper.gmk
+++ b/make/HotspotWrapper.gmk
@@ -42,7 +42,7 @@
 # not doing it breaks builds on msys.
 $(HOTSPOT_OUTPUTDIR)/_hotspot.timestamp: $(HOTSPOT_FILES)
 	@$(MKDIR) -p $(HOTSPOT_OUTPUTDIR)
-	@($(CD) $(HOTSPOT_TOPDIR)/make && $(MAKE) $(HOTSPOT_MAKE_ARGS) SPEC=$(HOTSPOT_SPEC) BASE_SPEC=$(BASE_SPEC))
+	@($(CD) $(HOTSPOT_TOPDIR)/make && $(MAKE) $(HOTSPOT_MAKE_ARGS) LOG_LEVEL=$(LOG_LEVEL) SPEC=$(HOTSPOT_SPEC) BASE_SPEC=$(BASE_SPEC))
 	$(TOUCH) $@
 
 hotspot: $(HOTSPOT_OUTPUTDIR)/_hotspot.timestamp
diff --git a/make/Init.gmk b/make/Init.gmk
new file mode 100644
index 0000000..59f98fa
--- /dev/null
+++ b/make/Init.gmk
@@ -0,0 +1,229 @@
+#
+# Copyright (c) 2012, 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.  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.
+#
+
+################################################################################
+# This is the bootstrapping part of the build. This file is included from the
+# top level Makefile, and is responsible for launching the Main.gmk file with
+# the proper make and the proper make arguments.
+################################################################################
+
+# This must be the first rule
+default:
+.PHONY: default
+
+# Inclusion of this pseudo-target will cause make to execute this file
+# serially, regardless of -j.
+.NOTPARALLEL:
+
+# If included from the top-level Makefile then topdir is set, but not when
+# recursively calling ourself with a spec.
+ifeq ($(topdir),)
+  topdir := $(strip $(patsubst %/make/, %, $(dir $(lastword $(MAKEFILE_LIST)))))
+endif
+
+# Our helper functions. Will include $(SPEC) if $(HAS_SPEC) is true.
+include $(topdir)/make/InitSupport.gmk
+
+# Here are "global" targets, i.e. targets that can be executed without having a configuration.
+# This will define ALL_GLOBAL_TARGETS.
+include $(topdir)/make/Help.gmk
+
+# Extract main targets from Main.gmk.
+ifneq ($(any_spec_file), )
+  ifeq ($(wildcard $(dir $(any_spec_file))/make-support/module-deps.gmk),)
+    # If make-support does not exist, we need to build the genmodules java tool first.
+    $(info Creating data for first make execution in new configuration...)
+    ignore_output := $(shell $(MAKE) -r -R -f $(topdir)/make/Main.gmk \
+        -I $(topdir)/make/common SPEC=$(any_spec_file) NO_RECIPES=true FRC)
+    $(info Done)
+  endif
+  ALL_MAIN_TARGETS := $(shell $(MAKE) -r -R -f $(topdir)/make/Main.gmk \
+      -I $(topdir)/make/common SPEC=$(any_spec_file) NO_RECIPES=true print-targets)
+else
+  # Without at least a single valid configuration, we cannot extract any real
+  # targets. To provide a helpful error message about the missing configuration
+  # later on, accept whatever targets the user has provided for now.
+  ALL_MAIN_TARGETS := $(if $(MAKECMDGOALS), $(MAKECMDGOALS), default)
+endif
+
+# Targets provided by this file.
+ALL_INIT_TARGETS := reconfigure
+
+ALL_TARGETS := $(sort $(ALL_GLOBAL_TARGETS) $(ALL_MAIN_TARGETS) $(ALL_INIT_TARGETS))
+
+ifneq ($(findstring qp, $(MAKEFLAGS)),)
+  ##############################################################################
+  # When called with -qp, assume an external part (e.g. bash completion) is trying
+  # to understand our targets. Just list our targets and do no more checking.
+  ##############################################################################
+
+  $(ALL_TARGETS):
+
+  .PHONY: $(ALL_TARGETS)
+
+else ifeq ($(HAS_SPEC),)
+
+  ##############################################################################
+  # This is the normal case, we have been called from the command line by the
+  # user and we need to call ourself back with a proper SPEC.
+  ##############################################################################
+
+  $(eval $(call CheckControlVariables))
+  $(eval $(call CheckDeprecatedEnvironment))
+  $(eval $(call CheckInvalidMakeFlags))
+
+  $(eval $(call ParseConfCheckOption))
+
+  # Check that the LOG given is valid, and set LOG_LEVEL, LOG_NOFILE and MAKE_LOG_FLAGS.
+  $(eval $(call ParseLogLevel))
+
+  ifneq ($(findstring $(LOG_LEVEL),info debug trace),)
+    $(info Running make as '$(strip $(MAKE) $(MFLAGS) $(COMMAND_LINE_VARIABLES) $(MAKECMDGOALS))')
+  endif
+
+  # CALLED_TARGETS is the list of targets that the user provided,
+  # or "default" if unspecified.
+  CALLED_TARGETS := $(if $(MAKECMDGOALS), $(MAKECMDGOALS), default)
+  CALLED_SPEC_TARGETS := $(filter $(ALL_MAIN_TARGETS) $(ALL_INIT_TARGETS), $(CALLED_TARGETS))
+  ifneq ($(CALLED_SPEC_TARGETS),)
+    # We have at least one non-global target, which need a SPEC
+    $(eval $(call ParseConfAndSpec))
+    # Now SPECS contain 1..N spec files (otherwise ParseConfAndSpec fails)
+
+    INIT_TARGETS := $(filter $(ALL_INIT_TARGETS), $(CALLED_SPEC_TARGETS))
+    SEQUENTIAL_TARGETS := $(filter dist-clean clean%, $(CALLED_SPEC_TARGETS))
+    PARALLEL_TARGETS := $(filter-out $(INIT_TARGETS) $(SEQUENTIAL_TARGETS), $(CALLED_SPEC_TARGETS))
+
+    # The spec files depend on the autoconf source code. This check makes sure
+    # the configuration is up to date after changes to configure.
+    $(SPECS): $(wildcard $(topdir)/common/autoconf/*)
+        ifeq ($(CONF_CHECK), fail)
+	  @echo "Error: The configuration is not up to date for '$(lastword $(subst /, , $(dir $@)))'."
+	  $(call PrintConfCheckFailed)
+	  @exit 2
+        else ifeq ($(CONF_CHECK), auto)
+	  @echo "Note: The configuration is not up to date for '$(lastword $(subst /, , $(dir $@)))'."
+	  @( cd $(topdir) && \
+	      $(MAKE) $(MFLAGS) $(MAKE_LOG_FLAGS) -f $(topdir)/make/Init.gmk SPEC=$@ HAS_SPEC=true \
+	      reconfigure )
+        else ifeq ($(CONF_CHECK), ignore)
+          # Do nothing
+        endif
+
+    # Unless reconfigure is explicitely called, let all targets depend on the spec files to be up to date.
+    ifeq ($(findstring reconfigure, $(CALLED_SPEC_TARGETS)), )
+      $(CALLED_SPEC_TARGETS): $(SPECS)
+    endif
+
+    # The recipe will be run once for every target specified, but we only want to execute the
+    # recipe a single time, hence the TARGET_DONE with a dummy command if true.
+    $(ALL_MAIN_TARGETS) $(ALL_INIT_TARGETS):
+	@$(if $(TARGET_DONE), \
+	  true \
+	, \
+	  $(foreach spec, $(SPECS), \
+	    ( cd $(topdir) && \
+	    $(MAKE) $(MFLAGS) $(MAKE_LOG_FLAGS) -j 1 -f $(topdir)/make/Init.gmk \
+	        SPEC=$(spec) HAS_SPEC=true \
+	        USER_MAKE_VARS="$(USER_MAKE_VARS)" MAKE_LOG_FLAGS=$(MAKE_LOG_FLAGS) \
+	        LOG_LEVEL=$(LOG_LEVEL) LOG_NOFILE=$(LOG_NOFILE) \
+	        INIT_TARGETS="$(INIT_TARGETS)" SEQUENTIAL_TARGETS="$(SEQUENTIAL_TARGETS)" \
+	        PARALLEL_TARGETS="$(PARALLEL_TARGETS)"  \
+	        main ) && \
+	  ) true \
+	  $(eval TARGET_DONE=true) \
+	)
+
+    .PHONY: $(ALL_MAIN_TARGETS) $(ALL_INIT_TARGETS)
+
+  endif # has $(CALLED_SPEC_TARGETS)
+
+else # HAS_SPEC=true
+
+  ##############################################################################
+  # Now we have a spec. This part provides the "main" target that acts as a
+  # trampoline to call the Main.gmk with the value of $(MAKE) found in the spec
+  # file.
+  ##############################################################################
+
+  ifeq ($(LOG_NOFILE), true)
+    # Disable log wrapper if LOG=[level,]nofile was given
+    override BUILD_LOG_WRAPPER :=
+  endif
+
+  ifeq ($(OUTPUT_SYNC_SUPPORTED), true)
+    OUTPUT_SYNC_FLAG := -O$(OUTPUT_SYNC)
+  endif
+
+  $(eval $(call CheckSpecSanity))
+
+  reconfigure:
+        ifneq ($(CONFIGURE_COMMAND_LINE), )
+	  $(ECHO) "Re-running configure using arguments '$(CONFIGURE_COMMAND_LINE)'"
+        else
+	  $(ECHO) "Re-running configure using default settings"
+        endif
+	( cd $(OUTPUT_ROOT) && PATH="$(ORIGINAL_PATH)" \
+	    $(BASH) $(TOPDIR)/configure $(CONFIGURE_COMMAND_LINE) )
+
+  main-init:
+	$(call RotateLogFiles)
+	$(BUILD_LOG_WRAPPER) $(PRINTF) "Building target(s) '$(strip \
+	    $(INIT_TARGETS) $(SEQUENTIAL_TARGETS) $(PARALLEL_TARGETS) \
+	    )' in configuration '$(CONF_NAME)'\n"
+
+
+  # MAKEOVERRIDES is automatically set and propagated by Make to sub-Make calls.
+  # We need to clear it of the init-specific variables. The user-specified
+  # variables are explicitely propagated using $(USER_MAKE_VARS).
+  main: MAKEOVERRIDES :=
+
+  main: $(INIT_TARGETS) main-init
+        ifneq ($(SEQUENTIAL_TARGETS), )
+          # Don't touch build output dir since we might be cleaning. That means
+	  # no log wrapper.
+	  ( cd $(TOPDIR) && \
+	      $(MAKE) $(MAKE_ARGS) -j 1 -f make/Main.gmk $(USER_MAKE_VARS) \
+	      $(SEQUENTIAL_TARGETS) \
+	  )
+        endif
+        ifneq ($(PARALLEL_TARGETS), )
+	  $(call StartGlobalTimer)
+	  $(call PrepareSmartJavac)
+	  ( cd $(TOPDIR) && \
+	      $(BUILD_LOG_WRAPPER) $(MAKE) $(MAKE_ARGS) $(OUTPUT_SYNC_FLAG) \
+	      -j $(JOBS) -f make/Main.gmk $(USER_MAKE_VARS) \
+	      $(PARALLEL_TARGETS) \
+	  )
+	  $(call CleanupSmartJavac)
+	  $(call StopGlobalTimer)
+	  $(call ReportBuildTimes)
+        endif
+	$(BUILD_LOG_WRAPPER) $(PRINTF) "Finished building target(s) '$(strip \
+	    $(INIT_TARGETS) $(SEQUENTIAL_TARGETS) $(PARALLEL_TARGETS) \
+	    )' in configuration '$(CONF_NAME)'\n"
+
+  .PHONY: reconfigure main-init main
+endif
diff --git a/make/InitSupport.gmk b/make/InitSupport.gmk
new file mode 100644
index 0000000..cc733cf
--- /dev/null
+++ b/make/InitSupport.gmk
@@ -0,0 +1,328 @@
+#
+# Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# This code is free software; you can redistribute it and/or modify it
+# 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.
+#
+
+################################################################################
+# This file contains helper functions for Init.gmk.
+# It is divided in two parts, depending on if a SPEC is present or not
+# (HAS_SPEC is true or not).
+################################################################################
+
+ifndef _INITSUPPORT_GMK
+_INITSUPPORT_GMK := 1
+
+# Setup information about available configurations, if any.
+build_dir=$(topdir)/build
+all_spec_files=$(wildcard $(build_dir)/*/spec.gmk)
+# Extract the configuration names from the path
+all_confs=$(patsubst %/spec.gmk, %, $(patsubst $(build_dir)/%, %, $(all_spec_files)))
+any_spec_file=$(firstword $(all_spec_files))
+
+ifeq ($(HAS_SPEC),)
+  ##############################################################################
+  # Helper functions for the initial part of Init.gmk, before the spec file is
+  # loaded. Most of these functions provide parsing and setting up make options
+  # from the command-line.
+  ##############################################################################
+
+  # Make control variables, handled by Init.gmk
+  INIT_CONTROL_VARIABLES := LOG CONF SPEC JOBS CONF_CHECK
+
+  # All known make control variables
+  MAKE_CONTROL_VARIABLES := $(INIT_CONTROL_VARIABLES) TEST JDK_FILTER
+
+  # Define a simple reverse function.
+  # Should maybe move to MakeBase.gmk, but we can't include that file now.
+  reverse = \
+      $(if $(strip $(1)), $(call reverse, $(wordlist 2, $(words $(1)), $(1)))) \
+          $(firstword $(1))
+
+  # The variable MAKEOVERRIDES contains variable assignments from the command
+  # line, but in reverse order to what the user entered.
+  COMMAND_LINE_VARIABLES := $(subst \#,\ , $(call reverse, $(subst \ ,\#,$(MAKEOVERRIDES))))
+
+  # A list like FOO="val1" BAR="val2" containing all user-supplied make variables
+  # that we should propagate.
+  USER_MAKE_VARS := $(filter-out $(addsuffix =%, $(INIT_CONTROL_VARIABLES)), \
+      $(MAKEOVERRIDES))
+
+  # Check for unknown command-line variables
+  define CheckControlVariables
+    command_line_variables := $$(strip $$(foreach var, \
+        $$(subst \ ,_,$$(MAKEOVERRIDES)), \
+        $$(firstword $$(subst =, , $$(var)))))
+    unknown_command_line_variables := $$(strip $$(filter-out $$(MAKE_CONTROL_VARIABLES), $$(command_line_variables)))
+    ifneq ($$(unknown_command_line_variables), )
+      $$(info Note: Command line contains non-control variables:)
+      $$(foreach var, $$(unknown_command_line_variables), $$(info * $$(var)=$$($$(var))))
+      $$(info Make sure it is not mistyped, and that you intend to override this variable.)
+      $$(info 'make help' will list known control variables.)
+      $$(info )
+    endif
+  endef
+
+  # Check for deprecated ALT_ variables
+  define CheckDeprecatedEnvironment
+    defined_alt_variables := $$(filter ALT_%, $$(.VARIABLES))
+    ifneq ($$(defined_alt_variables), )
+      $$(info Warning: You have the following ALT_ variables set:)
+      $$(foreach var, $$(defined_alt_variables), $$(info * $$(var)=$$($$(var))))
+      $$(info ALT_ variables are deprecated, and may result in a failed build.)
+      $$(info Please clean your environment.)
+      $$(info )
+    endif
+  endef
+
+  # Check for invalid make flags like -j
+  define CheckInvalidMakeFlags
+    # This is a trick to get this rule to execute before any other rules
+    # MAKEFLAGS only indicate -j if read in a recipe (!)
+    $$(topdir)/make/Init.gmk: .FORCE
+	$$(if $$(findstring --jobserver, $$(MAKEFLAGS)), \
+	    $$(info Error: 'make -jN' is not supported, use 'make JOBS=N') \
+	    $$(error Cannot continue) \
+	)
+    .FORCE:
+    .PHONY: .FORCE
+  endef
+
+  # Check that the CONF_CHECK option is valid and set up handling
+  define ParseConfCheckOption
+    ifeq ($$(CONF_CHECK), )
+      # Default behavior is fail
+      CONF_CHECK := fail
+    else ifneq ($$(filter-out auto fail ignore, $$(CONF_CHECK)),)
+      $$(info Error: CONF_CHECK must be one of: auto, fail or ignore.)
+      $$(error Cannot continue)
+    endif
+  endef
+
+  define ParseLogLevel
+    # Catch old-style VERBOSE= command lines.
+    ifneq ($$(origin VERBOSE), undefined)
+      $$(info Error: VERBOSE is deprecated. Use LOG=<warn|info|debug|trace> instead.)
+      $$(error Cannot continue)
+    endif
+
+    # Setup logging according to LOG
+
+    # If the "nofile" argument is given, act on it and strip it away
+    ifneq ($$(findstring nofile, $$(LOG)),)
+      LOG_NOFILE := true
+      # COMMA is defined in spec.gmk, but that is not included yet
+      COMMA := ,
+      # First try to remove ",nofile" if it exists, otherwise just remove "nofile"
+      LOG_STRIPPED := $$(subst nofile,, $$(subst $$(COMMA)nofile,, $$(LOG)))
+      # We might have ended up with a leading comma. Remove it
+      LOG_LEVEL := $$(strip $$(patsubst $$(COMMA)%, %, $$(LOG_STRIPPED)))
+    else
+      LOG_LEVEL := $$(LOG)
+    endif
+
+    ifeq ($$(LOG_LEVEL),)
+      # Set LOG to "warn" as default if not set
+      LOG_LEVEL := warn
+    endif
+
+    ifeq ($$(LOG_LEVEL), warn)
+      MAKE_LOG_FLAGS := -s
+    else ifeq ($$(LOG_LEVEL), info)
+      MAKE_LOG_FLAGS := -s
+    else ifeq ($$(LOG_LEVEL), debug)
+      MAKE_LOG_FLAGS :=
+    else ifeq ($$(LOG_LEVEL), trace)
+      MAKE_LOG_FLAGS := -d
+    else
+      $$(info Error: LOG must be one of: warn, info, debug or trace.)
+      $$(error Cannot continue)
+    endif
+  endef
+
+  define ParseConfAndSpec
+    ifneq ($$(origin SPEC), undefined)
+      # We have been given a SPEC, check that it works out properly
+      ifneq ($$(origin CONF), undefined)
+        # We also have a CONF argument. We can't have both.
+        $$(info Error: Cannot use CONF=$$(CONF) and SPEC=$$(SPEC) at the same time. Choose one.)
+        $$(error Cannot continue)
+      endif
+      ifeq ($$(wildcard $$(SPEC)),)
+        $$(info Error: Cannot locate spec.gmk, given by SPEC=$$(SPEC).)
+        $$(error Cannot continue)
+      endif
+      ifeq ($$(filter /%, $$(SPEC)),)
+        # If given with relative path, make it absolute
+        SPECS := $$(CURDIR)/$$(strip $$(SPEC))
+      else
+        SPECS := $$(SPEC)
+      endif
+
+      # For now, unset this SPEC variable.
+      override SPEC :=
+    else
+      # Use spec.gmk files in the build output directory
+      ifeq ($$(any_spec_file),)
+        $$(info Error: No configurations found for $$(topdir).)
+        $$(info Please run 'bash configure' to create a configuration.)
+        $$(info )
+        $$(error Cannot continue)
+      endif
+
+      ifneq ($$(origin CONF), undefined)
+        # User have given a CONF= argument.
+        ifeq ($$(CONF),)
+          # If given CONF=, match all configurations
+          matching_confs := $$(strip $$(all_confs))
+        else
+          # Otherwise select those that contain the given CONF string
+          matching_confs := $$(strip $$(foreach var, $$(all_confs), $$(if $$(findstring $$(CONF), $$(var)), $$(var))))
+        endif
+        ifeq ($$(matching_confs),)
+          $$(info Error: No configurations found matching CONF=$$(CONF).)
+          $$(info Available configurations in $$(build_dir):)
+          $$(foreach var, $$(all_confs), $$(info * $$(var)))
+          $$(error Cannot continue)
+        else
+          ifeq ($$(words $$(matching_confs)), 1)
+            $$(info Building configuration '$$(matching_confs)' (matching CONF=$$(CONF)))
+          else
+            $$(info Building these configurations (matching CONF=$$(CONF)):)
+            $$(foreach var, $$(matching_confs), $$(info * $$(var)))
+          endif
+        endif
+
+        # Create a SPEC definition. This will contain the path to one or more spec.gmk files.
+        SPECS := $$(addsuffix /spec.gmk, $$(addprefix $$(build_dir)/, $$(matching_confs)))
+      else
+        # No CONF or SPEC given, check the available configurations
+        ifneq ($$(words $$(all_spec_files)), 1)
+          $$(info Error: No CONF given, but more than one configuration found.)
+          $$(info Available configurations in $$(build_dir):)
+          $$(foreach var, $$(all_confs), $$(info * $$(var)))
+          $$(info Please retry building with CONF=<config pattern> (or SPEC=<spec file>).)
+          $$(info )
+          $$(error Cannot continue)
+        endif
+
+        # We found exactly one configuration, use it
+        SPECS := $$(strip $$(all_spec_files))
+      endif
+    endif
+  endef
+
+  define PrintConfCheckFailed
+	@echo ' '
+	@echo "Please rerun configure! Easiest way to do this is by running"
+	@echo "'make reconfigure'."
+	@echo "This behavior may also be changed using CONF_CHECK=<ignore|auto>."
+	@echo ' '
+  endef
+
+else # $(HAS_SPEC)=true
+  ##############################################################################
+  # Helper functions for the 'main' target. These functions assume a single,
+  # proper and existing SPEC is provided, and will load it.
+  ##############################################################################
+
+  include $(SPEC)
+  include $(SRC_ROOT)/make/common/MakeBase.gmk
+
+  # Define basic logging setup
+  BUILD_LOG := $(OUTPUT_ROOT)/build.log
+  BUILD_TRACE_LOG := $(OUTPUT_ROOT)/build-trace-time.log
+
+  BUILD_LOG_WRAPPER := $(BASH) $(SRC_ROOT)/common/bin/logger.sh $(BUILD_LOG)
+
+  # Disable the build log wrapper on sjavac+windows until
+  # we have solved how to prevent the log wrapper to wait
+  # for the background sjavac server process.
+  ifeq ($(ENABLE_SJAVAC)X$(OPENJDK_BUILD_OS),yesXwindows)
+    LOG_NOFILE := true
+  endif
+
+  # Sanity check the spec file, so it matches this source code
+  define CheckSpecSanity
+    ifneq ($$(topdir), $$(TOPDIR))
+      ifneq ($$(topdir), $$(ORIGINAL_TOPDIR))
+        ifneq ($$(topdir), $$(CANONICAL_TOPDIR))
+          $$(info Error: SPEC mismatch! Current working directory)
+          $$(info $$(topdir))
+          $$(info does not match either TOPDIR, ORIGINAL_TOPDIR or CANONICAL_TOPDIR)
+          $$(info $$(TOPDIR))
+          $$(info $$(ORIGINAL_TOPDIR))
+          $$(info $$(CANONICAL_TOPDIR))
+          $$(error Cannot continue)
+        endif
+      endif
+    endif
+  endef
+
+  define RotateLogFiles
+	$(RM) $(BUILD_LOG).old 2> /dev/null
+	$(MV) $(BUILD_LOG) $(BUILD_LOG).old 2> /dev/null || true
+	$(if $(findstring trace, $(LOG_LEVEL)), \
+	  $(RM) $(BUILD_TRACE_LOG).old 2> /dev/null && \
+	  $(MV) $(BUILD_TRACE_LOG) $(BUILD_TRACE_LOG).old 2> /dev/null || true \
+	)
+  endef
+
+  # Remove any javac server logs and port files. This
+  # prevents a new make run to reuse the previous servers.
+  define PrepareSmartJavac
+	$(if $(SJAVAC_SERVER_DIR), \
+	  $(RM) -r $(SJAVAC_SERVER_DIR) 2> /dev/null && \
+	  $(MKDIR) -p $(SJAVAC_SERVER_DIR) \
+	)
+  endef
+
+  define CleanupSmartJavac
+	[ -f $(SJAVAC_SERVER_DIR)/server.port ] && $(ECHO) Stopping sjavac server && \
+	    $(TOUCH) $(SJAVAC_SERVER_DIR)/server.port.stop; true
+  endef
+
+  define StartGlobalTimer
+	$(RM) -r $(BUILDTIMESDIR) 2> /dev/null
+	$(MKDIR) -p $(BUILDTIMESDIR)
+	$(call RecordStartTime,TOTAL)
+  endef
+
+  define StopGlobalTimer
+	$(call RecordEndTime,TOTAL)
+  endef
+
+  # Find all build_time_* files and print their contents in a list sorted
+  # on the name of the sub repository.
+  define ReportBuildTimes
+	$(BUILD_LOG_WRAPPER) $(PRINTF) $(LOG_INFO) -- \
+	    "----- Build times -------\nStart %s\nEnd   %s\n%s\n%s\n-------------------------\n" \
+	    "`$(CAT) $(BUILDTIMESDIR)/build_time_start_TOTAL_human_readable`" \
+	    "`$(CAT) $(BUILDTIMESDIR)/build_time_end_TOTAL_human_readable`" \
+	    "`$(LS) $(BUILDTIMESDIR)/build_time_diff_* | $(GREP) -v _TOTAL | \
+	    $(XARGS) $(CAT) | $(SORT) -k 2`" \
+	    "`$(CAT) $(BUILDTIMESDIR)/build_time_diff_TOTAL`"
+  endef
+
+endif # HAS_SPEC
+
+endif # _INITSUPPORT_GMK
diff --git a/make/Jprt.gmk b/make/Jprt.gmk
index f3f8726..57a7c67 100644
--- a/make/Jprt.gmk
+++ b/make/Jprt.gmk
@@ -130,7 +130,4 @@
         endif
 	@$(call TargetExit)
 
-
-###########################################################################
-# Phony targets
-.PHONY: jprt_bundle bundles final-images
+ALL_TARGETS += jprt_bundle bundles final-images
diff --git a/make/Main.gmk b/make/Main.gmk
index 5a4e0d5..a6aef46 100644
--- a/make/Main.gmk
+++ b/make/Main.gmk
@@ -26,14 +26,19 @@
 ################################################################################
 # This is the main makefile containing most actual top level targets. It needs
 # to be called with a SPEC file defined.
+################################################################################
 
 # Declare default target
 default:
 
+ifeq ($(wildcard $(SPEC)),)
+  $(error Main.gmk needs SPEC set to a proper spec.gmk)
+endif
+
 # Now load the spec
 include $(SPEC)
 
-include $(SRC_ROOT)/make/MakeHelpers.gmk
+include $(SRC_ROOT)/make/MainSupport.gmk
 
 # Load the vital tools for all the makefiles.
 include $(SRC_ROOT)/make/common/MakeBase.gmk
@@ -215,7 +220,8 @@
 BOOTCYCLE_TARGET := product-images
 bootcycle-images:
 	@$(ECHO) Boot cycle build step 2: Building a new JDK image using previously built image
-	+$(MAKE) $(MAKE_ARGS) -f Main.gmk SPEC=$(dir $(SPEC))bootcycle-spec.gmk $(BOOTCYCLE_TARGET)
+	+$(MAKE) $(MAKE_ARGS) -f $(SRC_ROOT)/make/Main.gmk \
+	    SPEC=$(dir $(SPEC))bootcycle-spec.gmk $(BOOTCYCLE_TARGET)
 
 zip-security:
 	+($(CD) $(SRC_ROOT)/make && $(MAKE) $(MAKE_ARGS) -f ZipSecurity.gmk)
@@ -589,42 +595,29 @@
     $(CLEAN_PHASE_TARGETS) $(CLEAN_MODULE_TARGETS) $(CLEAN_MODULE_PHASE_TARGETS)
 
 ################################################################################
-
-# Setup a rule for SPEC file that fails if executed. This check makes sure the
-# configuration is up to date after changes to configure.
-ifeq ($(findstring reconfigure, $(MAKECMDGOALS)), )
-  $(SPEC): $(wildcard $(SRC_ROOT)/common/autoconf/*)
-	@$(ECHO) "ERROR: $(SPEC) is not up to date."
-	@$(ECHO) "Please rerun configure! Easiest way to do this is by running"
-	@$(ECHO) "'make reconfigure'."
-	@$(ECHO) "It may also be ignored by setting IGNORE_OLD_CONFIG=true"
-	@if test "x$(IGNORE_OLD_CONFIG)" != "xtrue"; then exit 1; fi
-endif
-
-# The reconfigure target is automatically run serially from everything else
-# by the Makefile calling this file.
-
-reconfigure:
-        ifneq ($(CONFIGURE_COMMAND_LINE), )
-	  @$(ECHO) "Re-running configure using arguments '$(CONFIGURE_COMMAND_LINE)'"
-        else
-	  @$(ECHO) "Re-running configure using default settings"
-        endif
-	@( cd $(OUTPUT_ROOT) && PATH="$(ORIGINAL_PATH)" \
-	    $(BASH) $(TOPDIR)/configure $(CONFIGURE_COMMAND_LINE) )
-
-ALL_TARGETS += reconfigure
-
-################################################################################
 # Declare *-only targets for each normal target
 $(foreach t, $(ALL_TARGETS), $(eval $(t)-only: $(t)))
 
-ALL_TARGETS += $(addsuffix -only, $(filter-out clean%, $(ALL_TARGETS)))
+ALL_TARGETS += $(addsuffix -only, $(filter-out dist-clean clean%, $(ALL_TARGETS)))
+
+################################################################################
+
+# Include JPRT targets
+include $(SRC_ROOT)/make/Jprt.gmk
+
+################################################################################
+
+print-targets:
+	  @$(ECHO) $(sort $(ALL_TARGETS))
+
+print-modules:
+	  @$(ECHO) $(sort $(ALL_MODULES))
+
+# print-* targets intentionally not added to ALL_TARGETS since they are internal only.
+# The corresponding external targets are in Help.gmk
 
 ################################################################################
 
 .PHONY: $(ALL_TARGETS)
 
-include $(SRC_ROOT)/make/Jprt.gmk
-
 FRC: # Force target
diff --git a/make/MainSupport.gmk b/make/MainSupport.gmk
new file mode 100644
index 0000000..aded13e
--- /dev/null
+++ b/make/MainSupport.gmk
@@ -0,0 +1,186 @@
+#
+# Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# This code is free software; you can redistribute it and/or modify it
+# 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.
+#
+
+################################################################################
+# This file contains helper functions for Main.gmk.
+################################################################################
+
+ifndef _MAINSUPPORT_GMK
+_MAINSUPPORT_GMK := 1
+
+# Run the tests specified by $1.
+define RunTests
+	($(CD) $(SRC_ROOT)/test && $(MAKE) $(MAKE_ARGS) -j1 -k MAKEFLAGS= \
+	    JT_HOME=$(JT_HOME) PRODUCT_HOME=$(JDK_IMAGE_DIR) \
+	    TEST_IMAGE_DIR=$(TEST_IMAGE_DIR) \
+	    ALT_OUTPUTDIR=$(OUTPUT_ROOT) CONCURRENCY=$(JOBS) $1) || true
+endef
+
+# Cleans the dir given as $1
+define CleanDir
+	@$(PRINTF) "Cleaning $(strip $1) build artifacts ..."
+	@($(CD) $(OUTPUT_ROOT) && $(RM) -r $1)
+	@$(PRINTF) " done\n"
+endef
+
+define CleanTest
+	@$(PRINTF) "Cleaning test $(strip $1) ..."
+	@$(RM) -r $(SUPPORT_OUTPUTDIR)/test/$(strip $(subst -,/,$1))
+	@$(PRINTF) " done\n"
+endef
+
+define Clean-gensrc
+	@$(PRINTF) "Cleaning gensrc $(if $1,for $(strip $1) )..."
+	@$(RM) -r $(SUPPORT_OUTPUTDIR)/gensrc/$(strip $1)
+	@$(RM) -r $(SUPPORT_OUTPUTDIR)/gensrc_no_docs/$(strip $1)
+	@$(PRINTF) " done\n"
+endef
+
+define Clean-java
+	@$(PRINTF) "Cleaning java $(if $1,for $(strip $1) )..."
+	@$(RM) -r $(JDK_OUTPUTDIR)/modules/$(strip $1)
+	@$(RM) -r $(SUPPORT_OUTPUTDIR)/misc/$(strip $1)
+	@$(PRINTF) " done\n"
+	@$(PRINTF) "Cleaning headers $(if $1,for $(strip $1)) ..."
+	@$(RM) -r $(SUPPORT_OUTPUTDIR)/headers/$(strip $1)
+	@$(PRINTF) " done\n"
+endef
+
+define Clean-native
+	@$(PRINTF) "Cleaning native $(if $1,for $(strip $1) )..."
+	@$(RM) -r $(SUPPORT_OUTPUTDIR)/native/$(strip $1)
+	@$(RM) -r $(SUPPORT_OUTPUTDIR)/modules_libs/$(strip $1)
+	@$(RM) -r $(SUPPORT_OUTPUTDIR)/modules_libs-stripped/$(strip $1)
+	@$(RM) -r $(SUPPORT_OUTPUTDIR)/modules_cmds/$(strip $1)
+	@$(RM) -r $(SUPPORT_OUTPUTDIR)/modules_cmds-stripped/$(strip $1)
+	@$(PRINTF) " done\n"
+endef
+
+define Clean-include
+	@$(PRINTF) "Cleaning include $(if $1,for $(strip $1) )..."
+	@$(RM) -r $(SUPPORT_OUTPUTDIR)/modules_include/$(strip $1)
+	@$(PRINTF) " done\n"
+endef
+
+define CleanModule
+  $(call Clean-gensrc, $1)
+  $(call Clean-java, $1)
+  $(call Clean-native, $1)
+  $(call Clean-include, $1)
+endef
+
+
+################################################################################
+
+MAKE_TOPDIR_LIST := $(JDK_TOPDIR) $(CORBA_TOPDIR) $(LANGTOOLS_TOPDIR)
+MAKE_MAKEDIR_LIST := make
+
+# Helper macro for DeclareRecipesForPhase
+# Declare a recipe for calling the module and phase specific makefile.
+# If there are multiple makefiles to call, create a rule for each topdir
+# that contains a makefile with the target $module-$suffix-$repodir,
+# (i.e: java.base-gensrc-jdk)
+# Normally there is only one makefile, and the target will just be
+# $module-$suffix
+# Param 1: Name of list to add targets to
+# Param 2: Module name
+# Param 3: Topdir
+define DeclareRecipeForModuleMakefile
+  ifeq ($$($1_MULTIPLE_MAKEFILES), true)
+    $2-$$($1_TARGET_SUFFIX): $2-$$($1_TARGET_SUFFIX)-$$(notdir $3)
+    $1 += $2-$$($1_TARGET_SUFFIX)-$$(notdir $3)
+
+    $2-$$($1_TARGET_SUFFIX)-$$(notdir $3):
+  else
+    $2-$$($1_TARGET_SUFFIX):
+  endif
+	$(ECHO) $(LOG_INFO) "Building $$@"
+        ifeq ($$($1_USE_WRAPPER), true)
+	  +($(CD) $(SRC_ROOT)/make && $(MAKE) $(MAKE_ARGS) \
+	      -f ModuleWrapper.gmk \
+	          $$(addprefix -I, $$(wildcard $$(addprefix $3/, $(MAKE_MAKEDIR_LIST)) \
+	          $$(addsuffix /$$($1_MAKE_SUBDIR), $$(addprefix $3/, $(MAKE_MAKEDIR_LIST))))) \
+	          MODULE=$2 MAKEFILE_PREFIX=$$($1_FILE_PREFIX))
+        else
+	  +($(CD) $$(dir $$(firstword $$(wildcard $$(patsubst %, \
+	          $3/%/$$($1_MAKE_SUBDIR)/$$($1_FILE_PREFIX)-$2.gmk, $(MAKE_MAKEDIR_LIST))))) \
+	    && $(MAKE) $(MAKE_ARGS) \
+	          -f $$($1_FILE_PREFIX)-$2.gmk \
+	          $$(addprefix -I, $$(wildcard $$(addprefix $3/, $(MAKE_MAKEDIR_LIST)) \
+	          $$(addsuffix /$$($1_MAKE_SUBDIR), $$(addprefix $3/, $(MAKE_MAKEDIR_LIST))))) \
+	          MODULE=$2)
+        endif
+
+endef
+
+# Helper macro for DeclareRecipesForPhase
+# Param 1: Name of list to add targets to
+# Param 2: Module name
+define DeclareRecipesForPhaseAndModule
+  $1_$2_TOPDIRS := $$(strip $$(sort $$(foreach d, $(MAKE_TOPDIR_LIST), \
+      $$(patsubst $$d/%, $$d, $$(filter $$d/%, \
+          $$(wildcard $$(patsubst %, %/$$($1_MAKE_SUBDIR)/$$($1_FILE_PREFIX)-$2.gmk, \
+          $$(foreach s, $(MAKE_MAKEDIR_LIST), \
+              $$(addsuffix /$$s, $(MAKE_TOPDIR_LIST))))))))))
+
+  # Only declare recipes if there are makefiles to call
+  ifneq ($$($1_$2_TOPDIRS), )
+    ifeq ($(NO_RECIPES),)
+      $$(foreach d, $$($1_$2_TOPDIRS), \
+          $$(eval $$(call DeclareRecipeForModuleMakefile,$1,$2,$$d)))
+    endif
+    $1 += $2-$$($1_TARGET_SUFFIX)
+    $1_MODULES += $2
+  endif
+endef
+
+# Declare recipes for a specific module and build phase if there are makefiles
+# present for the specific combination.
+# Param 1: Name of list to add targets to
+# Named params:
+# TARGET_SUFFIX : Suffix of target to create for recipe
+# MAKE_SUBDIR : Subdir for this build phase
+# FILE_PREFIX : File prefix for this build phase
+# USE_WRAPPER : Set to true to use ModuleWrapper.gmk
+# CHECK_MODULES : List of modules to try
+# MULTIPLE_MAKEFILES : Set to true to handle makefils for the same module in
+#                      phase in multiple repos
+# Exported variables:
+# $1_MODULES : All modules that had rules generated
+# $1_TARGETS : All targets generated
+define DeclareRecipesForPhase
+  $(foreach i,2 3 4 5 6 7, $(if $($i),$(strip $1)_$(strip $($i)))$(NEWLINE))
+  $(if $(8),$(error Internal makefile error: Too many arguments to \
+      DeclareRecipesForPhase, please update MakeHelper.gmk))
+
+  $$(foreach m, $$($(strip $1)_CHECK_MODULES), \
+      $$(eval $$(call DeclareRecipesForPhaseAndModule,$(strip $1),$$m)))
+
+  $(strip $1)_TARGETS := $$($(strip $1))
+endef
+
+################################################################################
+
+endif # _MAINSUPPORT_GMK
diff --git a/make/MakeHelpers.gmk b/make/MakeHelpers.gmk
deleted file mode 100644
index 2de3b9c..0000000
--- a/make/MakeHelpers.gmk
+++ /dev/null
@@ -1,451 +0,0 @@
-#
-# Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# This code is free software; you can redistribute it and/or modify it
-# 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.
-#
-
-################################################################
-#
-# This file contains helper functions for the top-level Makefile that does
-# not depend on the spec.gmk file having been read. (The purpose of this
-# file is ju to avoid cluttering the top-level Makefile.)
-#
-################################################################
-
-ifndef _MAKEHELPERS_GMK
-_MAKEHELPERS_GMK := 1
-
-##############################
-# Stuff to run at include time
-##############################
-
-# Find out which variables were passed explicitely on the make command line. These
-# will be passed on to sub-makes, overriding spec.gmk settings.
-MAKE_ARGS=$(foreach var,$(subst =command,,$(filter %=command,$(foreach var,$(.VARIABLES),$(var)=$(firstword $(origin $(var)))))),$(var)="$($(var))")
-
-list_alt_overrides_with_origins=$(filter ALT_%=environment ALT_%=command,$(foreach var,$(.VARIABLES),$(var)=$(firstword $(origin $(var)))))
-list_alt_overrides=$(subst =command,,$(subst =environment,,$(list_alt_overrides_with_origins)))
-
-# Store the build times in this directory.
-BUILDTIMESDIR=$(OUTPUT_ROOT)/make-support/build-times
-
-# Global targets are possible to run either with or without a SPEC. The prototypical
-# global target is "help".
-global_targets=help
-
-##############################
-# Functions
-##############################
-
-define CheckEnvironment
-        # Find all environment or command line variables that begin with ALT.
-	$(if $(list_alt_overrides),
-	  @$(PRINTF) "\nWARNING: You have the following ALT_ variables set:\n"
-	  @$(PRINTF) "$(foreach var,$(list_alt_overrides),$(var)=$$$(var))\n"
-	  @$(PRINTF) "ALT_ variables are deprecated and will be ignored. Please clean your environment.\n\n"
-	)
-endef
-
-### Functions for timers
-
-# Record starting time for build of a sub repository.
-define RecordStartTime
-	$(MKDIR) -p $(BUILDTIMESDIR)
-	$(DATE) '+%Y %m %d %H %M %S' | $(NAWK) '{ print $$1,$$2,$$3,$$4,$$5,$$6,($$4*3600+$$5*60+$$6) }' > $(BUILDTIMESDIR)/build_time_start_$1
-	$(DATE) '+%Y-%m-%d %H:%M:%S' > $(BUILDTIMESDIR)/build_time_start_$1_human_readable
-endef
-
-# Record ending time and calculate the difference and store it in a
-# easy to read format. Handles builds that cross midnight. Expects
-# that a build will never take 24 hours or more.
-define RecordEndTime
-	$(DATE) '+%Y %m %d %H %M %S' | $(NAWK) '{ print $$1,$$2,$$3,$$4,$$5,$$6,($$4*3600+$$5*60+$$6) }' > $(BUILDTIMESDIR)/build_time_end_$1
-	$(DATE) '+%Y-%m-%d %H:%M:%S' > $(BUILDTIMESDIR)/build_time_end_$1_human_readable
-	$(ECHO) `$(CAT) $(BUILDTIMESDIR)/build_time_start_$1` `$(CAT) $(BUILDTIMESDIR)/build_time_end_$1` $1 | \
-	    $(NAWK) '{ F=$$7; T=$$14; if (F > T) { T+=3600*24 }; D=T-F; H=int(D/3600); \
-	    M=int((D-H*3600)/60); S=D-H*3600-M*60; printf("%02d:%02d:%02d %s\n",H,M,S,$$15); }' \
-	    > $(BUILDTIMESDIR)/build_time_diff_$1
-endef
-
-# Find all build_time_* files and print their contents in a list sorted
-# on the name of the sub repository.
-define ReportBuildTimes
-	$(BUILD_LOG_WRAPPER) $(PRINTF) -- "----- Build times -------\nStart %s\nEnd   %s\n%s\n%s\n-------------------------\n" \
-	    "`$(CAT) $(BUILDTIMESDIR)/build_time_start_TOTAL_human_readable`" \
-	    "`$(CAT) $(BUILDTIMESDIR)/build_time_end_TOTAL_human_readable`" \
-	    "`$(LS) $(BUILDTIMESDIR)/build_time_diff_* | $(GREP) -v _TOTAL | $(XARGS) $(CAT) | $(SORT) -k 2`" \
-	    "`$(CAT) $(BUILDTIMESDIR)/build_time_diff_TOTAL`"
-endef
-
-define ResetAllTimers
-  $$(shell $(MKDIR) -p $(BUILDTIMESDIR) && $(RM) $(BUILDTIMESDIR)/build_time_*)
-endef
-
-define StartGlobalTimer
-	$(call RecordStartTime,TOTAL)
-endef
-
-define StopGlobalTimer
-	$(call RecordEndTime,TOTAL)
-endef
-
-### Functions for managing makefile structure (start/end of makefile and individual targets)
-
-# Do not indent this function, this will add whitespace at the start which the caller won't handle
-define GetRealTarget
-$(strip $(if $(findstring main-wrapper, $(MAKECMDGOALS)), $(MAIN_TARGETS), \
-    $(if $(MAKECMDGOALS),$(MAKECMDGOALS),default)))
-endef
-
-# Do not indent this function, this will add whitespace at the start which the caller won't handle
-define LastGoal
-$(strip $(lastword $(call GetRealTarget)))
-endef
-
-# Check if the current target is the final target, as specified by
-# the user on the command line. If so, call AtRootMakeEnd.
-define CheckIfMakeAtEnd
-        # Check if the current target is the last goal
-	$(if $(filter $@,$(call LastGoal)),$(call AtMakeEnd))
-        # If the target is 'foo-only', check if our goal was stated as 'foo'
-	$(if $(filter $@,$(call LastGoal)-only),$(call AtMakeEnd))
-endef
-
-# Hook to be called when starting to execute a top-level target
-define TargetEnter
-	$(PRINTF) "## Starting $(patsubst %-only,%,$@)\n"
-	$(call RecordStartTime,$(patsubst %-only,%,$@))
-endef
-
-# Hook to be called when finish executing a top-level target
-define TargetExit
-	$(call RecordEndTime,$(patsubst %-only,%,$@))
-	$(PRINTF) "## Finished $(patsubst %-only,%,$@) (build time %s)\n\n" \
-	    "`$(CAT) $(BUILDTIMESDIR)/build_time_diff_$(patsubst %-only,%,$@) | $(CUT) -f 1 -d ' '`"
-endef
-
-# Hook to be called as the very first thing when running a normal build
-define AtMakeStart
-	$(if $(findstring --jobserver,$(MAKEFLAGS)),$(error make -j is not supported, use make JOBS=n))
-	$(call CheckEnvironment)
-	$(BUILD_LOG_WRAPPER) $(PRINTF) $(LOG_INFO) "Running make as '$(MAKE) $(MFLAGS) $(MAKE_ARGS)'\n"
-	$(BUILD_LOG_WRAPPER) $(PRINTF) "Building $(PRODUCT_NAME) for target '$(call GetRealTarget)' in configuration '$(CONF_NAME)'\n\n"
-	$(call StartGlobalTimer)
-endef
-
-# Hook to be called as the very last thing for targets that are "top level" targets
-define AtMakeEnd
-	[ -f $(SJAVAC_SERVER_DIR)/server.port ] && echo Stopping sjavac server && $(TOUCH) $(SJAVAC_SERVER_DIR)/server.port.stop; true
-	$(call StopGlobalTimer)
-	$(call ReportBuildTimes)
-	@$(PRINTF) "\nFinished building $(PRODUCT_NAME) for target '$(call GetRealTarget)'\n"
-	$(call CheckEnvironment)
-endef
-
-### Functions for parsing and setting up make options from command-line
-
-define FatalError
-  # If the user specificed a "global" target (e.g. 'help'), do not exit but continue running
-  $$(if $$(filter-out $(global_targets),$$(call GetRealTarget)),$$(error Cannot continue))
-endef
-
-define ParseLogLevel
-  ifeq ($$(origin VERBOSE),undefined)
-    # Setup logging according to LOG (but only if VERBOSE is not given)
-
-    # If the "nofile" argument is given, act on it and strip it away
-    ifneq ($$(findstring nofile,$$(LOG)),)
-      # Reset the build log wrapper, regardless of other values
-      override BUILD_LOG_WRAPPER=
-      # COMMA is defined in spec.gmk, but that is not included yet
-      COMMA=,
-      # First try to remove ",nofile" if it exists
-      LOG_STRIPPED1=$$(subst $$(COMMA)nofile,,$$(LOG))
-      # Otherwise just remove "nofile"
-      LOG_STRIPPED2=$$(subst nofile,,$$(LOG_STRIPPED1))
-      # We might have ended up with a leading comma. Remove it
-      LOG_STRIPPED3=$$(strip $$(patsubst $$(COMMA)%,%,$$(LOG_STRIPPED2)))
-      LOG_LEVEL:=$$(LOG_STRIPPED3)
-    else
-      LOG_LEVEL:=$$(LOG)
-    endif
-
-    ifeq ($$(LOG_LEVEL),)
-      # Set LOG to "warn" as default if not set (and no VERBOSE given)
-      override LOG_LEVEL=warn
-    endif
-    ifeq ($$(LOG_LEVEL),warn)
-      VERBOSE=-s
-    else ifeq ($$(LOG_LEVEL),info)
-      VERBOSE=-s
-    else ifeq ($$(LOG_LEVEL),debug)
-      VERBOSE=
-    else ifeq ($$(LOG_LEVEL),trace)
-      VERBOSE=
-    else
-      $$(info Error: LOG must be one of: warn, info, debug or trace.)
-      $$(eval $$(call FatalError))
-    endif
-  else
-    # Provide resonable interpretations of LOG_LEVEL if VERBOSE is given.
-    ifeq ($(VERBOSE),)
-      LOG_LEVEL:=debug
-    else
-      LOG_LEVEL:=warn
-    endif
-    ifneq ($$(LOG),)
-      # We have both a VERBOSE and a LOG argument. This is OK only if this is a repeated call by ourselves,
-      # but complain if this is the top-level make call.
-      ifeq ($$(MAKELEVEL),0)
-        $$(info Cannot use LOG=$$(LOG) and VERBOSE=$$(VERBOSE) at the same time. Choose one.)
-        $$(eval $$(call FatalError))
-      endif
-    endif
-  endif
-endef
-
-define ParseConfAndSpec
-  ifneq ($$(filter-out $(global_targets),$$(call GetRealTarget)),)
-    # If we only have global targets, no need to bother with SPEC or CONF
-    ifneq ($$(origin SPEC),undefined)
-      # We have been given a SPEC, check that it works out properly
-      ifneq ($$(origin CONF),undefined)
-        # We also have a CONF argument. This is OK only if this is a repeated call by ourselves,
-        # but complain if this is the top-level make call.
-        ifeq ($$(MAKELEVEL),0)
-          $$(info Error: Cannot use CONF=$$(CONF) and SPEC=$$(SPEC) at the same time. Choose one.)
-          $$(eval $$(call FatalError))
-        endif
-      endif
-      ifeq ($$(wildcard $$(SPEC)),)
-        $$(info Error: Cannot locate spec.gmk, given by SPEC=$$(SPEC).)
-        $$(eval $$(call FatalError))
-      endif
-      # ... OK, we're satisfied, we'll use this SPEC later on
-    else
-      # Find all spec.gmk files in the build output directory
-      output_dir=$$(root_dir)/build
-      all_spec_files=$$(wildcard $$(output_dir)/*/spec.gmk)
-      ifeq ($$(all_spec_files),)
-        $$(info Error: No configurations found for $$(root_dir).)
-        $$(info Please run 'bash configure' to create a configuration.)
-        $$(eval $$(call FatalError))
-      endif
-      # Extract the configuration names from the path
-      all_confs=$$(patsubst %/spec.gmk,%,$$(patsubst $$(output_dir)/%,%,$$(all_spec_files)))
-
-      ifneq ($$(origin CONF),undefined)
-        # User have given a CONF= argument.
-        ifeq ($$(CONF),)
-          # If given CONF=, match all configurations
-          matching_confs=$$(strip $$(all_confs))
-        else
-          # Otherwise select those that contain the given CONF string
-          matching_confs=$$(strip $$(foreach var,$$(all_confs),$$(if $$(findstring $$(CONF),$$(var)),$$(var))))
-        endif
-        ifeq ($$(matching_confs),)
-          $$(info Error: No configurations found matching CONF=$$(CONF).)
-          $$(info Available configurations in $$(output_dir):)
-          $$(foreach var,$$(all_confs),$$(info * $$(var)))
-          $$(eval $$(call FatalError))
-        else
-          ifeq ($$(words $$(matching_confs)),1)
-            $$(info Building '$$(matching_confs)' (matching CONF=$$(CONF)))
-          else
-            $$(info Building target '$(call GetRealTarget)' in these configurations (matching CONF=$$(CONF)):)
-            $$(foreach var,$$(matching_confs),$$(info * $$(var)))
-          endif
-        endif
-
-        # Create a SPEC definition. This will contain the path to one or more spec.gmk files.
-        SPEC=$$(addsuffix /spec.gmk,$$(addprefix $$(output_dir)/,$$(matching_confs)))
-      else
-        # No CONF or SPEC given, check the available configurations
-        ifneq ($$(words $$(all_spec_files)),1)
-          $$(info Error: No CONF given, but more than one configuration found.)
-          $$(info Available configurations in $$(output_dir):)
-          $$(foreach var,$$(all_confs),$$(info * $$(var)))
-          $$(info Please retry building with CONF=<config pattern> (or SPEC=<specfile>).)
-          $$(eval $$(call FatalError))
-        endif
-
-        # We found exactly one configuration, use it
-        SPEC=$$(strip $$(all_spec_files))
-      endif
-    endif
-  endif
-endef
-
-### Convenience functions from Main.gmk
-
-# Run the tests specified by $1.
-define RunTests
-	($(CD) $(SRC_ROOT)/test && $(MAKE) $(MAKE_ARGS) -j1 -k MAKEFLAGS= \
-	    JT_HOME=$(JT_HOME) PRODUCT_HOME=$(JDK_IMAGE_DIR) \
-	    TEST_IMAGE_DIR=$(TEST_IMAGE_DIR) \
-	    ALT_OUTPUTDIR=$(OUTPUT_ROOT) CONCURRENCY=$(JOBS) $1) || true
-endef
-
-# Cleans the dir given as $1
-define CleanDir
-	@$(PRINTF) "Cleaning $(strip $1) build artifacts ..."
-	@($(CD) $(OUTPUT_ROOT) && $(RM) -r $1)
-	@$(PRINTF) " done\n"
-endef
-
-define CleanTest
-	@$(PRINTF) "Cleaning test $(strip $1) ..."
-	@$(RM) -r $(SUPPORT_OUTPUTDIR)/test/$(strip $(subst -,/,$1))
-	@$(PRINTF) " done\n"
-endef
-
-define Clean-gensrc
-	@$(PRINTF) "Cleaning gensrc $(if $1,for $(strip $1) )..."
-	@$(RM) -r $(SUPPORT_OUTPUTDIR)/gensrc/$(strip $1)
-	@$(RM) -r $(SUPPORT_OUTPUTDIR)/gensrc_no_docs/$(strip $1)
-	@$(PRINTF) " done\n"
-endef
-
-define Clean-java
-	@$(PRINTF) "Cleaning java $(if $1,for $(strip $1) )..."
-	@$(RM) -r $(JDK_OUTPUTDIR)/modules/$(strip $1)
-	@$(RM) -r $(SUPPORT_OUTPUTDIR)/misc/$(strip $1)
-	@$(PRINTF) " done\n"
-	@$(PRINTF) "Cleaning headers $(if $1,for $(strip $1)) ..."
-	@$(RM) -r $(SUPPORT_OUTPUTDIR)/headers/$(strip $1)
-	@$(PRINTF) " done\n"
-endef
-
-define Clean-native
-	@$(PRINTF) "Cleaning native $(if $1,for $(strip $1) )..."
-	@$(RM) -r $(SUPPORT_OUTPUTDIR)/native/$(strip $1)
-	@$(RM) -r $(SUPPORT_OUTPUTDIR)/modules_libs/$(strip $1)
-	@$(RM) -r $(SUPPORT_OUTPUTDIR)/modules_libs-stripped/$(strip $1)
-	@$(RM) -r $(SUPPORT_OUTPUTDIR)/modules_cmds/$(strip $1)
-	@$(RM) -r $(SUPPORT_OUTPUTDIR)/modules_cmds-stripped/$(strip $1)
-	@$(PRINTF) " done\n"
-endef
-
-define Clean-include
-	@$(PRINTF) "Cleaning include $(if $1,for $(strip $1) )..."
-	@$(RM) -r $(SUPPORT_OUTPUTDIR)/modules_include/$(strip $1)
-	@$(PRINTF) " done\n"
-endef
-
-define CleanModule
-  $(call Clean-gensrc, $1)
-  $(call Clean-java, $1)
-  $(call Clean-native, $1)
-  $(call Clean-include, $1)
-endef
-
-
-################################################################################
-
-MAKE_TOPDIR_LIST := $(JDK_TOPDIR) $(CORBA_TOPDIR) $(LANGTOOLS_TOPDIR)
-MAKE_MAKEDIR_LIST := make
-
-# Helper macro for DeclareRecipesForPhase
-# Declare a recipe for calling the module and phase specific makefile.
-# If there are multiple makefiles to call, create a rule for each topdir
-# that contains a makefile with the target $module-$suffix-$repodir,
-# (i.e: java.base-gensrc-jdk)
-# Normally there is only one makefile, and the target will just be
-# $module-$suffix
-# Param 1: Name of list to add targets to
-# Param 2: Module name
-# Param 3: Topdir
-define DeclareRecipeForModuleMakefile
-  ifeq ($$($1_MULTIPLE_MAKEFILES), true)
-    $2-$$($1_TARGET_SUFFIX): $2-$$($1_TARGET_SUFFIX)-$$(notdir $3)
-    $1 += $2-$$($1_TARGET_SUFFIX)-$$(notdir $3)
-
-    $2-$$($1_TARGET_SUFFIX)-$$(notdir $3):
-  else
-    $2-$$($1_TARGET_SUFFIX):
-  endif
-	$(ECHO) $(LOG_INFO) "Building $$@"
-        ifeq ($$($1_USE_WRAPPER), true)
-	  +($(CD) $(SRC_ROOT)/make && $(MAKE) $(MAKE_ARGS) \
-	      -f ModuleWrapper.gmk \
-	          $$(addprefix -I, $$(wildcard $$(addprefix $3/, $(MAKE_MAKEDIR_LIST)) \
-	          $$(addsuffix /$$($1_MAKE_SUBDIR), $$(addprefix $3/, $(MAKE_MAKEDIR_LIST))))) \
-	          MODULE=$2 MAKEFILE_PREFIX=$$($1_FILE_PREFIX))
-        else
-	  +($(CD) $$(dir $$(firstword $$(wildcard $$(patsubst %, \
-	          $3/%/$$($1_MAKE_SUBDIR)/$$($1_FILE_PREFIX)-$2.gmk, $(MAKE_MAKEDIR_LIST))))) \
-	    && $(MAKE) $(MAKE_ARGS) \
-	          -f $$($1_FILE_PREFIX)-$2.gmk \
-	          $$(addprefix -I, $$(wildcard $$(addprefix $3/, $(MAKE_MAKEDIR_LIST)) \
-	          $$(addsuffix /$$($1_MAKE_SUBDIR), $$(addprefix $3/, $(MAKE_MAKEDIR_LIST))))) \
-	          MODULE=$2)
-        endif
-
-endef
-
-# Helper macro for DeclareRecipesForPhase
-# Param 1: Name of list to add targets to
-# Param 2: Module name
-define DeclareRecipesForPhaseAndModule
-  $1_$2_TOPDIRS := $$(strip $$(sort $$(foreach d, $(MAKE_TOPDIR_LIST), \
-      $$(patsubst $$d/%, $$d, $$(filter $$d/%, \
-          $$(wildcard $$(patsubst %, %/$$($1_MAKE_SUBDIR)/$$($1_FILE_PREFIX)-$2.gmk, \
-          $$(foreach s, $(MAKE_MAKEDIR_LIST), \
-              $$(addsuffix /$$s, $(MAKE_TOPDIR_LIST))))))))))
-
-  # Only declare recipes if there are makefiles to call
-  ifneq ($$($1_$2_TOPDIRS), )
-    $$(foreach d, $$($1_$2_TOPDIRS), \
-        $$(eval $$(call DeclareRecipeForModuleMakefile,$1,$2,$$d)))
-    $1 += $2-$$($1_TARGET_SUFFIX)
-    $1_MODULES += $2
-  endif
-endef
-
-# Declare recipes for a specific module and build phase if there are makefiles
-# present for the specific combination.
-# Param 1: Name of list to add targets to
-# Named params:
-# TARGET_SUFFIX : Suffix of target to create for recipe
-# MAKE_SUBDIR : Subdir for this build phase
-# FILE_PREFIX : File prefix for this build phase
-# USE_WRAPPER : Set to true to use ModuleWrapper.gmk
-# CHECK_MODULES : List of modules to try
-# MULTIPLE_MAKEFILES : Set to true to handle makefils for the same module in
-#                      phase in multiple repos
-# Exported variables:
-# $1_MODULES : All modules that had rules generated
-# $1_TARGETS : All targets generated
-define DeclareRecipesForPhase
-  $(foreach i,2 3 4 5 6 7, $(if $($i),$(strip $1)_$(strip $($i)))$(NEWLINE))
-  $(if $(8),$(error Internal makefile error: Too many arguments to \
-      DeclareRecipesForPhase, please update MakeHelper.gmk))
-
-  $$(foreach m, $$($(strip $1)_CHECK_MODULES), \
-      $$(eval $$(call DeclareRecipesForPhaseAndModule,$(strip $1),$$m)))
-
-  $(strip $1)_TARGETS := $$($(strip $1))
-endef
-
-################################################################################
-
-endif # _MAKEHELPERS_GMK
diff --git a/make/common/MakeBase.gmk b/make/common/MakeBase.gmk
index 8e789a8..b144dd7 100644
--- a/make/common/MakeBase.gmk
+++ b/make/common/MakeBase.gmk
@@ -32,6 +32,53 @@
 ifndef _MAKEBASE_GMK
 _MAKEBASE_GMK := 1
 
+ifeq ($(wildcard $(SPEC)),)
+  $(error MakeBase.gmk needs SPEC set to a proper spec.gmk)
+endif
+
+
+##############################
+# Functions
+##############################
+
+
+### Functions for timers
+
+# Store the build times in this directory.
+BUILDTIMESDIR=$(OUTPUT_ROOT)/make-support/build-times
+
+# Record starting time for build of a sub repository.
+define RecordStartTime
+	$(MKDIR) -p $(BUILDTIMESDIR)
+	$(DATE) '+%Y %m %d %H %M %S' | $(NAWK) '{ print $$1,$$2,$$3,$$4,$$5,$$6,($$4*3600+$$5*60+$$6) }' > $(BUILDTIMESDIR)/build_time_start_$(strip $1)
+	$(DATE) '+%Y-%m-%d %H:%M:%S' > $(BUILDTIMESDIR)/build_time_start_$(strip $1)_human_readable
+endef
+
+# Record ending time and calculate the difference and store it in a
+# easy to read format. Handles builds that cross midnight. Expects
+# that a build will never take 24 hours or more.
+define RecordEndTime
+	$(DATE) '+%Y %m %d %H %M %S' | $(NAWK) '{ print $$1,$$2,$$3,$$4,$$5,$$6,($$4*3600+$$5*60+$$6) }' > $(BUILDTIMESDIR)/build_time_end_$(strip $1)
+	$(DATE) '+%Y-%m-%d %H:%M:%S' > $(BUILDTIMESDIR)/build_time_end_$(strip $1)_human_readable
+	$(ECHO) `$(CAT) $(BUILDTIMESDIR)/build_time_start_$(strip $1)` `$(CAT) $(BUILDTIMESDIR)/build_time_end_$(strip $1)` $1 | \
+	    $(NAWK) '{ F=$$7; T=$$14; if (F > T) { T+=3600*24 }; D=T-F; H=int(D/3600); \
+	    M=int((D-H*3600)/60); S=D-H*3600-M*60; printf("%02d:%02d:%02d %s\n",H,M,S,$$15); }' \
+	    > $(BUILDTIMESDIR)/build_time_diff_$(strip $1)
+endef
+
+# Hook to be called when starting to execute a top-level target
+define TargetEnter
+	$(PRINTF) "## Starting $(patsubst %-only,%,$@)\n"
+	$(call RecordStartTime,$(patsubst %-only,%,$@))
+endef
+
+# Hook to be called when finish executing a top-level target
+define TargetExit
+	$(call RecordEndTime,$(patsubst %-only,%,$@))
+	$(PRINTF) "## Finished $(patsubst %-only,%,$@) (build time %s)\n\n" \
+	    "`$(CAT) $(BUILDTIMESDIR)/build_time_diff_$(patsubst %-only,%,$@) | $(CUT) -f 1 -d ' '`"
+endef
+
 ################################################################################
 # This macro translates $ into \$ to protect the $ from expansion in the shell.
 # To make this macro resilient against already escaped strings, first remove
@@ -341,7 +388,7 @@
 endef
 
 define SetupLogging
-  ifeq ($$(LOG_LEVEL),trace)
+  ifeq ($$(LOG_LEVEL), trace)
     # Shell redefinition trick inspired by http://www.cmcrossroads.com/ask-mr-make/6535-tracing-rule-execution-in-gnu-make
     # For each target executed, will print
     # Building <TARGET> (from <FIRST PREREQUISITE>) (<ALL NEWER PREREQUISITES> newer)
@@ -349,25 +396,25 @@
     # (and causing a crash on Cygwin).
     # Default shell seems to always be /bin/sh. Must override with bash to get this to work on Solaris.
     # Only use time if it's GNU time which supports format and output file.
-    WRAPPER_SHELL:=$$(BASH) $$(SRC_ROOT)/common/bin/shell-tracer.sh $$(if $$(findstring yes,$$(IS_GNU_TIME)),$$(TIME),-) $$(OUTPUT_ROOT)/build-trace-time.log $$(SHELL)
-    SHELL=$$(warning $$(if $$@,Building $$@,Running shell command) $$(if $$<, (from $$<))$$(if $$?, ($$(wordlist 1, 20, $$?) $$(if $$(wordlist 21, 22, $$?), ... [in total $$(words $$?) files]) newer)))$$(WRAPPER_SHELL)
+    WRAPPER_SHELL := $$(BASH) $$(SRC_ROOT)/common/bin/shell-tracer.sh $$(if $$(findstring yes,$$(IS_GNU_TIME)),$$(TIME),-) $$(OUTPUT_ROOT)/build-trace-time.log $$(SHELL)
+    SHELL := $$(warning $$(if $$@,Building $$@,Running shell command) $$(if $$<, (from $$<))$$(if $$?, ($$(wordlist 1, 20, $$?) $$(if $$(wordlist 21, 22, $$?), ... [in total $$(words $$?) files]) newer)))$$(WRAPPER_SHELL)
   endif
   # Never remove warning messages; this is just for completeness
-  LOG_WARN=
-  ifneq ($$(findstring $$(LOG_LEVEL),info debug trace),)
-    LOG_INFO=
+  LOG_WARN :=
+  ifneq ($$(findstring $$(LOG_LEVEL), info debug trace),)
+    LOG_INFO :=
   else
-    LOG_INFO=> /dev/null
+    LOG_INFO := > /dev/null
   endif
-  ifneq ($$(findstring $$(LOG_LEVEL),debug trace),)
-    LOG_DEBUG=
+  ifneq ($$(findstring $$(LOG_LEVEL), debug trace),)
+    LOG_DEBUG :=
   else
-    LOG_DEBUG=> /dev/null
+    LOG_DEBUG := > /dev/null
   endif
-  ifneq ($$(findstring $$(LOG_LEVEL),trace),)
-    LOG_TRACE=
+  ifneq ($$(findstring $$(LOG_LEVEL), trace),)
+    LOG_TRACE :=
   else
-    LOG_TRACE=> /dev/null
+    LOG_TRACE := > /dev/null
   endif
 endef
 
diff --git a/nashorn/.hgtags b/nashorn/.hgtags
index 1fc98ef..9785b65 100644
--- a/nashorn/.hgtags
+++ b/nashorn/.hgtags
@@ -291,3 +291,4 @@
 b2b332e64b7b2e06e25bccae9c0c0b585a03b4b5 jdk9-b55
 2e640036000dfadcadaf6638b5fd61db9c71a25c jdk9-b56
 3bcfcb13c23402cf435079766eb2f9a3c4f890e8 jdk9-b57
+5096a7cca5f0fda814832ac777966bea893f837e jdk9-b58
diff --git a/nashorn/make/Makefile b/nashorn/make/Makefile
deleted file mode 100644
index 4570070..0000000
--- a/nashorn/make/Makefile
+++ /dev/null
@@ -1,49 +0,0 @@
-#
-# Copyright (c) 2012, 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.
-#
-
-# Locate this Makefile
-ifeq ($(filter /%, $(lastword $(MAKEFILE_LIST))), )
-  makefile_path := $(CURDIR)/$(lastword $(MAKEFILE_LIST))
-else
-  makefile_path := $(lastword $(MAKEFILE_LIST))
-endif
-repo_dir := $(patsubst %/make/Makefile, %, $(makefile_path))
-
-# What is the name of this subsystem (langtools, corba, etc)?
-subsystem_name := $(notdir $(repo_dir))
-
-# Try to locate top-level makefile
-top_level_makefile := $(repo_dir)/../Makefile
-ifneq ($(wildcard $(top_level_makefile)), )
-  $(info Will run $(subsystem_name) target on top-level Makefile)
-  $(info WARNING: This is a non-recommended way of building!)
-  $(info ===================================================)
-else
-  $(info Cannot locate top-level Makefile. Is this repo not checked out as part of a complete forest?)
-  $(error Build from top-level Makefile instead)
-endif
-
-all:
-	@$(MAKE) -f $(top_level_makefile) $(subsystem_name)
diff --git a/nashorn/make/build.xml b/nashorn/make/build.xml
index bd85a06..bd87590 100644
--- a/nashorn/make/build.xml
+++ b/nashorn/make/build.xml
@@ -281,12 +281,12 @@
        <fileset dir="${test.src.dir}/META-INF/services/"/>
     </copy>
 
-    <copy todir="${build.test.classes.dir}/jdk/nashorn/internal/runtime/resources">
-       <fileset dir="${test.src.dir}/jdk/nashorn/internal/runtime/resources"/>
+    <copy todir="${build.test.classes.dir}/jdk/nashorn/internal/runtime/test/resources">
+       <fileset dir="${test.src.dir}/jdk/nashorn/internal/runtime/test/resources"/>
     </copy>
 
-    <copy todir="${build.test.classes.dir}/jdk/nashorn/api/scripting/resources">
-       <fileset dir="${test.src.dir}/jdk/nashorn/api/scripting/resources"/>
+    <copy todir="${build.test.classes.dir}/jdk/nashorn/api/scripting/test/resources">
+       <fileset dir="${test.src.dir}/jdk/nashorn/api/scripting/test/resources"/>
     </copy>
 
     <!-- tests that check nashorn internals and internal API -->
diff --git a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/objects/Global.java b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/objects/Global.java
index 76a787f..e6eba09 100644
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/objects/Global.java
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/objects/Global.java
@@ -60,6 +60,7 @@
 import jdk.nashorn.internal.objects.annotations.Setter;
 import jdk.nashorn.internal.runtime.Context;
 import jdk.nashorn.internal.runtime.ECMAErrors;
+import jdk.nashorn.internal.runtime.FindProperty;
 import jdk.nashorn.internal.runtime.GlobalConstants;
 import jdk.nashorn.internal.runtime.GlobalFunctions;
 import jdk.nashorn.internal.runtime.JSType;
@@ -2204,6 +2205,17 @@
     }
 
     @Override
+    protected FindProperty findProperty(final String key, final boolean deep, final ScriptObject start) {
+        if (lexicalScope != null && start != this && start.isScope()) {
+            final FindProperty find = lexicalScope.findProperty(key, false);
+            if (find != null) {
+                return find;
+            }
+        }
+        return super.findProperty(key, deep, start);
+    }
+
+    @Override
     public GuardedInvocation findSetMethod(final CallSiteDescriptor desc, final LinkRequest request) {
         final boolean isScope = NashornCallSiteDescriptor.isScope(desc);
 
diff --git a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/objects/NativeFloat32Array.java b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/objects/NativeFloat32Array.java
index ef7a1ff..b75d506 100644
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/objects/NativeFloat32Array.java
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/objects/NativeFloat32Array.java
@@ -114,12 +114,11 @@
 
         private void setElem(final int index, final double elem) {
             try {
-                nb.put(index, (float)elem);
-            } catch (final IndexOutOfBoundsException e) {
-                //swallow valid array indexes. it's ok.
-                if (index < 0) {
-                    throw new ClassCastException();
+                if (index < nb.limit()) {
+                    nb.put(index, (float) elem);
                 }
+            } catch (final IndexOutOfBoundsException e) {
+                throw new ClassCastException();
             }
         }
 
diff --git a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/objects/NativeFloat64Array.java b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/objects/NativeFloat64Array.java
index d0413d0..9a2e319 100644
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/objects/NativeFloat64Array.java
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/objects/NativeFloat64Array.java
@@ -114,12 +114,11 @@
 
         private void setElem(final int index, final double elem) {
             try {
-                nb.put(index, elem);
-            } catch (final IndexOutOfBoundsException e) {
-                //swallow valid array indexes. it's ok.
-                if (index < 0) {
-                    throw new ClassCastException();
+                if (index < nb.limit()) {
+                    nb.put(index, elem);
                 }
+            } catch (final IndexOutOfBoundsException e) {
+                throw new ClassCastException();
              }
         }
 
diff --git a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/objects/NativeInt16Array.java b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/objects/NativeInt16Array.java
index e4cdce5..c2eb555 100644
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/objects/NativeInt16Array.java
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/objects/NativeInt16Array.java
@@ -115,12 +115,11 @@
 
         private void setElem(final int index, final int elem) {
             try {
-                nb.put(index, (short)elem);
-            } catch (final IndexOutOfBoundsException e) {
-                //swallow valid array indexes. it's ok.
-                if (index < 0) {
-                    throw new ClassCastException();
+                if (index < nb.limit()) {
+                    nb.put(index, (short) elem);
                 }
+            } catch (final IndexOutOfBoundsException e) {
+                throw new ClassCastException();
             }
         }
 
diff --git a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/objects/NativeInt32Array.java b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/objects/NativeInt32Array.java
index 9e664ed..a266fc5 100644
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/objects/NativeInt32Array.java
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/objects/NativeInt32Array.java
@@ -104,11 +104,11 @@
 
         private void setElem(final int index, final int elem) {
             try {
-                nb.put(index, elem);
-               } catch (final IndexOutOfBoundsException e) {
-                   if (index < 0) {
-                      throw new ClassCastException();
-                 }
+                if (index < nb.limit()) {
+                    nb.put(index, elem);
+                }
+            } catch (final IndexOutOfBoundsException e) {
+                throw new ClassCastException();
             }
         }
 
diff --git a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/objects/NativeInt8Array.java b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/objects/NativeInt8Array.java
index c336d27..be9bacf 100644
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/objects/NativeInt8Array.java
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/objects/NativeInt8Array.java
@@ -113,12 +113,11 @@
 
         private void setElem(final int index, final int elem) {
             try {
-                nb.put(index, (byte)elem);
-            } catch (final IndexOutOfBoundsException e) {
-                //swallow valid array indexes. it's ok.
-                if (index < 0) {
-                    throw new ClassCastException();
+                if (index < nb.limit()) {
+                    nb.put(index, (byte) elem);
                 }
+            } catch (final IndexOutOfBoundsException e) {
+                throw new ClassCastException();
             }
         }
 
diff --git a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/objects/NativeUint16Array.java b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/objects/NativeUint16Array.java
index 2fc2c51..30dc681 100644
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/objects/NativeUint16Array.java
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/objects/NativeUint16Array.java
@@ -104,12 +104,11 @@
 
         private void setElem(final int index, final int elem) {
             try {
-                nb.put(index, (char)elem);
-            } catch (final IndexOutOfBoundsException e) {
-                //swallow valid array indexes. it's ok.
-                if (index < 0) {
-                    throw new ClassCastException();
+                if (index < nb.limit()) {
+                    nb.put(index, (char) elem);
                 }
+            } catch (final IndexOutOfBoundsException e) {
+                throw new ClassCastException();
             }
         }
 
diff --git a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/objects/NativeUint32Array.java b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/objects/NativeUint32Array.java
index 4c83cc0..8503517 100644
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/objects/NativeUint32Array.java
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/objects/NativeUint32Array.java
@@ -113,12 +113,11 @@
 
         private void setElem(final int index, final int elem) {
             try {
-                nb.put(index, elem);
-            } catch (final IndexOutOfBoundsException e) {
-                //swallow valid array indexes. it's ok.
-                if (index < 0) {
-                    throw new ClassCastException();
+                if (index < nb.limit()) {
+                    nb.put(index, elem);
                 }
+            } catch (final IndexOutOfBoundsException e) {
+                throw new ClassCastException();
             }
         }
 
diff --git a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/objects/NativeUint8Array.java b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/objects/NativeUint8Array.java
index 6e69eba..f5ccce6 100644
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/objects/NativeUint8Array.java
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/objects/NativeUint8Array.java
@@ -104,12 +104,11 @@
 
         private void setElem(final int index, final int elem) {
             try {
-                nb.put(index, (byte)elem);
-            } catch (final IndexOutOfBoundsException e) {
-                //swallow valid array indexes. it's ok.
-                if (index < 0) {
-                    throw new ClassCastException();
+                if (index < nb.limit()) {
+                    nb.put(index, (byte) elem);
                 }
+            } catch (final IndexOutOfBoundsException e) {
+                throw new ClassCastException();
             }
         }
 
diff --git a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/objects/NativeUint8ClampedArray.java b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/objects/NativeUint8ClampedArray.java
index 2dff261..28d72d1 100644
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/objects/NativeUint8ClampedArray.java
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/objects/NativeUint8ClampedArray.java
@@ -133,18 +133,17 @@
 
         private void setElem(final int index, final int elem) {
             try {
-                final byte clamped;
-                if ((elem & 0xffff_ff00) == 0) {
-                    clamped = (byte)elem;
-                } else {
-                    clamped = elem < 0 ? 0 : (byte)0xff;
+                if (index < nb.limit()) {
+                    final byte clamped;
+                    if ((elem & 0xffff_ff00) == 0) {
+                        clamped = (byte) elem;
+                    } else {
+                        clamped = elem < 0 ? 0 : (byte) 0xff;
+                    }
+                    nb.put(index, clamped);
                 }
-                nb.put(index, clamped);
             } catch (final IndexOutOfBoundsException e) {
-                //swallow valid array indexes. it's ok.
-                if (index < 0) {
-                    throw new ClassCastException();
-                }
+                throw new ClassCastException();
             }
         }
 
diff --git a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/ScriptObject.java b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/ScriptObject.java
index 358cc05..284505a 100644
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/ScriptObject.java
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/ScriptObject.java
@@ -812,7 +812,7 @@
      *
      * @return FindPropertyData or null if not found.
      */
-    FindProperty findProperty(final String key, final boolean deep, final ScriptObject start) {
+    protected FindProperty findProperty(final String key, final boolean deep, final ScriptObject start) {
 
         final PropertyMap selfMap  = getMap();
         final Property    property = selfMap.findProperty(key);
diff --git a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/WithObject.java b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/WithObject.java
index 20510df..a717a21 100644
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/WithObject.java
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/WithObject.java
@@ -198,7 +198,7 @@
      * @return FindPropertyData or null if not found.
      */
     @Override
-    FindProperty findProperty(final String key, final boolean deep, final ScriptObject start) {
+    protected FindProperty findProperty(final String key, final boolean deep, final ScriptObject start) {
         // We call findProperty on 'expression' with 'expression' itself as start parameter.
         // This way in ScriptObject.setObject we can tell the property is from a 'with' expression
         // (as opposed from another non-scope object in the proto chain such as Object.prototype).
diff --git a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/regexp/joni/ArrayCompiler.java b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/regexp/joni/ArrayCompiler.java
index 0e78933..b343d77 100644
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/regexp/joni/ArrayCompiler.java
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/regexp/joni/ArrayCompiler.java
@@ -145,9 +145,6 @@
             case TargetInfo.IS_EMPTY_MEM:
                 addOpcode(OPCode.NULL_CHECK_END_MEMST);
                 break;
-            case TargetInfo.IS_EMPTY_REC:
-                addOpcode(OPCode.NULL_CHECK_END_MEMST_PUSH);
-                break;
             default:
                 break;
             } // switch
diff --git a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/regexp/joni/ByteCodeMachine.java b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/regexp/joni/ByteCodeMachine.java
index 30cfe90..dbed5d1 100644
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/regexp/joni/ByteCodeMachine.java
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/regexp/joni/ByteCodeMachine.java
@@ -183,7 +183,6 @@
                 case OPCode.NULL_CHECK_START:           opNullCheckStart();        continue;
                 case OPCode.NULL_CHECK_END:             opNullCheckEnd();          continue;
                 case OPCode.NULL_CHECK_END_MEMST:       opNullCheckEndMemST();     continue;
-                case OPCode.NULL_CHECK_END_MEMST_PUSH:  opNullCheckEndMemSTPush(); continue;
 
                 case OPCode.JUMP:                       opJump();                  continue;
                 case OPCode.PUSH:                       opPush();                  continue;
@@ -1025,29 +1024,6 @@
         }
     }
 
-    // USE_SUBEXP_CALL
-    private void opNullCheckEndMemSTPush() {
-        final int mem = code[ip++];   /* mem: null check id */
-
-        int isNull;
-        if (Config.USE_MONOMANIAC_CHECK_CAPTURES_IN_ENDLESS_REPEAT) {
-            isNull = nullCheckMemStRec(mem, s);
-        } else {
-            isNull = nullCheckRec(mem, s);
-        }
-
-        if (isNull != 0) {
-            if (Config.DEBUG_MATCH) {
-                Config.log.println("NULL_CHECK_END_MEMST_PUSH: skip  id:" + mem + ", s:" + s);
-            }
-
-            if (isNull == -1) {opFail(); return;}
-            nullCheckFound();
-        } else {
-            pushNullCheckEnd(mem);
-        }
-    }
-
     private void opJump() {
         ip += code[ip] + 1;
     }
diff --git a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/regexp/joni/StackMachine.java b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/regexp/joni/StackMachine.java
index fc498c4..4cc33ba 100644
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/regexp/joni/StackMachine.java
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/regexp/joni/StackMachine.java
@@ -19,7 +19,6 @@
  */
 package jdk.nashorn.internal.runtime.regexp.joni;
 
-import static jdk.nashorn.internal.runtime.regexp.joni.BitStatus.bsAt;
 import java.lang.ref.WeakReference;
 import jdk.nashorn.internal.runtime.regexp.joni.constants.StackPopLevel;
 import jdk.nashorn.internal.runtime.regexp.joni.constants.StackType;
@@ -369,118 +368,9 @@
         }
     }
 
-    protected final int nullCheckRec(final int id, final int s) {
-        int level = 0;
-        int k = stk;
-        while (true) {
-            k--;
-            final StackEntry e = stack[k];
-
-            if (e.type == NULL_CHECK_START) {
-                if (e.getNullCheckNum() == id) {
-                    if (level == 0) {
-                        return e.getNullCheckPStr() == s ? 1 : 0;
-                    }
-                    level--;
-                }
-            } else if (e.type == NULL_CHECK_END) {
-                level++;
-            }
-        }
-    }
-
     protected final int nullCheckMemSt(final int id, final int s) {
-        int k = stk;
-        int isNull;
-        while (true) {
-            k--;
-            StackEntry e = stack[k];
-
-            if (e.type == NULL_CHECK_START) {
-                if (e.getNullCheckNum() == id) {
-                    if (e.getNullCheckPStr() != s) {
-                        isNull = 0;
-                        break;
-                    }
-                    int endp;
-                    isNull = 1;
-                    while (k < stk) {
-                        if (e.type == MEM_START) {
-                            if (e.getMemEnd() == INVALID_INDEX) {
-                                isNull = 0;
-                                break;
-                            }
-                            if (bsAt(regex.btMemEnd, e.getMemNum())) {
-                                endp = stack[e.getMemEnd()].getMemPStr();
-                            } else {
-                                endp = e.getMemEnd();
-                            }
-                            if (stack[e.getMemStart()].getMemPStr() != endp) {
-                                isNull = 0;
-                                break;
-                            } else if (endp != s) {
-                                isNull = -1; /* empty, but position changed */
-                            }
-                        }
-                        k++;
-                        e = stack[k]; // !!
-                    }
-                    break;
-                }
-            }
-        }
-        return isNull;
-    }
-
-    protected final int nullCheckMemStRec(final int id, final int s) {
-        int level = 0;
-        int k = stk;
-        int isNull;
-        while (true) {
-            k--;
-            StackEntry e = stack[k];
-
-            if (e.type == NULL_CHECK_START) {
-                if (e.getNullCheckNum() == id) {
-                    if (level == 0) {
-                        if (e.getNullCheckPStr() != s) {
-                            isNull = 0;
-                            break;
-                        }
-                        int endp;
-                        isNull = 1;
-                        while (k < stk) {
-                            if (e.type == MEM_START) {
-                                if (e.getMemEnd() == INVALID_INDEX) {
-                                    isNull = 0;
-                                    break;
-                                }
-                                if (bsAt(regex.btMemEnd, e.getMemNum())) {
-                                    endp = stack[e.getMemEnd()].getMemPStr();
-                                } else {
-                                    endp = e.getMemEnd();
-                                }
-                                if (stack[e.getMemStart()].getMemPStr() != endp) {
-                                    isNull = 0;
-                                    break;
-                                } else if (endp != s) {
-                                    isNull = -1; /* empty, but position changed */
-                                }
-                            }
-                            k++;
-                            e = stack[k];
-                        }
-                        break;
-                    }
-                    level--;
-                }
-            } else if (e.type == NULL_CHECK_END) {
-                if (e.getNullCheckNum() == id) {
-                    level++;
-                }
-            }
-        }
-        return isNull;
+        // Return -1 here to cause operation to fail
+        return -nullCheck(id, s);
     }
 
     protected final int getRepeat(final int id) {
diff --git a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/regexp/joni/constants/TargetInfo.java b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/regexp/joni/constants/TargetInfo.java
index 8dfb92b..5708a39 100644
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/regexp/joni/constants/TargetInfo.java
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/regexp/joni/constants/TargetInfo.java
@@ -24,5 +24,4 @@
     final int ISNOT_EMPTY   = 0;
     final int IS_EMPTY      = 1;
     final int IS_EMPTY_MEM  = 2;
-    final int IS_EMPTY_REC  = 3;
 }
diff --git a/nashorn/test/script/basic/JDK-8073868.js b/nashorn/test/script/basic/JDK-8073868.js
new file mode 100644
index 0000000..f35fb16
--- /dev/null
+++ b/nashorn/test/script/basic/JDK-8073868.js
@@ -0,0 +1,45 @@
+/*
+ * 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.
+ */
+
+/**
+ * JDK-8073868: Regex matching causes java.lang.ArrayIndexOutOfBoundsException: 64
+ *
+ * @test
+ * @run
+ */
+
+function test(input) {
+    var comma = input.indexOf(",");
+    Assert.assertEquals(/([^\s]+),(.*)+/.exec(input)[0], input.trimLeft());
+    Assert.assertEquals(/([^\s]+),(.*)+/.exec(input)[1], input.substring(0, comma).trimLeft());
+    Assert.assertEquals(/([^\s]+),(.*)+/.exec(input)[2], input.substring(comma + 1));
+    Assert.assertEquals(/(.*)+/.exec(input)[0], input);
+    Assert.assertEquals(/(.*)+/.exec(input)[1], input);
+}
+
+test(" xxxx,         xxx xxxxxx xxxxxxxxx xxxxxxx, xxxx xxxxx xxxxx ");
+test(" xxxx, xxx xxxxxx xxxxxxxxx xxxxxxx, xxxx xxxxx xxxxx ");
+test("x,         xxxxxxxxxx xxxxxxxxx xxxxxxx, xxxx xxxxx xxxxx ");
+
+Assert.assertEquals(/(?:\1a|())*/.exec("a")[0], "a");
+Assert.assertEquals(/(?:\1a|())*/.exec("a")[1], undefined);
diff --git a/nashorn/test/script/basic/es6/let-eval.js b/nashorn/test/script/basic/es6/let-eval.js
index b08fa98..d1855dc 100644
--- a/nashorn/test/script/basic/es6/let-eval.js
+++ b/nashorn/test/script/basic/es6/let-eval.js
@@ -96,3 +96,9 @@
 f();
 
 print(typeof a, typeof b, typeof c, typeof x, typeof z);
+
+let v = 1;
+eval("print('v: ' + v); v = 2; print ('v: ' + v);");
+print("this.v: " + this.v);
+print("v: " + v);
+
diff --git a/nashorn/test/script/basic/es6/let-eval.js.EXPECTED b/nashorn/test/script/basic/es6/let-eval.js.EXPECTED
index 96f9a6d..d6ccc59 100644
--- a/nashorn/test/script/basic/es6/let-eval.js.EXPECTED
+++ b/nashorn/test/script/basic/es6/let-eval.js.EXPECTED
@@ -14,3 +14,7 @@
 2 1 0
 2 1 0 undefined
 undefined undefined undefined undefined undefined
+v: 1
+v: 2
+this.v: undefined
+v: 2
diff --git a/nashorn/test/script/sandbox/interfaceimpl.js b/nashorn/test/script/sandbox/interfaceimpl.js
index 0745318..17745fc 100644
--- a/nashorn/test/script/sandbox/interfaceimpl.js
+++ b/nashorn/test/script/sandbox/interfaceimpl.js
@@ -29,8 +29,8 @@
  * @security
  */
 
-var Window = Java.type("jdk.nashorn.api.scripting.Window");
-var WindowEventHandler = Java.type("jdk.nashorn.api.scripting.WindowEventHandler");
+var Window = Java.type("jdk.nashorn.api.scripting.test.Window");
+var WindowEventHandler = Java.type("jdk.nashorn.api.scripting.test.WindowEventHandler");
 
 var w = new Window();
 
diff --git a/nashorn/test/script/trusted/JDK-8025629.js b/nashorn/test/script/trusted/JDK-8025629.js
index 609cfe8..f3f4cba 100644
--- a/nashorn/test/script/trusted/JDK-8025629.js
+++ b/nashorn/test/script/trusted/JDK-8025629.js
@@ -28,6 +28,6 @@
  * @run
  */
 
-load("classpath:jdk/nashorn/internal/runtime/resources/load_test.js")
+load("classpath:jdk/nashorn/internal/runtime/test/resources/load_test.js")
 
 Assert.assertEquals(loadedFunc("hello"), "HELLO");
diff --git a/nashorn/test/src/META-INF/services/java.sql.Driver b/nashorn/test/src/META-INF/services/java.sql.Driver
index 295fe48..d1bb7d3 100644
--- a/nashorn/test/src/META-INF/services/java.sql.Driver
+++ b/nashorn/test/src/META-INF/services/java.sql.Driver
@@ -1 +1 @@
-jdk.nashorn.api.NashornSQLDriver
+jdk.nashorn.api.test.NashornSQLDriver
diff --git a/nashorn/test/src/jdk/internal/dynalink/beans/CallerSensitiveTest.java b/nashorn/test/src/jdk/internal/dynalink/beans/test/CallerSensitiveTest.java
similarity index 94%
rename from nashorn/test/src/jdk/internal/dynalink/beans/CallerSensitiveTest.java
rename to nashorn/test/src/jdk/internal/dynalink/beans/test/CallerSensitiveTest.java
index d9a4455..2a6b746 100644
--- a/nashorn/test/src/jdk/internal/dynalink/beans/CallerSensitiveTest.java
+++ b/nashorn/test/src/jdk/internal/dynalink/beans/test/CallerSensitiveTest.java
@@ -23,8 +23,9 @@
  * questions.
  */
 
-package jdk.internal.dynalink.beans;
+package jdk.internal.dynalink.beans.test;
 
+import jdk.internal.dynalink.beans.BeansLinker;
 import jdk.nashorn.test.models.ClassLoaderAware;
 import org.testng.annotations.Test;
 
diff --git a/nashorn/test/src/jdk/nashorn/api/javaaccess/ArrayConversionTest.java b/nashorn/test/src/jdk/nashorn/api/javaaccess/test/ArrayConversionTest.java
similarity index 99%
rename from nashorn/test/src/jdk/nashorn/api/javaaccess/ArrayConversionTest.java
rename to nashorn/test/src/jdk/nashorn/api/javaaccess/test/ArrayConversionTest.java
index 1da767b..a7a17a2 100644
--- a/nashorn/test/src/jdk/nashorn/api/javaaccess/ArrayConversionTest.java
+++ b/nashorn/test/src/jdk/nashorn/api/javaaccess/test/ArrayConversionTest.java
@@ -23,7 +23,7 @@
  * questions.
  */
 
-package jdk.nashorn.api.javaaccess;
+package jdk.nashorn.api.javaaccess.test;
 
 import static org.testng.AssertJUnit.assertEquals;
 import static org.testng.AssertJUnit.assertFalse;
diff --git a/nashorn/test/src/jdk/nashorn/api/javaaccess/BooleanAccessTest.java b/nashorn/test/src/jdk/nashorn/api/javaaccess/test/BooleanAccessTest.java
similarity index 99%
rename from nashorn/test/src/jdk/nashorn/api/javaaccess/BooleanAccessTest.java
rename to nashorn/test/src/jdk/nashorn/api/javaaccess/test/BooleanAccessTest.java
index 234484f..f460927 100644
--- a/nashorn/test/src/jdk/nashorn/api/javaaccess/BooleanAccessTest.java
+++ b/nashorn/test/src/jdk/nashorn/api/javaaccess/test/BooleanAccessTest.java
@@ -23,7 +23,7 @@
  * questions.
  */
 
-package jdk.nashorn.api.javaaccess;
+package jdk.nashorn.api.javaaccess.test;
 
 import static org.testng.AssertJUnit.assertEquals;
 import static org.testng.AssertJUnit.assertTrue;
diff --git a/nashorn/test/src/jdk/nashorn/api/javaaccess/ConsStringTest.java b/nashorn/test/src/jdk/nashorn/api/javaaccess/test/ConsStringTest.java
similarity index 98%
rename from nashorn/test/src/jdk/nashorn/api/javaaccess/ConsStringTest.java
rename to nashorn/test/src/jdk/nashorn/api/javaaccess/test/ConsStringTest.java
index 2b12b04..db8794b 100644
--- a/nashorn/test/src/jdk/nashorn/api/javaaccess/ConsStringTest.java
+++ b/nashorn/test/src/jdk/nashorn/api/javaaccess/test/ConsStringTest.java
@@ -23,7 +23,7 @@
  * questions.
  */
 
-package jdk.nashorn.api.javaaccess;
+package jdk.nashorn.api.javaaccess.test;
 
 import static org.testng.AssertJUnit.assertEquals;
 import java.util.HashMap;
diff --git a/nashorn/test/src/jdk/nashorn/api/javaaccess/MethodAccessTest.java b/nashorn/test/src/jdk/nashorn/api/javaaccess/test/MethodAccessTest.java
similarity index 99%
rename from nashorn/test/src/jdk/nashorn/api/javaaccess/MethodAccessTest.java
rename to nashorn/test/src/jdk/nashorn/api/javaaccess/test/MethodAccessTest.java
index 8bac7e6..91487a8 100644
--- a/nashorn/test/src/jdk/nashorn/api/javaaccess/MethodAccessTest.java
+++ b/nashorn/test/src/jdk/nashorn/api/javaaccess/test/MethodAccessTest.java
@@ -23,7 +23,7 @@
  * questions.
  */
 
-package jdk.nashorn.api.javaaccess;
+package jdk.nashorn.api.javaaccess.test;
 
 import static org.testng.AssertJUnit.assertEquals;
 import static org.testng.AssertJUnit.assertTrue;
diff --git a/nashorn/test/src/jdk/nashorn/api/javaaccess/NumberAccessTest.java b/nashorn/test/src/jdk/nashorn/api/javaaccess/test/NumberAccessTest.java
similarity index 99%
rename from nashorn/test/src/jdk/nashorn/api/javaaccess/NumberAccessTest.java
rename to nashorn/test/src/jdk/nashorn/api/javaaccess/test/NumberAccessTest.java
index fd4ab9d..ffe7db3 100644
--- a/nashorn/test/src/jdk/nashorn/api/javaaccess/NumberAccessTest.java
+++ b/nashorn/test/src/jdk/nashorn/api/javaaccess/test/NumberAccessTest.java
@@ -23,7 +23,7 @@
  * questions.
  */
 
-package jdk.nashorn.api.javaaccess;
+package jdk.nashorn.api.javaaccess.test;
 
 import static org.testng.AssertJUnit.assertEquals;
 import static org.testng.AssertJUnit.assertTrue;
diff --git a/nashorn/test/src/jdk/nashorn/api/javaaccess/NumberBoxingTest.java b/nashorn/test/src/jdk/nashorn/api/javaaccess/test/NumberBoxingTest.java
similarity index 99%
rename from nashorn/test/src/jdk/nashorn/api/javaaccess/NumberBoxingTest.java
rename to nashorn/test/src/jdk/nashorn/api/javaaccess/test/NumberBoxingTest.java
index 40db684..fb9aa6a 100644
--- a/nashorn/test/src/jdk/nashorn/api/javaaccess/NumberBoxingTest.java
+++ b/nashorn/test/src/jdk/nashorn/api/javaaccess/test/NumberBoxingTest.java
@@ -23,7 +23,7 @@
  * questions.
  */
 
-package jdk.nashorn.api.javaaccess;
+package jdk.nashorn.api.javaaccess.test;
 
 import static org.testng.AssertJUnit.assertEquals;
 import static org.testng.AssertJUnit.assertTrue;
diff --git a/nashorn/test/src/jdk/nashorn/api/javaaccess/ObjectAccessTest.java b/nashorn/test/src/jdk/nashorn/api/javaaccess/test/ObjectAccessTest.java
similarity index 99%
rename from nashorn/test/src/jdk/nashorn/api/javaaccess/ObjectAccessTest.java
rename to nashorn/test/src/jdk/nashorn/api/javaaccess/test/ObjectAccessTest.java
index 00798a4..fdecf25 100644
--- a/nashorn/test/src/jdk/nashorn/api/javaaccess/ObjectAccessTest.java
+++ b/nashorn/test/src/jdk/nashorn/api/javaaccess/test/ObjectAccessTest.java
@@ -23,7 +23,7 @@
  * questions.
  */
 
-package jdk.nashorn.api.javaaccess;
+package jdk.nashorn.api.javaaccess.test;
 
 import static org.testng.AssertJUnit.assertEquals;
 import static org.testng.internal.junit.ArrayAsserts.assertArrayEquals;
diff --git a/nashorn/test/src/jdk/nashorn/api/javaaccess/Person.java b/nashorn/test/src/jdk/nashorn/api/javaaccess/test/Person.java
similarity index 97%
rename from nashorn/test/src/jdk/nashorn/api/javaaccess/Person.java
rename to nashorn/test/src/jdk/nashorn/api/javaaccess/test/Person.java
index 32b1c9b..3e563b1 100644
--- a/nashorn/test/src/jdk/nashorn/api/javaaccess/Person.java
+++ b/nashorn/test/src/jdk/nashorn/api/javaaccess/test/Person.java
@@ -23,7 +23,7 @@
  * questions.
  */
 
-package jdk.nashorn.api.javaaccess;
+package jdk.nashorn.api.javaaccess.test;
 
 @SuppressWarnings("javadoc")
 public class Person {
diff --git a/nashorn/test/src/jdk/nashorn/api/javaaccess/SharedObject.java b/nashorn/test/src/jdk/nashorn/api/javaaccess/test/SharedObject.java
similarity index 99%
rename from nashorn/test/src/jdk/nashorn/api/javaaccess/SharedObject.java
rename to nashorn/test/src/jdk/nashorn/api/javaaccess/test/SharedObject.java
index 93c93e1..3c41ac1 100644
--- a/nashorn/test/src/jdk/nashorn/api/javaaccess/SharedObject.java
+++ b/nashorn/test/src/jdk/nashorn/api/javaaccess/test/SharedObject.java
@@ -23,7 +23,7 @@
  * questions.
  */
 
-package jdk.nashorn.api.javaaccess;
+package jdk.nashorn.api.javaaccess.test;
 
 import javax.script.Invocable;
 import javax.script.ScriptEngine;
diff --git a/nashorn/test/src/jdk/nashorn/api/javaaccess/StringAccessTest.java b/nashorn/test/src/jdk/nashorn/api/javaaccess/test/StringAccessTest.java
similarity index 99%
rename from nashorn/test/src/jdk/nashorn/api/javaaccess/StringAccessTest.java
rename to nashorn/test/src/jdk/nashorn/api/javaaccess/test/StringAccessTest.java
index 1e0a96a..8ec43e6 100644
--- a/nashorn/test/src/jdk/nashorn/api/javaaccess/StringAccessTest.java
+++ b/nashorn/test/src/jdk/nashorn/api/javaaccess/test/StringAccessTest.java
@@ -23,7 +23,7 @@
  * questions.
  */
 
-package jdk.nashorn.api.javaaccess;
+package jdk.nashorn.api.javaaccess.test;
 
 import static org.testng.AssertJUnit.assertEquals;
 import static org.testng.internal.junit.ArrayAsserts.assertArrayEquals;
diff --git a/nashorn/test/src/jdk/nashorn/api/scripting/InvocableTest.java b/nashorn/test/src/jdk/nashorn/api/scripting/test/InvocableTest.java
similarity index 99%
rename from nashorn/test/src/jdk/nashorn/api/scripting/InvocableTest.java
rename to nashorn/test/src/jdk/nashorn/api/scripting/test/InvocableTest.java
index 4e44a29..bba4ce5 100644
--- a/nashorn/test/src/jdk/nashorn/api/scripting/InvocableTest.java
+++ b/nashorn/test/src/jdk/nashorn/api/scripting/test/InvocableTest.java
@@ -23,7 +23,7 @@
  * questions.
  */
 
-package jdk.nashorn.api.scripting;
+package jdk.nashorn.api.scripting.test;
 
 import static org.testng.Assert.assertEquals;
 import static org.testng.Assert.fail;
diff --git a/nashorn/test/src/jdk/nashorn/api/scripting/MultipleEngineTest.java b/nashorn/test/src/jdk/nashorn/api/scripting/test/MultipleEngineTest.java
similarity index 97%
rename from nashorn/test/src/jdk/nashorn/api/scripting/MultipleEngineTest.java
rename to nashorn/test/src/jdk/nashorn/api/scripting/test/MultipleEngineTest.java
index 218deff..1dd6908 100644
--- a/nashorn/test/src/jdk/nashorn/api/scripting/MultipleEngineTest.java
+++ b/nashorn/test/src/jdk/nashorn/api/scripting/test/MultipleEngineTest.java
@@ -23,7 +23,7 @@
  * questions.
  */
 
-package jdk.nashorn.api.scripting;
+package jdk.nashorn.api.scripting.test;
 
 import javax.script.ScriptEngine;
 import javax.script.ScriptEngineManager;
diff --git a/nashorn/test/src/jdk/nashorn/api/scripting/PluggableJSObjectTest.java b/nashorn/test/src/jdk/nashorn/api/scripting/test/PluggableJSObjectTest.java
similarity index 98%
rename from nashorn/test/src/jdk/nashorn/api/scripting/PluggableJSObjectTest.java
rename to nashorn/test/src/jdk/nashorn/api/scripting/test/PluggableJSObjectTest.java
index d6b9dcd..0d9dc4d 100644
--- a/nashorn/test/src/jdk/nashorn/api/scripting/PluggableJSObjectTest.java
+++ b/nashorn/test/src/jdk/nashorn/api/scripting/test/PluggableJSObjectTest.java
@@ -23,7 +23,7 @@
  * questions.
  */
 
-package jdk.nashorn.api.scripting;
+package jdk.nashorn.api.scripting.test;
 
 import static org.testng.Assert.assertEquals;
 import static org.testng.Assert.assertFalse;
@@ -36,6 +36,7 @@
 import java.util.Set;
 import javax.script.ScriptEngine;
 import javax.script.ScriptEngineManager;
+import jdk.nashorn.api.scripting.AbstractJSObject;
 import org.testng.annotations.Test;
 
 /**
diff --git a/nashorn/test/src/jdk/nashorn/api/scripting/ScopeTest.java b/nashorn/test/src/jdk/nashorn/api/scripting/test/ScopeTest.java
similarity index 99%
rename from nashorn/test/src/jdk/nashorn/api/scripting/ScopeTest.java
rename to nashorn/test/src/jdk/nashorn/api/scripting/test/ScopeTest.java
index f3e613b..6bc0c3b 100644
--- a/nashorn/test/src/jdk/nashorn/api/scripting/ScopeTest.java
+++ b/nashorn/test/src/jdk/nashorn/api/scripting/test/ScopeTest.java
@@ -22,7 +22,7 @@
  * or visit www.oracle.com if you need additional information or have any
  * questions.
  */
-package jdk.nashorn.api.scripting;
+package jdk.nashorn.api.scripting.test;
 
 import static org.testng.Assert.assertEquals;
 import static org.testng.Assert.assertNotNull;
@@ -35,6 +35,8 @@
 import javax.script.ScriptException;
 import javax.script.SimpleBindings;
 import javax.script.SimpleScriptContext;
+import jdk.nashorn.api.scripting.ScriptObjectMirror;
+import jdk.nashorn.api.scripting.URLReader;
 import org.testng.Assert;
 import org.testng.annotations.Test;
 
diff --git a/nashorn/test/src/jdk/nashorn/api/scripting/ScriptEngineSecurityTest.java b/nashorn/test/src/jdk/nashorn/api/scripting/test/ScriptEngineSecurityTest.java
similarity index 98%
rename from nashorn/test/src/jdk/nashorn/api/scripting/ScriptEngineSecurityTest.java
rename to nashorn/test/src/jdk/nashorn/api/scripting/test/ScriptEngineSecurityTest.java
index 06b89e8..dfebd44 100644
--- a/nashorn/test/src/jdk/nashorn/api/scripting/ScriptEngineSecurityTest.java
+++ b/nashorn/test/src/jdk/nashorn/api/scripting/test/ScriptEngineSecurityTest.java
@@ -23,7 +23,7 @@
  * questions.
  */
 
-package jdk.nashorn.api.scripting;
+package jdk.nashorn.api.scripting.test;
 
 import static org.testng.Assert.fail;
 import java.lang.reflect.InvocationHandler;
@@ -32,6 +32,8 @@
 import javax.script.ScriptEngine;
 import javax.script.ScriptEngineManager;
 import javax.script.ScriptException;
+import jdk.nashorn.api.scripting.ClassFilter;
+import jdk.nashorn.api.scripting.NashornScriptEngineFactory;
 import org.testng.annotations.Test;
 
 /**
diff --git a/nashorn/test/src/jdk/nashorn/api/scripting/ScriptEngineTest.java b/nashorn/test/src/jdk/nashorn/api/scripting/test/ScriptEngineTest.java
similarity index 99%
rename from nashorn/test/src/jdk/nashorn/api/scripting/ScriptEngineTest.java
rename to nashorn/test/src/jdk/nashorn/api/scripting/test/ScriptEngineTest.java
index 1c412c6..258c6bc 100644
--- a/nashorn/test/src/jdk/nashorn/api/scripting/ScriptEngineTest.java
+++ b/nashorn/test/src/jdk/nashorn/api/scripting/test/ScriptEngineTest.java
@@ -23,7 +23,7 @@
  * questions.
  */
 
-package jdk.nashorn.api.scripting;
+package jdk.nashorn.api.scripting.test;
 
 import static org.testng.Assert.assertEquals;
 import static org.testng.Assert.assertNotNull;
@@ -51,6 +51,7 @@
 import javax.script.ScriptEngineManager;
 import javax.script.ScriptException;
 import javax.script.SimpleScriptContext;
+import jdk.nashorn.api.scripting.ScriptObjectMirror;
 import org.testng.annotations.Test;
 
 /**
@@ -541,7 +542,7 @@
         final ScriptEngineManager m = new ScriptEngineManager();
         final ScriptEngine e = m.getEngineByName("nashorn");
         e.eval("obj = { foo: 'hello' }");
-        e.put("Window", e.eval("Packages.jdk.nashorn.api.scripting.Window"));
+        e.put("Window", e.eval("Packages.jdk.nashorn.api.scripting.test.Window"));
         assertEquals(e.eval("Window.funcJSObject(obj)"), "hello");
         assertEquals(e.eval("Window.funcScriptObjectMirror(obj)"), "hello");
         assertEquals(e.eval("Window.funcMap(obj)"), "hello");
diff --git a/nashorn/test/src/jdk/nashorn/api/scripting/ScriptObjectMirrorTest.java b/nashorn/test/src/jdk/nashorn/api/scripting/test/ScriptObjectMirrorTest.java
similarity index 98%
rename from nashorn/test/src/jdk/nashorn/api/scripting/ScriptObjectMirrorTest.java
rename to nashorn/test/src/jdk/nashorn/api/scripting/test/ScriptObjectMirrorTest.java
index ce3b421..f9c78fc 100644
--- a/nashorn/test/src/jdk/nashorn/api/scripting/ScriptObjectMirrorTest.java
+++ b/nashorn/test/src/jdk/nashorn/api/scripting/test/ScriptObjectMirrorTest.java
@@ -23,7 +23,7 @@
  * questions.
  */
 
-package jdk.nashorn.api.scripting;
+package jdk.nashorn.api.scripting.test;
 
 import static org.testng.Assert.assertEquals;
 import static org.testng.Assert.assertFalse;
@@ -41,6 +41,8 @@
 import javax.script.ScriptEngine;
 import javax.script.ScriptEngineManager;
 import javax.script.ScriptException;
+import jdk.nashorn.api.scripting.JSObject;
+import jdk.nashorn.api.scripting.ScriptObjectMirror;
 import org.testng.annotations.Test;
 
 /**
diff --git a/nashorn/test/src/jdk/nashorn/api/scripting/VariableArityTestInterface.java b/nashorn/test/src/jdk/nashorn/api/scripting/test/VariableArityTestInterface.java
similarity index 96%
rename from nashorn/test/src/jdk/nashorn/api/scripting/VariableArityTestInterface.java
rename to nashorn/test/src/jdk/nashorn/api/scripting/test/VariableArityTestInterface.java
index 8ce5e49..7761a3d 100644
--- a/nashorn/test/src/jdk/nashorn/api/scripting/VariableArityTestInterface.java
+++ b/nashorn/test/src/jdk/nashorn/api/scripting/test/VariableArityTestInterface.java
@@ -23,7 +23,7 @@
  * questions.
  */
 
-package jdk.nashorn.api.scripting;
+package jdk.nashorn.api.scripting.test;
 
 @SuppressWarnings("javadoc")
 public interface VariableArityTestInterface {
diff --git a/nashorn/test/src/jdk/nashorn/api/scripting/Window.java b/nashorn/test/src/jdk/nashorn/api/scripting/test/Window.java
similarity index 94%
rename from nashorn/test/src/jdk/nashorn/api/scripting/Window.java
rename to nashorn/test/src/jdk/nashorn/api/scripting/test/Window.java
index 7a7476f..6c60b16 100644
--- a/nashorn/test/src/jdk/nashorn/api/scripting/Window.java
+++ b/nashorn/test/src/jdk/nashorn/api/scripting/test/Window.java
@@ -23,10 +23,12 @@
  * questions.
  */
 
-package jdk.nashorn.api.scripting;
+package jdk.nashorn.api.scripting.test;
 
 import java.util.Map;
 import javax.script.Bindings;
+import jdk.nashorn.api.scripting.JSObject;
+import jdk.nashorn.api.scripting.ScriptObjectMirror;
 
 @SuppressWarnings("javadoc")
 public class Window {
diff --git a/nashorn/test/src/jdk/nashorn/api/scripting/WindowEventHandler.java b/nashorn/test/src/jdk/nashorn/api/scripting/test/WindowEventHandler.java
similarity index 96%
rename from nashorn/test/src/jdk/nashorn/api/scripting/WindowEventHandler.java
rename to nashorn/test/src/jdk/nashorn/api/scripting/test/WindowEventHandler.java
index dfcad5a..ddc879c 100644
--- a/nashorn/test/src/jdk/nashorn/api/scripting/WindowEventHandler.java
+++ b/nashorn/test/src/jdk/nashorn/api/scripting/test/WindowEventHandler.java
@@ -23,7 +23,7 @@
  * questions.
  */
 
-package jdk.nashorn.api.scripting;
+package jdk.nashorn.api.scripting.test;
 
 @SuppressWarnings("javadoc")
 public interface WindowEventHandler {
diff --git a/nashorn/test/src/jdk/nashorn/api/scripting/resources/func.js b/nashorn/test/src/jdk/nashorn/api/scripting/test/resources/func.js
similarity index 100%
rename from nashorn/test/src/jdk/nashorn/api/scripting/resources/func.js
rename to nashorn/test/src/jdk/nashorn/api/scripting/test/resources/func.js
diff --git a/nashorn/test/src/jdk/nashorn/api/scripting/resources/gettersetter.js b/nashorn/test/src/jdk/nashorn/api/scripting/test/resources/gettersetter.js
similarity index 100%
rename from nashorn/test/src/jdk/nashorn/api/scripting/resources/gettersetter.js
rename to nashorn/test/src/jdk/nashorn/api/scripting/test/resources/gettersetter.js
diff --git a/nashorn/test/src/jdk/nashorn/api/scripting/resources/witheval.js b/nashorn/test/src/jdk/nashorn/api/scripting/test/resources/witheval.js
similarity index 100%
rename from nashorn/test/src/jdk/nashorn/api/scripting/resources/witheval.js
rename to nashorn/test/src/jdk/nashorn/api/scripting/test/resources/witheval.js
diff --git a/nashorn/test/src/jdk/nashorn/api/NashornSQLDriver.java b/nashorn/test/src/jdk/nashorn/api/test/NashornSQLDriver.java
similarity index 98%
rename from nashorn/test/src/jdk/nashorn/api/NashornSQLDriver.java
rename to nashorn/test/src/jdk/nashorn/api/test/NashornSQLDriver.java
index dd62409..d1a5377 100644
--- a/nashorn/test/src/jdk/nashorn/api/NashornSQLDriver.java
+++ b/nashorn/test/src/jdk/nashorn/api/test/NashornSQLDriver.java
@@ -23,7 +23,7 @@
  * questions.
  */
 
-package jdk.nashorn.api;
+package jdk.nashorn.api.test;
 
 import java.sql.Connection;
 import java.sql.Driver;
diff --git a/nashorn/test/src/jdk/nashorn/api/tree/ParseAPITest.java b/nashorn/test/src/jdk/nashorn/api/tree/test/ParseAPITest.java
similarity index 97%
rename from nashorn/test/src/jdk/nashorn/api/tree/ParseAPITest.java
rename to nashorn/test/src/jdk/nashorn/api/tree/test/ParseAPITest.java
index e1985129..00504d9 100644
--- a/nashorn/test/src/jdk/nashorn/api/tree/ParseAPITest.java
+++ b/nashorn/test/src/jdk/nashorn/api/tree/test/ParseAPITest.java
@@ -22,13 +22,16 @@
  * or visit www.oracle.com if you need additional information or have any
  * questions.
  */
-package jdk.nashorn.api.tree;
+package jdk.nashorn.api.tree.test;
 
 import java.io.File;
 import java.io.IOException;
 import java.nio.charset.Charset;
 import java.nio.charset.StandardCharsets;
 import java.nio.file.Files;
+import jdk.nashorn.api.tree.Parser;
+import jdk.nashorn.api.tree.SimpleTreeVisitorES5_1;
+import jdk.nashorn.api.tree.Tree;
 import org.testng.Assert;
 import org.testng.annotations.Test;
 
diff --git a/nashorn/test/src/jdk/nashorn/internal/codegen/CompilerTest.java b/nashorn/test/src/jdk/nashorn/internal/codegen/test/CompilerTest.java
similarity index 99%
rename from nashorn/test/src/jdk/nashorn/internal/codegen/CompilerTest.java
rename to nashorn/test/src/jdk/nashorn/internal/codegen/test/CompilerTest.java
index 0c67af8..a6e86fe 100644
--- a/nashorn/test/src/jdk/nashorn/internal/codegen/CompilerTest.java
+++ b/nashorn/test/src/jdk/nashorn/internal/codegen/test/CompilerTest.java
@@ -23,7 +23,7 @@
  * questions.
  */
 
-package jdk.nashorn.internal.codegen;
+package jdk.nashorn.internal.codegen.test;
 
 import static jdk.nashorn.internal.runtime.Source.readFully;
 import static jdk.nashorn.internal.runtime.Source.sourceFor;
diff --git a/nashorn/test/src/jdk/nashorn/internal/parser/ParserTest.java b/nashorn/test/src/jdk/nashorn/internal/parser/test/ParserTest.java
similarity index 98%
rename from nashorn/test/src/jdk/nashorn/internal/parser/ParserTest.java
rename to nashorn/test/src/jdk/nashorn/internal/parser/test/ParserTest.java
index 24d507a..17259cc 100644
--- a/nashorn/test/src/jdk/nashorn/internal/parser/ParserTest.java
+++ b/nashorn/test/src/jdk/nashorn/internal/parser/test/ParserTest.java
@@ -23,11 +23,12 @@
  * questions.
  */
 
-package jdk.nashorn.internal.parser;
+package jdk.nashorn.internal.parser.test;
 
 import static jdk.nashorn.internal.runtime.Source.readFully;
 import static jdk.nashorn.internal.runtime.Source.sourceFor;
 import java.io.File;
+import jdk.nashorn.internal.parser.Parser;
 import jdk.nashorn.internal.runtime.Context;
 import jdk.nashorn.internal.runtime.ErrorManager;
 import jdk.nashorn.internal.runtime.Source;
diff --git a/nashorn/test/src/jdk/nashorn/internal/runtime/regexp/joni/JoniTest.java b/nashorn/test/src/jdk/nashorn/internal/runtime/regexp/joni/test/JoniTest.java
similarity index 94%
rename from nashorn/test/src/jdk/nashorn/internal/runtime/regexp/joni/JoniTest.java
rename to nashorn/test/src/jdk/nashorn/internal/runtime/regexp/joni/test/JoniTest.java
index 616f769..a208d02 100644
--- a/nashorn/test/src/jdk/nashorn/internal/runtime/regexp/joni/JoniTest.java
+++ b/nashorn/test/src/jdk/nashorn/internal/runtime/regexp/joni/test/JoniTest.java
@@ -23,8 +23,9 @@
  * questions.
  */
 
-package jdk.nashorn.internal.runtime.regexp.joni;
+package jdk.nashorn.internal.runtime.regexp.joni.test;
 
+import jdk.nashorn.internal.runtime.regexp.joni.Regex;
 import org.testng.annotations.Test;
 
 /**
diff --git a/nashorn/test/src/jdk/nashorn/internal/runtime/regexp/JdkRegExpTest.java b/nashorn/test/src/jdk/nashorn/internal/runtime/regexp/test/JdkRegExpTest.java
similarity index 91%
rename from nashorn/test/src/jdk/nashorn/internal/runtime/regexp/JdkRegExpTest.java
rename to nashorn/test/src/jdk/nashorn/internal/runtime/regexp/test/JdkRegExpTest.java
index 8156b78..87a27d0 100644
--- a/nashorn/test/src/jdk/nashorn/internal/runtime/regexp/JdkRegExpTest.java
+++ b/nashorn/test/src/jdk/nashorn/internal/runtime/regexp/test/JdkRegExpTest.java
@@ -23,8 +23,11 @@
  * questions.
  */
 
-package jdk.nashorn.internal.runtime.regexp;
+package jdk.nashorn.internal.runtime.regexp.test;
 
+import jdk.nashorn.internal.runtime.regexp.RegExp;
+import jdk.nashorn.internal.runtime.regexp.RegExpFactory;
+import jdk.nashorn.internal.runtime.regexp.RegExpMatcher;
 import static org.testng.Assert.assertEquals;
 import static org.testng.Assert.assertNotNull;
 import static org.testng.Assert.assertTrue;
diff --git a/nashorn/test/src/jdk/nashorn/internal/runtime/ClassFilterTest.java b/nashorn/test/src/jdk/nashorn/internal/runtime/test/ClassFilterTest.java
similarity index 99%
rename from nashorn/test/src/jdk/nashorn/internal/runtime/ClassFilterTest.java
rename to nashorn/test/src/jdk/nashorn/internal/runtime/test/ClassFilterTest.java
index 5c69141..7f53540 100644
--- a/nashorn/test/src/jdk/nashorn/internal/runtime/ClassFilterTest.java
+++ b/nashorn/test/src/jdk/nashorn/internal/runtime/test/ClassFilterTest.java
@@ -23,7 +23,7 @@
  * questions.
  */
 
-package jdk.nashorn.internal.runtime;
+package jdk.nashorn.internal.runtime.test;
 
 import static org.testng.Assert.fail;
 import java.io.File;
diff --git a/nashorn/test/src/jdk/nashorn/internal/runtime/CodeStoreAndPathTest.java b/nashorn/test/src/jdk/nashorn/internal/runtime/test/CodeStoreAndPathTest.java
similarity index 99%
rename from nashorn/test/src/jdk/nashorn/internal/runtime/CodeStoreAndPathTest.java
rename to nashorn/test/src/jdk/nashorn/internal/runtime/test/CodeStoreAndPathTest.java
index 2ca4820..1d10d81 100644
--- a/nashorn/test/src/jdk/nashorn/internal/runtime/CodeStoreAndPathTest.java
+++ b/nashorn/test/src/jdk/nashorn/internal/runtime/test/CodeStoreAndPathTest.java
@@ -22,7 +22,7 @@
  * or visit www.oracle.com if you need additional information or have any
  * questions.
  */
-package jdk.nashorn.internal.runtime;
+package jdk.nashorn.internal.runtime.test;
 
 import static org.testng.Assert.assertEquals;
 import static org.testng.Assert.assertFalse;
diff --git a/nashorn/test/src/jdk/nashorn/internal/runtime/ConsStringTest.java b/nashorn/test/src/jdk/nashorn/internal/runtime/test/ConsStringTest.java
similarity index 98%
rename from nashorn/test/src/jdk/nashorn/internal/runtime/ConsStringTest.java
rename to nashorn/test/src/jdk/nashorn/internal/runtime/test/ConsStringTest.java
index 16c3606..161a212 100644
--- a/nashorn/test/src/jdk/nashorn/internal/runtime/ConsStringTest.java
+++ b/nashorn/test/src/jdk/nashorn/internal/runtime/test/ConsStringTest.java
@@ -23,8 +23,9 @@
  * questions.
  */
 
-package jdk.nashorn.internal.runtime;
+package jdk.nashorn.internal.runtime.test;
 
+import jdk.nashorn.internal.runtime.ConsString;
 import static org.testng.Assert.assertEquals;
 
 import org.testng.annotations.Test;
diff --git a/nashorn/test/src/jdk/nashorn/internal/runtime/ContextTest.java b/nashorn/test/src/jdk/nashorn/internal/runtime/test/ContextTest.java
similarity index 93%
rename from nashorn/test/src/jdk/nashorn/internal/runtime/ContextTest.java
rename to nashorn/test/src/jdk/nashorn/internal/runtime/test/ContextTest.java
index 6770d7e..fbe20d8 100644
--- a/nashorn/test/src/jdk/nashorn/internal/runtime/ContextTest.java
+++ b/nashorn/test/src/jdk/nashorn/internal/runtime/test/ContextTest.java
@@ -23,7 +23,7 @@
  * questions.
  */
 
-package jdk.nashorn.internal.runtime;
+package jdk.nashorn.internal.runtime.test;
 
 import static jdk.nashorn.internal.runtime.Source.sourceFor;
 import static org.testng.Assert.assertEquals;
@@ -31,6 +31,12 @@
 import static org.testng.Assert.fail;
 import java.util.Map;
 import jdk.nashorn.internal.objects.Global;
+import jdk.nashorn.internal.runtime.Context;
+import jdk.nashorn.internal.runtime.ErrorManager;
+import jdk.nashorn.internal.runtime.ScriptFunction;
+import jdk.nashorn.internal.runtime.ScriptObject;
+import jdk.nashorn.internal.runtime.ScriptRuntime;
+import jdk.nashorn.internal.runtime.Source;
 import jdk.nashorn.internal.runtime.options.Options;
 import org.testng.annotations.Test;
 
diff --git a/nashorn/test/src/jdk/nashorn/internal/runtime/ExceptionsNotSerializable.java b/nashorn/test/src/jdk/nashorn/internal/runtime/test/ExceptionsNotSerializable.java
similarity index 94%
rename from nashorn/test/src/jdk/nashorn/internal/runtime/ExceptionsNotSerializable.java
rename to nashorn/test/src/jdk/nashorn/internal/runtime/test/ExceptionsNotSerializable.java
index 3b6d91b..1c80bde 100644
--- a/nashorn/test/src/jdk/nashorn/internal/runtime/ExceptionsNotSerializable.java
+++ b/nashorn/test/src/jdk/nashorn/internal/runtime/test/ExceptionsNotSerializable.java
@@ -23,7 +23,7 @@
  * questions.
  */
 
-package jdk.nashorn.internal.runtime;
+package jdk.nashorn.internal.runtime.test;
 
 import static org.testng.Assert.assertEquals;
 import static org.testng.Assert.fail;
@@ -34,6 +34,8 @@
 import javax.script.ScriptEngine;
 import javax.script.ScriptException;
 import jdk.nashorn.api.scripting.NashornScriptEngineFactory;
+import jdk.nashorn.internal.runtime.RewriteException;
+import jdk.nashorn.internal.runtime.UnwarrantedOptimismException;
 import org.testng.annotations.Test;
 
 /**
diff --git a/nashorn/test/src/jdk/nashorn/internal/runtime/JSTypeTest.java b/nashorn/test/src/jdk/nashorn/internal/runtime/test/JSTypeTest.java
similarity index 98%
rename from nashorn/test/src/jdk/nashorn/internal/runtime/JSTypeTest.java
rename to nashorn/test/src/jdk/nashorn/internal/runtime/test/JSTypeTest.java
index 406ce1c..71f818c 100644
--- a/nashorn/test/src/jdk/nashorn/internal/runtime/JSTypeTest.java
+++ b/nashorn/test/src/jdk/nashorn/internal/runtime/test/JSTypeTest.java
@@ -23,8 +23,10 @@
  * questions.
  */
 
-package jdk.nashorn.internal.runtime;
+package jdk.nashorn.internal.runtime.test;
 
+import jdk.nashorn.internal.runtime.JSType;
+import jdk.nashorn.internal.runtime.ScriptRuntime;
 import static org.testng.Assert.assertEquals;
 import static org.testng.Assert.assertFalse;
 import static org.testng.Assert.assertTrue;
diff --git a/nashorn/test/src/jdk/nashorn/internal/runtime/LexicalBindingTest.java b/nashorn/test/src/jdk/nashorn/internal/runtime/test/LexicalBindingTest.java
similarity index 99%
rename from nashorn/test/src/jdk/nashorn/internal/runtime/LexicalBindingTest.java
rename to nashorn/test/src/jdk/nashorn/internal/runtime/test/LexicalBindingTest.java
index 2cd0bf0..eb68232 100644
--- a/nashorn/test/src/jdk/nashorn/internal/runtime/LexicalBindingTest.java
+++ b/nashorn/test/src/jdk/nashorn/internal/runtime/test/LexicalBindingTest.java
@@ -23,7 +23,7 @@
  * questions.
  */
 
-package jdk.nashorn.internal.runtime;
+package jdk.nashorn.internal.runtime.test;
 
 import jdk.nashorn.api.scripting.NashornScriptEngineFactory;
 import org.testng.annotations.Test;
diff --git a/nashorn/test/src/jdk/nashorn/internal/runtime/NoPersistenceCachingTest.java b/nashorn/test/src/jdk/nashorn/internal/runtime/test/NoPersistenceCachingTest.java
similarity index 98%
rename from nashorn/test/src/jdk/nashorn/internal/runtime/NoPersistenceCachingTest.java
rename to nashorn/test/src/jdk/nashorn/internal/runtime/test/NoPersistenceCachingTest.java
index 91f1960..0872448 100644
--- a/nashorn/test/src/jdk/nashorn/internal/runtime/NoPersistenceCachingTest.java
+++ b/nashorn/test/src/jdk/nashorn/internal/runtime/test/NoPersistenceCachingTest.java
@@ -22,7 +22,7 @@
  * or visit www.oracle.com if you need additional information or have any
  * questions.
  */
-package jdk.nashorn.internal.runtime;
+package jdk.nashorn.internal.runtime.test;
 
 import static org.testng.Assert.fail;
 import java.io.ByteArrayOutputStream;
diff --git a/nashorn/test/src/jdk/nashorn/internal/runtime/SourceTest.java b/nashorn/test/src/jdk/nashorn/internal/runtime/test/SourceTest.java
similarity index 97%
rename from nashorn/test/src/jdk/nashorn/internal/runtime/SourceTest.java
rename to nashorn/test/src/jdk/nashorn/internal/runtime/test/SourceTest.java
index 12645c0..d62b2f4 100644
--- a/nashorn/test/src/jdk/nashorn/internal/runtime/SourceTest.java
+++ b/nashorn/test/src/jdk/nashorn/internal/runtime/test/SourceTest.java
@@ -23,7 +23,7 @@
  * questions.
  */
 
-package jdk.nashorn.internal.runtime;
+package jdk.nashorn.internal.runtime.test;
 
 import static jdk.nashorn.internal.runtime.Source.sourceFor;
 import static org.testng.Assert.assertEquals;
@@ -36,6 +36,7 @@
 import java.net.URL;
 import java.util.Arrays;
 import jdk.nashorn.api.scripting.URLReader;
+import jdk.nashorn.internal.runtime.Source;
 import org.testng.annotations.Test;
 
 /**
diff --git a/nashorn/test/src/jdk/nashorn/internal/runtime/TrustedScriptEngineTest.java b/nashorn/test/src/jdk/nashorn/internal/runtime/test/TrustedScriptEngineTest.java
similarity index 99%
rename from nashorn/test/src/jdk/nashorn/internal/runtime/TrustedScriptEngineTest.java
rename to nashorn/test/src/jdk/nashorn/internal/runtime/test/TrustedScriptEngineTest.java
index 09c90dc..416a204 100644
--- a/nashorn/test/src/jdk/nashorn/internal/runtime/TrustedScriptEngineTest.java
+++ b/nashorn/test/src/jdk/nashorn/internal/runtime/test/TrustedScriptEngineTest.java
@@ -23,7 +23,7 @@
  * questions.
  */
 
-package jdk.nashorn.internal.runtime;
+package jdk.nashorn.internal.runtime.test;
 
 import static org.testng.Assert.assertEquals;
 import static org.testng.Assert.assertTrue;
@@ -36,6 +36,7 @@
 import javax.script.SimpleScriptContext;
 import jdk.nashorn.api.scripting.ClassFilter;
 import jdk.nashorn.api.scripting.NashornScriptEngineFactory;
+import jdk.nashorn.internal.runtime.Version;
 import org.testng.annotations.Test;
 
 /**
diff --git a/nashorn/test/src/jdk/nashorn/internal/runtime/resources/load_test.js b/nashorn/test/src/jdk/nashorn/internal/runtime/test/resources/load_test.js
similarity index 100%
rename from nashorn/test/src/jdk/nashorn/internal/runtime/resources/load_test.js
rename to nashorn/test/src/jdk/nashorn/internal/runtime/test/resources/load_test.js
diff --git a/test/lib/sun/hotspot/WhiteBox.java b/test/lib/sun/hotspot/WhiteBox.java
index 283d8ad..b14626c 100644
--- a/test/lib/sun/hotspot/WhiteBox.java
+++ b/test/lib/sun/hotspot/WhiteBox.java
@@ -24,6 +24,7 @@
 
 package sun.hotspot;
 
+import java.lang.management.MemoryUsage;
 import java.lang.reflect.Executable;
 import java.util.Arrays;
 import java.util.List;
@@ -95,8 +96,10 @@
   // G1
   public native boolean g1InConcurrentMark();
   public native boolean g1IsHumongous(Object o);
+  public native long    g1NumMaxRegions();
   public native long    g1NumFreeRegions();
   public native int     g1RegionSize();
+  public native MemoryUsage g1AuxiliaryMemoryUsage();
   public native Object[]    parseCommandLine(String commandline, char delim, DiagnosticCommand[] args);
 
   // NMT