changeset 48618:42c802e0b351 switch

Automatic merge with default
author mcimadamore
date Thu, 21 Dec 2017 22:05:28 +0100
parents adf96aa88aa4 91bd550551e0
children ccb3467caa68
files src/java.base/share/classes/java/util/ArraysSupport.java src/java.base/share/native/include/classfile_constants.h src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/Target.java src/jdk.compiler/share/classes/com/sun/tools/javac/resources/compiler.properties
diffstat 125 files changed, 3787 insertions(+), 1980 deletions(-) [+]
line wrap: on
line diff
--- a/.hgtags	Thu Dec 14 22:06:19 2017 +0100
+++ b/.hgtags	Thu Dec 21 22:05:28 2017 +0100
@@ -461,3 +461,4 @@
 89deac44e51517841491ba86ff44aa82a5ca96b3 jdk-10+34
 d8c634b016c628622c9abbdc6bf50509e5dedbec jdk-10+35
 0ee20aad71c4f33c426372b4c8bcc1235ce2ec08 jdk-11+0
+959f2f7cbaa6d2ee45d50029744efb219721576c jdk-10+36
--- a/make/Main.gmk	Thu Dec 14 22:06:19 2017 +0100
+++ b/make/Main.gmk	Thu Dec 21 22:05:28 2017 +0100
@@ -637,7 +637,7 @@
   # Declare dependencies between hotspot-<variant>* targets
   $(foreach v, $(JVM_VARIANTS), \
       $(eval hotspot-$v: hotspot-$v-gensrc hotspot-$v-libs) \
-      $(eval hotspot-$v-libs: hotspot-$v-gensrc) \
+      $(eval hotspot-$v-libs: hotspot-$v-gensrc java.base-copy) \
   )
 
   hotspot-ide-project: hotspot exploded-image
@@ -691,8 +691,9 @@
   jdk.jdwp.agent-libs: jdk.jdwp.agent-gensrc
 
   # The swing beans need to have java base properly generated to avoid errors
-  # in javadoc.
-  java.desktop-gensrc-src: java.base-gensrc
+  # in javadoc. The X11 wrappers need the java.base include files to have been
+  # copied and processed.
+  java.desktop-gensrc-src: java.base-gensrc java.base-copy
 
   # The annotation processing for jdk.internal.vm.ci and jdk.internal.vm.compiler
   # needs classes from the current JDK.
--- a/make/autoconf/buildjdk-spec.gmk.in	Thu Dec 14 22:06:19 2017 +0100
+++ b/make/autoconf/buildjdk-spec.gmk.in	Thu Dec 21 22:05:28 2017 +0100
@@ -55,6 +55,7 @@
 OPENJDK_TARGET_CPU_BITS := @OPENJDK_BUILD_CPU_BITS@
 OPENJDK_TARGET_CPU_ENDIAN := @OPENJDK_BUILD_CPU_ENDIAN@
 OPENJDK_TARGET_CPU_LEGACY := @OPENJDK_BUILD_CPU_LEGACY@
+OPENJDK_TARGET_OS_INCLUDE_SUBDIR := @OPENJDK_BUILD_OS_INCLUDE_SUBDIR@
 
 HOTSPOT_TARGET_OS := @HOTSPOT_BUILD_OS@
 HOTSPOT_TARGET_OS_TYPE := @HOTSPOT_BUILD_OS_TYPE@
--- a/make/autoconf/flags.m4	Thu Dec 14 22:06:19 2017 +0100
+++ b/make/autoconf/flags.m4	Thu Dec 21 22:05:28 2017 +0100
@@ -1162,9 +1162,7 @@
   # Setup some hard coded includes
   $2COMMON_CCXXFLAGS_JDK="[$]$2COMMON_CCXXFLAGS_JDK \
       -I\$(SUPPORT_OUTPUTDIR)/modules_include/java.base \
-      -I${TOPDIR}/src/java.base/share/native/include \
-      -I${TOPDIR}/src/java.base/$OPENJDK_$1_OS/native/include \
-      -I${TOPDIR}/src/java.base/$OPENJDK_$1_OS_TYPE/native/include \
+      -I\$(SUPPORT_OUTPUTDIR)/modules_include/java.base/\$(OPENJDK_TARGET_OS_INCLUDE_SUBDIR) \
       -I${TOPDIR}/src/java.base/share/native/libjava \
       -I${TOPDIR}/src/java.base/$OPENJDK_$1_OS_TYPE/native/libjava \
       -I${TOPDIR}/src/hotspot/share/include \
--- a/make/autoconf/generated-configure.sh	Thu Dec 14 22:06:19 2017 +0100
+++ b/make/autoconf/generated-configure.sh	Thu Dec 21 22:05:28 2017 +0100
@@ -887,6 +887,8 @@
 BOOT_JDK
 JAVA_CHECK
 JAVAC_CHECK
+VERSION_CLASSFILE_MINOR
+VERSION_CLASSFILE_MAJOR
 VENDOR_VERSION_STRING
 VERSION_DATE
 VERSION_IS_GA
@@ -968,6 +970,7 @@
 USERNAME
 TOPDIR
 PATH_SEP
+OPENJDK_BUILD_OS_INCLUDE_SUBDIR
 HOTSPOT_BUILD_CPU_DEFINE
 HOTSPOT_BUILD_CPU_ARCH
 HOTSPOT_BUILD_CPU
@@ -978,6 +981,7 @@
 OPENJDK_BUILD_CPU_ISADIR
 OPENJDK_BUILD_CPU_LEGACY_LIB
 OPENJDK_BUILD_CPU_LEGACY
+OPENJDK_TARGET_OS_INCLUDE_SUBDIR
 HOTSPOT_TARGET_CPU_DEFINE
 HOTSPOT_TARGET_CPU_ARCH
 HOTSPOT_TARGET_CPU
@@ -1093,7 +1097,6 @@
 docdir
 oldincludedir
 includedir
-runstatedir
 localstatedir
 sharedstatedir
 sysconfdir
@@ -1383,7 +1386,6 @@
 sysconfdir='${prefix}/etc'
 sharedstatedir='${prefix}/com'
 localstatedir='${prefix}/var'
-runstatedir='${localstatedir}/run'
 includedir='${prefix}/include'
 oldincludedir='/usr/include'
 docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
@@ -1636,15 +1638,6 @@
   | -silent | --silent | --silen | --sile | --sil)
     silent=yes ;;
 
-  -runstatedir | --runstatedir | --runstatedi | --runstated \
-  | --runstate | --runstat | --runsta | --runst | --runs \
-  | --run | --ru | --r)
-    ac_prev=runstatedir ;;
-  -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \
-  | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \
-  | --run=* | --ru=* | --r=*)
-    runstatedir=$ac_optarg ;;
-
   -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
     ac_prev=sbindir ;;
   -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
@@ -1782,7 +1775,7 @@
 for ac_var in	exec_prefix prefix bindir sbindir libexecdir datarootdir \
 		datadir sysconfdir sharedstatedir localstatedir includedir \
 		oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
-		libdir localedir mandir runstatedir
+		libdir localedir mandir
 do
   eval ac_val=\$$ac_var
   # Remove trailing slashes.
@@ -1935,7 +1928,6 @@
   --sysconfdir=DIR        read-only single-machine data [PREFIX/etc]
   --sharedstatedir=DIR    modifiable architecture-independent data [PREFIX/com]
   --localstatedir=DIR     modifiable single-machine data [PREFIX/var]
-  --runstatedir=DIR       modifiable per-process data [LOCALSTATEDIR/run]
   --libdir=DIR            object code libraries [EPREFIX/lib]
   --includedir=DIR        C header files [PREFIX/include]
   --oldincludedir=DIR     C header files for non-gcc [/usr/include]
@@ -5185,7 +5177,7 @@
 #CUSTOM_AUTOCONF_INCLUDE
 
 # Do not change or remove the following line, it is needed for consistency checks:
-DATE_WHEN_GENERATED=1513206608
+DATE_WHEN_GENERATED=1513362567
 
 ###############################################################################
 #
@@ -16316,6 +16308,14 @@
   fi
 
 
+  # For historical reasons, the OS include directories have odd names.
+  OPENJDK_TARGET_OS_INCLUDE_SUBDIR="$OPENJDK_TARGET_OS"
+  if test "x$OPENJDK_TARGET_OS" = "xwindows"; then
+    OPENJDK_TARGET_OS_INCLUDE_SUBDIR="win32"
+  elif test "x$OPENJDK_TARGET_OS" = "xmacosx"; then
+    OPENJDK_TARGET_OS_INCLUDE_SUBDIR="darwin"
+  fi
+
 
 
   # Also store the legacy naming of the cpu.
@@ -16467,6 +16467,14 @@
   fi
 
 
+  # For historical reasons, the OS include directories have odd names.
+  OPENJDK_BUILD_OS_INCLUDE_SUBDIR="$OPENJDK_TARGET_OS"
+  if test "x$OPENJDK_TARGET_OS" = "xwindows"; then
+    OPENJDK_BUILD_OS_INCLUDE_SUBDIR="win32"
+  elif test "x$OPENJDK_TARGET_OS" = "xmacosx"; then
+    OPENJDK_BUILD_OS_INCLUDE_SUBDIR="darwin"
+  fi
+
 
 
 
@@ -25457,6 +25465,10 @@
     VENDOR_VERSION_STRING="$with_vendor_version_string"
   fi
 
+  # We could define --with flags for these, if really needed
+  VERSION_CLASSFILE_MAJOR="$DEFAULT_VERSION_CLASSFILE_MAJOR"
+  VERSION_CLASSFILE_MINOR="$DEFAULT_VERSION_CLASSFILE_MINOR"
+
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for version string" >&5
 $as_echo_n "checking for version string... " >&6; }
   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $VERSION_STRING" >&5
@@ -25478,6 +25490,9 @@
 
 
 
+
+
+
 ###############################################################################
 #
 # Setup BootJDK, used to bootstrap the build.
@@ -52888,9 +52903,7 @@
   # Setup some hard coded includes
   COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS_JDK \
       -I\$(SUPPORT_OUTPUTDIR)/modules_include/java.base \
-      -I${TOPDIR}/src/java.base/share/native/include \
-      -I${TOPDIR}/src/java.base/$OPENJDK_TARGET_OS/native/include \
-      -I${TOPDIR}/src/java.base/$OPENJDK_TARGET_OS_TYPE/native/include \
+      -I\$(SUPPORT_OUTPUTDIR)/modules_include/java.base/\$(OPENJDK_TARGET_OS_INCLUDE_SUBDIR) \
       -I${TOPDIR}/src/java.base/share/native/libjava \
       -I${TOPDIR}/src/java.base/$OPENJDK_TARGET_OS_TYPE/native/libjava \
       -I${TOPDIR}/src/hotspot/share/include \
@@ -53771,9 +53784,7 @@
   # Setup some hard coded includes
   OPENJDK_BUILD_COMMON_CCXXFLAGS_JDK="$OPENJDK_BUILD_COMMON_CCXXFLAGS_JDK \
       -I\$(SUPPORT_OUTPUTDIR)/modules_include/java.base \
-      -I${TOPDIR}/src/java.base/share/native/include \
-      -I${TOPDIR}/src/java.base/$OPENJDK_BUILD_OS/native/include \
-      -I${TOPDIR}/src/java.base/$OPENJDK_BUILD_OS_TYPE/native/include \
+      -I\$(SUPPORT_OUTPUTDIR)/modules_include/java.base/\$(OPENJDK_TARGET_OS_INCLUDE_SUBDIR) \
       -I${TOPDIR}/src/java.base/share/native/libjava \
       -I${TOPDIR}/src/java.base/$OPENJDK_BUILD_OS_TYPE/native/libjava \
       -I${TOPDIR}/src/hotspot/share/include \
--- a/make/autoconf/jdk-version.m4	Thu Dec 14 22:06:19 2017 +0100
+++ b/make/autoconf/jdk-version.m4	Thu Dec 21 22:05:28 2017 +0100
@@ -331,6 +331,10 @@
     VENDOR_VERSION_STRING="$with_vendor_version_string"
   fi
 
+  # We could define --with flags for these, if really needed
+  VERSION_CLASSFILE_MAJOR="$DEFAULT_VERSION_CLASSFILE_MAJOR"
+  VERSION_CLASSFILE_MINOR="$DEFAULT_VERSION_CLASSFILE_MINOR"
+
   AC_MSG_CHECKING([for version string])
   AC_MSG_RESULT([$VERSION_STRING])
 
@@ -348,4 +352,7 @@
   AC_SUBST(VERSION_IS_GA)
   AC_SUBST(VERSION_DATE)
   AC_SUBST(VENDOR_VERSION_STRING)
+  AC_SUBST(VERSION_CLASSFILE_MAJOR)
+  AC_SUBST(VERSION_CLASSFILE_MINOR)
+
 ])
--- a/make/autoconf/platform.m4	Thu Dec 14 22:06:19 2017 +0100
+++ b/make/autoconf/platform.m4	Thu Dec 21 22:05:28 2017 +0100
@@ -478,6 +478,14 @@
   fi
   AC_SUBST(HOTSPOT_$1_CPU_DEFINE)
 
+  # For historical reasons, the OS include directories have odd names.
+  OPENJDK_$1_OS_INCLUDE_SUBDIR="$OPENJDK_TARGET_OS"
+  if test "x$OPENJDK_TARGET_OS" = "xwindows"; then
+    OPENJDK_$1_OS_INCLUDE_SUBDIR="win32"
+  elif test "x$OPENJDK_TARGET_OS" = "xmacosx"; then
+    OPENJDK_$1_OS_INCLUDE_SUBDIR="darwin"
+  fi
+  AC_SUBST(OPENJDK_$1_OS_INCLUDE_SUBDIR)
 ])
 
 AC_DEFUN([PLATFORM_SET_RELEASE_FILE_OS_VALUES],
--- a/make/autoconf/spec.gmk.in	Thu Dec 14 22:06:19 2017 +0100
+++ b/make/autoconf/spec.gmk.in	Thu Dec 21 22:05:28 2017 +0100
@@ -78,6 +78,7 @@
 OPENJDK_TARGET_CPU_LEGACY:=@OPENJDK_TARGET_CPU_LEGACY@
 OPENJDK_TARGET_CPU_LEGACY_LIB:=@OPENJDK_TARGET_CPU_LEGACY_LIB@
 OPENJDK_TARGET_CPU_OSARCH:=@OPENJDK_TARGET_CPU_OSARCH@
+OPENJDK_TARGET_OS_INCLUDE_SUBIDR:=@OPENJDK_TARGET_OS_INCLUDE_SUBDIR@
 
 HOTSPOT_TARGET_OS := @HOTSPOT_TARGET_OS@
 HOTSPOT_TARGET_OS_TYPE := @HOTSPOT_TARGET_OS_TYPE@
@@ -100,6 +101,8 @@
 OPENJDK_BUILD_CPU_BITS:=@OPENJDK_BUILD_CPU_BITS@
 OPENJDK_BUILD_CPU_ENDIAN:=@OPENJDK_BUILD_CPU_ENDIAN@
 
+OPENJDK_BUILD_OS_INCLUDE_SUBIDR:=@OPENJDK_TARGET_OS_INCLUDE_SUBDIR@
+
 # Target platform value in ModuleTarget class file attribute.
 OPENJDK_MODULE_TARGET_PLATFORM:=@OPENJDK_MODULE_TARGET_PLATFORM@
 
@@ -175,6 +178,10 @@
 # Vendor version string
 VENDOR_VERSION_STRING := @VENDOR_VERSION_STRING@
 
+# Class-file version
+VERSION_CLASSFILE_MAJOR := @VERSION_CLASSFILE_MAJOR@
+VERSION_CLASSFILE_MINOR := @VERSION_CLASSFILE_MINOR@
+
 # Convenience CFLAGS settings for passing version information into native programs.
 VERSION_CFLAGS := \
     -DVERSION_FEATURE=$(VERSION_FEATURE) \
@@ -190,6 +197,8 @@
     -DVERSION_SPECIFICATION='"$(VERSION_SPECIFICATION)"' \
     -DVERSION_DATE='"$(VERSION_DATE)"' \
     -DVENDOR_VERSION_STRING='"$(VENDOR_VERSION_STRING)"' \
+    -DVERSION_CLASSFILE_MAJOR=$(VERSION_CLASSFILE_MAJOR) \
+    -DVERSION_CLASSFILE_MINOR=$(VERSION_CLASSFILE_MINOR) \
     #
 
 # Platform naming variables
--- a/make/autoconf/version-numbers	Thu Dec 14 22:06:19 2017 +0100
+++ b/make/autoconf/version-numbers	Thu Dec 21 22:05:28 2017 +0100
@@ -30,6 +30,8 @@
 DEFAULT_VERSION_UPDATE=0
 DEFAULT_VERSION_PATCH=0
 DEFAULT_VERSION_DATE=2018-03-20
+DEFAULT_VERSION_CLASSFILE_MAJOR=55  # "`$EXPR $DEFAULT_VERSION_FEATURE + 44`"
+DEFAULT_VERSION_CLASSFILE_MINOR=0
 
 LAUNCHER_NAME=openjdk
 PRODUCT_NAME=OpenJDK
--- a/make/common/SetupJavaCompilers.gmk	Thu Dec 14 22:06:19 2017 +0100
+++ b/make/common/SetupJavaCompilers.gmk	Thu Dec 21 22:05:28 2017 +0100
@@ -69,7 +69,7 @@
 $(eval $(call SetupJavaCompiler,GENERATE_JDKBYTECODE, \
     JVM := $(JAVA_JAVAC), \
     JAVAC := $(NEW_JAVAC), \
-    FLAGS := -source 10 -target 10 --doclint-format html5 \
+    FLAGS := -source 11 -target 11 --doclint-format html5 \
         -encoding ascii -XDignore.symbol.file=true $(JAVAC_WARNINGS), \
     SERVER_DIR := $(SJAVAC_SERVER_DIR), \
     SERVER_JVM := $(SJAVAC_SERVER_JAVA)))
@@ -79,7 +79,7 @@
 $(eval $(call SetupJavaCompiler,GENERATE_JDKBYTECODE_NOWARNINGS, \
     JVM := $(JAVA_JAVAC), \
     JAVAC := $(NEW_JAVAC), \
-    FLAGS := -source 10 -target 10 \
+    FLAGS := -source 11 -target 11 \
         -encoding ascii -XDignore.symbol.file=true $(DISABLE_WARNINGS), \
     SERVER_DIR := $(SJAVAC_SERVER_DIR), \
     SERVER_JVM := $(SJAVAC_SERVER_JAVA)))
--- a/make/conf/jib-profiles.js	Thu Dec 14 22:06:19 2017 +0100
+++ b/make/conf/jib-profiles.js	Thu Dec 21 22:05:28 2017 +0100
@@ -829,7 +829,7 @@
         jtreg: {
             server: "javare",
             revision: "4.2",
-            build_number: "b10",
+            build_number: "b11",
             checksum_file: "MD5_VALUES",
             file: "jtreg_bin-4.2.zip",
             environment_name: "JT_HOME",
--- a/make/copy/Copy-java.base.gmk	Thu Dec 14 22:06:19 2017 +0100
+++ b/make/copy/Copy-java.base.gmk	Thu Dec 21 22:05:28 2017 +0100
@@ -24,6 +24,7 @@
 #
 
 include CopyCommon.gmk
+include TextFileProcessing.gmk
 
 $(eval $(call IncludeCustomExtension, copy/Copy-java.base.gmk))
 
@@ -244,3 +245,16 @@
 endif
 
 ################################################################################
+# Generate classfile_constants.h
+
+$(eval $(call SetupTextFileProcessing, CREATE_CLASSFILE_CONSTANTS_H, \
+    SOURCE_FILES := $(TOPDIR)/src/java.base/share/native/include/classfile_constants.h.template, \
+    OUTPUT_FILE := $(SUPPORT_OUTPUTDIR)/modules_include/java.base/classfile_constants.h, \
+    REPLACEMENTS := \
+        @@VERSION_CLASSFILE_MAJOR@@ => $(VERSION_CLASSFILE_MAJOR) ; \
+        @@VERSION_CLASSFILE_MINOR@@ => $(VERSION_CLASSFILE_MINOR) ; , \
+))
+
+TARGETS += $(CREATE_CLASSFILE_CONSTANTS_H)
+
+################################################################################
--- a/make/copy/CopyCommon.gmk	Thu Dec 14 22:06:19 2017 +0100
+++ b/make/copy/CopyCommon.gmk	Thu Dec 21 22:05:28 2017 +0100
@@ -39,20 +39,12 @@
   $(eval $(call SetupCopyFiles, COPY_EXPORTED_INCLUDE, \
       SRC := $(INCLUDE_SOURCE_DIR), \
       DEST := $(INCLUDE_TARGET_DIR), \
-      FILES := $(shell $(FIND) $(INCLUDE_SOURCE_DIR) -type f), \
+      FILES := $(filter %.h, $(call CacheFind, $(INCLUDE_SOURCE_DIR))), \
   ))
 
   TARGETS += $(COPY_EXPORTED_INCLUDE)
 endif
 
-# For historical reasons, the OS include directories have odd names.
-INCLUDE_TARGET_OS_SUBDIR := $(OPENJDK_TARGET_OS)
-ifeq ($(OPENJDK_TARGET_OS), windows)
-  INCLUDE_TARGET_OS_SUBDIR := win32
-else ifeq ($(OPENJDK_TARGET_OS), macosx)
-  INCLUDE_TARGET_OS_SUBDIR := darwin
-endif
-
 # Use the most specific of OS and OS_TYPE.
 INCLUDE_SOURCE_OS_DIR := $(TOPDIR)/src/$(MODULE)/$(OPENJDK_TARGET_OS)/native/include
 ifeq ($(wildcard $(INCLUDE_SOURCE_OS_DIR)/*), )
@@ -62,8 +54,8 @@
 ifneq ($(wildcard $(INCLUDE_SOURCE_OS_DIR)/*), )
   $(eval $(call SetupCopyFiles, COPY_EXPORTED_INCLUDE_OS, \
       SRC := $(INCLUDE_SOURCE_OS_DIR), \
-      DEST := $(INCLUDE_TARGET_DIR)/$(INCLUDE_TARGET_OS_SUBDIR), \
-      FILES := $(shell $(FIND) $(INCLUDE_SOURCE_OS_DIR) -type f), \
+      DEST := $(INCLUDE_TARGET_DIR)/$(OPENJDK_TARGET_OS_INCLUDE_SUBDIR), \
+      FILES := $(filter %.h, $(call CacheFind, $(INCLUDE_SOURCE_OS_DIR))), \
   ))
 
   TARGETS += $(COPY_EXPORTED_INCLUDE_OS)
--- a/make/gensrc/GensrcX11Wrappers.gmk	Thu Dec 14 22:06:19 2017 +0100
+++ b/make/gensrc/GensrcX11Wrappers.gmk	Thu Dec 21 22:05:28 2017 +0100
@@ -92,10 +92,10 @@
   endif
 
   SIZER_CFLAGS := \
-      -I${TOPDIR}/src/hotspot/share/include \
-      -I${TOPDIR}/src/hotspot/os/$(HOTSPOT_TARGET_OS_TYPE)/include \
-      -I$(TOPDIR)/src/java.base/share/native/include \
-      -I$(TOPDIR)/src/java.base/$(OPENJDK_TARGET_OS_TYPE)/native/include \
+      -I$(TOPDIR)/src/hotspot/share/include \
+      -I$(TOPDIR)/src/hotspot/os/$(HOTSPOT_TARGET_OS_TYPE)/include \
+      -I$(SUPPORT_OUTPUTDIR)/modules_include/java.base \
+      -I$(SUPPORT_OUTPUTDIR)/modules_include/java.base/$(OPENJDK_TARGET_OS_INCLUDE_SUBDIR) \
       -I$(TOPDIR)/src/java.base/share/native/libjava \
       -I$(TOPDIR)/src/java.base/$(OPENJDK_TARGET_OS_TYPE)/native/libjava \
       -I$(TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_TYPE)/native/common/awt \
--- a/make/hotspot/lib/CompileJvm.gmk	Thu Dec 14 22:06:19 2017 +0100
+++ b/make/hotspot/lib/CompileJvm.gmk	Thu Dec 21 22:05:28 2017 +0100
@@ -59,8 +59,8 @@
     -I$(TOPDIR)/src/hotspot/share/precompiled \
     -I$(TOPDIR)/src/hotspot/share/include \
     -I$(TOPDIR)/src/hotspot/os/$(HOTSPOT_TARGET_OS_TYPE)/include \
-    -I$(TOPDIR)/src/java.base/share/native/include \
-    -I$(TOPDIR)/src/java.base/$(OPENJDK_TARGET_OS_TYPE)/native/include \
+    -I$(SUPPORT_OUTPUTDIR)/modules_include/java.base \
+    -I$(SUPPORT_OUTPUTDIR)/modules_include/java.base/$(OPENJDK_TARGET_OS_INCLUDE_SUBDIR) \
     -I$(TOPDIR)/src/java.base/share/native/libjimage \
     #
 
--- a/src/hotspot/share/classfile/classFileParser.cpp	Thu Dec 14 22:06:19 2017 +0100
+++ b/src/hotspot/share/classfile/classFileParser.cpp	Thu Dec 21 22:05:28 2017 +0100
@@ -86,8 +86,6 @@
 
 #define JAVA_CLASSFILE_MAGIC              0xCAFEBABE
 #define JAVA_MIN_SUPPORTED_VERSION        45
-#define JAVA_MAX_SUPPORTED_VERSION        54
-#define JAVA_MAX_SUPPORTED_MINOR_VERSION  0
 
 // Used for two backward compatibility reasons:
 // - to check for new additions to the class file format in JDK1.5
@@ -110,6 +108,8 @@
 
 #define JAVA_10_VERSION                   54
 
+#define JAVA_11_VERSION                   55
+
 void ClassFileParser::set_class_bad_constant_seen(short bad_constant) {
   assert((bad_constant == 19 || bad_constant == 20) && _major_version >= JAVA_9_VERSION,
          "Unexpected bad constant pool entry");
@@ -4642,11 +4642,11 @@
 }
 
 static bool is_supported_version(u2 major, u2 minor){
-  const u2 max_version = JAVA_MAX_SUPPORTED_VERSION;
+  const u2 max_version = JVM_CLASSFILE_MAJOR_VERSION;
   return (major >= JAVA_MIN_SUPPORTED_VERSION) &&
          (major <= max_version) &&
          ((major != max_version) ||
-          (minor <= JAVA_MAX_SUPPORTED_MINOR_VERSION));
+          (minor <= JVM_CLASSFILE_MINOR_VERSION));
 }
 
 void ClassFileParser::verify_legal_field_modifiers(jint flags,
@@ -5808,8 +5808,8 @@
       _class_name->as_C_string(),
       _major_version,
       _minor_version,
-      JAVA_MAX_SUPPORTED_VERSION,
-      JAVA_MAX_SUPPORTED_MINOR_VERSION);
+      JVM_CLASSFILE_MAJOR_VERSION,
+      JVM_CLASSFILE_MINOR_VERSION);
     return;
   }
 
--- a/src/hotspot/share/classfile/vmSymbols.hpp	Thu Dec 14 22:06:19 2017 +0100
+++ b/src/hotspot/share/classfile/vmSymbols.hpp	Thu Dec 21 22:05:28 2017 +0100
@@ -996,8 +996,8 @@
    do_name(     montgomerySquare_name,                             "implMontgomerySquare")                              \
    do_signature(montgomerySquare_signature,                        "([I[IIJ[I)[I")                                      \
                                                                                                                         \
-  do_class(java_util_ArraysSupport, "java/util/ArraysSupport")                                                          \
-  do_intrinsic(_vectorizedMismatch, java_util_ArraysSupport, vectorizedMismatch_name, vectorizedMismatch_signature, F_S)\
+  do_class(jdk_internal_util_ArraysSupport, "jdk/internal/util/ArraysSupport")                                                          \
+  do_intrinsic(_vectorizedMismatch, jdk_internal_util_ArraysSupport, vectorizedMismatch_name, vectorizedMismatch_signature, F_S)\
    do_name(vectorizedMismatch_name, "vectorizedMismatch")                                                               \
    do_signature(vectorizedMismatch_signature, "(Ljava/lang/Object;JLjava/lang/Object;JII)I")                            \
                                                                                                                         \
--- a/src/hotspot/share/runtime/arguments.cpp	Thu Dec 14 22:06:19 2017 +0100
+++ b/src/hotspot/share/runtime/arguments.cpp	Thu Dec 21 22:05:28 2017 +0100
@@ -674,6 +674,14 @@
   return false;
 }
 
+// Verifies the correctness of the entries in the special_jvm_flags table.
+// If there is a semantic error (i.e. a bug in the table) such as the obsoletion
+// version being earlier than the deprecation version, then a warning is issued
+// and verification fails - by returning false. If it is detected that the table
+// is out of date, with respect to the current version, then a warning is issued
+// but verification does not fail. This allows the VM to operate when the version
+// is first updated, without needing to update all the impacted flags at the
+// same time.
 static bool verify_special_jvm_flags() {
   bool success = true;
   for (size_t i = 0; special_jvm_flags[i].name != NULL; i++) {
@@ -710,7 +718,6 @@
       if (!version_less_than(JDK_Version::current(), flag.obsolete_in)) {
         if (Flag::find_flag(flag.name) != NULL) {
           warning("Global variable for obsolete special flag entry \"%s\" should be removed", flag.name);
-          success = false;
         }
       }
     }
@@ -720,7 +727,6 @@
       if (!version_less_than(JDK_Version::current(), flag.expired_in)) {
         if (Flag::find_flag(flag.name) != NULL) {
           warning("Global variable for expired flag entry \"%s\" should be removed", flag.name);
-          success = false;
         }
       }
     }
--- a/src/java.base/share/classes/com/sun/java/util/jar/pack/Constants.java	Thu Dec 14 22:06:19 2017 +0100
+++ b/src/java.base/share/classes/com/sun/java/util/jar/pack/Constants.java	Thu Dec 21 22:05:28 2017 +0100
@@ -48,6 +48,7 @@
         1.8 to 1.8.X 52,0
         1.9 to 1.9.X 53,0
         1.10 to 1.10.X 54,0
+        1.11 to 1.11.X 55,0
     */
 
     public static final Package.Version JAVA_MIN_CLASS_VERSION =
@@ -71,6 +72,9 @@
     public static final Package.Version JAVA10_MAX_CLASS_VERSION =
             Package.Version.of(54, 00);
 
+    public static final Package.Version JAVA11_MAX_CLASS_VERSION =
+            Package.Version.of(55, 00);
+
     public static final int JAVA_PACKAGE_MAGIC = 0xCAFED00D;
 
     public static final Package.Version JAVA5_PACKAGE_VERSION =
@@ -87,7 +91,7 @@
 
     // upper limit, should point to the latest class version
     public static final Package.Version JAVA_MAX_CLASS_VERSION =
-            JAVA10_MAX_CLASS_VERSION;
+            JAVA11_MAX_CLASS_VERSION;
 
     // upper limit should point to the latest package version, for version info!.
     public static final Package.Version MAX_PACKAGE_VERSION =
--- a/src/java.base/share/classes/java/nio/Bits.java	Thu Dec 14 22:06:19 2017 +0100
+++ b/src/java.base/share/classes/java/nio/Bits.java	Thu Dec 21 22:05:28 2017 +0100
@@ -63,38 +63,38 @@
 
     // -- Unsafe access --
 
-    private static final Unsafe unsafe = Unsafe.getUnsafe();
+    private static final Unsafe UNSAFE = Unsafe.getUnsafe();
 
     static Unsafe unsafe() {
-        return unsafe;
+        return UNSAFE;
     }
 
 
     // -- Processor and memory-system properties --
 
-    private static final ByteOrder byteOrder
-        = unsafe.isBigEndian() ? ByteOrder.BIG_ENDIAN : ByteOrder.LITTLE_ENDIAN;
+    private static final ByteOrder BYTE_ORDER
+        = UNSAFE.isBigEndian() ? ByteOrder.BIG_ENDIAN : ByteOrder.LITTLE_ENDIAN;
 
     static ByteOrder byteOrder() {
-        return byteOrder;
+        return BYTE_ORDER;
     }
 
-    private static int pageSize = -1;
+    private static int PAGE_SIZE = -1;
 
     static int pageSize() {
-        if (pageSize == -1)
-            pageSize = unsafe().pageSize();
-        return pageSize;
+        if (PAGE_SIZE == -1)
+            PAGE_SIZE = unsafe().pageSize();
+        return PAGE_SIZE;
     }
 
     static int pageCount(long size) {
         return (int)(size + (long)pageSize() - 1L) / pageSize();
     }
 
-    private static boolean unaligned = unsafe.unalignedAccess();
+    private static boolean UNALIGNED = UNSAFE.unalignedAccess();
 
     static boolean unaligned() {
-        return unaligned;
+        return UNALIGNED;
     }
 
 
@@ -103,11 +103,11 @@
     // A user-settable upper limit on the maximum amount of allocatable
     // direct buffer memory.  This value may be changed during VM
     // initialization if it is launched with "-XX:MaxDirectMemorySize=<size>".
-    private static volatile long maxMemory = VM.maxDirectMemory();
-    private static final AtomicLong reservedMemory = new AtomicLong();
-    private static final AtomicLong totalCapacity = new AtomicLong();
-    private static final AtomicLong count = new AtomicLong();
-    private static volatile boolean memoryLimitSet;
+    private static volatile long MAX_MEMORY = VM.maxDirectMemory();
+    private static final AtomicLong RESERVED_MEMORY = new AtomicLong();
+    private static final AtomicLong TOTAL_CAPACITY = new AtomicLong();
+    private static final AtomicLong COUNT = new AtomicLong();
+    private static volatile boolean MEMORY_LIMIT_SET;
 
     // max. number of sleeps during try-reserving with exponentially
     // increasing delay before throwing OutOfMemoryError:
@@ -120,9 +120,9 @@
     // which a process may access.  All sizes are specified in bytes.
     static void reserveMemory(long size, int cap) {
 
-        if (!memoryLimitSet && VM.initLevel() >= 1) {
-            maxMemory = VM.maxDirectMemory();
-            memoryLimitSet = true;
+        if (!MEMORY_LIMIT_SET && VM.initLevel() >= 1) {
+            MAX_MEMORY = VM.maxDirectMemory();
+            MEMORY_LIMIT_SET = true;
         }
 
         // optimist!
@@ -200,10 +200,10 @@
         // actual memory usage, which will differ when buffers are page
         // aligned.
         long totalCap;
-        while (cap <= maxMemory - (totalCap = totalCapacity.get())) {
-            if (totalCapacity.compareAndSet(totalCap, totalCap + cap)) {
-                reservedMemory.addAndGet(size);
-                count.incrementAndGet();
+        while (cap <= MAX_MEMORY - (totalCap = TOTAL_CAPACITY.get())) {
+            if (TOTAL_CAPACITY.compareAndSet(totalCap, totalCap + cap)) {
+                RESERVED_MEMORY.addAndGet(size);
+                COUNT.incrementAndGet();
                 return true;
             }
         }
@@ -213,9 +213,9 @@
 
 
     static void unreserveMemory(long size, int cap) {
-        long cnt = count.decrementAndGet();
-        long reservedMem = reservedMemory.addAndGet(-size);
-        long totalCap = totalCapacity.addAndGet(-cap);
+        long cnt = COUNT.decrementAndGet();
+        long reservedMem = RESERVED_MEMORY.addAndGet(-size);
+        long totalCap = TOTAL_CAPACITY.addAndGet(-cap);
         assert cnt >= 0 && reservedMem >= 0 && totalCap >= 0;
     }
 
@@ -234,15 +234,15 @@
                         }
                         @Override
                         public long getCount() {
-                            return Bits.count.get();
+                            return Bits.COUNT.get();
                         }
                         @Override
                         public long getTotalCapacity() {
-                            return Bits.totalCapacity.get();
+                            return Bits.TOTAL_CAPACITY.get();
                         }
                         @Override
                         public long getMemoryUsed() {
-                            return Bits.reservedMemory.get();
+                            return Bits.RESERVED_MEMORY.get();
                         }
                     };
                 }
--- a/src/java.base/share/classes/java/nio/Buffer.java	Thu Dec 14 22:06:19 2017 +0100
+++ b/src/java.base/share/classes/java/nio/Buffer.java	Thu Dec 21 22:05:28 2017 +0100
@@ -26,6 +26,7 @@
 package java.nio;
 
 import jdk.internal.HotSpotIntrinsicCandidate;
+import jdk.internal.misc.Unsafe;
 
 import java.util.Spliterator;
 
@@ -181,6 +182,8 @@
  */
 
 public abstract class Buffer {
+    // Cached unsafe-access object
+    static final Unsafe UNSAFE = Bits.unsafe();
 
     /**
      * The characteristics of Spliterators that traverse and split elements
@@ -617,6 +620,14 @@
     // -- Package-private methods for bounds checking, etc. --
 
     /**
+     *
+     * @return the base reference, paired with the address
+     * field, which in combination can be used for unsafe access into a heap
+     * buffer or direct byte buffer (and views of).
+     */
+    abstract Object base();
+
+    /**
      * Checks the current position against the limit, throwing a {@link
      * BufferUnderflowException} if it is not smaller than the limit, and then
      * increments the position.
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/java.base/share/classes/java/nio/BufferMismatch.java	Thu Dec 21 22:05:28 2017 +0100
@@ -0,0 +1,198 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * 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 java.nio;
+
+import jdk.internal.util.ArraysSupport;
+
+/**
+ * Mismatch methods for buffers
+ */
+final class BufferMismatch {
+
+    static int mismatch(ByteBuffer a, int aOff, ByteBuffer b, int bOff, int length) {
+        int i = 0;
+        if (length > 7) {
+            i = ArraysSupport.vectorizedMismatch(
+                    a.base(), a.address + aOff,
+                    b.base(), b.address + bOff,
+                    length,
+                    ArraysSupport.LOG2_ARRAY_BYTE_INDEX_SCALE);
+            if (i >= 0) return i;
+            i = length - ~i;
+        }
+        for (; i < length; i++) {
+            if (a.get(aOff + i) != b.get(bOff + i))
+                return i;
+        }
+        return -1;
+    }
+
+    static int mismatch(CharBuffer a, int aOff, CharBuffer b, int bOff, int length) {
+        int i = 0;
+        // Ensure only heap or off-heap buffer instances use the
+        // vectorized mismatch. If either buffer is a StringCharBuffer
+        // (order is null) then the slow path is taken
+        if (length > 3 && a.charRegionOrder() == b.charRegionOrder()
+            && a.charRegionOrder() != null && b.charRegionOrder() != null) {
+            i = ArraysSupport.vectorizedMismatch(
+                    a.base(), a.address + (aOff << ArraysSupport.LOG2_ARRAY_CHAR_INDEX_SCALE),
+                    b.base(), b.address + (bOff << ArraysSupport.LOG2_ARRAY_CHAR_INDEX_SCALE),
+                    length,
+                    ArraysSupport.LOG2_ARRAY_CHAR_INDEX_SCALE);
+            if (i >= 0) return i;
+            i = length - ~i;
+        }
+        for (; i < length; i++) {
+            if (a.get(aOff + i) != b.get(bOff + i))
+                return i;
+        }
+        return -1;
+    }
+
+    static int mismatch(ShortBuffer a, int aOff, ShortBuffer b, int bOff, int length) {
+        int i = 0;
+        if (length > 3 && a.order() == b.order()) {
+            i = ArraysSupport.vectorizedMismatch(
+                    a.base(), a.address + (aOff << ArraysSupport.LOG2_ARRAY_SHORT_INDEX_SCALE),
+                    b.base(), b.address + (bOff << ArraysSupport.LOG2_ARRAY_SHORT_INDEX_SCALE),
+                    length,
+                    ArraysSupport.LOG2_ARRAY_SHORT_INDEX_SCALE);
+            if (i >= 0) return i;
+            i = length - ~i;
+        }
+        for (; i < length; i++) {
+            if (a.get(aOff + i) != b.get(bOff + i))
+                return i;
+        }
+        return -1;
+    }
+
+    static int mismatch(IntBuffer a, int aOff, IntBuffer b, int bOff, int length) {
+        int i = 0;
+        if (length > 1 && a.order() == b.order()) {
+            i = ArraysSupport.vectorizedMismatch(
+                    a.base(), a.address + (aOff << ArraysSupport.LOG2_ARRAY_INT_INDEX_SCALE),
+                    b.base(), b.address + (bOff << ArraysSupport.LOG2_ARRAY_INT_INDEX_SCALE),
+                    length,
+                    ArraysSupport.LOG2_ARRAY_INT_INDEX_SCALE);
+            if (i >= 0) return i;
+            i = length - ~i;
+        }
+        for (; i < length; i++) {
+            if (a.get(aOff + i) != b.get(bOff + i))
+                return i;
+        }
+        return -1;
+    }
+
+    static int mismatch(FloatBuffer a, int aOff, FloatBuffer b, int bOff, int length) {
+        int i = 0;
+        if (length > 1 && a.order() == b.order()) {
+            i = ArraysSupport.vectorizedMismatch(
+                    a.base(), a.address + (aOff << ArraysSupport.LOG2_ARRAY_FLOAT_INDEX_SCALE),
+                    b.base(), b.address + (bOff << ArraysSupport.LOG2_ARRAY_FLOAT_INDEX_SCALE),
+                    length,
+                    ArraysSupport.LOG2_ARRAY_FLOAT_INDEX_SCALE);
+            // Mismatched
+            if (i >= 0) {
+                // Check if mismatch is not associated with two NaN values; and
+                // is not associated with +0 and -0
+                float av = a.get(aOff + i);
+                float bv = b.get(bOff + i);
+                if (av != bv && (!Float.isNaN(av) || !Float.isNaN(bv)))
+                    return i;
+
+                // Fall back to slow mechanism
+                // ISSUE: Consider looping over vectorizedMismatch adjusting ranges
+                // However, requires that returned value be relative to input ranges
+                i++;
+            }
+            // Matched
+            else {
+                i = length - ~i;
+            }
+        }
+        for (; i < length; i++) {
+            float av = a.get(aOff + i);
+            float bv = b.get(bOff + i);
+            if (av != bv && (!Float.isNaN(av) || !Float.isNaN(bv)))
+                return i;
+        }
+        return -1;
+    }
+
+    static int mismatch(LongBuffer a, int aOff, LongBuffer b, int bOff, int length) {
+        int i = 0;
+        if (length > 0 && a.order() == b.order()) {
+            i = ArraysSupport.vectorizedMismatch(
+                    a.base(), a.address + (aOff << ArraysSupport.LOG2_ARRAY_LONG_INDEX_SCALE),
+                    b.base(), b.address + (bOff << ArraysSupport.LOG2_ARRAY_LONG_INDEX_SCALE),
+                    length,
+                    ArraysSupport.LOG2_ARRAY_LONG_INDEX_SCALE);
+            return i >= 0 ? i : -1;
+        }
+        for (; i < length; i++) {
+            if (a.get(aOff + i) != b.get(bOff + i))
+                return i;
+        }
+        return -1;
+    }
+
+    static int mismatch(DoubleBuffer a, int aOff, DoubleBuffer b, int bOff, int length) {
+        int i = 0;
+        if (length > 0 && a.order() == b.order()) {
+            i = ArraysSupport.vectorizedMismatch(
+                    a.base(), a.address + (aOff << ArraysSupport.LOG2_ARRAY_DOUBLE_INDEX_SCALE),
+                    b.base(), b.address + (bOff << ArraysSupport.LOG2_ARRAY_DOUBLE_INDEX_SCALE),
+                    length,
+                    ArraysSupport.LOG2_ARRAY_DOUBLE_INDEX_SCALE);
+            // Mismatched
+            if (i >= 0) {
+                // Check if mismatch is not associated with two NaN values; and
+                // is not associated with +0 and -0
+                double av = a.get(aOff + i);
+                double bv = b.get(bOff + i);
+                if (av != bv && (!Double.isNaN(av) || !Double.isNaN(bv)))
+                    return i;
+
+                // Fall back to slow mechanism
+                // ISSUE: Consider looping over vectorizedMismatch adjusting ranges
+                // However, requires that returned value be relative to input ranges
+                i++;
+            }
+            // Matched
+            else {
+                return -1;
+            }
+        }
+        for (; i < length; i++) {
+            double av = a.get(aOff + i);
+            double bv = b.get(bOff + i);
+            if (av != bv && (!Double.isNaN(av) || !Double.isNaN(bv)))
+                return i;
+        }
+        return -1;
+    }
+}
--- a/src/java.base/share/classes/java/nio/ByteBufferAs-X-Buffer.java.template	Thu Dec 14 22:06:19 2017 +0100
+++ b/src/java.base/share/classes/java/nio/ByteBufferAs-X-Buffer.java.template	Thu Dec 21 22:05:28 2017 +0100
@@ -36,9 +36,6 @@
 
 #if[rw]
 
-    // Cached unsafe-access object
-    private static final Unsafe unsafe = Bits.unsafe();
-
     protected final ByteBuffer bb;
 
 #end[rw]
@@ -74,6 +71,11 @@
 #end[rw]
     }
 
+    @Override
+    Object base() {
+        return bb.hb;
+    }
+
     public $Type$Buffer slice() {
         int pos = this.position();
         int lim = this.limit();
@@ -117,20 +119,20 @@
     }
 
     public $type$ get() {
-        $memtype$ x = unsafe.get$Memtype$Unaligned(bb.hb, byteOffset(nextGetIndex()),
+        $memtype$ x = UNSAFE.get$Memtype$Unaligned(bb.hb, byteOffset(nextGetIndex()),
             {#if[boB]?true:false});
         return $fromBits$(x);
     }
 
     public $type$ get(int i) {
-        $memtype$ x = unsafe.get$Memtype$Unaligned(bb.hb, byteOffset(checkIndex(i)),
+        $memtype$ x = UNSAFE.get$Memtype$Unaligned(bb.hb, byteOffset(checkIndex(i)),
             {#if[boB]?true:false});
         return $fromBits$(x);
     }
 
 #if[streamableType]
    $type$ getUnchecked(int i) {
-        $memtype$ x = unsafe.get$Memtype$Unaligned(bb.hb, byteOffset(i),
+        $memtype$ x = UNSAFE.get$Memtype$Unaligned(bb.hb, byteOffset(i),
             {#if[boB]?true:false});
         return $fromBits$(x);
     }
@@ -141,7 +143,7 @@
     public $Type$Buffer put($type$ x) {
 #if[rw]
         $memtype$ y = $toBits$(x);
-        unsafe.put$Memtype$Unaligned(bb.hb, byteOffset(nextPutIndex()), y,
+        UNSAFE.put$Memtype$Unaligned(bb.hb, byteOffset(nextPutIndex()), y,
             {#if[boB]?true:false});
         return this;
 #else[rw]
@@ -152,7 +154,7 @@
     public $Type$Buffer put(int i, $type$ x) {
 #if[rw]
         $memtype$ y = $toBits$(x);
-        unsafe.put$Memtype$Unaligned(bb.hb, byteOffset(checkIndex(i)), y,
+        UNSAFE.put$Memtype$Unaligned(bb.hb, byteOffset(checkIndex(i)), y,
             {#if[boB]?true:false});
         return this;
 #else[rw]
@@ -241,4 +243,9 @@
 #end[boL]
     }
 
+#if[char]
+    ByteOrder charRegionOrder() {
+        return order();
+    }
+#end[char]
 }
--- a/src/java.base/share/classes/java/nio/Direct-X-Buffer-bin.java.template	Thu Dec 14 22:06:19 2017 +0100
+++ b/src/java.base/share/classes/java/nio/Direct-X-Buffer-bin.java.template	Thu Dec 21 22:05:28 2017 +0100
@@ -32,7 +32,7 @@
 #if[rw]
 
     private $type$ get$Type$(long a) {
-        $memtype$ x = unsafe.get$Memtype$Unaligned(null, a, bigEndian);
+        $memtype$ x = UNSAFE.get$Memtype$Unaligned(null, a, bigEndian);
         return $fromBits$(x);
     }
 
@@ -49,7 +49,7 @@
     private ByteBuffer put$Type$(long a, $type$ x) {
 #if[rw]
         $memtype$ y = $toBits$(x);
-        unsafe.put$Memtype$Unaligned(null, a, y, bigEndian);
+        UNSAFE.put$Memtype$Unaligned(null, a, y, bigEndian);
         return this;
 #else[rw]
         throw new ReadOnlyBufferException();
@@ -81,7 +81,7 @@
         int rem = (off <= lim ? lim - off : 0);
 
         int size = rem >> $LG_BYTES_PER_VALUE$;
-        if (!unaligned && ((address + off) % $BYTES_PER_VALUE$ != 0)) {
+        if (!UNALIGNED && ((address + off) % $BYTES_PER_VALUE$ != 0)) {
             return (bigEndian
                     ? ($Type$Buffer)(new ByteBufferAs$Type$Buffer$RW$B(this,
                                                                        -1,
--- a/src/java.base/share/classes/java/nio/Direct-X-Buffer.java.template	Thu Dec 14 22:06:19 2017 +0100
+++ b/src/java.base/share/classes/java/nio/Direct-X-Buffer.java.template	Thu Dec 21 22:05:28 2017 +0100
@@ -28,7 +28,6 @@
 package java.nio;
 
 import java.io.FileDescriptor;
-import jdk.internal.misc.Unsafe;
 import jdk.internal.misc.VM;
 import jdk.internal.ref.Cleaner;
 import sun.nio.ch.DirectBuffer;
@@ -45,14 +44,11 @@
 
 #if[rw]
 
-    // Cached unsafe-access object
-    protected static final Unsafe unsafe = Bits.unsafe();
-
     // Cached array base offset
-    private static final long arrayBaseOffset = (long)unsafe.arrayBaseOffset($type$[].class);
+    private static final long ARRAY_BASE_OFFSET = UNSAFE.arrayBaseOffset($type$[].class);
 
     // Cached unaligned-access capability
-    protected static final boolean unaligned = Bits.unaligned();
+    protected static final boolean UNALIGNED = Bits.unaligned();
 
     // Base address, used in all indexing calculations
     // NOTE: moved up to Buffer.java for speed in JNI GetDirectBufferAddress
@@ -73,8 +69,6 @@
         implements Runnable
     {
 
-        private static Unsafe unsafe = Unsafe.getUnsafe();
-
         private long address;
         private long size;
         private int capacity;
@@ -91,7 +85,7 @@
                 // Paranoia
                 return;
             }
-            unsafe.freeMemory(address);
+            UNSAFE.freeMemory(address);
             address = 0;
             Bits.unreserveMemory(size, capacity);
         }
@@ -124,12 +118,12 @@
 
         long base = 0;
         try {
-            base = unsafe.allocateMemory(size);
+            base = UNSAFE.allocateMemory(size);
         } catch (OutOfMemoryError x) {
             Bits.unreserveMemory(size, cap);
             throw x;
         }
-        unsafe.setMemory(base, size, (byte) 0);
+        UNSAFE.setMemory(base, size, (byte) 0);
         if (pa && (base % ps != 0)) {
             // Round up to page boundary
             address = base + ps - (base & (ps - 1));
@@ -206,6 +200,11 @@
 #end[rw]
     }
 
+    @Override
+    Object base() {
+        return null;
+    }
+
     public $Type$Buffer slice() {
         int pos = this.position();
         int lim = this.limit();
@@ -258,16 +257,16 @@
     }
 
     public $type$ get() {
-        return $fromBits$($swap$(unsafe.get$Swaptype$(ix(nextGetIndex()))));
+        return $fromBits$($swap$(UNSAFE.get$Swaptype$(ix(nextGetIndex()))));
     }
 
     public $type$ get(int i) {
-        return $fromBits$($swap$(unsafe.get$Swaptype$(ix(checkIndex(i)))));
+        return $fromBits$($swap$(UNSAFE.get$Swaptype$(ix(checkIndex(i)))));
     }
 
 #if[streamableType]
     $type$ getUnchecked(int i) {
-        return $fromBits$($swap$(unsafe.get$Swaptype$(ix(i))));
+        return $fromBits$($swap$(UNSAFE.get$Swaptype$(ix(i))));
     }
 #end[streamableType]
 
@@ -282,10 +281,10 @@
             if (length > rem)
                 throw new BufferUnderflowException();
 
-            long dstOffset = arrayBaseOffset + ((long)offset << $LG_BYTES_PER_VALUE$);
+            long dstOffset = ARRAY_BASE_OFFSET + ((long)offset << $LG_BYTES_PER_VALUE$);
 #if[!byte]
             if (order() != ByteOrder.nativeOrder())
-                unsafe.copySwapMemory(null,
+                UNSAFE.copySwapMemory(null,
                                       ix(pos),
                                       dst,
                                       dstOffset,
@@ -293,7 +292,7 @@
                                       (long)1 << $LG_BYTES_PER_VALUE$);
             else
 #end[!byte]
-                unsafe.copyMemory(null,
+                UNSAFE.copyMemory(null,
                                   ix(pos),
                                   dst,
                                   dstOffset,
@@ -312,7 +311,7 @@
 
     public $Type$Buffer put($type$ x) {
 #if[rw]
-        unsafe.put$Swaptype$(ix(nextPutIndex()), $swap$($toBits$(x)));
+        UNSAFE.put$Swaptype$(ix(nextPutIndex()), $swap$($toBits$(x)));
         return this;
 #else[rw]
         throw new ReadOnlyBufferException();
@@ -321,7 +320,7 @@
 
     public $Type$Buffer put(int i, $type$ x) {
 #if[rw]
-        unsafe.put$Swaptype$(ix(checkIndex(i)), $swap$($toBits$(x)));
+        UNSAFE.put$Swaptype$(ix(checkIndex(i)), $swap$($toBits$(x)));
         return this;
 #else[rw]
         throw new ReadOnlyBufferException();
@@ -347,7 +346,7 @@
 
             if (srem > rem)
                 throw new BufferOverflowException();
-            unsafe.copyMemory(sb.ix(spos), ix(pos), (long)srem << $LG_BYTES_PER_VALUE$);
+            UNSAFE.copyMemory(sb.ix(spos), ix(pos), (long)srem << $LG_BYTES_PER_VALUE$);
             sb.position(spos + srem);
             position(pos + srem);
         } else if (src.hb != null) {
@@ -380,10 +379,10 @@
             if (length > rem)
                 throw new BufferOverflowException();
 
-            long srcOffset = arrayBaseOffset + ((long)offset << $LG_BYTES_PER_VALUE$);
+            long srcOffset = ARRAY_BASE_OFFSET + ((long)offset << $LG_BYTES_PER_VALUE$);
 #if[!byte]
             if (order() != ByteOrder.nativeOrder())
-                unsafe.copySwapMemory(src,
+                UNSAFE.copySwapMemory(src,
                                       srcOffset,
                                       null,
                                       ix(pos),
@@ -391,7 +390,7 @@
                                       (long)1 << $LG_BYTES_PER_VALUE$);
             else
 #end[!byte]
-                unsafe.copyMemory(src,
+                UNSAFE.copyMemory(src,
                                   srcOffset,
                                   null,
                                   ix(pos),
@@ -413,7 +412,7 @@
         assert (pos <= lim);
         int rem = (pos <= lim ? lim - pos : 0);
 
-        unsafe.copyMemory(ix(pos), ix(0), (long)rem << $LG_BYTES_PER_VALUE$);
+        UNSAFE.copyMemory(ix(pos), ix(0), (long)rem << $LG_BYTES_PER_VALUE$);
         position(rem);
         limit(capacity());
         discardMark();
@@ -490,17 +489,22 @@
 
 #end[!byte]
 
+#if[char]
+    ByteOrder charRegionOrder() {
+        return order();
+    }
+#end[char]
 
 
 #if[byte]
 
     byte _get(int i) {                          // package-private
-        return unsafe.getByte(address + i);
+        return UNSAFE.getByte(address + i);
     }
 
     void _put(int i, byte b) {                  // package-private
 #if[rw]
-        unsafe.putByte(address + i, b);
+        UNSAFE.putByte(address + i, b);
 #else[rw]
         throw new ReadOnlyBufferException();
 #end[rw]
--- a/src/java.base/share/classes/java/nio/Heap-X-Buffer.java.template	Thu Dec 14 22:06:19 2017 +0100
+++ b/src/java.base/share/classes/java/nio/Heap-X-Buffer.java.template	Thu Dec 21 22:05:28 2017 +0100
@@ -27,8 +27,6 @@
 
 package java.nio;
 
-import jdk.internal.misc.Unsafe;
-
 /**
 #if[rw]
  * A read/write Heap$Type$Buffer.
@@ -43,6 +41,11 @@
 class Heap$Type$Buffer$RW$
     extends {#if[ro]?Heap}$Type$Buffer
 {
+    // Cached array base offset
+    private static final long ARRAY_BASE_OFFSET = UNSAFE.arrayBaseOffset($type$[].class);
+
+    // Cached array base offset
+    private static final long ARRAY_INDEX_SCALE = UNSAFE.arrayIndexScale($type$[].class);
 
     // For speed these fields are actually declared in X-Buffer;
     // these declarations are here as documentation
@@ -53,16 +56,6 @@
 #end[rw]
     */
 
-#if[byte]
-
-    // Cached unsafe-access object
-    private static final Unsafe unsafe = Bits.unsafe();
-
-    // Cached array base offset
-    private static final long arrayBaseOffset = unsafe.arrayBaseOffset($type$[].class);
-
-#end[byte]
-
     Heap$Type$Buffer$RW$(int cap, int lim) {            // package-private
 #if[rw]
         super(-1, 0, lim, cap, new $type$[cap], 0);
@@ -70,13 +63,11 @@
         hb = new $type$[cap];
         offset = 0;
         */
+        this.address = ARRAY_BASE_OFFSET;
 #else[rw]
         super(cap, lim);
         this.isReadOnly = true;
 #end[rw]
-#if[byte]
-        this.address = arrayBaseOffset;
-#end[byte]
     }
 
     Heap$Type$Buffer$RW$($type$[] buf, int off, int len) { // package-private
@@ -86,13 +77,11 @@
         hb = buf;
         offset = 0;
         */
+        this.address = ARRAY_BASE_OFFSET;
 #else[rw]
         super(buf, off, len);
         this.isReadOnly = true;
 #end[rw]
-#if[byte]
-        this.address = arrayBaseOffset;
-#end[byte]
     }
 
     protected Heap$Type$Buffer$RW$($type$[] buf,
@@ -105,13 +94,11 @@
         hb = buf;
         offset = off;
         */
+        this.address = ARRAY_BASE_OFFSET + off * ARRAY_INDEX_SCALE;
 #else[rw]
         super(buf, mark, pos, lim, cap, off);
         this.isReadOnly = true;
 #end[rw]
-#if[byte]
-        this.address = arrayBaseOffset + off;
-#end[byte]
     }
 
     public $Type$Buffer slice() {
@@ -296,18 +283,18 @@
 #if[rw]
 
     public char getChar() {
-        return unsafe.getCharUnaligned(hb, byteOffset(nextGetIndex(2)), bigEndian);
+        return UNSAFE.getCharUnaligned(hb, byteOffset(nextGetIndex(2)), bigEndian);
     }
 
     public char getChar(int i) {
-        return unsafe.getCharUnaligned(hb, byteOffset(checkIndex(i, 2)), bigEndian);
+        return UNSAFE.getCharUnaligned(hb, byteOffset(checkIndex(i, 2)), bigEndian);
     }
 
 #end[rw]
 
     public $Type$Buffer putChar(char x) {
 #if[rw]
-        unsafe.putCharUnaligned(hb, byteOffset(nextPutIndex(2)), x, bigEndian);
+        UNSAFE.putCharUnaligned(hb, byteOffset(nextPutIndex(2)), x, bigEndian);
         return this;
 #else[rw]
         throw new ReadOnlyBufferException();
@@ -316,7 +303,7 @@
 
     public $Type$Buffer putChar(int i, char x) {
 #if[rw]
-        unsafe.putCharUnaligned(hb, byteOffset(checkIndex(i, 2)), x, bigEndian);
+        UNSAFE.putCharUnaligned(hb, byteOffset(checkIndex(i, 2)), x, bigEndian);
         return this;
 #else[rw]
         throw new ReadOnlyBufferException();
@@ -347,18 +334,18 @@
 #if[rw]
 
     public short getShort() {
-        return unsafe.getShortUnaligned(hb, byteOffset(nextGetIndex(2)), bigEndian);
+        return UNSAFE.getShortUnaligned(hb, byteOffset(nextGetIndex(2)), bigEndian);
     }
 
     public short getShort(int i) {
-        return unsafe.getShortUnaligned(hb, byteOffset(checkIndex(i, 2)), bigEndian);
+        return UNSAFE.getShortUnaligned(hb, byteOffset(checkIndex(i, 2)), bigEndian);
     }
 
 #end[rw]
 
     public $Type$Buffer putShort(short x) {
 #if[rw]
-        unsafe.putShortUnaligned(hb, byteOffset(nextPutIndex(2)), x, bigEndian);
+        UNSAFE.putShortUnaligned(hb, byteOffset(nextPutIndex(2)), x, bigEndian);
         return this;
 #else[rw]
         throw new ReadOnlyBufferException();
@@ -367,7 +354,7 @@
 
     public $Type$Buffer putShort(int i, short x) {
 #if[rw]
-        unsafe.putShortUnaligned(hb, byteOffset(checkIndex(i, 2)), x, bigEndian);
+        UNSAFE.putShortUnaligned(hb, byteOffset(checkIndex(i, 2)), x, bigEndian);
         return this;
 #else[rw]
         throw new ReadOnlyBufferException();
@@ -398,18 +385,18 @@
 #if[rw]
 
     public int getInt() {
-        return unsafe.getIntUnaligned(hb, byteOffset(nextGetIndex(4)), bigEndian);
+        return UNSAFE.getIntUnaligned(hb, byteOffset(nextGetIndex(4)), bigEndian);
     }
 
     public int getInt(int i) {
-        return unsafe.getIntUnaligned(hb, byteOffset(checkIndex(i, 4)), bigEndian);
+        return UNSAFE.getIntUnaligned(hb, byteOffset(checkIndex(i, 4)), bigEndian);
     }
 
 #end[rw]
 
     public $Type$Buffer putInt(int x) {
 #if[rw]
-        unsafe.putIntUnaligned(hb, byteOffset(nextPutIndex(4)), x, bigEndian);
+        UNSAFE.putIntUnaligned(hb, byteOffset(nextPutIndex(4)), x, bigEndian);
         return this;
 #else[rw]
         throw new ReadOnlyBufferException();
@@ -418,7 +405,7 @@
 
     public $Type$Buffer putInt(int i, int x) {
 #if[rw]
-        unsafe.putIntUnaligned(hb, byteOffset(checkIndex(i, 4)), x, bigEndian);
+        UNSAFE.putIntUnaligned(hb, byteOffset(checkIndex(i, 4)), x, bigEndian);
         return this;
 #else[rw]
         throw new ReadOnlyBufferException();
@@ -449,18 +436,18 @@
 #if[rw]
 
     public long getLong() {
-        return unsafe.getLongUnaligned(hb, byteOffset(nextGetIndex(8)), bigEndian);
+        return UNSAFE.getLongUnaligned(hb, byteOffset(nextGetIndex(8)), bigEndian);
     }
 
     public long getLong(int i) {
-        return unsafe.getLongUnaligned(hb, byteOffset(checkIndex(i, 8)), bigEndian);
+        return UNSAFE.getLongUnaligned(hb, byteOffset(checkIndex(i, 8)), bigEndian);
     }
 
 #end[rw]
 
     public $Type$Buffer putLong(long x) {
 #if[rw]
-        unsafe.putLongUnaligned(hb, byteOffset(nextPutIndex(8)), x, bigEndian);
+        UNSAFE.putLongUnaligned(hb, byteOffset(nextPutIndex(8)), x, bigEndian);
         return this;
 #else[rw]
         throw new ReadOnlyBufferException();
@@ -469,7 +456,7 @@
 
     public $Type$Buffer putLong(int i, long x) {
 #if[rw]
-        unsafe.putLongUnaligned(hb, byteOffset(checkIndex(i, 8)), x, bigEndian);
+        UNSAFE.putLongUnaligned(hb, byteOffset(checkIndex(i, 8)), x, bigEndian);
         return this;
 #else[rw]
         throw new ReadOnlyBufferException();
@@ -500,12 +487,12 @@
 #if[rw]
 
     public float getFloat() {
-        int x = unsafe.getIntUnaligned(hb, byteOffset(nextGetIndex(4)), bigEndian);
+        int x = UNSAFE.getIntUnaligned(hb, byteOffset(nextGetIndex(4)), bigEndian);
         return Float.intBitsToFloat(x);
     }
 
     public float getFloat(int i) {
-        int x = unsafe.getIntUnaligned(hb, byteOffset(checkIndex(i, 4)), bigEndian);
+        int x = UNSAFE.getIntUnaligned(hb, byteOffset(checkIndex(i, 4)), bigEndian);
         return Float.intBitsToFloat(x);
     }
 
@@ -514,7 +501,7 @@
     public $Type$Buffer putFloat(float x) {
 #if[rw]
         int y = Float.floatToRawIntBits(x);
-        unsafe.putIntUnaligned(hb, byteOffset(nextPutIndex(4)), y, bigEndian);
+        UNSAFE.putIntUnaligned(hb, byteOffset(nextPutIndex(4)), y, bigEndian);
         return this;
 #else[rw]
         throw new ReadOnlyBufferException();
@@ -524,7 +511,7 @@
     public $Type$Buffer putFloat(int i, float x) {
 #if[rw]
         int y = Float.floatToRawIntBits(x);
-        unsafe.putIntUnaligned(hb, byteOffset(checkIndex(i, 4)), y, bigEndian);
+        UNSAFE.putIntUnaligned(hb, byteOffset(checkIndex(i, 4)), y, bigEndian);
         return this;
 #else[rw]
         throw new ReadOnlyBufferException();
@@ -555,12 +542,12 @@
 #if[rw]
 
     public double getDouble() {
-        long x = unsafe.getLongUnaligned(hb, byteOffset(nextGetIndex(8)), bigEndian);
+        long x = UNSAFE.getLongUnaligned(hb, byteOffset(nextGetIndex(8)), bigEndian);
         return Double.longBitsToDouble(x);
     }
 
     public double getDouble(int i) {
-        long x = unsafe.getLongUnaligned(hb, byteOffset(checkIndex(i, 8)), bigEndian);
+        long x = UNSAFE.getLongUnaligned(hb, byteOffset(checkIndex(i, 8)), bigEndian);
         return Double.longBitsToDouble(x);
     }
 
@@ -569,7 +556,7 @@
     public $Type$Buffer putDouble(double x) {
 #if[rw]
         long y = Double.doubleToRawLongBits(x);
-        unsafe.putLongUnaligned(hb, byteOffset(nextPutIndex(8)), y, bigEndian);
+        UNSAFE.putLongUnaligned(hb, byteOffset(nextPutIndex(8)), y, bigEndian);
         return this;
 #else[rw]
         throw new ReadOnlyBufferException();
@@ -579,7 +566,7 @@
     public $Type$Buffer putDouble(int i, double x) {
 #if[rw]
         long y = Double.doubleToRawLongBits(x);
-        unsafe.putLongUnaligned(hb, byteOffset(checkIndex(i, 8)), y, bigEndian);
+        UNSAFE.putLongUnaligned(hb, byteOffset(checkIndex(i, 8)), y, bigEndian);
         return this;
 #else[rw]
         throw new ReadOnlyBufferException();
@@ -643,7 +630,11 @@
     public ByteOrder order() {
         return ByteOrder.nativeOrder();
     }
+#end[!byte]
+#if[char]
 
-#end[!byte]
-
+    ByteOrder charRegionOrder() {
+        return order();
+    }
+#end[char]
 }
--- a/src/java.base/share/classes/java/nio/StringCharBuffer.java	Thu Dec 14 22:06:19 2017 +0100
+++ b/src/java.base/share/classes/java/nio/StringCharBuffer.java	Thu Dec 21 22:05:28 2017 +0100
@@ -127,4 +127,30 @@
         return ByteOrder.nativeOrder();
     }
 
+    ByteOrder charRegionOrder() {
+        return null;
+    }
+
+    public boolean equals(Object ob) {
+        if (this == ob)
+            return true;
+        if (!(ob instanceof CharBuffer))
+            return false;
+        CharBuffer that = (CharBuffer)ob;
+        if (this.remaining() != that.remaining())
+            return false;
+        return BufferMismatch.mismatch(this, this.position(),
+                                       that, that.position(),
+                                       this.remaining()) < 0;
+    }
+
+    public int compareTo(CharBuffer that) {
+        int i = BufferMismatch.mismatch(this, this.position(),
+                                        that, that.position(),
+                                        Math.min(this.remaining(), that.remaining()));
+        if (i >= 0) {
+            return Character.compare(this.get(this.position() + i), that.get(this.position() + i));
+        }
+        return this.remaining() - that.remaining();
+    }
 }
--- a/src/java.base/share/classes/java/nio/X-Buffer.java.template	Thu Dec 14 22:06:19 2017 +0100
+++ b/src/java.base/share/classes/java/nio/X-Buffer.java.template	Thu Dec 21 22:05:28 2017 +0100
@@ -36,6 +36,8 @@
 import java.util.stream.$Streamtype$Stream;
 #end[streamableType]
 
+import jdk.internal.util.ArraysSupport;
+
 /**
  * $A$ $type$ buffer.
  *
@@ -287,6 +289,11 @@
         this(mark, pos, lim, cap, null, 0);
     }
 
+    @Override
+    Object base() {
+        return hb;
+    }
+
 #if[byte]
 
     /**
@@ -1297,19 +1304,9 @@
         $Type$Buffer that = ($Type$Buffer)ob;
         if (this.remaining() != that.remaining())
             return false;
-        int p = this.position();
-        for (int i = this.limit() - 1, j = that.limit() - 1; i >= p; i--, j--)
-            if (!equals(this.get(i), that.get(j)))
-                return false;
-        return true;
-    }
-
-    private static boolean equals($type$ x, $type$ y) {
-#if[floatingPointType]
-        return (x == y) || ($Fulltype$.isNaN(x) && $Fulltype$.isNaN(y));
-#else[floatingPointType]
-        return x == y;
-#end[floatingPointType]
+        return BufferMismatch.mismatch(this, this.position(),
+                                       that, that.position(),
+                                       this.remaining()) < 0;
     }
 
     /**
@@ -1336,11 +1333,11 @@
      *          is less than, equal to, or greater than the given buffer
      */
     public int compareTo($Type$Buffer that) {
-        int n = this.position() + Math.min(this.remaining(), that.remaining());
-        for (int i = this.position(), j = that.position(); i < n; i++, j++) {
-            int cmp = compare(this.get(i), that.get(j));
-            if (cmp != 0)
-                return cmp;
+        int i = BufferMismatch.mismatch(this, this.position(),
+                                        that, that.position(),
+                                        Math.min(this.remaining(), that.remaining()));
+        if (i >= 0) {
+            return compare(this.get(this.position() + i), that.get(this.position() + i));
         }
         return this.remaining() - that.remaining();
     }
@@ -1571,6 +1568,12 @@
 
 #end[!byte]
 
+#if[char]
+    // The order or null if the buffer does not cover a memory region,
+    // such as StringCharBuffer
+    abstract ByteOrder charRegionOrder();
+#end[char]
+
 #if[byte]
 
     boolean bigEndian                                   // package-private
--- a/src/java.base/share/classes/java/nio/file/Files.java	Thu Dec 14 22:06:19 2017 +0100
+++ b/src/java.base/share/classes/java/nio/file/Files.java	Thu Dec 21 22:05:28 2017 +0100
@@ -2955,22 +2955,6 @@
     }
 
     /**
-     * Reads all bytes from an input stream and writes them to an output stream.
-     */
-    private static long copy(InputStream source, OutputStream sink)
-        throws IOException
-    {
-        long nread = 0L;
-        byte[] buf = new byte[BUFFER_SIZE];
-        int n;
-        while ((n = source.read(buf)) > 0) {
-            sink.write(buf, 0, n);
-            nread += n;
-        }
-        return nread;
-    }
-
-    /**
      * Copies all bytes from an input stream to a file. On return, the input
      * stream will be at end of stream.
      *
@@ -3082,7 +3066,7 @@
 
         // do the copy
         try (OutputStream out = ostream) {
-            return copy(in, out);
+            return in.transferTo(out);
         }
     }
 
@@ -3124,7 +3108,7 @@
         Objects.requireNonNull(out);
 
         try (InputStream in = newInputStream(source)) {
-            return copy(in, out);
+            return in.transferTo(out);
         }
     }
 
--- a/src/java.base/share/classes/java/util/Arrays.java	Thu Dec 14 22:06:19 2017 +0100
+++ b/src/java.base/share/classes/java/util/Arrays.java	Thu Dec 21 22:05:28 2017 +0100
@@ -26,6 +26,7 @@
 package java.util;
 
 import jdk.internal.HotSpotIntrinsicCandidate;
+import jdk.internal.util.ArraysSupport;
 
 import java.lang.reflect.Array;
 import java.util.concurrent.ForkJoinPool;
--- a/src/java.base/share/classes/java/util/ArraysSupport.java	Thu Dec 14 22:06:19 2017 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,545 +0,0 @@
-/*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  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 java.util;
-
-import jdk.internal.HotSpotIntrinsicCandidate;
-import jdk.internal.misc.Unsafe;
-
-/**
- * Utility methods to find a mismatch between two primitive arrays.
- *
- * <p>Array equality and lexicographical comparison can be built on top of
- * array mismatch functionality.
- *
- * <p>The mismatch method implementation, {@link #vectorizedMismatch}, leverages
- * vector-based techniques to access and compare the contents of two arrays.
- * The Java implementation uses {@code Unsafe.getLongUnaligned} to access the
- * content of an array, thus access is supported on platforms that do not
- * support unaligned access.  For a byte[] array, 8 bytes (64 bits) can be
- * accessed and compared as a unit rather than individually, which increases
- * the performance when the method is compiled by the HotSpot VM.  On supported
- * platforms the mismatch implementation is intrinsified to leverage SIMD
- * instructions.  So for a byte[] array, 16 bytes (128 bits), 32 bytes
- * (256 bits), and perhaps in the future even 64 bytes (512 bits), platform
- * permitting, can be accessed and compared as a unit, which further increases
- * the performance over the Java implementation.
- *
- * <p>None of the mismatch methods perform array bounds checks.  It is the
- * responsibility of the caller (direct or otherwise) to perform such checks
- * before calling this method.
- */
-class ArraysSupport {
-    static final Unsafe U = Unsafe.getUnsafe();
-
-    private static final boolean BIG_ENDIAN = U.isBigEndian();
-
-    private static final int LOG2_ARRAY_BOOLEAN_INDEX_SCALE = exactLog2(Unsafe.ARRAY_BOOLEAN_INDEX_SCALE);
-    private static final int LOG2_ARRAY_BYTE_INDEX_SCALE = exactLog2(Unsafe.ARRAY_BYTE_INDEX_SCALE);
-    private static final int LOG2_ARRAY_CHAR_INDEX_SCALE = exactLog2(Unsafe.ARRAY_CHAR_INDEX_SCALE);
-    private static final int LOG2_ARRAY_SHORT_INDEX_SCALE = exactLog2(Unsafe.ARRAY_SHORT_INDEX_SCALE);
-    private static final int LOG2_ARRAY_INT_INDEX_SCALE = exactLog2(Unsafe.ARRAY_INT_INDEX_SCALE);
-    private static final int LOG2_ARRAY_LONG_INDEX_SCALE = exactLog2(Unsafe.ARRAY_LONG_INDEX_SCALE);
-    private static final int LOG2_ARRAY_FLOAT_INDEX_SCALE = exactLog2(Unsafe.ARRAY_FLOAT_INDEX_SCALE);
-    private static final int LOG2_ARRAY_DOUBLE_INDEX_SCALE = exactLog2(Unsafe.ARRAY_DOUBLE_INDEX_SCALE);
-
-    private static final int LOG2_BYTE_BIT_SIZE = exactLog2(Byte.SIZE);
-
-    private static int exactLog2(int scale) {
-        if ((scale & (scale - 1)) != 0)
-            throw new Error("data type scale not a power of two");
-        return Integer.numberOfTrailingZeros(scale);
-    }
-
-    private ArraysSupport() {}
-
-    /**
-     * Find the relative index of the first mismatching pair of elements in two
-     * primitive arrays of the same component type.  Pairs of elements will be
-     * tested in order relative to given offsets into both arrays.
-     *
-     * <p>This method does not perform type checks or bounds checks.  It is the
-     * responsibility of the caller to perform such checks before calling this
-     * method.
-     *
-     * <p>The given offsets, in bytes, need not be aligned according to the
-     * given log<sub>2</sub> size the array elements.  More specifically, an
-     * offset modulus the size need not be zero.
-     *
-     * @param a the first array to be tested for mismatch, or {@code null} for
-     * direct memory access
-     * @param aOffset the relative offset, in bytes, from the base address of
-     * the first array to test from, otherwise if the first array is
-     * {@code null}, an absolute address pointing to the first element to test.
-     * @param b the second array to be tested for mismatch, or {@code null} for
-     * direct memory access
-     * @param bOffset the relative offset, in bytes, from the base address of
-     * the second array to test from, otherwise if the second array is
-     * {@code null}, an absolute address pointing to the first element to test.
-     * @param length the number of array elements to test
-     * @param log2ArrayIndexScale log<sub>2</sub> of the array index scale, that
-     * corresponds to the size, in bytes, of an array element.
-     * @return if a mismatch is found a relative index, between 0 (inclusive)
-     * and {@code length} (exclusive), of the first mismatching pair of elements
-     * in the two arrays.  Otherwise, if a mismatch is not found the bitwise
-     * compliment of the number of remaining pairs of elements to be checked in
-     * the tail of the two arrays.
-     */
-    @HotSpotIntrinsicCandidate
-    static int vectorizedMismatch(Object a, long aOffset,
-                                  Object b, long bOffset,
-                                  int length,
-                                  int log2ArrayIndexScale) {
-        // assert a.getClass().isArray();
-        // assert b.getClass().isArray();
-        // assert 0 <= length <= sizeOf(a)
-        // assert 0 <= length <= sizeOf(b)
-        // assert 0 <= log2ArrayIndexScale <= 3
-
-        int log2ValuesPerWidth = LOG2_ARRAY_LONG_INDEX_SCALE - log2ArrayIndexScale;
-        int wi = 0;
-        for (; wi < length >> log2ValuesPerWidth; wi++) {
-            long bi = ((long) wi) << LOG2_ARRAY_LONG_INDEX_SCALE;
-            long av = U.getLongUnaligned(a, aOffset + bi);
-            long bv = U.getLongUnaligned(b, bOffset + bi);
-            if (av != bv) {
-                long x = av ^ bv;
-                int o = BIG_ENDIAN
-                        ? Long.numberOfLeadingZeros(x) >> (LOG2_BYTE_BIT_SIZE + log2ArrayIndexScale)
-                        : Long.numberOfTrailingZeros(x) >> (LOG2_BYTE_BIT_SIZE + log2ArrayIndexScale);
-                return (wi << log2ValuesPerWidth) + o;
-            }
-        }
-
-        // Calculate the tail of remaining elements to check
-        int tail = length - (wi << log2ValuesPerWidth);
-
-        if (log2ArrayIndexScale < LOG2_ARRAY_INT_INDEX_SCALE) {
-            int wordTail = 1 << (LOG2_ARRAY_INT_INDEX_SCALE - log2ArrayIndexScale);
-            // Handle 4 bytes or 2 chars in the tail using int width
-            if (tail >= wordTail) {
-                long bi = ((long) wi) << LOG2_ARRAY_LONG_INDEX_SCALE;
-                int av = U.getIntUnaligned(a, aOffset + bi);
-                int bv = U.getIntUnaligned(b, bOffset + bi);
-                if (av != bv) {
-                    int x = av ^ bv;
-                    int o = BIG_ENDIAN
-                            ? Integer.numberOfLeadingZeros(x) >> (LOG2_BYTE_BIT_SIZE + log2ArrayIndexScale)
-                            : Integer.numberOfTrailingZeros(x) >> (LOG2_BYTE_BIT_SIZE + log2ArrayIndexScale);
-                    return (wi << log2ValuesPerWidth) + o;
-                }
-                tail -= wordTail;
-            }
-            return ~tail;
-        }
-        else {
-            return ~tail;
-        }
-    }
-
-    // Booleans
-    // Each boolean element takes up one byte
-
-    static int mismatch(boolean[] a,
-                        boolean[] b,
-                        int length) {
-        int i = 0;
-        if (length > 7) {
-            i = vectorizedMismatch(
-                    a, Unsafe.ARRAY_BOOLEAN_BASE_OFFSET,
-                    b, Unsafe.ARRAY_BOOLEAN_BASE_OFFSET,
-                    length, LOG2_ARRAY_BOOLEAN_INDEX_SCALE);
-            if (i >= 0)
-                return i;
-            i = length - ~i;
-        }
-        for (; i < length; i++) {
-            if (a[i] != b[i])
-                return i;
-        }
-        return -1;
-    }
-
-    static int mismatch(boolean[] a, int aFromIndex,
-                        boolean[] b, int bFromIndex,
-                        int length) {
-        int i = 0;
-        if (length > 7) {
-            int aOffset = Unsafe.ARRAY_BOOLEAN_BASE_OFFSET + aFromIndex;
-            int bOffset = Unsafe.ARRAY_BOOLEAN_BASE_OFFSET + bFromIndex;
-            i = vectorizedMismatch(
-                    a, aOffset,
-                    b, bOffset,
-                    length, LOG2_ARRAY_BOOLEAN_INDEX_SCALE);
-            if (i >= 0)
-                return i;
-            i = length - ~i;
-        }
-        for (; i < length; i++) {
-            if (a[aFromIndex + i] != b[bFromIndex + i])
-                return i;
-        }
-        return -1;
-    }
-
-
-    // Bytes
-
-    /**
-     * Find the index of a mismatch between two arrays.
-     *
-     * <p>This method does not perform bounds checks. It is the responsibility
-     * of the caller to perform such bounds checks before calling this method.
-     *
-     * @param a the first array to be tested for a mismatch
-     * @param b the second array to be tested for a mismatch
-     * @param length the number of bytes from each array to check
-     * @return the index of a mismatch between the two arrays, otherwise -1 if
-     * no mismatch.  The index will be within the range of (inclusive) 0 to
-     * (exclusive) the smaller of the two array lengths.
-     */
-    static int mismatch(byte[] a,
-                        byte[] b,
-                        int length) {
-        // ISSUE: defer to index receiving methods if performance is good
-        // assert length <= a.length
-        // assert length <= b.length
-
-        int i = 0;
-        if (length > 7) {
-            i = vectorizedMismatch(
-                    a, Unsafe.ARRAY_BYTE_BASE_OFFSET,
-                    b, Unsafe.ARRAY_BYTE_BASE_OFFSET,
-                    length, LOG2_ARRAY_BYTE_INDEX_SCALE);
-            if (i >= 0)
-                return i;
-            // Align to tail
-            i = length - ~i;
-//            assert i >= 0 && i <= 7;
-        }
-        // Tail < 8 bytes
-        for (; i < length; i++) {
-            if (a[i] != b[i])
-                return i;
-        }
-        return -1;
-    }
-
-    /**
-     * Find the relative index of a mismatch between two arrays starting from
-     * given indexes.
-     *
-     * <p>This method does not perform bounds checks. It is the responsibility
-     * of the caller to perform such bounds checks before calling this method.
-     *
-     * @param a the first array to be tested for a mismatch
-     * @param aFromIndex the index of the first element (inclusive) in the first
-     * array to be compared
-     * @param b the second array to be tested for a mismatch
-     * @param bFromIndex the index of the first element (inclusive) in the
-     * second array to be compared
-     * @param length the number of bytes from each array to check
-     * @return the relative index of a mismatch between the two arrays,
-     * otherwise -1 if no mismatch.  The index will be within the range of
-     * (inclusive) 0 to (exclusive) the smaller of the two array bounds.
-     */
-    static int mismatch(byte[] a, int aFromIndex,
-                        byte[] b, int bFromIndex,
-                        int length) {
-        // assert 0 <= aFromIndex < a.length
-        // assert 0 <= aFromIndex + length <= a.length
-        // assert 0 <= bFromIndex < b.length
-        // assert 0 <= bFromIndex + length <= b.length
-        // assert length >= 0
-
-        int i = 0;
-        if (length > 7) {
-            int aOffset = Unsafe.ARRAY_BYTE_BASE_OFFSET + aFromIndex;
-            int bOffset = Unsafe.ARRAY_BYTE_BASE_OFFSET + bFromIndex;
-            i = vectorizedMismatch(
-                    a, aOffset,
-                    b, bOffset,
-                    length, LOG2_ARRAY_BYTE_INDEX_SCALE);
-            if (i >= 0)
-                return i;
-            i = length - ~i;
-        }
-        for (; i < length; i++) {
-            if (a[aFromIndex + i] != b[bFromIndex + i])
-                return i;
-        }
-        return -1;
-    }
-
-
-    // Chars
-
-    static int mismatch(char[] a,
-                        char[] b,
-                        int length) {
-        int i = 0;
-        if (length > 3) {
-            i = vectorizedMismatch(
-                    a, Unsafe.ARRAY_CHAR_BASE_OFFSET,
-                    b, Unsafe.ARRAY_CHAR_BASE_OFFSET,
-                    length, LOG2_ARRAY_CHAR_INDEX_SCALE);
-            if (i >= 0)
-                return i;
-            i = length - ~i;
-        }
-        for (; i < length; i++) {
-            if (a[i] != b[i])
-                return i;
-        }
-        return -1;
-    }
-
-    static int mismatch(char[] a, int aFromIndex,
-                        char[] b, int bFromIndex,
-                        int length) {
-        int i = 0;
-        if (length > 3) {
-            int aOffset = Unsafe.ARRAY_CHAR_BASE_OFFSET + (aFromIndex << LOG2_ARRAY_CHAR_INDEX_SCALE);
-            int bOffset = Unsafe.ARRAY_CHAR_BASE_OFFSET + (bFromIndex << LOG2_ARRAY_CHAR_INDEX_SCALE);
-            i = vectorizedMismatch(
-                    a, aOffset,
-                    b, bOffset,
-                    length, LOG2_ARRAY_CHAR_INDEX_SCALE);
-            if (i >= 0)
-                return i;
-            i = length - ~i;
-        }
-        for (; i < length; i++) {
-            if (a[aFromIndex + i] != b[bFromIndex + i])
-                return i;
-        }
-        return -1;
-    }
-
-
-    // Shorts
-
-    static int mismatch(short[] a,
-                        short[] b,
-                        int length) {
-        int i = 0;
-        if (length > 3) {
-            i = vectorizedMismatch(
-                    a, Unsafe.ARRAY_SHORT_BASE_OFFSET,
-                    b, Unsafe.ARRAY_SHORT_BASE_OFFSET,
-                    length, LOG2_ARRAY_SHORT_INDEX_SCALE);
-            if (i >= 0)
-                return i;
-            i = length - ~i;
-        }
-        for (; i < length; i++) {
-            if (a[i] != b[i])
-                return i;
-        }
-        return -1;
-    }
-
-    static int mismatch(short[] a, int aFromIndex,
-                        short[] b, int bFromIndex,
-                        int length) {
-        int i = 0;
-        if (length > 3) {
-            int aOffset = Unsafe.ARRAY_SHORT_BASE_OFFSET + (aFromIndex << LOG2_ARRAY_SHORT_INDEX_SCALE);
-            int bOffset = Unsafe.ARRAY_SHORT_BASE_OFFSET + (bFromIndex << LOG2_ARRAY_SHORT_INDEX_SCALE);
-            i = vectorizedMismatch(
-                    a, aOffset,
-                    b, bOffset,
-                    length, LOG2_ARRAY_SHORT_INDEX_SCALE);
-            if (i >= 0)
-                return i;
-            i = length - ~i;
-        }
-        for (; i < length; i++) {
-            if (a[aFromIndex + i] != b[bFromIndex + i])
-                return i;
-        }
-        return -1;
-    }
-
-
-    // Ints
-
-    static int mismatch(int[] a,
-                        int[] b,
-                        int length) {
-        int i = 0;
-        if (length > 1) {
-            i = vectorizedMismatch(
-                    a, Unsafe.ARRAY_INT_BASE_OFFSET,
-                    b, Unsafe.ARRAY_INT_BASE_OFFSET,
-                    length, LOG2_ARRAY_INT_INDEX_SCALE);
-            if (i >= 0)
-                return i;
-            i = length - ~i;
-        }
-        for (; i < length; i++) {
-            if (a[i] != b[i])
-                return i;
-        }
-        return -1;
-    }
-
-    static int mismatch(int[] a, int aFromIndex,
-                        int[] b, int bFromIndex,
-                        int length) {
-        int i = 0;
-        if (length > 1) {
-            int aOffset = Unsafe.ARRAY_INT_BASE_OFFSET + (aFromIndex << LOG2_ARRAY_INT_INDEX_SCALE);
-            int bOffset = Unsafe.ARRAY_INT_BASE_OFFSET + (bFromIndex << LOG2_ARRAY_INT_INDEX_SCALE);
-            i = vectorizedMismatch(
-                    a, aOffset,
-                    b, bOffset,
-                    length, LOG2_ARRAY_INT_INDEX_SCALE);
-            if (i >= 0)
-                return i;
-            i = length - ~i;
-        }
-        for (; i < length; i++) {
-            if (a[aFromIndex + i] != b[bFromIndex + i])
-                return i;
-        }
-        return -1;
-    }
-
-
-    // Floats
-
-    static int mismatch(float[] a,
-                        float[] b,
-                        int length) {
-        return mismatch(a, 0, b, 0, length);
-    }
-
-    static int mismatch(float[] a, int aFromIndex,
-                        float[] b, int bFromIndex,
-                        int length) {
-        int i = 0;
-        if (length > 1) {
-            int aOffset = Unsafe.ARRAY_FLOAT_BASE_OFFSET + (aFromIndex << LOG2_ARRAY_FLOAT_INDEX_SCALE);
-            int bOffset = Unsafe.ARRAY_FLOAT_BASE_OFFSET + (bFromIndex << LOG2_ARRAY_FLOAT_INDEX_SCALE);
-            i = vectorizedMismatch(
-                    a, aOffset,
-                    b, bOffset,
-                    length, LOG2_ARRAY_FLOAT_INDEX_SCALE);
-            // Mismatched
-            if (i >= 0) {
-                // Check if mismatch is not associated with two NaN values
-                if (!Float.isNaN(a[aFromIndex + i]) || !Float.isNaN(b[bFromIndex + i]))
-                    return i;
-
-                // Mismatch on two different NaN values that are normalized to match
-                // Fall back to slow mechanism
-                // ISSUE: Consider looping over vectorizedMismatch adjusting ranges
-                // However, requires that returned value be relative to input ranges
-                i++;
-            }
-            // Matched
-            else {
-                i = length - ~i;
-            }
-        }
-        for (; i < length; i++) {
-            if (Float.floatToIntBits(a[aFromIndex + i]) != Float.floatToIntBits(b[bFromIndex + i]))
-                return i;
-        }
-        return -1;
-    }
-
-    // 64 bit sizes
-
-    // Long
-
-    static int mismatch(long[] a,
-                        long[] b,
-                        int length) {
-        if (length == 0) {
-            return -1;
-        }
-        int i = vectorizedMismatch(
-                a, Unsafe.ARRAY_LONG_BASE_OFFSET,
-                b, Unsafe.ARRAY_LONG_BASE_OFFSET,
-                length, LOG2_ARRAY_LONG_INDEX_SCALE);
-        return i >= 0 ? i : -1;
-    }
-
-    static int mismatch(long[] a, int aFromIndex,
-                        long[] b, int bFromIndex,
-                        int length) {
-        if (length == 0) {
-            return -1;
-        }
-        int aOffset = Unsafe.ARRAY_LONG_BASE_OFFSET + (aFromIndex << LOG2_ARRAY_LONG_INDEX_SCALE);
-        int bOffset = Unsafe.ARRAY_LONG_BASE_OFFSET + (bFromIndex << LOG2_ARRAY_LONG_INDEX_SCALE);
-        int i = vectorizedMismatch(
-                a, aOffset,
-                b, bOffset,
-                length, LOG2_ARRAY_LONG_INDEX_SCALE);
-        return i >= 0 ? i : -1;
-    }
-
-
-    // Double
-
-    static int mismatch(double[] a,
-                        double[] b,
-                        int length) {
-        return mismatch(a, 0, b, 0, length);
-    }
-
-    static int mismatch(double[] a, int aFromIndex,
-                        double[] b, int bFromIndex,
-                        int length) {
-        if (length == 0) {
-            return -1;
-        }
-        int aOffset = Unsafe.ARRAY_DOUBLE_BASE_OFFSET + (aFromIndex << LOG2_ARRAY_DOUBLE_INDEX_SCALE);
-        int bOffset = Unsafe.ARRAY_DOUBLE_BASE_OFFSET + (bFromIndex << LOG2_ARRAY_DOUBLE_INDEX_SCALE);
-        int i = vectorizedMismatch(
-                a, aOffset,
-                b, bOffset,
-                length, LOG2_ARRAY_DOUBLE_INDEX_SCALE);
-        if (i >= 0) {
-            // Check if mismatch is not associated with two NaN values
-            if (!Double.isNaN(a[aFromIndex + i]) || !Double.isNaN(b[bFromIndex + i]))
-                return i;
-
-            // Mismatch on two different NaN values that are normalized to match
-            // Fall back to slow mechanism
-            // ISSUE: Consider looping over vectorizedMismatch adjusting ranges
-            // However, requires that returned value be relative to input ranges
-            i++;
-            for (; i < length; i++) {
-                if (Double.doubleToLongBits(a[aFromIndex + i]) != Double.doubleToLongBits(b[bFromIndex + i]))
-                    return i;
-            }
-        }
-
-        return -1;
-    }
-}
--- a/src/java.base/share/classes/jdk/internal/module/ModuleInfo.java	Thu Dec 14 22:06:19 2017 +0100
+++ b/src/java.base/share/classes/jdk/internal/module/ModuleInfo.java	Thu Dec 21 22:05:28 2017 +0100
@@ -64,7 +64,7 @@
 public final class ModuleInfo {
 
     private final int JAVA_MIN_SUPPORTED_VERSION = 53;
-    private final int JAVA_MAX_SUPPORTED_VERSION = 54;
+    private final int JAVA_MAX_SUPPORTED_VERSION = 55;
 
     private static final JavaLangModuleAccess JLMA
         = SharedSecrets.getJavaLangModuleAccess();
--- a/src/java.base/share/classes/jdk/internal/org/objectweb/asm/ClassReader.java	Thu Dec 14 22:06:19 2017 +0100
+++ b/src/java.base/share/classes/jdk/internal/org/objectweb/asm/ClassReader.java	Thu Dec 21 22:05:28 2017 +0100
@@ -185,7 +185,7 @@
     public ClassReader(final byte[] b, final int off, final int len) {
         this.b = b;
         // checks the class version
-        if (readShort(off + 6) > Opcodes.V10) {
+        if (readShort(off + 6) > Opcodes.V11) {
             throw new IllegalArgumentException();
         }
         // parses the constant pool
--- a/src/java.base/share/classes/jdk/internal/org/objectweb/asm/Opcodes.java	Thu Dec 14 22:06:19 2017 +0100
+++ b/src/java.base/share/classes/jdk/internal/org/objectweb/asm/Opcodes.java	Thu Dec 21 22:05:28 2017 +0100
@@ -90,6 +90,7 @@
     int V1_8 = 0 << 16 | 52;
     int V9 = 0 << 16 | 53;
     int V10 = 0 << 16 | 54;
+    int V11 = 0 << 16 | 55;
 
     // access flags
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/java.base/share/classes/jdk/internal/util/ArraysSupport.java	Thu Dec 21 22:05:28 2017 +0100
@@ -0,0 +1,545 @@
+/*
+ * Copyright (c) 2015, 2017 Oracle and/or its affiliates. All rights reserved.
+ * 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 jdk.internal.util;
+
+import jdk.internal.HotSpotIntrinsicCandidate;
+import jdk.internal.misc.Unsafe;
+
+/**
+ * Utility methods to find a mismatch between two primitive arrays.
+ *
+ * <p>Array equality and lexicographical comparison can be built on top of
+ * array mismatch functionality.
+ *
+ * <p>The mismatch method implementation, {@link #vectorizedMismatch}, leverages
+ * vector-based techniques to access and compare the contents of two arrays.
+ * The Java implementation uses {@code Unsafe.getLongUnaligned} to access the
+ * content of an array, thus access is supported on platforms that do not
+ * support unaligned access.  For a byte[] array, 8 bytes (64 bits) can be
+ * accessed and compared as a unit rather than individually, which increases
+ * the performance when the method is compiled by the HotSpot VM.  On supported
+ * platforms the mismatch implementation is intrinsified to leverage SIMD
+ * instructions.  So for a byte[] array, 16 bytes (128 bits), 32 bytes
+ * (256 bits), and perhaps in the future even 64 bytes (512 bits), platform
+ * permitting, can be accessed and compared as a unit, which further increases
+ * the performance over the Java implementation.
+ *
+ * <p>None of the mismatch methods perform array bounds checks.  It is the
+ * responsibility of the caller (direct or otherwise) to perform such checks
+ * before calling this method.
+ */
+public class ArraysSupport {
+    static final Unsafe U = Unsafe.getUnsafe();
+
+    private static final boolean BIG_ENDIAN = U.isBigEndian();
+
+    public static final int LOG2_ARRAY_BOOLEAN_INDEX_SCALE = exactLog2(Unsafe.ARRAY_BOOLEAN_INDEX_SCALE);
+    public static final int LOG2_ARRAY_BYTE_INDEX_SCALE = exactLog2(Unsafe.ARRAY_BYTE_INDEX_SCALE);
+    public static final int LOG2_ARRAY_CHAR_INDEX_SCALE = exactLog2(Unsafe.ARRAY_CHAR_INDEX_SCALE);
+    public static final int LOG2_ARRAY_SHORT_INDEX_SCALE = exactLog2(Unsafe.ARRAY_SHORT_INDEX_SCALE);
+    public static final int LOG2_ARRAY_INT_INDEX_SCALE = exactLog2(Unsafe.ARRAY_INT_INDEX_SCALE);
+    public static final int LOG2_ARRAY_LONG_INDEX_SCALE = exactLog2(Unsafe.ARRAY_LONG_INDEX_SCALE);
+    public static final int LOG2_ARRAY_FLOAT_INDEX_SCALE = exactLog2(Unsafe.ARRAY_FLOAT_INDEX_SCALE);
+    public static final int LOG2_ARRAY_DOUBLE_INDEX_SCALE = exactLog2(Unsafe.ARRAY_DOUBLE_INDEX_SCALE);
+
+    private static final int LOG2_BYTE_BIT_SIZE = exactLog2(Byte.SIZE);
+
+    private static int exactLog2(int scale) {
+        if ((scale & (scale - 1)) != 0)
+            throw new Error("data type scale not a power of two");
+        return Integer.numberOfTrailingZeros(scale);
+    }
+
+    private ArraysSupport() {}
+
+    /**
+     * Find the relative index of the first mismatching pair of elements in two
+     * primitive arrays of the same component type.  Pairs of elements will be
+     * tested in order relative to given offsets into both arrays.
+     *
+     * <p>This method does not perform type checks or bounds checks.  It is the
+     * responsibility of the caller to perform such checks before calling this
+     * method.
+     *
+     * <p>The given offsets, in bytes, need not be aligned according to the
+     * given log<sub>2</sub> size the array elements.  More specifically, an
+     * offset modulus the size need not be zero.
+     *
+     * @param a the first array to be tested for mismatch, or {@code null} for
+     * direct memory access
+     * @param aOffset the relative offset, in bytes, from the base address of
+     * the first array to test from, otherwise if the first array is
+     * {@code null}, an absolute address pointing to the first element to test.
+     * @param b the second array to be tested for mismatch, or {@code null} for
+     * direct memory access
+     * @param bOffset the relative offset, in bytes, from the base address of
+     * the second array to test from, otherwise if the second array is
+     * {@code null}, an absolute address pointing to the first element to test.
+     * @param length the number of array elements to test
+     * @param log2ArrayIndexScale log<sub>2</sub> of the array index scale, that
+     * corresponds to the size, in bytes, of an array element.
+     * @return if a mismatch is found a relative index, between 0 (inclusive)
+     * and {@code length} (exclusive), of the first mismatching pair of elements
+     * in the two arrays.  Otherwise, if a mismatch is not found the bitwise
+     * compliment of the number of remaining pairs of elements to be checked in
+     * the tail of the two arrays.
+     */
+    @HotSpotIntrinsicCandidate
+    public static int vectorizedMismatch(Object a, long aOffset,
+                                         Object b, long bOffset,
+                                         int length,
+                                         int log2ArrayIndexScale) {
+        // assert a.getClass().isArray();
+        // assert b.getClass().isArray();
+        // assert 0 <= length <= sizeOf(a)
+        // assert 0 <= length <= sizeOf(b)
+        // assert 0 <= log2ArrayIndexScale <= 3
+
+        int log2ValuesPerWidth = LOG2_ARRAY_LONG_INDEX_SCALE - log2ArrayIndexScale;
+        int wi = 0;
+        for (; wi < length >> log2ValuesPerWidth; wi++) {
+            long bi = ((long) wi) << LOG2_ARRAY_LONG_INDEX_SCALE;
+            long av = U.getLongUnaligned(a, aOffset + bi);
+            long bv = U.getLongUnaligned(b, bOffset + bi);
+            if (av != bv) {
+                long x = av ^ bv;
+                int o = BIG_ENDIAN
+                        ? Long.numberOfLeadingZeros(x) >> (LOG2_BYTE_BIT_SIZE + log2ArrayIndexScale)
+                        : Long.numberOfTrailingZeros(x) >> (LOG2_BYTE_BIT_SIZE + log2ArrayIndexScale);
+                return (wi << log2ValuesPerWidth) + o;
+            }
+        }
+
+        // Calculate the tail of remaining elements to check
+        int tail = length - (wi << log2ValuesPerWidth);
+
+        if (log2ArrayIndexScale < LOG2_ARRAY_INT_INDEX_SCALE) {
+            int wordTail = 1 << (LOG2_ARRAY_INT_INDEX_SCALE - log2ArrayIndexScale);
+            // Handle 4 bytes or 2 chars in the tail using int width
+            if (tail >= wordTail) {
+                long bi = ((long) wi) << LOG2_ARRAY_LONG_INDEX_SCALE;
+                int av = U.getIntUnaligned(a, aOffset + bi);
+                int bv = U.getIntUnaligned(b, bOffset + bi);
+                if (av != bv) {
+                    int x = av ^ bv;
+                    int o = BIG_ENDIAN
+                            ? Integer.numberOfLeadingZeros(x) >> (LOG2_BYTE_BIT_SIZE + log2ArrayIndexScale)
+                            : Integer.numberOfTrailingZeros(x) >> (LOG2_BYTE_BIT_SIZE + log2ArrayIndexScale);
+                    return (wi << log2ValuesPerWidth) + o;
+                }
+                tail -= wordTail;
+            }
+            return ~tail;
+        }
+        else {
+            return ~tail;
+        }
+    }
+
+    // Booleans
+    // Each boolean element takes up one byte
+
+    public static int mismatch(boolean[] a,
+                               boolean[] b,
+                               int length) {
+        int i = 0;
+        if (length > 7) {
+            i = vectorizedMismatch(
+                    a, Unsafe.ARRAY_BOOLEAN_BASE_OFFSET,
+                    b, Unsafe.ARRAY_BOOLEAN_BASE_OFFSET,
+                    length, LOG2_ARRAY_BOOLEAN_INDEX_SCALE);
+            if (i >= 0)
+                return i;
+            i = length - ~i;
+        }
+        for (; i < length; i++) {
+            if (a[i] != b[i])
+                return i;
+        }
+        return -1;
+    }
+
+    public static int mismatch(boolean[] a, int aFromIndex,
+                               boolean[] b, int bFromIndex,
+                               int length) {
+        int i = 0;
+        if (length > 7) {
+            int aOffset = Unsafe.ARRAY_BOOLEAN_BASE_OFFSET + aFromIndex;
+            int bOffset = Unsafe.ARRAY_BOOLEAN_BASE_OFFSET + bFromIndex;
+            i = vectorizedMismatch(
+                    a, aOffset,
+                    b, bOffset,
+                    length, LOG2_ARRAY_BOOLEAN_INDEX_SCALE);
+            if (i >= 0)
+                return i;
+            i = length - ~i;
+        }
+        for (; i < length; i++) {
+            if (a[aFromIndex + i] != b[bFromIndex + i])
+                return i;
+        }
+        return -1;
+    }
+
+
+    // Bytes
+
+    /**
+     * Find the index of a mismatch between two arrays.
+     *
+     * <p>This method does not perform bounds checks. It is the responsibility
+     * of the caller to perform such bounds checks before calling this method.
+     *
+     * @param a the first array to be tested for a mismatch
+     * @param b the second array to be tested for a mismatch
+     * @param length the number of bytes from each array to check
+     * @return the index of a mismatch between the two arrays, otherwise -1 if
+     * no mismatch.  The index will be within the range of (inclusive) 0 to
+     * (exclusive) the smaller of the two array lengths.
+     */
+    public static int mismatch(byte[] a,
+                               byte[] b,
+                               int length) {
+        // ISSUE: defer to index receiving methods if performance is good
+        // assert length <= a.length
+        // assert length <= b.length
+
+        int i = 0;
+        if (length > 7) {
+            i = vectorizedMismatch(
+                    a, Unsafe.ARRAY_BYTE_BASE_OFFSET,
+                    b, Unsafe.ARRAY_BYTE_BASE_OFFSET,
+                    length, LOG2_ARRAY_BYTE_INDEX_SCALE);
+            if (i >= 0)
+                return i;
+            // Align to tail
+            i = length - ~i;
+//            assert i >= 0 && i <= 7;
+        }
+        // Tail < 8 bytes
+        for (; i < length; i++) {
+            if (a[i] != b[i])
+                return i;
+        }
+        return -1;
+    }
+
+    /**
+     * Find the relative index of a mismatch between two arrays starting from
+     * given indexes.
+     *
+     * <p>This method does not perform bounds checks. It is the responsibility
+     * of the caller to perform such bounds checks before calling this method.
+     *
+     * @param a the first array to be tested for a mismatch
+     * @param aFromIndex the index of the first element (inclusive) in the first
+     * array to be compared
+     * @param b the second array to be tested for a mismatch
+     * @param bFromIndex the index of the first element (inclusive) in the
+     * second array to be compared
+     * @param length the number of bytes from each array to check
+     * @return the relative index of a mismatch between the two arrays,
+     * otherwise -1 if no mismatch.  The index will be within the range of
+     * (inclusive) 0 to (exclusive) the smaller of the two array bounds.
+     */
+    public static int mismatch(byte[] a, int aFromIndex,
+                               byte[] b, int bFromIndex,
+                               int length) {
+        // assert 0 <= aFromIndex < a.length
+        // assert 0 <= aFromIndex + length <= a.length
+        // assert 0 <= bFromIndex < b.length
+        // assert 0 <= bFromIndex + length <= b.length
+        // assert length >= 0
+
+        int i = 0;
+        if (length > 7) {
+            int aOffset = Unsafe.ARRAY_BYTE_BASE_OFFSET + aFromIndex;
+            int bOffset = Unsafe.ARRAY_BYTE_BASE_OFFSET + bFromIndex;
+            i = vectorizedMismatch(
+                    a, aOffset,
+                    b, bOffset,
+                    length, LOG2_ARRAY_BYTE_INDEX_SCALE);
+            if (i >= 0)
+                return i;
+            i = length - ~i;
+        }
+        for (; i < length; i++) {
+            if (a[aFromIndex + i] != b[bFromIndex + i])
+                return i;
+        }
+        return -1;
+    }
+
+
+    // Chars
+
+    public static int mismatch(char[] a,
+                               char[] b,
+                               int length) {
+        int i = 0;
+        if (length > 3) {
+            i = vectorizedMismatch(
+                    a, Unsafe.ARRAY_CHAR_BASE_OFFSET,
+                    b, Unsafe.ARRAY_CHAR_BASE_OFFSET,
+                    length, LOG2_ARRAY_CHAR_INDEX_SCALE);
+            if (i >= 0)
+                return i;
+            i = length - ~i;
+        }
+        for (; i < length; i++) {
+            if (a[i] != b[i])
+                return i;
+        }
+        return -1;
+    }
+
+    public static int mismatch(char[] a, int aFromIndex,
+                               char[] b, int bFromIndex,
+                               int length) {
+        int i = 0;
+        if (length > 3) {
+            int aOffset = Unsafe.ARRAY_CHAR_BASE_OFFSET + (aFromIndex << LOG2_ARRAY_CHAR_INDEX_SCALE);
+            int bOffset = Unsafe.ARRAY_CHAR_BASE_OFFSET + (bFromIndex << LOG2_ARRAY_CHAR_INDEX_SCALE);
+            i = vectorizedMismatch(
+                    a, aOffset,
+                    b, bOffset,
+                    length, LOG2_ARRAY_CHAR_INDEX_SCALE);
+            if (i >= 0)
+                return i;
+            i = length - ~i;
+        }
+        for (; i < length; i++) {
+            if (a[aFromIndex + i] != b[bFromIndex + i])
+                return i;
+        }
+        return -1;
+    }
+
+
+    // Shorts
+
+    public static int mismatch(short[] a,
+                               short[] b,
+                               int length) {
+        int i = 0;
+        if (length > 3) {
+            i = vectorizedMismatch(
+                    a, Unsafe.ARRAY_SHORT_BASE_OFFSET,
+                    b, Unsafe.ARRAY_SHORT_BASE_OFFSET,
+                    length, LOG2_ARRAY_SHORT_INDEX_SCALE);
+            if (i >= 0)
+                return i;
+            i = length - ~i;
+        }
+        for (; i < length; i++) {
+            if (a[i] != b[i])
+                return i;
+        }
+        return -1;
+    }
+
+    public static int mismatch(short[] a, int aFromIndex,
+                               short[] b, int bFromIndex,
+                               int length) {
+        int i = 0;
+        if (length > 3) {
+            int aOffset = Unsafe.ARRAY_SHORT_BASE_OFFSET + (aFromIndex << LOG2_ARRAY_SHORT_INDEX_SCALE);
+            int bOffset = Unsafe.ARRAY_SHORT_BASE_OFFSET + (bFromIndex << LOG2_ARRAY_SHORT_INDEX_SCALE);
+            i = vectorizedMismatch(
+                    a, aOffset,
+                    b, bOffset,
+                    length, LOG2_ARRAY_SHORT_INDEX_SCALE);
+            if (i >= 0)
+                return i;
+            i = length - ~i;
+        }
+        for (; i < length; i++) {
+            if (a[aFromIndex + i] != b[bFromIndex + i])
+                return i;
+        }
+        return -1;
+    }
+
+
+    // Ints
+
+    public static int mismatch(int[] a,
+                               int[] b,
+                               int length) {
+        int i = 0;
+        if (length > 1) {
+            i = vectorizedMismatch(
+                    a, Unsafe.ARRAY_INT_BASE_OFFSET,
+                    b, Unsafe.ARRAY_INT_BASE_OFFSET,
+                    length, LOG2_ARRAY_INT_INDEX_SCALE);
+            if (i >= 0)
+                return i;
+            i = length - ~i;
+        }
+        for (; i < length; i++) {
+            if (a[i] != b[i])
+                return i;
+        }
+        return -1;
+    }
+
+    public static int mismatch(int[] a, int aFromIndex,
+                               int[] b, int bFromIndex,
+                               int length) {
+        int i = 0;
+        if (length > 1) {
+            int aOffset = Unsafe.ARRAY_INT_BASE_OFFSET + (aFromIndex << LOG2_ARRAY_INT_INDEX_SCALE);
+            int bOffset = Unsafe.ARRAY_INT_BASE_OFFSET + (bFromIndex << LOG2_ARRAY_INT_INDEX_SCALE);
+            i = vectorizedMismatch(
+                    a, aOffset,
+                    b, bOffset,
+                    length, LOG2_ARRAY_INT_INDEX_SCALE);
+            if (i >= 0)
+                return i;
+            i = length - ~i;
+        }
+        for (; i < length; i++) {
+            if (a[aFromIndex + i] != b[bFromIndex + i])
+                return i;
+        }
+        return -1;
+    }
+
+
+    // Floats
+
+    public static int mismatch(float[] a,
+                               float[] b,
+                               int length) {
+        return mismatch(a, 0, b, 0, length);
+    }
+
+    public static int mismatch(float[] a, int aFromIndex,
+                               float[] b, int bFromIndex,
+                               int length) {
+        int i = 0;
+        if (length > 1) {
+            int aOffset = Unsafe.ARRAY_FLOAT_BASE_OFFSET + (aFromIndex << LOG2_ARRAY_FLOAT_INDEX_SCALE);
+            int bOffset = Unsafe.ARRAY_FLOAT_BASE_OFFSET + (bFromIndex << LOG2_ARRAY_FLOAT_INDEX_SCALE);
+            i = vectorizedMismatch(
+                    a, aOffset,
+                    b, bOffset,
+                    length, LOG2_ARRAY_FLOAT_INDEX_SCALE);
+            // Mismatched
+            if (i >= 0) {
+                // Check if mismatch is not associated with two NaN values
+                if (!Float.isNaN(a[aFromIndex + i]) || !Float.isNaN(b[bFromIndex + i]))
+                    return i;
+
+                // Mismatch on two different NaN values that are normalized to match
+                // Fall back to slow mechanism
+                // ISSUE: Consider looping over vectorizedMismatch adjusting ranges
+                // However, requires that returned value be relative to input ranges
+                i++;
+            }
+            // Matched
+            else {
+                i = length - ~i;
+            }
+        }
+        for (; i < length; i++) {
+            if (Float.floatToIntBits(a[aFromIndex + i]) != Float.floatToIntBits(b[bFromIndex + i]))
+                return i;
+        }
+        return -1;
+    }
+
+    // 64 bit sizes
+
+    // Long
+
+    public static int mismatch(long[] a,
+                               long[] b,
+                               int length) {
+        if (length == 0) {
+            return -1;
+        }
+        int i = vectorizedMismatch(
+                a, Unsafe.ARRAY_LONG_BASE_OFFSET,
+                b, Unsafe.ARRAY_LONG_BASE_OFFSET,
+                length, LOG2_ARRAY_LONG_INDEX_SCALE);
+        return i >= 0 ? i : -1;
+    }
+
+    public static int mismatch(long[] a, int aFromIndex,
+                               long[] b, int bFromIndex,
+                               int length) {
+        if (length == 0) {
+            return -1;
+        }
+        int aOffset = Unsafe.ARRAY_LONG_BASE_OFFSET + (aFromIndex << LOG2_ARRAY_LONG_INDEX_SCALE);
+        int bOffset = Unsafe.ARRAY_LONG_BASE_OFFSET + (bFromIndex << LOG2_ARRAY_LONG_INDEX_SCALE);
+        int i = vectorizedMismatch(
+                a, aOffset,
+                b, bOffset,
+                length, LOG2_ARRAY_LONG_INDEX_SCALE);
+        return i >= 0 ? i : -1;
+    }
+
+
+    // Double
+
+    public static int mismatch(double[] a,
+                               double[] b,
+                               int length) {
+        return mismatch(a, 0, b, 0, length);
+    }
+
+    public static int mismatch(double[] a, int aFromIndex,
+                               double[] b, int bFromIndex,
+                               int length) {
+        if (length == 0) {
+            return -1;
+        }
+        int aOffset = Unsafe.ARRAY_DOUBLE_BASE_OFFSET + (aFromIndex << LOG2_ARRAY_DOUBLE_INDEX_SCALE);
+        int bOffset = Unsafe.ARRAY_DOUBLE_BASE_OFFSET + (bFromIndex << LOG2_ARRAY_DOUBLE_INDEX_SCALE);
+        int i = vectorizedMismatch(
+                a, aOffset,
+                b, bOffset,
+                length, LOG2_ARRAY_DOUBLE_INDEX_SCALE);
+        if (i >= 0) {
+            // Check if mismatch is not associated with two NaN values
+            if (!Double.isNaN(a[aFromIndex + i]) || !Double.isNaN(b[bFromIndex + i]))
+                return i;
+
+            // Mismatch on two different NaN values that are normalized to match
+            // Fall back to slow mechanism
+            // ISSUE: Consider looping over vectorizedMismatch adjusting ranges
+            // However, requires that returned value be relative to input ranges
+            i++;
+            for (; i < length; i++) {
+                if (Double.doubleToLongBits(a[aFromIndex + i]) != Double.doubleToLongBits(b[bFromIndex + i]))
+                    return i;
+            }
+        }
+
+        return -1;
+    }
+}
--- a/src/java.base/share/classes/sun/security/ssl/HandshakeHash.java	Thu Dec 14 22:06:19 2017 +0100
+++ b/src/java.base/share/classes/sun/security/ssl/HandshakeHash.java	Thu Dec 21 22:05:28 2017 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2017, Oracle and/or its affiliates. All rights reserved.
  * 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,7 +108,29 @@
      * a hash for the certificate verify message is required.
      */
     HandshakeHash(boolean needCertificateVerify) {
-        clonesNeeded = needCertificateVerify ? 4 : 3;
+        // We may rework the code later, but for now we use hard-coded number
+        // of clones if the underlying MessageDigests are not cloneable.
+        //
+        // The number used here is based on the current handshake protocols and
+        // implementation.  It may be changed if the handshake processe gets
+        // changed in the future, for example adding a new extension that
+        // requires handshake hash.  Please be careful about the number of
+        // clones if additional handshak hash is required in the future.
+        //
+        // For the current implementation, the handshake hash is required for
+        // the following items:
+        //     . CertificateVerify handshake message (optional)
+        //     . client Finished handshake message
+        //     . server Finished Handshake message
+        //     . the extended Master Secret extension [RFC 7627]
+        //
+        // Note that a late call to server setNeedClientAuth dose not update
+        // the number of clones.  We may address the issue later.
+        //
+        // Note for safety, we allocate one more clone for the current
+        // implementation.  We may consider it more carefully in the future
+        // for the exact number or rework the code in a different way.
+        clonesNeeded = needCertificateVerify ? 5 : 4;
     }
 
     void reserve(ByteBuffer input) {
@@ -335,7 +357,8 @@
         if (finMD != null) return;
 
         try {
-            finMD = CloneableDigest.getDigest(normalizeAlgName(s), 2);
+            // See comment in the contructor.
+            finMD = CloneableDigest.getDigest(normalizeAlgName(s), 4);
         } catch (NoSuchAlgorithmException e) {
             throw new Error(e);
         }
--- a/src/java.base/share/native/include/classfile_constants.h	Thu Dec 14 22:06:19 2017 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,581 +0,0 @@
-/*
- * Copyright (c) 2004, 2016, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * 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.
- */
-
-#ifndef CLASSFILE_CONSTANTS_H
-#define CLASSFILE_CONSTANTS_H
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/* Classfile version number for this information */
-#define JVM_CLASSFILE_MAJOR_VERSION 54
-#define JVM_CLASSFILE_MINOR_VERSION 0
-
-/* Flags */
-
-enum {
-    JVM_ACC_PUBLIC        = 0x0001,
-    JVM_ACC_PRIVATE       = 0x0002,
-    JVM_ACC_PROTECTED     = 0x0004,
-    JVM_ACC_STATIC        = 0x0008,
-    JVM_ACC_FINAL         = 0x0010,
-    JVM_ACC_SYNCHRONIZED  = 0x0020,
-    JVM_ACC_SUPER         = 0x0020,
-    JVM_ACC_VOLATILE      = 0x0040,
-    JVM_ACC_BRIDGE        = 0x0040,
-    JVM_ACC_TRANSIENT     = 0x0080,
-    JVM_ACC_VARARGS       = 0x0080,
-    JVM_ACC_NATIVE        = 0x0100,
-    JVM_ACC_INTERFACE     = 0x0200,
-    JVM_ACC_ABSTRACT      = 0x0400,
-    JVM_ACC_STRICT        = 0x0800,
-    JVM_ACC_SYNTHETIC     = 0x1000,
-    JVM_ACC_ANNOTATION    = 0x2000,
-    JVM_ACC_ENUM          = 0x4000,
-    JVM_ACC_MODULE        = 0x8000
-};
-
-#define JVM_ACC_PUBLIC_BIT        0
-#define JVM_ACC_PRIVATE_BIT       1
-#define JVM_ACC_PROTECTED_BIT     2
-#define JVM_ACC_STATIC_BIT        3
-#define JVM_ACC_FINAL_BIT         4
-#define JVM_ACC_SYNCHRONIZED_BIT  5
-#define JVM_ACC_SUPER_BIT         5
-#define JVM_ACC_VOLATILE_BIT      6
-#define JVM_ACC_BRIDGE_BIT        6
-#define JVM_ACC_TRANSIENT_BIT     7
-#define JVM_ACC_VARARGS_BIT       7
-#define JVM_ACC_NATIVE_BIT        8
-#define JVM_ACC_INTERFACE_BIT     9
-#define JVM_ACC_ABSTRACT_BIT      10
-#define JVM_ACC_STRICT_BIT        11
-#define JVM_ACC_SYNTHETIC_BIT     12
-#define JVM_ACC_ANNOTATION_BIT    13
-#define JVM_ACC_ENUM_BIT          14
-
-/* Used in newarray instruction. */
-
-enum {
-    JVM_T_BOOLEAN = 4,
-    JVM_T_CHAR    = 5,
-    JVM_T_FLOAT   = 6,
-    JVM_T_DOUBLE  = 7,
-    JVM_T_BYTE    = 8,
-    JVM_T_SHORT   = 9,
-    JVM_T_INT     = 10,
-    JVM_T_LONG    = 11
-};
-
-/* Constant Pool Entries */
-
-enum {
-    JVM_CONSTANT_Utf8                   = 1,
-    JVM_CONSTANT_Unicode                = 2, /* unused */
-    JVM_CONSTANT_Integer                = 3,
-    JVM_CONSTANT_Float                  = 4,
-    JVM_CONSTANT_Long                   = 5,
-    JVM_CONSTANT_Double                 = 6,
-    JVM_CONSTANT_Class                  = 7,
-    JVM_CONSTANT_String                 = 8,
-    JVM_CONSTANT_Fieldref               = 9,
-    JVM_CONSTANT_Methodref              = 10,
-    JVM_CONSTANT_InterfaceMethodref     = 11,
-    JVM_CONSTANT_NameAndType            = 12,
-    JVM_CONSTANT_MethodHandle           = 15,  // JSR 292
-    JVM_CONSTANT_MethodType             = 16,  // JSR 292
-    JVM_CONSTANT_InvokeDynamic          = 18,
-    JVM_CONSTANT_ExternalMax            = 18
-};
-
-/* JVM_CONSTANT_MethodHandle subtypes */
-enum {
-    JVM_REF_getField                = 1,
-    JVM_REF_getStatic               = 2,
-    JVM_REF_putField                = 3,
-    JVM_REF_putStatic               = 4,
-    JVM_REF_invokeVirtual           = 5,
-    JVM_REF_invokeStatic            = 6,
-    JVM_REF_invokeSpecial           = 7,
-    JVM_REF_newInvokeSpecial        = 8,
-    JVM_REF_invokeInterface         = 9
-};
-
-/* StackMapTable type item numbers */
-
-enum {
-    JVM_ITEM_Top                = 0,
-    JVM_ITEM_Integer            = 1,
-    JVM_ITEM_Float              = 2,
-    JVM_ITEM_Double             = 3,
-    JVM_ITEM_Long               = 4,
-    JVM_ITEM_Null               = 5,
-    JVM_ITEM_UninitializedThis  = 6,
-    JVM_ITEM_Object             = 7,
-    JVM_ITEM_Uninitialized      = 8
-};
-
-/* Type signatures */
-
-enum {
-    JVM_SIGNATURE_ARRAY         = '[',
-    JVM_SIGNATURE_BYTE          = 'B',
-    JVM_SIGNATURE_CHAR          = 'C',
-    JVM_SIGNATURE_CLASS         = 'L',
-    JVM_SIGNATURE_ENDCLASS      = ';',
-    JVM_SIGNATURE_ENUM          = 'E',
-    JVM_SIGNATURE_FLOAT         = 'F',
-    JVM_SIGNATURE_DOUBLE        = 'D',
-    JVM_SIGNATURE_FUNC          = '(',
-    JVM_SIGNATURE_ENDFUNC       = ')',
-    JVM_SIGNATURE_INT           = 'I',
-    JVM_SIGNATURE_LONG          = 'J',
-    JVM_SIGNATURE_SHORT         = 'S',
-    JVM_SIGNATURE_VOID          = 'V',
-    JVM_SIGNATURE_BOOLEAN       = 'Z'
-};
-
-/* Opcodes */
-
-enum {
-    JVM_OPC_nop                 = 0,
-    JVM_OPC_aconst_null         = 1,
-    JVM_OPC_iconst_m1           = 2,
-    JVM_OPC_iconst_0            = 3,
-    JVM_OPC_iconst_1            = 4,
-    JVM_OPC_iconst_2            = 5,
-    JVM_OPC_iconst_3            = 6,
-    JVM_OPC_iconst_4            = 7,
-    JVM_OPC_iconst_5            = 8,
-    JVM_OPC_lconst_0            = 9,
-    JVM_OPC_lconst_1            = 10,
-    JVM_OPC_fconst_0            = 11,
-    JVM_OPC_fconst_1            = 12,
-    JVM_OPC_fconst_2            = 13,
-    JVM_OPC_dconst_0            = 14,
-    JVM_OPC_dconst_1            = 15,
-    JVM_OPC_bipush              = 16,
-    JVM_OPC_sipush              = 17,
-    JVM_OPC_ldc                 = 18,
-    JVM_OPC_ldc_w               = 19,
-    JVM_OPC_ldc2_w              = 20,
-    JVM_OPC_iload               = 21,
-    JVM_OPC_lload               = 22,
-    JVM_OPC_fload               = 23,
-    JVM_OPC_dload               = 24,
-    JVM_OPC_aload               = 25,
-    JVM_OPC_iload_0             = 26,
-    JVM_OPC_iload_1             = 27,
-    JVM_OPC_iload_2             = 28,
-    JVM_OPC_iload_3             = 29,
-    JVM_OPC_lload_0             = 30,
-    JVM_OPC_lload_1             = 31,
-    JVM_OPC_lload_2             = 32,
-    JVM_OPC_lload_3             = 33,
-    JVM_OPC_fload_0             = 34,
-    JVM_OPC_fload_1             = 35,
-    JVM_OPC_fload_2             = 36,
-    JVM_OPC_fload_3             = 37,
-    JVM_OPC_dload_0             = 38,
-    JVM_OPC_dload_1             = 39,
-    JVM_OPC_dload_2             = 40,
-    JVM_OPC_dload_3             = 41,
-    JVM_OPC_aload_0             = 42,
-    JVM_OPC_aload_1             = 43,
-    JVM_OPC_aload_2             = 44,
-    JVM_OPC_aload_3             = 45,
-    JVM_OPC_iaload              = 46,
-    JVM_OPC_laload              = 47,
-    JVM_OPC_faload              = 48,
-    JVM_OPC_daload              = 49,
-    JVM_OPC_aaload              = 50,
-    JVM_OPC_baload              = 51,
-    JVM_OPC_caload              = 52,
-    JVM_OPC_saload              = 53,
-    JVM_OPC_istore              = 54,
-    JVM_OPC_lstore              = 55,
-    JVM_OPC_fstore              = 56,
-    JVM_OPC_dstore              = 57,
-    JVM_OPC_astore              = 58,
-    JVM_OPC_istore_0            = 59,
-    JVM_OPC_istore_1            = 60,
-    JVM_OPC_istore_2            = 61,
-    JVM_OPC_istore_3            = 62,
-    JVM_OPC_lstore_0            = 63,
-    JVM_OPC_lstore_1            = 64,
-    JVM_OPC_lstore_2            = 65,
-    JVM_OPC_lstore_3            = 66,
-    JVM_OPC_fstore_0            = 67,
-    JVM_OPC_fstore_1            = 68,
-    JVM_OPC_fstore_2            = 69,
-    JVM_OPC_fstore_3            = 70,
-    JVM_OPC_dstore_0            = 71,
-    JVM_OPC_dstore_1            = 72,
-    JVM_OPC_dstore_2            = 73,
-    JVM_OPC_dstore_3            = 74,
-    JVM_OPC_astore_0            = 75,
-    JVM_OPC_astore_1            = 76,
-    JVM_OPC_astore_2            = 77,
-    JVM_OPC_astore_3            = 78,
-    JVM_OPC_iastore             = 79,
-    JVM_OPC_lastore             = 80,
-    JVM_OPC_fastore             = 81,
-    JVM_OPC_dastore             = 82,
-    JVM_OPC_aastore             = 83,
-    JVM_OPC_bastore             = 84,
-    JVM_OPC_castore             = 85,
-    JVM_OPC_sastore             = 86,
-    JVM_OPC_pop                 = 87,
-    JVM_OPC_pop2                = 88,
-    JVM_OPC_dup                 = 89,
-    JVM_OPC_dup_x1              = 90,
-    JVM_OPC_dup_x2              = 91,
-    JVM_OPC_dup2                = 92,
-    JVM_OPC_dup2_x1             = 93,
-    JVM_OPC_dup2_x2             = 94,
-    JVM_OPC_swap                = 95,
-    JVM_OPC_iadd                = 96,
-    JVM_OPC_ladd                = 97,
-    JVM_OPC_fadd                = 98,
-    JVM_OPC_dadd                = 99,
-    JVM_OPC_isub                = 100,
-    JVM_OPC_lsub                = 101,
-    JVM_OPC_fsub                = 102,
-    JVM_OPC_dsub                = 103,
-    JVM_OPC_imul                = 104,
-    JVM_OPC_lmul                = 105,
-    JVM_OPC_fmul                = 106,
-    JVM_OPC_dmul                = 107,
-    JVM_OPC_idiv                = 108,
-    JVM_OPC_ldiv                = 109,
-    JVM_OPC_fdiv                = 110,
-    JVM_OPC_ddiv                = 111,
-    JVM_OPC_irem                = 112,
-    JVM_OPC_lrem                = 113,
-    JVM_OPC_frem                = 114,
-    JVM_OPC_drem                = 115,
-    JVM_OPC_ineg                = 116,
-    JVM_OPC_lneg                = 117,
-    JVM_OPC_fneg                = 118,
-    JVM_OPC_dneg                = 119,
-    JVM_OPC_ishl                = 120,
-    JVM_OPC_lshl                = 121,
-    JVM_OPC_ishr                = 122,
-    JVM_OPC_lshr                = 123,
-    JVM_OPC_iushr               = 124,
-    JVM_OPC_lushr               = 125,
-    JVM_OPC_iand                = 126,
-    JVM_OPC_land                = 127,
-    JVM_OPC_ior                 = 128,
-    JVM_OPC_lor                 = 129,
-    JVM_OPC_ixor                = 130,
-    JVM_OPC_lxor                = 131,
-    JVM_OPC_iinc                = 132,
-    JVM_OPC_i2l                 = 133,
-    JVM_OPC_i2f                 = 134,
-    JVM_OPC_i2d                 = 135,
-    JVM_OPC_l2i                 = 136,
-    JVM_OPC_l2f                 = 137,
-    JVM_OPC_l2d                 = 138,
-    JVM_OPC_f2i                 = 139,
-    JVM_OPC_f2l                 = 140,
-    JVM_OPC_f2d                 = 141,
-    JVM_OPC_d2i                 = 142,
-    JVM_OPC_d2l                 = 143,
-    JVM_OPC_d2f                 = 144,
-    JVM_OPC_i2b                 = 145,
-    JVM_OPC_i2c                 = 146,
-    JVM_OPC_i2s                 = 147,
-    JVM_OPC_lcmp                = 148,
-    JVM_OPC_fcmpl               = 149,
-    JVM_OPC_fcmpg               = 150,
-    JVM_OPC_dcmpl               = 151,
-    JVM_OPC_dcmpg               = 152,
-    JVM_OPC_ifeq                = 153,
-    JVM_OPC_ifne                = 154,
-    JVM_OPC_iflt                = 155,
-    JVM_OPC_ifge                = 156,
-    JVM_OPC_ifgt                = 157,
-    JVM_OPC_ifle                = 158,
-    JVM_OPC_if_icmpeq           = 159,
-    JVM_OPC_if_icmpne           = 160,
-    JVM_OPC_if_icmplt           = 161,
-    JVM_OPC_if_icmpge           = 162,
-    JVM_OPC_if_icmpgt           = 163,
-    JVM_OPC_if_icmple           = 164,
-    JVM_OPC_if_acmpeq           = 165,
-    JVM_OPC_if_acmpne           = 166,
-    JVM_OPC_goto                = 167,
-    JVM_OPC_jsr                 = 168,
-    JVM_OPC_ret                 = 169,
-    JVM_OPC_tableswitch         = 170,
-    JVM_OPC_lookupswitch        = 171,
-    JVM_OPC_ireturn             = 172,
-    JVM_OPC_lreturn             = 173,
-    JVM_OPC_freturn             = 174,
-    JVM_OPC_dreturn             = 175,
-    JVM_OPC_areturn             = 176,
-    JVM_OPC_return              = 177,
-    JVM_OPC_getstatic           = 178,
-    JVM_OPC_putstatic           = 179,
-    JVM_OPC_getfield            = 180,
-    JVM_OPC_putfield            = 181,
-    JVM_OPC_invokevirtual       = 182,
-    JVM_OPC_invokespecial       = 183,
-    JVM_OPC_invokestatic        = 184,
-    JVM_OPC_invokeinterface     = 185,
-    JVM_OPC_invokedynamic       = 186,
-    JVM_OPC_new                 = 187,
-    JVM_OPC_newarray            = 188,
-    JVM_OPC_anewarray           = 189,
-    JVM_OPC_arraylength         = 190,
-    JVM_OPC_athrow              = 191,
-    JVM_OPC_checkcast           = 192,
-    JVM_OPC_instanceof          = 193,
-    JVM_OPC_monitorenter        = 194,
-    JVM_OPC_monitorexit         = 195,
-    JVM_OPC_wide                = 196,
-    JVM_OPC_multianewarray      = 197,
-    JVM_OPC_ifnull              = 198,
-    JVM_OPC_ifnonnull           = 199,
-    JVM_OPC_goto_w              = 200,
-    JVM_OPC_jsr_w               = 201,
-    JVM_OPC_MAX                 = 201
-};
-
-/* Opcode length initializer, use with something like:
- *   unsigned char opcode_length[JVM_OPC_MAX+1] = JVM_OPCODE_LENGTH_INITIALIZER;
- */
-#define JVM_OPCODE_LENGTH_INITIALIZER { \
-   1,   /* nop */                       \
-   1,   /* aconst_null */               \
-   1,   /* iconst_m1 */                 \
-   1,   /* iconst_0 */                  \
-   1,   /* iconst_1 */                  \
-   1,   /* iconst_2 */                  \
-   1,   /* iconst_3 */                  \
-   1,   /* iconst_4 */                  \
-   1,   /* iconst_5 */                  \
-   1,   /* lconst_0 */                  \
-   1,   /* lconst_1 */                  \
-   1,   /* fconst_0 */                  \
-   1,   /* fconst_1 */                  \
-   1,   /* fconst_2 */                  \
-   1,   /* dconst_0 */                  \
-   1,   /* dconst_1 */                  \
-   2,   /* bipush */                    \
-   3,   /* sipush */                    \
-   2,   /* ldc */                       \
-   3,   /* ldc_w */                     \
-   3,   /* ldc2_w */                    \
-   2,   /* iload */                     \
-   2,   /* lload */                     \
-   2,   /* fload */                     \
-   2,   /* dload */                     \
-   2,   /* aload */                     \
-   1,   /* iload_0 */                   \
-   1,   /* iload_1 */                   \
-   1,   /* iload_2 */                   \
-   1,   /* iload_3 */                   \
-   1,   /* lload_0 */                   \
-   1,   /* lload_1 */                   \
-   1,   /* lload_2 */                   \
-   1,   /* lload_3 */                   \
-   1,   /* fload_0 */                   \
-   1,   /* fload_1 */                   \
-   1,   /* fload_2 */                   \
-   1,   /* fload_3 */                   \
-   1,   /* dload_0 */                   \
-   1,   /* dload_1 */                   \
-   1,   /* dload_2 */                   \
-   1,   /* dload_3 */                   \
-   1,   /* aload_0 */                   \
-   1,   /* aload_1 */                   \
-   1,   /* aload_2 */                   \
-   1,   /* aload_3 */                   \
-   1,   /* iaload */                    \
-   1,   /* laload */                    \
-   1,   /* faload */                    \
-   1,   /* daload */                    \
-   1,   /* aaload */                    \
-   1,   /* baload */                    \
-   1,   /* caload */                    \
-   1,   /* saload */                    \
-   2,   /* istore */                    \
-   2,   /* lstore */                    \
-   2,   /* fstore */                    \
-   2,   /* dstore */                    \
-   2,   /* astore */                    \
-   1,   /* istore_0 */                  \
-   1,   /* istore_1 */                  \
-   1,   /* istore_2 */                  \
-   1,   /* istore_3 */                  \
-   1,   /* lstore_0 */                  \
-   1,   /* lstore_1 */                  \
-   1,   /* lstore_2 */                  \
-   1,   /* lstore_3 */                  \
-   1,   /* fstore_0 */                  \
-   1,   /* fstore_1 */                  \
-   1,   /* fstore_2 */                  \
-   1,   /* fstore_3 */                  \
-   1,   /* dstore_0 */                  \
-   1,   /* dstore_1 */                  \
-   1,   /* dstore_2 */                  \
-   1,   /* dstore_3 */                  \
-   1,   /* astore_0 */                  \
-   1,   /* astore_1 */                  \
-   1,   /* astore_2 */                  \
-   1,   /* astore_3 */                  \
-   1,   /* iastore */                   \
-   1,   /* lastore */                   \
-   1,   /* fastore */                   \
-   1,   /* dastore */                   \
-   1,   /* aastore */                   \
-   1,   /* bastore */                   \
-   1,   /* castore */                   \
-   1,   /* sastore */                   \
-   1,   /* pop */                       \
-   1,   /* pop2 */                      \
-   1,   /* dup */                       \
-   1,   /* dup_x1 */                    \
-   1,   /* dup_x2 */                    \
-   1,   /* dup2 */                      \
-   1,   /* dup2_x1 */                   \
-   1,   /* dup2_x2 */                   \
-   1,   /* swap */                      \
-   1,   /* iadd */                      \
-   1,   /* ladd */                      \
-   1,   /* fadd */                      \
-   1,   /* dadd */                      \
-   1,   /* isub */                      \
-   1,   /* lsub */                      \
-   1,   /* fsub */                      \
-   1,   /* dsub */                      \
-   1,   /* imul */                      \
-   1,   /* lmul */                      \
-   1,   /* fmul */                      \
-   1,   /* dmul */                      \
-   1,   /* idiv */                      \
-   1,   /* ldiv */                      \
-   1,   /* fdiv */                      \
-   1,   /* ddiv */                      \
-   1,   /* irem */                      \
-   1,   /* lrem */                      \
-   1,   /* frem */                      \
-   1,   /* drem */                      \
-   1,   /* ineg */                      \
-   1,   /* lneg */                      \
-   1,   /* fneg */                      \
-   1,   /* dneg */                      \
-   1,   /* ishl */                      \
-   1,   /* lshl */                      \
-   1,   /* ishr */                      \
-   1,   /* lshr */                      \
-   1,   /* iushr */                     \
-   1,   /* lushr */                     \
-   1,   /* iand */                      \
-   1,   /* land */                      \
-   1,   /* ior */                       \
-   1,   /* lor */                       \
-   1,   /* ixor */                      \
-   1,   /* lxor */                      \
-   3,   /* iinc */                      \
-   1,   /* i2l */                       \
-   1,   /* i2f */                       \
-   1,   /* i2d */                       \
-   1,   /* l2i */                       \
-   1,   /* l2f */                       \
-   1,   /* l2d */                       \
-   1,   /* f2i */                       \
-   1,   /* f2l */                       \
-   1,   /* f2d */                       \
-   1,   /* d2i */                       \
-   1,   /* d2l */                       \
-   1,   /* d2f */                       \
-   1,   /* i2b */                       \
-   1,   /* i2c */                       \
-   1,   /* i2s */                       \
-   1,   /* lcmp */                      \
-   1,   /* fcmpl */                     \
-   1,   /* fcmpg */                     \
-   1,   /* dcmpl */                     \
-   1,   /* dcmpg */                     \
-   3,   /* ifeq */                      \
-   3,   /* ifne */                      \
-   3,   /* iflt */                      \
-   3,   /* ifge */                      \
-   3,   /* ifgt */                      \
-   3,   /* ifle */                      \
-   3,   /* if_icmpeq */                 \
-   3,   /* if_icmpne */                 \
-   3,   /* if_icmplt */                 \
-   3,   /* if_icmpge */                 \
-   3,   /* if_icmpgt */                 \
-   3,   /* if_icmple */                 \
-   3,   /* if_acmpeq */                 \
-   3,   /* if_acmpne */                 \
-   3,   /* goto */                      \
-   3,   /* jsr */                       \
-   2,   /* ret */                       \
-   99,  /* tableswitch */               \
-   99,  /* lookupswitch */              \
-   1,   /* ireturn */                   \
-   1,   /* lreturn */                   \
-   1,   /* freturn */                   \
-   1,   /* dreturn */                   \
-   1,   /* areturn */                   \
-   1,   /* return */                    \
-   3,   /* getstatic */                 \
-   3,   /* putstatic */                 \
-   3,   /* getfield */                  \
-   3,   /* putfield */                  \
-   3,   /* invokevirtual */             \
-   3,   /* invokespecial */             \
-   3,   /* invokestatic */              \
-   5,   /* invokeinterface */           \
-   5,   /* invokedynamic */             \
-   3,   /* new */                       \
-   2,   /* newarray */                  \
-   3,   /* anewarray */                 \
-   1,   /* arraylength */               \
-   1,   /* athrow */                    \
-   3,   /* checkcast */                 \
-   3,   /* instanceof */                \
-   1,   /* monitorenter */              \
-   1,   /* monitorexit */               \
-   0,   /* wide */                      \
-   4,   /* multianewarray */            \
-   3,   /* ifnull */                    \
-   3,   /* ifnonnull */                 \
-   5,   /* goto_w */                    \
-   5    /* jsr_w */                     \
-}
-
-#ifdef __cplusplus
-} /* extern "C" */
-#endif /* __cplusplus */
-
-#endif /* CLASSFILE_CONSTANTS */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/java.base/share/native/include/classfile_constants.h.template	Thu Dec 21 22:05:28 2017 +0100
@@ -0,0 +1,581 @@
+/*
+ * Copyright (c) 2004, 2017, Oracle and/or its affiliates. All rights reserved.
+ * 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.
+ */
+
+#ifndef CLASSFILE_CONSTANTS_H
+#define CLASSFILE_CONSTANTS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Classfile version number for this information */
+#define JVM_CLASSFILE_MAJOR_VERSION @@VERSION_CLASSFILE_MAJOR@@
+#define JVM_CLASSFILE_MINOR_VERSION @@VERSION_CLASSFILE_MINOR@@
+
+/* Flags */
+
+enum {
+    JVM_ACC_PUBLIC        = 0x0001,
+    JVM_ACC_PRIVATE       = 0x0002,
+    JVM_ACC_PROTECTED     = 0x0004,
+    JVM_ACC_STATIC        = 0x0008,
+    JVM_ACC_FINAL         = 0x0010,
+    JVM_ACC_SYNCHRONIZED  = 0x0020,
+    JVM_ACC_SUPER         = 0x0020,
+    JVM_ACC_VOLATILE      = 0x0040,
+    JVM_ACC_BRIDGE        = 0x0040,
+    JVM_ACC_TRANSIENT     = 0x0080,
+    JVM_ACC_VARARGS       = 0x0080,
+    JVM_ACC_NATIVE        = 0x0100,
+    JVM_ACC_INTERFACE     = 0x0200,
+    JVM_ACC_ABSTRACT      = 0x0400,
+    JVM_ACC_STRICT        = 0x0800,
+    JVM_ACC_SYNTHETIC     = 0x1000,
+    JVM_ACC_ANNOTATION    = 0x2000,
+    JVM_ACC_ENUM          = 0x4000,
+    JVM_ACC_MODULE        = 0x8000
+};
+
+#define JVM_ACC_PUBLIC_BIT        0
+#define JVM_ACC_PRIVATE_BIT       1
+#define JVM_ACC_PROTECTED_BIT     2
+#define JVM_ACC_STATIC_BIT        3
+#define JVM_ACC_FINAL_BIT         4
+#define JVM_ACC_SYNCHRONIZED_BIT  5
+#define JVM_ACC_SUPER_BIT         5
+#define JVM_ACC_VOLATILE_BIT      6
+#define JVM_ACC_BRIDGE_BIT        6
+#define JVM_ACC_TRANSIENT_BIT     7
+#define JVM_ACC_VARARGS_BIT       7
+#define JVM_ACC_NATIVE_BIT        8
+#define JVM_ACC_INTERFACE_BIT     9
+#define JVM_ACC_ABSTRACT_BIT      10
+#define JVM_ACC_STRICT_BIT        11
+#define JVM_ACC_SYNTHETIC_BIT     12
+#define JVM_ACC_ANNOTATION_BIT    13
+#define JVM_ACC_ENUM_BIT          14
+
+/* Used in newarray instruction. */
+
+enum {
+    JVM_T_BOOLEAN = 4,
+    JVM_T_CHAR    = 5,
+    JVM_T_FLOAT   = 6,
+    JVM_T_DOUBLE  = 7,
+    JVM_T_BYTE    = 8,
+    JVM_T_SHORT   = 9,
+    JVM_T_INT     = 10,
+    JVM_T_LONG    = 11
+};
+
+/* Constant Pool Entries */
+
+enum {
+    JVM_CONSTANT_Utf8                   = 1,
+    JVM_CONSTANT_Unicode                = 2, /* unused */
+    JVM_CONSTANT_Integer                = 3,
+    JVM_CONSTANT_Float                  = 4,
+    JVM_CONSTANT_Long                   = 5,
+    JVM_CONSTANT_Double                 = 6,
+    JVM_CONSTANT_Class                  = 7,
+    JVM_CONSTANT_String                 = 8,
+    JVM_CONSTANT_Fieldref               = 9,
+    JVM_CONSTANT_Methodref              = 10,
+    JVM_CONSTANT_InterfaceMethodref     = 11,
+    JVM_CONSTANT_NameAndType            = 12,
+    JVM_CONSTANT_MethodHandle           = 15,  // JSR 292
+    JVM_CONSTANT_MethodType             = 16,  // JSR 292
+    JVM_CONSTANT_InvokeDynamic          = 18,
+    JVM_CONSTANT_ExternalMax            = 18
+};
+
+/* JVM_CONSTANT_MethodHandle subtypes */
+enum {
+    JVM_REF_getField                = 1,
+    JVM_REF_getStatic               = 2,
+    JVM_REF_putField                = 3,
+    JVM_REF_putStatic               = 4,
+    JVM_REF_invokeVirtual           = 5,
+    JVM_REF_invokeStatic            = 6,
+    JVM_REF_invokeSpecial           = 7,
+    JVM_REF_newInvokeSpecial        = 8,
+    JVM_REF_invokeInterface         = 9
+};
+
+/* StackMapTable type item numbers */
+
+enum {
+    JVM_ITEM_Top                = 0,
+    JVM_ITEM_Integer            = 1,
+    JVM_ITEM_Float              = 2,
+    JVM_ITEM_Double             = 3,
+    JVM_ITEM_Long               = 4,
+    JVM_ITEM_Null               = 5,
+    JVM_ITEM_UninitializedThis  = 6,
+    JVM_ITEM_Object             = 7,
+    JVM_ITEM_Uninitialized      = 8
+};
+
+/* Type signatures */
+
+enum {
+    JVM_SIGNATURE_ARRAY         = '[',
+    JVM_SIGNATURE_BYTE          = 'B',
+    JVM_SIGNATURE_CHAR          = 'C',
+    JVM_SIGNATURE_CLASS         = 'L',
+    JVM_SIGNATURE_ENDCLASS      = ';',
+    JVM_SIGNATURE_ENUM          = 'E',
+    JVM_SIGNATURE_FLOAT         = 'F',
+    JVM_SIGNATURE_DOUBLE        = 'D',
+    JVM_SIGNATURE_FUNC          = '(',
+    JVM_SIGNATURE_ENDFUNC       = ')',
+    JVM_SIGNATURE_INT           = 'I',
+    JVM_SIGNATURE_LONG          = 'J',
+    JVM_SIGNATURE_SHORT         = 'S',
+    JVM_SIGNATURE_VOID          = 'V',
+    JVM_SIGNATURE_BOOLEAN       = 'Z'
+};
+
+/* Opcodes */
+
+enum {
+    JVM_OPC_nop                 = 0,
+    JVM_OPC_aconst_null         = 1,
+    JVM_OPC_iconst_m1           = 2,
+    JVM_OPC_iconst_0            = 3,
+    JVM_OPC_iconst_1            = 4,
+    JVM_OPC_iconst_2            = 5,
+    JVM_OPC_iconst_3            = 6,
+    JVM_OPC_iconst_4            = 7,
+    JVM_OPC_iconst_5            = 8,
+    JVM_OPC_lconst_0            = 9,
+    JVM_OPC_lconst_1            = 10,
+    JVM_OPC_fconst_0            = 11,
+    JVM_OPC_fconst_1            = 12,
+    JVM_OPC_fconst_2            = 13,
+    JVM_OPC_dconst_0            = 14,
+    JVM_OPC_dconst_1            = 15,
+    JVM_OPC_bipush              = 16,
+    JVM_OPC_sipush              = 17,
+    JVM_OPC_ldc                 = 18,
+    JVM_OPC_ldc_w               = 19,
+    JVM_OPC_ldc2_w              = 20,
+    JVM_OPC_iload               = 21,
+    JVM_OPC_lload               = 22,
+    JVM_OPC_fload               = 23,
+    JVM_OPC_dload               = 24,
+    JVM_OPC_aload               = 25,
+    JVM_OPC_iload_0             = 26,
+    JVM_OPC_iload_1             = 27,
+    JVM_OPC_iload_2             = 28,
+    JVM_OPC_iload_3             = 29,
+    JVM_OPC_lload_0             = 30,
+    JVM_OPC_lload_1             = 31,
+    JVM_OPC_lload_2             = 32,
+    JVM_OPC_lload_3             = 33,
+    JVM_OPC_fload_0             = 34,
+    JVM_OPC_fload_1             = 35,
+    JVM_OPC_fload_2             = 36,
+    JVM_OPC_fload_3             = 37,
+    JVM_OPC_dload_0             = 38,
+    JVM_OPC_dload_1             = 39,
+    JVM_OPC_dload_2             = 40,
+    JVM_OPC_dload_3             = 41,
+    JVM_OPC_aload_0             = 42,
+    JVM_OPC_aload_1             = 43,
+    JVM_OPC_aload_2             = 44,
+    JVM_OPC_aload_3             = 45,
+    JVM_OPC_iaload              = 46,
+    JVM_OPC_laload              = 47,
+    JVM_OPC_faload              = 48,
+    JVM_OPC_daload              = 49,
+    JVM_OPC_aaload              = 50,
+    JVM_OPC_baload              = 51,
+    JVM_OPC_caload              = 52,
+    JVM_OPC_saload              = 53,
+    JVM_OPC_istore              = 54,
+    JVM_OPC_lstore              = 55,
+    JVM_OPC_fstore              = 56,
+    JVM_OPC_dstore              = 57,
+    JVM_OPC_astore              = 58,
+    JVM_OPC_istore_0            = 59,
+    JVM_OPC_istore_1            = 60,
+    JVM_OPC_istore_2            = 61,
+    JVM_OPC_istore_3            = 62,
+    JVM_OPC_lstore_0            = 63,
+    JVM_OPC_lstore_1            = 64,
+    JVM_OPC_lstore_2            = 65,
+    JVM_OPC_lstore_3            = 66,
+    JVM_OPC_fstore_0            = 67,
+    JVM_OPC_fstore_1            = 68,
+    JVM_OPC_fstore_2            = 69,
+    JVM_OPC_fstore_3            = 70,
+    JVM_OPC_dstore_0            = 71,
+    JVM_OPC_dstore_1            = 72,
+    JVM_OPC_dstore_2            = 73,
+    JVM_OPC_dstore_3            = 74,
+    JVM_OPC_astore_0            = 75,
+    JVM_OPC_astore_1            = 76,
+    JVM_OPC_astore_2            = 77,
+    JVM_OPC_astore_3            = 78,
+    JVM_OPC_iastore             = 79,
+    JVM_OPC_lastore             = 80,
+    JVM_OPC_fastore             = 81,
+    JVM_OPC_dastore             = 82,
+    JVM_OPC_aastore             = 83,
+    JVM_OPC_bastore             = 84,
+    JVM_OPC_castore             = 85,
+    JVM_OPC_sastore             = 86,
+    JVM_OPC_pop                 = 87,
+    JVM_OPC_pop2                = 88,
+    JVM_OPC_dup                 = 89,
+    JVM_OPC_dup_x1              = 90,
+    JVM_OPC_dup_x2              = 91,
+    JVM_OPC_dup2                = 92,
+    JVM_OPC_dup2_x1             = 93,
+    JVM_OPC_dup2_x2             = 94,
+    JVM_OPC_swap                = 95,
+    JVM_OPC_iadd                = 96,
+    JVM_OPC_ladd                = 97,
+    JVM_OPC_fadd                = 98,
+    JVM_OPC_dadd                = 99,
+    JVM_OPC_isub                = 100,
+    JVM_OPC_lsub                = 101,
+    JVM_OPC_fsub                = 102,
+    JVM_OPC_dsub                = 103,
+    JVM_OPC_imul                = 104,
+    JVM_OPC_lmul                = 105,
+    JVM_OPC_fmul                = 106,
+    JVM_OPC_dmul                = 107,
+    JVM_OPC_idiv                = 108,
+    JVM_OPC_ldiv                = 109,
+    JVM_OPC_fdiv                = 110,
+    JVM_OPC_ddiv                = 111,
+    JVM_OPC_irem                = 112,
+    JVM_OPC_lrem                = 113,
+    JVM_OPC_frem                = 114,
+    JVM_OPC_drem                = 115,
+    JVM_OPC_ineg                = 116,
+    JVM_OPC_lneg                = 117,
+    JVM_OPC_fneg                = 118,
+    JVM_OPC_dneg                = 119,
+    JVM_OPC_ishl                = 120,
+    JVM_OPC_lshl                = 121,
+    JVM_OPC_ishr                = 122,
+    JVM_OPC_lshr                = 123,
+    JVM_OPC_iushr               = 124,
+    JVM_OPC_lushr               = 125,
+    JVM_OPC_iand                = 126,
+    JVM_OPC_land                = 127,
+    JVM_OPC_ior                 = 128,
+    JVM_OPC_lor                 = 129,
+    JVM_OPC_ixor                = 130,
+    JVM_OPC_lxor                = 131,
+    JVM_OPC_iinc                = 132,
+    JVM_OPC_i2l                 = 133,
+    JVM_OPC_i2f                 = 134,
+    JVM_OPC_i2d                 = 135,
+    JVM_OPC_l2i                 = 136,
+    JVM_OPC_l2f                 = 137,
+    JVM_OPC_l2d                 = 138,
+    JVM_OPC_f2i                 = 139,
+    JVM_OPC_f2l                 = 140,
+    JVM_OPC_f2d                 = 141,
+    JVM_OPC_d2i                 = 142,
+    JVM_OPC_d2l                 = 143,
+    JVM_OPC_d2f                 = 144,
+    JVM_OPC_i2b                 = 145,
+    JVM_OPC_i2c                 = 146,
+    JVM_OPC_i2s                 = 147,
+    JVM_OPC_lcmp                = 148,
+    JVM_OPC_fcmpl               = 149,
+    JVM_OPC_fcmpg               = 150,
+    JVM_OPC_dcmpl               = 151,
+    JVM_OPC_dcmpg               = 152,
+    JVM_OPC_ifeq                = 153,
+    JVM_OPC_ifne                = 154,
+    JVM_OPC_iflt                = 155,
+    JVM_OPC_ifge                = 156,
+    JVM_OPC_ifgt                = 157,
+    JVM_OPC_ifle                = 158,
+    JVM_OPC_if_icmpeq           = 159,
+    JVM_OPC_if_icmpne           = 160,
+    JVM_OPC_if_icmplt           = 161,
+    JVM_OPC_if_icmpge           = 162,
+    JVM_OPC_if_icmpgt           = 163,
+    JVM_OPC_if_icmple           = 164,
+    JVM_OPC_if_acmpeq           = 165,
+    JVM_OPC_if_acmpne           = 166,
+    JVM_OPC_goto                = 167,
+    JVM_OPC_jsr                 = 168,
+    JVM_OPC_ret                 = 169,
+    JVM_OPC_tableswitch         = 170,
+    JVM_OPC_lookupswitch        = 171,
+    JVM_OPC_ireturn             = 172,
+    JVM_OPC_lreturn             = 173,
+    JVM_OPC_freturn             = 174,
+    JVM_OPC_dreturn             = 175,
+    JVM_OPC_areturn             = 176,
+    JVM_OPC_return              = 177,
+    JVM_OPC_getstatic           = 178,
+    JVM_OPC_putstatic           = 179,
+    JVM_OPC_getfield            = 180,
+    JVM_OPC_putfield            = 181,
+    JVM_OPC_invokevirtual       = 182,
+    JVM_OPC_invokespecial       = 183,
+    JVM_OPC_invokestatic        = 184,
+    JVM_OPC_invokeinterface     = 185,
+    JVM_OPC_invokedynamic       = 186,
+    JVM_OPC_new                 = 187,
+    JVM_OPC_newarray            = 188,
+    JVM_OPC_anewarray           = 189,
+    JVM_OPC_arraylength         = 190,
+    JVM_OPC_athrow              = 191,
+    JVM_OPC_checkcast           = 192,
+    JVM_OPC_instanceof          = 193,
+    JVM_OPC_monitorenter        = 194,
+    JVM_OPC_monitorexit         = 195,
+    JVM_OPC_wide                = 196,
+    JVM_OPC_multianewarray      = 197,
+    JVM_OPC_ifnull              = 198,
+    JVM_OPC_ifnonnull           = 199,
+    JVM_OPC_goto_w              = 200,
+    JVM_OPC_jsr_w               = 201,
+    JVM_OPC_MAX                 = 201
+};
+
+/* Opcode length initializer, use with something like:
+ *   unsigned char opcode_length[JVM_OPC_MAX+1] = JVM_OPCODE_LENGTH_INITIALIZER;
+ */
+#define JVM_OPCODE_LENGTH_INITIALIZER { \
+   1,   /* nop */                       \
+   1,   /* aconst_null */               \
+   1,   /* iconst_m1 */                 \
+   1,   /* iconst_0 */                  \
+   1,   /* iconst_1 */                  \
+   1,   /* iconst_2 */                  \
+   1,   /* iconst_3 */                  \
+   1,   /* iconst_4 */                  \
+   1,   /* iconst_5 */                  \
+   1,   /* lconst_0 */                  \
+   1,   /* lconst_1 */                  \
+   1,   /* fconst_0 */                  \
+   1,   /* fconst_1 */                  \
+   1,   /* fconst_2 */                  \
+   1,   /* dconst_0 */                  \
+   1,   /* dconst_1 */                  \
+   2,   /* bipush */                    \
+   3,   /* sipush */                    \
+   2,   /* ldc */                       \
+   3,   /* ldc_w */                     \
+   3,   /* ldc2_w */                    \
+   2,   /* iload */                     \
+   2,   /* lload */                     \
+   2,   /* fload */                     \
+   2,   /* dload */                     \
+   2,   /* aload */                     \
+   1,   /* iload_0 */                   \
+   1,   /* iload_1 */                   \
+   1,   /* iload_2 */                   \
+   1,   /* iload_3 */                   \
+   1,   /* lload_0 */                   \
+   1,   /* lload_1 */                   \
+   1,   /* lload_2 */                   \
+   1,   /* lload_3 */                   \
+   1,   /* fload_0 */                   \
+   1,   /* fload_1 */                   \
+   1,   /* fload_2 */                   \
+   1,   /* fload_3 */                   \
+   1,   /* dload_0 */                   \
+   1,   /* dload_1 */                   \
+   1,   /* dload_2 */                   \
+   1,   /* dload_3 */                   \
+   1,   /* aload_0 */                   \
+   1,   /* aload_1 */                   \
+   1,   /* aload_2 */                   \
+   1,   /* aload_3 */                   \
+   1,   /* iaload */                    \
+   1,   /* laload */                    \
+   1,   /* faload */                    \
+   1,   /* daload */                    \
+   1,   /* aaload */                    \
+   1,   /* baload */                    \
+   1,   /* caload */                    \
+   1,   /* saload */                    \
+   2,   /* istore */                    \
+   2,   /* lstore */                    \
+   2,   /* fstore */                    \
+   2,   /* dstore */                    \
+   2,   /* astore */                    \
+   1,   /* istore_0 */                  \
+   1,   /* istore_1 */                  \
+   1,   /* istore_2 */                  \
+   1,   /* istore_3 */                  \
+   1,   /* lstore_0 */                  \
+   1,   /* lstore_1 */                  \
+   1,   /* lstore_2 */                  \
+   1,   /* lstore_3 */                  \
+   1,   /* fstore_0 */                  \
+   1,   /* fstore_1 */                  \
+   1,   /* fstore_2 */                  \
+   1,   /* fstore_3 */                  \
+   1,   /* dstore_0 */                  \
+   1,   /* dstore_1 */                  \
+   1,   /* dstore_2 */                  \
+   1,   /* dstore_3 */                  \
+   1,   /* astore_0 */                  \
+   1,   /* astore_1 */                  \
+   1,   /* astore_2 */                  \
+   1,   /* astore_3 */                  \
+   1,   /* iastore */                   \
+   1,   /* lastore */                   \
+   1,   /* fastore */                   \
+   1,   /* dastore */                   \
+   1,   /* aastore */                   \
+   1,   /* bastore */                   \
+   1,   /* castore */                   \
+   1,   /* sastore */                   \
+   1,   /* pop */                       \
+   1,   /* pop2 */                      \
+   1,   /* dup */                       \
+   1,   /* dup_x1 */                    \
+   1,   /* dup_x2 */                    \
+   1,   /* dup2 */                      \
+   1,   /* dup2_x1 */                   \
+   1,   /* dup2_x2 */                   \
+   1,   /* swap */                      \
+   1,   /* iadd */                      \
+   1,   /* ladd */                      \
+   1,   /* fadd */                      \
+   1,   /* dadd */                      \
+   1,   /* isub */                      \
+   1,   /* lsub */                      \
+   1,   /* fsub */                      \
+   1,   /* dsub */                      \
+   1,   /* imul */                      \
+   1,   /* lmul */                      \
+   1,   /* fmul */                      \
+   1,   /* dmul */                      \
+   1,   /* idiv */                      \
+   1,   /* ldiv */                      \
+   1,   /* fdiv */                      \
+   1,   /* ddiv */                      \
+   1,   /* irem */                      \
+   1,   /* lrem */                      \
+   1,   /* frem */                      \
+   1,   /* drem */                      \
+   1,   /* ineg */                      \
+   1,   /* lneg */                      \
+   1,   /* fneg */                      \
+   1,   /* dneg */                      \
+   1,   /* ishl */                      \
+   1,   /* lshl */                      \
+   1,   /* ishr */                      \
+   1,   /* lshr */                      \
+   1,   /* iushr */                     \
+   1,   /* lushr */                     \
+   1,   /* iand */                      \
+   1,   /* land */                      \
+   1,   /* ior */                       \
+   1,   /* lor */                       \
+   1,   /* ixor */                      \
+   1,   /* lxor */                      \
+   3,   /* iinc */                      \
+   1,   /* i2l */                       \
+   1,   /* i2f */                       \
+   1,   /* i2d */                       \
+   1,   /* l2i */                       \
+   1,   /* l2f */                       \
+   1,   /* l2d */                       \
+   1,   /* f2i */                       \
+   1,   /* f2l */                       \
+   1,   /* f2d */                       \
+   1,   /* d2i */                       \
+   1,   /* d2l */                       \
+   1,   /* d2f */                       \
+   1,   /* i2b */                       \
+   1,   /* i2c */                       \
+   1,   /* i2s */                       \
+   1,   /* lcmp */                      \
+   1,   /* fcmpl */                     \
+   1,   /* fcmpg */                     \
+   1,   /* dcmpl */                     \
+   1,   /* dcmpg */                     \
+   3,   /* ifeq */                      \
+   3,   /* ifne */                      \
+   3,   /* iflt */                      \
+   3,   /* ifge */                      \
+   3,   /* ifgt */                      \
+   3,   /* ifle */                      \
+   3,   /* if_icmpeq */                 \
+   3,   /* if_icmpne */                 \
+   3,   /* if_icmplt */                 \
+   3,   /* if_icmpge */                 \
+   3,   /* if_icmpgt */                 \
+   3,   /* if_icmple */                 \
+   3,   /* if_acmpeq */                 \
+   3,   /* if_acmpne */                 \
+   3,   /* goto */                      \
+   3,   /* jsr */                       \
+   2,   /* ret */                       \
+   99,  /* tableswitch */               \
+   99,  /* lookupswitch */              \
+   1,   /* ireturn */                   \
+   1,   /* lreturn */                   \
+   1,   /* freturn */                   \
+   1,   /* dreturn */                   \
+   1,   /* areturn */                   \
+   1,   /* return */                    \
+   3,   /* getstatic */                 \
+   3,   /* putstatic */                 \
+   3,   /* getfield */                  \
+   3,   /* putfield */                  \
+   3,   /* invokevirtual */             \
+   3,   /* invokespecial */             \
+   3,   /* invokestatic */              \
+   5,   /* invokeinterface */           \
+   5,   /* invokedynamic */             \
+   3,   /* new */                       \
+   2,   /* newarray */                  \
+   3,   /* anewarray */                 \
+   1,   /* arraylength */               \
+   1,   /* athrow */                    \
+   3,   /* checkcast */                 \
+   3,   /* instanceof */                \
+   1,   /* monitorenter */              \
+   1,   /* monitorexit */               \
+   0,   /* wide */                      \
+   4,   /* multianewarray */            \
+   3,   /* ifnull */                    \
+   3,   /* ifnonnull */                 \
+   5,   /* goto_w */                    \
+   5    /* jsr_w */                     \
+}
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif /* __cplusplus */
+
+#endif /* CLASSFILE_CONSTANTS */
--- a/src/java.base/share/native/libjava/System.c	Thu Dec 14 22:06:19 2017 +0100
+++ b/src/java.base/share/native/libjava/System.c	Thu Dec 21 22:05:28 2017 +0100
@@ -114,9 +114,6 @@
 #define VENDOR_URL_BUG "http://bugreport.java.com/bugreport/"
 #endif
 
-#define JAVA_MAX_SUPPORTED_VERSION 54
-#define JAVA_MAX_SUPPORTED_MINOR_VERSION 0
-
 #ifdef JAVA_SPECIFICATION_VENDOR /* Third party may NOT overwrite this. */
   #error "ERROR: No override of JAVA_SPECIFICATION_VENDOR is allowed"
 #else
@@ -219,8 +216,8 @@
     PUTPROP(props, "java.vendor.url", VENDOR_URL);
     PUTPROP(props, "java.vendor.url.bug", VENDOR_URL_BUG);
 
-    jio_snprintf(buf, sizeof(buf), "%d.%d", JAVA_MAX_SUPPORTED_VERSION,
-                                            JAVA_MAX_SUPPORTED_MINOR_VERSION);
+    jio_snprintf(buf, sizeof(buf), "%d.%d", JVM_CLASSFILE_MAJOR_VERSION,
+                                            JVM_CLASSFILE_MINOR_VERSION);
     PUTPROP(props, "java.class.version", buf);
 
     if (sprops->awt_toolkit) {
--- a/src/java.compiler/share/classes/javax/lang/model/SourceVersion.java	Thu Dec 14 22:06:19 2017 +0100
+++ b/src/java.compiler/share/classes/javax/lang/model/SourceVersion.java	Thu Dec 21 22:05:28 2017 +0100
@@ -57,6 +57,7 @@
      * 1.8: lambda expressions and default methods
      *   9: modules, small cleanups to 1.7 and 1.8 changes
      *  10: local-variable type inference (var)
+     *  11: to be determined changes
      */
 
     /**
@@ -162,7 +163,15 @@
      *
      * @since 10
      */
-     RELEASE_10;
+     RELEASE_10,
+
+    /**
+     * The version recognized by the Java Platform, Standard Edition
+     * 11.
+     *
+     * @since 11
+     */
+     RELEASE_11;
 
     // Note that when adding constants for newer releases, the
     // behavior of latest() and latestSupported() must be updated too.
@@ -173,7 +182,7 @@
      * @return the latest source version that can be modeled
      */
     public static SourceVersion latest() {
-        return RELEASE_10;
+        return RELEASE_11;
     }
 
     private static final SourceVersion latestSupported = getLatestSupported();
@@ -183,6 +192,8 @@
             String specVersion = System.getProperty("java.specification.version");
 
             switch (specVersion) {
+                case "11":
+                    return RELEASE_11;
                 case "10":
                     return RELEASE_10;
                 case "9":
--- a/src/java.desktop/share/classes/java/awt/Toolkit.java	Thu Dec 14 22:06:19 2017 +0100
+++ b/src/java.desktop/share/classes/java/awt/Toolkit.java	Thu Dec 21 22:05:28 2017 +0100
@@ -673,11 +673,13 @@
      * <p>
      * This method first checks if there is a security manager installed.
      * If so, the method calls the security manager's
-     * {@code checkPermission} method with the
-     * url.openConnection().getPermission() permission to ensure
-     * that the access to the image is allowed. For compatibility
-     * with pre-1.2 security managers, if the access is denied with
-     * {@code FilePermission} or {@code SocketPermission},
+     * {@code checkPermission} method with the corresponding
+     * permission to ensure that the access to the image is allowed.
+     * If the connection to the specified URL requires
+     * either {@code URLPermission} or {@code SocketPermission},
+     * then {@code URLPermission} is used for security checks.
+     * For compatibility with pre-1.2 security managers, if the access
+     * is denied with {@code FilePermission} or {@code SocketPermission},
      * the method throws the {@code SecurityException}
      * if the corresponding 1.1-style SecurityManager.checkXXX method
      * also denies permission.
@@ -717,11 +719,13 @@
      * <p>
      * This method first checks if there is a security manager installed.
      * If so, the method calls the security manager's
-     * {@code checkPermission} method with the
-     * url.openConnection().getPermission() permission to ensure
-     * that the image creation is allowed. For compatibility
-     * with pre-1.2 security managers, if the access is denied with
-     * {@code FilePermission} or {@code SocketPermission},
+     * {@code checkPermission} method with the corresponding
+     * permission to ensure that the image creation is allowed.
+     * If the connection to the specified URL requires
+     * either {@code URLPermission} or {@code SocketPermission},
+     * then {@code URLPermission} is used for security checks.
+     * For compatibility with pre-1.2 security managers, if the access
+     * is denied with {@code FilePermission} or {@code SocketPermission},
      * the method throws {@code SecurityException}
      * if the corresponding 1.1-style SecurityManager.checkXXX method
      * also denies permission.
--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Source.java	Thu Dec 14 22:06:19 2017 +0100
+++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Source.java	Thu Dec 21 22:05:28 2017 +0100
@@ -78,8 +78,11 @@
     /** 1.9 modularity. */
     JDK9("9"),
 
-    /** 1.10 covers the to be determined language features that will be added in JDK 10. */
-    JDK10("10");
+    /** 1.10 local-variable type inference (var). */
+    JDK10("10"),
+
+    /** 1.11 covers the to be determined language features that will be added in JDK 11. */
+    JDK11("11");
 
     private static final Context.Key<Source> sourceKey = new Context.Key<>();
 
@@ -108,6 +111,7 @@
         tab.put("1.8", JDK8); // Make 8 an alias for 1.8
         tab.put("1.9", JDK9); // Make 9 an alias for 1.9
         tab.put("1.10", JDK10); // Make 10 an alias for 1.10
+        // Decline to make 1.11 an alias for 11.
     }
 
     private Source(String name) {
@@ -125,6 +129,7 @@
     }
 
     public Target requiredTarget() {
+        if (this.compareTo(JDK11) >= 0) return Target.JDK1_11;
         if (this.compareTo(JDK10) >= 0) return Target.JDK1_10;
         if (this.compareTo(JDK9) >= 0) return Target.JDK1_9;
         if (this.compareTo(JDK8) >= 0) return Target.JDK1_8;
@@ -247,6 +252,8 @@
             return RELEASE_9;
         case JDK10:
             return RELEASE_10;
+        case JDK11:
+            return RELEASE_11;
         default:
             return null;
         }
--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Symbol.java	Thu Dec 14 22:06:19 2017 +0100
+++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Symbol.java	Thu Dec 21 22:05:28 2017 +0100
@@ -1628,9 +1628,6 @@
         /** The parameters of the method. */
         public List<VarSymbol> params = null;
 
-        /** The names of the parameters */
-        public List<Name> savedParameterNames;
-
         /** For an annotation type element, its default value if any.
          *  The value is null if none appeared in the method
          *  declaration.
@@ -1886,59 +1883,20 @@
         public List<VarSymbol> params() {
             owner.complete();
             if (params == null) {
-                // If ClassReader.saveParameterNames has been set true, then
-                // savedParameterNames will be set to a list of names that
-                // matches the types in type.getParameterTypes().  If any names
-                // were not found in the class file, those names in the list will
-                // be set to the empty name.
-                // If ClassReader.saveParameterNames has been set false, then
-                // savedParameterNames will be null.
-                List<Name> paramNames = savedParameterNames;
-                savedParameterNames = null;
-                // discard the provided names if the list of names is the wrong size.
-                if (paramNames == null || paramNames.size() != type.getParameterTypes().size()) {
-                    paramNames = List.nil();
-                }
-                ListBuffer<VarSymbol> buf = new ListBuffer<>();
-                List<Name> remaining = paramNames;
-                // assert: remaining and paramNames are both empty or both
-                // have same cardinality as type.getParameterTypes()
+                ListBuffer<VarSymbol> newParams = new ListBuffer<>();
                 int i = 0;
                 for (Type t : type.getParameterTypes()) {
-                    Name paramName;
-                    if (remaining.isEmpty()) {
-                        // no names for any parameters available
-                        paramName = createArgName(i, paramNames);
-                    } else {
-                        paramName = remaining.head;
-                        remaining = remaining.tail;
-                        if (paramName.isEmpty()) {
-                            // no name for this specific parameter
-                            paramName = createArgName(i, paramNames);
-                        }
-                    }
-                    buf.append(new VarSymbol(PARAMETER, paramName, t, this));
-                    i++;
+                    Name paramName = name.table.fromString("arg" + i);
+                    VarSymbol param = new VarSymbol(PARAMETER, paramName, t, this);
+                    newParams.append(param);
+
                 }
-                params = buf.toList();
+                params = newParams.toList();
             }
+            Assert.checkNonNull(params);
             return params;
         }
 
-        // Create a name for the argument at position 'index' that is not in
-        // the exclude list. In normal use, either no names will have been
-        // provided, in which case the exclude list is empty, or all the names
-        // will have been provided, in which case this method will not be called.
-        private Name createArgName(int index, List<Name> exclude) {
-            String prefix = "arg";
-            while (true) {
-                Name argName = name.table.fromString(prefix + index);
-                if (!exclude.contains(argName))
-                    return argName;
-                prefix += "$";
-            }
-        }
-
         public Symbol asMemberOf(Type site, Types types) {
             return new MethodSymbol(flags_field, name, types.memberType(site, this), owner);
         }
--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Check.java	Thu Dec 14 22:06:19 2017 +0100
+++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Check.java	Thu Dec 21 22:05:28 2017 +0100
@@ -1976,8 +1976,8 @@
                          types.covariantReturnType(rt2, rt1, types.noWarnings)) ||
                          checkCommonOverriderIn(s1,s2,site);
                     if (!compat) {
-                        log.error(pos, Errors.TypesIncompatibleDiffRet(t1, t2, s2.name +
-                                "(" + types.memberType(t2, s2).getParameterTypes() + ")"));
+                        log.error(pos, Errors.TypesIncompatible(t1, t2,
+                                Fragments.IncompatibleDiffRet(s2.name, types.memberType(t2, s2).getParameterTypes())));
                         return s2;
                     }
                 } else if (checkNameClash((ClassSymbol)site.tsym, s1, s2) &&
@@ -2563,20 +2563,22 @@
                         //strong semantics - issue an error if two sibling interfaces
                         //have two override-equivalent defaults - or if one is abstract
                         //and the other is default
-                        String errKey;
+                        Fragment diagKey;
                         Symbol s1 = defaults.first();
                         Symbol s2;
                         if (defaults.size() > 1) {
-                            errKey = "types.incompatible.unrelated.defaults";
                             s2 = defaults.toList().tail.head;
+                            diagKey = Fragments.IncompatibleUnrelatedDefaults(Kinds.kindName(site.tsym), site,
+                                    m.name, types.memberType(site, m).getParameterTypes(),
+                                    s1.location(), s2.location());
+
                         } else {
-                            errKey = "types.incompatible.abstract.default";
                             s2 = abstracts.first();
+                            diagKey = Fragments.IncompatibleAbstractDefault(Kinds.kindName(site.tsym), site,
+                                    m.name, types.memberType(site, m).getParameterTypes(),
+                                    s1.location(), s2.location());
                         }
-                        log.error(pos, errKey,
-                                Kinds.kindName(site.tsym), site,
-                                m.name, types.memberType(site, m).getParameterTypes(),
-                                s1.location(), s2.location());
+                        log.error(pos, Errors.TypesIncompatible(s1.location().type, s2.location().type, diagKey));
                         break;
                     }
                 }
--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/ClassFile.java	Thu Dec 14 22:06:19 2017 +0100
+++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/ClassFile.java	Thu Dec 21 22:05:28 2017 +0100
@@ -111,7 +111,8 @@
         V51(51, 0),   // JDK 1.7
         V52(52, 0),   // JDK 1.8: lambda, type annos, param names
         V53(53, 0),   // JDK 1.9: modules, indy string concat
-        V54(54, 0);   // JDK 10
+        V54(54, 0),   // JDK 10
+        V55(55, 0);   // JDK 11: constant dynamic
         Version(int major, int minor) {
             this.major = major;
             this.minor = minor;
--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/ClassReader.java	Thu Dec 14 22:06:19 2017 +0100
+++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/ClassReader.java	Thu Dec 21 22:05:28 2017 +0100
@@ -193,6 +193,26 @@
     int[] parameterNameIndices;
 
     /**
+     * A table to hold annotations for method parameters.
+     */
+    ParameterAnnotations[] parameterAnnotations;
+
+    /**
+     * A holder for parameter annotations.
+     */
+    static class ParameterAnnotations {
+        List<CompoundAnnotationProxy> proxies;
+
+        void add(List<CompoundAnnotationProxy> newAnnotations) {
+            if (proxies == null) {
+                proxies = newAnnotations;
+            } else {
+                proxies = proxies.prependList(newAnnotations);
+            }
+        }
+    }
+
+    /**
      * Whether or not any parameter names have been found.
      */
     boolean haveParameterNameIndices;
@@ -1218,7 +1238,7 @@
 
             new AttributeReader(names.RuntimeInvisibleParameterAnnotations, V49, CLASS_OR_MEMBER_ATTRIBUTE) {
                 protected void read(Symbol sym, int attrLen) {
-                    attachParameterAnnotations(sym);
+                    readParameterAnnotations(sym);
                 }
             },
 
@@ -1230,7 +1250,7 @@
 
             new AttributeReader(names.RuntimeVisibleParameterAnnotations, V49, CLASS_OR_MEMBER_ATTRIBUTE) {
                 protected void read(Symbol sym, int attrLen) {
-                    attachParameterAnnotations(sym);
+                    readParameterAnnotations(sym);
                 }
             },
 
@@ -1288,10 +1308,14 @@
                         int numEntries = nextByte();
                         parameterNameIndices = new int[numEntries];
                         haveParameterNameIndices = true;
+                        int index = 0;
                         for (int i = 0; i < numEntries; i++) {
                             int nameIndex = nextChar();
                             int flags = nextChar();
-                            parameterNameIndices[i] = nameIndex;
+                            if ((flags & (Flags.MANDATED | Flags.SYNTHETIC)) != 0) {
+                                continue;
+                            }
+                            parameterNameIndices[index++] = nameIndex;
                         }
                     }
                     bp = newbp;
@@ -1571,65 +1595,82 @@
  * Reading Java-language annotations
  ***********************************************************************/
 
+    /**
+     * Save annotations.
+     */
+    List<CompoundAnnotationProxy> readAnnotations() {
+        int numAttributes = nextChar();
+        ListBuffer<CompoundAnnotationProxy> annotations = new ListBuffer<>();
+        for (int i = 0; i < numAttributes; i++) {
+            annotations.append(readCompoundAnnotation());
+        }
+        return annotations.toList();
+    }
+
     /** Attach annotations.
      */
     void attachAnnotations(final Symbol sym) {
-        int numAttributes = nextChar();
-        if (numAttributes != 0) {
-            ListBuffer<CompoundAnnotationProxy> proxies = new ListBuffer<>();
-            for (int i = 0; i<numAttributes; i++) {
-                CompoundAnnotationProxy proxy = readCompoundAnnotation();
-                if (proxy.type.tsym == syms.proprietaryType.tsym)
-                    sym.flags_field |= PROPRIETARY;
-                else if (proxy.type.tsym == syms.profileType.tsym) {
-                    if (profile != Profile.DEFAULT) {
-                        for (Pair<Name,Attribute> v: proxy.values) {
-                            if (v.fst == names.value && v.snd instanceof Attribute.Constant) {
-                                Attribute.Constant c = (Attribute.Constant) v.snd;
-                                if (c.type == syms.intType && ((Integer) c.value) > profile.value) {
-                                    sym.flags_field |= NOT_IN_PROFILE;
-                                }
+        attachAnnotations(sym, readAnnotations());
+    }
+
+    /**
+     * Attach annotations.
+     */
+    void attachAnnotations(final Symbol sym, List<CompoundAnnotationProxy> annotations) {
+        if (annotations.isEmpty()) {
+            return;
+        }
+        ListBuffer<CompoundAnnotationProxy> proxies = new ListBuffer<>();
+        for (CompoundAnnotationProxy proxy : annotations) {
+            if (proxy.type.tsym == syms.proprietaryType.tsym)
+                sym.flags_field |= PROPRIETARY;
+            else if (proxy.type.tsym == syms.profileType.tsym) {
+                if (profile != Profile.DEFAULT) {
+                    for (Pair<Name, Attribute> v : proxy.values) {
+                        if (v.fst == names.value && v.snd instanceof Attribute.Constant) {
+                            Attribute.Constant c = (Attribute.Constant)v.snd;
+                            if (c.type == syms.intType && ((Integer)c.value) > profile.value) {
+                                sym.flags_field |= NOT_IN_PROFILE;
                             }
                         }
                     }
-                } else {
-                    if (proxy.type.tsym == syms.annotationTargetType.tsym) {
-                        target = proxy;
-                    } else if (proxy.type.tsym == syms.repeatableType.tsym) {
-                        repeatable = proxy;
-                    } else if (proxy.type.tsym == syms.deprecatedType.tsym) {
-                        sym.flags_field |= (DEPRECATED | DEPRECATED_ANNOTATION);
-                        for (Pair<Name, Attribute> v : proxy.values) {
-                            if (v.fst == names.forRemoval && v.snd instanceof Attribute.Constant) {
-                                Attribute.Constant c = (Attribute.Constant) v.snd;
-                                if (c.type == syms.booleanType && ((Integer) c.value) != 0) {
-                                    sym.flags_field |= DEPRECATED_REMOVAL;
-                                }
+                }
+            } else {
+                if (proxy.type.tsym == syms.annotationTargetType.tsym) {
+                    target = proxy;
+                } else if (proxy.type.tsym == syms.repeatableType.tsym) {
+                    repeatable = proxy;
+                } else if (proxy.type.tsym == syms.deprecatedType.tsym) {
+                    sym.flags_field |= (DEPRECATED | DEPRECATED_ANNOTATION);
+                    for (Pair<Name, Attribute> v : proxy.values) {
+                        if (v.fst == names.forRemoval && v.snd instanceof Attribute.Constant) {
+                            Attribute.Constant c = (Attribute.Constant)v.snd;
+                            if (c.type == syms.booleanType && ((Integer)c.value) != 0) {
+                                sym.flags_field |= DEPRECATED_REMOVAL;
                             }
                         }
                     }
-
-                    proxies.append(proxy);
                 }
+                proxies.append(proxy);
             }
-            annotate.normal(new AnnotationCompleter(sym, proxies.toList()));
         }
+        annotate.normal(new AnnotationCompleter(sym, proxies.toList()));
     }
 
-    /** Attach parameter annotations.
+    /** Read parameter annotations.
      */
-    void attachParameterAnnotations(final Symbol method) {
-        final MethodSymbol meth = (MethodSymbol)method;
+    void readParameterAnnotations(Symbol meth) {
         int numParameters = buf[bp++] & 0xFF;
-        List<VarSymbol> parameters = meth.params();
-        int pnum = 0;
-        while (parameters.tail != null) {
-            attachAnnotations(parameters.head);
-            parameters = parameters.tail;
-            pnum++;
+        if (parameterAnnotations == null) {
+            parameterAnnotations = new ParameterAnnotations[numParameters];
+        } else if (parameterAnnotations.length != numParameters) {
+            throw badClassFile("bad.runtime.invisible.param.annotations", meth);
         }
-        if (pnum != numParameters) {
-            throw badClassFile("bad.runtime.invisible.param.annotations", meth);
+        for (int pnum = 0; pnum < numParameters; pnum++) {
+            if (parameterAnnotations[pnum] == null) {
+                parameterAnnotations[pnum] = new ParameterAnnotations();
+            }
+            parameterAnnotations[pnum].add(readAnnotations());
         }
     }
 
@@ -2394,8 +2435,7 @@
         } finally {
             currentOwner = prevOwner;
         }
-        if (saveParameterNames)
-            setParameterNames(m, type);
+        setParameters(m, type);
 
         if ((flags & VARARGS) != 0) {
             final Type last = type.getParameterTypes().last();
@@ -2448,22 +2488,17 @@
     }
 
     /**
-     * Set the parameter names for a symbol from the name index in the
-     * parameterNameIndicies array. The type of the symbol may have changed
-     * while reading the method attributes (see the Signature attribute).
-     * This may be because of generic information or because anonymous
-     * synthetic parameters were added.   The original type (as read from
-     * the method descriptor) is used to help guess the existence of
+     * Set the parameters for a method symbol, including any names and
+     * annotations that were read.
+     *
+     * <p>The type of the symbol may have changed while reading the
+     * method attributes (see the Signature attribute). This may be
+     * because of generic information or because anonymous synthetic
+     * parameters were added.   The original type (as read from the
+     * method descriptor) is used to help guess the existence of
      * anonymous synthetic parameters.
-     * On completion, sym.savedParameter names will either be null (if
-     * no parameter names were found in the class file) or will be set to a
-     * list of names, one per entry in sym.type.getParameterTypes, with
-     * any missing names represented by the empty name.
      */
-    void setParameterNames(MethodSymbol sym, Type jvmType) {
-        // if no names were found in the class file, there's nothing more to do
-        if (!haveParameterNameIndices)
-            return;
+    void setParameters(MethodSymbol sym, Type jvmType) {
         // If we get parameter names from MethodParameters, then we
         // don't need to skip.
         int firstParam = 0;
@@ -2474,16 +2509,16 @@
             // make a corresponding allowance here for the position of
             // the first parameter.  Note that this assumes the
             // skipped parameter has a width of 1 -- i.e. it is not
-        // a double width type (long or double.)
-        if (sym.name == names.init && currentOwner.hasOuterInstance()) {
-            // Sometimes anonymous classes don't have an outer
-            // instance, however, there is no reliable way to tell so
-            // we never strip this$n
-            if (!currentOwner.name.isEmpty())
-                firstParam += 1;
-        }
+            // a double width type (long or double.)
+            if (sym.name == names.init && currentOwner.hasOuterInstance()) {
+                // Sometimes anonymous classes don't have an outer
+                // instance, however, there is no reliable way to tell so
+                // we never strip this$n
+                if (!currentOwner.name.isEmpty())
+                    firstParam += 1;
+            }
 
-        if (sym.type != jvmType) {
+            if (sym.type != jvmType) {
                 // reading the method attributes has caused the
                 // symbol's type to be changed. (i.e. the Signature
                 // attribute.)  This may happen if there are hidden
@@ -2493,21 +2528,55 @@
                 // at the beginning, and so skip over them. The
                 // primary case for this is two hidden parameters
                 // passed into Enum constructors.
-            int skip = Code.width(jvmType.getParameterTypes())
-                    - Code.width(sym.type.getParameterTypes());
-            firstParam += skip;
-        }
+                int skip = Code.width(jvmType.getParameterTypes())
+                        - Code.width(sym.type.getParameterTypes());
+                firstParam += skip;
+            }
         }
         List<Name> paramNames = List.nil();
-        int index = firstParam;
+        ListBuffer<VarSymbol> params = new ListBuffer<>();
+        int nameIndex = firstParam;
+        int annotationIndex = 0;
         for (Type t: sym.type.getParameterTypes()) {
-            int nameIdx = (index < parameterNameIndices.length
-                    ? parameterNameIndices[index] : 0);
-            Name name = nameIdx == 0 ? names.empty : readName(nameIdx);
+            Name name = parameterName(nameIndex, paramNames);
             paramNames = paramNames.prepend(name);
-            index += sawMethodParameters ? 1 : Code.width(t);
+            VarSymbol param = new VarSymbol(PARAMETER, name, t, sym);
+            params.append(param);
+            if (parameterAnnotations != null) {
+                ParameterAnnotations annotations = parameterAnnotations[annotationIndex];
+                if (annotations != null && annotations.proxies != null
+                        && !annotations.proxies.isEmpty()) {
+                    annotate.normal(new AnnotationCompleter(param, annotations.proxies));
+                }
+            }
+            nameIndex += sawMethodParameters ? 1 : Code.width(t);
+            annotationIndex++;
         }
-        sym.savedParameterNames = paramNames.reverse();
+        if (parameterAnnotations != null && parameterAnnotations.length != annotationIndex) {
+            throw badClassFile("bad.runtime.invisible.param.annotations", sym);
+        }
+        Assert.checkNull(sym.params);
+        sym.params = params.toList();
+        parameterAnnotations = null;
+        parameterNameIndices = null;
+    }
+
+
+    // Returns the name for the parameter at position 'index', either using
+    // names read from the MethodParameters, or by synthesizing a name that
+    // is not on the 'exclude' list.
+    private Name parameterName(int index, List<Name> exclude) {
+        if (parameterNameIndices != null && index < parameterNameIndices.length
+                && parameterNameIndices[index] != 0) {
+            return readName(parameterNameIndices[index]);
+        }
+        String prefix = "arg";
+        while (true) {
+            Name argName = names.fromString(prefix + exclude.size());
+            if (!exclude.contains(argName))
+                return argName;
+            prefix += "$";
+        }
     }
 
     /**
--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/Profile.java	Thu Dec 14 22:06:19 2017 +0100
+++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/Profile.java	Thu Dec 21 22:05:28 2017 +0100
@@ -40,9 +40,9 @@
  *  deletion without notice.</b>
  */
 public enum Profile {
-    COMPACT1("compact1", 1, Target.JDK1_8, Target.JDK1_9, Target.JDK1_10),
-    COMPACT2("compact2", 2, Target.JDK1_8, Target.JDK1_9, Target.JDK1_10),
-    COMPACT3("compact3", 3, Target.JDK1_8, Target.JDK1_9, Target.JDK1_10),
+    COMPACT1("compact1", 1, Target.JDK1_8, Target.JDK1_9, Target.JDK1_10, Target.JDK1_11),
+    COMPACT2("compact2", 2, Target.JDK1_8, Target.JDK1_9, Target.JDK1_10, Target.JDK1_11),
+    COMPACT3("compact3", 3, Target.JDK1_8, Target.JDK1_9, Target.JDK1_10, Target.JDK1_11),
 
     DEFAULT {
         @Override
--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/Target.java	Thu Dec 14 22:06:19 2017 +0100
+++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/Target.java	Thu Dec 21 22:05:28 2017 +0100
@@ -64,7 +64,10 @@
     JDK1_9("1.9", 53, 0),
 
     /** JDK 10. */
-    JDK1_10("1.10", 54, 0);
+    JDK1_10("1.10", 54, 0),
+
+    /** JDK 11. */
+    JDK1_11("11", 55, 0);
 
     private static final Context.Key<Target> targetKey = new Context.Key<>();
 
@@ -95,6 +98,7 @@
         tab.put("8", JDK1_8);
         tab.put("9", JDK1_9);
         tab.put("10", JDK1_10);
+        tab.put("11", JDK1_11);
     }
 
     public final String name;
--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/processing/JavacFiler.java	Thu Dec 14 22:06:19 2017 +0100
+++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/processing/JavacFiler.java	Thu Dec 21 22:05:28 2017 +0100
@@ -712,20 +712,20 @@
     }
 
     private void checkNameAndExistence(ModuleSymbol mod, String typename, boolean allowUnnamedPackageInfo) throws FilerException {
-        // TODO: Check if type already exists on source or class path?
-        // If so, use warning message key proc.type.already.exists
         checkName(typename, allowUnnamedPackageInfo);
-        ClassSymbol existing;
+        ClassSymbol existing = elementUtils.getTypeElement(typename);
         boolean alreadySeen = aggregateGeneratedSourceNames.contains(Pair.of(mod, typename)) ||
                               aggregateGeneratedClassNames.contains(Pair.of(mod, typename)) ||
                               initialClassNames.contains(typename) ||
-                              ((existing = elementUtils.getTypeElement(typename)) != null &&
-                               initialInputs.contains(existing.sourcefile));
+                              (existing != null && initialInputs.contains(existing.sourcefile));
         if (alreadySeen) {
             if (lint)
                 log.warning(Warnings.ProcTypeRecreate(typename));
             throw new FilerException("Attempt to recreate a file for type " + typename);
         }
+        if (lint && existing != null) {
+            log.warning("proc.type.already.exists", typename);
+        }
         if (!mod.isUnnamed() && !typename.contains(".")) {
             throw new FilerException("Attempt to create a type in unnamed package of a named module: " + typename);
         }
--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/processing/PrintingProcessor.java	Thu Dec 14 22:06:19 2017 +0100
+++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/processing/PrintingProcessor.java	Thu Dec 21 22:05:28 2017 +0100
@@ -55,7 +55,7 @@
  * deletion without notice.</b>
  */
 @SupportedAnnotationTypes("*")
-@SupportedSourceVersion(SourceVersion.RELEASE_10)
+@SupportedSourceVersion(SourceVersion.RELEASE_11)
 public class PrintingProcessor extends AbstractProcessor {
     PrintWriter writer;
 
--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/resources/compiler.properties	Thu Dec 14 22:06:19 2017 +0100
+++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/resources/compiler.properties	Thu Dec 21 22:05:28 2017 +0100
@@ -1136,16 +1136,21 @@
 compiler.err.type.var.more.than.once.in.result=\
     type variable {0} occurs more than once in type of {1}; cannot be left uninstantiated
 
-# 0: type, 1: type, 2: string
-compiler.err.types.incompatible.diff.ret=\
-    types {0} and {1} are incompatible; both define {2}, but with unrelated return types
+# 0: type, 1: type, 2: fragment
+compiler.err.types.incompatible=\
+    types {0} and {1} are incompatible;\n\
+    {2}
+
+# 0: name, 1: list of type
+compiler.misc.incompatible.diff.ret=\
+    both define {0}({1}), but with unrelated return types
 
 # 0: kind name, 1: type, 2: name, 3: list of type, 4: symbol, 5: symbol
-compiler.err.types.incompatible.unrelated.defaults=\
+compiler.misc.incompatible.unrelated.defaults=\
     {0} {1} inherits unrelated defaults for {2}({3}) from types {4} and {5}
 
 # 0: kind name, 1: type, 2: name, 3: list of type, 4: symbol, 5: symbol
-compiler.err.types.incompatible.abstract.default=\
+compiler.misc.incompatible.abstract.default=\
     {0} {1} inherits abstract and default for {2}({3}) from types {4} and {5}
 
 # 0: name, 1: kind name, 2: symbol
--- a/src/jdk.dynalink/share/classes/jdk/dynalink/beans/AbstractJavaLinker.java	Thu Dec 14 22:06:19 2017 +0100
+++ b/src/jdk.dynalink/share/classes/jdk/dynalink/beans/AbstractJavaLinker.java	Thu Dec 21 22:05:28 2017 +0100
@@ -414,20 +414,21 @@
 
     protected GuardedInvocationComponent getGuardedInvocationComponent(final ComponentLinkRequest req)
     throws Exception {
-        if (!req.namespaces.isEmpty()) {
-            final Namespace ns = req.namespaces.get(0);
-            final Operation op = req.baseOperation;
-            if (op == StandardOperation.GET) {
-                if (ns == StandardNamespace.PROPERTY) {
-                    return getPropertyGetter(req.popNamespace());
-                } else if (ns == StandardNamespace.METHOD) {
-                    return getMethodGetter(req.popNamespace());
-                }
-            } else if (op == StandardOperation.SET && ns == StandardNamespace.PROPERTY) {
-                return getPropertySetter(req.popNamespace());
+        if (req.namespaces.isEmpty()) {
+            return null;
+        }
+        final Namespace ns = req.namespaces.get(0);
+        final Operation op = req.baseOperation;
+        if (op == StandardOperation.GET) {
+            if (ns == StandardNamespace.PROPERTY) {
+                return getPropertyGetter(req.popNamespace());
+            } else if (ns == StandardNamespace.METHOD) {
+                return getMethodGetter(req.popNamespace());
             }
+        } else if (op == StandardOperation.SET && ns == StandardNamespace.PROPERTY) {
+            return getPropertySetter(req.popNamespace());
         }
-        return null;
+        return getNextComponent(req.popNamespace());
     }
 
     GuardedInvocationComponent getNextComponent(final ComponentLinkRequest req) throws Exception {
--- a/src/jdk.dynalink/share/classes/jdk/dynalink/beans/BeanLinker.java	Thu Dec 14 22:06:19 2017 +0100
+++ b/src/jdk.dynalink/share/classes/jdk/dynalink/beans/BeanLinker.java	Thu Dec 21 22:05:28 2017 +0100
@@ -136,24 +136,21 @@
 
     @Override
     protected GuardedInvocationComponent getGuardedInvocationComponent(final ComponentLinkRequest req) throws Exception {
-        final GuardedInvocationComponent superGic = super.getGuardedInvocationComponent(req);
-        if(superGic != null) {
-            return superGic;
+        if (req.namespaces.isEmpty()) {
+            return null;
         }
-        if (!req.namespaces.isEmpty()) {
+        final Namespace ns = req.namespaces.get(0);
+        if (ns == StandardNamespace.ELEMENT) {
             final Operation op = req.baseOperation;
-            final Namespace ns = req.namespaces.get(0);
-            if (ns == StandardNamespace.ELEMENT) {
-                if (op == StandardOperation.GET) {
-                    return getElementGetter(req.popNamespace());
-                } else if (op == StandardOperation.SET) {
-                    return getElementSetter(req.popNamespace());
-                } else if (op == StandardOperation.REMOVE) {
-                    return getElementRemover(req.popNamespace());
-                }
+            if (op == StandardOperation.GET) {
+                return getElementGetter(req.popNamespace());
+            } else if (op == StandardOperation.SET) {
+                return getElementSetter(req.popNamespace());
+            } else if (op == StandardOperation.REMOVE) {
+                return getElementRemover(req.popNamespace());
             }
         }
-        return null;
+        return super.getGuardedInvocationComponent(req);
     }
 
     @Override
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/classfile/Classfile.java	Thu Dec 14 22:06:19 2017 +0100
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/classfile/Classfile.java	Thu Dec 21 22:05:28 2017 +0100
@@ -47,7 +47,7 @@
     private final List<ClassfileBytecode> codeAttributes;
 
     private static final int MAJOR_VERSION_JAVA_MIN = 51;
-    private static final int MAJOR_VERSION_JAVA_MAX = 54;
+    private static final int MAJOR_VERSION_JAVA_MAX = 55;
     private static final int MAGIC = 0xCAFEBABE;
 
     /**
--- a/src/jdk.jdeps/share/classes/com/sun/tools/jdeprscan/LoadProc.java	Thu Dec 14 22:06:19 2017 +0100
+++ b/src/jdk.jdeps/share/classes/com/sun/tools/jdeprscan/LoadProc.java	Thu Dec 21 22:05:28 2017 +0100
@@ -50,7 +50,7 @@
 
 import javax.tools.Diagnostic;
 
-import static javax.lang.model.SourceVersion.RELEASE_10;
+import static javax.lang.model.SourceVersion.RELEASE_11;
 
 /**
  * Annotation processor for the Deprecation Scanner tool.
@@ -58,7 +58,7 @@
  *
  */
 @SupportedAnnotationTypes("java.lang.Deprecated")
-@SupportedSourceVersion(RELEASE_10)
+@SupportedSourceVersion(RELEASE_11)
 public class LoadProc extends AbstractProcessor {
     Elements elements;
     Messager messager;
--- a/src/jdk.jdeps/share/classes/com/sun/tools/jdeprscan/Main.java	Thu Dec 14 22:06:19 2017 +0100
+++ b/src/jdk.jdeps/share/classes/com/sun/tools/jdeprscan/Main.java	Thu Dec 21 22:05:28 2017 +0100
@@ -106,7 +106,7 @@
     // Keep these updated manually until there's a compiler API
     // that allows querying of supported releases.
     final Set<String> releasesWithoutForRemoval = Set.of("6", "7", "8");
-    final Set<String> releasesWithForRemoval = Set.of("9", "10");
+    final Set<String> releasesWithForRemoval = Set.of("9", "10", "11");
 
     final Set<String> validReleases;
     {
@@ -358,14 +358,15 @@
      * Process classes from a particular JDK release, using only information
      * in this JDK.
      *
-     * @param release "6", "7", "8", "9", or "10"
+     * @param release "6", "7", "8", "9", "10", or "11"
      * @param classes collection of classes to process, may be empty
      * @return success value
      */
     boolean processRelease(String release, Collection<String> classes) throws IOException {
         options.addAll(List.of("--release", release));
 
-        if (release.equals("9") || release.equals("10")) {
+        if (release.equals("9") || release.equals("10") ||
+            release.equals("11")) {
             List<String> rootMods = List.of("java.se", "java.se.ee");
             TraverseProc proc = new TraverseProc(rootMods);
             JavaCompiler.CompilationTask task =
@@ -481,7 +482,7 @@
         String dir = null;
         String jar = null;
         String jdkHome = null;
-        String release = "10";
+        String release = "11";
         List<String> loadClasses = new ArrayList<>();
         String csvFile = null;
 
--- a/src/jdk.jshell/share/classes/jdk/internal/jshell/tool/JShellTool.java	Thu Dec 14 22:06:19 2017 +0100
+++ b/src/jdk.jshell/share/classes/jdk/internal/jshell/tool/JShellTool.java	Thu Dec 21 22:05:28 2017 +0100
@@ -1817,7 +1817,7 @@
 
         // Documentation pseudo-commands
         registerCommand(new Command("/<id>",
-                "help.id",
+                "help.slashID",
                 arg -> cmdHelp("rerun"),
                 EMPTY_COMPLETION_PROVIDER,
                 CommandKind.HELP_ONLY));
@@ -1829,6 +1829,9 @@
         registerCommand(new Command("intro",
                 "help.intro",
                 CommandKind.HELP_SUBJECT));
+        registerCommand(new Command("id",
+                "help.id",
+                CommandKind.HELP_SUBJECT));
         registerCommand(new Command("shortcuts",
                 "help.shortcuts",
                 CommandKind.HELP_SUBJECT));
--- a/src/jdk.jshell/share/classes/jdk/internal/jshell/tool/resources/l10n.properties	Thu Dec 14 22:06:19 2017 +0100
+++ b/src/jdk.jshell/share/classes/jdk/internal/jshell/tool/resources/l10n.properties	Thu Dec 21 22:05:28 2017 +0100
@@ -46,7 +46,7 @@
 jshell.err.file.exception = File ''{1}'' for ''{0}'' threw exception: {2}
 jshell.err.file.filename = ''{0}'' requires a filename argument.
 
-jshell.err.startup.unexpected.exception = Unexpected exception reading start-up: {0}
+jshell.err.startup.unexpected.exception = Unexpected exception reading startup: {0}
 jshell.err.unexpected.exception = Unexpected exception: {0}
 
 jshell.err.invalid.command = Invalid command: {0}
@@ -104,9 +104,9 @@
 Subjects:\n\
 \n
 
-jshell.err.no.snippet.with.id = No snippet with id: {0}
+jshell.err.no.snippet.with.id = No snippet with ID: {0}
 jshell.err.end.snippet.range.less.than.start = End of snippet range less than start: {0} - {1}
-jshell.err.range.requires.id = Snippet ranges require snippet ids: {0}
+jshell.err.range.requires.id = Snippet ranges require snippet IDs: {0}
 
 jshell.err.exit.not.expression = The argument to /exit must be a valid integer expression, it is not an expression: {0}
 jshell.err.exit.bad.type = The argument to /exit must be a valid integer expression. The type is {1} : {0}
@@ -114,7 +114,7 @@
 
 jshell.err.drop.arg =\
 In the /drop argument, please specify an import, variable, method, or class to drop.\n\
-Specify by id or name. Use /list to see ids. Use /reset to reset all state.
+Specify by ID or name. Use /list to see IDs. Use /reset to reset all state.
 jshell.err.failed = Failed.
 jshell.msg.native.method = Native Method
 jshell.msg.unknown.source = Unknown Source
@@ -193,15 +193,15 @@
    /help shortcuts
 
 help.usage = \
-Usage:   jshell <option>... <load file>...\n\
+Usage:   jshell <option>... <load-file>...\n\
 where possible options include:\n\
 \    --class-path <path>   Specify where to find user class files\n\
 \    --module-path <path>  Specify where to find application modules\n\
 \    --add-modules <module>(,<module>)*\n\
 \                          Specify modules to resolve, or all modules on the\n\
 \                            module path if <module> is ALL-MODULE-PATHs\n\
-\    --startup <file>      One run replacement for the start-up definitions\n\
-\    --no-startup          Do not run the start-up definitions\n\
+\    --startup <file>      One run replacement for the startup definitions\n\
+\    --no-startup          Do not run the startup definitions\n\
 \    --feedback <mode>     Specify the initial feedback mode. The mode may be\n\
 \                            predefined (silent, concise, normal, or verbose) or\n\
 \                            previously user-defined\n\
@@ -218,12 +218,22 @@
 \    --show-version        Print version information and continue\n\
 \    --help                Print this synopsis of standard options and exit\n\
 \    --help-extra, -X      Print help on non-standard options and exit\n\
+\n\
 A file argument may be a file name, or one of the predefined file names: DEFAULT,\n\
 PRINTING, or JAVASE.\n\
-A load file may also be "-" to indicate standard input, without interactive I/O.\n
+A load-file may also be "-" to indicate standard input, without interactive I/O.\n\
+\n\
+For more information on the evaluation context options (--class-path,\n\
+--module-path, and --add-modules) see:\n\t\
+     /help context\n\
+\n\
+A path lists the directories and archives to search. For Windows, use a\n\
+semicolon (;) to separate items in the path. On other platforms, use a\n\
+colon (:) to separate items.\n\
 
 help.usage.x = \
-\    --add-exports <module>/<package>   Export specified module-private package to snippets\n\
+\    --add-exports <module>/<package>   Specify a package to be considered as\n\
+\                                         exported from its defining module \n\
 \    --execution <spec>                 Specify an alternate execution engine.\n\
 \                                         Where <spec> is an ExecutionControl spec.\n\
 \                                         See the documentation of the package\n\
@@ -234,47 +244,43 @@
 help.list.summary = list the source you have typed
 help.list.args = [<name or id>|-all|-start]
 help.list =\
-Show the source of snippets, prefaced with the snippet id.\n\
+Show the snippets, prefaced with their snippet IDs.\n\
 \n\
 /list\n\t\
     List the currently active snippets of code that you typed or read with /open\n\n\
 /list -start\n\t\
-    List the automatically evaluated start-up snippets\n\n\
+    List the evaluated startup snippets\n\n\
 /list -all\n\t\
-    List all snippets including failed, overwritten, dropped, and start-up\n\n\
+    List all snippets including failed, overwritten, dropped, and startup\n\n\
 /list <name>\n\t\
     List snippets with the specified name (preference for active snippets)\n\n\
 /list <id>\n\t\
-    List the snippet with the specified snippet id\n\n\
-/list <id> <id>...\n\t\
-    List the snippets with the specified snippet ids\n\n\
-/list <id>-<id>\n\t\
-    List the snippets within the range of snippet ids
+    List the snippet with the specified snippet ID.\n\t\
+    One or more IDs or ID ranges may used, see '/help id'
 
-help.edit.summary = edit a source entry referenced by name or id
+help.edit.summary = edit a source entry
 help.edit.args = <name or id>
 help.edit =\
 Edit a snippet or snippets of source in an external editor.\n\
-The editor to use is set with /set editor.\n\
-If no editor has been set, a simple editor will be launched.\n\
+The editor to use is set with /set editor. If no editor is set, then the\n\
+following environment variables are checked in order: JSHELLEDITOR, VISUAL,\n\
+and EDITOR. If no editor has been set and none of the editor environment\n\
+variables is set, a simple editor will be launched.\n\
 \n\
 /edit <name>\n\t\
     Edit the snippet or snippets with the specified name (preference for active snippets)\n\n\
 /edit <id>\n\t\
-    Edit the snippet with the specified snippet id\n\n\
-/edit <id> <id>...\n\t\
-    Edit the snippets with the specified snippet ids\n\n\
-/edit <id>-<id>\n\t\
-    Edit the snippets within the range of snippet ids\n\n\
+    Edit the snippet with the specified snippet ID.\n\t\
+    One or more IDs or ID ranges may used, see '/help id'\n\n\
 /edit -start\n\t\
-    Edit the automatically evaluated start-up snippets. Any changes are in this\n\t\
-    session, and do not affect the start-up setting\n\n\
+    Edit the startup snippets. Any changes are in this session, and do not\n\t\
+    affect the startup setting\n\n\
 /edit -all\n\t\
-    Edit all snippets including failed, overwritten, dropped, and start-up\n\n\
+    Edit all snippets including failed, overwritten, dropped, and startup\n\n\
 /edit\n\t\
     Edit the currently active snippets of code that you typed or read with /open
 
-help.drop.summary = delete a source entry referenced by name or id
+help.drop.summary = delete a source entry
 help.drop.args = <name or id>
 help.drop =\
 Drop a snippet -- making it inactive.\n\
@@ -282,13 +288,10 @@
 /drop <name>\n\t\
     Drop the snippet with the specified name\n\n\
 /drop <id>\n\t\
-    Drop the snippet with the specified snippet id\n\n\
-/drop <id> <id>...\n\t\
-    Drop the snippets with the specified snippet ids\n\n\
-/drop <id>-<id>\n\t\
-    Drop the snippets within the range of snippet ids
+    Drop the snippet with the specified snippet ID.\n\t\
+    One or more IDs or ID ranges may used, see '/help id'
 
-help.save.summary = Save snippet source to a file.
+help.save.summary = Save snippet source to a file
 help.save.args = [-all|-history|-start] <file>
 help.save =\
 Save the specified snippets and/or commands to the specified file.\n\
@@ -297,17 +300,15 @@
     Save the source of current active snippets to the file.\n\n\
 /save -all <file>\n\t\
     Save the source of all snippets to the file.\n\t\
-    Includes source including overwritten, failed, and start-up code.\n\n\
+    Includes source of overwritten, failed, and startup code\n\n\
 /save -history <file>\n\t\
-    Save the sequential history of all commands and snippets entered since jshell was launched.\n\n\
+    Save the sequential history of all commands and snippets entered since the\n\t\
+    jshell tool was launched.\n\n\
 /save -start <file>\n\t\
-    Save the current start-up definitions to the file.\n\n\
+    Save the current startup definitions to the file\n\n\
 /save <id> <file>\n\t\
-    Save the snippet with the specified snippet id\n\n\
-/save <id> <id>... <file>\n\t\
-    Save the snippets with the specified snippet ids\n\n\
-/save <id>-<id> <file>\n\t\
-    Save the snippets within the range of snippet ids
+    Save the snippet with the specified snippet ID.\n\t\
+    One or more IDs or ID ranges may used, see '/help id'
 
 help.open.summary = open a file as source input
 help.open.args = <file>
@@ -315,97 +316,94 @@
 Open a file and read its contents as snippets and commands.\n\
 \n\
 /open <file>\n\t\
-    Read the specified file as jshell input.
+    Read the specified file as the jshell tool input.\n\
+\n\
+The <file> may be an operating system file name, or one of the predefined\n\
+file names: DEFAULT, PRINTING, or JAVASE.\n\
+These are respectively: the default import snippets (as used by -default),\n\
+definitions of print(), println(), and printf() method snippets, or\n\
+imports of all Java SE packages.\n
 
 help.vars.summary = list the declared variables and their values
 help.vars.args = [<name or id>|-all|-start]
 help.vars =\
-List the type, name, and value of jshell variables.\n\
+List the type, name, and value of variables that were entered.\n\
 \n\
 /vars\n\t\
-    List the type, name, and value of the current active jshell variables\n\n\
+    List the type, name, and value of the current active variables\n\n\
 /vars <name>\n\t\
-    List jshell variables with the specified name (preference for active variables)\n\n\
+    List variables with the specified name (preference for active variables)\n\n\
 /vars <id>\n\t\
-    List the jshell variable with the specified snippet id\n\n\
-/vars <id> <id>... <file>\n\t\
-    List the jshell variables with the specified snippet ids\n\n\
-/vars <id>-<id> <file>\n\t\
-    List the jshell variables within the range of snippet ids\n\n\
+    List the variable with the specified snippet ID.\n\t\
+    One or more IDs or ID ranges may used, see '/help id'\n\n\
 /vars -start\n\t\
-    List the automatically added start-up jshell variables\n\n\
+    List the variables in the evaluated startup snippets\n\n\
 /vars -all\n\t\
-    List all jshell variables including failed, overwritten, dropped, and start-up
+    List all variables including failed, overwritten, dropped, and startup
 
 help.methods.summary = list the declared methods and their signatures
 help.methods.args = [<name or id>|-all|-start]
 help.methods =\
-List the name, parameter types, and return type of jshell methods.\n\
+List the name, parameter types, and return type of methods that were entered.\n\
 \n\
 /methods\n\t\
-    List the name, parameter types, and return type of the current active jshell methods\n\n\
+    List the name, parameter types, and return type of the current active methods\n\n\
 /methods <name>\n\t\
-    List jshell methods with the specified name (preference for active methods)\n\n\
+    List methods with the specified name (preference for active methods)\n\n\
 /methods <id>\n\t\
-    List the jshell method with the specified snippet id\n\n\
-/methods <id> <id>... <file>\n\t\
-    List jshell methods with the specified snippet ids\n\n\
-/methods <id>-<id> <file>\n\t\
-    List jshell methods within the range of snippet ids\n\n\
+    List the method with the specified snippet ID.\n\t\
+    One or more IDs or ID ranges may used, see '/help id'\n\n\
 /methods -start\n\t\
-    List the automatically added start-up jshell methods\n\n\
+    List the methods in the evaluated startup snippets\n\n\
 /methods -all\n\t\
-    List all snippets including failed, overwritten, dropped, and start-up
+    List all snippets including failed, overwritten, dropped, and startup
 
-help.types.summary = list the declared types
+help.types.summary = list the type declarations
 help.types.args =[<name or id>|-all|-start]
 help.types =\
-List jshell classes, interfaces, and enums.\n\
+List classes and interfaces that were entered.\n\
 \n\
 /types\n\t\
-    List the current active jshell classes, interfaces, and enums.\n\n\
+    List the current active type declarations\n\n\
 /types <name>\n\t\
-    List jshell types with the specified name (preference for active types)\n\n\
+    List type declarations with the specified name (preference for active snippets)\n\n\
 /types <id>\n\t\
-    List the jshell type with the specified snippet id\n\n\
-/types <id> <id>... <file>\n\t\
-    List jshell types with the specified snippet ids\n\n\
-/types <id>-<id> <file>\n\t\
-    List jshell types within the range of snippet ids\n\n\
+    List the type declaration with the specified snippet ID.\n\t\
+    One or more IDs or ID ranges may used, see '/help id'\n\n\
 /types -start\n\t\
-    List the automatically added start-up jshell types\n\n\
+    List the type declarations in the evaluated startup snippets\n\n\
 /types -all\n\t\
-    List all jshell types including failed, overwritten, dropped, and start-up
+    List all type declarations including failed, overwritten, dropped, and startup
 
 help.imports.summary = list the imported items
 help.imports.args =
 help.imports =\
-List the current active jshell imports.
+List the current active imports.  This will include imports from\n\
+startup snippets.
 
-help.exit.summary = exit jshell
+help.exit.summary = exit the jshell tool
 help.exit.args =[<integer-expression-snippet>]
 help.exit =\
 Leave the jshell tool.  No work is saved.\n\
 Save any work before using this command\n\
 \n\
 /exit\n\t\
-    Leave the jshell tool.  The exit status is zero.\n\n\
+    Leave the jshell tool.  The exit status is zero\n\n\
 /exit <integer-expression-snippet>\n\t\
     Evaluate the snippet.  If the snippet fails or is not an integer expression,\n\t\
     display the error.  Otherwise leave the jshell tool with the\n\t\
     value of the expression as the exit status
 
-help.reset.summary = reset jshell
+help.reset.summary = reset the jshell tool
 help.reset.args = \
 [-class-path <path>] [-module-path <path>] [-add-modules <modules>]...
 help.reset =\
 Reset the jshell tool code and execution state:\n\t\
-   * All entered code is lost.\n\t\
-   * Start-up code is re-executed.\n\t\
-   * The execution state is restarted.\n\t\
-Tool settings are maintained, as set with: /set ...\n\
+   * All entered code is lost\n\t\
+   * The execution state is restarted\n\t\
+   * Startup code is re-executed\n\
 Save any work before using this command.\n\
-The /reset command accepts context options, see:\n\n\t\
+The /reset command accepts evaluation context options, see:\n\n\t\
      /help context\n\
 
 
@@ -417,18 +415,19 @@
 and any /drop commands in the order they were entered.\n\
 \n\
 /reload\n\t\
-     Reset and replay the valid history since jshell was entered, or\n\t\
-     a /reset, or /reload command was executed -- whichever is most\n\t\
-     recent.\n\n\
+     Reset and replay the valid history since the jshell tool was entered, or\n\t\
+     a /reset or /reload command was executed -- whichever is most\n\t\
+     recent\n\n\
 /reload -restore\n\t\
      Reset and replay the valid history between the previous and most\n\t\
-     recent time that jshell was entered, or a /reset, /reload, or /env\n\t\
+     recent time that the jshell tool was entered, or a /reset, /reload, or /env\n\t\
      command was executed. This can thus be used to restore a previous\n\t\
-     jshell tool session.\n\n\
+     jshell tool session\n\n\
 /reload [-restore] -quiet\n\t\
-     With the '-quiet' argument the replay is not shown.  Errors will display.\n\
+     With the '-quiet' argument the replay is not shown, however any errors\n\t\
+     will be displayed\n\
 \n\
-Each of the above accepts context options, see:\n\n\t\
+Each of the above accepts evaluation context options, see:\n\n\t\
      /help context\n\
 \n\
 For example:\n\n\t\
@@ -439,28 +438,30 @@
 [-class-path <path>] [-module-path <path>] [-add-modules <modules>] ...
 help.env =\
 View or change the evaluation context.  The evaluation context is the class path,\n\
-module path, etc.\n\
+module path, etc.\n\n\
 /env\n\t\
-     Show the evaluation context displayed as context options.\n\n\
+     Show the evaluation context displayed as context options\n\n\
 /env [-class-path <path>] [-module-path <path>] [-add-modules <modules>] ...\n\t\
      With at least one option set, sets the evaluation context.  If snippets\n\t\
      have been defined, the execution state is reset with the new\n\t\
      evaluation context and the snippets will be replayed -- the replay is not\n\t\
-     shown, however, errors will display.  This is equivalent to: /reload -quiet\n\t\
-     For details of context options, see:\n\n\t\t\
-           /help context\n\n\t\
-     For example:\n\n\t\t\
-           /env -add-modules com.greetings
+     shown, however any errors will be displayed.  This is equivalent to:\n\n\t\t\
+             /reload -quiet ...\n\
+\n\
+For details of evaluation context options, see:\n\n\t\
+     /help context\n\n\
+For example:\n\n\t\
+     /env -add-modules com.greetings
 
 help.history.summary = history of what you have typed
 help.history.args =
 help.history =\
-Display the history of snippet and command input since this jshell was launched.
+Display the history of snippet and command input since this jshell tool was launched.
 
-help.debug.summary = toggle debugging of the jshell
+help.debug.summary = toggle debugging of the jshell tool
 help.debug.args = [0][r][g][f][c][d][e]
 help.debug =\
-Display debugging information for the jshell implementation.\n\
+Display debugging information for the jshell tool implementation.\n\
 0: Debugging off\n\
 r: Tool level debugging on\n\
 g: General debugging on\n\
@@ -469,12 +470,12 @@
 d: Dependency debugging on\n\
 e: Event debugging on
 
-help.help.summary = get information about jshell
+help.help.summary = get information about using the jshell tool
 help.help.args = [<command>|<subject>]
 help.help =\
-Display information about jshell.\n\
+Display information about using the jshell tool.\n\
 /help\n\t\
-     List the jshell commands and help subjects.\n\n\
+     List the jshell tool commands and help subjects\n\n\
 /help <command>\n\t\
      Display information about the specified command. The slash must be included.\n\t\
      Only the first few letters of the command are needed -- if more than one\n\t\
@@ -482,40 +483,40 @@
 /help <subject>\n\t\
      Display information about the specified help subject. Example: /help intro
 
-help.set.summary = set jshell configuration information
+help.set.summary = set configuration information
 help.set.args = editor|start|feedback|mode|prompt|truncation|format ...
 help.set =\
-Set jshell configuration information, including:\n\
-the external editor to use, the start-up definitions to use, a new feedback mode,\n\
+Set the jshell tool configuration information, including:\n\
+the external editor to use, the startup definitions to use, a new feedback mode,\n\
 the command prompt, the feedback mode to use, or the format of output.\n\
 \n\
 /set editor [-wait] <command> <optional-arg>...\n\t\
      Specify the command to launch for the /edit command.\n\t\
-     The <command> is an operating system dependent string.\n\n\
+     The <command> is an operating system dependent string\n\n\
 /set start <file>\n\t\
-     The contents of the specified <file> become the default start-up snippets and commands.\n\n\
+     The contents of the specified <file> become the default startup snippets and commands\n\n\
 /set feedback <mode>\n\t\
-     Set the feedback mode describing displayed feedback for entered snippets and commands.\n\n\
+     Set the feedback mode describing displayed feedback for entered snippets and commands\n\n\
 /set mode <mode> [<old-mode>] -command|-quiet|-delete\n\t\
-     Create or update a user-defined feedback mode, optionally copying from an existing mode.\n\n\
+     Create or update a user-defined feedback mode, optionally copying from an existing mode\n\n\
 /set prompt <mode> "<prompt>" "<continuation-prompt>"\n\t\
-     Set the displayed prompts for a given feedback mode.\n\n\
+     Set the displayed prompts for a given feedback mode\n\n\
 /set truncation <mode> <length> <selector>...\n\t\
-     Set the maximum length of a displayed value.\n\n\
+     Set the maximum length of a displayed value\n\n\
 /set format <mode> <field> "<format>" <selector>...\n\t\
-     Configure a feedback mode by setting the format of a field when the selector matches.\n\n\
+     Configure a feedback mode by setting the format of a field when the selector matches\n\n\
 /set\n\t\
      Show editor, start, and feedback settings as /set commands.\n\t\
-     To show the settings of any of the above, omit the set value.\n\n\
+     To show the settings of any of the above, omit the set value\n\n\
 To get more information about one of these forms, use /help with the form specified.\n\
 For example:   /help /set format
 
-help.quest.summary = get information about jshell
+help.quest.summary = get information about using the jshell tool
 help.quest.args = [<command>|<subject>]
 help.quest =\
-Display information about jshell (abbreviation for /help).\n\
+Display information about using the jshell tool (abbreviation for /help).\n\
 /?\n\t\
-     Display list of commands and help subjects.\n\
+     Display list of commands and help subjects\n\
 /? <command>\n\t\
      Display information about the specified command. The slash must be included.\n\t\
      Only the first few letters of the command are needed -- if more than one\n\t\
@@ -528,17 +529,18 @@
 help.bang =\
 Reevaluate the most recently entered snippet.
 
-help.id.summary = rerun snippets by id or id range -- see /help rerun
-help.id.args =
-help.id =\
+help.slashID.summary = rerun snippets by ID or ID range -- see /help rerun
+help.slashID.args =
+help.slashID =\
 /<id> <id> <id>\n\
 \n\
 /<id>-<id>\n\
 \n\
-Reevaluate the snippets specified by the id or id range.\n\
-An id range is represented as a two ids separated by a hyphen, e.g.:  3-17\n\
-Start-up and error snippets maybe used, e.g.:  s3-s9    or   e1-e4\n\
-Any number of ids or id ranges may be used, e.g.:  /3-7 s4 14-16 e2
+Reevaluate the snippets specified by the ID or ID range.\n\
+An ID range is represented as a two IDs separated by a hyphen, e.g.:  3-17\n\
+Startup and error snippets maybe used, e.g.:  s3-s9    or   e1-e4\n\
+Any number of IDs or ID ranges may be used, e.g.:  /3-7 s4 14-16 e2\n\
+See '/help id'.
 
 help.previous.summary = rerun n-th previous snippet -- see /help rerun
 help.previous.args =
@@ -553,7 +555,7 @@
 or a Java statement or import.\n\
 These little chunks of Java code are called 'snippets'.\n\
 \n\
-There are also jshell commands that allow you to understand and\n\
+There are also the jshell tool commands that allow you to understand and\n\
 control what you are doing, like:  /list\n\
 \n\
 For a list of commands: /help
@@ -565,7 +567,7 @@
 \n\
 <tab>\n\t\t\
         After entering the first few letters of a Java identifier,\n\t\t\
-        a jshell command, or, in some cases, a jshell command argument,\n\t\t\
+        a jshell tool command, or, in some cases, a jshell tool command argument,\n\t\t\
         press the <tab> key to complete the input.\n\t\t\
         If there is more than one completion, then possible completions will be shown.\n\t\t\
         Will show documentation if available and appropriate.\n\n\
@@ -580,26 +582,26 @@
         of the expression.\n\n\
 Shift-<tab> i\n\t\t\
         After an unresolvable identifier, hold down <shift> while pressing <tab>,\n\t\t\
-        then release and press "i", and jshell will propose possible imports\n\t\t\
+        then release and press "i", and the jshell tool will propose possible imports\n\t\t\
         which will resolve the identifier based on the content of the specified classpath.
 
 help.context.summary = a description of the evaluation context options for /env /reload and /reset
 help.context =\
-These options configure the evaluation context, they can be specified when\n\
-jshell is started: on the command-line, or restarted with the commands /env,\n\
-/reload, or /reset.\n\
+These options configure the evaluation context.  They can be specified on the\n\
+command-line when the jshell tool is started or as command options when the jshell tool is\n\
+restarted with the commands /env, /reload, or /reset.\n\
 \n\
 They are:\n\t\
-    --class-path <class search path of directories and zip/jar files>\n\t\t\
-                  A list of directories, JAR archives,\n\t\t\
+    --class-path <path>\n\t\t\
+                  The <path> is a list of directories, JAR archives,\n\t\t\
                   and ZIP archives to search for class files.\n\t\t\
-                  The list is separated with the path separator\n\t\t\
-                  (a : on unix/linux/mac, and ; on windows).\n\t\
-    --module-path <module path>...\n\t\t\
-                  A list of directories, each directory\n\t\t\
-                  is a directory of modules.\n\t\t\
-                  The list is separated with the path separator\n\t\t\
-                  (a : on unix/linux/mac, and ; on windows).\n\t\
+                  For Windows, use a semicolon (;) to separate items in the\n\t\t\
+                  path. On other platforms, use a  colon (:) to separate items.\n\t\
+    --module-path <path>...\n\t\t\
+                  The <path> is a list of directories, JAR archives,\n\t\t\
+                  and ZIP archives to search for modules.\n\t\t\
+                  For Windows, use a semicolon (;) to separate items in the\n\t\t\
+                  path. On other platforms, use a  colon (:) to separate items.\n\t\
     --add-modules <modulename>[,<modulename>...]\n\t\t\
                   root modules to resolve in addition to the initial module.\n\t\t\
                   <modulename> can also be ALL-DEFAULT, ALL-SYSTEM,\n\t\t\
@@ -611,8 +613,42 @@
                   unnamed modules. In jshell, if the <target-module> is not\n\t\t\
                   specified (no =) then ALL-UNNAMED is used.\n\
 \n\
+Evaluation context options entered on the command line or provided with a\n\
+previous /reset, /env, or /reload command are maintained unless an option is\n\
+entered that overwrites the setting.\n\
+\n\
 On the command-line these options must have two dashes, e.g.: --module-path\n\
-On jshell commands they can have one or two dashes, e.g.: -module-path\n\
+On the jshell tool commands they can have one or two dashes, e.g.: -module-path
+
+help.id.summary = a description of snippet IDs and how use them
+help.id =\
+Every snippet of code you enter has its own unique snippet ID.  Even if you\n\
+enter the same snippet again, it will have a new ID.  For normal snippets the ID\n\
+is an increasing number.  Snippets which fail with an error have a snippet ID\n\
+which begins with 'e'.  Snippets in the startup have an ID which begins with 's'.\n\
+\n\
+A snippet ID is one way to refer to a snippet in a command.  For example, this\n\
+command drops the snippet with ID '14':\n\
+\n\t\
+        /drop 14\n\
+\n\
+To see the ID of a snippet or snippets use the '/list' command.  To see the ID\n\
+of all snippets. including failed, startup, and overwritten snippets, use the\n\
+'/list -all' command.\n\
+\n\
+You can also refer to a range of IDs by separating the beginning ID and ending\n\
+ID with a hypen.  For example, '1-4' is the same as '1 2 3 4'.  All commands\n\
+which refer to snippets will take a list of IDs, ID ranges, and snippet names\n\
+as arguments.  These commands are: /list, /edit, /drop, /save, /vars, /methods,\n\
+/types, and /<id>.  Some examples:\n\
+\n\t\
+        /edit 7-23\n\
+\n\t\
+        /save s1-s4 3-8 foo 12 myfile\n\
+\n\t\
+        /9-12 33\n\
+\n\
+See '/help /edit', '/help /save', and '/help rerun' respectively.
 
 help.rerun.summary = a description of ways to re-evaluate previously entered snippets
 help.rerun =\
@@ -639,10 +675,11 @@
     \t2 + 2\n\
     \t$5 ==> 4\n\
 \n\
-The snippets to re-evaluate may be specified by snippet id or id range.\n\
-An id range is represented as a two ids separated by a hyphen, e.g.:  3-17\n\
-Start-up and error snippets maybe used, e.g.:  s3-s9    or   e1-e4\n\
-Any number of ids or id ranges may be used, e.g.:  /3-7 s4 14-16 e2\n\
+The snippets to re-evaluate may be specified by snippet ID or ID range.\n\
+An ID range is represented as a two IDs separated by a hyphen, e.g.:  3-17\n\
+Startup and error snippets maybe used, e.g.:  s3-s9    or   e1-e4\n\
+Any number of IDs or ID ranges may be used, e.g.:  /3-7 s4 14-16 e2\n\
+See also '/help id'.\n\
 \n\
 Finally, you can search backwards through history by entering ctrl-R followed by the string to search for.
 
@@ -656,7 +693,7 @@
 See these commands for more detail -- for example /help /set editor
 
 help.set.format.summary = \
-Set the format for reporting a snippet event.
+Set the format for reporting a snippet event
 
 help.set.format = \
 Set the format for reporting a snippet event:\n\
@@ -746,7 +783,7 @@
 shows the format settings for the mode mymode\n
 
 help.set.truncation.summary = \
-Set the max length of a displayed value.
+Set the max length of a displayed value
 
 help.set.truncation = \
 Set the max length of a displayed value:\n\
@@ -789,7 +826,7 @@
 shows the truncation settings for the mode mymode\n
 
 help.set.feedback.summary = \
-Set the feedback mode describing displayed feedback for entered snippets and commands.
+Set the feedback mode describing displayed feedback for entered snippets and commands
 
 help.set.feedback = \
 Set the feedback mode describing displayed feedback for entered snippets and commands:\n\
@@ -814,7 +851,7 @@
 The form without <mode> or -retain displays the current feedback mode and available modes.\n
 
 help.set.mode.summary = \
-Create a user-defined feedback mode, optionally copying from an existing mode.
+Create a user-defined feedback mode, optionally copying from an existing mode
 
 help.set.mode = \
 Create a user-defined feedback mode, optionally copying from an existing mode:\n\
@@ -869,7 +906,7 @@
 shows the mode, prompt, format, and truncation settings for the mode mymode
 
 help.set.prompt.summary = \
-Set the prompts.
+Set the prompts
 
 help.set.prompt = \
 Set the prompts.  Both the normal prompt and the continuation-prompt must be set:\n\
@@ -881,9 +918,9 @@
 /set prompt [<mode>]\n\
 \n\
 Where <mode> is the name of a previously defined feedback mode.\n\
-Where <prompt> and <continuation-prompt> are quoted strings printed as input prompts;\n\
-Both may optionally contain '%%s' which will be substituted with the next snippet id --\n\
-note that what is entered may not be assigned that id, for example it may be an error or command.\n\
+Where <prompt> and <continuation-prompt> are quoted strings to be printed as input prompts.\n\
+Both may optionally contain '%%s' which will be substituted with the next snippet ID --\n\
+note that what is entered may not be assigned that ID, for example it may be an error or command.\n\
 The continuation-prompt is used on the second and subsequent lines of a multi-line snippet.\n\
 \n\
 The form without <prompt> shows the currently set prompts.\n\
@@ -893,7 +930,7 @@
 shows the prompts set for the mode mymode\n
 
 help.set.editor.summary =\
-Specify the command to launch for the /edit command.
+Specify the command to launch for the /edit command
 
 help.set.editor =\
 Specify the command to launch for the /edit command:\n\
@@ -937,10 +974,10 @@
 The form without <command> or options shows the editor setting.\n
 
 help.set.start.summary =\
-Set the start-up configuration.
+Set the startup configuration
 
 help.set.start =\
-Set the start-up configuration -- a sequence of snippets and commands read at start-up:\n\
+Set the startup configuration -- a sequence of snippets and commands read at startup:\n\
 \n\t\
 /set start [-retain] <file>...\n\
 \n\t\
@@ -948,29 +985,29 @@
 \n\t\
 /set start [-retain] -none\n\
 \n\
-Retain the start-up configuration for future sessions:\n\
+Retain the startup configuration for future sessions:\n\
 \n\t\
 /set start -retain\n\
 \n\
-Show the start-up setting:\n\
+Show the startup setting:\n\
 \n\t\
 /set start\n\
 \n\
-The contents of the specified <file> become the start-up snippets and commands used\n\
+The contents of the specified <file> become the startup snippets and commands used\n\
 when the /reset, /reload, or /env commands are used in this session.\n\
-If instead the -default option is specified, the predefined start-up import\n\
+If instead the -default option is specified, the predefined startup import\n\
 snippets will be used.\n\
-If the -none option is used, the start-up will be empty -- no start-up snippets\n\
+If the -none option is used, the startup will be empty -- no startup snippets\n\
 or commands will be used.\n\
-This command is good for testing the start-up settings.  To retain them for future\n\
+This command is good for testing the startup settings.  To retain them for future\n\
 runs of the jshell tool use the command:\n\t\
 /set start -retain\n\
 \n\
 When the -retain option is used, the setting will be used in this and future\n\
 runs of the jshell tool.\n\
 \n\
-The form without <file> or options shows the start-up setting.\n\
-Note: if the start-up was last set from a file, this is shown with the\n\
+The form without <file> or options shows the startup setting.\n\
+Note: if the startup was last set from a file, this is shown with the\n\
 'set start' command followed by the contents of the file.\n\
 \n\
 The <file> may be an operating system file name, or one of the predefined\n\
--- a/src/jdk.rmic/share/classes/sun/tools/java/RuntimeConstants.java	Thu Dec 14 22:06:19 2017 +0100
+++ b/src/jdk.rmic/share/classes/sun/tools/java/RuntimeConstants.java	Thu Dec 21 22:05:28 2017 +0100
@@ -67,7 +67,7 @@
     /* Class File Constants */
     int JAVA_MAGIC                   = 0xcafebabe;
     int JAVA_MIN_SUPPORTED_VERSION   = 45;
-    int JAVA_MAX_SUPPORTED_VERSION   = 54;
+    int JAVA_MAX_SUPPORTED_VERSION   = 55;
     int JAVA_MAX_SUPPORTED_MINOR_VERSION = 0;
 
     /* Generate class file version for 1.1  by default */
--- a/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/codegen/AssignSymbols.java	Thu Dec 14 22:06:19 2017 +0100
+++ b/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/codegen/AssignSymbols.java	Thu Dec 21 22:05:28 2017 +0100
@@ -59,6 +59,7 @@
 import java.util.Map;
 import java.util.Set;
 import jdk.nashorn.internal.ir.AccessNode;
+import jdk.nashorn.internal.ir.BaseNode;
 import jdk.nashorn.internal.ir.BinaryNode;
 import jdk.nashorn.internal.ir.Block;
 import jdk.nashorn.internal.ir.CatchNode;
@@ -735,72 +736,13 @@
 
     @Override
     public Node leaveUnaryNode(final UnaryNode unaryNode) {
-        switch (unaryNode.tokenType()) {
-        case DELETE:
-            return leaveDELETE(unaryNode);
-        case TYPEOF:
+        if (unaryNode.tokenType() == TokenType.TYPEOF) {
             return leaveTYPEOF(unaryNode);
-        default:
+        } else {
             return super.leaveUnaryNode(unaryNode);
         }
     }
 
-    private Node leaveDELETE(final UnaryNode unaryNode) {
-        final FunctionNode currentFunctionNode = lc.getCurrentFunction();
-        final boolean      strictMode          = currentFunctionNode.isStrict();
-        final Expression   rhs                 = unaryNode.getExpression();
-        final Expression   strictFlagNode      = (Expression)LiteralNode.newInstance(unaryNode, strictMode).accept(this);
-
-        Request request = Request.DELETE;
-        final List<Expression> args = new ArrayList<>();
-
-        if (rhs instanceof IdentNode) {
-            final IdentNode ident = (IdentNode)rhs;
-            // If this is a declared variable or a function parameter, delete always fails (except for globals).
-            final String name = ident.getName();
-            final Symbol symbol = ident.getSymbol();
-
-            if (symbol.isThis()) {
-                // Can't delete "this", ignore and return true
-                return LiteralNode.newInstance(unaryNode, true);
-            }
-            final Expression literalNode = LiteralNode.newInstance(unaryNode, name);
-            final boolean failDelete = strictMode || (!symbol.isScope() && (symbol.isParam() || (symbol.isVar() && !symbol.isProgramLevel())));
-
-            if (!failDelete) {
-                args.add(compilerConstantIdentifier(SCOPE));
-            }
-            args.add(literalNode);
-            args.add(strictFlagNode);
-
-            if (failDelete) {
-                request = Request.FAIL_DELETE;
-            } else if ((symbol.isGlobal() && !symbol.isFunctionDeclaration()) || symbol.isProgramLevel()) {
-                request = Request.SLOW_DELETE;
-            }
-        } else if (rhs instanceof AccessNode) {
-            final Expression base     = ((AccessNode)rhs).getBase();
-            final String     property = ((AccessNode)rhs).getProperty();
-
-            args.add(base);
-            args.add(LiteralNode.newInstance(unaryNode, property));
-            args.add(strictFlagNode);
-
-        } else if (rhs instanceof IndexNode) {
-            final IndexNode indexNode = (IndexNode)rhs;
-            final Expression base  = indexNode.getBase();
-            final Expression index = indexNode.getIndex();
-
-            args.add(base);
-            args.add(index);
-            args.add(strictFlagNode);
-
-        } else {
-            throw new AssertionError("Unexpected delete with " + rhs.getClass().getName() + " expression");
-        }
-        return new RuntimeNode(unaryNode, request, args);
-    }
-
     @Override
     public Node leaveForNode(final ForNode forNode) {
         if (forNode.isForInOrOf()) {
--- a/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/codegen/CodeGenerator.java	Thu Dec 14 22:06:19 2017 +0100
+++ b/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/codegen/CodeGenerator.java	Thu Dec 21 22:05:28 2017 +0100
@@ -151,6 +151,7 @@
 import jdk.nashorn.internal.runtime.UnwarrantedOptimismException;
 import jdk.nashorn.internal.runtime.arrays.ArrayData;
 import jdk.nashorn.internal.runtime.linker.LinkerCallSite;
+import jdk.nashorn.internal.runtime.linker.NashornCallSiteDescriptor;
 import jdk.nashorn.internal.runtime.logging.DebugLogger;
 import jdk.nashorn.internal.runtime.logging.Loggable;
 import jdk.nashorn.internal.runtime.logging.Logger;
@@ -1142,6 +1143,12 @@
             }
 
             @Override
+            public boolean enterDELETE(final UnaryNode unaryNode) {
+                loadDELETE(unaryNode);
+                return false;
+            }
+
+            @Override
             public boolean enterEQ(final BinaryNode binaryNode) {
                 loadCmp(binaryNode, Condition.EQ);
                 return false;
@@ -3791,6 +3798,53 @@
         }
     }
 
+    public void loadDELETE(final UnaryNode unaryNode) {
+        final Expression expression = unaryNode.getExpression();
+        if (expression instanceof IdentNode) {
+            final IdentNode ident = (IdentNode)expression;
+            final Symbol symbol = ident.getSymbol();
+            final String name = ident.getName();
+
+            if (symbol.isThis()) {
+                // Can't delete "this", ignore and return true
+                if (!lc.popDiscardIfCurrent(unaryNode)) {
+                    method.load(true);
+                }
+            } else if (lc.getCurrentFunction().isStrict()) {
+                // All other scope identifier delete attempts fail for strict mode
+                method.load(name);
+                method.invoke(ScriptRuntime.STRICT_FAIL_DELETE);
+            } else if (!symbol.isScope() && (symbol.isParam() || (symbol.isVar() && !symbol.isProgramLevel()))) {
+                // If symbol is a function parameter, or a declared non-global variable, delete is a no-op and returns false.
+                if (!lc.popDiscardIfCurrent(unaryNode)) {
+                    method.load(false);
+                }
+            } else {
+                method.loadCompilerConstant(SCOPE);
+                method.load(name);
+                if ((symbol.isGlobal() && !symbol.isFunctionDeclaration()) || symbol.isProgramLevel()) {
+                    method.invoke(ScriptRuntime.SLOW_DELETE);
+                } else {
+                    method.load(false); // never strict here; that was handled with STRICT_FAIL_DELETE above.
+                    method.invoke(ScriptObject.DELETE);
+                }
+            }
+        } else if (expression instanceof BaseNode) {
+            loadExpressionAsObject(((BaseNode)expression).getBase());
+            if (expression instanceof AccessNode) {
+                final AccessNode accessNode = (AccessNode) expression;
+                method.dynamicRemove(accessNode.getProperty(), getCallSiteFlags(), accessNode.isIndex());
+            } else if (expression instanceof IndexNode) {
+                loadExpressionAsObject(((IndexNode) expression).getIndex());
+                method.dynamicRemoveIndex(getCallSiteFlags());
+            } else {
+                throw new AssertionError(expression.getClass().getName());
+            }
+        } else {
+            throw new AssertionError(expression.getClass().getName());
+        }
+    }
+
     public void loadADD(final BinaryNode binaryNode, final TypeBounds resultBounds) {
         new OptimisticOperation(binaryNode, resultBounds) {
             @Override
--- a/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/codegen/LocalVariableTypesCalculator.java	Thu Dec 14 22:06:19 2017 +0100
+++ b/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/codegen/LocalVariableTypesCalculator.java	Thu Dec 21 22:05:28 2017 +0100
@@ -43,6 +43,7 @@
 import java.util.Set;
 import jdk.nashorn.internal.codegen.types.Type;
 import jdk.nashorn.internal.ir.AccessNode;
+import jdk.nashorn.internal.ir.BaseNode;
 import jdk.nashorn.internal.ir.BinaryNode;
 import jdk.nashorn.internal.ir.Block;
 import jdk.nashorn.internal.ir.BreakNode;
@@ -1093,9 +1094,15 @@
     @Override
     public boolean enterUnaryNode(final UnaryNode unaryNode) {
         final Expression expr = unaryNode.getExpression();
-        final LvarType unaryType = toLvarType(unaryNode.setExpression(visitExpression(expr).typeExpression).getType());
-        if(unaryNode.isSelfModifying() && expr instanceof IdentNode) {
-            onSelfAssignment((IdentNode)expr, unaryType);
+        final LvarType unaryType;
+        if (unaryNode.tokenType() == TokenType.DELETE && expr instanceof IdentNode) {
+            // not visiting deleted identifiers; they don't count as use
+            unaryType = toLvarType(unaryNode.getType());
+        } else {
+            unaryType = toLvarType(unaryNode.setExpression(visitExpression(expr).typeExpression).getType());
+            if (unaryNode.isSelfModifying() && expr instanceof IdentNode) {
+                onSelfAssignment((IdentNode) expr, unaryType);
+            }
         }
         typeStack.push(unaryType);
         return false;
@@ -1348,6 +1355,12 @@
                 return true;
             }
 
+            @Override
+            public boolean enterUnaryNode(final UnaryNode unaryNode) {
+                // not visiting deleted identifiers; they don't count as use
+                return !(unaryNode.tokenType() == TokenType.DELETE && unaryNode.getExpression() instanceof IdentNode);
+            }
+
             @SuppressWarnings("fallthrough")
             @Override
             public Node leaveBinaryNode(final BinaryNode binaryNode) {
--- a/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/codegen/MethodEmitter.java	Thu Dec 14 22:06:19 2017 +0100
+++ b/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/codegen/MethodEmitter.java	Thu Dec 21 22:05:28 2017 +0100
@@ -2203,7 +2203,7 @@
     }
 
     /**
-     * Generate dynamic getter. Pop scope from stack. Push result
+     * Generate dynamic getter. Pop object from stack. Push result.
      *
      * @param valueType type of the value to set
      * @param name      name of property
@@ -2224,7 +2224,7 @@
             type = Type.OBJECT; //promote e.g strings to object generic setter
         }
 
-        popType(Type.SCOPE);
+        popType(Type.OBJECT);
         method.visitInvokeDynamicInsn(NameCodec.encode(name),
                 Type.getMethodDescriptor(type, Type.OBJECT), LINKERBOOTSTRAP, flags | dynGetOperation(isMethod, isIndex));
 
@@ -2256,13 +2256,38 @@
             convert(Type.OBJECT); //TODO bad- until we specialize boolean setters,
         }
         popType(type);
-        popType(Type.SCOPE);
+        popType(Type.OBJECT);
 
         method.visitInvokeDynamicInsn(NameCodec.encode(name),
                 methodDescriptor(void.class, Object.class, type.getTypeClass()), LINKERBOOTSTRAP, flags | dynSetOperation(isIndex));
     }
 
-     /**
+    /**
+     * Generate dynamic remover. Pop object from stack. Push result.
+     *
+     * @param name      name of property
+     * @param flags     call site flags
+     * @return the method emitter
+     */
+    MethodEmitter dynamicRemove(final String name, final int flags, final boolean isIndex) {
+        if (name.length() > LARGE_STRING_THRESHOLD) { // use removeIndex for extremely long names
+            return load(name).dynamicRemoveIndex(flags);
+        }
+
+        debug("dynamic_remove", name, Type.BOOLEAN, getProgramPoint(flags));
+
+        popType(Type.OBJECT);
+        // Type is widened to OBJECT then coerced back to BOOLEAN
+        method.visitInvokeDynamicInsn(NameCodec.encode(name),
+                Type.getMethodDescriptor(Type.OBJECT, Type.OBJECT), LINKERBOOTSTRAP, flags | dynRemoveOperation(isIndex));
+
+        pushType(Type.OBJECT);
+        convert(Type.BOOLEAN); //most probably a nop
+
+        return this;
+    }
+
+    /**
      * Dynamic getter for indexed structures. Pop index and receiver from stack,
      * generate appropriate signatures based on types
      *
@@ -2342,6 +2367,35 @@
     }
 
     /**
+     * Dynamic remover for indexed structures. Pop index and receiver from stack,
+     * generate appropriate signatures based on types
+     *
+     * @param flags call site flags for getter
+     *
+     * @return the method emitter
+     */
+    MethodEmitter dynamicRemoveIndex(final int flags) {
+        debug("dynamic_remove_index", peekType(1), "[", peekType(), "]", getProgramPoint(flags));
+
+        Type index = peekType();
+        if (index.isObject() || index.isBoolean()) {
+            index = Type.OBJECT; //e.g. string->object
+            convert(Type.OBJECT);
+        }
+        popType();
+
+        popType(Type.OBJECT);
+
+        final String signature = Type.getMethodDescriptor(Type.OBJECT, Type.OBJECT /*e.g STRING->OBJECT*/, index);
+
+        method.visitInvokeDynamicInsn(EMPTY_NAME, signature, LINKERBOOTSTRAP, flags | dynRemoveOperation(true));
+        pushType(Type.OBJECT);
+        convert(Type.BOOLEAN);
+
+        return this;
+    }
+
+    /**
      * Load a key value in the proper form.
      *
      * @param key
@@ -2520,6 +2574,10 @@
         return isIndex ? NashornCallSiteDescriptor.SET_ELEMENT : NashornCallSiteDescriptor.SET_PROPERTY;
     }
 
+    private static int dynRemoveOperation(final boolean isIndex) {
+        return isIndex ? NashornCallSiteDescriptor.REMOVE_ELEMENT : NashornCallSiteDescriptor.REMOVE_PROPERTY;
+    }
+
     private Type emitLocalVariableConversion(final LocalVariableConversion conversion, final boolean onlySymbolLiveValue) {
         final Type from = conversion.getFrom();
         final Type to = conversion.getTo();
--- a/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/ir/RuntimeNode.java	Thu Dec 14 22:06:19 2017 +0100
+++ b/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/ir/RuntimeNode.java	Thu Dec 21 22:05:28 2017 +0100
@@ -54,12 +54,6 @@
         TYPEOF,
         /** Reference error type */
         REFERENCE_ERROR,
-        /** Delete operator */
-        DELETE(TokenType.DELETE, Type.BOOLEAN, 1),
-        /** Delete operator for slow scopes */
-        SLOW_DELETE(TokenType.DELETE, Type.BOOLEAN, 1, false),
-        /** Delete operator that always fails -- see Lower */
-        FAIL_DELETE(TokenType.DELETE, Type.BOOLEAN, 1, false),
         /** === operator with at least one object */
         EQ_STRICT(TokenType.EQ_STRICT, Type.BOOLEAN, 2, true),
         /** == operator with at least one object */
--- a/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/ScriptObject.java	Thu Dec 14 22:06:19 2017 +0100
+++ b/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/ScriptObject.java	Thu Dec 21 22:05:28 2017 +0100
@@ -189,6 +189,8 @@
     /** Method handle for generic property setter */
     public static final Call GENERIC_SET = virtualCallNoLookup(ScriptObject.class, "set", void.class, Object.class, Object.class, int.class);
 
+    public static final Call DELETE = virtualCall(MethodHandles.lookup(), ScriptObject.class, "delete", boolean.class, Object.class, boolean.class);
+
     static final MethodHandle[] SET_SLOW = new MethodHandle[] {
         findOwnMH_V("set", void.class, Object.class, int.class, int.class),
         findOwnMH_V("set", void.class, Object.class, double.class, int.class),
@@ -202,6 +204,9 @@
     static final MethodHandle EXTENSION_CHECK   = findOwnMH_V("extensionCheck", boolean.class, boolean.class, String.class);
     static final MethodHandle ENSURE_SPILL_SIZE = findOwnMH_V("ensureSpillSize", Object.class, int.class);
 
+    private static final GuardedInvocation DELETE_GUARDED = new GuardedInvocation(MH.insertArguments(DELETE.methodHandle(), 2, false), NashornGuards.getScriptObjectGuard());
+    private static final GuardedInvocation DELETE_GUARDED_STRICT = new GuardedInvocation(MH.insertArguments(DELETE.methodHandle(), 2, true), NashornGuards.getScriptObjectGuard());
+
     /**
      * Constructor
      */
@@ -1869,6 +1874,13 @@
             return desc.getOperation() instanceof NamedOperation
                     ? findSetMethod(desc, request)
                     : findSetIndexMethod(desc, request);
+        case REMOVE:
+            final GuardedInvocation inv = NashornCallSiteDescriptor.isStrict(desc) ? DELETE_GUARDED_STRICT : DELETE_GUARDED;
+            final Object name = NamedOperation.getName(desc.getOperation());
+            if (name != null) {
+                return inv.replaceMethods(MH.insertArguments(inv.getInvocation(), 1, name), inv.getGuard());
+            }
+            return inv;
         case CALL:
             return findCallMethod(desc, request);
         case NEW:
--- a/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/ScriptRuntime.java	Thu Dec 14 22:06:19 2017 +0100
+++ b/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/ScriptRuntime.java	Thu Dec 21 22:05:28 2017 +0100
@@ -136,6 +136,16 @@
     public static final Call INVALIDATE_RESERVED_BUILTIN_NAME = staticCallNoLookup(ScriptRuntime.class, "invalidateReservedBuiltinName", void.class, String.class);
 
     /**
+     * Used to perform failed delete under strict mode
+     */
+    public static final Call STRICT_FAIL_DELETE = staticCallNoLookup(ScriptRuntime.class, "strictFailDelete", boolean.class, String.class);
+
+    /**
+     * Used to find the scope for slow delete
+     */
+    public static final Call SLOW_DELETE = staticCallNoLookup(ScriptRuntime.class, "slowDelete", boolean.class, ScriptObject.class, String.class);
+
+    /**
      * Converts a switch tag value to a simple integer. deflt value if it can't.
      *
      * @param tag   Switch statement tag value.
@@ -780,87 +790,40 @@
     }
 
     /**
-     * ECMA 11.4.1 - delete operation, generic implementation
+     * ECMA 11.4.1 - delete operator, implementation for slow scopes
      *
-     * @param obj       object with property to delete
+     * This implementation of 'delete' walks the scope chain to find the scope that contains the
+     * property to be deleted, then invokes delete on it. Always used on scopes, never strict.
+     *
+     * @param obj       top scope object
      * @param property  property to delete
-     * @param strict    are we in strict mode
      *
      * @return true if property was successfully found and deleted
      */
-    public static boolean DELETE(final Object obj, final Object property, final Object strict) {
-        if (obj instanceof ScriptObject) {
-            return ((ScriptObject)obj).delete(property, Boolean.TRUE.equals(strict));
+    public static boolean slowDelete(final ScriptObject obj, final String property) {
+        ScriptObject sobj = obj;
+        while (sobj != null && sobj.isScope()) {
+            final FindProperty find = sobj.findProperty(property, false);
+            if (find != null) {
+                return sobj.delete(property, false);
+            }
+            sobj = sobj.getProto();
         }
-
-        if (obj instanceof Undefined) {
-            return ((Undefined)obj).delete(property, false);
-        }
-
-        if (obj == null) {
-            throw typeError("cant.delete.property", safeToString(property), "null");
-        }
-
-        if (obj instanceof ScriptObjectMirror) {
-            return ((ScriptObjectMirror)obj).delete(property);
-        }
-
-        if (JSType.isPrimitive(obj)) {
-            return ((ScriptObject) JSType.toScriptObject(obj)).delete(property, Boolean.TRUE.equals(strict));
-        }
-
-        if (obj instanceof JSObject) {
-            ((JSObject)obj).removeMember(Objects.toString(property));
-            return true;
-        }
-
-        // if object is not reference type, vacuously delete is successful.
-        return true;
-    }
-
-    /**
-     * ECMA 11.4.1 - delete operator, implementation for slow scopes
-     *
-     * This implementation of 'delete' walks the scope chain to find the scope that contains the
-     * property to be deleted, then invokes delete on it.
-     *
-     * @param obj       top scope object
-     * @param property  property to delete
-     * @param strict    are we in strict mode
-     *
-     * @return true if property was successfully found and deleted
-     */
-    public static boolean SLOW_DELETE(final Object obj, final Object property, final Object strict) {
-        if (obj instanceof ScriptObject) {
-            ScriptObject sobj = (ScriptObject) obj;
-            final String key = property.toString();
-            while (sobj != null && sobj.isScope()) {
-                final FindProperty find = sobj.findProperty(key, false);
-                if (find != null) {
-                    return sobj.delete(key, Boolean.TRUE.equals(strict));
-                }
-                sobj = sobj.getProto();
-            }
-        }
-        return DELETE(obj, property, strict);
+        return obj.delete(property, false);
     }
 
     /**
      * ECMA 11.4.1 - delete operator, special case
      *
-     * This is 'delete' that always fails. We have to check strict mode and throw error.
-     * That is why this is a runtime function. Or else we could have inlined 'false'.
+     * This is 'delete' on a scope; it always fails under strict mode.
+     * It always throws an exception, but is declared to return a boolean
+     * to be compatible with the delete operator type.
      *
      * @param property  property to delete
-     * @param strict    are we in strict mode
-     *
-     * @return false always
+     * @return nothing, always throws an exception.
      */
-    public static boolean FAIL_DELETE(final Object property, final Object strict) {
-        if (Boolean.TRUE.equals(strict)) {
-            throw syntaxError("strict.cant.delete", safeToString(property));
-        }
-        return false;
+    public static boolean strictFailDelete(final String property) {
+        throw syntaxError("strict.cant.delete", property);
     }
 
     /**
--- a/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/Undefined.java	Thu Dec 14 22:06:19 2017 +0100
+++ b/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/Undefined.java	Thu Dec 21 22:05:28 2017 +0100
@@ -112,6 +112,11 @@
                 return findSetIndexMethod(desc);
             }
             return findSetMethod(desc);
+        case REMOVE:
+            if (!(desc.getOperation() instanceof NamedOperation)) {
+                return findDeleteIndexMethod(desc);
+            }
+            return findDeleteMethod(desc);
         default:
         }
         return null;
@@ -124,6 +129,7 @@
 
     private static final MethodHandle GET_METHOD = findOwnMH("get", Object.class, Object.class);
     private static final MethodHandle SET_METHOD = MH.insertArguments(findOwnMH("set", void.class, Object.class, Object.class, int.class), 3, NashornCallSiteDescriptor.CALLSITE_STRICT);
+    private static final MethodHandle DELETE_METHOD = MH.insertArguments(findOwnMH("delete", boolean.class, Object.class, boolean.class), 2, false);
 
     private static GuardedInvocation findGetMethod(final CallSiteDescriptor desc) {
         return new GuardedInvocation(MH.insertArguments(GET_METHOD, 1, NashornCallSiteDescriptor.getOperand(desc)), UNDEFINED_GUARD).asType(desc);
@@ -141,6 +147,15 @@
         return new GuardedInvocation(SET_METHOD, UNDEFINED_GUARD).asType(desc);
     }
 
+    private static GuardedInvocation findDeleteMethod(final CallSiteDescriptor desc) {
+        return new GuardedInvocation(MH.insertArguments(DELETE_METHOD, 1, NashornCallSiteDescriptor.getOperand(desc)), UNDEFINED_GUARD).asType(desc);
+    }
+
+    private static GuardedInvocation findDeleteIndexMethod(final CallSiteDescriptor desc) {
+        return new GuardedInvocation(DELETE_METHOD, UNDEFINED_GUARD).asType(desc);
+    }
+
+
     @Override
     public Object get(final Object key) {
         throw typeError("cant.read.property.of.undefined", ScriptRuntime.safeToString(key));
--- a/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/linker/JSObjectLinker.java	Thu Dec 14 22:06:19 2017 +0100
+++ b/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/linker/JSObjectLinker.java	Thu Dec 21 22:05:28 2017 +0100
@@ -31,7 +31,7 @@
 import java.lang.invoke.MethodHandles;
 import java.lang.invoke.MethodType;
 import java.util.Map;
-import javax.script.Bindings;
+import java.util.Objects;
 import jdk.dynalink.CallSiteDescriptor;
 import jdk.dynalink.Operation;
 import jdk.dynalink.StandardOperation;
@@ -64,11 +64,10 @@
         return canLinkTypeStatic(type);
     }
 
-    static boolean canLinkTypeStatic(final Class<?> type) {
-        // can link JSObject also handles Map, Bindings to make
+    private static boolean canLinkTypeStatic(final Class<?> type) {
+        // can link JSObject also handles Map (this includes Bindings) to make
         // sure those are not JSObjects.
         return Map.class.isAssignableFrom(type) ||
-               Bindings.class.isAssignableFrom(type) ||
                JSObject.class.isAssignableFrom(type);
     }
 
@@ -84,7 +83,7 @@
         if (self instanceof JSObject) {
             inv = lookup(desc, request, linkerServices);
             inv = inv.replaceMethods(linkerServices.filterInternalObjects(inv.getInvocation()), inv.getGuard());
-        } else if (self instanceof Map || self instanceof Bindings) {
+        } else if (self instanceof Map) {
             // guard to make sure the Map or Bindings does not turn into JSObject later!
             final GuardedInvocation beanInv = nashornBeansLinker.getGuardedInvocation(request, linkerServices);
             inv = new GuardedInvocation(beanInv.getInvocation(),
@@ -116,6 +115,13 @@
                     return name != null ? findSetMethod(name) : findSetIndexMethod();
                 }
                 break;
+            case REMOVE:
+                if (NashornCallSiteDescriptor.hasStandardNamespace(desc)) {
+                    return new GuardedInvocation(
+                            name == null ? JSOBJECTLINKER_DEL : MH.insertArguments(JSOBJECTLINKER_DEL, 1, name),
+                            IS_JSOBJECT_GUARD);
+                }
+                break;
             case CALL:
                 return findCallMethod(desc);
             case NEW:
@@ -206,6 +212,15 @@
         }
     }
 
+    @SuppressWarnings("unused")
+    private static boolean del(final Object jsobj, final Object key) {
+        if (jsobj instanceof ScriptObjectMirror) {
+            return ((ScriptObjectMirror)jsobj).delete(key);
+        }
+        ((JSObject) jsobj).removeMember(Objects.toString(key));
+        return true;
+    }
+
     private static int getIndex(final Number n) {
         final double value = n.doubleValue();
         return JSType.isRepresentableAsInt(value) ? (int)value : -1;
@@ -245,6 +260,7 @@
     private static final MethodHandle IS_JSOBJECT_GUARD  = findOwnMH_S("isJSObject", boolean.class, Object.class);
     private static final MethodHandle JSOBJECTLINKER_GET = findOwnMH_S("get", Object.class, MethodHandle.class, Object.class, Object.class);
     private static final MethodHandle JSOBJECTLINKER_PUT = findOwnMH_S("put", Void.TYPE, Object.class, Object.class, Object.class);
+    private static final MethodHandle JSOBJECTLINKER_DEL = findOwnMH_S("del", boolean.class, Object.class, Object.class);
 
     // method handles of JSObject class
     private static final MethodHandle JSOBJECT_GETMEMBER     = findJSObjectMH_V("getMember", Object.class, String.class);
--- a/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/linker/NashornBottomLinker.java	Thu Dec 14 22:06:19 2017 +0100
+++ b/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/linker/NashornBottomLinker.java	Thu Dec 21 22:05:28 2017 +0100
@@ -39,11 +39,13 @@
 import jdk.dynalink.NamedOperation;
 import jdk.dynalink.Operation;
 import jdk.dynalink.beans.BeansLinker;
+import jdk.dynalink.beans.StaticClass;
 import jdk.dynalink.linker.GuardedInvocation;
 import jdk.dynalink.linker.GuardingDynamicLinker;
 import jdk.dynalink.linker.GuardingTypeConverterFactory;
 import jdk.dynalink.linker.LinkRequest;
 import jdk.dynalink.linker.LinkerServices;
+import jdk.dynalink.linker.support.Guards;
 import jdk.dynalink.linker.support.Lookup;
 import jdk.nashorn.internal.codegen.types.Type;
 import jdk.nashorn.internal.runtime.ECMAException;
@@ -86,12 +88,16 @@
             MH.dropArguments(EMPTY_PROP_SETTER, 0, Object.class);
 
     private static final MethodHandle THROW_STRICT_PROPERTY_SETTER;
+    private static final MethodHandle THROW_STRICT_PROPERTY_REMOVER;
     private static final MethodHandle THROW_OPTIMISTIC_UNDEFINED;
+    private static final MethodHandle MISSING_PROPERTY_REMOVER;
 
     static {
         final Lookup lookup = new Lookup(MethodHandles.lookup());
         THROW_STRICT_PROPERTY_SETTER = lookup.findOwnStatic("throwStrictPropertySetter", void.class, Object.class, Object.class);
+        THROW_STRICT_PROPERTY_REMOVER = lookup.findOwnStatic("throwStrictPropertyRemover", boolean.class, Object.class, Object.class);
         THROW_OPTIMISTIC_UNDEFINED = lookup.findOwnStatic("throwOptimisticUndefined", Object.class, int.class);
+        MISSING_PROPERTY_REMOVER = lookup.findOwnStatic("missingPropertyRemover", boolean.class, Object.class, Object.class);
     }
 
     private static GuardedInvocation linkBean(final LinkRequest linkRequest) throws Exception {
@@ -124,6 +130,7 @@
     static MethodHandle linkMissingBeanMember(final LinkRequest linkRequest, final LinkerServices linkerServices) throws Exception {
         final CallSiteDescriptor desc = linkRequest.getCallSiteDescriptor();
         final String operand = NashornCallSiteDescriptor.getOperand(desc);
+        final boolean strict = NashornCallSiteDescriptor.isStrict(desc);
         switch (NashornCallSiteDescriptor.getStandardOperation(desc)) {
         case GET:
             if (NashornCallSiteDescriptor.isOptimistic(desc)) {
@@ -133,13 +140,17 @@
             }
             return getInvocation(EMPTY_ELEM_GETTER, linkerServices, desc);
         case SET:
-            final boolean strict = NashornCallSiteDescriptor.isStrict(desc);
             if (strict) {
                 return adaptThrower(bindOperand(THROW_STRICT_PROPERTY_SETTER, operand), desc);
             } else if (operand != null) {
                 return getInvocation(EMPTY_PROP_SETTER, linkerServices, desc);
             }
             return getInvocation(EMPTY_ELEM_SETTER, linkerServices, desc);
+        case REMOVE:
+            if (strict) {
+                return adaptThrower(bindOperand(THROW_STRICT_PROPERTY_REMOVER, operand), desc);
+            }
+            return getInvocation(bindOperand(MISSING_PROPERTY_REMOVER, operand), linkerServices, desc);
         default:
             throw new AssertionError("unknown call type " + desc);
         }
@@ -162,6 +173,33 @@
         throw createTypeError(self, name, "cant.set.property");
     }
 
+    @SuppressWarnings("unused")
+    private static boolean throwStrictPropertyRemover(final Object self, final Object name) {
+        if (isNonConfigurableProperty(self, name)) {
+            throw createTypeError(self, name, "cant.delete.property");
+        }
+        return true;
+    }
+
+    @SuppressWarnings("unused")
+    private static boolean missingPropertyRemover(final Object self, final Object name) {
+        return !isNonConfigurableProperty(self, name);
+    }
+
+    // Corresponds to ECMAScript 5.1 8.12.7 [[Delete]] point 3 check for "isConfigurable" (but negated)
+    private static boolean isNonConfigurableProperty(final Object self, final Object name) {
+        if (self instanceof StaticClass) {
+            final Class<?> clazz = ((StaticClass)self).getRepresentedClass();
+            return BeansLinker.getReadableStaticPropertyNames(clazz).contains(name) ||
+                   BeansLinker.getWritableStaticPropertyNames(clazz).contains(name) ||
+                   BeansLinker.getStaticMethodNames(clazz).contains(name);
+        }
+        final Class<?> clazz = self.getClass();
+        return BeansLinker.getReadableInstancePropertyNames(clazz).contains(name) ||
+            BeansLinker.getWritableInstancePropertyNames(clazz).contains(name) ||
+            BeansLinker.getInstanceMethodNames(clazz).contains(name);
+    }
+
     private static ECMAException createTypeError(final Object self, final Object name, final String msg) {
         return typeError(msg, String.valueOf(name), ScriptRuntime.safeToString(self));
     }
@@ -215,6 +253,8 @@
             throw typeError(NashornCallSiteDescriptor.isMethodFirstOperation(desc) ? "no.such.function" : "cant.get.property", getArgument(linkRequest), "null");
         case SET:
             throw typeError("cant.set.property", getArgument(linkRequest), "null");
+        case REMOVE:
+            throw typeError("cant.delete.property", getArgument(linkRequest), "null");
         default:
             throw new AssertionError("unknown call type " + desc);
         }
--- a/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/linker/NashornCallSiteDescriptor.java	Thu Dec 14 22:06:19 2017 +0100
+++ b/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/linker/NashornCallSiteDescriptor.java	Thu Dec 21 22:05:28 2017 +0100
@@ -29,6 +29,7 @@
 import static jdk.dynalink.StandardNamespace.METHOD;
 import static jdk.dynalink.StandardNamespace.PROPERTY;
 import static jdk.dynalink.StandardOperation.GET;
+import static jdk.dynalink.StandardOperation.REMOVE;
 import static jdk.dynalink.StandardOperation.SET;
 
 import java.lang.invoke.MethodHandles;
@@ -63,7 +64,7 @@
  * form of static methods.
  */
 public final class NashornCallSiteDescriptor extends CallSiteDescriptor {
-    // Lowest three bits describe the operation
+    // Lowest four bits describe the operation
     /** Property getter operation {@code obj.prop} */
     public static final int GET_PROPERTY        = 0;
     /** Element getter operation {@code obj[index]} */
@@ -76,12 +77,16 @@
     public static final int SET_PROPERTY        = 4;
     /** Element setter operation {@code obj[index] = value} */
     public static final int SET_ELEMENT         = 5;
+    /** Property remove operation {@code delete obj.prop} */
+    public static final int REMOVE_PROPERTY     = 6;
+    /** Element remove operation {@code delete obj[index]} */
+    public static final int REMOVE_ELEMENT      = 7;
     /** Call operation {@code fn(args...)} */
-    public static final int CALL                = 6;
+    public static final int CALL                = 8;
     /** New operation {@code new Constructor(args...)} */
-    public static final int NEW                 = 7;
+    public static final int NEW                 = 9;
 
-    private static final int OPERATION_MASK = 7;
+    private static final int OPERATION_MASK = 15;
 
     // Correspond to the operation indices above.
     private static final Operation[] OPERATIONS = new Operation[] {
@@ -91,42 +96,44 @@
         GET.withNamespaces(METHOD, ELEMENT, PROPERTY),
         SET.withNamespaces(PROPERTY, ELEMENT),
         SET.withNamespaces(ELEMENT, PROPERTY),
+        REMOVE.withNamespaces(PROPERTY, ELEMENT),
+        REMOVE.withNamespaces(ELEMENT, PROPERTY),
         StandardOperation.CALL,
         StandardOperation.NEW
     };
 
     /** Flags that the call site references a scope variable (it's an identifier reference or a var declaration, not a
      * property access expression. */
-    public static final int CALLSITE_SCOPE         = 1 << 3;
+    public static final int CALLSITE_SCOPE         = 1 << 4;
     /** Flags that the call site is in code that uses ECMAScript strict mode. */
-    public static final int CALLSITE_STRICT        = 1 << 4;
+    public static final int CALLSITE_STRICT        = 1 << 5;
     /** Flags that a property getter or setter call site references a scope variable that is located at a known distance
      * in the scope chain. Such getters and setters can often be linked more optimally using these assumptions. */
-    public static final int CALLSITE_FAST_SCOPE    = 1 << 5;
+    public static final int CALLSITE_FAST_SCOPE    = 1 << 6;
     /** Flags that a callsite type is optimistic, i.e. we might get back a wider return value than encoded in the
      * descriptor, and in that case we have to throw an UnwarrantedOptimismException */
-    public static final int CALLSITE_OPTIMISTIC    = 1 << 6;
+    public static final int CALLSITE_OPTIMISTIC    = 1 << 7;
     /** Is this really an apply that we try to call as a call? */
-    public static final int CALLSITE_APPLY_TO_CALL = 1 << 7;
+    public static final int CALLSITE_APPLY_TO_CALL = 1 << 8;
     /** Does this a callsite for a variable declaration? */
-    public static final int CALLSITE_DECLARE       = 1 << 8;
+    public static final int CALLSITE_DECLARE       = 1 << 9;
 
     /** Flags that the call site is profiled; Contexts that have {@code "profile.callsites"} boolean property set emit
      * code where call sites have this flag set. */
-    public static final int CALLSITE_PROFILE         = 1 << 9;
+    public static final int CALLSITE_PROFILE         = 1 << 10;
     /** Flags that the call site is traced; Contexts that have {@code "trace.callsites"} property set emit code where
      * call sites have this flag set. */
-    public static final int CALLSITE_TRACE           = 1 << 10;
+    public static final int CALLSITE_TRACE           = 1 << 11;
     /** Flags that the call site linkage miss (and thus, relinking) is traced; Contexts that have the keyword
      * {@code "miss"} in their {@code "trace.callsites"} property emit code where call sites have this flag set. */
-    public static final int CALLSITE_TRACE_MISSES    = 1 << 11;
+    public static final int CALLSITE_TRACE_MISSES    = 1 << 12;
     /** Flags that entry/exit to/from the method linked at call site are traced; Contexts that have the keyword
      * {@code "enterexit"} in their {@code "trace.callsites"} property emit code where call sites have this flag set. */
-    public static final int CALLSITE_TRACE_ENTEREXIT = 1 << 12;
+    public static final int CALLSITE_TRACE_ENTEREXIT = 1 << 13;
     /** Flags that values passed as arguments to and returned from the method linked at call site are traced; Contexts
      * that have the keyword {@code "values"} in their {@code "trace.callsites"} property emit code where call sites
      * have this flag set. */
-    public static final int CALLSITE_TRACE_VALUES    = 1 << 13;
+    public static final int CALLSITE_TRACE_VALUES    = 1 << 14;
 
     //we could have more tracing flags here, for example CALLSITE_TRACE_SCOPE, but bits are a bit precious
     //right now given the program points
@@ -138,10 +145,10 @@
      * TODO: rethink if we need the various profile/trace flags or the linker can use the Context instead to query its
      * trace/profile settings.
      */
-    public static final int CALLSITE_PROGRAM_POINT_SHIFT = 14;
+    public static final int CALLSITE_PROGRAM_POINT_SHIFT = 15;
 
     /**
-     * Maximum program point value. We have 18 bits left over after flags, and
+     * Maximum program point value. We have 17 bits left over after flags, and
      * it should be plenty. Program points are local to a single function. Every
      * function maps to a single JVM bytecode method that can have at most 65535
      * bytes. (Large functions are synthetically split into smaller functions.)
@@ -222,8 +229,10 @@
         case 3: return "GET_METHOD_ELEMENT";
         case 4: return "SET_PROPERTY";
         case 5: return "SET_ELEMENT";
-        case 6: return "CALL";
-        case 7: return "NEW";
+        case 6: return "REMOVE_PROPERTY";
+        case 7: return "REMOVE_ELEMENT";
+        case 8: return "CALL";
+        case 9: return "NEW";
         default: throw new AssertionError();
         }
     }
--- a/test/hotspot/jtreg/TEST.ROOT	Thu Dec 14 22:06:19 2017 +0100
+++ b/test/hotspot/jtreg/TEST.ROOT	Thu Dec 21 22:05:28 2017 +0100
@@ -58,7 +58,7 @@
     docker.support
 
 # Minimum jtreg version
-requiredVersion=4.2 b08
+requiredVersion=4.2 b11
 
 # Path to libraries in the topmost test directory. This is needed so @library
 # does not need ../../../ notation to reach them
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/hotspot/jtreg/runtime/classFileParserBug/Class55.jasm	Thu Dec 21 22:05:28 2017 +0100
@@ -0,0 +1,43 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * 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 8173382
+ * @summary Check that the JVM accepts class files with version 55
+ * @run main Class55
+ */
+
+super public class Class55 version 55:0 {
+
+    public Method "<init>":"()V" stack 1 locals 1 {
+        aload_0;
+        invokespecial    Method java/lang/Object."<init>":"()V";
+        return;
+    }
+
+    public static Method main:"([Ljava/lang/String;)V" stack 0 locals 1 {
+        return;
+    }
+
+} // end Class Class55
--- a/test/jaxp/TEST.ROOT	Thu Dec 14 22:06:19 2017 +0100
+++ b/test/jaxp/TEST.ROOT	Thu Dec 21 22:05:28 2017 +0100
@@ -23,7 +23,7 @@
 groups=TEST.groups
 
 # Minimum jtreg version
-requiredVersion=4.2 b08
+requiredVersion=4.2 b11
 
 # Path to libraries in the topmost test directory. This is needed so @library
 # does not need ../../ notation to reach them
--- a/test/jdk/TEST.ROOT	Thu Dec 14 22:06:19 2017 +0100
+++ b/test/jdk/TEST.ROOT	Thu Dec 21 22:05:28 2017 +0100
@@ -39,7 +39,7 @@
     vm.cds
 
 # Minimum jtreg version
-requiredVersion=4.2 b09
+requiredVersion=4.2 b11
 
 # Path to libraries in the topmost test directory. This is needed so @library
 # does not need ../../ notation to reach them
--- a/test/jdk/java/lang/module/ClassFileVersionsTest.java	Thu Dec 14 22:06:19 2017 +0100
+++ b/test/jdk/java/lang/module/ClassFileVersionsTest.java	Thu Dec 21 22:05:28 2017 +0100
@@ -54,6 +54,8 @@
                 { 53,   0,  Set.of(STATIC, TRANSITIVE) },
 
                 { 54,   0,  Set.of() },                      // JDK 10
+
+                { 55,   0,  Set.of()},                       // JDK 11
         };
     }
 
@@ -69,7 +71,11 @@
                 { 54,   0,  Set.of(TRANSITIVE) },
                 { 54,   0,  Set.of(STATIC, TRANSITIVE) },
 
-                { 55,   0,  Set.of()},                       // JDK 11
+                { 55,   0,  Set.of(STATIC) },                // JDK 11
+                { 55,   0,  Set.of(TRANSITIVE) },
+                { 55,   0,  Set.of(STATIC, TRANSITIVE) },
+
+                { 56,   0,  Set.of()},                       // JDK 12
         };
     }
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/jdk/java/nio/Buffer/EqualsCompareTest.java	Thu Dec 21 22:05:28 2017 +0100
@@ -0,0 +1,686 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * 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.Assert;
+import org.testng.annotations.DataProvider;
+import org.testng.annotations.Test;
+
+import java.lang.invoke.MethodHandle;
+import java.lang.invoke.MethodHandles;
+import java.lang.invoke.MethodType;
+import java.nio.Buffer;
+import java.nio.ByteBuffer;
+import java.nio.ByteOrder;
+import java.nio.CharBuffer;
+import java.nio.DoubleBuffer;
+import java.nio.FloatBuffer;
+import java.nio.IntBuffer;
+import java.nio.LongBuffer;
+import java.nio.ShortBuffer;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.function.BiFunction;
+import java.util.function.LongFunction;
+import java.util.stream.IntStream;
+
+/*
+ * @test
+ * @bug 8193085
+ * @summary tests for buffer equals and compare
+ * @run testng EqualsCompareTest
+ */
+
+public class EqualsCompareTest {
+
+    // Maximum width in bits
+    static final int MAX_WIDTH = 512;
+
+    static final Map<Class, Integer> typeToWidth;
+
+    static {
+        typeToWidth = new HashMap<>();
+        typeToWidth.put(byte.class, Byte.SIZE);
+        typeToWidth.put(short.class, Short.SIZE);
+        typeToWidth.put(char.class, Character.SIZE);
+        typeToWidth.put(int.class, Integer.SIZE);
+        typeToWidth.put(long.class, Long.SIZE);
+        typeToWidth.put(float.class, Float.SIZE);
+        typeToWidth.put(double.class, Double.SIZE);
+    }
+
+    static int arraySizeFor(Class<?> type) {
+        assert type.isPrimitive();
+        return 4 * MAX_WIDTH / typeToWidth.get(type);
+    }
+
+    enum BufferKind {
+        HEAP,
+        HEAP_VIEW,
+        DIRECT;
+    }
+
+    static abstract class BufferType<T extends Buffer, E> {
+        final BufferKind k;
+        final Class<?> bufferType;
+        final Class<?> elementType;
+
+        final MethodHandle eq;
+        final MethodHandle cmp;
+
+        final MethodHandle getter;
+        final MethodHandle setter;
+
+        BufferType(BufferKind k, Class<T> bufferType, Class<?> elementType) {
+            this.k = k;
+            this.bufferType = bufferType;
+            this.elementType = elementType;
+
+            var lookup = MethodHandles.lookup();
+            try {
+                eq = lookup.findVirtual(bufferType, "equals", MethodType.methodType(boolean.class, Object.class));
+                cmp = lookup.findVirtual(bufferType, "compareTo", MethodType.methodType(int.class, bufferType));
+
+                getter = lookup.findVirtual(bufferType, "get", MethodType.methodType(elementType, int.class));
+                setter = lookup.findVirtual(bufferType, "put", MethodType.methodType(bufferType, int.class, elementType));
+            }
+            catch (Exception e) {
+                throw new AssertionError(e);
+            }
+        }
+
+        @Override
+        public String toString() {
+            return bufferType.getName() + " " + k;
+        }
+
+        T construct(int length) {
+            return construct(length, ByteOrder.BIG_ENDIAN);
+        }
+
+        abstract T construct(int length, ByteOrder bo);
+
+        @SuppressWarnings("unchecked")
+        T slice(T a, int from, int to) {
+            return (T) a.position(from).limit(to).slice();
+        }
+
+        @SuppressWarnings("unchecked")
+        E get(T a, int i) {
+            try {
+                return (E) getter.invoke(a, i);
+            }
+            catch (RuntimeException | Error e) {
+                throw e;
+            }
+            catch (Throwable t) {
+                throw new Error(t);
+            }
+        }
+
+        void set(T a, int i, Object v) {
+            try {
+                setter.invoke(a, i, convert(v));
+            }
+            catch (RuntimeException | Error e) {
+                throw e;
+            }
+            catch (Throwable t) {
+                throw new Error(t);
+            }
+        }
+
+        abstract Object convert(Object o);
+
+        boolean equals(T a, T b) {
+            try {
+                return (boolean) eq.invoke(a, b);
+            }
+            catch (RuntimeException | Error e) {
+                throw e;
+            }
+            catch (Throwable t) {
+                throw new Error(t);
+            }
+        }
+
+        int compare(T a, T b) {
+            try {
+                return (int) cmp.invoke(a, b);
+            }
+            catch (RuntimeException | Error e) {
+                throw e;
+            }
+            catch (Throwable t) {
+                throw new Error(t);
+            }
+        }
+
+        boolean pairWiseEquals(T a, T b) {
+            if (a.remaining() != b.remaining())
+                return false;
+            int p = a.position();
+            for (int i = a.limit() - 1, j = b.limit() - 1; i >= p; i--, j--)
+                if (!get(a, i).equals(get(b, j)))
+                    return false;
+            return true;
+        }
+
+        static class Bytes extends BufferType<ByteBuffer, Byte> {
+            Bytes(BufferKind k) {
+                super(k, ByteBuffer.class, byte.class);
+            }
+
+            @Override
+            ByteBuffer construct(int length, ByteOrder bo) {
+                switch (k) {
+                    case DIRECT:
+                        return ByteBuffer.allocateDirect(length).order(bo);
+                    default:
+                    case HEAP_VIEW:
+                    case HEAP:
+                        return ByteBuffer.allocate(length).order(bo);
+                }
+            }
+
+            @Override
+            Object convert(Object o) {
+                return o instanceof Integer
+                       ? ((Integer) o).byteValue()
+                       : o;
+            }
+        }
+
+        static class Chars extends BufferType<CharBuffer, Character> {
+            Chars(BufferKind k) {
+                super(k, CharBuffer.class, char.class);
+            }
+
+            @Override
+            CharBuffer construct(int length, ByteOrder bo) {
+                switch (k) {
+                    case DIRECT:
+                        return ByteBuffer.allocateDirect(length * Character.BYTES).
+                                order(bo).
+                                asCharBuffer();
+                    case HEAP_VIEW:
+                        return ByteBuffer.allocate(length * Character.BYTES).
+                                order(bo).
+                                asCharBuffer();
+                    default:
+                    case HEAP:
+                        return CharBuffer.allocate(length);
+                }
+            }
+
+            @Override
+            Object convert(Object o) {
+                return o instanceof Integer
+                       ? (char) ((Integer) o).intValue()
+                       : o;
+            }
+
+            CharBuffer transformToStringBuffer(CharBuffer c) {
+                char[] chars = new char[c.remaining()];
+                c.get(chars);
+                return CharBuffer.wrap(new String(chars));
+            }
+        }
+
+        static class Shorts extends BufferType<ShortBuffer, Short> {
+            Shorts(BufferKind k) {
+                super(k, ShortBuffer.class, short.class);
+            }
+
+            @Override
+            ShortBuffer construct(int length, ByteOrder bo) {
+                switch (k) {
+                    case DIRECT:
+                        return ByteBuffer.allocateDirect(length * Short.BYTES).
+                                order(bo).
+                                asShortBuffer();
+                    case HEAP_VIEW:
+                        return ByteBuffer.allocate(length * Short.BYTES).
+                                order(bo).
+                                asShortBuffer();
+                    default:
+                    case HEAP:
+                        return ShortBuffer.allocate(length);
+                }
+            }
+
+            @Override
+            Object convert(Object o) {
+                return o instanceof Integer
+                       ? ((Integer) o).shortValue()
+                       : o;
+            }
+        }
+
+        static class Ints extends BufferType<IntBuffer, Integer> {
+            Ints(BufferKind k) {
+                super(k, IntBuffer.class, int.class);
+            }
+
+            @Override
+            IntBuffer construct(int length, ByteOrder bo) {
+                switch (k) {
+                    case DIRECT:
+                        return ByteBuffer.allocateDirect(length * Integer.BYTES).
+                                order(bo).
+                                asIntBuffer();
+                    case HEAP_VIEW:
+                        return ByteBuffer.allocate(length * Integer.BYTES).
+                                order(bo).
+                                asIntBuffer();
+                    default:
+                    case HEAP:
+                        return IntBuffer.allocate(length);
+                }
+            }
+
+            Object convert(Object o) {
+                return o;
+            }
+        }
+
+        static class Floats extends BufferType<FloatBuffer, Float> {
+            Floats(BufferKind k) {
+                super(k, FloatBuffer.class, float.class);
+            }
+
+            @Override
+            FloatBuffer construct(int length, ByteOrder bo) {
+                switch (k) {
+                    case DIRECT:
+                        return ByteBuffer.allocateDirect(length * Float.BYTES).
+                                order(bo).
+                                asFloatBuffer();
+                    case HEAP_VIEW:
+                        return ByteBuffer.allocate(length * Float.BYTES).
+                                order(bo).
+                                asFloatBuffer();
+                    default:
+                    case HEAP:
+                        return FloatBuffer.allocate(length);
+                }
+            }
+
+            @Override
+            Object convert(Object o) {
+                return o instanceof Integer
+                       ? ((Integer) o).floatValue()
+                       : o;
+            }
+
+            @Override
+            boolean pairWiseEquals(FloatBuffer a, FloatBuffer b) {
+                if (a.remaining() != b.remaining())
+                    return false;
+                int p = a.position();
+                for (int i = a.limit() - 1, j = b.limit() - 1; i >= p; i--, j--) {
+                    float av = a.get(i);
+                    float bv = b.get(j);
+                    if (av != bv && (!Float.isNaN(av) || !Float.isNaN(bv)))
+                        return false;
+                }
+                return true;
+            }
+        }
+
+        static class Longs extends BufferType<LongBuffer, Long> {
+            Longs(BufferKind k) {
+                super(k, LongBuffer.class, long.class);
+            }
+
+            @Override
+            LongBuffer construct(int length, ByteOrder bo) {
+                switch (k) {
+                    case DIRECT:
+                        return ByteBuffer.allocateDirect(length * Long.BYTES).
+                                order(bo).
+                                asLongBuffer();
+                    case HEAP_VIEW:
+                        return ByteBuffer.allocate(length * Long.BYTES).
+                                order(bo).
+                                asLongBuffer();
+                    default:
+                    case HEAP:
+                        return LongBuffer.allocate(length);
+                }
+            }
+
+            @Override
+            Object convert(Object o) {
+                return o instanceof Integer
+                       ? ((Integer) o).longValue()
+                       : o;
+            }
+        }
+
+        static class Doubles extends BufferType<DoubleBuffer, Double> {
+            Doubles(BufferKind k) {
+                super(k, DoubleBuffer.class, double.class);
+            }
+
+            @Override
+            DoubleBuffer construct(int length, ByteOrder bo) {
+                switch (k) {
+                    case DIRECT:
+                        return ByteBuffer.allocateDirect(length * Double.BYTES).
+                                order(bo).
+                                asDoubleBuffer();
+                    case HEAP_VIEW:
+                        return ByteBuffer.allocate(length * Double.BYTES).
+                                order(bo).
+                                asDoubleBuffer();
+                    default:
+                    case HEAP:
+                        return DoubleBuffer.allocate(length);
+                }
+            }
+
+            @Override
+            Object convert(Object o) {
+                return o instanceof Integer
+                       ? ((Integer) o).doubleValue()
+                       : o;
+            }
+
+            @Override
+            boolean pairWiseEquals(DoubleBuffer a, DoubleBuffer b) {
+                if (a.remaining() != b.remaining())
+                    return false;
+                int p = a.position();
+                for (int i = a.limit() - 1, j = b.limit() - 1; i >= p; i--, j--) {
+                    double av = a.get(i);
+                    double bv = b.get(j);
+                    if (av != bv && (!Double.isNaN(av) || !Double.isNaN(bv)))
+                        return false;
+                }
+                return true;
+            }
+        }
+    }
+
+
+    static Object[][] bufferTypes;
+
+    @DataProvider
+    public static Object[][] bufferTypesProvider() {
+        if (bufferTypes == null) {
+            bufferTypes = new Object[][]{
+                    {new BufferType.Bytes(BufferKind.HEAP)},
+                    {new BufferType.Bytes(BufferKind.DIRECT)},
+                    {new BufferType.Chars(BufferKind.HEAP)},
+                    {new BufferType.Chars(BufferKind.HEAP_VIEW)},
+                    {new BufferType.Chars(BufferKind.DIRECT)},
+                    {new BufferType.Shorts(BufferKind.HEAP)},
+                    {new BufferType.Shorts(BufferKind.HEAP_VIEW)},
+                    {new BufferType.Shorts(BufferKind.DIRECT)},
+                    {new BufferType.Ints(BufferKind.HEAP)},
+                    {new BufferType.Ints(BufferKind.HEAP_VIEW)},
+                    {new BufferType.Ints(BufferKind.DIRECT)},
+                    {new BufferType.Floats(BufferKind.HEAP)},
+                    {new BufferType.Floats(BufferKind.HEAP_VIEW)},
+                    {new BufferType.Floats(BufferKind.DIRECT)},
+                    {new BufferType.Longs(BufferKind.HEAP)},
+                    {new BufferType.Longs(BufferKind.HEAP_VIEW)},
+                    {new BufferType.Longs(BufferKind.DIRECT)},
+                    {new BufferType.Doubles(BufferKind.HEAP)},
+                    {new BufferType.Doubles(BufferKind.HEAP_VIEW)},
+                    {new BufferType.Doubles(BufferKind.DIRECT)},
+            };
+        }
+        return bufferTypes;
+    }
+
+
+    static Object[][] floatbufferTypes;
+
+    @DataProvider
+    public static Object[][] floatBufferTypesProvider() {
+        if (floatbufferTypes == null) {
+            LongFunction<Object> bTof = rb -> Float.intBitsToFloat((int) rb);
+            LongFunction<Object> bToD = Double::longBitsToDouble;
+
+            floatbufferTypes = new Object[][]{
+                    // canonical and non-canonical NaNs
+                    // If conversion is a signalling NaN it may be subject to conversion to a
+                    // quiet NaN on some processors, even if a copy is performed
+                    // The tests assume that if conversion occurs it does not convert to the
+                    // canonical NaN
+                    new Object[]{new BufferType.Floats(BufferKind.HEAP), 0x7fc00000L, 0x7f800001L, bTof},
+                    new Object[]{new BufferType.Floats(BufferKind.HEAP_VIEW), 0x7fc00000L, 0x7f800001L, bTof},
+                    new Object[]{new BufferType.Floats(BufferKind.DIRECT), 0x7fc00000L, 0x7f800001L, bTof},
+                    new Object[]{new BufferType.Doubles(BufferKind.HEAP), 0x7ff8000000000000L, 0x7ff0000000000001L, bToD},
+                    new Object[]{new BufferType.Doubles(BufferKind.HEAP_VIEW), 0x7ff8000000000000L, 0x7ff0000000000001L, bToD},
+                    new Object[]{new BufferType.Doubles(BufferKind.DIRECT), 0x7ff8000000000000L, 0x7ff0000000000001L, bToD},
+
+                    // +0.0 and -0.0
+                    new Object[]{new BufferType.Floats(BufferKind.HEAP), 0x0L, 0x80000000L, bTof},
+                    new Object[]{new BufferType.Floats(BufferKind.HEAP_VIEW), 0x0L, 0x80000000L, bTof},
+                    new Object[]{new BufferType.Floats(BufferKind.DIRECT), 0x0L, 0x80000000L, bTof},
+                    new Object[]{new BufferType.Doubles(BufferKind.HEAP), 0x0L, 0x8000000000000000L, bToD},
+                    new Object[]{new BufferType.Doubles(BufferKind.HEAP_VIEW), 0x0L, 0x8000000000000000L, bToD},
+                    new Object[]{new BufferType.Doubles(BufferKind.DIRECT), 0x0L, 0x8000000000000000L, bToD},
+            };
+        }
+        return floatbufferTypes;
+    }
+
+
+    static Object[][] charBufferTypes;
+
+    @DataProvider
+    public static Object[][] charBufferTypesProvider() {
+        if (charBufferTypes == null) {
+            charBufferTypes = new Object[][]{
+                    {new BufferType.Chars(BufferKind.HEAP)},
+                    {new BufferType.Chars(BufferKind.HEAP_VIEW)},
+                    {new BufferType.Chars(BufferKind.DIRECT)},
+            };
+        }
+        return charBufferTypes;
+    }
+
+
+    // Tests all primitive buffers
+    @Test(dataProvider = "bufferTypesProvider")
+    <E>
+    void testBuffers(BufferType<Buffer, E> bufferType) {
+        // Test with buffers of the same byte order (BE)
+        BiFunction<BufferType<Buffer, E>, Integer, Buffer> constructor = (at, s) -> {
+            Buffer a = at.construct(s);
+            for (int x = 0; x < s; x++) {
+                at.set(a, x, x % 8);
+            }
+            return a;
+        };
+
+        testBufferType(bufferType, constructor, constructor);
+
+        // Test with buffers of different byte order
+        if (bufferType.elementType != byte.class &&
+            (bufferType.k == BufferKind.HEAP_VIEW ||
+             bufferType.k == BufferKind.DIRECT)) {
+
+            BiFunction<BufferType<Buffer, E>, Integer, Buffer> leConstructor = (at, s) -> {
+                Buffer a = at.construct(s, ByteOrder.LITTLE_ENDIAN);
+                for (int x = 0; x < s; x++) {
+                    at.set(a, x, x % 8);
+                }
+                return a;
+            };
+            testBufferType(bufferType, constructor, leConstructor);
+        }
+    }
+
+    // Tests float and double buffers with edge-case values (NaN, -0.0, +0.0)
+    @Test(dataProvider = "floatBufferTypesProvider")
+    public void testFloatBuffers(
+            BufferType<Buffer, Float> bufferType,
+            long rawBitsA, long rawBitsB,
+            LongFunction<Object> bitsToFloat) {
+        Object av = bitsToFloat.apply(rawBitsA);
+        Object bv = bitsToFloat.apply(rawBitsB);
+
+        BiFunction<BufferType<Buffer, Float>, Integer, Buffer> allAs = (at, s) -> {
+            Buffer b = at.construct(s);
+            for (int x = 0; x < s; x++) {
+                at.set(b, x, av);
+            }
+            return b;
+        };
+
+        BiFunction<BufferType<Buffer, Float>, Integer, Buffer> allBs = (at, s) -> {
+            Buffer b = at.construct(s);
+            for (int x = 0; x < s; x++) {
+                at.set(b, x, bv);
+            }
+            return b;
+        };
+
+        BiFunction<BufferType<Buffer, Float>, Integer, Buffer> halfBs = (at, s) -> {
+            Buffer b = at.construct(s);
+            for (int x = 0; x < s / 2; x++) {
+                at.set(b, x, bv);
+            }
+            for (int x = s / 2; x < s; x++) {
+                at.set(b, x, 1);
+            }
+            return b;
+        };
+
+        // Sanity check
+        int size = arraySizeFor(bufferType.elementType);
+        Assert.assertTrue(bufferType.pairWiseEquals(allAs.apply(bufferType, size),
+                                                    allBs.apply(bufferType, size)));
+        Assert.assertTrue(bufferType.equals(allAs.apply(bufferType, size),
+                                            allBs.apply(bufferType, size)));
+
+        testBufferType(bufferType, allAs, allBs);
+        testBufferType(bufferType, allAs, halfBs);
+    }
+
+    // Tests CharBuffer for region sources and CharSequence sources
+    @Test(dataProvider = "charBufferTypesProvider")
+    public void testCharBuffers(BufferType.Chars charBufferType) {
+
+        BiFunction<BufferType.Chars, Integer, CharBuffer> constructor = (at, s) -> {
+            CharBuffer a = at.construct(s);
+            for (int x = 0; x < s; x++) {
+                at.set(a, x, x % 8);
+            }
+            return a;
+        };
+
+        BiFunction<BufferType.Chars, Integer, CharBuffer> constructorX = constructor.
+                andThen(charBufferType::transformToStringBuffer);
+
+        testBufferType(charBufferType, constructor, constructorX);
+    }
+
+
+    <B extends Buffer, E, BT extends BufferType<B, E>>
+    void testBufferType(BT bt,
+                        BiFunction<BT, Integer, B> aConstructor,
+                        BiFunction<BT, Integer, B> bConstructor) {
+        int n = arraySizeFor(bt.elementType);
+
+        for (int s : ranges(0, n)) {
+            B a = aConstructor.apply(bt, s);
+            B b = bConstructor.apply(bt, s);
+
+            for (int aFrom : ranges(0, s)) {
+                for (int aTo : ranges(aFrom, s)) {
+                    int aLength = aTo - aFrom;
+
+                    B as = aLength != s
+                           ? bt.slice(a, aFrom, aTo)
+                           : a;
+
+                    for (int bFrom : ranges(0, s)) {
+                        for (int bTo : ranges(bFrom, s)) {
+                            int bLength = bTo - bFrom;
+
+                            B bs = bLength != s
+                                   ? bt.slice(b, bFrom, bTo)
+                                   : b;
+
+                            boolean eq = bt.pairWiseEquals(as, bs);
+                            Assert.assertEquals(bt.equals(as, bs), eq);
+                            Assert.assertEquals(bt.equals(bs, as), eq);
+                            if (eq) {
+                                Assert.assertEquals(bt.compare(as, bs), 0);
+                                Assert.assertEquals(bt.compare(bs, as), 0);
+                            }
+                            else {
+                                int aCb = bt.compare(as, bs);
+                                int bCa = bt.compare(bs, as);
+                                int v = Integer.signum(aCb) * Integer.signum(bCa);
+                                Assert.assertTrue(v == -1);
+                            }
+                        }
+                    }
+
+                    if (aLength > 0 && !a.isReadOnly()) {
+                        for (int i = aFrom; i < aTo; i++) {
+                            B c = aConstructor.apply(bt, a.capacity());
+                            B cs = aLength != s
+                                   ? bt.slice(c, aFrom, aTo)
+                                   : c;
+
+                            // Create common prefix with a length of i - aFrom
+                            bt.set(c, i, -1);
+
+                            Assert.assertFalse(bt.equals(c, a));
+
+                            int cCa = bt.compare(cs, as);
+                            int aCc = bt.compare(as, cs);
+                            int v = Integer.signum(cCa) * Integer.signum(aCc);
+                            Assert.assertTrue(v == -1);
+                        }
+                    }
+                }
+            }
+        }
+    }
+
+    static int[] ranges(int from, int to) {
+        int width = to - from;
+        switch (width) {
+            case 0:
+                return new int[]{};
+            case 1:
+                return new int[]{from, to};
+            case 2:
+                return new int[]{from, from + 1, to};
+            case 3:
+                return new int[]{from, from + 1, from + 2, to};
+            default:
+                return IntStream.of(from, from + 1, from + 2, to / 2 - 1, to / 2, to / 2 + 1, to - 2, to - 1, to)
+                        .filter(i -> i >= from && i <= to)
+                        .distinct().toArray();
+        }
+    }
+}
--- a/test/langtools/ProblemList.txt	Thu Dec 14 22:06:19 2017 +0100
+++ b/test/langtools/ProblemList.txt	Thu Dec 21 22:05:28 2017 +0100
@@ -54,6 +54,7 @@
 tools/javac/annotations/typeAnnotations/referenceinfos/NestedTypes.java         8057687    generic-all    emit correct byte code an attributes for type annotations
 tools/javac/warnings/suppress/TypeAnnotations.java                              8057683    generic-all    improve ordering of errors with type annotations
 tools/javac/modules/SourceInSymlinkTest.java                                    8180263    windows-all    fails when run on a subst drive
+tools/javac/options/release/ReleaseOptionUnsupported.java                       8193784    generic-all    temporary until support for --release 11 is worked out
 
 ###########################################################################
 #
@@ -76,3 +77,5 @@
 ###########################################################################
 #
 # jdeps 
+
+tools/jdeprscan/tests/jdk/jdeprscan/TestNotFound.java       8193784    generic-all        temporary until support for --release 11 is worked out
--- a/test/langtools/TEST.ROOT	Thu Dec 14 22:06:19 2017 +0100
+++ b/test/langtools/TEST.ROOT	Thu Dec 21 22:05:28 2017 +0100
@@ -15,7 +15,7 @@
 groups=TEST.groups
 
 # Minimum jtreg version
-requiredVersion=4.2 b08
+requiredVersion=4.2 b11
 
 # Use new module options
 useNewOptions=true
--- a/test/langtools/jdk/javadoc/doclet/testModules/TestModulePackages.java	Thu Dec 14 22:06:19 2017 +0100
+++ b/test/langtools/jdk/javadoc/doclet/testModules/TestModulePackages.java	Thu Dec 21 22:05:28 2017 +0100
@@ -26,7 +26,9 @@
  * @bug 8178070
  * @summary Test packages table in module summary pages
  * @library /tools/lib ../lib
- * @modules jdk.javadoc/jdk.javadoc.internal.tool
+ * @modules jdk.compiler/com.sun.tools.javac.api
+ *          jdk.compiler/com.sun.tools.javac.main
+ *          jdk.javadoc/jdk.javadoc.internal.tool
  * @build toolbox.ModuleBuilder toolbox.ToolBox JavadocTester
  * @run main TestModulePackages
  */
--- a/test/langtools/jdk/jshell/CommandCompletionTest.java	Thu Dec 14 22:06:19 2017 +0100
+++ b/test/langtools/jdk/jshell/CommandCompletionTest.java	Thu Dec 21 22:05:28 2017 +0100
@@ -162,13 +162,13 @@
                 "/edit ", "/env ", "/exit ",
                 "/help ", "/history ", "/imports ",
                 "/list ", "/methods ", "/open ", "/reload ", "/reset ",
-                "/save ", "/set ", "/types ", "/vars ", "context ", "intro ", "rerun ", "shortcuts "),
+                "/save ", "/set ", "/types ", "/vars ", "context ", "id ", "intro ", "rerun ", "shortcuts "),
                 a -> assertCompletion(a, "/? |", false,
                 "/! ", "/-<n> ", "/<id> ", "/? ", "/drop ",
                 "/edit ", "/env ", "/exit ",
                 "/help ", "/history ", "/imports ",
                 "/list ", "/methods ", "/open ", "/reload ", "/reset ",
-                "/save ", "/set ", "/types ", "/vars ", "context ", "intro ", "rerun ", "shortcuts "),
+                "/save ", "/set ", "/types ", "/vars ", "context ", "id ", "intro ", "rerun ", "shortcuts "),
                 a -> assertCompletion(a, "/help /s|", false,
                 "/save ", "/set "),
                 a -> assertCompletion(a, "/help /set |", false,
--- a/test/langtools/jdk/jshell/EditorTestBase.java	Thu Dec 14 22:06:19 2017 +0100
+++ b/test/langtools/jdk/jshell/EditorTestBase.java	Thu Dec 21 22:05:28 2017 +0100
@@ -73,7 +73,7 @@
         for (String edit : new String[] {"/ed", "/edit"}) {
             test(new String[]{"--no-startup"},
                     a -> assertCommandOutputStartsWith(a, edit + " 1",
-                            "|  No snippet with id: 1"),
+                            "|  No snippet with ID: 1"),
                     a -> assertCommandOutputStartsWith(a, edit + " unknown",
                             "|  No such snippet: unknown")
             );
--- a/test/langtools/jdk/jshell/ToolBasicTest.java	Thu Dec 14 22:06:19 2017 +0100
+++ b/test/langtools/jdk/jshell/ToolBasicTest.java	Thu Dec 21 22:05:28 2017 +0100
@@ -189,8 +189,8 @@
 
     public void testRerun() {
         test(false, new String[] {"--no-startup"},
-                (a) -> assertCommand(a, "/0", "|  No snippet with id: 0"),
-                (a) -> assertCommand(a, "/5", "|  No snippet with id: 5")
+                (a) -> assertCommand(a, "/0", "|  No snippet with ID: 0"),
+                (a) -> assertCommand(a, "/5", "|  No snippet with ID: 5")
         );
         String[] codes = new String[] {
                 "int a = 0;", // var
@@ -251,9 +251,9 @@
         );
 
         test(false, new String[] {"--no-startup"},
-                (a) -> assertCommand(a, "/s1", "|  No snippet with id: s1"),
-                (a) -> assertCommand(a, "/1", "|  No snippet with id: 1"),
-                (a) -> assertCommand(a, "/e1", "|  No snippet with id: e1")
+                (a) -> assertCommand(a, "/s1", "|  No snippet with ID: s1"),
+                (a) -> assertCommand(a, "/1", "|  No snippet with ID: 1"),
+                (a) -> assertCommand(a, "/e1", "|  No snippet with ID: e1")
         );
     }
 
--- a/test/langtools/jdk/jshell/ToolShiftTabTest.java	Thu Dec 14 22:06:19 2017 +0100
+++ b/test/langtools/jdk/jshell/ToolShiftTabTest.java	Thu Dec 21 22:05:28 2017 +0100
@@ -23,7 +23,7 @@
 
 /**
  * @test
- * @bug 8166334
+ * @bug 8166334 8188894
  * @summary test shift-tab shortcuts "fixes"
  * @modules
  *     jdk.jshell/jdk.internal.jshell.tool.resources:open
@@ -107,11 +107,12 @@
 
     public void testFixImport() throws Exception {
         doRunTest((inputSink, out) -> {
-            inputSink.write("Frame");
-            inputSink.write(FIX + "i");
-            inputSink.write("1");
-            inputSink.write(".WIDTH\n");
-            waitOutput(out, "==> 1");
+            do {
+                inputSink.write("Frame");
+                inputSink.write(FIX + "i");
+                inputSink.write("1");
+                inputSink.write(".WIDTH\n");
+            } while (!waitOutput(out, "==> 1", "Results may be incomplete"));
             inputSink.write("/import\n");
             waitOutput(out, "|    import java.awt.Frame");
 
--- a/test/langtools/jdk/jshell/ToolSimpleTest.java	Thu Dec 14 22:06:19 2017 +0100
+++ b/test/langtools/jdk/jshell/ToolSimpleTest.java	Thu Dec 21 22:05:28 2017 +0100
@@ -296,7 +296,7 @@
     @Test
     public void testDropNegative() {
         test(false, new String[]{"--no-startup"},
-                a -> assertCommandOutputStartsWith(a, "/drop 0", "|  No snippet with id: 0"),
+                a -> assertCommandOutputStartsWith(a, "/drop 0", "|  No snippet with ID: 0"),
                 a -> assertCommandOutputStartsWith(a, "/drop a", "|  No such snippet: a"),
                 a -> assertCommandCheckOutput(a, "/drop",
                         assertStartsWith("|  In the /drop argument, please specify an import, variable, method, or class to drop.")),
--- a/test/langtools/jdk/jshell/UITesting.java	Thu Dec 14 22:06:19 2017 +0100
+++ b/test/langtools/jdk/jshell/UITesting.java	Thu Dec 21 22:05:28 2017 +0100
@@ -135,8 +135,19 @@
     }
 
     protected void waitOutput(StringBuilder out, String expected) {
+        waitOutput(out, expected, null);
+    }
+
+    // Return true if expected is found, false if secondary is found,
+    // otherwise, time out with an IllegalStateException
+    protected boolean waitOutput(StringBuilder out, String expected, String secondary) {
         expected = expected.replaceAll("\n", laxLineEndings ? "\r?\n" : System.getProperty("line.separator"));
         Pattern expectedPattern = Pattern.compile(expected, Pattern.DOTALL);
+        Pattern secondaryPattern = null;
+        if (secondary != null) {
+            secondary = secondary.replaceAll("\n", laxLineEndings ? "\r?\n" : System.getProperty("line.separator"));
+            secondaryPattern = Pattern.compile(secondary, Pattern.DOTALL);
+        }
         synchronized (out) {
             long s = System.currentTimeMillis();
 
@@ -144,7 +155,14 @@
                 Matcher m = expectedPattern.matcher(out);
                 if (m.find()) {
                     out.delete(0, m.end());
-                    return ;
+                    return true;
+                }
+                if (secondaryPattern != null) {
+                    m = secondaryPattern.matcher(out);
+                    if (m.find()) {
+                        out.delete(0, m.end());
+                        return false;
+                    }
                 }
                 long e =  System.currentTimeMillis();
                 if ((e - s) > TIMEOUT) {
--- a/test/langtools/tools/javac/6330997/T6330997.java	Thu Dec 14 22:06:19 2017 +0100
+++ b/test/langtools/tools/javac/6330997/T6330997.java	Thu Dec 21 22:05:28 2017 +0100
@@ -32,8 +32,8 @@
  *          jdk.compiler/com.sun.tools.javac.main
  *          jdk.compiler/com.sun.tools.javac.util
  * @clean T1 T2
- * @compile -source 10 -target 10 T1.java
- * @compile -source 10 -target 10 T2.java
+ * @compile -source 10 -target 11 T1.java
+ * @compile -source 10 -target 11 T2.java
  * @run main/othervm T6330997
  */
 
--- a/test/langtools/tools/javac/BadCovar.out	Thu Dec 14 22:06:19 2017 +0100
+++ b/test/langtools/tools/javac/BadCovar.out	Thu Dec 21 22:05:28 2017 +0100
@@ -1,2 +1,2 @@
-BadCovar.java:22:10: compiler.err.types.incompatible.diff.ret: bad.covar.B, bad.covar.A, f()
+BadCovar.java:22:10: compiler.err.types.incompatible: bad.covar.B, bad.covar.A, (compiler.misc.incompatible.diff.ret: f, )
 1 error
--- a/test/langtools/tools/javac/InconsistentInheritedSignature.out	Thu Dec 14 22:06:19 2017 +0100
+++ b/test/langtools/tools/javac/InconsistentInheritedSignature.out	Thu Dec 21 22:05:28 2017 +0100
@@ -1,2 +1,2 @@
-InconsistentInheritedSignature.java:17:1: compiler.err.types.incompatible.diff.ret: I2, I1, f()
+InconsistentInheritedSignature.java:17:1: compiler.err.types.incompatible: I2, I1, (compiler.misc.incompatible.diff.ret: f, )
 1 error
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/langtools/tools/javac/MethodParameters/ClassReaderTest/ClassReaderTest.java	Thu Dec 21 22:05:28 2017 +0100
@@ -0,0 +1,73 @@
+/*
+ * Copyright 2017 Google Inc. All Rights Reserved.
+ * 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 8007720 8177486
+ * @summary class reading of named parameters
+ * @library /tools/javac/lib
+ * @modules java.compiler
+ *          jdk.compiler
+ * @compile -parameters ClassReaderTest.java MethodParameterProcessor.java
+ * @compile/process/ref=ClassReaderTest.out -proc:only -processor MethodParameterProcessor ClassReaderTest ClassReaderTest$I ClassReaderTest$E
+ */
+
+import static java.lang.annotation.RetentionPolicy.CLASS;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Retention;
+
+public class ClassReaderTest {
+
+    @Retention(RUNTIME)
+    @interface RuntimeAnnoOne {
+        int value() default 0;
+    }
+
+    @Retention(RUNTIME)
+    @interface RuntimeAnnoTwo {
+        int value() default 0;
+    }
+
+    @Retention(CLASS)
+    @interface ClassAnno {
+        int value() default 0;
+    }
+
+    @MethodParameterProcessor.ParameterNames
+    void f(
+            @RuntimeAnnoOne(1) @RuntimeAnnoTwo(2) @ClassAnno(3) int a,
+            @RuntimeAnnoOne(4) @RuntimeAnnoTwo(5) @ClassAnno(6) String b) {}
+
+    class I {
+        @MethodParameterProcessor.ParameterNames
+        I(@ClassAnno(7) int d, @RuntimeAnnoOne(8) String e, Object o) {}
+    }
+
+    enum E {
+        ONE(42, "");
+
+        @MethodParameterProcessor.ParameterNames
+        E(int x, @RuntimeAnnoOne(9) String s) {}
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/langtools/tools/javac/MethodParameters/ClassReaderTest/ClassReaderTest.out	Thu Dec 21 22:05:28 2017 +0100
@@ -0,0 +1,3 @@
+Note: ClassReaderTest.E.<init>(x, @ClassReaderTest.RuntimeAnnoOne(9) s)
+Note: ClassReaderTest.I.<init>(@ClassReaderTest.ClassAnno(7) d, @ClassReaderTest.RuntimeAnnoOne(8) e, o)
+Note: ClassReaderTest.f(@ClassReaderTest.ClassAnno(3) @ClassReaderTest.RuntimeAnnoOne(1) @ClassReaderTest.RuntimeAnnoTwo(2) a, @ClassReaderTest.ClassAnno(6) @ClassReaderTest.RuntimeAnnoOne(4) @ClassReaderTest.RuntimeAnnoTwo(5) b)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/langtools/tools/javac/MethodParameters/ClassReaderTest/MethodParameterProcessor.java	Thu Dec 21 22:05:28 2017 +0100
@@ -0,0 +1,72 @@
+/*
+ * Copyright 2017 Google Inc. All Rights Reserved.
+ * 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 java.util.stream.Collectors.joining;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+import java.util.Arrays;
+import java.util.List;
+import java.util.Set;
+import javax.annotation.processing.RoundEnvironment;
+import javax.annotation.processing.SupportedAnnotationTypes;
+import javax.lang.model.element.Element;
+import javax.lang.model.element.ExecutableElement;
+import javax.lang.model.element.VariableElement;
+import javax.lang.model.element.TypeElement;
+import javax.tools.Diagnostic.Kind;
+
+@SupportedAnnotationTypes("MethodParameterProcessor.ParameterNames")
+public class MethodParameterProcessor extends JavacTestingAbstractProcessor {
+
+    @Retention(RetentionPolicy.RUNTIME)
+    @Target({ElementType.METHOD, ElementType.CONSTRUCTOR})
+    @interface ParameterNames {
+        String[] value() default {};
+    }
+
+    @Override
+    public boolean process(Set<? extends TypeElement> annotations, RoundEnvironment roundEnv) {
+        for (Element element : roundEnv.getElementsAnnotatedWith(ParameterNames.class)) {
+            ExecutableElement exec = (ExecutableElement)element;
+            String message = printNamesAndAnnotations(exec);
+            messager.printMessage(Kind.NOTE, message);
+        }
+        return false;
+    }
+
+    private String printNamesAndAnnotations(ExecutableElement exec) {
+        return String.format("%s.%s(%s)",
+                exec.getEnclosingElement(),
+                exec.getSimpleName(),
+                exec.getParameters().stream().map(this::printParameter).collect(joining(", ")));
+    }
+
+    private String printParameter(VariableElement param) {
+        return param.getAnnotationMirrors().stream().map(String::valueOf).collect(joining(" "))
+                + (param.getAnnotationMirrors().isEmpty() ? "" : " ")
+                + param.getSimpleName();
+    }
+}
--- a/test/langtools/tools/javac/OverrideChecks/InconsistentReturn.out	Thu Dec 14 22:06:19 2017 +0100
+++ b/test/langtools/tools/javac/OverrideChecks/InconsistentReturn.out	Thu Dec 21 22:05:28 2017 +0100
@@ -1,2 +1,2 @@
-InconsistentReturn.java:17:1: compiler.err.types.incompatible.diff.ret: I2, I1, f()
+InconsistentReturn.java:17:1: compiler.err.types.incompatible: I2, I1, (compiler.misc.incompatible.diff.ret: f, )
 1 error
--- a/test/langtools/tools/javac/api/T6265137.java	Thu Dec 14 22:06:19 2017 +0100
+++ b/test/langtools/tools/javac/api/T6265137.java	Thu Dec 21 22:05:28 2017 +0100
@@ -52,7 +52,7 @@
             String srcdir = System.getProperty("test.src");
             Iterable<? extends JavaFileObject> files =
                 fm.getJavaFileObjectsFromFiles(Arrays.asList(new File(srcdir, "T6265137a.java")));
-            javac.getTask(null, fm, dl, Arrays.asList("-target","10"), null, files).call();
+            javac.getTask(null, fm, dl, Arrays.asList("-target","11"), null, files).call();
         }
     }
 }
--- a/test/langtools/tools/javac/api/T6395981.java	Thu Dec 14 22:06:19 2017 +0100
+++ b/test/langtools/tools/javac/api/T6395981.java	Thu Dec 21 22:05:28 2017 +0100
@@ -23,7 +23,7 @@
 
 /*
  * @test
- * @bug     6395981 6458819 7025784 8028543 8028544
+ * @bug     6395981 6458819 7025784 8028543 8028544 8193291
  * @summary JavaCompilerTool and Tool must specify version of JLS and JVMS
  * @author  Peter von der Ah\u00e9
  * @modules java.compiler
@@ -31,7 +31,7 @@
  * @run main/fail T6395981
  * @run main/fail T6395981 RELEASE_3 RELEASE_5 RELEASE_6
  * @run main/fail T6395981 RELEASE_0 RELEASE_1 RELEASE_2 RELEASE_3 RELEASE_4 RELEASE_5 RELEASE_6
- * @run main T6395981 RELEASE_3 RELEASE_4 RELEASE_5 RELEASE_6 RELEASE_7 RELEASE_8 RELEASE_9 RELEASE_10
+ * @run main T6395981 RELEASE_3 RELEASE_4 RELEASE_5 RELEASE_6 RELEASE_7 RELEASE_8 RELEASE_9 RELEASE_10 RELEASE_11
  */
 
 import java.util.EnumSet;
--- a/test/langtools/tools/javac/classfiles/ClassVersionChecker.java	Thu Dec 14 22:06:19 2017 +0100
+++ b/test/langtools/tools/javac/classfiles/ClassVersionChecker.java	Thu Dec 21 22:05:28 2017 +0100
@@ -23,7 +23,7 @@
 
 /*
  * @test
- * @bug 7157626 8001112 8188870
+ * @bug 7157626 8001112 8188870 8173382
  * @summary Test major version for all legal combinations for -source and -target
  * @author sgoel
  *
@@ -38,7 +38,7 @@
 public class ClassVersionChecker {
 
     int errors;
-    String[] jdk = {"", "1.6", "1.7", "1.8", "1.9", "1.10"};
+    String[] jdk = {"", "1.6", "1.7", "1.8", "1.9", "1.10", "11"};
     File javaFile = null;
 
     public static void main(String[] args) throws Throwable {
@@ -58,11 +58,12 @@
          * -1 => invalid combinations
          */
         int[][] ver =
-                {{54, -1, -1, -1, -1, -1},
-                 {54, 50, 51, 52, 53, 54},
-                 {54, -1, 51, 52, 53, 54},
-                 {54, -1, -1, 52, 53, 54},
-                 {54, -1, -1, -1, 53, 54}};
+                {{55, -1, -1, -1, -1, -1, -1},
+                 {55, 50, 51, 52, 53, 54, 55},
+                 {55, -1, 51, 52, 53, 54, 55},
+                 {55, -1, -1, 52, 53, 54, 55},
+                 {55, -1, -1, -1, 53, 54, 55},
+                 {55, -1, -1, -1, -1, 54, 55}};
 
         // Loop to run all possible combinations of source/target values
         for (int i = 0; i< ver.length; i++) {
--- a/test/langtools/tools/javac/defaultMethods/Neg01.out	Thu Dec 14 22:06:19 2017 +0100
+++ b/test/langtools/tools/javac/defaultMethods/Neg01.out	Thu Dec 21 22:05:28 2017 +0100
@@ -1,2 +1,2 @@
-Neg01.java:14:12: compiler.err.types.incompatible.unrelated.defaults: kindname.class, Neg01.AB, m, , Neg01.IA, Neg01.IB
+Neg01.java:14:12: compiler.err.types.incompatible: Neg01.IA, Neg01.IB, (compiler.misc.incompatible.unrelated.defaults: kindname.class, Neg01.AB, m, , Neg01.IA, Neg01.IB)
 1 error
--- a/test/langtools/tools/javac/defaultMethods/Neg02.out	Thu Dec 14 22:06:19 2017 +0100
+++ b/test/langtools/tools/javac/defaultMethods/Neg02.out	Thu Dec 21 22:05:28 2017 +0100
@@ -1,2 +1,2 @@
-Neg02.java:16:13: compiler.err.types.incompatible.unrelated.defaults: kindname.class, Neg02.X, m, , Neg02.A, Neg02.B
+Neg02.java:16:13: compiler.err.types.incompatible: Neg02.A, Neg02.B, (compiler.misc.incompatible.unrelated.defaults: kindname.class, Neg02.X, m, , Neg02.A, Neg02.B)
 1 error
--- a/test/langtools/tools/javac/defaultMethods/Neg14.out	Thu Dec 14 22:06:19 2017 +0100
+++ b/test/langtools/tools/javac/defaultMethods/Neg14.out	Thu Dec 21 22:05:28 2017 +0100
@@ -1,2 +1,2 @@
-Neg14.java:10:14: compiler.err.types.incompatible.abstract.default: kindname.class, Neg14.AB, m, , Neg14.IB, Neg14.IA
+Neg14.java:10:14: compiler.err.types.incompatible: Neg14.IB, Neg14.IA, (compiler.misc.incompatible.abstract.default: kindname.class, Neg14.AB, m, , Neg14.IB, Neg14.IA)
 1 error
--- a/test/langtools/tools/javac/diags/examples/IncompatibleDescsInFunctionalIntf.java	Thu Dec 14 22:06:19 2017 +0100
+++ b/test/langtools/tools/javac/diags/examples/IncompatibleDescsInFunctionalIntf.java	Thu Dec 21 22:05:28 2017 +0100
@@ -21,7 +21,8 @@
  * questions.
  */
 
-// key: compiler.err.types.incompatible.diff.ret
+// key: compiler.err.types.incompatible
+// key: compiler.misc.incompatible.diff.ret
 // key: compiler.err.prob.found.req
 // key: compiler.misc.incompatible.descs.in.functional.intf
 // key: compiler.misc.descriptor
--- a/test/langtools/tools/javac/diags/examples/TypesIncompatible.java	Thu Dec 14 22:06:19 2017 +0100
+++ b/test/langtools/tools/javac/diags/examples/TypesIncompatible.java	Thu Dec 21 22:05:28 2017 +0100
@@ -21,7 +21,8 @@
  * questions.
  */
 
-// key: compiler.err.types.incompatible.diff.ret
+// key: compiler.err.types.incompatible
+// key: compiler.misc.incompatible.diff.ret
 
 interface A {
     int m();
--- a/test/langtools/tools/javac/diags/examples/TypesIncompatibleAbstractDefault.java	Thu Dec 14 22:06:19 2017 +0100
+++ b/test/langtools/tools/javac/diags/examples/TypesIncompatibleAbstractDefault.java	Thu Dec 21 22:05:28 2017 +0100
@@ -21,7 +21,8 @@
  * questions.
  */
 
-// key: compiler.err.types.incompatible.abstract.default
+// key: compiler.err.types.incompatible
+// key: compiler.misc.incompatible.abstract.default
 
 class TypesIncompatibleAbstractDefault {
     interface A {
--- a/test/langtools/tools/javac/diags/examples/TypesIncompatibleUnrelatedDefaults.java	Thu Dec 14 22:06:19 2017 +0100
+++ b/test/langtools/tools/javac/diags/examples/TypesIncompatibleUnrelatedDefaults.java	Thu Dec 21 22:05:28 2017 +0100
@@ -21,7 +21,8 @@
  * questions.
  */
 
-// key: compiler.err.types.incompatible.unrelated.defaults
+// key: compiler.err.types.incompatible
+// key: compiler.misc.incompatible.unrelated.defaults
 
 class TypesIncompatibleUnrelatedDefaults {
     interface A {
--- a/test/langtools/tools/javac/generics/6294779/T6294779c.out	Thu Dec 14 22:06:19 2017 +0100
+++ b/test/langtools/tools/javac/generics/6294779/T6294779c.out	Thu Dec 21 22:05:28 2017 +0100
@@ -1,2 +1,2 @@
-T6294779c.java:29:5: compiler.err.types.incompatible.diff.ret: T6294779c.I2, T6294779c.I1, get()
+T6294779c.java:29:5: compiler.err.types.incompatible: T6294779c.I2, T6294779c.I1, (compiler.misc.incompatible.diff.ret: get, )
 1 error
--- a/test/langtools/tools/javac/generics/abstract/T4717181c.out	Thu Dec 14 22:06:19 2017 +0100
+++ b/test/langtools/tools/javac/generics/abstract/T4717181c.out	Thu Dec 21 22:05:28 2017 +0100
@@ -1,2 +1,2 @@
-T4717181c.java:15:21: compiler.err.types.incompatible.diff.ret: T4717181c.A<java.lang.Integer>, T4717181c.A<java.lang.Integer>, f(java.lang.Integer)
+T4717181c.java:15:21: compiler.err.types.incompatible: T4717181c.A<java.lang.Integer>, T4717181c.A<java.lang.Integer>, (compiler.misc.incompatible.diff.ret: f, java.lang.Integer)
 1 error
--- a/test/langtools/tools/javac/generics/rawOverride/7157798/Test3.out	Thu Dec 14 22:06:19 2017 +0100
+++ b/test/langtools/tools/javac/generics/rawOverride/7157798/Test3.out	Thu Dec 21 22:05:28 2017 +0100
@@ -1,6 +1,6 @@
-Test3.java:14:1: compiler.err.types.incompatible.diff.ret: B, A, m()
-Test3.java:19:1: compiler.err.types.incompatible.diff.ret: D, C, m()
-Test3.java:27:1: compiler.err.types.incompatible.diff.ret: E<T>, B, m()
-Test3.java:33:1: compiler.err.types.incompatible.diff.ret: F<V>, E<U>, m()
-Test3.java:37:1: compiler.err.types.incompatible.diff.ret: F<V>, E<U>, m()
+Test3.java:14:1: compiler.err.types.incompatible: B, A, (compiler.misc.incompatible.diff.ret: m, )
+Test3.java:19:1: compiler.err.types.incompatible: D, C, (compiler.misc.incompatible.diff.ret: m, )
+Test3.java:27:1: compiler.err.types.incompatible: E<T>, B, (compiler.misc.incompatible.diff.ret: m, )
+Test3.java:33:1: compiler.err.types.incompatible: F<V>, E<U>, (compiler.misc.incompatible.diff.ret: m, )
+Test3.java:37:1: compiler.err.types.incompatible: F<V>, E<U>, (compiler.misc.incompatible.diff.ret: m, )
 5 errors
--- a/test/langtools/tools/javac/generics/typevars/4856983/T4856983a.out	Thu Dec 14 22:06:19 2017 +0100
+++ b/test/langtools/tools/javac/generics/typevars/4856983/T4856983a.out	Thu Dec 21 22:05:28 2017 +0100
@@ -1,2 +1,2 @@
-T4856983a.java:13:6: compiler.err.types.incompatible.diff.ret: I2, I1, m()
+T4856983a.java:13:6: compiler.err.types.incompatible: I2, I1, (compiler.misc.incompatible.diff.ret: m, )
 1 error
--- a/test/langtools/tools/javac/generics/typevars/4856983/T4856983b.out	Thu Dec 14 22:06:19 2017 +0100
+++ b/test/langtools/tools/javac/generics/typevars/4856983/T4856983b.out	Thu Dec 21 22:05:28 2017 +0100
@@ -1,2 +1,2 @@
-T4856983b.java:12:24: compiler.err.types.incompatible.diff.ret: I2, I1, m()
+T4856983b.java:12:24: compiler.err.types.incompatible: I2, I1, (compiler.misc.incompatible.diff.ret: m, )
 1 error
--- a/test/langtools/tools/javac/generics/typevars/6199146/T6199146.out	Thu Dec 14 22:06:19 2017 +0100
+++ b/test/langtools/tools/javac/generics/typevars/6199146/T6199146.out	Thu Dec 21 22:05:28 2017 +0100
@@ -1,2 +1,2 @@
-T6199146.java:9:25: compiler.err.types.incompatible.diff.ret: T6199146.I2, T6199146.I1, getFoo()
+T6199146.java:9:25: compiler.err.types.incompatible: T6199146.I2, T6199146.I1, (compiler.misc.incompatible.diff.ret: getFoo, )
 1 error
--- a/test/langtools/tools/javac/generics/wildcards/7034495/T7034495.out	Thu Dec 14 22:06:19 2017 +0100
+++ b/test/langtools/tools/javac/generics/wildcards/7034495/T7034495.out	Thu Dec 21 22:05:28 2017 +0100
@@ -1,2 +1,2 @@
-T7034495.java:40:17: compiler.err.types.incompatible.diff.ret: T7034495.B<compiler.misc.type.captureof: 1, ?>, T7034495.A<compiler.misc.type.captureof: 2, ?>, foo()
+T7034495.java:40:17: compiler.err.types.incompatible: T7034495.B<compiler.misc.type.captureof: 1, ?>, T7034495.A<compiler.misc.type.captureof: 2, ?>, (compiler.misc.incompatible.diff.ret: foo, )
 1 error
--- a/test/langtools/tools/javac/lambda/BadConv04.out	Thu Dec 14 22:06:19 2017 +0100
+++ b/test/langtools/tools/javac/lambda/BadConv04.out	Thu Dec 21 22:05:28 2017 +0100
@@ -1,3 +1,3 @@
-BadConv04.java:19:5: compiler.err.types.incompatible.diff.ret: BadConv04.I2, BadConv04.I1, m()
+BadConv04.java:19:5: compiler.err.types.incompatible: BadConv04.I2, BadConv04.I1, (compiler.misc.incompatible.diff.ret: m, )
 BadConv04.java:21:13: compiler.err.prob.found.req: (compiler.misc.incompatible.descs.in.functional.intf: kindname.interface, BadConv04.SAM,{(compiler.misc.descriptor: m, , long, ),(compiler.misc.descriptor: m, , int, )})
 2 errors
--- a/test/langtools/tools/javac/lambda/bridge/template_tests/BridgeMethodsTemplateTest.java	Thu Dec 14 22:06:19 2017 +0100
+++ b/test/langtools/tools/javac/lambda/bridge/template_tests/BridgeMethodsTemplateTest.java	Thu Dec 21 22:05:28 2017 +0100
@@ -1001,18 +1001,18 @@
 
     public void testA5() throws IOException, ReflectiveOperationException {
         compileSpec("C(A(Id0),Jd0)",
-                    "compiler.err.types.incompatible.unrelated.defaults");
+                    "compiler.err.types.incompatible");
     }
 
     public void testA6() throws IOException, ReflectiveOperationException {
         compileSpec("C(A(Ia0,Jd0))",
                     "compiler.err.does.not.override.abstract",
-                    "compiler.err.types.incompatible.abstract.default");
+                    "compiler.err.types.incompatible");
     }
 
     public void testA7() throws IOException, ReflectiveOperationException {
         compileSpec("C(A(Id0,Jd0))",
-                    "compiler.err.types.incompatible.unrelated.defaults");
+                    "compiler.err.types.incompatible");
     }
 
     public void testA8() throws IOException, ReflectiveOperationException {
--- a/test/langtools/tools/javac/lambda/funcInterfaces/NonSAM2.out	Thu Dec 14 22:06:19 2017 +0100
+++ b/test/langtools/tools/javac/lambda/funcInterfaces/NonSAM2.out	Thu Dec 21 22:05:28 2017 +0100
@@ -1,4 +1,4 @@
-NonSAM2.java:13:1: compiler.err.types.incompatible.diff.ret: Bar1, Foo1, getAge(java.lang.String)
+NonSAM2.java:13:1: compiler.err.types.incompatible: Bar1, Foo1, (compiler.misc.incompatible.diff.ret: getAge, java.lang.String)
 NonSAM2.java:15:1: compiler.err.name.clash.same.erasure.no.override: getOldest, java.util.List<?>, C, getOldest, java.util.List<java.lang.Number>, A
 NonSAM2.java:17:1: compiler.err.name.clash.same.erasure.no.override: getOldest, java.util.List<java.lang.Integer>, D, getOldest, java.util.List<java.lang.Number>, A
 NonSAM2.java:21:1: compiler.err.name.clash.same.erasure.no.override: m, T2, Bar2, m, T1, Foo2
--- a/test/langtools/tools/javac/lib/DPrinter.java	Thu Dec 14 22:06:19 2017 +0100
+++ b/test/langtools/tools/javac/lib/DPrinter.java	Thu Dec 21 22:05:28 2017 +0100
@@ -1233,7 +1233,6 @@
         public Void visitMethodSymbol(MethodSymbol sym, Void ignore) {
             // code
             printList("params", sym.params);
-            printList("savedParameterNames", sym.savedParameterNames);
             return visitSymbol(sym, null);
         }
 
--- a/test/langtools/tools/javac/lib/JavacTestingAbstractProcessor.java	Thu Dec 14 22:06:19 2017 +0100
+++ b/test/langtools/tools/javac/lib/JavacTestingAbstractProcessor.java	Thu Dec 21 22:05:28 2017 +0100
@@ -110,7 +110,7 @@
      * corresponding platform visitor type.
      */
 
-    @SupportedSourceVersion(RELEASE_10)
+    @SupportedSourceVersion(RELEASE_11)
     public static abstract class AbstractAnnotationValueVisitor<R, P> extends AbstractAnnotationValueVisitor9<R, P> {
 
         /**
@@ -121,7 +121,7 @@
         }
     }
 
-    @SupportedSourceVersion(RELEASE_10)
+    @SupportedSourceVersion(RELEASE_11)
     public static abstract class AbstractElementVisitor<R, P> extends AbstractElementVisitor9<R, P> {
         /**
          * Constructor for concrete subclasses to call.
@@ -131,7 +131,7 @@
         }
     }
 
-    @SupportedSourceVersion(RELEASE_10)
+    @SupportedSourceVersion(RELEASE_11)
     public static abstract class AbstractTypeVisitor<R, P> extends AbstractTypeVisitor9<R, P> {
         /**
          * Constructor for concrete subclasses to call.
@@ -141,7 +141,7 @@
         }
     }
 
-    @SupportedSourceVersion(RELEASE_10)
+    @SupportedSourceVersion(RELEASE_11)
     public static class ElementKindVisitor<R, P> extends ElementKindVisitor9<R, P> {
         /**
          * Constructor for concrete subclasses; uses {@code null} for the
@@ -162,7 +162,7 @@
         }
     }
 
-    @SupportedSourceVersion(RELEASE_10)
+    @SupportedSourceVersion(RELEASE_11)
     public static class ElementScanner<R, P> extends ElementScanner9<R, P> {
         /**
          * Constructor for concrete subclasses; uses {@code null} for the
@@ -181,7 +181,7 @@
         }
     }
 
-    @SupportedSourceVersion(RELEASE_10)
+    @SupportedSourceVersion(RELEASE_11)
     public static class SimpleAnnotationValueVisitor<R, P> extends SimpleAnnotationValueVisitor9<R, P> {
         /**
          * Constructor for concrete subclasses; uses {@code null} for the
@@ -202,7 +202,7 @@
         }
     }
 
-    @SupportedSourceVersion(RELEASE_10)
+    @SupportedSourceVersion(RELEASE_11)
     public static class SimpleElementVisitor<R, P> extends SimpleElementVisitor9<R, P> {
         /**
          * Constructor for concrete subclasses; uses {@code null} for the
@@ -223,7 +223,7 @@
         }
     }
 
-    @SupportedSourceVersion(RELEASE_10)
+    @SupportedSourceVersion(RELEASE_11)
     public static class SimpleTypeVisitor<R, P> extends SimpleTypeVisitor9<R, P> {
         /**
          * Constructor for concrete subclasses; uses {@code null} for the
@@ -244,7 +244,7 @@
         }
     }
 
-    @SupportedSourceVersion(RELEASE_10)
+    @SupportedSourceVersion(RELEASE_11)
     public static class TypeKindVisitor<R, P> extends TypeKindVisitor9<R, P> {
         /**
          * Constructor for concrete subclasses to call; uses {@code null}
--- a/test/langtools/tools/javac/miranda/4711056/T1.out	Thu Dec 14 22:06:19 2017 +0100
+++ b/test/langtools/tools/javac/miranda/4711056/T1.out	Thu Dec 21 22:05:28 2017 +0100
@@ -1,2 +1,2 @@
-T4.java:3:10: compiler.err.types.incompatible.diff.ret: iclss01004_2, iclss01004_1, foo(int)
+T4.java:3:10: compiler.err.types.incompatible: iclss01004_2, iclss01004_1, (compiler.misc.incompatible.diff.ret: foo, int)
 1 error
--- a/test/langtools/tools/javac/processing/model/TestSourceVersion.java	Thu Dec 14 22:06:19 2017 +0100
+++ b/test/langtools/tools/javac/processing/model/TestSourceVersion.java	Thu Dec 21 22:05:28 2017 +0100
@@ -23,7 +23,7 @@
 
 /*
  * @test
- * @bug 7025809 8028543 6415644 8028544 8029942
+ * @bug 7025809 8028543 6415644 8028544 8029942 8193291
  * @summary Test latest, latestSupported, underscore as keyword, etc.
  * @author  Joseph D. Darcy
  * @modules java.compiler
@@ -45,7 +45,7 @@
     }
 
     private static void testLatestSupported() {
-        if (SourceVersion.latest() != RELEASE_10 ||
+        if (SourceVersion.latest() != RELEASE_11 ||
             SourceVersion.latestSupported() != RELEASE_10)
             throw new RuntimeException("Unexpected release value(s) found:\n" +
                                        "latest:\t" + SourceVersion.latest() + "\n" +
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/langtools/tools/javac/processing/warnings/TypeAlreadyExists/A.java	Thu Dec 21 22:05:28 2017 +0100
@@ -0,0 +1,24 @@
+/*
+ * Copyright (c) 2017, Google Inc. All rights reserved.
+ * 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.
+ */
+
+public class A {}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/langtools/tools/javac/processing/warnings/TypeAlreadyExists/B.java	Thu Dec 21 22:05:28 2017 +0100
@@ -0,0 +1,26 @@
+/*
+ * Copyright (c) 2017, Google Inc. All rights reserved.
+ * 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.
+ */
+
+class B {
+    A a;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/langtools/tools/javac/processing/warnings/TypeAlreadyExists/TestProcTypeAlreadyExistsWarning.java	Thu Dec 21 22:05:28 2017 +0100
@@ -0,0 +1,66 @@
+/*
+ * Copyright (c) 2017, Google Inc. All rights reserved.
+ * 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 8193216
+ * @summary Filer should warn if processors redefine symbols from the classpath or sourcepath
+ * @library /tools/javac/lib
+ * @modules java.compiler
+ *          jdk.compiler
+ * @build JavacTestingAbstractProcessor TestProcTypeAlreadyExistsWarning
+ * @compile A.java
+ * @compile/ref=warn.out -XDrawDiagnostics -Xlint:processing -processor TestProcTypeAlreadyExistsWarning B.java
+ */
+
+import static java.nio.charset.StandardCharsets.UTF_8;
+
+import java.io.IOError;
+import java.io.IOException;
+import java.io.OutputStream;
+import java.util.Set;
+import javax.annotation.processing.RoundEnvironment;
+import javax.annotation.processing.SupportedAnnotationTypes;
+import javax.lang.model.element.TypeElement;
+
+@SupportedAnnotationTypes("*")
+public class TestProcTypeAlreadyExistsWarning extends JavacTestingAbstractProcessor {
+
+    int round = 0;
+
+    @Override
+    public boolean process(Set<? extends TypeElement> annotations, RoundEnvironment roundEnv) {
+        round++;
+
+        if (round == 1) {
+            try (OutputStream os =
+                    processingEnv.getFiler().createSourceFile("A").openOutputStream()) {
+                os.write("class A {}".getBytes(UTF_8));
+            } catch (IOException e) {
+                throw new IOError(e);
+            }
+        }
+
+        return false;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/langtools/tools/javac/processing/warnings/TypeAlreadyExists/warn.out	Thu Dec 21 22:05:28 2017 +0100
@@ -0,0 +1,2 @@
+- compiler.warn.proc.type.already.exists: A
+1 warning
--- a/test/langtools/tools/javac/profiles/ProfileOptionTest.java	Thu Dec 14 22:06:19 2017 +0100
+++ b/test/langtools/tools/javac/profiles/ProfileOptionTest.java	Thu Dec 21 22:05:28 2017 +0100
@@ -149,6 +149,7 @@
                         break;
                     case JDK1_9:
                     case JDK1_10:
+                    case JDK1_11:
                         if (p == Profile.DEFAULT)
                             break;
                         if (ise == null)
--- a/test/langtools/tools/javac/versions/Versions.java	Thu Dec 14 22:06:19 2017 +0100
+++ b/test/langtools/tools/javac/versions/Versions.java	Thu Dec 21 22:05:28 2017 +0100
@@ -23,7 +23,7 @@
 
 /*
  * @test
- * @bug 4981566 5028634 5094412 6304984 7025786 7025789 8001112 8028545 8000961 8030610 8028546 8188870
+ * @bug 4981566 5028634 5094412 6304984 7025786 7025789 8001112 8028545 8000961 8030610 8028546 8188870 8173382 8173382
  * @summary Check interpretation of -target and -source options
  * @modules java.compiler
  *          jdk.compiler
@@ -64,28 +64,35 @@
         String TC = "";
         System.out.println("Version.java: Starting");
 
-        check("54.0");
-        check("54.0", "-source 1.6");
-        check("54.0", "-source 1.7");
-        check("54.0", "-source 1.8");
-        check("54.0", "-source 1.9");
-        check("54.0", "-source 1.10");
+        check("55.0");
+        check("55.0", "-source 1.6");
+        check("55.0", "-source 1.7");
+        check("55.0", "-source 1.8");
+        check("55.0", "-source 1.9");
+        check("55.0", "-source 1.10");
+        check("55.0", "-source 11");
 
-        check_source_target("50.0", "6", "6");
-        check_source_target("51.0", "6", "7");
-        check_source_target("51.0", "7", "7");
-        check_source_target("52.0", "6", "8");
-        check_source_target("52.0", "7", "8");
-        check_source_target("52.0", "8", "8");
-        check_source_target("53.0", "6", "9");
-        check_source_target("53.0", "7", "9");
-        check_source_target("53.0", "8", "9");
-        check_source_target("53.0", "9", "9");
-        check_source_target("54.0", "6", "10");
-        check_source_target("54.0", "7", "10");
-        check_source_target("54.0", "8", "10");
-        check_source_target("54.0", "9", "10");
-        check_source_target("54.0", "10", "10");
+        check_source_target(true, "50.0", "6", "6");
+        check_source_target(true, "51.0", "6", "7");
+        check_source_target(true, "51.0", "7", "7");
+        check_source_target(true, "52.0", "6", "8");
+        check_source_target(true, "52.0", "7", "8");
+        check_source_target(true, "52.0", "8", "8");
+        check_source_target(true, "53.0", "6", "9");
+        check_source_target(true, "53.0", "7", "9");
+        check_source_target(true, "53.0", "8", "9");
+        check_source_target(true, "53.0", "9", "9");
+        check_source_target(true, "54.0", "6", "10");
+        check_source_target(true, "54.0", "7", "10");
+        check_source_target(true, "54.0", "8", "10");
+        check_source_target(true, "54.0", "9", "10");
+        check_source_target(true, "54.0", "10", "10");
+        check_source_target(false, "55.0", "6", "11");
+        check_source_target(false, "55.0", "7", "11");
+        check_source_target(false, "55.0", "8", "11");
+        check_source_target(false, "55.0", "9", "11");
+        check_source_target(false, "55.0", "10", "11");
+        check_source_target(false, "55.0", "11", "11");
 
         checksrc16("-source 1.6");
         checksrc16("-source 6");
@@ -108,8 +115,9 @@
         checksrc110("-source 10");
         checksrc110("-source 1.10", "-target 1.10");
         checksrc110("-source 10", "-target 10");
-        checksrc110("-target 1.10");
-        checksrc110("-target 10");
+        checksrc111("-source 11");
+        checksrc111("-source 11", "-target 11");
+        checksrc111("-target 11");
 
         fail("-source 7", "-target 1.6", "Base.java");
         fail("-source 8", "-target 1.6", "Base.java");
@@ -118,6 +126,8 @@
         fail("-source 9", "-target 1.8", "Base.java");
         fail("-source 10", "-target 1.7", "Base.java");
         fail("-source 10", "-target 1.8", "Base.java");
+        fail("-source 11", "-target 1.9", "Base.java");
+        fail("-source 11", "-target 1.10", "Base.java");
 
         fail("-source 1.5", "-target 1.5", "Base.java");
         fail("-source 1.4", "-target 1.4", "Base.java");
@@ -139,20 +149,24 @@
         System.out.printf("\n", fname);
     }
 
-    protected void check_source_target(String... args) {
+    protected void check_source_target(boolean dotOne, String... args) {
         printargs("check_source_target", args);
-        check_target(args[0], args[1], args[2]);
-        check_target(args[0], "1." + args[1], args[2]);
+        check_target(dotOne, args[0], args[1], args[2]);
+        if (dotOne) {
+            check_target(dotOne, args[0], "1." + args[1], args[2]);
+        }
     }
 
-    protected void check_target(String... args) {
+    protected void check_target(boolean dotOne, String... args) {
         check(args[0], "-source " + args[1], "-target " + args[2]);
-        check(args[0], "-source " + args[1], "-target 1." + args[2]);
+        if (dotOne) {
+            check(args[0], "-source " + args[1], "-target 1." + args[2]);
+        }
     }
 
     protected void check(String major, String... args) {
         printargs("check", args);
-        List<String> jcargs = new ArrayList<String>();
+        List<String> jcargs = new ArrayList<>();
         jcargs.add("-Xlint:-options");
 
         // add in args conforming to List requrements of JavaCompiler
@@ -207,6 +221,8 @@
         pass(newargs);
         newargs[asize] = "New18.java";
         pass(newargs);
+        newargs[asize] = "New110.java";
+        fail(newargs);
     }
 
     protected void checksrc19(String... args) {
@@ -216,7 +232,20 @@
 
     protected void checksrc110(String... args) {
         printargs("checksrc110", args);
-        checksrc19(args);
+        int asize = args.length;
+        String[] newargs = new String[asize+1];
+        System.arraycopy(args, 0, newargs,0 , asize);
+        newargs[asize] = "New17.java";
+        pass(newargs);
+        newargs[asize] = "New18.java";
+        pass(newargs);
+        newargs[asize] = "New110.java";
+        pass(newargs);
+    }
+
+    protected void checksrc111(String... args) {
+        printargs("checksrc111", args);
+        checksrc110(args);
     }
 
     protected void pass(String... args) {
@@ -347,6 +376,17 @@
             "} \n"
         );
 
+        /*
+         * Create a file with a new feature in 1.10, not in 1.9 : var
+         */
+        writeSourceFile("New110.java",
+            "public class New110 { \n" +
+            "    void m() { \n" +
+            "    var tmp = new Thread(() -> { }); \n" +
+            "    } \n" +
+            "} \n"
+        );
+
     }
 
     protected boolean checkClassFileVersion
--- a/test/nashorn/TEST.ROOT	Thu Dec 14 22:06:19 2017 +0100
+++ b/test/nashorn/TEST.ROOT	Thu Dec 21 22:05:28 2017 +0100
@@ -8,7 +8,7 @@
 groups=TEST.groups
 
 # Minimum jtreg version
-requiredVersion=4.2 b08
+requiredVersion=4.2 b11
 
 # Use new module options
 useNewOptions=true
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/nashorn/script/basic/JDK-8193371.js	Thu Dec 21 22:05:28 2017 +0100
@@ -0,0 +1,215 @@
+/*
+ * Copyright (c) 2017 Oracle and/or its affiliates. All rights reserved.
+ * 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-8193371: Use Dynalink REMOVE operation in Nashorn
+ *
+ * @test
+ * @run
+ */
+
+// This test exercises new functionality enabled by the issue, namely removal of elements from Java lists and maps.
+
+var ArrayList = java.util.ArrayList;
+var HashMap = java.util.HashMap;
+var listOf = java.util.List.of;
+var mapOf = java.util.Map.of;
+
+// Remove from a list
+(function() { 
+    var a = new ArrayList(listOf("foo", "bar", "baz"));
+    Assert.assertFalse(delete a.add);
+
+    // Delete actual element
+    Assert.assertTrue(delete a[1]);
+    Assert.assertEquals(a, listOf("foo", "baz"));
+
+    // Gracefully ignore silly indices
+    Assert.assertTrue(delete a[5]);
+    Assert.assertTrue(delete a[-1]);
+    Assert.assertTrue(delete a["whatever"]);
+    Assert.assertTrue(delete a.whatever);
+
+    // Gracefully ignore attempts at deleting methods and properties
+    Assert.assertFalse(delete a.add);
+    Assert.assertFalse(delete a.class);
+
+    Assert.assertEquals(a, listOf("foo", "baz"));
+
+    print("List passed.")
+})();
+
+// Remove from a list, strict
+(function() { 
+    "use strict";
+	
+    var a = new ArrayList(listOf("foo", "bar", "baz"));
+
+    // Delete actual element
+    Assert.assertTrue(delete a[1]);
+    Assert.assertEquals(a, listOf("foo", "baz"));
+
+    // Gracefully ignore silly indices
+    Assert.assertTrue(delete a[5]);
+    Assert.assertTrue(delete a[-1]);
+    Assert.assertTrue(delete a["whatever"]);
+    Assert.assertTrue(delete a.whatever);
+
+    // Fail deleting methods and properties
+    try { delete a.add; Assert.fail(); } catch (e) { Assert.assertTrue(e instanceof TypeError) }
+    try { delete a.class; Assert.fail(); } catch (e) { Assert.assertTrue(e instanceof TypeError) }
+
+    Assert.assertEquals(a, listOf("foo", "baz"));
+
+    print("Strict list passed.")
+})();
+
+// Remove from a map
+(function() { 
+    var m = new HashMap(mapOf("a", 1, "b", 2, "c", 3));
+
+    // Delete actual elements
+    Assert.assertTrue(delete m.a);
+    Assert.assertEquals(m, mapOf("b", 2, "c", 3));
+    var key = "b"
+    Assert.assertTrue(delete m[key]);
+    Assert.assertEquals(m, mapOf("c", 3));
+
+    // Gracefully ignore silly indices
+    Assert.assertTrue(delete m.x);
+    Assert.assertTrue(delete m[5]);
+    Assert.assertTrue(delete m[-1]);
+    Assert.assertTrue(delete m["whatever"]);
+
+    // Gracefully ignore attempts at deleting methods and properties
+    Assert.assertFalse(delete m.put);
+    Assert.assertFalse(delete m.class);
+
+    Assert.assertEquals(m, mapOf("c", 3));
+    print("Map passed.")
+})();
+
+// Remove from a map, strict
+(function() { 
+    "use strict";
+
+    var m = new HashMap(mapOf("a", 1, "b", 2, "c", 3));
+
+    // Delete actual elements
+    Assert.assertTrue(delete m.a);
+    Assert.assertEquals(m, mapOf("b", 2, "c", 3));
+    var key = "b"
+    Assert.assertTrue(delete m[key]);
+    Assert.assertEquals(m, mapOf("c", 3));
+
+    // Gracefully ignore silly indices
+    Assert.assertTrue(delete m.x);
+    Assert.assertTrue(delete m[5]);
+    Assert.assertTrue(delete m[-1]);
+    Assert.assertTrue(delete m["whatever"]);
+
+    // Fail deleting methods and properties
+    try { delete m.size; Assert.fail(); } catch (e) { Assert.assertTrue(e instanceof TypeError) }
+    try { delete m.class; Assert.fail(); } catch (e) { Assert.assertTrue(e instanceof TypeError) }
+
+    // Somewhat counterintuitive, but if we define an element of a map, we can 
+    // delete it, however then the method surfaces, and we can't delete that.
+    m.size = 4
+    Assert.assertTrue(delete m.size)
+    try { delete m.size; Assert.fail(); } catch (e) { Assert.assertTrue(e instanceof TypeError) }
+    
+    Assert.assertEquals(m, mapOf("c", 3));
+
+    print("Strict map passed.")
+})();
+
+// Remove from arrays and beans
+(function() { 
+    var a = new (Java.type("int[]"))(2)
+    a[0] = 42
+    a[1] = 13
+    
+    // Huh, Dynalink doesn't expose .clone() on Java arrays?
+    var c = new (Java.type("int[]"))(2)
+    c[0] = 42
+    c[1] = 13
+
+    // passes vacuously, but does nothing
+    Assert.assertTrue(delete a[0])
+    Assert.assertEquals(a, c);
+    
+    var b = new java.util.BitSet()
+    b.set(2)
+    // does nothing
+    Assert.assertFalse(delete b.get)
+    // Method is still there and operational
+    Assert.assertTrue(b.get(2))
+
+    // passes vacuously for non-existant property
+    Assert.assertTrue(delete b.foo)
+
+    // statics
+    var Calendar = java.util.Calendar
+    Assert.assertFalse(delete Calendar.UNDECIMBER) // field
+    Assert.assertFalse(delete Calendar.availableLocales) // property
+    Assert.assertFalse(delete Calendar.getInstance) // method
+    Assert.assertTrue(delete Calendar.BLAH) // no such thing
+  
+    print("Beans passed.")
+})();
+
+// Remove from arrays and beans, strict
+(function() { 
+    "use strict";
+    
+    var a = new (Java.type("int[]"))(2)
+    a[0] = 42
+    a[1] = 13
+
+    var c = new (Java.type("int[]"))(2)
+    c[0] = 42
+    c[1] = 13
+
+    // passes vacuously, but does nothing
+    Assert.assertTrue(delete a[0])
+    Assert.assertEquals(a, c);
+    
+    var b = new java.util.BitSet()
+    b.set(2)
+    // fails to delete a method
+    try { delete b.get; Assert.fail(); } catch (e) { Assert.assertTrue(e instanceof TypeError) }
+    // Method is still there and operational
+    Assert.assertTrue(b.get(2))
+
+    // passes vacuously for non-existant property
+    Assert.assertTrue(delete b.foo)
+    
+    // statics
+    var Calendar = java.util.Calendar
+    try { delete Calendar.UNDECIMBER; Assert.fail(); } catch (e) { Assert.assertTrue(e instanceof TypeError) }
+    try { delete Calendar.availableLocales; Assert.fail(); } catch (e) { Assert.assertTrue(e instanceof TypeError) }
+    try { delete Calendar.getInstance; Assert.fail(); } catch (e) { Assert.assertTrue(e instanceof TypeError) }
+    Assert.assertTrue(delete Calendar.BLAH) // no such thing
+  
+    print("Strict beans passed.")
+})();
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/nashorn/script/basic/JDK-8193371.js.EXPECTED	Thu Dec 21 22:05:28 2017 +0100
@@ -0,0 +1,6 @@
+List passed.
+Strict list passed.
+Map passed.
+Strict map passed.
+Beans passed.
+Strict beans passed.