changeset 53009:218799944c24 processorid

Merge
author alanb
date Mon, 10 Dec 2018 10:20:31 +0000
parents 3d499d469f62 eef755718cb2
children 5cc04c40d8e4
files make/nashorn/package-list src/hotspot/share/classfile/vmSymbols.hpp src/java.desktop/macosx/native/libsplashscreen/libpng/zlibwrapper/zlib.h test/jdk/java/awt/Choice/ChoiceKeyEventReaction/ChoiceKeyEventReaction.html test/jdk/java/util/Properties/Compatibility.xml test/jdk/java/util/Properties/CompatibilityTest.java test/jdk/lib/testlibrary/ExtendedRobot.java
diffstat 994 files changed, 10378 insertions(+), 5163 deletions(-) [+]
line wrap: on
line diff
--- a/.hgtags	Thu Dec 06 12:18:29 2018 +0100
+++ b/.hgtags	Mon Dec 10 10:20:31 2018 +0000
@@ -524,3 +524,4 @@
 dc1f9dec2018a37fedba47d8a2aedef99faaec64 jdk-12+19
 40098289d5804c3b5e7074bc75501a81e70d9b0d jdk-12+20
 f8fb0c86f2b3d24294d39c5685a628e1beb14ba7 jdk-12+21
+732bec44c89e8b93a38296bf690f97b7230c5b6d jdk-12+22
--- a/bin/idea.sh	Thu Dec 06 12:18:29 2018 +0100
+++ b/bin/idea.sh	Mon Dec 10 10:20:31 2018 +0000
@@ -1,6 +1,6 @@
 #!/bin/sh
 #
-# Copyright (c) 2009, 2014, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2009, 2018, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
--- a/doc/building.html	Thu Dec 06 12:18:29 2018 +0100
+++ b/doc/building.html	Mon Dec 10 10:20:31 2018 +0000
@@ -464,6 +464,10 @@
 <li><code>--with-jvm-features=&lt;feature&gt;[,&lt;feature&gt;...]</code> - Use the specified JVM features when building Hotspot. The list of features will be enabled on top of the default list. For the <code>custom</code> JVM variant, this default list is empty. A complete list of available JVM features can be found using <code>bash configure --help</code>.</li>
 <li><code>--with-target-bits=&lt;bits&gt;</code> - Create a target binary suitable for running on a <code>&lt;bits&gt;</code> platform. Use this to create 32-bit output on a 64-bit build platform, instead of doing a full cross-compile. (This is known as a <em>reduced</em> build.)</li>
 </ul>
+<p>On Linux, BSD and AIX, it is possible to override where Java by default searches for runtime/JNI libraries. This can be useful in situations where there is a special shared directory for system JNI libraries. This setting can in turn be overriden at runtime by setting the <code>java.library.path</code> property.</p>
+<ul>
+<li><code>--with-jni-libpath=&lt;path&gt;</code> - Use the specified path as a default when searching for runtime libraries.</li>
+</ul>
 <h4 id="configure-arguments-for-native-compilation">Configure Arguments for Native Compilation</h4>
 <ul>
 <li><code>--with-devkit=&lt;path&gt;</code> - Use this devkit for compilers, tools and resources</li>
--- a/doc/building.md	Thu Dec 06 12:18:29 2018 +0100
+++ b/doc/building.md	Mon Dec 10 10:20:31 2018 +0000
@@ -662,6 +662,14 @@
     platform, instead of doing a full cross-compile. (This is known as a
     *reduced* build.)
 
+On Linux, BSD and AIX, it is possible to override where Java by default
+searches for runtime/JNI libraries. This can be useful in situations where
+there is a special shared directory for system JNI libraries. This setting
+can in turn be overriden at runtime by setting the `java.library.path` property.
+
+  * `--with-jni-libpath=<path>` - Use the specified path as a default
+  when searching for runtime libraries.
+
 #### Configure Arguments for Native Compilation
 
   * `--with-devkit=<path>` - Use this devkit for compilers, tools and resources
--- a/make/BuildStatic.gmk	Thu Dec 06 12:18:29 2018 +0100
+++ b/make/BuildStatic.gmk	Mon Dec 10 10:20:31 2018 +0000
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
--- a/make/Bundles.gmk	Thu Dec 06 12:18:29 2018 +0100
+++ b/make/Bundles.gmk	Mon Dec 10 10:20:31 2018 +0000
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -262,6 +262,21 @@
 
 ################################################################################
 
+ifneq ($(filter jcov-bundles, $(MAKECMDGOALS)), )
+  JCOV_BUNDLE_FILES := $(call CacheFind, $(JCOV_IMAGE_DIR))
+
+  $(eval $(call SetupBundleFile, BUILD_JCOV_BUNDLE, \
+      BUNDLE_NAME := $(JCOV_BUNDLE_NAME), \
+      FILES := $(JCOV_BUNDLE_FILES), \
+      BASE_DIRS := $(JCOV_IMAGE_DIR), \
+      SUBDIR := $(JDK_BUNDLE_SUBDIR), \
+  ))
+
+  JCOV_TARGETS += $(BUILD_JCOV_BUNDLE)
+endif
+
+################################################################################
+
 # Hook to include the corresponding custom file, if present.
 $(eval $(call IncludeCustomExtension, Bundles.gmk))
 
@@ -270,5 +285,6 @@
 product-bundles: $(PRODUCT_TARGETS)
 test-bundles: $(TEST_TARGETS)
 docs-bundles: $(DOCS_TARGETS)
+jcov-bundles: $(JCOV_TARGETS)
 
-.PHONY: all default product-bundles test-bundles docs-bundles
+.PHONY: all default product-bundles test-bundles docs-bundles jcov-bundles
--- a/make/CompileDemos.gmk	Thu Dec 06 12:18:29 2018 +0100
+++ b/make/CompileDemos.gmk	Mon Dec 10 10:20:31 2018 +0000
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
--- a/make/CompileToolsHotspot.gmk	Thu Dec 06 12:18:29 2018 +0100
+++ b/make/CompileToolsHotspot.gmk	Mon Dec 10 10:20:31 2018 +0000
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
--- a/make/CopyInterimCLDRConverter.gmk	Thu Dec 06 12:18:29 2018 +0100
+++ b/make/CopyInterimCLDRConverter.gmk	Mon Dec 10 10:20:31 2018 +0000
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/make/Coverage.gmk	Mon Dec 10 10:20:31 2018 +0000
@@ -0,0 +1,56 @@
+#
+# Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
+# 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.
+
+include $(SPEC)
+include MakeBase.gmk
+
+################################################################################
+
+JCOV_INPUT_IMAGE_DIR :=
+
+ifneq ($(JCOV_INPUT_JDK), )
+  JCOV_INPUT_IMAGE_DIR := $(JCOV_INPUT_JDK)
+else
+  JCOV_INPUT_IMAGE_DIR := $(JDK_IMAGE_DIR)
+endif
+
+#moving instrumented jdk image in and out of jcov_temp because of CODETOOLS-7902299
+JCOV_TEMP := $(SUPPORT_OUTPUTDIR)/jcov_temp
+
+$(JCOV_IMAGE_DIR)/release: $(JCOV_INPUT_IMAGE_DIR)/release
+	$(call LogWarn, Creating instrumented jdk image with JCov)
+	$(call MakeDir, $(JCOV_TEMP) $(IMAGES_OUTPUTDIR))
+	$(RM) -r $(JCOV_IMAGE_DIR) $(JCOV_TEMP)/*
+	$(CP) -r $(JCOV_INPUT_IMAGE_DIR) $(JCOV_TEMP)/$(JCOV_IMAGE_SUBDIR)
+	$(JAVA) -Xmx3g -jar $(JCOV_HOME)/lib/jcov.jar JREInstr \
+	    -t $(JCOV_TEMP)/$(JCOV_IMAGE_SUBDIR)/template.xml \
+	    -rt $(JCOV_HOME)/lib/jcov_network_saver.jar \
+	    -exclude 'java.lang.Object' \
+	    -exclude 'jdk.internal.org.objectweb.**' \
+	    -exclude jdk.test.Main -exclude '**\$Proxy*' \
+	    $(JCOV_TEMP)/$(JCOV_IMAGE_SUBDIR)
+	$(MV) $(JCOV_TEMP)/$(JCOV_IMAGE_SUBDIR) $(JCOV_IMAGE_DIR)
+	$(RMDIR) $(JCOV_TEMP)
+
+jcov-image: $(JCOV_IMAGE_DIR)/release
--- a/make/CreateBuildJdkCopy.gmk	Thu Dec 06 12:18:29 2018 +0100
+++ b/make/CreateBuildJdkCopy.gmk	Mon Dec 10 10:20:31 2018 +0000
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
--- a/make/CreateJmods.gmk	Thu Dec 06 12:18:29 2018 +0100
+++ b/make/CreateJmods.gmk	Mon Dec 10 10:20:31 2018 +0000
@@ -1,4 +1,4 @@
-# Copyright (c) 2014, 2017, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2014, 2018, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
--- a/make/GenerateModuleSummary.gmk	Thu Dec 06 12:18:29 2018 +0100
+++ b/make/GenerateModuleSummary.gmk	Mon Dec 10 10:20:31 2018 +0000
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2014, 2017, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2014, 2018, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
--- a/make/GensrcModuleInfo.gmk	Thu Dec 06 12:18:29 2018 +0100
+++ b/make/GensrcModuleInfo.gmk	Mon Dec 10 10:20:31 2018 +0000
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
--- a/make/InterimImage.gmk	Thu Dec 06 12:18:29 2018 +0100
+++ b/make/InterimImage.gmk	Mon Dec 10 10:20:31 2018 +0000
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
--- a/make/Main.gmk	Thu Dec 06 12:18:29 2018 +0100
+++ b/make/Main.gmk	Mon Dec 10 10:20:31 2018 +0000
@@ -371,10 +371,15 @@
 exploded-image-optimize:
 	+($(CD) $(TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f ExplodedImageOptimize.gmk)
 
+ifeq ($(JCOV_ENABLED), true)
+  jcov-image:
+	+($(CD) $(TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f Coverage.gmk jcov-image)
+endif
+
 ALL_TARGETS += store-source-revision create-source-revision-tracker bootcycle-images zip-security \
     zip-source jrtfs-jar jdk-image legacy-jre-image \
     symbols-image mac-jdk-bundle mac-legacy-jre-bundle \
-    release-file exploded-image-optimize
+    release-file exploded-image-optimize jcov-image
 
 ################################################################################
 # Docs targets
@@ -577,7 +582,12 @@
 docs-bundles:
 	+($(CD) $(TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f Bundles.gmk docs-bundles)
 
-ALL_TARGETS += product-bundles test-bundles docs-bundles
+ifeq ($(JCOV_ENABLED), true)
+  jcov-bundles:
+	+($(CD) $(TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f Bundles.gmk jcov-bundles)
+endif
+
+ALL_TARGETS += product-bundles test-bundles docs-bundles jcov-bundles
 
 ################################################################################
 # Install targets
@@ -633,6 +643,7 @@
   # Declare dependencies between hotspot-<variant>* targets
   $(foreach v, $(JVM_VARIANTS), \
       $(eval hotspot-$v: hotspot-$v-gensrc hotspot-$v-libs) \
+      $(eval hotspot-$v-gensrc: java.base-copy) \
       $(eval hotspot-$v-libs: hotspot-$v-gensrc java.base-copy) \
   )
 
@@ -820,6 +831,10 @@
   mac-jdk-bundle: jdk-image
   mac-legacy-jre-bundle: legacy-jre-image
 
+  ifeq ($(JCOV_INPUT_JDK), )
+    jcov-image: jdk-image
+  endif
+
   # The optimize target can run as soon as the modules dir has been completely
   # populated (java, copy and gendata targets) and the basic libs and launchers
   # have been built.
@@ -900,6 +915,8 @@
 
   docs-bundles: docs-image
 
+  jcov-bundles: jcov-image
+
   generate-summary: jmods buildtools-modules
 
   update-x11wrappers: java.base-copy buildtools-jdk
--- a/make/RunTests.gmk	Thu Dec 06 12:18:29 2018 +0100
+++ b/make/RunTests.gmk	Mon Dec 10 10:20:31 2018 +0000
@@ -135,9 +135,11 @@
     $1_LD := $$(LD)
   endif
 
+  # Create jaotc flags.
+  # VM flags which don't affect AOT code generation are filtered out: -Xcomp, -XX:+-TieredCompilation
   $1_JAOTC_OPTS := \
       -J-Xmx4g --info \
-      $$(addprefix -J, $$($1_VM_OPTIONS)) \
+      $$(addprefix -J, $$(filter-out -Xcomp %TieredCompilation, $$($1_VM_OPTIONS))) \
       $$(addprefix --compile-commands$(SPACE), $$($1_AOT_CCLIST)) \
       --linker-path $$($1_LD) \
       #
--- a/make/ZipSource.gmk	Thu Dec 06 12:18:29 2018 +0100
+++ b/make/ZipSource.gmk	Mon Dec 10 10:20:31 2018 +0000
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2014, 2018, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
--- a/make/autoconf/boot-jdk.m4	Thu Dec 06 12:18:29 2018 +0100
+++ b/make/autoconf/boot-jdk.m4	Mon Dec 10 10:20:31 2018 +0000
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2011, 2017, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
--- a/make/autoconf/build-aux/config.guess	Thu Dec 06 12:18:29 2018 +0100
+++ b/make/autoconf/build-aux/config.guess	Mon Dec 10 10:20:31 2018 +0000
@@ -1,6 +1,6 @@
 #!/bin/sh
 #
-# Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
--- a/make/autoconf/flags-other.m4	Thu Dec 06 12:18:29 2018 +0100
+++ b/make/autoconf/flags-other.m4	Mon Dec 10 10:20:31 2018 +0000
@@ -119,6 +119,12 @@
   # Misuse EXTRA_CFLAGS to mimic old behavior
   $2JVM_ASFLAGS="$JVM_BASIC_ASFLAGS ${$2EXTRA_CFLAGS}"
 
+  if test "x$1" = "xTARGET" && \
+      test "x$TOOLCHAIN_TYPE" = xgcc && \
+      test "x$OPENJDK_TARGET_CPU" = xarm; then
+    $2JVM_ASFLAGS="${$2JVM_ASFLAGS} $ARM_ARCH_TYPE_ASFLAGS $ARM_FLOAT_TYPE_ASFLAGS"
+  fi
+
   AC_SUBST($2JVM_ASFLAGS)
 ])
 
--- a/make/autoconf/flags.m4	Thu Dec 06 12:18:29 2018 +0100
+++ b/make/autoconf/flags.m4	Mon Dec 10 10:20:31 2018 +0000
@@ -46,41 +46,59 @@
     AC_MSG_CHECKING([for ABI profle])
     AC_MSG_RESULT([$OPENJDK_TARGET_ABI_PROFILE])
 
+    # --- Arm-sflt CFLAGS and ASFLAGS ---
+    # Armv5te is required for assembler, because pld insn used in arm32 hotspot is only in v5E and above.
+    # However, there is also a GCC bug which generates unaligned strd/ldrd instructions on armv5te:
+    # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82445, and it was fixed only quite recently.
+    # The resulting compromise is to enable v5TE for assembler and let GCC generate code for v5T.
     if test "x$OPENJDK_TARGET_ABI_PROFILE" = xarm-vfp-sflt; then
       ARM_FLOAT_TYPE=vfp-sflt
       ARM_ARCH_TYPE_FLAGS='-march=armv7-a -mthumb'
+      ARM_ARCH_TYPE_ASFLAGS='-march=armv7-a -mthumb'
     elif test "x$OPENJDK_TARGET_ABI_PROFILE" = xarm-vfp-hflt; then
       ARM_FLOAT_TYPE=vfp-hflt
       ARM_ARCH_TYPE_FLAGS='-march=armv7-a -mthumb'
+      ARM_ARCH_TYPE_ASFLAGS='-march=armv7-a -mthumb'
     elif test "x$OPENJDK_TARGET_ABI_PROFILE" = xarm-sflt; then
       ARM_FLOAT_TYPE=sflt
       ARM_ARCH_TYPE_FLAGS='-march=armv5t -marm'
+      ARM_ARCH_TYPE_ASFLAGS='-march=armv5te'
     elif test "x$OPENJDK_TARGET_ABI_PROFILE" = xarmv5-vfp-sflt; then
       ARM_FLOAT_TYPE=vfp-sflt
       ARM_ARCH_TYPE_FLAGS='-march=armv5t -marm'
+      ARM_ARCH_TYPE_ASFLAGS='-march=armv5te'
     elif test "x$OPENJDK_TARGET_ABI_PROFILE" = xarmv6-vfp-hflt; then
       ARM_FLOAT_TYPE=vfp-hflt
       ARM_ARCH_TYPE_FLAGS='-march=armv6 -marm'
+      ARM_ARCH_TYPE_ASFLAGS='-march=armv6'
     elif test "x$OPENJDK_TARGET_ABI_PROFILE" = xaarch64; then
       # No special flags, just need to trigger setting JDK_ARCH_ABI_PROP_NAME
       ARM_FLOAT_TYPE=
       ARM_ARCH_TYPE_FLAGS=
+      ARM_ARCH_TYPE_ASFLAGS=
     else
       AC_MSG_ERROR([Invalid ABI profile: "$OPENJDK_TARGET_ABI_PROFILE"])
     fi
 
     if test "x$ARM_FLOAT_TYPE" = xvfp-sflt; then
       ARM_FLOAT_TYPE_FLAGS='-mfloat-abi=softfp -mfpu=vfp -DFLOAT_ARCH=-vfp-sflt'
+      ARM_FLOAT_TYPE_ASFLAGS="-mfloat-abi=softfp -mfpu=vfp"
     elif test "x$ARM_FLOAT_TYPE" = xvfp-hflt; then
       ARM_FLOAT_TYPE_FLAGS='-mfloat-abi=hard -mfpu=vfp -DFLOAT_ARCH=-vfp-hflt'
+      ARM_FLOAT_TYPE_ASFLAGS="-mfloat-abi=hard -mfpu=vfp"
     elif test "x$ARM_FLOAT_TYPE" = xsflt; then
       ARM_FLOAT_TYPE_FLAGS='-msoft-float -mfpu=vfp'
+      ARM_FLOAT_TYPE_ASFLAGS="-mfloat-abi=soft -mfpu=vfp"
     fi
     AC_MSG_CHECKING([for $ARM_FLOAT_TYPE floating point flags])
     AC_MSG_RESULT([$ARM_FLOAT_TYPE_FLAGS])
+    AC_MSG_CHECKING([for $ARM_FLOAT_TYPE floating point flags for assembler])
+    AC_MSG_RESULT([$ARM_FLOAT_TYPE_ASFLAGS])
 
     AC_MSG_CHECKING([for arch type flags])
     AC_MSG_RESULT([$ARM_ARCH_TYPE_FLAGS])
+    AC_MSG_CHECKING([for arch type flags for assembler])
+    AC_MSG_RESULT([$ARM_ARCH_TYPE_ASFLAGS])
 
     # Now set JDK_ARCH_ABI_PROP_NAME. This is equivalent to the last part of the
     # autoconf target triplet.
--- a/make/autoconf/hotspot.m4	Thu Dec 06 12:18:29 2018 +0100
+++ b/make/autoconf/hotspot.m4	Mon Dec 10 10:20:31 2018 +0000
@@ -325,17 +325,13 @@
     fi
   fi
 
-  # Only enable ZGC on Linux x86_64
-  AC_MSG_CHECKING([if zgc should be built])
-  if HOTSPOT_CHECK_JVM_FEATURE(zgc); then
-    if test "x$OPENJDK_TARGET_OS" = "xlinux" && test "x$OPENJDK_TARGET_CPU" = "xx86_64"; then
-      AC_MSG_RESULT([yes])
-    else
-      DISABLED_JVM_FEATURES="$DISABLED_JVM_FEATURES zgc"
-      AC_MSG_RESULT([no, platform not supported])
-    fi
+  # Only enable ZGC on supported platforms
+  AC_MSG_CHECKING([if zgc can be built])
+  if test "x$OPENJDK_TARGET_OS" = "xlinux" && test "x$OPENJDK_TARGET_CPU" = "xx86_64"; then
+    AC_MSG_RESULT([yes])
   else
-    AC_MSG_RESULT([no])
+    DISABLED_JVM_FEATURES="$DISABLED_JVM_FEATURES zgc"
+    AC_MSG_RESULT([no, platform not supported])
   fi
 
   # Disable unsupported GCs for Zero
@@ -474,7 +470,7 @@
   fi
 
   # All variants but minimal (and custom) get these features
-  NON_MINIMAL_FEATURES="$NON_MINIMAL_FEATURES cmsgc g1gc parallelgc serialgc epsilongc jni-check jvmti management nmt services vm-structs"
+  NON_MINIMAL_FEATURES="$NON_MINIMAL_FEATURES cmsgc g1gc parallelgc serialgc epsilongc jni-check jvmti management nmt services vm-structs zgc"
 
   # Disable CDS on AIX.
   if test "x$OPENJDK_TARGET_OS" = "xaix"; then
--- a/make/autoconf/jdk-options.m4	Thu Dec 06 12:18:29 2018 +0100
+++ b/make/autoconf/jdk-options.m4	Mon Dec 10 10:20:31 2018 +0000
@@ -244,6 +244,28 @@
     COPYRIGHT_YEAR=`$DATE +'%Y'`
   fi
   AC_SUBST(COPYRIGHT_YEAR)
+
+  # Override default library path
+  AC_ARG_WITH([jni-libpath], [AS_HELP_STRING([--with-jni-libpath],
+      [override default JNI library search path])])
+  AC_MSG_CHECKING([for jni library path])
+  if test "x${with_jni_libpath}" = "x" || test "x${with_jni_libpath}" = "xno"; then
+    AC_MSG_RESULT([default])
+  elif test "x${with_jni_libpath}" = "xyes"; then
+    AC_MSG_RESULT([invalid])
+    AC_MSG_ERROR([The --with-jni-libpath option requires an argument.])
+  else
+    HOTSPOT_OVERRIDE_LIBPATH=${with_jni_libpath}
+    if test "x$OPENJDK_TARGET_OS" != "xlinux" &&
+         test "x$OPENJDK_TARGET_OS" != "xbsd" &&
+         test "x$OPENJDK_TARGET_OS" != "xaix"; then
+      AC_MSG_RESULT([fail])
+      AC_MSG_ERROR([Overriding JNI library path is supported only on Linux, BSD and AIX.])
+    fi
+    AC_MSG_RESULT(${HOTSPOT_OVERRIDE_LIBPATH})
+  fi
+  AC_SUBST(HOTSPOT_OVERRIDE_LIBPATH)
+
 ])
 
 ###############################################################################
@@ -373,8 +395,37 @@
   elif test "x$enable_native_coverage" != "x"; then
     AC_MSG_ERROR([--enable-native-coverage can only be assigned "yes" or "no"])
   fi
+  AC_SUBST(GCOV_ENABLED)
 
-  AC_SUBST(GCOV_ENABLED)
+  AC_ARG_WITH(jcov, [AS_HELP_STRING([--with-jcov],
+      [jcov library location])])
+  AC_ARG_WITH(jcov-input-jdk, [AS_HELP_STRING([--with-jcov-input-jdk],
+      [jdk image to instrument])])
+  JCOV_HOME=
+  JCOV_INPUT_JDK=
+  JCOV_ENABLED=
+  if test "x$with_jcov" = "x" ; then
+    JCOV_ENABLED="false"
+  else
+    JCOV_HOME="$with_jcov"
+    if test ! -f "$JCOV_HOME/lib/jcov.jar"; then
+      AC_MSG_RESULT([fail])
+      AC_MSG_ERROR([Invalid JCov bundle: "$JCOV_HOME/lib/jcov.jar" does not exist])
+    fi
+    JCOV_ENABLED="true"
+    BASIC_FIXUP_PATH(JCOV_HOME)
+    if test "x$with_jcov_input_jdk" != "x" ; then
+      JCOV_INPUT_JDK="$with_jcov_input_jdk"
+      if test ! -f "$JCOV_INPUT_JDK/bin/java$EXE_SUFFIX"; then
+        AC_MSG_RESULT([fail])
+        AC_MSG_ERROR([Invalid JDK bundle: "$JCOV_INPUT_JDK/bin/java$EXE_SUFFIX" does not exist])
+      fi
+      BASIC_FIXUP_PATH(JCOV_INPUT_JDK)
+    fi
+  fi
+  AC_SUBST(JCOV_ENABLED)
+  AC_SUBST(JCOV_HOME)
+  AC_SUBST(JCOV_INPUT_JDK)
 ])
 
 ###############################################################################
--- a/make/autoconf/jdk-version.m4	Thu Dec 06 12:18:29 2018 +0100
+++ b/make/autoconf/jdk-version.m4	Mon Dec 10 10:20:31 2018 +0000
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -91,7 +91,9 @@
     AC_MSG_ERROR([--with-vendor-url must have a value])
   elif [ ! [[ $with_vendor_url =~ ^[[:print:]]*$ ]] ]; then
     AC_MSG_ERROR([--with-vendor-url contains non-printing characters: $with_vendor_url])
-  else
+  elif test "x$with_vendor_url" != x; then
+    # Only set VENDOR_URL if '--with-vendor-url' was used and is not empty.
+    # Otherwise we will use the value from "version-numbers" included above.
     VENDOR_URL="$with_vendor_url"
   fi
   AC_SUBST(VENDOR_URL)
@@ -103,7 +105,9 @@
     AC_MSG_ERROR([--with-vendor-bug-url must have a value])
   elif [ ! [[ $with_vendor_bug_url =~ ^[[:print:]]*$ ]] ]; then
     AC_MSG_ERROR([--with-vendor-bug-url contains non-printing characters: $with_vendor_bug_url])
-  else
+  elif test "x$with_vendor_bug_url" != x; then
+    # Only set VENDOR_URL_BUG if '--with-vendor-bug-url' was used and is not empty.
+    # Otherwise we will use the value from "version-numbers" included above.
     VENDOR_URL_BUG="$with_vendor_bug_url"
   fi
   AC_SUBST(VENDOR_URL_BUG)
--- a/make/autoconf/lib-bundled.m4	Thu Dec 06 12:18:29 2018 +0100
+++ b/make/autoconf/lib-bundled.m4	Mon Dec 10 10:20:31 2018 +0000
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2011, 2017, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
--- a/make/autoconf/spec.gmk.in	Thu Dec 06 12:18:29 2018 +0100
+++ b/make/autoconf/spec.gmk.in	Mon Dec 10 10:20:31 2018 +0000
@@ -228,7 +228,8 @@
   # Only export "VENDOR" to the build if COMPANY_NAME contains a real value.
   # Otherwise the default value for VENDOR, which is used to set the "java.vendor"
   # and "java.vm.vendor" properties is hard-coded into the source code (i.e. in
-  # System.c in the jdk for "vm.vendor" and vm_version.cpp in the VM for "java.vm.vendor")
+  # VersionProps.java.template in the jdk for "vm.vendor" and
+  # vm_version.cpp in the VM for "java.vm.vendor")
   ifneq ($(COMPANY_NAME), N/A)
     VERSION_CFLAGS += -DVENDOR='"$(COMPANY_NAME)"'
   endif
@@ -274,6 +275,9 @@
 # Control wether Hotspot builds gtest tests
 BUILD_GTEST := @BUILD_GTEST@
 
+# Allow overriding the default hotspot library path
+HOTSPOT_OVERRIDE_LIBPATH := @HOTSPOT_OVERRIDE_LIBPATH@
+
 # Control use of precompiled header in hotspot libjvm build
 USE_PRECOMPILED_HEADER := @USE_PRECOMPILED_HEADER@
 
@@ -368,6 +372,9 @@
 UNLIMITED_CRYPTO=@UNLIMITED_CRYPTO@
 
 GCOV_ENABLED=@GCOV_ENABLED@
+JCOV_ENABLED=@JCOV_ENABLED@
+JCOV_HOME=@JCOV_HOME@
+JCOV_INPUT_JDK=@JCOV_INPUT_JDK@
 
 # AddressSanitizer
 export ASAN_ENABLED:=@ASAN_ENABLED@
@@ -835,10 +842,12 @@
 # Images directory definitions
 JDK_IMAGE_SUBDIR:=jdk
 JRE_IMAGE_SUBDIR:=jre
+JCOV_IMAGE_SUBDIR := jdk-jcov
 
 # Colon left out to be able to override output dir for bootcycle-images
 JDK_IMAGE_DIR=$(IMAGES_OUTPUTDIR)/$(JDK_IMAGE_SUBDIR)
 JRE_IMAGE_DIR=$(IMAGES_OUTPUTDIR)/$(JRE_IMAGE_SUBDIR)
+JCOV_IMAGE_DIR = $(IMAGES_OUTPUTDIR)/$(JCOV_IMAGE_SUBDIR)
 
 # Test image, as above
 TEST_IMAGE_SUBDIR:=test
@@ -885,12 +894,14 @@
 TEST_DEMOS_BUNDLE_NAME := jdk-$(BASE_NAME)_bin-tests-demos$(DEBUG_PART).tar.gz
 TEST_BUNDLE_NAME := jdk-$(BASE_NAME)_bin-tests$(DEBUG_PART).tar.gz
 DOCS_BUNDLE_NAME := jdk-$(BASE_NAME)_doc-api-spec$(DEBUG_PART).tar.gz
+JCOV_BUNDLE_NAME := jdk-jcov-$(BASE_NAME)_bin$(DEBUG_PART).$(JDK_BUNDLE_EXTENSION)
 
 JDK_BUNDLE := $(BUNDLES_OUTPUTDIR)/$(JDK_BUNDLE_NAME)
 JDK_SYMBOLS_BUNDLE :=  $(BUNDLES_OUTPUTDIR)/$(JDK_SYMBOLS_BUNDLE_NAME)
 TEST_DEMOS_BUNDLE := $(BUNDLES_OUTPUTDIR)/$(TEST_DEMOS_BUNDLE_NAME)
 TEST_BUNDLE :=  $(BUNDLES_OUTPUTDIR)/$(TEST_BUNDLE_NAME)
 DOCS_BUNDLE :=  $(BUNDLES_OUTPUTDIR)/$(DOCS_BUNDLE_NAME)
+JCOV_BUNDLE := $(BUNDLES_OUTPUTDIR)/$(JCOV_BUNDLE_NAME)
 
 # This macro is called to allow inclusion of closed source counterparts.
 # Unless overridden in closed sources, it expands to nothing.
--- a/make/autoconf/toolchain_windows.m4	Thu Dec 06 12:18:29 2018 +0100
+++ b/make/autoconf/toolchain_windows.m4	Mon Dec 10 10:20:31 2018 +0000
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
--- a/make/autoconf/version-numbers	Thu Dec 06 12:18:29 2018 +0100
+++ b/make/autoconf/version-numbers	Mon Dec 10 10:20:31 2018 +0000
@@ -43,6 +43,8 @@
 JDK_RC_PLATFORM_NAME=Platform
 COMPANY_NAME=N/A
 HOTSPOT_VM_DISTRO="OpenJDK"
+VENDOR_URL=https://openjdk.java.net/
+VENDOR_URL_BUG=https://bugreport.java.com/bugreport/
 
 # Might need better names for these
 MACOSX_BUNDLE_NAME_BASE="OpenJDK"
--- a/make/common/JarArchive.gmk	Thu Dec 06 12:18:29 2018 +0100
+++ b/make/common/JarArchive.gmk	Mon Dec 10 10:20:31 2018 +0000
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
--- a/make/common/JavaCompilation.gmk	Thu Dec 06 12:18:29 2018 +0100
+++ b/make/common/JavaCompilation.gmk	Mon Dec 10 10:20:31 2018 +0000
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2011, 2017, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
--- a/make/common/NativeCompilation.gmk	Thu Dec 06 12:18:29 2018 +0100
+++ b/make/common/NativeCompilation.gmk	Mon Dec 10 10:20:31 2018 +0000
@@ -237,7 +237,7 @@
     $1_SRC_FILE := $$($1_FILE)
 
     ifneq ($$($1_DISABLE_THIS_FILE_DEFINE), true)
-      $1_THIS_FILE = -DTHIS_FILE='"$$(<F)"'
+      $1_THIS_FILE = -DTHIS_FILE='"$$($1_FILENAME)"'
     endif
 
     ifeq ($$($1_OPTIMIZATION), )
--- a/make/common/TextFileProcessing.gmk	Thu Dec 06 12:18:29 2018 +0100
+++ b/make/common/TextFileProcessing.gmk	Mon Dec 10 10:20:31 2018 +0000
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
--- a/make/common/ZipArchive.gmk	Thu Dec 06 12:18:29 2018 +0100
+++ b/make/common/ZipArchive.gmk	Mon Dec 10 10:20:31 2018 +0000
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
--- a/make/conf/jib-profiles.js	Thu Dec 06 12:18:29 2018 +0100
+++ b/make/conf/jib-profiles.js	Mon Dec 10 10:20:31 2018 +0000
@@ -243,7 +243,7 @@
 
     // These are the base setttings for all the main build profiles.
     common.main_profile_base = {
-        dependencies: ["boot_jdk", "gnumake", "jtreg", "jib", "autoconf", "jmh"],
+        dependencies: ["boot_jdk", "gnumake", "jtreg", "jib", "autoconf", "jmh", "jcov"],
         default_make_targets: ["product-bundles", "test-bundles"],
         configure_args: concat(["--enable-jtreg-failure-handler"],
             "--with-exclude-translations=de,es,fr,it,ko,pt_BR,sv,ca,tr,cs,sk,ja_JP_A,ja_JP_HA,ja_JP_HI,ja_JP_I,zh_TW,zh_HK",
@@ -688,14 +688,6 @@
                        profiles[openName].artifacts["jdk"].remote));
     });
 
-    // Enable ZGC in linux-x64-open builds
-    [ "linux-x64-open" ].forEach(function (name) {
-        var configureArgs = { configure_args: [ "--with-jvm-features=zgc" ] };
-        var debugName = name + common.debug_suffix;
-        profiles[name] = concatObjects(profiles[name], configureArgs);
-        profiles[debugName] = concatObjects(profiles[debugName], configureArgs);
-    });
-
     // Generate cmp-baseline profiles for each main profile and their
     // corresponding debug profile. This profile does a compare build run with no
     // changes to verify that the compare script has a clean baseline
@@ -898,6 +890,14 @@
             revision: "1.21+1.0"
         },
 
+        jcov: {
+            server: "jpg",
+            product: "jcov",
+            version: "3.0",
+            build_number: "b07",
+            file: "bundles/jcov-3_0.zip",
+        },
+
         gnumake: {
             organization: common.organization,
             ext: "tar.gz",
--- a/make/copy/Copy-java.desktop.gmk	Thu Dec 06 12:18:29 2018 +0100
+++ b/make/copy/Copy-java.desktop.gmk	Mon Dec 10 10:20:31 2018 +0000
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2014, 2017, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2014, 2018, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
--- a/make/copy/CopyCommon.gmk	Thu Dec 06 12:18:29 2018 +0100
+++ b/make/copy/CopyCommon.gmk	Mon Dec 10 10:20:31 2018 +0000
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2011, 2017, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
--- a/make/data/charsetmapping/IBM970.c2b	Thu Dec 06 12:18:29 2018 +0100
+++ b/make/data/charsetmapping/IBM970.c2b	Mon Dec 10 10:20:31 2018 +0000
@@ -5,14 +5,3 @@
 A2A6       FF5E
 A2C1       2299
 A3DC       20A9
-#
-# see .map file for the info regarding following 3 entries
-#
-a1aa	6950
-a1a9	84f1
-a1ad	cf7f
-
-
-
-
-
--- a/make/data/charsetmapping/IBM970.map	Thu Dec 06 12:18:29 2018 +0100
+++ b/make/data/charsetmapping/IBM970.map	Mon Dec 10 10:20:31 2018 +0000
@@ -1,15 +1,6 @@
 #
 #    source: Cp970.b2c, which is identical(?) to 03CA34B0.TPMAP100
 #
-#    Warning:
-#        following 3 c->b only entries exist in the "old" implementation,
-#        they don't appear existing in any of of the cdc 970 tables. Added
-#        them into c2b for "compatibility
-#        6950  ->  a1aa    2014
-#        84f1  ->  a1a9    2010
-#        cf7f  ->  a1ad    301c
-#
-#
 00         0000			
 01         0001			
 02         0002			
@@ -294,6 +285,7 @@
 A2BE       2665			
 A2BF       2667			
 A2C0       2663			
+A2C1       25C9			
 A2C2       25C8			
 A2C3       25A3			
 A2C4       25D0			
--- a/make/data/fontconfig/macosx.fontconfig.properties	Thu Dec 06 12:18:29 2018 +0100
+++ b/make/data/fontconfig/macosx.fontconfig.properties	Mon Dec 10 10:20:31 2018 +0000
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
--- a/make/data/fontconfig/solaris.fontconfig.properties	Thu Dec 06 12:18:29 2018 +0100
+++ b/make/data/fontconfig/solaris.fontconfig.properties	Mon Dec 10 10:20:31 2018 +0000
@@ -1,6 +1,6 @@
 #
 #
-# Copyright (c) 2005, 2016, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2005, 2018, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
--- a/make/data/fontconfig/windows.fontconfig.properties	Thu Dec 06 12:18:29 2018 +0100
+++ b/make/data/fontconfig/windows.fontconfig.properties	Mon Dec 10 10:20:31 2018 +0000
@@ -1,6 +1,6 @@
 #
 # 
-# Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
--- a/make/data/lsrdata/language-subtag-registry.txt	Thu Dec 06 12:18:29 2018 +0100
+++ b/make/data/lsrdata/language-subtag-registry.txt	Mon Dec 10 10:20:31 2018 +0000
@@ -1,4 +1,4 @@
-File-Date: 2018-04-23
+File-Date: 2018-10-31
 %%
 Type: language
 Subtag: aa
@@ -3351,7 +3351,7 @@
 %%
 Type: language
 Subtag: aue
-Description: =/Kx'au//'ein
+Description: ǂKxʼauǁʼein
 Added: 2009-07-29
 Deprecated: 2015-02-12
 Preferred-Value: ktz
@@ -9812,6 +9812,12 @@
 Added: 2009-07-29
 %%
 Type: language
+Subtag: dno
+Description: Ndrulo
+Description: Northern Lendu
+Added: 2018-10-28
+%%
+Type: language
 Subtag: dnr
 Description: Danaru
 Added: 2009-07-29
@@ -10338,6 +10344,11 @@
 Added: 2016-05-30
 %%
 Type: language
+Subtag: dwz
+Description: Dewas Rai
+Added: 2018-10-28
+%%
+Type: language
 Subtag: dya
 Description: Dyan
 Added: 2009-07-29
@@ -12022,7 +12033,7 @@
 %%
 Type: language
 Subtag: gfx
-Description: Mangetti Dune !Xung
+Description: Mangetti Dune ǃXung
 Added: 2012-08-12
 Deprecated: 2015-02-12
 Preferred-Value: vaj
@@ -12328,7 +12339,6 @@
 Type: language
 Subtag: gku
 Description: ǂUngkue
-Description: =/Ungkue
 Added: 2015-02-12
 %%
 Type: language
@@ -12523,7 +12533,6 @@
 %%
 Type: language
 Subtag: gnk
-Description: //Gana
 Description: ǁGana
 Added: 2009-07-29
 %%
@@ -13156,7 +13165,6 @@
 %%
 Type: language
 Subtag: gwj
-Description: /Gwi
 Description: ǀGwi
 Added: 2009-07-29
 %%
@@ -13489,7 +13497,6 @@
 %%
 Type: language
 Subtag: hgm
-Description: Hai//om
 Description: Haiǁom
 Added: 2009-07-29
 %%
@@ -13833,7 +13840,6 @@
 %%
 Type: language
 Subtag: hnh
-Description: //Ani
 Description: ǁAni
 Added: 2009-07-29
 %%
@@ -14113,7 +14119,6 @@
 %%
 Type: language
 Subtag: huc
-Description: =/Hua
 Description: ǂHua
 Added: 2009-07-29
 %%
@@ -18425,7 +18430,6 @@
 %%
 Type: language
 Subtag: ktz
-Description: Ju/'hoan
 Description: Juǀʼhoan
 Description: Juǀʼhoansi
 Added: 2009-07-29
@@ -24926,7 +24930,6 @@
 %%
 Type: language
 Subtag: ngh
-Description: N/u
 Description: Nǀu
 Added: 2009-07-29
 %%
@@ -25641,7 +25644,6 @@
 %%
 Type: language
 Subtag: nmn
-Description: !Xóõ
 Description: ǃXóõ
 Added: 2009-07-29
 %%
@@ -27613,7 +27615,7 @@
 %%
 Type: language
 Subtag: oun
-Description: !O!ung
+Description: ǃOǃung
 Added: 2009-07-29
 Deprecated: 2015-02-12
 Preferred-Value: vaj
@@ -36667,7 +36669,6 @@
 Type: language
 Subtag: vaj
 Description: Sekele
-Description: Northwestern !Kung
 Description: Northwestern ǃKung
 Description: Vasekele
 Added: 2009-07-29
@@ -38299,7 +38300,6 @@
 %%
 Type: language
 Subtag: xam
-Description: /Xam
 Description: ǀXam
 Added: 2009-07-29
 %%
@@ -38559,7 +38559,6 @@
 %%
 Type: language
 Subtag: xeg
-Description: //Xegwi
 Description: ǁXegwi
 Added: 2009-07-29
 %%
@@ -44036,6 +44035,11 @@
 Added: 2010-08-16
 %%
 Type: script
+Subtag: Elym
+Description: Elymaic
+Added: 2018-10-28
+%%
+Type: script
 Subtag: Ethi
 Description: Ethiopic
 Description: Geʻez
@@ -44432,6 +44436,11 @@
 Added: 2005-10-16
 %%
 Type: script
+Subtag: Nand
+Description: Nandinagari
+Added: 2018-10-28
+%%
+Type: script
 Subtag: Narb
 Description: Old North Arabian
 Description: Ancient North Arabian
@@ -46032,6 +46041,8 @@
 %%
 Type: region
 Subtag: SZ
+Description: Eswatini
+Description: eSwatini
 Description: Swaziland
 Added: 2005-10-16
 %%
--- a/make/devkit/createMacosxDevkit6.sh	Thu Dec 06 12:18:29 2018 +0100
+++ b/make/devkit/createMacosxDevkit6.sh	Mon Dec 10 10:20:31 2018 +0000
@@ -1,6 +1,6 @@
 #!/bin/bash
 #
-# Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
--- a/make/devkit/createSolarisDevkit12.4.sh	Thu Dec 06 12:18:29 2018 +0100
+++ b/make/devkit/createSolarisDevkit12.4.sh	Mon Dec 10 10:20:31 2018 +0000
@@ -1,6 +1,6 @@
 #!/bin/bash
 #
-# Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
--- a/make/devkit/createWindowsDevkit2013.sh	Thu Dec 06 12:18:29 2018 +0100
+++ b/make/devkit/createWindowsDevkit2013.sh	Mon Dec 10 10:20:31 2018 +0000
@@ -1,6 +1,6 @@
 #!/bin/bash
 #
-# Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
--- a/make/gendata/GendataFontConfig.gmk	Thu Dec 06 12:18:29 2018 +0100
+++ b/make/gendata/GendataFontConfig.gmk	Mon Dec 10 10:20:31 2018 +0000
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
--- a/make/gendata/GendataHtml32dtd.gmk	Thu Dec 06 12:18:29 2018 +0100
+++ b/make/gendata/GendataHtml32dtd.gmk	Mon Dec 10 10:20:31 2018 +0000
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
--- a/make/gendata/GendataTZDB.gmk	Thu Dec 06 12:18:29 2018 +0100
+++ b/make/gendata/GendataTZDB.gmk	Mon Dec 10 10:20:31 2018 +0000
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
--- a/make/gensrc/Gensrc-jdk.localedata.gmk	Thu Dec 06 12:18:29 2018 +0100
+++ b/make/gensrc/Gensrc-jdk.localedata.gmk	Mon Dec 10 10:20:31 2018 +0000
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2014, 2018, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
--- a/make/gensrc/GensrcCharsetCoder.gmk	Thu Dec 06 12:18:29 2018 +0100
+++ b/make/gensrc/GensrcCharsetCoder.gmk	Mon Dec 10 10:20:31 2018 +0000
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
--- a/make/gensrc/GensrcCommonLangtools.gmk	Thu Dec 06 12:18:29 2018 +0100
+++ b/make/gensrc/GensrcCommonLangtools.gmk	Mon Dec 10 10:20:31 2018 +0000
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2014, 2018, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
--- a/make/gensrc/GensrcLocaleData.gmk	Thu Dec 06 12:18:29 2018 +0100
+++ b/make/gensrc/GensrcLocaleData.gmk	Mon Dec 10 10:20:31 2018 +0000
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2011, 2017, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
--- a/make/gensrc/GensrcMisc.gmk	Thu Dec 06 12:18:29 2018 +0100
+++ b/make/gensrc/GensrcMisc.gmk	Mon Dec 10 10:20:31 2018 +0000
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2011, 2017, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -40,7 +40,13 @@
         @@VERSION_BUILD@@ => $(VERSION_BUILD) ; \
         @@VERSION_OPT@@ => $(VERSION_OPT) ; \
         @@VERSION_DATE@@ => $(VERSION_DATE) ; \
-        @@VENDOR_VERSION_STRING@@ => $(VENDOR_VERSION_STRING), \
+        @@VERSION_CLASSFILE_MAJOR@@ => $(VERSION_CLASSFILE_MAJOR) ; \
+        @@VERSION_CLASSFILE_MINOR@@ => $(VERSION_CLASSFILE_MINOR) ; \
+        @@VERSION_SPECIFICATION@@ => $(VERSION_SPECIFICATION) ; \
+        @@VENDOR_VERSION_STRING@@ => $(VENDOR_VERSION_STRING) ; \
+        @@VENDOR@@ => $(COMPANY_NAME) ; \
+        @@VENDOR_URL@@ => $(VENDOR_URL) ; \
+        @@VENDOR_URL_BUG@@ => $(VENDOR_URL_BUG), \
 ))
 
 GENSRC_JAVA_BASE += $(BUILD_VERSION_JAVA)
--- a/make/gensrc/GensrcModuleLoaderMap.gmk	Thu Dec 06 12:18:29 2018 +0100
+++ b/make/gensrc/GensrcModuleLoaderMap.gmk	Mon Dec 10 10:20:31 2018 +0000
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
--- a/make/gensrc/GensrcSwing.gmk	Thu Dec 06 12:18:29 2018 +0100
+++ b/make/gensrc/GensrcSwing.gmk	Mon Dec 10 10:20:31 2018 +0000
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
--- a/make/gensrc/GensrcVarHandles.gmk	Thu Dec 06 12:18:29 2018 +0100
+++ b/make/gensrc/GensrcVarHandles.gmk	Mon Dec 10 10:20:31 2018 +0000
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
--- a/make/hotspot/gensrc/GenerateSources.gmk	Thu Dec 06 12:18:29 2018 +0100
+++ b/make/hotspot/gensrc/GenerateSources.gmk	Mon Dec 10 10:20:31 2018 +0000
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
--- a/make/hotspot/gensrc/GensrcDtrace.gmk	Thu Dec 06 12:18:29 2018 +0100
+++ b/make/hotspot/gensrc/GensrcDtrace.gmk	Mon Dec 10 10:20:31 2018 +0000
@@ -64,8 +64,9 @@
     include lib/JvmFeatures.gmk
     include lib/JvmFlags.gmk
 
-    # We cannot compile until the JVMTI gensrc has finished
+    # We cannot compile until the JVMTI and JFR gensrc has finished
     JVMTI_H := $(JVM_VARIANT_OUTPUTDIR)/gensrc/jvmtifiles/jvmti.h
+    JFR_FILES := $(JVM_VARIANT_OUTPUTDIR)/gensrc/jfrfiles/jfrEventClasses.hpp
 
     $(eval $(call SetupNativeCompilation, BUILD_DTRACE_GEN_OFFSETS, \
         NAME := dtraceGenOffsets, \
@@ -76,7 +77,7 @@
         CFLAGS := -m64 $(JVM_CFLAGS), \
         DISABLED_WARNINGS_solstudio := hidef w_novirtualdescr unknownpragma \
             doubunder nokeyworddefine wunreachable, \
-        EXTRA_DEPS := $(JVMTI_H), \
+        EXTRA_DEPS := $(JVMTI_H) $(JFR_FILES), \
         OBJECT_DIR := $(JVM_VARIANT_OUTPUTDIR)/tools/dtrace-gen-offsets/objs, \
         OUTPUT_DIR := $(JVM_VARIANT_OUTPUTDIR)/tools/dtrace-gen-offsets, \
     ))
--- a/make/hotspot/lib/JvmFlags.gmk	Thu Dec 06 12:18:29 2018 +0100
+++ b/make/hotspot/lib/JvmFlags.gmk	Mon Dec 10 10:20:31 2018 +0000
@@ -95,3 +95,7 @@
 ifeq ($(USE_PRECOMPILED_HEADER), false)
   JVM_CFLAGS += -DDONT_USE_PRECOMPILED_HEADER
 endif
+
+ifneq ($(HOTSPOT_OVERRIDE_LIBPATH), )
+  JVM_CFLAGS += -DOVERRIDE_LIBPATH='"$(HOTSPOT_OVERRIDE_LIBPATH)"'
+endif
--- a/make/hotspot/src/classes/build/tools/projectcreator/BuildConfig.java	Thu Dec 06 12:18:29 2018 +0100
+++ b/make/hotspot/src/classes/build/tools/projectcreator/BuildConfig.java	Mon Dec 10 10:20:31 2018 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
--- a/make/hotspot/symbols/symbols-unix	Thu Dec 06 12:18:29 2018 +0100
+++ b/make/hotspot/symbols/symbols-unix	Mon Dec 10 10:20:31 2018 +0000
@@ -121,6 +121,7 @@
 JVM_GetNestHost
 JVM_GetNestMembers
 JVM_GetPrimitiveArrayElement
+JVM_GetProperties
 JVM_GetProtectionDomain
 JVM_GetSimpleBinaryName
 JVM_GetStackAccessControlContext
@@ -132,7 +133,6 @@
 JVM_HasReferencePendingList
 JVM_HoldsLock
 JVM_IHashCode
-JVM_InitProperties
 JVM_InitStackTraceElement
 JVM_InitStackTraceElementArray
 JVM_InitializeFromArchive
--- a/make/jdk/src/classes/build/tools/classlist/HelloClasslist.java	Thu Dec 06 12:18:29 2018 +0100
+++ b/make/jdk/src/classes/build/tools/classlist/HelloClasslist.java	Mon Dec 10 10:20:31 2018 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
--- a/make/jdk/src/classes/build/tools/module/GenModuleInfoSource.java	Thu Dec 06 12:18:29 2018 +0100
+++ b/make/jdk/src/classes/build/tools/module/GenModuleInfoSource.java	Mon Dec 10 10:20:31 2018 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
--- a/make/jdk/src/classes/build/tools/module/ModuleInfoExtraTest.java	Thu Dec 06 12:18:29 2018 +0100
+++ b/make/jdk/src/classes/build/tools/module/ModuleInfoExtraTest.java	Mon Dec 10 10:20:31 2018 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
--- a/make/langtools/build.xml	Thu Dec 06 12:18:29 2018 +0100
+++ b/make/langtools/build.xml	Mon Dec 10 10:20:31 2018 +0000
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!--
-  ~ Copyright (c) 2007, 2017, Oracle and/or its affiliates. All rights reserved.
+  ~ Copyright (c) 2007, 2018, Oracle and/or its affiliates. All rights reserved.
   ~ DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   ~
   ~ This code is free software; you can redistribute it and/or modify it
--- a/make/langtools/intellij/template/src/idea/LangtoolsIdeaAntLogger.java	Thu Dec 06 12:18:29 2018 +0100
+++ b/make/langtools/intellij/template/src/idea/LangtoolsIdeaAntLogger.java	Mon Dec 10 10:20:31 2018 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
--- a/make/langtools/tools/propertiesparser/PropertiesParser.java	Thu Dec 06 12:18:29 2018 +0100
+++ b/make/langtools/tools/propertiesparser/PropertiesParser.java	Mon Dec 10 10:20:31 2018 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
--- a/make/langtools/tools/propertiesparser/gen/ClassGenerator.java	Thu Dec 06 12:18:29 2018 +0100
+++ b/make/langtools/tools/propertiesparser/gen/ClassGenerator.java	Mon Dec 10 10:20:31 2018 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
--- a/make/launcher/Launcher-jdk.aot.gmk	Thu Dec 06 12:18:29 2018 +0100
+++ b/make/launcher/Launcher-jdk.aot.gmk	Mon Dec 10 10:20:31 2018 +0000
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
--- a/make/launcher/Launcher-jdk.pack.gmk	Thu Dec 06 12:18:29 2018 +0100
+++ b/make/launcher/Launcher-jdk.pack.gmk	Mon Dec 10 10:20:31 2018 +0000
@@ -39,7 +39,7 @@
 # On Mac, we have always exported all symbols, probably due to oversight
 # and/or misunderstanding. To emulate this, don't hide any symbols
 # by default.
-# On AIX/xlc we need at least xlc 13.1 for the symbol hiding
+# On AIX/xlc we need at least xlc 13.1 for the symbol hiding (see JDK-8214063)
 # Also provide an override for non-conformant libraries.
 ifeq ($(TOOLCHAIN_TYPE), gcc)
   CXXFLAGS_JDKEXE += -fvisibility=hidden
@@ -50,10 +50,6 @@
   endif
 else ifeq ($(TOOLCHAIN_TYPE), solstudio)
   CXXFLAGS_JDKEXE += -xldscope=hidden
-else ifeq ($(TOOLCHAIN_TYPE), xlc)
-  ifneq ($(CC_VERSION_NUMBER), 12.1)
-    CXXFLAGS_JDKEXE += -qvisibility=hidden
-  endif
 endif
 
 UNPACKEXE_SRC := $(TOPDIR)/src/jdk.pack/share/native/common-unpack \
--- a/make/launcher/LauncherCommon.gmk	Thu Dec 06 12:18:29 2018 +0100
+++ b/make/launcher/LauncherCommon.gmk	Mon Dec 10 10:20:31 2018 +0000
@@ -33,7 +33,7 @@
 # On Mac, we have always exported all symbols, probably due to oversight
 # and/or misunderstanding. To emulate this, don't hide any symbols
 # by default.
-# On AIX/xlc we need at least xlc 13.1 for the symbol hiding
+# On AIX/xlc we need at least xlc 13.1 for the symbol hiding (see JDK-8214063)
 # Also provide an override for non-conformant libraries.
 ifeq ($(TOOLCHAIN_TYPE), gcc)
   LAUNCHER_CFLAGS += -fvisibility=hidden
@@ -42,10 +42,6 @@
   LAUNCHER_CFLAGS += -fvisibility=hidden
 else ifeq ($(TOOLCHAIN_TYPE), solstudio)
   LAUNCHER_CFLAGS += -xldscope=hidden
-else ifeq ($(TOOLCHAIN_TYPE), xlc)
-  ifneq ($(CC_VERSION_NUMBER), 12.1)
-    CXXFLAGS_JDKEXE += -qvisibility=hidden
-  endif
 endif
 
 LAUNCHER_SRC := $(TOPDIR)/src/java.base/share/native/launcher
--- a/make/lib/Awt2dLibraries.gmk	Thu Dec 06 12:18:29 2018 +0100
+++ b/make/lib/Awt2dLibraries.gmk	Mon Dec 10 10:20:31 2018 +0000
@@ -776,17 +776,6 @@
 
   ifeq ($(USE_EXTERNAL_LIBPNG), false)
     LIBSPLASHSCREEN_HEADER_DIRS += libsplashscreen/libpng
-
-    ifeq ($(OPENJDK_TARGET_OS), macosx)
-      ifeq ($(USE_EXTERNAL_LIBZ), true)
-        # When building our own libpng and using an external libz, we need to
-        # inject our own libz.h to tweak the exported ZLIB_VERNUM macro. See
-        # $(TOPDIR)/src/java.desktop/macosx/native/libsplashscreen/libpng/zlibwrapper/zlib.h
-        # for details. This must be specified with -iquote, not -I to avoid a
-        # circular include.
-        LIBSPLASHSCREEN_CFLAGS += -iquote $(TOPDIR)/src/$(MODULE)/macosx/native/libsplashscreen/libpng/zlibwrapper
-      endif
-    endif
   else
     LIBSPLASHSCREEN_EXCLUDES += libpng
   endif
--- a/make/lib/CoreLibraries.gmk	Thu Dec 06 12:18:29 2018 +0100
+++ b/make/lib/CoreLibraries.gmk	Mon Dec 10 10:20:31 2018 +0000
@@ -102,7 +102,6 @@
     OPTIMIZATION := HIGH, \
     CFLAGS := $(CFLAGS_JDKLIB) \
         $(LIBJAVA_CFLAGS), \
-    System.c_CFLAGS := $(VERSION_CFLAGS), \
     jdk_util.c_CFLAGS := $(VERSION_CFLAGS), \
     EXTRA_HEADER_DIRS := libfdlibm, \
     WARNINGS_AS_ERRORS_xlc := false, \
--- a/make/lib/Lib-jdk.accessibility.gmk	Thu Dec 06 12:18:29 2018 +0100
+++ b/make/lib/Lib-jdk.accessibility.gmk	Mon Dec 10 10:20:31 2018 +0000
@@ -41,7 +41,7 @@
         EXTRA_SRC := common, \
         OPTIMIZATION := LOW, \
         DISABLED_WARNINGS_microsoft := 4311 4302 4312, \
-        CFLAGS := $(CFLAGS_JDKLIB) \
+        CFLAGS := $(filter-out -MD, $(CFLAGS_JDKLIB)) -MT \
             -DACCESSBRIDGE_ARCH_$2, \
         EXTRA_HEADER_DIRS := \
             include/bridge \
--- a/make/lib/LibCommon.gmk	Thu Dec 06 12:18:29 2018 +0100
+++ b/make/lib/LibCommon.gmk	Mon Dec 10 10:20:31 2018 +0000
@@ -38,7 +38,7 @@
 # On Mac, we have always exported all symbols, probably due to oversight
 # and/or misunderstanding. To emulate this, don't hide any symbols
 # by default.
-# On AIX/xlc we need at least xlc 13.1 for the symbol hiding
+# On AIX/xlc we need at least xlc 13.1 for the symbol hiding (see JDK-8214063)
 # Also provide an override for non-conformant libraries.
 ifeq ($(TOOLCHAIN_TYPE), gcc)
   CFLAGS_JDKLIB += -fvisibility=hidden
@@ -53,12 +53,6 @@
   CFLAGS_JDKLIB += -xldscope=hidden
   CXXFLAGS_JDKLIB += -xldscope=hidden
   EXPORT_ALL_SYMBOLS := -xldscope=global
-else ifeq ($(TOOLCHAIN_TYPE), xlc)
-  ifneq ($(CC_VERSION_NUMBER), 12.1)
-    CFLAGS_JDKLIB += -qvisibility=hidden
-    CXXFLAGS_JDKLIB += -qvisibility=hidden
-    EXPORT_ALL_SYMBOLS := -qvisibility=default
-  endif
 endif
 
 # Put the libraries here.
--- a/make/nashorn/build.xml	Thu Dec 06 12:18:29 2018 +0100
+++ b/make/nashorn/build.xml	Mon Dec 10 10:20:31 2018 +0000
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 
 <!--
- Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 2010, 2018, Oracle and/or its affiliates. All rights reserved.
  DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 
  This code is free software; you can redistribute it and/or modify it
@@ -278,7 +278,7 @@
       <arg value="${javadoc.option}"/>
       <fileset dir="${nashorn.module.src.dir}" includes="**/*.java"/>
       <fileset dir="${dynalink.module.src.dir}" includes="**/*.java"/>
-      <link offline="true" href="${javadoc.base.url}" packagelistLoc="${javadoc.pkg.list}"/>
+      <link offline="true" href="${javadoc.base.url}" packagelistLoc="${javadoc.element.list}"/>
     </javadoc>
   </target>
 
@@ -296,7 +296,7 @@
       <arg value="."/>
       <arg value="${javadoc.option}"/>
       <fileset dir="${nashorn.module.src.dir}" includes="jdk/nashorn/api/**/*.java"/>
-      <link offline="true" href="${javadoc.base.url}" packagelistLoc="${javadoc.pkg.list}"/>
+      <link offline="true" href="${javadoc.base.url}" packagelistLoc="${javadoc.element.list}"/>
     </javadoc>
   </target>
 
@@ -314,7 +314,7 @@
       <arg value="."/>
       <arg value="${javadoc.option}"/>
       <fileset dir="${dynalink.module.src.dir}" includes="**/*.java"/>
-      <link offline="true" href="${javadoc.base.url}" packagelistLoc="${javadoc.pkg.list}"/>
+      <link offline="true" href="${javadoc.base.url}" packagelistLoc="${javadoc.element.list}"/>
     </javadoc>
   </target>
 
@@ -835,8 +835,8 @@
 
     <!-- yui -->
     <mkdir dir="${test.external.dir}/yui"/>
-    <get src="http://yui.yahooapis.com/3.5.1/build/yui/yui.js" dest="${test.external.dir}/yui" skipexisting="true" ignoreerrors="true"/>
-    <get src="http://yui.yahooapis.com/3.5.1/build/yui/yui-min.js" dest="${test.external.dir}/yui" skipexisting="true" ignoreerrors="true"/>
+    <get src="http://yui.yahooapis.com/3.5.1/build/yui/yui.js" dest="${test.external.dir}/yui" skipexisting="true" ignoreerrors="true" tryGzipEncoding="true"/>
+    <get src="http://yui.yahooapis.com/3.5.1/build/yui/yui-min.js" dest="${test.external.dir}/yui" skipexisting="true" ignoreerrors="true" tryGzipEncoding="true"/>
 
     <!-- showdown -->
     <mkdir dir="${test.external.dir}/showdown"/>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/make/nashorn/element-list	Mon Dec 10 10:20:31 2018 +0000
@@ -0,0 +1,282 @@
+module:java.base
+java.io
+java.lang
+java.lang.annotation
+java.lang.invoke
+java.lang.module
+java.lang.ref
+java.lang.reflect
+java.math
+java.net
+java.net.spi
+java.nio
+java.nio.channels
+java.nio.channels.spi
+java.nio.charset
+java.nio.charset.spi
+java.nio.file
+java.nio.file.attribute
+java.nio.file.spi
+java.security
+java.security.acl
+java.security.cert
+java.security.interfaces
+java.security.spec
+java.text
+java.text.spi
+java.time
+java.time.chrono
+java.time.format
+java.time.temporal
+java.time.zone
+java.util
+java.util.concurrent
+java.util.concurrent.atomic
+java.util.concurrent.locks
+java.util.function
+java.util.jar
+java.util.regex
+java.util.spi
+java.util.stream
+java.util.zip
+javax.crypto
+javax.crypto.interfaces
+javax.crypto.spec
+javax.net
+javax.net.ssl
+javax.security.auth
+javax.security.auth.callback
+javax.security.auth.login
+javax.security.auth.spi
+javax.security.auth.x500
+javax.security.cert
+module:java.compiler
+javax.annotation.processing
+javax.lang.model
+javax.lang.model.element
+javax.lang.model.type
+javax.lang.model.util
+javax.tools
+module:java.datatransfer
+java.awt.datatransfer
+module:java.desktop
+java.applet
+java.awt
+java.awt.color
+java.awt.desktop
+java.awt.dnd
+java.awt.event
+java.awt.font
+java.awt.geom
+java.awt.im
+java.awt.im.spi
+java.awt.image
+java.awt.image.renderable
+java.awt.print
+java.beans
+java.beans.beancontext
+javax.accessibility
+javax.imageio
+javax.imageio.event
+javax.imageio.metadata
+javax.imageio.plugins.bmp
+javax.imageio.plugins.jpeg
+javax.imageio.plugins.tiff
+javax.imageio.spi
+javax.imageio.stream
+javax.print
+javax.print.attribute
+javax.print.attribute.standard
+javax.print.event
+javax.sound.midi
+javax.sound.midi.spi
+javax.sound.sampled
+javax.sound.sampled.spi
+javax.swing
+javax.swing.border
+javax.swing.colorchooser
+javax.swing.event
+javax.swing.filechooser
+javax.swing.plaf
+javax.swing.plaf.basic
+javax.swing.plaf.metal
+javax.swing.plaf.multi
+javax.swing.plaf.nimbus
+javax.swing.plaf.synth
+javax.swing.table
+javax.swing.text
+javax.swing.text.html
+javax.swing.text.html.parser
+javax.swing.text.rtf
+javax.swing.tree
+javax.swing.undo
+module:java.instrument
+java.lang.instrument
+module:java.logging
+java.util.logging
+module:java.management
+java.lang.management
+javax.management
+javax.management.loading
+javax.management.modelmbean
+javax.management.monitor
+javax.management.openmbean
+javax.management.relation
+javax.management.remote
+javax.management.timer
+module:java.management.rmi
+javax.management.remote.rmi
+module:java.naming
+javax.naming
+javax.naming.directory
+javax.naming.event
+javax.naming.ldap
+javax.naming.spi
+module:java.net.http
+java.net.http
+module:java.prefs
+java.util.prefs
+module:java.rmi
+java.rmi
+java.rmi.activation
+java.rmi.dgc
+java.rmi.registry
+java.rmi.server
+javax.rmi.ssl
+module:java.scripting
+javax.script
+module:java.se
+module:java.security.jgss
+javax.security.auth.kerberos
+org.ietf.jgss
+module:java.security.sasl
+javax.security.sasl
+module:java.smartcardio
+javax.smartcardio
+module:java.sql
+java.sql
+javax.sql
+module:java.sql.rowset
+javax.sql.rowset
+javax.sql.rowset.serial
+javax.sql.rowset.spi
+module:java.transaction.xa
+javax.transaction.xa
+module:java.xml
+javax.xml
+javax.xml.catalog
+javax.xml.datatype
+javax.xml.namespace
+javax.xml.parsers
+javax.xml.stream
+javax.xml.stream.events
+javax.xml.stream.util
+javax.xml.transform
+javax.xml.transform.dom
+javax.xml.transform.sax
+javax.xml.transform.stax
+javax.xml.transform.stream
+javax.xml.validation
+javax.xml.xpath
+org.w3c.dom
+org.w3c.dom.bootstrap
+org.w3c.dom.events
+org.w3c.dom.ls
+org.w3c.dom.ranges
+org.w3c.dom.traversal
+org.w3c.dom.views
+org.xml.sax
+org.xml.sax.ext
+org.xml.sax.helpers
+module:java.xml.crypto
+javax.xml.crypto
+javax.xml.crypto.dom
+javax.xml.crypto.dsig
+javax.xml.crypto.dsig.dom
+javax.xml.crypto.dsig.keyinfo
+javax.xml.crypto.dsig.spec
+module:jdk.accessibility
+com.sun.java.accessibility.util
+module:jdk.attach
+com.sun.tools.attach
+com.sun.tools.attach.spi
+module:jdk.charsets
+module:jdk.compiler
+com.sun.source.doctree
+com.sun.source.tree
+com.sun.source.util
+com.sun.tools.javac
+module:jdk.crypto.cryptoki
+module:jdk.crypto.ec
+module:jdk.dynalink
+jdk.dynalink
+jdk.dynalink.beans
+jdk.dynalink.linker
+jdk.dynalink.linker.support
+jdk.dynalink.support
+module:jdk.editpad
+module:jdk.hotspot.agent
+module:jdk.httpserver
+com.sun.net.httpserver
+com.sun.net.httpserver.spi
+module:jdk.jartool
+com.sun.jarsigner
+jdk.security.jarsigner
+module:jdk.javadoc
+com.sun.javadoc
+com.sun.tools.javadoc
+jdk.javadoc.doclet
+module:jdk.jcmd
+module:jdk.jconsole
+com.sun.tools.jconsole
+module:jdk.jdeps
+module:jdk.jdi
+com.sun.jdi
+com.sun.jdi.connect
+com.sun.jdi.connect.spi
+com.sun.jdi.event
+com.sun.jdi.request
+module:jdk.jdwp.agent
+module:jdk.jfr
+jdk.jfr
+jdk.jfr.consumer
+module:jdk.jlink
+module:jdk.jshell
+jdk.jshell
+jdk.jshell.execution
+jdk.jshell.spi
+jdk.jshell.tool
+module:jdk.jsobject
+netscape.javascript
+module:jdk.jstatd
+module:jdk.localedata
+module:jdk.management
+com.sun.management
+module:jdk.management.agent
+module:jdk.management.jfr
+jdk.management.jfr
+module:jdk.naming.dns
+module:jdk.naming.rmi
+module:jdk.net
+jdk.net
+jdk.nio
+module:jdk.pack
+module:jdk.rmic
+module:jdk.scripting.nashorn
+jdk.nashorn.api.scripting
+jdk.nashorn.api.tree
+module:jdk.sctp
+com.sun.nio.sctp
+module:jdk.security.auth
+com.sun.security.auth
+com.sun.security.auth.callback
+com.sun.security.auth.login
+com.sun.security.auth.module
+module:jdk.security.jgss
+com.sun.security.jgss
+module:jdk.xml.dom
+org.w3c.dom.css
+org.w3c.dom.html
+org.w3c.dom.stylesheets
+org.w3c.dom.xpath
+module:jdk.zipfs
--- a/make/nashorn/package-list	Thu Dec 06 12:18:29 2018 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,314 +0,0 @@
-com.sun.jarsigner
-com.sun.java.accessibility.util
-com.sun.javadoc
-com.sun.jdi
-com.sun.jdi.connect
-com.sun.jdi.connect.spi
-com.sun.jdi.event
-com.sun.jdi.request
-com.sun.management
-com.sun.net.httpserver
-com.sun.net.httpserver.spi
-com.sun.nio.sctp
-com.sun.security.auth
-com.sun.security.auth.callback
-com.sun.security.auth.login
-com.sun.security.auth.module
-com.sun.security.jgss
-com.sun.source.doctree
-com.sun.source.tree
-com.sun.source.util
-com.sun.tools.attach
-com.sun.tools.attach.spi
-com.sun.tools.doclets
-com.sun.tools.doclets.standard
-com.sun.tools.javac
-com.sun.tools.javadoc
-com.sun.tools.jconsole
-java.applet
-java.awt
-java.awt.color
-java.awt.datatransfer
-java.awt.desktop
-java.awt.dnd
-java.awt.event
-java.awt.font
-java.awt.geom
-java.awt.im
-java.awt.im.spi
-java.awt.image
-java.awt.image.renderable
-java.awt.print
-java.beans
-java.beans.beancontext
-java.io
-java.lang
-java.lang.annotation
-java.lang.instrument
-java.lang.invoke
-java.lang.management
-java.lang.module
-java.lang.ref
-java.lang.reflect
-java.math
-java.net
-java.net.spi
-java.nio
-java.nio.channels
-java.nio.channels.spi
-java.nio.charset
-java.nio.charset.spi
-java.nio.file
-java.nio.file.attribute
-java.nio.file.spi
-java.rmi
-java.rmi.activation
-java.rmi.dgc
-java.rmi.registry
-java.rmi.server
-java.security
-java.security.acl
-java.security.cert
-java.security.interfaces
-java.security.spec
-java.sql
-java.text
-java.text.spi
-java.time
-java.time.chrono
-java.time.format
-java.time.temporal
-java.time.zone
-java.util
-java.util.concurrent
-java.util.concurrent.atomic
-java.util.concurrent.locks
-java.util.function
-java.util.jar
-java.util.logging
-java.util.prefs
-java.util.regex
-java.util.spi
-java.util.stream
-java.util.zip
-javafx.animation
-javafx.application
-javafx.beans
-javafx.beans.binding
-javafx.beans.property
-javafx.beans.property.adapter
-javafx.beans.value
-javafx.collections
-javafx.collections.transformation
-javafx.concurrent
-javafx.css
-javafx.css.converter
-javafx.embed.swing
-javafx.event
-javafx.fxml
-javafx.geometry
-javafx.print
-javafx.scene
-javafx.scene.canvas
-javafx.scene.chart
-javafx.scene.control
-javafx.scene.control.cell
-javafx.scene.control.skin
-javafx.scene.effect
-javafx.scene.image
-javafx.scene.input
-javafx.scene.layout
-javafx.scene.media
-javafx.scene.paint
-javafx.scene.shape
-javafx.scene.text
-javafx.scene.transform
-javafx.scene.web
-javafx.stage
-javafx.util
-javafx.util.converter
-javax.accessibility
-javax.activation
-javax.activity
-javax.annotation
-javax.annotation.processing
-javax.crypto
-javax.crypto.interfaces
-javax.crypto.spec
-javax.imageio
-javax.imageio.event
-javax.imageio.metadata
-javax.imageio.plugins.bmp
-javax.imageio.plugins.jpeg
-javax.imageio.plugins.tiff
-javax.imageio.spi
-javax.imageio.stream
-javax.jnlp
-javax.jws
-javax.jws.soap
-javax.lang.model
-javax.lang.model.element
-javax.lang.model.type
-javax.lang.model.util
-javax.management
-javax.management.loading
-javax.management.modelmbean
-javax.management.monitor
-javax.management.openmbean
-javax.management.relation
-javax.management.remote
-javax.management.remote.rmi
-javax.management.timer
-javax.naming
-javax.naming.directory
-javax.naming.event
-javax.naming.ldap
-javax.naming.spi
-javax.net
-javax.net.ssl
-javax.print
-javax.print.attribute
-javax.print.attribute.standard
-javax.print.event
-javax.rmi
-javax.rmi.CORBA
-javax.rmi.ssl
-javax.script
-javax.security.auth
-javax.security.auth.callback
-javax.security.auth.kerberos
-javax.security.auth.login
-javax.security.auth.spi
-javax.security.auth.x500
-javax.security.cert
-javax.security.sasl
-javax.smartcardio
-javax.sound.midi
-javax.sound.midi.spi
-javax.sound.sampled
-javax.sound.sampled.spi
-javax.sql
-javax.sql.rowset
-javax.sql.rowset.serial
-javax.sql.rowset.spi
-javax.swing
-javax.swing.border
-javax.swing.colorchooser
-javax.swing.event
-javax.swing.filechooser
-javax.swing.plaf
-javax.swing.plaf.basic
-javax.swing.plaf.metal
-javax.swing.plaf.multi
-javax.swing.plaf.nimbus
-javax.swing.plaf.synth
-javax.swing.table
-javax.swing.text
-javax.swing.text.html
-javax.swing.text.html.parser
-javax.swing.text.rtf
-javax.swing.tree
-javax.swing.undo
-javax.tools
-javax.transaction
-javax.transaction.xa
-javax.xml
-javax.xml.bind
-javax.xml.bind.annotation
-javax.xml.bind.annotation.adapters
-javax.xml.bind.attachment
-javax.xml.bind.helpers
-javax.xml.bind.util
-javax.xml.catalog
-javax.xml.crypto
-javax.xml.crypto.dom
-javax.xml.crypto.dsig
-javax.xml.crypto.dsig.dom
-javax.xml.crypto.dsig.keyinfo
-javax.xml.crypto.dsig.spec
-javax.xml.datatype
-javax.xml.namespace
-javax.xml.parsers
-javax.xml.soap
-javax.xml.stream
-javax.xml.stream.events
-javax.xml.stream.util
-javax.xml.transform
-javax.xml.transform.dom
-javax.xml.transform.sax
-javax.xml.transform.stax
-javax.xml.transform.stream
-javax.xml.validation
-javax.xml.ws
-javax.xml.ws.handler
-javax.xml.ws.handler.soap
-javax.xml.ws.http
-javax.xml.ws.soap
-javax.xml.ws.spi
-javax.xml.ws.spi.http
-javax.xml.ws.wsaddressing
-javax.xml.xpath
-jdk.dynalink
-jdk.dynalink.beans
-jdk.dynalink.linker
-jdk.dynalink.linker.support
-jdk.dynalink.support
-jdk.incubator.http
-jdk.javadoc.doclet
-jdk.jfr
-jdk.jfr.consumer
-jdk.jshell
-jdk.jshell.execution
-jdk.jshell.spi
-jdk.jshell.tool
-jdk.management.jfr
-jdk.management.resource
-jdk.nashorn.api.scripting
-jdk.nashorn.api.tree
-jdk.net
-jdk.packager.services
-jdk.security.jarsigner
-netscape.javascript
-org.ietf.jgss
-org.omg.CORBA
-org.omg.CORBA_2_3
-org.omg.CORBA_2_3.portable
-org.omg.CORBA.DynAnyPackage
-org.omg.CORBA.ORBPackage
-org.omg.CORBA.portable
-org.omg.CORBA.TypeCodePackage
-org.omg.CosNaming
-org.omg.CosNaming.NamingContextExtPackage
-org.omg.CosNaming.NamingContextPackage
-org.omg.Dynamic
-org.omg.DynamicAny
-org.omg.DynamicAny.DynAnyFactoryPackage
-org.omg.DynamicAny.DynAnyPackage
-org.omg.IOP
-org.omg.IOP.CodecFactoryPackage
-org.omg.IOP.CodecPackage
-org.omg.Messaging
-org.omg.PortableInterceptor
-org.omg.PortableInterceptor.ORBInitInfoPackage
-org.omg.PortableServer
-org.omg.PortableServer.CurrentPackage
-org.omg.PortableServer.POAManagerPackage
-org.omg.PortableServer.POAPackage
-org.omg.PortableServer.portable
-org.omg.PortableServer.ServantLocatorPackage
-org.omg.SendingContext
-org.omg.stub.java.rmi
-org.w3c.dom
-org.w3c.dom.bootstrap
-org.w3c.dom.css
-org.w3c.dom.events
-org.w3c.dom.html
-org.w3c.dom.ls
-org.w3c.dom.ranges
-org.w3c.dom.stylesheets
-org.w3c.dom.traversal
-org.w3c.dom.views
-org.w3c.dom.xpath
-org.xml.sax
-org.xml.sax.ext
-org.xml.sax.helpers
--- a/make/nashorn/project.properties	Thu Dec 06 12:18:29 2018 +0100
+++ b/make/nashorn/project.properties	Mon Dec 10 10:20:31 2018 +0000
@@ -36,8 +36,8 @@
 jdk.build.dir=build
 nashorn.make.dir=make/nashorn
 
-javadoc.base.url=https://docs.oracle.com/javase/9/docs/api/
-javadoc.pkg.list=make/nashorn
+javadoc.base.url=https://docs.oracle.com/en/java/javase/11/docs/api/
+javadoc.element.list=make/nashorn
 
 javadoc.option=\
     -tag "implSpec:a:Implementation Requirements:" \
--- a/make/rmic/Rmic-java.management.rmi.gmk	Thu Dec 06 12:18:29 2018 +0100
+++ b/make/rmic/Rmic-java.management.rmi.gmk	Mon Dec 10 10:20:31 2018 +0000
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
--- a/make/scripts/compare_exceptions.sh.incl	Thu Dec 06 12:18:29 2018 +0100
+++ b/make/scripts/compare_exceptions.sh.incl	Mon Dec 10 10:20:31 2018 +0000
@@ -1,6 +1,6 @@
 #!/bin/bash
 #
-# Copyright (c) 2012, 2017, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
--- a/make/scripts/update_copyright_year.sh	Thu Dec 06 12:18:29 2018 +0100
+++ b/make/scripts/update_copyright_year.sh	Mon Dec 10 10:20:31 2018 +0000
@@ -98,7 +98,7 @@
   count=0
   files=${tmp}/files.$1
   rm -f ${files}
-  hg log --rev $1 -v --template '{files}\n' | expand \
+  hg log -l1 --rev $1 -v --template '{files}\n' | expand \
     | ${awk} -F' ' '{for(i=1;i<=NF;i++)print $i}' \
     > ${files}
   if [ -f "${files}" -a -s "${files}" ] ; then
@@ -120,8 +120,8 @@
     printf "  ERROR: No files changed in the changeset? Must be a mistake.\n"
     set -x
     ls -al ${files}
-    hg log --rev $1 -v --template '{files}\n'
-    hg log --rev $1 -v --template '{files}\n' | expand \
+    hg log -l1 --rev $1 -v --template '{files}\n'
+    hg log -l1 --rev $1 -v --template '{files}\n' | expand \
       | ${awk} -F' ' '{for(i=1;i<=NF;i++)print $i}'
     set +x
     exit 1
@@ -150,7 +150,7 @@
     desc=${tmp}/desc.${changeset}
     rm -f ${desc}
     echo "------------------------------------------------"
-    hg log --rev ${changeset} --template '{desc}\n' > ${desc}
+    hg log -l1 --rev ${changeset} --template '{desc}\n' > ${desc}
     printf "%d: %s\n%s\n" ${index} "${changeset}" "`cat ${desc}|head -1`"
     if [ "${year}" = "2010" ] ; then
       if cat ${desc} | fgrep -i "Added tag" > /dev/null ; then
--- a/make/test/JtregNativeJdk.gmk	Thu Dec 06 12:18:29 2018 +0100
+++ b/make/test/JtregNativeJdk.gmk	Mon Dec 10 10:20:31 2018 +0000
@@ -48,28 +48,38 @@
 
 BUILD_JDK_JTREG_IMAGE_DIR := $(TEST_IMAGE_DIR)/jdk/jtreg
 
+BUILD_JDK_JTREG_EXECUTABLES_CFLAGS_exeJliLaunchTest := \
+    -I$(TOPDIR)/src/java.base/share/native/libjli \
+    -I$(TOPDIR)/src/java.base/$(OPENJDK_TARGET_OS_TYPE)/native/libjli \
+    -I$(TOPDIR)/src/java.base/$(OPENJDK_TARGET_OS)/native/libjli
+
 # Platform specific setup
 ifeq ($(OPENJDK_TARGET_OS), windows)
   BUILD_JDK_JTREG_EXCLUDE += libDirectIO.c libInheritedChannel.c
 
   WIN_LIB_JAVA := $(SUPPORT_OUTPUTDIR)/native/java.base/libjava/java.lib
   BUILD_JDK_JTREG_LIBRARIES_LIBS_libstringPlatformChars := $(WIN_LIB_JAVA)
+  WIN_LIB_JLI := $(SUPPORT_OUTPUTDIR)/native/java.base/libjli/jli.lib
+  BUILD_JDK_JTREG_EXECUTABLES_LIBS_exeJliLaunchTest := $(WIN_LIB_JLI)
 else
   BUILD_JDK_JTREG_LIBRARIES_LIBS_libstringPlatformChars := -ljava
   BUILD_JDK_JTREG_LIBRARIES_LIBS_libDirectIO := -ljava
   ifeq ($(OPENJDK_TARGET_OS), linux)
     BUILD_JDK_JTREG_LIBRARIES_LIBS_libInheritedChannel := -ljava
   else ifeq ($(OPENJDK_TARGET_OS), solaris)
-    BUILD_JDK_JTREG_LIBRARIES_LIBS_libInheritedChannel := -ljava
+    BUILD_JDK_JTREG_LIBRARIES_LIBS_libInheritedChannel := -ljava -lsocket -lnsl
   endif
+  BUILD_JDK_JTREG_EXECUTABLES_LIBS_exeJliLaunchTest := -ljli
 endif
 
 ifeq ($(OPENJDK_TARGET_OS), macosx)
   BUILD_JDK_JTREG_LIBRARIES_CFLAGS_libTestMainKeyWindow := -ObjC
   BUILD_JDK_JTREG_LIBRARIES_LIBS_libTestMainKeyWindow := -framework JavaVM \
       -framework Cocoa -framework JavaNativeFoundation
+  BUILD_JDK_JTREG_EXECUTABLES_LIBS_exeJniInvocationTest := -ljli
 else
   BUILD_JDK_JTREG_EXCLUDE += libTestMainKeyWindow.c
+  BUILD_JDK_JTREG_EXCLUDE += exeJniInvocationTest.c
 endif
 
 $(eval $(call SetupTestFilesCompilation, BUILD_JDK_JTREG_LIBRARIES, \
--- a/src/demo/share/jfc/FileChooserDemo/FileChooserDemo.java	Thu Dec 06 12:18:29 2018 +0100
+++ b/src/demo/share/jfc/FileChooserDemo/FileChooserDemo.java	Mon Dec 10 10:20:31 2018 +0000
@@ -800,7 +800,7 @@
                      * NOTE: By default, the look and feel will be set to the
                      * Cross Platform Look and Feel (which is currently Metal).
                      * The following code tries to set the Look and Feel to Nimbus.
-                     * http://docs.oracle.com/javase/tutorial/uiswing/lookandfeel/nimbus.html
+                     * https://docs.oracle.com/javase/tutorial/uiswing/lookandfeel/nimbus.html
                      */
                     try {
                         for (LookAndFeelInfo info : UIManager.
--- a/src/hotspot/cpu/ppc/macroAssembler_ppc.cpp	Thu Dec 06 12:18:29 2018 +0100
+++ b/src/hotspot/cpu/ppc/macroAssembler_ppc.cpp	Mon Dec 10 10:20:31 2018 +0000
@@ -4019,105 +4019,6 @@
  * @param len   register containing number of bytes
  * @param table register pointing to CRC table
  *
- * Uses R9..R12 as work register. Must be saved/restored by caller!
- */
-void MacroAssembler::kernel_crc32_2word(Register crc, Register buf, Register len, Register table,
-                                        Register t0,  Register t1,  Register t2,  Register t3,
-                                        Register tc0, Register tc1, Register tc2, Register tc3,
-                                        bool invertCRC) {
-  assert_different_registers(crc, buf, len, table);
-
-  Label L_mainLoop, L_tail;
-  Register  tmp  = t0;
-  Register  data = t0;
-  Register  tmp2 = t1;
-  const int mainLoop_stepping  = 8;
-  const int tailLoop_stepping  = 1;
-  const int log_stepping       = exact_log2(mainLoop_stepping);
-  const int mainLoop_alignment = 32; // InputForNewCode > 4 ? InputForNewCode : 32;
-  const int complexThreshold   = 2*mainLoop_stepping;
-
-  // Don't test for len <= 0 here. This pathological case should not occur anyway.
-  // Optimizing for it by adding a test and a branch seems to be a waste of CPU cycles
-  // for all well-behaved cases. The situation itself is detected and handled correctly
-  // within update_byteLoop_crc32.
-  assert(tailLoop_stepping == 1, "check tailLoop_stepping!");
-
-  BLOCK_COMMENT("kernel_crc32_2word {");
-
-  if (invertCRC) {
-    nand(crc, crc, crc);                      // 1s complement of crc
-  }
-
-  // Check for short (<mainLoop_stepping) buffer.
-  cmpdi(CCR0, len, complexThreshold);
-  blt(CCR0, L_tail);
-
-  // Pre-mainLoop alignment did show a slight (1%) positive effect on performance.
-  // We leave the code in for reference. Maybe we need alignment when we exploit vector instructions.
-  {
-    // Align buf addr to mainLoop_stepping boundary.
-    neg(tmp2, buf);                           // Calculate # preLoop iterations for alignment.
-    rldicl(tmp2, tmp2, 0, 64-log_stepping);   // Rotate tmp2 0 bits, insert into tmp2, anding with mask with 1s from 62..63.
-
-    if (complexThreshold > mainLoop_stepping) {
-      sub(len, len, tmp2);                       // Remaining bytes for main loop (>=mainLoop_stepping is guaranteed).
-    } else {
-      sub(tmp, len, tmp2);                       // Remaining bytes for main loop.
-      cmpdi(CCR0, tmp, mainLoop_stepping);
-      blt(CCR0, L_tail);                         // For less than one mainloop_stepping left, do only tail processing
-      mr(len, tmp);                              // remaining bytes for main loop (>=mainLoop_stepping is guaranteed).
-    }
-    update_byteLoop_crc32(crc, buf, tmp2, table, data, false);
-  }
-
-  srdi(tmp2, len, log_stepping);                 // #iterations for mainLoop
-  andi(len, len, mainLoop_stepping-1);           // remaining bytes for tailLoop
-  mtctr(tmp2);
-
-#ifdef VM_LITTLE_ENDIAN
-  Register crc_rv = crc;
-#else
-  Register crc_rv = tmp;                         // Load_reverse needs separate registers to work on.
-                                                 // Occupies tmp, but frees up crc.
-  load_reverse_32(crc_rv, crc);                  // Revert byte order because we are dealing with big-endian data.
-  tmp = crc;
-#endif
-
-  int reconstructTableOffset = crc32_table_columns(table, tc0, tc1, tc2, tc3);
-
-  align(mainLoop_alignment);                     // Octoword-aligned loop address. Shows 2% improvement.
-  BIND(L_mainLoop);
-    update_1word_crc32(crc_rv, buf, table, 0, 0, crc_rv, t1, t2, t3, tc0, tc1, tc2, tc3);
-    update_1word_crc32(crc_rv, buf, table, 4, mainLoop_stepping, crc_rv, t1, t2, t3, tc0, tc1, tc2, tc3);
-    bdnz(L_mainLoop);
-
-#ifndef VM_LITTLE_ENDIAN
-  load_reverse_32(crc, crc_rv);                  // Revert byte order because we are dealing with big-endian data.
-  tmp = crc_rv;                                  // Tmp uses it's original register again.
-#endif
-
-  // Restore original table address for tailLoop.
-  if (reconstructTableOffset != 0) {
-    addi(table, table, -reconstructTableOffset);
-  }
-
-  // Process last few (<complexThreshold) bytes of buffer.
-  BIND(L_tail);
-  update_byteLoop_crc32(crc, buf, len, table, data, false);
-
-  if (invertCRC) {
-    nand(crc, crc, crc);                      // 1s complement of crc
-  }
-  BLOCK_COMMENT("} kernel_crc32_2word");
-}
-
-/**
- * @param crc   register containing existing CRC (32-bit)
- * @param buf   register pointing to input byte buffer (byte*)
- * @param len   register containing number of bytes
- * @param table register pointing to CRC table
- *
  * uses R9..R12 as work register. Must be saved/restored by caller!
  */
 void MacroAssembler::kernel_crc32_1word(Register crc, Register buf, Register len, Register table,
--- a/src/hotspot/cpu/ppc/macroAssembler_ppc.hpp	Thu Dec 06 12:18:29 2018 +0100
+++ b/src/hotspot/cpu/ppc/macroAssembler_ppc.hpp	Mon Dec 10 10:20:31 2018 +0000
@@ -835,10 +835,6 @@
   void update_1word_crc32(Register crc, Register buf, Register table, int bufDisp, int bufInc,
                           Register t0,  Register t1,  Register t2,  Register t3,
                           Register tc0, Register tc1, Register tc2, Register tc3);
-  void kernel_crc32_2word(Register crc, Register buf, Register len, Register table,
-                          Register t0,  Register t1,  Register t2,  Register t3,
-                          Register tc0, Register tc1, Register tc2, Register tc3,
-                          bool invertCRC);
   void kernel_crc32_1word(Register crc, Register buf, Register len, Register table,
                           Register t0,  Register t1,  Register t2,  Register t3,
                           Register tc0, Register tc1, Register tc2, Register tc3,
--- a/src/hotspot/cpu/ppc/stubRoutines_ppc.hpp	Thu Dec 06 12:18:29 2018 +0100
+++ b/src/hotspot/cpu/ppc/stubRoutines_ppc.hpp	Mon Dec 10 10:20:31 2018 +0000
@@ -62,7 +62,6 @@
  public:
 
   // CRC32 Intrinsics.
-  static void generate_load_table_addr(MacroAssembler* masm, Register table, address table_addr, uint64_t table_contents);
   static void generate_load_crc_table_addr(MacroAssembler* masm, Register table);
   static void generate_load_crc_constants_addr(MacroAssembler* masm, Register table);
   static void generate_load_crc_barret_constants_addr(MacroAssembler* masm, Register table);
--- a/src/hotspot/cpu/s390/macroAssembler_s390.cpp	Thu Dec 06 12:18:29 2018 +0100
+++ b/src/hotspot/cpu/s390/macroAssembler_s390.cpp	Mon Dec 10 10:20:31 2018 +0000
@@ -6333,75 +6333,6 @@
  *
  * uses Z_R10..Z_R13 as work register. Must be saved/restored by caller!
  */
-void MacroAssembler::kernel_crc32_2word(Register crc, Register buf, Register len, Register table,
-                                        Register t0,  Register t1,  Register t2,  Register t3,
-                                        bool invertCRC) {
-  assert_different_registers(crc, buf, len, table);
-
-  Label L_mainLoop, L_tail;
-  Register  data = t0;
-  Register  ctr  = Z_R0;
-  const int mainLoop_stepping = 8;
-  const int tailLoop_stepping = 1;
-  const int log_stepping      = exact_log2(mainLoop_stepping);
-
-  // Don't test for len <= 0 here. This pathological case should not occur anyway.
-  // Optimizing for it by adding a test and a branch seems to be a waste of CPU cycles.
-  // The situation itself is detected and handled correctly by the conditional branches
-  // following aghi(len, -stepping) and aghi(len, +stepping).
-
-  if (invertCRC) {
-    not_(crc, noreg, false);           // 1s complement of crc
-  }
-
-#if 0
-  {
-    // Pre-mainLoop alignment did not show any positive effect on performance.
-    // We leave the code in for reference. Maybe the vector instructions in z13 depend on alignment.
-
-    z_cghi(len, mainLoop_stepping);    // Alignment is useless for short data streams.
-    z_brnh(L_tail);
-
-    // Align buf to word (4-byte) boundary.
-    z_lcr(ctr, buf);
-    rotate_then_insert(ctr, ctr, 62, 63, 0, true); // TODO: should set cc
-    z_sgfr(len, ctr);                  // Remaining len after alignment.
-
-    update_byteLoop_crc32(crc, buf, ctr, table, data);
-  }
-#endif
-
-  // Check for short (<mainLoop_stepping bytes) buffer.
-  z_srag(ctr, len, log_stepping);
-  z_brnh(L_tail);
-
-  z_lrvr(crc, crc);          // Revert byte order because we are dealing with big-endian data.
-  rotate_then_insert(len, len, 64-log_stepping, 63, 0, true); // #bytes for tailLoop
-
-  BIND(L_mainLoop);
-    update_1word_crc32(crc, buf, table, 0, 0, crc, t1, t2, t3);
-    update_1word_crc32(crc, buf, table, 4, mainLoop_stepping, crc, t1, t2, t3);
-    z_brct(ctr, L_mainLoop); // Iterate.
-
-  z_lrvr(crc, crc);          // Revert byte order back to original.
-
-  // Process last few (<8) bytes of buffer.
-  BIND(L_tail);
-  update_byteLoop_crc32(crc, buf, len, table, data);
-
-  if (invertCRC) {
-    not_(crc, noreg, false);           // 1s complement of crc
-  }
-}
-
-/**
- * @param crc   register containing existing CRC (32-bit)
- * @param buf   register pointing to input byte buffer (byte*)
- * @param len   register containing number of bytes
- * @param table register pointing to CRC table
- *
- * uses Z_R10..Z_R13 as work register. Must be saved/restored by caller!
- */
 void MacroAssembler::kernel_crc32_1word(Register crc, Register buf, Register len, Register table,
                                         Register t0,  Register t1,  Register t2,  Register t3,
                                         bool invertCRC) {
--- a/src/hotspot/cpu/s390/macroAssembler_s390.hpp	Thu Dec 06 12:18:29 2018 +0100
+++ b/src/hotspot/cpu/s390/macroAssembler_s390.hpp	Mon Dec 10 10:20:31 2018 +0000
@@ -1056,9 +1056,6 @@
   void kernel_crc32_1word(Register crc, Register buf, Register len, Register table,
                           Register t0,  Register t1,  Register t2,  Register t3,
                           bool invertCRC);
-  void kernel_crc32_2word(Register crc, Register buf, Register len, Register table,
-                          Register t0,  Register t1,  Register t2,  Register t3,
-                          bool invertCRC);
 
   // Emitters for BigInteger.multiplyToLen intrinsic
   // note: length of result array (zlen) is passed on the stack
--- a/src/hotspot/cpu/zero/stack_zero.cpp	Thu Dec 06 12:18:29 2018 +0100
+++ b/src/hotspot/cpu/zero/stack_zero.cpp	Mon Dec 10 10:20:31 2018 +0000
@@ -26,7 +26,7 @@
 #include "precompiled.hpp"
 #include "interpreter/bytecodeInterpreter.hpp"
 #include "interpreter/interpreterRuntime.hpp"
-#include "runtime/thread.hpp"
+#include "runtime/thread.inline.hpp"
 #include "stack_zero.hpp"
 #include "stack_zero.inline.hpp"
 #include "runtime/frame.inline.hpp"
--- a/src/hotspot/os/aix/os_aix.cpp	Thu Dec 06 12:18:29 2018 +0100
+++ b/src/hotspot/os/aix/os_aix.cpp	Mon Dec 10 10:20:31 2018 +0000
@@ -541,7 +541,11 @@
 
 void os::init_system_properties_values() {
 
-#define DEFAULT_LIBPATH "/lib:/usr/lib"
+#ifndef OVERRIDE_LIBPATH
+  #define DEFAULT_LIBPATH "/lib:/usr/lib"
+#else
+  #define DEFAULT_LIBPATH OVERRIDE_LIBPATH
+#endif
 #define EXTENSIONS_DIR  "/lib/ext"
 
   // Buffer that fits several sprintfs.
--- a/src/hotspot/os/bsd/os_bsd.cpp	Thu Dec 06 12:18:29 2018 +0100
+++ b/src/hotspot/os/bsd/os_bsd.cpp	Mon Dec 10 10:20:31 2018 +0000
@@ -316,7 +316,11 @@
   //        ...
   //        7: The default directories, normally /lib and /usr/lib.
 #ifndef DEFAULT_LIBPATH
-  #define DEFAULT_LIBPATH "/lib:/usr/lib"
+  #ifndef OVERRIDE_LIBPATH
+    #define DEFAULT_LIBPATH "/lib:/usr/lib"
+  #else
+    #define DEFAULT_LIBPATH OVERRIDE_LIBPATH
+  #endif
 #endif
 
 // Base path of extensions installed on the system.
--- a/src/hotspot/os/linux/os_linux.cpp	Thu Dec 06 12:18:29 2018 +0100
+++ b/src/hotspot/os/linux/os_linux.cpp	Mon Dec 10 10:20:31 2018 +0000
@@ -323,10 +323,14 @@
   //        1: ...
   //        ...
   //        7: The default directories, normally /lib and /usr/lib.
-#if defined(AMD64) || (defined(_LP64) && defined(SPARC)) || defined(PPC64) || defined(S390)
-  #define DEFAULT_LIBPATH "/usr/lib64:/lib64:/lib:/usr/lib"
+#ifndef OVERRIDE_LIBPATH
+  #if defined(AMD64) || (defined(_LP64) && defined(SPARC)) || defined(PPC64) || defined(S390)
+    #define DEFAULT_LIBPATH "/usr/lib64:/lib64:/lib:/usr/lib"
+  #else
+    #define DEFAULT_LIBPATH "/lib:/usr/lib"
+  #endif
 #else
-  #define DEFAULT_LIBPATH "/lib:/usr/lib"
+  #define DEFAULT_LIBPATH OVERRIDE_LIBPATH
 #endif
 
 // Base path of extensions installed on the system.
--- a/src/hotspot/share/adlc/adlc.hpp	Thu Dec 06 12:18:29 2018 +0100
+++ b/src/hotspot/share/adlc/adlc.hpp	Mon Dec 10 10:20:31 2018 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -50,6 +50,10 @@
 #define strdup _strdup
 #endif
 
+#if _MSC_VER < 1900
+#define snprintf _snprintf
+#endif
+
 #ifndef _INTPTR_T_DEFINED
 #ifdef _WIN64
 typedef __int64 intptr_t;
--- a/src/hotspot/share/adlc/dfa.cpp	Thu Dec 06 12:18:29 2018 +0100
+++ b/src/hotspot/share/adlc/dfa.cpp	Mon Dec 10 10:20:31 2018 +0000
@@ -719,21 +719,21 @@
 
   // Preserve use of external name which has a zero value
   if( c1->_external_name != NULL ) {
-    sprintf(string_buffer, "%s", c1->as_string());
-    if( !c2->is_zero() ) {
-      strncat(string_buffer, "+", STRING_BUFFER_LENGTH);
-      strncat(string_buffer, c2->as_string(), STRING_BUFFER_LENGTH);
+    if( c2->is_zero() ) {
+      snprintf(string_buffer, STRING_BUFFER_LENGTH, "%s", c1->as_string());
+    } else {
+      snprintf(string_buffer, STRING_BUFFER_LENGTH, "%s+%s", c1->as_string(), c2->as_string());
     }
+    string_buffer[STRING_BUFFER_LENGTH - 1] = '\0';
     result = strdup(string_buffer);
   }
   else if( c2->_external_name != NULL ) {
-    if( !c1->is_zero() ) {
-      sprintf(string_buffer, "%s", c1->as_string());
-      strncat(string_buffer, " + ", STRING_BUFFER_LENGTH);
+    if( c1->is_zero() ) {
+      snprintf(string_buffer, STRING_BUFFER_LENGTH, "%s", c2->_external_name);
     } else {
-      string_buffer[0] = '\0';
+      snprintf(string_buffer, STRING_BUFFER_LENGTH, "%s + %s", c1->as_string(), c2->as_string());
     }
-    strncat(string_buffer, c2->_external_name, STRING_BUFFER_LENGTH);
+    string_buffer[STRING_BUFFER_LENGTH - 1] = '\0';
     result = strdup(string_buffer);
   }
   return result;
@@ -741,18 +741,19 @@
 
 const char *Expr::compute_expr(const Expr *c1, const Expr *c2) {
   if( !c1->is_zero() ) {
-    sprintf( string_buffer, "%s", c1->_expr);
-    if( !c2->is_zero() ) {
-      strncat(string_buffer, "+", STRING_BUFFER_LENGTH);
-      strncat(string_buffer, c2->_expr, STRING_BUFFER_LENGTH);
+    if( c2->is_zero() ) {
+      snprintf(string_buffer, STRING_BUFFER_LENGTH, "%s", c1->_expr);
+    } else {
+      snprintf(string_buffer, STRING_BUFFER_LENGTH, "%s+%s", c1->_expr, c2->_expr);
     }
   }
   else if( !c2->is_zero() ) {
-    sprintf( string_buffer, "%s", c2->_expr);
+    snprintf(string_buffer, STRING_BUFFER_LENGTH, "%s", c2->_expr);
   }
   else {
     sprintf( string_buffer, "0");
   }
+  string_buffer[STRING_BUFFER_LENGTH - 1] = '\0';
   char *cost = strdup(string_buffer);
 
   return cost;
--- a/src/hotspot/share/ci/ciInstanceKlass.cpp	Thu Dec 06 12:18:29 2018 +0100
+++ b/src/hotspot/share/ci/ciInstanceKlass.cpp	Mon Dec 10 10:20:31 2018 +0000
@@ -57,7 +57,7 @@
   AccessFlags access_flags = ik->access_flags();
   _flags = ciFlags(access_flags);
   _has_finalizer = access_flags.has_finalizer();
-  _has_subklass = ik->subklass() != NULL;
+  _has_subklass = flags().is_final() ? subklass_false : subklass_unknown;
   _init_state = ik->init_state();
   _nonstatic_field_size = ik->nonstatic_field_size();
   _has_nonstatic_fields = ik->has_nonstatic_fields();
@@ -147,8 +147,8 @@
 bool ciInstanceKlass::compute_shared_has_subklass() {
   GUARDED_VM_ENTRY(
     InstanceKlass* ik = get_instanceKlass();
-    _has_subklass = ik->subklass() != NULL;
-    return _has_subklass;
+    _has_subklass = ik->subklass() != NULL ? subklass_true : subklass_false;
+    return _has_subklass == subklass_true;
   )
 }
 
@@ -583,7 +583,7 @@
   if (is_shared()) {
     return is_final();  // approximately correct
   } else {
-    return !_has_subklass && (nof_implementors() == 0);
+    return !has_subklass() && (nof_implementors() == 0);
   }
 }
 
--- a/src/hotspot/share/ci/ciInstanceKlass.hpp	Thu Dec 06 12:18:29 2018 +0100
+++ b/src/hotspot/share/ci/ciInstanceKlass.hpp	Mon Dec 10 10:20:31 2018 +0000
@@ -44,13 +44,15 @@
   friend class ciField;
 
 private:
+  enum SubklassValue { subklass_unknown, subklass_false, subklass_true };
+
   jobject                _loader;
   jobject                _protection_domain;
 
   InstanceKlass::ClassState _init_state;           // state of class
   bool                   _is_shared;
   bool                   _has_finalizer;
-  bool                   _has_subklass;
+  SubklassValue          _has_subklass;
   bool                   _has_nonstatic_fields;
   bool                   _has_nonstatic_concrete_methods;
   bool                   _is_unsafe_anonymous;
@@ -139,14 +141,15 @@
     return _has_finalizer; }
   bool                   has_subklass()   {
     assert(is_loaded(), "must be loaded");
-    if (_is_shared && !_has_subklass) {
+    if (_has_subklass == subklass_unknown ||
+        (_is_shared && _has_subklass == subklass_false)) {
       if (flags().is_final()) {
         return false;
       } else {
         return compute_shared_has_subklass();
       }
     }
-    return _has_subklass;
+    return _has_subklass == subklass_true;
   }
   jint                   size_helper()  {
     return (Klass::layout_helper_size_in_bytes(layout_helper())
--- a/src/hotspot/share/ci/ciMethodData.cpp	Thu Dec 06 12:18:29 2018 +0100
+++ b/src/hotspot/share/ci/ciMethodData.cpp	Mon Dec 10 10:20:31 2018 +0000
@@ -198,17 +198,28 @@
   }
 }
 
-
 void ciTypeStackSlotEntries::translate_type_data_from(const TypeStackSlotEntries* entries) {
   for (int i = 0; i < number_of_entries(); i++) {
     intptr_t k = entries->type(i);
-    TypeStackSlotEntries::set_type(i, translate_klass(k));
+    Klass* klass = (Klass*)klass_part(k);
+    if (klass != NULL && !klass->is_loader_alive()) {
+      // With concurrent class unloading, the MDO could have stale metadata; override it
+      TypeStackSlotEntries::set_type(i, TypeStackSlotEntries::with_status((Klass*)NULL, k));
+    } else {
+      TypeStackSlotEntries::set_type(i, translate_klass(k));
+    }
   }
 }
 
 void ciReturnTypeEntry::translate_type_data_from(const ReturnTypeEntry* ret) {
   intptr_t k = ret->type();
-  set_type(translate_klass(k));
+  Klass* klass = (Klass*)klass_part(k);
+  if (klass != NULL && !klass->is_loader_alive()) {
+    // With concurrent class unloading, the MDO could have stale metadata; override it
+    set_type(ReturnTypeEntry::with_status((Klass*)NULL, k));
+  } else {
+    set_type(translate_klass(k));
+  }
 }
 
 void ciSpeculativeTrapData::translate_from(const ProfileData* data) {
--- a/src/hotspot/share/classfile/classLoaderDataGraph.cpp	Thu Dec 06 12:18:29 2018 +0100
+++ b/src/hotspot/share/classfile/classLoaderDataGraph.cpp	Mon Dec 10 10:20:31 2018 +0000
@@ -29,6 +29,7 @@
 #include "classfile/metadataOnStackMark.hpp"
 #include "classfile/moduleEntry.hpp"
 #include "classfile/packageEntry.hpp"
+#include "code/dependencyContext.hpp"
 #include "logging/log.hpp"
 #include "logging/logStream.hpp"
 #include "memory/allocation.inline.hpp"
@@ -582,7 +583,6 @@
 }
 
 void ClassLoaderDataGraph::purge() {
-  assert_locked_or_safepoint(ClassLoaderDataGraph_lock);
   ClassLoaderData* list = _unloading;
   _unloading = NULL;
   ClassLoaderData* next = list;
@@ -597,6 +597,7 @@
     Metaspace::purge();
     set_metaspace_oom(false);
   }
+  DependencyContext::purge_dependency_contexts();
 }
 
 int ClassLoaderDataGraph::resize_if_needed() {
--- a/src/hotspot/share/classfile/compactHashtable.hpp	Thu Dec 06 12:18:29 2018 +0100
+++ b/src/hotspot/share/classfile/compactHashtable.hpp	Mon Dec 10 10:20:31 2018 +0000
@@ -375,6 +375,9 @@
   inline int remain() {
     return (int)(_end - _p);
   }
+  int last_line_no() {
+    return _line_no - 1;
+  }
 
   void corrupted(const char *p, const char *msg);
 
--- a/src/hotspot/share/classfile/dictionary.cpp	Thu Dec 06 12:18:29 2018 +0100
+++ b/src/hotspot/share/classfile/dictionary.cpp	Mon Dec 10 10:20:31 2018 +0000
@@ -235,7 +235,7 @@
 
 
 void Dictionary::do_unloading() {
-  assert(SafepointSynchronize::is_at_safepoint(), "must be at safepoint");
+  assert_locked_or_safepoint(SystemDictionary_lock);
 
   // The NULL class loader doesn't initiate loading classes from other class loaders
   if (loader_data() == ClassLoaderData::the_null_class_loader_data()) {
--- a/src/hotspot/share/classfile/javaClasses.cpp	Thu Dec 06 12:18:29 2018 +0100
+++ b/src/hotspot/share/classfile/javaClasses.cpp	Mon Dec 10 10:20:31 2018 +0000
@@ -3741,6 +3741,7 @@
 // Support for java_lang_invoke_MethodHandleNatives_CallSiteContext
 
 int java_lang_invoke_MethodHandleNatives_CallSiteContext::_vmdependencies_offset;
+int java_lang_invoke_MethodHandleNatives_CallSiteContext::_last_cleanup_offset;
 
 void java_lang_invoke_MethodHandleNatives_CallSiteContext::compute_offsets() {
   InstanceKlass* k = SystemDictionary::Context_klass();
@@ -3755,8 +3756,9 @@
 
 DependencyContext java_lang_invoke_MethodHandleNatives_CallSiteContext::vmdependencies(oop call_site) {
   assert(java_lang_invoke_MethodHandleNatives_CallSiteContext::is_instance(call_site), "");
-  intptr_t* vmdeps_addr = (intptr_t*)call_site->field_addr(_vmdependencies_offset);
-  DependencyContext dep_ctx(vmdeps_addr);
+  nmethodBucket* volatile* vmdeps_addr = (nmethodBucket* volatile*)call_site->field_addr(_vmdependencies_offset);
+  volatile uint64_t* last_cleanup_addr = (volatile uint64_t*)call_site->field_addr(_last_cleanup_offset);
+  DependencyContext dep_ctx(vmdeps_addr, last_cleanup_addr);
   return dep_ctx;
 }
 
--- a/src/hotspot/share/classfile/javaClasses.hpp	Thu Dec 06 12:18:29 2018 +0100
+++ b/src/hotspot/share/classfile/javaClasses.hpp	Mon Dec 10 10:20:31 2018 +0000
@@ -1201,7 +1201,8 @@
 // Interface to java.lang.invoke.MethodHandleNatives$CallSiteContext objects
 
 #define CALLSITECONTEXT_INJECTED_FIELDS(macro) \
-  macro(java_lang_invoke_MethodHandleNatives_CallSiteContext, vmdependencies, intptr_signature, false)
+  macro(java_lang_invoke_MethodHandleNatives_CallSiteContext, vmdependencies, intptr_signature, false) \
+  macro(java_lang_invoke_MethodHandleNatives_CallSiteContext, last_cleanup, long_signature, false)
 
 class DependencyContext;
 
@@ -1210,6 +1211,7 @@
 
 private:
   static int _vmdependencies_offset;
+  static int _last_cleanup_offset;
 
   static void compute_offsets();
 
--- a/src/hotspot/share/classfile/verifier.cpp	Thu Dec 06 12:18:29 2018 +0100
+++ b/src/hotspot/share/classfile/verifier.cpp	Mon Dec 10 10:20:31 2018 +0000
@@ -2017,8 +2017,7 @@
   if (kls != NULL) {
     current_class()->class_loader_data()->record_dependency(kls);
     if (log_is_enabled(Debug, class, resolve)) {
-      InstanceKlass* cur_class = InstanceKlass::cast(current_class());
-      Verifier::trace_class_resolution(kls, cur_class);
+      Verifier::trace_class_resolution(kls, current_class());
     }
   }
   return kls;
--- a/src/hotspot/share/classfile/vmSymbols.hpp	Thu Dec 06 12:18:29 2018 +0100
+++ b/src/hotspot/share/classfile/vmSymbols.hpp	Mon Dec 10 10:20:31 2018 +0000
@@ -426,6 +426,7 @@
   template(signers_name,                              "signers_name")                             \
   template(loader_data_name,                          "loader_data")                              \
   template(vmdependencies_name,                       "vmdependencies")                           \
+  template(last_cleanup_name,                         "last_cleanup")                             \
   template(loader_name,                               "loader")                                   \
   template(getModule_name,                            "getModule")                                \
   template(input_stream_void_signature,               "(Ljava/io/InputStream;)V")                 \
--- a/src/hotspot/share/code/codeBlob.hpp	Thu Dec 06 12:18:29 2018 +0100
+++ b/src/hotspot/share/code/codeBlob.hpp	Mon Dec 10 10:20:31 2018 +0000
@@ -116,7 +116,12 @@
 
   CodeBlob(const char* name, CompilerType type, const CodeBlobLayout& layout, int frame_complete_offset, int frame_size, ImmutableOopMapSet* oop_maps, bool caller_must_gc_arguments);
   CodeBlob(const char* name, CompilerType type, const CodeBlobLayout& layout, CodeBuffer* cb, int frame_complete_offset, int frame_size, OopMapSet* oop_maps, bool caller_must_gc_arguments);
+
 public:
+  // Only used by unit test.
+  CodeBlob()
+    : _type(compiler_none) {}
+
   // Returns the space needed for CodeBlob
   static unsigned int allocation_size(CodeBuffer* cb, int header_size);
   static unsigned int align_code_offset(int offset);
--- a/src/hotspot/share/code/codeCache.cpp	Thu Dec 06 12:18:29 2018 +0100
+++ b/src/hotspot/share/code/codeCache.cpp	Mon Dec 10 10:20:31 2018 +0000
@@ -29,6 +29,7 @@
 #include "code/codeHeapState.hpp"
 #include "code/compiledIC.hpp"
 #include "code/dependencies.hpp"
+#include "code/dependencyContext.hpp"
 #include "code/icBuffer.hpp"
 #include "code/nmethod.hpp"
 #include "code/pcDesc.hpp"
@@ -940,6 +941,19 @@
   }
 }
 
+CodeCache::UnloadingScope::UnloadingScope(BoolObjectClosure* is_alive)
+  : _is_unloading_behaviour(is_alive)
+{
+  IsUnloadingBehaviour::set_current(&_is_unloading_behaviour);
+  increment_unloading_cycle();
+  DependencyContext::cleaning_start();
+}
+
+CodeCache::UnloadingScope::~UnloadingScope() {
+  IsUnloadingBehaviour::set_current(NULL);
+  DependencyContext::cleaning_end();
+}
+
 void CodeCache::verify_oops() {
   MutexLockerEx mu(CodeCache_lock, Mutex::_no_safepoint_check_flag);
   VerifyOopClosure voc;
@@ -1397,8 +1411,7 @@
     }
 
     if (heap->full_count() == 0) {
-      LogTarget(Debug, codecache) lt;
-      if (lt.is_enabled()) {
+      if (PrintCodeHeapAnalytics) {
         CompileBroker::print_heapinfo(tty, "all", "4096"); // details, may be a lot!
       }
     }
--- a/src/hotspot/share/code/codeCache.hpp	Thu Dec 06 12:18:29 2018 +0100
+++ b/src/hotspot/share/code/codeCache.hpp	Mon Dec 10 10:20:31 2018 +0000
@@ -180,17 +180,10 @@
     ClosureIsUnloadingBehaviour _is_unloading_behaviour;
 
   public:
-    UnloadingScope(BoolObjectClosure* is_alive)
-      : _is_unloading_behaviour(is_alive)
-    {
-      IsUnloadingBehaviour::set_current(&_is_unloading_behaviour);
-      increment_unloading_cycle();
-    }
+    UnloadingScope(BoolObjectClosure* is_alive);
+    ~UnloadingScope();
+  };
 
-    ~UnloadingScope() {
-      IsUnloadingBehaviour::set_current(NULL);
-    }
-  };
   static void do_unloading(BoolObjectClosure* is_alive, bool unloading_occurred);
   static uint8_t unloading_cycle() { return _unloading_cycle; }
   static void increment_unloading_cycle();
--- a/src/hotspot/share/code/codeHeapState.cpp	Thu Dec 06 12:18:29 2018 +0100
+++ b/src/hotspot/share/code/codeHeapState.cpp	Mon Dec 10 10:20:31 2018 +0000
@@ -38,7 +38,7 @@
 // Aggregation condenses the information of a piece of the CodeHeap
 // (4096 bytes by default) into an analysis granule. These granules
 // contain enough detail to gain initial insight while keeping the
-// internal sttructure sizes in check.
+// internal structure sizes in check.
 //
 // The CodeHeap is a living thing. Therefore, the aggregate is collected
 // under the CodeCache_lock. The subsequent print steps are only locked
@@ -63,15 +63,12 @@
 //
 // If you are (only) interested in how the CodeHeap looks like after running
 // a sample workload, you can use the command line option
-//   -Xlog:codecache=Trace
+//   -XX:+PrintCodeHeapAnalytics
+// It will cause a full analysis to be written to tty. In addition, a full
+// analysis will be written the first time a "CodeCache full" condition is
+// detected.
 //
-// To see the CodeHeap state in case of a "CodeCache full" condition, start the
-// VM with the
-//   -Xlog:codecache=Debug
-// command line option. It will produce output only for the first time the
-// condition is recognized.
-//
-// Both command line option variants produce output identical to the jcmd function
+// The command line option produces output identical to the jcmd function
 //   jcmd <pid> Compiler.CodeHeap_Analytics all 4096
 // ---------------------------------------------------------------------------------
 
--- a/src/hotspot/share/code/compiledMethod.hpp	Thu Dec 06 12:18:29 2018 +0100
+++ b/src/hotspot/share/code/compiledMethod.hpp	Mon Dec 10 10:20:31 2018 +0000
@@ -177,6 +177,9 @@
   CompiledMethod(Method* method, const char* name, CompilerType type, int size, int header_size, CodeBuffer* cb, int frame_complete_offset, int frame_size, OopMapSet* oop_maps, bool caller_must_gc_arguments);
 
 public:
+  // Only used by unit test.
+  CompiledMethod() {}
+
   virtual bool is_compiled() const                { return true; }
 
   template<typename T>
--- a/src/hotspot/share/code/dependencyContext.cpp	Thu Dec 06 12:18:29 2018 +0100
+++ b/src/hotspot/share/code/dependencyContext.cpp	Mon Dec 10 10:20:31 2018 +0000
@@ -35,6 +35,9 @@
 PerfCounter* DependencyContext::_perf_total_buckets_deallocated_count = NULL;
 PerfCounter* DependencyContext::_perf_total_buckets_stale_count       = NULL;
 PerfCounter* DependencyContext::_perf_total_buckets_stale_acc_count   = NULL;
+nmethodBucket* volatile DependencyContext::_purge_list                = NULL;
+volatile uint64_t DependencyContext::_cleaning_epoch                  = 0;
+uint64_t  DependencyContext::_cleaning_epoch_monotonic                = 0;
 
 void dependencyContext_init() {
   DependencyContext::init();
@@ -61,7 +64,7 @@
 //
 int DependencyContext::mark_dependent_nmethods(DepChange& changes) {
   int found = 0;
-  for (nmethodBucket* b = dependencies(); b != NULL; b = b->next()) {
+  for (nmethodBucket* b = dependencies_not_unloading(); b != NULL; b = b->next_not_unloading()) {
     nmethod* nm = b->get_nmethod();
     // since dependencies aren't removed until an nmethod becomes a zombie,
     // the dependency list may contain nmethods which aren't alive.
@@ -86,21 +89,49 @@
 // so a count is kept for each bucket to guarantee that creation and
 // deletion of dependencies is consistent.
 //
-void DependencyContext::add_dependent_nmethod(nmethod* nm, bool expunge) {
+void DependencyContext::add_dependent_nmethod(nmethod* nm) {
   assert_lock_strong(CodeCache_lock);
-  for (nmethodBucket* b = dependencies(); b != NULL; b = b->next()) {
+  for (nmethodBucket* b = dependencies_not_unloading(); b != NULL; b = b->next_not_unloading()) {
     if (nm == b->get_nmethod()) {
       b->increment();
       return;
     }
   }
-  set_dependencies(new nmethodBucket(nm, dependencies()));
+  nmethodBucket* new_head = new nmethodBucket(nm, NULL);
+  for (;;) {
+    nmethodBucket* head = Atomic::load(_dependency_context_addr);
+    new_head->set_next(head);
+    if (Atomic::cmpxchg(new_head, _dependency_context_addr, head) == head) {
+      break;
+    }
+  }
   if (UsePerfData) {
     _perf_total_buckets_allocated_count->inc();
   }
+}
+
+void DependencyContext::release(nmethodBucket* b) {
+  bool expunge = Atomic::load(&_cleaning_epoch) == 0;
   if (expunge) {
-    // Remove stale entries from the list.
-    expunge_stale_entries();
+    assert_locked_or_safepoint(CodeCache_lock);
+    delete b;
+    if (UsePerfData) {
+      _perf_total_buckets_deallocated_count->inc();
+    }
+  } else {
+    // Mark the context as having stale entries, since it is not safe to
+    // expunge the list right now.
+    for (;;) {
+      nmethodBucket* purge_list_head = Atomic::load(&_purge_list);
+      b->set_purge_list_next(purge_list_head);
+      if (Atomic::cmpxchg(b, &_purge_list, purge_list_head) == purge_list_head) {
+        break;
+      }
+    }
+    if (UsePerfData) {
+      _perf_total_buckets_stale_count->inc();
+      _perf_total_buckets_stale_acc_count->inc();
+    }
   }
 }
 
@@ -111,92 +142,71 @@
 // a corresponding bucket otherwise there's a bug in the recording of dependencies.
 // Can be called concurrently by parallel GC threads.
 //
-void DependencyContext::remove_dependent_nmethod(nmethod* nm, bool expunge) {
+void DependencyContext::remove_dependent_nmethod(nmethod* nm) {
   assert_locked_or_safepoint(CodeCache_lock);
-  nmethodBucket* first = dependencies();
+  nmethodBucket* first = dependencies_not_unloading();
   nmethodBucket* last = NULL;
-  for (nmethodBucket* b = first; b != NULL; b = b->next()) {
+  for (nmethodBucket* b = first; b != NULL; b = b->next_not_unloading()) {
     if (nm == b->get_nmethod()) {
       int val = b->decrement();
       guarantee(val >= 0, "Underflow: %d", val);
       if (val == 0) {
-        if (expunge) {
-          if (last == NULL) {
-            set_dependencies(b->next());
-          } else {
-            last->set_next(b->next());
-          }
-          delete b;
-          if (UsePerfData) {
-            _perf_total_buckets_deallocated_count->inc();
-          }
+        if (last == NULL) {
+          // If there was not a head that was not unloading, we can set a new
+          // head without a CAS, because we know there is no contending cleanup.
+          set_dependencies(b->next_not_unloading());
         } else {
-          // Mark the context as having stale entries, since it is not safe to
-          // expunge the list right now.
-          set_has_stale_entries(true);
-          if (UsePerfData) {
-            _perf_total_buckets_stale_count->inc();
-            _perf_total_buckets_stale_acc_count->inc();
-          }
+          // Only supports a single inserting thread (protected by CodeCache_lock)
+          // for now. Therefore, the next pointer only competes with another cleanup
+          // operation. That interaction does not need a CAS.
+          last->set_next(b->next_not_unloading());
         }
-      }
-      if (expunge) {
-        // Remove stale entries from the list.
-        expunge_stale_entries();
+        release(b);
       }
       return;
     }
     last = b;
   }
-#ifdef ASSERT
-  tty->print_raw_cr("### can't find dependent nmethod");
-  nm->print();
-#endif // ASSERT
-  ShouldNotReachHere();
 }
 
 //
 // Reclaim all unused buckets.
 //
-void DependencyContext::expunge_stale_entries() {
-  assert_locked_or_safepoint(CodeCache_lock);
-  if (!has_stale_entries()) {
-    assert(!find_stale_entries(), "inconsistent info");
+void DependencyContext::purge_dependency_contexts() {
+  int removed = 0;
+  for (nmethodBucket* b = _purge_list; b != NULL;) {
+    nmethodBucket* next = b->purge_list_next();
+    removed++;
+    delete b;
+    b = next;
+  }
+  if (UsePerfData && removed > 0) {
+    _perf_total_buckets_deallocated_count->inc(removed);
+  }
+  _purge_list = NULL;
+}
+
+//
+// Cleanup a dependency context by unlinking and placing all dependents corresponding
+// to is_unloading nmethods on a purge list, which will be deleted later when it is safe.
+void DependencyContext::clean_unloading_dependents() {
+  if (!claim_cleanup()) {
+    // Somebody else is cleaning up this dependency context.
     return;
   }
-  nmethodBucket* first = dependencies();
-  nmethodBucket* last = NULL;
-  int removed = 0;
-  for (nmethodBucket* b = first; b != NULL;) {
-    assert(b->count() >= 0, "bucket count: %d", b->count());
-    nmethodBucket* next = b->next();
-    if (b->count() == 0) {
-      if (last == NULL) {
-        first = next;
-      } else {
-        last->set_next(next);
-      }
-      removed++;
-      delete b;
-      // last stays the same.
-    } else {
-      last = b;
-    }
+  // Walk the nmethodBuckets and move dead entries on the purge list, which will
+  // be deleted during ClassLoaderDataGraph::purge().
+  nmethodBucket* b = dependencies_not_unloading();
+  while (b != NULL) {
+    nmethodBucket* next = b->next_not_unloading();
     b = next;
   }
-  set_dependencies(first);
-  set_has_stale_entries(false);
-  if (UsePerfData && removed > 0) {
-    _perf_total_buckets_deallocated_count->inc(removed);
-    _perf_total_buckets_stale_count->dec(removed);
-  }
 }
 
 //
 // Invalidate all dependencies in the context
 int DependencyContext::remove_all_dependents() {
-  assert_locked_or_safepoint(CodeCache_lock);
-  nmethodBucket* b = dependencies();
+  nmethodBucket* b = dependencies_not_unloading();
   set_dependencies(NULL);
   int marked = 0;
   int removed = 0;
@@ -206,12 +216,11 @@
       nm->mark_for_deoptimization();
       marked++;
     }
-    nmethodBucket* next = b->next();
+    nmethodBucket* next = b->next_not_unloading();
     removed++;
-    delete b;
+    release(b);
     b = next;
   }
-  set_has_stale_entries(false);
   if (UsePerfData && removed > 0) {
     _perf_total_buckets_deallocated_count->inc(removed);
   }
@@ -221,7 +230,7 @@
 #ifndef PRODUCT
 void DependencyContext::print_dependent_nmethods(bool verbose) {
   int idx = 0;
-  for (nmethodBucket* b = dependencies(); b != NULL; b = b->next()) {
+  for (nmethodBucket* b = dependencies_not_unloading(); b != NULL; b = b->next_not_unloading()) {
     nmethod* nm = b->get_nmethod();
     tty->print("[%d] count=%d { ", idx++, b->count());
     if (!verbose) {
@@ -236,7 +245,7 @@
 }
 
 bool DependencyContext::is_dependent_nmethod(nmethod* nm) {
-  for (nmethodBucket* b = dependencies(); b != NULL; b = b->next()) {
+  for (nmethodBucket* b = dependencies_not_unloading(); b != NULL; b = b->next_not_unloading()) {
     if (nm == b->get_nmethod()) {
 #ifdef ASSERT
       int count = b->count();
@@ -248,15 +257,114 @@
   return false;
 }
 
-bool DependencyContext::find_stale_entries() {
-  for (nmethodBucket* b = dependencies(); b != NULL; b = b->next()) {
-    if (b->count() == 0)  return true;
-  }
-  return false;
-}
-
 #endif //PRODUCT
 
 int nmethodBucket::decrement() {
   return Atomic::sub(1, &_count);
 }
+
+// We use a monotonically increasing epoch counter to track the last epoch a given
+// dependency context was cleaned. GC threads claim cleanup tasks by performing
+// a CAS on this value.
+bool DependencyContext::claim_cleanup() {
+  uint64_t cleaning_epoch = Atomic::load(&_cleaning_epoch);
+  uint64_t last_cleanup = Atomic::load(_last_cleanup_addr);
+  if (last_cleanup >= cleaning_epoch) {
+    return false;
+  }
+  return Atomic::cmpxchg(cleaning_epoch, _last_cleanup_addr, last_cleanup) == last_cleanup;
+}
+
+// Retrieve the first nmethodBucket that has a dependent that does not correspond to
+// an is_unloading nmethod. Any nmethodBucket entries observed from the original head
+// that is_unloading() will be unlinked and placed on the purge list.
+nmethodBucket* DependencyContext::dependencies_not_unloading() {
+  for (;;) {
+    // Need acquire becase the read value could come from a concurrent insert.
+    nmethodBucket* head = OrderAccess::load_acquire(_dependency_context_addr);
+    if (head == NULL || !head->get_nmethod()->is_unloading()) {
+      return head;
+    }
+    nmethodBucket* head_next = head->next();
+    OrderAccess::loadload();
+    if (Atomic::load(_dependency_context_addr) != head) {
+      // Unstable load of head w.r.t. head->next
+      continue;
+    }
+    if (Atomic::cmpxchg(head_next, _dependency_context_addr, head) == head) {
+      // Release is_unloading entries if unlinking was claimed
+      DependencyContext::release(head);
+    }
+  }
+}
+
+// Relaxed accessors
+void DependencyContext::set_dependencies(nmethodBucket* b) {
+  Atomic::store(b, _dependency_context_addr);
+}
+
+nmethodBucket* DependencyContext::dependencies() {
+  return Atomic::load(_dependency_context_addr);
+}
+
+// After the gc_prologue, the dependency contexts may be claimed by the GC
+// and releasing of nmethodBucket entries will be deferred and placed on
+// a purge list to be deleted later.
+void DependencyContext::cleaning_start() {
+  assert(SafepointSynchronize::is_at_safepoint(), "must be");
+  uint64_t epoch = ++_cleaning_epoch_monotonic;
+  Atomic::store(epoch, &_cleaning_epoch);
+}
+
+// The epilogue marks the end of dependency context cleanup by the GC,
+// and also makes subsequent releases of nmethodBuckets cause immediate
+// deletion. It is okay to delay calling of cleaning_end() to a concurrent
+// phase, subsequent to the safepoint operation in which cleaning_start()
+// was called. That allows dependency contexts to be cleaned concurrently.
+void DependencyContext::cleaning_end() {
+  uint64_t epoch = 0;
+  Atomic::store(epoch, &_cleaning_epoch);
+}
+
+// This function skips over nmethodBuckets in the list corresponding to
+// nmethods that are is_unloading. This allows exposing a view of the
+// dependents as-if they were already cleaned, despite being cleaned
+// concurrently. Any entry observed that is_unloading() will be unlinked
+// and placed on the purge list.
+nmethodBucket* nmethodBucket::next_not_unloading() {
+  for (;;) {
+    // Do not need acquire because the loaded entry can never be
+    // concurrently inserted.
+    nmethodBucket* next = Atomic::load(&_next);
+    if (next == NULL || !next->get_nmethod()->is_unloading()) {
+      return next;
+    }
+    nmethodBucket* next_next = Atomic::load(&next->_next);
+    OrderAccess::loadload();
+    if (Atomic::load(&_next) != next) {
+      // Unstable load of next w.r.t. next->next
+      continue;
+    }
+    if (Atomic::cmpxchg(next_next, &_next, next) == next) {
+      // Release is_unloading entries if unlinking was claimed
+      DependencyContext::release(next);
+    }
+  }
+}
+
+// Relaxed accessors
+nmethodBucket* nmethodBucket::next() {
+  return Atomic::load(&_next);
+}
+
+void nmethodBucket::set_next(nmethodBucket* b) {
+  Atomic::store(b, &_next);
+}
+
+nmethodBucket* nmethodBucket::purge_list_next() {
+  return Atomic::load(&_purge_list_next);
+}
+
+void nmethodBucket::set_purge_list_next(nmethodBucket* b) {
+  Atomic::store(b, &_purge_list_next);
+}
--- a/src/hotspot/share/code/dependencyContext.hpp	Thu Dec 06 12:18:29 2018 +0100
+++ b/src/hotspot/share/code/dependencyContext.hpp	Mon Dec 10 10:20:31 2018 +0000
@@ -48,70 +48,51 @@
   friend class VMStructs;
  private:
   nmethod*       _nmethod;
-  int            _count;
-  nmethodBucket* _next;
+  volatile int   _count;
+  nmethodBucket* volatile _next;
+  nmethodBucket* volatile _purge_list_next;
 
  public:
   nmethodBucket(nmethod* nmethod, nmethodBucket* next) :
-   _nmethod(nmethod), _count(1), _next(next) {}
+    _nmethod(nmethod), _count(1), _next(next), _purge_list_next(NULL) {}
 
-  int count()                             { return _count; }
-  int increment()                         { _count += 1; return _count; }
+  int count()                                { return _count; }
+  int increment()                            { _count += 1; return _count; }
   int decrement();
-  nmethodBucket* next()                   { return _next; }
-  void set_next(nmethodBucket* b)         { _next = b; }
-  nmethod* get_nmethod()                  { return _nmethod; }
+  nmethodBucket* next();
+  nmethodBucket* next_not_unloading();
+  void set_next(nmethodBucket* b);
+  nmethodBucket* purge_list_next();
+  void set_purge_list_next(nmethodBucket* b);
+  nmethod* get_nmethod()                     { return _nmethod; }
 };
 
 //
 // Utility class to manipulate nmethod dependency context.
-// The context consists of nmethodBucket* (a head of a linked list)
-// and a boolean flag (does the list contains stale entries). The structure is
-// encoded as an intptr_t: lower bit is used for the flag. It is possible since
-// nmethodBucket* is aligned - the structure is malloc'ed in C heap.
 // Dependency context can be attached either to an InstanceKlass (_dep_context field)
 // or CallSiteContext oop for call_site_target dependencies (see javaClasses.hpp).
-// DependencyContext class operates on some location which holds a intptr_t value.
+// DependencyContext class operates on some location which holds a nmethodBucket* value
+// and uint64_t integer recording the safepoint counter at the last cleanup.
 //
 class DependencyContext : public StackObj {
   friend class VMStructs;
   friend class TestDependencyContext;
  private:
-  enum TagBits { _has_stale_entries_bit = 1, _has_stale_entries_mask = 1 };
+  nmethodBucket* volatile* _dependency_context_addr;
+  volatile uint64_t*       _last_cleanup_addr;
 
-  intptr_t* _dependency_context_addr;
+  bool claim_cleanup();
+  void set_dependencies(nmethodBucket* b);
+  nmethodBucket* dependencies();
+  nmethodBucket* dependencies_not_unloading();
 
-  void set_dependencies(nmethodBucket* b) {
-    assert((intptr_t(b) & _has_stale_entries_mask) == 0, "should be aligned");
-    if (has_stale_entries()) {
-      *_dependency_context_addr = intptr_t(b) | _has_stale_entries_mask;
-    } else {
-      *_dependency_context_addr = intptr_t(b);
-    }
-  }
-
-  void set_has_stale_entries(bool x) {
-    if (x) {
-      *_dependency_context_addr |= _has_stale_entries_mask;
-    } else {
-      *_dependency_context_addr &= ~_has_stale_entries_mask;
-    }
-  }
-
-  nmethodBucket* dependencies() {
-    intptr_t value = *_dependency_context_addr;
-    return (nmethodBucket*) (value & ~_has_stale_entries_mask);
-  }
-
-  bool has_stale_entries() const {
-    intptr_t value = *_dependency_context_addr;
-    return (value & _has_stale_entries_mask) != 0;
-  }
-
-  static PerfCounter* _perf_total_buckets_allocated_count;
-  static PerfCounter* _perf_total_buckets_deallocated_count;
-  static PerfCounter* _perf_total_buckets_stale_count;
-  static PerfCounter* _perf_total_buckets_stale_acc_count;
+  static PerfCounter*            _perf_total_buckets_allocated_count;
+  static PerfCounter*            _perf_total_buckets_deallocated_count;
+  static PerfCounter*            _perf_total_buckets_stale_count;
+  static PerfCounter*            _perf_total_buckets_stale_acc_count;
+  static nmethodBucket* volatile _purge_list;
+  static uint64_t                _cleaning_epoch_monotonic;
+  static volatile uint64_t       _cleaning_epoch;
 
  public:
 #ifdef ASSERT
@@ -120,31 +101,35 @@
   // (e.g. CallSiteContext Java object).
   uint64_t _safepoint_counter;
 
-  DependencyContext(intptr_t* addr) : _dependency_context_addr(addr),
-    _safepoint_counter(SafepointSynchronize::safepoint_counter()) {}
+  DependencyContext(nmethodBucket* volatile* bucket_addr, volatile uint64_t* last_cleanup_addr)
+    : _dependency_context_addr(bucket_addr),
+      _last_cleanup_addr(last_cleanup_addr),
+      _safepoint_counter(SafepointSynchronize::safepoint_counter()) {}
 
   ~DependencyContext() {
     assert(_safepoint_counter == SafepointSynchronize::safepoint_counter(), "safepoint happened");
   }
 #else
-  DependencyContext(intptr_t* addr) : _dependency_context_addr(addr) {}
+  DependencyContext(nmethodBucket* volatile* bucket_addr, volatile uint64_t* last_cleanup_addr)
+    : _dependency_context_addr(bucket_addr),
+      _last_cleanup_addr(last_cleanup_addr) {}
 #endif // ASSERT
 
-  static const intptr_t EMPTY = 0; // dependencies = NULL, has_stale_entries = false
-
   static void init();
 
   int  mark_dependent_nmethods(DepChange& changes);
-  void add_dependent_nmethod(nmethod* nm, bool expunge_stale_entries = false);
-  void remove_dependent_nmethod(nmethod* nm, bool expunge_stale_entries = false);
+  void add_dependent_nmethod(nmethod* nm);
+  void remove_dependent_nmethod(nmethod* nm);
   int  remove_all_dependents();
-
-  void expunge_stale_entries();
+  void clean_unloading_dependents();
+  static void purge_dependency_contexts();
+  static void release(nmethodBucket* b);
+  static void cleaning_start();
+  static void cleaning_end();
 
 #ifndef PRODUCT
   void print_dependent_nmethods(bool verbose);
   bool is_dependent_nmethod(nmethod* nm);
-  bool find_stale_entries();
 #endif //PRODUCT
 };
 #endif // SHARE_VM_CODE_DEPENDENCYCONTEXT_HPP
--- a/src/hotspot/share/code/nmethod.cpp	Thu Dec 06 12:18:29 2018 +0100
+++ b/src/hotspot/share/code/nmethod.cpp	Mon Dec 10 10:20:31 2018 +0000
@@ -1053,7 +1053,8 @@
   // recorded in instanceKlasses get flushed.
   // Since this work is being done during a GC, defer deleting dependencies from the
   // InstanceKlass.
-  assert(Universe::heap()->is_gc_active(), "should only be called during gc");
+  assert(Universe::heap()->is_gc_active() || Thread::current()->is_ConcurrentGC_thread(),
+         "should only be called during gc");
   flush_dependencies(/*delete_immediately*/false);
 
   // Break cycle between nmethod & method
@@ -1095,7 +1096,8 @@
   }
 
   // Make the class unloaded - i.e., change state and notify sweeper
-  assert(SafepointSynchronize::is_at_safepoint(), "must be at safepoint");
+  assert(SafepointSynchronize::is_at_safepoint() || Thread::current()->is_ConcurrentGC_thread(),
+         "must be at safepoint");
 
   // Unregister must be done before the state change
   Universe::heap()->unregister_nmethod(this);
@@ -1372,8 +1374,8 @@
 // notifies instanceKlasses that are reachable
 
 void nmethod::flush_dependencies(bool delete_immediately) {
-  assert_locked_or_safepoint(CodeCache_lock);
-  assert(Universe::heap()->is_gc_active() != delete_immediately,
+  DEBUG_ONLY(bool called_by_gc = Universe::heap()->is_gc_active() || Thread::current()->is_ConcurrentGC_thread();)
+  assert(called_by_gc != delete_immediately,
   "delete_immediately is false if and only if we are called during GC");
   if (!has_flushed_dependencies()) {
     set_has_flushed_dependencies();
@@ -1381,7 +1383,12 @@
       if (deps.type() == Dependencies::call_site_target_value) {
         // CallSite dependencies are managed on per-CallSite instance basis.
         oop call_site = deps.argument_oop(0);
-        MethodHandles::remove_dependent_nmethod(call_site, this);
+        if (delete_immediately) {
+          assert_locked_or_safepoint(CodeCache_lock);
+          MethodHandles::remove_dependent_nmethod(call_site, this);
+        } else {
+          MethodHandles::clean_dependency_context(call_site);
+        }
       } else {
         Klass* klass = deps.context_type();
         if (klass == NULL) {
@@ -1389,11 +1396,12 @@
         }
         // During GC delete_immediately is false, and liveness
         // of dependee determines class that needs to be updated.
-        if (delete_immediately || klass->is_loader_alive()) {
-          // The GC defers deletion of this entry, since there might be multiple threads
-          // iterating over the _dependencies graph. Other call paths are single-threaded
-          // and may delete it immediately.
-          InstanceKlass::cast(klass)->remove_dependent_nmethod(this, delete_immediately);
+        if (delete_immediately) {
+          assert_locked_or_safepoint(CodeCache_lock);
+          InstanceKlass::cast(klass)->remove_dependent_nmethod(this);
+        } else if (klass->is_loader_alive()) {
+          // The GC may clean dependency contexts concurrently and in parallel.
+          InstanceKlass::cast(klass)->clean_dependency_context();
         }
       }
     }
@@ -1567,14 +1575,44 @@
   if (state_is_unloading) {
     return true;
   }
-  if (state_unloading_cycle == CodeCache::unloading_cycle()) {
+  uint8_t current_cycle = CodeCache::unloading_cycle();
+  if (state_unloading_cycle == current_cycle) {
     return false;
   }
 
   // The IsUnloadingBehaviour is responsible for checking if there are any dead
   // oops in the CompiledMethod, by calling oops_do on it.
-  state_unloading_cycle = CodeCache::unloading_cycle();
-  state_is_unloading = IsUnloadingBehaviour::current()->is_unloading(this);
+  state_unloading_cycle = current_cycle;
+
+  if (is_zombie()) {
+    // Zombies without calculated unloading epoch are never unloading due to GC.
+
+    // There are no races where a previously observed is_unloading() nmethod
+    // suddenly becomes not is_unloading() due to here being observed as zombie.
+
+    // With STW unloading, all is_alive() && is_unloading() nmethods are unlinked
+    // and unloaded in the safepoint. That makes races where an nmethod is first
+    // observed as is_alive() && is_unloading() and subsequently observed as
+    // is_zombie() impossible.
+
+    // With concurrent unloading, all references to is_unloading() nmethods are
+    // first unlinked (e.g. IC caches and dependency contexts). Then a global
+    // handshake operation is performed with all JavaThreads before finally
+    // unloading the nmethods. The sweeper never converts is_alive() && is_unloading()
+    // nmethods to zombies; it waits for them to become is_unloaded(). So before
+    // the global handshake, it is impossible for is_unloading() nmethods to
+    // racingly become is_zombie(). And is_unloading() is calculated for all is_alive()
+    // nmethods before taking that global handshake, meaning that it will never
+    // be recalculated after the handshake.
+
+    // After that global handshake, is_unloading() nmethods are only observable
+    // to the iterators, and they will never trigger recomputation of the cached
+    // is_unloading_state, and hence may not suffer from such races.
+
+    state_is_unloading = false;
+  } else {
+    state_is_unloading = IsUnloadingBehaviour::current()->is_unloading(this);
+  }
 
   state = IsUnloadingState::create(state_is_unloading, state_unloading_cycle);
 
@@ -2917,6 +2955,10 @@
 }
 
 void nmethod::maybe_invalidate_installed_code() {
+  if (!is_compiled_by_jvmci()) {
+    return;
+  }
+
   assert(Patching_lock->is_locked() ||
          SafepointSynchronize::is_at_safepoint(), "should be performed under a lock for consistency");
   oop installed_code = JNIHandles::resolve(_jvmci_installed_code);
--- a/src/hotspot/share/code/nmethod.hpp	Thu Dec 06 12:18:29 2018 +0100
+++ b/src/hotspot/share/code/nmethod.hpp	Mon Dec 10 10:20:31 2018 +0000
@@ -257,6 +257,14 @@
 #endif
   );
 
+  // Only used for unit tests.
+  nmethod()
+    : CompiledMethod(),
+      _is_unloading_state(0),
+      _native_receiver_sp_offset(in_ByteSize(-1)),
+      _native_basic_lock_sp_offset(in_ByteSize(-1)) {}
+
+
   static nmethod* new_native_nmethod(const methodHandle& method,
                                      int compile_id,
                                      CodeBuffer *code_buffer,
--- a/src/hotspot/share/gc/g1/dirtyCardQueue.cpp	Thu Dec 06 12:18:29 2018 +0100
+++ b/src/hotspot/share/gc/g1/dirtyCardQueue.cpp	Mon Dec 10 10:20:31 2018 +0000
@@ -31,6 +31,7 @@
 #include "gc/shared/suspendibleThreadSet.hpp"
 #include "gc/shared/workgroup.hpp"
 #include "runtime/atomic.hpp"
+#include "runtime/flags/flagSetting.hpp"
 #include "runtime/mutexLocker.hpp"
 #include "runtime/safepoint.hpp"
 #include "runtime/thread.inline.hpp"
@@ -148,14 +149,9 @@
 
 void DirtyCardQueueSet::initialize(Monitor* cbl_mon,
                                    BufferNode::Allocator* allocator,
-                                   int process_completed_threshold,
-                                   int max_completed_queue,
                                    Mutex* lock,
                                    bool init_free_ids) {
-  PtrQueueSet::initialize(cbl_mon,
-                          allocator,
-                          process_completed_threshold,
-                          max_completed_queue);
+  PtrQueueSet::initialize(cbl_mon, allocator);
   _shared_dirty_card_queue.set_lock(lock);
   if (init_free_ids) {
     _free_ids = new FreeIdSet(num_par_ids(), _cbl_mon);
@@ -334,13 +330,11 @@
   // Iterate over all the threads, if we find a partial log add it to
   // the global list of logs.  Temporarily turn off the limit on the number
   // of outstanding buffers.
-  int save_max_completed_queue = _max_completed_queue;
-  _max_completed_queue = max_jint;
   assert(SafepointSynchronize::is_at_safepoint(), "Must be at safepoint.");
+  SizeTFlagSetting local_max(_max_completed_buffers,
+                             MaxCompletedBuffersUnlimited);
   for (JavaThreadIteratorWithHandle jtiwh; JavaThread *t = jtiwh.next(); ) {
     concatenate_log(G1ThreadLocalData::dirty_card_queue(t));
   }
   concatenate_log(_shared_dirty_card_queue);
-  // Restore the completed buffer queue limit.
-  _max_completed_queue = save_max_completed_queue;
 }
--- a/src/hotspot/share/gc/g1/dirtyCardQueue.hpp	Thu Dec 06 12:18:29 2018 +0100
+++ b/src/hotspot/share/gc/g1/dirtyCardQueue.hpp	Mon Dec 10 10:20:31 2018 +0000
@@ -119,8 +119,6 @@
 
   void initialize(Monitor* cbl_mon,
                   BufferNode::Allocator* allocator,
-                  int process_completed_threshold,
-                  int max_completed_queue,
                   Mutex* lock,
                   bool init_free_ids = false);
 
--- a/src/hotspot/share/gc/g1/g1Arguments.cpp	Thu Dec 06 12:18:29 2018 +0100
+++ b/src/hotspot/share/gc/g1/g1Arguments.cpp	Mon Dec 10 10:20:31 2018 +0000
@@ -81,6 +81,13 @@
     vm_exit_during_initialization("The flag -XX:+UseG1GC can not be combined with -XX:ParallelGCThreads=0", NULL);
   }
 
+  // When dumping the CDS archive we want to reduce fragmentation by
+  // triggering a full collection. To get as low fragmentation as
+  // possible we only use one worker thread.
+  if (DumpSharedSpaces) {
+    FLAG_SET_ERGO(uint, ParallelGCThreads, 1);
+  }
+
   if (FLAG_IS_DEFAULT(G1ConcRefinementThreads)) {
     FLAG_SET_ERGO(uint, G1ConcRefinementThreads, ParallelGCThreads);
   }
--- a/src/hotspot/share/gc/g1/g1CollectedHeap.cpp	Thu Dec 06 12:18:29 2018 +0100
+++ b/src/hotspot/share/gc/g1/g1CollectedHeap.cpp	Mon Dec 10 10:20:31 2018 +0000
@@ -1563,16 +1563,33 @@
   guarantee(_task_queues != NULL, "task_queues allocation failure.");
 }
 
+static size_t actual_reserved_page_size(ReservedSpace rs) {
+  size_t page_size = os::vm_page_size();
+  if (UseLargePages) {
+    // There are two ways to manage large page memory.
+    // 1. OS supports committing large page memory.
+    // 2. OS doesn't support committing large page memory so ReservedSpace manages it.
+    //    And ReservedSpace calls it 'special'. If we failed to set 'special',
+    //    we reserved memory without large page.
+    if (os::can_commit_large_page_memory() || rs.special()) {
+      page_size = rs.alignment();
+    }
+  }
+
+  return page_size;
+}
+
 G1RegionToSpaceMapper* G1CollectedHeap::create_aux_memory_mapper(const char* description,
                                                                  size_t size,
                                                                  size_t translation_factor) {
   size_t preferred_page_size = os::page_size_for_region_unaligned(size, 1);
   // Allocate a new reserved space, preferring to use large pages.
   ReservedSpace rs(size, preferred_page_size);
+  size_t page_size = actual_reserved_page_size(rs);
   G1RegionToSpaceMapper* result  =
     G1RegionToSpaceMapper::create_mapper(rs,
                                          size,
-                                         rs.alignment(),
+                                         page_size,
                                          HeapRegion::GrainBytes,
                                          translation_factor,
                                          mtGC);
@@ -1580,7 +1597,7 @@
   os::trace_page_sizes_for_requested_size(description,
                                           size,
                                           preferred_page_size,
-                                          rs.alignment(),
+                                          page_size,
                                           rs.base(),
                                           rs.size());
 
@@ -1659,19 +1676,15 @@
                                                  G1SATBBufferEnqueueingThresholdPercent,
                                                  Shared_SATB_Q_lock);
 
-  // process_completed_threshold and max_completed_queue are updated
+  // process_completed_buffers_threshold and max_completed_buffers are updated
   // later, based on the concurrent refinement object.
   G1BarrierSet::dirty_card_queue_set().initialize(DirtyCardQ_CBL_mon,
                                                   &bs->dirty_card_queue_buffer_allocator(),
-                                                  -1, // temp. never trigger
-                                                  -1, // temp. no limit
                                                   Shared_DirtyCardQ_lock,
                                                   true); // init_free_ids
 
   dirty_card_queue_set().initialize(DirtyCardQ_CBL_mon,
                                     &bs->dirty_card_queue_buffer_allocator(),
-                                    -1, // never trigger processing
-                                    -1, // no limit on length
                                     Shared_DirtyCardQ_lock);
 
   // Create the hot card cache.
@@ -1679,7 +1692,7 @@
 
   // Carve out the G1 part of the heap.
   ReservedSpace g1_rs = heap_rs.first_part(max_byte_size);
-  size_t page_size = UseLargePages ? os::large_page_size() : os::vm_page_size();
+  size_t page_size = actual_reserved_page_size(heap_rs);
   G1RegionToSpaceMapper* heap_storage =
     G1RegionToSpaceMapper::create_mapper(g1_rs,
                                          g1_rs.size(),
@@ -1782,8 +1795,8 @@
 
   {
     DirtyCardQueueSet& dcqs = G1BarrierSet::dirty_card_queue_set();
-    dcqs.set_process_completed_threshold((int)concurrent_refine()->yellow_zone());
-    dcqs.set_max_completed_queue((int)concurrent_refine()->red_zone());
+    dcqs.set_process_completed_buffers_threshold(concurrent_refine()->yellow_zone());
+    dcqs.set_max_completed_buffers(concurrent_refine()->red_zone());
   }
 
   // Here we allocate the dummy HeapRegion that is required by the
--- a/src/hotspot/share/gc/g1/g1ConcurrentRefine.cpp	Thu Dec 06 12:18:29 2018 +0100
+++ b/src/hotspot/share/gc/g1/g1ConcurrentRefine.cpp	Mon Dec 10 10:20:31 2018 +0000
@@ -144,7 +144,7 @@
 STATIC_ASSERT(sizeof(LP64_ONLY(jint) NOT_LP64(jshort)) <= (sizeof(size_t)/2));
 const size_t max_yellow_zone = LP64_ONLY(max_jint) NOT_LP64(max_jshort);
 const size_t max_green_zone = max_yellow_zone / 2;
-const size_t max_red_zone = INT_MAX; // For dcqs.set_max_completed_queue.
+const size_t max_red_zone = INT_MAX; // For dcqs.set_max_completed_buffers.
 STATIC_ASSERT(max_yellow_zone <= max_red_zone);
 
 // Range check assertions for green zone values.
@@ -386,21 +386,22 @@
     // Change the barrier params
     if (max_num_threads() == 0) {
       // Disable dcqs notification when there are no threads to notify.
-      dcqs.set_process_completed_threshold(INT_MAX);
+      dcqs.set_process_completed_buffers_threshold(DirtyCardQueueSet::ProcessCompletedBuffersThresholdNever);
     } else {
       // Worker 0 is the primary; wakeup is via dcqs notification.
       STATIC_ASSERT(max_yellow_zone <= INT_MAX);
       size_t activate = activation_threshold(0);
-      dcqs.set_process_completed_threshold((int)activate);
+      dcqs.set_process_completed_buffers_threshold(activate);
     }
-    dcqs.set_max_completed_queue((int)red_zone());
+    dcqs.set_max_completed_buffers(red_zone());
   }
 
   size_t curr_queue_size = dcqs.completed_buffers_num();
-  if (curr_queue_size >= yellow_zone()) {
-    dcqs.set_completed_queue_padding(curr_queue_size);
+  if ((dcqs.max_completed_buffers() > 0) &&
+      (curr_queue_size >= yellow_zone())) {
+    dcqs.set_completed_buffers_padding(curr_queue_size);
   } else {
-    dcqs.set_completed_queue_padding(0);
+    dcqs.set_completed_buffers_padding(0);
   }
   dcqs.notify_if_necessary();
 }
@@ -433,8 +434,8 @@
   // that means that the transition period after the evacuation pause has ended.
   // Since the value written to the DCQS is the same for all threads, there is no
   // need to synchronize.
-  if (dcqs.completed_queue_padding() > 0 && curr_buffer_num <= yellow_zone()) {
-    dcqs.set_completed_queue_padding(0);
+  if (dcqs.completed_buffers_padding() > 0 && curr_buffer_num <= yellow_zone()) {
+    dcqs.set_completed_buffers_padding(0);
   }
 
   maybe_activate_more_threads(worker_id, curr_buffer_num);
--- a/src/hotspot/share/gc/g1/g1HeapVerifier.cpp	Thu Dec 06 12:18:29 2018 +0100
+++ b/src/hotspot/share/gc/g1/g1HeapVerifier.cpp	Mon Dec 10 10:20:31 2018 +0000
@@ -273,6 +273,69 @@
 };
 
 // Should be only used at CDS dump time
+class VerifyReadyForArchivingRegionClosure : public HeapRegionClosure {
+  bool _seen_free;
+  bool _has_holes;
+  bool _has_unexpected_holes;
+  bool _has_humongous;
+public:
+  bool has_holes() {return _has_holes;}
+  bool has_unexpected_holes() {return _has_unexpected_holes;}
+  bool has_humongous() {return _has_humongous;}
+
+  VerifyReadyForArchivingRegionClosure() : HeapRegionClosure() {
+    _seen_free = false;
+    _has_holes = false;
+    _has_unexpected_holes = false;
+    _has_humongous = false;
+  }
+  virtual bool do_heap_region(HeapRegion* hr) {
+    const char* hole = "";
+
+    if (hr->is_free()) {
+      _seen_free = true;
+    } else {
+      if (_seen_free) {
+        _has_holes = true;
+        if (hr->is_humongous()) {
+          hole = " hole";
+        } else {
+          _has_unexpected_holes = true;
+          hole = " hole **** unexpected ****";
+        }
+      }
+    }
+    if (hr->is_humongous()) {
+      _has_humongous = true;
+    }
+    log_info(gc, region, cds)("HeapRegion " INTPTR_FORMAT " %s%s", p2i(hr->bottom()), hr->get_type_str(), hole);
+    return false;
+  }
+};
+
+// We want all used regions to be moved to the bottom-end of the heap, so we have
+// a contiguous range of free regions at the top end of the heap. This way, we can
+// avoid fragmentation while allocating the archive regions.
+//
+// Before calling this, a full GC should have been executed with a single worker thread,
+// so that no old regions would be moved to the middle of the heap.
+void G1HeapVerifier::verify_ready_for_archiving() {
+  VerifyReadyForArchivingRegionClosure cl;
+  G1CollectedHeap::heap()->heap_region_iterate(&cl);
+  if (cl.has_holes()) {
+    log_warning(gc, verify)("All free regions should be at the top end of the heap, but"
+                            " we found holes. This is probably caused by (unmovable) humongous"
+                            " allocations, and may lead to fragmentation while"
+                            " writing archive heap memory regions.");
+  }
+  if (cl.has_humongous()) {
+    log_warning(gc, verify)("(Unmovable) humongous regions have been found and"
+                            " may lead to fragmentation while"
+                            " writing archive heap memory regions.");
+  }
+  assert(!cl.has_unexpected_holes(), "all holes should have been caused by humongous regions");
+}
+
 class VerifyArchivePointerRegionClosure: public HeapRegionClosure {
 private:
   G1CollectedHeap* _g1h;
--- a/src/hotspot/share/gc/g1/g1HeapVerifier.hpp	Thu Dec 06 12:18:29 2018 +0100
+++ b/src/hotspot/share/gc/g1/g1HeapVerifier.hpp	Mon Dec 10 10:20:31 2018 +0000
@@ -115,6 +115,7 @@
   void verify_dirty_region(HeapRegion* hr) PRODUCT_RETURN;
   void verify_dirty_young_regions() PRODUCT_RETURN;
 
+  static void verify_ready_for_archiving();
   static void verify_archive_regions();
 };
 
--- a/src/hotspot/share/gc/g1/g1SATBMarkQueueSet.cpp	Thu Dec 06 12:18:29 2018 +0100
+++ b/src/hotspot/share/gc/g1/g1SATBMarkQueueSet.cpp	Mon Dec 10 10:20:31 2018 +0000
@@ -37,12 +37,12 @@
 void G1SATBMarkQueueSet::initialize(G1CollectedHeap* g1h,
                                     Monitor* cbl_mon,
                                     BufferNode::Allocator* allocator,
-                                    int process_completed_threshold,
+                                    size_t process_completed_buffers_threshold,
                                     uint buffer_enqueue_threshold_percentage,
                                     Mutex* lock) {
   SATBMarkQueueSet::initialize(cbl_mon,
                                allocator,
-                               process_completed_threshold,
+                               process_completed_buffers_threshold,
                                buffer_enqueue_threshold_percentage,
                                lock);
   _g1h = g1h;
--- a/src/hotspot/share/gc/g1/g1SATBMarkQueueSet.hpp	Thu Dec 06 12:18:29 2018 +0100
+++ b/src/hotspot/share/gc/g1/g1SATBMarkQueueSet.hpp	Mon Dec 10 10:20:31 2018 +0000
@@ -39,7 +39,7 @@
   void initialize(G1CollectedHeap* g1h,
                   Monitor* cbl_mon,
                   BufferNode::Allocator* allocator,
-                  int process_completed_threshold,
+                  size_t process_completed_buffers_threshold,
                   uint buffer_enqueue_threshold_percentage,
                   Mutex* lock);
 
--- a/src/hotspot/share/gc/shared/gcCause.cpp	Thu Dec 06 12:18:29 2018 +0100
+++ b/src/hotspot/share/gc/shared/gcCause.cpp	Mon Dec 10 10:20:31 2018 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -60,6 +60,9 @@
     case _wb_full_gc:
       return "WhiteBox Initiated Full GC";
 
+    case _archive_time_gc:
+      return "Full GC for -Xshare:dump";
+
     case _no_gc:
       return "No GC";
 
--- a/src/hotspot/share/gc/shared/gcCause.hpp	Thu Dec 06 12:18:29 2018 +0100
+++ b/src/hotspot/share/gc/shared/gcCause.hpp	Mon Dec 10 10:20:31 2018 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -52,6 +52,7 @@
     _wb_young_gc,
     _wb_conc_mark,
     _wb_full_gc,
+    _archive_time_gc,
 
     /* implementation independent, but reserved for GC use */
     _no_gc,
--- a/src/hotspot/share/gc/shared/ptrQueue.cpp	Thu Dec 06 12:18:29 2018 +0100
+++ b/src/hotspot/share/gc/shared/ptrQueue.cpp	Mon Dec 10 10:20:31 2018 +0000
@@ -164,12 +164,12 @@
   _completed_buffers_head(NULL),
   _completed_buffers_tail(NULL),
   _n_completed_buffers(0),
-  _process_completed_threshold(0),
+  _process_completed_buffers_threshold(ProcessCompletedBuffersThresholdNever),
   _process_completed(false),
   _all_active(false),
   _notify_when_complete(notify_when_complete),
-  _max_completed_queue(0),
-  _completed_queue_padding(0)
+  _max_completed_buffers(MaxCompletedBuffersUnlimited),
+  _completed_buffers_padding(0)
 {}
 
 PtrQueueSet::~PtrQueueSet() {
@@ -179,12 +179,7 @@
 }
 
 void PtrQueueSet::initialize(Monitor* cbl_mon,
-                             BufferNode::Allocator* allocator,
-                             int process_completed_threshold,
-                             int max_completed_queue) {
-  _max_completed_queue = max_completed_queue;
-  _process_completed_threshold = process_completed_threshold;
-  _completed_queue_padding = 0;
+                             BufferNode::Allocator* allocator) {
   assert(cbl_mon != NULL && allocator != NULL, "Init order issue?");
   _cbl_mon = cbl_mon;
   _allocator = allocator;
@@ -238,13 +233,14 @@
 
 bool PtrQueueSet::process_or_enqueue_complete_buffer(BufferNode* node) {
   if (Thread::current()->is_Java_thread()) {
-    // We don't lock. It is fine to be epsilon-precise here.
-    if (_max_completed_queue == 0 ||
-        (_max_completed_queue > 0 &&
-          _n_completed_buffers >= _max_completed_queue + _completed_queue_padding)) {
-      bool b = mut_process_buffer(node);
-      if (b) {
-        // True here means that the buffer hasn't been deallocated and the caller may reuse it.
+    // If the number of buffers exceeds the limit, make this Java
+    // thread do the processing itself.  We don't lock to access
+    // buffer count or padding; it is fine to be imprecise here.  The
+    // add of padding could overflow, which is treated as unlimited.
+    size_t limit = _max_completed_buffers + _completed_buffers_padding;
+    if ((_n_completed_buffers > limit) && (limit >= _max_completed_buffers)) {
+      if (mut_process_buffer(node)) {
+        // Successfully processed; return true to allow buffer reuse.
         return true;
       }
     }
@@ -267,8 +263,8 @@
   }
   _n_completed_buffers++;
 
-  if (!_process_completed && _process_completed_threshold >= 0 &&
-      _n_completed_buffers >= (size_t)_process_completed_threshold) {
+  if (!_process_completed &&
+      (_n_completed_buffers > _process_completed_buffers_threshold)) {
     _process_completed = true;
     if (_notify_when_complete) {
       _cbl_mon->notify();
@@ -327,8 +323,7 @@
 
 void PtrQueueSet::notify_if_necessary() {
   MutexLockerEx x(_cbl_mon, Mutex::_no_safepoint_check_flag);
-  assert(_process_completed_threshold >= 0, "_process_completed_threshold is negative");
-  if (_n_completed_buffers >= (size_t)_process_completed_threshold || _max_completed_queue == 0) {
+  if (_n_completed_buffers > _process_completed_buffers_threshold) {
     _process_completed = true;
     if (_notify_when_complete)
       _cbl_mon->notify();
--- a/src/hotspot/share/gc/shared/ptrQueue.hpp	Thu Dec 06 12:18:29 2018 +0100
+++ b/src/hotspot/share/gc/shared/ptrQueue.hpp	Mon Dec 10 10:20:31 2018 +0000
@@ -284,7 +284,7 @@
   BufferNode* _completed_buffers_head;
   BufferNode* _completed_buffers_tail;
   size_t _n_completed_buffers;
-  int _process_completed_threshold;
+  size_t _process_completed_buffers_threshold;
   volatile bool _process_completed;
 
   bool _all_active;
@@ -293,9 +293,9 @@
   bool _notify_when_complete;
 
   // Maximum number of elements allowed on completed queue: after that,
-  // enqueuer does the work itself.  Zero indicates no maximum.
-  int _max_completed_queue;
-  size_t _completed_queue_padding;
+  // enqueuer does the work itself.
+  size_t _max_completed_buffers;
+  size_t _completed_buffers_padding;
 
   size_t completed_buffers_list_length();
   void assert_completed_buffer_list_len_correct_locked();
@@ -316,10 +316,7 @@
 
   // Because of init-order concerns, we can't pass these as constructor
   // arguments.
-  void initialize(Monitor* cbl_mon,
-                  BufferNode::Allocator* allocator,
-                  int process_completed_threshold,
-                  int max_completed_queue);
+  void initialize(Monitor* cbl_mon, BufferNode::Allocator* allocator);
 
 public:
 
@@ -350,18 +347,34 @@
   }
 
   // Get/Set the number of completed buffers that triggers log processing.
-  void set_process_completed_threshold(int sz) { _process_completed_threshold = sz; }
-  int process_completed_threshold() const { return _process_completed_threshold; }
+  // Log processing should be done when the number of buffers exceeds the
+  // threshold.
+  void set_process_completed_buffers_threshold(size_t sz) {
+    _process_completed_buffers_threshold = sz;
+  }
+  size_t process_completed_buffers_threshold() const {
+    return _process_completed_buffers_threshold;
+  }
+  static const size_t ProcessCompletedBuffersThresholdNever = ~size_t(0);
 
-  size_t completed_buffers_num() { return _n_completed_buffers; }
+  size_t completed_buffers_num() const { return _n_completed_buffers; }
 
   void merge_bufferlists(PtrQueueSet* src);
 
-  void set_max_completed_queue(int m) { _max_completed_queue = m; }
-  int max_completed_queue() { return _max_completed_queue; }
+  void set_max_completed_buffers(size_t m) {
+    _max_completed_buffers = m;
+  }
+  size_t max_completed_buffers() const {
+    return _max_completed_buffers;
+  }
+  static const size_t MaxCompletedBuffersUnlimited = ~size_t(0);
 
-  void set_completed_queue_padding(size_t padding) { _completed_queue_padding = padding; }
-  size_t completed_queue_padding() { return _completed_queue_padding; }
+  void set_completed_buffers_padding(size_t padding) {
+    _completed_buffers_padding = padding;
+  }
+  size_t completed_buffers_padding() const {
+    return _completed_buffers_padding;
+  }
 
   // Notify the consumer if the number of buffers crossed the threshold
   void notify_if_necessary();
--- a/src/hotspot/share/gc/shared/satbMarkQueue.cpp	Thu Dec 06 12:18:29 2018 +0100
+++ b/src/hotspot/share/gc/shared/satbMarkQueue.cpp	Mon Dec 10 10:20:31 2018 +0000
@@ -113,10 +113,11 @@
 
 void SATBMarkQueueSet::initialize(Monitor* cbl_mon,
                                   BufferNode::Allocator* allocator,
-                                  int process_completed_threshold,
+                                  size_t process_completed_buffers_threshold,
                                   uint buffer_enqueue_threshold_percentage,
                                   Mutex* lock) {
-  PtrQueueSet::initialize(cbl_mon, allocator, process_completed_threshold, -1);
+  PtrQueueSet::initialize(cbl_mon, allocator);
+  set_process_completed_buffers_threshold(process_completed_buffers_threshold);
   _shared_satb_queue.set_lock(lock);
   assert(buffer_size() != 0, "buffer size not initialized");
   // Minimum threshold of 1 ensures enqueuing of completely full buffers.
--- a/src/hotspot/share/gc/shared/satbMarkQueue.hpp	Thu Dec 06 12:18:29 2018 +0100
+++ b/src/hotspot/share/gc/shared/satbMarkQueue.hpp	Mon Dec 10 10:20:31 2018 +0000
@@ -110,7 +110,7 @@
 
   void initialize(Monitor* cbl_mon,
                   BufferNode::Allocator* allocator,
-                  int process_completed_threshold,
+                  size_t process_completed_buffers_threshold,
                   uint buffer_enqueue_threshold_percentage,
                   Mutex* lock);
 
--- a/src/hotspot/share/gc/z/c2/zBarrierSetC2.cpp	Thu Dec 06 12:18:29 2018 +0100
+++ b/src/hotspot/share/gc/z/c2/zBarrierSetC2.cpp	Mon Dec 10 10:20:31 2018 +0000
@@ -658,8 +658,6 @@
       kit->set_control(gvn.transform(new ProjNode(barrier, LoadBarrierNode::Control)));
     }
     Node* result = gvn.transform(new ProjNode(transformed_barrier, LoadBarrierNode::Oop));
-    assert(is_gc_barrier_node(result), "sanity");
-    assert(step_over_gc_barrier(result) == val, "sanity");
     return result;
   } else {
     return val;
@@ -997,13 +995,12 @@
 }
 
 bool ZBarrierSetC2::expand_barriers(Compile* C, PhaseIterGVN& igvn) const {
-  PhaseMacroExpand macro(igvn);
   ZBarrierSetC2State* s = state();
   if (s->load_barrier_count() > 0) {
+    PhaseMacroExpand macro(igvn);
 #ifdef ASSERT
     verify_gc_barriers(false);
 #endif
-    igvn.set_delay_transform(true);
     int skipped = 0;
     while (s->load_barrier_count() > skipped) {
       int load_barrier_count = s->load_barrier_count();
--- a/src/hotspot/share/gc/z/zForwardingTable.cpp	Thu Dec 06 12:18:29 2018 +0100
+++ b/src/hotspot/share/gc/z/zForwardingTable.cpp	Mon Dec 10 10:20:31 2018 +0000
@@ -38,11 +38,18 @@
   _size = ZUtils::round_up_power_of_2(live_objects * 2);
   _table = MallocArrayAllocator<ZForwardingTableEntry>::allocate(_size, mtGC);
 
-  // Clear table
-  memset(_table, ZForwardingTableEntry::empty(), _size * sizeof(ZForwardingTableEntry));
+  // Construct table entries
+  for (size_t i = 0; i < _size; i++) {
+    ::new (_table + i) ZForwardingTableEntry();
+  }
 }
 
 void ZForwardingTable::reset() {
+  // Destruct table entries
+  for (size_t i = 0; i < _size; i++) {
+    (_table + i)->~ZForwardingTableEntry();
+  }
+
   // Free table
   MallocArrayAllocator<ZForwardingTableEntry>::free(_table);
   _table = NULL;
--- a/src/hotspot/share/gc/z/zForwardingTableEntry.hpp	Thu Dec 06 12:18:29 2018 +0100
+++ b/src/hotspot/share/gc/z/zForwardingTableEntry.hpp	Mon Dec 10 10:20:31 2018 +0000
@@ -52,6 +52,10 @@
 
   uint64_t _entry;
 
+  static uintptr_t empty() {
+    return (uintptr_t)-1;
+  }
+
 public:
   ZForwardingTableEntry() :
       _entry(empty()) {}
@@ -60,10 +64,6 @@
       _entry(field_from_index::encode(from_index) |
              field_to_offset::encode(to_offset)) {}
 
-  static uintptr_t empty() {
-    return (uintptr_t)-1;
-  }
-
   bool is_empty() const {
     return _entry == empty();
   }
--- a/src/hotspot/share/include/jvm.h	Thu Dec 06 12:18:29 2018 +0100
+++ b/src/hotspot/share/include/jvm.h	Mon Dec 10 10:20:31 2018 +0000
@@ -111,9 +111,11 @@
 JVM_ArrayCopy(JNIEnv *env, jclass ignored, jobject src, jint src_pos,
               jobject dst, jint dst_pos, jint length);
 
-JNIEXPORT jobject JNICALL
-JVM_InitProperties(JNIEnv *env, jobject p);
-
+/*
+ * Return an array of all properties as alternating name and value pairs.
+ */
+JNIEXPORT jobjectArray JNICALL
+JVM_GetProperties(JNIEnv *env);
 
 /*
  * java.lang.Runtime
--- a/src/hotspot/share/interpreter/interpreterRuntime.cpp	Thu Dec 06 12:18:29 2018 +0100
+++ b/src/hotspot/share/interpreter/interpreterRuntime.cpp	Mon Dec 10 10:20:31 2018 +0000
@@ -728,7 +728,7 @@
   // class is initialized.  This is required so that access to the static
   // field will call the initialization function every time until the class
   // is completely initialized ala. in 2.17.5 in JVM Specification.
-  InstanceKlass* klass = InstanceKlass::cast(info.field_holder());
+  InstanceKlass* klass = info.field_holder();
   bool uninitialized_static = is_static && !klass->is_initialized();
   bool has_initialized_final_update = info.field_holder()->major_version() >= 53 &&
                                       info.has_initialized_final_update();
--- a/src/hotspot/share/interpreter/linkResolver.cpp	Thu Dec 06 12:18:29 2018 +0100
+++ b/src/hotspot/share/interpreter/linkResolver.cpp	Mon Dec 10 10:20:31 2018 +0000
@@ -1151,7 +1151,7 @@
     InstanceKlass* ck = InstanceKlass::cast(current_klass);
     InstanceKlass *klass_to_check = !ck->is_unsafe_anonymous() ?
                                     ck :
-                                    InstanceKlass::cast(ck->unsafe_anonymous_host());
+                                    ck->unsafe_anonymous_host();
     // Disable verification for the dynamically-generated reflection bytecodes.
     bool is_reflect = klass_to_check->is_subclass_of(
                         SystemDictionary::reflect_MagicAccessorImpl_klass());
--- a/src/hotspot/share/memory/binaryTreeDictionary.inline.hpp	Thu Dec 06 12:18:29 2018 +0100
+++ b/src/hotspot/share/memory/binaryTreeDictionary.inline.hpp	Mon Dec 10 10:20:31 2018 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -229,7 +229,8 @@
   assert(chunk->list() == this, "list should be set for chunk");
   assert(tail() != NULL, "The tree list is embedded in the first chunk");
   // which means that the list can never be empty.
-  assert(!this->verify_chunk_in_free_list(chunk), "Double entry");
+  // This is expensive for metaspace
+  assert(!FLSVerifyDictionary || !this->verify_chunk_in_free_list(chunk), "Double entry");
   assert(head() == NULL || head()->prev() == NULL, "list invariant");
   assert(tail() == NULL || tail()->next() == NULL, "list invariant");
 
@@ -253,7 +254,8 @@
   assert(chunk->list() == this, "list should be set for chunk");
   assert(head() != NULL, "The tree list is embedded in the first chunk");
   assert(chunk != NULL, "returning NULL chunk");
-  assert(!this->verify_chunk_in_free_list(chunk), "Double entry");
+  // This is expensive for metaspace
+  assert(!FLSVerifyDictionary || !this->verify_chunk_in_free_list(chunk), "Double entry");
   assert(head() == NULL || head()->prev() == NULL, "list invariant");
   assert(tail() == NULL || tail()->next() == NULL, "list invariant");
 
--- a/src/hotspot/share/memory/filemap.cpp	Thu Dec 06 12:18:29 2018 +0100
+++ b/src/hotspot/share/memory/filemap.cpp	Mon Dec 10 10:20:31 2018 +0000
@@ -683,7 +683,7 @@
   int arr_len = heap_mem == NULL ? 0 : heap_mem->length();
   if(arr_len > max_num_regions) {
     fail_stop("Unable to write archive heap memory regions: "
-              "number of memory regions exceeds maximum due to fragmentation."
+              "number of memory regions exceeds maximum due to fragmentation. "
               "Please increase java heap size "
               "(current MaxHeapSize is " SIZE_FORMAT ", InitialHeapSize is " SIZE_FORMAT ").",
               MaxHeapSize, InitialHeapSize);
--- a/src/hotspot/share/memory/heapShared.cpp	Thu Dec 06 12:18:29 2018 +0100
+++ b/src/hotspot/share/memory/heapShared.cpp	Mon Dec 10 10:20:31 2018 +0000
@@ -193,6 +193,8 @@
     return;
   }
 
+  G1HeapVerifier::verify_ready_for_archiving();
+
   {
     NoSafepointVerifier nsv;
 
@@ -581,7 +583,7 @@
   for (JavaFieldStream fs(k); !fs.done(); fs.next()) {
     if (!fs.access_flags().is_static()) {
       BasicType ft = fs.field_descriptor().field_type();
-      if (!fs.access_flags().is_final() && (ft == T_ARRAY || T_OBJECT)) {
+      if (!fs.access_flags().is_final() && (ft == T_ARRAY || ft == T_OBJECT)) {
         ResourceMark rm(THREAD);
         log_warning(cds, heap)(
           "Please check reference field in %s instance in closed archive heap region: %s %s",
--- a/src/hotspot/share/memory/metaspace.cpp	Thu Dec 06 12:18:29 2018 +0100
+++ b/src/hotspot/share/memory/metaspace.cpp	Mon Dec 10 10:20:31 2018 +0000
@@ -865,6 +865,7 @@
 
 // Utils to check if a pointer or range is part of a committed metaspace region.
 metaspace::VirtualSpaceNode* MetaspaceUtils::find_enclosing_virtual_space(const void* p) {
+  MutexLockerEx cl(MetaspaceExpand_lock, Mutex::_no_safepoint_check_flag);
   VirtualSpaceNode* vsn = Metaspace::space_list()->find_enclosing_space(p);
   if (Metaspace::using_class_space() && vsn == NULL) {
     vsn = Metaspace::class_space_list()->find_enclosing_space(p);
--- a/src/hotspot/share/memory/metaspace/virtualSpaceList.cpp	Thu Dec 06 12:18:29 2018 +0100
+++ b/src/hotspot/share/memory/metaspace/virtualSpaceList.cpp	Mon Dec 10 10:20:31 2018 +0000
@@ -89,7 +89,6 @@
 // nodes with a 0 container_count.  Remove Metachunks in
 // the node from their respective freelists.
 void VirtualSpaceList::purge(ChunkManager* chunk_manager) {
-  assert(SafepointSynchronize::is_at_safepoint(), "must be called at safepoint for contains to work");
   assert_lock_strong(MetaspaceExpand_lock);
   // Don't use a VirtualSpaceListIterator because this
   // list is being changed and a straightforward use of an iterator is not safe.
--- a/src/hotspot/share/memory/metaspaceShared.cpp	Thu Dec 06 12:18:29 2018 +0100
+++ b/src/hotspot/share/memory/metaspaceShared.cpp	Mon Dec 10 10:20:31 2018 +0000
@@ -29,6 +29,7 @@
 #include "classfile/classLoaderExt.hpp"
 #include "classfile/dictionary.hpp"
 #include "classfile/loaderConstraints.hpp"
+#include "classfile/javaClasses.inline.hpp"
 #include "classfile/placeholders.hpp"
 #include "classfile/symbolTable.hpp"
 #include "classfile/stringTable.hpp"
@@ -350,7 +351,11 @@
   }
 }
 
+static GrowableArray<Handle>* _extra_interned_strings = NULL;
+
 void MetaspaceShared::read_extra_data(const char* filename, TRAPS) {
+  _extra_interned_strings = new (ResourceObj::C_HEAP, mtInternal)GrowableArray<Handle>(10000, true);
+
   HashtableTextDump reader(filename);
   reader.check_version("VERSION: 1.0");
 
@@ -358,15 +363,45 @@
     int utf8_length;
     int prefix_type = reader.scan_prefix(&utf8_length);
     ResourceMark rm(THREAD);
-    char* utf8_buffer = NEW_RESOURCE_ARRAY(char, utf8_length);
+    if (utf8_length == 0x7fffffff) {
+      // buf_len will overflown 32-bit value.
+      vm_exit_during_initialization(err_msg("string length too large: %d", utf8_length));
+    }
+    int buf_len = utf8_length+1;
+    char* utf8_buffer = NEW_RESOURCE_ARRAY(char, buf_len);
     reader.get_utf8(utf8_buffer, utf8_length);
+    utf8_buffer[utf8_length] = '\0';
 
     if (prefix_type == HashtableTextDump::SymbolPrefix) {
-      SymbolTable::new_symbol(utf8_buffer, utf8_length, THREAD);
+      SymbolTable::new_permanent_symbol(utf8_buffer, THREAD);
     } else{
       assert(prefix_type == HashtableTextDump::StringPrefix, "Sanity");
-      utf8_buffer[utf8_length] = '\0';
       oop s = StringTable::intern(utf8_buffer, THREAD);
+
+      if (HAS_PENDING_EXCEPTION) {
+        log_warning(cds, heap)("[line %d] extra interned string allocation failed; size too large: %d",
+                               reader.last_line_no(), utf8_length);
+        CLEAR_PENDING_EXCEPTION;
+      } else {
+#if INCLUDE_G1GC
+        if (UseG1GC) {
+          typeArrayOop body = java_lang_String::value(s);
+          const HeapRegion* hr = G1CollectedHeap::heap()->heap_region_containing(body);
+          if (hr->is_humongous()) {
+            // Don't keep it alive, so it will be GC'ed before we dump the strings, in order
+            // to maximize free heap space and minimize fragmentation.
+            log_warning(cds, heap)("[line %d] extra interned string ignored; size too large: %d",
+                                reader.last_line_no(), utf8_length);
+            continue;
+          }
+        }
+#endif
+        // Interned strings are GC'ed if there are no references to it, so let's
+        // add a reference to keep this string alive.
+        assert(s != NULL, "must succeed");
+        Handle h(THREAD, s);
+        _extra_interned_strings->append(h);
+      }
     }
   }
 }
@@ -451,8 +486,6 @@
   return _cds_i2i_entry_code_buffers;
 }
 
-// CDS code for dumping shared archive.
-
 // Global object for holding classes that have been loaded.  Since this
 // is run at a safepoint just before exit, this is the entire set of classes.
 static GrowableArray<Klass*>* _global_klass_objects;
@@ -1686,6 +1719,13 @@
     link_and_cleanup_shared_classes(CATCH);
     tty->print_cr("Rewriting and linking classes: done");
 
+    if (HeapShared::is_heap_object_archiving_allowed()) {
+      // Avoid fragmentation while archiving heap objects.
+      Universe::heap()->soft_ref_policy()->set_should_clear_all_soft_refs(true);
+      Universe::heap()->collect(GCCause::_archive_time_gc);
+      Universe::heap()->soft_ref_policy()->set_should_clear_all_soft_refs(false);
+    }
+
     VM_PopulateDumpSharedSpace op;
     VMThread::execute(&op);
   }
--- a/src/hotspot/share/memory/universe.cpp	Thu Dec 06 12:18:29 2018 +0100
+++ b/src/hotspot/share/memory/universe.cpp	Mon Dec 10 10:20:31 2018 +0000
@@ -529,10 +529,6 @@
 #undef assert_pll_locked
 #undef assert_pll_ownership
 
-// initialize_vtable could cause gc if
-// 1) we specified true to initialize_vtable and
-// 2) this ran after gc was enabled
-// In case those ever change we use handles for oops
 void Universe::reinitialize_vtable_of(Klass* ko, TRAPS) {
   // init vtable of k and all subclasses
   ko->vtable().initialize_vtable(false, CHECK);
@@ -545,6 +541,14 @@
   }
 }
 
+void Universe::reinitialize_vtables(TRAPS) {
+  // The vtables are initialized by starting at java.lang.Object and
+  // initializing through the subclass links, so that the super
+  // classes are always initialized first.
+  Klass* ok = SystemDictionary::Object_klass();
+  Universe::reinitialize_vtable_of(ok, THREAD);
+}
+
 
 void initialize_itable_for_klass(InstanceKlass* k, TRAPS) {
   k->itable().initialize_itable(false, CHECK);
@@ -961,9 +965,7 @@
   { ResourceMark rm;
     Interpreter::initialize();      // needed for interpreter entry points
     if (!UseSharedSpaces) {
-      HandleMark hm(THREAD);
-      Klass* ok = SystemDictionary::Object_klass();
-      Universe::reinitialize_vtable_of(ok, CHECK_false);
+      Universe::reinitialize_vtables(CHECK_false);
       Universe::reinitialize_itables(CHECK_false);
     }
   }
--- a/src/hotspot/share/memory/universe.hpp	Thu Dec 06 12:18:29 2018 +0100
+++ b/src/hotspot/share/memory/universe.hpp	Mon Dec 10 10:20:31 2018 +0000
@@ -218,6 +218,7 @@
   static void fixup_mirrors(TRAPS);
 
   static void reinitialize_vtable_of(Klass* k, TRAPS);
+  static void reinitialize_vtables(TRAPS);
   static void reinitialize_itables(TRAPS);
   static void compute_base_vtable_size();             // compute vtable size of class Object
 
--- a/src/hotspot/share/oops/instanceKlass.cpp	Thu Dec 06 12:18:29 2018 +0100
+++ b/src/hotspot/share/oops/instanceKlass.cpp	Mon Dec 10 10:20:31 2018 +0000
@@ -1070,27 +1070,32 @@
 }
 
 Klass* InstanceKlass::implementor() const {
-  assert_locked_or_safepoint(Compile_lock);
-  Klass** k = adr_implementor();
+  Klass* volatile* k = adr_implementor();
   if (k == NULL) {
     return NULL;
   } else {
-    return *k;
+    // This load races with inserts, and therefore needs acquire.
+    Klass* kls = OrderAccess::load_acquire(k);
+    if (kls != NULL && !kls->is_loader_alive()) {
+      return NULL;  // don't return unloaded class
+    } else {
+      return kls;
+    }
   }
 }
 
+
 void InstanceKlass::set_implementor(Klass* k) {
   assert_lock_strong(Compile_lock);
   assert(is_interface(), "not interface");
-  Klass** addr = adr_implementor();
+  Klass* volatile* addr = adr_implementor();
   assert(addr != NULL, "null addr");
   if (addr != NULL) {
-    *addr = k;
+    OrderAccess::release_store(addr, k);
   }
 }
 
 int  InstanceKlass::nof_implementors() const {
-  assert_lock_strong(Compile_lock);
   Klass* k = implementor();
   if (k == NULL) {
     return 0;
@@ -2117,7 +2122,7 @@
 }
 
 inline DependencyContext InstanceKlass::dependencies() {
-  DependencyContext dep_context(&_dep_context);
+  DependencyContext dep_context(&_dep_context, &_dep_context_last_cleaned);
   return dep_context;
 }
 
@@ -2129,8 +2134,12 @@
   dependencies().add_dependent_nmethod(nm);
 }
 
-void InstanceKlass::remove_dependent_nmethod(nmethod* nm, bool delete_immediately) {
-  dependencies().remove_dependent_nmethod(nm, delete_immediately);
+void InstanceKlass::remove_dependent_nmethod(nmethod* nm) {
+  dependencies().remove_dependent_nmethod(nm);
+}
+
+void InstanceKlass::clean_dependency_context() {
+  dependencies().clean_unloading_dependents();
 }
 
 #ifndef PRODUCT
@@ -2146,26 +2155,28 @@
 void InstanceKlass::clean_weak_instanceklass_links() {
   clean_implementors_list();
   clean_method_data();
-
-  // Since GC iterates InstanceKlasses sequentially, it is safe to remove stale entries here.
-  DependencyContext dep_context(&_dep_context);
-  dep_context.expunge_stale_entries();
 }
 
 void InstanceKlass::clean_implementors_list() {
   assert(is_loader_alive(), "this klass should be live");
   if (is_interface()) {
-    if (ClassUnloading) {
-      Klass* impl = implementor();
-      if (impl != NULL) {
-        if (!impl->is_loader_alive()) {
-          // remove this guy
-          Klass** klass = adr_implementor();
-          assert(klass != NULL, "null klass");
-          if (klass != NULL) {
-            *klass = NULL;
+    assert (ClassUnloading, "only called for ClassUnloading");
+    for (;;) {
+      // Use load_acquire due to competing with inserts
+      Klass* impl = OrderAccess::load_acquire(adr_implementor());
+      if (impl != NULL && !impl->is_loader_alive()) {
+        // NULL this field, might be an unloaded klass or NULL
+        Klass* volatile* klass = adr_implementor();
+        if (Atomic::cmpxchg((Klass*)NULL, klass, impl) == impl) {
+          // Successfully unlinking implementor.
+          if (log_is_enabled(Trace, class, unload)) {
+            ResourceMark rm;
+            log_trace(class, unload)("unlinking class (implementor): %s", impl->external_name());
           }
+          return;
         }
+      } else {
+        return;
       }
     }
   }
@@ -2334,7 +2345,7 @@
   // These are not allocated from metaspace, but they should should all be empty
   // during dump time, so we don't need to worry about them in InstanceKlass::iterate().
   guarantee(_source_debug_extension == NULL, "must be");
-  guarantee(_dep_context == DependencyContext::EMPTY, "must be");
+  guarantee(_dep_context == NULL, "must be");
   guarantee(_osr_nmethods_head == NULL, "must be");
 
 #if INCLUDE_JVMTI
@@ -2479,7 +2490,7 @@
     FreeHeap(jmeths);
   }
 
-  assert(_dep_context == DependencyContext::EMPTY,
+  assert(_dep_context == NULL,
          "dependencies should already be cleaned");
 
 #if INCLUDE_JVMTI
@@ -3106,7 +3117,6 @@
   st->cr();
 
   if (is_interface()) {
-    MutexLocker ml(Compile_lock);
     st->print_cr(BULLET"nof implementors:  %d", nof_implementors());
     if (nof_implementors() == 1) {
       st->print_cr(BULLET"implementor:    ");
@@ -3514,9 +3524,6 @@
     guarantee(sib->super() == super, "siblings should have same superklass");
   }
 
-  // Verify implementor fields requires the Compile_lock, but this is sometimes
-  // called inside a safepoint, so don't verify.
-
   // Verify local interfaces
   if (local_interfaces()) {
     Array<InstanceKlass*>* local_interfaces = this->local_interfaces();
--- a/src/hotspot/share/oops/instanceKlass.hpp	Thu Dec 06 12:18:29 2018 +0100
+++ b/src/hotspot/share/oops/instanceKlass.hpp	Mon Dec 10 10:20:31 2018 +0000
@@ -69,6 +69,7 @@
 class jniIdMapBase;
 class JNIid;
 class JvmtiCachedClassFieldMap;
+class nmethodBucket;
 class SuperTypeClosure;
 
 // This is used in iterators below.
@@ -249,7 +250,8 @@
   OopMapCache*    volatile _oop_map_cache;   // OopMapCache for all methods in the klass (allocated lazily)
   JNIid*          _jni_ids;              // First JNI identifier for static fields in this class
   jmethodID*      volatile _methods_jmethod_ids;  // jmethodIDs corresponding to method_idnum, or NULL if none
-  intptr_t        _dep_context;          // packed DependencyContext structure
+  nmethodBucket*  volatile _dep_context;          // packed DependencyContext structure
+  uint64_t        volatile _dep_context_last_cleaned;
   nmethod*        _osr_nmethods_head;    // Head of list of on-stack replacement nmethods for this class
 #if INCLUDE_JVMTI
   BreakpointInfo* _breakpoints;          // bpt lists, managed by Method*
@@ -976,7 +978,8 @@
   inline DependencyContext dependencies();
   int  mark_dependent_nmethods(KlassDepChange& changes);
   void add_dependent_nmethod(nmethod* nm);
-  void remove_dependent_nmethod(nmethod* nm, bool delete_immediately);
+  void remove_dependent_nmethod(nmethod* nm);
+  void clean_dependency_context();
 
   // On-stack replacement support
   nmethod* osr_nmethods_head() const         { return _osr_nmethods_head; };
@@ -1092,9 +1095,9 @@
                      nonstatic_oop_map_count());
   }
 
-  Klass** adr_implementor() const {
+  Klass* volatile* adr_implementor() const {
     if (is_interface()) {
-      return (Klass**)end_of_nonstatic_oop_maps();
+      return (Klass* volatile*)end_of_nonstatic_oop_maps();
     } else {
       return NULL;
     }
@@ -1102,7 +1105,7 @@
 
   InstanceKlass** adr_unsafe_anonymous_host() const {
     if (is_unsafe_anonymous()) {
-      InstanceKlass** adr_impl = (InstanceKlass **)adr_implementor();
+      InstanceKlass** adr_impl = (InstanceKlass**)adr_implementor();
       if (adr_impl != NULL) {
         return adr_impl + 1;
       } else {
@@ -1120,7 +1123,7 @@
         return (address)(adr_host + 1);
       }
 
-      Klass** adr_impl = adr_implementor();
+      Klass* volatile* adr_impl = adr_implementor();
       if (adr_impl != NULL) {
         return (address)(adr_impl + 1);
       }
--- a/src/hotspot/share/oops/klass.cpp	Thu Dec 06 12:18:29 2018 +0100
+++ b/src/hotspot/share/oops/klass.cpp	Mon Dec 10 10:20:31 2018 +0000
@@ -121,7 +121,7 @@
   Klass *r = this;
   while( r->is_abstract() ) {   // Receiver is abstract?
     Klass *s = r->subklass();   // Check for exactly 1 subklass
-    if( !s || s->next_sibling() ) // Oops; wrong count; give up
+    if (s == NULL || s->next_sibling() != NULL) // Oops; wrong count; give up
       return this;              // Return 'this' as a no-progress flag
     r = s;                    // Loop till find concrete class
   }
@@ -362,22 +362,71 @@
 }
 
 
+// superklass links
 InstanceKlass* Klass::superklass() const {
   assert(super() == NULL || super()->is_instance_klass(), "must be instance klass");
   return _super == NULL ? NULL : InstanceKlass::cast(_super);
 }
 
+// subklass links.  Used by the compiler (and vtable initialization)
+// May be cleaned concurrently, so must use the Compile_lock.
+// The log parameter is for clean_weak_klass_links to report unlinked classes.
+Klass* Klass::subklass(bool log) const {
+  // Need load_acquire on the _subklass, because it races with inserts that
+  // publishes freshly initialized data.
+  for (Klass* chain = OrderAccess::load_acquire(&_subklass);
+       chain != NULL;
+       // Do not need load_acquire on _next_sibling, because inserts never
+       // create _next_sibling edges to dead data.
+       chain = Atomic::load(&chain->_next_sibling))
+  {
+    if (chain->is_loader_alive()) {
+      return chain;
+    } else if (log) {
+      if (log_is_enabled(Trace, class, unload)) {
+        ResourceMark rm;
+        log_trace(class, unload)("unlinking class (subclass): %s", chain->external_name());
+      }
+    }
+  }
+  return NULL;
+}
+
+Klass* Klass::next_sibling(bool log) const {
+  // Do not need load_acquire on _next_sibling, because inserts never
+  // create _next_sibling edges to dead data.
+  for (Klass* chain = Atomic::load(&_next_sibling);
+       chain != NULL;
+       chain = Atomic::load(&chain->_next_sibling)) {
+    // Only return alive klass, there may be stale klass
+    // in this chain if cleaned concurrently.
+    if (chain->is_loader_alive()) {
+      return chain;
+    } else if (log) {
+      if (log_is_enabled(Trace, class, unload)) {
+        ResourceMark rm;
+        log_trace(class, unload)("unlinking class (sibling): %s", chain->external_name());
+      }
+    }
+  }
+  return NULL;
+}
+
 void Klass::set_subklass(Klass* s) {
   assert(s != this, "sanity check");
-  _subklass = s;
+  OrderAccess::release_store(&_subklass, s);
 }
 
 void Klass::set_next_sibling(Klass* s) {
   assert(s != this, "sanity check");
-  _next_sibling = s;
+  // Does not need release semantics. If used by cleanup, it will link to
+  // already safely published data, and if used by inserts, will be published
+  // safely using cmpxchg.
+  Atomic::store(s, &_next_sibling);
 }
 
 void Klass::append_to_sibling_list() {
+  assert_locked_or_safepoint(Compile_lock);
   debug_only(verify();)
   // add ourselves to superklass' subklass list
   InstanceKlass* super = superklass();
@@ -385,16 +434,39 @@
   assert((!super->is_interface()    // interfaces cannot be supers
           && (super->superklass() == NULL || !is_interface())),
          "an interface can only be a subklass of Object");
-  Klass* prev_first_subklass = super->subklass();
-  if (prev_first_subklass != NULL) {
-    // set our sibling to be the superklass' previous first subklass
-    set_next_sibling(prev_first_subklass);
+
+  // Make sure there is no stale subklass head
+  super->clean_subklass();
+
+  for (;;) {
+    Klass* prev_first_subklass = OrderAccess::load_acquire(&_super->_subklass);
+    if (prev_first_subklass != NULL) {
+      // set our sibling to be the superklass' previous first subklass
+      assert(prev_first_subklass->is_loader_alive(), "May not attach not alive klasses");
+      set_next_sibling(prev_first_subklass);
+    }
+    // Note that the prev_first_subklass is always alive, meaning no sibling_next links
+    // are ever created to not alive klasses. This is an important invariant of the lock-free
+    // cleaning protocol, that allows us to safely unlink dead klasses from the sibling list.
+    if (Atomic::cmpxchg(this, &super->_subklass, prev_first_subklass) == prev_first_subklass) {
+      return;
+    }
   }
-  // make ourselves the superklass' first subklass
-  super->set_subklass(this);
   debug_only(verify();)
 }
 
+void Klass::clean_subklass() {
+  for (;;) {
+    // Need load_acquire, due to contending with concurrent inserts
+    Klass* subklass = OrderAccess::load_acquire(&_subklass);
+    if (subklass == NULL || subklass->is_loader_alive()) {
+      return;
+    }
+    // Try to fix _subklass until it points at something not dead.
+    Atomic::cmpxchg(subklass->next_sibling(), &_subklass, subklass);
+  }
+}
+
 oop Klass::holder_phantom() const {
   return class_loader_data()->holder_phantom();
 }
@@ -414,30 +486,14 @@
     assert(current->is_loader_alive(), "just checking, this should be live");
 
     // Find and set the first alive subklass
-    Klass* sub = current->subklass();
-    while (sub != NULL && !sub->is_loader_alive()) {
-#ifndef PRODUCT
-      if (log_is_enabled(Trace, class, unload)) {
-        ResourceMark rm;
-        log_trace(class, unload)("unlinking class (subclass): %s", sub->external_name());
-      }
-#endif
-      sub = sub->next_sibling();
-    }
-    current->set_subklass(sub);
+    Klass* sub = current->subklass(true);
+    current->clean_subklass();
     if (sub != NULL) {
       stack.push(sub);
     }
 
     // Find and set the first alive sibling
-    Klass* sibling = current->next_sibling();
-    while (sibling != NULL && !sibling->is_loader_alive()) {
-      if (log_is_enabled(Trace, class, unload)) {
-        ResourceMark rm;
-        log_trace(class, unload)("[Unlinking class (sibling) %s]", sibling->external_name());
-      }
-      sibling = sibling->next_sibling();
-    }
+    Klass* sibling = current->next_sibling(true);
     current->set_next_sibling(sibling);
     if (sibling != NULL) {
       stack.push(sibling);
@@ -470,8 +526,8 @@
     it->push(&_primary_supers[i]);
   }
   it->push(&_super);
-  it->push(&_subklass);
-  it->push(&_next_sibling);
+  it->push((Klass**)&_subklass);
+  it->push((Klass**)&_next_sibling);
   it->push(&_next_link);
 
   vtableEntry* vt = start_of_vtable();
--- a/src/hotspot/share/oops/klass.hpp	Thu Dec 06 12:18:29 2018 +0100
+++ b/src/hotspot/share/oops/klass.hpp	Mon Dec 10 10:20:31 2018 +0000
@@ -140,9 +140,9 @@
   // Superclass
   Klass*      _super;
   // First subclass (NULL if none); _subklass->next_sibling() is next one
-  Klass*      _subklass;
+  Klass* volatile _subklass;
   // Sibling link (or NULL); links all subklasses of a klass
-  Klass*      _next_sibling;
+  Klass* volatile _next_sibling;
 
   // All klasses loaded by a class loader are chained through these links
   Klass*      _next_link;
@@ -284,8 +284,9 @@
   // Use InstanceKlass::contains_field_offset to classify field offsets.
 
   // sub/superklass links
-  Klass* subklass() const              { return _subklass; }
-  Klass* next_sibling() const          { return _next_sibling; }
+  Klass* subklass(bool log = false) const;
+  Klass* next_sibling(bool log = false) const;
+
   InstanceKlass* superklass() const;
   void append_to_sibling_list();           // add newly created receiver to superklass' subklass list
 
@@ -659,6 +660,8 @@
   // be used safely.
   oop holder_phantom() const;
 
+  void clean_subklass();
+
   static void clean_weak_klass_links(bool unloading_occurred, bool clean_alive_klasses = true);
   static void clean_subklass_tree() {
     clean_weak_klass_links(/*unloading_occurred*/ true , /* clean_alive_klasses */ false);
--- a/src/hotspot/share/opto/vectornode.hpp	Thu Dec 06 12:18:29 2018 +0100
+++ b/src/hotspot/share/opto/vectornode.hpp	Mon Dec 10 10:20:31 2018 +0000
@@ -553,6 +553,7 @@
   LoadVectorNode(Node* c, Node* mem, Node* adr, const TypePtr* at, const TypeVect* vt, ControlDependency control_dependency = LoadNode::DependsOnlyOnTest)
     : LoadNode(c, mem, adr, at, vt, MemNode::unordered, control_dependency) {
     init_class_id(Class_LoadVector);
+    set_mismatched_access();
   }
 
   const TypeVect* vect_type() const { return type()->is_vect(); }
@@ -581,6 +582,7 @@
     : StoreNode(c, mem, adr, at, val, MemNode::unordered) {
     assert(val->is_Vector() || val->is_LoadVector(), "sanity");
     init_class_id(Class_StoreVector);
+    set_mismatched_access();
   }
 
   const TypeVect* vect_type() const { return in(MemNode::ValueIn)->bottom_type()->is_vect(); }
--- a/src/hotspot/share/prims/jvm.cpp	Thu Dec 06 12:18:29 2018 +0100
+++ b/src/hotspot/share/prims/jvm.cpp	Mon Dec 10 10:20:31 2018 +0000
@@ -354,19 +354,37 @@
 
 #define PUTPROP(props, name, value) set_property((props), (name), (value), CHECK_(properties));
 
-
-JVM_ENTRY(jobject, JVM_InitProperties(JNIEnv *env, jobject properties))
-  JVMWrapper("JVM_InitProperties");
-  ResourceMark rm;
-
-  Handle props(THREAD, JNIHandles::resolve_non_null(properties));
-
-  // System property list includes both user set via -D option and
-  // jvm system specific properties.
-  for (SystemProperty* p = Arguments::system_properties(); p != NULL; p = p->next()) {
-    if (strcmp(p->key(), "sun.nio.MaxDirectMemorySize") == 0)  // Can not be defined with -D
-      continue;
-    PUTPROP(props, p->key(), p->value());
+/*
+ * Return all of the system properties in a Java String array with alternating
+ * names and values from the jvm SystemProperty.
+ * Which includes some internal and all commandline -D defined properties.
+ */
+JVM_ENTRY(jobjectArray, JVM_GetProperties(JNIEnv *env))
+  JVMWrapper("JVM_GetProperties");
+  ResourceMark rm(THREAD);
+  HandleMark hm(THREAD);
+  int ndx = 0;
+  int fixedCount = 2;
+
+  SystemProperty* p = Arguments::system_properties();
+  int count = Arguments::PropertyList_count(p);
+
+  // Allocate result String array
+  InstanceKlass* ik = SystemDictionary::String_klass();
+  objArrayOop r = oopFactory::new_objArray(ik, (count + fixedCount) * 2, CHECK_NULL);
+  objArrayHandle result_h(THREAD, r);
+
+  while (p != NULL) {
+    const char * key = p->key();
+    if (strcmp(key, "sun.nio.MaxDirectMemorySize") != 0) {
+        const char * value = p->value();
+        Handle key_str    = java_lang_String::create_from_platform_dependent_str(key, CHECK_NULL);
+        Handle value_str  = java_lang_String::create_from_platform_dependent_str((value != NULL ? value : ""), CHECK_NULL);
+        result_h->obj_at_put(ndx * 2,  key_str());
+        result_h->obj_at_put(ndx * 2 + 1, value_str());
+        ndx++;
+    }
+    p = p->next();
   }
 
   // Convert the -XX:MaxDirectMemorySize= command line flag
@@ -377,7 +395,11 @@
   if (!FLAG_IS_DEFAULT(MaxDirectMemorySize)) {
     char as_chars[256];
     jio_snprintf(as_chars, sizeof(as_chars), JULONG_FORMAT, MaxDirectMemorySize);
-    PUTPROP(props, "sun.nio.MaxDirectMemorySize", as_chars);
+    Handle key_str = java_lang_String::create_from_platform_dependent_str("sun.nio.MaxDirectMemorySize", CHECK_NULL);
+    Handle value_str  = java_lang_String::create_from_platform_dependent_str(as_chars, CHECK_NULL);
+    result_h->obj_at_put(ndx * 2,  key_str());
+    result_h->obj_at_put(ndx * 2 + 1, value_str());
+    ndx++;
   }
 
   // JVM monitoring and management support
@@ -406,11 +428,15 @@
 
     if (*compiler_name != '\0' &&
         (Arguments::mode() != Arguments::_int)) {
-      PUTPROP(props, "sun.management.compiler", compiler_name);
+      Handle key_str = java_lang_String::create_from_platform_dependent_str("sun.management.compiler", CHECK_NULL);
+      Handle value_str  = java_lang_String::create_from_platform_dependent_str(compiler_name, CHECK_NULL);
+      result_h->obj_at_put(ndx * 2,  key_str());
+      result_h->obj_at_put(ndx * 2 + 1, value_str());
+      ndx++;
     }
   }
 
-  return properties;
+  return (jobjectArray) JNIHandles::make_local(env, result_h());
 JVM_END
 
 
--- a/src/hotspot/share/prims/methodHandles.cpp	Thu Dec 06 12:18:29 2018 +0100
+++ b/src/hotspot/share/prims/methodHandles.cpp	Mon Dec 10 10:20:31 2018 +0000
@@ -1064,14 +1064,6 @@
   return rfill + overflow;
 }
 
-// Is it safe to remove stale entries from a dependency list?
-static bool safe_to_expunge() {
-  // Since parallel GC threads can concurrently iterate over a dependency
-  // list during safepoint, it is safe to remove entries only when
-  // CodeCache lock is held.
-  return CodeCache_lock->owned_by_self();
-}
-
 void MethodHandles::add_dependent_nmethod(oop call_site, nmethod* nm) {
   assert_locked_or_safepoint(CodeCache_lock);
 
@@ -1082,7 +1074,7 @@
   // in order to avoid memory leak, stale entries are purged whenever a dependency list
   // is changed (both on addition and removal). Though memory reclamation is delayed,
   // it avoids indefinite memory usage growth.
-  deps.add_dependent_nmethod(nm, /*expunge_stale_entries=*/safe_to_expunge());
+  deps.add_dependent_nmethod(nm);
 }
 
 void MethodHandles::remove_dependent_nmethod(oop call_site, nmethod* nm) {
@@ -1090,7 +1082,13 @@
 
   oop context = java_lang_invoke_CallSite::context_no_keepalive(call_site);
   DependencyContext deps = java_lang_invoke_MethodHandleNatives_CallSiteContext::vmdependencies(context);
-  deps.remove_dependent_nmethod(nm, /*expunge_stale_entries=*/safe_to_expunge());
+  deps.remove_dependent_nmethod(nm);
+}
+
+void MethodHandles::clean_dependency_context(oop call_site) {
+  oop context = java_lang_invoke_CallSite::context_no_keepalive(call_site);
+  DependencyContext deps = java_lang_invoke_MethodHandleNatives_CallSiteContext::vmdependencies(context);
+  deps.clean_unloading_dependents();
 }
 
 void MethodHandles::flush_dependent_nmethods(Handle call_site, Handle target) {
@@ -1500,7 +1498,6 @@
     {
       NoSafepointVerifier nsv;
       MutexLockerEx mu2(CodeCache_lock, Mutex::_no_safepoint_check_flag);
-      assert(safe_to_expunge(), "removal is not safe");
       DependencyContext deps = java_lang_invoke_MethodHandleNatives_CallSiteContext::vmdependencies(context());
       marked = deps.remove_all_dependents();
     }
--- a/src/hotspot/share/prims/methodHandles.hpp	Thu Dec 06 12:18:29 2018 +0100
+++ b/src/hotspot/share/prims/methodHandles.hpp	Mon Dec 10 10:20:31 2018 +0000
@@ -79,6 +79,7 @@
   // CallSite support
   static void add_dependent_nmethod(oop call_site, nmethod* nm);
   static void remove_dependent_nmethod(oop call_site, nmethod* nm);
+  static void clean_dependency_context(oop call_site);
 
   static void flush_dependent_nmethods(Handle call_site, Handle target);
 
--- a/src/hotspot/share/runtime/globals.hpp	Thu Dec 06 12:18:29 2018 +0100
+++ b/src/hotspot/share/runtime/globals.hpp	Mon Dec 10 10:20:31 2018 +0000
@@ -723,6 +723,9 @@
           "Print the code cache memory usage each time a method is "        \
           "compiled")                                                       \
                                                                             \
+  diagnostic(bool, PrintCodeHeapAnalytics, false,                           \
+          "Print code heap usage statistics on exit and on full condition") \
+                                                                            \
   diagnostic(bool, PrintStubCode, false,                                    \
           "Print generated stub code")                                      \
                                                                             \
@@ -2585,7 +2588,7 @@
   develop(bool, VerifyMetaspace, false,                                     \
           "Verify metaspace on chunk movements.")                           \
                                                                             \
-  diagnostic(bool, ShowRegistersOnAssert, false,                            \
+  diagnostic(bool, ShowRegistersOnAssert, true,                             \
           "On internal errors, include registers in error report.")         \
                                                                             \
   experimental(bool, UseSwitchProfiling, true,                              \
--- a/src/hotspot/share/runtime/java.cpp	Thu Dec 06 12:18:29 2018 +0100
+++ b/src/hotspot/share/runtime/java.cpp	Mon Dec 10 10:20:31 2018 +0000
@@ -318,8 +318,7 @@
 
   // CodeHeap State Analytics.
   // Does also call NMethodSweeper::print(tty)
-  LogTarget(Trace, codecache) lt;
-  if (lt.is_enabled()) {
+  if (PrintCodeHeapAnalytics) {
     CompileBroker::print_heapinfo(NULL, "all", "4096"); // details
   } else if (PrintMethodFlushingStatistics) {
     NMethodSweeper::print(tty);
@@ -387,8 +386,7 @@
 
   // CodeHeap State Analytics.
   // Does also call NMethodSweeper::print(tty)
-  LogTarget(Trace, codecache) lt;
-  if (lt.is_enabled()) {
+  if (PrintCodeHeapAnalytics) {
     CompileBroker::print_heapinfo(NULL, "all", "4096"); // details
   } else if (PrintMethodFlushingStatistics) {
     NMethodSweeper::print(tty);
--- a/src/hotspot/share/runtime/thread.cpp	Thu Dec 06 12:18:29 2018 +0100
+++ b/src/hotspot/share/runtime/thread.cpp	Mon Dec 10 10:20:31 2018 +0000
@@ -3902,6 +3902,9 @@
   // may be attached late and JVMTI must track phases of VM execution
   JvmtiExport::enter_live_phase();
 
+  // Make perfmemory accessible
+  PerfMemory::set_accessible(true);
+
   // Notify JVMTI agents that VM initialization is complete - nop if no agents.
   JvmtiExport::post_vm_initialized();
 
--- a/src/hotspot/share/runtime/vmStructs.cpp	Thu Dec 06 12:18:29 2018 +0100
+++ b/src/hotspot/share/runtime/vmStructs.cpp	Mon Dec 10 10:20:31 2018 +0000
@@ -259,12 +259,12 @@
   nonstatic_field(Klass,                       _java_mirror,                                  OopHandle)                             \
   nonstatic_field(Klass,                       _modifier_flags,                               jint)                                  \
   nonstatic_field(Klass,                       _super,                                        Klass*)                                \
-  nonstatic_field(Klass,                       _subklass,                                     Klass*)                                \
+  volatile_nonstatic_field(Klass,              _subklass,                                     Klass*)                                 \
   nonstatic_field(Klass,                       _layout_helper,                                jint)                                  \
   nonstatic_field(Klass,                       _name,                                         Symbol*)                               \
   nonstatic_field(Klass,                       _access_flags,                                 AccessFlags)                           \
   nonstatic_field(Klass,                       _prototype_header,                             markOop)                               \
-  nonstatic_field(Klass,                       _next_sibling,                                 Klass*)                                \
+  volatile_nonstatic_field(Klass,              _next_sibling,                                 Klass*)                                \
   nonstatic_field(Klass,                       _next_link,                                    Klass*)                                \
   nonstatic_field(Klass,                       _vtable_len,                                   int)                                   \
   nonstatic_field(Klass,                       _class_loader_data,                            ClassLoaderData*)                      \
--- a/src/java.base/aix/classes/sun/nio/fs/AixFileSystemProvider.java	Thu Dec 06 12:18:29 2018 +0100
+++ b/src/java.base/aix/classes/sun/nio/fs/AixFileSystemProvider.java	Mon Dec 10 10:20:31 2018 +0000
@@ -32,7 +32,7 @@
  * AIX implementation of FileSystemProvider
  */
 
-public class AixFileSystemProvider extends UnixFileSystemProvider {
+class AixFileSystemProvider extends UnixFileSystemProvider {
     public AixFileSystemProvider() {
         super();
     }
--- a/src/java.base/aix/classes/sun/nio/fs/DefaultFileSystemProvider.java	Thu Dec 06 12:18:29 2018 +0100
+++ b/src/java.base/aix/classes/sun/nio/fs/DefaultFileSystemProvider.java	Mon Dec 10 10:20:31 2018 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,19 +25,29 @@
 
 package sun.nio.fs;
 
-import java.nio.file.spi.FileSystemProvider;
+import java.nio.file.FileSystem;
 
 /**
  * Creates this platform's default FileSystemProvider.
  */
 
 public class DefaultFileSystemProvider {
+    private static final AixFileSystemProvider INSTANCE
+        = new AixFileSystemProvider();
+
     private DefaultFileSystemProvider() { }
 
     /**
-     * Returns the default FileSystemProvider.
+     * Returns the platform's default file system provider.
      */
-    public static FileSystemProvider create() {
-        return new AixFileSystemProvider();
+    public static AixFileSystemProvider instance() {
+        return INSTANCE;
+    }
+
+    /**
+     * Returns the platform's default file system.
+     */
+    public static FileSystem theFileSystem() {
+        return INSTANCE.theFileSystem();
     }
 }
--- a/src/java.base/linux/classes/sun/nio/fs/DefaultFileSystemProvider.java	Thu Dec 06 12:18:29 2018 +0100
+++ b/src/java.base/linux/classes/sun/nio/fs/DefaultFileSystemProvider.java	Mon Dec 10 10:20:31 2018 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,19 +25,29 @@
 
 package sun.nio.fs;
 
-import java.nio.file.spi.FileSystemProvider;
+import java.nio.file.FileSystem;
 
 /**
  * Creates this platform's default FileSystemProvider.
  */
 
 public class DefaultFileSystemProvider {
+    private static final LinuxFileSystemProvider INSTANCE
+        = new LinuxFileSystemProvider();
+
     private DefaultFileSystemProvider() { }
 
     /**
-     * Returns the default FileSystemProvider.
+     * Returns the platform's default file system provider.
      */
-    public static FileSystemProvider create() {
-        return new LinuxFileSystemProvider();
+    public static LinuxFileSystemProvider instance() {
+        return INSTANCE;
+    }
+
+    /**
+     * Returns the platform's default file system.
+     */
+    public static FileSystem theFileSystem() {
+        return INSTANCE.theFileSystem();
     }
 }
--- a/src/java.base/linux/classes/sun/nio/fs/LinuxFileSystemProvider.java	Thu Dec 06 12:18:29 2018 +0100
+++ b/src/java.base/linux/classes/sun/nio/fs/LinuxFileSystemProvider.java	Mon Dec 10 10:20:31 2018 +0000
@@ -36,7 +36,7 @@
  * Linux implementation of FileSystemProvider
  */
 
-public class LinuxFileSystemProvider extends UnixFileSystemProvider {
+class LinuxFileSystemProvider extends UnixFileSystemProvider {
     public LinuxFileSystemProvider() {
         super();
     }
--- a/src/java.base/macosx/classes/sun/nio/fs/BsdFileSystemProvider.java	Thu Dec 06 12:18:29 2018 +0100
+++ b/src/java.base/macosx/classes/sun/nio/fs/BsdFileSystemProvider.java	Mon Dec 10 10:20:31 2018 +0000
@@ -31,7 +31,7 @@
  * Bsd implementation of FileSystemProvider
  */
 
-public class BsdFileSystemProvider extends UnixFileSystemProvider {
+class BsdFileSystemProvider extends UnixFileSystemProvider {
     public BsdFileSystemProvider() {
         super();
     }
--- a/src/java.base/macosx/classes/sun/nio/fs/DefaultFileSystemProvider.java	Thu Dec 06 12:18:29 2018 +0100
+++ b/src/java.base/macosx/classes/sun/nio/fs/DefaultFileSystemProvider.java	Mon Dec 10 10:20:31 2018 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,19 +25,29 @@
 
 package sun.nio.fs;
 
-import java.nio.file.spi.FileSystemProvider;
+import java.nio.file.FileSystem;
 
 /**
  * Creates this platform's default FileSystemProvider.
  */
 
 public class DefaultFileSystemProvider {
+    private static final MacOSXFileSystemProvider INSTANCE
+        = new MacOSXFileSystemProvider();
+
     private DefaultFileSystemProvider() { }
 
     /**
-     * Returns the default FileSystemProvider.
+     * Returns the platform's default file system provider.
      */
-    public static FileSystemProvider create() {
-        return new MacOSXFileSystemProvider();
+    public static MacOSXFileSystemProvider instance() {
+        return INSTANCE;
+    }
+
+    /**
+     * Returns the platform's default file system.
+     */
+    public static FileSystem theFileSystem() {
+        return INSTANCE.theFileSystem();
     }
 }
--- a/src/java.base/macosx/classes/sun/nio/fs/MacOSXFileSystemProvider.java	Thu Dec 06 12:18:29 2018 +0100
+++ b/src/java.base/macosx/classes/sun/nio/fs/MacOSXFileSystemProvider.java	Mon Dec 10 10:20:31 2018 +0000
@@ -34,7 +34,7 @@
  * MacOSX implementation of FileSystemProvider
  */
 
-public class MacOSXFileSystemProvider extends BsdFileSystemProvider {
+class MacOSXFileSystemProvider extends BsdFileSystemProvider {
     public MacOSXFileSystemProvider() {
         super();
     }
--- a/src/java.base/macosx/native/libjava/java_props_macosx.c	Thu Dec 06 12:18:29 2018 +0100
+++ b/src/java.base/macosx/native/libjava/java_props_macosx.c	Mon Dec 10 10:20:31 2018 +0000
@@ -416,14 +416,12 @@
     cf_httpHost = NULL,
     cf_httpsHost = NULL,
     cf_ftpHost = NULL,
-    cf_socksHost = NULL,
-    cf_gopherHost = NULL;
+    cf_socksHost = NULL;
     int
     httpPort = 80, // Default proxy port values
     httpsPort = 443,
     ftpPort = 21,
-    socksPort = 1080,
-    gopherPort = 70;
+    socksPort = 1080;
 
     CFDictionaryRef dict = SCDynamicStoreCopyProxies(NULL);
     if (dict == NULL) return;
@@ -479,7 +477,6 @@
     CHECK_PROXY(https, HTTPS);
     CHECK_PROXY(ftp, FTP);
     CHECK_PROXY(socks, SOCKS);
-    CHECK_PROXY(gopher, Gopher);
 
 #undef CHECK_PROXY
 
--- a/src/java.base/macosx/native/libjli/java_md_macosx.m	Thu Dec 06 12:18:29 2018 +0100
+++ b/src/java.base/macosx/native/libjli/java_md_macosx.m	Mon Dec 10 10:20:31 2018 +0000
@@ -508,7 +508,7 @@
         return JNI_FALSE;
     }
 
-    const char lastPathComponent[] = "/lib/jli/libjli.dylib";
+    const char lastPathComponent[] = "/lib/libjli.dylib";
     size_t sizeOfLastPathComponent = sizeof(lastPathComponent) - 1;
     if (pathLen < sizeOfLastPathComponent) {
         return JNI_FALSE;
--- a/src/java.base/share/classes/com/sun/crypto/provider/PBES2Parameters.java	Thu Dec 06 12:18:29 2018 +0100
+++ b/src/java.base/share/classes/com/sun/crypto/provider/PBES2Parameters.java	Mon Dec 10 10:20:31 2018 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,7 +26,6 @@
 package com.sun.crypto.provider;
 
 import java.io.*;
-import java.math.BigInteger;
 import java.security.NoSuchAlgorithmException;
 import java.security.AlgorithmParametersSpi;
 import java.security.spec.AlgorithmParameterSpec;
@@ -264,7 +263,20 @@
             throw new IOException("PBE parameter parsing error: "
                 + "not an ASN.1 SEQUENCE tag");
         }
-        kdfAlgo = parseKDF(pBES2_params.data.getDerValue());
+        DerValue kdf = pBES2_params.data.getDerValue();
+
+        // Before JDK-8202837, PBES2-params was mistakenly encoded like
+        // an AlgorithmId which is a sequence of its own OID and the real
+        // PBES2-params. If the first DerValue is an OID instead of a
+        // PBES2-KDFs (which should be a SEQUENCE), we are likely to be
+        // dealing with this buggy encoding. Skip the OID and treat the
+        // next DerValue as the real PBES2-params.
+        if (kdf.getTag() == DerValue.tag_ObjectId) {
+            pBES2_params = pBES2_params.data.getDerValue();
+            kdf = pBES2_params.data.getDerValue();
+        }
+
+        kdfAlgo = parseKDF(kdf);
 
         if (pBES2_params.tag != DerValue.tag_Sequence) {
             throw new IOException("PBE parameter parsing error: "
--- a/src/java.base/share/classes/java/io/FilePermission.java	Thu Dec 06 12:18:29 2018 +0100
+++ b/src/java.base/share/classes/java/io/FilePermission.java	Mon Dec 10 10:20:31 2018 +0000
@@ -25,7 +25,6 @@
 
 package java.io;
 
-import java.net.URI;
 import java.nio.file.*;
 import java.security.*;
 import java.util.Enumeration;
@@ -199,12 +198,11 @@
     private static final long serialVersionUID = 7930732926638008763L;
 
     /**
-     * Always use the internal default file system, in case it was modified
-     * with java.nio.file.spi.DefaultFileSystemProvider.
+     * Use the platform's default file system to avoid recursive initialization
+     * issues when the VM is configured to use a custom file system provider.
      */
     private static final java.nio.file.FileSystem builtInFS =
-            DefaultFileSystemProvider.create()
-                    .getFileSystem(URI.create("file:///"));
+        DefaultFileSystemProvider.theFileSystem();
 
     private static final Path here = builtInFS.getPath(
             GetPropertyAction.privilegedGetProperty("user.dir"));
@@ -326,7 +324,7 @@
 
             if (name.equals("<<ALL FILES>>")) {
                 allFiles = true;
-                npath = builtInFS.getPath("");
+                npath = EMPTY_PATH;
                 // other fields remain default
                 return;
             }
@@ -351,7 +349,7 @@
                     npath = npath.getParent();
                 }
                 if (npath == null) {
-                    npath = builtInFS.getPath("");
+                    npath = EMPTY_PATH;
                 }
                 invalid = false;
             } catch (InvalidPathException ipe) {
--- a/src/java.base/share/classes/java/lang/System.java	Thu Dec 06 12:18:29 2018 +0100
+++ b/src/java.base/share/classes/java/lang/System.java	Mon Dec 10 10:20:31 2018 +0000
@@ -72,6 +72,7 @@
 import jdk.internal.logger.LoggerFinderLoader;
 import jdk.internal.logger.LazyLoggers;
 import jdk.internal.logger.LocalizedLoggerWrapper;
+import jdk.internal.util.SystemProps;
 import jdk.internal.vm.annotation.Stable;
 import sun.reflect.annotation.AnnotationType;
 import sun.nio.ch.Interruptible;
@@ -605,7 +606,6 @@
      */
 
     private static Properties props;
-    private static native Properties initProperties(Properties props);
 
     /**
      * Determines the current system properties.
@@ -799,9 +799,9 @@
         if (sm != null) {
             sm.checkPropertiesAccess();
         }
+
         if (props == null) {
-            props = new Properties();
-            initProperties(props);
+            props = SystemProps.initProperties();
             VersionProps.init(props);
         }
         System.props = props;
@@ -1966,15 +1966,11 @@
 
         // VM might invoke JNU_NewStringPlatform() to set those encoding
         // sensitive properties (user.home, user.name, boot.class.path, etc.)
-        // during "props" initialization, in which it may need access, via
-        // System.getProperty(), to the related system encoding property that
-        // have been initialized (put into "props") at early stage of the
-        // initialization. So make sure the "props" is available at the
-        // very beginning of the initialization and all system properties to
-        // be put into it directly.
-        props = new Properties(84);
-        initProperties(props);  // initialized by the VM
+        // during "props" initialization.
+        // The charset is initialized in System.c and does not depend on the Properties.
+        props = SystemProps.initProperties();
         VersionProps.init(props);
+        StaticProperty.javaHome();          // Load StaticProperty to cache the property values
 
         // There are certain system configurations that may be controlled by
         // VM options such as the maximum amount of direct memory and
@@ -1993,7 +1989,6 @@
         VM.saveAndRemoveProperties(props);
 
         lineSeparator = props.getProperty("line.separator");
-        StaticProperty.javaHome();          // Load StaticProperty to cache the property values
 
         FileInputStream fdIn = new FileInputStream(FileDescriptor.in);
         FileOutputStream fdOut = new FileOutputStream(FileDescriptor.out);
--- a/src/java.base/share/classes/java/lang/VersionProps.java.template	Thu Dec 06 12:18:29 2018 +0100
+++ b/src/java.base/share/classes/java/lang/VersionProps.java.template	Mon Dec 10 10:20:31 2018 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -51,6 +51,9 @@
     private static final String VERSION_NUMBER =
         "@@VERSION_NUMBER@@";
 
+    private static final String VERSION_SPECIFICATION =
+        "@@VERSION_SPECIFICATION@@";
+
     private static final String VERSION_BUILD =
         "@@VERSION_BUILD@@";
 
@@ -63,6 +66,9 @@
     private static final boolean isLTS =
         "@@VERSION_OPT@@".startsWith("LTS");
 
+    private static final String CLASSFILE_MAJOR_MINOR =
+        "@@VERSION_CLASSFILE_MAJOR@@.@@VERSION_CLASSFILE_MINOR@@";
+
     private static final String VENDOR_VERSION_STRING =
         "@@VENDOR_VERSION_STRING@@";
 
@@ -70,6 +76,20 @@
         (VENDOR_VERSION_STRING.length() > 0
          ? " " + VENDOR_VERSION_STRING : "");
 
+    private static final String VENDOR =
+        "@@VENDOR@@";
+
+    private static final String VENDOR_URL =
+        "@@VENDOR_URL@@";
+
+    private static final String VENDOR_URL_BUG =
+        "@@VENDOR_URL_BUG@@";
+
+    /**
+     * Initialize system properties using build provided values.
+     *
+     * @param props Properties instance in which to insert the properties
+     */
     public static void init(Properties props) {
         props.setProperty("java.version", java_version);
         props.setProperty("java.version.date", java_version_date);
@@ -77,6 +97,16 @@
         props.setProperty("java.runtime.name", java_runtime_name);
         if (VENDOR_VERSION_STRING.length() > 0)
             props.setProperty("java.vendor.version", VENDOR_VERSION_STRING);
+
+        props.setProperty("java.class.version", CLASSFILE_MAJOR_MINOR);
+
+        props.setProperty("java.specification.version", VERSION_SPECIFICATION);
+        props.setProperty("java.specification.name", "Java Platform API Specification");
+        props.setProperty("java.specification.vendor", "Oracle Corporation");
+
+        props.setProperty("java.vendor", VENDOR);
+        props.setProperty("java.vendor.url", VENDOR_URL);
+        props.setProperty("java.vendor.url.bug", VENDOR_URL_BUG);
     }
 
     private static int parseVersionNumber(String version, int prevIndex, int index) {
--- a/src/java.base/share/classes/java/lang/invoke/MethodHandleNatives.java	Thu Dec 06 12:18:29 2018 +0100
+++ b/src/java.base/share/classes/java/lang/invoke/MethodHandleNatives.java	Mon Dec 10 10:20:31 2018 +0000
@@ -75,6 +75,7 @@
     /** Represents a context to track nmethod dependencies on CallSite instance target. */
     static class CallSiteContext implements Runnable {
         //@Injected JVM_nmethodBucket* vmdependencies;
+        //@Injected jlong last_cleanup;
 
         static CallSiteContext make(CallSite cs) {
             final CallSiteContext newContext = new CallSiteContext();
--- a/src/java.base/share/classes/java/nio/file/FileSystems.java	Thu Dec 06 12:18:29 2018 +0100
+++ b/src/java.base/share/classes/java/nio/file/FileSystems.java	Mon Dec 10 10:20:31 2018 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2007, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -37,6 +37,7 @@
 import java.util.ServiceLoader;
 
 import jdk.internal.misc.VM;
+import sun.nio.fs.DefaultFileSystemProvider;
 
 /**
  * Factory methods for file systems. This class defines the {@link #getDefault
@@ -88,16 +89,6 @@
 public final class FileSystems {
     private FileSystems() { }
 
-    // Built-in file system provider
-    private static final FileSystemProvider builtinFileSystemProvider =
-        sun.nio.fs.DefaultFileSystemProvider.create();
-
-    // built-in file system
-    private static class BuiltinFileSystemHolder {
-        static final FileSystem builtinFileSystem =
-            builtinFileSystemProvider.getFileSystem(URI.create("file:///"));
-    }
-
     // lazy initialization of default file system
     private static class DefaultFileSystemHolder {
         static final FileSystem defaultFileSystem = defaultFileSystem();
@@ -118,7 +109,8 @@
 
         // returns default provider
         private static FileSystemProvider getDefaultProvider() {
-            FileSystemProvider provider = builtinFileSystemProvider;
+            // start with the platform's default file system provider
+            FileSystemProvider provider = DefaultFileSystemProvider.instance();
 
             // if the property java.nio.file.spi.DefaultFileSystemProvider is
             // set then its value is the name of the default provider (or a list)
@@ -189,7 +181,8 @@
         if (VM.isModuleSystemInited()) {
             return DefaultFileSystemHolder.defaultFileSystem;
         } else {
-            return BuiltinFileSystemHolder.builtinFileSystem;
+            // always use the platform's default file system during startup
+            return DefaultFileSystemProvider.theFileSystem();
         }
     }
 
--- a/src/java.base/share/classes/java/util/ArrayDeque.java	Thu Dec 06 12:18:29 2018 +0100
+++ b/src/java.base/share/classes/java/util/ArrayDeque.java	Mon Dec 10 10:20:31 2018 +0000
@@ -37,7 +37,6 @@
 import java.io.Serializable;
 import java.util.function.Consumer;
 import java.util.function.Predicate;
-
 import jdk.internal.access.SharedSecrets;
 
 /**
--- a/src/java.base/share/classes/java/util/Date.java	Thu Dec 06 12:18:29 2018 +0100
+++ b/src/java.base/share/classes/java/util/Date.java	Mon Dec 10 10:20:31 2018 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1994, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1994, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -84,12 +84,12 @@
  * <i>not</i> adjusted for leap seconds. An interesting source of
  * further information is the United States Naval Observatory (USNO):
  * <blockquote><pre>
- *     <a href="http://www.usno.navy.mil/USNO">http://www.usno.navy.mil/USNO</a>
+ *     <a href="https://www.usno.navy.mil/USNO">https://www.usno.navy.mil/USNO</a>
  * </pre></blockquote>
  * <p>
  * and the material regarding "Systems of Time" at:
  * <blockquote><pre>
- *     <a href="http://www.usno.navy.mil/USNO/time/master-clock/systems-of-time">http://www.usno.navy.mil/USNO/time/master-clock/systems-of-time</a>
+ *     <a href="https://www.usno.navy.mil/USNO/time/master-clock/systems-of-time">https://www.usno.navy.mil/USNO/time/master-clock/systems-of-time</a>
  * </pre></blockquote>
  * <p>
  * which has descriptions of various different time systems including
--- a/src/java.base/share/classes/java/util/ResourceBundle.java	Thu Dec 06 12:18:29 2018 +0100
+++ b/src/java.base/share/classes/java/util/ResourceBundle.java	Mon Dec 10 10:20:31 2018 +0000
@@ -3184,10 +3184,16 @@
                                 bundleClass.getName() + " in " + m.toString());
                         }
                         try {
-                            // bundle in a unnamed module
-                            Constructor<ResourceBundle> ctor = bundleClass.getConstructor();
+                            Constructor<ResourceBundle> ctor = AccessController.doPrivileged(
+                                new PrivilegedExceptionAction<>() {
+                                    @Override
+                                    public Constructor<ResourceBundle> run() throws NoSuchMethodException {
+                                        return bundleClass.getDeclaredConstructor();
+                                    }
+                                });
                             if (!Modifier.isPublic(ctor.getModifiers())) {
-                                return null;
+                                throw new IllegalAccessException("no-arg constructor in " +
+                                    bundleClass.getName() + " is not publicly accessible.");
                             }
 
                             // java.base may not be able to read the bundleClass's module.
@@ -3196,12 +3202,16 @@
                             bundle = ctor.newInstance((Object[]) null);
                         } catch (InvocationTargetException e) {
                             uncheckedThrow(e);
+                        } catch (PrivilegedActionException e) {
+                            assert e.getException() instanceof NoSuchMethodException;
+                            throw new InstantiationException("public no-arg constructor " +
+                                "does not exist in " + bundleClass.getName());
                         }
                     } else {
                         throw new ClassCastException(c.getName()
                                 + " cannot be cast to ResourceBundle");
                     }
-                } catch (ClassNotFoundException|NoSuchMethodException e) {
+                } catch (ClassNotFoundException e) {
                 }
             } else if (format.equals("java.properties")) {
                 final String resourceName = toResourceName0(bundleName, "properties");
--- a/src/java.base/share/classes/java/util/concurrent/ConcurrentHashMap.java	Thu Dec 06 12:18:29 2018 +0100
+++ b/src/java.base/share/classes/java/util/concurrent/ConcurrentHashMap.java	Mon Dec 10 10:20:31 2018 +0000
@@ -2542,6 +2542,8 @@
                             setTabAt(tab, i, fwd);
                             advance = true;
                         }
+                        else if (f instanceof ReservationNode)
+                            throw new IllegalStateException("Recursive update");
                     }
                 }
             }
--- a/src/java.base/share/classes/java/util/concurrent/Exchanger.java	Thu Dec 06 12:18:29 2018 +0100
+++ b/src/java.base/share/classes/java/util/concurrent/Exchanger.java	Mon Dec 10 10:20:31 2018 +0000
@@ -564,8 +564,8 @@
         Object item = (x == null) ? NULL_ITEM : x; // translate null args
         if (((a = arena) != null ||
              (v = slotExchange(item, false, 0L)) == null) &&
-            ((Thread.interrupted() || // disambiguates null return
-              (v = arenaExchange(item, false, 0L)) == null)))
+            (Thread.interrupted() || // disambiguates null return
+             (v = arenaExchange(item, false, 0L)) == null))
             throw new InterruptedException();
         return (v == NULL_ITEM) ? null : (V)v;
     }
@@ -620,8 +620,8 @@
         long ns = unit.toNanos(timeout);
         if ((arena != null ||
              (v = slotExchange(item, true, ns)) == null) &&
-            ((Thread.interrupted() ||
-              (v = arenaExchange(item, true, ns)) == null)))
+            (Thread.interrupted() ||
+             (v = arenaExchange(item, true, ns)) == null))
             throw new InterruptedException();
         if (v == TIMED_OUT)
             throw new TimeoutException();
--- a/src/java.base/share/classes/java/util/concurrent/ForkJoinTask.java	Thu Dec 06 12:18:29 2018 +0100
+++ b/src/java.base/share/classes/java/util/concurrent/ForkJoinTask.java	Mon Dec 10 10:20:31 2018 +0000
@@ -1230,14 +1230,13 @@
     /**
      * Immediately performs the base action of this task and returns
      * true if, upon return from this method, this task is guaranteed
-     * to have completed normally. This method may return false
-     * otherwise, to indicate that this task is not necessarily
-     * complete (or is not known to be complete), for example in
-     * asynchronous actions that require explicit invocations of
-     * completion methods. This method may also throw an (unchecked)
-     * exception to indicate abnormal exit. This method is designed to
-     * support extensions, and should not in general be called
-     * otherwise.
+     * to have completed. This method may return false otherwise, to
+     * indicate that this task is not necessarily complete (or is not
+     * known to be complete), for example in asynchronous actions that
+     * require explicit invocations of completion methods. This method
+     * may also throw an (unchecked) exception to indicate abnormal
+     * exit. This method is designed to support extensions, and should
+     * not in general be called otherwise.
      *
      * @return {@code true} if this task is known to have completed normally
      */
--- a/src/java.base/share/classes/java/util/concurrent/atomic/AtomicIntegerFieldUpdater.java	Thu Dec 06 12:18:29 2018 +0100
+++ b/src/java.base/share/classes/java/util/concurrent/atomic/AtomicIntegerFieldUpdater.java	Mon Dec 10 10:20:31 2018 +0000
@@ -121,9 +121,9 @@
      * other calls to {@code compareAndSet} and {@code set}, but not
      * necessarily with respect to other changes in the field.
      *
-     * <p><a href="package-summary.html#weakCompareAndSet">May fail
-     * spuriously and does not provide ordering guarantees</a>, so is
-     * only rarely an appropriate alternative to {@code compareAndSet}.
+     * <p>This operation may fail spuriously and does not provide
+     * ordering guarantees, so is only rarely an appropriate
+     * alternative to {@code compareAndSet}.
      *
      * @param obj An object whose field to conditionally set
      * @param expect the expected value
--- a/src/java.base/share/classes/java/util/concurrent/atomic/AtomicLongFieldUpdater.java	Thu Dec 06 12:18:29 2018 +0100
+++ b/src/java.base/share/classes/java/util/concurrent/atomic/AtomicLongFieldUpdater.java	Mon Dec 10 10:20:31 2018 +0000
@@ -124,9 +124,9 @@
      * other calls to {@code compareAndSet} and {@code set}, but not
      * necessarily with respect to other changes in the field.
      *
-     * <p><a href="package-summary.html#weakCompareAndSet">May fail
-     * spuriously and does not provide ordering guarantees</a>, so is
-     * only rarely an appropriate alternative to {@code compareAndSet}.
+     * <p>This operation may fail spuriously and does not provide
+     * ordering guarantees, so is only rarely an appropriate
+     * alternative to {@code compareAndSet}.
      *
      * @param obj An object whose field to conditionally set
      * @param expect the expected value
--- a/src/java.base/share/classes/java/util/concurrent/atomic/AtomicMarkableReference.java	Thu Dec 06 12:18:29 2018 +0100
+++ b/src/java.base/share/classes/java/util/concurrent/atomic/AtomicMarkableReference.java	Mon Dec 10 10:20:31 2018 +0000
@@ -110,14 +110,12 @@
     }
 
     /**
-     * Atomically sets the value of both the reference and mark
-     * to the given update values if the
-     * current reference is {@code ==} to the expected reference
-     * and the current mark is equal to the expected mark.
-     *
-     * <p><a href="package-summary.html#weakCompareAndSet">May fail
-     * spuriously and does not provide ordering guarantees</a>, so is
-     * only rarely an appropriate alternative to {@code compareAndSet}.
+     * Atomically sets the value of both the reference and mark to the
+     * given update values if the current reference is {@code ==} to
+     * the expected reference and the current mark is equal to the
+     * expected mark. This operation may fail spuriously and does not
+     * provide ordering guarantees, so is only rarely an
+     * appropriate alternative to {@code compareAndSet}.
      *
      * @param expectedReference the expected value of the reference
      * @param newReference the new value for the reference
--- a/src/java.base/share/classes/java/util/concurrent/atomic/AtomicReferenceFieldUpdater.java	Thu Dec 06 12:18:29 2018 +0100
+++ b/src/java.base/share/classes/java/util/concurrent/atomic/AtomicReferenceFieldUpdater.java	Mon Dec 10 10:20:31 2018 +0000
@@ -143,9 +143,9 @@
      * other calls to {@code compareAndSet} and {@code set}, but not
      * necessarily with respect to other changes in the field.
      *
-     * <p><a href="package-summary.html#weakCompareAndSet">May fail
-     * spuriously and does not provide ordering guarantees</a>, so is
-     * only rarely an appropriate alternative to {@code compareAndSet}.
+     * <p>This operation may fail spuriously and does not provide
+     * ordering guarantees, so is only rarely an appropriate
+     * alternative to {@code compareAndSet}.
      *
      * @param obj An object whose field to conditionally set
      * @param expect the expected value
--- a/src/java.base/share/classes/java/util/concurrent/atomic/AtomicStampedReference.java	Thu Dec 06 12:18:29 2018 +0100
+++ b/src/java.base/share/classes/java/util/concurrent/atomic/AtomicStampedReference.java	Mon Dec 10 10:20:31 2018 +0000
@@ -110,14 +110,12 @@
     }
 
     /**
-     * Atomically sets the value of both the reference and stamp
-     * to the given update values if the
-     * current reference is {@code ==} to the expected reference
-     * and the current stamp is equal to the expected stamp.
-     *
-     * <p><a href="package-summary.html#weakCompareAndSet">May fail
-     * spuriously and does not provide ordering guarantees</a>, so is
-     * only rarely an appropriate alternative to {@code compareAndSet}.
+     * Atomically sets the value of both the reference and stamp to
+     * the given update values if the current reference is {@code ==}
+     * to the expected reference and the current stamp is equal to the
+     * expected stamp. This operation may fail spuriously and does not
+     * provide ordering guarantees, so is only rarely an
+     * appropriate alternative to {@code compareAndSet}.
      *
      * @param expectedReference the expected value of the reference
      * @param newReference the new value for the reference
--- a/src/java.base/share/classes/java/util/concurrent/atomic/DoubleAccumulator.java	Thu Dec 06 12:18:29 2018 +0100
+++ b/src/java.base/share/classes/java/util/concurrent/atomic/DoubleAccumulator.java	Mon Dec 10 10:20:31 2018 +0000
@@ -280,7 +280,7 @@
 
     /**
      * Returns a
-     * <a href="../../../../serialized-form.html#java.util.concurrent.atomic.DoubleAccumulator.SerializationProxy">
+     * <a href="{@docRoot}/serialized-form.html#java.util.concurrent.atomic.DoubleAccumulator.SerializationProxy">
      * SerializationProxy</a>
      * representing the state of this instance.
      *
--- a/src/java.base/share/classes/java/util/concurrent/atomic/DoubleAdder.java	Thu Dec 06 12:18:29 2018 +0100
+++ b/src/java.base/share/classes/java/util/concurrent/atomic/DoubleAdder.java	Mon Dec 10 10:20:31 2018 +0000
@@ -239,7 +239,7 @@
 
     /**
      * Returns a
-     * <a href="../../../../serialized-form.html#java.util.concurrent.atomic.DoubleAdder.SerializationProxy">
+     * <a href="{@docRoot}/serialized-form.html#java.util.concurrent.atomic.DoubleAdder.SerializationProxy">
      * SerializationProxy</a>
      * representing the state of this instance.
      *
--- a/src/java.base/share/classes/java/util/concurrent/atomic/LongAccumulator.java	Thu Dec 06 12:18:29 2018 +0100
+++ b/src/java.base/share/classes/java/util/concurrent/atomic/LongAccumulator.java	Mon Dec 10 10:20:31 2018 +0000
@@ -271,7 +271,7 @@
 
     /**
      * Returns a
-     * <a href="../../../../serialized-form.html#java.util.concurrent.atomic.LongAccumulator.SerializationProxy">
+     * <a href="{@docRoot}/serialized-form.html#java.util.concurrent.atomic.LongAccumulator.SerializationProxy">
      * SerializationProxy</a>
      * representing the state of this instance.
      *
--- a/src/java.base/share/classes/java/util/concurrent/atomic/LongAdder.java	Thu Dec 06 12:18:29 2018 +0100
+++ b/src/java.base/share/classes/java/util/concurrent/atomic/LongAdder.java	Mon Dec 10 10:20:31 2018 +0000
@@ -241,7 +241,7 @@
 
     /**
      * Returns a
-     * <a href="../../../../serialized-form.html#java.util.concurrent.atomic.LongAdder.SerializationProxy">
+     * <a href="{@docRoot}/serialized-form.html#java.util.concurrent.atomic.LongAdder.SerializationProxy">
      * SerializationProxy</a>
      * representing the state of this instance.
      *
--- a/src/java.base/share/classes/java/util/concurrent/locks/LockSupport.java	Thu Dec 06 12:18:29 2018 +0100
+++ b/src/java.base/share/classes/java/util/concurrent/locks/LockSupport.java	Mon Dec 10 10:20:31 2018 +0000
@@ -199,10 +199,11 @@
      * Disables the current thread for thread scheduling purposes, for up to
      * the specified waiting time, unless the permit is available.
      *
-     * <p>If the permit is available then it is consumed and the call
-     * returns immediately; otherwise the current thread becomes disabled
-     * for thread scheduling purposes and lies dormant until one of four
-     * things happens:
+     * <p>If the specified waiting time is zero or negative, the
+     * method does nothing. Otherwise, if the permit is available then
+     * it is consumed and the call returns immediately; otherwise the
+     * current thread becomes disabled for thread scheduling purposes
+     * and lies dormant until one of four things happens:
      *
      * <ul>
      * <li>Some other thread invokes {@link #unpark unpark} with the
@@ -327,10 +328,11 @@
      * Disables the current thread for thread scheduling purposes, for up to
      * the specified waiting time, unless the permit is available.
      *
-     * <p>If the permit is available then it is consumed and the call
-     * returns immediately; otherwise the current thread becomes disabled
-     * for thread scheduling purposes and lies dormant until one of four
-     * things happens:
+     * <p>If the specified waiting time is zero or negative, the
+     * method does nothing. Otherwise, if the permit is available then
+     * it is consumed and the call returns immediately; otherwise the
+     * current thread becomes disabled for thread scheduling purposes
+     * and lies dormant until one of four things happens:
      *
      * <ul>
      * <li>Some other thread invokes {@link #unpark unpark} with the
--- a/src/java.base/share/classes/java/util/concurrent/locks/StampedLock.java	Thu Dec 06 12:18:29 2018 +0100
+++ b/src/java.base/share/classes/java/util/concurrent/locks/StampedLock.java	Mon Dec 10 10:20:31 2018 +0000
@@ -65,22 +65,23 @@
  *   and timed versions of {@code tryReadLock} are also provided.
  *
  *  <li><b>Optimistic Reading.</b> Method {@link #tryOptimisticRead}
- *   returns a non-zero stamp only if the lock is not currently held
- *   in write mode. Method {@link #validate} returns true if the lock
- *   has not been acquired in write mode since obtaining a given
- *   stamp.  This mode can be thought of as an extremely weak version
- *   of a read-lock, that can be broken by a writer at any time.  The
- *   use of optimistic mode for short read-only code segments often
- *   reduces contention and improves throughput.  However, its use is
- *   inherently fragile.  Optimistic read sections should only read
- *   fields and hold them in local variables for later use after
- *   validation. Fields read while in optimistic mode may be wildly
- *   inconsistent, so usage applies only when you are familiar enough
- *   with data representations to check consistency and/or repeatedly
- *   invoke method {@code validate()}.  For example, such steps are
- *   typically required when first reading an object or array
- *   reference, and then accessing one of its fields, elements or
- *   methods.
+ *   returns a non-zero stamp only if the lock is not currently held in
+ *   write mode.  Method {@link #validate} returns true if the lock has not
+ *   been acquired in write mode since obtaining a given stamp, in which
+ *   case all actions prior to the most recent write lock release
+ *   happen-before actions following the call to {@code tryOptimisticRead}.
+ *   This mode can be thought of as an extremely weak version of a
+ *   read-lock, that can be broken by a writer at any time.  The use of
+ *   optimistic read mode for short read-only code segments often reduces
+ *   contention and improves throughput.  However, its use is inherently
+ *   fragile.  Optimistic read sections should only read fields and hold
+ *   them in local variables for later use after validation. Fields read
+ *   while in optimistic read mode may be wildly inconsistent, so usage
+ *   applies only when you are familiar enough with data representations to
+ *   check consistency and/or repeatedly invoke method {@code validate()}.
+ *   For example, such steps are typically required when first reading an
+ *   object or array reference, and then accessing one of its fields,
+ *   elements or methods.
  *
  * </ul>
  *
@@ -88,8 +89,8 @@
  * conversions across the three modes. For example, method {@link
  * #tryConvertToWriteLock} attempts to "upgrade" a mode, returning
  * a valid write stamp if (1) already in writing mode (2) in reading
- * mode and there are no other readers or (3) in optimistic mode and
- * the lock is available. The forms of these methods are designed to
+ * mode and there are no other readers or (3) in optimistic read mode
+ * and the lock is available. The forms of these methods are designed to
  * help reduce some of the code bloat that otherwise occurs in
  * retry-based designs.
  *
@@ -129,6 +130,19 @@
  * #asReadWriteLock()} in applications requiring only the associated
  * set of functionality.
  *
+ * <p><b>Memory Synchronization.</b> Methods with the effect of
+ * successfully locking in any mode have the same memory
+ * synchronization effects as a <em>Lock</em> action described in
+ * <a href="https://docs.oracle.com/javase/specs/jls/se8/html/jls-17.html#jls-17.4">
+ * Chapter 17 of <cite>The Java&trade; Language Specification</cite></a>.
+ * Methods successfully unlocking in write mode have the same memory
+ * synchronization effects as an <em>Unlock</em> action.  In optimistic
+ * read usages, actions prior to the most recent write mode unlock action
+ * are guaranteed to happen-before those following a tryOptimisticRead
+ * only if a later validate returns true; otherwise there is no guarantee
+ * that the reads between tryOptimisticRead and validate obtain a
+ * consistent snapshot.
+ *
  * <p><b>Sample Usage.</b> The following illustrates some usage idioms
  * in a class that maintains simple two-dimensional points. The sample
  * code illustrates some try/catch conventions even though they are
--- a/src/java.base/share/classes/java/util/doc-files/coll-reference.html	Thu Dec 06 12:18:29 2018 +0100
+++ b/src/java.base/share/classes/java/util/doc-files/coll-reference.html	Mon Dec 10 10:20:31 2018 +0000
@@ -431,7 +431,7 @@
 fill(List, Object)</a></strong> - Overwrites every element in a
 list with the specified value.</li>
 <li><strong><a href=
-"../Collections.html#copy-java.util.List(java.util.List)">
+"../Collections.html#copy(java.util.List,java.util.List)">
 copy(List dest, List src)</a></strong> - Copies the source list
 into the destination list.</li>
 <li><strong><a href=
--- a/src/java.base/share/classes/java/util/spi/TimeZoneNameProvider.java	Thu Dec 06 12:18:29 2018 +0100
+++ b/src/java.base/share/classes/java/util/spi/TimeZoneNameProvider.java	Mon Dec 10 10:20:31 2018 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -52,7 +52,7 @@
      * presentation to the user in the specified locale. The given time
      * zone ID is "GMT" or one of the names defined using "Zone" entries
      * in the "tz database", a public domain time zone database at
-     * <a href="ftp://elsie.nci.nih.gov/pub/">ftp://elsie.nci.nih.gov/pub/</a>.
+     * <a href="https://www.iana.org/time-zones">https://www.iana.org/time-zones</a>.
      * The data of this database is contained in a file whose name starts with
      * "tzdata", and the specification of the data format is part of the zic.8
      * man page, which is contained in a file whose name starts with "tzcode".
--- a/src/java.base/share/classes/java/util/zip/Deflater.java	Thu Dec 06 12:18:29 2018 +0100
+++ b/src/java.base/share/classes/java/util/zip/Deflater.java	Mon Dec 10 10:20:31 2018 +0000
@@ -224,7 +224,6 @@
      * One of the {@code setInput()} methods should be called whenever
      * {@code needsInput()} returns true indicating that more input data
      * is required.
-     * <p>
      * @param input the input data bytes
      * @param off the start offset of the data
      * @param len the length of the data
@@ -248,7 +247,6 @@
      * One of the {@code setInput()} methods should be called whenever
      * {@code needsInput()} returns true indicating that more input data
      * is required.
-     * <p>
      * @param input the input data bytes
      * @see Deflater#needsInput
      */
--- a/src/java.base/share/classes/javax/net/ssl/SSLContext.java	Thu Dec 06 12:18:29 2018 +0100
+++ b/src/java.base/share/classes/javax/net/ssl/SSLContext.java	Mon Dec 10 10:20:31 2018 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -38,18 +38,16 @@
  * secure random bytes.
  *
  * <p> Every implementation of the Java platform is required to support the
- * following standard {@code SSLContext} protocols:
+ * following standard {@code SSLContext} protocol:
  * <ul>
- * <li>{@code TLSv1}</li>
- * <li>{@code TLSv1.1}</li>
  * <li>{@code TLSv1.2}</li>
  * </ul>
- * These protocols are described in the <a href=
+ * This protocol is described in the <a href=
  * "{@docRoot}/../specs/security/standard-names.html#sslcontext-algorithms">
  * SSLContext section</a> of the
  * Java Security Standard Algorithm Names Specification.
  * Consult the release documentation for your implementation to see if any
- * other algorithms are supported.
+ * other protocols are supported.
  *
  * @since 1.4
  */
--- a/src/java.base/share/classes/javax/net/ssl/SSLSessionContext.java	Thu Dec 06 12:18:29 2018 +0100
+++ b/src/java.base/share/classes/javax/net/ssl/SSLSessionContext.java	Mon Dec 10 10:20:31 2018 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -87,10 +87,17 @@
      * A check for sessions exceeding the timeout is made immediately whenever
      * the timeout limit is changed for this <code>SSLSessionContext</code>.
      *
+     * @apiNote Note that the JDK Implementation uses default values for both
+     *          the session cache size and timeout.  See
+     *          {@code getSessionCacheSize} and {@code getSessionTimeout} for
+     *          more information.  Applications should consider their
+     *          performance requirements and override the defaults if necessary.
+     *
      * @param seconds the new session timeout limit in seconds; zero means
-     *          there is no limit.
+     *        there is no limit.
      *
-     * @exception IllegalArgumentException if the timeout specified is {@code < 0}.
+     * @throws IllegalArgumentException if the timeout specified is {@code < 0}.
+     *
      * @see #getSessionTimeout
      */
     public void setSessionTimeout(int seconds)
@@ -109,33 +116,50 @@
      * whenever the timeout limit is changed for this
      * <code>SSLSessionContext</code>.
      *
+     * @implNote The JDK implementation returns the session timeout as set by
+     *           the {@code setSessionTimeout} method, or if not set, a default
+     *           value of 86400 seconds (24 hours).
+     *
      * @return the session timeout limit in seconds; zero means there is no
-     * limit.
+     *         limit.
+     *
      * @see #setSessionTimeout
      */
     public int getSessionTimeout();
 
     /**
-     * Sets the size of the cache used for storing
-     * <code>SSLSession</code> objects grouped under this
-     * <code>SSLSessionContext</code>.
+     * Sets the size of the cache used for storing <code>SSLSession</code>
+     * objects grouped under this <code>SSLSessionContext</code>.
+     *
+     * @apiNote Note that the JDK Implementation uses default values for both
+     *          the session cache size and timeout.  See
+     *          {@code getSessionCacheSize} and {@code getSessionTimeout} for
+     *          more information.  Applications should consider their
+     *          performance requirements and override the defaults if necessary.
      *
      * @param size the new session cache size limit; zero means there is no
-     * limit.
-     * @exception IllegalArgumentException if the specified size is {@code < 0}.
+     *        limit.
+     *
+     * @throws IllegalArgumentException if the specified size is {@code < 0}.
+     *
      * @see #getSessionCacheSize
      */
     public void setSessionCacheSize(int size)
                  throws IllegalArgumentException;
 
     /**
-     * Returns the size of the cache used for storing
-     * <code>SSLSession</code> objects grouped under this
-     * <code>SSLSessionContext</code>.
+     * Returns the size of the cache used for storing <code>SSLSession</code>
+     * objects grouped under this <code>SSLSessionContext</code>.
+     *
+     * @implNote The JDK implementation returns the cache size as set by
+     *           the {@code setSessionCacheSize} method, or if not set, the
+     *           value of the {@systemProperty javax.net.ssl.sessionCacheSize}
+     *           system property.  If neither is set, it returns a default
+     *           value of 20480.
      *
      * @return size of the session cache; zero means there is no size limit.
+     *
      * @see #setSessionCacheSize
      */
     public int getSessionCacheSize();
-
 }
--- a/src/java.base/share/classes/jdk/internal/org/xml/sax/DTDHandler.java	Thu Dec 06 12:18:29 2018 +0100
+++ b/src/java.base/share/classes/jdk/internal/org/xml/sax/DTDHandler.java	Mon Dec 10 10:20:31 2018 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -73,7 +73,6 @@
  */
 public interface DTDHandler {
 
-
     /**
      * Receive notification of a notation declaration event.
      *
@@ -136,6 +135,39 @@
                                              String notationName)
         throws SAXException;
 
+    // from SAX2 extension DeclHandler
+    /**
+     * Receive notification of the start of DTD declarations.
+     *
+     * The start/endDTD events appear within the start/endDocument events
+     * from ContentHandler.
+     *
+     * @param name The document type name.
+     * @param publicId The declared public identifier for the
+     *        external DTD subset, or null if none was declared.
+     * @param systemId The declared system identifier for the
+     *        external DTD subset, or null if none was declared.
+     *        (Note that this is not resolved against the document
+     *        base URI.)
+     * @throws SAXException the event receiver may throw an exception during processing
+     */
+    default public void startDTD (String name, String publicId, String systemId)
+        throws SAXException
+    {
+        // no op
+    }
+
+    // Custom API for the Properties
+
+    /**
+     * Receive notification of the start of DTD internal subset.
+     *
+     * @throws SAXException the event receiver may throw an exception during processing
+     */
+    default public void startInternalSub () throws SAXException
+    {
+        // no op
+    }
 }
 
 // end of DTDHandler.java
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/java.base/share/classes/jdk/internal/util/SystemProps.java	Mon Dec 10 10:20:31 2018 +0000
@@ -0,0 +1,294 @@
+/*
+ * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
+ * 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 java.lang.annotation.Native;
+import java.util.Properties;
+
+/**
+ * System Property initialization for internal use only
+ * Retrieves the platform, JVM, and command line properties,
+ * applies initial defaults and returns the Properties instance
+ * that becomes the System.getProperties instance.
+ */
+public final class SystemProps {
+
+    // no instances
+    private SystemProps() {}
+
+    /**
+     * Create and initialize the system properties from the native properties
+     * and command line properties.
+     * Note:  Build-defined properties such as versions and vendor information
+     * are initialized by VersionProps.java-template.
+     *
+     * @return a Properties instance initialized with all of the properties
+     */
+    public static Properties initProperties() {
+        // Initially, cmdProperties only includes -D and props from the VM
+        Raw raw = new Raw();
+        Properties props = raw.cmdProperties();
+
+        String javaHome = props.getProperty("java.home");
+        assert javaHome != null : "java.home not set";
+
+        putIfAbsent(props, "user.home", raw.propDefault(Raw._user_home_NDX));
+        putIfAbsent(props, "user.dir", raw.propDefault(Raw._user_dir_NDX));
+        putIfAbsent(props, "user.name", raw.propDefault(Raw._user_name_NDX));
+
+        // Platform defined encoding cannot be overridden on the command line
+        put(props, "sun.jnu.encoding", raw.propDefault(Raw._sun_jnu_encoding_NDX));
+
+        // Add properties that have not been overridden on the cmdline
+        putIfAbsent(props, "file.encoding",
+                ((raw.propDefault(Raw._file_encoding_NDX) == null)
+                        ? raw.propDefault(Raw._sun_jnu_encoding_NDX)
+                        : raw.propDefault(Raw._file_encoding_NDX)));
+
+        // Use platform values if not overridden by a commandline -Dkey=value
+        // In no particular order
+        putIfAbsent(props, "os.name", raw.propDefault(Raw._os_name_NDX));
+        putIfAbsent(props, "os.arch", raw.propDefault(Raw._os_arch_NDX));
+        putIfAbsent(props, "os.version", raw.propDefault(Raw._os_version_NDX));
+        putIfAbsent(props, "line.separator", raw.propDefault(Raw._line_separator_NDX));
+        putIfAbsent(props, "file.separator", raw.propDefault(Raw._file_separator_NDX));
+        putIfAbsent(props, "path.separator", raw.propDefault(Raw._path_separator_NDX));
+        putIfAbsent(props, "java.io.tmpdir", raw.propDefault(Raw._java_io_tmpdir_NDX));
+        putIfAbsent(props, "http.proxyHost", raw.propDefault(Raw._http_proxyHost_NDX));
+        putIfAbsent(props, "http.proxyPort", raw.propDefault(Raw._http_proxyPort_NDX));
+        putIfAbsent(props, "https.proxyHost", raw.propDefault(Raw._https_proxyHost_NDX));
+        putIfAbsent(props, "https.proxyPort", raw.propDefault(Raw._https_proxyPort_NDX));
+        putIfAbsent(props, "ftp.proxyHost", raw.propDefault(Raw._ftp_proxyHost_NDX));
+        putIfAbsent(props, "ftp.proxyPort", raw.propDefault(Raw._ftp_proxyPort_NDX));
+        putIfAbsent(props, "socksProxyHost", raw.propDefault(Raw._socksProxyHost_NDX));
+        putIfAbsent(props, "socksProxyPort", raw.propDefault(Raw._socksProxyPort_NDX));
+        putIfAbsent(props, "http.nonProxyHosts", raw.propDefault(Raw._http_nonProxyHosts_NDX));
+        putIfAbsent(props, "ftp.nonProxyHosts", raw.propDefault(Raw._ftp_nonProxyHosts_NDX));
+        putIfAbsent(props, "socksNonProxyHosts", raw.propDefault(Raw._socksNonProxyHosts_NDX));
+        putIfAbsent(props, "awt.toolkit", raw.propDefault(Raw._awt_toolkit_NDX));
+        putIfAbsent(props, "java.awt.headless", raw.propDefault(Raw._java_awt_headless_NDX));
+        putIfAbsent(props, "java.awt.graphicsenv", raw.propDefault(Raw._java_awt_graphicsenv_NDX));
+        putIfAbsent(props, "sun.desktop", raw.propDefault(Raw._sun_desktop_NDX));
+        putIfAbsent(props, "sun.java2d.fontpath", raw.propDefault(Raw._sun_java2d_fontpath_NDX));
+        putIfAbsent(props, "sun.arch.abi", raw.propDefault(Raw._sun_arch_abi_NDX));
+        putIfAbsent(props, "sun.arch.data.model", raw.propDefault(Raw._sun_arch_data_model_NDX));
+        putIfAbsent(props, "sun.os.patch.level", raw.propDefault(Raw._sun_os_patch_level_NDX));
+        putIfAbsent(props, "sun.stdout.encoding", raw.propDefault(Raw._sun_stdout_encoding_NDX));
+        putIfAbsent(props, "sun.stderr.encoding", raw.propDefault(Raw._sun_stderr_encoding_NDX));
+        putIfAbsent(props, "sun.io.unicode.encoding", raw.propDefault(Raw._sun_io_unicode_encoding_NDX));
+        putIfAbsent(props, "sun.cpu.isalist", raw.propDefault(Raw._sun_cpu_isalist_NDX));
+        putIfAbsent(props, "sun.cpu.endian", raw.propDefault(Raw._sun_cpu_endian_NDX));
+
+        /* Construct i18n related options */
+        fillI18nProps(props,"user.language", raw.propDefault(Raw._display_language_NDX),
+                raw.propDefault(Raw._format_language_NDX));
+        fillI18nProps(props,"user.script",   raw.propDefault(Raw._display_script_NDX),
+                raw.propDefault(Raw._format_script_NDX));
+        fillI18nProps(props,"user.country",  raw.propDefault(Raw._display_country_NDX),
+                raw.propDefault(Raw._format_country_NDX));
+        fillI18nProps(props,"user.variant",  raw.propDefault(Raw._display_variant_NDX),
+                raw.propDefault(Raw._format_variant_NDX));
+
+        return props;
+    }
+
+    /**
+     * Puts the property if it is non-null
+     * @param props the Properties
+     * @param key the key
+     * @param value the value
+     */
+    private static void put(Properties props, String key, String value) {
+        if (value != null) {
+            props.put(key, value);
+        }
+    }
+
+    /**
+     * Puts the property if it is non-null and is not already in the Properties.
+     * @param props the Properties
+     * @param key the key
+     * @param value the value
+     */
+    private static void putIfAbsent(Properties props, String key, String value) {
+        if (value != null) {
+            props.putIfAbsent(key, value);
+        }
+    }
+
+    /**
+     * For internationalization options, compute the values for
+     * display and format properties
+     * MUST NOT override command line defined values.
+     *
+     * @param base the base property name
+     * @param display the display value for the base
+     * @param format the format value for the base
+     */
+    private static void fillI18nProps(Properties cmdProps, String base, String display,
+                                      String format) {
+        // Do not override command line setting
+        String baseValue = cmdProps.getProperty(base);
+        if (baseValue == null) {
+            // Not overridden on the command line; define the properties if there are platform defined values
+            baseValue = display;
+        }
+        if (baseValue != null) {
+            cmdProps.put(base, baseValue);
+        }
+
+        /* user.xxx.display property */
+        String disp = base + ".display";
+        String dispValue = cmdProps.getProperty(disp);
+        if (dispValue == null && display != null && !display.equals(baseValue)) {
+            // Create the property only if different from the base property
+            cmdProps.put(disp, display);
+        }
+
+        /* user.xxx.format property */
+        String fmt = base + ".format";
+        String fmtValue = cmdProps.getProperty(fmt);
+        if (fmtValue == null && format != null && !format.equals(baseValue)) {
+            // Create the property only if different than the base property
+            cmdProps.put(fmt, format);
+        }
+    }
+
+    /**
+     * Read the raw properties from native System.c.
+     */
+    public static class Raw {
+        // Array indices written by native vmProperties()
+        // The order is arbitrary (but alphabetic for convenience)
+        @Native private static final int _awt_toolkit_NDX = 0;
+        @Native private static final int _display_country_NDX = 1 + _awt_toolkit_NDX;
+        @Native private static final int _display_language_NDX = 1 + _display_country_NDX;
+        @Native private static final int _display_script_NDX = 1 + _display_language_NDX;
+        @Native private static final int _display_variant_NDX = 1 + _display_script_NDX;
+        @Native private static final int _file_encoding_NDX = 1 + _display_variant_NDX;
+        @Native private static final int _file_separator_NDX = 1 + _file_encoding_NDX;
+        @Native private static final int _format_country_NDX = 1 + _file_separator_NDX;
+        @Native private static final int _format_language_NDX = 1 + _format_country_NDX;
+        @Native private static final int _format_script_NDX = 1 + _format_language_NDX;
+        @Native private static final int _format_variant_NDX = 1 + _format_script_NDX;
+        @Native private static final int _ftp_nonProxyHosts_NDX = 1 + _format_variant_NDX;
+        @Native private static final int _ftp_proxyHost_NDX = 1 + _ftp_nonProxyHosts_NDX;
+        @Native private static final int _ftp_proxyPort_NDX = 1 + _ftp_proxyHost_NDX;
+        @Native private static final int _http_nonProxyHosts_NDX = 1 + _ftp_proxyPort_NDX;
+        @Native private static final int _http_proxyHost_NDX = 1 + _http_nonProxyHosts_NDX;
+        @Native private static final int _http_proxyPort_NDX = 1 + _http_proxyHost_NDX;
+        @Native private static final int _https_proxyHost_NDX = 1 + _http_proxyPort_NDX;
+        @Native private static final int _https_proxyPort_NDX = 1 + _https_proxyHost_NDX;
+        @Native private static final int _java_awt_graphicsenv_NDX = 1 + _https_proxyPort_NDX;
+        @Native private static final int _java_awt_headless_NDX = 1 + _java_awt_graphicsenv_NDX;
+        @Native private static final int _java_io_tmpdir_NDX = 1 + _java_awt_headless_NDX;
+        @Native private static final int _line_separator_NDX = 1 + _java_io_tmpdir_NDX;
+        @Native private static final int _os_arch_NDX = 1 + _line_separator_NDX;
+        @Native private static final int _os_name_NDX = 1 + _os_arch_NDX;
+        @Native private static final int _os_version_NDX = 1 + _os_name_NDX;
+        @Native private static final int _path_separator_NDX = 1 + _os_version_NDX;
+        @Native private static final int _socksNonProxyHosts_NDX = 1 + _path_separator_NDX;
+        @Native private static final int _socksProxyHost_NDX = 1 + _socksNonProxyHosts_NDX;
+        @Native private static final int _socksProxyPort_NDX = 1 + _socksProxyHost_NDX;
+        @Native private static final int _sun_arch_abi_NDX = 1 + _socksProxyPort_NDX;
+        @Native private static final int _sun_arch_data_model_NDX = 1 + _sun_arch_abi_NDX;
+        @Native private static final int _sun_cpu_endian_NDX = 1 + _sun_arch_data_model_NDX;
+        @Native private static final int _sun_cpu_isalist_NDX = 1 + _sun_cpu_endian_NDX;
+        @Native private static final int _sun_desktop_NDX = 1 + _sun_cpu_isalist_NDX;
+        @Native private static final int _sun_io_unicode_encoding_NDX = 1 + _sun_desktop_NDX;
+        @Native private static final int _sun_java2d_fontpath_NDX = 1 + _sun_io_unicode_encoding_NDX;
+        @Native private static final int _sun_jnu_encoding_NDX = 1 + _sun_java2d_fontpath_NDX;
+        @Native private static final int _sun_os_patch_level_NDX = 1 + _sun_jnu_encoding_NDX;
+        @Native private static final int _sun_stderr_encoding_NDX = 1 + _sun_os_patch_level_NDX;
+        @Native private static final int _sun_stdout_encoding_NDX = 1 + _sun_stderr_encoding_NDX;
+        @Native private static final int _user_dir_NDX = 1 + _sun_stdout_encoding_NDX;
+        @Native private static final int _user_home_NDX = 1 + _user_dir_NDX;
+        @Native private static final int _user_name_NDX = 1 + _user_home_NDX;
+        @Native private static final int FIXED_LENGTH = 1 + _user_name_NDX;
+
+        // Array of Strings returned from the VM and Command line properties
+        // The array is not used after initialization is complete.
+        private final String[] platformProps;
+
+        private Raw() {
+            platformProps = platformProperties();
+        }
+
+        /**
+         * Return the value for a well known default from native.
+         * @param index the index of the known property
+         * @return the value
+         */
+        String propDefault(int index) {
+            return platformProps[index];
+        }
+
+        /**
+         * Return a Properties instance of the command line and VM options
+         * defined by name and value.
+         * The Properties instance is sized to include the fixed properties.
+         *
+         * @return return a Properties instance of the command line and VM options
+         */
+        private Properties cmdProperties() {
+            String[] vmProps = vmProperties();
+            int nProps = vmProps.length / 2;
+            var cmdProps = new Properties(nProps + Raw.FIXED_LENGTH);
+            for (int i = 0; i < nProps; i++) {
+                String k = vmProps[i * 2];
+                if (k != null) {
+                    String v = vmProps[i * 2 + 1];
+                    cmdProps.setProperty(k, v != null ? v : "");
+                } else {
+                    // no more key/value pairs
+                    break;
+                }
+            }
+            return cmdProps;
+        }
+
+        /**
+         * Returns the available VM and Command Line Properties.
+         * The VM supplies some key/value pairs and processes the command line
+         * to extract key/value pairs from the {@code "-Dkey=value"} arguments.
+         *