Merge
authorhenryjen
Tue, 15 Jan 2019 10:55:26 -0800
changeset 53335 585902b2bfcb
parent 53334 b94283cb226b (current diff)
parent 53310 8ce4083fc831 (diff)
child 53336 36ca868f266f
Merge
make/autoconf/flags-cflags.m4
src/hotspot/share/classfile/dictionary.hpp
src/hotspot/share/classfile/systemDictionary.cpp
src/hotspot/share/prims/jvm.cpp
src/java.base/unix/native/libnet/net_util_md.c
test/jdk/java/lang/String/AlignIndent.java
test/jdk/java/net/MulticastSocket/PromiscuousIPv6.java
test/jdk/java/nio/channels/DatagramChannel/PromiscuousIPv6.java
test/langtools/tools/javac/RawStringLiteralLang.java
test/langtools/tools/javac/RawStringLiteralLangAPI.java
test/langtools/tools/javac/diags/examples/RawStringLiteral.java
--- a/.hgtags	Thu Dec 13 11:51:06 2018 -0800
+++ b/.hgtags	Tue Jan 15 10:55:26 2019 -0800
@@ -526,3 +526,7 @@
 f8fb0c86f2b3d24294d39c5685a628e1beb14ba7 jdk-12+21
 732bec44c89e8b93a38296bf690f97b7230c5b6d jdk-12+22
 eef755718cb24813031a842bbfc716a6cea18e9a jdk-12+23
+7d4397b43fa305806160785a4c7210600d59581a jdk-12+24
+7496df94b3b79f3da53925d2d137317715f11d97 jdk-12+25
+de9fd809bb475401aad188eab2264226788aad81 jdk-12+26
+f15d443f97318e9b40e6f451e327ff69ed4ec361 jdk-12+27
--- a/make/Docs.gmk	Thu Dec 13 11:51:06 2018 -0800
+++ b/make/Docs.gmk	Tue Jan 15 10:55:26 2019 -0800
@@ -517,7 +517,7 @@
   ) \
 )
 
-ifneq ($(PANDOC), )
+ifeq ($(ENABLE_PANDOC), true)
   # For all markdown files in $module/share/specs directories, convert them to
   # html, if we have pandoc (otherwise we'll just skip this).
 
--- a/make/RunTestsPrebuilt.gmk	Thu Dec 13 11:51:06 2018 -0800
+++ b/make/RunTestsPrebuilt.gmk	Tue Jan 15 10:55:26 2019 -0800
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -237,7 +237,8 @@
 else ifeq ($(OPENJDK_TARGET_OS), windows)
   NUM_CORES := $(NUMBER_OF_PROCESSORS)
   MEMORY_SIZE := $(shell \
-      $(EXPR) `wmic computersystem get totalphysicalmemory -value | $(GREP) = \
+      $(EXPR) `wmic computersystem get totalphysicalmemory -value \
+          | $(GREP) = | $(SED) 's/\\r//g' \
           | $(CUT) -d "=" -f 2-` / 1024 / 1024 \
   )
 endif
--- a/make/autoconf/basics.m4	Thu Dec 13 11:51:06 2018 -0800
+++ b/make/autoconf/basics.m4	Tue Jan 15 10:55:26 2019 -0800
@@ -610,7 +610,14 @@
   BASIC_PATH_PROGS(DF, df)
   BASIC_PATH_PROGS(CPIO, [cpio bsdcpio])
   BASIC_PATH_PROGS(NICE, nice)
+
   BASIC_PATH_PROGS(PANDOC, pandoc)
+  if test -n "$PANDOC"; then
+    ENABLE_PANDOC="true"
+  else
+    ENABLE_PANDOC="false"
+  fi
+  AC_SUBST(ENABLE_PANDOC)
 ])
 
 ###############################################################################
--- a/make/autoconf/flags-cflags.m4	Thu Dec 13 11:51:06 2018 -0800
+++ b/make/autoconf/flags-cflags.m4	Tue Jan 15 10:55:26 2019 -0800
@@ -183,7 +183,8 @@
 
       # Additional warnings that are not activated by -Wall and -Wextra
       WARNINGS_ENABLE_ADDITIONAL="-Wpointer-arith -Wsign-compare \
-          -Wunused-function -Wundef -Wunused-value -Wreturn-type"
+          -Wunused-function -Wundef -Wunused-value -Wreturn-type \
+          -Wtrampolines"
       WARNINGS_ENABLE_ADDITIONAL_CXX="-Woverloaded-virtual -Wreorder"
       WARNINGS_ENABLE_ALL_CFLAGS="-Wall -Wextra -Wformat=2 $WARNINGS_ENABLE_ADDITIONAL"
       WARNINGS_ENABLE_ALL_CXXFLAGS="$WARNINGS_ENABLE_ALL_CFLAGS $WARNINGS_ENABLE_ADDITIONAL_CXX"
--- a/make/autoconf/spec.gmk.in	Thu Dec 13 11:51:06 2018 -0800
+++ b/make/autoconf/spec.gmk.in	Tue Jan 15 10:55:26 2019 -0800
@@ -761,6 +761,7 @@
 MSVCP_DLL:=@MSVCP_DLL@
 UCRT_DLL_DIR:=@UCRT_DLL_DIR@
 STLPORT_LIB:=@STLPORT_LIB@
+ENABLE_PANDOC:=@ENABLE_PANDOC@
 
 ####################################################
 #
--- a/make/launcher/LauncherCommon.gmk	Thu Dec 13 11:51:06 2018 -0800
+++ b/make/launcher/LauncherCommon.gmk	Tue Jan 15 10:55:26 2019 -0800
@@ -203,7 +203,7 @@
 
   ifneq ($(MAN_FILES_MD), )
     # If we got markdown files, ignore the troff files
-    ifeq ($(PANDOC), )
+    ifeq ($(ENABLE_PANDOC), false)
       $(info Warning: pandoc not found. Not generating man pages)
     else
       # Create dynamic man pages from markdown using pandoc. We need
--- a/make/scripts/pandoc-html-manpage-filter.js	Thu Dec 13 11:51:06 2018 -0800
+++ b/make/scripts/pandoc-html-manpage-filter.js	Tue Jan 15 10:55:26 2019 -0800
@@ -86,7 +86,7 @@
 function change_title(type, value) {
     if (type === 'MetaInlines') {
         if (value[0].t === 'Str') {
-            var match = value[0].c.match(/^([A-Z]+)\([0-9]+\)$/);
+            var match = value[0].c.match(/^([A-Z0-9]+)\([0-9]+\)$/);
             if (match) {
                 return MetaInlines([
                         Str("The"), Space(),
--- a/src/hotspot/cpu/aarch64/aarch64.ad	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/hotspot/cpu/aarch64/aarch64.ad	Tue Jan 15 10:55:26 2019 -0800
@@ -2133,7 +2133,12 @@
 }
 
 const uint Matcher::vector_shift_count_ideal_reg(int size) {
-  return Op_VecX;
+  switch(size) {
+    case  8: return Op_VecD;
+    case 16: return Op_VecX;
+  }
+  ShouldNotReachHere();
+  return 0;
 }
 
 // AES support not yet implemented
@@ -16524,32 +16529,32 @@
 %}
 
 // ------------------------------ Shift ---------------------------------------
-
-instruct vshiftcntL(vecX dst, iRegIorL2I cnt) %{
+instruct vshiftcnt8B(vecD dst, iRegIorL2I cnt) %{
+  predicate(n->as_Vector()->length_in_bytes() == 8);
   match(Set dst (LShiftCntV cnt));
-  format %{ "dup  $dst, $cnt\t# shift count (vecX)" %}
+  match(Set dst (RShiftCntV cnt));
+  format %{ "dup  $dst, $cnt\t# shift count vector (8B)" %}
+  ins_encode %{
+    __ dup(as_FloatRegister($dst$$reg), __ T8B, as_Register($cnt$$reg));
+  %}
+  ins_pipe(vdup_reg_reg64);
+%}
+
+instruct vshiftcnt16B(vecX dst, iRegIorL2I cnt) %{
+  predicate(n->as_Vector()->length_in_bytes() == 16);
+  match(Set dst (LShiftCntV cnt));
+  match(Set dst (RShiftCntV cnt));
+  format %{ "dup  $dst, $cnt\t# shift count vector (16B)" %}
   ins_encode %{
     __ dup(as_FloatRegister($dst$$reg), __ T16B, as_Register($cnt$$reg));
   %}
   ins_pipe(vdup_reg_reg128);
 %}
 
-// Right shifts on aarch64 SIMD are implemented as left shift by -ve amount
-instruct vshiftcntR(vecX dst, iRegIorL2I cnt) %{
-  match(Set dst (RShiftCntV cnt));
-  format %{ "dup  $dst, $cnt\t# shift count (vecX)\n\tneg  $dst, $dst\t T16B" %}
-  ins_encode %{
-    __ dup(as_FloatRegister($dst$$reg), __ T16B, as_Register($cnt$$reg));
-    __ negr(as_FloatRegister($dst$$reg), __ T16B, as_FloatRegister($dst$$reg));
-  %}
-  ins_pipe(vdup_reg_reg128);
-%}
-
-instruct vsll8B(vecD dst, vecD src, vecX shift) %{
+instruct vsll8B(vecD dst, vecD src, vecD shift) %{
   predicate(n->as_Vector()->length() == 4 ||
             n->as_Vector()->length() == 8);
   match(Set dst (LShiftVB src shift));
-  match(Set dst (RShiftVB src shift));
   ins_cost(INSN_COST);
   format %{ "sshl  $dst,$src,$shift\t# vector (8B)" %}
   ins_encode %{
@@ -16563,7 +16568,6 @@
 instruct vsll16B(vecX dst, vecX src, vecX shift) %{
   predicate(n->as_Vector()->length() == 16);
   match(Set dst (LShiftVB src shift));
-  match(Set dst (RShiftVB src shift));
   ins_cost(INSN_COST);
   format %{ "sshl  $dst,$src,$shift\t# vector (16B)" %}
   ins_encode %{
@@ -16574,29 +16578,93 @@
   ins_pipe(vshift128);
 %}
 
-instruct vsrl8B(vecD dst, vecD src, vecX shift) %{
+// Right shifts with vector shift count on aarch64 SIMD are implemented
+// as left shift by negative shift count.
+// There are two cases for vector shift count.
+//
+// Case 1: The vector shift count is from replication.
+//        |            |
+//    LoadVector  RShiftCntV
+//        |       /
+//     RShiftVI
+// Note: In inner loop, multiple neg instructions are used, which can be
+// moved to outer loop and merge into one neg instruction.
+//
+// Case 2: The vector shift count is from loading.
+// This case isn't supported by middle-end now. But it's supported by
+// panama/vectorIntrinsics(JEP 338: Vector API).
+//        |            |
+//    LoadVector  LoadVector
+//        |       /
+//     RShiftVI
+//
+
+instruct vsra8B(vecD dst, vecD src, vecD shift, vecD tmp) %{
+  predicate(n->as_Vector()->length() == 4 ||
+            n->as_Vector()->length() == 8);
+  match(Set dst (RShiftVB src shift));
+  ins_cost(INSN_COST);
+  effect(TEMP tmp);
+  format %{ "negr  $tmp,$shift\t"
+            "sshl  $dst,$src,$tmp\t# vector (8B)" %}
+  ins_encode %{
+    __ negr(as_FloatRegister($tmp$$reg), __ T8B,
+            as_FloatRegister($shift$$reg));
+    __ sshl(as_FloatRegister($dst$$reg), __ T8B,
+            as_FloatRegister($src$$reg),
+            as_FloatRegister($tmp$$reg));
+  %}
+  ins_pipe(vshift64);
+%}
+
+instruct vsra16B(vecX dst, vecX src, vecX shift, vecX tmp) %{
+  predicate(n->as_Vector()->length() == 16);
+  match(Set dst (RShiftVB src shift));
+  ins_cost(INSN_COST);
+  effect(TEMP tmp);
+  format %{ "negr  $tmp,$shift\t"
+            "sshl  $dst,$src,$tmp\t# vector (16B)" %}
+  ins_encode %{
+    __ negr(as_FloatRegister($tmp$$reg), __ T16B,
+            as_FloatRegister($shift$$reg));
+    __ sshl(as_FloatRegister($dst$$reg), __ T16B,
+            as_FloatRegister($src$$reg),
+            as_FloatRegister($tmp$$reg));
+  %}
+  ins_pipe(vshift128);
+%}
+
+instruct vsrl8B(vecD dst, vecD src, vecD shift, vecD tmp) %{
   predicate(n->as_Vector()->length() == 4 ||
             n->as_Vector()->length() == 8);
   match(Set dst (URShiftVB src shift));
   ins_cost(INSN_COST);
-  format %{ "ushl  $dst,$src,$shift\t# vector (8B)" %}
-  ins_encode %{
+  effect(TEMP tmp);
+  format %{ "negr  $tmp,$shift\t"
+            "ushl  $dst,$src,$tmp\t# vector (8B)" %}
+  ins_encode %{
+    __ negr(as_FloatRegister($tmp$$reg), __ T8B,
+            as_FloatRegister($shift$$reg));
     __ ushl(as_FloatRegister($dst$$reg), __ T8B,
             as_FloatRegister($src$$reg),
-            as_FloatRegister($shift$$reg));
+            as_FloatRegister($tmp$$reg));
   %}
   ins_pipe(vshift64);
 %}
 
-instruct vsrl16B(vecX dst, vecX src, vecX shift) %{
+instruct vsrl16B(vecX dst, vecX src, vecX shift, vecX tmp) %{
   predicate(n->as_Vector()->length() == 16);
   match(Set dst (URShiftVB src shift));
   ins_cost(INSN_COST);
-  format %{ "ushl  $dst,$src,$shift\t# vector (16B)" %}
-  ins_encode %{
+  effect(TEMP tmp);
+  format %{ "negr  $tmp,$shift\t"
+            "ushl  $dst,$src,$tmp\t# vector (16B)" %}
+  ins_encode %{
+    __ negr(as_FloatRegister($tmp$$reg), __ T16B,
+            as_FloatRegister($shift$$reg));
     __ ushl(as_FloatRegister($dst$$reg), __ T16B,
             as_FloatRegister($src$$reg),
-            as_FloatRegister($shift$$reg));
+            as_FloatRegister($tmp$$reg));
   %}
   ins_pipe(vshift128);
 %}
@@ -16708,11 +16776,10 @@
   ins_pipe(vshift128_imm);
 %}
 
-instruct vsll4S(vecD dst, vecD src, vecX shift) %{
+instruct vsll4S(vecD dst, vecD src, vecD shift) %{
   predicate(n->as_Vector()->length() == 2 ||
             n->as_Vector()->length() == 4);
   match(Set dst (LShiftVS src shift));
-  match(Set dst (RShiftVS src shift));
   ins_cost(INSN_COST);
   format %{ "sshl  $dst,$src,$shift\t# vector (4H)" %}
   ins_encode %{
@@ -16726,7 +16793,6 @@
 instruct vsll8S(vecX dst, vecX src, vecX shift) %{
   predicate(n->as_Vector()->length() == 8);
   match(Set dst (LShiftVS src shift));
-  match(Set dst (RShiftVS src shift));
   ins_cost(INSN_COST);
   format %{ "sshl  $dst,$src,$shift\t# vector (8H)" %}
   ins_encode %{
@@ -16737,29 +16803,72 @@
   ins_pipe(vshift128);
 %}
 
-instruct vsrl4S(vecD dst, vecD src, vecX shift) %{
+instruct vsra4S(vecD dst, vecD src, vecD shift, vecD tmp) %{
+  predicate(n->as_Vector()->length() == 2 ||
+            n->as_Vector()->length() == 4);
+  match(Set dst (RShiftVS src shift));
+  ins_cost(INSN_COST);
+  effect(TEMP tmp);
+  format %{ "negr  $tmp,$shift\t"
+            "sshl  $dst,$src,$tmp\t# vector (4H)" %}
+  ins_encode %{
+    __ negr(as_FloatRegister($tmp$$reg), __ T8B,
+            as_FloatRegister($shift$$reg));
+    __ sshl(as_FloatRegister($dst$$reg), __ T4H,
+            as_FloatRegister($src$$reg),
+            as_FloatRegister($tmp$$reg));
+  %}
+  ins_pipe(vshift64);
+%}
+
+instruct vsra8S(vecX dst, vecX src, vecX shift, vecX tmp) %{
+  predicate(n->as_Vector()->length() == 8);
+  match(Set dst (RShiftVS src shift));
+  ins_cost(INSN_COST);
+  effect(TEMP tmp);
+  format %{ "negr  $tmp,$shift\t"
+            "sshl  $dst,$src,$tmp\t# vector (8H)" %}
+  ins_encode %{
+    __ negr(as_FloatRegister($tmp$$reg), __ T16B,
+            as_FloatRegister($shift$$reg));
+    __ sshl(as_FloatRegister($dst$$reg), __ T8H,
+            as_FloatRegister($src$$reg),
+            as_FloatRegister($tmp$$reg));
+  %}
+  ins_pipe(vshift128);
+%}
+
+instruct vsrl4S(vecD dst, vecD src, vecD shift, vecD tmp) %{
   predicate(n->as_Vector()->length() == 2 ||
             n->as_Vector()->length() == 4);
   match(Set dst (URShiftVS src shift));
   ins_cost(INSN_COST);
-  format %{ "ushl  $dst,$src,$shift\t# vector (4H)" %}
-  ins_encode %{
+  effect(TEMP tmp);
+  format %{ "negr  $tmp,$shift\t"
+            "ushl  $dst,$src,$tmp\t# vector (4H)" %}
+  ins_encode %{
+    __ negr(as_FloatRegister($tmp$$reg), __ T8B,
+            as_FloatRegister($shift$$reg));
     __ ushl(as_FloatRegister($dst$$reg), __ T4H,
             as_FloatRegister($src$$reg),
-            as_FloatRegister($shift$$reg));
+            as_FloatRegister($tmp$$reg));
   %}
   ins_pipe(vshift64);
 %}
 
-instruct vsrl8S(vecX dst, vecX src, vecX shift) %{
+instruct vsrl8S(vecX dst, vecX src, vecX shift, vecX tmp) %{
   predicate(n->as_Vector()->length() == 8);
   match(Set dst (URShiftVS src shift));
   ins_cost(INSN_COST);
-  format %{ "ushl  $dst,$src,$shift\t# vector (8H)" %}
-  ins_encode %{
+  effect(TEMP tmp);
+  format %{ "negr  $tmp,$shift\t"
+            "ushl  $dst,$src,$tmp\t# vector (8H)" %}
+  ins_encode %{
+    __ negr(as_FloatRegister($tmp$$reg), __ T16B,
+            as_FloatRegister($shift$$reg));
     __ ushl(as_FloatRegister($dst$$reg), __ T8H,
             as_FloatRegister($src$$reg),
-            as_FloatRegister($shift$$reg));
+            as_FloatRegister($tmp$$reg));
   %}
   ins_pipe(vshift128);
 %}
@@ -16871,10 +16980,9 @@
   ins_pipe(vshift128_imm);
 %}
 
-instruct vsll2I(vecD dst, vecD src, vecX shift) %{
+instruct vsll2I(vecD dst, vecD src, vecD shift) %{
   predicate(n->as_Vector()->length() == 2);
   match(Set dst (LShiftVI src shift));
-  match(Set dst (RShiftVI src shift));
   ins_cost(INSN_COST);
   format %{ "sshl  $dst,$src,$shift\t# vector (2S)" %}
   ins_encode %{
@@ -16888,7 +16996,6 @@
 instruct vsll4I(vecX dst, vecX src, vecX shift) %{
   predicate(n->as_Vector()->length() == 4);
   match(Set dst (LShiftVI src shift));
-  match(Set dst (RShiftVI src shift));
   ins_cost(INSN_COST);
   format %{ "sshl  $dst,$src,$shift\t# vector (4S)" %}
   ins_encode %{
@@ -16899,28 +17006,70 @@
   ins_pipe(vshift128);
 %}
 
-instruct vsrl2I(vecD dst, vecD src, vecX shift) %{
+instruct vsra2I(vecD dst, vecD src, vecD shift, vecD tmp) %{
   predicate(n->as_Vector()->length() == 2);
-  match(Set dst (URShiftVI src shift));
-  ins_cost(INSN_COST);
-  format %{ "ushl  $dst,$src,$shift\t# vector (2S)" %}
-  ins_encode %{
-    __ ushl(as_FloatRegister($dst$$reg), __ T2S,
+  match(Set dst (RShiftVI src shift));
+  ins_cost(INSN_COST);
+  effect(TEMP tmp);
+  format %{ "negr  $tmp,$shift\t"
+            "sshl  $dst,$src,$tmp\t# vector (2S)" %}
+  ins_encode %{
+    __ negr(as_FloatRegister($tmp$$reg), __ T8B,
+            as_FloatRegister($shift$$reg));
+    __ sshl(as_FloatRegister($dst$$reg), __ T2S,
             as_FloatRegister($src$$reg),
-            as_FloatRegister($shift$$reg));
+            as_FloatRegister($tmp$$reg));
   %}
   ins_pipe(vshift64);
 %}
 
-instruct vsrl4I(vecX dst, vecX src, vecX shift) %{
+instruct vsra4I(vecX dst, vecX src, vecX shift, vecX tmp) %{
+  predicate(n->as_Vector()->length() == 4);
+  match(Set dst (RShiftVI src shift));
+  ins_cost(INSN_COST);
+  effect(TEMP tmp);
+  format %{ "negr  $tmp,$shift\t"
+            "sshl  $dst,$src,$tmp\t# vector (4S)" %}
+  ins_encode %{
+    __ negr(as_FloatRegister($tmp$$reg), __ T16B,
+            as_FloatRegister($shift$$reg));
+    __ sshl(as_FloatRegister($dst$$reg), __ T4S,
+            as_FloatRegister($src$$reg),
+            as_FloatRegister($tmp$$reg));
+  %}
+  ins_pipe(vshift128);
+%}
+
+instruct vsrl2I(vecD dst, vecD src, vecD shift, vecD tmp) %{
+  predicate(n->as_Vector()->length() == 2);
+  match(Set dst (URShiftVI src shift));
+  ins_cost(INSN_COST);
+  effect(TEMP tmp);
+  format %{ "negr  $tmp,$shift\t"
+            "ushl  $dst,$src,$tmp\t# vector (2S)" %}
+  ins_encode %{
+    __ negr(as_FloatRegister($tmp$$reg), __ T8B,
+            as_FloatRegister($shift$$reg));
+    __ ushl(as_FloatRegister($dst$$reg), __ T2S,
+            as_FloatRegister($src$$reg),
+            as_FloatRegister($tmp$$reg));
+  %}
+  ins_pipe(vshift64);
+%}
+
+instruct vsrl4I(vecX dst, vecX src, vecX shift, vecX tmp) %{
   predicate(n->as_Vector()->length() == 4);
   match(Set dst (URShiftVI src shift));
   ins_cost(INSN_COST);
-  format %{ "ushl  $dst,$src,$shift\t# vector (4S)" %}
-  ins_encode %{
+  effect(TEMP tmp);
+  format %{ "negr  $tmp,$shift\t"
+            "ushl  $dst,$src,$tmp\t# vector (4S)" %}
+  ins_encode %{
+    __ negr(as_FloatRegister($tmp$$reg), __ T16B,
+            as_FloatRegister($shift$$reg));
     __ ushl(as_FloatRegister($dst$$reg), __ T4S,
             as_FloatRegister($src$$reg),
-            as_FloatRegister($shift$$reg));
+            as_FloatRegister($tmp$$reg));
   %}
   ins_pipe(vshift128);
 %}
@@ -17006,7 +17155,6 @@
 instruct vsll2L(vecX dst, vecX src, vecX shift) %{
   predicate(n->as_Vector()->length() == 2);
   match(Set dst (LShiftVL src shift));
-  match(Set dst (RShiftVL src shift));
   ins_cost(INSN_COST);
   format %{ "sshl  $dst,$src,$shift\t# vector (2D)" %}
   ins_encode %{
@@ -17017,15 +17165,36 @@
   ins_pipe(vshift128);
 %}
 
-instruct vsrl2L(vecX dst, vecX src, vecX shift) %{
+instruct vsra2L(vecX dst, vecX src, vecX shift, vecX tmp) %{
+  predicate(n->as_Vector()->length() == 2);
+  match(Set dst (RShiftVL src shift));
+  ins_cost(INSN_COST);
+  effect(TEMP tmp);
+  format %{ "negr  $tmp,$shift\t"
+            "sshl  $dst,$src,$tmp\t# vector (2D)" %}
+  ins_encode %{
+    __ negr(as_FloatRegister($tmp$$reg), __ T16B,
+            as_FloatRegister($shift$$reg));
+    __ sshl(as_FloatRegister($dst$$reg), __ T2D,
+            as_FloatRegister($src$$reg),
+            as_FloatRegister($tmp$$reg));
+  %}
+  ins_pipe(vshift128);
+%}
+
+instruct vsrl2L(vecX dst, vecX src, vecX shift, vecX tmp) %{
   predicate(n->as_Vector()->length() == 2);
   match(Set dst (URShiftVL src shift));
   ins_cost(INSN_COST);
-  format %{ "ushl  $dst,$src,$shift\t# vector (2D)" %}
-  ins_encode %{
+  effect(TEMP tmp);
+  format %{ "negr  $tmp,$shift\t"
+            "ushl  $dst,$src,$tmp\t# vector (2D)" %}
+  ins_encode %{
+    __ negr(as_FloatRegister($tmp$$reg), __ T16B,
+            as_FloatRegister($shift$$reg));
     __ ushl(as_FloatRegister($dst$$reg), __ T2D,
             as_FloatRegister($src$$reg),
-            as_FloatRegister($shift$$reg));
+            as_FloatRegister($tmp$$reg));
   %}
   ins_pipe(vshift128);
 %}
--- a/src/hotspot/cpu/aarch64/macroAssembler_aarch64.cpp	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/hotspot/cpu/aarch64/macroAssembler_aarch64.cpp	Tue Jan 15 10:55:26 2019 -0800
@@ -4896,7 +4896,7 @@
 
   // A very short string
   cmpw(cnt2, minCharsInWord);
-  br(Assembler::LT, SHORT_STRING);
+  br(Assembler::LE, SHORT_STRING);
 
   // Compare longwords
   // load first parts of strings and finish initialization while loading
@@ -4920,8 +4920,7 @@
       ldr(tmp2, Address(str2));
       cmp(cnt2, STUB_THRESHOLD);
       br(GE, STUB);
-      subsw(cnt2, cnt2, 4);
-      br(EQ, TAIL_CHECK);
+      subw(cnt2, cnt2, 4);
       eor(vtmpZ, T16B, vtmpZ, vtmpZ);
       lea(str1, Address(str1, cnt2, Address::uxtw(str1_chr_shift)));
       lea(str2, Address(str2, cnt2, Address::uxtw(str2_chr_shift)));
@@ -4937,8 +4936,7 @@
       ldrs(vtmp, Address(str2));
       cmp(cnt2, STUB_THRESHOLD);
       br(GE, STUB);
-      subsw(cnt2, cnt2, 4);
-      br(EQ, TAIL_CHECK);
+      subw(cnt2, cnt2, 4);
       lea(str1, Address(str1, cnt2, Address::uxtw(str1_chr_shift)));
       eor(vtmpZ, T16B, vtmpZ, vtmpZ);
       lea(str2, Address(str2, cnt2, Address::uxtw(str2_chr_shift)));
@@ -5650,12 +5648,12 @@
           orr(v5, T16B, Vtmp3, Vtmp4);
           uzp1(Vtmp1, T16B, Vtmp1, Vtmp2);
           uzp1(Vtmp3, T16B, Vtmp3, Vtmp4);
-          stpq(Vtmp1, Vtmp3, dst);
           uzp2(v5, T16B, v4, v5); // high bytes
           umov(tmp2, v5, D, 1);
           fmovd(tmp1, v5);
           orr(tmp1, tmp1, tmp2);
           cbnz(tmp1, LOOP_8);
+          stpq(Vtmp1, Vtmp3, dst);
           sub(len, len, 32);
           add(dst, dst, 32);
           add(src, src, 64);
@@ -5673,7 +5671,6 @@
       prfm(Address(src, SoftwarePrefetchHintDistance));
       uzp1(v4, T16B, Vtmp1, Vtmp2);
       uzp1(v5, T16B, Vtmp3, Vtmp4);
-      stpq(v4, v5, dst);
       orr(Vtmp1, T16B, Vtmp1, Vtmp2);
       orr(Vtmp3, T16B, Vtmp3, Vtmp4);
       uzp2(Vtmp1, T16B, Vtmp1, Vtmp3); // high bytes
@@ -5681,6 +5678,7 @@
       fmovd(tmp1, Vtmp1);
       orr(tmp1, tmp1, tmp2);
       cbnz(tmp1, LOOP_8);
+      stpq(v4, v5, dst);
       sub(len, len, 32);
       add(dst, dst, 32);
       add(src, src, 64);
@@ -5695,9 +5693,9 @@
       ld1(Vtmp1, T8H, src);
       uzp1(Vtmp2, T16B, Vtmp1, Vtmp1); // low bytes
       uzp2(Vtmp3, T16B, Vtmp1, Vtmp1); // high bytes
-      strd(Vtmp2, dst);
       fmovd(tmp1, Vtmp3);
       cbnz(tmp1, NEXT_1);
+      strd(Vtmp2, dst);
 
       sub(len, len, 8);
       add(dst, dst, 8);
@@ -5710,9 +5708,9 @@
     cbz(len, DONE);
     BIND(NEXT_1);
       ldrh(tmp1, Address(post(src, 2)));
-      strb(tmp1, Address(post(dst, 1)));
       tst(tmp1, 0xff00);
       br(NE, SET_RESULT);
+      strb(tmp1, Address(post(dst, 1)));
       subs(len, len, 1);
       br(GT, NEXT_1);
 
--- a/src/hotspot/cpu/aarch64/methodHandles_aarch64.cpp	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/hotspot/cpu/aarch64/methodHandles_aarch64.cpp	Tue Jan 15 10:55:26 2019 -0800
@@ -105,8 +105,8 @@
     // compiled code in threads for which the event is enabled.  Check here for
     // interp_only_mode if these events CAN be enabled.
 
-    __ ldrb(rscratch1, Address(rthread, JavaThread::interp_only_mode_offset()));
-    __ cbnz(rscratch1, run_compiled_code);
+    __ ldrw(rscratch1, Address(rthread, JavaThread::interp_only_mode_offset()));
+    __ cbzw(rscratch1, run_compiled_code);
     __ ldr(rscratch1, Address(method, Method::interpreter_entry_offset()));
     __ br(rscratch1);
     __ BIND(run_compiled_code);
--- a/src/hotspot/cpu/aarch64/templateInterpreterGenerator_aarch64.cpp	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/hotspot/cpu/aarch64/templateInterpreterGenerator_aarch64.cpp	Tue Jan 15 10:55:26 2019 -0800
@@ -1886,6 +1886,7 @@
   __ restore_locals();
   __ restore_constant_pool_cache();
   __ get_method(rmethod);
+  __ get_dispatch();
 
   // The method data pointer was incremented already during
   // call profiling. We have to restore the mdp for the current bcp.
--- a/src/hotspot/cpu/arm/arm.ad	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/hotspot/cpu/arm/arm.ad	Tue Jan 15 10:55:26 2019 -0800
@@ -8945,9 +8945,10 @@
 instruct cmpFastLock(flagsRegP pcc, iRegP object, iRegP box, iRegP scratch2, iRegP scratch )
 %{
   match(Set pcc (FastLock object box));
+  predicate(!(UseBiasedLocking && !UseOptoBiasInlining));
 
   effect(TEMP scratch, TEMP scratch2);
-  ins_cost(100);
+  ins_cost(DEFAULT_COST*3);
 
   format %{ "FASTLOCK  $object, $box; KILL $scratch, $scratch2" %}
   ins_encode %{
@@ -8956,6 +8957,21 @@
   ins_pipe(long_memory_op);
 %}
 
+instruct cmpFastLock_noBiasInline(flagsRegP pcc, iRegP object, iRegP box, iRegP scratch2,
+                                  iRegP scratch, iRegP scratch3) %{
+  match(Set pcc (FastLock object box));
+  predicate(UseBiasedLocking && !UseOptoBiasInlining);
+
+  effect(TEMP scratch, TEMP scratch2, TEMP scratch3);
+  ins_cost(DEFAULT_COST*5);
+
+  format %{ "FASTLOCK  $object, $box; KILL $scratch, $scratch2, $scratch3" %}
+  ins_encode %{
+    __ fast_lock($object$$Register, $box$$Register, $scratch$$Register, $scratch2$$Register, $scratch3$$Register);
+  %}
+  ins_pipe(long_memory_op);
+%}
+
 
 instruct cmpFastUnlock(flagsRegP pcc, iRegP object, iRegP box, iRegP scratch2, iRegP scratch ) %{
   match(Set pcc (FastUnlock object box));
--- a/src/hotspot/cpu/arm/macroAssembler_arm.cpp	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/hotspot/cpu/arm/macroAssembler_arm.cpp	Tue Jan 15 10:55:26 2019 -0800
@@ -1971,7 +1971,7 @@
 
 
 #ifdef COMPILER2
-void MacroAssembler::fast_lock(Register Roop, Register Rbox, Register Rscratch, Register Rscratch2)
+void MacroAssembler::fast_lock(Register Roop, Register Rbox, Register Rscratch, Register Rscratch2, Register scratch3)
 {
   assert(VM_Version::supports_ldrex(), "unsupported, yet?");
 
@@ -1985,11 +1985,13 @@
   Label fast_lock, done;
 
   if (UseBiasedLocking && !UseOptoBiasInlining) {
-    Label failed;
-    biased_locking_enter(Roop, Rmark, Rscratch, false, noreg, done, failed);
-    bind(failed);
+    assert(scratch3 != noreg, "need extra temporary for -XX:-UseOptoBiasInlining");
+    biased_locking_enter(Roop, Rmark, Rscratch, false, scratch3, done, done);
+    // Fall through if lock not biased otherwise branch to done
   }
 
+  // Invariant: Rmark loaded below does not contain biased lock pattern
+
   ldr(Rmark, Address(Roop, oopDesc::mark_offset_in_bytes()));
   tst(Rmark, markOopDesc::unlocked_value);
   b(fast_lock, ne);
@@ -2016,6 +2018,9 @@
 
   bind(done);
 
+  // At this point flags are set as follows:
+  //  EQ -> Success
+  //  NE -> Failure, branch to slow path
 }
 
 void MacroAssembler::fast_unlock(Register Roop, Register Rbox, Register Rscratch, Register Rscratch2)
--- a/src/hotspot/cpu/arm/macroAssembler_arm.hpp	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/hotspot/cpu/arm/macroAssembler_arm.hpp	Tue Jan 15 10:55:26 2019 -0800
@@ -371,10 +371,10 @@
   // lock_reg and obj_reg must be loaded up with the appropriate values.
   // swap_reg must be supplied.
   // tmp_reg must be supplied.
-  // Optional slow case is for implementations (interpreter and C1) which branch to
-  // slow case directly. If slow_case is NULL, then leaves condition
-  // codes set (for C2's Fast_Lock node) and jumps to done label.
-  // Falls through for the fast locking attempt.
+  // Done label is branched to with condition code EQ set if the lock is
+  // biased and we acquired it. Slow case label is branched to with
+  // condition code NE set if the lock is biased but we failed to acquire
+  // it. Otherwise fall through.
   // Returns offset of first potentially-faulting instruction for null
   // check info (currently consumed only by C1). If
   // swap_reg_contains_mark is true then returns -1 as it is assumed
@@ -1073,7 +1073,7 @@
   void restore_default_fp_mode();
 
 #ifdef COMPILER2
-  void fast_lock(Register obj, Register box, Register scratch, Register scratch2);
+  void fast_lock(Register obj, Register box, Register scratch, Register scratch2, Register scratch3 = noreg);
   void fast_unlock(Register obj, Register box, Register scratch, Register scratch2);
 #endif
 
--- a/src/hotspot/cpu/ppc/stubGenerator_ppc.cpp	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/hotspot/cpu/ppc/stubGenerator_ppc.cpp	Tue Jan 15 10:55:26 2019 -0800
@@ -269,7 +269,7 @@
       // when called via a c2i.
 
       // Pass initial_caller_sp to framemanager.
-      __ mr(R21_tmp1, R1_SP);
+      __ mr(R21_sender_SP, R1_SP);
 
       // Do a light-weight C-call here, r_new_arg_entry holds the address
       // of the interpreter entry point (frame manager or native entry)
--- a/src/hotspot/cpu/ppc/templateInterpreterGenerator_ppc.cpp	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/hotspot/cpu/ppc/templateInterpreterGenerator_ppc.cpp	Tue Jan 15 10:55:26 2019 -0800
@@ -532,14 +532,8 @@
   // these parameters the pre-barrier does not generate
   // the load of the previous value.
 
-  // Restore caller sp for c2i case.
-#ifdef ASSERT
-  __ ld(R9_ARG7, 0, R1_SP);
-  __ ld(R10_ARG8, 0, R21_sender_SP);
-  __ cmpd(CCR0, R9_ARG7, R10_ARG8);
-  __ asm_assert_eq("backlink", 0x544);
-#endif // ASSERT
-  __ mr(R1_SP, R21_sender_SP); // Cut the stack back to where the caller started.
+  // Restore caller sp for c2i case (from compiled) and for resized sender frame (from interpreted).
+  __ resize_frame_absolute(R21_sender_SP, R11_scratch1, R0);
 
   __ blr();
 
@@ -835,8 +829,13 @@
   assert(StubRoutines::throw_StackOverflowError_entry() != NULL, "generated in wrong order");
   __ load_const_optimized(Rscratch1, (StubRoutines::throw_StackOverflowError_entry()), R0);
   __ mtctr(Rscratch1);
-  // Restore caller_sp.
+  // Restore caller_sp (c2i adapter may exist, but no shrinking of interpreted caller frame).
 #ifdef ASSERT
+  Label frame_not_shrunk;
+  __ cmpld(CCR0, R1_SP, R21_sender_SP);
+  __ ble(CCR0, frame_not_shrunk);
+  __ stop("frame shrunk", 0x546);
+  __ bind(frame_not_shrunk);
   __ ld(Rscratch1, 0, R1_SP);
   __ ld(R0, 0, R21_sender_SP);
   __ cmpd(CCR0, R0, Rscratch1);
@@ -1155,15 +1154,6 @@
     }
   }
 
-  // Pop c2i arguments (if any) off when we return.
-#ifdef ASSERT
-  __ ld(R9_ARG7, 0, R1_SP);
-  __ ld(R10_ARG8, 0, R21_sender_SP);
-  __ cmpd(CCR0, R9_ARG7, R10_ARG8);
-  __ asm_assert_eq("backlink", 0x545);
-#endif // ASSERT
-  __ mr(R1_SP, R21_sender_SP); // Cut the stack back to where the caller started.
-
   if (use_instruction) {
     switch (kind) {
       case Interpreter::java_lang_math_sqrt: __ fsqrt(F1_RET, F1);          break;
@@ -1188,6 +1178,8 @@
     __ restore_LR_CR(R0);
   }
 
+  // Restore caller sp for c2i case (from compiled) and for resized sender frame (from interpreted).
+  __ resize_frame_absolute(R21_sender_SP, R11_scratch1, R0);
   __ blr();
 
   __ flush();
@@ -1843,8 +1835,8 @@
     StubRoutines::ppc64::generate_load_crc_table_addr(_masm, table);
     __ kernel_crc32_singleByte(crc, data, dataLen, table, tmp, true);
 
-    // Restore caller sp for c2i case and return.
-    __ mr(R1_SP, R21_sender_SP); // Cut the stack back to where the caller started.
+    // Restore caller sp for c2i case (from compiled) and for resized sender frame (from interpreted).
+    __ resize_frame_absolute(R21_sender_SP, R11_scratch1, R0);
     __ blr();
 
     // Generate a vanilla native entry as the slow path.
@@ -1931,8 +1923,8 @@
     // code compactness.
     __ kernel_crc32_1word(crc, data, dataLen, table, t0, t1, t2, t3, tc0, tc1, tc2, tc3, true);
 
-    // Restore caller sp for c2i case and return.
-    __ mr(R1_SP, R21_sender_SP); // Cut the stack back to where the caller started.
+    // Restore caller sp for c2i case (from compiled) and for resized sender frame (from interpreted).
+    __ resize_frame_absolute(R21_sender_SP, R11_scratch1, R0);
     __ blr();
 
     // Generate a vanilla native entry as the slow path.
@@ -2019,8 +2011,8 @@
     // code compactness.
     __ kernel_crc32_1word(crc, data, dataLen, table, t0, t1, t2, t3, tc0, tc1, tc2, tc3, false);
 
-    // Restore caller sp for c2i case and return.
-    __ mr(R1_SP, R21_sender_SP); // Cut the stack back to where the caller started.
+    // Restore caller sp for c2i case (from compiled) and for resized sender frame (from interpreted).
+    __ resize_frame_absolute(R21_sender_SP, R11_scratch1, R0);
     __ blr();
 
     BLOCK_COMMENT("} CRC32C_update{Bytes|DirectByteBuffer}");
--- a/src/hotspot/cpu/x86/c1_LIRAssembler_x86.cpp	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/hotspot/cpu/x86/c1_LIRAssembler_x86.cpp	Tue Jan 15 10:55:26 2019 -0800
@@ -649,7 +649,7 @@
 
     case T_FLOAT: {
       if (dest->is_single_xmm()) {
-        if (LP64_ONLY(UseAVX < 2 &&) c->is_zero_float()) {
+        if (LP64_ONLY(UseAVX <= 2 &&) c->is_zero_float()) {
           __ xorps(dest->as_xmm_float_reg(), dest->as_xmm_float_reg());
         } else {
           __ movflt(dest->as_xmm_float_reg(),
@@ -671,7 +671,7 @@
 
     case T_DOUBLE: {
       if (dest->is_double_xmm()) {
-        if (LP64_ONLY(UseAVX < 2 &&) c->is_zero_double()) {
+        if (LP64_ONLY(UseAVX <= 2 &&) c->is_zero_double()) {
           __ xorpd(dest->as_xmm_double_reg(), dest->as_xmm_double_reg());
         } else {
           __ movdbl(dest->as_xmm_double_reg(),
--- a/src/hotspot/cpu/x86/x86.ad	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/hotspot/cpu/x86/x86.ad	Tue Jan 15 10:55:26 2019 -0800
@@ -2924,11 +2924,11 @@
   match(Set dst src);
   format %{ "movdqu $dst,$src\t! load vector (16 bytes)" %}
   ins_encode %{
-    if (UseAVX < 2 || VM_Version::supports_avx512vl()) {
-      __ movdqu($dst$$XMMRegister, $src$$XMMRegister);
-    } else {
+    if (UseAVX > 2 && !VM_Version::supports_avx512vl()) {
       int vector_len = 2;
       __ evmovdquq($dst$$XMMRegister, $src$$XMMRegister, vector_len);
+    } else {
+      __ movdqu($dst$$XMMRegister, $src$$XMMRegister);
     }
   %}
   ins_pipe( fpu_reg_reg );
@@ -2939,11 +2939,11 @@
   match(Set dst src);
   format %{ "movdqu $dst,$src\t! load vector (16 bytes)" %}
   ins_encode %{
-    if (UseAVX < 2 || VM_Version::supports_avx512vl()) {
-      __ movdqu($dst$$XMMRegister, $src$$XMMRegister);
-    } else {
+    if (UseAVX > 2 && !VM_Version::supports_avx512vl()) {
       int vector_len = 2;
       __ evmovdquq($dst$$XMMRegister, $src$$XMMRegister, vector_len);
+    } else {
+      __ movdqu($dst$$XMMRegister, $src$$XMMRegister);
     }
   %}
   ins_pipe( fpu_reg_reg );
@@ -2966,11 +2966,11 @@
   match(Set dst src);
   format %{ "vmovdqu $dst,$src\t! load vector (32 bytes)" %}
   ins_encode %{
-    if (UseAVX < 2 || VM_Version::supports_avx512vl()) {
-      __ vmovdqu($dst$$XMMRegister, $src$$XMMRegister);
-    } else {
+    if (UseAVX > 2 && !VM_Version::supports_avx512vl()) {
       int vector_len = 2;
       __ evmovdquq($dst$$XMMRegister, $src$$XMMRegister, vector_len);
+    } else {
+      __ vmovdqu($dst$$XMMRegister, $src$$XMMRegister);
     }
   %}
   ins_pipe( fpu_reg_reg );
@@ -2981,11 +2981,11 @@
   match(Set dst src);
   format %{ "vmovdqu $dst,$src\t! load vector (32 bytes)" %}
   ins_encode %{
-    if (UseAVX < 2 || VM_Version::supports_avx512vl()) {
-      __ vmovdqu($dst$$XMMRegister, $src$$XMMRegister);
-    } else {
+    if (UseAVX > 2 && !VM_Version::supports_avx512vl()) {
       int vector_len = 2;
       __ evmovdquq($dst$$XMMRegister, $src$$XMMRegister, vector_len);
+    } else {
+      __ vmovdqu($dst$$XMMRegister, $src$$XMMRegister);
     }
   %}
   ins_pipe( fpu_reg_reg );
--- a/src/hotspot/cpu/x86/x86_32.ad	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/hotspot/cpu/x86/x86_32.ad	Tue Jan 15 10:55:26 2019 -0800
@@ -7760,9 +7760,9 @@
   match(Set dst (MulAddS2I (Binary dst src1) (Binary src2 src3)));
   effect(KILL cr, KILL src2);
 
-  expand %{ mulI_rReg(dst, src1, cr);
-           mulI_rReg(src2, src3, cr);
-           addI_rReg(dst, src2, cr); %}
+  expand %{ mulI_eReg(dst, src1, cr);
+           mulI_eReg(src2, src3, cr);
+           addI_eReg(dst, src2, cr); %}
 %}
 
 // Multiply Register Int to Long
--- a/src/hotspot/cpu/x86/x86_64.ad	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/hotspot/cpu/x86/x86_64.ad	Tue Jan 15 10:55:26 2019 -0800
@@ -4265,132 +4265,196 @@
 
 // Operands for bound floating pointer register arguments
 operand rxmm0() %{
-  constraint(ALLOC_IN_RC(xmm0_reg));  match(VecX);
-  predicate((UseSSE > 0) && (UseAVX<= 2));  format%{%}  interface(REG_INTER);
+  constraint(ALLOC_IN_RC(xmm0_reg));
+  match(VecX);
+  format%{%}
+  interface(REG_INTER);
 %}
 operand rxmm1() %{
-  constraint(ALLOC_IN_RC(xmm1_reg));  match(VecX);
-  predicate((UseSSE > 0) && (UseAVX <= 2));  format%{%}  interface(REG_INTER);
+  constraint(ALLOC_IN_RC(xmm1_reg));
+  match(VecX);
+  format%{%}
+  interface(REG_INTER);
 %}
 operand rxmm2() %{
-  constraint(ALLOC_IN_RC(xmm2_reg));  match(VecX);
-  predicate((UseSSE > 0) && (UseAVX <= 2));  format%{%}  interface(REG_INTER);
+  constraint(ALLOC_IN_RC(xmm2_reg));
+  match(VecX);
+  format%{%}
+  interface(REG_INTER);
 %}
 operand rxmm3() %{
-  constraint(ALLOC_IN_RC(xmm3_reg));  match(VecX);
-  predicate((UseSSE > 0) && (UseAVX <= 2));  format%{%}  interface(REG_INTER);
+  constraint(ALLOC_IN_RC(xmm3_reg));
+  match(VecX);
+  format%{%}
+  interface(REG_INTER);
 %}
 operand rxmm4() %{
-  constraint(ALLOC_IN_RC(xmm4_reg));  match(VecX);
-  predicate((UseSSE > 0) && (UseAVX <= 2));  format%{%}  interface(REG_INTER);
+  constraint(ALLOC_IN_RC(xmm4_reg));
+  match(VecX);
+  format%{%}
+  interface(REG_INTER);
 %}
 operand rxmm5() %{
-  constraint(ALLOC_IN_RC(xmm5_reg));  match(VecX);
-  predicate((UseSSE > 0) && (UseAVX <= 2));  format%{%}  interface(REG_INTER);
+  constraint(ALLOC_IN_RC(xmm5_reg));
+  match(VecX);
+  format%{%}
+  interface(REG_INTER);
 %}
 operand rxmm6() %{
-  constraint(ALLOC_IN_RC(xmm6_reg));  match(VecX);
-  predicate((UseSSE > 0) && (UseAVX <= 2));  format%{%}  interface(REG_INTER);
+  constraint(ALLOC_IN_RC(xmm6_reg));
+  match(VecX);
+  format%{%}
+  interface(REG_INTER);
 %}
 operand rxmm7() %{
-  constraint(ALLOC_IN_RC(xmm7_reg));  match(VecX);
-  predicate((UseSSE > 0) && (UseAVX <= 2));  format%{%}  interface(REG_INTER);
+  constraint(ALLOC_IN_RC(xmm7_reg));
+  match(VecX);
+  format%{%}
+  interface(REG_INTER);
 %}
 operand rxmm8() %{
-  constraint(ALLOC_IN_RC(xmm8_reg));  match(VecX);
-  predicate((UseSSE > 0) && (UseAVX <= 2));  format%{%}  interface(REG_INTER);
+  constraint(ALLOC_IN_RC(xmm8_reg));
+  match(VecX);
+  format%{%}
+  interface(REG_INTER);
 %}
 operand rxmm9() %{
-  constraint(ALLOC_IN_RC(xmm9_reg));  match(VecX);
-  predicate((UseSSE > 0) && (UseAVX <= 2));  format%{%}  interface(REG_INTER);
+  constraint(ALLOC_IN_RC(xmm9_reg));
+  match(VecX);
+  format%{%}
+  interface(REG_INTER);
 %}
 operand rxmm10() %{
-  constraint(ALLOC_IN_RC(xmm10_reg));  match(VecX);
-  predicate((UseSSE > 0) && (UseAVX <= 2));  format%{%}  interface(REG_INTER);
+  constraint(ALLOC_IN_RC(xmm10_reg));
+  match(VecX);
+  format%{%}
+  interface(REG_INTER);
 %}
 operand rxmm11() %{
-  constraint(ALLOC_IN_RC(xmm11_reg));  match(VecX);
-  predicate((UseSSE > 0) && (UseAVX <= 2));  format%{%}  interface(REG_INTER);
+  constraint(ALLOC_IN_RC(xmm11_reg));
+  match(VecX);
+  format%{%}
+  interface(REG_INTER);
 %}
 operand rxmm12() %{
-  constraint(ALLOC_IN_RC(xmm12_reg));  match(VecX);
-  predicate((UseSSE > 0) && (UseAVX <= 2));  format%{%}  interface(REG_INTER);
+  constraint(ALLOC_IN_RC(xmm12_reg));
+  match(VecX);
+  format%{%}
+  interface(REG_INTER);
 %}
 operand rxmm13() %{
-  constraint(ALLOC_IN_RC(xmm13_reg));  match(VecX);
-  predicate((UseSSE > 0) && (UseAVX <= 2));  format%{%}  interface(REG_INTER);
+  constraint(ALLOC_IN_RC(xmm13_reg));
+  match(VecX);
+  format%{%}
+  interface(REG_INTER);
 %}
 operand rxmm14() %{
-  constraint(ALLOC_IN_RC(xmm14_reg));  match(VecX);
-  predicate((UseSSE > 0) && (UseAVX <= 2));  format%{%}  interface(REG_INTER);
+  constraint(ALLOC_IN_RC(xmm14_reg));
+  match(VecX);
+  format%{%}
+  interface(REG_INTER);
 %}
 operand rxmm15() %{
-  constraint(ALLOC_IN_RC(xmm15_reg));  match(VecX);
-  predicate((UseSSE > 0) && (UseAVX <= 2));  format%{%}  interface(REG_INTER);
+  constraint(ALLOC_IN_RC(xmm15_reg));
+  match(VecX);
+  format%{%}
+  interface(REG_INTER);
 %}
 operand rxmm16() %{
-  constraint(ALLOC_IN_RC(xmm16_reg));  match(VecX);
-  predicate(UseAVX == 3);  format%{%}  interface(REG_INTER);
+  constraint(ALLOC_IN_RC(xmm16_reg));
+  match(VecX);
+  format%{%}
+  interface(REG_INTER);
 %}
 operand rxmm17() %{
-  constraint(ALLOC_IN_RC(xmm17_reg));  match(VecX);
-  predicate(UseAVX == 3);  format%{%}  interface(REG_INTER);
+  constraint(ALLOC_IN_RC(xmm17_reg));
+  match(VecX);
+  format%{%}
+  interface(REG_INTER);
 %}
 operand rxmm18() %{
-  constraint(ALLOC_IN_RC(xmm18_reg));  match(VecX);
-  predicate(UseAVX == 3);  format%{%}  interface(REG_INTER);
+  constraint(ALLOC_IN_RC(xmm18_reg));
+  match(VecX);
+  format%{%}
+  interface(REG_INTER);
 %}
 operand rxmm19() %{
-  constraint(ALLOC_IN_RC(xmm19_reg));  match(VecX);
-  predicate(UseAVX == 3);  format%{%}  interface(REG_INTER);
+  constraint(ALLOC_IN_RC(xmm19_reg));
+  match(VecX);
+  format%{%}
+  interface(REG_INTER);
 %}
 operand rxmm20() %{
-  constraint(ALLOC_IN_RC(xmm20_reg));  match(VecX);
-  predicate(UseAVX == 3);  format%{%}  interface(REG_INTER);
+  constraint(ALLOC_IN_RC(xmm20_reg));
+  match(VecX);
+  format%{%}
+  interface(REG_INTER);
 %}
 operand rxmm21() %{
-  constraint(ALLOC_IN_RC(xmm21_reg));  match(VecX);
-  predicate(UseAVX == 3);  format%{%}  interface(REG_INTER);
+  constraint(ALLOC_IN_RC(xmm21_reg));
+  match(VecX);
+  format%{%}
+  interface(REG_INTER);
 %}
 operand rxmm22() %{
-  constraint(ALLOC_IN_RC(xmm22_reg));  match(VecX);
-  predicate(UseAVX == 3);  format%{%}  interface(REG_INTER);
+  constraint(ALLOC_IN_RC(xmm22_reg));
+  match(VecX);
+  format%{%}
+  interface(REG_INTER);
 %}
 operand rxmm23() %{
-  constraint(ALLOC_IN_RC(xmm23_reg));  match(VecX);
-  predicate(UseAVX == 3);  format%{%}  interface(REG_INTER);
+  constraint(ALLOC_IN_RC(xmm23_reg));
+  match(VecX);
+  format%{%}
+  interface(REG_INTER);
 %}
 operand rxmm24() %{
-  constraint(ALLOC_IN_RC(xmm24_reg));  match(VecX);
-  predicate(UseAVX == 3);  format%{%}  interface(REG_INTER);
+  constraint(ALLOC_IN_RC(xmm24_reg));
+  match(VecX);
+  format%{%}
+  interface(REG_INTER);
 %}
 operand rxmm25() %{
-  constraint(ALLOC_IN_RC(xmm25_reg));  match(VecX);
-  predicate(UseAVX == 3);  format%{%}  interface(REG_INTER);
+  constraint(ALLOC_IN_RC(xmm25_reg));
+  match(VecX);
+  format%{%}
+  interface(REG_INTER);
 %}
 operand rxmm26() %{
-  constraint(ALLOC_IN_RC(xmm26_reg));  match(VecX);
-  predicate(UseAVX == 3);  format%{%}  interface(REG_INTER);
+  constraint(ALLOC_IN_RC(xmm26_reg));
+  match(VecX);
+  format%{%}
+  interface(REG_INTER);
 %}
 operand rxmm27() %{
-  constraint(ALLOC_IN_RC(xmm27_reg));  match(VecX);
-  predicate(UseAVX == 3);  format%{%}  interface(REG_INTER);
+  constraint(ALLOC_IN_RC(xmm27_reg));
+  match(VecX);
+  format%{%}
+  interface(REG_INTER);
 %}
 operand rxmm28() %{
-  constraint(ALLOC_IN_RC(xmm28_reg));  match(VecX);
-  predicate(UseAVX == 3);  format%{%}  interface(REG_INTER);
+  constraint(ALLOC_IN_RC(xmm28_reg));
+  match(VecX);
+  format%{%}
+  interface(REG_INTER);
 %}
 operand rxmm29() %{
-  constraint(ALLOC_IN_RC(xmm29_reg));  match(VecX);
-  predicate(UseAVX == 3);  format%{%}  interface(REG_INTER);
+  constraint(ALLOC_IN_RC(xmm29_reg));
+  match(VecX);
+  format%{%}
+  interface(REG_INTER);
 %}
 operand rxmm30() %{
-  constraint(ALLOC_IN_RC(xmm30_reg));  match(VecX);
-  predicate(UseAVX == 3);  format%{%}  interface(REG_INTER);
+  constraint(ALLOC_IN_RC(xmm30_reg));
+  match(VecX);
+  format%{%}
+  interface(REG_INTER);
 %}
 operand rxmm31() %{
-  constraint(ALLOC_IN_RC(xmm31_reg));  match(VecX);
-  predicate(UseAVX == 3);  format%{%}  interface(REG_INTER);
+  constraint(ALLOC_IN_RC(xmm31_reg));
+  match(VecX);
+  format%{%}
+  interface(REG_INTER);
 %}
 
 //----------OPERAND CLASSES----------------------------------------------------
@@ -12651,33 +12715,6 @@
 // Execute ZGC load barrier (strong) slow path
 //
 
-// When running without XMM regs
-instruct loadBarrierSlowRegNoVec(rRegP dst, memory mem, rFlagsReg cr) %{
-
-  match(Set dst (LoadBarrierSlowReg mem));
-  predicate(MaxVectorSize < 16);
-
-  effect(DEF dst, KILL cr);
-
-  format %{"LoadBarrierSlowRegNoVec $dst, $mem" %}
-  ins_encode %{
-#if INCLUDE_ZGC
-    Register d = $dst$$Register;
-    ZBarrierSetAssembler* bs = (ZBarrierSetAssembler*)BarrierSet::barrier_set()->barrier_set_assembler();
-
-    assert(d != r12, "Can't be R12!");
-    assert(d != r15, "Can't be R15!");
-    assert(d != rsp, "Can't be RSP!");
-
-    __ lea(d, $mem$$Address);
-    __ call(RuntimeAddress(bs->load_barrier_slow_stub(d)));
-#else
-    ShouldNotReachHere();
-#endif
-  %}
-  ins_pipe(pipe_slow);
-%}
-
 // For XMM and YMM enabled processors
 instruct loadBarrierSlowRegXmmAndYmm(rRegP dst, memory mem, rFlagsReg cr,
                                      rxmm0 x0, rxmm1 x1, rxmm2 x2,rxmm3 x3,
@@ -12686,7 +12723,7 @@
                                      rxmm12 x12, rxmm13 x13, rxmm14 x14, rxmm15 x15) %{
 
   match(Set dst (LoadBarrierSlowReg mem));
-  predicate((UseSSE > 0) && (UseAVX <= 2) && (MaxVectorSize >= 16));
+  predicate(UseAVX <= 2);
 
   effect(DEF dst, KILL cr,
          KILL x0, KILL x1, KILL x2, KILL x3,
@@ -12694,7 +12731,7 @@
          KILL x8, KILL x9, KILL x10, KILL x11,
          KILL x12, KILL x13, KILL x14, KILL x15);
 
-  format %{"LoadBarrierSlowRegXmm $dst, $mem" %}
+  format %{"LoadBarrierSlowRegXmmAndYmm $dst, $mem" %}
   ins_encode %{
 #if INCLUDE_ZGC
     Register d = $dst$$Register;
@@ -12725,7 +12762,7 @@
                                rxmm28 x28, rxmm29 x29, rxmm30 x30, rxmm31 x31) %{
 
   match(Set dst (LoadBarrierSlowReg mem));
-  predicate((UseAVX == 3) && (MaxVectorSize >= 16));
+  predicate(UseAVX == 3);
 
   effect(DEF dst, KILL cr,
          KILL x0, KILL x1, KILL x2, KILL x3,
@@ -12760,33 +12797,6 @@
 // Execute ZGC load barrier (weak) slow path
 //
 
-// When running without XMM regs
-instruct loadBarrierWeakSlowRegNoVec(rRegP dst, memory mem, rFlagsReg cr) %{
-
-  match(Set dst (LoadBarrierSlowReg mem));
-  predicate(MaxVectorSize < 16);
-
-  effect(DEF dst, KILL cr);
-
-  format %{"LoadBarrierSlowRegNoVec $dst, $mem" %}
-  ins_encode %{
-#if INCLUDE_ZGC
-    Register d = $dst$$Register;
-    ZBarrierSetAssembler* bs = (ZBarrierSetAssembler*)BarrierSet::barrier_set()->barrier_set_assembler();
-
-    assert(d != r12, "Can't be R12!");
-    assert(d != r15, "Can't be R15!");
-    assert(d != rsp, "Can't be RSP!");
-
-    __ lea(d, $mem$$Address);
-    __ call(RuntimeAddress(bs->load_barrier_weak_slow_stub(d)));
-#else
-    ShouldNotReachHere();
-#endif
-  %}
-  ins_pipe(pipe_slow);
-%}
-
 // For XMM and YMM enabled processors
 instruct loadBarrierWeakSlowRegXmmAndYmm(rRegP dst, memory mem, rFlagsReg cr,
                                          rxmm0 x0, rxmm1 x1, rxmm2 x2,rxmm3 x3,
@@ -12795,7 +12805,7 @@
                                          rxmm12 x12, rxmm13 x13, rxmm14 x14, rxmm15 x15) %{
 
   match(Set dst (LoadBarrierWeakSlowReg mem));
-  predicate((UseSSE > 0) && (UseAVX <= 2) && (MaxVectorSize >= 16));
+  predicate(UseAVX <= 2);
 
   effect(DEF dst, KILL cr,
          KILL x0, KILL x1, KILL x2, KILL x3,
@@ -12803,7 +12813,7 @@
          KILL x8, KILL x9, KILL x10, KILL x11,
          KILL x12, KILL x13, KILL x14, KILL x15);
 
-  format %{"LoadBarrierWeakSlowRegXmm $dst, $mem" %}
+  format %{"LoadBarrierWeakSlowRegXmmAndYmm $dst, $mem" %}
   ins_encode %{
 #if INCLUDE_ZGC
     Register d = $dst$$Register;
@@ -12834,7 +12844,7 @@
                                    rxmm28 x28, rxmm29 x29, rxmm30 x30, rxmm31 x31) %{
 
   match(Set dst (LoadBarrierWeakSlowReg mem));
-  predicate((UseAVX == 3) && (MaxVectorSize >= 16));
+  predicate(UseAVX == 3);
 
   effect(DEF dst, KILL cr,
          KILL x0, KILL x1, KILL x2, KILL x3,
--- a/src/hotspot/os/linux/os_linux.cpp	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/hotspot/os/linux/os_linux.cpp	Tue Jan 15 10:55:26 2019 -0800
@@ -5073,7 +5073,7 @@
   // initialize thread priority policy
   prio_init();
 
-  if (!FLAG_IS_DEFAULT(AllocateHeapAt)) {
+  if (!FLAG_IS_DEFAULT(AllocateHeapAt) || !FLAG_IS_DEFAULT(AllocateOldGenAt)) {
     set_coredump_filter(DAX_SHARED_BIT);
   }
 
--- a/src/hotspot/os_cpu/linux_aarch64/os_linux_aarch64.cpp	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/hotspot/os_cpu/linux_aarch64/os_linux_aarch64.cpp	Tue Jan 15 10:55:26 2019 -0800
@@ -370,7 +370,6 @@
       if (thread->on_local_stack(addr)) {
         // stack overflow
         if (thread->in_stack_yellow_reserved_zone(addr)) {
-          thread->disable_stack_yellow_reserved_zone();
           if (thread->thread_state() == _thread_in_Java) {
             if (thread->in_stack_reserved_zone(addr)) {
               frame fr;
@@ -392,9 +391,11 @@
             }
             // Throw a stack overflow exception.  Guard pages will be reenabled
             // while unwinding the stack.
+            thread->disable_stack_yellow_reserved_zone();
             stub = SharedRuntime::continuation_for_implicit_exception(thread, pc, SharedRuntime::STACK_OVERFLOW);
           } else {
             // Thread was in the vm or native code.  Return and try to finish.
+            thread->disable_stack_yellow_reserved_zone();
             return 1;
           }
         } else if (thread->in_stack_red_zone(addr)) {
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/hotspot/os_cpu/linux_x86/gc/z/zArguments_linux_x86.cpp	Tue Jan 15 10:55:26 2019 -0800
@@ -0,0 +1,42 @@
+/*
+ * Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+#include "precompiled.hpp"
+#include "gc/z/zArguments.hpp"
+#include "runtime/globals.hpp"
+#include "runtime/globals_extension.hpp"
+#include "utilities/debug.hpp"
+
+void ZArguments::initialize_platform() {
+#ifdef COMPILER2
+  // The C2 barrier slow path expects vector registers to be least
+  // 16 bytes wide, which is the minimum width available on all
+  // x86-64 systems. However, the user could have speficied a lower
+  // number on the command-line, in which case we print a warning
+  // and raise it to 16.
+  if (MaxVectorSize < 16) {
+    warning("ZGC requires MaxVectorSize to be at least 16");
+    FLAG_SET_DEFAULT(MaxVectorSize, 16);
+  }
+#endif
+}
--- a/src/hotspot/share/ci/ciEnv.hpp	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/hotspot/share/ci/ciEnv.hpp	Tue Jan 15 10:55:26 2019 -0800
@@ -46,6 +46,7 @@
 
   friend class CompileBroker;
   friend class Dependencies;  // for get_object, during logging
+  friend class PrepareExtraDataClosure;
 
 private:
   Arena*           _arena;       // Alias for _ciEnv_arena except in init_shared_objects()
@@ -188,6 +189,10 @@
     }
   }
 
+  ciMetadata* cached_metadata(Metadata* o) {
+    return _factory->cached_metadata(o);
+  }
+
   ciInstance* get_instance(oop o) {
     if (o == NULL) return NULL;
     return get_object(o)->as_instance();
--- a/src/hotspot/share/ci/ciMethodData.cpp	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/hotspot/share/ci/ciMethodData.cpp	Tue Jan 15 10:55:26 2019 -0800
@@ -78,10 +78,81 @@
   _parameters = NULL;
 }
 
+// Check for entries that reference an unloaded method
+class PrepareExtraDataClosure : public CleanExtraDataClosure {
+  MethodData*            _mdo;
+  uint64_t               _safepoint_counter;
+  GrowableArray<Method*> _uncached_methods;
+
+public:
+  PrepareExtraDataClosure(MethodData* mdo)
+    : _mdo(mdo),
+      _safepoint_counter(SafepointSynchronize::safepoint_counter()),
+      _uncached_methods()
+  { }
+
+  bool is_live(Method* m) {
+    if (!m->method_holder()->is_loader_alive()) {
+      return false;
+    }
+    if (CURRENT_ENV->cached_metadata(m) == NULL) {
+      // Uncached entries need to be pre-populated.
+      _uncached_methods.append(m);
+    }
+    return true;
+  }
+
+  bool has_safepointed() {
+    return SafepointSynchronize::safepoint_counter() != _safepoint_counter;
+  }
+
+  bool finish() {
+    if (_uncached_methods.length() == 0) {
+      // Preparation finished iff all Methods* were already cached.
+      return true;
+    }
+    // Holding locks through safepoints is bad practice.
+    MutexUnlocker mu(_mdo->extra_data_lock());
+    for (int i = 0; i < _uncached_methods.length(); ++i) {
+      if (has_safepointed()) {
+        // The metadata in the growable array might contain stale
+        // entries after a safepoint.
+        return false;
+      }
+      Method* method = _uncached_methods.at(i);
+      // Populating ciEnv caches may cause safepoints due
+      // to taking the Compile_lock with safepoint checks.
+      (void)CURRENT_ENV->get_method(method);
+    }
+    return false;
+  }
+};
+
+void ciMethodData::prepare_metadata() {
+  MethodData* mdo = get_MethodData();
+
+  for (;;) {
+    ResourceMark rm;
+    PrepareExtraDataClosure cl(mdo);
+    mdo->clean_extra_data(&cl);
+    if (cl.finish()) {
+      // When encountering uncached metadata, the Compile_lock might be
+      // acquired when creating ciMetadata handles, causing safepoints
+      // which requires a new round of preparation to clean out potentially
+      // new unloading metadata.
+      return;
+    }
+  }
+}
+
 void ciMethodData::load_extra_data() {
   MethodData* mdo = get_MethodData();
-
   MutexLocker ml(mdo->extra_data_lock());
+  // Deferred metadata cleaning due to concurrent class unloading.
+  prepare_metadata();
+  // After metadata preparation, there is no stale metadata,
+  // and no safepoints can introduce more stale metadata.
+  NoSafepointVerifier no_safepoint;
 
   // speculative trap entries also hold a pointer to a Method so need to be translated
   DataLayout* dp_src  = mdo->extra_data_base();
@@ -94,22 +165,21 @@
     // New traps in the MDO may have been added since we copied the
     // data (concurrent deoptimizations before we acquired
     // extra_data_lock above) or can be removed (a safepoint may occur
-    // in the translate_from call below) as we translate the copy:
+    // in the prepare_metadata call above) as we translate the copy:
     // update the copy as we go.
     int tag = dp_src->tag();
-    if (tag != DataLayout::arg_info_data_tag) {
-      memcpy(dp_dst, dp_src, ((intptr_t)MethodData::next_extra(dp_src)) - ((intptr_t)dp_src));
+    size_t entry_size = DataLayout::header_size_in_bytes();
+    if (tag != DataLayout::no_tag) {
+      ProfileData* src_data = dp_src->data_in();
+      entry_size = src_data->size_in_bytes();
     }
+    memcpy(dp_dst, dp_src, entry_size);
 
     switch(tag) {
     case DataLayout::speculative_trap_data_tag: {
       ciSpeculativeTrapData data_dst(dp_dst);
       SpeculativeTrapData   data_src(dp_src);
-
-      { // During translation a safepoint can happen or VM lock can be taken (e.g., Compile_lock).
-        MutexUnlocker ml(mdo->extra_data_lock());
-        data_dst.translate_from(&data_src);
-      }
+      data_dst.translate_from(&data_src);
       break;
     }
     case DataLayout::bit_data_tag:
--- a/src/hotspot/share/ci/ciMethodData.hpp	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/hotspot/share/ci/ciMethodData.hpp	Tue Jan 15 10:55:26 2019 -0800
@@ -475,6 +475,7 @@
     return (address) _data;
   }
 
+  void prepare_metadata();
   void load_extra_data();
   ciProfileData* bci_to_extra_data(int bci, ciMethod* m, bool& two_free_slots);
 
--- a/src/hotspot/share/ci/ciObjectFactory.cpp	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/hotspot/share/ci/ciObjectFactory.cpp	Tue Jan 15 10:55:26 2019 -0800
@@ -266,6 +266,24 @@
 }
 
 // ------------------------------------------------------------------
+// ciObjectFactory::cached_metadata
+//
+// Get the ciMetadata corresponding to some Metadata. If the ciMetadata has
+// already been created, it is returned. Otherwise, null is returned.
+ciMetadata* ciObjectFactory::cached_metadata(Metadata* key) {
+  ASSERT_IN_VM;
+
+  bool found = false;
+  int index = _ci_metadata->find_sorted<Metadata*, ciObjectFactory::metadata_compare>(key, found);
+
+  if (!found) {
+    return NULL;
+  }
+  return _ci_metadata->at(index)->as_metadata();
+}
+
+
+// ------------------------------------------------------------------
 // ciObjectFactory::get_metadata
 //
 // Get the ciMetadata corresponding to some Metadata. If the ciMetadata has
--- a/src/hotspot/share/ci/ciObjectFactory.hpp	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/hotspot/share/ci/ciObjectFactory.hpp	Tue Jan 15 10:55:26 2019 -0800
@@ -100,6 +100,7 @@
   // Get the ciObject corresponding to some oop.
   ciObject* get(oop key);
   ciMetadata* get_metadata(Metadata* key);
+  ciMetadata* cached_metadata(Metadata* key);
   ciSymbol* get_symbol(Symbol* key);
 
   // Get the ciSymbol corresponding to one of the vmSymbols.
--- a/src/hotspot/share/classfile/dictionary.hpp	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/hotspot/share/classfile/dictionary.hpp	Tue Jan 15 10:55:26 2019 -0800
@@ -170,7 +170,7 @@
     for (ProtectionDomainEntry* current = pd_set(); // accessed at a safepoint
                                 current != NULL;
                                 current = current->_next) {
-      guarantee(oopDesc::is_oop(current->_pd_cache->object_no_keepalive()), "Invalid oop");
+      guarantee(oopDesc::is_oop_or_null(current->_pd_cache->object_no_keepalive()), "Invalid oop");
     }
   }
 
--- a/src/hotspot/share/classfile/systemDictionary.cpp	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/hotspot/share/classfile/systemDictionary.cpp	Tue Jan 15 10:55:26 2019 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -1795,14 +1795,17 @@
   assert(k != NULL, "just checking");
   assert_locked_or_safepoint(Compile_lock);
 
-  // Link into hierachy. Make sure the vtables are initialized before linking into
+  k->set_init_state(InstanceKlass::loaded);
+  // make sure init_state store is already done.
+  // The compiler reads the hierarchy outside of the Compile_lock.
+  // Access ordering is used to add to hierarchy.
+
+  // Link into hierachy.
   k->append_to_sibling_list();                    // add to superklass/sibling list
   k->process_interfaces(THREAD);                  // handle all "implements" declarations
-  k->set_init_state(InstanceKlass::loaded);
+
   // Now flush all code that depended on old class hierarchy.
   // Note: must be done *after* linking k into the hierarchy (was bug 12/9/97)
-  // Also, first reinitialize vtable because it may have gotten out of synch
-  // while the new class wasn't connected to the class hierarchy.
   CodeCache::flush_dependents_on(k);
 }
 
--- a/src/hotspot/share/classfile/systemDictionaryShared.cpp	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/hotspot/share/classfile/systemDictionaryShared.cpp	Tue Jan 15 10:55:26 2019 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -503,26 +503,33 @@
 Handle SystemDictionaryShared::get_shared_protection_domain(Handle class_loader,
                                                             ModuleEntry* mod, TRAPS) {
   ClassLoaderData *loader_data = mod->loader_data();
-  Handle protection_domain;
   if (mod->shared_protection_domain() == NULL) {
     Symbol* location = mod->location();
     if (location != NULL) {
-      Handle url_string = java_lang_String::create_from_symbol(
-                                 location, CHECK_(protection_domain));
+      Handle location_string = java_lang_String::create_from_symbol(
+                                     location, CHECK_NH);
+      Handle url;
       JavaValue result(T_OBJECT);
-      Klass* classLoaders_klass =
-        SystemDictionary::jdk_internal_loader_ClassLoaders_klass();
-      JavaCalls::call_static(&result, classLoaders_klass, vmSymbols::toFileURL_name(),
+      if (location->starts_with("jrt:/")) {
+        url = JavaCalls::construct_new_instance(SystemDictionary::URL_klass(),
+                                                vmSymbols::string_void_signature(),
+                                                location_string, CHECK_NH);
+      } else {
+        Klass* classLoaders_klass =
+          SystemDictionary::jdk_internal_loader_ClassLoaders_klass();
+        JavaCalls::call_static(&result, classLoaders_klass, vmSymbols::toFileURL_name(),
                                vmSymbols::toFileURL_signature(),
-                               url_string, CHECK_(protection_domain));
-      Handle url = Handle(THREAD, (oop)result.get_jobject());
+                               location_string, CHECK_NH);
+        url = Handle(THREAD, (oop)result.get_jobject());
+      }
 
-      Handle pd = get_protection_domain_from_classloader(class_loader, url, THREAD);
+      Handle pd = get_protection_domain_from_classloader(class_loader, url,
+                                                         CHECK_NH);
       mod->set_shared_protection_domain(loader_data, pd);
     }
   }
 
-  protection_domain = Handle(THREAD, mod->shared_protection_domain());
+  Handle protection_domain(THREAD, mod->shared_protection_domain());
   assert(protection_domain.not_null(), "sanity");
   return protection_domain;
 }
--- a/src/hotspot/share/code/icBuffer.cpp	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/hotspot/share/code/icBuffer.cpp	Tue Jan 15 10:55:26 2019 -0800
@@ -53,29 +53,29 @@
     _refill_remembered(false)
 {
   Thread* thread = Thread::current();
-  assert(thread->missed_ic_stub_refill_mark() == NULL, "nesting not supported");
-  thread->set_missed_ic_stub_refill_mark(this);
+  assert(thread->missed_ic_stub_refill_verifier() == NULL, "nesting not supported");
+  thread->set_missed_ic_stub_refill_verifier(this);
 }
 
 ICRefillVerifier::~ICRefillVerifier() {
   assert(!_refill_requested || _refill_remembered,
          "Forgot to refill IC stubs after failed IC transition");
-  Thread::current()->set_missed_ic_stub_refill_mark(NULL);
+  Thread::current()->set_missed_ic_stub_refill_verifier(NULL);
 }
 
 ICRefillVerifierMark::ICRefillVerifierMark(ICRefillVerifier* verifier) {
   Thread* thread = Thread::current();
-  assert(thread->missed_ic_stub_refill_mark() == NULL, "nesting not supported");
-  thread->set_missed_ic_stub_refill_mark(this);
+  assert(thread->missed_ic_stub_refill_verifier() == NULL, "nesting not supported");
+  thread->set_missed_ic_stub_refill_verifier(verifier);
 }
 
 ICRefillVerifierMark::~ICRefillVerifierMark() {
-  Thread::current()->set_missed_ic_stub_refill_mark(NULL);
+  Thread::current()->set_missed_ic_stub_refill_verifier(NULL);
 }
 
 static ICRefillVerifier* current_ic_refill_verifier() {
   Thread* current = Thread::current();
-  ICRefillVerifier* verifier = reinterpret_cast<ICRefillVerifier*>(current->missed_ic_stub_refill_mark());
+  ICRefillVerifier* verifier = current->missed_ic_stub_refill_verifier();
   assert(verifier != NULL, "need a verifier for safety");
   return verifier;
 }
--- a/src/hotspot/share/code/nmethod.cpp	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/hotspot/share/code/nmethod.cpp	Tue Jan 15 10:55:26 2019 -0800
@@ -1159,6 +1159,19 @@
   }
 }
 
+void nmethod::unlink_from_method(bool acquire_lock) {
+  // We need to check if both the _code and _from_compiled_code_entry_point
+  // refer to this nmethod because there is a race in setting these two fields
+  // in Method* as seen in bugid 4947125.
+  // If the vep() points to the zombie nmethod, the memory for the nmethod
+  // could be flushed and the compiler and vtable stubs could still call
+  // through it.
+  if (method() != NULL && (method()->code() == this ||
+                           method()->from_compiled_entry() == verified_entry_point())) {
+    method()->clear_code(acquire_lock);
+  }
+}
+
 /**
  * Common functionality for both make_not_entrant and make_zombie
  */
@@ -1246,17 +1259,7 @@
     JVMCI_ONLY(maybe_invalidate_installed_code());
 
     // Remove nmethod from method.
-    // We need to check if both the _code and _from_compiled_code_entry_point
-    // refer to this nmethod because there is a race in setting these two fields
-    // in Method* as seen in bugid 4947125.
-    // If the vep() points to the zombie nmethod, the memory for the nmethod
-    // could be flushed and the compiler and vtable stubs could still call
-    // through it.
-    if (method() != NULL && (method()->code() == this ||
-                             method()->from_compiled_entry() == verified_entry_point())) {
-      HandleMark hm;
-      method()->clear_code(false /* already owns Patching_lock */);
-    }
+    unlink_from_method(false /* already owns Patching_lock */);
   } // leave critical region under Patching_lock
 
 #ifdef ASSERT
@@ -1283,6 +1286,13 @@
       flush_dependencies(/*delete_immediately*/true);
     }
 
+    // Clear ICStubs to prevent back patching stubs of zombie or flushed
+    // nmethods during the next safepoint (see ICStub::finalize).
+    {
+      CompiledICLocker ml(this);
+      clear_ic_stubs();
+    }
+
     // zombie only - if a JVMTI agent has enabled the CompiledMethodUnload
     // event and it hasn't already been reported for this nmethod then
     // report it now. The event may have been reported earlier if the GC
@@ -2533,6 +2543,7 @@
         case relocInfo::section_word_type:     return "section_word";
         case relocInfo::poll_type:             return "poll";
         case relocInfo::poll_return_type:      return "poll_return";
+        case relocInfo::trampoline_stub_type:  return "trampoline_stub";
         case relocInfo::type_mask:             return "type_bit_mask";
 
         default:
--- a/src/hotspot/share/code/nmethod.hpp	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/hotspot/share/code/nmethod.hpp	Tue Jan 15 10:55:26 2019 -0800
@@ -376,6 +376,8 @@
 
   int   comp_level() const                        { return _comp_level; }
 
+  void unlink_from_method(bool acquire_lock);
+
   // Support for oops in scopes and relocs:
   // Note: index 0 is reserved for null.
   oop   oop_at(int index) const;
--- a/src/hotspot/share/code/scopeDesc.cpp	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/hotspot/share/code/scopeDesc.cpp	Tue Jan 15 10:55:26 2019 -0800
@@ -51,9 +51,9 @@
 }
 
 
-ScopeDesc::ScopeDesc(const ScopeDesc* parent) {
+void ScopeDesc::initialize(const ScopeDesc* parent, int decode_offset) {
   _code          = parent->_code;
-  _decode_offset = parent->_sender_decode_offset;
+  _decode_offset = decode_offset;
   _objects       = parent->_objects;
   _reexecute     = false; //reexecute only applies to the first scope
   _rethrow_exception = false;
@@ -61,6 +61,14 @@
   decode_body();
 }
 
+ScopeDesc::ScopeDesc(const ScopeDesc* parent) {
+  initialize(parent, parent->_sender_decode_offset);
+}
+
+ScopeDesc::ScopeDesc(const ScopeDesc* parent, int decode_offset) {
+  initialize(parent, decode_offset);
+}
+
 
 void ScopeDesc::decode_body() {
   if (decode_offset() == DebugInformationRecorder::serialized_null) {
--- a/src/hotspot/share/code/scopeDesc.hpp	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/hotspot/share/code/scopeDesc.hpp	Tue Jan 15 10:55:26 2019 -0800
@@ -67,6 +67,9 @@
   // avoid a .hpp-.hpp dependency.)
   ScopeDesc(const CompiledMethod* code, int decode_offset, bool reexecute, bool rethrow_exception, bool return_oop);
 
+  // Direct access to scope
+  ScopeDesc* at_offset(int decode_offset) { return new ScopeDesc(this, decode_offset); }
+
   // JVM state
   Method* method()      const { return _method; }
   int          bci()      const { return _bci;    }
@@ -85,12 +88,16 @@
   // Returns where the scope was decoded
   int decode_offset() const { return _decode_offset; }
 
+  int sender_decode_offset() const { return _sender_decode_offset; }
+
   // Tells whether sender() returns NULL
   bool is_top() const;
 
  private:
-  // Alternative constructor
+  void initialize(const ScopeDesc* parent, int decode_offset);
+  // Alternative constructors
   ScopeDesc(const ScopeDesc* parent);
+  ScopeDesc(const ScopeDesc* parent, int decode_offset);
 
   // JVM state
   Method*       _method;
--- a/src/hotspot/share/gc/g1/g1Allocator.inline.hpp	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/hotspot/share/gc/g1/g1Allocator.inline.hpp	Tue Jan 15 10:55:26 2019 -0800
@@ -97,7 +97,7 @@
   }
 
   _archive_check_enabled = true;
-  size_t length = Universe::heap()->max_capacity();
+  size_t length = G1CollectedHeap::heap()->max_reserved_capacity();
   _closed_archive_region_map.initialize((HeapWord*)Universe::heap()->base(),
                                         (HeapWord*)Universe::heap()->base() + length,
                                         HeapRegion::GrainBytes);
--- a/src/hotspot/share/gc/g1/g1Arguments.cpp	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/hotspot/share/gc/g1/g1Arguments.cpp	Tue Jan 15 10:55:26 2019 -0800
@@ -28,6 +28,7 @@
 #include "gc/g1/g1CollectedHeap.inline.hpp"
 #include "gc/g1/g1CollectorPolicy.hpp"
 #include "gc/g1/g1HeapVerifier.hpp"
+#include "gc/g1/g1HeterogeneousCollectorPolicy.hpp"
 #include "gc/g1/heapRegion.hpp"
 #include "gc/shared/gcArguments.inline.hpp"
 #include "gc/shared/workerPolicy.hpp"
@@ -156,5 +157,9 @@
 }
 
 CollectedHeap* G1Arguments::create_heap() {
-  return create_heap_with_policy<G1CollectedHeap, G1CollectorPolicy>();
+  if (AllocateOldGenAt != NULL) {
+    return create_heap_with_policy<G1CollectedHeap, G1HeterogeneousCollectorPolicy>();
+  } else {
+    return create_heap_with_policy<G1CollectedHeap, G1CollectorPolicy>();
+  }
 }
--- a/src/hotspot/share/gc/g1/g1CardCounts.cpp	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/hotspot/share/gc/g1/g1CardCounts.cpp	Tue Jan 15 10:55:26 2019 -0800
@@ -63,7 +63,7 @@
 }
 
 void G1CardCounts::initialize(G1RegionToSpaceMapper* mapper) {
-  assert(_g1h->max_capacity() > 0, "initialization order");
+  assert(_g1h->max_reserved_capacity() > 0, "initialization order");
   assert(_g1h->capacity() == 0, "initialization order");
 
   if (G1ConcRSHotCardLimit > 0) {
--- a/src/hotspot/share/gc/g1/g1CollectedHeap.cpp	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/hotspot/share/gc/g1/g1CollectedHeap.cpp	Tue Jan 15 10:55:26 2019 -0800
@@ -161,12 +161,12 @@
 
 // Private methods.
 
-HeapRegion* G1CollectedHeap::new_region(size_t word_size, bool is_old, bool do_expand) {
+HeapRegion* G1CollectedHeap::new_region(size_t word_size, HeapRegionType type, bool do_expand) {
   assert(!is_humongous(word_size) || word_size <= HeapRegion::GrainWords,
          "the only time we use this to allocate a humongous region is "
          "when we are allocating a single humongous region");
 
-  HeapRegion* res = _hrm.allocate_free_region(is_old);
+  HeapRegion* res = _hrm->allocate_free_region(type);
 
   if (res == NULL && do_expand && _expand_heap_after_alloc_failure) {
     // Currently, only attempts to allocate GC alloc regions set
@@ -183,7 +183,7 @@
       // always expand the heap by an amount aligned to the heap
       // region size, the free list should in theory not be empty.
       // In either case allocate_free_region() will check for NULL.
-      res = _hrm.allocate_free_region(is_old);
+      res = _hrm->allocate_free_region(type);
     } else {
       _expand_heap_after_alloc_failure = false;
     }
@@ -330,16 +330,16 @@
     // Only one region to allocate, try to use a fast path by directly allocating
     // from the free lists. Do not try to expand here, we will potentially do that
     // later.
-    HeapRegion* hr = new_region(word_size, true /* is_old */, false /* do_expand */);
+    HeapRegion* hr = new_region(word_size, HeapRegionType::Humongous, false /* do_expand */);
     if (hr != NULL) {
       first = hr->hrm_index();
     }
   } else {
     // Policy: Try only empty regions (i.e. already committed first). Maybe we
     // are lucky enough to find some.
-    first = _hrm.find_contiguous_only_empty(obj_regions);
+    first = _hrm->find_contiguous_only_empty(obj_regions);
     if (first != G1_NO_HRM_INDEX) {
-      _hrm.allocate_free_regions_starting_at(first, obj_regions);
+      _hrm->allocate_free_regions_starting_at(first, obj_regions);
     }
   }
 
@@ -347,14 +347,14 @@
     // Policy: We could not find enough regions for the humongous object in the
     // free list. Look through the heap to find a mix of free and uncommitted regions.
     // If so, try expansion.
-    first = _hrm.find_contiguous_empty_or_unavailable(obj_regions);
+    first = _hrm->find_contiguous_empty_or_unavailable(obj_regions);
     if (first != G1_NO_HRM_INDEX) {
       // We found something. Make sure these regions are committed, i.e. expand
       // the heap. Alternatively we could do a defragmentation GC.
       log_debug(gc, ergo, heap)("Attempt heap expansion (humongous allocation request failed). Allocation request: " SIZE_FORMAT "B",
                                     word_size * HeapWordSize);
 
-      _hrm.expand_at(first, obj_regions, workers());
+      _hrm->expand_at(first, obj_regions, workers());
       g1_policy()->record_new_heap_size(num_regions());
 
 #ifdef ASSERT
@@ -365,7 +365,7 @@
         assert(is_on_master_free_list(hr), "sanity");
       }
 #endif
-      _hrm.allocate_free_regions_starting_at(first, obj_regions);
+      _hrm->allocate_free_regions_starting_at(first, obj_regions);
     } else {
       // Policy: Potentially trigger a defragmentation GC.
     }
@@ -554,7 +554,7 @@
 bool G1CollectedHeap::check_archive_addresses(MemRegion* ranges, size_t count) {
   assert(ranges != NULL, "MemRegion array NULL");
   assert(count != 0, "No MemRegions provided");
-  MemRegion reserved = _hrm.reserved();
+  MemRegion reserved = _hrm->reserved();
   for (size_t i = 0; i < count; i++) {
     if (!reserved.contains(ranges[i].start()) || !reserved.contains(ranges[i].last())) {
       return false;
@@ -571,7 +571,7 @@
   assert(count != 0, "No MemRegions provided");
   MutexLockerEx x(Heap_lock);
 
-  MemRegion reserved = _hrm.reserved();
+  MemRegion reserved = _hrm->reserved();
   HeapWord* prev_last_addr = NULL;
   HeapRegion* prev_last_region = NULL;
 
@@ -605,7 +605,7 @@
     // range ended, and adjust the start address so we don't try to allocate
     // the same region again. If the current range is entirely within that
     // region, skip it, just adjusting the recorded top.
-    HeapRegion* start_region = _hrm.addr_to_region(start_address);
+    HeapRegion* start_region = _hrm->addr_to_region(start_address);
     if ((prev_last_region != NULL) && (start_region == prev_last_region)) {
       start_address = start_region->end();
       if (start_address > last_address) {
@@ -615,12 +615,12 @@
       }
       start_region->set_top(start_address);
       curr_range = MemRegion(start_address, last_address + 1);
-      start_region = _hrm.addr_to_region(start_address);
+      start_region = _hrm->addr_to_region(start_address);
     }
 
     // Perform the actual region allocation, exiting if it fails.
     // Then note how much new space we have allocated.
-    if (!_hrm.allocate_containing_regions(curr_range, &commits, workers())) {
+    if (!_hrm->allocate_containing_regions(curr_range, &commits, workers())) {
       return false;
     }
     increase_used(word_size * HeapWordSize);
@@ -632,8 +632,8 @@
 
     // Mark each G1 region touched by the range as archive, add it to
     // the old set, and set top.
-    HeapRegion* curr_region = _hrm.addr_to_region(start_address);
-    HeapRegion* last_region = _hrm.addr_to_region(last_address);
+    HeapRegion* curr_region = _hrm->addr_to_region(start_address);
+    HeapRegion* last_region = _hrm->addr_to_region(last_address);
     prev_last_region = last_region;
 
     while (curr_region != NULL) {
@@ -650,7 +650,7 @@
       HeapRegion* next_region;
       if (curr_region != last_region) {
         top = curr_region->end();
-        next_region = _hrm.next_region_in_heap(curr_region);
+        next_region = _hrm->next_region_in_heap(curr_region);
       } else {
         top = last_address + 1;
         next_region = NULL;
@@ -671,7 +671,7 @@
   assert(!is_init_completed(), "Expect to be called at JVM init time");
   assert(ranges != NULL, "MemRegion array NULL");
   assert(count != 0, "No MemRegions provided");
-  MemRegion reserved = _hrm.reserved();
+  MemRegion reserved = _hrm->reserved();
   HeapWord *prev_last_addr = NULL;
   HeapRegion* prev_last_region = NULL;
 
@@ -691,8 +691,8 @@
            "Ranges not in ascending order: " PTR_FORMAT " <= " PTR_FORMAT ,
            p2i(start_address), p2i(prev_last_addr));
 
-    HeapRegion* start_region = _hrm.addr_to_region(start_address);
-    HeapRegion* last_region = _hrm.addr_to_region(last_address);
+    HeapRegion* start_region = _hrm->addr_to_region(start_address);
+    HeapRegion* last_region = _hrm->addr_to_region(last_address);
     HeapWord* bottom_address = start_region->bottom();
 
     // Check for a range beginning in the same region in which the
@@ -708,7 +708,7 @@
       guarantee(curr_region->is_archive(),
                 "Expected archive region at index %u", curr_region->hrm_index());
       if (curr_region != last_region) {
-        curr_region = _hrm.next_region_in_heap(curr_region);
+        curr_region = _hrm->next_region_in_heap(curr_region);
       } else {
         curr_region = NULL;
       }
@@ -757,7 +757,7 @@
   assert(!is_init_completed(), "Expect to be called at JVM init time");
   assert(ranges != NULL, "MemRegion array NULL");
   assert(count != 0, "No MemRegions provided");
-  MemRegion reserved = _hrm.reserved();
+  MemRegion reserved = _hrm->reserved();
   HeapWord* prev_last_addr = NULL;
   HeapRegion* prev_last_region = NULL;
   size_t size_used = 0;
@@ -779,8 +779,8 @@
     size_used += ranges[i].byte_size();
     prev_last_addr = last_address;
 
-    HeapRegion* start_region = _hrm.addr_to_region(start_address);
-    HeapRegion* last_region = _hrm.addr_to_region(last_address);
+    HeapRegion* start_region = _hrm->addr_to_region(start_address);
+    HeapRegion* last_region = _hrm->addr_to_region(last_address);
 
     // Check for ranges that start in the same G1 region in which the previous
     // range ended, and adjust the start address so we don't try to free
@@ -791,7 +791,7 @@
       if (start_address > last_address) {
         continue;
       }
-      start_region = _hrm.addr_to_region(start_address);
+      start_region = _hrm->addr_to_region(start_address);
     }
     prev_last_region = last_region;
 
@@ -806,11 +806,11 @@
       curr_region->set_free();
       curr_region->set_top(curr_region->bottom());
       if (curr_region != last_region) {
-        curr_region = _hrm.next_region_in_heap(curr_region);
+        curr_region = _hrm->next_region_in_heap(curr_region);
       } else {
         curr_region = NULL;
       }
-      _hrm.shrink_at(curr_index, 1);
+      _hrm->shrink_at(curr_index, 1);
       uncommitted_regions++;
     }
 
@@ -1024,6 +1024,8 @@
   abandon_collection_set(collection_set());
 
   tear_down_region_sets(false /* free_list_only */);
+
+  hrm()->prepare_for_full_collection_start();
 }
 
 void G1CollectedHeap::verify_before_full_collection(bool explicit_gc) {
@@ -1035,6 +1037,8 @@
 }
 
 void G1CollectedHeap::prepare_heap_for_mutators() {
+  hrm()->prepare_for_full_collection_end();
+
   // Delete metaspaces for unloaded class loaders and clean up loader_data graph
   ClassLoaderDataGraph::purge();
   MetaspaceUtils::verify_metrics();
@@ -1071,7 +1075,7 @@
 }
 
 void G1CollectedHeap::verify_after_full_collection() {
-  _hrm.verify_optional();
+  _hrm->verify_optional();
   _verifier->verify_region_sets_optional();
   _verifier->verify_after_gc(G1HeapVerifier::G1VerifyFull);
   // Clear the previous marking bitmap, if needed for bitmap verification.
@@ -1325,7 +1329,7 @@
 
 
   if (expand(expand_bytes, _workers)) {
-    _hrm.verify_optional();
+    _hrm->verify_optional();
     _verifier->verify_region_sets_optional();
     return attempt_allocation_at_safepoint(word_size,
                                            false /* expect_null_mutator_alloc_region */);
@@ -1350,7 +1354,7 @@
   uint regions_to_expand = (uint)(aligned_expand_bytes / HeapRegion::GrainBytes);
   assert(regions_to_expand > 0, "Must expand by at least one region");
 
-  uint expanded_by = _hrm.expand_by(regions_to_expand, pretouch_workers);
+  uint expanded_by = _hrm->expand_by(regions_to_expand, pretouch_workers);
   if (expand_time_ms != NULL) {
     *expand_time_ms = (os::elapsedTime() - expand_heap_start_time_sec) * MILLIUNITS;
   }
@@ -1365,7 +1369,7 @@
     // The expansion of the virtual storage space was unsuccessful.
     // Let's see if it was because we ran out of swap.
     if (G1ExitOnExpansionFailure &&
-        _hrm.available() >= regions_to_expand) {
+        _hrm->available() >= regions_to_expand) {
       // We had head room...
       vm_exit_out_of_memory(aligned_expand_bytes, OOM_MMAP_ERROR, "G1 heap expansion");
     }
@@ -1380,7 +1384,7 @@
                                          HeapRegion::GrainBytes);
   uint num_regions_to_remove = (uint)(shrink_bytes / HeapRegion::GrainBytes);
 
-  uint num_regions_removed = _hrm.shrink_by(num_regions_to_remove);
+  uint num_regions_removed = _hrm->shrink_by(num_regions_to_remove);
   size_t shrunk_bytes = num_regions_removed * HeapRegion::GrainBytes;
 
 
@@ -1408,7 +1412,7 @@
   shrink_helper(shrink_bytes);
   rebuild_region_sets(true /* free_list_only */);
 
-  _hrm.verify_optional();
+  _hrm->verify_optional();
   _verifier->verify_region_sets_optional();
 }
 
@@ -1486,7 +1490,7 @@
   _humongous_set("Humongous Region Set", new HumongousRegionSetChecker()),
   _bot(NULL),
   _listener(),
-  _hrm(),
+  _hrm(NULL),
   _allocator(NULL),
   _verifier(NULL),
   _summary_bytes_used(0),
@@ -1505,7 +1509,7 @@
   _survivor(),
   _gc_timer_stw(new (ResourceObj::C_HEAP, mtGC) STWGCTimer()),
   _gc_tracer_stw(new (ResourceObj::C_HEAP, mtGC) G1NewTracer()),
-  _g1_policy(new G1Policy(_gc_timer_stw)),
+  _g1_policy(G1Policy::create_policy(collector_policy, _gc_timer_stw)),
   _heap_sizing_policy(NULL),
   _collection_set(this, _g1_policy),
   _hot_card_cache(NULL),
@@ -1632,7 +1636,7 @@
   guarantee(HeapWordSize == wordSize, "HeapWordSize must equal wordSize");
 
   size_t init_byte_size = collector_policy()->initial_heap_byte_size();
-  size_t max_byte_size = collector_policy()->max_heap_byte_size();
+  size_t max_byte_size = g1_collector_policy()->heap_reserved_size_bytes();
   size_t heap_alignment = collector_policy()->heap_alignment();
 
   // Ensure that the sizes are properly aligned.
@@ -1692,12 +1696,17 @@
   ReservedSpace g1_rs = heap_rs.first_part(max_byte_size);
   size_t page_size = actual_reserved_page_size(heap_rs);
   G1RegionToSpaceMapper* heap_storage =
-    G1RegionToSpaceMapper::create_mapper(g1_rs,
-                                         g1_rs.size(),
-                                         page_size,
-                                         HeapRegion::GrainBytes,
-                                         1,
-                                         mtJavaHeap);
+    G1RegionToSpaceMapper::create_heap_mapper(g1_rs,
+                                              g1_rs.size(),
+                                              page_size,
+                                              HeapRegion::GrainBytes,
+                                              1,
+                                              mtJavaHeap);
+  if(heap_storage == NULL) {
+    vm_shutdown_during_initialization("Could not initialize G1 heap");
+    return JNI_ERR;
+  }
+
   os::trace_page_sizes("Heap",
                        collector_policy()->min_heap_byte_size(),
                        max_byte_size,
@@ -1728,7 +1737,9 @@
   G1RegionToSpaceMapper* next_bitmap_storage =
     create_aux_memory_mapper("Next Bitmap", bitmap_size, G1CMBitMap::heap_map_factor());
 
-  _hrm.initialize(heap_storage, prev_bitmap_storage, next_bitmap_storage, bot_storage, cardtable_storage, card_counts_storage);
+  _hrm = HeapRegionManager::create_manager(this, g1_collector_policy());
+
+  _hrm->initialize(heap_storage, prev_bitmap_storage, next_bitmap_storage, bot_storage, cardtable_storage, card_counts_storage);
   _card_table->initialize(cardtable_storage);
   // Do later initialization work for concurrent refinement.
   _hot_card_cache->initialize(card_counts_storage);
@@ -1743,20 +1754,20 @@
   guarantee(g1_rs.base() >= (char*)G1CardTable::card_size, "Java heap must not start within the first card.");
   // Also create a G1 rem set.
   _g1_rem_set = new G1RemSet(this, _card_table, _hot_card_cache);
-  _g1_rem_set->initialize(max_capacity(), max_regions());
+  _g1_rem_set->initialize(max_reserved_capacity(), max_regions());
 
   size_t max_cards_per_region = ((size_t)1 << (sizeof(CardIdx_t)*BitsPerByte-1)) - 1;
   guarantee(HeapRegion::CardsPerRegion > 0, "make sure it's initialized");
   guarantee(HeapRegion::CardsPerRegion < max_cards_per_region,
             "too many cards per region");
 
-  FreeRegionList::set_unrealistically_long_length(max_regions() + 1);
+  FreeRegionList::set_unrealistically_long_length(max_expandable_regions() + 1);
 
   _bot = new G1BlockOffsetTable(reserved_region(), bot_storage);
 
   {
-    HeapWord* start = _hrm.reserved().start();
-    HeapWord* end = _hrm.reserved().end();
+    HeapWord* start = _hrm->reserved().start();
+    HeapWord* end = _hrm->reserved().end();
     size_t granularity = HeapRegion::GrainBytes;
 
     _in_cset_fast_test.initialize(start, end, granularity);
@@ -1807,7 +1818,7 @@
 
   // Here we allocate the dummy HeapRegion that is required by the
   // G1AllocRegion class.
-  HeapRegion* dummy_region = _hrm.get_dummy_region();
+  HeapRegion* dummy_region = _hrm->get_dummy_region();
 
   // We'll re-use the same region whether the alloc region will
   // require BOT updates or not and, if it doesn't, then a non-young
@@ -1927,16 +1938,20 @@
   return _collector_policy;
 }
 
+G1CollectorPolicy* G1CollectedHeap::g1_collector_policy() const {
+  return _collector_policy;
+}
+
 SoftRefPolicy* G1CollectedHeap::soft_ref_policy() {
   return &_soft_ref_policy;
 }
 
 size_t G1CollectedHeap::capacity() const {
-  return _hrm.length() * HeapRegion::GrainBytes;
+  return _hrm->length() * HeapRegion::GrainBytes;
 }
 
 size_t G1CollectedHeap::unused_committed_regions_in_bytes() const {
-  return _hrm.total_free_bytes();
+  return _hrm->total_free_bytes();
 }
 
 void G1CollectedHeap::iterate_hcc_closure(CardTableEntryClosure* cl, uint worker_i) {
@@ -2002,6 +2017,18 @@
   }
 }
 
+bool G1CollectedHeap::should_upgrade_to_full_gc(GCCause::Cause cause) {
+  if(g1_policy()->force_upgrade_to_full()) {
+    return true;
+  } else if (should_do_concurrent_full_gc(_gc_cause)) {
+    return false;
+  } else if (has_regions_left_for_allocation()) {
+    return false;
+  } else {
+    return true;
+  }
+}
+
 #ifndef PRODUCT
 void G1CollectedHeap::allocate_dummy_regions() {
   // Let's fill up most of the region
@@ -2152,7 +2179,7 @@
 }
 
 bool G1CollectedHeap::is_in(const void* p) const {
-  if (_hrm.reserved().contains(p)) {
+  if (_hrm->reserved().contains(p)) {
     // Given that we know that p is in the reserved space,
     // heap_region_containing() should successfully
     // return the containing region.
@@ -2166,7 +2193,7 @@
 #ifdef ASSERT
 bool G1CollectedHeap::is_in_exact(const void* p) const {
   bool contains = reserved_region().contains(p);
-  bool available = _hrm.is_available(addr_to_region((HeapWord*)p));
+  bool available = _hrm->is_available(addr_to_region((HeapWord*)p));
   if (contains && available) {
     return true;
   } else {
@@ -2197,18 +2224,18 @@
 }
 
 void G1CollectedHeap::heap_region_iterate(HeapRegionClosure* cl) const {
-  _hrm.iterate(cl);
+  _hrm->iterate(cl);
 }
 
 void G1CollectedHeap::heap_region_par_iterate_from_worker_offset(HeapRegionClosure* cl,
                                                                  HeapRegionClaimer *hrclaimer,
                                                                  uint worker_id) const {
-  _hrm.par_iterate(cl, hrclaimer, hrclaimer->offset_for_worker(worker_id));
+  _hrm->par_iterate(cl, hrclaimer, hrclaimer->offset_for_worker(worker_id));
 }
 
 void G1CollectedHeap::heap_region_par_iterate_from_start(HeapRegionClosure* cl,
                                                          HeapRegionClaimer *hrclaimer) const {
-  _hrm.par_iterate(cl, hrclaimer, 0);
+  _hrm->par_iterate(cl, hrclaimer, 0);
 }
 
 void G1CollectedHeap::collection_set_iterate(HeapRegionClosure* cl) {
@@ -2257,7 +2284,11 @@
 }
 
 size_t G1CollectedHeap::max_capacity() const {
-  return _hrm.reserved().byte_size();
+  return _hrm->max_expandable_length() * HeapRegion::GrainBytes;
+}
+
+size_t G1CollectedHeap::max_reserved_capacity() const {
+  return _hrm->max_length() * HeapRegion::GrainBytes;
 }
 
 jlong G1CollectedHeap::millis_since_last_gc() {
@@ -2347,8 +2378,8 @@
   st->print(" total " SIZE_FORMAT "K, used " SIZE_FORMAT "K",
             capacity()/K, used_unlocked()/K);
   st->print(" [" PTR_FORMAT ", " PTR_FORMAT ")",
-            p2i(_hrm.reserved().start()),
-            p2i(_hrm.reserved().end()));
+            p2i(_hrm->reserved().start()),
+            p2i(_hrm->reserved().end()));
   st->cr();
   st->print("  region size " SIZE_FORMAT "K, ", HeapRegion::GrainBytes / K);
   uint young_regions = young_regions_count();
@@ -3131,7 +3162,7 @@
     // output from the concurrent mark thread interfering with this
     // logging output either.
 
-    _hrm.verify_optional();
+    _hrm->verify_optional();
     _verifier->verify_region_sets_optional();
 
     TASKQUEUE_STATS_ONLY(print_taskqueue_stats());
@@ -3947,7 +3978,7 @@
                                   bool locked) {
   assert(!hr->is_free(), "the region should not be free");
   assert(!hr->is_empty(), "the region should not be empty");
-  assert(_hrm.is_available(hr->hrm_index()), "region should be committed");
+  assert(_hrm->is_available(hr->hrm_index()), "region should be committed");
   assert(free_list != NULL, "pre-condition");
 
   if (G1VerifyBitmaps) {
@@ -3988,7 +4019,7 @@
   assert(list != NULL, "list can't be null");
   if (!list->is_empty()) {
     MutexLockerEx x(FreeList_lock, Mutex::_no_safepoint_check_flag);
-    _hrm.insert_list_into_free_list(list);
+    _hrm->insert_list_into_free_list(list);
   }
 }
 
@@ -4521,7 +4552,7 @@
     // this is that during a full GC string deduplication needs to know if
     // a collected region was young or old when the full GC was initiated.
   }
-  _hrm.remove_all_free_regions();
+  _hrm->remove_all_free_regions();
 }
 
 void G1CollectedHeap::increase_used(size_t bytes) {
@@ -4596,7 +4627,7 @@
     _survivor.clear();
   }
 
-  RebuildRegionSetsClosure cl(free_list_only, &_old_set, &_hrm);
+  RebuildRegionSetsClosure cl(free_list_only, &_old_set, _hrm);
   heap_region_iterate(&cl);
 
   if (!free_list_only) {
@@ -4623,7 +4654,7 @@
   bool should_allocate = g1_policy()->should_allocate_mutator_region();
   if (force || should_allocate) {
     HeapRegion* new_alloc_region = new_region(word_size,
-                                              false /* is_old */,
+                                              HeapRegionType::Eden,
                                               false /* do_expand */);
     if (new_alloc_region != NULL) {
       set_region_short_lived_locked(new_alloc_region);
@@ -4667,13 +4698,19 @@
     return NULL;
   }
 
-  const bool is_survivor = dest.is_young();
+  HeapRegionType type;
+  if (dest.is_young()) {
+    type = HeapRegionType::Survivor;
+  } else {
+    type = HeapRegionType::Old;
+  }
 
   HeapRegion* new_alloc_region = new_region(word_size,
-                                            !is_survivor,
+                                            type,
                                             true /* do_expand */);
+
   if (new_alloc_region != NULL) {
-    if (is_survivor) {
+    if (type.is_survivor()) {
       new_alloc_region->set_survivor();
       _survivor.add(new_alloc_region);
       _verifier->check_bitmaps("Survivor Region Allocation", new_alloc_region);
@@ -4705,14 +4742,14 @@
 
 HeapRegion* G1CollectedHeap::alloc_highest_free_region() {
   bool expanded = false;
-  uint index = _hrm.find_highest_free(&expanded);
+  uint index = _hrm->find_highest_free(&expanded);
 
   if (index != G1_NO_HRM_INDEX) {
     if (expanded) {
       log_debug(gc, ergo, heap)("Attempt heap expansion (requested address range outside heap bounds). region size: " SIZE_FORMAT "B",
                                 HeapRegion::GrainWords * HeapWordSize);
     }
-    _hrm.allocate_free_regions_starting_at(index, 1);
+    _hrm->allocate_free_regions_starting_at(index, 1);
     return region_at(index);
   }
   return NULL;
--- a/src/hotspot/share/gc/g1/g1CollectedHeap.hpp	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/hotspot/share/gc/g1/g1CollectedHeap.hpp	Tue Jan 15 10:55:26 2019 -0800
@@ -45,6 +45,7 @@
 #include "gc/g1/g1YCTypes.hpp"
 #include "gc/g1/heapRegionManager.hpp"
 #include "gc/g1/heapRegionSet.hpp"
+#include "gc/g1/heterogeneousHeapRegionManager.hpp"
 #include "gc/shared/barrierSet.hpp"
 #include "gc/shared/collectedHeap.hpp"
 #include "gc/shared/gcHeapSummary.hpp"
@@ -194,7 +195,7 @@
   G1RegionMappingChangedListener _listener;
 
   // The sequence of all heap regions in the heap.
-  HeapRegionManager _hrm;
+  HeapRegionManager* _hrm;
 
   // Manages all allocations with regions except humongous object allocations.
   G1Allocator* _allocator;
@@ -267,6 +268,9 @@
   // (e) cause == _wb_conc_mark
   bool should_do_concurrent_full_gc(GCCause::Cause cause);
 
+  // Return true if should upgrade to full gc after an incremental one.
+  bool should_upgrade_to_full_gc(GCCause::Cause cause);
+
   // indicates whether we are in young or mixed GC mode
   G1CollectorState _collector_state;
 
@@ -369,9 +373,9 @@
   // Try to allocate a single non-humongous HeapRegion sufficient for
   // an allocation of the given word_size. If do_expand is true,
   // attempt to expand the heap if necessary to satisfy the allocation
-  // request. If the region is to be used as an old region or for a
-  // humongous object, set is_old to true. If not, to false.
-  HeapRegion* new_region(size_t word_size, bool is_old, bool do_expand);
+  // request. 'type' takes the type of region to be allocated. (Use constants
+  // Old, Eden, Humongous, Survivor defined in HeapRegionType.)
+  HeapRegion* new_region(size_t word_size, HeapRegionType type, bool do_expand);
 
   // Initialize a contiguous set of free regions of length num_regions
   // and starting at index first so that they appear as a single
@@ -957,10 +961,13 @@
   // The current policy object for the collector.
   G1Policy* g1_policy() const { return _g1_policy; }
 
+  HeapRegionManager* hrm() const { return _hrm; }
+
   const G1CollectionSet* collection_set() const { return &_collection_set; }
   G1CollectionSet* collection_set() { return &_collection_set; }
 
   virtual CollectorPolicy* collector_policy() const;
+  virtual G1CollectorPolicy* g1_collector_policy() const;
 
   virtual SoftRefPolicy* soft_ref_policy();
 
@@ -1009,7 +1016,7 @@
   // But G1CollectedHeap doesn't yet support this.
 
   virtual bool is_maximal_no_gc() const {
-    return _hrm.available() == 0;
+    return _hrm->available() == 0;
   }
 
   // Returns whether there are any regions left in the heap for allocation.
@@ -1018,19 +1025,22 @@
   }
 
   // The current number of regions in the heap.
-  uint num_regions() const { return _hrm.length(); }
+  uint num_regions() const { return _hrm->length(); }
 
   // The max number of regions in the heap.
-  uint max_regions() const { return _hrm.max_length(); }
+  uint max_regions() const { return _hrm->max_length(); }
+
+  // Max number of regions that can be comitted.
+  uint max_expandable_regions() const { return _hrm->max_expandable_length(); }
 
   // The number of regions that are completely free.
-  uint num_free_regions() const { return _hrm.num_free_regions(); }
+  uint num_free_regions() const { return _hrm->num_free_regions(); }
 
   // The number of regions that can be allocated into.
-  uint num_free_or_available_regions() const { return num_free_regions() + _hrm.available(); }
+  uint num_free_or_available_regions() const { return num_free_regions() + _hrm->available(); }
 
   MemoryUsage get_auxiliary_data_memory_usage() const {
-    return _hrm.get_auxiliary_data_memory_usage();
+    return _hrm->get_auxiliary_data_memory_usage();
   }
 
   // The number of regions that are not completely free.
@@ -1038,7 +1048,7 @@
 
 #ifdef ASSERT
   bool is_on_master_free_list(HeapRegion* hr) {
-    return _hrm.is_free(hr);
+    return _hrm->is_free(hr);
   }
 #endif // ASSERT
 
@@ -1095,13 +1105,13 @@
   // Return "TRUE" iff the given object address is in the reserved
   // region of g1.
   bool is_in_g1_reserved(const void* p) const {
-    return _hrm.reserved().contains(p);
+    return _hrm->reserved().contains(p);
   }
 
   // Returns a MemRegion that corresponds to the space that has been
   // reserved for the heap
   MemRegion g1_reserved() const {
-    return _hrm.reserved();
+    return _hrm->reserved();
   }
 
   virtual bool is_in_closed_subset(const void* p) const;
@@ -1227,6 +1237,9 @@
   // Print the maximum heap capacity.
   virtual size_t max_capacity() const;
 
+  // Return the size of reserved memory. Returns different value than max_capacity() when AllocateOldGenAt is used.
+  virtual size_t max_reserved_capacity() const;
+
   virtual jlong millis_since_last_gc();
 
 
--- a/src/hotspot/share/gc/g1/g1CollectedHeap.inline.hpp	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/hotspot/share/gc/g1/g1CollectedHeap.inline.hpp	Tue Jan 15 10:55:26 2019 -0800
@@ -57,13 +57,13 @@
 // Inline functions for G1CollectedHeap
 
 // Return the region with the given index. It assumes the index is valid.
-inline HeapRegion* G1CollectedHeap::region_at(uint index) const { return _hrm.at(index); }
+inline HeapRegion* G1CollectedHeap::region_at(uint index) const { return _hrm->at(index); }
 
 // Return the region with the given index, or NULL if unmapped. It assumes the index is valid.
-inline HeapRegion* G1CollectedHeap::region_at_or_null(uint index) const { return _hrm.at_or_null(index); }
+inline HeapRegion* G1CollectedHeap::region_at_or_null(uint index) const { return _hrm->at_or_null(index); }
 
 inline HeapRegion* G1CollectedHeap::next_region_in_humongous(HeapRegion* hr) const {
-  return _hrm.next_region_in_humongous(hr);
+  return _hrm->next_region_in_humongous(hr);
 }
 
 inline uint G1CollectedHeap::addr_to_region(HeapWord* addr) const {
@@ -74,7 +74,7 @@
 }
 
 inline HeapWord* G1CollectedHeap::bottom_addr_for_region(uint index) const {
-  return _hrm.reserved().start() + index * HeapRegion::GrainWords;
+  return _hrm->reserved().start() + index * HeapRegion::GrainWords;
 }
 
 template <class T>
@@ -83,7 +83,7 @@
   assert(is_in_g1_reserved((const void*) addr),
          "Address " PTR_FORMAT " is outside of the heap ranging from [" PTR_FORMAT " to " PTR_FORMAT ")",
          p2i((void*)addr), p2i(g1_reserved().start()), p2i(g1_reserved().end()));
-  return _hrm.addr_to_region((HeapWord*) addr);
+  return _hrm->addr_to_region((HeapWord*) addr);
 }
 
 template <class T>
@@ -266,12 +266,12 @@
 }
 
 inline void G1CollectedHeap::set_humongous_reclaim_candidate(uint region, bool value) {
-  assert(_hrm.at(region)->is_starts_humongous(), "Must start a humongous object");
+  assert(_hrm->at(region)->is_starts_humongous(), "Must start a humongous object");
   _humongous_reclaim_candidates.set_candidate(region, value);
 }
 
 inline bool G1CollectedHeap::is_humongous_reclaim_candidate(uint region) {
-  assert(_hrm.at(region)->is_starts_humongous(), "Must start a humongous object");
+  assert(_hrm->at(region)->is_starts_humongous(), "Must start a humongous object");
   return _humongous_reclaim_candidates.is_candidate(region);
 }
 
--- a/src/hotspot/share/gc/g1/g1CollectorPolicy.cpp	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/hotspot/share/gc/g1/g1CollectorPolicy.cpp	Tue Jan 15 10:55:26 2019 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2016, 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
@@ -55,3 +55,11 @@
   size_t page_size = UseLargePages ? os::large_page_size() : os::vm_page_size();
   _heap_alignment = MAX3(card_table_alignment, _space_alignment, page_size);
 }
+
+size_t G1CollectorPolicy::heap_reserved_size_bytes() const {
+  return _max_heap_byte_size;
+}
+
+bool G1CollectorPolicy::is_hetero_heap() const {
+  return false;
+}
--- a/src/hotspot/share/gc/g1/g1CollectorPolicy.hpp	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/hotspot/share/gc/g1/g1CollectorPolicy.hpp	Tue Jan 15 10:55:26 2019 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2016, 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
@@ -38,6 +38,7 @@
 
 public:
   G1CollectorPolicy();
+  virtual size_t heap_reserved_size_bytes() const;
+  virtual bool is_hetero_heap() const;
 };
-
 #endif // SHARE_VM_GC_G1_G1COLLECTORPOLICY_HPP
--- a/src/hotspot/share/gc/g1/g1HeapVerifier.cpp	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/hotspot/share/gc/g1/g1HeapVerifier.cpp	Tue Jan 15 10:55:26 2019 -0800
@@ -603,14 +603,14 @@
   assert_heap_locked_or_at_safepoint(true /* should_be_vm_thread */);
 
   // First, check the explicit lists.
-  _g1h->_hrm.verify();
+  _g1h->_hrm->verify();
 
   // Finally, make sure that the region accounting in the lists is
   // consistent with what we see in the heap.
 
-  VerifyRegionListsClosure cl(&_g1h->_old_set, &_g1h->_archive_set, &_g1h->_humongous_set, &_g1h->_hrm);
+  VerifyRegionListsClosure cl(&_g1h->_old_set, &_g1h->_archive_set, &_g1h->_humongous_set, _g1h->_hrm);
   _g1h->heap_region_iterate(&cl);
-  cl.verify_counts(&_g1h->_old_set, &_g1h->_archive_set, &_g1h->_humongous_set, &_g1h->_hrm);
+  cl.verify_counts(&_g1h->_old_set, &_g1h->_archive_set, &_g1h->_humongous_set, _g1h->_hrm);
 }
 
 void G1HeapVerifier::prepare_for_verify() {
@@ -851,7 +851,7 @@
 
 bool G1HeapVerifier::check_cset_fast_test() {
   G1CheckCSetFastTableClosure cl;
-  _g1h->_hrm.iterate(&cl);
+  _g1h->_hrm->iterate(&cl);
   return !cl.failures();
 }
 #endif // PRODUCT
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/hotspot/share/gc/g1/g1HeterogeneousCollectorPolicy.cpp	Tue Jan 15 10:55:26 2019 -0800
@@ -0,0 +1,103 @@
+/*
+ * 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.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+#include "precompiled.hpp"
+#include "gc/g1/g1HeterogeneousCollectorPolicy.hpp"
+#include "logging/log.hpp"
+#include "runtime/globals_extension.hpp"
+#include "runtime/os.hpp"
+#include "utilities/formatBuffer.hpp"
+
+const double G1HeterogeneousCollectorPolicy::MaxRamFractionForYoung = 0.8;
+size_t G1HeterogeneousCollectorPolicy::MaxMemoryForYoung;
+
+static size_t calculate_reasonable_max_memory_for_young(FormatBuffer<100> &calc_str, double max_ram_fraction_for_young) {
+  julong phys_mem;
+  // If MaxRam is specified, we use that as maximum physical memory available.
+  if (FLAG_IS_DEFAULT(MaxRAM)) {
+    phys_mem = os::physical_memory();
+    calc_str.append("Physical_Memory");
+  } else {
+    phys_mem = (julong)MaxRAM;
+    calc_str.append("MaxRAM");
+  }
+
+  julong reasonable_max = phys_mem;
+
+  // If either MaxRAMFraction or MaxRAMPercentage is specified, we use them to calculate
+  // reasonable max size of young generation.
+  if (!FLAG_IS_DEFAULT(MaxRAMFraction)) {
+    reasonable_max = (julong)(phys_mem / MaxRAMFraction);
+    calc_str.append(" / MaxRAMFraction");
+  }  else if (!FLAG_IS_DEFAULT(MaxRAMPercentage)) {
+    reasonable_max = (julong)((phys_mem * MaxRAMPercentage) / 100);
+    calc_str.append(" * MaxRAMPercentage / 100");
+  }  else {
+    // We use our own fraction to calculate max size of young generation.
+    reasonable_max = phys_mem * max_ram_fraction_for_young;
+    calc_str.append(" * %0.2f", max_ram_fraction_for_young);
+  }
+
+  return (size_t)reasonable_max;
+}
+
+void G1HeterogeneousCollectorPolicy::initialize_flags() {
+
+  FormatBuffer<100> calc_str("");
+
+  MaxMemoryForYoung = calculate_reasonable_max_memory_for_young(calc_str, MaxRamFractionForYoung);
+
+  if (MaxNewSize > MaxMemoryForYoung) {
+    if (FLAG_IS_CMDLINE(MaxNewSize)) {
+      log_warning(gc, ergo)("Setting MaxNewSize to " SIZE_FORMAT " based on dram available (calculation = align(%s))",
+                            MaxMemoryForYoung, calc_str.buffer());
+    } else {
+      log_info(gc, ergo)("Setting MaxNewSize to " SIZE_FORMAT " based on dram available (calculation = align(%s)). "
+                         "Dram usage can be lowered by setting MaxNewSize to a lower value", MaxMemoryForYoung, calc_str.buffer());
+    }
+    MaxNewSize = MaxMemoryForYoung;
+  }
+  if (NewSize > MaxMemoryForYoung) {
+    if (FLAG_IS_CMDLINE(NewSize)) {
+      log_warning(gc, ergo)("Setting NewSize to " SIZE_FORMAT " based on dram available (calculation = align(%s))",
+                            MaxMemoryForYoung, calc_str.buffer());
+    }
+    NewSize = MaxMemoryForYoung;
+  }
+
+  // After setting new size flags, call base class initialize_flags()
+  G1CollectorPolicy::initialize_flags();
+}
+
+size_t G1HeterogeneousCollectorPolicy::reasonable_max_memory_for_young() {
+  return MaxMemoryForYoung;
+}
+
+size_t G1HeterogeneousCollectorPolicy::heap_reserved_size_bytes() const {
+    return 2 * _max_heap_byte_size;
+}
+
+bool G1HeterogeneousCollectorPolicy::is_hetero_heap() const {
+  return true;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/hotspot/share/gc/g1/g1HeterogeneousCollectorPolicy.hpp	Tue Jan 15 10:55:26 2019 -0800
@@ -0,0 +1,48 @@
+/*
+ * 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.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+#ifndef SHARE_VM_GC_G1_G1HETEROGENEOUSCOLLECTORPOLICY_HPP
+#define SHARE_VM_GC_G1_G1HETEROGENEOUSCOLLECTORPOLICY_HPP
+
+#include "gc/g1/g1CollectorPolicy.hpp"
+#include "gc/g1/g1HeterogeneousHeapYoungGenSizer.hpp"
+
+class G1HeterogeneousCollectorPolicy : public G1CollectorPolicy {
+private:
+  // Max fraction of dram to use for young generation when MaxRAMFraction and
+  // MaxRAMPercentage are not specified on commandline.
+  static const double MaxRamFractionForYoung;
+  static size_t MaxMemoryForYoung;
+
+protected:
+  virtual void initialize_flags();
+
+public:
+  G1HeterogeneousCollectorPolicy() {}
+  virtual size_t heap_reserved_size_bytes() const;
+  virtual bool is_hetero_heap() const;
+  static size_t reasonable_max_memory_for_young();
+};
+
+#endif // SHARE_VM_GC_G1_G1HETEROGENEOUSCOLLECTORPOLICY_HPP
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/hotspot/share/gc/g1/g1HeterogeneousHeapPolicy.cpp	Tue Jan 15 10:55:26 2019 -0800
@@ -0,0 +1,58 @@
+/*
+ * 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.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+#include "precompiled.hpp"
+#include "gc/g1/g1CollectedHeap.hpp"
+#include "gc/g1/g1HeterogeneousHeapPolicy.hpp"
+#include "gc/g1/g1Policy.hpp"
+#include "gc/g1/heterogeneousHeapRegionManager.hpp"
+
+G1HeterogeneousHeapPolicy::G1HeterogeneousHeapPolicy(G1CollectorPolicy* policy, STWGCTimer* gc_timer) :
+  G1Policy(policy, gc_timer), _manager(NULL) {}
+
+// We call the super class init(), after which we provision young_list_target_length() regions in dram.
+void G1HeterogeneousHeapPolicy::init(G1CollectedHeap* g1h, G1CollectionSet* collection_set) {
+  G1Policy::init(g1h, collection_set);
+  _manager = HeterogeneousHeapRegionManager::manager();
+  _manager->adjust_dram_regions((uint)young_list_target_length(), G1CollectedHeap::heap()->workers());
+}
+
+// After a collection pause, young list target length is updated. So we need to make sure we have enough regions in dram for young gen.
+void G1HeterogeneousHeapPolicy::record_collection_pause_end(double pause_time_ms, size_t cards_scanned, size_t heap_used_bytes_before_gc) {
+  G1Policy::record_collection_pause_end(pause_time_ms, cards_scanned, heap_used_bytes_before_gc);
+  _manager->adjust_dram_regions((uint)young_list_target_length(), G1CollectedHeap::heap()->workers());
+}
+
+// After a full collection, young list target length is updated. So we need to make sure we have enough regions in dram for young gen.
+void G1HeterogeneousHeapPolicy::record_full_collection_end() {
+  G1Policy::record_full_collection_end();
+  _manager->adjust_dram_regions((uint)young_list_target_length(), G1CollectedHeap::heap()->workers());
+}
+
+bool G1HeterogeneousHeapPolicy::force_upgrade_to_full() {
+  if (_manager->has_borrowed_regions()) {
+    return true;
+  }
+  return false;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/hotspot/share/gc/g1/g1HeterogeneousHeapPolicy.hpp	Tue Jan 15 10:55:26 2019 -0800
@@ -0,0 +1,48 @@
+/*
+ * 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.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+#ifndef SHARE_VM_GC_G1_G1HETEROGENEOUSHEAPPOLICY_HPP
+#define SHARE_VM_GC_G1_G1HETEROGENEOUSHEAPPOLICY_HPP
+
+#include "gc/g1/g1CollectorPolicy.hpp"
+#include "gc/g1/g1Policy.hpp"
+#include "gc/g1/heterogeneousHeapRegionManager.hpp"
+
+class G1HeterogeneousHeapPolicy : public G1Policy {
+  // Stash a pointer to the hrm.
+  HeterogeneousHeapRegionManager* _manager;
+
+public:
+  G1HeterogeneousHeapPolicy(G1CollectorPolicy* policy, STWGCTimer* gc_timer);
+
+  // initialize policy
+  virtual void init(G1CollectedHeap* g1h, G1CollectionSet* collection_set);
+  // Record end of an evacuation pause.
+  virtual void record_collection_pause_end(double pause_time_ms, size_t cards_scanned, size_t heap_used_bytes_before_gc);
+  // Record the end of full collection.
+  virtual void record_full_collection_end();
+
+  virtual bool force_upgrade_to_full();
+};
+#endif // SHARE_VM_GC_G1_G1HETEROGENEOUSHEAPPOLICY_HPP
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/hotspot/share/gc/g1/g1HeterogeneousHeapYoungGenSizer.cpp	Tue Jan 15 10:55:26 2019 -0800
@@ -0,0 +1,51 @@
+/*
+ * 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.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+#include "precompiled.hpp"
+#include "gc/g1/g1HeterogeneousCollectorPolicy.hpp"
+#include "gc/g1/g1HeterogeneousHeapYoungGenSizer.hpp"
+#include "gc/g1/heapRegion.hpp"
+
+G1HeterogeneousHeapYoungGenSizer::G1HeterogeneousHeapYoungGenSizer() : G1YoungGenSizer() {
+  // will be used later when min and max young size is calculated.
+  _max_young_length = (uint)(G1HeterogeneousCollectorPolicy::reasonable_max_memory_for_young() / HeapRegion::GrainBytes);
+}
+
+// Since heap is sized potentially to larger value accounting for dram + nvdimm, we need to limit
+// max young gen size to the available dram.
+// Call parent class method first and then adjust sizes based on available dram
+void G1HeterogeneousHeapYoungGenSizer::adjust_max_new_size(uint number_of_heap_regions) {
+  G1YoungGenSizer::adjust_max_new_size(number_of_heap_regions);
+  adjust_lengths_based_on_dram_memory();
+}
+
+void G1HeterogeneousHeapYoungGenSizer::heap_size_changed(uint new_number_of_heap_regions) {
+  G1YoungGenSizer::heap_size_changed(new_number_of_heap_regions);
+  adjust_lengths_based_on_dram_memory();
+}
+
+void G1HeterogeneousHeapYoungGenSizer::adjust_lengths_based_on_dram_memory() {
+  _min_desired_young_length = MIN2(_min_desired_young_length, _max_young_length);
+  _max_desired_young_length = MIN2(_max_desired_young_length, _max_young_length);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/hotspot/share/gc/g1/g1HeterogeneousHeapYoungGenSizer.hpp	Tue Jan 15 10:55:26 2019 -0800
@@ -0,0 +1,51 @@
+/*
+ * 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.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+#ifndef SHARE_VM_GC_G1_G1HETEROGENEOUSHEAPYOUNGGENSIZER_HPP
+#define SHARE_VM_GC_G1_G1HETEROGENEOUSHEAPYOUNGGENSIZER_HPP
+
+#include "gc/g1/g1YoungGenSizer.hpp"
+
+// This class prevents the size of young generation of G1 heap to exceed dram
+// memory available. If set on command line, MaxRAM and MaxRAMFraction/MaxRAMPercentage
+// are used to determine the maximum size that young generation can grow.
+// Else we set the maximum size to 80% of dram available in the system.
+
+class G1HeterogeneousHeapYoungGenSizer : public G1YoungGenSizer {
+private:
+  // maximum no of regions that young generation can grow to. Calculated in constructor.
+  uint _max_young_length;
+  void adjust_lengths_based_on_dram_memory();
+
+public:
+  G1HeterogeneousHeapYoungGenSizer();
+
+  // Calculate the maximum length of the young gen given the number of regions
+  // depending on the sizing algorithm.
+  virtual void adjust_max_new_size(uint number_of_heap_regions);
+
+  virtual void heap_size_changed(uint new_number_of_heap_regions);
+};
+
+#endif // SHARE_VM_GC_G1_G1HETEROGENEOUSHEAPYOUNGGENSIZER_HPP
--- a/src/hotspot/share/gc/g1/g1PageBasedVirtualSpace.cpp	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/hotspot/share/gc/g1/g1PageBasedVirtualSpace.cpp	Tue Jan 15 10:55:26 2019 -0800
@@ -100,6 +100,12 @@
   return reserved_size() - committed_size();
 }
 
+void G1PageBasedVirtualSpace::commit_and_set_special() {
+  commit_internal(addr_to_page_index(_low_boundary), addr_to_page_index(_high_boundary));
+  _special = true;
+  _dirty.initialize(reserved_size()/_page_size);
+}
+
 size_t G1PageBasedVirtualSpace::addr_to_page_index(char* addr) const {
   return (addr - _low_boundary) / _page_size;
 }
--- a/src/hotspot/share/gc/g1/g1PageBasedVirtualSpace.hpp	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/hotspot/share/gc/g1/g1PageBasedVirtualSpace.hpp	Tue Jan 15 10:55:26 2019 -0800
@@ -136,6 +136,8 @@
   // Memory left to use/expand in this virtual space.
   size_t uncommitted_size() const;
 
+  void commit_and_set_special();
+
   bool contains(const void* p) const;
 
   MemRegion reserved() {
--- a/src/hotspot/share/gc/g1/g1Policy.cpp	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/hotspot/share/gc/g1/g1Policy.cpp	Tue Jan 15 10:55:26 2019 -0800
@@ -29,6 +29,7 @@
 #include "gc/g1/g1ConcurrentMark.hpp"
 #include "gc/g1/g1ConcurrentMarkThread.inline.hpp"
 #include "gc/g1/g1ConcurrentRefine.hpp"
+#include "gc/g1/g1HeterogeneousHeapPolicy.hpp"
 #include "gc/g1/g1HotCardCache.hpp"
 #include "gc/g1/g1IHOPControl.hpp"
 #include "gc/g1/g1GCPhaseTimes.hpp"
@@ -46,7 +47,7 @@
 #include "utilities/growableArray.hpp"
 #include "utilities/pair.hpp"
 
-G1Policy::G1Policy(STWGCTimer* gc_timer) :
+G1Policy::G1Policy(G1CollectorPolicy* policy, STWGCTimer* gc_timer) :
   _predictor(G1ConfidencePercent / 100.0),
   _analytics(new G1Analytics(&_predictor)),
   _remset_tracker(),
@@ -62,7 +63,7 @@
   _survivor_surv_rate_group(new SurvRateGroup()),
   _reserve_factor((double) G1ReservePercent / 100.0),
   _reserve_regions(0),
-  _young_gen_sizer(),
+  _young_gen_sizer(G1YoungGenSizer::create_gen_sizer(policy)),
   _free_regions_at_end_of_collection(0),
   _max_rs_lengths(0),
   _rs_lengths_prediction(0),
@@ -83,6 +84,15 @@
 
 G1Policy::~G1Policy() {
   delete _ihop_control;
+  delete _young_gen_sizer;
+}
+
+G1Policy* G1Policy::create_policy(G1CollectorPolicy* policy, STWGCTimer* gc_timer_stw) {
+  if (policy->is_hetero_heap()) {
+    return new G1HeterogeneousHeapPolicy(policy, gc_timer_stw);
+  } else {
+    return new G1Policy(policy, gc_timer_stw);
+  }
 }
 
 G1CollectorState* G1Policy::collector_state() const { return _g1h->collector_state(); }
@@ -94,9 +104,9 @@
   assert(Heap_lock->owned_by_self(), "Locking discipline.");
 
   if (!adaptive_young_list_length()) {
-    _young_list_fixed_length = _young_gen_sizer.min_desired_young_length();
+    _young_list_fixed_length = _young_gen_sizer->min_desired_young_length();
   }
-  _young_gen_sizer.adjust_max_new_size(_g1h->max_regions());
+  _young_gen_sizer->adjust_max_new_size(_g1h->max_expandable_regions());
 
   _free_regions_at_end_of_collection = _g1h->num_free_regions();
 
@@ -176,7 +186,7 @@
   // smaller than 1.0) we'll get 1.
   _reserve_regions = (uint) ceil(reserve_regions_d);
 
-  _young_gen_sizer.heap_size_changed(new_number_of_regions);
+  _young_gen_sizer->heap_size_changed(new_number_of_regions);
 
   _ihop_control->update_target_occupancy(new_number_of_regions * HeapRegion::GrainBytes);
 }
@@ -195,14 +205,14 @@
   }
   desired_min_length += base_min_length;
   // make sure we don't go below any user-defined minimum bound
-  return MAX2(_young_gen_sizer.min_desired_young_length(), desired_min_length);
+  return MAX2(_young_gen_sizer->min_desired_young_length(), desired_min_length);
 }
 
 uint G1Policy::calculate_young_list_desired_max_length() const {
   // Here, we might want to also take into account any additional
   // constraints (i.e., user-defined minimum bound). Currently, we
   // effectively don't set this bound.
-  return _young_gen_sizer.max_desired_young_length();
+  return _young_gen_sizer->max_desired_young_length();
 }
 
 uint G1Policy::update_young_list_max_and_target_length() {
@@ -218,6 +228,7 @@
 uint G1Policy::update_young_list_target_length(size_t rs_lengths) {
   YoungTargetLengths young_lengths = young_list_target_lengths(rs_lengths);
   _young_list_target_length = young_lengths.first;
+
   return young_lengths.second;
 }
 
@@ -900,7 +911,7 @@
 }
 
 bool G1Policy::adaptive_young_list_length() const {
-  return _young_gen_sizer.adaptive_young_list_length();
+  return _young_gen_sizer->adaptive_young_list_length();
 }
 
 size_t G1Policy::desired_survivor_size(uint max_regions) const {
--- a/src/hotspot/share/gc/g1/g1Policy.hpp	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/hotspot/share/gc/g1/g1Policy.hpp	Tue Jan 15 10:55:26 2019 -0800
@@ -25,6 +25,7 @@
 #ifndef SHARE_VM_GC_G1_G1POLICY_HPP
 #define SHARE_VM_GC_G1_G1POLICY_HPP
 
+#include "gc/g1/g1CollectorPolicy.hpp"
 #include "gc/g1/g1CollectorState.hpp"
 #include "gc/g1/g1GCPhaseTimes.hpp"
 #include "gc/g1/g1InCSetState.hpp"
@@ -91,7 +92,7 @@
   // for the first time during initialization.
   uint   _reserve_regions;
 
-  G1YoungGenSizer _young_gen_sizer;
+  G1YoungGenSizer* _young_gen_sizer;
 
   uint _free_regions_at_end_of_collection;
 
@@ -282,10 +283,12 @@
   void abort_time_to_mixed_tracking();
 public:
 
-  G1Policy(STWGCTimer* gc_timer);
+  G1Policy(G1CollectorPolicy* policy, STWGCTimer* gc_timer);
 
   virtual ~G1Policy();
 
+  static G1Policy* create_policy(G1CollectorPolicy* policy, STWGCTimer* gc_timer_stw);
+
   G1CollectorState* collector_state() const;
 
   G1GCPhaseTimes* phase_times() const { return _phase_times; }
@@ -298,7 +301,7 @@
   // This should be called after the heap is resized.
   void record_new_heap_size(uint new_number_of_regions);
 
-  void init(G1CollectedHeap* g1h, G1CollectionSet* collection_set);
+  virtual void init(G1CollectedHeap* g1h, G1CollectionSet* collection_set);
 
   void note_gc_start();
 
@@ -308,11 +311,11 @@
 
   // Record the start and end of an evacuation pause.
   void record_collection_pause_start(double start_time_sec);
-  void record_collection_pause_end(double pause_time_ms, size_t cards_scanned, size_t heap_used_bytes_before_gc);
+  virtual void record_collection_pause_end(double pause_time_ms, size_t cards_scanned, size_t heap_used_bytes_before_gc);
 
   // Record the start and end of a full collection.
   void record_full_collection_start();
-  void record_full_collection_end();
+  virtual void record_full_collection_end();
 
   // Must currently be called while the world is stopped.
   void record_concurrent_mark_init_end(double mark_init_elapsed_time_ms);
@@ -432,6 +435,10 @@
   void update_max_gc_locker_expansion();
 
   void update_survivors_policy();
+
+  virtual bool force_upgrade_to_full() {
+    return false;
+  }
 };
 
 #endif // SHARE_VM_GC_G1_G1POLICY_HPP
--- a/src/hotspot/share/gc/g1/g1RegionToSpaceMapper.cpp	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/hotspot/share/gc/g1/g1RegionToSpaceMapper.cpp	Tue Jan 15 10:55:26 2019 -0800
@@ -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
@@ -25,11 +25,15 @@
 #include "precompiled.hpp"
 #include "gc/g1/g1BiasedArray.hpp"
 #include "gc/g1/g1RegionToSpaceMapper.hpp"
+#include "logging/log.hpp"
 #include "memory/allocation.inline.hpp"
 #include "memory/virtualspace.hpp"
+#include "runtime/java.hpp"
+#include "runtime/os.inline.hpp"
 #include "services/memTracker.hpp"
 #include "utilities/align.hpp"
 #include "utilities/bitMap.inline.hpp"
+#include "utilities/formatBuffer.hpp"
 
 G1RegionToSpaceMapper::G1RegionToSpaceMapper(ReservedSpace rs,
                                              size_t used_size,
@@ -170,16 +174,156 @@
   }
 }
 
+static bool map_nvdimm_space(ReservedSpace rs) {
+  assert(AllocateOldGenAt != NULL, "");
+  int _backing_fd = os::create_file_for_heap(AllocateOldGenAt);
+  if (_backing_fd == -1) {
+    log_error(gc, init)("Could not create file for Old generation at location %s", AllocateOldGenAt);
+    return false;
+  }
+  // commit this memory in nv-dimm
+  char* ret = os::attempt_reserve_memory_at(rs.size(), rs.base(), _backing_fd);
+
+  if (ret != rs.base()) {
+    if (ret != NULL) {
+      os::unmap_memory(rs.base(), rs.size());
+    }
+    log_error(gc, init)("Error in mapping Old Gen to given AllocateOldGenAt = %s", AllocateOldGenAt);
+    os::close(_backing_fd);
+    return false;
+  }
+
+  os::close(_backing_fd);
+  return true;
+}
+
+G1RegionToHeteroSpaceMapper::G1RegionToHeteroSpaceMapper(ReservedSpace rs,
+                                                         size_t actual_size,
+                                                         size_t page_size,
+                                                         size_t alloc_granularity,
+                                                         size_t commit_factor,
+                                                         MemoryType type) :
+  G1RegionToSpaceMapper(rs, actual_size, page_size, alloc_granularity, commit_factor, type),
+  _rs(rs),
+  _num_committed_dram(0),
+  _num_committed_nvdimm(0),
+  _page_size(page_size),
+  _commit_factor(commit_factor),
+  _type(type) {
+  assert(actual_size == 2 * MaxHeapSize, "For 2-way heterogenuous heap, reserved space is two times MaxHeapSize");
+}
+
+bool G1RegionToHeteroSpaceMapper::initialize() {
+  // Since we need to re-map the reserved space - 'Xmx' to nv-dimm and 'Xmx' to dram, we need to release the reserved memory first.
+  // Because on some OSes (e.g. Windows) you cannot do a file mapping on memory reserved with regular mapping.
+  os::release_memory(_rs.base(), _rs.size());
+  // First half of size Xmx is for nv-dimm.
+  ReservedSpace rs_nvdimm = _rs.first_part(MaxHeapSize);
+  assert(rs_nvdimm.base() == _rs.base(), "We should get the same base address");
+
+  // Second half of reserved memory is mapped to dram.
+  ReservedSpace rs_dram = _rs.last_part(MaxHeapSize);
+
+  assert(rs_dram.size() == rs_nvdimm.size() && rs_nvdimm.size() == MaxHeapSize, "They all should be same");
+
+  // Reserve dram memory
+  char* base = os::attempt_reserve_memory_at(rs_dram.size(), rs_dram.base());
+  if (base != rs_dram.base()) {
+    if (base != NULL) {
+      os::release_memory(base, rs_dram.size());
+    }
+    log_error(gc, init)("Error in re-mapping memory on dram during G1 heterogenous memory initialization");
+    return false;
+  }
+
+  // We reserve and commit this entire space to NV-DIMM.
+  if (!map_nvdimm_space(rs_nvdimm)) {
+    log_error(gc, init)("Error in re-mapping memory to nv-dimm during G1 heterogenous memory initialization");
+    return false;
+  }
+
+  if (_region_granularity >= (_page_size * _commit_factor)) {
+    _dram_mapper = new G1RegionsLargerThanCommitSizeMapper(rs_dram, rs_dram.size(), _page_size, _region_granularity, _commit_factor, _type);
+  } else {
+    _dram_mapper = new G1RegionsSmallerThanCommitSizeMapper(rs_dram, rs_dram.size(), _page_size, _region_granularity, _commit_factor, _type);
+  }
+
+  _start_index_of_nvdimm = 0;
+  _start_index_of_dram = (uint)(rs_nvdimm.size() / _region_granularity);
+  return true;
+}
+
+void G1RegionToHeteroSpaceMapper::commit_regions(uint start_idx, size_t num_regions, WorkGang* pretouch_gang) {
+  uint end_idx = (start_idx + (uint)num_regions - 1);
+
+  uint num_dram = end_idx >= _start_index_of_dram ? MIN2((end_idx - _start_index_of_dram + 1), (uint)num_regions) : 0;
+  uint num_nvdimm = (uint)num_regions - num_dram;
+
+  if (num_nvdimm > 0) {
+    // We do not need to commit nv-dimm regions, since they are committed in the beginning.
+    _num_committed_nvdimm += num_nvdimm;
+  }
+  if (num_dram > 0) {
+    _dram_mapper->commit_regions(start_idx > _start_index_of_dram ? (start_idx - _start_index_of_dram) : 0, num_dram, pretouch_gang);
+    _num_committed_dram += num_dram;
+  }
+}
+
+void G1RegionToHeteroSpaceMapper::uncommit_regions(uint start_idx, size_t num_regions) {
+  uint end_idx = (start_idx + (uint)num_regions - 1);
+  uint num_dram = end_idx >= _start_index_of_dram ? MIN2((end_idx - _start_index_of_dram + 1), (uint)num_regions) : 0;
+  uint num_nvdimm = (uint)num_regions - num_dram;
+
+  if (num_nvdimm > 0) {
+    // We do not uncommit memory for nv-dimm regions.
+    _num_committed_nvdimm -= num_nvdimm;
+  }
+
+  if (num_dram > 0) {
+    _dram_mapper->uncommit_regions(start_idx > _start_index_of_dram ? (start_idx - _start_index_of_dram) : 0, num_dram);
+    _num_committed_dram -= num_dram;
+  }
+}
+
+uint G1RegionToHeteroSpaceMapper::num_committed_dram() const {
+  return _num_committed_dram;
+}
+
+uint G1RegionToHeteroSpaceMapper::num_committed_nvdimm() const {
+  return _num_committed_nvdimm;
+}
+
+G1RegionToSpaceMapper* G1RegionToSpaceMapper::create_heap_mapper(ReservedSpace rs,
+                                                                 size_t actual_size,
+                                                                 size_t page_size,
+                                                                 size_t region_granularity,
+                                                                 size_t commit_factor,
+                                                                 MemoryType type) {
+  if (AllocateOldGenAt != NULL) {
+    G1RegionToHeteroSpaceMapper* mapper = new G1RegionToHeteroSpaceMapper(rs, actual_size, page_size, region_granularity, commit_factor, type);
+    if (!mapper->initialize()) {
+      delete mapper;
+      return NULL;
+    }
+    return (G1RegionToSpaceMapper*)mapper;
+  } else {
+    return create_mapper(rs, actual_size, page_size, region_granularity, commit_factor, type);
+  }
+}
+
 G1RegionToSpaceMapper* G1RegionToSpaceMapper::create_mapper(ReservedSpace rs,
                                                             size_t actual_size,
                                                             size_t page_size,
                                                             size_t region_granularity,
                                                             size_t commit_factor,
                                                             MemoryType type) {
-
   if (region_granularity >= (page_size * commit_factor)) {
     return new G1RegionsLargerThanCommitSizeMapper(rs, actual_size, page_size, region_granularity, commit_factor, type);
   } else {
     return new G1RegionsSmallerThanCommitSizeMapper(rs, actual_size, page_size, region_granularity, commit_factor, type);
   }
 }
+
+void G1RegionToSpaceMapper::commit_and_set_special() {
+  _storage.commit_and_set_special();
+}
--- a/src/hotspot/share/gc/g1/g1RegionToSpaceMapper.hpp	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/hotspot/share/gc/g1/g1RegionToSpaceMapper.hpp	Tue Jan 15 10:55:26 2019 -0800
@@ -70,6 +70,7 @@
     return _commit_map.at(idx);
   }
 
+  void commit_and_set_special();
   virtual void commit_regions(uint start_idx, size_t num_regions = 1, WorkGang* pretouch_workers = NULL) = 0;
   virtual void uncommit_regions(uint start_idx, size_t num_regions = 1) = 0;
 
@@ -87,6 +88,37 @@
                                               size_t region_granularity,
                                               size_t byte_translation_factor,
                                               MemoryType type);
+
+  static G1RegionToSpaceMapper* create_heap_mapper(ReservedSpace rs,
+                                                   size_t actual_size,
+                                                   size_t page_size,
+                                                   size_t region_granularity,
+                                                   size_t byte_translation_factor,
+                                                   MemoryType type);
 };
 
+// G1RegionToSpaceMapper implementation where
+// part of space is mapped to dram and part to nv-dimm
+class G1RegionToHeteroSpaceMapper : public G1RegionToSpaceMapper {
+private:
+  size_t _pages_per_region;
+  ReservedSpace _rs;
+  G1RegionToSpaceMapper* _dram_mapper;
+  uint _num_committed_dram;
+  uint _num_committed_nvdimm;
+  uint _start_index_of_nvdimm;
+  uint _start_index_of_dram;
+  size_t _page_size;
+  size_t _commit_factor;
+  MemoryType _type;
+
+public:
+  G1RegionToHeteroSpaceMapper(ReservedSpace rs, size_t used_size, size_t page_size, size_t region_granularity, size_t commit_factor, MemoryType type);
+  bool initialize();
+  uint num_committed_dram() const;
+  uint num_committed_nvdimm() const;
+
+  virtual void commit_regions(uint start_idx, size_t num_regions = 1, WorkGang* pretouch_workers = NULL);
+  virtual void uncommit_regions(uint start_idx, size_t num_regions = 1);
+};
 #endif // SHARE_VM_GC_G1_G1REGIONTOSPACEMAPPER_HPP
--- a/src/hotspot/share/gc/g1/g1VMOperations.cpp	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/hotspot/share/gc/g1/g1VMOperations.cpp	Tue Jan 15 10:55:26 2019 -0800
@@ -138,8 +138,8 @@
       // kind of GC.
       _result = g1h->satisfy_failed_allocation(_word_size, &_pause_succeeded);
     } else {
-      bool should_upgrade_to_full = !g1h->should_do_concurrent_full_gc(_gc_cause) &&
-                                    !g1h->has_regions_left_for_allocation();
+      bool should_upgrade_to_full = g1h->should_upgrade_to_full_gc(_gc_cause);
+
       if (should_upgrade_to_full) {
         // There has been a request to perform a GC to free some space. We have no
         // information on how much memory has been asked for. In case there are
--- a/src/hotspot/share/gc/g1/g1YoungGenSizer.cpp	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/hotspot/share/gc/g1/g1YoungGenSizer.cpp	Tue Jan 15 10:55:26 2019 -0800
@@ -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
@@ -23,12 +23,14 @@
  */
 
 #include "precompiled.hpp"
+#include "gc/g1/g1CollectorPolicy.hpp"
+#include "gc/g1/g1HeterogeneousHeapYoungGenSizer.hpp"
 #include "gc/g1/g1YoungGenSizer.hpp"
 #include "gc/g1/heapRegion.hpp"
 #include "logging/log.hpp"
 
 G1YoungGenSizer::G1YoungGenSizer() : _sizer_kind(SizerDefaults),
-  _min_desired_young_length(0), _max_desired_young_length(0), _adaptive_size(true) {
+  _adaptive_size(true), _min_desired_young_length(0), _max_desired_young_length(0) {
 
   if (FLAG_IS_CMDLINE(NewRatio)) {
     if (FLAG_IS_CMDLINE(NewSize) || FLAG_IS_CMDLINE(MaxNewSize)) {
@@ -127,3 +129,11 @@
   recalculate_min_max_young_length(new_number_of_heap_regions, &_min_desired_young_length,
           &_max_desired_young_length);
 }
+
+G1YoungGenSizer* G1YoungGenSizer::create_gen_sizer(G1CollectorPolicy* policy) {
+  if (policy->is_hetero_heap()) {
+    return new G1HeterogeneousHeapYoungGenSizer();
+  } else {
+    return new G1YoungGenSizer();
+  }
+}
--- a/src/hotspot/share/gc/g1/g1YoungGenSizer.hpp	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/hotspot/share/gc/g1/g1YoungGenSizer.hpp	Tue Jan 15 10:55:26 2019 -0800
@@ -25,6 +25,7 @@
 #ifndef SHARE_VM_GC_G1_G1YOUNGGENSIZER_HPP
 #define SHARE_VM_GC_G1_G1YOUNGGENSIZER_HPP
 
+#include "gc/g1/g1CollectorPolicy.hpp"
 #include "utilities/globalDefinitions.hpp"
 
 // There are three command line options related to the young gen size:
@@ -63,7 +64,7 @@
 //
 // NewSize and MaxNewSize override NewRatio. So, NewRatio is ignored if it is
 // combined with either NewSize or MaxNewSize. (A warning message is printed.)
-class G1YoungGenSizer {
+class G1YoungGenSizer : public CHeapObj<mtGC> {
 private:
   enum SizerKind {
     SizerDefaults,
@@ -73,8 +74,6 @@
     SizerNewRatio
   };
   SizerKind _sizer_kind;
-  uint _min_desired_young_length;
-  uint _max_desired_young_length;
 
   // False when using a fixed young generation size due to command-line options,
   // true otherwise.
@@ -87,13 +86,17 @@
   // given the number of heap regions depending on the kind of sizing algorithm.
   void recalculate_min_max_young_length(uint number_of_heap_regions, uint* min_young_length, uint* max_young_length);
 
+protected:
+  uint _min_desired_young_length;
+  uint _max_desired_young_length;
+
 public:
   G1YoungGenSizer();
   // Calculate the maximum length of the young gen given the number of regions
   // depending on the sizing algorithm.
-  void adjust_max_new_size(uint number_of_heap_regions);
+  virtual void adjust_max_new_size(uint number_of_heap_regions);
 
-  void heap_size_changed(uint new_number_of_heap_regions);
+  virtual void heap_size_changed(uint new_number_of_heap_regions);
   uint min_desired_young_length() const {
     return _min_desired_young_length;
   }
@@ -104,6 +107,8 @@
   bool adaptive_young_list_length() const {
     return _adaptive_size;
   }
+
+  static G1YoungGenSizer* create_gen_sizer(G1CollectorPolicy* policy);
 };
 
 #endif // SHARE_VM_GC_G1_G1YOUNGGENSIZER_HPP
--- a/src/hotspot/share/gc/g1/g1YoungRemSetSamplingThread.cpp	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/hotspot/share/gc/g1/g1YoungRemSetSamplingThread.cpp	Tue Jan 15 10:55:26 2019 -0800
@@ -71,9 +71,9 @@
 
   // Check if load is lower than max.
   double recent_load;
-  if ((G1PeriodicGCSystemLoadThreshold > 0) &&
+  if ((G1PeriodicGCSystemLoadThreshold > 0.0f) &&
       (os::loadavg(&recent_load, 1) == -1 || recent_load > G1PeriodicGCSystemLoadThreshold)) {
-    log_debug(gc, periodic)("Load %1.2f is higher than threshold " UINTX_FORMAT ". Skipping.",
+    log_debug(gc, periodic)("Load %1.2f is higher than threshold %1.2f. Skipping.",
                             recent_load, G1PeriodicGCSystemLoadThreshold);
     return false;
   }
--- a/src/hotspot/share/gc/g1/g1_globals.hpp	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/hotspot/share/gc/g1/g1_globals.hpp	Tue Jan 15 10:55:26 2019 -0800
@@ -311,10 +311,21 @@
           "perform a concurrent GC as periodic GC, otherwise use a STW "    \
           "Full GC.")                                                       \
                                                                             \
-  manageable(uintx, G1PeriodicGCSystemLoadThreshold, 0,                     \
-          "Maximum recent system wide system load as returned by the 1m "   \
-          "value of getloadavg() at which G1 triggers a periodic GC. A "    \
-          "load above this value cancels a given periodic GC. A value of "  \
-          "zero disables this check.")                                      \
+  manageable(double, G1PeriodicGCSystemLoadThreshold, 0.0,                  \
+          "Maximum recent system wide load as returned by the 1m value "    \
+          "of getloadavg() at which G1 triggers a periodic GC. A load "     \
+          "above this value cancels a given periodic GC. A value of zero "  \
+          "disables this check.")                                           \
+          range(0.0, (double)max_uintx)                                     \
+                                                                            \
+  experimental(uintx, G1YoungExpansionBufferPercent, 10,                    \
+               "When heterogenous heap is enabled by AllocateOldGenAt "     \
+               "option, after every GC, young gen is re-sized which "       \
+               "involves system calls to commit/uncommit memory. To "       \
+               "reduce these calls, we keep a buffer of extra regions to "  \
+               "absorb small changes in young gen length. This flag takes " \
+               "the buffer size as an percentage of young gen length")      \
+               range(0, 100)                                                \
+
 
 #endif // SHARE_VM_GC_G1_G1_GLOBALS_HPP
--- a/src/hotspot/share/gc/g1/heapRegionManager.cpp	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/hotspot/share/gc/g1/heapRegionManager.cpp	Tue Jan 15 10:55:26 2019 -0800
@@ -28,6 +28,8 @@
 #include "gc/g1/heapRegion.hpp"
 #include "gc/g1/heapRegionManager.inline.hpp"
 #include "gc/g1/heapRegionSet.inline.hpp"
+#include "gc/g1/heterogeneousHeapRegionManager.hpp"
+#include "gc/shared/collectorPolicy.hpp"
 #include "memory/allocation.hpp"
 #include "utilities/bitMap.inline.hpp"
 
@@ -54,18 +56,25 @@
 };
 
 HeapRegionManager::HeapRegionManager() :
-  _regions(), _heap_mapper(NULL),
-  _prev_bitmap_mapper(NULL),
-  _next_bitmap_mapper(NULL),
   _bot_mapper(NULL),
   _cardtable_mapper(NULL),
   _card_counts_mapper(NULL),
-  _free_list("Free list", new MasterFreeRegionListChecker()),
   _available_map(mtGC),
   _num_committed(0),
-  _allocated_heapregions_length(0)
+  _allocated_heapregions_length(0),
+  _regions(), _heap_mapper(NULL),
+  _prev_bitmap_mapper(NULL),
+  _next_bitmap_mapper(NULL),
+  _free_list("Free list", new MasterFreeRegionListChecker())
 { }
 
+HeapRegionManager* HeapRegionManager::create_manager(G1CollectedHeap* heap, G1CollectorPolicy* policy) {
+  if (policy->is_hetero_heap()) {
+    return new HeterogeneousHeapRegionManager((uint)(policy->max_heap_byte_size() / HeapRegion::GrainBytes) /*heap size as num of regions*/);
+  }
+  return new HeapRegionManager();
+}
+
 void HeapRegionManager::initialize(G1RegionToSpaceMapper* heap_storage,
                                G1RegionToSpaceMapper* prev_bitmap,
                                G1RegionToSpaceMapper* next_bitmap,
@@ -514,7 +523,7 @@
 #endif // PRODUCT
 
 HeapRegionClaimer::HeapRegionClaimer(uint n_workers) :
-    _n_workers(n_workers), _n_regions(G1CollectedHeap::heap()->_hrm._allocated_heapregions_length), _claims(NULL) {
+    _n_workers(n_workers), _n_regions(G1CollectedHeap::heap()->_hrm->_allocated_heapregions_length), _claims(NULL) {
   assert(n_workers > 0, "Need at least one worker.");
   uint* new_claims = NEW_C_HEAP_ARRAY(uint, _n_regions, mtGC);
   memset(new_claims, Unclaimed, sizeof(*_claims) * _n_regions);
--- a/src/hotspot/share/gc/g1/heapRegionManager.hpp	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/hotspot/share/gc/g1/heapRegionManager.hpp	Tue Jan 15 10:55:26 2019 -0800
@@ -26,8 +26,10 @@
 #define SHARE_VM_GC_G1_HEAPREGIONMANAGER_HPP
 
 #include "gc/g1/g1BiasedArray.hpp"
+#include "gc/g1/g1CollectorPolicy.hpp"
 #include "gc/g1/g1RegionToSpaceMapper.hpp"
 #include "gc/g1/heapRegionSet.hpp"
+#include "gc/shared/collectorPolicy.hpp"
 #include "services/memoryUsage.hpp"
 
 class HeapRegion;
@@ -71,17 +73,10 @@
   friend class VMStructs;
   friend class HeapRegionClaimer;
 
-  G1HeapRegionTable _regions;
-
-  G1RegionToSpaceMapper* _heap_mapper;
-  G1RegionToSpaceMapper* _prev_bitmap_mapper;
-  G1RegionToSpaceMapper* _next_bitmap_mapper;
   G1RegionToSpaceMapper* _bot_mapper;
   G1RegionToSpaceMapper* _cardtable_mapper;
   G1RegionToSpaceMapper* _card_counts_mapper;
 
-  FreeRegionList _free_list;
-
   // Each bit in this bitmap indicates that the corresponding region is available
   // for allocation.
   CHeapBitMap _available_map;
@@ -95,11 +90,8 @@
   HeapWord* heap_bottom() const { return _regions.bottom_address_mapped(); }
   HeapWord* heap_end() const {return _regions.end_address_mapped(); }
 
-  void make_regions_available(uint index, uint num_regions = 1, WorkGang* pretouch_gang = NULL);
-
   // Pass down commit calls to the VirtualSpace.
   void commit_regions(uint index, size_t num_regions = 1, WorkGang* pretouch_gang = NULL);
-  void uncommit_regions(uint index, size_t num_regions = 1);
 
   // Notify other data structures about change in the heap layout.
   void update_committed_space(HeapWord* old_end, HeapWord* new_end);
@@ -117,6 +109,16 @@
   // the heap. Returns the length of the sequence found. If this value is zero, no
   // sequence could be found, otherwise res_idx contains the start index of this range.
   uint find_empty_from_idx_reverse(uint start_idx, uint* res_idx) const;
+
+protected:
+  G1HeapRegionTable _regions;
+  G1RegionToSpaceMapper* _heap_mapper;
+  G1RegionToSpaceMapper* _prev_bitmap_mapper;
+  G1RegionToSpaceMapper* _next_bitmap_mapper;
+  FreeRegionList _free_list;
+
+  void make_regions_available(uint index, uint num_regions = 1, WorkGang* pretouch_gang = NULL);
+  void uncommit_regions(uint index, size_t num_regions = 1);
   // Allocate a new HeapRegion for the given index.
   HeapRegion* new_heap_region(uint hrm_index);
 #ifdef ASSERT
@@ -127,18 +129,25 @@
   // Empty constructor, we'll initialize it with the initialize() method.
   HeapRegionManager();
 
-  void initialize(G1RegionToSpaceMapper* heap_storage,
-                  G1RegionToSpaceMapper* prev_bitmap,
-                  G1RegionToSpaceMapper* next_bitmap,
-                  G1RegionToSpaceMapper* bot,
-                  G1RegionToSpaceMapper* cardtable,
-                  G1RegionToSpaceMapper* card_counts);
+  static HeapRegionManager* create_manager(G1CollectedHeap* heap, G1CollectorPolicy* policy);
+
+  virtual void initialize(G1RegionToSpaceMapper* heap_storage,
+                          G1RegionToSpaceMapper* prev_bitmap,
+                          G1RegionToSpaceMapper* next_bitmap,
+                          G1RegionToSpaceMapper* bot,
+                          G1RegionToSpaceMapper* cardtable,
+                          G1RegionToSpaceMapper* card_counts);
+
+  // Prepare heap regions before and after full collection.
+  // Nothing to be done in this class.
+  virtual void prepare_for_full_collection_start() {}
+  virtual void prepare_for_full_collection_end() {}
 
   // Return the "dummy" region used for G1AllocRegion. This is currently a hardwired
   // new HeapRegion that owns HeapRegion at index 0. Since at the moment we commit
   // the heap from the lowest address, this region (and its associated data
   // structures) are available and we do not need to check further.
-  HeapRegion* get_dummy_region() { return new_heap_region(0); }
+  virtual HeapRegion* get_dummy_region() { return new_heap_region(0); }
 
   // Return the HeapRegion at the given index. Assume that the index
   // is valid.
@@ -167,8 +176,8 @@
     _free_list.add_ordered(list);
   }
 
-  HeapRegion* allocate_free_region(bool is_old) {
-    HeapRegion* hr = _free_list.remove_region(is_old);
+  virtual HeapRegion* allocate_free_region(HeapRegionType type) {
+    HeapRegion* hr = _free_list.remove_region(!type.is_young());
 
     if (hr != NULL) {
       assert(hr->next() == NULL, "Single region should not have next");
@@ -202,6 +211,9 @@
   // Return the maximum number of regions in the heap.
   uint max_length() const { return (uint)_regions.length(); }
 
+  // Return maximum number of regions that heap can expand to.
+  virtual uint max_expandable_length() const { return (uint)_regions.length(); }
+
   MemoryUsage get_auxiliary_data_memory_usage() const;
 
   MemRegion reserved() const { return MemRegion(heap_bottom(), heap_end()); }
@@ -210,26 +222,26 @@
   // HeapRegions, or re-use existing ones. Returns the number of regions the
   // sequence was expanded by. If a HeapRegion allocation fails, the resulting
   // number of regions might be smaller than what's desired.
-  uint expand_by(uint num_regions, WorkGang* pretouch_workers);
+  virtual uint expand_by(uint num_regions, WorkGang* pretouch_workers);
 
   // Makes sure that the regions from start to start+num_regions-1 are available
   // for allocation. Returns the number of regions that were committed to achieve
   // this.
-  uint expand_at(uint start, uint num_regions, WorkGang* pretouch_workers);
+  virtual uint expand_at(uint start, uint num_regions, WorkGang* pretouch_workers);
 
   // Find a contiguous set of empty regions of length num. Returns the start index of
   // that set, or G1_NO_HRM_INDEX.
-  uint find_contiguous_only_empty(size_t num) { return find_contiguous(num, true); }
+  virtual uint find_contiguous_only_empty(size_t num) { return find_contiguous(num, true); }
   // Find a contiguous set of empty or unavailable regions of length num. Returns the
   // start index of that set, or G1_NO_HRM_INDEX.
-  uint find_contiguous_empty_or_unavailable(size_t num) { return find_contiguous(num, false); }
+  virtual uint find_contiguous_empty_or_unavailable(size_t num) { return find_contiguous(num, false); }
 
   HeapRegion* next_region_in_heap(const HeapRegion* r) const;
 
   // Find the highest free or uncommitted region in the reserved heap,
   // and if uncommitted, commit it. If none are available, return G1_NO_HRM_INDEX.
   // Set the 'expanded' boolean true if a new region was committed.
-  uint find_highest_free(bool* expanded);
+  virtual uint find_highest_free(bool* expanded);
 
   // Allocate the regions that contain the address range specified, committing the
   // regions if necessary. Return false if any of the regions is already committed
@@ -244,13 +256,13 @@
 
   // Uncommit up to num_regions_to_remove regions that are completely free.
   // Return the actual number of uncommitted regions.
-  uint shrink_by(uint num_regions_to_remove);
+  virtual uint shrink_by(uint num_regions_to_remove);
 
   // Uncommit a number of regions starting at the specified index, which must be available,
   // empty, and free.
   void shrink_at(uint index, size_t num_regions);
 
-  void verify();
+  virtual void verify();
 
   // Do some sanity checking.
   void verify_optional() PRODUCT_RETURN;
--- a/src/hotspot/share/gc/g1/heapRegionSet.cpp	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/hotspot/share/gc/g1/heapRegionSet.cpp	Tue Jan 15 10:55:26 2019 -0800
@@ -234,6 +234,21 @@
   verify_optional();
 }
 
+uint FreeRegionList::num_of_regions_in_range(uint start, uint end) const {
+  HeapRegion* cur = _head;
+  uint num = 0;
+  while (cur != NULL) {
+    uint index = cur->hrm_index();
+    if (index > end) {
+      break;
+    } else if (index >= start) {
+      num++;
+    }
+    cur = cur->next();
+  }
+  return num;
+}
+
 void FreeRegionList::verify() {
   // See comment in HeapRegionSetBase::verify() about MT safety and
   // verification.
--- a/src/hotspot/share/gc/g1/heapRegionSet.hpp	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/hotspot/share/gc/g1/heapRegionSet.hpp	Tue Jan 15 10:55:26 2019 -0800
@@ -194,6 +194,8 @@
   void remove_starting_at(HeapRegion* first, uint num_regions);
 
   virtual void verify();
+
+  uint num_of_regions_in_range(uint start, uint end) const;
 };
 
 // Iterator class that provides a convenient way to iterate over the
--- a/src/hotspot/share/gc/g1/heapRegionType.cpp	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/hotspot/share/gc/g1/heapRegionType.cpp	Tue Jan 15 10:55:26 2019 -0800
@@ -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
@@ -26,6 +26,11 @@
 #include "gc/g1/g1HeapRegionTraceType.hpp"
 #include "gc/g1/heapRegionType.hpp"
 
+const HeapRegionType HeapRegionType::Eden      = HeapRegionType(EdenTag);
+const HeapRegionType HeapRegionType::Survivor  = HeapRegionType(SurvTag);
+const HeapRegionType HeapRegionType::Old       = HeapRegionType(OldTag);
+const HeapRegionType HeapRegionType::Humongous = HeapRegionType(StartsHumongousTag);
+
 bool HeapRegionType::is_valid(Tag tag) {
   switch (tag) {
     case FreeTag:
--- a/src/hotspot/share/gc/g1/heapRegionType.hpp	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/hotspot/share/gc/g1/heapRegionType.hpp	Tue Jan 15 10:55:26 2019 -0800
@@ -117,6 +117,9 @@
     _tag = tag;
   }
 
+  // Private constructor used static constants
+  HeapRegionType(Tag t) : _tag(t) { hrt_assert_is_valid(_tag); }
+
 public:
   // Queries
 
@@ -186,6 +189,11 @@
   G1HeapRegionTraceType::Type get_trace_type();
 
   HeapRegionType() : _tag(FreeTag) { hrt_assert_is_valid(_tag); }
+
+  static const HeapRegionType Eden;
+  static const HeapRegionType Survivor;
+  static const HeapRegionType Old;
+  static const HeapRegionType Humongous;
 };
 
 #endif // SHARE_VM_GC_G1_HEAPREGIONTYPE_HPP
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/hotspot/share/gc/g1/heterogeneousHeapRegionManager.cpp	Tue Jan 15 10:55:26 2019 -0800
@@ -0,0 +1,523 @@
+/*
+ * 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.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+#include "precompiled.hpp"
+#include "gc/g1/g1CollectedHeap.inline.hpp"
+#include "gc/g1/g1ConcurrentRefine.hpp"
+#include "gc/g1/heapRegion.hpp"
+#include "gc/g1/heapRegionManager.inline.hpp"
+#include "gc/g1/heapRegionSet.inline.hpp"
+#include "gc/g1/heterogeneousHeapRegionManager.hpp"
+#include "memory/allocation.hpp"
+
+
+HeterogeneousHeapRegionManager* HeterogeneousHeapRegionManager::manager() {
+  G1CollectedHeap* g1h = G1CollectedHeap::heap();
+  assert(g1h != NULL, "Uninitialized access to HeterogeneousHeapRegionManager::manager()");
+
+  HeapRegionManager* hrm = g1h->hrm();
+  assert(hrm != NULL, "Uninitialized access to HeterogeneousHeapRegionManager::manager()");
+  return (HeterogeneousHeapRegionManager*)hrm;
+}
+
+void HeterogeneousHeapRegionManager::initialize(G1RegionToSpaceMapper* heap_storage,
+                                                G1RegionToSpaceMapper* prev_bitmap,
+                                                G1RegionToSpaceMapper* next_bitmap,
+                                                G1RegionToSpaceMapper* bot,
+                                                G1RegionToSpaceMapper* cardtable,
+                                                G1RegionToSpaceMapper* card_counts) {
+  HeapRegionManager::initialize(heap_storage, prev_bitmap, next_bitmap, bot, cardtable, card_counts);
+
+  // We commit bitmap for all regions during initialization and mark the bitmap space as special.
+  // This allows regions to be un-committed while concurrent-marking threads are accessing the bitmap concurrently.
+  _prev_bitmap_mapper->commit_and_set_special();
+  _next_bitmap_mapper->commit_and_set_special();
+}
+
+// expand_by() is called to grow the heap. We grow into nvdimm now.
+// Dram regions are committed later as needed during mutator region allocation or
+// when young list target length is determined after gc cycle.
+uint HeterogeneousHeapRegionManager::expand_by(uint num_regions, WorkGang* pretouch_workers) {
+  uint num_regions_possible = total_regions_committed() >= max_expandable_length() ? 0 : max_expandable_length() - total_regions_committed();
+  uint num_expanded = expand_nvdimm(MIN2(num_regions, num_regions_possible), pretouch_workers);
+  return num_expanded;
+}
+
+// Expands heap starting from 'start' index. The question is should we expand from one memory (e.g. nvdimm) to another (e.g. dram).
+// Looking at the code, expand_at() is called for humongous allocation where 'start' is in nv-dimm.
+// So we only allocate regions in the same kind of memory as 'start'.
+uint HeterogeneousHeapRegionManager::expand_at(uint start, uint num_regions, WorkGang* pretouch_workers) {
+  if (num_regions == 0) {
+    return 0;
+  }
+  uint target_num_regions = MIN2(num_regions, max_expandable_length() - total_regions_committed());
+  uint end = is_in_nvdimm(start) ? end_index_of_nvdimm() : end_index_of_dram();
+
+  uint num_expanded = expand_in_range(start, end, target_num_regions, pretouch_workers);
+  assert(total_regions_committed() <= max_expandable_length(), "must be");
+  return num_expanded;
+}
+
+// This function ensures that there are 'expected_num_regions' committed regions in dram.
+// If new regions are committed, it un-commits that many regions from nv-dimm.
+// If there are already more regions committed in dram, extra regions are un-committed.
+void HeterogeneousHeapRegionManager::adjust_dram_regions(uint expected_num_regions, WorkGang* pretouch_workers) {
+
+  // Release back the extra regions allocated in evacuation failure scenario.
+  if(_no_borrowed_regions > 0) {
+    _no_borrowed_regions -= shrink_dram(_no_borrowed_regions);
+    _no_borrowed_regions -= shrink_nvdimm(_no_borrowed_regions);
+  }
+
+  if(expected_num_regions > free_list_dram_length()) {
+    // If we are going to expand DRAM, we expand a little more so that we can absorb small variations in Young gen sizing.
+    uint targeted_dram_regions = expected_num_regions * (1 + (double)G1YoungExpansionBufferPercent / 100);
+    uint to_be_made_available = targeted_dram_regions - free_list_dram_length();
+
+#ifdef ASSERT
+    uint total_committed_before = total_regions_committed();
+#endif
+    uint can_be_made_available = shrink_nvdimm(to_be_made_available);
+    uint ret = expand_dram(can_be_made_available, pretouch_workers);
+#ifdef ASSERT
+    assert(ret == can_be_made_available, "should be equal");
+    assert(total_committed_before == total_regions_committed(), "invariant not met");
+#endif
+  } else {
+    uint to_be_released = free_list_dram_length() - expected_num_regions;
+    // if number of extra DRAM regions is small, do not shrink.
+    if (to_be_released < expected_num_regions * G1YoungExpansionBufferPercent / 100) {
+      return;
+    }
+
+#ifdef ASSERT
+    uint total_committed_before = total_regions_committed();
+#endif
+    uint ret = shrink_dram(to_be_released);
+    assert(ret == to_be_released, "Should be able to shrink by given amount");
+    ret = expand_nvdimm(to_be_released, pretouch_workers);
+#ifdef ASSERT
+    assert(ret == to_be_released, "Should be able to expand by given amount");
+    assert(total_committed_before == total_regions_committed(), "invariant not met");
+#endif
+  }
+}
+
+uint HeterogeneousHeapRegionManager::total_regions_committed() const {
+  return num_committed_dram() + num_committed_nvdimm();
+}
+
+uint HeterogeneousHeapRegionManager::num_committed_dram() const {
+  // This class does not keep count of committed regions in dram and nv-dimm.
+  // G1RegionToHeteroSpaceMapper keeps this information.
+  return static_cast<G1RegionToHeteroSpaceMapper*>(_heap_mapper)->num_committed_dram();
+}
+
+uint HeterogeneousHeapRegionManager::num_committed_nvdimm() const {
+  // See comment for num_committed_dram()
+  return static_cast<G1RegionToHeteroSpaceMapper*>(_heap_mapper)->num_committed_nvdimm();
+}
+
+// Return maximum number of regions that heap can expand to.
+uint HeterogeneousHeapRegionManager::max_expandable_length() const {
+  return _max_regions;
+}
+
+uint HeterogeneousHeapRegionManager::find_unavailable_in_range(uint start_idx, uint end_idx, uint* res_idx) const {
+  guarantee(res_idx != NULL, "checking");
+  guarantee(start_idx <= (max_length() + 1), "checking");
+
+  uint num_regions = 0;
+
+  uint cur = start_idx;
+  while (cur <= end_idx && is_available(cur)) {
+    cur++;
+  }
+  if (cur == end_idx + 1) {
+    return num_regions;
+  }
+  *res_idx = cur;
+  while (cur <= end_idx && !is_available(cur)) {
+    cur++;
+  }
+  num_regions = cur - *res_idx;
+
+#ifdef ASSERT
+  for (uint i = *res_idx; i < (*res_idx + num_regions); i++) {
+    assert(!is_available(i), "just checking");
+  }
+  assert(cur == end_idx + 1 || num_regions == 0 || is_available(cur),
+    "The region at the current position %u must be available or at the end", cur);
+#endif
+  return num_regions;
+}
+
+uint HeterogeneousHeapRegionManager::expand_dram(uint num_regions, WorkGang* pretouch_workers) {
+  return expand_in_range(start_index_of_dram(), end_index_of_dram(), num_regions, pretouch_workers);
+}
+
+uint HeterogeneousHeapRegionManager::expand_nvdimm(uint num_regions, WorkGang* pretouch_workers) {
+  return expand_in_range(start_index_of_nvdimm(), end_index_of_nvdimm(), num_regions, pretouch_workers);
+}
+
+// Follows same logic as expand_at() form HeapRegionManager.
+uint HeterogeneousHeapRegionManager::expand_in_range(uint start, uint end, uint num_regions, WorkGang* pretouch_gang) {
+
+  uint so_far = 0;
+  uint chunk_start = 0;
+  uint num_last_found = 0;
+  while (so_far < num_regions &&
+         (num_last_found = find_unavailable_in_range(start, end, &chunk_start)) > 0) {
+    uint to_commit = MIN2(num_regions - so_far, num_last_found);
+    make_regions_available(chunk_start, to_commit, pretouch_gang);
+    so_far += to_commit;
+    start = chunk_start + to_commit + 1;
+  }
+
+  return so_far;
+}
+
+// Shrink in the range of indexes which are reserved for dram.
+uint HeterogeneousHeapRegionManager::shrink_dram(uint num_regions, bool update_free_list) {
+  return shrink_in_range(start_index_of_dram(), end_index_of_dram(), num_regions, update_free_list);
+}
+
+// Shrink in the range of indexes which are reserved for nv-dimm.
+uint HeterogeneousHeapRegionManager::shrink_nvdimm(uint num_regions, bool update_free_list) {
+  return shrink_in_range(start_index_of_nvdimm(), end_index_of_nvdimm(), num_regions, update_free_list);
+}
+
+// Find empty regions in given range, un-commit them and return the count.
+uint HeterogeneousHeapRegionManager::shrink_in_range(uint start, uint end, uint num_regions, bool update_free_list) {
+
+  if (num_regions == 0) {
+    return 0;
+  }
+  uint so_far = 0;
+  uint idx_last_found = 0;
+  uint num_last_found;
+  while (so_far < num_regions &&
+         (num_last_found = find_empty_in_range_reverse(start, end, &idx_last_found)) > 0) {
+    uint to_uncommit = MIN2(num_regions - so_far, num_last_found);
+    if(update_free_list) {
+      _free_list.remove_starting_at(at(idx_last_found + num_last_found - to_uncommit), to_uncommit);
+    }
+    uncommit_regions(idx_last_found + num_last_found - to_uncommit, to_uncommit);
+    so_far += to_uncommit;
+    end = idx_last_found;
+  }
+  return so_far;
+}
+
+uint HeterogeneousHeapRegionManager::find_empty_in_range_reverse(uint start_idx, uint end_idx, uint* res_idx) {
+  guarantee(res_idx != NULL, "checking");
+  guarantee(start_idx < max_length(), "checking");
+  guarantee(end_idx < max_length(), "checking");
+  if(start_idx > end_idx) {
+    return 0;
+  }
+
+  uint num_regions_found = 0;
+
+  jlong cur = end_idx;
+  while (cur >= start_idx && !(is_available(cur) && at(cur)->is_empty())) {
+    cur--;
+  }
+  if (cur == start_idx - 1) {
+    return num_regions_found;
+  }
+  jlong old_cur = cur;
+  // cur indexes the first empty region
+  while (cur >= start_idx && is_available(cur) && at(cur)->is_empty()) {
+    cur--;
+  }
+  *res_idx = cur + 1;
+  num_regions_found = old_cur - cur;
+
+#ifdef ASSERT
+  for (uint i = *res_idx; i < (*res_idx + num_regions_found); i++) {
+    assert(at(i)->is_empty(), "just checking");
+  }
+#endif
+  return num_regions_found;
+}
+
+HeapRegion* HeterogeneousHeapRegionManager::allocate_free_region(HeapRegionType type) {
+
+  // We want to prevent mutators from proceeding when we have borrowed regions from the last collection. This
+  // will force a full collection to remedy the situation.
+  // Free region requests from GC threads can proceed.
+  if(type.is_eden() || type.is_humongous()) {
+    if(has_borrowed_regions()) {
+      return NULL;
+    }
+  }
+
+  // old and humongous regions are allocated from nv-dimm; eden and survivor regions are allocated from dram
+  // assumption: dram regions take higher indexes
+  bool from_nvdimm = (type.is_old() || type.is_humongous()) ? true : false;
+  bool from_head = from_nvdimm;
+  HeapRegion* hr = _free_list.remove_region(from_head);
+
+  if (hr != NULL && ( (from_nvdimm && !is_in_nvdimm(hr->hrm_index())) || (!from_nvdimm && !is_in_dram(hr->hrm_index())) ) ) {
+    _free_list.add_ordered(hr);
+    hr = NULL;
+  }
+
+#ifdef ASSERT
+  uint total_committed_before = total_regions_committed();
+#endif
+
+  if (hr == NULL) {
+    if (!from_nvdimm) {
+      uint ret = shrink_nvdimm(1);
+      if (ret == 1) {
+        ret = expand_dram(1, NULL);
+        assert(ret == 1, "We should be able to commit one region");
+        hr = _free_list.remove_region(from_head);
+      }
+    }
+    else { /*is_old*/
+      uint ret = shrink_dram(1);
+      if (ret == 1) {
+        ret = expand_nvdimm(1, NULL);
+        assert(ret == 1, "We should be able to commit one region");
+        hr = _free_list.remove_region(from_head);
+      }
+    }
+  }
+#ifdef ASSERT
+  assert(total_committed_before == total_regions_committed(), "invariant not met");
+#endif
+
+  // When an old region is requested (which happens during collection pause) and we can't find any empty region
+  // in the set of available regions (which is an evacuation failure scenario), we borrow (or pre-allocate) an unavailable region
+  // from nv-dimm. This region is used to evacuate surviving objects from eden, survivor or old.
+  if(hr == NULL && type.is_old()) {
+    hr = borrow_old_region_for_gc();
+  }
+
+  if (hr != NULL) {
+    assert(hr->next() == NULL, "Single region should not have next");
+    assert(is_available(hr->hrm_index()), "Must be committed");
+  }
+  return hr;
+}
+
+uint HeterogeneousHeapRegionManager::find_contiguous_only_empty(size_t num) {
+  if (has_borrowed_regions()) {
+      return G1_NO_HRM_INDEX;
+  }
+  return find_contiguous(start_index_of_nvdimm(), end_index_of_nvdimm(), num, true);
+}
+
+uint HeterogeneousHeapRegionManager::find_contiguous_empty_or_unavailable(size_t num) {
+  if (has_borrowed_regions()) {
+    return G1_NO_HRM_INDEX;
+  }
+  return find_contiguous(start_index_of_nvdimm(), end_index_of_nvdimm(), num, false);
+}
+
+uint HeterogeneousHeapRegionManager::find_contiguous(size_t start, size_t end, size_t num, bool empty_only) {
+  uint found = 0;
+  size_t length_found = 0;
+  uint cur = (uint)start;
+  uint length_unavailable = 0;
+
+  while (length_found < num && cur <= end) {
+    HeapRegion* hr = _regions.get_by_index(cur);
+    if ((!empty_only && !is_available(cur)) || (is_available(cur) && hr != NULL && hr->is_empty())) {
+      // This region is a potential candidate for allocation into.
+      if (!is_available(cur)) {
+        if(shrink_dram(1) == 1) {
+          uint ret = expand_in_range(cur, cur, 1, NULL);
+          assert(ret == 1, "We should be able to expand at this index");
+        } else {
+          length_unavailable++;
+        }
+      }
+      length_found++;
+    }
+    else {
+      // This region is not a candidate. The next region is the next possible one.
+      found = cur + 1;
+      length_found = 0;
+    }
+    cur++;
+  }
+
+  if (length_found == num) {
+    for (uint i = found; i < (found + num); i++) {
+      HeapRegion* hr = _regions.get_by_index(i);
+      // sanity check
+      guarantee((!empty_only && !is_available(i)) || (is_available(i) && hr != NULL && hr->is_empty()),
+                "Found region sequence starting at " UINT32_FORMAT ", length " SIZE_FORMAT
+                " that is not empty at " UINT32_FORMAT ". Hr is " PTR_FORMAT, found, num, i, p2i(hr));
+    }
+    if (!empty_only && length_unavailable > (max_expandable_length() - total_regions_committed())) {
+      // if 'length_unavailable' number of regions will be made available, we will exceed max regions.
+      return G1_NO_HRM_INDEX;
+    }
+    return found;
+  }
+  else {
+    return G1_NO_HRM_INDEX;
+  }
+}
+
+uint HeterogeneousHeapRegionManager::find_highest_free(bool* expanded) {
+  // Loop downwards from the highest dram region index, looking for an
+  // entry which is either free or not yet committed.  If not yet
+  // committed, expand_at that index.
+  uint curr = end_index_of_dram();
+  while (true) {
+    HeapRegion *hr = _regions.get_by_index(curr);
+    if (hr == NULL && !(total_regions_committed() < _max_regions)) {
+      uint res = shrink_nvdimm(1);
+      if (res == 1) {
+        res = expand_in_range(curr, curr, 1, NULL);
+        assert(res == 1, "We should be able to expand since shrink was successful");
+        *expanded = true;
+        return curr;
+      }
+    }
+    else {
+      if (hr->is_free()) {
+        *expanded = false;
+        return curr;
+      }
+    }
+    if (curr == start_index_of_dram()) {
+      return G1_NO_HRM_INDEX;
+    }
+    curr--;
+  }
+}
+
+// We need to override this since region 0 which serves are dummy region in base class may not be available here.
+// This is a corner condition when either number of regions is small. When adaptive sizing is used, initial heap size
+// could be just one region.  This region is commited in dram to be used for young generation, leaving region 0 (which is in nvdimm)
+// unavailable.
+HeapRegion* HeterogeneousHeapRegionManager::get_dummy_region() {
+  uint curr = 0;
+
+  while (curr < _regions.length()) {
+    if (is_available(curr)) {
+      return new_heap_region(curr);
+    }
+    curr++;
+  }
+  assert(false, "We should always find a region available for dummy region");
+  return NULL;
+}
+
+// First shrink in dram, then in nv-dimm.
+uint HeterogeneousHeapRegionManager::shrink_by(uint num_regions) {
+  // This call is made at end of full collection. Before making this call the region sets are tore down (tear_down_region_sets()).
+  // So shrink() calls below do not need to remove uncomitted regions from free list.
+  uint ret = shrink_dram(num_regions, false /* update_free_list */);
+  ret += shrink_nvdimm(num_regions - ret, false /* update_free_list */);
+  return ret;
+}
+
+void HeterogeneousHeapRegionManager::verify() {
+  HeapRegionManager::verify();
+}
+
+uint HeterogeneousHeapRegionManager::free_list_dram_length() const {
+  return _free_list.num_of_regions_in_range(start_index_of_dram(), end_index_of_dram());
+}
+
+uint HeterogeneousHeapRegionManager::free_list_nvdimm_length() const {
+  return _free_list.num_of_regions_in_range(start_index_of_nvdimm(), end_index_of_nvdimm());
+}
+
+bool HeterogeneousHeapRegionManager::is_in_nvdimm(uint index) const {
+  return index >= start_index_of_nvdimm() && index <= end_index_of_nvdimm();
+}
+
+bool HeterogeneousHeapRegionManager::is_in_dram(uint index) const {
+  return index >= start_index_of_dram() && index <= end_index_of_dram();
+}
+
+// We have to make sure full collection copies all surviving objects to NV-DIMM.
+// We might not have enough regions in nvdimm_set, so we need to make more regions on NV-DIMM available for full collection.
+// Note: by doing this we are breaking the in-variant that total number of committed regions is equal to current heap size.
+// After full collection ends, we will re-establish this in-variant by freeing DRAM regions.
+void HeterogeneousHeapRegionManager::prepare_for_full_collection_start() {
+  _total_commited_before_full_gc = total_regions_committed() - _no_borrowed_regions;
+  _no_borrowed_regions = 0;
+  expand_nvdimm(num_committed_dram(), NULL);
+  remove_all_free_regions();
+}
+
+// We need to bring back the total committed regions to before full collection start.
+// Unless we are close to OOM, all regular (not pinned) regions in DRAM should be free.
+// We shrink all free regions in DRAM and if needed from NV-DIMM (when there are pinned DRAM regions)
+// If we can't bring back committed regions count to _total_commited_before_full_gc, we keep the extra count in _no_borrowed_regions.
+// When this GC finishes, new regions won't be allocated since has_borrowed_regions() is true. VM will be forced to re-try GC
+// with clear soft references followed by OOM error in worst case.
+void HeterogeneousHeapRegionManager::prepare_for_full_collection_end() {
+  uint shrink_size = total_regions_committed() - _total_commited_before_full_gc;
+  uint so_far = 0;
+  uint idx_last_found = 0;
+  uint num_last_found;
+  uint end = (uint)_regions.length() - 1;
+  while (so_far < shrink_size &&
+         (num_last_found = find_empty_in_range_reverse(0, end, &idx_last_found)) > 0) {
+    uint to_uncommit = MIN2(shrink_size - so_far, num_last_found);
+    uncommit_regions(idx_last_found + num_last_found - to_uncommit, to_uncommit);
+    so_far += to_uncommit;
+    end = idx_last_found;
+  }
+  // See comment above the function.
+  _no_borrowed_regions = shrink_size - so_far;
+}
+
+uint HeterogeneousHeapRegionManager::start_index_of_dram() const { return _max_regions;}
+
+uint HeterogeneousHeapRegionManager::end_index_of_dram() const { return 2*_max_regions - 1; }
+
+uint HeterogeneousHeapRegionManager::start_index_of_nvdimm() const { return 0; }
+
+uint HeterogeneousHeapRegionManager::end_index_of_nvdimm() const { return _max_regions - 1; }
+
+// This function is called when there are no free nv-dimm regions.
+// It borrows a region from the set of unavailable regions in nv-dimm for GC purpose.
+HeapRegion* HeterogeneousHeapRegionManager::borrow_old_region_for_gc() {
+  assert(free_list_nvdimm_length() == 0, "this function should be called only when there are no nv-dimm regions in free list");
+
+  uint ret = expand_nvdimm(1, NULL);
+  if(ret != 1) {
+    return NULL;
+  }
+  HeapRegion* hr = _free_list.remove_region(true /*from_head*/);
+  assert(is_in_nvdimm(hr->hrm_index()), "allocated region should be in nv-dimm");
+  _no_borrowed_regions++;
+  return hr;
+}
+
+bool HeterogeneousHeapRegionManager::has_borrowed_regions() const {
+  return _no_borrowed_regions > 0;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/hotspot/share/gc/g1/heterogeneousHeapRegionManager.hpp	Tue Jan 15 10:55:26 2019 -0800
@@ -0,0 +1,150 @@
+/*
+ * 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.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+#ifndef SHARE_VM_GC_G1_HETEROGENEOUSHEAPREGIONMANAGER_HPP
+#define SHARE_VM_GC_G1_HETEROGENEOUSHEAPREGIONMANAGER_HPP
+
+#include "gc/g1/heapRegionManager.hpp"
+
+// This class manages heap regions on heterogenous memory comprising of dram and nv-dimm.
+// Regions in dram (dram_set) are used for young objects and archive regions (CDS).
+// Regions in nv-dimm (nvdimm_set) are used for old objects and humongous objects.
+// At any point there are some regions committed on dram and some on nv-dimm with the following guarantees:
+//   1. The total number of regions committed in dram and nv-dimm equals the current size of heap.
+//   2. Consequently, total number of regions committed is less than or equal to Xmx.
+//   3. To maintain the guarantee stated by 1., whenever one set grows (new regions committed), the other set shrinks (regions un-committed).
+//      3a. If more dram regions are needed (young generation expansion), corresponding number of regions in nv-dimm are un-committed.
+//      3b. When old generation or humongous set grows, and new regions need to be committed to nv-dimm, corresponding number of regions
+//            are un-committed in dram.
+class HeterogeneousHeapRegionManager : public HeapRegionManager {
+  const uint _max_regions;
+  uint _max_dram_regions;
+  uint _max_nvdimm_regions;
+  uint _start_index_of_nvdimm;
+  uint _total_commited_before_full_gc;
+  uint _no_borrowed_regions;
+
+  uint total_regions_committed() const;
+  uint num_committed_dram() const;
+  uint num_committed_nvdimm() const;
+
+  // Similar to find_unavailable_from_idx() function from base class, difference is this function searches in range [start, end].
+  uint find_unavailable_in_range(uint start_idx, uint end_idx, uint* res_idx) const;
+
+  // Expand into dram. Maintains the invariant that total number of committed regions is less than current heap size.
+  uint expand_dram(uint num_regions, WorkGang* pretouch_workers);
+
+  // Expand into nv-dimm.
+  uint expand_nvdimm(uint num_regions, WorkGang* pretouch_workers);
+
+  // Expand by finding unavailable regions in [start, end] range.
+  uint expand_in_range(uint start, uint end, uint num_regions, WorkGang* pretouch_workers);
+
+  // Shrink dram set of regions.
+  uint shrink_dram(uint num_regions, bool update_free_list = true);
+
+  // Shrink nv-dimm set of regions.
+  uint shrink_nvdimm(uint num_regions, bool update_free_list = true);
+
+  // Shrink regions from [start, end] range.
+  uint shrink_in_range(uint start, uint end, uint num_regions, bool update_free_list = true);
+
+  // Similar to find_empty_from_idx_reverse() in base class. Only here it searches in a range.
+  uint find_empty_in_range_reverse(uint start_idx, uint end_idx, uint* res_idx);
+
+  // Similar to find_contiguous() in base class, with [start, end] range
+  uint find_contiguous(size_t start, size_t end, size_t num, bool empty_only);
+
+  // This function is called when there are no free nv-dimm regions.
+  // It borrows a region from the set of unavailable regions in nv-dimm for GC purpose.
+  HeapRegion* borrow_old_region_for_gc();
+
+  uint free_list_dram_length() const;
+  uint free_list_nvdimm_length() const;
+
+  // is region with given index in nv-dimm?
+  bool is_in_nvdimm(uint index) const;
+  bool is_in_dram(uint index) const;
+
+public:
+
+  // Empty constructor, we'll initialize it with the initialize() method.
+  HeterogeneousHeapRegionManager(uint num_regions) : _max_regions(num_regions), _max_dram_regions(0),
+                                                     _max_nvdimm_regions(0), _start_index_of_nvdimm(0),
+                                                     _total_commited_before_full_gc(0), _no_borrowed_regions(0)
+  {}
+
+  static HeterogeneousHeapRegionManager* manager();
+
+  virtual void initialize(G1RegionToSpaceMapper* heap_storage,
+                          G1RegionToSpaceMapper* prev_bitmap,
+                          G1RegionToSpaceMapper* next_bitmap,
+                          G1RegionToSpaceMapper* bot,
+                          G1RegionToSpaceMapper* cardtable,
+                          G1RegionToSpaceMapper* card_counts);
+
+  uint start_index_of_nvdimm() const;
+  uint start_index_of_dram() const;
+  uint end_index_of_nvdimm() const;
+  uint end_index_of_dram() const;
+
+  // Override.
+  HeapRegion* get_dummy_region();
+
+  // Adjust dram_set to provision 'expected_num_regions' regions.
+  void adjust_dram_regions(uint expected_num_regions, WorkGang* pretouch_workers);
+
+  // Prepare heap regions before and after full collection.
+  void prepare_for_full_collection_start();
+  void prepare_for_full_collection_end();
+
+  virtual HeapRegion* allocate_free_region(HeapRegionType type);
+
+  // Return maximum number of regions that heap can expand to.
+  uint max_expandable_length() const;
+
+  // Override. Expand in nv-dimm.
+  uint expand_by(uint num_regions, WorkGang* pretouch_workers);
+
+  // Override.
+  uint expand_at(uint start, uint num_regions, WorkGang* pretouch_workers);
+
+  // Override. This function is called for humongous allocation, so we need to find empty regions in nv-dimm.
+  uint find_contiguous_only_empty(size_t num);
+
+  // Override. This function is called for humongous allocation, so we need to find empty or unavailable regions in nv-dimm.
+  uint find_contiguous_empty_or_unavailable(size_t num);
+
+  // Overrides base class implementation to find highest free region in dram.
+  uint find_highest_free(bool* expanded);
+
+  // Override. This fuction is called to shrink the heap, we shrink in dram first then in nv-dimm.
+  uint shrink_by(uint num_regions_to_remove);
+
+  bool has_borrowed_regions() const;
+
+  void verify();
+};
+
+#endif // SHARE_VM_GC_G1_HETEROGENEOUSHEAPREGIONMANAGER_HPP
--- a/src/hotspot/share/gc/g1/vmStructs_g1.hpp	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/hotspot/share/gc/g1/vmStructs_g1.hpp	Tue Jan 15 10:55:26 2019 -0800
@@ -53,7 +53,7 @@
   nonstatic_field(HeapRegionManager, _num_committed,    uint)                 \
                                                                               \
   nonstatic_field(G1CollectedHeap, _summary_bytes_used, size_t)               \
-  nonstatic_field(G1CollectedHeap, _hrm,                HeapRegionManager)    \
+  nonstatic_field(G1CollectedHeap, _hrm,                HeapRegionManager*)    \
   nonstatic_field(G1CollectedHeap, _g1mm,               G1MonitoringSupport*) \
   nonstatic_field(G1CollectedHeap, _old_set,            HeapRegionSetBase)    \
   nonstatic_field(G1CollectedHeap, _archive_set,        HeapRegionSetBase)    \
--- a/src/hotspot/share/gc/parallel/adjoiningGenerations.cpp	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/hotspot/share/gc/parallel/adjoiningGenerations.cpp	Tue Jan 15 10:55:26 2019 -0800
@@ -24,6 +24,7 @@
 
 #include "precompiled.hpp"
 #include "gc/parallel/adjoiningGenerations.hpp"
+#include "gc/parallel/adjoiningGenerationsForHeteroHeap.hpp"
 #include "gc/parallel/adjoiningVirtualSpaces.hpp"
 #include "gc/parallel/generationSizer.hpp"
 #include "gc/parallel/parallelScavengeHeap.hpp"
@@ -40,8 +41,8 @@
 AdjoiningGenerations::AdjoiningGenerations(ReservedSpace old_young_rs,
                                            GenerationSizer* policy,
                                            size_t alignment) :
-  _virtual_spaces(old_young_rs, policy->min_old_size(),
-                  policy->min_young_size(), alignment) {
+  _virtual_spaces(new AdjoiningVirtualSpaces(old_young_rs, policy->min_old_size(),
+                                             policy->min_young_size(), alignment)) {
   size_t init_low_byte_size = policy->initial_old_size();
   size_t min_low_byte_size = policy->min_old_size();
   size_t max_low_byte_size = policy->max_old_size();
@@ -61,21 +62,21 @@
     // generation.
 
     // Does the actual creation of the virtual spaces
-    _virtual_spaces.initialize(max_low_byte_size,
-                               init_low_byte_size,
-                               init_high_byte_size);
+    _virtual_spaces->initialize(max_low_byte_size,
+                                init_low_byte_size,
+                                init_high_byte_size);
 
     // Place the young gen at the high end.  Passes in the virtual space.
-    _young_gen = new ASPSYoungGen(_virtual_spaces.high(),
-                                  _virtual_spaces.high()->committed_size(),
+    _young_gen = new ASPSYoungGen(_virtual_spaces->high(),
+                                  _virtual_spaces->high()->committed_size(),
                                   min_high_byte_size,
-                                  _virtual_spaces.high_byte_size_limit());
+                                  _virtual_spaces->high_byte_size_limit());
 
     // Place the old gen at the low end. Passes in the virtual space.
-    _old_gen = new ASPSOldGen(_virtual_spaces.low(),
-                              _virtual_spaces.low()->committed_size(),
+    _old_gen = new ASPSOldGen(_virtual_spaces->low(),
+                              _virtual_spaces->low()->committed_size(),
                               min_low_byte_size,
-                              _virtual_spaces.low_byte_size_limit(),
+                              _virtual_spaces->low_byte_size_limit(),
                               "old", 1);
 
     young_gen()->initialize_work();
@@ -92,8 +93,9 @@
   } else {
 
     // Layout the reserved space for the generations.
+    // If OldGen is allocated on nv-dimm, we need to split the reservation (this is required for windows).
     ReservedSpace old_rs   =
-      virtual_spaces()->reserved_space().first_part(max_low_byte_size);
+      virtual_spaces()->reserved_space().first_part(max_low_byte_size, policy->is_hetero_heap() /* split */);
     ReservedSpace heap_rs  =
       virtual_spaces()->reserved_space().last_part(max_low_byte_size);
     ReservedSpace young_rs = heap_rs.first_part(max_high_byte_size);
@@ -117,6 +119,8 @@
   }
 }
 
+AdjoiningGenerations::AdjoiningGenerations() { }
+
 size_t AdjoiningGenerations::reserved_byte_size() {
   return virtual_spaces()->reserved_space().size();
 }
@@ -279,3 +283,13 @@
     }
   }
 }
+
+AdjoiningGenerations* AdjoiningGenerations::create_adjoining_generations(ReservedSpace old_young_rs,
+                                                                         GenerationSizer* policy,
+                                                                         size_t alignment) {
+  if (policy->is_hetero_heap() && UseAdaptiveGCBoundary) {
+    return new AdjoiningGenerationsForHeteroHeap(old_young_rs, policy, alignment);
+  } else {
+    return new AdjoiningGenerations(old_young_rs, policy, alignment);
+  }
+}
--- a/src/hotspot/share/gc/parallel/adjoiningGenerations.hpp	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/hotspot/share/gc/parallel/adjoiningGenerations.hpp	Tue Jan 15 10:55:26 2019 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2015, 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
@@ -43,27 +43,29 @@
 class AdjoiningGenerations : public CHeapObj<mtGC> {
   friend class VMStructs;
  private:
-  // The young generation and old generation, respectively
-  PSYoungGen* _young_gen;
-  PSOldGen* _old_gen;
-
-  // The spaces used by the two generations.
-  AdjoiningVirtualSpaces _virtual_spaces;
-
   // Move boundary up to expand old gen.  Checks are made to
   // determine if the move can be done with specified limits.
   void request_old_gen_expansion(size_t desired_change_in_bytes);
   // Move boundary down to expand young gen.
   bool request_young_gen_expansion(size_t desired_change_in_bytes);
 
+ protected:
+   // The young generation and old generation, respectively
+   PSYoungGen* _young_gen;
+   PSOldGen* _old_gen;
+
+   // The spaces used by the two generations.
+   AdjoiningVirtualSpaces* _virtual_spaces;
+
  public:
   AdjoiningGenerations(ReservedSpace rs, GenerationSizer* policy, size_t alignment);
+  AdjoiningGenerations();
 
   // Accessors
   PSYoungGen* young_gen() { return _young_gen; }
   PSOldGen* old_gen() { return _old_gen; }
 
-  AdjoiningVirtualSpaces* virtual_spaces() { return &_virtual_spaces; }
+  AdjoiningVirtualSpaces* virtual_spaces() { return _virtual_spaces; }
 
   // Additional space is needed in the old generation.  Check
   // the available space and attempt to move the boundary if more space
@@ -74,7 +76,9 @@
 
   // Return the total byte size of the reserved space
   // for the adjoining generations.
-  size_t reserved_byte_size();
+  virtual size_t reserved_byte_size();
+
+  // Return new AdjoiningGenerations instance based on collector policy (specifically - whether heap is heterogeneous).
+  static AdjoiningGenerations* create_adjoining_generations(ReservedSpace rs, GenerationSizer* policy, size_t alignment);
 };
-
 #endif // SHARE_VM_GC_PARALLEL_ADJOININGGENERATIONS_HPP
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/hotspot/share/gc/parallel/adjoiningGenerationsForHeteroHeap.cpp	Tue Jan 15 10:55:26 2019 -0800
@@ -0,0 +1,260 @@
+/*
+ * 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.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+#include "precompiled.hpp"
+#include "gc/parallel/adjoiningGenerationsForHeteroHeap.hpp"
+#include "gc/parallel/adjoiningVirtualSpaces.hpp"
+#include "gc/parallel/generationSizer.hpp"
+#include "gc/parallel/parallelScavengeHeap.hpp"
+#include "gc/parallel/psFileBackedVirtualspace.hpp"
+#include "logging/log.hpp"
+#include "logging/logStream.hpp"
+#include "memory/resourceArea.hpp"
+#include "utilities/align.hpp"
+#include "utilities/ostream.hpp"
+
+// Create two virtual spaces (HeteroVirtualSpaces), low() on nv-dimm memory, high() on dram.
+// create ASPSOldGen and ASPSYoungGen the same way as in base class
+
+AdjoiningGenerationsForHeteroHeap::AdjoiningGenerationsForHeteroHeap(ReservedSpace old_young_rs, GenerationSizer* policy, size_t alignment) :
+  _total_size_limit(policy->max_heap_byte_size()) {
+  size_t init_old_byte_size = policy->initial_old_size();
+  size_t min_old_byte_size = policy->min_old_size();
+  size_t max_old_byte_size = policy->max_old_size();
+  size_t init_young_byte_size = policy->initial_young_size();
+  size_t min_young_byte_size = policy->min_young_size();
+  size_t max_young_byte_size = policy->max_young_size();
+  // create HeteroVirtualSpaces which is composed of non-overlapping virtual spaces.
+  HeteroVirtualSpaces* hetero_virtual_spaces = new HeteroVirtualSpaces(old_young_rs, min_old_byte_size,
+                                                                       min_young_byte_size, _total_size_limit, alignment);
+
+  assert(min_old_byte_size <= init_old_byte_size &&
+         init_old_byte_size <= max_old_byte_size, "Parameter check");
+  assert(min_young_byte_size <= init_young_byte_size &&
+         init_young_byte_size <= max_young_byte_size, "Parameter check");
+
+  assert(UseAdaptiveGCBoundary, "Should be used only when UseAdaptiveGCBoundary is true");
+
+  // Initialize the virtual spaces. Then pass a virtual space to each generation
+  // for initialization of the generation.
+
+  // Does the actual creation of the virtual spaces
+  hetero_virtual_spaces->initialize(max_old_byte_size, init_old_byte_size, init_young_byte_size);
+
+  _young_gen = new ASPSYoungGen(hetero_virtual_spaces->high(),
+                                hetero_virtual_spaces->high()->committed_size() /* intial_size */,
+                                min_young_byte_size,
+                                hetero_virtual_spaces->max_young_size());
+
+  _old_gen = new ASPSOldGen(hetero_virtual_spaces->low(),
+                            hetero_virtual_spaces->low()->committed_size() /* intial_size */,
+                            min_old_byte_size,
+                            hetero_virtual_spaces->max_old_size(), "old", 1);
+
+  young_gen()->initialize_work();
+  assert(young_gen()->reserved().byte_size() <= young_gen()->gen_size_limit(), "Consistency check");
+  assert(old_young_rs.size() >= young_gen()->gen_size_limit(), "Consistency check");
+
+  old_gen()->initialize_work("old", 1);
+  assert(old_gen()->reserved().byte_size() <= old_gen()->gen_size_limit(), "Consistency check");
+  assert(old_young_rs.size() >= old_gen()->gen_size_limit(), "Consistency check");
+
+  _virtual_spaces = hetero_virtual_spaces;
+}
+
+size_t AdjoiningGenerationsForHeteroHeap::required_reserved_memory(GenerationSizer* policy) {
+  // This is the size that young gen can grow to, when AdaptiveGCBoundary is true.
+  size_t max_yg_size = policy->max_heap_byte_size() - policy->min_old_size();
+  // This is the size that old gen can grow to, when AdaptiveGCBoundary is true.
+  size_t max_old_size = policy->max_heap_byte_size() - policy->min_young_size();
+
+  return max_yg_size + max_old_size;
+}
+
+// We override this function since size of reservedspace here is more than heap size and
+// callers expect this function to return heap size.
+size_t AdjoiningGenerationsForHeteroHeap::reserved_byte_size() {
+  return total_size_limit();
+}
+
+AdjoiningGenerationsForHeteroHeap::HeteroVirtualSpaces::HeteroVirtualSpaces(ReservedSpace rs, size_t min_old_byte_size, size_t min_yg_byte_size, size_t max_total_size, size_t alignment) :
+                                                                            AdjoiningVirtualSpaces(rs, min_old_byte_size, min_yg_byte_size, alignment),
+                                                                            _max_total_size(max_total_size),
+                                                                            _min_old_byte_size(min_old_byte_size), _min_young_byte_size(min_yg_byte_size),
+                                                                            _max_old_byte_size(_max_total_size - _min_young_byte_size),
+                                                                            _max_young_byte_size(_max_total_size - _min_old_byte_size) {
+}
+
+void AdjoiningGenerationsForHeteroHeap::HeteroVirtualSpaces::initialize(size_t initial_old_reserved_size, size_t init_old_byte_size,
+                                                                        size_t init_young_byte_size) {
+
+  // This is the reserved space exclusively for old generation.
+  ReservedSpace low_rs = _reserved_space.first_part(_max_old_byte_size, true);
+  // Intially we only assign 'initial_old_reserved_size' of the reserved space to old virtual space.
+  low_rs = low_rs.first_part(initial_old_reserved_size);
+
+  // This is the reserved space exclusively for young generation.
+  ReservedSpace high_rs = _reserved_space.last_part(_max_old_byte_size).first_part(_max_young_byte_size);
+
+  // Carve out 'initial_young_reserved_size' of reserved space.
+  size_t initial_young_reserved_size = _max_total_size - initial_old_reserved_size;
+  high_rs = high_rs.last_part(_max_young_byte_size - initial_young_reserved_size);
+
+  _low = new PSFileBackedVirtualSpace(low_rs, alignment(), AllocateOldGenAt);
+  if (!static_cast <PSFileBackedVirtualSpace*>(_low)->initialize()) {
+    vm_exit_during_initialization("Could not map space for old generation at given AllocateOldGenAt path");
+  }
+
+  if (!_low->expand_by(init_old_byte_size)) {
+    vm_exit_during_initialization("Could not reserve enough space for object heap");
+  }
+
+  _high = new PSVirtualSpaceHighToLow(high_rs, alignment());
+  if (!_high->expand_by(init_young_byte_size)) {
+    vm_exit_during_initialization("Could not reserve enough space for object heap");
+  }
+}
+
+// Since the virtual spaces are non-overlapping, there is no boundary as such.
+// We replicate the same behavior and maintain the same invariants as base class 'AdjoiningVirtualSpaces' by
+// increasing old generation size and decreasing young generation size by same amount.
+bool AdjoiningGenerationsForHeteroHeap::HeteroVirtualSpaces::adjust_boundary_up(size_t change_in_bytes) {
+  assert(UseAdaptiveSizePolicy && UseAdaptiveGCBoundary, "runtime check");
+  DEBUG_ONLY(size_t total_size_before = young_vs()->reserved_size() + old_vs()->reserved_size());
+
+  size_t bytes_needed = change_in_bytes;
+  size_t uncommitted_in_old = MIN2(old_vs()->uncommitted_size(), bytes_needed);
+  bool old_expanded = false;
+
+  // 1. Try to expand old within its reserved space.
+  if (uncommitted_in_old != 0) {
+    if (!old_vs()->expand_by(uncommitted_in_old)) {
+      return false;
+    }
+    old_expanded = true;
+    bytes_needed -= uncommitted_in_old;
+    if (bytes_needed == 0) {
+      return true;
+    }
+  }
+
+  size_t bytes_to_add_in_old = 0;
+
+  // 2. Get uncommitted memory from Young virtualspace.
+  size_t young_uncommitted = MIN2(young_vs()->uncommitted_size(), bytes_needed);
+  if (young_uncommitted > 0) {
+    young_vs()->set_reserved(young_vs()->reserved_low_addr() + young_uncommitted,
+                             young_vs()->reserved_high_addr(),
+                             young_vs()->special());
+    bytes_needed -= young_uncommitted;
+    bytes_to_add_in_old = young_uncommitted;
+  }
+
+  // 3. Get committed memory from Young virtualspace
+  if (bytes_needed > 0) {
+    size_t shrink_size = align_down(bytes_needed, young_vs()->alignment());
+    bool ret = young_vs()->shrink_by(shrink_size);
+    assert(ret, "We should be able to shrink young space");
+    young_vs()->set_reserved(young_vs()->reserved_low_addr() + shrink_size,
+                             young_vs()->reserved_high_addr(),
+                             young_vs()->special());
+
+    bytes_to_add_in_old += shrink_size;
+  }
+
+  // 4. Increase size of old space
+  old_vs()->set_reserved(old_vs()->reserved_low_addr(),
+                         old_vs()->reserved_high_addr() + bytes_to_add_in_old,
+                         old_vs()->special());
+  if (!old_vs()->expand_by(bytes_to_add_in_old) && !old_expanded) {
+    return false;
+  }
+
+  DEBUG_ONLY(size_t total_size_after = young_vs()->reserved_size() + old_vs()->reserved_size());
+  assert(total_size_after == total_size_before, "should be equal");
+
+  return true;
+}
+
+// Read comment for adjust_boundary_up()
+// Increase young generation size and decrease old generation size by same amount.
+bool AdjoiningGenerationsForHeteroHeap::HeteroVirtualSpaces::adjust_boundary_down(size_t change_in_bytes) {
+  assert(UseAdaptiveSizePolicy && UseAdaptiveGCBoundary, "runtime check");
+  DEBUG_ONLY(size_t total_size_before = young_vs()->reserved_size() + old_vs()->reserved_size());
+
+  size_t bytes_needed = change_in_bytes;
+  size_t uncommitted_in_young = MIN2(young_vs()->uncommitted_size(), bytes_needed);
+  bool young_expanded = false;
+
+  // 1. Try to expand old within its reserved space.
+  if (uncommitted_in_young > 0) {
+    if (!young_vs()->expand_by(uncommitted_in_young)) {
+      return false;
+    }
+    young_expanded = true;
+    bytes_needed -= uncommitted_in_young;
+    if (bytes_needed == 0) {
+      return true;
+    }
+  }
+
+  size_t bytes_to_add_in_young = 0;
+
+  // 2. Get uncommitted memory from Old virtualspace.
+  size_t old_uncommitted = MIN2(old_vs()->uncommitted_size(), bytes_needed);
+  if (old_uncommitted > 0) {
+    old_vs()->set_reserved(old_vs()->reserved_low_addr(),
+                           old_vs()->reserved_high_addr() - old_uncommitted,
+                           old_vs()->special());
+    bytes_needed -= old_uncommitted;
+    bytes_to_add_in_young = old_uncommitted;
+  }
+
+  // 3. Get committed memory from Old virtualspace
+  if (bytes_needed > 0) {
+    size_t shrink_size = align_down(bytes_needed, old_vs()->alignment());
+    bool ret = old_vs()->shrink_by(shrink_size);
+    assert(ret, "We should be able to shrink young space");
+           old_vs()->set_reserved(old_vs()->reserved_low_addr(),
+           old_vs()->reserved_high_addr() - shrink_size,
+           old_vs()->special());
+
+    bytes_to_add_in_young += shrink_size;
+  }
+
+  assert(bytes_to_add_in_young <= change_in_bytes, "should not be more than requested size");
+  // 4. Increase size of young space
+  young_vs()->set_reserved(young_vs()->reserved_low_addr() - bytes_to_add_in_young,
+                           young_vs()->reserved_high_addr(),
+                           young_vs()->special());
+  if (!young_vs()->expand_by(bytes_to_add_in_young) && !young_expanded) {
+    return false;
+  }
+
+  DEBUG_ONLY(size_t total_size_after = young_vs()->reserved_size() + old_vs()->reserved_size());
+  assert(total_size_after == total_size_before, "should be equal");
+
+  return true;
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/hotspot/share/gc/parallel/adjoiningGenerationsForHeteroHeap.hpp	Tue Jan 15 10:55:26 2019 -0800
@@ -0,0 +1,85 @@
+/*
+ * 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.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+#ifndef SHARE_VM_GC_PARALLEL_ADJOININGGENERATIONSFORHETEROHEAP_HPP
+#define SHARE_VM_GC_PARALLEL_ADJOININGGENERATIONSFORHETEROHEAP_HPP
+
+#include "gc/parallel/adjoiningGenerations.hpp"
+
+class AdjoiningGenerationsForHeteroHeap : public AdjoiningGenerations {
+  friend class VMStructs;
+private:
+  // Maximum total size of the generations. This is equal to the heap size specified by user.
+  // When adjusting young and old generation sizes, we need ensure that sum of the generation sizes does not exceed this.
+  size_t _total_size_limit;
+
+  size_t total_size_limit() const {
+    return _total_size_limit;
+  }
+
+  // HeteroVirtualSpaces creates non-overlapping virtual spaces. Here _low and _high do not share a reserved space, i.e. there is no boundary
+  // separating the two virtual spaces.
+  class HeteroVirtualSpaces : public AdjoiningVirtualSpaces {
+    size_t _max_total_size;
+    size_t _min_old_byte_size;
+    size_t _min_young_byte_size;
+    size_t _max_old_byte_size;
+    size_t _max_young_byte_size;
+
+    // Internally we access the virtual spaces using these methods. It increases readability, since we were not really
+    // dealing with adjoining virtual spaces separated by a boundary as is the case in base class.
+    // Externally they are accessed using low() and high() methods of base class.
+    PSVirtualSpace* young_vs() { return high(); }
+    PSVirtualSpace* old_vs() { return low(); }
+
+  public:
+    HeteroVirtualSpaces(ReservedSpace rs,
+                        size_t min_old_byte_size,
+                        size_t min_young_byte_size, size_t max_total_size,
+                        size_t alignment);
+
+    // Increase old generation size and decrease young generation size by same amount
+    bool adjust_boundary_up(size_t size_in_bytes);
+    // Increase young generation size and decrease old generation size by same amount
+    bool adjust_boundary_down(size_t size_in_bytes);
+
+    size_t max_young_size() const { return _max_young_byte_size; }
+    size_t max_old_size() const { return _max_old_byte_size; }
+
+    void initialize(size_t initial_old_reserved_size, size_t init_low_byte_size,
+                    size_t init_high_byte_size);
+  };
+
+public:
+  AdjoiningGenerationsForHeteroHeap(ReservedSpace rs, GenerationSizer* policy, size_t alignment);
+
+  // Given the size policy, calculate the total amount of memory that needs to be reserved.
+  // We need to reserve more memory than Xmx, since we use non-overlapping virtual spaces for the young and old generations.
+  static size_t required_reserved_memory(GenerationSizer* policy);
+
+  // Return the total byte size of the reserved space
+  size_t reserved_byte_size();
+};
+#endif // SHARE_VM_GC_PARALLEL_ADJOININGGENERATIONSFORHETEROHEAP_HPP
+
--- a/src/hotspot/share/gc/parallel/adjoiningVirtualSpaces.hpp	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/hotspot/share/gc/parallel/adjoiningVirtualSpaces.hpp	Tue Jan 15 10:55:26 2019 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2015, 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
@@ -59,7 +59,8 @@
 // moved up consistently.  AdjoiningVirtualSpaces provide the
 // interfaces for moving the this boundary.
 
-class AdjoiningVirtualSpaces {
+class AdjoiningVirtualSpaces : public CHeapObj<mtGC> {
+protected:
   // space at the high end and the low end, respectively
   PSVirtualSpace*    _high;
   PSVirtualSpace*    _low;
@@ -84,17 +85,17 @@
                          size_t alignment);
 
   // accessors
-  PSVirtualSpace* high() { return _high; }
-  PSVirtualSpace* low()  { return _low; }
+  virtual PSVirtualSpace* high() { return _high; }
+  virtual PSVirtualSpace* low()  { return _low; }
   ReservedSpace reserved_space() { return _reserved_space; }
   size_t min_low_byte_size() { return _min_low_byte_size; }
   size_t min_high_byte_size() { return _min_high_byte_size; }
   size_t alignment() const { return _alignment; }
 
   // move boundary between the two spaces up
-  bool adjust_boundary_up(size_t size_in_bytes);
+  virtual bool adjust_boundary_up(size_t size_in_bytes);
   // and down
-  bool adjust_boundary_down(size_t size_in_bytes);
+  virtual bool adjust_boundary_down(size_t size_in_bytes);
 
   // Maximum byte size for the high space.
   size_t high_byte_size_limit() {
@@ -107,9 +108,8 @@
 
   // Sets the boundaries for the virtual spaces and commits and
   // initial size;
-  void initialize(size_t max_low_byte_size,
+  virtual void initialize(size_t max_low_byte_size,
                   size_t init_low_byte_size,
                   size_t init_high_byte_size);
 };
-
 #endif // SHARE_VM_GC_PARALLEL_ADJOININGVIRTUALSPACES_HPP
--- a/src/hotspot/share/gc/parallel/generationSizer.cpp	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/hotspot/share/gc/parallel/generationSizer.cpp	Tue Jan 15 10:55:26 2019 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2015, 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
@@ -67,3 +67,11 @@
   }
   GenCollectorPolicy::initialize_size_info();
 }
+
+bool GenerationSizer::is_hetero_heap() const {
+  return false;
+}
+
+size_t GenerationSizer::heap_reserved_size_bytes() const {
+  return _max_heap_byte_size;
+}
--- a/src/hotspot/share/gc/parallel/generationSizer.hpp	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/hotspot/share/gc/parallel/generationSizer.hpp	Tue Jan 15 10:55:26 2019 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2015, 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
@@ -32,7 +32,6 @@
 
 class GenerationSizer : public GenCollectorPolicy {
  private:
-
   // The alignment used for boundary between young gen and old gen
   static size_t default_gen_alignment() { return 64 * K * HeapWordSize; }
 
@@ -41,5 +40,9 @@
   void initialize_alignments();
   void initialize_flags();
   void initialize_size_info();
+
+ public:
+  virtual size_t heap_reserved_size_bytes() const;
+  virtual bool is_hetero_heap() const;
 };
 #endif // SHARE_VM_GC_PARALLEL_GENERATIONSIZER_HPP
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/hotspot/share/gc/parallel/heterogeneousGenerationSizer.cpp	Tue Jan 15 10:55:26 2019 -0800
@@ -0,0 +1,106 @@
+/*
+ * 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.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+#include "precompiled.hpp"
+#include "gc/parallel/heterogeneousGenerationSizer.hpp"
+#include "gc/shared/collectorPolicy.hpp"
+#include "logging/log.hpp"
+#include "runtime/globals_extension.hpp"
+#include "runtime/os.hpp"
+#include "utilities/align.hpp"
+#include "utilities/formatBuffer.hpp"
+#include "utilities/globalDefinitions.hpp"
+
+const double HeterogeneousGenerationSizer::MaxRamFractionForYoung = 0.8;
+
+// Check the available dram memory to limit NewSize and MaxNewSize before
+// calling base class initialize_flags().
+void HeterogeneousGenerationSizer::initialize_flags() {
+  FormatBuffer<100> calc_str("");
+
+  julong phys_mem;
+  // If MaxRam is specified, we use that as maximum physical memory available.
+  if (FLAG_IS_DEFAULT(MaxRAM)) {
+    phys_mem = os::physical_memory();
+    calc_str.append("Physical_Memory");
+  } else {
+    phys_mem = (julong)MaxRAM;
+    calc_str.append("MaxRAM");
+  }
+
+  julong reasonable_max = phys_mem;
+
+  // If either MaxRAMFraction or MaxRAMPercentage is specified, we use them to calculate
+  // reasonable max size of young generation.
+  if (!FLAG_IS_DEFAULT(MaxRAMFraction)) {
+    reasonable_max = (julong)(phys_mem / MaxRAMFraction);
+    calc_str.append(" / MaxRAMFraction");
+  } else if (!FLAG_IS_DEFAULT(MaxRAMPercentage)) {
+    reasonable_max = (julong)((phys_mem * MaxRAMPercentage) / 100);
+    calc_str.append(" * MaxRAMPercentage / 100");
+  } else {
+    // We use our own fraction to calculate max size of young generation.
+    reasonable_max = phys_mem * MaxRamFractionForYoung;
+    calc_str.append(" * %0.2f", MaxRamFractionForYoung);
+  }
+  reasonable_max = align_up(reasonable_max, _gen_alignment);
+
+  if (MaxNewSize > reasonable_max) {
+    if (FLAG_IS_CMDLINE(MaxNewSize)) {
+      log_warning(gc, ergo)("Setting MaxNewSize to " SIZE_FORMAT " based on dram available (calculation = align(%s))",
+                            (size_t)reasonable_max, calc_str.buffer());
+    } else {
+      log_info(gc, ergo)("Setting MaxNewSize to " SIZE_FORMAT " based on dram available (calculation = align(%s)). "
+                         "Dram usage can be lowered by setting MaxNewSize to a lower value", (size_t)reasonable_max, calc_str.buffer());
+    }
+    MaxNewSize = reasonable_max;
+  }
+  if (NewSize > reasonable_max) {
+    if (FLAG_IS_CMDLINE(NewSize)) {
+      log_warning(gc, ergo)("Setting NewSize to " SIZE_FORMAT " based on dram available (calculation = align(%s))",
+                            (size_t)reasonable_max, calc_str.buffer());
+    }
+    NewSize = reasonable_max;
+  }
+
+  // After setting new size flags, call base class initialize_flags()
+  GenerationSizer::initialize_flags();
+}
+
+bool HeterogeneousGenerationSizer::is_hetero_heap() const {
+  return true;
+}
+
+size_t HeterogeneousGenerationSizer::heap_reserved_size_bytes() const {
+  if (UseAdaptiveGCBoundary) {
+    // This is the size that young gen can grow to, when UseAdaptiveGCBoundary is true.
+    size_t max_yg_size = _max_heap_byte_size - _min_old_size;
+    // This is the size that old gen can grow to, when UseAdaptiveGCBoundary is true.
+    size_t max_old_size = _max_heap_byte_size - _min_young_size;
+
+    return max_yg_size + max_old_size;
+  } else {
+    return _max_heap_byte_size;
+  }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/hotspot/share/gc/parallel/heterogeneousGenerationSizer.hpp	Tue Jan 15 10:55:26 2019 -0800
@@ -0,0 +1,46 @@
+/*
+ * 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.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+#ifndef SHARE_VM_GC_PARALLEL_HETEROGENEOUSGENERATIONSIZER_HPP
+#define SHARE_VM_GC_PARALLEL_HETEROGENEOUSGENERATIONSIZER_HPP
+
+#include "gc/parallel/generationSizer.hpp"
+
+// There is a nice batch of tested generation sizing code in
+// GenCollectorPolicy. Lets reuse it!
+
+class HeterogeneousGenerationSizer : public GenerationSizer {
+private:
+  // Max fraction of dram to use for young generation when MaxRAMFraction and
+  // MaxRAMPercentage are not specified on commandline.
+  static const double MaxRamFractionForYoung;
+
+protected:
+  virtual void initialize_flags();
+
+public:
+  virtual size_t heap_reserved_size_bytes() const;
+  virtual bool is_hetero_heap() const;
+};
+#endif // SHARE_VM_GC_PARALLEL_HETEROGENEOUSGENERATIONSIZER_HPP
--- a/src/hotspot/share/gc/parallel/parallelArguments.cpp	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/hotspot/share/gc/parallel/parallelArguments.cpp	Tue Jan 15 10:55:26 2019 -0800
@@ -24,6 +24,7 @@
  */
 
 #include "precompiled.hpp"
+#include "gc/parallel/heterogeneousGenerationSizer.hpp"
 #include "gc/parallel/parallelArguments.hpp"
 #include "gc/parallel/parallelScavengeHeap.hpp"
 #include "gc/shared/adaptiveSizePolicy.hpp"
@@ -93,5 +94,9 @@
 }
 
 CollectedHeap* ParallelArguments::create_heap() {
-  return create_heap_with_policy<ParallelScavengeHeap, GenerationSizer>();
+  if (AllocateOldGenAt != NULL) {
+    return create_heap_with_policy<ParallelScavengeHeap, HeterogeneousGenerationSizer>();
+  } else {
+    return create_heap_with_policy<ParallelScavengeHeap, GenerationSizer>();
+  }
 }
--- a/src/hotspot/share/gc/parallel/parallelScavengeHeap.cpp	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/hotspot/share/gc/parallel/parallelScavengeHeap.cpp	Tue Jan 15 10:55:26 2019 -0800
@@ -25,6 +25,7 @@
 #include "precompiled.hpp"
 #include "code/codeCache.hpp"
 #include "gc/parallel/adjoiningGenerations.hpp"
+#include "gc/parallel/adjoiningGenerationsForHeteroHeap.hpp"
 #include "gc/parallel/adjoiningVirtualSpaces.hpp"
 #include "gc/parallel/gcTaskManager.hpp"
 #include "gc/parallel/generationSizer.hpp"
@@ -58,7 +59,7 @@
 GCTaskManager* ParallelScavengeHeap::_gc_task_manager = NULL;
 
 jint ParallelScavengeHeap::initialize() {
-  const size_t heap_size = _collector_policy->max_heap_byte_size();
+  size_t heap_size = _collector_policy->heap_reserved_size_bytes();
 
   ReservedSpace heap_rs = Universe::reserve_heap(heap_size, _collector_policy->heap_alignment());
 
@@ -86,7 +87,7 @@
   double max_gc_pause_sec = ((double) MaxGCPauseMillis)/1000.0;
   double max_gc_minor_pause_sec = ((double) MaxGCMinorPauseMillis)/1000.0;
 
-  _gens = new AdjoiningGenerations(heap_rs, _collector_policy, generation_alignment());
+  _gens = AdjoiningGenerations::create_adjoining_generations(heap_rs, _collector_policy, generation_alignment());
 
   _old_gen = _gens->old_gen();
   _young_gen = _gens->young_gen();
@@ -104,7 +105,7 @@
                              GCTimeRatio
                              );
 
-  assert(!UseAdaptiveGCBoundary ||
+  assert(_collector_policy->is_hetero_heap() || !UseAdaptiveGCBoundary ||
     (old_gen()->virtual_space()->high_boundary() ==
      young_gen()->virtual_space()->low_boundary()),
     "Boundaries must meet");
--- a/src/hotspot/share/gc/parallel/parallelScavengeHeap.hpp	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/hotspot/share/gc/parallel/parallelScavengeHeap.hpp	Tue Jan 15 10:55:26 2019 -0800
@@ -111,6 +111,8 @@
 
   virtual CollectorPolicy* collector_policy() const { return _collector_policy; }
 
+  virtual GenerationSizer* ps_collector_policy() const { return _collector_policy; }
+
   virtual SoftRefPolicy* soft_ref_policy() { return &_soft_ref_policy; }
 
   virtual GrowableArray<GCMemoryManager*> memory_managers();
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/hotspot/share/gc/parallel/psFileBackedVirtualspace.cpp	Tue Jan 15 10:55:26 2019 -0800
@@ -0,0 +1,87 @@
+/*
+ * 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.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+#include "precompiled.hpp"
+#include "gc/parallel/psFileBackedVirtualspace.hpp"
+#include "memory/virtualspace.hpp"
+#include "runtime/os.inline.hpp"
+
+PSFileBackedVirtualSpace::PSFileBackedVirtualSpace(ReservedSpace rs, size_t alignment, const char* path) : PSVirtualSpace(rs, alignment),
+                                                   _file_path(path), _fd(-1), _mapping_succeeded(false) {
+  assert(!rs.special(), "ReservedSpace passed to PSFileBackedVirtualSpace cannot be special");
+}
+
+bool PSFileBackedVirtualSpace::initialize() {
+  _fd = os::create_file_for_heap(_file_path);
+  if (_fd == -1) {
+    return false;
+  }
+  // We map the reserved space to a file at initialization.
+  char* ret = os::replace_existing_mapping_with_file_mapping(reserved_low_addr(), reserved_size(), _fd);
+  if (ret != reserved_low_addr()) {
+    os::close(_fd);
+    return false;
+  }
+  // _mapping_succeeded is false if we return before this point.
+  // expand calls later check value of this flag and return error if it is false.
+  _mapping_succeeded = true;
+  _special = true;
+  os::close(_fd);
+  return true;
+}
+
+PSFileBackedVirtualSpace::PSFileBackedVirtualSpace(ReservedSpace rs, const char* path) {
+  PSFileBackedVirtualSpace(rs, os::vm_page_size(), path);
+}
+
+bool PSFileBackedVirtualSpace::expand_by(size_t bytes) {
+  assert(special(), "Since entire space is committed at initialization, _special should always be true for PSFileBackedVirtualSpace");
+
+  // if mapping did not succeed during intialization return false
+  if (!_mapping_succeeded) {
+    return false;
+  }
+  return PSVirtualSpace::expand_by(bytes);
+
+}
+
+bool PSFileBackedVirtualSpace::shrink_by(size_t bytes) {
+  assert(special(), "Since entire space is committed at initialization, _special should always be true for PSFileBackedVirtualSpace");
+  return PSVirtualSpace::shrink_by(bytes);
+}
+
+size_t PSFileBackedVirtualSpace::expand_into(PSVirtualSpace* space, size_t bytes) {
+  // not supported. Since doing this will change page mapping which will lead to large TLB penalties.
+  assert(false, "expand_into() should not be called for PSFileBackedVirtualSpace");
+  return 0;
+}
+
+void PSFileBackedVirtualSpace::release() {
+  os::close(_fd);
+  _fd = -1;
+  _file_path = NULL;
+
+  PSVirtualSpace::release();
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/hotspot/share/gc/parallel/psFileBackedVirtualspace.hpp	Tue Jan 15 10:55:26 2019 -0800
@@ -0,0 +1,46 @@
+/*
+ * 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.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+#ifndef SHARE_VM_GC_PARALLEL_PSFILEBACKEDVIRTUALSPACE_HPP
+#define SHARE_VM_GC_PARALLEL_PSFILEBACKEDVIRTUALSPACE_HPP
+
+#include "gc/parallel/psVirtualspace.hpp"
+
+class PSFileBackedVirtualSpace : public PSVirtualSpace {
+private:
+  const char* _file_path;
+  int _fd;
+  bool _mapping_succeeded;
+public:
+  PSFileBackedVirtualSpace(ReservedSpace rs, size_t alignment, const char* file_path);
+  PSFileBackedVirtualSpace(ReservedSpace rs, const char* file_path);
+
+  bool   initialize();
+  bool   expand_by(size_t bytes);
+  bool   shrink_by(size_t bytes);
+  size_t expand_into(PSVirtualSpace* space, size_t bytes);
+  void   release();
+};
+#endif // SHARE_VM_GC_PARALLEL_PSFILEBACKEDVIRTUALSPACE_HPP
+
--- a/src/hotspot/share/gc/parallel/psOldGen.cpp	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/hotspot/share/gc/parallel/psOldGen.cpp	Tue Jan 15 10:55:26 2019 -0800
@@ -27,6 +27,7 @@
 #include "gc/parallel/parallelScavengeHeap.hpp"
 #include "gc/parallel/psAdaptiveSizePolicy.hpp"
 #include "gc/parallel/psCardTable.hpp"
+#include "gc/parallel/psFileBackedVirtualspace.hpp"
 #include "gc/parallel/psMarkSweepDecorator.hpp"
 #include "gc/parallel/psOldGen.hpp"
 #include "gc/shared/cardTableBarrierSet.hpp"
@@ -71,7 +72,14 @@
 
 void PSOldGen::initialize_virtual_space(ReservedSpace rs, size_t alignment) {
 
-  _virtual_space = new PSVirtualSpace(rs, alignment);
+  if(ParallelScavengeHeap::heap()->ps_collector_policy()->is_hetero_heap()) {
+    _virtual_space = new PSFileBackedVirtualSpace(rs, alignment, AllocateOldGenAt);
+    if (!(static_cast <PSFileBackedVirtualSpace*>(_virtual_space))->initialize()) {
+      vm_exit_during_initialization("Could not map space for PSOldGen at given AllocateOldGenAt path");
+    }
+  } else {
+    _virtual_space = new PSVirtualSpace(rs, alignment);
+  }
   if (!_virtual_space->expand_by(_init_gen_size)) {
     vm_exit_during_initialization("Could not reserve enough space for "
                                   "object heap");
--- a/src/hotspot/share/gc/parallel/psParallelCompact.cpp	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/hotspot/share/gc/parallel/psParallelCompact.cpp	Tue Jan 15 10:55:26 2019 -0800
@@ -1995,7 +1995,10 @@
   assert(young_gen->virtual_space()->alignment() ==
          old_gen->virtual_space()->alignment(), "alignments do not match");
 
-  if (!(UseAdaptiveSizePolicy && UseAdaptiveGCBoundary)) {
+  // We also return false when it's a heterogenous heap because old generation cannot absorb data from eden
+  // when it is allocated on different memory (example, nv-dimm) than young.
+  if (!(UseAdaptiveSizePolicy && UseAdaptiveGCBoundary) ||
+      ParallelScavengeHeap::heap()->ps_collector_policy()->is_hetero_heap()) {
     return false;
   }
 
--- a/src/hotspot/share/gc/shared/barrierSet.hpp	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/hotspot/share/gc/shared/barrierSet.hpp	Tue Jan 15 10:55:26 2019 -0800
@@ -275,11 +275,7 @@
     template <typename T>
     static bool oop_arraycopy_in_heap(arrayOop src_obj, size_t src_offset_in_bytes, T* src_raw,
                                       arrayOop dst_obj, size_t dst_offset_in_bytes, T* dst_raw,
-                                      size_t length) {
-      return Raw::oop_arraycopy(src_obj, src_offset_in_bytes, src_raw,
-                                dst_obj, dst_offset_in_bytes, dst_raw,
-                                length);
-    }
+                                      size_t length);
 
     // Off-heap oop accesses. These accessors get resolved when
     // IN_HEAP is not set (e.g. when using the NativeAccess API), it is
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/hotspot/share/gc/shared/barrierSet.inline.hpp	Tue Jan 15 10:55:26 2019 -0800
@@ -0,0 +1,60 @@
+/*
+ * Copyright (c) 2019, Red Hat, Inc. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+#ifndef SHARE_VM_GC_SHARED_BARRIERSET_INLINE_HPP
+#define SHARE_VM_GC_SHARED_BARRIERSET_INLINE_HPP
+
+#include "gc/shared/barrierSet.hpp"
+#include "oops/accessDecorators.hpp"
+#include "oops/arrayOop.hpp"
+#include "oops/compressedOops.inline.hpp"
+#include "oops/objArrayOop.inline.hpp"
+#include "oops/oop.hpp"
+
+template <DecoratorSet decorators, typename BarrierSetT>
+template <typename T>
+inline bool BarrierSet::AccessBarrier<decorators, BarrierSetT>::oop_arraycopy_in_heap(arrayOop src_obj, size_t src_offset_in_bytes, T* src_raw,
+                                                                                      arrayOop dst_obj, size_t dst_offset_in_bytes, T* dst_raw,
+                                                                                      size_t length) {
+  T* src = arrayOopDesc::obj_offset_to_raw(src_obj, src_offset_in_bytes, src_raw);
+  T* dst = arrayOopDesc::obj_offset_to_raw(dst_obj, dst_offset_in_bytes, dst_raw);
+
+  if (!HasDecorator<decorators, ARRAYCOPY_CHECKCAST>::value) {
+    // Covariant, copy without checks
+    return Raw::oop_arraycopy(NULL, 0, src, NULL, 0, dst, length);
+  }
+
+  // Copy each element with checking casts
+  Klass* const dst_klass = objArrayOop(dst_obj)->element_klass();
+  for (const T* const end = src + length; src < end; src++, dst++) {
+    const T elem = *src;
+    if (!oopDesc::is_instanceof_or_null(CompressedOops::decode(elem), dst_klass)) {
+      return false;
+    }
+    *dst = elem;
+  }
+
+  return true;
+}
+
+#endif // SHARE_VM_GC_SHARED_BARRIERSET_INLINE_HPP
--- a/src/hotspot/share/gc/shared/gcArguments.cpp	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/hotspot/share/gc/shared/gcArguments.cpp	Tue Jan 15 10:55:26 2019 -0800
@@ -28,6 +28,7 @@
 #include "runtime/arguments.hpp"
 #include "runtime/globals.hpp"
 #include "runtime/globals_extension.hpp"
+#include "utilities/defaultStream.hpp"
 #include "utilities/macros.hpp"
 
 void GCArguments::initialize() {
@@ -53,4 +54,28 @@
     // If class unloading is disabled, also disable concurrent class unloading.
     FLAG_SET_CMDLINE(bool, ClassUnloadingWithConcurrentMark, false);
   }
+
+  if (!FLAG_IS_DEFAULT(AllocateOldGenAt)) {
+    // CompressedOops not supported when AllocateOldGenAt is set.
+    LP64_ONLY(FLAG_SET_DEFAULT(UseCompressedOops, false));
+    LP64_ONLY(FLAG_SET_DEFAULT(UseCompressedClassPointers, false));
+    // When AllocateOldGenAt is set, we cannot use largepages for entire heap memory.
+    // Only young gen which is allocated in dram can use large pages, but we currently don't support that.
+    FLAG_SET_DEFAULT(UseLargePages, false);
+  }
 }
+
+bool GCArguments::check_args_consistency() {
+  bool status = true;
+  if (!FLAG_IS_DEFAULT(AllocateHeapAt) && !FLAG_IS_DEFAULT(AllocateOldGenAt)) {
+    jio_fprintf(defaultStream::error_stream(),
+      "AllocateHeapAt and AllocateOldGenAt cannot be used together.\n");
+    status = false;
+  }
+  if (!FLAG_IS_DEFAULT(AllocateOldGenAt) && (UseSerialGC || UseConcMarkSweepGC || UseEpsilonGC || UseZGC)) {
+    jio_fprintf(defaultStream::error_stream(),
+      "AllocateOldGenAt is not supported for selected GC.\n");
+    status = false;
+  }
+  return status;
+}
--- a/src/hotspot/share/gc/shared/gcArguments.hpp	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/hotspot/share/gc/shared/gcArguments.hpp	Tue Jan 15 10:55:26 2019 -0800
@@ -39,6 +39,7 @@
   virtual void initialize();
   virtual size_t conservative_max_heap_alignment() = 0;
   virtual CollectedHeap* create_heap() = 0;
+  static bool check_args_consistency();
 };
 
 #endif // SHARE_GC_SHARED_GCARGUMENTS_HPP
--- a/src/hotspot/share/gc/shenandoah/c2/shenandoahBarrierSetC2.cpp	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/hotspot/share/gc/shenandoah/c2/shenandoahBarrierSetC2.cpp	Tue Jan 15 10:55:26 2019 -0800
@@ -983,7 +983,7 @@
   Node* c = new ProjNode(call,TypeFunc::Control);
   c = igvn.transform(c);
   Node* m = new ProjNode(call, TypeFunc::Memory);
-  c = igvn.transform(m);
+  m = igvn.transform(m);
 
   Node* dest = ac->in(ArrayCopyNode::Dest);
   assert(dest->is_AddP(), "bad input");
--- a/src/hotspot/share/gc/z/c2/zBarrierSetC2.cpp	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/hotspot/share/gc/z/c2/zBarrierSetC2.cpp	Tue Jan 15 10:55:26 2019 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -189,6 +189,15 @@
   bs->register_potential_barrier_node(this);
 }
 
+uint LoadBarrierNode::size_of() const {
+  return sizeof(*this);
+}
+
+uint LoadBarrierNode::cmp(const Node& n) const {
+  ShouldNotReachHere();
+  return 0;
+}
+
 const Type *LoadBarrierNode::bottom_type() const {
   const Type** floadbarrier = (const Type **)(Compile::current()->type_arena()->Amalloc_4((Number_of_Outputs)*sizeof(Type*)));
   Node* in_oop = in(Oop);
@@ -198,6 +207,11 @@
   return TypeTuple::make(Number_of_Outputs, floadbarrier);
 }
 
+const TypePtr* LoadBarrierNode::adr_type() const {
+  ShouldNotReachHere();
+  return NULL;
+}
+
 const Type *LoadBarrierNode::Value(PhaseGVN *phase) const {
   const Type** floadbarrier = (const Type **)(phase->C->type_arena()->Amalloc_4((Number_of_Outputs)*sizeof(Type*)));
   const Type* val_t = phase->type(in(Oop));
@@ -441,6 +455,11 @@
   return NULL;
 }
 
+uint LoadBarrierNode::match_edge(uint idx) const {
+  ShouldNotReachHere();
+  return 0;
+}
+
 void LoadBarrierNode::fix_similar_in_uses(PhaseIterGVN* igvn) {
   Node* out_res = proj_out_or_null(Oop);
   if (out_res == NULL) {
@@ -1151,7 +1170,7 @@
   if (lb->in(LoadBarrierNode::Oop)->is_Phi()) {
     Node* oop_phi = lb->in(LoadBarrierNode::Oop);
 
-    if (oop_phi->in(2) == oop_phi) {
+    if ((oop_phi->req() != 3) || (oop_phi->in(2) == oop_phi)) {
       // Ignore phis with only one input
       return false;
     }
--- a/src/hotspot/share/gc/z/c2/zBarrierSetC2.hpp	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/hotspot/share/gc/z/c2/zBarrierSetC2.hpp	Tue Jan 15 10:55:26 2019 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -62,10 +62,14 @@
                   bool oop_reload_allowed);
 
   virtual int Opcode() const;
+  virtual uint size_of() const;
+  virtual uint cmp(const Node& n) const;
   virtual const Type *bottom_type() const;
+  virtual const TypePtr* adr_type() const;
   virtual const Type *Value(PhaseGVN *phase) const;
   virtual Node *Identity(PhaseGVN *phase);
   virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);
+  virtual uint match_edge(uint idx) const;
 
   LoadBarrierNode* has_dominating_barrier(PhaseIdealLoop* phase,
                                           bool linear_only,
--- a/src/hotspot/share/gc/z/zArguments.cpp	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/hotspot/share/gc/z/zArguments.cpp	Tue Jan 15 10:55:26 2019 -0800
@@ -19,7 +19,6 @@
  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  * or visit www.oracle.com if you need additional information or have any
  * questions.
- *
  */
 
 #include "precompiled.hpp"
@@ -91,6 +90,9 @@
   // Verification of stacks not (yet) supported, for the same reason
   // we need fixup_partial_loads
   DEBUG_ONLY(FLAG_SET_DEFAULT(VerifyStack, false));
+
+  // Initialize platform specific arguments
+  initialize_platform();
 }
 
 CollectedHeap* ZArguments::create_heap() {
--- a/src/hotspot/share/gc/z/zArguments.hpp	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/hotspot/share/gc/z/zArguments.hpp	Tue Jan 15 10:55:26 2019 -0800
@@ -29,6 +29,9 @@
 class CollectedHeap;
 
 class ZArguments : public GCArguments {
+private:
+  void initialize_platform();
+
 public:
   virtual void initialize();
   virtual size_t conservative_max_heap_alignment();
--- a/src/hotspot/share/gc/z/zBarrierSetNMethod.cpp	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/hotspot/share/gc/z/zBarrierSetNMethod.cpp	Tue Jan 15 10:55:26 2019 -0800
@@ -42,6 +42,11 @@
   }
 
   if (nm->is_unloading()) {
+    // We don't need to take the lock when unlinking nmethods from
+    // the Method, because it is only concurrently unlinked by
+    // the entry barrier, which acquires the per nmethod lock.
+    nm->unlink_from_method(false /* acquire_lock */);
+
     // We can end up calling nmethods that are unloading
     // since we clear compiled ICs lazily. Returning false
     // will re-resovle the call and update the compiled IC.
--- a/src/hotspot/share/gc/z/zNMethodTable.cpp	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/hotspot/share/gc/z/zNMethodTable.cpp	Tue Jan 15 10:55:26 2019 -0800
@@ -611,15 +611,20 @@
       return;
     }
 
+    ZLocker<ZReentrantLock> locker(ZNMethodTable::lock_for_nmethod(nm));
+
     if (nm->is_unloading()) {
       // Unlinking of the dependencies must happen before the
       // handshake separating unlink and purge.
       nm->flush_dependencies(false /* delete_immediately */);
+
+      // We don't need to take the lock when unlinking nmethods from
+      // the Method, because it is only concurrently unlinked by
+      // the entry barrier, which acquires the per nmethod lock.
+      nm->unlink_from_method(false /* acquire_lock */);
       return;
     }
 
-    ZLocker<ZReentrantLock> locker(ZNMethodTable::lock_for_nmethod(nm));
-
     // Heal oops and disarm
     ZNMethodOopClosure cl;
     ZNMethodTable::entry_oops_do(entry, &cl);
--- a/src/hotspot/share/gc/z/zObjectAllocator.cpp	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/hotspot/share/gc/z/zObjectAllocator.cpp	Tue Jan 15 10:55:26 2019 -0800
@@ -128,7 +128,8 @@
 }
 
 uintptr_t ZObjectAllocator::alloc_small_object_from_nonworker(size_t size, ZAllocationFlags flags) {
-  assert(ZThread::is_java() || ZThread::is_vm(), "Should be a Java or VM thread");
+  assert(ZThread::is_java() || ZThread::is_vm() || ZThread::is_runtime_worker(),
+         "Should be a Java, VM or Runtime worker thread");
 
   // Non-worker small page allocation can never use the reserve
   flags.set_no_reserve();
@@ -193,7 +194,8 @@
 }
 
 uintptr_t ZObjectAllocator::alloc_object_for_relocation(size_t size) {
-  assert(ZThread::is_java() || ZThread::is_worker() || ZThread::is_vm(), "Unknown thread");
+  assert(ZThread::is_java() || ZThread::is_vm() || ZThread::is_worker() || ZThread::is_runtime_worker(),
+         "Unknown thread");
 
   ZAllocationFlags flags;
   flags.set_relocation();
--- a/src/hotspot/share/gc/z/zRuntimeWorkers.cpp	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/hotspot/share/gc/z/zRuntimeWorkers.cpp	Tue Jan 15 10:55:26 2019 -0800
@@ -22,7 +22,43 @@
  */
 
 #include "precompiled.hpp"
+#include "gc/shared/workgroup.hpp"
 #include "gc/z/zRuntimeWorkers.hpp"
+#include "gc/z/zThread.hpp"
+#include "runtime/mutexLocker.hpp"
+
+class ZRuntimeWorkersInitializeTask : public AbstractGangTask {
+private:
+  const uint _nworkers;
+  uint       _started;
+  Monitor    _monitor;
+
+public:
+  ZRuntimeWorkersInitializeTask(uint nworkers) :
+      AbstractGangTask("ZRuntimeWorkersInitializeTask"),
+      _nworkers(nworkers),
+      _started(0),
+      _monitor(Monitor::leaf,
+               "ZRuntimeWorkersInitialize",
+               false /* allow_vm_block */,
+               Monitor::_safepoint_check_never) {}
+
+  virtual void work(uint worker_id) {
+    // Register as runtime worker
+    ZThread::set_runtime_worker();
+
+    // Wait for all threads to start
+    MonitorLockerEx ml(&_monitor, Monitor::_no_safepoint_check_flag);
+    if (++_started == _nworkers) {
+      // All threads started
+      ml.notify_all();
+    } else {
+      while (_started != _nworkers) {
+        ml.wait(Monitor::_no_safepoint_check_flag);
+      }
+    }
+  }
+};
 
 ZRuntimeWorkers::ZRuntimeWorkers() :
     _workers("RuntimeWorker",
@@ -35,6 +71,15 @@
   // Initialize worker threads
   _workers.initialize_workers();
   _workers.update_active_workers(nworkers());
+  if (_workers.active_workers() != nworkers()) {
+    vm_exit_during_initialization("Failed to create ZRuntimeWorkers");
+  }
+
+  // Execute task to register threads as runtime workers. This also
+  // helps reduce latency in early safepoints, which otherwise would
+  // have to take on any warmup costs.
+  ZRuntimeWorkersInitializeTask task(nworkers());
+  _workers.run_task(&task);
 }
 
 uint ZRuntimeWorkers::nworkers() const {
--- a/src/hotspot/share/gc/z/zThread.cpp	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/hotspot/share/gc/z/zThread.cpp	Tue Jan 15 10:55:26 2019 -0800
@@ -31,6 +31,7 @@
 __thread bool      ZThread::_is_vm;
 __thread bool      ZThread::_is_java;
 __thread bool      ZThread::_is_worker;
+__thread bool      ZThread::_is_runtime_worker;
 __thread uint      ZThread::_worker_id;
 
 void ZThread::initialize() {
@@ -40,7 +41,8 @@
   _id = (uintptr_t)thread;
   _is_vm = thread->is_VM_thread();
   _is_java = thread->is_Java_thread();
-  _is_worker = thread->is_Worker_thread();
+  _is_worker = false;
+  _is_runtime_worker = false;
   _worker_id = (uint)-1;
 }
 
@@ -56,6 +58,16 @@
   return "Unknown";
 }
 
+void ZThread::set_worker() {
+  ensure_initialized();
+  _is_worker = true;
+}
+
+void ZThread::set_runtime_worker() {
+  ensure_initialized();
+  _is_runtime_worker = true;
+}
+
 bool ZThread::has_worker_id() {
   return _initialized &&
          _is_worker &&
--- a/src/hotspot/share/gc/z/zThread.hpp	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/hotspot/share/gc/z/zThread.hpp	Tue Jan 15 10:55:26 2019 -0800
@@ -29,6 +29,8 @@
 
 class ZThread : public AllStatic {
   friend class ZTask;
+  friend class ZWorkersInitializeTask;
+  friend class ZRuntimeWorkersInitializeTask;
 
 private:
   static __thread bool      _initialized;
@@ -36,6 +38,7 @@
   static __thread bool      _is_vm;
   static __thread bool      _is_java;
   static __thread bool      _is_worker;
+  static __thread bool      _is_runtime_worker;
   static __thread uint      _worker_id;
 
   static void initialize();
@@ -46,6 +49,9 @@
     }
   }
 
+  static void set_worker();
+  static void set_runtime_worker();
+
   static bool has_worker_id();
   static void set_worker_id(uint worker_id);
   static void clear_worker_id();
@@ -73,6 +79,11 @@
     return _is_worker;
   }
 
+  static bool is_runtime_worker() {
+    ensure_initialized();
+    return _is_runtime_worker;
+  }
+
   static uint worker_id() {
     assert(has_worker_id(), "Worker id not initialized");
     return _worker_id;
--- a/src/hotspot/share/gc/z/zWorkers.cpp	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/hotspot/share/gc/z/zWorkers.cpp	Tue Jan 15 10:55:26 2019 -0800
@@ -24,6 +24,7 @@
 #include "precompiled.hpp"
 #include "gc/z/zGlobals.hpp"
 #include "gc/z/zTask.hpp"
+#include "gc/z/zThread.hpp"
 #include "gc/z/zWorkers.inline.hpp"
 #include "runtime/os.hpp"
 #include "runtime/mutexLocker.hpp"
@@ -64,20 +65,26 @@
   return calculate_nworkers(12.5);
 }
 
-class ZWorkersWarmupTask : public ZTask {
+class ZWorkersInitializeTask : public ZTask {
 private:
   const uint _nworkers;
   uint       _started;
   Monitor    _monitor;
 
 public:
-  ZWorkersWarmupTask(uint nworkers) :
-      ZTask("ZWorkersWarmupTask"),
+  ZWorkersInitializeTask(uint nworkers) :
+      ZTask("ZWorkersInitializeTask"),
       _nworkers(nworkers),
       _started(0),
-      _monitor(Monitor::leaf, "ZWorkersWarmup", false, Monitor::_safepoint_check_never) {}
+      _monitor(Monitor::leaf,
+               "ZWorkersInitialize",
+               false /* allow_vm_block */,
+               Monitor::_safepoint_check_never) {}
 
   virtual void work() {
+    // Register as worker
+    ZThread::set_worker();
+
     // Wait for all threads to start
     MonitorLockerEx ml(&_monitor, Monitor::_no_safepoint_check_flag);
     if (++_started == _nworkers) {
@@ -107,10 +114,10 @@
     vm_exit_during_initialization("Failed to create ZWorkers");
   }
 
-  // Warm up worker threads by having them execute a dummy task.
-  // This helps reduce latency in early GC pauses, which otherwise
-  // would have to take on any warmup costs.
-  ZWorkersWarmupTask task(nworkers());
+  // Execute task to register threads as workers. This also helps
+  // reduce latency in early GC pauses, which otherwise would have
+  // to take on any warmup costs.
+  ZWorkersInitializeTask task(nworkers());
   run(&task, nworkers());
 }
 
--- a/src/hotspot/share/include/jvm.h	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/hotspot/share/include/jvm.h	Tue Jan 15 10:55:26 2019 -0800
@@ -625,6 +625,15 @@
 JNIEXPORT jobject JNICALL
 JVM_GetInheritedAccessControlContext(JNIEnv *env, jclass cls);
 
+/*
+ * Ensure that code doing a stackwalk and using javaVFrame::locals() to
+ * get the value will see a materialized value and not a scalar-replaced
+ * null value.
+ */
+#define JVM_EnsureMaterializedForStackWalk(env, value) \
+    do {} while(0) // Nothing to do.  The fact that the value escaped
+                   // through a native method is enough.
+
 JNIEXPORT jobject JNICALL
 JVM_GetStackAccessControlContext(JNIEnv *env, jclass cls);
 
--- a/src/hotspot/share/jfr/recorder/checkpoint/types/jfrTypeSetUtils.cpp	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/hotspot/share/jfr/recorder/checkpoint/types/jfrTypeSetUtils.cpp	Tue Jan 15 10:55:26 2019 -0800
@@ -164,7 +164,7 @@
 uintptr_t JfrSymbolId::unsafe_anonymous_klass_name_hash_code(const InstanceKlass* ik) {
   assert(ik != NULL, "invariant");
   assert(ik->is_unsafe_anonymous(), "invariant");
-  const oop mirror = ik->java_mirror();
+  const oop mirror = ik->java_mirror_no_keepalive();
   assert(mirror != NULL, "invariant");
   return (uintptr_t)mirror->identity_hash();
 }
@@ -174,7 +174,7 @@
   assert(ik->is_unsafe_anonymous(), "invariant");
   assert(0 == hashcode, "invariant");
   char* anonymous_symbol = NULL;
-  const oop mirror = ik->java_mirror();
+  const oop mirror = ik->java_mirror_no_keepalive();
   assert(mirror != NULL, "invariant");
   char hash_buf[40];
   hashcode = unsafe_anonymous_klass_name_hash_code(ik);
--- a/src/hotspot/share/oops/access.inline.hpp	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/hotspot/share/oops/access.inline.hpp	Tue Jan 15 10:55:26 2019 -0800
@@ -25,6 +25,7 @@
 #ifndef SHARE_OOPS_ACCESS_INLINE_HPP
 #define SHARE_OOPS_ACCESS_INLINE_HPP
 
+#include "gc/shared/barrierSet.inline.hpp"
 #include "gc/shared/barrierSetConfig.inline.hpp"
 #include "oops/access.hpp"
 #include "oops/accessBackend.inline.hpp"
--- a/src/hotspot/share/oops/instanceKlass.cpp	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/hotspot/share/oops/instanceKlass.cpp	Tue Jan 15 10:55:26 2019 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -2186,6 +2186,7 @@
   for (int m = 0; m < methods()->length(); m++) {
     MethodData* mdo = methods()->at(m)->method_data();
     if (mdo != NULL) {
+      MutexLockerEx ml(SafepointSynchronize::is_at_safepoint() ? NULL : mdo->extra_data_lock());
       mdo->clean_method_data(/*always_clean*/false);
     }
   }
@@ -3662,14 +3663,14 @@
   }
 }
 
+void InstanceKlass::set_init_state(ClassState state) {
 #ifdef ASSERT
-void InstanceKlass::set_init_state(ClassState state) {
   bool good_state = is_shared() ? (_init_state <= state)
                                                : (_init_state < state);
   assert(good_state || state == allocated, "illegal state transition");
+#endif
   _init_state = (u1)state;
 }
-#endif
 
 #if INCLUDE_JVMTI
 
--- a/src/hotspot/share/oops/instanceKlass.hpp	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/hotspot/share/oops/instanceKlass.hpp	Tue Jan 15 10:55:26 2019 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -1242,11 +1242,7 @@
 
 private:
   // initialization state
-#ifdef ASSERT
   void set_init_state(ClassState state);
-#else
-  void set_init_state(ClassState state) { _init_state = (u1)state; }
-#endif
   void set_rewritten()                  { _misc_flags |= _misc_rewritten; }
   void set_init_thread(Thread *thread)  { _init_thread = thread; }
 
--- a/src/hotspot/share/oops/methodData.cpp	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/hotspot/share/oops/methodData.cpp	Tue Jan 15 10:55:26 2019 -0800
@@ -1653,11 +1653,6 @@
   }
 }
 
-class CleanExtraDataClosure : public StackObj {
-public:
-  virtual bool is_live(Method* m) = 0;
-};
-
 // Check for entries that reference an unloaded method
 class CleanExtraDataKlassClosure : public CleanExtraDataClosure {
   bool _always_clean;
--- a/src/hotspot/share/oops/methodData.hpp	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/hotspot/share/oops/methodData.hpp	Tue Jan 15 10:55:26 2019 -0800
@@ -1943,7 +1943,11 @@
 // adjusted in the event of a change in control flow.
 //
 
-class CleanExtraDataClosure;
+class CleanExtraDataClosure : public StackObj {
+public:
+  virtual bool is_live(Method* m) = 0;
+};
+
 
 class MethodData : public Metadata {
   friend class VMStructs;
@@ -2116,11 +2120,12 @@
   static bool profile_parameters_jsr292_only();
   static bool profile_all_parameters();
 
-  void clean_extra_data(CleanExtraDataClosure* cl);
   void clean_extra_data_helper(DataLayout* dp, int shift, bool reset = false);
   void verify_extra_data_clean(CleanExtraDataClosure* cl);
 
 public:
+  void clean_extra_data(CleanExtraDataClosure* cl);
+
   static int header_size() {
     return sizeof(MethodData)/wordSize;
   }
--- a/src/hotspot/share/opto/callnode.cpp	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/hotspot/share/opto/callnode.cpp	Tue Jan 15 10:55:26 2019 -0800
@@ -1271,6 +1271,14 @@
   return (TypeFunc::Parms == idx);
 }
 
+void SafePointNode::disconnect_from_root(PhaseIterGVN *igvn) {
+  assert(Opcode() == Op_SafePoint, "only value for safepoint in loops");
+  int nb = igvn->C->root()->find_prec_edge(this);
+  if (nb != -1) {
+    igvn->C->root()->rm_prec(nb);
+  }
+}
+
 //==============  SafePointScalarObjectNode  ==============
 
 SafePointScalarObjectNode::SafePointScalarObjectNode(const TypeOopPtr* tp,
--- a/src/hotspot/share/opto/callnode.hpp	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/hotspot/share/opto/callnode.hpp	Tue Jan 15 10:55:26 2019 -0800
@@ -462,6 +462,8 @@
     return !_replaced_nodes.is_empty();
   }
 
+  void disconnect_from_root(PhaseIterGVN *igvn);
+
   // Standard Node stuff
   virtual int            Opcode() const;
   virtual bool           pinned() const { return true; }
--- a/src/hotspot/share/opto/compile.cpp	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/hotspot/share/opto/compile.cpp	Tue Jan 15 10:55:26 2019 -0800
@@ -2184,6 +2184,23 @@
   return true;
 }
 
+// Remove edges from "root" to each SafePoint at a backward branch.
+// They were inserted during parsing (see add_safepoint()) to make
+// infinite loops without calls or exceptions visible to root, i.e.,
+// useful.
+void Compile::remove_root_to_sfpts_edges() {
+  Node *r = root();
+  if (r != NULL) {
+    for (uint i = r->req(); i < r->len(); ++i) {
+      Node *n = r->in(i);
+      if (n != NULL && n->is_SafePoint()) {
+        r->rm_prec(i);
+        --i;
+      }
+    }
+  }
+}
+
 //------------------------------Optimize---------------------------------------
 // Given a graph, optimize it.
 void Compile::Optimize() {
@@ -2244,6 +2261,10 @@
     if (failing())  return;
   }
 
+  // Now that all inlining is over, cut edge from root to loop
+  // safepoints
+  remove_root_to_sfpts_edges();
+
   // Remove the speculative part of types and clean up the graph from
   // the extra CastPP nodes whose only purpose is to carry them. Do
   // that early so that optimizations are not disrupted by the extra
@@ -3248,8 +3269,10 @@
             break;
           }
         }
-        assert(proj != NULL, "must be found");
-        p->subsume_by(proj, this);
+        assert(proj != NULL || p->_con == TypeFunc::I_O, "io may be dropped at an infinite loop");
+        if (proj != NULL) {
+          p->subsume_by(proj, this);
+        }
       }
     }
     break;
@@ -3469,8 +3492,7 @@
   }
   case Op_CmpUL: {
     if (!Matcher::has_match_rule(Op_CmpUL)) {
-      // We don't support unsigned long comparisons. Set 'max_idx_expr'
-      // to max_julong if < 0 to make the signed comparison fail.
+      // No support for unsigned long comparisons
       ConINode* sign_pos = new ConINode(TypeInt::make(BitsPerLong - 1));
       Node* sign_bit_mask = new RShiftLNode(n->in(1), sign_pos);
       Node* orl = new OrLNode(n->in(1), sign_bit_mask);
--- a/src/hotspot/share/opto/compile.hpp	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/hotspot/share/opto/compile.hpp	Tue Jan 15 10:55:26 2019 -0800
@@ -1088,6 +1088,7 @@
   void inline_string_calls(bool parse_time);
   void inline_boxing_calls(PhaseIterGVN& igvn);
   bool optimize_loops(PhaseIterGVN& igvn, LoopOptsMode mode);
+  void remove_root_to_sfpts_edges();
 
   // Matching, CFG layout, allocation, code generation
   PhaseCFG*         cfg()                       { return _cfg; }
--- a/src/hotspot/share/opto/escape.cpp	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/hotspot/share/opto/escape.cpp	Tue Jan 15 10:55:26 2019 -0800
@@ -1727,7 +1727,8 @@
     //
     Node* n = field->ideal_node();
     for (DUIterator_Fast imax, i = n->fast_outs(imax); i < imax; i++) {
-      if (n->fast_out(i)->is_LoadStore()) {
+      Node* u = n->fast_out(i);
+      if (u->is_LoadStore() || (u->is_Mem() && u->as_Mem()->is_mismatched_access())) {
         jobj->set_scalar_replaceable(false);
         return;
       }
--- a/src/hotspot/share/opto/loopPredicate.cpp	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/hotspot/share/opto/loopPredicate.cpp	Tue Jan 15 10:55:26 2019 -0800
@@ -1308,7 +1308,7 @@
 // range checks between the pre and main loop to validate the value
 // of the main loop induction variable. Make a copy of the predicates
 // here with an opaque node as a place holder for the value (will be
-// updated by PhaseIdealLoop::update_skeleton_predicate()).
+// updated by PhaseIdealLoop::clone_skeleton_predicate()).
 ProjNode* PhaseIdealLoop::insert_skeleton_predicate(IfNode* iff, IdealLoopTree *loop,
                                                     ProjNode* proj, ProjNode *predicate_proj,
                                                     ProjNode* upper_bound_proj,
--- a/src/hotspot/share/opto/loopTransform.cpp	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/hotspot/share/opto/loopTransform.cpp	Tue Jan 15 10:55:26 2019 -0800
@@ -354,6 +354,10 @@
   // check for vectorized loops, any peeling done was already applied
   if (_head->is_CountedLoop() && _head->as_CountedLoop()->do_unroll_only()) return false;
 
+  if (_head->is_CountedLoop() && _head->as_CountedLoop()->trip_count() == 1) {
+    return false;
+  }
+
   while( test != _head ) {      // Scan till run off top of loop
     if( test->is_If() ) {       // Test?
       Node *ctrl = phase->get_ctrl(test->in(1));
@@ -1063,8 +1067,9 @@
 // CastII/ConvI2L nodes cause some data paths to die. For consistency,
 // the control paths must die too but the range checks were removed by
 // predication. The range checks that we add here guarantee that they do.
-void PhaseIdealLoop::duplicate_predicates_helper(Node* predicate, Node* castii, IdealLoopTree* outer_loop,
-                                                 LoopNode* outer_main_head, uint dd_main_head) {
+void PhaseIdealLoop::duplicate_predicates_helper(Node* predicate, Node* start, Node* end,
+                                                 IdealLoopTree* outer_loop, LoopNode* outer_main_head,
+                                                 uint dd_main_head) {
   if (predicate != NULL) {
     IfNode* iff = predicate->in(0)->as_If();
     ProjNode* uncommon_proj = iff->proj_out(1 - predicate->as_Proj()->_con);
@@ -1080,13 +1085,14 @@
       if (uncommon_proj->unique_ctrl_out() != rgn)
         break;
       if (iff->in(1)->Opcode() == Op_Opaque4) {
+        assert(skeleton_predicate_has_opaque(iff), "unexpected");
         // Clone the predicate twice and initialize one with the initial
         // value of the loop induction variable. Leave the other predicate
         // to be initialized when increasing the stride during loop unrolling.
-        prev_proj = update_skeleton_predicate(iff, castii, predicate, uncommon_proj, current_proj, outer_loop, prev_proj);
-        Node* value = new Opaque1Node(C, castii);
-        register_new_node(value, current_proj);
-        prev_proj = update_skeleton_predicate(iff, value, predicate, uncommon_proj, current_proj, outer_loop, prev_proj);
+        prev_proj = clone_skeleton_predicate(iff, start, predicate, uncommon_proj, current_proj, outer_loop, prev_proj);
+        assert(skeleton_predicate_has_opaque(prev_proj->in(0)->as_If()) == (start->Opcode() == Op_Opaque1), "");
+        prev_proj = clone_skeleton_predicate(iff, end, predicate, uncommon_proj, current_proj, outer_loop, prev_proj);
+        assert(skeleton_predicate_has_opaque(prev_proj->in(0)->as_If()) == (end->Opcode() == Op_Opaque1), "");
         // Remove the skeleton predicate from the pre-loop
         _igvn.replace_input_of(iff, 1, _igvn.intcon(1));
       }
@@ -1097,9 +1103,47 @@
   }
 }
 
-Node* PhaseIdealLoop::update_skeleton_predicate(Node* iff, Node* value, Node* predicate, Node* uncommon_proj,
-                                                Node* current_proj, IdealLoopTree* outer_loop, Node* prev_proj) {
-  bool clone = (outer_loop != NULL); // Clone the predicate?
+static bool skeleton_follow_inputs(Node* n, int op) {
+  return (n->is_Bool() ||
+          n->is_Cmp() ||
+          op == Op_AndL ||
+          op == Op_OrL ||
+          op == Op_RShiftL ||
+          op == Op_LShiftL ||
+          op == Op_AddL ||
+          op == Op_AddI ||
+          op == Op_MulL ||
+          op == Op_MulI ||
+          op == Op_SubL ||
+          op == Op_SubI ||
+          op == Op_ConvI2L);
+}
+
+bool PhaseIdealLoop::skeleton_predicate_has_opaque(IfNode* iff) {
+  ResourceMark rm;
+  Unique_Node_List wq;
+  wq.push(iff->in(1)->in(1));
+  for (uint i = 0; i < wq.size(); i++) {
+    Node* n = wq.at(i);
+    int op = n->Opcode();
+    if (skeleton_follow_inputs(n, op)) {
+      for (uint j = 1; j < n->req(); j++) {
+        Node* m = n->in(j);
+        if (m != NULL) {
+          wq.push(m);
+        }
+      }
+      continue;
+    }
+    if (op == Op_Opaque1) {
+      return true;
+    }
+  }
+  return false;
+}
+
+Node* PhaseIdealLoop::clone_skeleton_predicate(Node* iff, Node* value, Node* predicate, Node* uncommon_proj,
+                                               Node* current_proj, IdealLoopTree* outer_loop, Node* prev_proj) {
   Node_Stack to_clone(2);
   to_clone.push(iff->in(1), 1);
   uint current = C->unique();
@@ -1114,28 +1158,11 @@
     uint i = to_clone.index();
     Node* m = n->in(i);
     int op = m->Opcode();
-    if (m->is_Bool() ||
-        m->is_Cmp() ||
-        op == Op_AndL ||
-        op == Op_OrL ||
-        op == Op_RShiftL ||
-        op == Op_LShiftL ||
-        op == Op_AddL ||
-        op == Op_AddI ||
-        op == Op_MulL ||
-        op == Op_MulI ||
-        op == Op_SubL ||
-        op == Op_SubI ||
-        op == Op_ConvI2L) {
+    if (skeleton_follow_inputs(m, op)) {
         to_clone.push(m, 1);
         continue;
     }
     if (op == Op_Opaque1) {
-      if (!clone) {
-        // Update the input of the Opaque1Node and exit
-        _igvn.replace_input_of(m, 1, value);
-        return prev_proj;
-      }
       if (n->_idx < current) {
         n = n->clone();
       }
@@ -1157,20 +1184,17 @@
       }
       Node* next = to_clone.node();
       j = to_clone.index();
-      if (clone && cur->_idx >= current) {
+      if (next->in(j) != cur) {
+        assert(cur->_idx >= current || next->in(j)->Opcode() == Op_Opaque1, "new node or Opaque1 being replaced");
         if (next->_idx < current) {
           next = next->clone();
           register_new_node(next, current_proj);
           to_clone.set_node(next);
         }
-        assert(next->in(j) != cur, "input should have been cloned");
         next->set_req(j, cur);
       }
     }
   } while (result == NULL);
-  if (!clone) {
-    return NULL;
-  }
   assert(result->_idx >= current, "new node expected");
 
   Node* proj = predicate->clone();
@@ -1193,8 +1217,9 @@
   return proj;
 }
 
-void PhaseIdealLoop::duplicate_predicates(CountedLoopNode* pre_head, Node* castii, IdealLoopTree* outer_loop,
-                                          LoopNode* outer_main_head, uint dd_main_head) {
+void PhaseIdealLoop::duplicate_predicates(CountedLoopNode* pre_head, Node* start, Node* end,
+                                          IdealLoopTree* outer_loop, LoopNode* outer_main_head,
+                                          uint dd_main_head) {
   if (UseLoopPredicate) {
     Node* entry = pre_head->in(LoopNode::EntryControl);
     Node* predicate = NULL;
@@ -1210,8 +1235,8 @@
       }
     }
     predicate = find_predicate_insertion_point(entry, Deoptimization::Reason_predicate);
-    duplicate_predicates_helper(predicate, castii, outer_loop, outer_main_head, dd_main_head);
-    duplicate_predicates_helper(profile_predicate, castii, outer_loop, outer_main_head, dd_main_head);
+    duplicate_predicates_helper(predicate, start, end, outer_loop, outer_main_head, dd_main_head);
+    duplicate_predicates_helper(profile_predicate, start, end, outer_loop, outer_main_head, dd_main_head);
   }
 }
 
@@ -1358,7 +1383,9 @@
   // CastII for the main loop:
   Node* castii = cast_incr_before_loop( pre_incr, min_taken, main_head );
   assert(castii != NULL, "no castII inserted");
-  duplicate_predicates(pre_head, castii, outer_loop, outer_main_head, dd_main_head);
+  Node* opaque_castii = new Opaque1Node(C, castii);
+  register_new_node(opaque_castii, outer_main_head->in(LoopNode::EntryControl));
+  duplicate_predicates(pre_head, castii, opaque_castii, outer_loop, outer_main_head, dd_main_head);
 
   // Step B4: Shorten the pre-loop to run only 1 iteration (for now).
   // RCE and alignment may change this later.
@@ -1637,6 +1664,49 @@
   return !is_member(_phase->get_loop(n_c));
 }
 
+void PhaseIdealLoop::update_skeleton_predicates(Node* ctrl, CountedLoopNode* loop_head, Node* init, int stride_con) {
+  // Search for skeleton predicates and update them according to the new stride
+  Node* entry = ctrl;
+  Node* prev_proj = ctrl;
+  LoopNode* outer_loop_head = loop_head->skip_strip_mined();
+  IdealLoopTree* outer_loop = get_loop(outer_loop_head);
+  while (entry != NULL && entry->is_Proj() && entry->in(0)->is_If()) {
+    IfNode* iff = entry->in(0)->as_If();
+    ProjNode* proj = iff->proj_out(1 - entry->as_Proj()->_con);
+    if (proj->unique_ctrl_out()->Opcode() != Op_Halt) {
+      break;
+    }
+    if (iff->in(1)->Opcode() == Op_Opaque4) {
+      // Look for predicate with an Opaque1 node that can be used as a template
+      if (!skeleton_predicate_has_opaque(iff)) {
+        // No Opaque1 node? It's either the check for the first value
+        // of the first iteration or the check for the last value of
+        // the first iteration of an unrolled loop. We can't
+        // tell. Kill it in any case.
+        _igvn.replace_input_of(iff, 1, iff->in(1)->in(2));
+      } else {
+        // Add back the predicate for the value at the beginning of the first entry
+        prev_proj = clone_skeleton_predicate(iff, init, entry, proj, ctrl, outer_loop, prev_proj);
+        assert(!skeleton_predicate_has_opaque(prev_proj->in(0)->as_If()), "unexpected");
+        // Compute the value of the loop induction variable at the end of the
+        // first iteration of the unrolled loop: init + new_stride_con - init_inc
+        int init_inc = stride_con/loop_head->unrolled_count();
+        assert(init_inc != 0, "invalid loop increment");
+        int new_stride_con = stride_con * 2;
+        Node* max_value = _igvn.intcon(new_stride_con - init_inc);
+        max_value = new AddINode(init, max_value);
+        register_new_node(max_value, get_ctrl(iff->in(1)));
+        prev_proj = clone_skeleton_predicate(iff, max_value, entry, proj, ctrl, outer_loop, prev_proj);
+        assert(!skeleton_predicate_has_opaque(prev_proj->in(0)->as_If()), "unexpected");
+      }
+    }
+    entry = entry->in(0)->in(0);
+  }
+  if (prev_proj != ctrl) {
+    _igvn.replace_input_of(outer_loop_head, LoopNode::EntryControl, prev_proj);
+    set_idom(outer_loop_head, prev_proj, dom_depth(outer_loop_head));
+  }
+}
 
 //------------------------------do_unroll--------------------------------------
 // Unroll the loop body one step - make each trip do 2 iterations.
@@ -1702,29 +1772,7 @@
   assert(old_trip_count > 1 &&
       (!adjust_min_trip || stride_p <= (1<<3)*loop_head->unrolled_count()), "sanity");
 
-  if (UseLoopPredicate) {
-    // Search for skeleton predicates and update them according to the new stride
-    Node* entry = ctrl;
-    while (entry != NULL && entry->is_Proj() && entry->in(0)->is_If()) {
-      IfNode* iff = entry->in(0)->as_If();
-      ProjNode* proj = iff->proj_out(1 - entry->as_Proj()->_con);
-      if (proj->unique_ctrl_out()->Opcode() != Op_Halt) {
-        break;
-      }
-      if (iff->in(1)->Opcode() == Op_Opaque4) {
-        // Compute the value of the loop induction variable at the end of the
-        // first iteration of the unrolled loop: init + new_stride_con - init_inc
-        int init_inc = stride_con/loop_head->unrolled_count();
-        assert(init_inc != 0, "invalid loop increment");
-        int new_stride_con = stride_con * 2;
-        Node* max_value = _igvn.intcon(new_stride_con - init_inc);
-        max_value = new AddINode(init, max_value);
-        register_new_node(max_value, get_ctrl(iff->in(1)));
-        update_skeleton_predicate(iff, max_value);
-      }
-      entry = entry->in(0)->in(0);
-    }
-  }
+  update_skeleton_predicates(ctrl, loop_head, init, stride_con);
 
   // Adjust loop limit to keep valid iterations number after unroll.
   // Use (limit - stride) instead of (((limit - init)/stride) & (-2))*stride
@@ -2035,13 +2083,20 @@
 
 //------------------------------adjust_limit-----------------------------------
 // Helper function for add_constraint().
-Node* PhaseIdealLoop::adjust_limit(int stride_con, Node * scale, Node *offset, Node *rc_limit, Node *loop_limit, Node *pre_ctrl) {
+Node* PhaseIdealLoop::adjust_limit(int stride_con, Node * scale, Node *offset, Node *rc_limit, Node *loop_limit, Node *pre_ctrl, bool round_up) {
   // Compute "I :: (limit-offset)/scale"
   Node *con = new SubINode(rc_limit, offset);
   register_new_node(con, pre_ctrl);
   Node *X = new DivINode(0, con, scale);
   register_new_node(X, pre_ctrl);
 
+  // When the absolute value of scale is greater than one, the integer
+  // division may round limit down so add one to the limit.
+  if (round_up) {
+    X = new AddINode(X, _igvn.intcon(1));
+    register_new_node(X, pre_ctrl);
+  }
+
   // Adjust loop limit
   loop_limit = (stride_con > 0)
                ? (Node*)(new MinINode(loop_limit, X))
@@ -2082,7 +2137,7 @@
     // (upper_limit-offset) may overflow or underflow.
     // But it is fine since main loop will either have
     // less iterations or will be skipped in such case.
-    *main_limit = adjust_limit(stride_con, scale, offset, upper_limit, *main_limit, pre_ctrl);
+    *main_limit = adjust_limit(stride_con, scale, offset, upper_limit, *main_limit, pre_ctrl, false);
 
     // The underflow limit: low_limit <= scale*I+offset.
     // For pre-loop compute
@@ -2117,7 +2172,8 @@
       // max(pre_limit, original_limit) is used in do_range_check().
     }
     // Pass (-stride) to indicate pre_loop_cond = NOT(main_loop_cond);
-    *pre_limit = adjust_limit((-stride_con), scale, offset, low_limit, *pre_limit, pre_ctrl);
+    *pre_limit = adjust_limit((-stride_con), scale, offset, low_limit, *pre_limit, pre_ctrl,
+                              scale_con > 1 && stride_con > 0);
 
   } else { // stride_con*scale_con < 0
     // For negative stride*scale pre-loop checks for overflow and
@@ -2143,7 +2199,8 @@
     Node *plus_one = new AddINode(offset, one);
     register_new_node( plus_one, pre_ctrl );
     // Pass (-stride) to indicate pre_loop_cond = NOT(main_loop_cond);
-    *pre_limit = adjust_limit((-stride_con), scale, plus_one, upper_limit, *pre_limit, pre_ctrl);
+    *pre_limit = adjust_limit((-stride_con), scale, plus_one, upper_limit, *pre_limit, pre_ctrl,
+                              scale_con < -1 && stride_con > 0);
 
     if (low_limit->get_int() == -max_jint) {
       // We need this guard when scale*main_limit+offset >= limit
@@ -2177,7 +2234,8 @@
     //       I > (low_limit-(offset+1))/scale
     //   )
 
-    *main_limit = adjust_limit(stride_con, scale, plus_one, low_limit, *main_limit, pre_ctrl);
+    *main_limit = adjust_limit(stride_con, scale, plus_one, low_limit, *main_limit, pre_ctrl,
+                               false);
   }
 }
 
@@ -2282,16 +2340,16 @@
 // eliminated by iteration splitting.
 Node* PhaseIdealLoop::add_range_check_predicate(IdealLoopTree* loop, CountedLoopNode* cl,
                                                 Node* predicate_proj, int scale_con, Node* offset,
-                                                Node* limit, jint stride_con) {
+                                                Node* limit, jint stride_con, Node* value) {
   bool overflow = false;
-  BoolNode* bol = rc_predicate(loop, predicate_proj, scale_con, offset, cl->init_trip(), NULL, stride_con, limit, (stride_con > 0) != (scale_con > 0), overflow);
+  BoolNode* bol = rc_predicate(loop, predicate_proj, scale_con, offset, value, NULL, stride_con, limit, (stride_con > 0) != (scale_con > 0), overflow);
   Node* opaque_bol = new Opaque4Node(C, bol, _igvn.intcon(1));
   register_new_node(opaque_bol, predicate_proj);
   IfNode* new_iff = NULL;
   if (overflow) {
-    new_iff = new IfNode(predicate_proj, bol, PROB_MAX, COUNT_UNKNOWN);
+    new_iff = new IfNode(predicate_proj, opaque_bol, PROB_MAX, COUNT_UNKNOWN);
   } else {
-    new_iff = new RangeCheckNode(predicate_proj, bol, PROB_MAX, COUNT_UNKNOWN);
+    new_iff = new RangeCheckNode(predicate_proj, opaque_bol, PROB_MAX, COUNT_UNKNOWN);
   }
   register_control(new_iff, loop->_parent, predicate_proj);
   Node* iffalse = new IfFalseNode(new_iff);
@@ -2483,7 +2541,23 @@
           add_constraint( stride_con, scale_con, offset, zero, limit, pre_ctrl, &pre_limit, &main_limit );
           // (0-offset)/scale could be outside of loop iterations range.
           conditional_rc = true;
-          predicate_proj = add_range_check_predicate(loop, cl, predicate_proj, scale_con, offset, limit, stride_con);
+          Node* init = cl->init_trip();
+          Node* opaque_init = new Opaque1Node(C, init);
+          register_new_node(opaque_init, predicate_proj);
+          // template predicate so it can be updated on next unrolling
+          predicate_proj = add_range_check_predicate(loop, cl, predicate_proj, scale_con, offset, limit, stride_con, opaque_init);
+          assert(skeleton_predicate_has_opaque(predicate_proj->in(0)->as_If()), "unexpected");
+          // predicate on first value of first iteration
+          predicate_proj = add_range_check_predicate(loop, cl, predicate_proj, scale_con, offset, limit, stride_con, init);
+          assert(!skeleton_predicate_has_opaque(predicate_proj->in(0)->as_If()), "unexpected");
+          int init_inc = stride_con/cl->unrolled_count();
+          assert(init_inc != 0, "invalid loop increment");
+          Node* max_value = _igvn.intcon(stride_con - init_inc);
+          max_value = new AddINode(init, max_value);
+          register_new_node(max_value, predicate_proj);
+          // predicate on last value of first iteration (in case unrolling has already happened)
+          predicate_proj = add_range_check_predicate(loop, cl, predicate_proj, scale_con, offset, limit, stride_con, max_value);
+          assert(!skeleton_predicate_has_opaque(predicate_proj->in(0)->as_If()), "unexpected");
         } else {
           if (PrintOpto) {
             tty->print_cr("missed RCE opportunity");
--- a/src/hotspot/share/opto/loopnode.hpp	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/hotspot/share/opto/loopnode.hpp	Tue Jan 15 10:55:26 2019 -0800
@@ -302,7 +302,7 @@
   void set_slp_max_unroll(int unroll_factor) { _slp_maximum_unroll_factor = unroll_factor; }
   int  slp_max_unroll() const                { return _slp_maximum_unroll_factor; }
 
-  virtual LoopNode* skip_strip_mined(int expect_opaq = 1);
+  virtual LoopNode* skip_strip_mined(int expect_skeleton = 1);
   OuterStripMinedLoopNode* outer_loop() const;
   virtual IfTrueNode* outer_loop_tail() const;
   virtual OuterStripMinedLoopEndNode* outer_loop_end() const;
@@ -747,12 +747,14 @@
   }
 
   Node* cast_incr_before_loop(Node* incr, Node* ctrl, Node* loop);
-  void duplicate_predicates_helper(Node* predicate, Node* castii, IdealLoopTree* outer_loop,
+  void duplicate_predicates_helper(Node* predicate, Node* start, Node* end, IdealLoopTree* outer_loop,
                                    LoopNode* outer_main_head, uint dd_main_head);
-  void duplicate_predicates(CountedLoopNode* pre_head, Node* castii, IdealLoopTree* outer_loop,
+  void duplicate_predicates(CountedLoopNode* pre_head, Node* start, Node* end, IdealLoopTree* outer_loop,
                             LoopNode* outer_main_head, uint dd_main_head);
-  Node* update_skeleton_predicate(Node* iff, Node* value, Node* predicate = NULL, Node* uncommon_proj = NULL,
-                                  Node* current_proj = NULL, IdealLoopTree* outer_loop = NULL, Node* prev_proj = NULL);
+  Node* clone_skeleton_predicate(Node* iff, Node* value, Node* predicate, Node* uncommon_proj,
+                                  Node* current_proj, IdealLoopTree* outer_loop, Node* prev_proj);
+  bool skeleton_predicate_has_opaque(IfNode* iff);
+  void update_skeleton_predicates(Node* ctrl, CountedLoopNode* loop_head, Node* init, int stride_con);
   void insert_loop_limit_check(ProjNode* limit_check_proj, Node* cmp_limit, Node* bol);
 
 public:
@@ -1128,7 +1130,7 @@
                                       Deoptimization::DeoptReason reason);
   Node* add_range_check_predicate(IdealLoopTree* loop, CountedLoopNode* cl,
                                   Node* predicate_proj, int scale_con, Node* offset,
-                                  Node* limit, jint stride_con);
+                                  Node* limit, jint stride_con, Node* value);
 
   // Helper function to collect predicate for eliminating the useless ones
   void collect_potentially_useful_predicates(IdealLoopTree *loop, Unique_Node_List &predicate_opaque1);
@@ -1190,7 +1192,7 @@
   // loop.  Scale_con, offset and limit are all loop invariant.
   void add_constraint( int stride_con, int scale_con, Node *offset, Node *low_limit, Node *upper_limit, Node *pre_ctrl, Node **pre_limit, Node **main_limit );
   // Helper function for add_constraint().
-  Node* adjust_limit( int stride_con, Node * scale, Node *offset, Node *rc_limit, Node *loop_limit, Node *pre_ctrl );
+  Node* adjust_limit(int stride_con, Node * scale, Node *offset, Node *rc_limit, Node *loop_limit, Node *pre_ctrl, bool round_up);
 
   // Partially peel loop up through last_peel node.
   bool partial_peel( IdealLoopTree *loop, Node_List &old_new );
@@ -1304,6 +1306,14 @@
   bool identical_backtoback_ifs(Node *n);
   bool can_split_if(Node *n_ctrl);
 
+  // Determine if a method is too big for a/another round of split-if, based on
+  // a magic (approximate) ratio derived from the equally magic constant 35000,
+  // previously used for this purpose (but without relating to the node limit).
+  bool must_throttle_split_if() {
+    uint threshold = C->max_node_limit() * 2 / 5;
+    return C->live_nodes() > threshold;
+  }
+
   bool _created_loop_node;
 public:
   void set_created_loop_node() { _created_loop_node = true; }
--- a/src/hotspot/share/opto/loopopts.cpp	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/hotspot/share/opto/loopopts.cpp	Tue Jan 15 10:55:26 2019 -0800
@@ -1024,8 +1024,7 @@
     }
   }
 
-  // Use same limit as split_if_with_blocks_post
-  if( C->live_nodes() > 35000 ) return n; // Method too big
+  if (must_throttle_split_if()) return n;
 
   // Split 'n' through the merge point if it is profitable
   Node *phi = split_thru_phi( n, n_blk, policy );
@@ -1143,9 +1142,10 @@
   return true;
 }
 
-bool PhaseIdealLoop::can_split_if(Node *n_ctrl) {
-  if (C->live_nodes() > 35000) {
-    return false; // Method too big
+
+bool PhaseIdealLoop::can_split_if(Node* n_ctrl) {
+  if (must_throttle_split_if()) {
+    return false;
   }
 
   // Do not do 'split-if' if irreducible loops are present.
@@ -1462,12 +1462,13 @@
 // Check for aggressive application of 'split-if' optimization,
 // using basic block level info.
 void PhaseIdealLoop::split_if_with_blocks(VectorSet &visited, Node_Stack &nstack, bool last_round) {
-  Node *n = C->root();
-  visited.set(n->_idx); // first, mark node as visited
+  Node* root = C->root();
+  visited.set(root->_idx); // first, mark root as visited
   // Do pre-visit work for root
-  n = split_if_with_blocks_pre( n );
-  uint cnt = n->outcnt();
-  uint i   = 0;
+  Node* n   = split_if_with_blocks_pre(root);
+  uint  cnt = n->outcnt();
+  uint  i   = 0;
+
   while (true) {
     // Visit all children
     if (i < cnt) {
@@ -1475,7 +1476,7 @@
       ++i;
       if (use->outcnt() != 0 && !visited.test_set(use->_idx)) {
         // Now do pre-visit work for this use
-        use = split_if_with_blocks_pre( use );
+        use = split_if_with_blocks_pre(use);
         nstack.push(n, i); // Save parent and next use's index.
         n   = use;         // Process all children of current use.
         cnt = use->outcnt();
@@ -1486,7 +1487,10 @@
       // All of n's children have been processed, complete post-processing.
       if (cnt != 0 && !n->is_Con()) {
         assert(has_node(n), "no dead nodes");
-        split_if_with_blocks_post( n, last_round );
+        split_if_with_blocks_post(n, last_round);
+      }
+      if (must_throttle_split_if()) {
+        nstack.clear();
       }
       if (nstack.is_empty()) {
         // Finished all nodes on stack.
--- a/src/hotspot/share/opto/node.cpp	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/hotspot/share/opto/node.cpp	Tue Jan 15 10:55:26 2019 -0800
@@ -37,6 +37,7 @@
 #include "opto/node.hpp"
 #include "opto/opcodes.hpp"
 #include "opto/regmask.hpp"
+#include "opto/rootnode.hpp"
 #include "opto/type.hpp"
 #include "utilities/copy.hpp"
 #include "utilities/macros.hpp"
@@ -1310,6 +1311,9 @@
 
   while (nstack.size() > 0) {
     dead = nstack.pop();
+    if (dead->Opcode() == Op_SafePoint) {
+      dead->as_SafePoint()->disconnect_from_root(igvn);
+    }
     if (dead->outcnt() > 0) {
       // Keep dead node on stack until all uses are processed.
       nstack.push(dead);
@@ -1367,7 +1371,7 @@
         igvn->C->remove_range_check_cast(cast);
       }
       if (dead->Opcode() == Op_Opaque4) {
-        igvn->C->remove_range_check_cast(dead);
+        igvn->C->remove_opaque4_node(dead);
       }
       BarrierSetC2* bs = BarrierSet::barrier_set()->barrier_set_c2();
       bs->unregister_potential_barrier_node(dead);
--- a/src/hotspot/share/opto/phaseX.cpp	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/hotspot/share/opto/phaseX.cpp	Tue Jan 15 10:55:26 2019 -0800
@@ -430,20 +430,6 @@
 
   // Disconnect 'useless' nodes that are adjacent to useful nodes
   C->remove_useless_nodes(_useful);
-
-  // Remove edges from "root" to each SafePoint at a backward branch.
-  // They were inserted during parsing (see add_safepoint()) to make infinite
-  // loops without calls or exceptions visible to root, i.e., useful.
-  Node *root = C->root();
-  if( root != NULL ) {
-    for( uint i = root->req(); i < root->len(); ++i ) {
-      Node *n = root->in(i);
-      if( n != NULL && n->is_SafePoint() ) {
-        root->rm_prec(i);
-        --i;
-      }
-    }
-  }
 }
 
 //=============================================================================
@@ -1354,6 +1340,9 @@
 
   while (_stack.is_nonempty()) {
     dead = _stack.node();
+    if (dead->Opcode() == Op_SafePoint) {
+      dead->as_SafePoint()->disconnect_from_root(this);
+    }
     uint progress_state = _stack.index();
     assert(dead != C->root(), "killing root, eh?");
     assert(!dead->is_top(), "add check for top when pushing");
@@ -1456,6 +1445,9 @@
 //------------------------------subsume_node-----------------------------------
 // Remove users from node 'old' and add them to node 'nn'.
 void PhaseIterGVN::subsume_node( Node *old, Node *nn ) {
+  if (old->Opcode() == Op_SafePoint) {
+    old->as_SafePoint()->disconnect_from_root(this);
+  }
   assert( old != hash_find(old), "should already been removed" );
   assert( old != C->top(), "cannot subsume top node");
   // Copy debug or profile information to the new version:
--- a/src/hotspot/share/prims/jni.cpp	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/hotspot/share/prims/jni.cpp	Tue Jan 15 10:55:26 2019 -0800
@@ -823,9 +823,7 @@
 
   HOTSPOT_JNI_ISSAMEOBJECT_ENTRY(env, r1, r2);
 
-  oop a = JNIHandles::resolve(r1);
-  oop b = JNIHandles::resolve(r2);
-  jboolean ret = oopDesc::equals(a, b) ? JNI_TRUE : JNI_FALSE;
+  jboolean ret = JNIHandles::is_same_object(r1, r2) ? JNI_TRUE : JNI_FALSE;
 
   HOTSPOT_JNI_ISSAMEOBJECT_RETURN(ret);
   return ret;
--- a/src/hotspot/share/prims/jvm.cpp	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/hotspot/share/prims/jvm.cpp	Tue Jan 15 10:55:26 2019 -0800
@@ -61,6 +61,7 @@
 #include "runtime/handles.inline.hpp"
 #include "runtime/init.hpp"
 #include "runtime/interfaceSupport.inline.hpp"
+#include "runtime/deoptimization.hpp"
 #include "runtime/java.hpp"
 #include "runtime/javaCalls.hpp"
 #include "runtime/jfieldIDWorkaround.hpp"
@@ -1229,11 +1230,10 @@
   oop protection_domain = NULL;
 
   // Iterate through Java frames
-  RegisterMap reg_map(thread);
-  javaVFrame *vf = thread->last_java_vframe(&reg_map);
-  for (; vf != NULL; vf = vf->java_sender()) {
+  vframeStream vfst(thread);
+  for(; !vfst.at_end(); vfst.next()) {
     // get method of frame
-    Method* method = vf->method();
+    Method* method = vfst.method();
 
     // stop at the first privileged frame
     if (method->method_holder() == SystemDictionary::AccessController_klass() &&
@@ -1242,13 +1242,15 @@
       // this frame is privileged
       is_privileged = true;
 
-      javaVFrame *priv = vf;                        // executePrivileged
-      javaVFrame *caller_fr = priv->java_sender();  // doPrivileged
-      caller_fr = caller_fr->java_sender();         // caller
+      javaVFrame *priv = vfst.asJavaVFrame();       // executePrivileged
 
       StackValueCollection* locals = priv->locals();
-      privileged_context = locals->obj_at(1);
-      Handle caller      = locals->obj_at(2);
+      StackValue* ctx_sv = locals->at(1); // AccessControlContext context
+      StackValue* clr_sv = locals->at(2); // Class<?> caller
+      assert(!ctx_sv->obj_is_scalar_replaced(), "found scalar-replaced object");
+      assert(!clr_sv->obj_is_scalar_replaced(), "found scalar-replaced object");
+      privileged_context    = ctx_sv->get_obj();
+      Handle caller         = clr_sv->get_obj();
 
       Klass *caller_klass = java_lang_Class::as_Klass(caller());
       protection_domain  = caller_klass->protection_domain();
--- a/src/hotspot/share/prims/whitebox.cpp	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/hotspot/share/prims/whitebox.cpp	Tue Jan 15 10:55:26 2019 -0800
@@ -82,6 +82,7 @@
 #include "gc/g1/g1ConcurrentMark.hpp"
 #include "gc/g1/g1ConcurrentMarkThread.hpp"
 #include "gc/g1/heapRegionRemSet.hpp"
+#include "gc/g1/heterogeneousHeapRegionManager.hpp"
 #endif // INCLUDE_G1GC
 #if INCLUDE_PARALLELGC
 #include "gc/parallel/parallelScavengeHeap.inline.hpp"
@@ -499,6 +500,113 @@
 
 #endif // INCLUDE_G1GC
 
+#if INCLUDE_G1GC || INCLUDE_PARALLELGC
+WB_ENTRY(jlong, WB_DramReservedStart(JNIEnv* env, jobject o))
+#if INCLUDE_G1GC
+  if (UseG1GC) {
+    G1CollectedHeap* g1h = G1CollectedHeap::heap();
+    if (g1h->g1_collector_policy()->is_hetero_heap()) {
+      uint start_region = HeterogeneousHeapRegionManager::manager()->start_index_of_dram();
+      return (jlong)(g1h->base() + start_region * HeapRegion::GrainBytes);
+    } else {
+      return (jlong)g1h->base();
+    }
+  }
+#endif // INCLUDE_G1GC
+#if INCLUDE_PARALLELGC
+  if (UseParallelGC) {
+    ParallelScavengeHeap* ps_heap = ParallelScavengeHeap::heap();
+    if (AllocateOldGenAt != NULL) {
+      MemRegion reserved = ps_heap->young_gen()->reserved();
+      return (jlong)reserved.start();
+    } else {
+      return (jlong)ps_heap->base();
+    }
+  }
+#endif // INCLUDE_PARALLELGC
+  THROW_MSG_0(vmSymbols::java_lang_UnsupportedOperationException(), "WB_DramReservedStart: enabled only for G1 and Parallel GC");
+WB_END
+
+WB_ENTRY(jlong, WB_DramReservedEnd(JNIEnv* env, jobject o))
+#if INCLUDE_G1GC
+  if (UseG1GC) {
+    G1CollectedHeap* g1h = G1CollectedHeap::heap();
+    if (g1h->g1_collector_policy()->is_hetero_heap()) {
+      uint end_region = HeterogeneousHeapRegionManager::manager()->end_index_of_dram();
+      return (jlong)(g1h->base() + (end_region + 1) * HeapRegion::GrainBytes - 1);
+    } else {
+      return (jlong)g1h->base() + g1h->collector_policy()->max_heap_byte_size();
+    }
+  }
+#endif // INCLUDE_G1GC
+#if INCLUDE_PARALLELGC
+  if (UseParallelGC) {
+    ParallelScavengeHeap* ps_heap = ParallelScavengeHeap::heap();
+    if (AllocateOldGenAt != NULL) {
+      MemRegion reserved = ps_heap->young_gen()->reserved();
+      return (jlong)reserved.end();
+    } else {
+      return (jlong)ps_heap->reserved_region().end();
+    }
+  }
+#endif // INCLUDE_PARALLELGC
+  THROW_MSG_0(vmSymbols::java_lang_UnsupportedOperationException(), "WB_DramReservedEnd: enabled only for G1 and Parallel GC");
+WB_END
+
+WB_ENTRY(jlong, WB_NvdimmReservedStart(JNIEnv* env, jobject o))
+#if INCLUDE_G1GC
+  if (UseG1GC) {
+    G1CollectedHeap* g1h = G1CollectedHeap::heap();
+    if (g1h->g1_collector_policy()->is_hetero_heap()) {
+      uint start_region = HeterogeneousHeapRegionManager::manager()->start_index_of_nvdimm();
+      return (jlong)(g1h->base() + start_region * HeapRegion::GrainBytes);
+    } else {
+      THROW_MSG_0(vmSymbols::java_lang_UnsupportedOperationException(), "WB_NvdimmReservedStart: Old gen is not allocated on NV-DIMM using AllocateOldGenAt flag");
+    }
+  }
+#endif // INCLUDE_G1GC
+#if INCLUDE_PARALLELGC
+  if (UseParallelGC) {
+    ParallelScavengeHeap* ps_heap = ParallelScavengeHeap::heap();
+    if (AllocateOldGenAt != NULL) {
+      MemRegion reserved = ps_heap->old_gen()->reserved();
+      return (jlong)reserved.start();
+    } else {
+      THROW_MSG_0(vmSymbols::java_lang_UnsupportedOperationException(), "WB_NvdimmReservedStart: Old gen is not allocated on NV-DIMM using AllocateOldGenAt flag");
+    }
+  }
+#endif // INCLUDE_PARALLELGC
+  THROW_MSG_0(vmSymbols::java_lang_UnsupportedOperationException(), "WB_NvdimmReservedStart: enabled only for G1 and Parallel GC");
+WB_END
+
+WB_ENTRY(jlong, WB_NvdimmReservedEnd(JNIEnv* env, jobject o))
+#if INCLUDE_G1GC
+  if (UseG1GC) {
+    G1CollectedHeap* g1h = G1CollectedHeap::heap();
+    if (g1h->g1_collector_policy()->is_hetero_heap()) {
+      uint end_region = HeterogeneousHeapRegionManager::manager()->start_index_of_nvdimm();
+      return (jlong)(g1h->base() + (end_region + 1) * HeapRegion::GrainBytes - 1);
+    } else {
+      THROW_MSG_0(vmSymbols::java_lang_UnsupportedOperationException(), "WB_NvdimmReservedEnd: Old gen is not allocated on NV-DIMM using AllocateOldGenAt flag");
+    }
+  }
+#endif // INCLUDE_G1GC
+#if INCLUDE_PARALLELGC
+  if (UseParallelGC) {
+    ParallelScavengeHeap* ps_heap = ParallelScavengeHeap::heap();
+    if (AllocateOldGenAt != NULL) {
+      MemRegion reserved = ps_heap->old_gen()->reserved();
+      return (jlong)reserved.end();
+      } else {
+      THROW_MSG_0(vmSymbols::java_lang_UnsupportedOperationException(), "WB_NvdimmReservedEnd: Old gen is not allocated on NV-DIMM using AllocateOldGenAt flag");
+    }
+  }
+#endif // INCLUDE_PARALLELGC
+  THROW_MSG_0(vmSymbols::java_lang_UnsupportedOperationException(), "WB_NvdimmReservedEnd: enabled only for G1 and Parallel GC");
+WB_END
+
+#endif // INCLUDE_G1GC || INCLUDE_PARALLELGC
+
 #if INCLUDE_PARALLELGC
 
 WB_ENTRY(jlong, WB_PSVirtualSpaceAlignment(JNIEnv* env, jobject o))
@@ -2054,6 +2162,12 @@
                                                       (void*)&WB_G1AuxiliaryMemoryUsage  },
   {CC"g1GetMixedGCInfo",   CC"(I)[J",                 (void*)&WB_G1GetMixedGCInfo },
 #endif // INCLUDE_G1GC
+#if INCLUDE_G1GC || INCLUDE_PARALLELGC
+  {CC"dramReservedStart",   CC"()J",                  (void*)&WB_DramReservedStart },
+  {CC"dramReservedEnd",     CC"()J",                  (void*)&WB_DramReservedEnd },
+  {CC"nvdimmReservedStart", CC"()J",                  (void*)&WB_NvdimmReservedStart },
+  {CC"nvdimmReservedEnd",   CC"()J",                  (void*)&WB_NvdimmReservedEnd },
+#endif // INCLUDE_G1GC || INCLUDE_PARALLELGC
 #if INCLUDE_PARALLELGC
   {CC"psVirtualSpaceAlignment",CC"()J",               (void*)&WB_PSVirtualSpaceAlignment},
   {CC"psHeapGenerationAlignment",CC"()J",             (void*)&WB_PSHeapGenerationAlignment},
--- a/src/hotspot/share/runtime/arguments.cpp	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/hotspot/share/runtime/arguments.cpp	Tue Jan 15 10:55:26 2019 -0800
@@ -2062,6 +2062,9 @@
       log_warning(arguments) ("NUMA support for Heap depends on the file system when AllocateHeapAt option is used.\n");
     }
   }
+
+  status = status && GCArguments::check_args_consistency();
+
   return status;
 }
 
@@ -2953,6 +2956,7 @@
   }
 #endif // LINUX
   fix_appclasspath();
+
   return JNI_OK;
 }
 
@@ -3107,6 +3111,10 @@
       BytecodeVerificationRemote = true;
       log_info(cds)("All non-system classes will be verified (-Xverify:remote) during CDS dump time.");
     }
+
+    // Compilation is already disabled if the user specifies -Xshare:dump.
+    // Disable compilation in case user specifies -XX:+DumpSharedSpaces instead of -Xshare:dump.
+    set_mode_flags(_int);
   }
   if (UseSharedSpaces && patch_mod_javabase) {
     no_shared_spaces("CDS is disabled when " JAVA_BASE_NAME " module is patched.");
@@ -3811,6 +3819,7 @@
 
 #if defined(AIX)
   UNSUPPORTED_OPTION(AllocateHeapAt);
+  UNSUPPORTED_OPTION(AllocateOldGenAt);
 #endif
 
   ArgumentsExt::report_unsupported_options();
--- a/src/hotspot/share/runtime/globals.hpp	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/hotspot/share/runtime/globals.hpp	Tue Jan 15 10:55:26 2019 -0800
@@ -2575,6 +2575,12 @@
           "Path to the directoy where a temporary file will be created "    \
           "to use as the backing store for Java Heap.")                     \
                                                                             \
+  experimental(ccstr, AllocateOldGenAt, NULL,                               \
+          "Path to the directoy where a temporary file will be "            \
+          "created to use as the backing store for old generation."         \
+          "File of size Xmx is pre-allocated for performance reason, so"    \
+          "we need that much space available")                              \
+                                                                            \
   develop(bool, VerifyMetaspace, false,                                     \
           "Verify metaspace on chunk movements.")                           \
                                                                             \
--- a/src/hotspot/share/runtime/jniHandles.cpp	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/hotspot/share/runtime/jniHandles.cpp	Tue Jan 15 10:55:26 2019 -0800
@@ -152,17 +152,11 @@
 oop JNIHandles::resolve_external_guard(jobject handle) {
   oop result = NULL;
   if (handle != NULL) {
-    result = resolve_impl<true /* external_guard */ >(handle);
+    result = resolve_impl<0 /* decorators */, true /* external_guard */>(handle);
   }
   return result;
 }
 
-oop JNIHandles::resolve_jweak(jweak handle) {
-  assert(handle != NULL, "precondition");
-  assert(is_jweak(handle), "precondition");
-  return NativeAccess<ON_PHANTOM_OOP_REF>::oop_load(jweak_ptr(handle));
-}
-
 bool JNIHandles::is_global_weak_cleared(jweak handle) {
   assert(handle != NULL, "precondition");
   assert(is_jweak(handle), "not a weak handle");
@@ -318,7 +312,7 @@
 class VerifyJNIHandles: public OopClosure {
 public:
   virtual void do_oop(oop* root) {
-    guarantee(oopDesc::is_oop(RawAccess<>::oop_load(root)), "Invalid oop");
+    guarantee(oopDesc::is_oop_or_null(RawAccess<>::oop_load(root)), "Invalid oop");
   }
   virtual void do_oop(narrowOop* root) { ShouldNotReachHere(); }
 };
--- a/src/hotspot/share/runtime/jniHandles.hpp	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/hotspot/share/runtime/jniHandles.hpp	Tue Jan 15 10:55:26 2019 -0800
@@ -42,8 +42,10 @@
   inline static oop* jobject_ptr(jobject handle); // NOT jweak!
   inline static oop* jweak_ptr(jobject handle);
 
-  template<bool external_guard> inline static oop resolve_impl(jobject handle);
-  static oop resolve_jweak(jweak handle);
+  template <DecoratorSet decorators, bool external_guard> inline static oop resolve_impl(jobject handle);
+
+  // Resolve handle into oop, without keeping the object alive
+  inline static oop resolve_no_keepalive(jobject handle);
 
   // This method is not inlined in order to avoid circular includes between
   // this header file and thread.hpp.
@@ -70,6 +72,9 @@
   // Resolve externally provided handle into oop with some guards
   static oop resolve_external_guard(jobject handle);
 
+  // Check for equality without keeping objects alive
+  static bool is_same_object(jobject handle1, jobject handle2);
+
   // Local handles
   static jobject make_local(oop obj);
   static jobject make_local(JNIEnv* env, oop obj);    // Fast version when env is known
--- a/src/hotspot/share/runtime/jniHandles.inline.hpp	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/hotspot/share/runtime/jniHandles.inline.hpp	Tue Jan 15 10:55:26 2019 -0800
@@ -49,15 +49,15 @@
 }
 
 // external_guard is true if called from resolve_external_guard.
-template<bool external_guard>
+template <DecoratorSet decorators, bool external_guard>
 inline oop JNIHandles::resolve_impl(jobject handle) {
   assert(handle != NULL, "precondition");
   assert(!current_thread_in_native(), "must not be in native");
   oop result;
   if (is_jweak(handle)) {       // Unlikely
-    result = resolve_jweak(handle);
+    result = NativeAccess<ON_PHANTOM_OOP_REF|decorators>::oop_load(jweak_ptr(handle));
   } else {
-    result = NativeAccess<>::oop_load(jobject_ptr(handle));
+    result = NativeAccess<decorators>::oop_load(jobject_ptr(handle));
     // Construction of jobjects canonicalize a null value into a null
     // jobject, so for non-jweak the pointee should never be null.
     assert(external_guard || result != NULL, "Invalid JNI handle");
@@ -68,14 +68,28 @@
 inline oop JNIHandles::resolve(jobject handle) {
   oop result = NULL;
   if (handle != NULL) {
-    result = resolve_impl<false /* external_guard */ >(handle);
+    result = resolve_impl<0 /* decorators */, false /* external_guard */>(handle);
   }
   return result;
 }
 
+inline oop JNIHandles::resolve_no_keepalive(jobject handle) {
+  oop result = NULL;
+  if (handle != NULL) {
+    result = resolve_impl<AS_NO_KEEPALIVE, false /* external_guard */>(handle);
+  }
+  return result;
+}
+
+inline bool JNIHandles::is_same_object(jobject handle1, jobject handle2) {
+  oop obj1 = resolve_no_keepalive(handle1);
+  oop obj2 = resolve_no_keepalive(handle2);
+  return oopDesc::equals(obj1, obj2);
+}
+
 inline oop JNIHandles::resolve_non_null(jobject handle) {
   assert(handle != NULL, "JNI handle should not be null");
-  oop result = resolve_impl<false /* external_guard */ >(handle);
+  oop result = resolve_impl<0 /* decorators */, false /* external_guard */>(handle);
   assert(result != NULL, "NULL read from jni handle");
   return result;
 }
--- a/src/hotspot/share/runtime/sweeper.cpp	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/hotspot/share/runtime/sweeper.cpp	Tue Jan 15 10:55:26 2019 -0800
@@ -149,7 +149,7 @@
 long     NMethodSweeper::_last_sweep                   = 0;    // Value of _time_counter when the last sweep happened
 int      NMethodSweeper::_seen                         = 0;    // Nof. nmethod we have currently processed in current pass of CodeCache
 
-volatile bool NMethodSweeper::_should_sweep            = true; // Indicates if we should invoke the sweeper
+volatile bool NMethodSweeper::_should_sweep            = false;// Indicates if we should invoke the sweeper
 volatile bool NMethodSweeper::_force_sweep             = false;// Indicates if we should force a sweep
 volatile int  NMethodSweeper::_bytes_changed           = 0;    // Counts the total nmethod size if the nmethod changed from:
                                                                //   1) alive       -> not_entrant
@@ -717,12 +717,6 @@
     // stack we can safely convert it to a zombie method
     OrderAccess::loadload(); // _stack_traversal_mark and _state
     if (cm->can_convert_to_zombie()) {
-      // Clear ICStubs to prevent back patching stubs of zombie or flushed
-      // nmethods during the next safepoint (see ICStub::finalize).
-      {
-        CompiledICLocker ml(cm);
-        cm->clear_ic_stubs();
-      }
       // Code cache state change is tracked in make_zombie()
       cm->make_zombie();
       SWEEP(cm);
--- a/src/hotspot/share/runtime/thread.cpp	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/hotspot/share/runtime/thread.cpp	Tue Jan 15 10:55:26 2019 -0800
@@ -231,7 +231,7 @@
   set_active_handles(NULL);
   set_free_handle_block(NULL);
   set_last_handle_mark(NULL);
-  DEBUG_ONLY(_missed_ic_stub_refill_mark = NULL);
+  DEBUG_ONLY(_missed_ic_stub_refill_verifier = NULL);
 
   // This initial value ==> never claimed.
   _oops_do_parity = 0;
@@ -2603,8 +2603,7 @@
 }
 
 void JavaThread::enable_stack_reserved_zone() {
-  assert(_stack_guard_state != stack_guard_unused, "must be using guard pages.");
-  assert(_stack_guard_state != stack_guard_enabled, "already enabled");
+  assert(_stack_guard_state == stack_guard_reserved_disabled, "inconsistent state");
 
   // The base notation is from the stack's point of view, growing downward.
   // We need to adjust it to work correctly with guard_memory()
@@ -2622,11 +2621,10 @@
 }
 
 void JavaThread::disable_stack_reserved_zone() {
-  assert(_stack_guard_state != stack_guard_unused, "must be using guard pages.");
-  assert(_stack_guard_state != stack_guard_reserved_disabled, "already disabled");
+  assert(_stack_guard_state == stack_guard_enabled, "inconsistent state");
 
   // Simply return if called for a thread that does not use guard pages.
-  if (_stack_guard_state == stack_guard_unused) return;
+  if (_stack_guard_state != stack_guard_enabled) return;
 
   // The base notation is from the stack's point of view, growing downward.
   // We need to adjust it to work correctly with guard_memory()
--- a/src/hotspot/share/runtime/thread.hpp	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/hotspot/share/runtime/thread.hpp	Tue Jan 15 10:55:26 2019 -0800
@@ -81,6 +81,7 @@
 
 class GCTaskQueue;
 class ThreadClosure;
+class ICRefillVerifier;
 class IdealGraphPrinter;
 
 class Metadata;
@@ -329,15 +330,15 @@
  private:
 
 #ifdef ASSERT
-  void* _missed_ic_stub_refill_mark;
+  ICRefillVerifier* _missed_ic_stub_refill_verifier;
 
  public:
-  void* missed_ic_stub_refill_mark() {
-    return _missed_ic_stub_refill_mark;
+  ICRefillVerifier* missed_ic_stub_refill_verifier() {
+    return _missed_ic_stub_refill_verifier;
   }
 
-  void set_missed_ic_stub_refill_mark(void* mark) {
-    _missed_ic_stub_refill_mark = mark;
+  void set_missed_ic_stub_refill_verifier(ICRefillVerifier* verifier) {
+    _missed_ic_stub_refill_verifier = verifier;
   }
 #endif
 
--- a/src/hotspot/share/runtime/vframe.cpp	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/hotspot/share/runtime/vframe.cpp	Tue Jan 15 10:55:26 2019 -0800
@@ -452,8 +452,10 @@
   _stop_at_java_call_stub = stop_at_java_call_stub;
 
   // skip top frame, as it may not be at safepoint
+  _prev_frame = top_frame;
   _frame  = top_frame.sender(&_reg_map);
   while (!fill_from_frame()) {
+    _prev_frame = _frame;
     _frame = _frame.sender(&_reg_map);
   }
 }
@@ -534,6 +536,37 @@
   }
 }
 
+javaVFrame* vframeStreamCommon::asJavaVFrame() {
+  javaVFrame* result = NULL;
+  if (_mode == compiled_mode) {
+    guarantee(_frame.is_compiled_frame(), "expected compiled Java frame");
+
+    // lazy update to register map
+    bool update_map = true;
+    RegisterMap map(_thread, update_map);
+    frame f = _prev_frame.sender(&map);
+
+    guarantee(f.is_compiled_frame(), "expected compiled Java frame");
+
+    compiledVFrame* cvf = compiledVFrame::cast(vframe::new_vframe(&f, &map, _thread));
+
+    guarantee(cvf->cb() == cb(), "wrong code blob");
+
+    // get the same scope as this stream
+    cvf = cvf->at_scope(_decode_offset, _vframe_id);
+
+    guarantee(cvf->scope()->decode_offset() == _decode_offset, "wrong scope");
+    guarantee(cvf->scope()->sender_decode_offset() == _sender_decode_offset, "wrong scope");
+    guarantee(cvf->vframe_id() == _vframe_id, "wrong vframe");
+
+    result = cvf;
+  } else {
+    result = javaVFrame::cast(vframe::new_vframe(&_frame, &_reg_map, _thread));
+  }
+  guarantee(result->method() == method(), "wrong method");
+  return result;
+}
+
 
 #ifndef PRODUCT
 void vframe::print() {
--- a/src/hotspot/share/runtime/vframe.hpp	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/hotspot/share/runtime/vframe.hpp	Tue Jan 15 10:55:26 2019 -0800
@@ -278,12 +278,16 @@
 class vframeStreamCommon : StackObj {
  protected:
   // common
+  frame        _prev_frame;
   frame        _frame;
   JavaThread*  _thread;
   RegisterMap  _reg_map;
   enum { interpreted_mode, compiled_mode, at_end_mode } _mode;
 
+  // For compiled_mode
+  int _decode_offset;
   int _sender_decode_offset;
+  int _vframe_id;
 
   // Cached information
   Method* _method;
@@ -320,6 +324,8 @@
       return (CompiledMethod*) cb();
   }
 
+  javaVFrame* asJavaVFrame();
+
   // Frame type
   inline bool is_interpreted_frame() const;
   inline bool is_entry_frame() const;
--- a/src/hotspot/share/runtime/vframe.inline.hpp	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/hotspot/share/runtime/vframe.inline.hpp	Tue Jan 15 10:55:26 2019 -0800
@@ -44,6 +44,7 @@
 
   // handle general case
   do {
+    _prev_frame = _frame;
     _frame = _frame.sender(&_reg_map);
   } while (!fill_from_frame());
 }
@@ -59,6 +60,7 @@
 
   _frame = _thread->last_frame();
   while (!fill_from_frame()) {
+    _prev_frame = _frame;
     _frame = _frame.sender(&_reg_map);
   }
 }
@@ -68,12 +70,14 @@
     return false;
   }
   fill_from_compiled_frame(_sender_decode_offset);
+  ++_vframe_id;
   return true;
 }
 
 
 inline void vframeStreamCommon::fill_from_compiled_frame(int decode_offset) {
   _mode = compiled_mode;
+  _decode_offset = decode_offset;
 
   // Range check to detect ridiculous offsets.
   if (decode_offset == DebugInformationRecorder::serialized_null ||
@@ -118,6 +122,8 @@
 inline void vframeStreamCommon::fill_from_compiled_native_frame() {
   _mode = compiled_mode;
   _sender_decode_offset = DebugInformationRecorder::serialized_null;
+  _decode_offset = DebugInformationRecorder::serialized_null;
+  _vframe_id = 0;
   _method = nm()->method();
   _bci = 0;
 }
@@ -187,6 +193,7 @@
         decode_offset = pc_desc->scope_decode_offset();
       }
       fill_from_compiled_frame(decode_offset);
+      _vframe_id = 0;
     }
     return true;
   }
--- a/src/hotspot/share/runtime/vframe_hp.cpp	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/hotspot/share/runtime/vframe_hp.cpp	Tue Jan 15 10:55:26 2019 -0800
@@ -252,6 +252,14 @@
   guarantee(_scope != NULL, "scope must be present");
 }
 
+compiledVFrame* compiledVFrame::at_scope(int decode_offset, int vframe_id) {
+  if (scope()->decode_offset() != decode_offset) {
+    ScopeDesc* scope = this->scope()->at_offset(decode_offset);
+    return new compiledVFrame(frame_pointer(), register_map(), thread(), scope, vframe_id);
+  }
+  assert(_vframe_id == vframe_id, "wrong frame id");
+  return this;
+}
 
 bool compiledVFrame::is_top() const {
   // FIX IT: Remove this when new native stubs are in place
--- a/src/hotspot/share/runtime/vframe_hp.hpp	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/hotspot/share/runtime/vframe_hp.hpp	Tue Jan 15 10:55:26 2019 -0800
@@ -72,6 +72,9 @@
   // Returns the scopeDesc
   ScopeDesc* scope() const { return _scope; }
 
+  // Return the compiledVFrame for the desired scope
+  compiledVFrame* at_scope(int decode_offset, int vframe_id);
+
   // Returns SynchronizationEntryBCI or bci() (used for synchronization)
   int raw_bci() const;
 
--- a/src/hotspot/share/runtime/vmThread.cpp	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/hotspot/share/runtime/vmThread.cpp	Tue Jan 15 10:55:26 2019 -0800
@@ -206,7 +206,7 @@
   if (is_armed()) {
     jlong delay = (os::javaTimeMillis() - _arm_time);
     if (delay > AbortVMOnVMOperationTimeoutDelay) {
-      fatal("VM operation took too long: " SIZE_FORMAT " ms (timeout: " SIZE_FORMAT " ms)",
+      fatal("VM operation took too long: " JLONG_FORMAT " ms (timeout: " INTX_FORMAT " ms)",
             delay, AbortVMOnVMOperationTimeoutDelay);
     }
   }
--- a/src/java.base/share/classes/java/lang/Class.java	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/java.base/share/classes/java/lang/Class.java	Tue Jan 15 10:55:26 2019 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1994, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1994, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -3420,8 +3420,8 @@
         StringBuilder sb = new StringBuilder();
         sb.append(getName() + "." + name + "(");
         if (argTypes != null) {
-            Stream.of(argTypes).map(c -> {return (c == null) ? "null" : c.getName();}).
-                collect(Collectors.joining(","));
+            sb.append(Stream.of(argTypes).map(c -> {return (c == null) ? "null" : c.getName();}).
+                      collect(Collectors.joining(",")));
         }
         sb.append(")");
         return sb.toString();
--- a/src/java.base/share/classes/java/lang/ClassLoader.java	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/java.base/share/classes/java/lang/ClassLoader.java	Tue Jan 15 10:55:26 2019 -0800
@@ -1864,12 +1864,12 @@
      * <p> The default system class loader is an implementation-dependent
      * instance of this class.
      *
-     * <p> If the system property "{@code java.system.class.loader}" is defined
-     * when this method is first invoked then the value of that property is
-     * taken to be the name of a class that will be returned as the system
-     * class loader.  The class is loaded using the default system class loader
-     * and must define a public constructor that takes a single parameter of
-     * type {@code ClassLoader} which is used as the delegation parent.  An
+     * <p> If the system property "{@systemProperty java.system.class.loader}"
+     * is defined when this method is first invoked then the value of that
+     * property is taken to be the name of a class that will be returned as the
+     * system class loader. The class is loaded using the default system class
+     * loader and must define a public constructor that takes a single parameter
+     * of type {@code ClassLoader} which is used as the delegation parent. An
      * instance is then created using this constructor with the default system
      * class loader as the parameter.  The resulting class loader is defined
      * to be the system class loader. During construction, the class loader
--- a/src/java.base/share/classes/java/lang/String.java	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/java.base/share/classes/java/lang/String.java	Tue Jan 15 10:55:26 2019 -0800
@@ -664,7 +664,7 @@
      *          object.
      */
     public int length() {
-        return isLatin1() ? value.length : value.length >> UTF16;
+        return value.length >> coder();
     }
 
     /**
@@ -2813,8 +2813,7 @@
      * lines are then concatenated and returned.
      * <p>
      * If {@code n > 0} then {@code n} spaces (U+0020) are inserted at the
-     * beginning of each line. {@link String#isBlank() Blank lines} are
-     * unaffected.
+     * beginning of each line.
      * <p>
      * If {@code n < 0} then up to {@code n}
      * {@link Character#isWhitespace(int) white space characters} are removed
@@ -2849,7 +2848,7 @@
                                              : lines();
         if (n > 0) {
             final String spaces = " ".repeat(n);
-            stream = stream.map(s -> s.isBlank() ? s : spaces + s);
+            stream = stream.map(s -> spaces + s);
         } else if (n == Integer.MIN_VALUE) {
             stream = stream.map(s -> s.stripLeading());
         } else if (n < 0) {
@@ -2869,119 +2868,12 @@
     }
 
     /**
-     * Removes vertical and horizontal white space margins from around the
-     * essential body of a multi-line string, while preserving relative
-     * indentation.
-     * <p>
-     * This string is first conceptually separated into lines as if by
-     * {@link String#lines()}.
-     * <p>
-     * Then, the <i>minimum indentation</i> (min) is determined as follows. For
-     * each non-blank line (as defined by {@link String#isBlank()}), the
-     * leading {@link Character#isWhitespace(int) white space} characters are
-     * counted. The <i>min</i> value is the smallest of these counts.
-     * <p>
-     * For each non-blank line, <i>min</i> leading white space characters are
-     * removed. Each white space character is treated as a single character. In
-     * particular, the tab character {@code "\t"} (U+0009) is considered a
-     * single character; it is not expanded.
-     * <p>
-     * Leading and trailing blank lines, if any, are removed. Trailing spaces are
-     * preserved.
-     * <p>
-     * Each line is suffixed with a line feed character {@code "\n"} (U+000A).
-     * <p>
-     * Finally, the lines are concatenated into a single string and returned.
-     *
-     * @apiNote
-     * This method's primary purpose is to shift a block of lines as far as
-     * possible to the left, while preserving relative indentation. Lines
-     * that were indented the least will thus have no leading white space.
-     *
-     * Example:
-     * <blockquote><pre>
-     * `
-     *      This is the first line
-     *          This is the second line
-     * `.align();
-     *
-     * returns
-     * This is the first line
-     *     This is the second line
-     * </pre></blockquote>
-     *
-     * @return string with margins removed and line terminators normalized
-     *
-     * @see String#lines()
-     * @see String#isBlank()
-     * @see String#indent(int)
-     * @see Character#isWhitespace(int)
-     *
-     * @since 12
-     */
-    public String align() {
-        return align(0);
-    }
-
-    /**
-     * Removes vertical and horizontal white space margins from around the
-     * essential body of a multi-line string, while preserving relative
-     * indentation and with optional indentation adjustment.
-     * <p>
-     * Invoking this method is equivalent to:
-     * <blockquote>
-     *  {@code this.align().indent(n)}
-     * </blockquote>
-     *
-     * @apiNote
-     * Examples:
-     * <blockquote><pre>
-     * `
-     *      This is the first line
-     *          This is the second line
-     * `.align(0);
-     *
-     * returns
-     * This is the first line
-     *     This is the second line
-     *
-     *
-     * `
-     *    This is the first line
-     *       This is the second line
-     * `.align(4);
-     * returns
-     *     This is the first line
-     *         This is the second line
-     * </pre></blockquote>
-     *
-     * @param n  number of leading white space characters
-     *           to add or remove
-     *
-     * @return string with margins removed, indentation adjusted and
-     *         line terminators normalized
-     *
-     * @see String#align()
-     *
-     * @since 12
-     */
-    public String align(int n) {
-        if (isEmpty()) {
-            return "";
-        }
-        int outdent = lines().filter(not(String::isBlank))
-                             .mapToInt(String::indexOfNonWhitespace)
-                             .min()
-                             .orElse(0);
-        // overflow-conscious code
-        int indent = n - outdent;
-        return indent(indent > n ? Integer.MIN_VALUE : indent, true);
-    }
-
-    /**
      * This method allows the application of a function to {@code this}
      * string. The function should expect a single String argument
      * and produce an {@code R} result.
+     * <p>
+     * Any exception thrown by {@code f()} will be propagated to the
+     * caller.
      *
      * @param f    functional interface to a apply
      *
--- a/src/java.base/share/classes/java/lang/constant/ClassDesc.java	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/java.base/share/classes/java/lang/constant/ClassDesc.java	Tue Jan 15 10:55:26 2019 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -97,7 +97,10 @@
      */
     static ClassDesc of(String packageName, String className) {
         ConstantUtils.validateBinaryClassName(requireNonNull(packageName));
-        validateMemberName(requireNonNull(className));
+        if (packageName.isEmpty()) {
+            return of(className);
+        }
+        validateMemberName(requireNonNull(className), false);
         return ofDescriptor(String.format("L%s%s%s;",
                                           binaryToInternal(packageName),
                                           (packageName.length() > 0 ? "/" : ""),
@@ -130,6 +133,9 @@
      */
     static ClassDesc ofDescriptor(String descriptor) {
         requireNonNull(descriptor);
+        if (descriptor.isEmpty()) {
+            throw new IllegalArgumentException(String.format("not a valid reference type descriptor: %s", descriptor));
+        }
         int depth = ConstantUtils.arrayDepth(descriptor);
         if (depth > ConstantUtils.MAX_ARRAY_TYPE_DESC_DIMENSIONS) {
             throw new IllegalArgumentException(String.format("Cannot create an array type descriptor with more than %d dimensions",
@@ -192,7 +198,7 @@
      * @throws IllegalArgumentException if the nested class name is invalid
      */
     default ClassDesc nested(String nestedName) {
-        validateMemberName(nestedName);
+        validateMemberName(nestedName, false);
         if (!isClassOrInterface())
             throw new IllegalStateException("Outer class is not a class or interface type");
         return ClassDesc.ofDescriptor(String.format("%s$%s;", dropLastChar(descriptorString()), nestedName));
--- a/src/java.base/share/classes/java/lang/constant/ConstantUtils.java	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/java.base/share/classes/java/lang/constant/ConstantUtils.java	Tue Jan 15 10:55:26 2019 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -65,7 +65,7 @@
      * @return the name passed if valid
      * @throws IllegalArgumentException if the member name is invalid
      */
-    public static String validateMemberName(String name) {
+    public static String validateMemberName(String name, boolean method) {
         requireNonNull(name);
         if (name.length() == 0)
             throw new IllegalArgumentException("zero-length member name");
@@ -73,7 +73,7 @@
             char ch = name.charAt(i);
             if (ch == '.' || ch == ';' || ch == '[' || ch == '/')
                 throw new IllegalArgumentException("Invalid member name: " + name);
-            if (ch == '<' || ch == '>') {
+            if (method && (ch == '<' || ch == '>')) {
                 if (!pointyNames.contains(name))
                     throw new IllegalArgumentException("Invalid member name: " + name);
             }
@@ -126,8 +126,8 @@
 
         ++cur;  // skip '('
         while (cur < end && descriptor.charAt(cur) != ')') {
-            int len = matchSig(descriptor, cur, end);
-            if (len == 0 || descriptor.charAt(cur) == 'V')
+            int len = skipOverFieldSignature(descriptor, cur, end, false);
+            if (len == 0)
                 throw new IllegalArgumentException("Bad method descriptor: " + descriptor);
             ptypes.add(descriptor.substring(cur, cur + len));
             cur += len;
@@ -136,41 +136,103 @@
             throw new IllegalArgumentException("Bad method descriptor: " + descriptor);
         ++cur;  // skip ')'
 
-        int rLen = matchSig(descriptor, cur, end);
+        int rLen = skipOverFieldSignature(descriptor, cur, end, true);
         if (rLen == 0 || cur + rLen != end)
             throw new IllegalArgumentException("Bad method descriptor: " + descriptor);
         ptypes.add(0, descriptor.substring(cur, cur + rLen));
         return ptypes;
     }
 
+    private static final char JVM_SIGNATURE_ARRAY = '[';
+    private static final char JVM_SIGNATURE_BYTE = 'B';
+    private static final char JVM_SIGNATURE_CHAR = 'C';
+    private static final char JVM_SIGNATURE_CLASS = 'L';
+    private static final char JVM_SIGNATURE_ENDCLASS = ';';
+    private static final char JVM_SIGNATURE_ENUM = 'E';
+    private static final char JVM_SIGNATURE_FLOAT = 'F';
+    private static final char JVM_SIGNATURE_DOUBLE = 'D';
+    private static final char JVM_SIGNATURE_FUNC = '(';
+    private static final char JVM_SIGNATURE_ENDFUNC = ')';
+    private static final char JVM_SIGNATURE_INT = 'I';
+    private static final char JVM_SIGNATURE_LONG = 'J';
+    private static final char JVM_SIGNATURE_SHORT = 'S';
+    private static final char JVM_SIGNATURE_VOID = 'V';
+    private static final char JVM_SIGNATURE_BOOLEAN = 'Z';
+
     /**
      * Validates that the characters at [start, end) within the provided string
      * describe a valid field type descriptor.
-     *
-     * @param str the descriptor string
+     * @param descriptor the descriptor string
      * @param start the starting index into the string
      * @param end the ending index within the string
+     * @param voidOK is void acceptable?
      * @return the length of the descriptor, or 0 if it is not a descriptor
      * @throws IllegalArgumentException if the descriptor string is not valid
      */
-    static int matchSig(String str, int start, int end) {
-        if (start >= end || start >= str.length() || end > str.length())
-            return 0;
-        char c = str.charAt(start);
-        if (c == 'L') {
-            int endc = str.indexOf(';', start);
-            int badc = str.indexOf('.', start);
-            if (badc >= 0 && badc < endc)
-                return 0;
-            badc = str.indexOf('[', start);
-            if (badc >= 0 && badc < endc)
-                return 0;
-            return (endc < 0) ? 0 : endc - start + 1;
-        } else if (c == '[') {
-            int t = matchSig(str, start+1, end);
-            return (t > 0) ? t + 1 : 0;
-        } else {
-            return ("IJCSBFDZV".indexOf(c) >= 0) ? 1 : 0;
+    @SuppressWarnings("fallthrough")
+    static int skipOverFieldSignature(String descriptor, int start, int end, boolean voidOK) {
+        int arrayDim = 0;
+        int index = start;
+        while (index < end) {
+            switch (descriptor.charAt(index)) {
+                case JVM_SIGNATURE_VOID: if (!voidOK) { return index; }
+                case JVM_SIGNATURE_BOOLEAN:
+                case JVM_SIGNATURE_BYTE:
+                case JVM_SIGNATURE_CHAR:
+                case JVM_SIGNATURE_SHORT:
+                case JVM_SIGNATURE_INT:
+                case JVM_SIGNATURE_FLOAT:
+                case JVM_SIGNATURE_LONG:
+                case JVM_SIGNATURE_DOUBLE:
+                    return index - start + 1;
+                case JVM_SIGNATURE_CLASS:
+                    // Skip leading 'L' and ignore first appearance of ';'
+                    index++;
+                    int indexOfSemi = descriptor.indexOf(';', index);
+                    if (indexOfSemi != -1) {
+                        String unqualifiedName = descriptor.substring(index, indexOfSemi);
+                        boolean legal = verifyUnqualifiedClassName(unqualifiedName);
+                        if (!legal) {
+                            return 0;
+                        }
+                        return index - start + unqualifiedName.length() + 1;
+                    }
+                    return 0;
+                case JVM_SIGNATURE_ARRAY:
+                    arrayDim++;
+                    if (arrayDim > MAX_ARRAY_TYPE_DESC_DIMENSIONS) {
+                        throw new IllegalArgumentException(String.format("Cannot create an array type descriptor with more than %d dimensions",
+                                ConstantUtils.MAX_ARRAY_TYPE_DESC_DIMENSIONS));
+                    }
+                    // The rest of what's there better be a legal descriptor
+                    index++;
+                    voidOK = false;
+                    break;
+                default:
+                    return 0;
+            }
         }
+        return 0;
+    }
+
+    static boolean verifyUnqualifiedClassName(String name) {
+        for (int index = 0; index < name.length(); index++) {
+            char ch = name.charAt(index);
+            if (ch < 128) {
+                if (ch == '.' || ch == ';' || ch == '[' ) {
+                    return false;   // do not permit '.', ';', or '['
+                }
+                if (ch == '/') {
+                    // check for '//' or leading or trailing '/' which are not legal
+                    // unqualified name must not be empty
+                    if (index == 0 || index + 1 >= name.length() || name.charAt(index + 1) == '/') {
+                        return false;
+                    }
+                }
+            } else {
+                index ++;
+            }
+        }
+        return true;
     }
 }
--- a/src/java.base/share/classes/java/lang/constant/DirectMethodHandleDescImpl.java	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/java.base/share/classes/java/lang/constant/DirectMethodHandleDescImpl.java	Tue Jan 15 10:55:26 2019 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -68,7 +68,7 @@
 
         requireNonNull(kind);
         validateClassOrInterface(requireNonNull(owner));
-        validateMemberName(requireNonNull(name));
+        validateMemberName(requireNonNull(name), true);
         requireNonNull(type);
 
         switch (kind) {
--- a/src/java.base/share/classes/java/lang/constant/DynamicCallSiteDesc.java	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/java.base/share/classes/java/lang/constant/DynamicCallSiteDesc.java	Tue Jan 15 10:55:26 2019 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -75,7 +75,7 @@
                                 String invocationName,
                                 MethodTypeDesc invocationType,
                                 ConstantDesc[] bootstrapArgs) {
-        this.invocationName = validateMemberName(requireNonNull(invocationName));
+        this.invocationName = validateMemberName(requireNonNull(invocationName), true);
         this.invocationType = requireNonNull(invocationType);
         this.bootstrapMethod = requireNonNull(bootstrapMethod);
         this.bootstrapArgs = requireNonNull(bootstrapArgs.clone());
--- a/src/java.base/share/classes/java/lang/constant/DynamicConstantDesc.java	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/java.base/share/classes/java/lang/constant/DynamicConstantDesc.java	Tue Jan 15 10:55:26 2019 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -96,7 +96,7 @@
                                   ClassDesc constantType,
                                   ConstantDesc... bootstrapArgs) {
         this.bootstrapMethod = requireNonNull(bootstrapMethod);
-        this.constantName = validateMemberName(requireNonNull(constantName));
+        this.constantName = validateMemberName(requireNonNull(constantName), true);
         this.constantType = requireNonNull(constantType);
         this.bootstrapArgs = requireNonNull(bootstrapArgs).clone();
 
--- a/src/java.base/share/classes/java/lang/constant/ReferenceClassDescImpl.java	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/java.base/share/classes/java/lang/constant/ReferenceClassDescImpl.java	Tue Jan 15 10:55:26 2019 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -49,7 +49,7 @@
      */
     ReferenceClassDescImpl(String descriptor) {
         requireNonNull(descriptor);
-        int len = ConstantUtils.matchSig(descriptor, 0, descriptor.length());
+        int len = ConstantUtils.skipOverFieldSignature(descriptor, 0, descriptor.length(), false);
         if (len == 0 || len == 1
             || len != descriptor.length())
             throw new IllegalArgumentException(String.format("not a valid reference type descriptor: %s", descriptor));
--- a/src/java.base/share/classes/java/lang/invoke/VarHandle.java	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/java.base/share/classes/java/lang/invoke/VarHandle.java	Tue Jan 15 10:55:26 2019 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -1865,35 +1865,6 @@
     }
 
     /**
-     * Compare this {@linkplain VarHandle} with another object for equality.
-     * Two {@linkplain VarHandle}s are considered equal if they both describe the
-     * same instance field, both describe the same static field, both describe
-     * array elements for arrays with the same component type, or both describe
-     * the same component of an off-heap structure.
-     *
-     * @param o the other object
-     * @return Whether this {@linkplain VarHandle} is equal to the other object
-     */
-    @Override
-    public final boolean equals(Object o) {
-        if (this == o) return true;
-        if (o == null || getClass() != o.getClass()) return false;
-
-        VarHandle that = (VarHandle) o;
-        return accessModeType(AccessMode.GET).equals(that.accessModeType(AccessMode.GET)) &&
-               internalEquals(that);
-    }
-
-    abstract boolean internalEquals(VarHandle vh);
-
-    @Override
-    public final int hashCode() {
-        return 31 * accessModeType(AccessMode.GET).hashCode() + internalHashCode();
-    }
-
-    abstract int internalHashCode();
-
-    /**
      * Returns a compact textual description of this {@linkplain VarHandle},
      * including the type of variable described, and a description of its coordinates.
      *
--- a/src/java.base/share/classes/java/lang/invoke/X-VarHandle.java.template	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/java.base/share/classes/java/lang/invoke/X-VarHandle.java.template	Tue Jan 15 10:55:26 2019 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -64,17 +64,6 @@
         }
 
         @Override
-        final boolean internalEquals(VarHandle vh) {
-            FieldInstanceReadOnly that = (FieldInstanceReadOnly) vh;
-            return fieldOffset == that.fieldOffset;
-        }
-
-        @Override
-        final int internalHashCode() {
-            return Long.hashCode(fieldOffset);
-        }
-
-        @Override
         public Optional<VarHandleDesc> describeConstable() {
             var receiverTypeRef = receiverType.describeConstable();
             var fieldTypeRef = {#if[Object]?fieldType:$type$.class}.describeConstable();
@@ -350,17 +339,6 @@
         }
 
         @Override
-        final boolean internalEquals(VarHandle vh) {
-            FieldStaticReadOnly that = (FieldStaticReadOnly) vh;
-            return base == that.base && fieldOffset == that.fieldOffset;
-        }
-
-        @Override
-        final int internalHashCode() {
-            return 31 * Long.hashCode(fieldOffset) + base.hashCode();
-        }
-
-        @Override
         public Optional<VarHandleDesc> describeConstable() {
             var fieldTypeRef = {#if[Object]?fieldType:$type$.class}.describeConstable();
             if (!fieldTypeRef.isPresent())
@@ -640,20 +618,6 @@
         }
 
         @Override
-        final boolean internalEquals(VarHandle vh) {
-            // Equality of access mode types of AccessMode.GET is sufficient for
-            // equality checks
-            return true;
-        }
-
-        @Override
-        final int internalHashCode() {
-            // The hash code of the access mode types of AccessMode.GET is
-            // sufficient for hash code generation
-            return 0;
-        }
-
-        @Override
         public Optional<VarHandleDesc> describeConstable() {
             var arrayTypeRef = {#if[Object]?arrayType:$type$[].class}.describeConstable();
             if (!arrayTypeRef.isPresent())
--- a/src/java.base/share/classes/java/lang/invoke/X-VarHandleByteArrayView.java.template	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/java.base/share/classes/java/lang/invoke/X-VarHandleByteArrayView.java.template	Tue Jan 15 10:55:26 2019 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -67,17 +67,6 @@
             super(form);
             this.be = be;
         }
-
-        @Override
-        final boolean internalEquals(VarHandle vh) {
-            ByteArrayViewVarHandle that = (ByteArrayViewVarHandle) vh;
-            return be == that.be;
-        }
-
-        @Override
-        final int internalHashCode() {
-            return Boolean.hashCode(be);
-        }
     }
 
     static final class ArrayHandle extends ByteArrayViewVarHandle {
--- a/src/java.base/share/classes/java/net/URL.java	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/java.base/share/classes/java/net/URL.java	Tue Jan 15 10:55:26 2019 -0800
@@ -304,7 +304,7 @@
      *     or all providers have been exhausted.
      * <li>If the previous step fails to find a protocol handler, the
      *     constructor reads the value of the system property:
-     *     <blockquote>{@code
+     *     <blockquote>{@systemProperty
      *         java.protocol.handler.pkgs
      *     }</blockquote>
      *     If the value of that system property is not {@code null},
--- a/src/java.base/share/classes/java/security/AccessController.java	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/java.base/share/classes/java/security/AccessController.java	Tue Jan 15 10:55:26 2019 -0800
@@ -710,6 +710,13 @@
     }
 
     /**
+     * The value needs to be physically located in the frame, so that it
+     * can be found by a stack walk.
+     */
+    @Hidden
+    private static native void ensureMaterializedForStackWalk(Object o);
+
+    /**
      * Sanity check that the caller context is indeed privileged.
      *
      * Used by executePrivileged to make sure the frame is properly
@@ -734,6 +741,11 @@
                           AccessControlContext context,
                           Class<?> caller)
     {
+        // Ensure context has a physical value in the frame
+        if (context != null) {
+            ensureMaterializedForStackWalk(context);
+        }
+
         assert isPrivileged(); // sanity check invariant
         T result = action.run();
         assert isPrivileged(); // sanity check invariant
@@ -742,7 +754,6 @@
         // retrieved by getStackAccessControlContext().
         Reference.reachabilityFence(context);
         Reference.reachabilityFence(caller);
-        Reference.reachabilityFence(action);
         return result;
     }
 
@@ -761,6 +772,11 @@
                           Class<?> caller)
         throws Exception
     {
+        // Ensure context has a physical value in the frame
+        if (context != null) {
+            ensureMaterializedForStackWalk(context);
+        }
+
         assert isPrivileged(); // sanity check invariant
         T result = action.run();
         assert isPrivileged(); // sanity check invariant
@@ -769,7 +785,6 @@
         // retrieved by getStackAccessControlContext().
         Reference.reachabilityFence(context);
         Reference.reachabilityFence(caller);
-        Reference.reachabilityFence(action);
         return result;
     }
 
--- a/src/java.base/share/classes/java/time/chrono/JapaneseEra.java	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/java.base/share/classes/java/time/chrono/JapaneseEra.java	Tue Jan 15 10:55:26 2019 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -94,7 +94,7 @@
  * dates before Meiji 6, January 1 are not supported.
  * The number of the valid eras may increase, as new eras may be
  * defined by the Japanese government. Once an era is defined,
- * subsequent versions of this class will add a singleton instance
+ * future versions of the platform may add a singleton instance
  * for it. The defined era is expected to have a consecutive integer
  * associated with it.
  *
--- a/src/java.base/share/classes/java/time/zone/ZoneRulesProvider.java	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/java.base/share/classes/java/time/zone/ZoneRulesProvider.java	Tue Jan 15 10:55:26 2019 -0800
@@ -99,7 +99,7 @@
  * <p>
  * The Java virtual machine has a default provider that provides zone rules
  * for the time-zones defined by IANA Time Zone Database (TZDB). If the system
- * property {@code java.time.zone.DefaultZoneRulesProvider} is defined then
+ * property {@systemProperty java.time.zone.DefaultZoneRulesProvider} is defined then
  * it is taken to be the fully-qualified name of a concrete ZoneRulesProvider
  * class to be loaded as the default provider, using the system class loader.
  * If this system property is not defined, a system-default provider will be
--- a/src/java.base/share/classes/java/util/Currency.java	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/java.base/share/classes/java/util/Currency.java	Tue Jan 15 10:55:26 2019 -0800
@@ -60,7 +60,7 @@
  * the <code>getInstance</code> methods.
  * <p>
  * Users can supersede the Java runtime currency data by means of the system
- * property {@code java.util.currency.data}. If this system property is
+ * property {@systemProperty java.util.currency.data}. If this system property is
  * defined then its value is the location of a properties file, the contents of
  * which are key/value pairs of the ISO 3166 country codes and the ISO 4217
  * currency data respectively.  The value part consists of three ISO 4217 values
--- a/src/java.base/share/classes/java/util/PropertyResourceBundle.java	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/java.base/share/classes/java/util/PropertyResourceBundle.java	Tue Jan 15 10:55:26 2019 -0800
@@ -115,7 +115,7 @@
  * input stream, then the {@code PropertyResourceBundle} instance resets to the state
  * before the exception, re-reads the input stream in {@code ISO-8859-1}, and
  * continues reading. If the system property
- * {@code java.util.PropertyResourceBundle.encoding} is set to either
+ * {@systemProperty java.util.PropertyResourceBundle.encoding} is set to either
  * "ISO-8859-1" or "UTF-8", the input stream is solely read in that encoding,
  * and throws the exception if it encounters an invalid sequence.
  * If "ISO-8859-1" is specified, characters that cannot be represented in
--- a/src/java.base/share/classes/java/util/jar/Manifest.java	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/java.base/share/classes/java/util/jar/Manifest.java	Tue Jan 15 10:55:26 2019 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -58,14 +58,10 @@
     // associated JarVerifier, not null when called by JarFile::getManifest.
     private final JarVerifier jv;
 
-    // name of the corresponding jar archive if available.
-    private final String jarFilename;
-
     /**
      * Constructs a new, empty Manifest.
      */
     public Manifest() {
-        jarFilename = null;
         jv = null;
     }
 
@@ -84,7 +80,7 @@
      *
      * @param is the input stream containing manifest data
      * @param jarFilename the name of the corresponding jar archive if available
-     * @throws IOException if an I/O error has occured
+     * @throws IOException if an I/O error has occurred
      */
     Manifest(InputStream is, String jarFilename) throws IOException {
         this(null, is, jarFilename);
@@ -93,10 +89,14 @@
     /**
      * Constructs a new Manifest from the specified input stream
      * and associates it with a JarVerifier.
+     *
+     * @param jv the JarVerifier to use
+     * @param is the input stream containing manifest data
+     * @param jarFilename the name of the corresponding jar archive if available
+     * @throws IOException if an I/O error has occurred
      */
     Manifest(JarVerifier jv, InputStream is, String jarFilename) throws IOException {
-        read(is);
-        this.jarFilename = jarFilename;
+        read(is, jarFilename);
         this.jv = jv;
     }
 
@@ -108,7 +108,6 @@
     public Manifest(Manifest man) {
         attr.putAll(man.getMainAttributes());
         entries.putAll(man.getEntries());
-        jarFilename = null;
         jv = man.jv;
     }
 
@@ -250,6 +249,10 @@
      * @exception IOException if an I/O error has occurred
      */
     public void read(InputStream is) throws IOException {
+        read(is, null);
+    }
+
+    private void read(InputStream is, String jarFilename) throws IOException {
         // Buffered input stream for reading manifest data
         FastInputStream fis = new FastInputStream(is);
         // Line buffer
@@ -285,7 +288,7 @@
             if (name == null) {
                 name = parseName(lbuf, len);
                 if (name == null) {
-                    throw new IOException("invalid manifest format"
+                    throw new IOException("invalid manifest format ("
                               + getErrorPosition(jarFilename, lineNumber) + ")");
                 }
                 if (fis.peek() == ' ') {
--- a/src/java.base/share/classes/java/util/jar/Pack200.java	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/java.base/share/classes/java/util/jar/Pack200.java	Tue Jan 15 10:55:26 2019 -0800
@@ -112,7 +112,7 @@
     /**
      * Obtain new instance of a class that implements Packer.
      * <ul>
-     * <li><p>If the system property {@code java.util.jar.Pack200.Packer}
+     * <li><p>If the system property {@systemProperty java.util.jar.Pack200.Packer}
      * is defined, then the value is taken to be the fully-qualified name
      * of a concrete implementation class, which must implement Packer.
      * This class is loaded and instantiated.  If this process fails
@@ -138,7 +138,7 @@
     /**
      * Obtain new instance of a class that implements Unpacker.
      * <ul>
-     * <li><p>If the system property {@code java.util.jar.Pack200.Unpacker}
+     * <li><p>If the system property {@systemProperty java.util.jar.Pack200.Unpacker}
      * is defined, then the value is taken to be the fully-qualified
      * name of a concrete implementation class, which must implement Unpacker.
      * The class is loaded and instantiated.  If this process fails
--- a/src/java.base/share/classes/java/util/spi/LocaleServiceProvider.java	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/java.base/share/classes/java/util/spi/LocaleServiceProvider.java	Tue Jan 15 10:55:26 2019 -0800
@@ -113,7 +113,7 @@
  * described above as if the locale was not supported.
  * <p>
  * The search order of locale sensitive services can
- * be configured by using the "java.locale.providers" system property.
+ * be configured by using the {@systemProperty java.locale.providers} system property.
  * This system property declares the user's preferred order for looking up
  * the locale sensitive services separated by a comma. It is only read at
  * the Java runtime startup, so the later call to System.setProperty() won't
--- a/src/java.base/share/classes/sun/security/provider/certpath/DistributionPointFetcher.java	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/java.base/share/classes/sun/security/provider/certpath/DistributionPointFetcher.java	Tue Jan 15 10:55:26 2019 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2017, 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
@@ -770,7 +770,7 @@
          *
          * In practice, conforming CAs MUST use the key identifier method,
          * and MUST include authority key identifier extension in all CRLs
-         * issued. [section 5.2.1, RFC 2459]
+         * issued. [section 5.2.1, RFC 5280]
          */
         AuthorityKeyIdentifierExtension crlAKID = crl.getAuthKeyIdExtension();
         issuerSelector.setSkiAndSerialNumber(crlAKID);
--- a/src/java.base/share/classes/sun/security/provider/certpath/ForwardBuilder.java	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/java.base/share/classes/sun/security/provider/certpath/ForwardBuilder.java	Tue Jan 15 10:55:26 2019 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2016, 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
@@ -668,7 +668,7 @@
      * Verifies a matching certificate.
      *
      * This method executes the validation steps in the PKIX path
-     * validation algorithm <draft-ietf-pkix-new-part1-08.txt> which were
+     * validation algorithm, RFC 5280, which were
      * not satisfied by the selection criteria used by getCertificates()
      * to find the certs and only the steps that can be executed in a
      * forward direction (target to trust anchor). Those steps that can
--- a/src/java.base/share/classes/sun/security/ssl/Alert.java	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/java.base/share/classes/sun/security/ssl/Alert.java	Tue Jan 15 10:55:26 2019 -0800
@@ -122,11 +122,17 @@
             reason = (cause != null) ? cause.getMessage() : "";
         }
 
-        SSLException ssle = (this == UNEXPECTED_MESSAGE) ?
-                new SSLProtocolException(reason) :
-                (handshakeOnly ?
-                        new SSLHandshakeException(reason) :
-                        new SSLException(reason));
+        SSLException ssle;
+        if ((cause != null) && (cause instanceof IOException)) {
+            ssle = new SSLException(reason);
+        } else if ((this == UNEXPECTED_MESSAGE)) {
+            ssle = new SSLProtocolException(reason);
+        } else if (handshakeOnly) {
+            ssle = new SSLHandshakeException(reason);
+        } else {
+            ssle = new SSLException(reason);
+        }
+
         if (cause != null) {
             ssle.initCause(cause);
         }
@@ -187,7 +193,7 @@
             //      AlertDescription description;
             //  } Alert;
             if (m.remaining() != 2) {
-                context.fatal(Alert.ILLEGAL_PARAMETER,
+                throw context.fatal(Alert.ILLEGAL_PARAMETER,
                     "Invalid Alert message: no sufficient data");
             }
 
@@ -241,14 +247,14 @@
                 if (tc.peerUserCanceled) {
                     tc.closeOutbound();
                 } else if (tc.handshakeContext != null) {
-                    tc.fatal(Alert.UNEXPECTED_MESSAGE,
+                    throw tc.fatal(Alert.UNEXPECTED_MESSAGE,
                             "Received close_notify during handshake");
                 }
             } else if (alert == Alert.USER_CANCELED) {
                 if (level == Level.WARNING) {
                     tc.peerUserCanceled = true;
                 } else {
-                    tc.fatal(alert,
+                    throw tc.fatal(alert,
                             "Received fatal close_notify alert", true, null);
                 }
             } else if ((level == Level.WARNING) && (alert != null)) {
@@ -263,7 +269,7 @@
                             alert != Alert.NO_CERTIFICATE ||
                             (tc.sslConfig.clientAuthType !=
                                     ClientAuthType.CLIENT_AUTH_REQUESTED)) {
-                        tc.fatal(Alert.HANDSHAKE_FAILURE,
+                        throw tc.fatal(Alert.HANDSHAKE_FAILURE,
                             "received handshake warning: " + alert.description);
                     }  // Otherwise, ignore the warning
                 }   // Otherwise, ignore the warning.
@@ -276,7 +282,7 @@
                     diagnostic = "Received fatal alert: " + alert.description;
                 }
 
-                tc.fatal(alert, diagnostic, true, null);
+                throw tc.fatal(alert, diagnostic, true, null);
             }
         }
     }
--- a/src/java.base/share/classes/sun/security/ssl/AlpnExtension.java	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/java.base/share/classes/sun/security/ssl/AlpnExtension.java	Tue Jan 15 10:55:26 2019 -0800
@@ -174,7 +174,8 @@
                         SSLLogger.severe(
                                 "Application protocol name cannot be empty");
                     }
-                    chc.conContext.fatal(Alert.ILLEGAL_PARAMETER,
+
+                    throw chc.conContext.fatal(Alert.ILLEGAL_PARAMETER,
                             "Application protocol name cannot be empty");
                 }
 
@@ -189,7 +190,8 @@
                                 ") exceeds the size limit (" +
                                 MAX_AP_LENGTH + " bytes)");
                     }
-                    chc.conContext.fatal(Alert.ILLEGAL_PARAMETER,
+
+                    throw chc.conContext.fatal(Alert.ILLEGAL_PARAMETER,
                                 "Application protocol name (" + ap +
                                 ") exceeds the size limit (" +
                                 MAX_AP_LENGTH + " bytes)");
@@ -204,7 +206,8 @@
                                 ") exceed the size limit (" +
                                 MAX_AP_LIST_LENGTH + " bytes)");
                     }
-                    chc.conContext.fatal(Alert.ILLEGAL_PARAMETER,
+
+                    throw chc.conContext.fatal(Alert.ILLEGAL_PARAMETER,
                                 "The configured application protocols (" +
                                 Arrays.toString(laps) +
                                 ") exceed the size limit (" +
@@ -283,8 +286,7 @@
             try {
                 spec = new AlpnSpec(buffer);
             } catch (IOException ioe) {
-                shc.conContext.fatal(Alert.UNEXPECTED_MESSAGE, ioe);
-                return;     // fatal() always throws, make the compiler happy.
+                throw shc.conContext.fatal(Alert.UNEXPECTED_MESSAGE, ioe);
             }
 
             // Update the context.
@@ -302,7 +304,7 @@
                 }
 
                 if (!matched) {
-                    shc.conContext.fatal(Alert.NO_APPLICATION_PROTOCOL,
+                    throw shc.conContext.fatal(Alert.NO_APPLICATION_PROTOCOL,
                             "No matching application layer protocol values");
                 }
             }   // Otherwise, applicationProtocol will be set by the
@@ -379,7 +381,8 @@
                     if ((shc.applicationProtocol == null) ||
                             (!shc.applicationProtocol.isEmpty() &&
                             !alps.contains(shc.applicationProtocol))) {
-                        shc.conContext.fatal(Alert.NO_APPLICATION_PROTOCOL,
+                        throw shc.conContext.fatal(
+                            Alert.NO_APPLICATION_PROTOCOL,
                             "No matching application layer protocol values");
                     }
                 }
@@ -391,7 +394,8 @@
                     if ((shc.applicationProtocol == null) ||
                             (!shc.applicationProtocol.isEmpty() &&
                             !alps.contains(shc.applicationProtocol))) {
-                        shc.conContext.fatal(Alert.NO_APPLICATION_PROTOCOL,
+                        throw shc.conContext.fatal(
+                            Alert.NO_APPLICATION_PROTOCOL,
                             "No matching application layer protocol values");
                     }
                 }
@@ -454,7 +458,7 @@
             if (requestedAlps == null ||
                     requestedAlps.applicationProtocols == null ||
                     requestedAlps.applicationProtocols.isEmpty()) {
-                chc.conContext.fatal(Alert.UNEXPECTED_MESSAGE,
+                throw chc.conContext.fatal(Alert.UNEXPECTED_MESSAGE,
                     "Unexpected " + SSLExtension.CH_ALPN.name + " extension");
             }
 
@@ -463,13 +467,12 @@
             try {
                 spec = new AlpnSpec(buffer);
             } catch (IOException ioe) {
-                chc.conContext.fatal(Alert.UNEXPECTED_MESSAGE, ioe);
-                return;     // fatal() always throws, make the compiler happy.
+                throw chc.conContext.fatal(Alert.UNEXPECTED_MESSAGE, ioe);
             }
 
             // Only one application protocol is allowed.
             if (spec.applicationProtocols.size() != 1) {
-                chc.conContext.fatal(Alert.UNEXPECTED_MESSAGE,
+                throw chc.conContext.fatal(Alert.UNEXPECTED_MESSAGE,
                     "Invalid " + SSLExtension.CH_ALPN.name + " extension: " +
                     "Only one application protocol name " +
                     "is allowed in ServerHello message");
@@ -478,7 +481,7 @@
             // The respond application protocol must be one of the requested.
             if (!requestedAlps.applicationProtocols.containsAll(
                     spec.applicationProtocols)) {
-                chc.conContext.fatal(Alert.UNEXPECTED_MESSAGE,
+                throw chc.conContext.fatal(Alert.UNEXPECTED_MESSAGE,
                     "Invalid " + SSLExtension.CH_ALPN.name + " extension: " +
                     "Only client specified application protocol " +
                     "is allowed in ServerHello message");
--- a/src/java.base/share/classes/sun/security/ssl/CertSignAlgsExtension.java	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/java.base/share/classes/sun/security/ssl/CertSignAlgsExtension.java	Tue Jan 15 10:55:26 2019 -0800
@@ -153,8 +153,7 @@
             try {
                 spec = new SignatureSchemesSpec(buffer);
             } catch (IOException ioe) {
-                shc.conContext.fatal(Alert.UNEXPECTED_MESSAGE, ioe);
-                return;     // fatal() always throws, make the compiler happy.
+                throw shc.conContext.fatal(Alert.UNEXPECTED_MESSAGE, ioe);
             }
 
             // Update the context.
@@ -297,8 +296,7 @@
             try {
                 spec = new SignatureSchemesSpec(buffer);
             } catch (IOException ioe) {
-                chc.conContext.fatal(Alert.UNEXPECTED_MESSAGE, ioe);
-                return;     // fatal() always throws, make the compiler happy.
+                throw chc.conContext.fatal(Alert.UNEXPECTED_MESSAGE, ioe);
             }
 
             // Update the context.
--- a/src/java.base/share/classes/sun/security/ssl/CertStatusExtension.java	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/java.base/share/classes/sun/security/ssl/CertStatusExtension.java	Tue Jan 15 10:55:26 2019 -0800
@@ -606,8 +606,7 @@
             try {
                 spec = new CertStatusRequestSpec(buffer);
             } catch (IOException ioe) {
-                shc.conContext.fatal(Alert.UNEXPECTED_MESSAGE, ioe);
-                return;     // fatal() always throws, make the compiler happy.
+                throw shc.conContext.fatal(Alert.UNEXPECTED_MESSAGE, ioe);
             }
 
             // Update the context.
@@ -711,13 +710,13 @@
             CertStatusRequestSpec requestedCsr = (CertStatusRequestSpec)
                     chc.handshakeExtensions.get(CH_STATUS_REQUEST);
             if (requestedCsr == null) {
-                chc.conContext.fatal(Alert.UNEXPECTED_MESSAGE,
+                throw chc.conContext.fatal(Alert.UNEXPECTED_MESSAGE,
                     "Unexpected status_request extension in ServerHello");
             }
 
             // Parse the extension.
             if (buffer.hasRemaining()) {
-                chc.conContext.fatal(Alert.UNEXPECTED_MESSAGE,
+                throw chc.conContext.fatal(Alert.UNEXPECTED_MESSAGE,
                   "Invalid status_request extension in ServerHello message: " +
                   "the extension data must be empty");
             }
@@ -964,8 +963,7 @@
             try {
                 spec = new CertStatusRequestV2Spec(buffer);
             } catch (IOException ioe) {
-                shc.conContext.fatal(Alert.UNEXPECTED_MESSAGE, ioe);
-                return;     // fatal() always throws, make the compiler happy.
+                throw shc.conContext.fatal(Alert.UNEXPECTED_MESSAGE, ioe);
             }
 
             // Update the context.
@@ -1067,13 +1065,13 @@
             CertStatusRequestV2Spec requestedCsr = (CertStatusRequestV2Spec)
                     chc.handshakeExtensions.get(CH_STATUS_REQUEST_V2);
             if (requestedCsr == null) {
-                chc.conContext.fatal(Alert.UNEXPECTED_MESSAGE,
+                throw chc.conContext.fatal(Alert.UNEXPECTED_MESSAGE,
                     "Unexpected status_request_v2 extension in ServerHello");
             }
 
             // Parse the extension.
             if (buffer.hasRemaining()) {
-                chc.conContext.fatal(Alert.UNEXPECTED_MESSAGE,
+                throw chc.conContext.fatal(Alert.UNEXPECTED_MESSAGE,
                   "Invalid status_request_v2 extension in ServerHello: " +
                   "the extension data must be empty");
             }
@@ -1157,10 +1155,10 @@
                                 respBytes);
                 producedData = certResp.toByteArray();
             } catch (CertificateException ce) {
-                shc.conContext.fatal(Alert.BAD_CERTIFICATE,
+                throw shc.conContext.fatal(Alert.BAD_CERTIFICATE,
                         "Failed to parse server certificates", ce);
             } catch (IOException ioe) {
-                shc.conContext.fatal(Alert.BAD_CERT_STATUS_RESPONSE,
+                throw shc.conContext.fatal(Alert.BAD_CERT_STATUS_RESPONSE,
                         "Failed to parse certificate status response", ioe);
             }
 
@@ -1188,8 +1186,7 @@
             try {
                 spec = new CertStatusResponseSpec(buffer);
             } catch (IOException ioe) {
-                chc.conContext.fatal(Alert.DECODE_ERROR, ioe);
-                return;     // fatal() always throws, make the compiler happy.
+                throw chc.conContext.fatal(Alert.DECODE_ERROR, ioe);
             }
 
             if (chc.sslContext.isStaplingEnabled(true)) {
--- a/src/java.base/share/classes/sun/security/ssl/CertificateMessage.java	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/java.base/share/classes/sun/security/ssl/CertificateMessage.java	Tue Jan 15 10:55:26 2019 -0800
@@ -111,10 +111,10 @@
                     encodedCerts.add(cert.getEncoded());
                 } catch (CertificateEncodingException cee) {
                     // unlikely
-                    handshakeContext.conContext.fatal(Alert.INTERNAL_ERROR,
+                    throw handshakeContext.conContext.fatal(
+                            Alert.INTERNAL_ERROR,
                             "Could not encode certificate (" +
                             cert.getSubjectX500Principal() + ")", cee);
-                    break;
                 }
             }
 
@@ -127,7 +127,8 @@
 
             int listLen = Record.getInt24(m);
             if (listLen > m.remaining()) {
-                handshakeContext.conContext.fatal(Alert.ILLEGAL_PARAMETER,
+                throw handshakeContext.conContext.fatal(
+                    Alert.ILLEGAL_PARAMETER,
                     "Error parsing certificate message:no sufficient data");
             }
             if (listLen > 0) {
@@ -248,10 +249,8 @@
             }
 
             if (x509Possession == null) {       // unlikely
-                shc.conContext.fatal(Alert.INTERNAL_ERROR,
+                throw shc.conContext.fatal(Alert.INTERNAL_ERROR,
                     "No expected X.509 certificate for server authentication");
-
-                return null;        // make the compiler happy
             }
 
             shc.handshakeSession.setLocalPrivateKey(
@@ -375,7 +374,7 @@
                 if (shc.sslConfig.clientAuthType !=
                         ClientAuthType.CLIENT_AUTH_REQUESTED) {
                     // unexpected or require client authentication
-                    shc.conContext.fatal(Alert.BAD_CERTIFICATE,
+                    throw shc.conContext.fatal(Alert.BAD_CERTIFICATE,
                         "Empty server certificate chain");
                 } else {
                     return;
@@ -392,7 +391,7 @@
                                     new ByteArrayInputStream(encodedCert));
                 }
             } catch (CertificateException ce) {
-                shc.conContext.fatal(Alert.BAD_CERTIFICATE,
+                throw shc.conContext.fatal(Alert.BAD_CERTIFICATE,
                     "Failed to parse server certificates", ce);
             }
 
@@ -410,7 +409,7 @@
                 T12CertificateMessage certificateMessage) throws IOException {
             List<byte[]> encodedCerts = certificateMessage.encodedCertChain;
             if (encodedCerts == null || encodedCerts.isEmpty()) {
-                chc.conContext.fatal(Alert.BAD_CERTIFICATE,
+                throw chc.conContext.fatal(Alert.BAD_CERTIFICATE,
                     "Empty server certificate chain");
             }
 
@@ -424,7 +423,7 @@
                                     new ByteArrayInputStream(encodedCert));
                 }
             } catch (CertificateException ce) {
-                chc.conContext.fatal(Alert.BAD_CERTIFICATE,
+                throw chc.conContext.fatal(Alert.BAD_CERTIFICATE,
                     "Failed to parse server certificates", ce);
             }
 
@@ -443,7 +442,7 @@
                 if ((identityAlg == null || identityAlg.isEmpty()) &&
                         !isIdentityEquivalent(x509Certs[0],
                                 chc.reservedServerCerts[0])) {
-                    chc.conContext.fatal(Alert.BAD_CERTIFICATE,
+                    throw chc.conContext.fatal(Alert.BAD_CERTIFICATE,
                             "server certificate change is restricted " +
                             "during renegotiation");
                 }
@@ -639,7 +638,7 @@
                 // the certificate chain in the TLS session.
                 chc.handshakeSession.setPeerCertificates(certs);
             } catch (CertificateException ce) {
-                chc.conContext.fatal(getCertificateAlert(chc, ce), ce);
+                throw chc.conContext.fatal(getCertificateAlert(chc, ce), ce);
             }
         }
 
@@ -685,7 +684,7 @@
                             "Improper X509TrustManager implementation");
                 }
             } catch (CertificateException ce) {
-                shc.conContext.fatal(Alert.CERTIFICATE_UNKNOWN, ce);
+                throw shc.conContext.fatal(Alert.CERTIFICATE_UNKNOWN, ce);
             }
         }
 
@@ -942,22 +941,20 @@
 
             SSLPossession pos = choosePossession(shc, clientHello);
             if (pos == null) {
-                shc.conContext.fatal(Alert.HANDSHAKE_FAILURE,
+                throw shc.conContext.fatal(Alert.HANDSHAKE_FAILURE,
                         "No available authentication scheme");
-                return null;    // make the complier happy
             }
 
             if (!(pos instanceof X509Possession)) {
-                shc.conContext.fatal(Alert.HANDSHAKE_FAILURE,
+                throw shc.conContext.fatal(Alert.HANDSHAKE_FAILURE,
                         "No X.509 certificate for server authentication");
             }
 
             X509Possession x509Possession = (X509Possession)pos;
             X509Certificate[] localCerts = x509Possession.popCerts;
             if (localCerts == null || localCerts.length == 0) {
-                shc.conContext.fatal(Alert.HANDSHAKE_FAILURE,
+                throw shc.conContext.fatal(Alert.HANDSHAKE_FAILURE,
                         "No X.509 certificate for server authentication");
-                return null;    // make the complier happy
             }
 
             // update the context
@@ -969,9 +966,8 @@
             try {
                 cm = new T13CertificateMessage(shc, (new byte[0]), localCerts);
             } catch (SSLException | CertificateException ce) {
-                shc.conContext.fatal(Alert.HANDSHAKE_FAILURE,
+                throw shc.conContext.fatal(Alert.HANDSHAKE_FAILURE,
                         "Failed to produce server Certificate message", ce);
-                return null;    // make the complier happy
             }
 
             // Check the OCSP stapling extensions and attempt
@@ -1108,9 +1104,8 @@
                 cm = new T13CertificateMessage(
                         chc, chc.certRequestContext, localCerts);
             } catch (SSLException | CertificateException ce) {
-                chc.conContext.fatal(Alert.HANDSHAKE_FAILURE,
+                throw chc.conContext.fatal(Alert.HANDSHAKE_FAILURE,
                         "Failed to produce client Certificate message", ce);
-                return null;
             }
             if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) {
                 SSLLogger.fine("Produced client Certificate message", cm);
@@ -1163,7 +1158,7 @@
             if (certificateMessage.certEntries == null ||
                     certificateMessage.certEntries.isEmpty()) {
                 if (shc.sslConfig.clientAuthType == CLIENT_AUTH_REQUIRED) {
-                    shc.conContext.fatal(Alert.BAD_CERTIFICATE,
+                    throw shc.conContext.fatal(Alert.BAD_CERTIFICATE,
                         "Empty client certificate chain");
                 } else {
                     // optional client authentication
@@ -1187,7 +1182,7 @@
                 T13CertificateMessage certificateMessage )throws IOException {
             if (certificateMessage.certEntries == null ||
                     certificateMessage.certEntries.isEmpty()) {
-                chc.conContext.fatal(Alert.BAD_CERTIFICATE,
+                throw chc.conContext.fatal(Alert.BAD_CERTIFICATE,
                     "Empty server certificate chain");
             }
 
@@ -1224,7 +1219,7 @@
                                     new ByteArrayInputStream(entry.encoded));
                 }
             } catch (CertificateException ce) {
-                shc.conContext.fatal(Alert.BAD_CERTIFICATE,
+                throw shc.conContext.fatal(Alert.BAD_CERTIFICATE,
                     "Failed to parse server certificates", ce);
             }
 
@@ -1270,7 +1265,7 @@
                 // the certificate chain in the TLS session.
                 shc.handshakeSession.setPeerCertificates(certs);
             } catch (CertificateException ce) {
-                shc.conContext.fatal(Alert.CERTIFICATE_UNKNOWN, ce);
+                throw shc.conContext.fatal(Alert.CERTIFICATE_UNKNOWN, ce);
             }
 
             return certs;
@@ -1289,7 +1284,7 @@
                                     new ByteArrayInputStream(entry.encoded));
                 }
             } catch (CertificateException ce) {
-                chc.conContext.fatal(Alert.BAD_CERTIFICATE,
+                throw chc.conContext.fatal(Alert.BAD_CERTIFICATE,
                     "Failed to parse server certificates", ce);
             }
 
@@ -1326,7 +1321,7 @@
                 // the certificate chain in the TLS session.
                 chc.handshakeSession.setPeerCertificates(certs);
             } catch (CertificateException ce) {
-                chc.conContext.fatal(getCertificateAlert(chc, ce), ce);
+                throw chc.conContext.fatal(getCertificateAlert(chc, ce), ce);
             }
 
             return certs;
--- a/src/java.base/share/classes/sun/security/ssl/CertificateRequest.java	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/java.base/share/classes/sun/security/ssl/CertificateRequest.java	Tue Jan 15 10:55:26 2019 -0800
@@ -171,14 +171,14 @@
             //     DistinguishedName certificate_authorities<0..2^16-1>;
             // } CertificateRequest;
             if (m.remaining() < 4) {
-                handshakeContext.conContext.fatal(Alert.ILLEGAL_PARAMETER,
+                throw handshakeContext.conContext.fatal(Alert.ILLEGAL_PARAMETER,
                     "Incorrect CertificateRequest message: no sufficient data");
             }
             this.types = Record.getBytes8(m);
 
             int listLen = Record.getInt16(m);
             if (listLen > m.remaining()) {
-                handshakeContext.conContext.fatal(Alert.ILLEGAL_PARAMETER,
+                throw handshakeContext.conContext.fatal(Alert.ILLEGAL_PARAMETER,
                     "Incorrect CertificateRequest message:no sufficient data");
             }
 
@@ -407,7 +407,7 @@
             this.types = ClientCertificateType.CERT_TYPES;
 
             if (signatureSchemes == null || signatureSchemes.isEmpty()) {
-                handshakeContext.conContext.fatal(Alert.ILLEGAL_PARAMETER,
+                throw handshakeContext.conContext.fatal(Alert.ILLEGAL_PARAMETER,
                         "No signature algorithms specified for " +
                         "CertificateRequest hanshake message");
             }
@@ -437,7 +437,7 @@
 
             // certificate_authorities
             if (m.remaining() < 8) {
-                handshakeContext.conContext.fatal(Alert.ILLEGAL_PARAMETER,
+                throw handshakeContext.conContext.fatal(Alert.ILLEGAL_PARAMETER,
                         "Invalid CertificateRequest handshake message: " +
                         "no sufficient data");
             }
@@ -445,14 +445,14 @@
 
             // supported_signature_algorithms
             if (m.remaining() < 6) {
-                handshakeContext.conContext.fatal(Alert.ILLEGAL_PARAMETER,
+                throw handshakeContext.conContext.fatal(Alert.ILLEGAL_PARAMETER,
                         "Invalid CertificateRequest handshake message: " +
                         "no sufficient data");
             }
 
             byte[] algs = Record.getBytes16(m);
             if (algs == null || algs.length == 0 || (algs.length & 0x01) != 0) {
-                handshakeContext.conContext.fatal(Alert.ILLEGAL_PARAMETER,
+                throw handshakeContext.conContext.fatal(Alert.ILLEGAL_PARAMETER,
                         "Invalid CertificateRequest handshake message: " +
                         "incomplete signature algorithms");
             }
@@ -466,14 +466,14 @@
 
             // certificate_authorities
             if (m.remaining() < 2) {
-                handshakeContext.conContext.fatal(Alert.ILLEGAL_PARAMETER,
+                throw handshakeContext.conContext.fatal(Alert.ILLEGAL_PARAMETER,
                         "Invalid CertificateRequest handshake message: " +
                         "no sufficient data");
             }
 
             int listLen = Record.getInt16(m);
             if (listLen > m.remaining()) {
-                handshakeContext.conContext.fatal(Alert.ILLEGAL_PARAMETER,
+                throw handshakeContext.conContext.fatal(Alert.ILLEGAL_PARAMETER,
                     "Invalid CertificateRequest message: no sufficient data");
             }
 
@@ -597,7 +597,7 @@
 
             if (shc.localSupportedSignAlgs == null ||
                     shc.localSupportedSignAlgs.isEmpty()) {
-                shc.conContext.fatal(Alert.HANDSHAKE_FAILURE,
+                throw shc.conContext.fatal(Alert.HANDSHAKE_FAILURE,
                     "No supported signature algorithm");
             }
 
@@ -783,14 +783,14 @@
             //      Extension extensions<2..2^16-1>;
             //  } CertificateRequest;
             if (m.remaining() < 5) {
-                handshakeContext.conContext.fatal(Alert.ILLEGAL_PARAMETER,
+                throw handshakeContext.conContext.fatal(Alert.ILLEGAL_PARAMETER,
                         "Invalid CertificateRequest handshake message: " +
                         "no sufficient data");
             }
             this.requestContext = Record.getBytes8(m);
 
             if (m.remaining() < 4) {
-                handshakeContext.conContext.fatal(Alert.ILLEGAL_PARAMETER,
+                throw handshakeContext.conContext.fatal(Alert.ILLEGAL_PARAMETER,
                         "Invalid CertificateRequest handshake message: " +
                         "no sufficient extensions data");
             }
--- a/src/java.base/share/classes/sun/security/ssl/CertificateStatus.java	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/java.base/share/classes/sun/security/ssl/CertificateStatus.java	Tue Jan 15 10:55:26 2019 -0800
@@ -154,7 +154,8 @@
                     encodedResponses.add(respDER);
                     encodedResponsesLen = 3 + respDER.length;
                 } else {
-                    handshakeContext.conContext.fatal(Alert.HANDSHAKE_FAILURE,
+                    throw handshakeContext.conContext.fatal(
+                            Alert.HANDSHAKE_FAILURE,
                             "Zero-length OCSP Response");
                 }
             } else if (statusType == CertStatusRequestType.OCSP_MULTI) {
@@ -172,11 +173,13 @@
                 }
 
                 if (respListLen != 0) {
-                    handshakeContext.conContext.fatal(Alert.INTERNAL_ERROR,
+                    throw handshakeContext.conContext.fatal(
+                            Alert.INTERNAL_ERROR,
                             "Bad OCSP response list length");
                 }
             } else {
-                handshakeContext.conContext.fatal(Alert.HANDSHAKE_FAILURE,
+                throw handshakeContext.conContext.fatal(
+                        Alert.HANDSHAKE_FAILURE,
                         "Unsupported StatusResponseType: " + statusType);
             }
             messageLength = messageLength();
--- a/src/java.base/share/classes/sun/security/ssl/CertificateVerify.java	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/java.base/share/classes/sun/security/ssl/CertificateVerify.java	Tue Jan 15 10:55:26 2019 -0800
@@ -83,11 +83,11 @@
                 signer.update(hashes);
                 temproary = signer.sign();
             } catch (NoSuchAlgorithmException nsae) {
-                chc.conContext.fatal(Alert.INTERNAL_ERROR,
+                throw chc.conContext.fatal(Alert.INTERNAL_ERROR,
                         "Unsupported signature algorithm (" + algorithm +
                         ") used in CertificateVerify handshake message", nsae);
             } catch (GeneralSecurityException gse) {
-                chc.conContext.fatal(Alert.HANDSHAKE_FAILURE,
+                throw chc.conContext.fatal(Alert.HANDSHAKE_FAILURE,
                         "Cannot produce CertificateVerify signature", gse);
             }
 
@@ -112,7 +112,7 @@
             //    };
             //  } Signature;
             if (m.remaining() < 2) {
-                shc.conContext.fatal(Alert.ILLEGAL_PARAMETER,
+                throw shc.conContext.fatal(Alert.ILLEGAL_PARAMETER,
                     "Invalid CertificateVerify message: no sufficient data");
             }
 
@@ -128,7 +128,7 @@
 
             if (x509Credentials == null ||
                     x509Credentials.popPublicKey == null) {
-                shc.conContext.fatal(Alert.HANDSHAKE_FAILURE,
+                throw shc.conContext.fatal(Alert.HANDSHAKE_FAILURE,
                     "No X509 credentials negotiated for CertificateVerify");
             }
 
@@ -140,15 +140,15 @@
                         shc.handshakeSession.getMasterSecret());
                 signer.update(hashes);
                 if (!signer.verify(signature)) {
-                    shc.conContext.fatal(Alert.HANDSHAKE_FAILURE,
+                    throw shc.conContext.fatal(Alert.HANDSHAKE_FAILURE,
                         "Invalid CertificateVerify message: invalid signature");
                 }
             } catch (NoSuchAlgorithmException nsae) {
-                shc.conContext.fatal(Alert.INTERNAL_ERROR,
+                throw shc.conContext.fatal(Alert.INTERNAL_ERROR,
                         "Unsupported signature algorithm (" + algorithm +
                         ") used in CertificateVerify handshake message", nsae);
             } catch (GeneralSecurityException gse) {
-                shc.conContext.fatal(Alert.HANDSHAKE_FAILURE,
+                throw shc.conContext.fatal(Alert.HANDSHAKE_FAILURE,
                         "Cannot verify CertificateVerify signature", gse);
             }
         }
@@ -327,11 +327,11 @@
                 signer.update(hashes);
                 temproary = signer.sign();
             } catch (NoSuchAlgorithmException nsae) {
-                chc.conContext.fatal(Alert.INTERNAL_ERROR,
+                throw chc.conContext.fatal(Alert.INTERNAL_ERROR,
                         "Unsupported signature algorithm (" + algorithm +
                         ") used in CertificateVerify handshake message", nsae);
             } catch (GeneralSecurityException gse) {
-                chc.conContext.fatal(Alert.HANDSHAKE_FAILURE,
+                throw chc.conContext.fatal(Alert.HANDSHAKE_FAILURE,
                     "Cannot produce CertificateVerify signature", gse);
             }
 
@@ -356,7 +356,7 @@
             //    };
             //  } Signature;
             if (m.remaining() < 2) {
-                shc.conContext.fatal(Alert.ILLEGAL_PARAMETER,
+                throw shc.conContext.fatal(Alert.ILLEGAL_PARAMETER,
                     "Invalid CertificateVerify message: no sufficient data");
             }
 
@@ -372,7 +372,7 @@
 
             if (x509Credentials == null ||
                     x509Credentials.popPublicKey == null) {
-                shc.conContext.fatal(Alert.HANDSHAKE_FAILURE,
+                throw shc.conContext.fatal(Alert.HANDSHAKE_FAILURE,
                     "No X509 credentials negotiated for CertificateVerify");
             }
 
@@ -383,15 +383,15 @@
                 byte[] hashes = shc.handshakeHash.digest(algorithm);
                 signer.update(hashes);
                 if (!signer.verify(signature)) {
-                    shc.conContext.fatal(Alert.HANDSHAKE_FAILURE,
+                    throw shc.conContext.fatal(Alert.HANDSHAKE_FAILURE,
                         "Invalid CertificateVerify message: invalid signature");
                 }
             } catch (NoSuchAlgorithmException nsae) {
-                shc.conContext.fatal(Alert.INTERNAL_ERROR,
+                throw shc.conContext.fatal(Alert.INTERNAL_ERROR,
                         "Unsupported signature algorithm (" + algorithm +
                         ") used in CertificateVerify handshake message", nsae);
             } catch (GeneralSecurityException gse) {
-                shc.conContext.fatal(Alert.HANDSHAKE_FAILURE,
+                throw shc.conContext.fatal(Alert.HANDSHAKE_FAILURE,
                         "Cannot verify CertificateVerify signature", gse);
             }
         }
@@ -570,7 +570,7 @@
             if (signatureScheme == null) {
                 // Unlikely, the credentials generator should have
                 // selected the preferable signature algorithm properly.
-                chc.conContext.fatal(Alert.INTERNAL_ERROR,
+                throw chc.conContext.fatal(Alert.INTERNAL_ERROR,
                     "No preferred signature algorithm for CertificateVerify");
             }
 
@@ -582,12 +582,12 @@
                 temproary = signer.sign();
             } catch (NoSuchAlgorithmException |
                     InvalidAlgorithmParameterException nsae) {
-                chc.conContext.fatal(Alert.INTERNAL_ERROR,
+                throw chc.conContext.fatal(Alert.INTERNAL_ERROR,
                         "Unsupported signature algorithm (" +
                         signatureScheme.name +
                         ") used in CertificateVerify handshake message", nsae);
             } catch (InvalidKeyException | SignatureException ikse) {
-                chc.conContext.fatal(Alert.HANDSHAKE_FAILURE,
+                throw chc.conContext.fatal(Alert.HANDSHAKE_FAILURE,
                         "Cannot produce CertificateVerify signature", ikse);
             }
 
@@ -607,7 +607,7 @@
             //     opaque signature<0..2^16-1>;
             // } DigitallySigned;
             if (m.remaining() < 4) {
-                shc.conContext.fatal(Alert.ILLEGAL_PARAMETER,
+                throw shc.conContext.fatal(Alert.ILLEGAL_PARAMETER,
                     "Invalid CertificateVerify message: no sufficient data");
             }
 
@@ -615,13 +615,13 @@
             int ssid = Record.getInt16(m);
             this.signatureScheme = SignatureScheme.valueOf(ssid);
             if (signatureScheme == null) {
-                shc.conContext.fatal(Alert.HANDSHAKE_FAILURE,
+                throw shc.conContext.fatal(Alert.HANDSHAKE_FAILURE,
                         "Invalid signature algorithm (" + ssid +
                         ") used in CertificateVerify handshake message");
             }
 
             if (!shc.localSupportedSignAlgs.contains(signatureScheme)) {
-                shc.conContext.fatal(Alert.HANDSHAKE_FAILURE,
+                throw shc.conContext.fatal(Alert.HANDSHAKE_FAILURE,
                         "Unsupported signature algorithm (" +
                         signatureScheme.name +
                         ") used in CertificateVerify handshake message");
@@ -638,7 +638,7 @@
 
             if (x509Credentials == null ||
                     x509Credentials.popPublicKey == null) {
-                shc.conContext.fatal(Alert.HANDSHAKE_FAILURE,
+                throw shc.conContext.fatal(Alert.HANDSHAKE_FAILURE,
                     "No X509 credentials negotiated for CertificateVerify");
             }
 
@@ -649,17 +649,17 @@
                     signatureScheme.getSignature(x509Credentials.popPublicKey);
                 signer.update(shc.handshakeHash.archived());
                 if (!signer.verify(signature)) {
-                    shc.conContext.fatal(Alert.HANDSHAKE_FAILURE,
+                    throw shc.conContext.fatal(Alert.HANDSHAKE_FAILURE,
                         "Invalid CertificateVerify signature");
                 }
             } catch (NoSuchAlgorithmException |
                     InvalidAlgorithmParameterException nsae) {
-                shc.conContext.fatal(Alert.INTERNAL_ERROR,
+                throw shc.conContext.fatal(Alert.INTERNAL_ERROR,
                         "Unsupported signature algorithm (" +
                         signatureScheme.name +
                         ") used in CertificateVerify handshake message", nsae);
             } catch (InvalidKeyException | SignatureException ikse) {
-                shc.conContext.fatal(Alert.HANDSHAKE_FAILURE,
+                throw shc.conContext.fatal(Alert.HANDSHAKE_FAILURE,
                         "Cannot verify CertificateVerify signature", ikse);
             }
         }
@@ -871,7 +871,7 @@
             if (signatureScheme == null) {
                 // Unlikely, the credentials generator should have
                 // selected the preferable signature algorithm properly.
-                context.conContext.fatal(Alert.INTERNAL_ERROR,
+                throw context.conContext.fatal(Alert.INTERNAL_ERROR,
                     "No preferred signature algorithm for CertificateVerify");
             }
 
@@ -897,12 +897,12 @@
                 temproary = signer.sign();
             } catch (NoSuchAlgorithmException |
                     InvalidAlgorithmParameterException nsae) {
-                context.conContext.fatal(Alert.INTERNAL_ERROR,
+                throw context.conContext.fatal(Alert.INTERNAL_ERROR,
                         "Unsupported signature algorithm (" +
                         signatureScheme.name +
                         ") used in CertificateVerify handshake message", nsae);
             } catch (InvalidKeyException | SignatureException ikse) {
-                context.conContext.fatal(Alert.HANDSHAKE_FAILURE,
+                throw context.conContext.fatal(Alert.HANDSHAKE_FAILURE,
                         "Cannot produce CertificateVerify signature", ikse);
             }
 
@@ -918,7 +918,7 @@
             //     opaque signature<0..2^16-1>;
             // } DigitallySigned;
             if (m.remaining() < 4) {
-                context.conContext.fatal(Alert.ILLEGAL_PARAMETER,
+                throw context.conContext.fatal(Alert.ILLEGAL_PARAMETER,
                     "Invalid CertificateVerify message: no sufficient data");
             }
 
@@ -926,13 +926,13 @@
             int ssid = Record.getInt16(m);
             this.signatureScheme = SignatureScheme.valueOf(ssid);
             if (signatureScheme == null) {
-                context.conContext.fatal(Alert.HANDSHAKE_FAILURE,
+                throw context.conContext.fatal(Alert.HANDSHAKE_FAILURE,
                         "Invalid signature algorithm (" + ssid +
                         ") used in CertificateVerify handshake message");
             }
 
             if (!context.localSupportedSignAlgs.contains(signatureScheme)) {
-                context.conContext.fatal(Alert.HANDSHAKE_FAILURE,
+                throw context.conContext.fatal(Alert.HANDSHAKE_FAILURE,
                         "Unsupported signature algorithm (" +
                         signatureScheme.name +
                         ") used in CertificateVerify handshake message");
@@ -949,7 +949,7 @@
 
             if (x509Credentials == null ||
                     x509Credentials.popPublicKey == null) {
-                context.conContext.fatal(Alert.HANDSHAKE_FAILURE,
+                throw context.conContext.fatal(Alert.HANDSHAKE_FAILURE,
                     "No X509 credentials negotiated for CertificateVerify");
             }
 
@@ -975,17 +975,17 @@
                     signatureScheme.getSignature(x509Credentials.popPublicKey);
                 signer.update(contentCovered);
                 if (!signer.verify(signature)) {
-                    context.conContext.fatal(Alert.HANDSHAKE_FAILURE,
+                    throw context.conContext.fatal(Alert.HANDSHAKE_FAILURE,
                         "Invalid CertificateVerify signature");
                 }
             } catch (NoSuchAlgorithmException |
                     InvalidAlgorithmParameterException nsae) {
-                context.conContext.fatal(Alert.INTERNAL_ERROR,
+                throw context.conContext.fatal(Alert.INTERNAL_ERROR,
                         "Unsupported signature algorithm (" +
                         signatureScheme.name +
                         ") used in CertificateVerify handshake message", nsae);
             } catch (InvalidKeyException | SignatureException ikse) {
-                context.conContext.fatal(Alert.HANDSHAKE_FAILURE,
+                throw context.conContext.fatal(Alert.HANDSHAKE_FAILURE,
                         "Cannot verify CertificateVerify signature", ikse);
             }
         }
--- a/src/java.base/share/classes/sun/security/ssl/ChangeCipherSpec.java	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/java.base/share/classes/sun/security/ssl/ChangeCipherSpec.java	Tue Jan 15 10:55:26 2019 -0800
@@ -105,6 +105,12 @@
                 throw new SSLException("Algorithm missing:  ", gse);
             }
 
+            if (writeCipher == null) {
+                throw hc.conContext.fatal(Alert.ILLEGAL_PARAMETER,
+                    "Illegal cipher suite (" + ncs +
+                    ") and protocol version (" + hc.negotiatedProtocol + ")");
+            }
+
             if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) {
                 SSLLogger.fine("Produced ChangeCipherSpec message");
             }
@@ -136,7 +142,7 @@
 
             // parse
             if (message.remaining() != 1 || message.get() != 1) {
-                tc.fatal(Alert.UNEXPECTED_MESSAGE,
+                throw tc.fatal(Alert.UNEXPECTED_MESSAGE,
                         "Malformed or unexpected ChangeCipherSpec message");
             }
             if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) {
@@ -145,7 +151,7 @@
 
             // validate
             if (tc.handshakeContext == null) {
-                tc.fatal(Alert.HANDSHAKE_FAILURE,
+                throw tc.fatal(Alert.HANDSHAKE_FAILURE,
                         "Unexpected ChangeCipherSpec message");
             }
 
@@ -153,7 +159,7 @@
             HandshakeContext hc = tc.handshakeContext;
 
             if (hc.handshakeKeyDerivation == null) {
-                tc.fatal(Alert.UNEXPECTED_MESSAGE,
+                throw tc.fatal(Alert.UNEXPECTED_MESSAGE,
                         "Unexpected ChangeCipherSpec message");
             }
 
@@ -195,6 +201,14 @@
                     // unlikely
                     throw new SSLException("Algorithm missing:  ", gse);
                 }
+
+                if (readCipher == null) {
+                    throw hc.conContext.fatal(Alert.ILLEGAL_PARAMETER,
+                        "Illegal cipher suite (" + hc.negotiatedCipherSuite +
+                        ") and protocol version (" + hc.negotiatedProtocol +
+                        ")");
+                }
+
                 tc.inputRecord.changeReadCiphers(readCipher);
             } else {
                 throw new UnsupportedOperationException("Not supported.");
@@ -225,7 +239,7 @@
 
             // parse
             if (message.remaining() != 1 || message.get() != 1) {
-                tc.fatal(Alert.UNEXPECTED_MESSAGE,
+                throw tc.fatal(Alert.UNEXPECTED_MESSAGE,
                         "Malformed or unexpected ChangeCipherSpec message");
             }
             if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) {
--- a/src/java.base/share/classes/sun/security/ssl/Ciphertext.java	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/java.base/share/classes/sun/security/ssl/Ciphertext.java	Tue Jan 15 10:55:26 2019 -0800
@@ -31,8 +31,6 @@
  * Ciphertext
  */
 final class Ciphertext {
-    static final Ciphertext CIPHERTEXT_NULL = new Ciphertext();
-
     final byte contentType;
     final byte handshakeType;
     final long recordSN;
--- a/src/java.base/share/classes/sun/security/ssl/ClientHello.java	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/java.base/share/classes/sun/security/ssl/ClientHello.java	Tue Jan 15 10:55:26 2019 -0800
@@ -144,8 +144,8 @@
                     if (id == SSLExtension.CH_PRE_SHARED_KEY.id) {
                         // ensure pre_shared_key is the last extension
                         if (remaining > 0) {
-                            tc.fatal(Alert.ILLEGAL_PARAMETER,
-                            "pre_shared_key extension is not last");
+                            throw tc.fatal(Alert.ILLEGAL_PARAMETER,
+                                    "pre_shared_key extension is not last");
                         }
                         // read only up to the IDs
                         Record.getBytes16(m);
@@ -169,7 +169,8 @@
             try {
                 sessionId.checkLength(clientVersion);
             } catch (SSLProtocolException ex) {
-                handshakeContext.conContext.fatal(Alert.ILLEGAL_PARAMETER, ex);
+                throw handshakeContext.conContext.fatal(
+                        Alert.ILLEGAL_PARAMETER, ex);
             }
             if (isDTLS) {
                 this.cookie = Record.getBytes8(m);
@@ -179,8 +180,9 @@
 
             byte[] encodedIds = Record.getBytes16(m);
             if (encodedIds.length == 0 || (encodedIds.length & 0x01) != 0) {
-                handshakeContext.conContext.fatal(Alert.ILLEGAL_PARAMETER,
-                    "Invalid ClientHello message");
+                throw handshakeContext.conContext.fatal(
+                        Alert.ILLEGAL_PARAMETER,
+                        "Invalid ClientHello message");
             }
 
             this.cipherSuiteIds = new int[encodedIds.length >> 1];
@@ -702,7 +704,8 @@
                     try {
                         chc.kickstart();
                     } catch (IOException ioe) {
-                        chc.conContext.fatal(Alert.HANDSHAKE_FAILURE, ioe);
+                        throw chc.conContext.fatal(
+                                Alert.HANDSHAKE_FAILURE, ioe);
                     }
 
                     // The handshake message has been delivered.
@@ -790,7 +793,7 @@
             // clean up this consumer
             shc.handshakeConsumers.remove(SSLHandshake.CLIENT_HELLO.id);
             if (!shc.handshakeConsumers.isEmpty()) {
-                shc.conContext.fatal(Alert.UNEXPECTED_MESSAGE,
+                throw shc.conContext.fatal(Alert.UNEXPECTED_MESSAGE,
                         "No more handshake message allowed " +
                         "in a ClientHello flight");
             }
@@ -877,7 +880,7 @@
                     context.activeProtocols, chv);
             if (pv == null || pv == ProtocolVersion.NONE ||
                     pv == ProtocolVersion.SSL20Hello) {
-                context.conContext.fatal(Alert.PROTOCOL_VERSION,
+                throw context.conContext.fatal(Alert.PROTOCOL_VERSION,
                     "Client requested protocol " +
                     ProtocolVersion.nameOf(clientHelloVersion) +
                     " is not enabled or supported in server context");
@@ -910,13 +913,11 @@
             }
 
             // No protocol version can be negotiated.
-            context.conContext.fatal(Alert.PROTOCOL_VERSION,
+            throw context.conContext.fatal(Alert.PROTOCOL_VERSION,
                 "The client supported protocol versions " + Arrays.toString(
                     ProtocolVersion.toStringArray(clientSupportedVersions)) +
                 " are not accepted by server preferences " +
                 context.activeProtocols);
-
-            return null;        // make the compiler happy
         }
     }
 
@@ -957,13 +958,13 @@
             if (shc.conContext.isNegotiated) {
                 if (!shc.conContext.secureRenegotiation &&
                         !HandshakeContext.allowUnsafeRenegotiation) {
-                    shc.conContext.fatal(Alert.HANDSHAKE_FAILURE,
+                    throw shc.conContext.fatal(Alert.HANDSHAKE_FAILURE,
                             "Unsafe renegotiation is not allowed");
                 }
 
                 if (ServerHandshakeContext.rejectClientInitiatedRenego &&
                         !shc.kickstartMessageDelivered) {
-                    shc.conContext.fatal(Alert.HANDSHAKE_FAILURE,
+                    throw shc.conContext.fatal(Alert.HANDSHAKE_FAILURE,
                             "Client initiated renegotiation is not allowed");
                 }
             }
@@ -1170,13 +1171,13 @@
                     handshakeProducer.produce(shc, clientHello);
             } else {
                 // unlikely
-                shc.conContext.fatal(Alert.HANDSHAKE_FAILURE,
+                throw shc.conContext.fatal(Alert.HANDSHAKE_FAILURE,
                     "No HelloRetryRequest producer: " + shc.handshakeProducers);
             }
 
             if (!shc.handshakeProducers.isEmpty()) {
                 // unlikely, but please double check.
-                shc.conContext.fatal(Alert.HANDSHAKE_FAILURE,
+                throw shc.conContext.fatal(Alert.HANDSHAKE_FAILURE,
                     "unknown handshake producers: " + shc.handshakeProducers);
             }
         }
@@ -1264,13 +1265,13 @@
             if (shc.conContext.isNegotiated) {
                 if (!shc.conContext.secureRenegotiation &&
                         !HandshakeContext.allowUnsafeRenegotiation) {
-                    shc.conContext.fatal(Alert.HANDSHAKE_FAILURE,
+                    throw shc.conContext.fatal(Alert.HANDSHAKE_FAILURE,
                             "Unsafe renegotiation is not allowed");
                 }
 
                 if (ServerHandshakeContext.rejectClientInitiatedRenego &&
                         !shc.kickstartMessageDelivered) {
-                    shc.conContext.fatal(Alert.HANDSHAKE_FAILURE,
+                    throw shc.conContext.fatal(Alert.HANDSHAKE_FAILURE,
                             "Client initiated renegotiation is not allowed");
                 }
             }
--- a/src/java.base/share/classes/sun/security/ssl/ClientKeyExchange.java	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/java.base/share/classes/sun/security/ssl/ClientKeyExchange.java	Tue Jan 15 10:55:26 2019 -0800
@@ -68,9 +68,8 @@
             }
 
             // not consumer defined.
-            chc.conContext.fatal(Alert.UNEXPECTED_MESSAGE,
+            throw chc.conContext.fatal(Alert.UNEXPECTED_MESSAGE,
                         "Unexpected ClientKeyExchange handshake message.");
-            return null;    // make the compiler happe
         }
     }
 
@@ -105,7 +104,7 @@
             }
 
             // not consumer defined.
-            shc.conContext.fatal(Alert.UNEXPECTED_MESSAGE,
+            throw shc.conContext.fatal(Alert.UNEXPECTED_MESSAGE,
                         "Unexpected ClientKeyExchange handshake message.");
         }
     }
--- a/src/java.base/share/classes/sun/security/ssl/CookieExtension.java	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/java.base/share/classes/sun/security/ssl/CookieExtension.java	Tue Jan 15 10:55:26 2019 -0800
@@ -163,8 +163,7 @@
             try {
                 spec = new CookieSpec(buffer);
             } catch (IOException ioe) {
-                shc.conContext.fatal(Alert.UNEXPECTED_MESSAGE, ioe);
-                return;     // fatal() always throws, make the compiler happy.
+                throw shc.conContext.fatal(Alert.UNEXPECTED_MESSAGE, ioe);
             }
 
             shc.handshakeExtensions.put(SSLExtension.CH_COOKIE, spec);
@@ -201,9 +200,8 @@
             HelloCookieManager hcm =
                 shc.sslContext.getHelloCookieManager(shc.negotiatedProtocol);
             if (!hcm.isCookieValid(shc, clientHello, spec.cookie)) {
-                shc.conContext.fatal(Alert.UNEXPECTED_MESSAGE,
+                throw shc.conContext.fatal(Alert.UNEXPECTED_MESSAGE,
                         "unrecognized cookie");
-                return;     // fatal() always throws, make the compiler happy.
             }
         }
     }
@@ -270,8 +268,7 @@
             try {
                 spec = new CookieSpec(buffer);
             } catch (IOException ioe) {
-                chc.conContext.fatal(Alert.UNEXPECTED_MESSAGE, ioe);
-                return;     // fatal() always throws, make the compiler happy.
+                throw chc.conContext.fatal(Alert.UNEXPECTED_MESSAGE, ioe);
             }
 
             chc.handshakeExtensions.put(SSLExtension.HRR_COOKIE, spec);
--- a/src/java.base/share/classes/sun/security/ssl/DHClientKeyExchange.java	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/java.base/share/classes/sun/security/ssl/DHClientKeyExchange.java	Tue Jan 15 10:55:26 2019 -0800
@@ -87,7 +87,7 @@
 
             if (dhePossession == null) {
                 // unlikely
-                chc.conContext.fatal(Alert.HANDSHAKE_FAILURE,
+                throw chc.conContext.fatal(Alert.HANDSHAKE_FAILURE,
                     "No DHE credentials negotiated for client key exchange");
             }
 
@@ -104,14 +104,14 @@
                     (ServerHandshakeContext)handshakeContext;
 
             if (m.remaining() < 3) {
-                shc.conContext.fatal(Alert.HANDSHAKE_FAILURE,
+                throw shc.conContext.fatal(Alert.HANDSHAKE_FAILURE,
                     "Invalid DH ClientKeyExchange message: insufficient data");
             }
 
             this.y = Record.getBytes16(m);
 
             if (m.hasRemaining()) {
-                shc.conContext.fatal(Alert.HANDSHAKE_FAILURE,
+                throw shc.conContext.fatal(Alert.HANDSHAKE_FAILURE,
                     "Invalid DH ClientKeyExchange message: unknown extra data");
             }
         }
@@ -177,7 +177,7 @@
             }
 
             if (dheCredentials == null) {
-                chc.conContext.fatal(Alert.HANDSHAKE_FAILURE,
+                throw chc.conContext.fatal(Alert.HANDSHAKE_FAILURE,
                     "No DHE credentials negotiated for client key exchange");
             }
 
@@ -202,7 +202,7 @@
                     chc.negotiatedProtocol);
             if (ke == null) {
                 // unlikely
-                chc.conContext.fatal(Alert.INTERNAL_ERROR,
+                throw chc.conContext.fatal(Alert.INTERNAL_ERROR,
                         "Not supported key exchange type");
             } else {
                 SSLKeyDerivation masterKD = ke.createKeyDerivation(chc);
@@ -214,7 +214,7 @@
                         SSLTrafficKeyDerivation.valueOf(chc.negotiatedProtocol);
                 if (kd == null) {
                     // unlikely
-                    chc.conContext.fatal(Alert.INTERNAL_ERROR,
+                    throw chc.conContext.fatal(Alert.INTERNAL_ERROR,
                             "Not supported key derivation: " +
                             chc.negotiatedProtocol);
                 } else {
@@ -254,7 +254,7 @@
 
             if (dhePossession == null) {
                 // unlikely
-                shc.conContext.fatal(Alert.HANDSHAKE_FAILURE,
+                throw shc.conContext.fatal(Alert.HANDSHAKE_FAILURE,
                     "No expected DHE possessions for client key exchange");
             }
 
@@ -263,7 +263,7 @@
                     shc.negotiatedProtocol);
             if (ke == null) {
                 // unlikely
-                shc.conContext.fatal(Alert.INTERNAL_ERROR,
+                throw shc.conContext.fatal(Alert.INTERNAL_ERROR,
                         "Not supported key exchange type");
             }
 
@@ -310,7 +310,7 @@
                     SSLTrafficKeyDerivation.valueOf(shc.negotiatedProtocol);
             if (kd == null) {
                 // unlikely
-                shc.conContext.fatal(Alert.INTERNAL_ERROR,
+                throw shc.conContext.fatal(Alert.INTERNAL_ERROR,
                     "Not supported key derivation: " + shc.negotiatedProtocol);
             } else {
                 shc.handshakeKeyDerivation =
--- a/src/java.base/share/classes/sun/security/ssl/DHKeyExchange.java	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/java.base/share/classes/sun/security/ssl/DHKeyExchange.java	Tue Jan 15 10:55:26 2019 -0800
@@ -438,7 +438,7 @@
             }
 
             if (dhePossession == null || dheCredentials == null) {
-                context.conContext.fatal(Alert.HANDSHAKE_FAILURE,
+                throw context.conContext.fatal(Alert.HANDSHAKE_FAILURE,
                     "No sufficient DHE key agreement parameters negotiated");
             }
 
--- a/src/java.base/share/classes/sun/security/ssl/DHServerKeyExchange.java	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/java.base/share/classes/sun/security/ssl/DHServerKeyExchange.java	Tue Jan 15 10:55:26 2019 -0800
@@ -106,7 +106,7 @@
 
             if (dhePossession == null) {
                 // unlikely
-                shc.conContext.fatal(Alert.ILLEGAL_PARAMETER,
+                throw shc.conContext.fatal(Alert.ILLEGAL_PARAMETER,
                     "No DHE credentials negotiated for server key exchange");
             }
             DHPublicKey publicKey = dhePossession.publicKey;
@@ -132,7 +132,7 @@
                     if (signatureScheme == null) {
                         // Unlikely, the credentials generator should have
                         // selected the preferable signature algorithm properly.
-                        shc.conContext.fatal(Alert.INTERNAL_ERROR,
+                        throw shc.conContext.fatal(Alert.INTERNAL_ERROR,
                             "No preferred signature algorithm");
                     }
                     try {
@@ -140,7 +140,7 @@
                                 x509Possession.popPrivateKey);
                     } catch (NoSuchAlgorithmException | InvalidKeyException |
                             InvalidAlgorithmParameterException nsae) {
-                        shc.conContext.fatal(Alert.INTERNAL_ERROR,
+                        throw shc.conContext.fatal(Alert.INTERNAL_ERROR,
                             "Unsupported signature algorithm: " +
                             signatureScheme.name, nsae);
                     }
@@ -151,7 +151,7 @@
                                 x509Possession.popPrivateKey.getAlgorithm(),
                                 x509Possession.popPrivateKey);
                     } catch (NoSuchAlgorithmException | InvalidKeyException e) {
-                        shc.conContext.fatal(Alert.INTERNAL_ERROR,
+                        throw shc.conContext.fatal(Alert.INTERNAL_ERROR,
                             "Unsupported signature algorithm: " +
                             x509Possession.popPrivateKey.getAlgorithm(), e);
                     }
@@ -163,7 +163,7 @@
                             shc.serverHelloRandom.randomBytes);
                     signature = signer.sign();
                 } catch (SignatureException ex) {
-                    shc.conContext.fatal(Alert.INTERNAL_ERROR,
+                    throw shc.conContext.fatal(Alert.INTERNAL_ERROR,
                         "Failed to sign dhe parameters: " +
                         x509Possession.popPrivateKey.getAlgorithm(), ex);
                 }
@@ -189,7 +189,7 @@
                         new BigInteger(1, p),
                         new BigInteger(1, p)));
             } catch (InvalidKeyException ike) {
-                chc.conContext.fatal(Alert.HANDSHAKE_FAILURE,
+                throw chc.conContext.fatal(Alert.HANDSHAKE_FAILURE,
                     "Invalid DH ServerKeyExchange: invalid parameters", ike);
             }
 
@@ -204,7 +204,7 @@
             if (x509Credentials == null) {
                 // anonymous, no authentication, no signature
                 if (m.hasRemaining()) {
-                    chc.conContext.fatal(Alert.HANDSHAKE_FAILURE,
+                    throw chc.conContext.fatal(Alert.HANDSHAKE_FAILURE,
                         "Invalid DH ServerKeyExchange: unknown extra data");
                 }
 
@@ -221,13 +221,13 @@
                 int ssid = Record.getInt16(m);
                 signatureScheme = SignatureScheme.valueOf(ssid);
                 if (signatureScheme == null) {
-                    chc.conContext.fatal(Alert.HANDSHAKE_FAILURE,
+                    throw chc.conContext.fatal(Alert.HANDSHAKE_FAILURE,
                             "Invalid signature algorithm (" + ssid +
                             ") used in DH ServerKeyExchange handshake message");
                 }
 
                 if (!chc.localSupportedSignAlgs.contains(signatureScheme)) {
-                    chc.conContext.fatal(Alert.HANDSHAKE_FAILURE,
+                    throw chc.conContext.fatal(Alert.HANDSHAKE_FAILURE,
                             "Unsupported signature algorithm (" +
                             signatureScheme.name +
                             ") used in DH ServerKeyExchange handshake message");
@@ -245,11 +245,9 @@
                             x509Credentials.popPublicKey);
                 } catch (NoSuchAlgorithmException | InvalidKeyException |
                         InvalidAlgorithmParameterException nsae) {
-                    chc.conContext.fatal(Alert.INTERNAL_ERROR,
+                    throw chc.conContext.fatal(Alert.INTERNAL_ERROR,
                             "Unsupported signature algorithm: " +
                             signatureScheme.name, nsae);
-
-                    return;     // make the compiler happe
                 }
             } else {
                 try {
@@ -257,11 +255,9 @@
                             x509Credentials.popPublicKey.getAlgorithm(),
                             x509Credentials.popPublicKey);
                 } catch (NoSuchAlgorithmException | InvalidKeyException e) {
-                    chc.conContext.fatal(Alert.INTERNAL_ERROR,
+                    throw chc.conContext.fatal(Alert.INTERNAL_ERROR,
                             "Unsupported signature algorithm: " +
                             x509Credentials.popPublicKey.getAlgorithm(), e);
-
-                    return;     // make the compiler happe
                 }
             }
 
@@ -271,11 +267,11 @@
                         chc.serverHelloRandom.randomBytes);
 
                 if (!signer.verify(paramsSignature)) {
-                    chc.conContext.fatal(Alert.HANDSHAKE_FAILURE,
+                    throw chc.conContext.fatal(Alert.HANDSHAKE_FAILURE,
                         "Invalid signature on DH ServerKeyExchange message");
                 }
             } catch (SignatureException ex) {
-                chc.conContext.fatal(Alert.HANDSHAKE_FAILURE,
+                throw chc.conContext.fatal(Alert.HANDSHAKE_FAILURE,
                         "Cannot verify DH ServerKeyExchange signature", ex);
             }
         }
@@ -535,15 +531,13 @@
                         new BigInteger(1, skem.g));
                 publicKey = (DHPublicKey)kf.generatePublic(spec);
             } catch (GeneralSecurityException gse) {
-                chc.conContext.fatal(Alert.INSUFFICIENT_SECURITY,
+                throw chc.conContext.fatal(Alert.INSUFFICIENT_SECURITY,
                     "Could not generate DHPublicKey", gse);
-
-                return;     // make the compiler happy
             }
 
             if (!chc.algorithmConstraints.permits(
                     EnumSet.of(CryptoPrimitive.KEY_AGREEMENT), publicKey)) {
-                chc.conContext.fatal(Alert.INSUFFICIENT_SECURITY,
+                throw chc.conContext.fatal(Alert.INSUFFICIENT_SECURITY,
                         "DH ServerKeyExchange does not comply to " +
                         "algorithm constraints");
             }
--- a/src/java.base/share/classes/sun/security/ssl/ECDHClientKeyExchange.java	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/java.base/share/classes/sun/security/ssl/ECDHClientKeyExchange.java	Tue Jan 15 10:55:26 2019 -0800
@@ -190,20 +190,20 @@
             }
 
             if (x509Credentials == null) {
-                chc.conContext.fatal(Alert.INTERNAL_ERROR,
+                throw chc.conContext.fatal(Alert.INTERNAL_ERROR,
                     "No server certificate for ECDH client key exchange");
             }
 
             PublicKey publicKey = x509Credentials.popPublicKey;
             if (!publicKey.getAlgorithm().equals("EC")) {
-                chc.conContext.fatal(Alert.ILLEGAL_PARAMETER,
+                throw chc.conContext.fatal(Alert.ILLEGAL_PARAMETER,
                     "Not EC server certificate for ECDH client key exchange");
             }
 
             ECParameterSpec params = ((ECPublicKey)publicKey).getParams();
             NamedGroup namedGroup = NamedGroup.valueOf(params);
             if (namedGroup == null) {
-                chc.conContext.fatal(Alert.ILLEGAL_PARAMETER,
+                throw chc.conContext.fatal(Alert.ILLEGAL_PARAMETER,
                     "Unsupported EC server cert for ECDH client key exchange");
             }
 
@@ -228,7 +228,7 @@
                     chc.negotiatedProtocol);
             if (ke == null) {
                 // unlikely
-                chc.conContext.fatal(Alert.INTERNAL_ERROR,
+                throw chc.conContext.fatal(Alert.INTERNAL_ERROR,
                         "Not supported key exchange type");
             } else {
                 SSLKeyDerivation masterKD = ke.createKeyDerivation(chc);
@@ -240,7 +240,7 @@
                         SSLTrafficKeyDerivation.valueOf(chc.negotiatedProtocol);
                 if (kd == null) {
                     // unlikely
-                    chc.conContext.fatal(Alert.INTERNAL_ERROR,
+                    throw chc.conContext.fatal(Alert.INTERNAL_ERROR,
                             "Not supported key derivation: " +
                             chc.negotiatedProtocol);
                 } else {
@@ -280,15 +280,14 @@
 
             if (x509Possession == null) {
                 // unlikely, have been checked during cipher suite negotiation.
-                shc.conContext.fatal(Alert.INTERNAL_ERROR,
+                throw shc.conContext.fatal(Alert.INTERNAL_ERROR,
                     "No expected EC server cert for ECDH client key exchange");
-                return;     // make the compiler happy
             }
 
             PrivateKey privateKey = x509Possession.popPrivateKey;
             if (!privateKey.getAlgorithm().equals("EC")) {
                 // unlikely, have been checked during cipher suite negotiation.
-                shc.conContext.fatal(Alert.ILLEGAL_PARAMETER,
+                throw shc.conContext.fatal(Alert.ILLEGAL_PARAMETER,
                     "Not EC server cert for ECDH client key exchange");
             }
 
@@ -296,7 +295,7 @@
             NamedGroup namedGroup = NamedGroup.valueOf(params);
             if (namedGroup == null) {
                 // unlikely, have been checked during cipher suite negotiation.
-                shc.conContext.fatal(Alert.ILLEGAL_PARAMETER,
+                throw shc.conContext.fatal(Alert.ILLEGAL_PARAMETER,
                     "Unsupported EC server cert for ECDH client key exchange");
             }
 
@@ -305,9 +304,8 @@
                     shc.negotiatedProtocol);
             if (ke == null) {
                 // unlikely
-                shc.conContext.fatal(Alert.INTERNAL_ERROR,
+                throw shc.conContext.fatal(Alert.INTERNAL_ERROR,
                         "Not supported key exchange type");
-                return;     // make the compiler happy
             }
 
             // parse the handshake message
@@ -353,7 +351,7 @@
                     SSLTrafficKeyDerivation.valueOf(shc.negotiatedProtocol);
             if (kd == null) {
                 // unlikely
-                shc.conContext.fatal(Alert.INTERNAL_ERROR,
+                throw shc.conContext.fatal(Alert.INTERNAL_ERROR,
                     "Not supported key derivation: " + shc.negotiatedProtocol);
             } else {
                 shc.handshakeKeyDerivation =
@@ -387,7 +385,7 @@
             }
 
             if (ecdheCredentials == null) {
-                chc.conContext.fatal(Alert.INTERNAL_ERROR,
+                throw chc.conContext.fatal(Alert.INTERNAL_ERROR,
                     "No ECDHE credentials negotiated for client key exchange");
             }
 
@@ -412,7 +410,7 @@
                     chc.negotiatedProtocol);
             if (ke == null) {
                 // unlikely
-                chc.conContext.fatal(Alert.INTERNAL_ERROR,
+                throw chc.conContext.fatal(Alert.INTERNAL_ERROR,
                         "Not supported key exchange type");
             } else {
                 SSLKeyDerivation masterKD = ke.createKeyDerivation(chc);
@@ -424,7 +422,7 @@
                         SSLTrafficKeyDerivation.valueOf(chc.negotiatedProtocol);
                 if (kd == null) {
                     // unlikely
-                    chc.conContext.fatal(Alert.INTERNAL_ERROR,
+                    throw chc.conContext.fatal(Alert.INTERNAL_ERROR,
                             "Not supported key derivation: " +
                             chc.negotiatedProtocol);
                 } else {
@@ -463,16 +461,15 @@
             }
             if (ecdhePossession == null) {
                 // unlikely
-                shc.conContext.fatal(Alert.INTERNAL_ERROR,
+                throw shc.conContext.fatal(Alert.INTERNAL_ERROR,
                     "No expected ECDHE possessions for client key exchange");
-                return;     // make the compiler happy
             }
 
             ECParameterSpec params = ecdhePossession.publicKey.getParams();
             NamedGroup namedGroup = NamedGroup.valueOf(params);
             if (namedGroup == null) {
                 // unlikely, have been checked during cipher suite negotiation.
-                shc.conContext.fatal(Alert.ILLEGAL_PARAMETER,
+                throw shc.conContext.fatal(Alert.ILLEGAL_PARAMETER,
                     "Unsupported EC server cert for ECDHE client key exchange");
             }
 
@@ -481,9 +478,8 @@
                     shc.negotiatedProtocol);
             if (ke == null) {
                 // unlikely
-                shc.conContext.fatal(Alert.INTERNAL_ERROR,
+                throw shc.conContext.fatal(Alert.INTERNAL_ERROR,
                         "Not supported key exchange type");
-                return;     // make the compiler happy
             }
 
             // parse the handshake message
@@ -529,7 +525,7 @@
                     SSLTrafficKeyDerivation.valueOf(shc.negotiatedProtocol);
             if (kd == null) {
                 // unlikely
-                shc.conContext.fatal(Alert.INTERNAL_ERROR,
+                throw shc.conContext.fatal(Alert.INTERNAL_ERROR,
                     "Not supported key derivation: " + shc.negotiatedProtocol);
             } else {
                 shc.handshakeKeyDerivation =
--- a/src/java.base/share/classes/sun/security/ssl/ECDHKeyExchange.java	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/java.base/share/classes/sun/security/ssl/ECDHKeyExchange.java	Tue Jan 15 10:55:26 2019 -0800
@@ -274,7 +274,7 @@
                 NamedGroup ng = NamedGroup.valueOf(params);
                 if (ng == null) {
                     // unlikely, have been checked during cipher suite negotiation.
-                    shc.conContext.fatal(Alert.ILLEGAL_PARAMETER,
+                    throw shc.conContext.fatal(Alert.ILLEGAL_PARAMETER,
                         "Unsupported EC server cert for ECDH key exchange");
                 }
 
@@ -295,7 +295,7 @@
             }
 
             if (x509Possession == null || ecdheCredentials == null) {
-                shc.conContext.fatal(Alert.HANDSHAKE_FAILURE,
+                throw shc.conContext.fatal(Alert.HANDSHAKE_FAILURE,
                     "No sufficient ECDHE key agreement parameters negotiated");
             }
 
@@ -327,7 +327,7 @@
                     NamedGroup namedGroup = NamedGroup.valueOf(params);
                     if (namedGroup == null) {
                         // unlikely, should have been checked previously
-                        chc.conContext.fatal(Alert.ILLEGAL_PARAMETER,
+                        throw chc.conContext.fatal(Alert.ILLEGAL_PARAMETER,
                             "Unsupported EC server cert for ECDH key exchange");
                     }
 
@@ -344,7 +344,7 @@
             }
 
             if (ecdhePossession == null || x509Credentials == null) {
-                chc.conContext.fatal(Alert.HANDSHAKE_FAILURE,
+                throw chc.conContext.fatal(Alert.HANDSHAKE_FAILURE,
                     "No sufficient ECDH key agreement parameters negotiated");
             }
 
@@ -388,7 +388,7 @@
             }
 
             if (ecdhePossession == null || ecdheCredentials == null) {
-                context.conContext.fatal(Alert.HANDSHAKE_FAILURE,
+                throw context.conContext.fatal(Alert.HANDSHAKE_FAILURE,
                     "No sufficient ECDHE key agreement parameters negotiated");
             }
 
--- a/src/java.base/share/classes/sun/security/ssl/ECDHServerKeyExchange.java	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/java.base/share/classes/sun/security/ssl/ECDHServerKeyExchange.java	Tue Jan 15 10:55:26 2019 -0800
@@ -113,7 +113,7 @@
 
             if (ecdhePossession == null) {
                 // unlikely
-                shc.conContext.fatal(Alert.ILLEGAL_PARAMETER,
+                throw shc.conContext.fatal(Alert.ILLEGAL_PARAMETER,
                     "No ECDHE credentials negotiated for server key exchange");
             }
 
@@ -125,7 +125,7 @@
             this.namedGroup = NamedGroup.valueOf(params);
             if ((namedGroup == null) || (namedGroup.oid == null) ) {
                 // unlikely
-                shc.conContext.fatal(Alert.ILLEGAL_PARAMETER,
+                throw shc.conContext.fatal(Alert.ILLEGAL_PARAMETER,
                     "Unnamed EC parameter spec: " + params);
             }
 
@@ -146,7 +146,7 @@
                     if (signatureScheme == null) {
                         // Unlikely, the credentials generator should have
                         // selected the preferable signature algorithm properly.
-                        shc.conContext.fatal(Alert.INTERNAL_ERROR,
+                        throw shc.conContext.fatal(Alert.INTERNAL_ERROR,
                                 "No preferred signature algorithm for " +
                                 x509Possession.popPrivateKey.getAlgorithm() +
                                 "  key");
@@ -156,7 +156,7 @@
                                 x509Possession.popPrivateKey);
                     } catch (NoSuchAlgorithmException | InvalidKeyException |
                             InvalidAlgorithmParameterException nsae) {
-                        shc.conContext.fatal(Alert.INTERNAL_ERROR,
+                        throw shc.conContext.fatal(Alert.INTERNAL_ERROR,
                             "Unsupported signature algorithm: " +
                             signatureScheme.name, nsae);
                     }
@@ -167,7 +167,7 @@
                                 x509Possession.popPrivateKey.getAlgorithm(),
                                 x509Possession.popPrivateKey);
                     } catch (NoSuchAlgorithmException | InvalidKeyException e) {
-                        shc.conContext.fatal(Alert.INTERNAL_ERROR,
+                        throw shc.conContext.fatal(Alert.INTERNAL_ERROR,
                             "Unsupported signature algorithm: " +
                             x509Possession.popPrivateKey.getAlgorithm(), e);
                     }
@@ -180,7 +180,7 @@
                             namedGroup.id, publicPoint);
                     signature = signer.sign();
                 } catch (SignatureException ex) {
-                    shc.conContext.fatal(Alert.INTERNAL_ERROR,
+                    throw shc.conContext.fatal(Alert.INTERNAL_ERROR,
                         "Failed to sign ecdhe parameters: " +
                         x509Possession.popPrivateKey.getAlgorithm(), ex);
                 }
@@ -199,37 +199,37 @@
             byte curveType = (byte)Record.getInt8(m);
             if (curveType != CURVE_NAMED_CURVE) {
                 // Unlikely as only the named curves should be negotiated.
-                chc.conContext.fatal(Alert.ILLEGAL_PARAMETER,
+                throw chc.conContext.fatal(Alert.ILLEGAL_PARAMETER,
                     "Unsupported ECCurveType: " + curveType);
             }
 
             int namedGroupId = Record.getInt16(m);
             this.namedGroup = NamedGroup.valueOf(namedGroupId);
             if (namedGroup == null) {
-                chc.conContext.fatal(Alert.ILLEGAL_PARAMETER,
+                throw chc.conContext.fatal(Alert.ILLEGAL_PARAMETER,
                     "Unknown named group ID: " + namedGroupId);
             }
 
             if (!SupportedGroups.isSupported(namedGroup)) {
-                chc.conContext.fatal(Alert.ILLEGAL_PARAMETER,
+                throw chc.conContext.fatal(Alert.ILLEGAL_PARAMETER,
                     "Unsupported named group: " + namedGroup);
             }
 
             if (namedGroup.oid == null) {
-                chc.conContext.fatal(Alert.ILLEGAL_PARAMETER,
+                throw chc.conContext.fatal(Alert.ILLEGAL_PARAMETER,
                     "Unknown named EC curve: " + namedGroup);
             }
 
             ECParameterSpec parameters =
                     JsseJce.getECParameterSpec(namedGroup.oid);
             if (parameters == null) {
-                chc.conContext.fatal(Alert.ILLEGAL_PARAMETER,
+                throw chc.conContext.fatal(Alert.ILLEGAL_PARAMETER,
                     "No supported EC parameter: " + namedGroup);
             }
 
             publicPoint = Record.getBytes8(m);
             if (publicPoint.length == 0) {
-                chc.conContext.fatal(Alert.ILLEGAL_PARAMETER,
+                throw chc.conContext.fatal(Alert.ILLEGAL_PARAMETER,
                     "Insufficient ECPoint data: " + namedGroup);
             }
 
@@ -242,7 +242,7 @@
                     new ECPublicKeySpec(point, parameters));
             } catch (NoSuchAlgorithmException |
                     InvalidKeySpecException | IOException ex) {
-                chc.conContext.fatal(Alert.ILLEGAL_PARAMETER,
+                throw chc.conContext.fatal(Alert.ILLEGAL_PARAMETER,
                     "Invalid ECPoint: " + namedGroup, ex);
             }
 
@@ -259,7 +259,7 @@
             if (x509Credentials == null) {
                 // anonymous, no authentication, no signature
                 if (m.hasRemaining()) {
-                    chc.conContext.fatal(Alert.HANDSHAKE_FAILURE,
+                    throw chc.conContext.fatal(Alert.HANDSHAKE_FAILURE,
                         "Invalid DH ServerKeyExchange: unknown extra data");
                 }
                 this.signatureScheme = null;
@@ -275,13 +275,13 @@
                 int ssid = Record.getInt16(m);
                 signatureScheme = SignatureScheme.valueOf(ssid);
                 if (signatureScheme == null) {
-                    chc.conContext.fatal(Alert.HANDSHAKE_FAILURE,
+                    throw chc.conContext.fatal(Alert.HANDSHAKE_FAILURE,
                         "Invalid signature algorithm (" + ssid +
                         ") used in ECDH ServerKeyExchange handshake message");
                 }
 
                 if (!chc.localSupportedSignAlgs.contains(signatureScheme)) {
-                    chc.conContext.fatal(Alert.HANDSHAKE_FAILURE,
+                    throw chc.conContext.fatal(Alert.HANDSHAKE_FAILURE,
                         "Unsupported signature algorithm (" +
                         signatureScheme.name +
                         ") used in ECDH ServerKeyExchange handshake message");
@@ -299,11 +299,9 @@
                             x509Credentials.popPublicKey);
                 } catch (NoSuchAlgorithmException | InvalidKeyException |
                         InvalidAlgorithmParameterException nsae) {
-                    chc.conContext.fatal(Alert.INTERNAL_ERROR,
+                    throw chc.conContext.fatal(Alert.INTERNAL_ERROR,
                         "Unsupported signature algorithm: " +
                         signatureScheme.name, nsae);
-
-                    return;     // make the compiler happe
                 }
             } else {
                 try {
@@ -311,11 +309,9 @@
                             x509Credentials.popPublicKey.getAlgorithm(),
                             x509Credentials.popPublicKey);
                 } catch (NoSuchAlgorithmException | InvalidKeyException e) {
-                    chc.conContext.fatal(Alert.INTERNAL_ERROR,
+                    throw chc.conContext.fatal(Alert.INTERNAL_ERROR,
                         "Unsupported signature algorithm: " +
                         x509Credentials.popPublicKey.getAlgorithm(), e);
-
-                    return;     // make the compiler happe
                 }
             }
 
@@ -326,11 +322,11 @@
                         namedGroup.id, publicPoint);
 
                 if (!signer.verify(paramsSignature)) {
-                    chc.conContext.fatal(Alert.HANDSHAKE_FAILURE,
+                    throw chc.conContext.fatal(Alert.HANDSHAKE_FAILURE,
                         "Invalid ECDH ServerKeyExchange signature");
                 }
             } catch (SignatureException ex) {
-                chc.conContext.fatal(Alert.HANDSHAKE_FAILURE,
+                throw chc.conContext.fatal(Alert.HANDSHAKE_FAILURE,
                         "Cannot verify ECDH ServerKeyExchange signature", ex);
             }
         }
@@ -546,7 +542,7 @@
             if (!chc.algorithmConstraints.permits(
                     EnumSet.of(CryptoPrimitive.KEY_AGREEMENT),
                     skem.publicKey)) {
-                chc.conContext.fatal(Alert.INSUFFICIENT_SECURITY,
+                throw chc.conContext.fatal(Alert.INSUFFICIENT_SECURITY,
                         "ECDH ServerKeyExchange does not comply " +
                         "to algorithm constraints");
             }
--- a/src/java.base/share/classes/sun/security/ssl/ECPointFormatsExtension.java	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/java.base/share/classes/sun/security/ssl/ECPointFormatsExtension.java	Tue Jan 15 10:55:26 2019 -0800
@@ -231,13 +231,12 @@
             try {
                 spec = new ECPointFormatsSpec(buffer);
             } catch (IOException ioe) {
-                shc.conContext.fatal(Alert.UNEXPECTED_MESSAGE, ioe);
-                return;     // fatal() always throws, make the compiler happy.
+                throw shc.conContext.fatal(Alert.UNEXPECTED_MESSAGE, ioe);
             }
 
             // per RFC 4492, uncompressed points must always be supported.
             if (!spec.hasUncompressedFormat()) {
-                shc.conContext.fatal(Alert.UNEXPECTED_MESSAGE,
+                throw shc.conContext.fatal(Alert.UNEXPECTED_MESSAGE,
                     "Invalid ec_point_formats extension data: " +
                     "peer does not support uncompressed points");
             }
@@ -272,7 +271,7 @@
             ECPointFormatsSpec requestedSpec = (ECPointFormatsSpec)
                     chc.handshakeExtensions.get(CH_EC_POINT_FORMATS);
             if (requestedSpec == null) {
-                chc.conContext.fatal(Alert.UNEXPECTED_MESSAGE,
+                throw chc.conContext.fatal(Alert.UNEXPECTED_MESSAGE,
                     "Unexpected ec_point_formats extension in ServerHello");
             }
 
@@ -281,13 +280,12 @@
             try {
                 spec = new ECPointFormatsSpec(buffer);
             } catch (IOException ioe) {
-                chc.conContext.fatal(Alert.UNEXPECTED_MESSAGE, ioe);
-                return;     // fatal() always throws, make the compiler happy.
+                throw chc.conContext.fatal(Alert.UNEXPECTED_MESSAGE, ioe);
             }
 
             // per RFC 4492, uncompressed points must always be supported.
             if (!spec.hasUncompressedFormat()) {
-                chc.conContext.fatal(Alert.UNEXPECTED_MESSAGE,
+                throw chc.conContext.fatal(Alert.UNEXPECTED_MESSAGE,
                         "Invalid ec_point_formats extension data: " +
                         "peer does not support uncompressed points");
             }
--- a/src/java.base/share/classes/sun/security/ssl/EncryptedExtensions.java	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/java.base/share/classes/sun/security/ssl/EncryptedExtensions.java	Tue Jan 15 10:55:26 2019 -0800
@@ -60,7 +60,7 @@
             //     Extension extensions<0..2^16-1>;
             // } EncryptedExtensions;
             if (m.remaining() < 2) {
-                handshakeContext.conContext.fatal(Alert.ILLEGAL_PARAMETER,
+                throw handshakeContext.conContext.fatal(Alert.ILLEGAL_PARAMETER,
                         "Invalid EncryptedExtensions handshake message: " +
                         "no sufficient data");
             }
--- a/src/java.base/share/classes/sun/security/ssl/ExtendedMasterSecretExtension.java	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/java.base/share/classes/sun/security/ssl/ExtendedMasterSecretExtension.java	Tue Jan 15 10:55:26 2019 -0800
@@ -172,8 +172,7 @@
             try {
                 spec = new ExtendedMasterSecretSpec(buffer);
             } catch (IOException ioe) {
-                shc.conContext.fatal(Alert.UNEXPECTED_MESSAGE, ioe);
-                return;     // fatal() always throws, make the compiler happy.
+                throw shc.conContext.fatal(Alert.UNEXPECTED_MESSAGE, ioe);
             }
 
             if (shc.isResumption && shc.resumingSession != null &&
@@ -232,7 +231,7 @@
                 //
                 // As if extended master extension is required for full
                 // handshake, it MUST be used in abbreviated handshake too.
-                shc.conContext.fatal(Alert.HANDSHAKE_FAILURE,
+                throw shc.conContext.fatal(Alert.HANDSHAKE_FAILURE,
                     "Extended Master Secret extension is required");
             }
 
@@ -242,7 +241,7 @@
                     // session used the "extended_master_secret" extension
                     // but the new ClientHello does not contain it, the
                     // server MUST abort the abbreviated handshake.
-                    shc.conContext.fatal(Alert.HANDSHAKE_FAILURE,
+                    throw shc.conContext.fatal(Alert.HANDSHAKE_FAILURE,
                             "Missing Extended Master Secret extension " +
                             "on session resumption");
                 } else {
@@ -250,7 +249,7 @@
                     // original session nor the new ClientHello uses the
                     // extension, the server SHOULD abort the handshake.
                     if (!SSLConfiguration.allowLegacyResumption) {
-                        shc.conContext.fatal(Alert.HANDSHAKE_FAILURE,
+                        throw shc.conContext.fatal(Alert.HANDSHAKE_FAILURE,
                             "Missing Extended Master Secret extension " +
                             "on session resumption");
                     } else {  // Otherwise, continue with a full handshake.
@@ -318,7 +317,7 @@
             ExtendedMasterSecretSpec requstedSpec = (ExtendedMasterSecretSpec)
                     chc.handshakeExtensions.get(CH_EXTENDED_MASTER_SECRET);
             if (requstedSpec == null) {
-                chc.conContext.fatal(Alert.UNSUPPORTED_EXTENSION,
+                throw chc.conContext.fatal(Alert.UNSUPPORTED_EXTENSION,
                         "Server sent the extended_master_secret " +
                         "extension improperly");
             }
@@ -328,13 +327,12 @@
             try {
                 spec = new ExtendedMasterSecretSpec(buffer);
             } catch (IOException ioe) {
-                chc.conContext.fatal(Alert.UNEXPECTED_MESSAGE, ioe);
-                return;     // fatal() always throws, make the compiler happy.
+                throw chc.conContext.fatal(Alert.UNEXPECTED_MESSAGE, ioe);
             }
 
             if (chc.isResumption && chc.resumingSession != null &&
                     !chc.resumingSession.useExtendedMasterSecret) {
-                chc.conContext.fatal(Alert.UNSUPPORTED_EXTENSION,
+                throw chc.conContext.fatal(Alert.UNSUPPORTED_EXTENSION,
                         "Server sent an unexpected extended_master_secret " +
                         "extension on session resumption");
             }
@@ -364,7 +362,7 @@
                 // For full handshake, if a client receives a ServerHello
                 // without the extension, it SHOULD abort the handshake if
                 // it does not wish to interoperate with legacy servers.
-                chc.conContext.fatal(Alert.HANDSHAKE_FAILURE,
+                throw chc.conContext.fatal(Alert.HANDSHAKE_FAILURE,
                         "Extended Master Secret extension is required");
             }
 
@@ -374,14 +372,14 @@
                     // the "extended_master_secret" extension but the new
                     // ServerHello does not contain the extension, the client
                     // MUST abort the handshake.
-                    chc.conContext.fatal(Alert.HANDSHAKE_FAILURE,
+                    throw chc.conContext.fatal(Alert.HANDSHAKE_FAILURE,
                             "Missing Extended Master Secret extension " +
                             "on session resumption");
                 } else if (SSLConfiguration.useExtendedMasterSecret &&
                         !SSLConfiguration.allowLegacyResumption &&
                         chc.negotiatedProtocol.useTLS10PlusSpec()) {
                     // Unlikely, abbreviated handshake should be discarded.
-                    chc.conContext.fatal(Alert.HANDSHAKE_FAILURE,
+                    throw chc.conContext.fatal(Alert.HANDSHAKE_FAILURE,
                         "Extended Master Secret extension is required");
                 }
             }
--- a/src/java.base/share/classes/sun/security/ssl/Finished.java	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/java.base/share/classes/sun/security/ssl/Finished.java	Tue Jan 15 10:55:26 2019 -0800
@@ -83,7 +83,7 @@
             try {
                 vd = vds.createVerifyData(context, false);
             } catch (IOException ioe) {
-                context.conContext.fatal(Alert.ILLEGAL_PARAMETER,
+                throw context.conContext.fatal(Alert.ILLEGAL_PARAMETER,
                         "Failed to generate verify_data", ioe);
             }
 
@@ -102,7 +102,7 @@
             }
 
             if (m.remaining() != verifyDataLen) {
-                context.conContext.fatal(Alert.ILLEGAL_PARAMETER,
+                throw context.conContext.fatal(Alert.ILLEGAL_PARAMETER,
                     "Inappropriate finished message: need " + verifyDataLen +
                     " but remaining " + m.remaining() + " bytes verify_data");
             }
@@ -116,12 +116,11 @@
             try {
                 myVerifyData = vd.createVerifyData(context, true);
             } catch (IOException ioe) {
-                context.conContext.fatal(Alert.ILLEGAL_PARAMETER,
+                throw context.conContext.fatal(Alert.ILLEGAL_PARAMETER,
                         "Failed to generate verify_data", ioe);
-                return;     // make the compiler happy
             }
             if (!MessageDigest.isEqual(myVerifyData, verifyData)) {
-                context.conContext.fatal(Alert.ILLEGAL_PARAMETER,
+                throw context.conContext.fatal(Alert.ILLEGAL_PARAMETER,
                         "The Finished message cannot be verified.");
             }
         }
@@ -518,7 +517,7 @@
             // we have received ChangeCipherSpec
             if (hc.conContext.consumers.containsKey(
                     ContentType.CHANGE_CIPHER_SPEC.id)) {
-                hc.conContext.fatal(Alert.UNEXPECTED_MESSAGE,
+                throw hc.conContext.fatal(Alert.UNEXPECTED_MESSAGE,
                         "Missing ChangeCipherSpec message");
             }
 
@@ -679,19 +678,17 @@
             SSLKeyDerivation kd = chc.handshakeKeyDerivation;
             if (kd == null) {
                 // unlikely
-                chc.conContext.fatal(Alert.INTERNAL_ERROR,
+                throw chc.conContext.fatal(Alert.INTERNAL_ERROR,
                     "no key derivation");
-                return null;    // make the compiler happy
             }
 
             SSLTrafficKeyDerivation kdg =
                     SSLTrafficKeyDerivation.valueOf(chc.negotiatedProtocol);
             if (kdg == null) {
                 // unlikely
-                chc.conContext.fatal(Alert.INTERNAL_ERROR,
+                throw chc.conContext.fatal(Alert.INTERNAL_ERROR,
                         "Not supported key derivation: " +
                         chc.negotiatedProtocol);
-                return null;    // make the compiler happy
             }
 
             try {
@@ -713,22 +710,29 @@
                                 chc.negotiatedProtocol, writeKey, writeIv,
                                 chc.sslContext.getSecureRandom());
 
+                if (writeCipher == null) {
+                    throw chc.conContext.fatal(Alert.ILLEGAL_PARAMETER,
+                        "Illegal cipher suite (" + chc.negotiatedCipherSuite +
+                        ") and protocol version (" + chc.negotiatedProtocol +
+                        ")");
+                }
+
                 chc.baseWriteSecret = writeSecret;
                 chc.conContext.outputRecord.changeWriteCiphers(
                         writeCipher, false);
 
             } catch (GeneralSecurityException gse) {
-                chc.conContext.fatal(Alert.INTERNAL_ERROR,
+                throw chc.conContext.fatal(Alert.INTERNAL_ERROR,
                         "Failure to derive application secrets", gse);
-                return null;    // make the compiler happy
             }
 
             // The resumption master secret is stored in the session so
             // it can be used after the handshake is completed.
             SSLSecretDerivation sd = ((SSLSecretDerivation) kd).forContext(chc);
             SecretKey resumptionMasterSecret = sd.deriveKey(
-            "TlsResumptionMasterSecret", null);
-            chc.handshakeSession.setResumptionMasterSecret(resumptionMasterSecret);
+                    "TlsResumptionMasterSecret", null);
+            chc.handshakeSession.setResumptionMasterSecret(
+                    resumptionMasterSecret);
 
             chc.conContext.conSession = chc.handshakeSession.finish();
             chc.conContext.protocolVersion = chc.negotiatedProtocol;
@@ -762,19 +766,17 @@
             SSLKeyDerivation kd = shc.handshakeKeyDerivation;
             if (kd == null) {
                 // unlikely
-                shc.conContext.fatal(Alert.INTERNAL_ERROR,
+                throw shc.conContext.fatal(Alert.INTERNAL_ERROR,
                     "no key derivation");
-                return null;    // make the compiler happy
             }
 
             SSLTrafficKeyDerivation kdg =
                     SSLTrafficKeyDerivation.valueOf(shc.negotiatedProtocol);
             if (kdg == null) {
                 // unlikely
-                shc.conContext.fatal(Alert.INTERNAL_ERROR,
+                throw shc.conContext.fatal(Alert.INTERNAL_ERROR,
                         "Not supported key derivation: " +
                         shc.negotiatedProtocol);
-                return null;    // make the compiler happy
             }
 
             // derive salt secret
@@ -810,6 +812,13 @@
                                 shc.negotiatedProtocol, writeKey, writeIv,
                                 shc.sslContext.getSecureRandom());
 
+                if (writeCipher == null) {
+                    throw shc.conContext.fatal(Alert.ILLEGAL_PARAMETER,
+                        "Illegal cipher suite (" + shc.negotiatedCipherSuite +
+                        ") and protocol version (" + shc.negotiatedProtocol +
+                        ")");
+                }
+
                 shc.baseWriteSecret = writeSecret;
                 shc.conContext.outputRecord.changeWriteCiphers(
                         writeCipher, false);
@@ -817,9 +826,8 @@
                 // update the context for the following key derivation
                 shc.handshakeKeyDerivation = secretKD;
             } catch (GeneralSecurityException gse) {
-                shc.conContext.fatal(Alert.INTERNAL_ERROR,
+                throw shc.conContext.fatal(Alert.INTERNAL_ERROR,
                         "Failure to derive application secrets", gse);
-                return null;    // make the compiler happy
             }
 
             /*
@@ -892,19 +900,17 @@
             SSLKeyDerivation kd = chc.handshakeKeyDerivation;
             if (kd == null) {
                 // unlikely
-                chc.conContext.fatal(Alert.INTERNAL_ERROR,
+                throw chc.conContext.fatal(Alert.INTERNAL_ERROR,
                     "no key derivation");
-                return;    // make the compiler happy
             }
 
             SSLTrafficKeyDerivation kdg =
                     SSLTrafficKeyDerivation.valueOf(chc.negotiatedProtocol);
             if (kdg == null) {
                 // unlikely
-                chc.conContext.fatal(Alert.INTERNAL_ERROR,
+                throw chc.conContext.fatal(Alert.INTERNAL_ERROR,
                         "Not supported key derivation: " +
                         chc.negotiatedProtocol);
-                return;    // make the compiler happy
             }
 
             // save the session
@@ -947,15 +953,21 @@
                                 chc.negotiatedProtocol, readKey, readIv,
                                 chc.sslContext.getSecureRandom());
 
+                if (readCipher == null) {
+                    throw chc.conContext.fatal(Alert.ILLEGAL_PARAMETER,
+                        "Illegal cipher suite (" + chc.negotiatedCipherSuite +
+                        ") and protocol version (" + chc.negotiatedProtocol +
+                        ")");
+                }
+
                 chc.baseReadSecret = readSecret;
                 chc.conContext.inputRecord.changeReadCiphers(readCipher);
 
                 // update the context for the following key derivation
                 chc.handshakeKeyDerivation = secretKD;
             } catch (GeneralSecurityException gse) {
-                chc.conContext.fatal(Alert.INTERNAL_ERROR,
+                throw chc.conContext.fatal(Alert.INTERNAL_ERROR,
                         "Failure to derive application secrets", gse);
-                return;    // make the compiler happy
             }
 
             //
@@ -1003,19 +1015,17 @@
             SSLKeyDerivation kd = shc.handshakeKeyDerivation;
             if (kd == null) {
                 // unlikely
-                shc.conContext.fatal(Alert.INTERNAL_ERROR,
+                throw shc.conContext.fatal(Alert.INTERNAL_ERROR,
                     "no key derivation");
-                return;    // make the compiler happy
             }
 
             SSLTrafficKeyDerivation kdg =
                     SSLTrafficKeyDerivation.valueOf(shc.negotiatedProtocol);
             if (kdg == null) {
                 // unlikely
-                shc.conContext.fatal(Alert.INTERNAL_ERROR,
+                throw shc.conContext.fatal(Alert.INTERNAL_ERROR,
                         "Not supported key derivation: " +
                         shc.negotiatedProtocol);
-                return;    // make the compiler happy
             }
 
             // save the session
@@ -1044,20 +1054,28 @@
                                 shc.negotiatedProtocol, readKey, readIv,
                                 shc.sslContext.getSecureRandom());
 
+                if (readCipher == null) {
+                    throw shc.conContext.fatal(Alert.ILLEGAL_PARAMETER,
+                        "Illegal cipher suite (" + shc.negotiatedCipherSuite +
+                        ") and protocol version (" + shc.negotiatedProtocol +
+                        ")");
+                }
+
                 shc.baseReadSecret = readSecret;
                 shc.conContext.inputRecord.changeReadCiphers(readCipher);
 
                 // The resumption master secret is stored in the session so
                 // it can be used after the handshake is completed.
                 shc.handshakeHash.update();
-                SSLSecretDerivation sd = ((SSLSecretDerivation)kd).forContext(shc);
+                SSLSecretDerivation sd =
+                        ((SSLSecretDerivation)kd).forContext(shc);
                 SecretKey resumptionMasterSecret = sd.deriveKey(
                 "TlsResumptionMasterSecret", null);
-                shc.handshakeSession.setResumptionMasterSecret(resumptionMasterSecret);
+                shc.handshakeSession.setResumptionMasterSecret(
+                        resumptionMasterSecret);
             } catch (GeneralSecurityException gse) {
-                shc.conContext.fatal(Alert.INTERNAL_ERROR,
+                throw shc.conContext.fatal(Alert.INTERNAL_ERROR,
                         "Failure to derive application secrets", gse);
-                return;    // make the compiler happy
             }
 
             //  update connection context
--- a/src/java.base/share/classes/sun/security/ssl/HandshakeContext.java	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/java.base/share/classes/sun/security/ssl/HandshakeContext.java	Tue Jan 15 10:55:26 2019 -0800
@@ -365,26 +365,20 @@
         //     } Handshake;
 
         if (plaintext.contentType != ContentType.HANDSHAKE.id) {
-            conContext.fatal(Alert.INTERNAL_ERROR,
+            throw conContext.fatal(Alert.INTERNAL_ERROR,
                 "Unexpected operation for record: " + plaintext.contentType);
-
-            return 0;
         }
 
         if (plaintext.fragment == null || plaintext.fragment.remaining() < 4) {
-            conContext.fatal(Alert.UNEXPECTED_MESSAGE,
+            throw conContext.fatal(Alert.UNEXPECTED_MESSAGE,
                     "Invalid handshake message: insufficient data");
-
-            return 0;
         }
 
         byte handshakeType = (byte)Record.getInt8(plaintext.fragment);
         int handshakeLen = Record.getInt24(plaintext.fragment);
         if (handshakeLen != plaintext.fragment.remaining()) {
-            conContext.fatal(Alert.UNEXPECTED_MESSAGE,
+            throw conContext.fatal(Alert.UNEXPECTED_MESSAGE,
                     "Invalid handshake message: insufficient handshake body");
-
-            return 0;
         }
 
         return handshakeType;
@@ -438,16 +432,15 @@
         }
 
         if (consumer == null) {
-            conContext.fatal(Alert.UNEXPECTED_MESSAGE,
+            throw conContext.fatal(Alert.UNEXPECTED_MESSAGE,
                     "Unexpected handshake message: " +
                     SSLHandshake.nameOf(handshakeType));
-            return;
         }
 
         try {
             consumer.consume(this, fragment);
         } catch (UnsupportedOperationException unsoe) {
-            conContext.fatal(Alert.UNEXPECTED_MESSAGE,
+            throw conContext.fatal(Alert.UNEXPECTED_MESSAGE,
                     "Unsupported handshake message: " +
                     SSLHandshake.nameOf(handshakeType), unsoe);
         }
--- a/src/java.base/share/classes/sun/security/ssl/HelloRequest.java	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/java.base/share/classes/sun/security/ssl/HelloRequest.java	Tue Jan 15 10:55:26 2019 -0800
@@ -59,7 +59,7 @@
                 ByteBuffer m) throws IOException {
             super(handshakeContext);
             if (m.hasRemaining()) {
-                handshakeContext.conContext.fatal(Alert.ILLEGAL_PARAMETER,
+                throw handshakeContext.conContext.fatal(Alert.ILLEGAL_PARAMETER,
                     "Error parsing HelloRequest message: not empty");
             }
         }
@@ -185,7 +185,7 @@
             if (!chc.kickstartMessageDelivered) {
                 if (!chc.conContext.secureRenegotiation &&
                         !HandshakeContext.allowUnsafeRenegotiation) {
-                    chc.conContext.fatal(Alert.HANDSHAKE_FAILURE,
+                    throw chc.conContext.fatal(Alert.HANDSHAKE_FAILURE,
                             "Unsafe renegotiation is not allowed");
                 }
 
--- a/src/java.base/share/classes/sun/security/ssl/HelloVerifyRequest.java	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/java.base/share/classes/sun/security/ssl/HelloVerifyRequest.java	Tue Jan 15 10:55:26 2019 -0800
@@ -73,7 +73,7 @@
             //      opaque cookie<0..2^8-1>;
             //  } HelloVerifyRequest;
             if (m.remaining() < 3) {
-                chc.conContext.fatal(Alert.ILLEGAL_PARAMETER,
+                throw chc.conContext.fatal(Alert.ILLEGAL_PARAMETER,
                     "Invalid HelloVerifyRequest: no sufficient data");
             }
 
@@ -186,7 +186,7 @@
                 chc.handshakeConsumers.remove(SSLHandshake.SERVER_HELLO.id);
             }
             if (!chc.handshakeConsumers.isEmpty()) {
-                chc.conContext.fatal(Alert.UNEXPECTED_MESSAGE,
+                throw chc.conContext.fatal(Alert.UNEXPECTED_MESSAGE,
                         "No more message expected before " +
                         "HelloVerifyRequest is processed");
             }
--- a/src/java.base/share/classes/sun/security/ssl/KeyShareExtension.java	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/java.base/share/classes/sun/security/ssl/KeyShareExtension.java	Tue Jan 15 10:55:26 2019 -0800
@@ -337,8 +337,7 @@
             try {
                 spec = new CHKeyShareSpec(buffer);
             } catch (IOException ioe) {
-                shc.conContext.fatal(Alert.UNEXPECTED_MESSAGE, ioe);
-                return;     // fatal() always throws, make the compiler happy.
+                throw shc.conContext.fatal(Alert.UNEXPECTED_MESSAGE, ioe);
             }
 
             List<SSLCredentials> credentials = new LinkedList<>();
@@ -610,16 +609,14 @@
             if (chc.clientRequestedNamedGroups == null ||
                     chc.clientRequestedNamedGroups.isEmpty()) {
                 // No supported groups.
-                chc.conContext.fatal(Alert.UNEXPECTED_MESSAGE,
+                throw chc.conContext.fatal(Alert.UNEXPECTED_MESSAGE,
                         "Unexpected key_share extension in ServerHello");
-                return;     // fatal() always throws, make the compiler happy.
             }
 
             // Is it a supported and enabled extension?
             if (!chc.sslConfig.isAvailable(SSLExtension.SH_KEY_SHARE)) {
-                chc.conContext.fatal(Alert.UNEXPECTED_MESSAGE,
+                throw chc.conContext.fatal(Alert.UNEXPECTED_MESSAGE,
                         "Unsupported key_share extension in ServerHello");
-                return;     // fatal() always throws, make the compiler happy.
             }
 
             // Parse the extension
@@ -627,25 +624,22 @@
             try {
                 spec = new SHKeyShareSpec(buffer);
             } catch (IOException ioe) {
-                chc.conContext.fatal(Alert.UNEXPECTED_MESSAGE, ioe);
-                return;     // fatal() always throws, make the compiler happy.
+                throw chc.conContext.fatal(Alert.UNEXPECTED_MESSAGE, ioe);
             }
 
             KeyShareEntry keyShare = spec.serverShare;
             NamedGroup ng = NamedGroup.valueOf(keyShare.namedGroupId);
             if (ng == null || !SupportedGroups.isActivatable(
                     chc.sslConfig.algorithmConstraints, ng)) {
-                chc.conContext.fatal(Alert.UNEXPECTED_MESSAGE,
+                throw chc.conContext.fatal(Alert.UNEXPECTED_MESSAGE,
                         "Unsupported named group: " +
                         NamedGroup.nameOf(keyShare.namedGroupId));
-                return;     // fatal() always throws, make the compiler happy.
             }
 
             SSLKeyExchange ke = SSLKeyExchange.valueOf(ng);
             if (ke == null) {
-                chc.conContext.fatal(Alert.UNEXPECTED_MESSAGE,
+                throw chc.conContext.fatal(Alert.UNEXPECTED_MESSAGE,
                         "No key exchange for named group " + ng.name);
-                return;     // fatal() always throws, make the compiler happy.
             }
 
             SSLCredentials credentials = null;
@@ -657,7 +651,7 @@
                         if (!chc.algorithmConstraints.permits(
                                 EnumSet.of(CryptoPrimitive.KEY_AGREEMENT),
                                 ecdhec.popPublicKey)) {
-                            chc.conContext.fatal(Alert.UNEXPECTED_MESSAGE,
+                            throw chc.conContext.fatal(Alert.UNEXPECTED_MESSAGE,
                                     "ECDHE key share entry does not " +
                                     "comply to algorithm constraints");
                         } else {
@@ -665,7 +659,7 @@
                         }
                     }
                 } catch (IOException | GeneralSecurityException ex) {
-                    chc.conContext.fatal(Alert.UNEXPECTED_MESSAGE,
+                    throw chc.conContext.fatal(Alert.UNEXPECTED_MESSAGE,
                             "Cannot decode named group: " +
                             NamedGroup.nameOf(keyShare.namedGroupId));
                 }
@@ -677,7 +671,7 @@
                         if (!chc.algorithmConstraints.permits(
                                 EnumSet.of(CryptoPrimitive.KEY_AGREEMENT),
                                 dhec.popPublicKey)) {
-                            chc.conContext.fatal(Alert.UNEXPECTED_MESSAGE,
+                            throw chc.conContext.fatal(Alert.UNEXPECTED_MESSAGE,
                                     "DHE key share entry does not " +
                                     "comply to algorithm constraints");
                         } else {
@@ -685,18 +679,18 @@
                         }
                     }
                 } catch (IOException | GeneralSecurityException ex) {
-                    chc.conContext.fatal(Alert.UNEXPECTED_MESSAGE,
+                    throw chc.conContext.fatal(Alert.UNEXPECTED_MESSAGE,
                             "Cannot decode named group: " +
                             NamedGroup.nameOf(keyShare.namedGroupId));
                 }
             } else {
-                chc.conContext.fatal(Alert.UNEXPECTED_MESSAGE,
+                throw chc.conContext.fatal(Alert.UNEXPECTED_MESSAGE,
                         "Unsupported named group: " +
                         NamedGroup.nameOf(keyShare.namedGroupId));
             }
 
             if (credentials == null) {
-                chc.conContext.fatal(Alert.UNEXPECTED_MESSAGE,
+                throw chc.conContext.fatal(Alert.UNEXPECTED_MESSAGE,
                         "Unsupported named group: " + ng.name);
             }
 
@@ -794,17 +788,15 @@
 
             // Is it a supported and enabled extension?
             if (!shc.sslConfig.isAvailable(SSLExtension.HRR_KEY_SHARE)) {
-                shc.conContext.fatal(Alert.UNEXPECTED_MESSAGE,
+                throw shc.conContext.fatal(Alert.UNEXPECTED_MESSAGE,
                         "Unsupported key_share extension in HelloRetryRequest");
-                return null;    // make the compiler happy.
             }
 
             if (shc.clientRequestedNamedGroups == null ||
                     shc.clientRequestedNamedGroups.isEmpty()) {
                 // No supported groups.
-                shc.conContext.fatal(Alert.UNEXPECTED_MESSAGE,
+                throw shc.conContext.fatal(Alert.UNEXPECTED_MESSAGE,
                         "Unexpected key_share extension in HelloRetryRequest");
-                return null;    // make the compiler happy.
             }
 
             NamedGroup selectedGroup = null;
@@ -823,9 +815,8 @@
             }
 
             if (selectedGroup == null) {
-                shc.conContext.fatal(Alert.UNEXPECTED_MESSAGE,
-                        new IOException("No common named group"));
-                return null;    // make the complier happy
+                throw shc.conContext.fatal(
+                        Alert.UNEXPECTED_MESSAGE, "No common named group");
             }
 
             byte[] extdata = new byte[] {
@@ -861,9 +852,8 @@
 
             // Is it a supported and enabled extension?
             if (!shc.sslConfig.isAvailable(SSLExtension.HRR_KEY_SHARE)) {
-                shc.conContext.fatal(Alert.UNEXPECTED_MESSAGE,
+                throw shc.conContext.fatal(Alert.UNEXPECTED_MESSAGE,
                         "Unsupported key_share extension in HelloRetryRequest");
-                return null;    // make the compiler happy.
             }
 
             CHKeyShareSpec spec = (CHKeyShareSpec)shc.handshakeExtensions.get(
@@ -903,17 +893,15 @@
 
             // Is it a supported and enabled extension?
             if (!chc.sslConfig.isAvailable(SSLExtension.HRR_KEY_SHARE)) {
-                chc.conContext.fatal(Alert.UNEXPECTED_MESSAGE,
+                throw chc.conContext.fatal(Alert.UNEXPECTED_MESSAGE,
                         "Unsupported key_share extension in HelloRetryRequest");
-                return;     // make the compiler happy.
             }
 
             if (chc.clientRequestedNamedGroups == null ||
                     chc.clientRequestedNamedGroups.isEmpty()) {
                 // No supported groups.
-                chc.conContext.fatal(Alert.UNEXPECTED_MESSAGE,
+                throw chc.conContext.fatal(Alert.UNEXPECTED_MESSAGE,
                         "Unexpected key_share extension in HelloRetryRequest");
-                return;     // make the compiler happy.
             }
 
             // Parse the extension
@@ -921,23 +909,20 @@
             try {
                 spec = new HRRKeyShareSpec(buffer);
             } catch (IOException ioe) {
-                chc.conContext.fatal(Alert.UNEXPECTED_MESSAGE, ioe);
-                return;     // fatal() always throws, make the compiler happy.
+                throw chc.conContext.fatal(Alert.UNEXPECTED_MESSAGE, ioe);
             }
 
             NamedGroup serverGroup = NamedGroup.valueOf(spec.selectedGroup);
             if (serverGroup == null) {
-                chc.conContext.fatal(Alert.UNEXPECTED_MESSAGE,
+                throw chc.conContext.fatal(Alert.UNEXPECTED_MESSAGE,
                         "Unsupported HelloRetryRequest selected group: " +
                                 NamedGroup.nameOf(spec.selectedGroup));
-                return;     // fatal() always throws, make the compiler happy.
             }
 
             if (!chc.clientRequestedNamedGroups.contains(serverGroup)) {
-                chc.conContext.fatal(Alert.UNEXPECTED_MESSAGE,
+                throw chc.conContext.fatal(Alert.UNEXPECTED_MESSAGE,
                         "Unexpected HelloRetryRequest selected group: " +
                                 serverGroup.name);
-                return;     // fatal() always throws, make the compiler happy.
             }
 
             // update the context
--- a/src/java.base/share/classes/sun/security/ssl/KeyUpdate.java	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/java.base/share/classes/sun/security/ssl/KeyUpdate.java	Tue Jan 15 10:55:26 2019 -0800
@@ -78,7 +78,7 @@
             super(context);
 
             if (m.remaining() != 1) {
-                context.conContext.fatal(Alert.ILLEGAL_PARAMETER,
+                throw context.conContext.fatal(Alert.ILLEGAL_PARAMETER,
                         "KeyUpdate has an unexpected length of "+
                         m.remaining());
             }
@@ -86,7 +86,7 @@
             byte request = m.get();
             this.status = KeyUpdateRequest.valueOf(request);
             if (status == null) {
-                context.conContext.fatal(Alert.ILLEGAL_PARAMETER,
+                throw context.conContext.fatal(Alert.ILLEGAL_PARAMETER,
                         "Invalid KeyUpdate message value: " +
                         KeyUpdateRequest.nameOf(request));
             }
@@ -198,18 +198,17 @@
                 SSLTrafficKeyDerivation.valueOf(hc.conContext.protocolVersion);
             if (kdg == null) {
                 // unlikely
-                hc.conContext.fatal(Alert.INTERNAL_ERROR,
+                throw hc.conContext.fatal(Alert.INTERNAL_ERROR,
                         "Not supported key derivation: " +
                                 hc.conContext.protocolVersion);
-                return;
             }
 
             SSLKeyDerivation skd = kdg.createKeyDerivation(hc,
                     hc.conContext.inputRecord.readCipher.baseSecret);
             if (skd == null) {
                 // unlikely
-                hc.conContext.fatal(Alert.INTERNAL_ERROR, "no key derivation");
-                return;
+                throw hc.conContext.fatal(
+                        Alert.INTERNAL_ERROR, "no key derivation");
             }
 
             SecretKey nplus1 = skd.deriveKey("TlsUpdateNplus1", null);
@@ -223,15 +222,22 @@
                         Authenticator.valueOf(hc.conContext.protocolVersion),
                         hc.conContext.protocolVersion, key, ivSpec,
                         hc.sslContext.getSecureRandom());
+
+                if (rc == null) {
+                    throw hc.conContext.fatal(Alert.ILLEGAL_PARAMETER,
+                        "Illegal cipher suite (" + hc.negotiatedCipherSuite +
+                        ") and protocol version (" + hc.negotiatedProtocol +
+                        ")");
+                }
+
                 rc.baseSecret = nplus1;
                 hc.conContext.inputRecord.changeReadCiphers(rc);
                 if (SSLLogger.isOn && SSLLogger.isOn("ssl")) {
                     SSLLogger.fine("KeyUpdate: read key updated");
                 }
             } catch (GeneralSecurityException gse) {
-                hc.conContext.fatal(Alert.INTERNAL_ERROR,
+                throw hc.conContext.fatal(Alert.INTERNAL_ERROR,
                         "Failure to derive read secrets", gse);
-                return;
             }
 
             if (km.status == KeyUpdateRequest.REQUESTED) {
@@ -271,18 +277,17 @@
                 SSLTrafficKeyDerivation.valueOf(hc.conContext.protocolVersion);
             if (kdg == null) {
                 // unlikely
-                hc.conContext.fatal(Alert.INTERNAL_ERROR,
+                throw hc.conContext.fatal(Alert.INTERNAL_ERROR,
                         "Not supported key derivation: " +
                                 hc.conContext.protocolVersion);
-                return null;
             }
 
             SSLKeyDerivation skd = kdg.createKeyDerivation(hc,
                     hc.conContext.outputRecord.writeCipher.baseSecret);
             if (skd == null) {
                 // unlikely
-                hc.conContext.fatal(Alert.INTERNAL_ERROR, "no key derivation");
-                return null;
+                throw hc.conContext.fatal(
+                        Alert.INTERNAL_ERROR, "no key derivation");
             }
 
             SecretKey nplus1 = skd.deriveKey("TlsUpdateNplus1", null);
@@ -298,9 +303,14 @@
                         hc.conContext.protocolVersion, key, ivSpec,
                         hc.sslContext.getSecureRandom());
             } catch (GeneralSecurityException gse) {
-                hc.conContext.fatal(Alert.INTERNAL_ERROR,
+                throw hc.conContext.fatal(Alert.INTERNAL_ERROR,
                         "Failure to derive write secrets", gse);
-                return null;
+            }
+
+            if (wc == null) {
+                throw hc.conContext.fatal(Alert.ILLEGAL_PARAMETER,
+                    "Illegal cipher suite (" + hc.negotiatedCipherSuite +
+                    ") and protocol version (" + hc.negotiatedProtocol + ")");
             }
 
             // Output the handshake message and change the write cipher.
--- a/src/java.base/share/classes/sun/security/ssl/MaxFragExtension.java	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/java.base/share/classes/sun/security/ssl/MaxFragExtension.java	Tue Jan 15 10:55:26 2019 -0800
@@ -253,13 +253,12 @@
             try {
                 spec = new MaxFragLenSpec(buffer);
             } catch (IOException ioe) {
-                shc.conContext.fatal(Alert.UNEXPECTED_MESSAGE, ioe);
-                return;     // fatal() always throws, make the compiler happy.
+                throw shc.conContext.fatal(Alert.UNEXPECTED_MESSAGE, ioe);
             }
 
             MaxFragLenEnum mfle = MaxFragLenEnum.valueOf(spec.id);
             if (mfle == null) {
-                shc.conContext.fatal(Alert.ILLEGAL_PARAMETER,
+                throw shc.conContext.fatal(Alert.ILLEGAL_PARAMETER,
                     "the requested maximum fragment length is other " +
                     "than the allowed values");
             }
@@ -359,7 +358,7 @@
             MaxFragLenSpec requestedSpec = (MaxFragLenSpec)
                     chc.handshakeExtensions.get(CH_MAX_FRAGMENT_LENGTH);
             if (requestedSpec == null) {
-                chc.conContext.fatal(Alert.UNEXPECTED_MESSAGE,
+                throw chc.conContext.fatal(Alert.UNEXPECTED_MESSAGE,
                     "Unexpected max_fragment_length extension in ServerHello");
             }
 
@@ -368,18 +367,17 @@
             try {
                 spec = new MaxFragLenSpec(buffer);
             } catch (IOException ioe) {
-                chc.conContext.fatal(Alert.UNEXPECTED_MESSAGE, ioe);
-                return;     // fatal() always throws, make the compiler happy.
+                throw chc.conContext.fatal(Alert.UNEXPECTED_MESSAGE, ioe);
             }
 
             if (spec.id != requestedSpec.id) {
-                chc.conContext.fatal(Alert.ILLEGAL_PARAMETER,
+                throw chc.conContext.fatal(Alert.ILLEGAL_PARAMETER,
                     "The maximum fragment length response is not requested");
             }
 
             MaxFragLenEnum mfle = MaxFragLenEnum.valueOf(spec.id);
             if (mfle == null) {
-                chc.conContext.fatal(Alert.ILLEGAL_PARAMETER,
+                throw chc.conContext.fatal(Alert.ILLEGAL_PARAMETER,
                     "the requested maximum fragment length is other " +
                     "than the allowed values");
             }
@@ -532,7 +530,7 @@
             MaxFragLenSpec requestedSpec = (MaxFragLenSpec)
                     chc.handshakeExtensions.get(CH_MAX_FRAGMENT_LENGTH);
             if (requestedSpec == null) {
-                chc.conContext.fatal(Alert.UNEXPECTED_MESSAGE,
+                throw chc.conContext.fatal(Alert.UNEXPECTED_MESSAGE,
                     "Unexpected max_fragment_length extension in ServerHello");
             }
 
@@ -541,18 +539,17 @@
             try {
                 spec = new MaxFragLenSpec(buffer);
             } catch (IOException ioe) {
-                chc.conContext.fatal(Alert.UNEXPECTED_MESSAGE, ioe);
-                return;     // fatal() always throws, make the compiler happy.
+                throw chc.conContext.fatal(Alert.UNEXPECTED_MESSAGE, ioe);
             }
 
             if (spec.id != requestedSpec.id) {
-                chc.conContext.fatal(Alert.ILLEGAL_PARAMETER,
+                throw chc.conContext.fatal(Alert.ILLEGAL_PARAMETER,
                     "The maximum fragment length response is not requested");
             }
 
             MaxFragLenEnum mfle = MaxFragLenEnum.valueOf(spec.id);
             if (mfle == null) {
-                chc.conContext.fatal(Alert.ILLEGAL_PARAMETER,
+                throw chc.conContext.fatal(Alert.ILLEGAL_PARAMETER,
                     "the requested maximum fragment length is other " +
                     "than the allowed values");
             }
--- a/src/java.base/share/classes/sun/security/ssl/NewSessionTicket.java	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/java.base/share/classes/sun/security/ssl/NewSessionTicket.java	Tue Jan 15 10:55:26 2019 -0800
@@ -86,7 +86,7 @@
             //     Extension extensions<0..2^16-2>;
             // } NewSessionTicket;
             if (m.remaining() < 14) {
-                context.conContext.fatal(Alert.ILLEGAL_PARAMETER,
+                throw context.conContext.fatal(Alert.ILLEGAL_PARAMETER,
                     "Invalid NewSessionTicket message: no sufficient data");
             }
 
@@ -95,18 +95,18 @@
             this.ticketNonce = Record.getBytes8(m);
 
             if (m.remaining() < 5) {
-                context.conContext.fatal(Alert.ILLEGAL_PARAMETER,
+                throw context.conContext.fatal(Alert.ILLEGAL_PARAMETER,
                     "Invalid NewSessionTicket message: no sufficient data");
             }
 
             this.ticket = Record.getBytes16(m);
             if (ticket.length == 0) {
-                context.conContext.fatal(Alert.ILLEGAL_PARAMETER,
+                throw context.conContext.fatal(Alert.ILLEGAL_PARAMETER,
                     "No ticket in the NewSessionTicket handshake message");
             }
 
             if (m.remaining() < 2) {
-                context.conContext.fatal(Alert.ILLEGAL_PARAMETER,
+                throw context.conContext.fatal(Alert.ILLEGAL_PARAMETER,
                     "Invalid NewSessionTicket message: no sufficient data");
             }
 
--- a/src/java.base/share/classes/sun/security/ssl/PostHandshakeContext.java	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/java.base/share/classes/sun/security/ssl/PostHandshakeContext.java	Tue Jan 15 10:55:26 2019 -0800
@@ -43,7 +43,7 @@
         super(context);
 
         if (!negotiatedProtocol.useTLS13PlusSpec()) {
-            conContext.fatal(Alert.UNEXPECTED_MESSAGE,
+            throw conContext.fatal(Alert.UNEXPECTED_MESSAGE,
                 "Post-handshake not supported in " + negotiatedProtocol.name);
         }
 
@@ -63,16 +63,15 @@
     void dispatch(byte handshakeType, ByteBuffer fragment) throws IOException {
         SSLConsumer consumer = handshakeConsumers.get(handshakeType);
         if (consumer == null) {
-            conContext.fatal(Alert.UNEXPECTED_MESSAGE,
+            throw conContext.fatal(Alert.UNEXPECTED_MESSAGE,
                     "Unexpected post-handshake message: " +
                             SSLHandshake.nameOf(handshakeType));
-            return;
         }
 
         try {
             consumer.consume(this, fragment);
         } catch (UnsupportedOperationException unsoe) {
-            conContext.fatal(Alert.UNEXPECTED_MESSAGE,
+            throw conContext.fatal(Alert.UNEXPECTED_MESSAGE,
                     "Unsupported post-handshake message: " +
                             SSLHandshake.nameOf(handshakeType), unsoe);
         }
--- a/src/java.base/share/classes/sun/security/ssl/PreSharedKeyExtension.java	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/java.base/share/classes/sun/security/ssl/PreSharedKeyExtension.java	Tue Jan 15 10:55:26 2019 -0800
@@ -111,14 +111,14 @@
             //     PskBinderEntry binders<33..2^16-1>;
             // } OfferedPsks;
             if (m.remaining() < 44) {
-                context.conContext.fatal(Alert.ILLEGAL_PARAMETER,
+                throw context.conContext.fatal(Alert.ILLEGAL_PARAMETER,
                     "Invalid pre_shared_key extension: " +
                     "insufficient data (length=" + m.remaining() + ")");
             }
 
             int idEncodedLength = Record.getInt16(m);
             if (idEncodedLength < 7) {
-                context.conContext.fatal(Alert.ILLEGAL_PARAMETER,
+                throw context.conContext.fatal(Alert.ILLEGAL_PARAMETER,
                     "Invalid pre_shared_key extension: " +
                     "insufficient identities (length=" + idEncodedLength + ")");
             }
@@ -128,7 +128,7 @@
             while (idReadLength < idEncodedLength) {
                 byte[] id = Record.getBytes16(m);
                 if (id.length < 1) {
-                    context.conContext.fatal(Alert.ILLEGAL_PARAMETER,
+                    throw context.conContext.fatal(Alert.ILLEGAL_PARAMETER,
                         "Invalid pre_shared_key extension: " +
                         "insufficient identity (length=" + id.length + ")");
                 }
@@ -140,7 +140,7 @@
             }
 
             if (m.remaining() < 35) {
-                context.conContext.fatal(Alert.ILLEGAL_PARAMETER,
+                throw context.conContext.fatal(Alert.ILLEGAL_PARAMETER,
                         "Invalid pre_shared_key extension: " +
                         "insufficient binders data (length=" +
                         m.remaining() + ")");
@@ -148,7 +148,7 @@
 
             int bindersEncodedLen = Record.getInt16(m);
             if (bindersEncodedLen < 33) {
-                context.conContext.fatal(Alert.ILLEGAL_PARAMETER,
+                throw context.conContext.fatal(Alert.ILLEGAL_PARAMETER,
                         "Invalid pre_shared_key extension: " +
                         "insufficient binders (length=" +
                         bindersEncodedLen + ")");
@@ -159,7 +159,7 @@
             while (bindersReadLength < bindersEncodedLen) {
                 byte[] binder = Record.getBytes8(m);
                 if (binder.length < 32) {
-                    context.conContext.fatal(Alert.ILLEGAL_PARAMETER,
+                    throw context.conContext.fatal(Alert.ILLEGAL_PARAMETER,
                             "Invalid pre_shared_key extension: " +
                             "insufficient binder entry (length=" +
                             binder.length + ")");
@@ -171,7 +171,7 @@
 
         int getIdsEncodedLength() {
             int idEncodedLength = 0;
-            for(PskIdentity curId : identities) {
+            for (PskIdentity curId : identities) {
                 idEncodedLength += curId.getEncodedLength();
             }
 
@@ -194,7 +194,7 @@
             byte[] buffer = new byte[encodedLength];
             ByteBuffer m = ByteBuffer.wrap(buffer);
             Record.putInt16(m, idsEncodedLength);
-            for(PskIdentity curId : identities) {
+            for (PskIdentity curId : identities) {
                 curId.writeEncoded(m);
             }
             Record.putInt16(m, bindersEncodedLength);
@@ -271,7 +271,7 @@
         SHPreSharedKeySpec(HandshakeContext context,
                 ByteBuffer m) throws IOException {
             if (m.remaining() < 2) {
-                context.conContext.fatal(Alert.ILLEGAL_PARAMETER,
+                throw context.conContext.fatal(Alert.ILLEGAL_PARAMETER,
                         "Invalid pre_shared_key extension: " +
                         "insufficient selected_identity (length=" +
                         m.remaining() + ")");
@@ -348,21 +348,20 @@
             try {
                 pskSpec = new CHPreSharedKeySpec(shc, buffer);
             } catch (IOException ioe) {
-                shc.conContext.fatal(Alert.UNEXPECTED_MESSAGE, ioe);
-                return;     // fatal() always throws, make the compiler happy.
+                throw shc.conContext.fatal(Alert.UNEXPECTED_MESSAGE, ioe);
             }
 
             // The "psk_key_exchange_modes" extension should have been loaded.
             if (!shc.handshakeExtensions.containsKey(
                     SSLExtension.PSK_KEY_EXCHANGE_MODES)) {
-                shc.conContext.fatal(Alert.ILLEGAL_PARAMETER,
+                throw shc.conContext.fatal(Alert.ILLEGAL_PARAMETER,
                         "Client sent PSK but not PSK modes, or the PSK " +
                         "extension is not the last extension");
             }
 
             // error if id and binder lists are not the same length
             if (pskSpec.identities.size() != pskSpec.binders.size()) {
-                shc.conContext.fatal(Alert.ILLEGAL_PARAMETER,
+                throw shc.conContext.fatal(Alert.ILLEGAL_PARAMETER,
                         "PSK extension has incorrect number of binders");
             }
 
@@ -506,7 +505,7 @@
             SHPreSharedKeySpec shPsk = (SHPreSharedKeySpec)
                     shc.handshakeExtensions.get(SSLExtension.SH_PRE_SHARED_KEY);
             if (chPsk == null || shPsk == null) {
-                shc.conContext.fatal(Alert.INTERNAL_ERROR,
+                throw shc.conContext.fatal(Alert.INTERNAL_ERROR,
                         "Required extensions are unavailable");
             }
 
@@ -533,17 +532,17 @@
             HandshakeHash pskBinderHash, byte[] binder) throws IOException {
         Optional<SecretKey> pskOpt = session.getPreSharedKey();
         if (!pskOpt.isPresent()) {
-            shc.conContext.fatal(Alert.INTERNAL_ERROR,
+            throw shc.conContext.fatal(Alert.INTERNAL_ERROR,
                     "Session has no PSK");
         }
         SecretKey psk = pskOpt.get();
 
-        SecretKey binderKey = deriveBinderKey(psk, session);
+        SecretKey binderKey = deriveBinderKey(shc, psk, session);
         byte[] computedBinder =
-                computeBinder(binderKey, session, pskBinderHash);
+                computeBinder(shc, binderKey, session, pskBinderHash);
         if (!Arrays.equals(binder, computedBinder)) {
-            shc.conContext.fatal(Alert.ILLEGAL_PARAMETER,
-            "Incorect PSK binder value");
+            throw shc.conContext.fatal(Alert.ILLEGAL_PARAMETER,
+                    "Incorect PSK binder value");
         }
     }
 
@@ -687,13 +686,14 @@
                     ageMillis + chc.resumingSession.getTicketAgeAdd();
             identities.add(new PskIdentity(chc.pskIdentity, obfuscatedAge));
 
-            SecretKey binderKey = deriveBinderKey(psk, chc.resumingSession);
+            SecretKey binderKey =
+                    deriveBinderKey(chc, psk, chc.resumingSession);
             ClientHelloMessage clientHello = (ClientHelloMessage)message;
             CHPreSharedKeySpec pskPrototype = createPskPrototype(
                 chc.resumingSession.getSuite().hashAlg.hashLength, identities);
             HandshakeHash pskBinderHash = chc.handshakeHash.copy();
 
-            byte[] binder = computeBinder(binderKey, pskBinderHash,
+            byte[] binder = computeBinder(chc, binderKey, pskBinderHash,
                     chc.resumingSession, chc, clientHello, pskPrototype);
 
             List<byte[]> binders = new ArrayList<>();
@@ -717,7 +717,8 @@
         }
     }
 
-    private static byte[] computeBinder(SecretKey binderKey,
+    private static byte[] computeBinder(
+            HandshakeContext context, SecretKey binderKey,
             SSLSessionImpl session,
             HandshakeHash pskBinderHash) throws IOException {
 
@@ -726,10 +727,11 @@
         pskBinderHash.update();
         byte[] digest = pskBinderHash.digest();
 
-        return computeBinder(binderKey, session, digest);
+        return computeBinder(context, binderKey, session, digest);
     }
 
-    private static byte[] computeBinder(SecretKey binderKey,
+    private static byte[] computeBinder(
+            HandshakeContext context, SecretKey binderKey,
             HandshakeHash hash, SSLSessionImpl session,
             HandshakeContext ctx, ClientHello.ClientHelloMessage hello,
             CHPreSharedKeySpec pskPrototype) throws IOException {
@@ -745,10 +747,11 @@
         hash.update();
         byte[] digest = hash.digest();
 
-        return computeBinder(binderKey, session, digest);
+        return computeBinder(context, binderKey, session, digest);
     }
 
-    private static byte[] computeBinder(SecretKey binderKey,
+    private static byte[] computeBinder(HandshakeContext context,
+            SecretKey binderKey,
             SSLSessionImpl session, byte[] digest) throws IOException {
         try {
             CipherSuite.HashAlg hashAlg = session.getSuite().hashAlg;
@@ -766,15 +769,15 @@
                 hmac.init(finishedKey);
                 return hmac.doFinal(digest);
             } catch (NoSuchAlgorithmException | InvalidKeyException ex) {
-                throw new IOException(ex);
+                throw context.conContext.fatal(Alert.INTERNAL_ERROR, ex);
             }
         } catch (GeneralSecurityException ex) {
-            throw new IOException(ex);
+            throw context.conContext.fatal(Alert.INTERNAL_ERROR, ex);
         }
     }
 
-    private static SecretKey deriveBinderKey(SecretKey psk,
-            SSLSessionImpl session) throws IOException {
+    private static SecretKey deriveBinderKey(HandshakeContext context,
+            SecretKey psk, SSLSessionImpl session) throws IOException {
         try {
             CipherSuite.HashAlg hashAlg = session.getSuite().hashAlg;
             HKDF hkdf = new HKDF(hashAlg.name);
@@ -788,7 +791,7 @@
             return hkdf.expand(earlySecret,
                     hkdfInfo, hashAlg.hashLength, "TlsBinderKey");
         } catch (GeneralSecurityException ex) {
-            throw new IOException(ex);
+            throw context.conContext.fatal(Alert.INTERNAL_ERROR, ex);
         }
     }
 
@@ -827,7 +830,7 @@
             // Is it a response of the specific request?
             if (!chc.handshakeExtensions.containsKey(
                     SSLExtension.CH_PRE_SHARED_KEY)) {
-                chc.conContext.fatal(Alert.UNEXPECTED_MESSAGE,
+                throw chc.conContext.fatal(Alert.UNEXPECTED_MESSAGE,
                     "Server sent unexpected pre_shared_key extension");
             }
 
@@ -838,13 +841,13 @@
             }
 
             if (shPsk.selectedIdentity != 0) {
-                chc.conContext.fatal(Alert.ILLEGAL_PARAMETER,
+                throw chc.conContext.fatal(Alert.ILLEGAL_PARAMETER,
                     "Selected identity index is not in correct range.");
             }
 
             if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) {
                 SSLLogger.fine(
-                "Resuming session: ", chc.resumingSession);
+                        "Resuming session: ", chc.resumingSession);
             }
         }
     }
--- a/src/java.base/share/classes/sun/security/ssl/PskKeyExchangeModesExtension.java	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/java.base/share/classes/sun/security/ssl/PskKeyExchangeModesExtension.java	Tue Jan 15 10:55:26 2019 -0800
@@ -201,8 +201,7 @@
             try {
                 spec = new PskKeyExchangeModesSpec(buffer);
             } catch (IOException ioe) {
-                shc.conContext.fatal(Alert.UNEXPECTED_MESSAGE, ioe);
-                return;     // fatal() always throws, make the compiler happy.
+                throw shc.conContext.fatal(Alert.UNEXPECTED_MESSAGE, ioe);
             }
 
             // Update the context.
@@ -324,7 +323,7 @@
             SSLExtensionSpec spec =
                 shc.handshakeExtensions.get(SSLExtension.CH_PRE_SHARED_KEY);
             if (spec != null) {
-                shc.conContext.fatal(Alert.HANDSHAKE_FAILURE,
+                throw shc.conContext.fatal(Alert.HANDSHAKE_FAILURE,
                         "pre_shared_key key extension is offered " +
                         "without a psk_key_exchange_modes extension");
             }
--- a/src/java.base/share/classes/sun/security/ssl/RSAClientKeyExchange.java	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/java.base/share/classes/sun/security/ssl/RSAClientKeyExchange.java	Tue Jan 15 10:55:26 2019 -0800
@@ -75,7 +75,7 @@
             super(context);
 
             if (m.remaining() < 2) {
-                context.conContext.fatal(Alert.HANDSHAKE_FAILURE,
+                throw context.conContext.fatal(Alert.HANDSHAKE_FAILURE,
                     "Invalid RSA ClientKeyExchange message: insufficient data");
             }
 
@@ -167,14 +167,14 @@
             }
 
             if (rsaCredentials == null && x509Credentials == null) {
-                chc.conContext.fatal(Alert.ILLEGAL_PARAMETER,
+                throw chc.conContext.fatal(Alert.ILLEGAL_PARAMETER,
                     "No RSA credentials negotiated for client key exchange");
             }
 
             PublicKey publicKey = (rsaCredentials != null) ?
                     rsaCredentials.popPublicKey : x509Credentials.popPublicKey;
             if (!publicKey.getAlgorithm().equals("RSA")) {      // unlikely
-                chc.conContext.fatal(Alert.ILLEGAL_PARAMETER,
+                throw chc.conContext.fatal(Alert.ILLEGAL_PARAMETER,
                     "Not RSA public key for client key exchange");
             }
 
@@ -186,10 +186,8 @@
                 ckem = new RSAClientKeyExchangeMessage(
                         chc, premaster, publicKey);
             } catch (GeneralSecurityException gse) {
-                chc.conContext.fatal(Alert.ILLEGAL_PARAMETER,
+                throw chc.conContext.fatal(Alert.ILLEGAL_PARAMETER,
                         "Cannot generate RSA premaster secret", gse);
-
-                return null;    // make the compiler happy
             }
             if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) {
                 SSLLogger.fine(
@@ -205,7 +203,7 @@
                     chc.negotiatedCipherSuite.keyExchange,
                     chc.negotiatedProtocol);
             if (ke == null) {   // unlikely
-                chc.conContext.fatal(Alert.INTERNAL_ERROR,
+                throw chc.conContext.fatal(Alert.INTERNAL_ERROR,
                         "Not supported key exchange type");
             } else {
                 SSLKeyDerivation masterKD = ke.createKeyDerivation(chc);
@@ -217,7 +215,7 @@
                 SSLTrafficKeyDerivation kd =
                         SSLTrafficKeyDerivation.valueOf(chc.negotiatedProtocol);
                 if (kd == null) {   // unlikely
-                    chc.conContext.fatal(Alert.INTERNAL_ERROR,
+                    throw chc.conContext.fatal(Alert.INTERNAL_ERROR,
                             "Not supported key derivation: " +
                             chc.negotiatedProtocol);
                 } else {
@@ -262,14 +260,14 @@
             }
 
             if (rsaPossession == null && x509Possession == null) {  // unlikely
-                shc.conContext.fatal(Alert.ILLEGAL_PARAMETER,
+                throw shc.conContext.fatal(Alert.ILLEGAL_PARAMETER,
                     "No RSA possessions negotiated for client key exchange");
             }
 
             PrivateKey privateKey = (rsaPossession != null) ?
                     rsaPossession.popPrivateKey : x509Possession.popPrivateKey;
             if (!privateKey.getAlgorithm().equals("RSA")) {     // unlikely
-                shc.conContext.fatal(Alert.ILLEGAL_PARAMETER,
+                throw shc.conContext.fatal(Alert.ILLEGAL_PARAMETER,
                     "Not RSA private key for client key exchange");
             }
 
@@ -287,7 +285,7 @@
                     RSAPremasterSecret.decode(shc, privateKey, ckem.encrypted);
                 shc.handshakeCredentials.add(premaster);
             } catch (GeneralSecurityException gse) {
-                shc.conContext.fatal(Alert.ILLEGAL_PARAMETER,
+                throw shc.conContext.fatal(Alert.ILLEGAL_PARAMETER,
                     "Cannot decode RSA premaster secret", gse);
             }
 
@@ -296,7 +294,7 @@
                     shc.negotiatedCipherSuite.keyExchange,
                     shc.negotiatedProtocol);
             if (ke == null) {   // unlikely
-                shc.conContext.fatal(Alert.INTERNAL_ERROR,
+                throw shc.conContext.fatal(Alert.INTERNAL_ERROR,
                         "Not supported key exchange type");
             } else {
                 SSLKeyDerivation masterKD = ke.createKeyDerivation(shc);
@@ -308,7 +306,7 @@
                 SSLTrafficKeyDerivation kd =
                         SSLTrafficKeyDerivation.valueOf(shc.negotiatedProtocol);
                 if (kd == null) {       // unlikely
-                    shc.conContext.fatal(Alert.INTERNAL_ERROR,
+                    throw shc.conContext.fatal(Alert.INTERNAL_ERROR,
                             "Not supported key derivation: " +
                             shc.negotiatedProtocol);
                 } else {
--- a/src/java.base/share/classes/sun/security/ssl/RSAKeyExchange.java	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/java.base/share/classes/sun/security/ssl/RSAKeyExchange.java	Tue Jan 15 10:55:26 2019 -0800
@@ -274,7 +274,7 @@
             }
 
             if (premaster == null) {
-                context.conContext.fatal(Alert.HANDSHAKE_FAILURE,
+                throw context.conContext.fatal(Alert.HANDSHAKE_FAILURE,
                     "No sufficient RSA key agreement parameters negotiated");
             }
 
--- a/src/java.base/share/classes/sun/security/ssl/RSAServerKeyExchange.java	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/java.base/share/classes/sun/security/ssl/RSAServerKeyExchange.java	Tue Jan 15 10:55:26 2019 -0800
@@ -94,7 +94,7 @@
                 signature = signer.sign();
             } catch (NoSuchAlgorithmException |
                     InvalidKeyException | SignatureException ex) {
-                shc.conContext.fatal(Alert.INTERNAL_ERROR,
+                throw shc.conContext.fatal(Alert.INTERNAL_ERROR,
                         "Failed to sign ephemeral RSA parameters", ex);
             }
 
@@ -122,7 +122,7 @@
             }
 
             if (x509Credentials == null) {
-                chc.conContext.fatal(Alert.ILLEGAL_PARAMETER,
+                throw chc.conContext.fatal(Alert.ILLEGAL_PARAMETER,
                     "No RSA credentials negotiated for server key exchange");
             }
 
@@ -133,12 +133,12 @@
                           chc.clientHelloRandom.randomBytes,
                           chc.serverHelloRandom.randomBytes);
                 if (!signer.verify(paramsSignature)) {
-                    chc.conContext.fatal(Alert.HANDSHAKE_FAILURE,
+                    throw chc.conContext.fatal(Alert.HANDSHAKE_FAILURE,
                         "Invalid signature of RSA ServerKeyExchange message");
                 }
             } catch (NoSuchAlgorithmException |
                     InvalidKeyException | SignatureException ex) {
-                chc.conContext.fatal(Alert.INTERNAL_ERROR,
+                throw chc.conContext.fatal(Alert.INTERNAL_ERROR,
                     "Failed to sign ephemeral RSA parameters", ex);
             }
         }
@@ -250,12 +250,12 @@
                 return null;
             } else if (x509Possession == null) {
                 // unlikely
-                shc.conContext.fatal(Alert.ILLEGAL_PARAMETER,
+                throw shc.conContext.fatal(Alert.ILLEGAL_PARAMETER,
                     "No RSA certificate negotiated for server key exchange");
             } else if (!"RSA".equals(
                     x509Possession.popPrivateKey.getAlgorithm())) {
                 // unlikely
-                shc.conContext.fatal(Alert.ILLEGAL_PARAMETER,
+                throw shc.conContext.fatal(Alert.ILLEGAL_PARAMETER,
                         "No X.509 possession can be used for " +
                         "ephemeral RSA ServerKeyExchange");
             }
@@ -312,15 +312,13 @@
                     new BigInteger(1, skem.exponent));
                 publicKey = (RSAPublicKey)kf.generatePublic(spec);
             } catch (GeneralSecurityException gse) {
-                chc.conContext.fatal(Alert.INSUFFICIENT_SECURITY,
+                throw chc.conContext.fatal(Alert.INSUFFICIENT_SECURITY,
                         "Could not generate RSAPublicKey", gse);
-
-                return;     // make the compiler happy
             }
 
             if (!chc.algorithmConstraints.permits(
                     EnumSet.of(CryptoPrimitive.KEY_AGREEMENT), publicKey)) {
-                chc.conContext.fatal(Alert.INSUFFICIENT_SECURITY,
+                throw chc.conContext.fatal(Alert.INSUFFICIENT_SECURITY,
                         "RSA ServerKeyExchange does not comply to " +
                         "algorithm constraints");
             }
@@ -328,7 +326,8 @@
             //
             // update
             //
-            chc.handshakeCredentials.add(new EphemeralRSACredentials(publicKey));
+            chc.handshakeCredentials.add(
+                    new EphemeralRSACredentials(publicKey));
 
             //
             // produce
--- a/src/java.base/share/classes/sun/security/ssl/RenegoInfoExtension.java	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/java.base/share/classes/sun/security/ssl/RenegoInfoExtension.java	Tue Jan 15 10:55:26 2019 -0800
@@ -185,12 +185,10 @@
                     return null;
                 } else {
                     // terminate the session.
-                    chc.conContext.fatal(Alert.HANDSHAKE_FAILURE,
+                    throw chc.conContext.fatal(Alert.HANDSHAKE_FAILURE,
                             "insecure renegotiation is not allowed");
                 }
             }
-
-            return null;
         }
     }
 
@@ -226,14 +224,13 @@
             try {
                 spec = new RenegotiationInfoSpec(buffer);
             } catch (IOException ioe) {
-                shc.conContext.fatal(Alert.UNEXPECTED_MESSAGE, ioe);
-                return;     // fatal() always throws, make the compiler happy.
+                throw shc.conContext.fatal(Alert.UNEXPECTED_MESSAGE, ioe);
             }
 
             if (!shc.conContext.isNegotiated) {
                 // initial handshaking.
                 if (spec.renegotiatedConnection.length != 0) {
-                    shc.conContext.fatal(Alert.UNEXPECTED_MESSAGE,
+                    throw shc.conContext.fatal(Alert.UNEXPECTED_MESSAGE,
                         "Invalid renegotiation_info extension data: not empty");
                 }
                 shc.conContext.secureRenegotiation = true;
@@ -241,14 +238,14 @@
                 if (!shc.conContext.secureRenegotiation) {
                     // Unexpected RI extension for insecure renegotiation,
                     // abort the handshake with a fatal handshake_failure alert.
-                    shc.conContext.fatal(Alert.HANDSHAKE_FAILURE,
+                    throw shc.conContext.fatal(Alert.HANDSHAKE_FAILURE,
                             "The renegotiation_info is present in a insecure " +
                             "renegotiation");
                 } else {
                     // verify the client_verify_data value
                     if (!Arrays.equals(shc.conContext.clientVerifyData,
                             spec.renegotiatedConnection)) {
-                        shc.conContext.fatal(Alert.UNEXPECTED_MESSAGE,
+                        throw shc.conContext.fatal(Alert.UNEXPECTED_MESSAGE,
                             "Invalid renegotiation_info extension data: " +
                             "incorrect verify data in ClientHello");
                     }
@@ -295,7 +292,7 @@
                 }
 
                 if (!HandshakeContext.allowLegacyHelloMessages) {
-                    shc.conContext.fatal(Alert.HANDSHAKE_FAILURE,
+                    throw shc.conContext.fatal(Alert.HANDSHAKE_FAILURE,
                         "Failed to negotiate the use of secure renegotiation");
                 }   // otherwise, allow legacy hello message
 
@@ -307,7 +304,7 @@
                 shc.conContext.secureRenegotiation = false;
             } else if (shc.conContext.secureRenegotiation) {
                 // Require secure renegotiation, terminate the connection.
-                shc.conContext.fatal(Alert.HANDSHAKE_FAILURE,
+                throw shc.conContext.fatal(Alert.HANDSHAKE_FAILURE,
                         "Inconsistent secure renegotiation indication");
             } else {    // renegotiation, not secure
                 if (HandshakeContext.allowUnsafeRenegotiation) {
@@ -320,7 +317,7 @@
                     if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) {
                         SSLLogger.fine("Terminate insecure renegotiation");
                     }
-                    shc.conContext.fatal(Alert.HANDSHAKE_FAILURE,
+                    throw shc.conContext.fatal(Alert.HANDSHAKE_FAILURE,
                         "Unsafe renegotiation is not allowed");
                 }
             }
@@ -430,7 +427,7 @@
             if (requestedSpec == null &&
                     !chc.activeCipherSuites.contains(
                             CipherSuite.TLS_EMPTY_RENEGOTIATION_INFO_SCSV)) {
-                chc.conContext.fatal(Alert.INTERNAL_ERROR,
+                throw chc.conContext.fatal(Alert.INTERNAL_ERROR,
                     "Missing renegotiation_info and SCSV detected in " +
                     "ClientHello");
             }
@@ -440,8 +437,7 @@
             try {
                 spec = new RenegotiationInfoSpec(buffer);
             } catch (IOException ioe) {
-                chc.conContext.fatal(Alert.UNEXPECTED_MESSAGE, ioe);
-                return;     // fatal() always throws, make the compiler happy.
+                throw chc.conContext.fatal(Alert.UNEXPECTED_MESSAGE, ioe);
             }
 
 
@@ -452,7 +448,7 @@
                 // and if it is not, MUST abort the handshake (by sending
                 // a fatal handshake_failure alert). [RFC 5746]
                 if (spec.renegotiatedConnection.length != 0) {
-                    chc.conContext.fatal(Alert.HANDSHAKE_FAILURE,
+                    throw chc.conContext.fatal(Alert.HANDSHAKE_FAILURE,
                         "Invalid renegotiation_info in ServerHello: " +
                         "not empty renegotiated_connection");
                 }
@@ -467,7 +463,7 @@
                 int infoLen = chc.conContext.clientVerifyData.length +
                               chc.conContext.serverVerifyData.length;
                 if (spec.renegotiatedConnection.length != infoLen) {
-                    chc.conContext.fatal(Alert.HANDSHAKE_FAILURE,
+                    throw chc.conContext.fatal(Alert.HANDSHAKE_FAILURE,
                         "Invalid renegotiation_info in ServerHello: " +
                         "invalid renegotiated_connection length (" +
                         spec.renegotiatedConnection.length + ")");
@@ -476,14 +472,14 @@
                 byte[] cvd = chc.conContext.clientVerifyData;
                 if (!Arrays.equals(spec.renegotiatedConnection,
                         0, cvd.length, cvd, 0, cvd.length)) {
-                    chc.conContext.fatal(Alert.HANDSHAKE_FAILURE,
+                    throw chc.conContext.fatal(Alert.HANDSHAKE_FAILURE,
                         "Invalid renegotiation_info in ServerHello: " +
                         "unmatched client_verify_data value");
                 }
                 byte[] svd = chc.conContext.serverVerifyData;
                 if (!Arrays.equals(spec.renegotiatedConnection,
                         cvd.length, infoLen, svd, 0, svd.length)) {
-                    chc.conContext.fatal(Alert.HANDSHAKE_FAILURE,
+                    throw chc.conContext.fatal(Alert.HANDSHAKE_FAILURE,
                         "Invalid renegotiation_info in ServerHello: " +
                         "unmatched server_verify_data value");
                 }
@@ -516,7 +512,7 @@
             if (requestedSpec == null &&
                     !chc.activeCipherSuites.contains(
                             CipherSuite.TLS_EMPTY_RENEGOTIATION_INFO_SCSV)) {
-                chc.conContext.fatal(Alert.INTERNAL_ERROR,
+                throw chc.conContext.fatal(Alert.INTERNAL_ERROR,
                     "Missing renegotiation_info and SCSV detected in " +
                     "ClientHello");
             }
@@ -524,7 +520,7 @@
             if (!chc.conContext.isNegotiated) {
                 // initial handshaking.
                 if (!HandshakeContext.allowLegacyHelloMessages) {
-                    chc.conContext.fatal(Alert.HANDSHAKE_FAILURE,
+                    throw chc.conContext.fatal(Alert.HANDSHAKE_FAILURE,
                         "Failed to negotiate the use of secure renegotiation");
                 }   // otherwise, allow legacy hello message
 
@@ -536,7 +532,7 @@
                 chc.conContext.secureRenegotiation = false;
             } else if (chc.conContext.secureRenegotiation) {
                 // Require secure renegotiation, terminate the connection.
-                chc.conContext.fatal(Alert.HANDSHAKE_FAILURE,
+                throw chc.conContext.fatal(Alert.HANDSHAKE_FAILURE,
                         "Inconsistent secure renegotiation indication");
             } else {    // renegotiation, not secure
                 if (HandshakeContext.allowUnsafeRenegotiation) {
@@ -549,7 +545,7 @@
                     if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) {
                         SSLLogger.fine("Terminate insecure renegotiation");
                     }
-                    chc.conContext.fatal(Alert.HANDSHAKE_FAILURE,
+                    throw chc.conContext.fatal(Alert.HANDSHAKE_FAILURE,
                         "Unsafe renegotiation is not allowed");
                 }
             }
--- a/src/java.base/share/classes/sun/security/ssl/SSLConfiguration.java	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/java.base/share/classes/sun/security/ssl/SSLConfiguration.java	Tue Jan 15 10:55:26 2019 -0800
@@ -29,8 +29,6 @@
 import java.security.AccessController;
 import java.security.AlgorithmConstraints;
 import java.security.NoSuchAlgorithmException;
-import java.security.PrivilegedActionException;
-import java.security.PrivilegedExceptionAction;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Collection;
--- a/src/java.base/share/classes/sun/security/ssl/SSLEngineImpl.java	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/java.base/share/classes/sun/security/ssl/SSLEngineImpl.java	Tue Jan 15 10:55:26 2019 -0800
@@ -102,10 +102,10 @@
         try {
             conContext.kickstart();
         } catch (IOException ioe) {
-            conContext.fatal(Alert.HANDSHAKE_FAILURE,
+            throw conContext.fatal(Alert.HANDSHAKE_FAILURE,
                 "Couldn't kickstart handshaking", ioe);
         } catch (Exception ex) {     // including RuntimeException
-            conContext.fatal(Alert.INTERNAL_ERROR,
+            throw conContext.fatal(Alert.INTERNAL_ERROR,
                 "Fail to begin handshake", ex);
         }
     }
@@ -137,16 +137,14 @@
                 srcs, srcsOffset, srcsLength, dsts, dstsOffset, dstsLength);
         } catch (SSLProtocolException spe) {
             // may be an unexpected handshake message
-            conContext.fatal(Alert.UNEXPECTED_MESSAGE, spe);
+            throw conContext.fatal(Alert.UNEXPECTED_MESSAGE, spe);
         } catch (IOException ioe) {
-            conContext.fatal(Alert.INTERNAL_ERROR,
+            throw conContext.fatal(Alert.INTERNAL_ERROR,
                 "problem wrapping app data", ioe);
         } catch (Exception ex) {     // including RuntimeException
-            conContext.fatal(Alert.INTERNAL_ERROR,
+            throw conContext.fatal(Alert.INTERNAL_ERROR,
                 "Fail to wrap application data", ex);
         }
-
-        return null;    // make compiler happy
     }
 
     private SSLEngineResult writeRecord(
@@ -249,6 +247,19 @@
             hsStatus = ciphertext.handshakeStatus;
         } else {
             hsStatus = getHandshakeStatus();
+            if (ciphertext == null && !conContext.isNegotiated &&
+                    conContext.isInboundClosed() &&
+                    hsStatus == HandshakeStatus.NEED_WRAP) {
+                // Even the outboud is open, no futher data could be wrapped as:
+                //     1. the outbound is empty
+                //     2. no negotiated connection
+                //     3. the inbound has closed, cannot complete the handshake
+                //
+                // Mark the engine as closed if the handshake status is
+                // NEED_WRAP. Otherwise, it could lead to dead loops in
+                // applications.
+                status = Status.CLOSED;
+            }
         }
 
         int deltaSrcs = srcsRemains;
@@ -275,13 +286,13 @@
                 srcs, srcsOffset, srcsLength, dsts, dstsOffset, dstsLength);
         } catch (SSLHandshakeException she) {
             // may be record sequence number overflow
-            conContext.fatal(Alert.HANDSHAKE_FAILURE, she);
+            throw conContext.fatal(Alert.HANDSHAKE_FAILURE, she);
         } catch (IOException e) {
-            conContext.fatal(Alert.UNEXPECTED_MESSAGE, e);
+            throw conContext.fatal(Alert.UNEXPECTED_MESSAGE, e);
         }
 
         if (ciphertext == null) {
-            return Ciphertext.CIPHERTEXT_NULL;
+            return null;
         }
 
         // Is the handshake completed?
@@ -444,7 +455,7 @@
                 srcs, srcsOffset, srcsLength, dsts, dstsOffset, dstsLength);
         } catch (SSLProtocolException spe) {
             // may be an unexpected handshake message
-            conContext.fatal(Alert.UNEXPECTED_MESSAGE,
+            throw conContext.fatal(Alert.UNEXPECTED_MESSAGE,
                     spe.getMessage(), spe);
         } catch (IOException ioe) {
             /*
@@ -453,14 +464,12 @@
              * got us into this situation, so report that much back.
              * Our days of consuming are now over anyway.
              */
-            conContext.fatal(Alert.INTERNAL_ERROR,
+            throw conContext.fatal(Alert.INTERNAL_ERROR,
                     "problem unwrapping net record", ioe);
         } catch (Exception ex) {     // including RuntimeException
-            conContext.fatal(Alert.INTERNAL_ERROR,
+            throw conContext.fatal(Alert.INTERNAL_ERROR,
                 "Fail to unwrap network record", ex);
         }
-
-        return null;    // make compiler happy
     }
 
     private SSLEngineResult readRecord(
@@ -721,7 +730,7 @@
         if (!conContext.isInputCloseNotified &&
             (conContext.isNegotiated || conContext.handshakeContext != null)) {
 
-            conContext.fatal(Alert.INTERNAL_ERROR,
+            throw conContext.fatal(Alert.INTERNAL_ERROR,
                     "closing inbound before receiving peer's close_notify");
         }
 
--- a/src/java.base/share/classes/sun/security/ssl/SSLExtensions.java	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/java.base/share/classes/sun/security/ssl/SSLExtensions.java	Tue Jan 15 10:55:26 2019 -0800
@@ -60,7 +60,8 @@
             int extId = Record.getInt16(m);
             int extLen = Record.getInt16(m);
             if (extLen > m.remaining()) {
-                hm.handshakeContext.conContext.fatal(Alert.ILLEGAL_PARAMETER,
+                throw hm.handshakeContext.conContext.fatal(
+                        Alert.ILLEGAL_PARAMETER,
                         "Error parsing extension (" + extId +
                         "): no sufficient data");
             }
@@ -86,7 +87,7 @@
                                 "in the ServerHello handshake message");
                     }
                 } else {
-                    hm.handshakeContext.conContext.fatal(
+                    throw hm.handshakeContext.conContext.fatal(
                         Alert.UNSUPPORTED_EXTENSION,
                         "extension (" + extId +
                         ") should not be presented in " + handshakeType.name);
@@ -102,7 +103,7 @@
                     }
 
                     if (extension.handshakeType != handshakeType) {
-                        hm.handshakeContext.conContext.fatal(
+                        throw hm.handshakeContext.conContext.fatal(
                                 Alert.UNSUPPORTED_EXTENSION,
                                 "extension (" + extId + ") should not be " +
                                 "presented in " + handshakeType.name);
--- a/src/java.base/share/classes/sun/security/ssl/SSLSocketImpl.java	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/java.base/share/classes/sun/security/ssl/SSLSocketImpl.java	Tue Jan 15 10:55:26 2019 -0800
@@ -402,7 +402,7 @@
                     readHandshakeRecord();
                 }
             } catch (IOException ioe) {
-                conContext.fatal(Alert.HANDSHAKE_FAILURE,
+                throw conContext.fatal(Alert.HANDSHAKE_FAILURE,
                     "Couldn't kickstart handshaking", ioe);
             } catch (Exception oe) {    // including RuntimeException
                 handleException(oe);
@@ -608,7 +608,12 @@
             }
         } else {
             if (!conContext.isInboundClosed()) {
-                conContext.inputRecord.close();
+                try (conContext.inputRecord) {
+                    // Try the best to use up the input records and close the
+                    // socket gracefully, without impact the performance too
+                    // much.
+                    appInput.deplete();
+                }
             }
 
             if ((autoClose || !isLayered()) && !super.isInputShutdown()) {
@@ -642,7 +647,7 @@
         if (checkCloseNotify && !conContext.isInputCloseNotified &&
             (conContext.isNegotiated || conContext.handshakeContext != null)) {
 
-            conContext.fatal(Alert.INTERNAL_ERROR,
+            throw conContext.fatal(Alert.INTERNAL_ERROR,
                     "closing inbound before receiving peer's close_notify");
         }
 
@@ -907,6 +912,30 @@
 
             return false;
         }
+
+        /**
+         * Try the best to use up the input records so as to close the
+         * socket gracefully, without impact the performance too much.
+         */
+        private synchronized void deplete() {
+            if (!conContext.isInboundClosed()) {
+                if (!(conContext.inputRecord instanceof SSLSocketInputRecord)) {
+                    return;
+                }
+
+                SSLSocketInputRecord socketInputRecord =
+                        (SSLSocketInputRecord)conContext.inputRecord;
+                try {
+                    socketInputRecord.deplete(
+                        conContext.isNegotiated && (getSoTimeout() > 0));
+                } catch (IOException ioe) {
+                    if (SSLLogger.isOn && SSLLogger.isOn("ssl")) {
+                        SSLLogger.warning(
+                            "input stream close depletion failed", ioe);
+                    }
+                }
+            }
+        }
     }
 
     @Override
@@ -982,9 +1011,9 @@
                 conContext.outputRecord.deliver(b, off, len);
             } catch (SSLHandshakeException she) {
                 // may be record sequence number overflow
-                conContext.fatal(Alert.HANDSHAKE_FAILURE, she);
+                throw conContext.fatal(Alert.HANDSHAKE_FAILURE, she);
             } catch (IOException e) {
-                conContext.fatal(Alert.UNEXPECTED_MESSAGE, e);
+                throw conContext.fatal(Alert.UNEXPECTED_MESSAGE, e);
             }
 
             // Is the sequence number is nearly overflow, or has the key usage
@@ -1309,7 +1338,8 @@
                 alert = Alert.INTERNAL_ERROR;
             }
         }
-        conContext.fatal(alert, cause);
+
+        throw conContext.fatal(alert, cause);
     }
 
     private Plaintext handleEOF(EOFException eofe) throws IOException {
--- a/src/java.base/share/classes/sun/security/ssl/SSLSocketInputRecord.java	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/java.base/share/classes/sun/security/ssl/SSLSocketInputRecord.java	Tue Jan 15 10:55:26 2019 -0800
@@ -463,4 +463,17 @@
 
         return n;
     }
+
+    // Try to use up the input stream without impact the performance too much.
+    void deplete(boolean tryToRead) throws IOException {
+        int remaining = is.available();
+        if (tryToRead && (remaining == 0)) {
+            // try to wait and read one byte if no buffered input
+            is.read();
+        }
+
+        while ((remaining = is.available()) != 0) {
+            is.skip(remaining);
+        }
+    }
 }
--- a/src/java.base/share/classes/sun/security/ssl/SSLTransport.java	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/java.base/share/classes/sun/security/ssl/SSLTransport.java	Tue Jan 15 10:55:26 2019 -0800
@@ -115,7 +115,7 @@
                 }
             }
 
-            context.fatal(Alert.UNEXPECTED_MESSAGE, unsoe);
+            throw context.fatal(Alert.UNEXPECTED_MESSAGE, unsoe);
         } catch (BadPaddingException bpe) {
             /*
              * The basic SSLv3 record protection involves (optional)
@@ -126,15 +126,15 @@
             Alert alert = (context.handshakeContext != null) ?
                     Alert.HANDSHAKE_FAILURE :
                     Alert.BAD_RECORD_MAC;
-            context.fatal(alert, bpe);
+            throw context.fatal(alert, bpe);
         } catch (SSLHandshakeException she) {
             // may be record sequence number overflow
-            context.fatal(Alert.HANDSHAKE_FAILURE, she);
+            throw context.fatal(Alert.HANDSHAKE_FAILURE, she);
         } catch (EOFException eofe) {
             // rethrow EOFException, the call will handle it if neede.
             throw eofe;
         } catch (IOException ioe) {
-            context.fatal(Alert.UNEXPECTED_MESSAGE, ioe);
+            throw context.fatal(Alert.UNEXPECTED_MESSAGE, ioe);
         }
 
         if (plaintexts == null || plaintexts.length == 0) {
@@ -191,7 +191,7 @@
                     }
 
                     if (remains > 0) {
-                        context.fatal(Alert.INTERNAL_ERROR,
+                        throw context.fatal(Alert.INTERNAL_ERROR,
                             "no sufficient room in the destination buffers");
                     }
                 }
--- a/src/java.base/share/classes/sun/security/ssl/ServerHello.java	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/java.base/share/classes/sun/security/ssl/ServerHello.java	Tue Jan 15 10:55:26 2019 -0800
@@ -133,7 +133,7 @@
             this.serverVersion = ProtocolVersion.valueOf(major, minor);
             if (this.serverVersion == null) {
                 // The client should only request for known protocol versions.
-                context.conContext.fatal(Alert.PROTOCOL_VERSION,
+                throw context.conContext.fatal(Alert.PROTOCOL_VERSION,
                     "Unsupported protocol version: " +
                     ProtocolVersion.nameOf(major, minor));
             }
@@ -143,20 +143,21 @@
             try {
                 sessionId.checkLength(serverVersion.id);
             } catch (SSLProtocolException ex) {
-                handshakeContext.conContext.fatal(Alert.ILLEGAL_PARAMETER, ex);
+                throw handshakeContext.conContext.fatal(
+                        Alert.ILLEGAL_PARAMETER, ex);
             }
 
             int cipherSuiteId = Record.getInt16(m);
             this.cipherSuite = CipherSuite.valueOf(cipherSuiteId);
             if (cipherSuite == null || !context.isNegotiable(cipherSuite)) {
-                context.conContext.fatal(Alert.ILLEGAL_PARAMETER,
+                throw context.conContext.fatal(Alert.ILLEGAL_PARAMETER,
                     "Server selected improper ciphersuite " +
                     CipherSuite.nameOf(cipherSuiteId));
             }
 
             this.compressionMethod = m.get();
             if (compressionMethod != 0) {
-                context.conContext.fatal(Alert.ILLEGAL_PARAMETER,
+                throw context.conContext.fatal(Alert.ILLEGAL_PARAMETER,
                     "compression type not supported, " + compressionMethod);
             }
 
@@ -293,10 +294,8 @@
                 KeyExchangeProperties credentials =
                         chooseCipherSuite(shc, clientHello);
                 if (credentials == null) {
-                    shc.conContext.fatal(Alert.HANDSHAKE_FAILURE,
+                    throw shc.conContext.fatal(Alert.HANDSHAKE_FAILURE,
                             "no cipher suites in common");
-
-                    return null;    // make the compiler happy
                 }
                 shc.negotiatedCipherSuite = credentials.cipherSuite;
                 shc.handshakeKeyExchange = credentials.keyExchange;
@@ -374,7 +373,7 @@
                     SSLTrafficKeyDerivation.valueOf(shc.negotiatedProtocol);
                 if (kdg == null) {
                     // unlikely
-                    shc.conContext.fatal(Alert.INTERNAL_ERROR,
+                    throw shc.conContext.fatal(Alert.INTERNAL_ERROR,
                             "Not supported key derivation: " +
                             shc.negotiatedProtocol);
                 } else {
@@ -458,10 +457,8 @@
                 }
             }
 
-            shc.conContext.fatal(Alert.HANDSHAKE_FAILURE,
+            throw shc.conContext.fatal(Alert.HANDSHAKE_FAILURE,
                     "no cipher suites in common");
-
-            return null;    // make the compiler happy.
         }
 
         private static final class KeyExchangeProperties {
@@ -524,9 +521,8 @@
                 // negotiate the cipher suite.
                 CipherSuite cipherSuite = chooseCipherSuite(shc, clientHello);
                 if (cipherSuite == null) {
-                    shc.conContext.fatal(Alert.HANDSHAKE_FAILURE,
+                    throw shc.conContext.fatal(Alert.HANDSHAKE_FAILURE,
                             "no cipher suites in common");
-                    return null;    // make the compiler happy
                 }
                 shc.negotiatedCipherSuite = cipherSuite;
                 shc.handshakeSession.setSuite(cipherSuite);
@@ -592,9 +588,8 @@
             SSLKeyExchange ke = shc.handshakeKeyExchange;
             if (ke == null) {
                 // unlikely
-                shc.conContext.fatal(Alert.INTERNAL_ERROR,
+                throw shc.conContext.fatal(Alert.INTERNAL_ERROR,
                         "Not negotiated key shares");
-                return null;    // make the compiler happy
             }
 
             SSLKeyDerivation handshakeKD = ke.createKeyDerivation(shc);
@@ -605,10 +600,9 @@
                 SSLTrafficKeyDerivation.valueOf(shc.negotiatedProtocol);
             if (kdg == null) {
                 // unlikely
-                shc.conContext.fatal(Alert.INTERNAL_ERROR,
+                throw shc.conContext.fatal(Alert.INTERNAL_ERROR,
                         "Not supported key derivation: " +
                         shc.negotiatedProtocol);
-                return null;    // make the compiler happy
             }
 
             SSLKeyDerivation kd =
@@ -634,9 +628,15 @@
                         shc.sslContext.getSecureRandom());
             } catch (GeneralSecurityException gse) {
                 // unlikely
-                shc.conContext.fatal(Alert.HANDSHAKE_FAILURE,
+                throw shc.conContext.fatal(Alert.HANDSHAKE_FAILURE,
                         "Missing cipher algorithm", gse);
-                return null;    // make the compiler happy
+            }
+
+            if (readCipher == null) {
+                throw shc.conContext.fatal(Alert.ILLEGAL_PARAMETER,
+                    "Illegal cipher suite (" + shc.negotiatedCipherSuite +
+                    ") and protocol version (" + shc.negotiatedProtocol +
+                    ")");
             }
 
             shc.baseReadSecret = readSecret;
@@ -662,9 +662,15 @@
                         shc.sslContext.getSecureRandom());
             } catch (GeneralSecurityException gse) {
                 // unlikely
-                shc.conContext.fatal(Alert.HANDSHAKE_FAILURE,
+                throw shc.conContext.fatal(Alert.HANDSHAKE_FAILURE,
                         "Missing cipher algorithm", gse);
-                return null;    //  make the compiler happy
+            }
+
+            if (writeCipher == null) {
+                throw shc.conContext.fatal(Alert.ILLEGAL_PARAMETER,
+                    "Illegal cipher suite (" + shc.negotiatedCipherSuite +
+                    ") and protocol version (" + shc.negotiatedProtocol +
+                    ")");
             }
 
             shc.baseWriteSecret = writeSecret;
@@ -746,9 +752,8 @@
             CipherSuite cipherSuite =
                     T13ServerHelloProducer.chooseCipherSuite(shc, clientHello);
             if (cipherSuite == null) {
-                shc.conContext.fatal(Alert.HANDSHAKE_FAILURE,
+                throw shc.conContext.fatal(Alert.HANDSHAKE_FAILURE,
                         "no cipher suites in common for hello retry request");
-                return null;    // make the compiler happy
             }
 
             ServerHelloMessage hhrm = new ServerHelloMessage(shc,
@@ -857,7 +862,7 @@
                         SSLHandshake.HELLO_VERIFY_REQUEST.id);
             }
             if (!chc.handshakeConsumers.isEmpty()) {
-                chc.conContext.fatal(Alert.UNEXPECTED_MESSAGE,
+                throw chc.conContext.fatal(Alert.UNEXPECTED_MESSAGE,
                     "No more message expected before ServerHello is processed");
             }
 
@@ -895,14 +900,14 @@
             }
 
             if (!chc.activeProtocols.contains(serverVersion)) {
-                chc.conContext.fatal(Alert.PROTOCOL_VERSION,
+                throw chc.conContext.fatal(Alert.PROTOCOL_VERSION,
                     "The server selected protocol version " + serverVersion +
                     " is not accepted by client preferences " +
                     chc.activeProtocols);
             }
 
             if (!serverVersion.useTLS13PlusSpec()) {
-                chc.conContext.fatal(Alert.PROTOCOL_VERSION,
+                throw chc.conContext.fatal(Alert.PROTOCOL_VERSION,
                     "Unexpected HelloRetryRequest for " + serverVersion.name);
             }
 
@@ -947,7 +952,7 @@
             }
 
             if (!chc.activeProtocols.contains(serverVersion)) {
-                chc.conContext.fatal(Alert.PROTOCOL_VERSION,
+                throw chc.conContext.fatal(Alert.PROTOCOL_VERSION,
                     "The server selected protocol version " + serverVersion +
                     " is not accepted by client preferences " +
                     chc.activeProtocols);
@@ -964,7 +969,7 @@
             }
 
             if (serverHello.serverRandom.isVersionDowngrade(chc)) {
-                chc.conContext.fatal(Alert.ILLEGAL_PARAMETER,
+                throw chc.conContext.fatal(Alert.ILLEGAL_PARAMETER,
                     "A potential protocol version downgrade attack");
             }
 
@@ -1007,7 +1012,7 @@
             ClientHandshakeContext chc = (ClientHandshakeContext)context;
             ServerHelloMessage serverHello = (ServerHelloMessage)message;
             if (!chc.isNegotiable(serverHello.serverVersion)) {
-                chc.conContext.fatal(Alert.PROTOCOL_VERSION,
+                throw chc.conContext.fatal(Alert.PROTOCOL_VERSION,
                     "Server chose " + serverHello.serverVersion +
                     ", but that protocol version is not enabled or " +
                     "not supported by the client.");
@@ -1019,7 +1024,7 @@
                     chc.negotiatedProtocol, chc.negotiatedCipherSuite);
             chc.serverHelloRandom = serverHello.serverRandom;
             if (chc.negotiatedCipherSuite.keyExchange == null) {
-                chc.conContext.fatal(Alert.PROTOCOL_VERSION,
+                throw chc.conContext.fatal(Alert.PROTOCOL_VERSION,
                     "TLS 1.2 or prior version does not support the " +
                     "server cipher suite: " + chc.negotiatedCipherSuite.name);
             }
@@ -1045,7 +1050,7 @@
                     // Verify that the session ciphers are unchanged.
                     CipherSuite sessionSuite = chc.resumingSession.getSuite();
                     if (chc.negotiatedCipherSuite != sessionSuite) {
-                        chc.conContext.fatal(Alert.PROTOCOL_VERSION,
+                        throw chc.conContext.fatal(Alert.PROTOCOL_VERSION,
                             "Server returned wrong cipher suite for session");
                     }
 
@@ -1053,7 +1058,7 @@
                     ProtocolVersion sessionVersion =
                             chc.resumingSession.getProtocolVersion();
                     if (chc.negotiatedProtocol != sessionVersion) {
-                        chc.conContext.fatal(Alert.PROTOCOL_VERSION,
+                        throw chc.conContext.fatal(Alert.PROTOCOL_VERSION,
                             "Server resumed with wrong protocol version");
                     }
 
@@ -1072,7 +1077,7 @@
                     }
                     chc.isResumption = false;
                     if (!chc.sslConfig.enableSessionCreation) {
-                        chc.conContext.fatal(Alert.PROTOCOL_VERSION,
+                        throw chc.conContext.fatal(Alert.PROTOCOL_VERSION,
                             "New session creation is disabled");
                     }
                 }
@@ -1091,7 +1096,7 @@
                 }
 
                 if (!chc.sslConfig.enableSessionCreation) {
-                    chc.conContext.fatal(Alert.PROTOCOL_VERSION,
+                    throw chc.conContext.fatal(Alert.PROTOCOL_VERSION,
                         "New session creation is disabled");
                 }
                 chc.handshakeSession = new SSLSessionImpl(chc,
@@ -1112,7 +1117,7 @@
                         SSLTrafficKeyDerivation.valueOf(chc.negotiatedProtocol);
                 if (kdg == null) {
                     // unlikely
-                    chc.conContext.fatal(Alert.INTERNAL_ERROR,
+                    throw chc.conContext.fatal(Alert.INTERNAL_ERROR,
                             "Not supported key derivation: " +
                             chc.negotiatedProtocol);
                 } else {
@@ -1183,7 +1188,7 @@
             ClientHandshakeContext chc = (ClientHandshakeContext)context;
             ServerHelloMessage serverHello = (ServerHelloMessage)message;
             if (serverHello.serverVersion != ProtocolVersion.TLS12) {
-                chc.conContext.fatal(Alert.PROTOCOL_VERSION,
+                throw chc.conContext.fatal(Alert.PROTOCOL_VERSION,
                     "The ServerHello.legacy_version field is not TLS 1.2");
             }
 
@@ -1208,7 +1213,7 @@
                 }
 
                 if (!chc.sslConfig.enableSessionCreation) {
-                    chc.conContext.fatal(Alert.PROTOCOL_VERSION,
+                    throw chc.conContext.fatal(Alert.PROTOCOL_VERSION,
                         "New session creation is disabled");
                 }
                 chc.handshakeSession = new SSLSessionImpl(chc,
@@ -1221,7 +1226,7 @@
                 Optional<SecretKey> psk =
                         chc.resumingSession.consumePreSharedKey();
                 if(!psk.isPresent()) {
-                    chc.conContext.fatal(Alert.INTERNAL_ERROR,
+                    throw chc.conContext.fatal(Alert.INTERNAL_ERROR,
                     "No PSK available. Unable to resume.");
                 }
 
@@ -1242,9 +1247,8 @@
             SSLKeyExchange ke = chc.handshakeKeyExchange;
             if (ke == null) {
                 // unlikely
-                chc.conContext.fatal(Alert.INTERNAL_ERROR,
+                throw chc.conContext.fatal(Alert.INTERNAL_ERROR,
                         "Not negotiated key shares");
-                return;     // make the compiler happy
             }
 
             SSLKeyDerivation handshakeKD = ke.createKeyDerivation(chc);
@@ -1254,10 +1258,9 @@
                 SSLTrafficKeyDerivation.valueOf(chc.negotiatedProtocol);
             if (kdg == null) {
                 // unlikely
-                chc.conContext.fatal(Alert.INTERNAL_ERROR,
+                throw chc.conContext.fatal(Alert.INTERNAL_ERROR,
                         "Not supported key derivation: " +
                         chc.negotiatedProtocol);
-                return;     // make the compiler happy
             }
 
             SSLKeyDerivation secretKD =
@@ -1284,9 +1287,15 @@
                         chc.sslContext.getSecureRandom());
             } catch (GeneralSecurityException gse) {
                 // unlikely
-                chc.conContext.fatal(Alert.HANDSHAKE_FAILURE,
+                throw chc.conContext.fatal(Alert.HANDSHAKE_FAILURE,
                         "Missing cipher algorithm", gse);
-                return;     // make the compiler happy
+            }
+
+            if (readCipher == null) {
+                throw chc.conContext.fatal(Alert.ILLEGAL_PARAMETER,
+                    "Illegal cipher suite (" + chc.negotiatedCipherSuite +
+                    ") and protocol version (" + chc.negotiatedProtocol +
+                    ")");
             }
 
             chc.baseReadSecret = readSecret;
@@ -1312,9 +1321,15 @@
                         chc.sslContext.getSecureRandom());
             } catch (GeneralSecurityException gse) {
                 // unlikely
-                chc.conContext.fatal(Alert.HANDSHAKE_FAILURE,
+                throw chc.conContext.fatal(Alert.HANDSHAKE_FAILURE,
                         "Missing cipher algorithm", gse);
-                return;     //  make the compiler happy
+            }
+
+            if (writeCipher == null) {
+                throw chc.conContext.fatal(Alert.ILLEGAL_PARAMETER,
+                    "Illegal cipher suite (" + chc.negotiatedCipherSuite +
+                    ") and protocol version (" + chc.negotiatedProtocol +
+                    ")");
             }
 
             chc.baseWriteSecret = writeSecret;
@@ -1376,7 +1391,7 @@
             ClientHandshakeContext chc = (ClientHandshakeContext)context;
             ServerHelloMessage helloRetryRequest = (ServerHelloMessage)message;
             if (helloRetryRequest.serverVersion != ProtocolVersion.TLS12) {
-                chc.conContext.fatal(Alert.PROTOCOL_VERSION,
+                throw chc.conContext.fatal(Alert.PROTOCOL_VERSION,
                     "The HelloRetryRequest.legacy_version is not TLS 1.2");
             }
 
@@ -1406,7 +1421,7 @@
                 chc.initialClientHelloMsg.write(hos);
             } catch (IOException ioe) {
                 // unlikely
-                chc.conContext.fatal(Alert.HANDSHAKE_FAILURE,
+                throw chc.conContext.fatal(Alert.HANDSHAKE_FAILURE,
                     "Failed to construct message hash", ioe);
             }
             chc.handshakeHash.deliver(hos.toByteArray());
--- a/src/java.base/share/classes/sun/security/ssl/ServerHelloDone.java	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/java.base/share/classes/sun/security/ssl/ServerHelloDone.java	Tue Jan 15 10:55:26 2019 -0800
@@ -50,7 +50,7 @@
                 ByteBuffer m) throws IOException {
             super(handshakeContext);
             if (m.hasRemaining()) {
-                handshakeContext.conContext.fatal(Alert.ILLEGAL_PARAMETER,
+                throw handshakeContext.conContext.fatal(Alert.ILLEGAL_PARAMETER,
                     "Error parsing ServerHelloDone message: not empty");
             }
         }
--- a/src/java.base/share/classes/sun/security/ssl/ServerKeyExchange.java	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/java.base/share/classes/sun/security/ssl/ServerKeyExchange.java	Tue Jan 15 10:55:26 2019 -0800
@@ -68,9 +68,8 @@
             }
 
             // not producer defined.
-            shc.conContext.fatal(Alert.HANDSHAKE_FAILURE,
+            throw shc.conContext.fatal(Alert.HANDSHAKE_FAILURE,
                     "No ServerKeyExchange handshake message can be produced.");
-            return null;    // make the compiler happe
         }
     }
 
@@ -107,7 +106,7 @@
             }
 
             // no consumer defined.
-            chc.conContext.fatal(Alert.UNEXPECTED_MESSAGE,
+            throw chc.conContext.fatal(Alert.UNEXPECTED_MESSAGE,
                         "Unexpected ServerKeyExchange handshake message.");
         }
     }
--- a/src/java.base/share/classes/sun/security/ssl/ServerNameExtension.java	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/java.base/share/classes/sun/security/ssl/ServerNameExtension.java	Tue Jan 15 10:55:26 2019 -0800
@@ -295,8 +295,7 @@
             try {
                 spec = new CHServerNamesSpec(buffer);
             } catch (IOException ioe) {
-                shc.conContext.fatal(Alert.UNEXPECTED_MESSAGE, ioe);
-                return;     // fatal() always throws, make the compiler happy.
+                throw shc.conContext.fatal(Alert.UNEXPECTED_MESSAGE, ioe);
             }
 
             // Update the context.
@@ -314,7 +313,7 @@
                     }
                 } else {
                     // We do not reject client without SNI extension currently.
-                    shc.conContext.fatal(Alert.UNRECOGNIZED_NAME,
+                    throw shc.conContext.fatal(Alert.UNRECOGNIZED_NAME,
                             "Unrecognized server name indication");
                 }
             } else {
@@ -483,13 +482,13 @@
             CHServerNamesSpec spec = (CHServerNamesSpec)
                     chc.handshakeExtensions.get(CH_SERVER_NAME);
             if (spec == null) {
-                chc.conContext.fatal(Alert.UNEXPECTED_MESSAGE,
+                throw chc.conContext.fatal(Alert.UNEXPECTED_MESSAGE,
                     "Unexpected ServerHello server_name extension");
             }
 
             // Parse the extension.
             if (buffer.remaining() != 0) {
-                chc.conContext.fatal(Alert.UNEXPECTED_MESSAGE,
+                throw chc.conContext.fatal(Alert.UNEXPECTED_MESSAGE,
                     "Invalid ServerHello server_name extension");
             }
 
@@ -570,13 +569,13 @@
             CHServerNamesSpec spec = (CHServerNamesSpec)
                     chc.handshakeExtensions.get(CH_SERVER_NAME);
             if (spec == null) {
-                chc.conContext.fatal(Alert.UNEXPECTED_MESSAGE,
+                throw chc.conContext.fatal(Alert.UNEXPECTED_MESSAGE,
                     "Unexpected EncryptedExtensions server_name extension");
             }
 
             // Parse the extension.
             if (buffer.remaining() != 0) {
-                chc.conContext.fatal(Alert.UNEXPECTED_MESSAGE,
+                throw chc.conContext.fatal(Alert.UNEXPECTED_MESSAGE,
                     "Invalid EncryptedExtensions server_name extension");
             }
 
--- a/src/java.base/share/classes/sun/security/ssl/SignatureAlgorithmsExtension.java	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/java.base/share/classes/sun/security/ssl/SignatureAlgorithmsExtension.java	Tue Jan 15 10:55:26 2019 -0800
@@ -238,8 +238,7 @@
             try {
                 spec = new SignatureSchemesSpec(buffer);
             } catch (IOException ioe) {
-                shc.conContext.fatal(Alert.UNEXPECTED_MESSAGE, ioe);
-                return;     // fatal() always throws, make the compiler happy.
+                throw shc.conContext.fatal(Alert.UNEXPECTED_MESSAGE, ioe);
             }
 
             // Update the context.
@@ -329,7 +328,7 @@
             // We may support the server authentication other than X.509
             // certificate later.
             if (shc.negotiatedProtocol.useTLS13PlusSpec()) {
-                shc.conContext.fatal(Alert.MISSING_EXTENSION,
+                throw shc.conContext.fatal(Alert.MISSING_EXTENSION,
                     "No mandatory signature_algorithms extension in the " +
                     "received CertificateRequest handshake message");
             }
@@ -403,10 +402,9 @@
             // handshake message in TLS 1.3.
             if (!shc.sslConfig.isAvailable(
                     SSLExtension.CR_SIGNATURE_ALGORITHMS)) {
-                shc.conContext.fatal(Alert.MISSING_EXTENSION,
+                throw shc.conContext.fatal(Alert.MISSING_EXTENSION,
                         "No available signature_algorithms extension " +
                         "for client certificate authentication");
-                return null;    // make the compiler happy
             }
 
             // Produce the extension.
@@ -454,10 +452,9 @@
             // handshake message in TLS 1.3.
             if (!chc.sslConfig.isAvailable(
                     SSLExtension.CR_SIGNATURE_ALGORITHMS)) {
-                chc.conContext.fatal(Alert.HANDSHAKE_FAILURE,
+                throw chc.conContext.fatal(Alert.HANDSHAKE_FAILURE,
                         "No available signature_algorithms extension " +
                         "for client certificate authentication");
-                return;     // make the compiler happy
             }
 
             // Parse the extension.
@@ -465,8 +462,7 @@
             try {
                 spec = new SignatureSchemesSpec(buffer);
             } catch (IOException ioe) {
-                chc.conContext.fatal(Alert.UNEXPECTED_MESSAGE, ioe);
-                return;     // fatal() always throws, make the compiler happy.
+                throw chc.conContext.fatal(Alert.UNEXPECTED_MESSAGE, ioe);
             }
 
             List<SignatureScheme> knownSignatureSchemes = new LinkedList<>();
@@ -545,7 +541,7 @@
 
             // This is a mandatory extension for CertificateRequest handshake
             // message in TLS 1.3.
-            chc.conContext.fatal(Alert.MISSING_EXTENSION,
+            throw chc.conContext.fatal(Alert.MISSING_EXTENSION,
                     "No mandatory signature_algorithms extension in the " +
                     "received CertificateRequest handshake message");
         }
--- a/src/java.base/share/classes/sun/security/ssl/SupportedGroupsExtension.java	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/java.base/share/classes/sun/security/ssl/SupportedGroupsExtension.java	Tue Jan 15 10:55:26 2019 -0800
@@ -900,8 +900,7 @@
             try {
                 spec = new SupportedGroupsSpec(buffer);
             } catch (IOException ioe) {
-                shc.conContext.fatal(Alert.UNEXPECTED_MESSAGE, ioe);
-                return;     // fatal() always throws, make the compiler happy.
+                throw shc.conContext.fatal(Alert.UNEXPECTED_MESSAGE, ioe);
             }
 
             // Update the context.
@@ -1024,8 +1023,7 @@
             try {
                 spec = new SupportedGroupsSpec(buffer);
             } catch (IOException ioe) {
-                chc.conContext.fatal(Alert.UNEXPECTED_MESSAGE, ioe);
-                return;     // fatal() always throws, make the compiler happy.
+                throw chc.conContext.fatal(Alert.UNEXPECTED_MESSAGE, ioe);
             }
 
             // Update the context.
--- a/src/java.base/share/classes/sun/security/ssl/SupportedVersionsExtension.java	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/java.base/share/classes/sun/security/ssl/SupportedVersionsExtension.java	Tue Jan 15 10:55:26 2019 -0800
@@ -225,8 +225,7 @@
             try {
                 spec = new CHSupportedVersionsSpec(buffer);
             } catch (IOException ioe) {
-                shc.conContext.fatal(Alert.UNEXPECTED_MESSAGE, ioe);
-                return;     // fatal() always throws, make the compiler happy.
+                throw shc.conContext.fatal(Alert.UNEXPECTED_MESSAGE, ioe);
             }
 
             // Update the context.
@@ -368,8 +367,7 @@
             try {
                 spec = new SHSupportedVersionsSpec(buffer);
             } catch (IOException ioe) {
-                chc.conContext.fatal(Alert.UNEXPECTED_MESSAGE, ioe);
-                return;     // fatal() always throws, make the compiler happy.
+                throw chc.conContext.fatal(Alert.UNEXPECTED_MESSAGE, ioe);
             }
 
             // Update the context.
@@ -458,8 +456,7 @@
             try {
                 spec = new SHSupportedVersionsSpec(buffer);
             } catch (IOException ioe) {
-                chc.conContext.fatal(Alert.UNEXPECTED_MESSAGE, ioe);
-                return;     // fatal() always throws, make the compiler happy.
+                throw chc.conContext.fatal(Alert.UNEXPECTED_MESSAGE, ioe);
             }
 
             // Update the context.
--- a/src/java.base/share/classes/sun/security/ssl/TransportContext.java	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/java.base/share/classes/sun/security/ssl/TransportContext.java	Tue Jan 15 10:55:26 2019 -0800
@@ -148,9 +148,8 @@
 
         ContentType ct = ContentType.valueOf(plaintext.contentType);
         if (ct == null) {
-            fatal(Alert.UNEXPECTED_MESSAGE,
+            throw fatal(Alert.UNEXPECTED_MESSAGE,
                 "Unknown content type: " + plaintext.contentType);
-            return;
         }
 
         switch (ct) {
@@ -164,7 +163,7 @@
                                 protocolVersion.useTLS13PlusSpec()) {
                             handshakeContext = new PostHandshakeContext(this);
                         } else {
-                            fatal(Alert.UNEXPECTED_MESSAGE,
+                            throw fatal(Alert.UNEXPECTED_MESSAGE,
                                     "Unexpected post-handshake message: " +
                                     SSLHandshake.nameOf(type));
                         }
@@ -185,7 +184,7 @@
                 if (consumer != null) {
                     consumer.consume(this, plaintext.fragment);
                 } else {
-                    fatal(Alert.UNEXPECTED_MESSAGE,
+                    throw fatal(Alert.UNEXPECTED_MESSAGE,
                         "Unexpected content: " + plaintext.contentType);
                 }
         }
@@ -250,22 +249,22 @@
         }
     }
 
-    void fatal(Alert alert,
+    SSLException fatal(Alert alert,
             String diagnostic) throws SSLException {
-        fatal(alert, diagnostic, null);
+        return fatal(alert, diagnostic, null);
     }
 
-    void fatal(Alert alert, Throwable cause) throws SSLException {
-        fatal(alert, null, cause);
+    SSLException fatal(Alert alert, Throwable cause) throws SSLException {
+        return fatal(alert, null, cause);
     }
 
-    void fatal(Alert alert,
+    SSLException fatal(Alert alert,
             String diagnostic, Throwable cause) throws SSLException {
-        fatal(alert, diagnostic, false, cause);
+        return fatal(alert, diagnostic, false, cause);
     }
 
     // Note: close_notify is not delivered via fatal() methods.
-    void fatal(Alert alert, String diagnostic,
+    SSLException fatal(Alert alert, String diagnostic,
             boolean recvFatalAlert, Throwable cause) throws SSLException {
         // If we've already shutdown because of an error, there is nothing we
         // can do except rethrow the exception.
@@ -328,6 +327,8 @@
             if (SSLLogger.isOn && SSLLogger.isOn("ssl")) {
                 SSLLogger.warning("Fatal: input record closure failed", ioe);
             }
+
+            closeReason.addSuppressed(ioe);
         }
 
         // invalidate the session
@@ -353,6 +354,8 @@
                     SSLLogger.warning(
                         "Fatal: failed to send fatal alert " + alert, ioe);
                 }
+
+                closeReason.addSuppressed(ioe);
             }
         }
 
@@ -363,6 +366,8 @@
             if (SSLLogger.isOn && SSLLogger.isOn("ssl")) {
                 SSLLogger.warning("Fatal: output record closure failed", ioe);
             }
+
+            closeReason.addSuppressed(ioe);
         }
 
         // terminate the handshake context
@@ -377,6 +382,8 @@
             if (SSLLogger.isOn && SSLLogger.isOn("ssl")) {
                 SSLLogger.warning("Fatal: transport closure failed", ioe);
             }
+
+            closeReason.addSuppressed(ioe);
         } finally {
             isBroken = true;
         }
@@ -570,13 +577,7 @@
             } else if (!isOutboundClosed()) {
                 // Special case that the inbound was closed, but outbound open.
                 return HandshakeStatus.NEED_WRAP;
-            }
-        } else if (isOutboundClosed() && !isInboundClosed()) {
-            // Special case that the outbound was closed, but inbound open.
-            return HandshakeStatus.NEED_UNWRAP;
-        } else if (!isOutboundClosed() && isInboundClosed()) {
-            // Special case that the inbound was closed, but outbound open.
-            return HandshakeStatus.NEED_WRAP;
+            }   // Otherwise, both inbound and outbound are closed.
         }
 
         return HandshakeStatus.NOT_HANDSHAKING;
--- a/src/java.base/share/classes/sun/security/tools/keytool/Resources_ja.java	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/java.base/share/classes/sun/security/tools/keytool/Resources_ja.java	Tue Jan 15 10:55:26 2019 -0800
@@ -61,16 +61,16 @@
         {"Exports.certificate",
                 "\u8A3C\u660E\u66F8\u3092\u30A8\u30AF\u30B9\u30DD\u30FC\u30C8\u3057\u307E\u3059"}, //-exportcert
         {"Generates.a.key.pair",
-                "\u9375\u30DA\u30A2\u3092\u751F\u6210\u3057\u307E\u3059"}, //-genkeypair
+                "\u30AD\u30FC\u30FB\u30DA\u30A2\u3092\u751F\u6210\u3057\u307E\u3059"}, //-genkeypair
         {"Generates.a.secret.key",
-                "\u79D8\u5BC6\u9375\u3092\u751F\u6210\u3057\u307E\u3059"}, //-genseckey
+                "\u79D8\u5BC6\u30AD\u30FC\u3092\u751F\u6210\u3057\u307E\u3059"}, //-genseckey
         {"Generates.certificate.from.a.certificate.request",
                 "\u8A3C\u660E\u66F8\u30EA\u30AF\u30A8\u30B9\u30C8\u304B\u3089\u8A3C\u660E\u66F8\u3092\u751F\u6210\u3057\u307E\u3059"}, //-gencert
         {"Generates.CRL", "CRL\u3092\u751F\u6210\u3057\u307E\u3059"}, //-gencrl
         {"Generated.keyAlgName.secret.key",
-                "{0}\u79D8\u5BC6\u9375\u3092\u751F\u6210\u3057\u307E\u3057\u305F"}, //-genseckey
+                "{0}\u79D8\u5BC6\u30AD\u30FC\u3092\u751F\u6210\u3057\u307E\u3057\u305F"}, //-genseckey
         {"Generated.keysize.bit.keyAlgName.secret.key",
-                "{0}\u30D3\u30C3\u30C8{1}\u79D8\u5BC6\u9375\u3092\u751F\u6210\u3057\u307E\u3057\u305F"}, //-genseckey
+                "{0}\u30D3\u30C3\u30C8{1}\u79D8\u5BC6\u30AD\u30FC\u3092\u751F\u6210\u3057\u307E\u3057\u305F"}, //-genseckey
         {"Imports.entries.from.a.JDK.1.1.x.style.identity.database",
                 "JDK 1.1.x-style\u30A2\u30A4\u30C7\u30F3\u30C6\u30A3\u30C6\u30A3\u30FB\u30C7\u30FC\u30BF\u30D9\u30FC\u30B9\u304B\u3089\u30A8\u30F3\u30C8\u30EA\u3092\u30A4\u30F3\u30DD\u30FC\u30C8\u3057\u307E\u3059"}, //-identitydb
         {"Imports.a.certificate.or.a.certificate.chain",
@@ -80,9 +80,9 @@
         {"Imports.one.or.all.entries.from.another.keystore",
                 "\u5225\u306E\u30AD\u30FC\u30B9\u30C8\u30A2\u304B\u30891\u3064\u307E\u305F\u306F\u3059\u3079\u3066\u306E\u30A8\u30F3\u30C8\u30EA\u3092\u30A4\u30F3\u30DD\u30FC\u30C8\u3057\u307E\u3059"}, //-importkeystore
         {"Clones.a.key.entry",
-                "\u9375\u30A8\u30F3\u30C8\u30EA\u306E\u30AF\u30ED\u30FC\u30F3\u3092\u4F5C\u6210\u3057\u307E\u3059"}, //-keyclone
+                "\u30AD\u30FC\u30FB\u30A8\u30F3\u30C8\u30EA\u306E\u30AF\u30ED\u30FC\u30F3\u3092\u4F5C\u6210\u3057\u307E\u3059"}, //-keyclone
         {"Changes.the.key.password.of.an.entry",
-                "\u30A8\u30F3\u30C8\u30EA\u306E\u9375\u30D1\u30B9\u30EF\u30FC\u30C9\u3092\u5909\u66F4\u3057\u307E\u3059"}, //-keypasswd
+                "\u30A8\u30F3\u30C8\u30EA\u306E\u30AD\u30FC\u30FB\u30D1\u30B9\u30EF\u30FC\u30C9\u3092\u5909\u66F4\u3057\u307E\u3059"}, //-keypasswd
         {"Lists.entries.in.a.keystore",
                 "\u30AD\u30FC\u30B9\u30C8\u30A2\u5185\u306E\u30A8\u30F3\u30C8\u30EA\u3092\u30EA\u30B9\u30C8\u3057\u307E\u3059"}, //-list
         {"Prints.the.content.of.a.certificate",
@@ -98,6 +98,8 @@
         // keytool: help: options
         {"alias.name.of.the.entry.to.process",
                 "\u51E6\u7406\u3059\u308B\u30A8\u30F3\u30C8\u30EA\u306E\u5225\u540D"}, //-alias
+        {"groupname.option.help",
+                "\u30B0\u30EB\u30FC\u30D7\u540D\u3002\u305F\u3068\u3048\u3070\u3001\u6955\u5186\u66F2\u7DDA\u540D\u3067\u3059\u3002"}, //-groupname
         {"destination.alias",
                 "\u51FA\u529B\u5148\u306E\u5225\u540D"}, //-destalias
         {"destination.key.password",
@@ -121,11 +123,11 @@
         {"input.file.name",
                 "\u5165\u529B\u30D5\u30A1\u30A4\u30EB\u540D"}, //-file and -infile
         {"key.algorithm.name",
-                "\u9375\u30A2\u30EB\u30B4\u30EA\u30BA\u30E0\u540D"}, //-keyalg
+                "\u30AD\u30FC\u30FB\u30A2\u30EB\u30B4\u30EA\u30BA\u30E0\u540D"}, //-keyalg
         {"key.password",
-                "\u9375\u306E\u30D1\u30B9\u30EF\u30FC\u30C9"}, //-keypass
+                "\u30AD\u30FC\u306E\u30D1\u30B9\u30EF\u30FC\u30C9"}, //-keypass
         {"key.bit.size",
-                "\u9375\u306E\u30D3\u30C3\u30C8\u30FB\u30B5\u30A4\u30BA"}, //-keysize
+                "\u30AD\u30FC\u306E\u30D3\u30C3\u30C8\u30FB\u30B5\u30A4\u30BA"}, //-keysize
         {"keystore.name",
                 "\u30AD\u30FC\u30B9\u30C8\u30A2\u540D"}, //-keystore
         {"access.the.cacerts.keystore",
@@ -196,7 +198,7 @@
         {"Cannot.find.file.", "\u30D5\u30A1\u30A4\u30EB\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093: "},
         {"Command.option.flag.needs.an.argument.", "\u30B3\u30DE\u30F3\u30C9\u30FB\u30AA\u30D7\u30B7\u30E7\u30F3{0}\u306B\u306F\u5F15\u6570\u304C\u5FC5\u8981\u3067\u3059\u3002"},
         {"Warning.Different.store.and.key.passwords.not.supported.for.PKCS12.KeyStores.Ignoring.user.specified.command.value.",
-                "\u8B66\u544A: PKCS12\u30AD\u30FC\u30B9\u30C8\u30A2\u3067\u306F\u3001\u30B9\u30C8\u30A2\u306E\u30D1\u30B9\u30EF\u30FC\u30C9\u3068\u9375\u306E\u30D1\u30B9\u30EF\u30FC\u30C9\u304C\u7570\u306A\u308B\u72B6\u6CC1\u306F\u30B5\u30DD\u30FC\u30C8\u3055\u308C\u307E\u305B\u3093\u3002\u30E6\u30FC\u30B6\u30FC\u304C\u6307\u5B9A\u3057\u305F{0}\u306E\u5024\u306F\u7121\u8996\u3057\u307E\u3059\u3002"},
+                "\u8B66\u544A: PKCS12\u30AD\u30FC\u30B9\u30C8\u30A2\u3067\u306F\u3001\u30B9\u30C8\u30A2\u306E\u30D1\u30B9\u30EF\u30FC\u30C9\u3068\u30AD\u30FC\u306E\u30D1\u30B9\u30EF\u30FC\u30C9\u304C\u7570\u306A\u308B\u72B6\u6CC1\u306F\u30B5\u30DD\u30FC\u30C8\u3055\u308C\u307E\u305B\u3093\u3002\u30E6\u30FC\u30B6\u30FC\u304C\u6307\u5B9A\u3057\u305F{0}\u306E\u5024\u306F\u7121\u8996\u3057\u307E\u3059\u3002"},
         {"the.keystore.or.storetype.option.cannot.be.used.with.the.cacerts.option",
             "-keystore\u307E\u305F\u306F-storetype\u30AA\u30D7\u30B7\u30E7\u30F3\u306F\u3001-cacerts\u30AA\u30D7\u30B7\u30E7\u30F3\u3068\u3068\u3082\u306B\u4F7F\u7528\u3067\u304D\u307E\u305B\u3093"},
         {".keystore.must.be.NONE.if.storetype.is.{0}",
@@ -229,7 +231,7 @@
         {"Must.not.specify.both.v.and.rfc.with.list.command",
                 "'list'\u30B3\u30DE\u30F3\u30C9\u306B-v\u3068-rfc\u306E\u4E21\u65B9\u3092\u6307\u5B9A\u3059\u308B\u3053\u3068\u306F\u3067\u304D\u307E\u305B\u3093"},
         {"Key.password.must.be.at.least.6.characters",
-                "\u9375\u306E\u30D1\u30B9\u30EF\u30FC\u30C9\u306F6\u6587\u5B57\u4EE5\u4E0A\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059"},
+                "\u30AD\u30FC\u306E\u30D1\u30B9\u30EF\u30FC\u30C9\u306F6\u6587\u5B57\u4EE5\u4E0A\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059"},
         {"New.password.must.be.at.least.6.characters",
                 "\u65B0\u898F\u30D1\u30B9\u30EF\u30FC\u30C9\u306F6\u6587\u5B57\u4EE5\u4E0A\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059"},
         {"Keystore.file.exists.but.is.empty.",
@@ -280,31 +282,35 @@
                 "\u8A3C\u660E\u66F8\u304C\u30AD\u30FC\u30B9\u30C8\u30A2\u306B\u8FFD\u52A0\u3055\u308C\u307E\u305B\u3093\u3067\u3057\u305F"},
         {".Storing.ksfname.", "[{0}\u3092\u683C\u7D0D\u4E2D]"},
         {"alias.has.no.public.key.certificate.",
-                "{0}\u306B\u306F\u516C\u958B\u9375(\u8A3C\u660E\u66F8)\u304C\u3042\u308A\u307E\u305B\u3093"},
+                "{0}\u306B\u306F\u516C\u958B\u30AD\u30FC(\u8A3C\u660E\u66F8)\u304C\u3042\u308A\u307E\u305B\u3093"},
         {"Cannot.derive.signature.algorithm",
                 "\u7F72\u540D\u30A2\u30EB\u30B4\u30EA\u30BA\u30E0\u3092\u53D6\u5F97\u3067\u304D\u307E\u305B\u3093"},
         {"Alias.alias.does.not.exist",
                 "\u5225\u540D<{0}>\u306F\u5B58\u5728\u3057\u307E\u305B\u3093"},
         {"Alias.alias.has.no.certificate",
                 "\u5225\u540D<{0}>\u306B\u306F\u8A3C\u660E\u66F8\u304C\u3042\u308A\u307E\u305B\u3093"},
+        {"groupname.keysize.coexist",
+                "-groupname\u3068-keysize\u306E\u4E21\u65B9\u3092\u6307\u5B9A\u3067\u304D\u307E\u305B\u3093"},
+        {"deprecate.keysize.for.ec",
+                "-keysize\u306E\u6307\u5B9A\u306B\u3088\u308BEC\u30AD\u30FC\u306E\u751F\u6210\u306F\u975E\u63A8\u5968\u3067\u3059\u3002\u304B\u308F\u308A\u306B\"-groupname %s\"\u3092\u4F7F\u7528\u3057\u3066\u304F\u3060\u3055\u3044\u3002"},
         {"Key.pair.not.generated.alias.alias.already.exists",
-                "\u9375\u30DA\u30A2\u306F\u751F\u6210\u3055\u308C\u307E\u305B\u3093\u3067\u3057\u305F\u3002\u5225\u540D<{0}>\u306F\u3059\u3067\u306B\u5B58\u5728\u3057\u307E\u3059"},
+                "\u30AD\u30FC\u30FB\u30DA\u30A2\u306F\u751F\u6210\u3055\u308C\u307E\u305B\u3093\u3067\u3057\u305F\u3002\u5225\u540D<{0}>\u306F\u3059\u3067\u306B\u5B58\u5728\u3057\u307E\u3059"},
         {"Generating.keysize.bit.keyAlgName.key.pair.and.self.signed.certificate.sigAlgName.with.a.validity.of.validality.days.for",
-                "{3}\u65E5\u9593\u6709\u52B9\u306A{0}\u30D3\u30C3\u30C8\u306E{1}\u306E\u9375\u30DA\u30A2\u3068\u81EA\u5DF1\u7F72\u540D\u578B\u8A3C\u660E\u66F8({2})\u3092\u751F\u6210\u3057\u3066\u3044\u307E\u3059\n\t\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u540D: {4}"},
-        {"Enter.key.password.for.alias.", "<{0}>\u306E\u9375\u30D1\u30B9\u30EF\u30FC\u30C9\u3092\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044"},
+                "{3}\u65E5\u9593\u6709\u52B9\u306A{0}\u30D3\u30C3\u30C8\u306E{1}\u306E\u30AD\u30FC\u30FB\u30DA\u30A2\u3068\u81EA\u5DF1\u7F72\u540D\u578B\u8A3C\u660E\u66F8({2})\u3092\u751F\u6210\u3057\u3066\u3044\u307E\u3059\n\t\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u540D: {4}"},
+        {"Enter.key.password.for.alias.", "<{0}>\u306E\u30AD\u30FC\u30FB\u30D1\u30B9\u30EF\u30FC\u30C9\u3092\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044"},
         {".RETURN.if.same.as.keystore.password.",
                 "\t(\u30AD\u30FC\u30B9\u30C8\u30A2\u306E\u30D1\u30B9\u30EF\u30FC\u30C9\u3068\u540C\u3058\u5834\u5408\u306FRETURN\u3092\u62BC\u3057\u3066\u304F\u3060\u3055\u3044):  "},
         {"Key.password.is.too.short.must.be.at.least.6.characters",
-                "\u9375\u306E\u30D1\u30B9\u30EF\u30FC\u30C9\u304C\u77ED\u3059\u304E\u307E\u3059 - 6\u6587\u5B57\u4EE5\u4E0A\u3092\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044"},
+                "\u30AD\u30FC\u306E\u30D1\u30B9\u30EF\u30FC\u30C9\u304C\u77ED\u3059\u304E\u307E\u3059 - 6\u6587\u5B57\u4EE5\u4E0A\u3092\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044"},
         {"Too.many.failures.key.not.added.to.keystore",
-                "\u969C\u5BB3\u304C\u591A\u3059\u304E\u307E\u3059 - \u9375\u306F\u30AD\u30FC\u30B9\u30C8\u30A2\u306B\u8FFD\u52A0\u3055\u308C\u307E\u305B\u3093\u3067\u3057\u305F"},
+                "\u969C\u5BB3\u304C\u591A\u3059\u304E\u307E\u3059 - \u30AD\u30FC\u306F\u30AD\u30FC\u30B9\u30C8\u30A2\u306B\u8FFD\u52A0\u3055\u308C\u307E\u305B\u3093\u3067\u3057\u305F"},
         {"Destination.alias.dest.already.exists",
                 "\u51FA\u529B\u5148\u306E\u5225\u540D<{0}>\u306F\u3059\u3067\u306B\u5B58\u5728\u3057\u307E\u3059"},
         {"Password.is.too.short.must.be.at.least.6.characters",
                 "\u30D1\u30B9\u30EF\u30FC\u30C9\u304C\u77ED\u3059\u304E\u307E\u3059 - 6\u6587\u5B57\u4EE5\u4E0A\u3092\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044"},
         {"Too.many.failures.Key.entry.not.cloned",
-                "\u969C\u5BB3\u304C\u591A\u3059\u304E\u307E\u3059\u3002\u9375\u30A8\u30F3\u30C8\u30EA\u306E\u30AF\u30ED\u30FC\u30F3\u306F\u4F5C\u6210\u3055\u308C\u307E\u305B\u3093\u3067\u3057\u305F"},
-        {"key.password.for.alias.", "<{0}>\u306E\u9375\u306E\u30D1\u30B9\u30EF\u30FC\u30C9"},
+                "\u969C\u5BB3\u304C\u591A\u3059\u304E\u307E\u3059\u3002\u30AD\u30FC\u30FB\u30A8\u30F3\u30C8\u30EA\u306E\u30AF\u30ED\u30FC\u30F3\u306F\u4F5C\u6210\u3055\u308C\u307E\u305B\u3093\u3067\u3057\u305F"},
+        {"key.password.for.alias.", "<{0}>\u306E\u30AD\u30FC\u306E\u30D1\u30B9\u30EF\u30FC\u30C9"},
         {"Keystore.entry.for.id.getName.already.exists",
                 "<{0}>\u306E\u30AD\u30FC\u30B9\u30C8\u30A2\u30FB\u30A8\u30F3\u30C8\u30EA\u306F\u3059\u3067\u306B\u5B58\u5728\u3057\u307E\u3059"},
         {"Creating.keystore.entry.for.id.getName.",
@@ -330,7 +336,7 @@
         {"Failed.to.parse.input", "\u5165\u529B\u306E\u69CB\u6587\u89E3\u6790\u306B\u5931\u6557\u3057\u307E\u3057\u305F"},
         {"Empty.input", "\u5165\u529B\u304C\u3042\u308A\u307E\u305B\u3093"},
         {"Not.X.509.certificate", "X.509\u8A3C\u660E\u66F8\u3067\u306F\u3042\u308A\u307E\u305B\u3093"},
-        {"alias.has.no.public.key", "{0}\u306B\u306F\u516C\u958B\u9375\u304C\u3042\u308A\u307E\u305B\u3093"},
+        {"alias.has.no.public.key", "{0}\u306B\u306F\u516C\u958B\u30AD\u30FC\u304C\u3042\u308A\u307E\u305B\u3093"},
         {"alias.has.no.X.509.certificate", "{0}\u306B\u306FX.509\u8A3C\u660E\u66F8\u304C\u3042\u308A\u307E\u305B\u3093"},
         {"New.certificate.self.signed.", "\u65B0\u3057\u3044\u8A3C\u660E\u66F8(\u81EA\u5DF1\u7F72\u540D\u578B):"},
         {"Reply.has.no.certificates", "\u5FDC\u7B54\u306B\u306F\u8A3C\u660E\u66F8\u304C\u3042\u308A\u307E\u305B\u3093"},
@@ -377,9 +383,9 @@
         {"y", "y"},
         {".defaultValue.", "  [{0}]:  "},
         {"Alias.alias.has.no.key",
-                "\u5225\u540D<{0}>\u306B\u306F\u9375\u304C\u3042\u308A\u307E\u305B\u3093"},
+                "\u5225\u540D<{0}>\u306B\u306F\u30AD\u30FC\u304C\u3042\u308A\u307E\u305B\u3093"},
         {"Alias.alias.references.an.entry.type.that.is.not.a.private.key.entry.The.keyclone.command.only.supports.cloning.of.private.key",
-                 "\u5225\u540D<{0}>\u304C\u53C2\u7167\u3057\u3066\u3044\u308B\u30A8\u30F3\u30C8\u30EA\u30FB\u30BF\u30A4\u30D7\u306F\u79D8\u5BC6\u9375\u30A8\u30F3\u30C8\u30EA\u3067\u306F\u3042\u308A\u307E\u305B\u3093\u3002-keyclone\u30B3\u30DE\u30F3\u30C9\u306F\u79D8\u5BC6\u9375\u30A8\u30F3\u30C8\u30EA\u306E\u30AF\u30ED\u30FC\u30F3\u4F5C\u6210\u306E\u307F\u3092\u30B5\u30DD\u30FC\u30C8\u3057\u307E\u3059"},
+                 "\u5225\u540D<{0}>\u304C\u53C2\u7167\u3057\u3066\u3044\u308B\u30A8\u30F3\u30C8\u30EA\u30FB\u30BF\u30A4\u30D7\u306F\u79D8\u5BC6\u30AD\u30FC\u30FB\u30A8\u30F3\u30C8\u30EA\u3067\u306F\u3042\u308A\u307E\u305B\u3093\u3002-keyclone\u30B3\u30DE\u30F3\u30C9\u306F\u79D8\u5BC6\u30AD\u30FC\u30FB\u30A8\u30F3\u30C8\u30EA\u306E\u30AF\u30ED\u30FC\u30F3\u4F5C\u6210\u306E\u307F\u3092\u30B5\u30DD\u30FC\u30C8\u3057\u307E\u3059"},
 
         {".WARNING.WARNING.WARNING.",
             "*****************  WARNING WARNING WARNING  *****************"},
@@ -398,7 +404,7 @@
             "*\u30BD\u30FC\u30B9\u30FB\u30AD\u30FC\u30B9\u30C8\u30A2\u306B\u4FDD\u5B58\u3055\u308C\u305F\u60C5\u5831\u306E\u6574\u5408\u6027\u306F*\n*\u691C\u8A3C\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002\u6574\u5408\u6027\u3092\u691C\u8A3C\u3059\u308B\u306B\u306F*\n*\u30BD\u30FC\u30B9\u30FB\u30AD\u30FC\u30B9\u30C8\u30A2\u306E\u30D1\u30B9\u30EF\u30FC\u30C9\u3092\u5165\u529B\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002*"},
 
         {"Certificate.reply.does.not.contain.public.key.for.alias.",
-                "\u8A3C\u660E\u66F8\u5FDC\u7B54\u306B\u306F\u3001<{0}>\u306E\u516C\u958B\u9375\u306F\u542B\u307E\u308C\u307E\u305B\u3093"},
+                "\u8A3C\u660E\u66F8\u5FDC\u7B54\u306B\u306F\u3001<{0}>\u306E\u516C\u958B\u30AD\u30FC\u306F\u542B\u307E\u308C\u307E\u305B\u3093"},
         {"Incomplete.certificate.chain.in.reply",
                 "\u5FDC\u7B54\u3057\u305F\u8A3C\u660E\u66F8\u30C1\u30A7\u30FC\u30F3\u306F\u4E0D\u5B8C\u5168\u3067\u3059"},
         {"Certificate.chain.in.reply.does.not.verify.",
@@ -409,7 +415,7 @@
         {"Install.reply.anyway.no.", "\u5FDC\u7B54\u3092\u30A4\u30F3\u30B9\u30C8\u30FC\u30EB\u3057\u307E\u3059\u304B\u3002[\u3044\u3044\u3048]:  "},
         {"NO", "\u3044\u3044\u3048"},
         {"Public.keys.in.reply.and.keystore.don.t.match",
-                "\u5FDC\u7B54\u3057\u305F\u516C\u958B\u9375\u3068\u30AD\u30FC\u30B9\u30C8\u30A2\u304C\u4E00\u81F4\u3057\u307E\u305B\u3093"},
+                "\u5FDC\u7B54\u3057\u305F\u516C\u958B\u30AD\u30FC\u3068\u30AD\u30FC\u30B9\u30C8\u30A2\u304C\u4E00\u81F4\u3057\u307E\u305B\u3093"},
         {"Certificate.reply.and.certificate.in.keystore.are.identical",
                 "\u8A3C\u660E\u66F8\u5FDC\u7B54\u3068\u30AD\u30FC\u30B9\u30C8\u30A2\u5185\u306E\u8A3C\u660E\u66F8\u304C\u540C\u3058\u3067\u3059"},
         {"Failed.to.establish.chain.from.reply",
@@ -417,9 +423,9 @@
         {"n", "n"},
         {"Wrong.answer.try.again", "\u5FDC\u7B54\u304C\u9593\u9055\u3063\u3066\u3044\u307E\u3059\u3002\u3082\u3046\u4E00\u5EA6\u5B9F\u884C\u3057\u3066\u304F\u3060\u3055\u3044"},
         {"Secret.key.not.generated.alias.alias.already.exists",
-                "\u79D8\u5BC6\u9375\u306F\u751F\u6210\u3055\u308C\u307E\u305B\u3093\u3067\u3057\u305F\u3002\u5225\u540D<{0}>\u306F\u3059\u3067\u306B\u5B58\u5728\u3057\u307E\u3059"},
+                "\u79D8\u5BC6\u30AD\u30FC\u306F\u751F\u6210\u3055\u308C\u307E\u305B\u3093\u3067\u3057\u305F\u3002\u5225\u540D<{0}>\u306F\u3059\u3067\u306B\u5B58\u5728\u3057\u307E\u3059"},
         {"Please.provide.keysize.for.secret.key.generation",
-                "\u79D8\u5BC6\u9375\u306E\u751F\u6210\u6642\u306B\u306F -keysize\u3092\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044"},
+                "\u79D8\u5BC6\u30AD\u30FC\u306E\u751F\u6210\u6642\u306B\u306F -keysize\u3092\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044"},
 
         {"warning.not.verified.make.sure.keystore.is.correct",
             "\u8B66\u544A: \u691C\u8A3C\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002-keystore\u304C\u6B63\u3057\u3044\u3053\u3068\u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002"},
@@ -453,13 +459,13 @@
         {"alias.in.cacerts", "cacerts\u5185\u306E\u767A\u884C\u8005<%s>"},
         {"alias.in.keystore", "\u767A\u884C\u8005<%s>"},
         {"with.weak", "%s (\u5F31)"},
-        {"key.bit", "%1$d\u30D3\u30C3\u30C8%2$s\u9375"},
-        {"key.bit.weak", "%1$d\u30D3\u30C3\u30C8%2$s\u9375(\u5F31)"},
+        {"key.bit", "%1$d\u30D3\u30C3\u30C8%2$s\u30AD\u30FC"},
+        {"key.bit.weak", "%1$d\u30D3\u30C3\u30C8%2$s\u30AD\u30FC(\u5F31)"},
         {"unknown.size.1", "\u4E0D\u660E\u306A\u30B5\u30A4\u30BA\u306E%s\u30AD\u30FC"},
         {".PATTERN.printX509Cert.with.weak",
-                "\u6240\u6709\u8005: {0}\n\u767A\u884C\u8005: {1}\n\u30B7\u30EA\u30A2\u30EB\u756A\u53F7: {2}\n\u6709\u52B9\u671F\u9593\u306E\u958B\u59CB\u65E5: {3}\u7D42\u4E86\u65E5: {4}\n\u8A3C\u660E\u66F8\u306E\u30D5\u30A3\u30F3\u30AC\u30D7\u30EA\u30F3\u30C8:\n\t SHA1: {5}\n\t SHA256: {6}\n\u7F72\u540D\u30A2\u30EB\u30B4\u30EA\u30BA\u30E0\u540D: {7}\n\u30B5\u30D6\u30B8\u30A7\u30AF\u30C8\u516C\u958B\u9375\u30A2\u30EB\u30B4\u30EA\u30BA\u30E0: {8}\n\u30D0\u30FC\u30B8\u30E7\u30F3: {9}"},
+                "\u6240\u6709\u8005: {0}\n\u767A\u884C\u8005: {1}\n\u30B7\u30EA\u30A2\u30EB\u756A\u53F7: {2}\n\u6709\u52B9\u671F\u9593\u306E\u958B\u59CB\u65E5: {3}\u7D42\u4E86\u65E5: {4}\n\u8A3C\u660E\u66F8\u306E\u30D5\u30A3\u30F3\u30AC\u30D7\u30EA\u30F3\u30C8:\n\t SHA1: {5}\n\t SHA256: {6}\n\u7F72\u540D\u30A2\u30EB\u30B4\u30EA\u30BA\u30E0\u540D: {7}\n\u30B5\u30D6\u30B8\u30A7\u30AF\u30C8\u516C\u958B\u30AD\u30FC\u30FB\u30A2\u30EB\u30B4\u30EA\u30BA\u30E0: {8}\n\u30D0\u30FC\u30B8\u30E7\u30F3: {9}"},
         {"PKCS.10.with.weak",
-                "PKCS #10\u8A3C\u660E\u66F8\u30EA\u30AF\u30A8\u30B9\u30C8(\u30D0\u30FC\u30B8\u30E7\u30F31.0)\n\u30B5\u30D6\u30B8\u30A7\u30AF\u30C8: %1$s\n\u30D5\u30A9\u30FC\u30DE\u30C3\u30C8: %2$s\n\u516C\u958B\u9375: %3$s\n\u7F72\u540D\u30A2\u30EB\u30B4\u30EA\u30BA\u30E0: %4$s\n"},
+                "PKCS #10\u8A3C\u660E\u66F8\u30EA\u30AF\u30A8\u30B9\u30C8(\u30D0\u30FC\u30B8\u30E7\u30F31.0)\n\u30B5\u30D6\u30B8\u30A7\u30AF\u30C8: %1$s\n\u30D5\u30A9\u30FC\u30DE\u30C3\u30C8: %2$s\n\u516C\u958B\u30AD\u30FC: %3$s\n\u7F72\u540D\u30A2\u30EB\u30B4\u30EA\u30BA\u30E0: %4$s\n"},
         {"verified.by.s.in.s.weak", "%2$s\u5185\u306E%1$s\u306B\u3088\u308A%3$s\u3067\u691C\u8A3C\u3055\u308C\u307E\u3057\u305F"},
         {"whose.sigalg.risk", "%1$s\u306F%2$s\u7F72\u540D\u30A2\u30EB\u30B4\u30EA\u30BA\u30E0\u3092\u4F7F\u7528\u3057\u3066\u304A\u308A\u3001\u3053\u308C\u306F\u30BB\u30AD\u30E5\u30EA\u30C6\u30A3\u30FB\u30EA\u30B9\u30AF\u3068\u307F\u306A\u3055\u308C\u307E\u3059\u3002"},
         {"whose.key.risk", "%1$s\u306F%2$s\u3092\u4F7F\u7528\u3057\u3066\u304A\u308A\u3001\u3053\u308C\u306F\u30BB\u30AD\u30E5\u30EA\u30C6\u30A3\u30FB\u30EA\u30B9\u30AF\u3068\u307F\u306A\u3055\u308C\u307E\u3059\u3002"},
@@ -467,6 +473,7 @@
         {"migrate.keystore.warning", "\"%1$s\"\u304C%4$s\u306B\u79FB\u884C\u3055\u308C\u307E\u3057\u305F\u3002%2$s\u30AD\u30FC\u30B9\u30C8\u30A2\u306F\"%3$s\"\u3068\u3057\u3066\u30D0\u30C3\u30AF\u30A2\u30C3\u30D7\u3055\u308C\u307E\u3059\u3002"},
         {"backup.keystore.warning", "\u5143\u306E\u30AD\u30FC\u30B9\u30C8\u30A2\"%1$s\"\u306F\"%3$s\"\u3068\u3057\u3066\u30D0\u30C3\u30AF\u30A2\u30C3\u30D7\u3055\u308C\u307E\u3059..."},
         {"importing.keystore.status", "\u30AD\u30FC\u30B9\u30C8\u30A2%1$s\u3092%2$s\u306B\u30A4\u30F3\u30DD\u30FC\u30C8\u3057\u3066\u3044\u307E\u3059..."},
+        {"keyalg.option.1.missing.warning", "-keyalg\u30AA\u30D7\u30B7\u30E7\u30F3\u304C\u3042\u308A\u307E\u305B\u3093\u3002\u30C7\u30D5\u30A9\u30EB\u30C8\u306E\u30AD\u30FC\u30FB\u30A2\u30EB\u30B4\u30EA\u30BA\u30E0(%s)\u306F\u3001\u65E7\u5F0F\u306E\u30A2\u30EB\u30B4\u30EA\u30BA\u30E0\u3067\u3001\u73FE\u5728\u306F\u63A8\u5968\u3055\u308C\u307E\u305B\u3093\u3002JDK\u306E\u5F8C\u7D9A\u306E\u30EA\u30EA\u30FC\u30B9\u3067\u306F\u3001\u30C7\u30D5\u30A9\u30EB\u30C8\u306F\u524A\u9664\u3055\u308C\u308B\u4E88\u5B9A\u3067\u3001-keyalg\u30AA\u30D7\u30B7\u30E7\u30F3\u3092\u6307\u5B9A\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002"},
     };
 
 
--- a/src/java.base/share/classes/sun/security/tools/keytool/Resources_zh_CN.java	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/java.base/share/classes/sun/security/tools/keytool/Resources_zh_CN.java	Tue Jan 15 10:55:26 2019 -0800
@@ -98,6 +98,8 @@
         // keytool: help: options
         {"alias.name.of.the.entry.to.process",
                 "\u8981\u5904\u7406\u7684\u6761\u76EE\u7684\u522B\u540D"}, //-alias
+        {"groupname.option.help",
+                "\u7EC4\u540D\u3002\u4F8B\u5982\uFF0C\u692D\u5706\u66F2\u7EBF\u540D\u79F0\u3002"}, //-groupname
         {"destination.alias",
                 "\u76EE\u6807\u522B\u540D"}, //-destalias
         {"destination.key.password",
@@ -287,6 +289,10 @@
                 "\u522B\u540D <{0}> \u4E0D\u5B58\u5728"},
         {"Alias.alias.has.no.certificate",
                 "\u522B\u540D <{0}> \u6CA1\u6709\u8BC1\u4E66"},
+        {"groupname.keysize.coexist",
+                "\u65E0\u6CD5\u540C\u65F6\u6307\u5B9A -groupname \u548C -keysize"},
+        {"deprecate.keysize.for.ec",
+                "\u4E3A\u751F\u6210 EC \u5BC6\u94A5\u6307\u5B9A -keysize \u5DF2\u8FC7\u65F6\uFF0C\u8BF7\u6539\u4E3A\u4F7F\u7528 \"-groupname %s\"\u3002"},
         {"Key.pair.not.generated.alias.alias.already.exists",
                 "\u672A\u751F\u6210\u5BC6\u94A5\u5BF9, \u522B\u540D <{0}> \u5DF2\u7ECF\u5B58\u5728"},
         {"Generating.keysize.bit.keyAlgName.key.pair.and.self.signed.certificate.sigAlgName.with.a.validity.of.validality.days.for",
@@ -467,6 +473,7 @@
         {"migrate.keystore.warning", "\u5DF2\u5C06 \"%1$s\" \u8FC1\u79FB\u5230 %4$s\u3002\u5C06 %2$s \u5BC6\u94A5\u5E93\u4F5C\u4E3A \"%3$s\" \u8FDB\u884C\u4E86\u5907\u4EFD\u3002"},
         {"backup.keystore.warning", "\u5DF2\u5C06\u539F\u59CB\u5BC6\u94A5\u5E93 \"%1$s\" \u5907\u4EFD\u4E3A \"%3$s\"..."},
         {"importing.keystore.status", "\u6B63\u5728\u5C06\u5BC6\u94A5\u5E93 %1$s \u5BFC\u5165\u5230 %2$s..."},
+        {"keyalg.option.1.missing.warning", "\u65E0 -keyalg \u9009\u9879\u3002\u9ED8\u8BA4\u5BC6\u94A5\u7B97\u6CD5 (%s) \u662F\u4F20\u7EDF\u7B97\u6CD5\uFF0C\u4E0D\u518D\u63A8\u8350\u3002\u5728 JDK \u7684\u540E\u7EED\u53D1\u884C\u7248\u4E2D\uFF0C\u5C06\u5220\u9664\u9ED8\u8BA4\u503C\uFF0C\u60A8\u5FC5\u987B\u6307\u5B9A -keyalg \u9009\u9879\u3002"},
     };
 
 
--- a/src/java.base/share/classes/sun/security/util/AuthResources_ja.java	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/java.base/share/classes/sun/security/util/AuthResources_ja.java	Tue Jan 15 10:55:26 2019 -0800
@@ -88,7 +88,7 @@
         {"Keystore.alias.","\u30AD\u30FC\u30B9\u30C8\u30A2\u306E\u5225\u540D: "},
         {"Keystore.password.","\u30AD\u30FC\u30B9\u30C8\u30A2\u306E\u30D1\u30B9\u30EF\u30FC\u30C9: "},
         {"Private.key.password.optional.",
-            "\u79D8\u5BC6\u9375\u306E\u30D1\u30B9\u30EF\u30FC\u30C9(\u30AA\u30D7\u30B7\u30E7\u30F3): "},
+            "\u79D8\u5BC6\u30AD\u30FC\u306E\u30D1\u30B9\u30EF\u30FC\u30C9(\u30AA\u30D7\u30B7\u30E7\u30F3): "},
 
         // com.sun.security.auth.module.Krb5LoginModule
         {"Kerberos.username.defUsername.",
--- a/src/java.base/share/classes/sun/security/util/SignatureUtil.java	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/java.base/share/classes/sun/security/util/SignatureUtil.java	Tue Jan 15 10:55:26 2019 -0800
@@ -28,8 +28,6 @@
 import java.io.IOException;
 import java.security.*;
 import java.security.spec.*;
-import sun.security.util.ObjectIdentifier;
-import sun.security.x509.AlgorithmId;
 import sun.security.rsa.RSAUtil;
 
 /**
@@ -86,13 +84,12 @@
     // specified Signature object as signature parameters.
     public static void specialSetParameter(Signature sig, byte[] paramBytes)
             throws InvalidAlgorithmParameterException, ProviderException {
-
-        AlgorithmParameters params = null;
         if (paramBytes != null) {
             String sigName = sig.getAlgorithm();
-            params = createAlgorithmParameters(sigName, paramBytes);
+            AlgorithmParameters params =
+                createAlgorithmParameters(sigName, paramBytes);
+            specialSetParameter(sig, params);
         }
-        specialSetParameter(sig, params);
     }
 
     // Special method for setting the specified AlgorithmParameter object
@@ -100,16 +97,9 @@
     public static void specialSetParameter(Signature sig,
             AlgorithmParameters params)
             throws InvalidAlgorithmParameterException, ProviderException {
-
-        String sigName = sig.getAlgorithm();
         if (params != null) {
+            String sigName = sig.getAlgorithm();
             sig.setParameter(getParamSpec(sigName, params));
-        } else {
-            try {
-                sig.setParameter(null);
-            } catch (UnsupportedOperationException e) {
-                // ignore for maintaining backward compatibility
-            }
         }
     }
 }
--- a/src/java.base/share/classes/sun/security/x509/AVA.java	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/java.base/share/classes/sun/security/x509/AVA.java	Tue Jan 15 10:55:26 2019 -0800
@@ -1045,7 +1045,7 @@
 
             if (valStr == null) {
 
-                // rfc1779 specifies that attribute values associated
+                // RFC 1779 specifies that attribute values associated
                 // with non-standard keyword attributes may be represented
                 // using the hex format below.  This will be used only
                 // when the value is not a string type
--- a/src/java.base/share/classes/sun/security/x509/AlgorithmId.java	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/java.base/share/classes/sun/security/x509/AlgorithmId.java	Tue Jan 15 10:55:26 2019 -0800
@@ -166,15 +166,15 @@
 
             // Several AlgorithmId should omit the whole parameter part when
             // it's NULL. They are ---
-            // rfc3370 2.1: Implementations SHOULD generate SHA-1
+            // RFC 3370 2.1: Implementations SHOULD generate SHA-1
             // AlgorithmIdentifiers with absent parameters.
-            // rfc3447 C1: When id-sha1, id-sha224, id-sha256, id-sha384 and
+            // RFC 3447 C1: When id-sha1, id-sha224, id-sha256, id-sha384 and
             // id-sha512 are used in an AlgorithmIdentifier the parameters
             // (which are optional) SHOULD be omitted.
-            // rfc3279 2.3.2: The id-dsa algorithm syntax includes optional
+            // RFC 3279 2.3.2: The id-dsa algorithm syntax includes optional
             // domain parameters... When omitted, the parameters component
             // MUST be omitted entirely
-            // rfc3370 3.1: When the id-dsa-with-sha1 algorithm identifier
+            // RFC 3370 3.1: When the id-dsa-with-sha1 algorithm identifier
             // is used, the AlgorithmIdentifier parameters field MUST be absent.
             /*if (
                 algid.equals((Object)SHA_oid) ||
--- a/src/java.base/share/classes/sun/security/x509/CertificatePoliciesExtension.java	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/java.base/share/classes/sun/security/x509/CertificatePoliciesExtension.java	Tue Jan 15 10:55:26 2019 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2011, 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
@@ -45,7 +45,7 @@
  * certificate.
  * <p>
  * Optional qualifiers are not supported in this implementation, as they are
- * not recommended by RFC2459.
+ * not recommended by RFC 5280.
  *
  * The ASN.1 syntax for this is (IMPLICIT tagging is defined in the
  * module definition):
--- a/src/java.base/share/classes/sun/security/x509/DNSName.java	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/java.base/share/classes/sun/security/x509/DNSName.java	Tue Jan 15 10:55:26 2019 -0800
@@ -181,7 +181,7 @@
      * For example, www.host.example.com would satisfy the constraint but
      * host1.example.com would not.
      * <p>
-     * draft-ietf-pkix-new-part1-00.txt:  DNSName restrictions are expressed as foo.bar.com.
+     * RFC 5280:  DNSName restrictions are expressed as foo.bar.com.
      * Any DNSName that
      * can be constructed by simply adding to the left hand side of the name
      * satisfies the name constraint. For example, www.foo.bar.com would
--- a/src/java.base/share/classes/sun/security/x509/IPAddressName.java	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/java.base/share/classes/sun/security/x509/IPAddressName.java	Tue Jan 15 10:55:26 2019 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2002, 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
@@ -37,27 +37,27 @@
 /**
  * This class implements the IPAddressName as required by the GeneralNames
  * ASN.1 object.  Both IPv4 and IPv6 addresses are supported using the
- * formats specified in IETF PKIX RFC2459.
+ * formats specified in IETF PKIX RFC 5280.
  * <p>
- * [RFC2459 4.2.1.7 Subject Alternative Name]
- * When the subjectAltName extension contains a iPAddress, the address
- * MUST be stored in the octet string in "network byte order," as
- * specified in RFC 791. The least significant bit (LSB) of
- * each octet is the LSB of the corresponding byte in the network
- * address. For IP Version 4, as specified in RFC 791, the octet string
- * MUST contain exactly four octets.  For IP Version 6, as specified in
- * RFC 1883, the octet string MUST contain exactly sixteen octets.
+ * [RFC 5280 4.2.1.6 Subject Alternative Name]
+ * When the subjectAltName extension contains an iPAddress, the address
+ * MUST be stored in the octet string in "network byte order", as
+ * specified in [RFC791].  The least significant bit (LSB) of each octet
+ * is the LSB of the corresponding byte in the network address.  For IP
+ * version 4, as specified in [RFC791], the octet string MUST contain
+ * exactly four octets.  For IP version 6, as specified in
+ * [RFC 2460], the octet string MUST contain exactly sixteen octets.
  * <p>
- * [RFC2459 4.2.1.11 Name Constraints]
- * The syntax of iPAddress MUST be as described in section 4.2.1.7 with
- * the following additions specifically for Name Constraints.  For IPv4
- * addresses, the ipAddress field of generalName MUST contain eight (8)
- * octets, encoded in the style of RFC 1519 (CIDR) to represent an
- * address range.[RFC 1519]  For IPv6 addresses, the ipAddress field
+ * [RFC 5280 4.2.1.10 Name Constraints]
+ * The syntax of iPAddress MUST be as described in Section 4.2.1.6 with
+ * the following additions specifically for name constraints.  For IPv4
+ * addresses, the iPAddress field of GeneralName MUST contain eight (8)
+ * octets, encoded in the style of RFC 4632 (CIDR) to represent an
+ * address range [RFC 4632].  For IPv6 addresses, the iPAddress field
  * MUST contain 32 octets similarly encoded.  For example, a name
- * constraint for "class C" subnet 10.9.8.0 shall be represented as the
- * octets 0A 09 08 00 FF FF FF 00, representing the CIDR notation
- * 10.9.8.0/255.255.255.0.
+ * constraint for "class C" subnet 192.0.2.0 is represented as the
+ * octets C0 00 02 00 FF FF FF 00, representing the CIDR notation
+ * 192.0.2.0/24 (mask 255.255.255.0).
  * <p>
  * @see GeneralName
  * @see GeneralNameInterface
@@ -376,15 +376,16 @@
      * </ul>.  These results are used in checking NameConstraints during
      * certification path verification.
      * <p>
-     * [RFC2459] The syntax of iPAddress MUST be as described in section
-     * 4.2.1.7 with the following additions specifically for Name Constraints.
-     * For IPv4 addresses, the ipAddress field of generalName MUST contain
-     * eight (8) octets, encoded in the style of RFC 1519 (CIDR) to represent an
-     * address range.[RFC 1519]  For IPv6 addresses, the ipAddress field
+     * [RFC 5280 4.2.1.10 Name Constraints]
+     * The syntax of iPAddress MUST be as described in Section 4.2.1.6 with
+     * the following additions specifically for name constraints.  For IPv4
+     * addresses, the iPAddress field of GeneralName MUST contain eight (8)
+     * octets, encoded in the style of RFC 4632 (CIDR) to represent an
+     * address range [RFC 4632].  For IPv6 addresses, the iPAddress field
      * MUST contain 32 octets similarly encoded.  For example, a name
-     * constraint for "class C" subnet 10.9.8.0 shall be represented as the
-     * octets 0A 09 08 00 FF FF FF 00, representing the CIDR notation
-     * 10.9.8.0/255.255.255.0.
+     * constraint for "class C" subnet 192.0.2.0 is represented as the
+     * octets C0 00 02 00 FF FF FF 00, representing the CIDR notation
+     * 192.0.2.0/24 (mask 255.255.255.0).
      *
      * @param inputName to be checked for being constrained
      * @return constraint type above
--- a/src/java.base/share/classes/sun/security/x509/KeyIdentifier.java	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/java.base/share/classes/sun/security/x509/KeyIdentifier.java	Tue Jan 15 10:55:26 2019 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 1999, 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
@@ -63,7 +63,7 @@
     /**
      * Creates a KeyIdentifier from a public-key value.
      *
-     * <p>From RFC2459: Two common methods for generating key identifiers from
+     * <p>From RFC 5280: Two common methods for generating key identifiers from
      * the public key are:
      * <ol>
      * <li>The keyIdentifier is composed of the 160-bit SHA-1 hash of the
--- a/src/java.base/share/classes/sun/security/x509/NameConstraintsExtension.java	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/java.base/share/classes/sun/security/x509/NameConstraintsExtension.java	Tue Jan 15 10:55:26 2019 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2017, 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
@@ -326,7 +326,7 @@
      * expanded by a merge, just remain constant or become more
      * limiting.
      * <p>
-     * IETF RFC2459 specifies the processing of Name Constraints as
+     * IETF RFC 5280 specifies the processing of Name Constraints as
      * follows:
      * <p>
      * (j)  If permittedSubtrees is present in the certificate, set the
--- a/src/java.base/share/classes/sun/security/x509/OIDName.java	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/java.base/share/classes/sun/security/x509/OIDName.java	Tue Jan 15 10:55:26 2019 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2015, 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
@@ -156,7 +156,7 @@
         else if (this.equals((OIDName)inputName))
             constraintType = NAME_MATCH;
         else
-            //widens and narrows not defined in RFC2459 for OIDName (aka registeredID)
+            //widens and narrows not defined in RFC 5280 for OIDName (aka registeredID)
             throw new UnsupportedOperationException("Narrowing and widening are not supported for OIDNames");
         return constraintType;
     }
--- a/src/java.base/share/classes/sun/security/x509/RFC822Name.java	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/java.base/share/classes/sun/security/x509/RFC822Name.java	Tue Jan 15 10:55:26 2019 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2011, 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
@@ -68,7 +68,7 @@
 
     /**
      * Parse an RFC822Name string to see if it is a valid
-     * addr-spec according to IETF RFC822 and RFC2459:
+     * addr-spec according to IETF RFC 822 and RFC 5280:
      * [local-part@]domain
      * <p>
      * local-part@ could be empty for an RFC822Name NameConstraint,
@@ -131,7 +131,7 @@
      * Compares this name with another, for equality.
      *
      * @return true iff the names are equivalent
-     * according to RFC2459.
+     * according to RFC 5280.
      */
     public boolean equals(Object obj) {
         if (this == obj)
@@ -142,7 +142,7 @@
 
         RFC822Name other = (RFC822Name)obj;
 
-        // RFC2459 mandates that these names are
+        // RFC 5280 mandates that these names are
         // not case-sensitive
         return name.equalsIgnoreCase(other.name);
     }
@@ -166,14 +166,15 @@
      * </ul>.  These results are used in checking NameConstraints during
      * certification path verification.
      * <p>
-     * [RFC2459]    When the subjectAltName extension contains an Internet mail address,
-     * the address MUST be included as an rfc822Name. The format of an
-     * rfc822Name is an "addr-spec" as defined in RFC 822 [RFC 822]. An
-     * addr-spec has the form "local-part@domain". Note that an addr-spec
-     * has no phrase (such as a common name) before it, has no comment (text
+     *
+     * [RFC 5280]:
+     * When the subjectAltName extension contains an Internet mail address,
+     * the address MUST be stored in the rfc822Name.  The format of an
+     * rfc822Name is a "Mailbox" as defined in Section 4.1.2 of [RFC2821].
+     * A Mailbox has the form "Local-part@Domain".  Note that a Mailbox has
+     * no phrase (such as a common name) before it, has no comment (text
      * surrounded in parentheses) after it, and is not surrounded by "&lt;" and
-     * "&gt;". Note that while upper and lower case letters are allowed in an
-     * RFC 822 addr-spec, no significance is attached to the case.
+     * "&gt;".
      *
      * @param inputName to be checked for being constrained
      * @return constraint type above
@@ -187,7 +188,7 @@
         else if (inputName.getType() != (GeneralNameInterface.NAME_RFC822)) {
             constraintType = NAME_DIFF_TYPE;
         } else {
-            //RFC2459 specifies that case is not significant in RFC822Names
+            //RFC 5280 specifies that case is not significant in RFC822Names
             String inName =
                 (((RFC822Name)inputName).getName()).toLowerCase(Locale.ENGLISH);
             String thisName = name.toLowerCase(Locale.ENGLISH);
--- a/src/java.base/share/classes/sun/security/x509/URIName.java	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/java.base/share/classes/sun/security/x509/URIName.java	Tue Jan 15 10:55:26 2019 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2014, 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
@@ -213,7 +213,7 @@
     /**
      * Compares this name with another, for equality.
      *
-     * @return true iff the names are equivalent according to RFC2459.
+     * @return true iff the names are equivalent according to RFC 5280.
      */
     public boolean equals(Object obj) {
         if (this == obj) {
--- a/src/java.base/share/classes/sun/security/x509/X400Address.java	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/java.base/share/classes/sun/security/x509/X400Address.java	Tue Jan 15 10:55:26 2019 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 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
@@ -403,7 +403,7 @@
         else if (inputName.getType() != NAME_X400)
             constraintType = NAME_DIFF_TYPE;
         else
-            //Narrowing, widening, and match constraints not defined in rfc2459 for X400Address
+            //Narrowing, widening, and match constraints not defined in RFC 5280 for X400Address
             throw new UnsupportedOperationException("Narrowing, widening, and match are not supported for X400Address.");
         return constraintType;
     }
--- a/src/java.base/share/classes/sun/security/x509/X509CertImpl.java	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/java.base/share/classes/sun/security/x509/X509CertImpl.java	Tue Jan 15 10:55:26 2019 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1996, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 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
@@ -63,14 +63,8 @@
  * direct knowledge of each other.  CA certificates are either signed by
  * themselves, or by some other CA such as a "root" CA.
  *
- * <P>RFC 1422 is very informative, though it does not describe much
- * of the recent work being done with X.509 certificates.  That includes
- * a 1996 version (X.509v3) and a variety of enhancements being made to
- * facilitate an explosion of personal certificates used as "Internet
- * Drivers' Licences", or with SET for credit card transactions.
- *
- * <P>More recent work includes the IETF PKIX Working Group efforts,
- * especially RFC2459.
+ * <P> Standards relating to X.509 Public Key Infrastructure for the Internet
+ * can be referenced in RFC 5280.
  *
  * @author Dave Brownell
  * @author Amit Kapoor
--- a/src/java.base/share/lib/security/default.policy	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/java.base/share/lib/security/default.policy	Tue Jan 15 10:55:26 2019 -0800
@@ -157,10 +157,14 @@
 };
 
 grant codeBase "jrt:/jdk.internal.vm.compiler.management" {
-    permission java.lang.RuntimePermission "accessClassInPackage.org.graalvm.compiler.hotspot";
+    permission java.lang.RuntimePermission "accessClassInPackage.jdk.internal.vm.compiler.collections";
     permission java.lang.RuntimePermission "accessClassInPackage.jdk.vm.ci.runtime";
-    permission java.lang.RuntimePermission "accessClassInPackage.sun.management.spi";
-    permission java.lang.RuntimePermission "sun.management.spi.PlatformMBeanProvider.subclass";
+    permission java.lang.RuntimePermission "accessClassInPackage.org.graalvm.compiler.core.common";
+    permission java.lang.RuntimePermission "accessClassInPackage.org.graalvm.compiler.debug";
+    permission java.lang.RuntimePermission "accessClassInPackage.org.graalvm.compiler.hotspot";
+    permission java.lang.RuntimePermission "accessClassInPackage.org.graalvm.compiler.options";
+    permission java.lang.RuntimePermission "accessClassInPackage.org.graalvm.compiler.phases.common.jmx";
+    permission java.lang.RuntimePermission "accessClassInPackage.org.graalvm.compiler.serviceprovider";
 };
 
 grant codeBase "jrt:/jdk.jsobject" {
--- a/src/java.base/share/native/libjava/AccessController.c	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/java.base/share/native/libjava/AccessController.c	Tue Jan 15 10:55:26 2019 -0800
@@ -59,3 +59,12 @@
 {
     return JVM_GetInheritedAccessControlContext(env, this);
 }
+
+JNIEXPORT void JNICALL
+Java_java_security_AccessController_ensureMaterializedForStackWalk(
+                                                              JNIEnv *env,
+                                                              jclass cls,
+                                                              jobject value)
+{
+    JVM_EnsureMaterializedForStackWalk(env, value);
+}
--- a/src/java.base/unix/native/libjsig/jsig.c	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/java.base/unix/native/libjsig/jsig.c	Tue Jan 15 10:55:26 2019 -0800
@@ -5,7 +5,9 @@
  *
  * 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.
+ * 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
--- a/src/java.base/unix/native/libnet/net_util_md.c	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/java.base/unix/native/libnet/net_util_md.c	Tue Jan 15 10:55:26 2019 -0800
@@ -805,12 +805,8 @@
 
 #ifdef __linux__
         /*
-         * On Linux if we are connecting to a
-         *
-         *   - link-local address
-         *   - multicast interface-local or link-local address
-         *
-         * we need to specify the interface in the scope_id.
+         * On Linux if we are connecting to a link-local address
+         * we need to specify the interface in the scope_id (2.4 kernel only)
          *
          * If the scope was cached then we use the cached value. If not cached but
          * specified in the Inet6Address we use that, but we first check if the
@@ -820,9 +816,7 @@
          * we try to determine a value from the routing table. In all these
          * cases the used value is cached for further use.
          */
-        if (IN6_IS_ADDR_LINKLOCAL(&sa->sa6.sin6_addr)
-            || IN6_IS_ADDR_MC_NODELOCAL(&sa->sa6.sin6_addr)
-            || IN6_IS_ADDR_MC_LINKLOCAL(&sa->sa6.sin6_addr)) {
+        if (IN6_IS_ADDR_LINKLOCAL(&sa->sa6.sin6_addr)) {
             unsigned int cached_scope_id = 0, scope_id = 0;
 
             if (ia6_cachedscopeidID) {
--- a/src/java.compiler/share/classes/javax/lang/model/util/AbstractAnnotationValueVisitor7.java	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/java.compiler/share/classes/javax/lang/model/util/AbstractAnnotationValueVisitor7.java	Tue Jan 15 10:55:26 2019 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -68,7 +68,7 @@
      * @deprecated Release 7 is obsolete; update to a visitor for a newer
      * release level.
      */
-    @Deprecated
+    @Deprecated(since="12")
     protected AbstractAnnotationValueVisitor7() {
         super(); // Superclass constructor deprecated too
     }
--- a/src/java.compiler/share/classes/javax/lang/model/util/AbstractElementVisitor7.java	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/java.compiler/share/classes/javax/lang/model/util/AbstractElementVisitor7.java	Tue Jan 15 10:55:26 2019 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010, 2018, Oacle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019, Oacle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -71,7 +71,7 @@
      * @deprecated Release 7 is obsolete; update to a visitor for a newer
      * release level.
      */
-    @Deprecated
+    @Deprecated(since="12")
     protected AbstractElementVisitor7(){
         super(); // Superclass constructor deprecated too
     }
--- a/src/java.compiler/share/classes/javax/lang/model/util/AbstractTypeVisitor7.java	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/java.compiler/share/classes/javax/lang/model/util/AbstractTypeVisitor7.java	Tue Jan 15 10:55:26 2019 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -71,7 +71,7 @@
      * @deprecated Release 7 is obsolete; update to a visitor for a newer
      * release level.
      */
-    @Deprecated
+    @Deprecated(since="12")
     protected AbstractTypeVisitor7() {
         super();  // Superclass constructor deprecated too
     }
--- a/src/java.compiler/share/classes/javax/lang/model/util/ElementKindVisitor7.java	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/java.compiler/share/classes/javax/lang/model/util/ElementKindVisitor7.java	Tue Jan 15 10:55:26 2019 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -85,7 +85,7 @@
      * @deprecated Release 7 is obsolete; update to a visitor for a newer
      * release level.
      */
-    @Deprecated
+    @Deprecated(since="12")
     protected ElementKindVisitor7() {
         super(null); // Superclass constructor deprecated too
     }
@@ -99,7 +99,7 @@
      * @deprecated Release 7 is obsolete; update to a visitor for a newer
      * release level.
      */
-    @Deprecated
+    @Deprecated(since="12")
     protected ElementKindVisitor7(R defaultValue) {
         super(defaultValue); // Superclass constructor deprecated too
     }
--- a/src/java.compiler/share/classes/javax/lang/model/util/ElementScanner7.java	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/java.compiler/share/classes/javax/lang/model/util/ElementScanner7.java	Tue Jan 15 10:55:26 2019 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -98,7 +98,7 @@
      * @deprecated Release 7 is obsolete; update to a visitor for a newer
      * release level.
      */
-    @Deprecated
+    @Deprecated(since="12")
     protected ElementScanner7(){
         super(null); // Superclass constructor deprecated too
     }
@@ -112,7 +112,7 @@
      * @deprecated Release 7 is obsolete; update to a visitor for a newer
      * release level.
      */
-    @Deprecated
+    @Deprecated(since="12")
     protected ElementScanner7(R defaultValue){
         super(defaultValue); // Superclass constructor deprecated too
     }
--- a/src/java.compiler/share/classes/javax/lang/model/util/SimpleAnnotationValueVisitor7.java	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/java.compiler/share/classes/javax/lang/model/util/SimpleAnnotationValueVisitor7.java	Tue Jan 15 10:55:26 2019 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -75,7 +75,7 @@
      * @deprecated Release 7 is obsolete; update to a visitor for a newer
      * release level.
      */
-    @Deprecated
+    @Deprecated(since="12")
     protected SimpleAnnotationValueVisitor7() {
         super(null); // Superclass constructor deprecated too
     }
@@ -89,7 +89,7 @@
      * @deprecated Release 7 is obsolete; update to a visitor for a newer
      * release level.
      */
-    @Deprecated
+    @Deprecated(since="12")
     protected SimpleAnnotationValueVisitor7(R defaultValue) {
         super(defaultValue); // Superclass constructor deprecated too
     }
--- a/src/java.compiler/share/classes/javax/lang/model/util/SimpleElementVisitor7.java	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/java.compiler/share/classes/javax/lang/model/util/SimpleElementVisitor7.java	Tue Jan 15 10:55:26 2019 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -81,7 +81,7 @@
      * @deprecated Release 7 is obsolete; update to a visitor for a newer
      * release level.
      */
-    @Deprecated
+    @Deprecated(since="12")
     protected SimpleElementVisitor7(){
         super(null); // Superclass constructor deprecated too
     }
@@ -95,7 +95,7 @@
      * @deprecated Release 7 is obsolete; update to a visitor for a newer
      * release level.
      */
-    @Deprecated
+    @Deprecated(since="12")
     protected SimpleElementVisitor7(R defaultValue){
         super(defaultValue); // Superclass constructor deprecated too
     }
--- a/src/java.compiler/share/classes/javax/lang/model/util/SimpleTypeVisitor7.java	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/java.compiler/share/classes/javax/lang/model/util/SimpleTypeVisitor7.java	Tue Jan 15 10:55:26 2019 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -81,7 +81,7 @@
      * @deprecated Release 7 is obsolete; update to a visitor for a newer
      * release level.
      */
-    @Deprecated
+    @Deprecated(since="12")
     protected SimpleTypeVisitor7(){
         super(null); // Superclass constructor deprecated too
     }
@@ -95,7 +95,7 @@
      * @deprecated Release 7 is obsolete; update to a visitor for a newer
      * release level.
      */
-    @Deprecated
+    @Deprecated(since="12")
     protected SimpleTypeVisitor7(R defaultValue){
         super(defaultValue); // Superclass constructor deprecated too
     }
--- a/src/java.compiler/share/classes/javax/lang/model/util/TypeKindVisitor7.java	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/java.compiler/share/classes/javax/lang/model/util/TypeKindVisitor7.java	Tue Jan 15 10:55:26 2019 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -82,7 +82,7 @@
      * @deprecated Release 7 is obsolete; update to a visitor for a newer
      * release level.
      */
-    @Deprecated
+    @Deprecated(since="12")
     protected TypeKindVisitor7() {
         super(null); // Superclass constructor deprecated too
     }
@@ -96,7 +96,7 @@
      * @deprecated Release 7 is obsolete; update to a visitor for a newer
      * release level.
      */
-    @Deprecated
+    @Deprecated(since="12")
     protected TypeKindVisitor7(R defaultValue) {
         super(defaultValue); // Superclass constructor deprecated too
     }
--- a/src/java.desktop/unix/native/libawt_xawt/xawt/XToolkit.c	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/java.desktop/unix/native/libawt_xawt/xawt/XToolkit.c	Tue Jan 15 10:55:26 2019 -0800
@@ -150,6 +150,10 @@
 DEF_JNI_OnLoad(JavaVM *vm, void *reserved)
 {
     jvm = vm;
+
+    //Set the gtk backend to x11 on all the systems
+    putenv("GDK_BACKEND=x11");
+
     return JNI_VERSION_1_2;
 }
 
--- a/src/java.logging/share/classes/java/util/logging/LogManager.java	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/java.logging/share/classes/java/util/logging/LogManager.java	Tue Jan 15 10:55:26 2019 -0800
@@ -76,8 +76,8 @@
  * the initial configuration, as specified in the {@link #readConfiguration()}
  * method:
  * <ul>
- * <li>"java.util.logging.config.class"
- * <li>"java.util.logging.config.file"
+ * <li>{@systemProperty java.util.logging.config.class}
+ * <li>{@systemProperty java.util.logging.config.file}
  * </ul>
  * <p>
  * These two system properties may be specified on the command line to the "java"
--- a/src/java.logging/share/classes/java/util/logging/SimpleFormatter.java	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/java.logging/share/classes/java/util/logging/SimpleFormatter.java	Tue Jan 15 10:55:26 2019 -0800
@@ -39,7 +39,7 @@
  * <a id="formatting">
  * <b>Configuration:</b></a>
  * The {@code SimpleFormatter} is initialized with the format string
- * specified in the {@code java.util.logging.SimpleFormatter.format}
+ * specified in the {@systemProperty java.util.logging.SimpleFormatter.format}
  * property to {@linkplain #format(LogRecord) format} the log messages.
  * This property can be defined
  * in the {@linkplain LogManager#getProperty logging properties}
--- a/src/java.naming/share/classes/com/sun/jndi/ldap/ext/StartTlsResponseImpl.java	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/java.naming/share/classes/com/sun/jndi/ldap/ext/StartTlsResponseImpl.java	Tue Jan 15 10:55:26 2019 -0800
@@ -288,7 +288,8 @@
      */
     public void setConnection(Connection ldapConnection, String hostname) {
         this.ldapConnection = ldapConnection;
-        this.hostname = (hostname != null) ? hostname : ldapConnection.host;
+        this.hostname = (hostname == null || hostname.isEmpty())
+            ? ldapConnection.host : hostname;
         originalInputStream = ldapConnection.inStream;
         originalOutputStream = ldapConnection.outStream;
     }
--- a/src/java.rmi/share/classes/java/rmi/server/ObjID.java	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/java.rmi/share/classes/java/rmi/server/ObjID.java	Tue Jan 15 10:55:26 2019 -0800
@@ -57,7 +57,7 @@
  * equivalent to one returned by invoking the {@link UID#UID(short)}
  * constructor with the value zero.
  *
- * <p>If the system property <code>java.rmi.server.randomIDs</code>
+ * <p>If the system property {@systemProperty java.rmi.server.randomIDs}
  * is defined to equal the string <code>"true"</code> (case insensitive),
  * then the {@link #ObjID()} constructor will use a cryptographically
  * strong random number generator to choose the object number of the
--- a/src/java.rmi/share/classes/java/rmi/server/RMIClassLoader.java	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/java.rmi/share/classes/java/rmi/server/RMIClassLoader.java	Tue Jan 15 10:55:26 2019 -0800
@@ -68,7 +68,7 @@
  * <ul>
  *
  * <li>If the system property
- * <code>java.rmi.server.RMIClassLoaderSpi</code> is defined, then if
+ * {@systemProperty java.rmi.server.RMIClassLoaderSpi} is defined, then if
  * its value equals the string <code>"default"</code>, the provider
  * instance will be the value returned by an invocation of the {@link
  * #getDefaultProviderInstance()} method, and for any other value, if
@@ -429,7 +429,7 @@
      * system class loader such as the loader used for installed
      * extensions, or the bootstrap class loader (which may be
      * represented by <code>null</code>), then the value of the
-     * <code>java.rmi.server.codebase</code> property (or possibly an
+     * {@systemProperty java.rmi.server.codebase} property (or possibly an
      * earlier cached value) is returned, or
      * <code>null</code> is returned if that property is not set.
      *
--- a/src/java.rmi/share/classes/java/rmi/server/RMISocketFactory.java	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/java.rmi/share/classes/java/rmi/server/RMISocketFactory.java	Tue Jan 15 10:55:26 2019 -0800
@@ -66,7 +66,7 @@
  *     RMISocketFactory.setSocketFactory(new LoopbackSocketFactory());
  * }</pre>
  *
- * Set the {@code java.rmi.server.hostname} system property
+ * Set the {@systemProperty java.rmi.server.hostname} system property
  * to {@code 127.0.0.1} to ensure that the generated stubs connect to the right
  * network interface.
  *
--- a/src/java.rmi/share/classes/javax/rmi/ssl/SslRMIClientSocketFactory.java	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/java.rmi/share/classes/javax/rmi/ssl/SslRMIClientSocketFactory.java	Tue Jan 15 10:55:26 2019 -0800
@@ -53,14 +53,14 @@
  * #hashCode() hashCode} may also need to be overridden.</p>
  *
  * <p>If the system property
- * <code>javax.rmi.ssl.client.enabledCipherSuites</code> is specified,
+ * {@systemProperty javax.rmi.ssl.client.enabledCipherSuites} is specified,
  * the {@link #createSocket(String,int)} method will call {@link
  * SSLSocket#setEnabledCipherSuites(String[])} before returning the
  * socket.  The value of this system property is a string that is a
  * comma-separated list of SSL/TLS cipher suites to enable.</p>
  *
  * <p>If the system property
- * <code>javax.rmi.ssl.client.enabledProtocols</code> is specified,
+ * {@systemProperty javax.rmi.ssl.client.enabledProtocols} is specified,
  * the {@link #createSocket(String,int)} method will call {@link
  * SSLSocket#setEnabledProtocols(String[])} before returning the
  * socket.  The value of this system property is a string that is a
@@ -96,7 +96,7 @@
      * <p>Creates an SSL socket.</p>
      *
      * <p>If the system property
-     * <code>javax.rmi.ssl.client.enabledCipherSuites</code> is
+     * {@systemProperty javax.rmi.ssl.client.enabledCipherSuites} is
      * specified, this method will call {@link
      * SSLSocket#setEnabledCipherSuites(String[])} before returning
      * the socket. The value of this system property is a string that
@@ -104,7 +104,7 @@
      * enable.</p>
      *
      * <p>If the system property
-     * <code>javax.rmi.ssl.client.enabledProtocols</code> is
+     * {@systemProperty javax.rmi.ssl.client.enabledProtocols} is
      * specified, this method will call {@link
      * SSLSocket#setEnabledProtocols(String[])} before returning the
      * socket. The value of this system property is a string that is a
--- a/src/java.smartcardio/share/classes/javax/smartcardio/TerminalFactory.java	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/java.smartcardio/share/classes/javax/smartcardio/TerminalFactory.java	Tue Jan 15 10:55:26 2019 -0800
@@ -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
@@ -182,7 +182,7 @@
      * <p>It is determined as follows:
      *
      * when this class is initialized, the system property
-     * <code>javax.smartcardio.TerminalFactory.DefaultType</code>
+     * {@systemProperty javax.smartcardio.TerminalFactory.DefaultType}
      * is examined. If it is set, a TerminalFactory of this type is
      * instantiated by calling the {@linkplain #getInstance
      * getInstance(String,Object)} method passing
--- a/src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/Main.java	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/Main.java	Tue Jan 15 10:55:26 2019 -0800
@@ -29,11 +29,18 @@
 import static org.graalvm.compiler.core.common.GraalOptions.ImmutableCode;
 import static org.graalvm.compiler.hotspot.meta.HotSpotAOTProfilingPlugin.Options.TieredAOT;
 
+import java.io.IOException;
 import java.io.PrintWriter;
 import java.text.MessageFormat;
+import java.util.ArrayList;
+import java.util.Collections;
 import java.util.List;
 import java.util.ListIterator;
 import java.util.Set;
+import java.util.StringTokenizer;
+import java.util.stream.Stream;
+import java.nio.file.Files;
+import java.nio.file.Paths;
 
 import org.graalvm.compiler.api.replacements.SnippetReflectionProvider;
 import org.graalvm.compiler.api.runtime.GraalJVMCICompiler;
@@ -78,10 +85,33 @@
 
     public static void main(String[] args) throws Exception {
         Main t = new Main();
-        final int exitCode = t.run(args);
+        final int exitCode = t.run(parse(args));
         System.exit(exitCode);
     }
 
+    /**
+     * Expands '@file' in command line arguments by replacing '@file' with the content of 'file'
+     * parsed by StringTokenizer. '@' character can be quoted as '@@'.
+     */
+    private static String[] parse(String[] args) throws IOException {
+        List<String> result = new ArrayList<>();
+        for (String arg : args) {
+            if (arg.length() > 1 && arg.charAt(0) == '@') {
+                String v = arg.substring(1);
+                if (v.charAt(0) == '@') {
+                    result.add(v);
+                } else {
+                    try (Stream<String> file = Files.lines(Paths.get(v))) {
+                        file.map(StringTokenizer::new).map(Collections::list).flatMap(l -> l.stream().map(o -> (String) o)).forEachOrdered(result::add);
+                    }
+                }
+            } else {
+                result.add(arg);
+            }
+        }
+        return result.toArray(String[]::new);
+    }
+
     private int run(String[] args) {
         log = new PrintWriter(System.out);
         printer = new LogPrinter(this, log);
--- a/src/jdk.compiler/share/classes/com/sun/tools/doclint/resources/doclint_ja.properties	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/jdk.compiler/share/classes/com/sun/tools/doclint/resources/doclint_ja.properties	Tue Jan 15 10:55:26 2019 -0800
@@ -60,6 +60,7 @@
 dc.service.not.found = \u30B5\u30FC\u30D3\u30B9\u30FB\u30BF\u30A4\u30D7\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093
 dc.tag.code.within.code = <code>\u5185\u306E'{@code'}
 dc.tag.empty = \u7A7A\u306E<{0}>\u30BF\u30B0
+dc.tag.a.within.a = <a>\u306B\u5C55\u958B\u3055\u308C\u308B<a>\u5185\u306E{0}\u30BF\u30B0
 dc.tag.end.not.permitted = \u7121\u52B9\u306A\u7D42\u4E86\u30BF\u30B0: </{0}>
 dc.tag.end.unexpected = \u4E88\u671F\u3057\u306A\u3044\u7D42\u4E86\u30BF\u30B0: </{0}>
 dc.tag.header.sequence.1 = \u30D8\u30C3\u30C0\u30FC\u306E\u6307\u5B9A\u9806\u5E8F\u304C\u6B63\u3057\u304F\u3042\u308A\u307E\u305B\u3093: <{0}>
--- a/src/jdk.compiler/share/classes/com/sun/tools/doclint/resources/doclint_zh_CN.properties	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/jdk.compiler/share/classes/com/sun/tools/doclint/resources/doclint_zh_CN.properties	Tue Jan 15 10:55:26 2019 -0800
@@ -60,6 +60,7 @@
 dc.service.not.found = \u627E\u4E0D\u5230\u670D\u52A1\u7C7B\u578B
 dc.tag.code.within.code = '{@code'} \u5728 <code> \u4E2D
 dc.tag.empty = <{0}> \u6807\u8BB0\u4E3A\u7A7A
+dc.tag.a.within.a = {0} \u6807\u8BB0\uFF0C\u5176\u6269\u5C55\u5230 <a>\uFF0C\u4F4D\u4E8E <a> \u5185
 dc.tag.end.not.permitted = \u65E0\u6548\u7684\u7ED3\u675F\u6807\u8BB0: </{0}>
 dc.tag.end.unexpected = \u610F\u5916\u7684\u7ED3\u675F\u6807\u8BB0: </{0}>
 dc.tag.header.sequence.1 = \u4F7F\u7528\u7684\u6807\u9898\u8D85\u51FA\u5E8F\u5217: <{0}>
--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Preview.java	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Preview.java	Tue Jan 15 10:55:26 2019 -0800
@@ -167,8 +167,7 @@
     public boolean isPreview(Feature feature) {
         if (feature == Feature.SWITCH_EXPRESSION ||
             feature == Feature.SWITCH_MULTIPLE_CASE_LABELS ||
-            feature == Feature.SWITCH_RULE ||
-            feature == Feature.RAW_STRING_LITERALS)
+            feature == Feature.SWITCH_RULE)
             return true;
         //Note: this is a backdoor which allows to optionally treat all features as 'preview' (for testing).
         //When real preview features will be added, this method can be implemented to return 'true'
--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Source.java	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Source.java	Tue Jan 15 10:55:26 2019 -0800
@@ -184,8 +184,7 @@
         IMPORT_ON_DEMAND_OBSERVABLE_PACKAGES(JDK1_2, JDK8),
         SWITCH_MULTIPLE_CASE_LABELS(JDK12, Fragments.FeatureMultipleCaseLabels, DiagKind.PLURAL),
         SWITCH_RULE(JDK12, Fragments.FeatureSwitchRules, DiagKind.PLURAL),
-        SWITCH_EXPRESSION(JDK12, Fragments.FeatureSwitchExpressions, DiagKind.PLURAL),
-        RAW_STRING_LITERALS(JDK12, Fragments.FeatureRawStringLiterals, DiagKind.PLURAL);
+        SWITCH_EXPRESSION(JDK12, Fragments.FeatureSwitchExpressions, DiagKind.PLURAL);
 
         enum DiagKind {
             NORMAL,
--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Modules.java	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Modules.java	Tue Jan 15 10:55:26 2019 -0800
@@ -450,7 +450,12 @@
                 String moduleOverride = singleModuleOverride(trees);
                 switch (rootModules.size()) {
                     case 0:
-                        defaultModule = moduleFinder.findSingleModule();
+                        try {
+                            defaultModule = moduleFinder.findSingleModule();
+                        } catch (CompletionFailure cf) {
+                            chk.completionError(null, cf);
+                            defaultModule = syms.unnamedModule;
+                        }
                         if (defaultModule == syms.unnamedModule) {
                             if (moduleOverride != null) {
                                 checkNoAllModulePath();
--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/main/JavaCompiler.java	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/main/JavaCompiler.java	Tue Jan 15 10:55:26 2019 -0800
@@ -1761,6 +1761,7 @@
     private Name parseAndGetName(JavaFileObject fo,
                                  Function<JCTree.JCCompilationUnit, Name> tree2Name) {
         DiagnosticHandler dh = new DiscardDiagnosticHandler(log);
+        JavaFileObject prevSource = log.useSource(fo);
         try {
             JCTree.JCCompilationUnit t = parse(fo, fo.getCharContent(false));
             return tree2Name.apply(t);
@@ -1768,6 +1769,7 @@
             return null;
         } finally {
             log.popDiagnosticHandler(dh);
+            log.useSource(prevSource);
         }
     }
 
--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/parser/JavaTokenizer.java	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/parser/JavaTokenizer.java	Tue Jan 15 10:55:26 2019 -0800
@@ -646,60 +646,7 @@
                         lexError(pos, Errors.UnclosedStrLit);
                     }
                     break loop;
-                case '`':
-                    checkSourceLevel(pos, Feature.RAW_STRING_LITERALS);
-                    // Ensure that the backtick was not a Unicode escape sequence
-                    if (reader.peekBack() != '`') {
-                        reader.scanChar();
-                        lexError(pos, Errors.UnicodeBacktick);
-                        break loop;
-                    }
-                    // Turn off unicode processsing and save previous state
-                    boolean oldState = reader.setUnicodeConversion(false);
-                    // Count the number of backticks in the open quote sequence
-                    int openCount = reader.skipRepeats();
-                    // Skip last backtick
-                    reader.scanChar();
-                    while (reader.bp < reader.buflen) {
-                        // If potential close quote sequence
-                        if (reader.ch == '`') {
-                            // Count number of backticks in sequence
-                            int closeCount = reader.skipRepeats();
-                            // If the counts match we can exit the raw string literal
-                            if (openCount == closeCount) {
-                                break;
-                            }
-                            // Emit non-close backtick sequence
-                            for (int i = 0; i <= closeCount; i++) {
-                                reader.putChar('`', false);
-                            }
-                            // Skip last backtick
-                            reader.scanChar();
-                        } else if (reader.ch == LF) {
-                            reader.putChar(true);
-                            processLineTerminator(pos, reader.bp);
-                        } else if (reader.ch == CR) {
-                            if (reader.peekChar() == LF) {
-                                reader.scanChar();
-                            }
-                            // Translate CR and CRLF sequences to LF
-                            reader.putChar('\n', true);
-                            processLineTerminator(pos, reader.bp);
-                        } else {
-                            reader.putChar(true);
-                        }
-                    }
-                    // Restore unicode processsing
-                    reader.setUnicodeConversion(oldState);
-                    // Ensure the close quote was encountered
-                    if (reader.bp == reader.buflen) {
-                        lexError(pos, Errors.UnclosedStrLit);
-                    } else {
-                        tk = TokenKind.STRINGLITERAL;
-                        reader.scanChar();
-                    }
-                    break loop;
-                default:
+               default:
                     if (isSpecial(reader.ch)) {
                         scanOperator();
                     } else {
--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/parser/UnicodeReader.java	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/parser/UnicodeReader.java	Tue Jan 15 10:55:26 2019 -0800
@@ -64,10 +64,6 @@
      */
     protected int unicodeConversionBp = -1;
 
-    /** Control conversion of unicode characters
-     */
-    protected boolean unicodeConversion = true;
-
     protected Log log;
     protected Names names;
 
@@ -158,17 +154,11 @@
         return new String(sbuf, 0, sp);
     }
 
-    protected boolean setUnicodeConversion(boolean newState) {
-        boolean oldState = unicodeConversion;
-        unicodeConversion = newState;
-        return oldState;
-    }
-
     /** Convert unicode escape; bp points to initial '\' character
      *  (Spec 3.3).
      */
     protected void convertUnicode() {
-        if (ch == '\\' && unicodeConversion && unicodeConversionBp != bp ) {
+        if (ch == '\\' && unicodeConversionBp != bp ) {
             bp++; ch = buf[bp];
             if (ch == 'u') {
                 do {
@@ -264,24 +254,6 @@
         return buf[bp + 1];
     }
 
-    protected char peekBack() {
-        return buf[bp];
-    }
-
-    /**
-     * Skips consecutive occurrences of the current character, leaving bp positioned
-     * at the last occurrence. Returns the occurrence count.
-     */
-    protected int skipRepeats() {
-        int start = bp;
-        while (bp < buflen) {
-            if (buf[bp] != buf[bp + 1])
-                break;
-            bp++;
-        }
-        return bp - start;
-    }
-
     /**
      * Returns a copy of the input buffer, up to its inputLength.
      * Unicode escape sequences are not translated.
--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/resources/compiler.properties	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/resources/compiler.properties	Tue Jan 15 10:55:26 2019 -0800
@@ -1240,9 +1240,6 @@
 compiler.err.unclosed.str.lit=\
     unclosed string literal
 
-compiler.err.unicode.backtick=\
-    attempt to use \\u0060 as a raw string literal delimiter
-
 # 0: string
 compiler.err.unsupported.encoding=\
     unsupported encoding: {0}
@@ -2837,9 +2834,6 @@
 compiler.misc.feature.switch.expressions=\
     switch expressions
 
-compiler.misc.feature.raw.string.literals=\
-    raw string literals
-
 compiler.misc.feature.var.syntax.in.implicit.lambda=\
     var syntax in implicit lambdas
 
--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/resources/compiler_ja.properties	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/resources/compiler_ja.properties	Tue Jan 15 10:55:26 2019 -0800
@@ -49,6 +49,7 @@
 # kind name         an informative description of the kind of a declaration; see compiler.misc.kindname.*
 # target            a target version number, such as 1.5, 1.6, 1.7, taken from a com.sun.tools.javac.jvm.Target
 # token             the name of a non-terminal in source code; see compiler.misc.token.*
+# tree tag          the name of a non-terminal in source code; see compiler.misc.token.*
 # type              a Java type; e.g. int, X, X<T>
 # url               a URL
 # object            a Java object (unspecified)
@@ -158,6 +159,28 @@
 
 compiler.err.break.outside.switch.loop=break\u304Cswitch\u6587\u307E\u305F\u306F\u30EB\u30FC\u30D7\u306E\u5916\u306B\u3042\u308A\u307E\u3059
 
+compiler.err.break.missing.value=break\u306E\u5024\u304C\u3042\u308A\u307E\u305B\u3093
+
+compiler.err.break.outside.switch.expression=break\u304C\u3001\u56F2\u3093\u3067\u3044\u308Bswitch\u5F0F\u306E\u5916\u306B\u3042\u308A\u307E\u3059
+
+compiler.err.continue.outside.switch.expression=continue\u304C\u3001\u56F2\u3093\u3067\u3044\u308Bswitch\u5F0F\u306E\u5916\u306B\u3042\u308A\u307E\u3059
+
+compiler.err.return.outside.switch.expression=return\u304C\u3001\u56F2\u3093\u3067\u3044\u308Bswitch\u5F0F\u306E\u5916\u306B\u3042\u308A\u307E\u3059
+
+compiler.err.rule.completes.normally=switch\u30EB\u30FC\u30EB\u304C\u5024\u3092\u63D0\u4F9B\u305B\u305A\u306B\u5B8C\u4E86\u3057\u307E\u3057\u305F\n(switch\u5F0F\u306Eswitch\u30EB\u30FC\u30EB\u306F\u5024\u307E\u305F\u306F\u30B9\u30ED\u30FC\u3092\u63D0\u4F9B\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059)
+
+compiler.err.switch.expression.completes.normally=switch\u5F0F\u304C\u5024\u3092\u63D0\u4F9B\u305B\u305A\u306B\u5B8C\u4E86\u3057\u307E\u3057\u305F\n(switch\u5F0F\u306F\u3059\u3079\u3066\u306E\u53EF\u80FD\u306A\u5165\u529B\u5024\u306B\u3064\u3044\u3066\u5024\u307E\u305F\u306F\u30B9\u30ED\u30FC\u3092\u63D0\u4F9B\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059)
+
+# 0: name
+compiler.err.break.ambiguous.target=''{0}''\u3078\u306E\u53C2\u7167\u304C\u3042\u3044\u307E\u3044\u3067\u3059\n(''{0}''\u306F\u30E9\u30D9\u30EB\u3068\u5F0F\u306E\u4E21\u65B9\u3067\u3059)
+
+# 0: tree tag
+compiler.err.break.expr.not.immediate=\u5024\u30D6\u30EC\u30FC\u30AF\u306F''{0}''\u3067\u30B5\u30DD\u30FC\u30C8\u3055\u308C\u3066\u3044\u307E\u305B\u3093
+
+compiler.err.break.complex.value.no.switch.expression=\u4E88\u671F\u3057\u306A\u3044\u5024\u30D6\u30EC\u30FC\u30AF\u3067\u3059
+
+compiler.err.switch.expression.empty=switch\u5F0F\u306Bcase\u53E5\u304C\u3042\u308A\u307E\u305B\u3093
+
 # 0: name
 compiler.err.call.must.be.first.stmt.in.ctor={0}\u306E\u547C\u51FA\u3057\u306F\u30B3\u30F3\u30B9\u30C8\u30E9\u30AF\u30BF\u306E\u5148\u982D\u6587\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059
 
@@ -583,15 +606,17 @@
 
 compiler.err.native.meth.cant.have.body=native\u30E1\u30BD\u30C3\u30C9\u304C\u672C\u4F53\u3092\u6301\u3064\u3053\u3068\u306F\u3067\u304D\u307E\u305B\u3093
 
-# 0: type, 1: type
-compiler.err.neither.conditional.subtype=?\u306B\u5BFE\u3059\u308B\u4E92\u63DB\u6027\u306E\u306A\u3044\u578B : \u3069\u3061\u3089\u3082\u4ED6\u65B9\u306E\u30B5\u30D6\u30BF\u30A4\u30D7\u3067\u306F\u3042\u308A\u307E\u305B\u3093\u3002\n2\u756A\u76EE\u306E\u30AA\u30DA\u30E9\u30F3\u30C9 : {0}\n3\u756A\u76EE\u306E\u30AA\u30DA\u30E9\u30F3\u30C9 : {1}
-
 
 # 0: message segment
 compiler.misc.incompatible.type.in.conditional=\u6761\u4EF6\u5F0F\u306E\u578B\u304C\u4E0D\u6B63\u3067\u3059\n{0}
 
 compiler.misc.conditional.target.cant.be.void=\u6761\u4EF6\u5F0F\u306E\u30BF\u30FC\u30B2\u30C3\u30C8\u578B\u306Fvoid\u306B\u3067\u304D\u307E\u305B\u3093
 
+compiler.misc.switch.expression.target.cant.be.void=switch\u5F0F\u306E\u30BF\u30FC\u30B2\u30C3\u30C8\u578B\u306Fvoid\u306B\u3067\u304D\u307E\u305B\u3093
+
+# 0: message segment
+compiler.misc.incompatible.type.in.switch.expression=switch\u5F0F\u306E\u578B\u304C\u4E0D\u6B63\u3067\u3059\n{0}
+
 # 0: message segment
 compiler.misc.incompatible.ret.type.in.lambda=\u30E9\u30E0\u30C0\u5F0F\u306E\u623B\u308A\u578B\u304C\u4E0D\u6B63\u3067\u3059\n{0}
 
@@ -817,8 +842,6 @@
 
 compiler.err.throws.not.allowed.in.intf.annotation=throws\u7BC0\u3092@interface\u30E1\u30F3\u30D0\u30FC\u3067\u4F7F\u7528\u3059\u308B\u3053\u3068\u306F\u3067\u304D\u307E\u305B\u3093
 
-compiler.err.try.without.catch.or.finally=''try''\u3078\u306E''catch''\u307E\u305F\u306F''finally''\u304C\u3042\u308A\u307E\u305B\u3093
-
 compiler.err.try.without.catch.finally.or.resource.decls=''try''\u3078\u306E''catch''\u3001''finally''\u307E\u305F\u306F\u30EA\u30BD\u30FC\u30B9\u5BA3\u8A00\u304C\u3042\u308A\u307E\u305B\u3093
 
 # 0: symbol
@@ -865,6 +888,8 @@
 
 compiler.err.unclosed.str.lit=\u6587\u5B57\u5217\u30EA\u30C6\u30E9\u30EB\u304C\u9589\u3058\u3089\u308C\u3066\u3044\u307E\u305B\u3093
 
+compiler.err.unicode.backtick=RAW\u6587\u5B57\u5217\u30EA\u30C6\u30E9\u30EB\u306E\u30C7\u30EA\u30DF\u30BF\u3068\u3057\u3066\\u0060\u3092\u4F7F\u7528\u3057\u3088\u3046\u3068\u3057\u307E\u3057\u305F
+
 # 0: string
 compiler.err.unsupported.encoding=\u30B5\u30DD\u30FC\u30C8\u3055\u308C\u3066\u3044\u306A\u3044\u30A8\u30F3\u30B3\u30FC\u30C7\u30A3\u30F3\u30B0\u3067\u3059: {0}
 
@@ -922,6 +947,8 @@
 
 compiler.err.unreachable.stmt=\u3053\u306E\u6587\u306B\u5236\u5FA1\u304C\u79FB\u308B\u3053\u3068\u306F\u3042\u308A\u307E\u305B\u3093
 
+compiler.err.not.exhaustive=switch\u5F0F\u304C\u3059\u3079\u3066\u306E\u53EF\u80FD\u306A\u5165\u529B\u5024\u3092\u30AB\u30D0\u30FC\u3057\u3066\u3044\u307E\u305B\u3093
+
 compiler.err.initializer.must.be.able.to.complete.normally=\u521D\u671F\u5316\u5B50\u306F\u6B63\u5E38\u306B\u5B8C\u4E86\u3067\u304D\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059
 
 compiler.err.initializer.not.allowed=\u30A4\u30CB\u30B7\u30E3\u30E9\u30A4\u30B6\u306Finterfaces\u3067\u306F\u8A31\u53EF\u3055\u308C\u307E\u305B\u3093
@@ -1240,9 +1267,6 @@
 # 0: type, 1: type
 compiler.warn.inexact.non-varargs.call=\u6700\u7D42\u30D1\u30E9\u30E1\u30FC\u30BF\u306E\u4E0D\u6B63\u78BA\u306A\u5F15\u6570\u578B\u3092\u6301\u3063\u305F\u53EF\u5909\u5F15\u6570\u30E1\u30BD\u30C3\u30C9\u306E\u975E\u53EF\u5909\u5F15\u6570\u547C\u51FA\u3057\u3002\n\u53EF\u5909\u5F15\u6570\u547C\u51FA\u3057\u306B\u95A2\u3057\u3066\u306F{0}\u306B\u30AD\u30E3\u30B9\u30C8\u3057\u307E\u3059\u3002\n\u975E\u53EF\u5909\u5F15\u6570\u547C\u51FA\u3057\u306B\u95A2\u3057\u3066\u306F{1}\u306B\u30AD\u30E3\u30B9\u30C8\u3057\u3066\u3053\u306E\u8B66\u544A\u3092\u51FA\u3055\u306A\u3044\u3088\u3046\u306B\u3057\u307E\u3059
 
-# 0: target, 1: target
-compiler.err.bad.target.sigpoly.call=\u591A\u76F8\u7F72\u540D\u547C\u51FA\u3057\u306F-target {0}\u3067\u306F\u30B5\u30DD\u30FC\u30C8\u3055\u308C\u3066\u3044\u307E\u305B\u3093\n(\u591A\u76F8\u7F72\u540D\u547C\u51FA\u3057\u3092\u6709\u52B9\u306B\u3059\u308B\u306B\u306F-target {1}\u4EE5\u4E0A\u3092\u4F7F\u7528\u3057\u307E\u3059)
-
 # 0: list of type
 compiler.warn.unreachable.catch=catch\u53E5\u306B\u79FB\u3059\u3053\u3068\u304C\u3067\u304D\u307E\u305B\u3093\n\u30B9\u30ED\u30FC\u3055\u308C\u305F\u30BF\u30A4\u30D7{0}\u306F\u3059\u3067\u306B\u6355\u6349\u3055\u308C\u3066\u3044\u307E\u3059
 
@@ -1852,6 +1876,17 @@
 
 compiler.misc.kindname.instance.init=\u30A4\u30F3\u30B9\u30BF\u30F3\u30B9\u521D\u671F\u5316\u5B50
 
+# the following are names of tree kinds:
+compiler.misc.tree.tag.forloop=for
+
+compiler.misc.tree.tag.foreachloop=for
+
+compiler.misc.tree.tag.whileloop=while
+
+compiler.misc.tree.tag.doloop=do
+
+compiler.misc.tree.tag.switch=switch
+
 #####
 
 compiler.misc.no.args=\u5F15\u6570\u304C\u3042\u308A\u307E\u305B\u3093
@@ -1958,12 +1993,6 @@
 
 compiler.misc.feature.diamond.and.anon.class=\u533F\u540D\u5185\u90E8\u30AF\u30E9\u30B9\u3067\u306E''<>''
 
-compiler.misc.feature.binary.lit=2\u9032\u6570\u30EA\u30C6\u30E9\u30EB
-
-compiler.misc.feature.underscore.lit=\u30EA\u30C6\u30E9\u30EB\u5185\u306E\u30A2\u30F3\u30C0\u30FC\u30B9\u30B3\u30A2
-
-compiler.misc.feature.try.with.resources=try-with-resources
-
 compiler.misc.feature.var.in.try.with.resources=try-with-resources\u5185\u306E\u5909\u6570
 
 compiler.misc.feature.type.annotations=\u30BF\u30A4\u30D7\u6CE8\u91C8
@@ -1974,10 +2003,6 @@
 
 compiler.misc.feature.diamond=\u30C0\u30A4\u30E4\u30E2\u30F3\u30C9\u6F14\u7B97\u5B50
 
-compiler.misc.feature.multicatch=\u8907\u6570catch\u6587
-
-compiler.misc.feature.string.switch=switch\u5185\u306E\u6587\u5B57\u5217
-
 compiler.misc.feature.lambda=\u30E9\u30E0\u30C0\u5F0F
 
 compiler.misc.feature.method.references=\u30E1\u30BD\u30C3\u30C9\u53C2\u7167
@@ -1992,6 +2017,16 @@
 
 compiler.misc.feature.private.intf.methods=private\u30A4\u30F3\u30BF\u30D5\u30A7\u30FC\u30B9\u30FB\u30E1\u30BD\u30C3\u30C9
 
+compiler.misc.feature.multiple.case.labels=\u8907\u6570\u306Ecase\u30E9\u30D9\u30EB
+
+compiler.misc.feature.switch.rules=switch\u30EB\u30FC\u30EB
+
+compiler.misc.feature.switch.expressions=switch\u5F0F
+
+compiler.misc.feature.raw.string.literals=RAW\u6587\u5B57\u5217\u30EA\u30C6\u30E9\u30EB
+
+compiler.misc.feature.var.syntax.in.implicit.lambda=\u6697\u9ED9\u30E9\u30E0\u30C0\u306Evar\u69CB\u6587
+
 compiler.warn.underscore.as.identifier=\u30EA\u30EA\u30FC\u30B99\u304B\u3089''_''\u306F\u30AD\u30FC\u30EF\u30FC\u30C9\u306A\u306E\u3067\u8B58\u5225\u5B50\u3068\u3057\u3066\u4F7F\u7528\u3059\u308B\u3053\u3068\u306F\u3067\u304D\u307E\u305B\u3093
 
 compiler.err.underscore.as.identifier=\u30EA\u30EA\u30FC\u30B99\u304B\u3089''_''\u306F\u30AD\u30FC\u30EF\u30FC\u30C9\u306A\u306E\u3067\u8B58\u5225\u5B50\u3068\u3057\u3066\u4F7F\u7528\u3059\u308B\u3053\u3068\u306F\u3067\u304D\u307E\u305B\u3093
@@ -2339,6 +2374,11 @@
 # 0: string, 1: string
 compiler.err.illegal.argument.for.option={0}\u306E\u5F15\u6570\u304C\u4E0D\u6B63\u3067\u3059: {1}
 
+compiler.err.switch.null.not.allowed=case\u306Enull\u30E9\u30D9\u30EB\u306F\u8A31\u53EF\u3055\u308C\u307E\u305B\u3093
+
+compiler.err.switch.case.unexpected.statement=case\u306E\u4E88\u671F\u3057\u306A\u3044\u6587\u3067\u3059\u3002\u4E88\u671F\u3055\u308C\u308B\u306E\u306F\u3001\u5F0F\u3001\u30D6\u30ED\u30C3\u30AF\u307E\u305F\u306Fthrow\u6587\u3067\u3059
+
+compiler.err.switch.mixing.case.types=switch\u3067case\u306E\u7570\u306A\u308B\u7A2E\u985E\u304C\u4F7F\u7528\u3055\u308C\u3066\u3044\u307E\u3059
 
 ############################################
 # messages previouly at javac.properties
@@ -2407,7 +2447,12 @@
 compiler.err.no.value.for.option={0}\u30AA\u30D7\u30B7\u30E7\u30F3\u306E\u5024\u304C\u3042\u308A\u307E\u305B\u3093
 
 # 0: string
-compiler.err.repeated.value.for.patch.module={0}\u306B\u5BFE\u3057\u3066--patch-module\u304C\u8907\u6570\u56DE\u6307\u5B9A\u3055\u308C\u3066\u3044\u307E\u3059
+compiler.err.repeated.value.for.patch.module=\u30E2\u30B8\u30E5\u30FC\u30EB{0}\u306B\u5BFE\u3057\u3066--patch-module\u304C\u8907\u6570\u56DE\u6307\u5B9A\u3055\u308C\u3066\u3044\u307E\u3059
+
+# 0: string
+compiler.err.repeated.value.for.module.source.path=\u30E2\u30B8\u30E5\u30FC\u30EB{0}\u306B\u5BFE\u3057\u3066--module-source-path\u304C\u8907\u6570\u56DE\u6307\u5B9A\u3055\u308C\u3066\u3044\u307E\u3059
+
+compiler.err.multiple.values.for.module.source.path=\u30D1\u30BF\u30FC\u30F3\u5F15\u6570\u3067--module-source-path\u304C\u8907\u6570\u56DE\u6307\u5B9A\u3055\u308C\u3066\u3044\u307E\u3059
 
 # 0: string
 compiler.err.unmatched.quote=\u74B0\u5883\u5909\u6570{0}\u306E\u5F15\u7528\u7B26\u304C\u4E00\u81F4\u3057\u307E\u305B\u3093
--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/resources/compiler_zh_CN.properties	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/resources/compiler_zh_CN.properties	Tue Jan 15 10:55:26 2019 -0800
@@ -49,6 +49,7 @@
 # kind name         an informative description of the kind of a declaration; see compiler.misc.kindname.*
 # target            a target version number, such as 1.5, 1.6, 1.7, taken from a com.sun.tools.javac.jvm.Target
 # token             the name of a non-terminal in source code; see compiler.misc.token.*
+# tree tag          the name of a non-terminal in source code; see compiler.misc.token.*
 # type              a Java type; e.g. int, X, X<T>
 # url               a URL
 # object            a Java object (unspecified)
@@ -158,6 +159,28 @@
 
 compiler.err.break.outside.switch.loop=\u5728 switch \u6216 loop \u5916\u90E8\u4E2D\u65AD
 
+compiler.err.break.missing.value=\u7F3A\u5C11\u4E2D\u65AD\u503C
+
+compiler.err.break.outside.switch.expression=break \u5728\u95ED\u5408\u7684 switch \u8868\u8FBE\u5F0F\u5916\u90E8
+
+compiler.err.continue.outside.switch.expression=continue \u5728\u95ED\u5408\u7684 switch \u8868\u8FBE\u5F0F\u5916\u90E8
+
+compiler.err.return.outside.switch.expression=return \u5728\u95ED\u5408\u7684 switch \u8868\u8FBE\u5F0F\u5916\u90E8
+
+compiler.err.rule.completes.normally=switch \u89C4\u5219\u5B8C\u7ED3\u4F46\u6CA1\u6709\u63D0\u4F9B\u503C\n\uFF08switch \u8868\u8FBE\u5F0F\u4E2D\u7684 switch \u89C4\u5219\u5FC5\u987B\u63D0\u4F9B\u503C\u6216\u629B\u51FA\uFF09
+
+compiler.err.switch.expression.completes.normally=switch \u8868\u8FBE\u5F0F\u5B8C\u7ED3\u4F46\u6CA1\u6709\u63D0\u4F9B\u503C\n\uFF08switch \u8868\u8FBE\u5F0F\u5FC5\u987B\u4E3A\u6240\u6709\u53EF\u80FD\u7684\u8F93\u5165\u503C\u63D0\u4F9B\u503C\u6216\u629B\u51FA\uFF09
+
+# 0: name
+compiler.err.break.ambiguous.target=\u5BF9 ''{0}'' \u7684\u5F15\u7528\u4E0D\u660E\u786E\n\uFF08''{0}'' \u540C\u65F6\u662F\u6807\u7B7E\u548C\u8868\u8FBE\u5F0F\uFF09
+
+# 0: tree tag
+compiler.err.break.expr.not.immediate=''{0}'' \u4E2D\u4E0D\u652F\u6301\u503C\u4E2D\u65AD
+
+compiler.err.break.complex.value.no.switch.expression=\u610F\u5916\u503C\u4E2D\u65AD
+
+compiler.err.switch.expression.empty=switch \u8868\u8FBE\u5F0F\u4E2D\u6CA1\u6709\u4EFB\u4F55 case \u5B50\u53E5
+
 # 0: name
 compiler.err.call.must.be.first.stmt.in.ctor=\u5BF9{0}\u7684\u8C03\u7528\u5FC5\u987B\u662F\u6784\u9020\u5668\u4E2D\u7684\u7B2C\u4E00\u4E2A\u8BED\u53E5
 
@@ -583,15 +606,17 @@
 
 compiler.err.native.meth.cant.have.body=\u672C\u673A\u65B9\u6CD5\u4E0D\u80FD\u5E26\u6709\u4E3B\u4F53
 
-# 0: type, 1: type
-compiler.err.neither.conditional.subtype=? \u7684\u4E0D\u517C\u5BB9\u7C7B\u578B: \u4E24\u8005\u90FD\u4E0D\u662F\u5BF9\u65B9\u7684\u5B50\u7C7B\u578B\n\u7B2C\u4E8C\u4E2A\u64CD\u4F5C\u6570: {0}\n\u7B2C\u4E09\u4E2A\u64CD\u4F5C\u6570: {1}
-
 
 # 0: message segment
 compiler.misc.incompatible.type.in.conditional=\u6761\u4EF6\u8868\u8FBE\u5F0F\u4E2D\u7684\u7C7B\u578B\u9519\u8BEF\n{0}
 
 compiler.misc.conditional.target.cant.be.void=\u6761\u4EF6\u8868\u8FBE\u5F0F\u7684\u76EE\u6807\u7C7B\u578B\u4E0D\u80FD\u4E3A\u7A7A
 
+compiler.misc.switch.expression.target.cant.be.void=switch \u8868\u8FBE\u5F0F\u7684\u76EE\u6807\u7C7B\u578B\u4E0D\u80FD\u4E3A\u7A7A
+
+# 0: message segment
+compiler.misc.incompatible.type.in.switch.expression=switch \u8868\u8FBE\u5F0F\u4E2D\u7684\u7C7B\u578B\u9519\u8BEF\n{0}
+
 # 0: message segment
 compiler.misc.incompatible.ret.type.in.lambda=lambda \u8868\u8FBE\u5F0F\u4E2D\u7684\u8FD4\u56DE\u7C7B\u578B\u9519\u8BEF\n{0}
 
@@ -817,8 +842,6 @@
 
 compiler.err.throws.not.allowed.in.intf.annotation=@interface \u6210\u5458\u4E2D\u4E0D\u5141\u8BB8\u4F7F\u7528 throws \u5B50\u53E5
 
-compiler.err.try.without.catch.or.finally=\u6709 ''try'', \u4F46\u662F\u6CA1\u6709 ''catch'' \u6216 ''finally''
-
 compiler.err.try.without.catch.finally.or.resource.decls=''try'' \u4E0D\u5E26\u6709 ''catch'', ''finally'' \u6216\u8D44\u6E90\u58F0\u660E
 
 # 0: symbol
@@ -865,6 +888,8 @@
 
 compiler.err.unclosed.str.lit=\u672A\u7ED3\u675F\u7684\u5B57\u7B26\u4E32\u6587\u5B57
 
+compiler.err.unicode.backtick=\u5C1D\u8BD5\u5C06 \\u0060 \u7528\u4F5C\u539F\u59CB\u5B57\u7B26\u4E32\u6587\u5B57\u5206\u9694\u7B26
+
 # 0: string
 compiler.err.unsupported.encoding=\u4E0D\u652F\u6301\u7684\u7F16\u7801: {0}
 
@@ -922,6 +947,8 @@
 
 compiler.err.unreachable.stmt=\u65E0\u6CD5\u8BBF\u95EE\u7684\u8BED\u53E5
 
+compiler.err.not.exhaustive=switch \u8868\u8FBE\u5F0F\u4E0D\u5305\u542B\u6240\u6709\u53EF\u80FD\u7684\u8F93\u5165\u503C
+
 compiler.err.initializer.must.be.able.to.complete.normally=\u521D\u59CB\u5316\u7A0B\u5E8F\u5FC5\u987B\u80FD\u591F\u6B63\u5E38\u5B8C\u6210
 
 compiler.err.initializer.not.allowed=\u63A5\u53E3\u4E2D\u4E0D\u5141\u8BB8\u6709\u521D\u59CB\u5316\u7A0B\u5E8F
@@ -1240,9 +1267,6 @@
 # 0: type, 1: type
 compiler.warn.inexact.non-varargs.call=\u6700\u540E\u4E00\u4E2A\u53C2\u6570\u4F7F\u7528\u4E86\u4E0D\u51C6\u786E\u7684\u53D8\u91CF\u7C7B\u578B\u7684 varargs \u65B9\u6CD5\u7684\u975E varargs \u8C03\u7528; \n\u5BF9\u4E8E varargs \u8C03\u7528, \u5E94\u4F7F\u7528 {0}\n\u5BF9\u4E8E\u975E varargs \u8C03\u7528, \u5E94\u4F7F\u7528 {1}, \u8FD9\u6837\u4E5F\u53EF\u4EE5\u6291\u5236\u6B64\u8B66\u544A
 
-# 0: target, 1: target
-compiler.err.bad.target.sigpoly.call=-target {0} \u4E2D\u4E0D\u652F\u6301\u591A\u6001\u7B7E\u540D\u8C03\u7528\n\uFF08\u8BF7\u4F7F\u7528 -target {1} \u6216\u66F4\u9AD8\u7248\u672C\u4EE5\u542F\u7528\u591A\u6001\u7B7E\u540D\u8C03\u7528\uFF09
-
 # 0: list of type
 compiler.warn.unreachable.catch=catch \u5B50\u53E5\u65E0\u6CD5\u8BBF\u95EE\n\u5DF2\u6355\u83B7\u5230\u629B\u51FA\u7684\u7C7B\u578B{0}
 
@@ -1852,6 +1876,17 @@
 
 compiler.misc.kindname.instance.init=\u5B9E\u4F8B\u521D\u59CB\u5316\u7A0B\u5E8F
 
+# the following are names of tree kinds:
+compiler.misc.tree.tag.forloop=for
+
+compiler.misc.tree.tag.foreachloop=for
+
+compiler.misc.tree.tag.whileloop=while
+
+compiler.misc.tree.tag.doloop=do
+
+compiler.misc.tree.tag.switch=switch
+
 #####
 
 compiler.misc.no.args=\u6CA1\u6709\u53C2\u6570
@@ -1958,12 +1993,6 @@
 
 compiler.misc.feature.diamond.and.anon.class=''<>'' \u5177\u6709\u533F\u540D\u7684\u5185\u90E8\u7C7B
 
-compiler.misc.feature.binary.lit=\u4E8C\u8FDB\u5236\u6587\u5B57
-
-compiler.misc.feature.underscore.lit=\u6587\u5B57\u4E2D\u7684\u4E0B\u5212\u7EBF
-
-compiler.misc.feature.try.with.resources=try-with-resources
-
 compiler.misc.feature.var.in.try.with.resources=try-with-resources \u4E2D\u7684\u53D8\u91CF
 
 compiler.misc.feature.type.annotations=\u7C7B\u578B\u6CE8\u91CA
@@ -1974,10 +2003,6 @@
 
 compiler.misc.feature.diamond=diamond \u8FD0\u7B97\u7B26
 
-compiler.misc.feature.multicatch=multi-catch \u8BED\u53E5
-
-compiler.misc.feature.string.switch=switch \u4E2D\u7684\u5B57\u7B26\u4E32
-
 compiler.misc.feature.lambda=lambda \u8868\u8FBE\u5F0F
 
 compiler.misc.feature.method.references=\u65B9\u6CD5\u5F15\u7528
@@ -1992,6 +2017,16 @@
 
 compiler.misc.feature.private.intf.methods=\u79C1\u6709\u63A5\u53E3\u65B9\u6CD5
 
+compiler.misc.feature.multiple.case.labels=\u591A\u4E2A case \u6807\u7B7E
+
+compiler.misc.feature.switch.rules=switch \u89C4\u5219
+
+compiler.misc.feature.switch.expressions=switch \u8868\u8FBE\u5F0F
+
+compiler.misc.feature.raw.string.literals=\u539F\u59CB\u5B57\u7B26\u4E32\u6587\u5B57
+
+compiler.misc.feature.var.syntax.in.implicit.lambda=\u9690\u5F0F lambda \u4E2D\u7684 var \u8BED\u6CD5
+
 compiler.warn.underscore.as.identifier=\u4ECE\u53D1\u884C\u7248 9 \u5F00\u59CB, ''_'' \u4E3A\u5173\u952E\u5B57, \u4E0D\u80FD\u7528\u4F5C\u6807\u8BC6\u7B26
 
 compiler.err.underscore.as.identifier=\u4ECE\u53D1\u884C\u7248 9 \u5F00\u59CB, ''_'' \u4E3A\u5173\u952E\u5B57, \u4E0D\u80FD\u7528\u4F5C\u6807\u8BC6\u7B26
@@ -2339,6 +2374,11 @@
 # 0: string, 1: string
 compiler.err.illegal.argument.for.option={0} \u7684\u53C2\u6570\u975E\u6CD5: {1}
 
+compiler.err.switch.null.not.allowed=case \u4E2D\u4E0D\u5141\u8BB8\u4F7F\u7528\u7A7A\u6807\u7B7E
+
+compiler.err.switch.case.unexpected.statement=case \u4E2D\u5B58\u5728\u610F\u5916\u8BED\u53E5\uFF0C\u5E94\u4E3A\u8868\u8FBE\u5F0F\u3001\u5757\u6216\u629B\u51FA\u8BED\u53E5
+
+compiler.err.switch.mixing.case.types=\u5728 switch \u4E2D\u4F7F\u7528\u4E86\u4E0D\u540C case \u7C7B\u578B
 
 ############################################
 # messages previouly at javac.properties
@@ -2407,7 +2447,12 @@
 compiler.err.no.value.for.option={0} \u9009\u9879\u6CA1\u6709\u503C
 
 # 0: string
-compiler.err.repeated.value.for.patch.module=\u4E3A {0} \u591A\u6B21\u6307\u5B9A\u4E86 --patch-module
+compiler.err.repeated.value.for.patch.module=\u4E3A\u6A21\u5757 {0} \u591A\u6B21\u6307\u5B9A\u4E86 --patch-module
+
+# 0: string
+compiler.err.repeated.value.for.module.source.path=\u4E3A\u6A21\u5757 {0} \u591A\u6B21\u6307\u5B9A\u4E86 --module-source-path
+
+compiler.err.multiple.values.for.module.source.path=\u4F7F\u7528\u6A21\u5F0F\u53C2\u6570\u591A\u6B21\u6307\u5B9A\u4E86 --module-source-path
 
 # 0: string
 compiler.err.unmatched.quote=\u73AF\u5883\u53D8\u91CF {0} \u4E2D\u7684\u5F15\u53F7\u4E0D\u6210\u5BF9
--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/resources/javac.properties	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/resources/javac.properties	Tue Jan 15 10:55:26 2019 -0800
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 1999, 2018, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1999, 2019, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -44,7 +44,7 @@
 javac.opt.sourcepath=\
     Specify where to find input source files
 javac.opt.m=\
-    Compile only the specified module, check timestamps
+    Compile only the specified module(s), check timestamps
 javac.opt.modulesourcepath=\
     Specify where to find input source files for multiple modules
 javac.opt.bootclasspath=\
@@ -108,7 +108,7 @@
 javac.opt.arg.mspath=\
     <module-source-path>
 javac.opt.arg.m=\
-    <module-name>
+    <module>(,<module>)*
 javac.opt.arg.jdk=\
     <jdk>|none
 javac.opt.arg.dirs=\
--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/resources/javac_ja.properties	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/resources/javac_ja.properties	Tue Jan 15 10:55:26 2019 -0800
@@ -52,9 +52,9 @@
 javac.opt.J=<flag>\u3092\u5B9F\u884C\u30B7\u30B9\u30C6\u30E0\u306B\u76F4\u63A5\u6E21\u3059
 javac.opt.encoding=\u30BD\u30FC\u30B9\u30FB\u30D5\u30A1\u30A4\u30EB\u304C\u4F7F\u7528\u3059\u308B\u6587\u5B57\u30A8\u30F3\u30B3\u30FC\u30C7\u30A3\u30F3\u30B0\u3092\u6307\u5B9A\u3059\u308B
 javac.opt.profile=\u4F7F\u7528\u3055\u308C\u3066\u3044\u308BAPI\u304C\u6307\u5B9A\u3057\u305F\u30D7\u30ED\u30D5\u30A1\u30A4\u30EB\u3067\u4F7F\u7528\u53EF\u80FD\u304B\u3069\u3046\u304B\u3092\u78BA\u8A8D\u3057\u307E\u3059
-javac.opt.target=\u7279\u5B9A\u306EVM\u30D0\u30FC\u30B8\u30E7\u30F3\u7528\u306E\u30AF\u30E9\u30B9\u30FB\u30D5\u30A1\u30A4\u30EB\u3092\u751F\u6210\u3059\u308B
-javac.opt.release=\u7279\u5B9A\u306EVM\u30D0\u30FC\u30B8\u30E7\u30F3\u7528\u306B\u30B3\u30F3\u30D1\u30A4\u30EB\u3057\u307E\u3059\u3002\u30B5\u30DD\u30FC\u30C8\u3055\u308C\u3066\u3044\u308B\u30BF\u30FC\u30B2\u30C3\u30C8: {0}
-javac.opt.source=\u6307\u5B9A\u3055\u308C\u305F\u30EA\u30EA\u30FC\u30B9\u3068\u30BD\u30FC\u30B9\u306E\u4E92\u63DB\u6027\u3092\u4FDD\u3064
+javac.opt.target=\u7279\u5B9A\u306EVM\u30D0\u30FC\u30B8\u30E7\u30F3\u7528\u306E\u30AF\u30E9\u30B9\u30FB\u30D5\u30A1\u30A4\u30EB\u3092\u751F\u6210\u3057\u307E\u3059\u3002\u30B5\u30DD\u30FC\u30C8\u3055\u308C\u3066\u3044\u308B\u30D0\u30FC\u30B8\u30E7\u30F3: {0}
+javac.opt.release=\u7279\u5B9A\u306E\u30EA\u30EA\u30FC\u30B9\u7528\u306B\u306B\u30B3\u30F3\u30D1\u30A4\u30EB\u3057\u307E\u3059\u3002\u30B5\u30DD\u30FC\u30C8\u3055\u308C\u3066\u3044\u308B\u30EA\u30EA\u30FC\u30B9: {0}
+javac.opt.source=\u6307\u5B9A\u3055\u308C\u305F\u30EA\u30EA\u30FC\u30B9\u3068\u30BD\u30FC\u30B9\u306E\u4E92\u63DB\u6027\u3092\u4FDD\u6301\u3057\u307E\u3059\u3002\u30B5\u30DD\u30FC\u30C8\u3055\u308C\u3066\u3044\u308B\u30EA\u30EA\u30FC\u30B9: {0}
 javac.opt.Werror=\u8B66\u544A\u304C\u767A\u751F\u3057\u305F\u5834\u5408\u306B\u30B3\u30F3\u30D1\u30A4\u30EB\u3092\u7D42\u4E86\u3059\u308B
 javac.opt.A=\u6CE8\u91C8\u30D7\u30ED\u30BB\u30C3\u30B5\u306B\u6E21\u3055\u308C\u308B\u30AA\u30D7\u30B7\u30E7\u30F3
 javac.opt.implicit=\u6697\u9ED9\u7684\u306B\u53C2\u7167\u3055\u308C\u308B\u30D5\u30A1\u30A4\u30EB\u306B\u3064\u3044\u3066\u30AF\u30E9\u30B9\u30FB\u30D5\u30A1\u30A4\u30EB\u3092\u751F\u6210\u3059\u308B\u304B\u3069\u3046\u304B\u3092\u6307\u5B9A\u3059\u308B
--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/resources/javac_zh_CN.properties	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/resources/javac_zh_CN.properties	Tue Jan 15 10:55:26 2019 -0800
@@ -52,9 +52,9 @@
 javac.opt.J=\u76F4\u63A5\u5C06 <\u6807\u8BB0> \u4F20\u9012\u7ED9\u8FD0\u884C\u65F6\u7CFB\u7EDF
 javac.opt.encoding=\u6307\u5B9A\u6E90\u6587\u4EF6\u4F7F\u7528\u7684\u5B57\u7B26\u7F16\u7801
 javac.opt.profile=\u8BF7\u786E\u4FDD\u4F7F\u7528\u7684 API \u5728\u6307\u5B9A\u7684\u914D\u7F6E\u6587\u4EF6\u4E2D\u53EF\u7528
-javac.opt.target=\u751F\u6210\u7279\u5B9A VM \u7248\u672C\u7684\u7C7B\u6587\u4EF6
-javac.opt.release=\u9488\u5BF9\u7279\u5B9A VM \u7248\u672C\u8FDB\u884C\u7F16\u8BD1\u3002\u652F\u6301\u7684\u76EE\u6807: {0}
-javac.opt.source=\u63D0\u4F9B\u4E0E\u6307\u5B9A\u53D1\u884C\u7248\u7684\u6E90\u517C\u5BB9\u6027
+javac.opt.target=\u751F\u6210\u9488\u5BF9\u7279\u5B9A VM \u7248\u672C\u7684\u7C7B\u6587\u4EF6\u3002\u652F\u6301\u7684\u7248\u672C\uFF1A{0}
+javac.opt.release=\u9488\u5BF9\u7279\u5B9A\u53D1\u884C\u7248\u8FDB\u884C\u7F16\u8BD1\u3002\u652F\u6301\u7684\u53D1\u884C\u7248\uFF1A{0}
+javac.opt.source=\u63D0\u4F9B\u4E0E\u6307\u5B9A\u53D1\u884C\u7248\u7684\u6E90\u517C\u5BB9\u6027\u3002\u652F\u6301\u7684\u53D1\u884C\u7248\uFF1A{0}
 javac.opt.Werror=\u51FA\u73B0\u8B66\u544A\u65F6\u7EC8\u6B62\u7F16\u8BD1
 javac.opt.A=\u4F20\u9012\u7ED9\u6CE8\u91CA\u5904\u7406\u7A0B\u5E8F\u7684\u9009\u9879
 javac.opt.implicit=\u6307\u5B9A\u662F\u5426\u4E3A\u9690\u5F0F\u5F15\u7528\u6587\u4EF6\u751F\u6210\u7C7B\u6587\u4EF6
--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/resources/launcher_ja.properties	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/resources/launcher_ja.properties	Tue Jan 15 10:55:26 2019 -0800
@@ -80,17 +80,17 @@
 ## All errors are preceded by this string.
 launcher.error=\u30A8\u30E9\u30FC: 
 
-launcher.err.no.args=\u30D5\u30A1\u30A4\u30EB\u540D\u306A\u3057
+launcher.err.no.args=\u30BD\u30FC\u30B9\u30FB\u30D5\u30A1\u30A4\u30EB\u306E\u30D1\u30B9\u304C\u3042\u308A\u307E\u305B\u3093
 
 # 0: string
-launcher.err.invalid.filename=\u30D5\u30A1\u30A4\u30EB\u540D\u304C\u7121\u52B9\u3067\u3059: {0}
+launcher.err.invalid.filename=\u30BD\u30FC\u30B9\u30FB\u30D5\u30A1\u30A4\u30EB\u306E\u7121\u52B9\u306A\u30D1\u30B9: {0}
 
 # 0: path
-launcher.err.file.not.found=\u30D5\u30A1\u30A4\u30EB\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093: {0}
+launcher.err.file.not.found=\u30BD\u30FC\u30B9\u30FB\u30D5\u30A1\u30A4\u30EB\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093: {0}
 
 launcher.err.compilation.failed=\u30B3\u30F3\u30D1\u30A4\u30EB\u304C\u5931\u6557\u3057\u307E\u3057\u305F
 
-launcher.err.no.class=\u30D5\u30A1\u30A4\u30EB\u3067\u30AF\u30E9\u30B9\u304C\u5BA3\u8A00\u3055\u308C\u3066\u3044\u307E\u305B\u3093
+launcher.err.no.class=\u30BD\u30FC\u30B9\u30FB\u30D5\u30A1\u30A4\u30EB\u3067\u5BA3\u8A00\u3055\u308C\u305F\u30AF\u30E9\u30B9\u304C\u3042\u308A\u307E\u305B\u3093
 
 launcher.err.main.not.public.static=''main'\u30E1\u30BD\u30C3\u30C9\u304C''public static''\u3068\u3057\u3066\u5BA3\u8A00\u3055\u308C\u3066\u3044\u307E\u305B\u3093
 
@@ -100,16 +100,13 @@
 launcher.err.cant.find.class=\u30AF\u30E9\u30B9\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093: {0}
 
 # 0: string
-launcher.err.unexpected.class=\u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u30FB\u30AF\u30E9\u30B9\u30FB\u30D1\u30B9\u306B\u30AF\u30E9\u30B9\u304C\u898B\u3064\u304B\u308A\u307E\u3057\u305F: {0}
-
-# 0: string
 launcher.err.cant.find.main.method=\u30AF\u30E9\u30B9\u306Bmain(String[])\u30E1\u30BD\u30C3\u30C9\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093: {0}
 
 # 0: string
 launcher.err.cant.access.main.method=\u30AF\u30E9\u30B9\u306E\u30E1\u30A4\u30F3\u30FB\u30E1\u30BD\u30C3\u30C9\u306B\u30A2\u30AF\u30BB\u30B9\u3067\u304D\u307E\u305B\u3093: {0}
 
 # 0: path, 1: object
-launcher.err.cant.read.file=\u30D5\u30A1\u30A4\u30EB{0}\u306E\u8AAD\u53D6\u308A\u4E2D\u306B\u30A8\u30E9\u30FC\u304C\u767A\u751F\u3057\u307E\u3057\u305F: {1}
+launcher.err.cant.read.file=\u30BD\u30FC\u30B9\u30FB\u30D5\u30A1\u30A4\u30EB{0}\u306E\u8AAD\u53D6\u308A\u30A8\u30E9\u30FC: {1}
 
 # 0: string
 launcher.err.no.value.for.option=\u30AA\u30D7\u30B7\u30E7\u30F3\u306B\u5024\u304C\u6307\u5B9A\u3055\u308C\u3066\u3044\u307E\u305B\u3093: {0}
--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/resources/launcher_zh_CN.properties	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/resources/launcher_zh_CN.properties	Tue Jan 15 10:55:26 2019 -0800
@@ -80,17 +80,17 @@
 ## All errors are preceded by this string.
 launcher.error=\u9519\u8BEF: 
 
-launcher.err.no.args=\u65E0\u6587\u4EF6\u540D
+launcher.err.no.args=\u65E0\u6E90\u6587\u4EF6\u7684\u8DEF\u5F84
 
 # 0: string
-launcher.err.invalid.filename=\u65E0\u6548\u7684\u6587\u4EF6\u540D\uFF1A{0}
+launcher.err.invalid.filename=\u6E90\u6587\u4EF6\u7684\u8DEF\u5F84\u65E0\u6548\uFF1A{0}
 
 # 0: path
-launcher.err.file.not.found=\u627E\u4E0D\u5230\u6587\u4EF6: {0}
+launcher.err.file.not.found=\u627E\u4E0D\u5230\u6E90\u6587\u4EF6\uFF1A{0}
 
 launcher.err.compilation.failed=\u7F16\u8BD1\u5931\u8D25
 
-launcher.err.no.class=\u5728\u6587\u4EF6\u4E2D\u672A\u58F0\u660E\u7C7B
+launcher.err.no.class=\u5728\u6E90\u6587\u4EF6\u4E2D\u672A\u58F0\u660E\u7C7B
 
 launcher.err.main.not.public.static=''main'' \u65B9\u6CD5\u672A\u58F0\u660E ''public static''
 
@@ -100,16 +100,13 @@
 launcher.err.cant.find.class=\u627E\u4E0D\u5230\u7C7B\uFF1A{0}
 
 # 0: string
-launcher.err.unexpected.class=\u5728\u5E94\u7528\u7A0B\u5E8F\u7C7B\u8DEF\u5F84 {0} \u4E2D\u627E\u5230\u7C7B
-
-# 0: string
 launcher.err.cant.find.main.method=\u5728\u7C7B {0} \u4E2D\u627E\u4E0D\u5230 main(String[]) \u65B9\u6CD5
 
 # 0: string
 launcher.err.cant.access.main.method=\u65E0\u6CD5\u8BBF\u95EE\u7C7B {0} \u4E2D\u7684 main \u65B9\u6CD5
 
 # 0: path, 1: object
-launcher.err.cant.read.file=\u8BFB\u53D6\u6587\u4EF6 {0} \u65F6\u51FA\u9519\uFF1A{1}
+launcher.err.cant.read.file=\u8BFB\u53D6\u6E90\u6587\u4EF6 {0} \u65F6\u51FA\u9519\uFF1A{1}
 
 # 0: string
 launcher.err.no.value.for.option=\u6CA1\u6709\u4E3A\u9009\u9879 {0} \u6307\u5B9A\u503C
--- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/g1/G1CollectedHeap.java	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/g1/G1CollectedHeap.java	Tue Jan 15 10:55:26 2019 -0800
@@ -47,7 +47,7 @@
 
 public class G1CollectedHeap extends CollectedHeap {
     // HeapRegionManager _hrm;
-    static private long hrmFieldOffset;
+    static private AddressField hrmField;
     // MemRegion _g1_reserved;
     static private long g1ReservedFieldOffset;
     // size_t _summary_bytes_used;
@@ -72,7 +72,7 @@
     static private synchronized void initialize(TypeDataBase db) {
         Type type = db.lookupType("G1CollectedHeap");
 
-        hrmFieldOffset = type.getField("_hrm").getOffset();
+        hrmField = type.getAddressField("_hrm");
         summaryBytesUsedField = type.getCIntegerField("_summary_bytes_used");
         g1mmField = type.getAddressField("_g1mm");
         oldSetFieldOffset = type.getField("_old_set").getOffset();
@@ -93,7 +93,7 @@
     }
 
     public HeapRegionManager hrm() {
-        Address hrmAddr = addr.addOffsetTo(hrmFieldOffset);
+        Address hrmAddr = hrmField.getValue(addr);
         return (HeapRegionManager) VMObjectFactory.newObject(HeapRegionManager.class,
                                                          hrmAddr);
     }
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm.amd64/src/org/graalvm/compiler/asm/amd64/AMD64Assembler.java	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm.amd64/src/org/graalvm/compiler/asm/amd64/AMD64Assembler.java	Tue Jan 15 10:55:26 2019 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -1759,6 +1759,14 @@
         emitOperandHelper(dst, src, 0);
     }
 
+    public final void cmpb(Register dst, Register src) {
+        CMP.byteRmOp.emit(this, BYTE, dst, src);
+    }
+
+    public final void cmpw(Register dst, Register src) {
+        CMP.rmOp.emit(this, WORD, dst, src);
+    }
+
     public final void cmpl(Register dst, int imm32) {
         CMP.getMIOpcode(DWORD, isByte(imm32)).emit(this, DWORD, dst, imm32);
     }
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.java/src/org/graalvm/compiler/java/BytecodeParser.java	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.java/src/org/graalvm/compiler/java/BytecodeParser.java	Tue Jan 15 10:55:26 2019 -0800
@@ -4195,7 +4195,6 @@
             handleIllegalNewInstance(resolvedType);
             return;
         }
-
         maybeEagerlyInitialize(resolvedType);
 
         ClassInitializationPlugin classInitializationPlugin = graphBuilderConfig.getPlugins().getClassInitializationPlugin();
@@ -4509,7 +4508,6 @@
         }
 
         ResolvedJavaType holder = resolvedField.getDeclaringClass();
-        maybeEagerlyInitialize(holder);
         ClassInitializationPlugin classInitializationPlugin = this.graphBuilderConfig.getPlugins().getClassInitializationPlugin();
         if (classInitializationPlugin != null) {
             classInitializationPlugin.apply(this, holder, this::createCurrentFrameState);
@@ -4545,16 +4543,20 @@
     private ResolvedJavaField resolveStaticFieldAccess(JavaField field, ValueNode value) {
         if (field instanceof ResolvedJavaField) {
             ResolvedJavaField resolvedField = (ResolvedJavaField) field;
-            if (resolvedField.getDeclaringClass().isInitialized() || graphBuilderConfig.getPlugins().getClassInitializationPlugin() != null) {
+            ResolvedJavaType resolvedType = resolvedField.getDeclaringClass();
+            maybeEagerlyInitialize(resolvedType);
+
+            if (resolvedType.isInitialized() || graphBuilderConfig.getPlugins().getClassInitializationPlugin() != null) {
                 return resolvedField;
             }
+
             /*
              * Static fields have initialization semantics but may be safely accessed under certain
              * conditions while the class is being initialized. Executing in the clinit or init of
-             * classes which are subtypes of the field holder are sure to be running in a context
-             * where the access is safe.
+             * subclasses (but not implementers) of the field holder are sure to be running in a
+             * context where the access is safe.
              */
-            if (resolvedField.getDeclaringClass().isAssignableFrom(method.getDeclaringClass())) {
+            if (!resolvedType.isInterface() && resolvedType.isAssignableFrom(method.getDeclaringClass())) {
                 if (method.isClassInitializer() || method.isConstructor()) {
                     return resolvedField;
                 }
@@ -4588,7 +4590,6 @@
 
         ClassInitializationPlugin classInitializationPlugin = this.graphBuilderConfig.getPlugins().getClassInitializationPlugin();
         ResolvedJavaType holder = resolvedField.getDeclaringClass();
-        maybeEagerlyInitialize(holder);
         if (classInitializationPlugin != null) {
             Supplier<FrameState> stateBefore = () -> {
                 JavaKind[] pushedSlotKinds = {field.getJavaKind()};
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64ArrayIndexOfOp.java	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64ArrayIndexOfOp.java	Tue Jan 15 10:55:26 2019 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2018, 2019 Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -125,6 +125,14 @@
         return kind == JavaKind.Char;
     }
 
+    private JavaKind getComparisonKind() {
+        return findTwoConsecutive ? (byteMode(kind) ? JavaKind.Char : JavaKind.Int) : kind;
+    }
+
+    private AVXKind.AVXSize getVectorSize() {
+        return AVXKind.getDataSize(vectorKind);
+    }
+
     @Override
     public void emitCode(CompilationResultBuilder crb, AMD64MacroAssembler asm) {
         Register arrayPtr = asRegister(arrayPtrValue);
@@ -159,9 +167,6 @@
         Label retNotFound = new Label();
         Label end = new Label();
 
-        AVXKind.AVXSize vectorSize = AVXKind.getDataSize(vectorKind);
-        int nVectors = nValues == 1 ? 4 : nValues == 2 ? 2 : 1;
-
         // load array length
         // important: this must be the first register manipulation, since arrayLengthValue is
         // annotated with @Use
@@ -178,10 +183,10 @@
         }
         // fill comparison vector with copies of the search value
         for (int i = 0; i < nValues; i++) {
-            emitBroadcast(asm, findTwoConsecutive ? (byteMode(kind) ? JavaKind.Char : JavaKind.Int) : kind, vecCmp[i], vecArray[0], vectorSize);
+            emitBroadcast(asm, getComparisonKind(), vecCmp[i], vecArray[0], getVectorSize());
         }
 
-        emitArrayIndexOfChars(crb, asm, kind, vectorSize, result, slotsRemaining, searchValue, vecCmp, vecArray, cmpResult, retFound, retNotFound, vmPageSize, nValues, nVectors, findTwoConsecutive);
+        emitArrayIndexOfChars(crb, asm, result, slotsRemaining, searchValue, vecCmp, vecArray, cmpResult, retFound, retNotFound);
 
         // return -1 (no match)
         asm.bind(retNotFound);
@@ -197,7 +202,7 @@
         asm.bind(end);
     }
 
-    private static void emitArrayIndexOfChars(CompilationResultBuilder crb, AMD64MacroAssembler asm, JavaKind kind, AVXKind.AVXSize vectorSize,
+    private void emitArrayIndexOfChars(CompilationResultBuilder crb, AMD64MacroAssembler asm,
                     Register arrayPtr,
                     Register slotsRemaining,
                     Register[] searchValue,
@@ -205,11 +210,10 @@
                     Register[] vecArray,
                     Register[] cmpResult,
                     Label retFound,
-                    Label retNotFound,
-                    int vmPageSize,
-                    int nValues,
-                    int nVectors,
-                    boolean findTwoCharPrefix) {
+                    Label retNotFound) {
+        int nVectors = nValues == 1 ? 4 : nValues == 2 ? 2 : 1;
+        AVXKind.AVXSize vectorSize = getVectorSize();
+
         Label bulkVectorLoop = new Label();
         Label singleVectorLoop = new Label();
         Label[] vectorFound = {
@@ -229,7 +233,7 @@
         int bulkLoopCondition = bulkSize;
         int[] vectorOffsets;
         JavaKind vectorCompareKind = kind;
-        if (findTwoCharPrefix) {
+        if (findTwoConsecutive) {
             singleVectorLoopCondition++;
             bulkLoopCondition++;
             bulkSize /= 2;
@@ -274,7 +278,7 @@
         emitAlign(crb, asm);
         asm.bind(bulkVectorLoop);
         // memory-aligned bulk comparison
-        emitVectorCompare(asm, vectorCompareKind, vectorSize, nValues, nVectors, vectorOffsets, arrayPtr, vecCmp, vecArray, cmpResult, vectorFound, !findTwoCharPrefix);
+        emitVectorCompare(asm, vectorCompareKind, vectorSize, nValues, nVectors, vectorOffsets, arrayPtr, vecCmp, vecArray, cmpResult, vectorFound, !findTwoConsecutive);
         // adjust number of array slots remaining
         asm.subl(slotsRemaining, bulkSize);
         // adjust array pointer
@@ -293,7 +297,7 @@
             asm.cmpl(slotsRemaining, singleVectorLoopCondition);
             asm.jcc(AMD64Assembler.ConditionFlag.Below, lessThanVectorSizeRemaining);
             // compare
-            emitVectorCompare(asm, vectorCompareKind, vectorSize, nValues, findTwoCharPrefix ? 2 : 1, vectorOffsets, arrayPtr, vecCmp, vecArray, cmpResult, vectorFound, false);
+            emitVectorCompare(asm, vectorCompareKind, vectorSize, nValues, findTwoConsecutive ? 2 : 1, vectorOffsets, arrayPtr, vecCmp, vecArray, cmpResult, vectorFound, false);
             // adjust number of array slots remaining
             asm.subl(slotsRemaining, arraySlotsPerVector);
             // adjust array pointer
@@ -313,16 +317,16 @@
         asm.movl(tmpArrayPtrLow, arrayPtr);
         // check if pointer + vector size would cross the page boundary
         asm.andl(tmpArrayPtrLow, (vmPageSize - 1));
-        asm.cmpl(tmpArrayPtrLow, (vmPageSize - (findTwoCharPrefix ? bytesPerVector + kind.getByteCount() : bytesPerVector)));
+        asm.cmpl(tmpArrayPtrLow, (vmPageSize - (findTwoConsecutive ? bytesPerVector + kind.getByteCount() : bytesPerVector)));
         // if the page boundary would be crossed, do byte/character-wise comparison instead.
         asm.jccb(AMD64Assembler.ConditionFlag.Above, lessThanVectorSizeRemainingLoop);
 
         Label[] overBoundsMatch = {new Label(), new Label()};
         // otherwise, do a vector compare that reads beyond array bounds
-        emitVectorCompare(asm, vectorCompareKind, vectorSize, nValues, findTwoCharPrefix ? 2 : 1, vectorOffsets, arrayPtr, vecCmp, vecArray, cmpResult, overBoundsMatch, false);
+        emitVectorCompare(asm, vectorCompareKind, vectorSize, nValues, findTwoConsecutive ? 2 : 1, vectorOffsets, arrayPtr, vecCmp, vecArray, cmpResult, overBoundsMatch, false);
         // no match
         asm.jmp(retNotFound);
-        if (findTwoCharPrefix) {
+        if (findTwoConsecutive) {
             Label overBoundsFinish = new Label();
             asm.bind(overBoundsMatch[1]);
             // get match offset of second result
@@ -348,14 +352,14 @@
         }
         // check if offset of matched value is greater than number of bytes remaining / out of array
         // bounds
-        if (findTwoCharPrefix) {
+        if (findTwoConsecutive) {
             asm.decrementl(slotsRemaining);
         }
         asm.cmpl(cmpResult[0], slotsRemaining);
         // match is out of bounds, return no match
         asm.jcc(AMD64Assembler.ConditionFlag.GreaterEqual, retNotFound);
         // adjust number of array slots remaining
-        if (findTwoCharPrefix) {
+        if (findTwoConsecutive) {
             asm.incrementl(slotsRemaining, 1);
         }
         asm.subl(slotsRemaining, cmpResult[0]);
@@ -365,17 +369,17 @@
         // compare remaining slots in the array one-by-one
         asm.bind(lessThanVectorSizeRemainingLoop);
         // check if enough array slots remain
-        asm.cmpl(slotsRemaining, findTwoCharPrefix ? 1 : 0);
+        asm.cmpl(slotsRemaining, findTwoConsecutive ? 1 : 0);
         asm.jcc(AMD64Assembler.ConditionFlag.LessEqual, retNotFound);
         // load char / byte
         if (byteMode(kind)) {
-            if (findTwoCharPrefix) {
+            if (findTwoConsecutive) {
                 asm.movzwl(cmpResult[0], new AMD64Address(arrayPtr));
             } else {
                 asm.movzbl(cmpResult[0], new AMD64Address(arrayPtr));
             }
         } else {
-            if (findTwoCharPrefix) {
+            if (findTwoConsecutive) {
                 asm.movl(cmpResult[0], new AMD64Address(arrayPtr));
             } else {
                 asm.movzwl(cmpResult[0], new AMD64Address(arrayPtr));
@@ -383,7 +387,7 @@
         }
         // check for match
         for (int i = 0; i < nValues; i++) {
-            asm.cmpl(cmpResult[0], searchValue[i]);
+            emitCompareInst(asm, getComparisonKind(), cmpResult[0], searchValue[i]);
             asm.jcc(AMD64Assembler.ConditionFlag.Equal, retFound);
         }
         // adjust number of array slots remaining
@@ -393,11 +397,11 @@
         // continue loop
         asm.jmpb(lessThanVectorSizeRemainingLoop);
 
-        for (int i = 1; i < nVectors; i += (findTwoCharPrefix ? 2 : 1)) {
+        for (int i = 1; i < nVectors; i += (findTwoConsecutive ? 2 : 1)) {
             emitVectorFoundWithOffset(asm, kind, vectorOffsets[i], arrayPtr, cmpResult[i], slotsRemaining, vectorFound[i], retFound);
         }
 
-        if (findTwoCharPrefix) {
+        if (findTwoConsecutive) {
             asm.bind(vectorFound[2]);
             asm.addq(arrayPtr, vectorOffsets[2]);
             // adjust number of array slots remaining
@@ -626,6 +630,23 @@
         }
     }
 
+    private static void emitCompareInst(AMD64MacroAssembler asm, JavaKind kind, Register dst, Register src) {
+        switch (kind) {
+            case Byte:
+                asm.cmpb(dst, src);
+                break;
+            case Short:
+            case Char:
+                asm.cmpw(dst, src);
+                break;
+            case Int:
+                asm.cmpl(dst, src);
+                break;
+            default:
+                asm.cmpq(dst, src);
+        }
+    }
+
     private static boolean supportsAVX2(LIRGeneratorTool tool) {
         return supports(tool, CPUFeature.AVX2);
     }
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/IntegerExactExceptionTest.java	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/IntegerExactExceptionTest.java	Tue Jan 15 10:55:26 2019 -0800
@@ -86,6 +86,46 @@
         }
     }
 
+    public void testIntegerExactOverflowWithoutUse1(int input) {
+        Math.addExact(intCounter, input);
+    }
+
+    public void testIntegerExactOverflowWithoutUse2(int input, boolean cond) {
+        if (cond) {
+            Math.addExact(intCounter, input);
+        } else {
+            intCounter = Math.addExact(intCounter, input);
+        }
+    }
+
+    @Test
+    public void testIntegerExactWithoutUse1() throws InvalidInstalledCodeException {
+        ResolvedJavaMethod method = getResolvedJavaMethod("testIntegerExactOverflowWithoutUse1");
+        InstalledCode code = getCode(method);
+
+        boolean gotException = false;
+        try {
+            code.executeVarargs(this, Integer.MAX_VALUE);
+        } catch (ArithmeticException e) {
+            gotException = true;
+        }
+        assertTrue(gotException);
+    }
+
+    @Test
+    public void testIntegerExactWithoutUse2() throws InvalidInstalledCodeException {
+        ResolvedJavaMethod method = getResolvedJavaMethod("testIntegerExactOverflowWithoutUse2");
+        InstalledCode code = getCode(method);
+
+        boolean gotException = false;
+        try {
+            code.executeVarargs(this, Integer.MAX_VALUE, true);
+        } catch (ArithmeticException e) {
+            gotException = true;
+        }
+        assertTrue(gotException);
+    }
+
     static long longCounter = 10;
 
     public void testLongExactOverflowSnippet(long input) {
@@ -138,4 +178,44 @@
             assertTrue(code.isValid());
         }
     }
+
+    public void testLongExactOverflowWithoutUse1(long input) {
+        Math.addExact(longCounter, input);
+    }
+
+    public void testLongExactOverflowWithoutUse2(long input, boolean cond) {
+        if (cond) {
+            Math.addExact(longCounter, input);
+        } else {
+            longCounter = Math.addExact(longCounter, input);
+        }
+    }
+
+    @Test
+    public void testLongExactWithoutUse1() throws InvalidInstalledCodeException {
+        ResolvedJavaMethod method = getResolvedJavaMethod("testLongExactOverflowWithoutUse1");
+        InstalledCode code = getCode(method);
+
+        boolean gotException = false;
+        try {
+            code.executeVarargs(this, Long.MAX_VALUE);
+        } catch (ArithmeticException e) {
+            gotException = true;
+        }
+        assertTrue(gotException);
+    }
+
+    @Test
+    public void testLongExactWithoutUse2() throws InvalidInstalledCodeException {
+        ResolvedJavaMethod method = getResolvedJavaMethod("testLongExactOverflowWithoutUse2");
+        InstalledCode code = getCode(method);
+
+        boolean gotException = false;
+        try {
+            code.executeVarargs(this, Long.MAX_VALUE, true);
+        } catch (ArithmeticException e) {
+            gotException = true;
+        }
+        assertTrue(gotException);
+    }
 }
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/IntegerExactFoldTest.java	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/IntegerExactFoldTest.java	Tue Jan 15 10:55:26 2019 -0800
@@ -50,11 +50,13 @@
 import org.graalvm.compiler.replacements.nodes.arithmetic.IntegerExactArithmeticNode;
 import org.graalvm.compiler.replacements.nodes.arithmetic.IntegerExactArithmeticSplitNode;
 import org.junit.Assert;
+import org.junit.Ignore;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.junit.runners.Parameterized;
 import org.junit.runners.Parameterized.Parameters;
 
+@Ignore
 @RunWith(Parameterized.class)
 public class IntegerExactFoldTest extends GraalCompilerTest {
     private final long lowerBoundA;
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/StandardGraphBuilderPlugins.java	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/StandardGraphBuilderPlugins.java	Tue Jan 15 10:55:26 2019 -0800
@@ -559,26 +559,19 @@
         }
     }
 
-    private static void createIntegerExactOperation(GraphBuilderContext b, JavaKind kind, ValueNode x, ValueNode y, IntegerExactOp op) {
-        if (b.needsExplicitException()) {
+    private static boolean createIntegerExactOperation(GraphBuilderContext b, JavaKind kind, ValueNode x, ValueNode y, IntegerExactOp op) {
+        if (x.isConstant() && y.isConstant()) {
+            b.addPush(kind, createIntegerExactArithmeticNode(x, y, null, op));
+            return true;
+        } else {
             BytecodeExceptionKind exceptionKind = kind == JavaKind.Int ? BytecodeExceptionKind.INTEGER_EXACT_OVERFLOW : BytecodeExceptionKind.LONG_EXACT_OVERFLOW;
             AbstractBeginNode exceptionEdge = b.genExplicitExceptionEdge(exceptionKind);
-            IntegerExactArithmeticSplitNode split = b.addPush(kind, createIntegerExactSplit(x, y, exceptionEdge, op));
-            split.setNext(b.add(new BeginNode()));
-        } else {
-            SpeculationLog log = b.getGraph().getSpeculationLog();
-            if (log == null || (x.isConstant() && y.isConstant())) {
-                b.addPush(kind, createIntegerExactArithmeticNode(x, y, null, op));
-            } else {
-                SpeculationReason speculation = new IntegerExactOpSpeculation(b.getMethod(), op);
-                if (log.maySpeculate(speculation)) {
-                    b.addPush(kind, createIntegerExactArithmeticNode(x, y, speculation, op));
-                } else {
-                    BeginNode begin = b.add(new BeginNode());
-                    IntegerExactArithmeticNode node = (IntegerExactArithmeticNode) b.addPush(kind, createIntegerExactArithmeticNode(x, y, null, op));
-                    node.setAnchor(begin);
-                }
+            if (exceptionEdge != null) {
+                IntegerExactArithmeticSplitNode split = b.addPush(kind, createIntegerExactSplit(x, y, exceptionEdge, op));
+                split.setNext(b.add(new BeginNode()));
+                return true;
             }
+            return false;
         }
     }
 
@@ -592,8 +585,7 @@
                     @Override
                     public boolean apply(GraphBuilderContext b, ResolvedJavaMethod targetMethod, Receiver receiver, ValueNode x) {
                         ConstantNode y = b.add(ConstantNode.forIntegerKind(kind, 1));
-                        createIntegerExactOperation(b, kind, x, y, IntegerExactOp.INTEGER_DECREMENT_EXACT);
-                        return true;
+                        return createIntegerExactOperation(b, kind, x, y, IntegerExactOp.INTEGER_DECREMENT_EXACT);
                     }
                 });
 
@@ -601,33 +593,29 @@
                     @Override
                     public boolean apply(GraphBuilderContext b, ResolvedJavaMethod targetMethod, Receiver receiver, ValueNode x) {
                         ConstantNode y = b.add(ConstantNode.forIntegerKind(kind, 1));
-                        createIntegerExactOperation(b, kind, x, y, IntegerExactOp.INTEGER_INCREMENT_EXACT);
-                        return true;
+                        return createIntegerExactOperation(b, kind, x, y, IntegerExactOp.INTEGER_INCREMENT_EXACT);
                     }
                 });
 
                 r.register2("addExact", type, type, new InvocationPlugin() {
                     @Override
                     public boolean apply(GraphBuilderContext b, ResolvedJavaMethod targetMethod, Receiver receiver, ValueNode x, ValueNode y) {
-                        createIntegerExactOperation(b, kind, x, y, IntegerExactOp.INTEGER_ADD_EXACT);
-                        return true;
+                        return createIntegerExactOperation(b, kind, x, y, IntegerExactOp.INTEGER_ADD_EXACT);
                     }
                 });
 
                 r.register2("subtractExact", type, type, new InvocationPlugin() {
                     @Override
                     public boolean apply(GraphBuilderContext b, ResolvedJavaMethod targetMethod, Receiver receiver, ValueNode x, ValueNode y) {
-                        createIntegerExactOperation(b, kind, x, y, IntegerExactOp.INTEGER_SUBTRACT_EXACT);
-                        return true;
+                        return createIntegerExactOperation(b, kind, x, y, IntegerExactOp.INTEGER_SUBTRACT_EXACT);
                     }
                 });
 
                 r.register2("multiplyExact", type, type, new InvocationPlugin() {
                     @Override
                     public boolean apply(GraphBuilderContext b, ResolvedJavaMethod targetMethod, Receiver receiver, ValueNode x, ValueNode y) {
-                        createIntegerExactOperation(b, kind, x, y, IntegerExactOp.INTEGER_MULTIPLY_EXACT);
-                        return true;
-                    }
+                        return createIntegerExactOperation(b, kind, x, y, IntegerExactOp.INTEGER_MULTIPLY_EXACT);
+                     }
                 });
             }
         }
--- a/src/jdk.jartool/share/classes/sun/security/tools/jarsigner/Resources_ja.java	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/jdk.jartool/share/classes/sun/security/tools/jarsigner/Resources_ja.java	Tue Jan 15 10:55:26 2019 -0800
@@ -65,7 +65,7 @@
         {".storetype.type.keystore.type",
                 "[-storetype <type>]         \u30AD\u30FC\u30B9\u30C8\u30A2\u306E\u578B"},
         {".keypass.password.password.for.private.key.if.different.",
-                "[-keypass <password>]       \u79D8\u5BC6\u9375\u306E\u30D1\u30B9\u30EF\u30FC\u30C9(\u7570\u306A\u308B\u5834\u5408)"},
+                "[-keypass <password>]       \u79D8\u5BC6\u30AD\u30FC\u306E\u30D1\u30B9\u30EF\u30FC\u30C9(\u7570\u306A\u308B\u5834\u5408)"},
         {".certchain.file.name.of.alternative.certchain.file",
                 "[-certchain <file>]         \u4EE3\u66FF\u8A3C\u660E\u66F8\u30C1\u30A7\u30FC\u30F3\u30FB\u30D5\u30A1\u30A4\u30EB\u306E\u540D\u524D"},
         {".sigfile.file.name.of.SF.DSA.file",
@@ -87,7 +87,7 @@
         {".tsa.url.location.of.the.Timestamping.Authority",
                 "[-tsa <url>]                \u30BF\u30A4\u30E0\u30B9\u30BF\u30F3\u30D7\u5C40\u306E\u5834\u6240"},
         {".tsacert.alias.public.key.certificate.for.Timestamping.Authority",
-                "[-tsacert <alias>]          \u30BF\u30A4\u30E0\u30B9\u30BF\u30F3\u30D7\u5C40\u306E\u516C\u958B\u9375\u8A3C\u660E\u66F8"},
+                "[-tsacert <alias>]          \u30BF\u30A4\u30E0\u30B9\u30BF\u30F3\u30D7\u5C40\u306E\u516C\u958B\u30AD\u30FC\u8A3C\u660E\u66F8"},
         {".tsapolicyid.tsapolicyid.for.Timestamping.Authority",
                 "[-tsapolicyid <oid>]        \u30BF\u30A4\u30E0\u30B9\u30BF\u30F3\u30D7\u5C40\u306ETSAPolicyID"},
         {".tsadigestalg.algorithm.of.digest.data.in.timestamping.request",
@@ -162,8 +162,8 @@
         {"history.nobk", "- \u7F72\u540D\u95A2\u9023\u30D5\u30A1\u30A4\u30EBMETA-INF/%s.SF\u306E\u30D6\u30ED\u30C3\u30AF\u30FB\u30D5\u30A1\u30A4\u30EB\u304C\u3042\u308A\u307E\u305B\u3093"},
 
         {"with.weak", "%s (\u5F31)"},
-        {"key.bit", "%d\u30D3\u30C3\u30C8\u9375"},
-        {"key.bit.weak", "%d\u30D3\u30C3\u30C8\u9375(\u5F31)"},
+        {"key.bit", "%d\u30D3\u30C3\u30C8\u30FB\u30AD\u30FC"},
+        {"key.bit.weak", "%d\u30D3\u30C3\u30C8\u30FB\u30AD\u30FC(\u5F31)"},
         {"unknown.size", "\u4E0D\u660E\u30B5\u30A4\u30BA"},
 
         {"jarsigner.", "jarsigner: "},
@@ -185,7 +185,7 @@
         {"unable.to.instantiate.keystore.class.",
                 "\u30AD\u30FC\u30B9\u30C8\u30A2\u30FB\u30AF\u30E9\u30B9\u306E\u30A4\u30F3\u30B9\u30BF\u30F3\u30B9\u3092\u751F\u6210\u3067\u304D\u307E\u305B\u3093: "},
         {"Certificate.chain.not.found.for.alias.alias.must.reference.a.valid.KeyStore.key.entry.containing.a.private.key.and",
-                "\u6B21\u306E\u8A3C\u660E\u66F8\u30C1\u30A7\u30FC\u30F3\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093: {0}\u3002{1}\u306F\u3001\u79D8\u5BC6\u9375\u304A\u3088\u3073\u5BFE\u5FDC\u3059\u308B\u516C\u958B\u9375\u8A3C\u660E\u66F8\u30C1\u30A7\u30FC\u30F3\u3092\u542B\u3080\u6709\u52B9\u306AKeyStore\u9375\u30A8\u30F3\u30C8\u30EA\u3092\u53C2\u7167\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002"},
+                "\u6B21\u306E\u8A3C\u660E\u66F8\u30C1\u30A7\u30FC\u30F3\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093: {0}\u3002{1}\u306F\u3001\u79D8\u5BC6\u30AD\u30FC\u304A\u3088\u3073\u5BFE\u5FDC\u3059\u308B\u516C\u958B\u30AD\u30FC\u8A3C\u660E\u66F8\u30C1\u30A7\u30FC\u30F3\u3092\u542B\u3080\u6709\u52B9\u306AKeyStore\u30AD\u30FC\u30FB\u30A8\u30F3\u30C8\u30EA\u3092\u53C2\u7167\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002"},
         {"File.specified.by.certchain.does.not.exist",
                 "-certchain\u3067\u6307\u5B9A\u3055\u308C\u3066\u3044\u308B\u30D5\u30A1\u30A4\u30EB\u306F\u5B58\u5728\u3057\u307E\u305B\u3093"},
         {"Cannot.restore.certchain.from.file.specified",
@@ -195,12 +195,12 @@
         {"found.non.X.509.certificate.in.signer.s.chain",
                 "\u7F72\u540D\u8005\u306E\u9023\u9396\u5185\u3067\u975EX.509\u8A3C\u660E\u66F8\u304C\u691C\u51FA\u3055\u308C\u307E\u3057\u305F"},
         {"incomplete.certificate.chain", "\u4E0D\u5B8C\u5168\u306A\u8A3C\u660E\u66F8\u30C1\u30A7\u30FC\u30F3"},
-        {"Enter.key.password.for.alias.", "{0}\u306E\u9375\u30D1\u30B9\u30EF\u30FC\u30C9\u3092\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044: "},
+        {"Enter.key.password.for.alias.", "{0}\u306E\u30AD\u30FC\u30FB\u30D1\u30B9\u30EF\u30FC\u30C9\u3092\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044: "},
         {"unable.to.recover.key.from.keystore",
-                "\u30AD\u30FC\u30B9\u30C8\u30A2\u304B\u3089\u9375\u3092\u5FA9\u5143\u3067\u304D\u307E\u305B\u3093"},
+                "\u30AD\u30FC\u30B9\u30C8\u30A2\u304B\u3089\u30AD\u30FC\u3092\u5FA9\u5143\u3067\u304D\u307E\u305B\u3093"},
         {"key.associated.with.alias.not.a.private.key",
-                "{0}\u3068\u95A2\u9023\u4ED8\u3051\u3089\u308C\u305F\u9375\u306F\u3001\u79D8\u5BC6\u9375\u3067\u306F\u3042\u308A\u307E\u305B\u3093"},
-        {"you.must.enter.key.password", "\u9375\u30D1\u30B9\u30EF\u30FC\u30C9\u3092\u5165\u529B\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059"},
+                "{0}\u3068\u95A2\u9023\u4ED8\u3051\u3089\u308C\u305F\u30AD\u30FC\u306F\u3001\u79D8\u5BC6\u30AD\u30FC\u3067\u306F\u3042\u308A\u307E\u305B\u3093"},
+        {"you.must.enter.key.password", "\u30AD\u30FC\u30FB\u30D1\u30B9\u30EF\u30FC\u30C9\u3092\u5165\u529B\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059"},
         {"unable.to.read.password.", "\u30D1\u30B9\u30EF\u30FC\u30C9\u3092\u8AAD\u307F\u8FBC\u3081\u307E\u305B\u3093: "},
         {"certificate.is.valid.from", "\u8A3C\u660E\u66F8\u306F{0}\u304B\u3089{1}\u307E\u3067\u6709\u52B9\u3067\u3059"},
         {"certificate.expired.on", "\u8A3C\u660E\u66F8\u306F{0}\u306B\u5931\u52B9\u3057\u307E\u3057\u305F"},
@@ -217,7 +217,7 @@
                 "\u30BF\u30A4\u30E0\u30B9\u30BF\u30F3\u30D7\u5C40\u304B\u3089\u306E\u30EC\u30B9\u30DD\u30F3\u30B9\u304C\u3042\u308A\u307E\u305B\u3093\u3002\u30D5\u30A1\u30A4\u30A2\u30A6\u30A9\u30FC\u30EB\u3092\u4ECB\u3057\u3066\u63A5\u7D9A\u3059\u308B\u3068\u304D\u306F\u3001\u5FC5\u8981\u306B\u5FDC\u3058\u3066HTTP\u307E\u305F\u306FHTTPS\u30D7\u30ED\u30AD\u30B7\u3092\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044\u3002jarsigner\u306B\u6B21\u306E\u30AA\u30D7\u30B7\u30E7\u30F3\u3092\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044:"},
         {"or", "\u307E\u305F\u306F"},
         {"Certificate.not.found.for.alias.alias.must.reference.a.valid.KeyStore.entry.containing.an.X.509.public.key.certificate.for.the",
-                "\u8A3C\u660E\u66F8\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093\u3067\u3057\u305F: {0}\u3002{1}\u306F\u30BF\u30A4\u30E0\u30B9\u30BF\u30F3\u30D7\u5C40\u306EX.509\u516C\u958B\u9375\u8A3C\u660E\u66F8\u304C\u542B\u307E\u308C\u3066\u3044\u308B\u6709\u52B9\u306AKeyStore\u30A8\u30F3\u30C8\u30EA\u3092\u53C2\u7167\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002"},
+                "\u8A3C\u660E\u66F8\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093\u3067\u3057\u305F: {0}\u3002{1}\u306F\u30BF\u30A4\u30E0\u30B9\u30BF\u30F3\u30D7\u5C40\u306EX.509\u516C\u958B\u30AD\u30FC\u8A3C\u660E\u66F8\u304C\u542B\u307E\u308C\u3066\u3044\u308B\u6709\u52B9\u306AKeyStore\u30A8\u30F3\u30C8\u30EA\u3092\u53C2\u7167\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002"},
         {"using.an.alternative.signing.mechanism",
                 "\u4EE3\u66FF\u7F72\u540D\u30E1\u30AB\u30CB\u30BA\u30E0\u306E\u4F7F\u7528"},
         {"entry.was.signed.on", "\u30A8\u30F3\u30C8\u30EA\u306F{0}\u306B\u7F72\u540D\u3055\u308C\u307E\u3057\u305F"},
@@ -277,7 +277,7 @@
         {"The.1.algorithm.specified.for.the.2.option.is.considered.a.security.risk.",
                 "%1$s\u30A2\u30EB\u30B4\u30EA\u30BA\u30E0(%2$s\u30AA\u30D7\u30B7\u30E7\u30F3\u306B\u6307\u5B9A)\u306F\u3001\u30BB\u30AD\u30E5\u30EA\u30C6\u30A3\u30FB\u30EA\u30B9\u30AF\u3068\u307F\u306A\u3055\u308C\u307E\u3059\u3002"},
         {"The.1.signing.key.has.a.keysize.of.2.which.is.considered.a.security.risk.",
-                "%1$s\u7F72\u540D\u9375\u306B\u306F\u3001\u30BB\u30AD\u30E5\u30EA\u30C6\u30A3\u30FB\u30EA\u30B9\u30AF\u3068\u307F\u306A\u3055\u308C\u308B%2$d\u306E\u9375\u30B5\u30A4\u30BA\u304C\u3042\u308A\u307E\u3059\u3002"},
+                "%1$s\u7F72\u540D\u30AD\u30FC\u306B\u306F\u3001\u30BB\u30AD\u30E5\u30EA\u30C6\u30A3\u30FB\u30EA\u30B9\u30AF\u3068\u307F\u306A\u3055\u308C\u308B%2$d\u306E\u30AD\u30FC\u30FB\u30B5\u30A4\u30BA\u304C\u3042\u308A\u307E\u3059\u3002"},
         {"This.jar.contains.entries.whose.certificate.chain.is.invalid.reason.1",
                  "\u3053\u306Ejar\u306B\u306F\u3001\u8A3C\u660E\u66F8\u30C1\u30A7\u30FC\u30F3\u304C\u7121\u52B9\u306A\u30A8\u30F3\u30C8\u30EA\u304C\u542B\u307E\u308C\u3066\u3044\u307E\u3059\u3002\u7406\u7531: %s"},
         {"This.jar.contains.entries.whose.tsa.certificate.chain.is.invalid.reason.1",
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/IndexRedirectWriter.java	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/IndexRedirectWriter.java	Tue Jan 15 10:55:26 2019 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved.
  * 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,6 +40,8 @@
 import jdk.javadoc.internal.doclets.toolkit.util.DocPath;
 import jdk.javadoc.internal.doclets.toolkit.util.DocPaths;
 
+import java.util.Collections;
+
 /**
  * Writes a file that tries to redirect to an alternate page.
  * The redirect uses JavaScript, if enabled, falling back on
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/resources/search.js	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/resources/search.js	Tue Jan 15 10:55:26 2019 -0800
@@ -55,7 +55,7 @@
             return ui.item.m + slash;
         } else if ((ui.item.category === catTypes && ui.item.p) || ui.item.category === catMembers) {
             $.each(packageSearchIndex, function(index, item) {
-                if (ui.item.p == item.l) {
+                if (item.m && ui.item.p == item.l) {
                     urlPrefix = item.m + slash;
                 }
             });
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/resources/standard_ja.properties	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/resources/standard_ja.properties	Tue Jan 15 10:55:26 2019 -0800
@@ -93,6 +93,7 @@
 doclet.Interfaces=\u30A4\u30F3\u30BF\u30D5\u30A7\u30FC\u30B9
 doclet.Enclosing_Class=\u542B\u307E\u308C\u3066\u3044\u308B\u30AF\u30E9\u30B9:
 doclet.Enclosing_Interface=\u542B\u307E\u308C\u3066\u3044\u308B\u30A4\u30F3\u30BF\u30D5\u30A7\u30FC\u30B9:
+doclet.System_Property=\u30B7\u30B9\u30C6\u30E0\u30FB\u30D7\u30ED\u30D1\u30C6\u30A3
 doclet.Window_Source_title=\u30BD\u30FC\u30B9\u30FB\u30B3\u30FC\u30C9
 doclet.Window_Help_title=API\u30D8\u30EB\u30D7
 
@@ -122,7 +123,6 @@
 doclet.help.index.body={0}\u306B\u306F\u3001\u3059\u3079\u3066\u306E\u30AF\u30E9\u30B9\u3001\u30A4\u30F3\u30BF\u30D5\u30A7\u30FC\u30B9\u3001\u30B3\u30F3\u30B9\u30C8\u30E9\u30AF\u30BF\u3001\u30E1\u30BD\u30C3\u30C9\u304A\u3088\u3073\u30D5\u30A3\u30FC\u30EB\u30C9\u306E\u30A2\u30EB\u30D5\u30A1\u30D9\u30C3\u30C8\u9806\u306E\u30A4\u30F3\u30C7\u30C3\u30AF\u30B9\u3068\u3001\u3059\u3079\u3066\u306E\u30D1\u30C3\u30B1\u30FC\u30B8\u304A\u3088\u3073\u3059\u3079\u3066\u306E\u30AF\u30E9\u30B9\u306E\u30EA\u30B9\u30C8\u304C\u542B\u307E\u308C\u307E\u3059\u3002
 doclet.help.frames.head=\u30D5\u30EC\u30FC\u30E0/\u30D5\u30EC\u30FC\u30E0\u306A\u3057
 doclet.help.frames.body=\u3053\u308C\u3089\u306E\u30EA\u30F3\u30AF\u306FHTML\u30D5\u30EC\u30FC\u30E0\u306E\u8868\u793A\u3068\u975E\u8868\u793A\u3092\u5207\u308A\u66FF\u3048\u307E\u3059\u3002\u3059\u3079\u3066\u306E\u30DA\u30FC\u30B8\u306F\u30D5\u30EC\u30FC\u30E0\u3042\u308A\u3067\u3082\u3001\u30D5\u30EC\u30FC\u30E0\u306A\u3057\u3067\u3082\u8868\u793A\u3067\u304D\u307E\u3059\u3002
-doclet.help.all_classes.body={0}\u30EA\u30F3\u30AF\u306B\u306F\u3001\u3059\u3079\u3066\u306E\u30AF\u30E9\u30B9\u304A\u3088\u3073\u30A4\u30F3\u30BF\u30D5\u30A7\u30FC\u30B9(\u975Estatic\u306E\u30CD\u30B9\u30C8\u3055\u308C\u305F\u578B\u3092\u9664\u304F)\u304C\u8868\u793A\u3055\u308C\u307E\u3059\u3002
 doclet.help.serial_form.body=\u76F4\u5217\u5316\u53EF\u80FD\u307E\u305F\u306F\u5916\u90E8\u5316\u53EF\u80FD\u306A\u5404\u30AF\u30E9\u30B9\u306F\u3001\u76F4\u5217\u5316\u30D5\u30A3\u30FC\u30EB\u30C9\u3068\u30E1\u30BD\u30C3\u30C9\u306E\u8AAC\u660E\u3092\u542B\u307F\u307E\u3059\u3002\u3053\u306E\u60C5\u5831\u306F\u3001API\u3092\u4F7F\u7528\u3059\u308B\u958B\u767A\u8005\u3067\u306F\u306A\u304F\u3001\u518D\u5B9F\u88C5\u3092\u884C\u3046\u62C5\u5F53\u8005\u306B\u5F79\u7ACB\u3061\u307E\u3059\u3002\u30CA\u30D3\u30B2\u30FC\u30B7\u30E7\u30F3\u30FB\u30D0\u30FC\u306B\u30EA\u30F3\u30AF\u304C\u306A\u3044\u5834\u5408\u3001\u76F4\u5217\u5316\u3055\u308C\u305F\u30AF\u30E9\u30B9\u306B\u79FB\u52D5\u3057\u3066\u3001\u30AF\u30E9\u30B9\u8A18\u8FF0\u306E\u300C\u95A2\u9023\u9805\u76EE\u300D\u30BB\u30AF\u30B7\u30E7\u30F3\u306B\u3042\u308B\u300C\u76F4\u5217\u5316\u3055\u308C\u305F\u5F62\u5F0F\u300D\u3092\u30AF\u30EA\u30C3\u30AF\u3059\u308B\u3053\u3068\u306B\u3088\u308A\u3001\u3053\u306E\u60C5\u5831\u3092\u8868\u793A\u3067\u304D\u307E\u3059\u3002
 doclet.help.constants.body={0}\u30DA\u30FC\u30B8\u306B\u306F\u3001static final\u30D5\u30A3\u30FC\u30EB\u30C9\u3068\u305D\u306E\u5024\u306E\u30EA\u30B9\u30C8\u304C\u3042\u308A\u307E\u3059\u3002
 doclet.help.footnote=\u3053\u306E\u30D8\u30EB\u30D7\u30FB\u30D5\u30A1\u30A4\u30EB\u306F\u3001\u6A19\u6E96doclet\u306B\u3088\u3063\u3066\u751F\u6210\u3055\u308C\u305FAPI\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u306B\u9069\u7528\u3055\u308C\u307E\u3059\u3002
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/resources/standard_zh_CN.properties	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/resources/standard_zh_CN.properties	Tue Jan 15 10:55:26 2019 -0800
@@ -93,6 +93,7 @@
 doclet.Interfaces=\u63A5\u53E3
 doclet.Enclosing_Class=\u5C01\u95ED\u7C7B:
 doclet.Enclosing_Interface=\u5C01\u95ED\u63A5\u53E3:
+doclet.System_Property=\u7CFB\u7EDF\u5C5E\u6027
 doclet.Window_Source_title=\u6E90\u4EE3\u7801
 doclet.Window_Help_title=API \u5E2E\u52A9
 
@@ -122,7 +123,6 @@
 doclet.help.index.body={0} \u5305\u542B\u6240\u6709\u7C7B\u3001\u63A5\u53E3\u3001\u6784\u9020\u5668\u3001\u65B9\u6CD5\u548C\u5B57\u6BB5\u7684\u6309\u5B57\u6BCD\u987A\u5E8F\u6392\u5217\u7684\u7D22\u5F15\uFF0C\u4EE5\u53CA\u6240\u6709\u7A0B\u5E8F\u5305\u548C\u6240\u6709\u7C7B\u7684\u5217\u8868\u3002
 doclet.help.frames.head=\u6846\u67B6/\u65E0\u6846\u67B6
 doclet.help.frames.body=\u8FD9\u4E9B\u94FE\u63A5\u7528\u4E8E\u663E\u793A\u548C\u9690\u85CF HTML \u6846\u67B6\u3002\u6240\u6709\u9875\u9762\u5747\u5177\u6709\u6709\u6846\u67B6\u548C\u65E0\u6846\u67B6\u4E24\u79CD\u663E\u793A\u65B9\u5F0F\u3002
-doclet.help.all_classes.body={0}\u94FE\u63A5\u663E\u793A\u6240\u6709\u7C7B\u548C\u63A5\u53E3 (\u9664\u4E86\u975E\u9759\u6001\u5D4C\u5957\u7C7B\u578B)\u3002
 doclet.help.serial_form.body=\u6BCF\u4E2A\u53EF\u5E8F\u5217\u5316\u6216\u53EF\u5916\u90E8\u5316\u7684\u7C7B\u90FD\u6709\u5176\u5E8F\u5217\u5316\u5B57\u6BB5\u548C\u65B9\u6CD5\u7684\u8BF4\u660E\u3002\u6B64\u4FE1\u606F\u5BF9\u91CD\u65B0\u5B9E\u73B0\u8005\u6709\u7528, \u800C\u5BF9\u4F7F\u7528 API \u7684\u5F00\u53D1\u8005\u5219\u6CA1\u6709\u4EC0\u4E48\u7528\u5904\u3002\u5C3D\u7BA1\u5BFC\u822A\u680F\u4E2D\u6CA1\u6709\u94FE\u63A5, \u4F46\u60A8\u53EF\u4EE5\u901A\u8FC7\u4E0B\u5217\u65B9\u5F0F\u83B7\u53D6\u6B64\u4FE1\u606F: \u8F6C\u81F3\u4EFB\u4F55\u5E8F\u5217\u5316\u7C7B, \u7136\u540E\u5355\u51FB\u7C7B\u8BF4\u660E\u7684 "\u53E6\u8BF7\u53C2\u9605" \u90E8\u5206\u4E2D\u7684 "\u5E8F\u5217\u5316\u8868\u683C"\u3002
 doclet.help.constants.body={0}\u9875\u9762\u5217\u51FA\u4E86\u9759\u6001\u6700\u7EC8\u5B57\u6BB5\u53CA\u5176\u503C\u3002
 doclet.help.footnote=\u6B64\u5E2E\u52A9\u6587\u4EF6\u9002\u7528\u4E8E\u7531\u6807\u51C6 doclet \u751F\u6210\u7684 API \u6587\u6863\u3002
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/resources/doclets_ja.properties	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/resources/doclets_ja.properties	Tue Jan 15 10:55:26 2019 -0800
@@ -104,7 +104,7 @@
 doclet.Constructor_Summary=\u30B3\u30F3\u30B9\u30C8\u30E9\u30AF\u30BF\u306E\u6982\u8981
 doclet.Method_Summary=\u30E1\u30BD\u30C3\u30C9\u306E\u6982\u8981
 doclet.Interfaces=\u30A4\u30F3\u30BF\u30D5\u30A7\u30FC\u30B9
-doclet.Enums=\u5217\u6319\u578B
+doclet.Enums=\u5217\u6319
 doclet.AnnotationTypes=\u6CE8\u91C8\u578B
 doclet.Exceptions=\u4F8B\u5916
 doclet.Errors=\u30A8\u30E9\u30FC
@@ -122,7 +122,7 @@
 doclet.AnnotationType=\u6CE8\u91C8\u578B
 doclet.annotationtype=\u6CE8\u91C8\u578B
 doclet.annotationtypes=\u6CE8\u91C8\u578B
-doclet.Enum=\u5217\u6319\u578B
+doclet.Enum=\u5217\u6319
 doclet.enum=\u5217\u6319
 doclet.enums=\u5217\u6319
 doclet.interface=\u30A4\u30F3\u30BF\u30D5\u30A7\u30FC\u30B9
@@ -211,13 +211,15 @@
 doclet.Annotation_Type_Required_Member=\u5FC5\u9808\u8981\u7D20
 doclet.Annotation_Type_Member=\u6CE8\u91C8\u578B\u8981\u7D20
 doclet.Enum_Constant=\u5217\u6319\u578B\u5B9A\u6570
-doclet.Class=\u30AF\u30E9\u30B9
 doclet.Description=\u8AAC\u660E
 doclet.ConstantField=\u5B9A\u6570\u30D5\u30A3\u30FC\u30EB\u30C9
 doclet.Value=\u5024
+doclet.linkMismatch_PackagedLinkedtoModule=\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u5316\u3057\u3088\u3046\u3068\u3057\u3066\u3044\u308B\u30B3\u30FC\u30C9\u3067\u306F\u540D\u524D\u306E\u306A\u3044\u30E2\u30B8\u30E5\u30FC\u30EB\u306E\u30D1\u30C3\u30B1\u30FC\u30B8\u304C\u4F7F\u7528\u3055\u308C\u3066\u3044\u307E\u3059\u304C\u3001{0}\u3067\u5B9A\u7FA9\u3055\u308C\u3066\u3044\u308B\u30D1\u30C3\u30B1\u30FC\u30B8\u306F\u540D\u524D\u306E\u3042\u308B\u30E2\u30B8\u30E5\u30FC\u30EB\u306E\u3082\u306E\u3067\u3059\u3002
+doclet.linkMismatch_ModuleLinkedtoPackage=\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u5316\u3057\u3088\u3046\u3068\u3057\u3066\u3044\u308B\u30B3\u30FC\u30C9\u3067\u306F\u30E2\u30B8\u30E5\u30FC\u30EB\u304C\u4F7F\u7528\u3055\u308C\u3066\u3044\u307E\u3059\u304C\u3001{0}\u3067\u5B9A\u7FA9\u3055\u308C\u3066\u3044\u308B\u30D1\u30C3\u30B1\u30FC\u30B8\u306F\u540D\u524D\u306E\u306A\u3044\u30E2\u30B8\u30E5\u30FC\u30EB\u306E\u3082\u306E\u3067\u3059\u3002
+doclet.urlRedirected=URL {0}\u306F{1}\u306B\u30EA\u30C0\u30A4\u30EC\u30AF\u30C8\u3055\u308C\u307E\u3057\u305F -- \u30B3\u30DE\u30F3\u30C9\u30E9\u30A4\u30F3\u30FB\u30AA\u30D7\u30B7\u30E7\u30F3\u3092\u66F4\u65B0\u3057\u3066\u3053\u306E\u8B66\u544A\u3092\u8868\u793A\u3057\u306A\u3044\u3088\u3046\u306B\u3057\u3066\u304F\u3060\u3055\u3044\u3002
 
 #Documentation for Enums
-doclet.enum_values_doc.fullbody=\u3053\u306E\u5217\u6319\u578B\u306E\u5B9A\u6570\u3092\u542B\u3080\u914D\u5217\u3092\u5BA3\u8A00\u3055\u308C\u3066\u3044\u308B\u9806\u5E8F\u3067\u8FD4\u3057\u307E\u3059\u3002\n\u3053\u306E\u30E1\u30BD\u30C3\u30C9\u306F\u6B21\u306E\u3088\u3046\u306B\u3057\u3066\u5B9A\u6570\u3092\u53CD\u5FA9\u3059\u308B\u305F\u3081\u306B\n\u4F7F\u7528\u3067\u304D\u307E\u3059:\n<pre>\nfor ({0} c : {0}.values())\n&nbsp;   System.out.println(c);\n</pre>
+doclet.enum_values_doc.fullbody=\u3053\u306E\u5217\u6319\u578B\u306E\u5B9A\u6570\u3092\u542B\u3080\u914D\u5217\u3092\u5BA3\u8A00\u3055\u308C\u3066\u3044\u308B\u9806\u5E8F\u3067\n\u8FD4\u3057\u307E\u3059\u3002
 
 doclet.enum_values_doc.return=\u3053\u306E\u5217\u6319\u578B\u306E\u5B9A\u6570\u3092\u542B\u3080\u3001\u5BA3\u8A00\u3055\u308C\u3066\u3044\u308B\u9806\u5E8F\u3067\u306E\u914D\u5217
 
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/resources/doclets_zh_CN.properties	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/resources/doclets_zh_CN.properties	Tue Jan 15 10:55:26 2019 -0800
@@ -211,13 +211,15 @@
 doclet.Annotation_Type_Required_Member=\u5FC5\u9700\u7684\u5143\u7D20
 doclet.Annotation_Type_Member=\u6CE8\u91CA\u7C7B\u578B\u5143\u7D20
 doclet.Enum_Constant=\u679A\u4E3E\u5E38\u91CF
-doclet.Class=\u7C7B
 doclet.Description=\u8BF4\u660E
 doclet.ConstantField=\u5E38\u91CF\u5B57\u6BB5
 doclet.Value=\u503C
+doclet.linkMismatch_PackagedLinkedtoModule=\u8FDB\u884C\u6587\u6863\u5316\u7684\u4EE3\u7801\u4F7F\u7528\u4E86\u672A\u547D\u540D\u6A21\u5757\u4E2D\u7684\u7A0B\u5E8F\u5305\uFF0C\u4F46\u5728 {0} \u4E2D\u5B9A\u4E49\u7684\u7A0B\u5E8F\u5305\u5728\u547D\u540D\u6A21\u5757\u4E2D\u3002
+doclet.linkMismatch_ModuleLinkedtoPackage=\u8FDB\u884C\u6587\u6863\u5316\u7684\u4EE3\u7801\u4F7F\u7528\u4E86\u6A21\u5757\uFF0C\u4F46\u5728 {0} \u4E2D\u5B9A\u4E49\u7684\u7A0B\u5E8F\u5305\u5728\u672A\u547D\u540D\u6A21\u5757\u4E2D\u3002
+doclet.urlRedirected=URL {0} \u5DF2\u91CD\u5B9A\u5411\u5230 {1} \u2014 \u66F4\u65B0\u547D\u4EE4\u884C\u9009\u9879\u4EE5\u9690\u85CF\u6B64\u8B66\u544A\u3002
 
 #Documentation for Enums
-doclet.enum_values_doc.fullbody=\u6309\u7167\u58F0\u660E\u8BE5\u679A\u4E3E\u7C7B\u578B\u7684\u5E38\u91CF\u7684\u987A\u5E8F, \u8FD4\u56DE\n\u5305\u542B\u8FD9\u4E9B\u5E38\u91CF\u7684\u6570\u7EC4\u3002\u8BE5\u65B9\u6CD5\u53EF\u7528\u4E8E\u8FED\u4EE3\n\u5E38\u91CF, \u5982\u4E0B\u6240\u793A:\n<pre>\nfor ({0} c : {0}.values())\n&nbsp;   System.out.println(c);\n</pre>
+doclet.enum_values_doc.fullbody=\u6309\u7167\u58F0\u660E\u8BE5\u679A\u4E3E\u7C7B\u578B\u7684\u5E38\u91CF\u7684\u987A\u5E8F, \n\u8FD4\u56DE\u4E00\u4E2A\u5305\u542B\u8FD9\u4E9B\u5E38\u91CF\u7684\u6570\u7EC4\u3002
 
 doclet.enum_values_doc.return=\u6309\u7167\u58F0\u660E\u8BE5\u679A\u4E3E\u7C7B\u578B\u7684\u5E38\u91CF\u7684\u987A\u5E8F\u8FD4\u56DE\u7684\u5305\u542B\u8FD9\u4E9B\u5E38\u91CF\u7684\u6570\u7EC4
 
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/Extern.java	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/Extern.java	Tue Jan 15 10:55:26 2019 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -45,6 +45,8 @@
 import javax.tools.Diagnostic.Kind;
 import javax.tools.DocumentationTool;
 
+import com.sun.tools.javac.code.Flags;
+import com.sun.tools.javac.code.Symbol.ModuleSymbol;
 import jdk.javadoc.doclet.Reporter;
 import jdk.javadoc.internal.doclets.toolkit.BaseConfiguration;
 import jdk.javadoc.internal.doclets.toolkit.Resources;
@@ -276,6 +278,12 @@
             ModuleElement moduleElement = utils.containingModule(packageElement);
             Map<String, Item> pkgMap = packageItems.get(utils.getModuleName(moduleElement));
             item = (pkgMap != null) ? pkgMap.get(utils.getPackageName(packageElement)) : null;
+            if (item == null && isAutomaticModule(moduleElement)) {
+                pkgMap = packageItems.get(utils.getModuleName(null));
+                if (pkgMap != null) {
+                    item = pkgMap.get(utils.getPackageName(packageElement));
+                }
+            }
         }
         return item;
     }
@@ -420,12 +428,25 @@
                             path), null);
                 }
             } else if (moduleName == null) {
-                throw new Fault(resources.getText("doclet.linkMismatch_ModuleLinkedtoPackage",
-                        path), null);
+                // suppress the error message in the case of automatic modules
+                if (!isAutomaticModule(me)) {
+                    throw new Fault(resources.getText("doclet.linkMismatch_ModuleLinkedtoPackage",
+                            path), null);
+                }
             }
         }
     }
 
+    // The following should be replaced by a new method such as Elements.isAutomaticModule
+    private boolean isAutomaticModule(ModuleElement me) {
+        if (me == null) {
+            return false;
+        } else {
+            ModuleSymbol msym = (ModuleSymbol) me;
+            return (msym.flags() & Flags.AUTOMATIC_MODULE) != 0;
+        }
+    }
+
     public boolean isUrl (String urlCandidate) {
         try {
             new URL(urlCandidate);
--- a/src/jdk.jdeps/share/classes/com/sun/tools/jdeps/resources/jdeps_ja.properties	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/jdk.jdeps/share/classes/com/sun/tools/jdeps/resources/jdeps_ja.properties	Tue Jan 15 10:55:26 2019 -0800
@@ -20,6 +20,10 @@
 
 main.opt.require=\  --require <module-name>       \u6307\u5B9A\u306E\u30E2\u30B8\u30E5\u30FC\u30EB\u540D\u306B\u4E00\u81F4\u3059\u308B\u4F9D\u5B58\u6027\u3092\u691C\u51FA\u3057\u307E\u3059\n                                 (\u8907\u6570\u56DE\u6307\u5B9A\u53EF\u80FD)\u3002--package\u3001\n                                --regex\u3001--require\u306F\u76F8\u4E92\u306B\u6392\u4ED6\u7684\u3067\u3059\u3002
 
+main.opt.missing-deps=\  --missing-deps                \u6B20\u843D\u3057\u3066\u3044\u308B\u4F9D\u5B58\u6027\u3092\u691C\u51FA\u3057\u307E\u3059\u3002  \u3053\u306E\u30AA\u30D7\u30B7\u30E7\u30F3\u306F\n                                -p\u3001-e\u304A\u3088\u3073-s\u30AA\u30D7\u30B7\u30E7\u30F3\u3068\u4E00\u7DD2\u306B\u4F7F\u7528\u3067\u304D\u307E\u305B\u3093\u3002
+
+main.opt.ignore-missing-deps=\  --ignore-missing-deps         \u6B20\u843D\u3057\u3066\u3044\u308B\u4F9D\u5B58\u6027\u3092\u7121\u8996\u3057\u307E\u3059\u3002
+
 main.opt.include=\n\u5206\u6790\u5BFE\u8C61\u30AF\u30E9\u30B9\u3092\u30D5\u30A3\u30EB\u30BF\u3059\u308B\u30AA\u30D7\u30B7\u30E7\u30F3:\n  -include <regex>              \u30D1\u30BF\u30FC\u30F3\u306B\u4E00\u81F4\u3059\u308B\u30AF\u30E9\u30B9\u306B\u5206\u6790\u3092\u5236\u9650\u3057\u307E\u3059\n                                     \u3053\u306E\u30AA\u30D7\u30B7\u30E7\u30F3\u3092\u6307\u5B9A\u3059\u308B\u3068\u3001\u5206\u6790\u5BFE\u8C61\u30AF\u30E9\u30B9\u306E\n                                     \u30EA\u30B9\u30C8\u304C\u30D5\u30A3\u30EB\u30BF\u3055\u308C\u307E\u3059\u3002\u30D1\u30BF\u30FC\u30F3\u3092\u4F9D\u5B58\u6027\u306B\n                                     \u9069\u7528\u3059\u308B-p\u304A\u3088\u3073-e\u3068\u4E00\u7DD2\u306B\u4F7F\u7528\u3067\u304D\u307E\u3059
 
 main.opt.P=\  -P       -profile             \u30D1\u30C3\u30B1\u30FC\u30B8\u3092\u542B\u3080\u30D7\u30ED\u30D5\u30A1\u30A4\u30EB\u3092\u8868\u793A\u3057\u307E\u3059
@@ -34,9 +38,11 @@
 
 main.opt.add-modules=\  --add-modules <module-name>[,<module-name>...]\n                                \u5206\u6790\u7528\u306B\u30E2\u30B8\u30E5\u30FC\u30EB\u3092\u30EB\u30FC\u30C8\u30FB\u30BB\u30C3\u30C8\u306B\u8FFD\u52A0\u3057\u307E\u3059
 
-main.opt.R=\  -R       -recursive           \u3059\u3079\u3066\u306E\u30E9\u30F3\u30BF\u30A4\u30E0\u4F9D\u5B58\u6027\u3092\u518D\u5E30\u7684\u306B\u30C8\u30E9\u30D0\u30FC\u30B9\u3057\u307E\u3059\u3002\n                                -R\u30AA\u30D7\u30B7\u30E7\u30F3\u306F-filter:none\u3092\u610F\u5473\u3057\u307E\u3059\u3002-p\u3001-e\u3001-f\n                                \u30AA\u30D7\u30B7\u30E7\u30F3\u304C\u6307\u5B9A\u3055\u308C\u3066\u3044\u308B\u5834\u5408\u3001\u4E00\u81F4\u3059\u308B\u4F9D\u5B58\u6027\u306E\u307F\n                                \u5206\u6790\u3055\u308C\u307E\u3059\u3002
+main.opt.R=\  -R\n  --recursive                   \u3059\u3079\u3066\u306E\u30E9\u30F3\u30BF\u30A4\u30E0\u4F9D\u5B58\u6027\u3092\u518D\u5E30\u7684\u306B\u30C8\u30E9\u30D0\u30FC\u30B9\u3057\u307E\u3059\u3002\n                                -R\u30AA\u30D7\u30B7\u30E7\u30F3\u306F-filter:none\u3092\u610F\u5473\u3057\u307E\u3059\u3002-p\u3001-e\u3001-f\n                                \u30AA\u30D7\u30B7\u30E7\u30F3\u304C\u6307\u5B9A\u3055\u308C\u3066\u3044\u308B\u5834\u5408\u3001\u4E00\u81F4\u3059\u308B\u4F9D\u5B58\u6027\u306E\u307F\n                                \u5206\u6790\u3055\u308C\u307E\u3059\u3002
 
-main.opt.I=\  -I       --inverse            \u4ED6\u306E\u6307\u5B9A\u306E\u30AA\u30D7\u30B7\u30E7\u30F3\u3054\u3068\u306B\u4F9D\u5B58\u6027\u3092\u5206\u6790\u3057\u3001\n                                \u4E00\u81F4\u3059\u308B\u30CE\u30FC\u30C9\u306B\u76F4\u63A5\u304A\u3088\u3073\u9593\u63A5\u7684\u306B\u4F9D\u5B58\u3059\u308B\n                                \u3059\u3079\u3066\u306E\u30A2\u30FC\u30C6\u30A3\u30D5\u30A1\u30AF\u30C8\u3092\u691C\u51FA\u3057\u307E\u3059\u3002\n                                \u3053\u308C\u306F\u3001\u30B3\u30F3\u30D1\u30A4\u30EB\u6642\u306E\u8868\u793A\u5206\u6790\n                                \u304A\u3088\u3073\u51FA\u529B\u4F9D\u5B58\u6027\u30B5\u30DE\u30EA\u30FC\u306E\u9006\u306B\u76F8\u5F53\u3057\u307E\u3059\u3002\n                                \u3053\u306E\u30AA\u30D7\u30B7\u30E7\u30F3\u306F--require\u3001--package\u307E\u305F\u306F--regex\u30AA\u30D7\u30B7\u30E7\u30F3\u3068\n                                \u4E00\u7DD2\u306B\u4F7F\u7528\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002
+main.opt.no-recursive=\  --no-recursive                \u4F9D\u5B58\u6027\u3092\u518D\u5E30\u7684\u306B\u30C8\u30E9\u30D0\u30FC\u30B9\u3057\u307E\u305B\u3093\u3002
+
+main.opt.I=\  -I\n  --inverse                     \u4ED6\u306E\u6307\u5B9A\u306E\u30AA\u30D7\u30B7\u30E7\u30F3\u3054\u3068\u306B\u4F9D\u5B58\u6027\u3092\u5206\u6790\u3057\u3001\n                                \u4E00\u81F4\u3059\u308B\u30CE\u30FC\u30C9\u306B\u76F4\u63A5\u304A\u3088\u3073\u9593\u63A5\u7684\u306B\u4F9D\u5B58\u3059\u308B\n                                \u3059\u3079\u3066\u306E\u30A2\u30FC\u30C6\u30A3\u30D5\u30A1\u30AF\u30C8\u3092\u691C\u51FA\u3057\u307E\u3059\u3002\n                                \u3053\u308C\u306F\u3001\u30B3\u30F3\u30D1\u30A4\u30EB\u6642\u306E\u8868\u793A\u5206\u6790\n                                \u304A\u3088\u3073\u51FA\u529B\u4F9D\u5B58\u6027\u30B5\u30DE\u30EA\u30FC\u306E\u9006\u306B\u76F8\u5F53\u3057\u307E\u3059\u3002\n                                \u3053\u306E\u30AA\u30D7\u30B7\u30E7\u30F3\u306F--require\u3001--package\u307E\u305F\u306F--regex\u30AA\u30D7\u30B7\u30E7\u30F3\u3068\n                                \u4E00\u7DD2\u306B\u4F7F\u7528\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002
 
 main.opt.compile-time=\  --compile-time                \u63A8\u79FB\u7684\u306A\u4F9D\u5B58\u6027\u306E\u30B3\u30F3\u30D1\u30A4\u30EB\u6642\u306E\u8868\u793A\n                                \u4F8B: -R\u30AA\u30D7\u30B7\u30E7\u30F3\u306E\u30B3\u30F3\u30D1\u30A4\u30EB\u6642\u306E\u8868\u793A\u3002\n                                \u4ED6\u306E\u6307\u5B9A\u306E\u30AA\u30D7\u30B7\u30E7\u30F3\u3054\u3068\u306B\u4F9D\u5B58\u6027\u3092\u5206\u6790\u3057\u307E\u3059\n                                \u4F9D\u5B58\u6027\u304C\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u3001JAR\u30D5\u30A1\u30A4\u30EB\u307E\u305F\u306F\u30E2\u30B8\u30E5\u30FC\u30EB\u304B\u3089\n                                \u691C\u51FA\u3055\u308C\u305F\u5834\u5408\u3001\u305D\u306E\u5305\u542B\u3059\u308B\u30A2\u30FC\u30AB\u30A4\u30D6\u306E\n                                \u3059\u3079\u3066\u306E\u30AF\u30E9\u30B9\u304C\u5206\u6790\u3055\u308C\u307E\u3059\u3002
 
@@ -54,7 +60,7 @@
 
 main.opt.jdkinternals=\  -jdkinternals\n  --jdk-internals               JDK\u5185\u90E8API\u306E\u30AF\u30E9\u30B9\u30EC\u30D9\u30EB\u306E\u4F9D\u5B58\u6027\u3092\u691C\u51FA\u3057\u307E\u3059\u3002\n                                \u30C7\u30D5\u30A9\u30EB\u30C8\u3067\u306F\u3001-include\u30AA\u30D7\u30B7\u30E7\u30F3\u3092\u6307\u5B9A\u3057\u306A\u3044\u3068\u3001\n                                --class-path\u306E\u3059\u3079\u3066\u306E\u30AF\u30E9\u30B9\u3068\u5165\u529B\u30D5\u30A1\u30A4\u30EB\u3092\u5206\u6790\u3057\u307E\u3059\u3002\n                                \u3053\u306E\u30AA\u30D7\u30B7\u30E7\u30F3\u306F-p\u3001-e\u304A\u3088\u3073-s\u30AA\u30D7\u30B7\u30E7\u30F3\u3068\u4E00\u7DD2\u306B\n                                \u4F7F\u7528\u3067\u304D\u307E\u305B\u3093\u3002\n                                \u8B66\u544A: JDK\u5185\u90E8API\u306F\u3001\u30A2\u30AF\u30BB\u30B9\u3067\u304D\u306A\u304F\u306A\u308A\u307E\u3059\u3002
 
-main.opt.list-deps=\  --list-deps                   \u30E2\u30B8\u30E5\u30FC\u30EB\u4F9D\u5B58\u6027\u3092\u30EA\u30B9\u30C8\u3057\u307E\u3059\u3002\u53C2\u7167\u3055\u308C\u3066\u3044\u308B\n                                \u5834\u5408\u3001\u4EFB\u610F\u306EJDK\u5185\u90E8API\u30D1\u30C3\u30B1\u30FC\u30B8\u3082\u51FA\u529B\u3057\u307E\u3059\u3002\n                                \u3053\u306E\u30AA\u30D7\u30B7\u30E7\u30F3\u3067\u306F\u3001\u30AF\u30E9\u30B9\u30D1\u30B9\u306E\u4F9D\u5B58\u6027\u3084\u898B\u3064\u3051\u3089\u308C\u306A\u3044\n                                \u4F9D\u5B58\u6027\u306F\u8868\u793A\u3055\u308C\u307E\u305B\u3093\u3002
+main.opt.list-deps=\  --list-deps                   \u30E2\u30B8\u30E5\u30FC\u30EB\u4F9D\u5B58\u6027\u3092\u30EA\u30B9\u30C8\u3057\u307E\u3059\u3002\u53C2\u7167\u3055\u308C\u3066\u3044\u308B\n                                \u5834\u5408\u3001\u4EFB\u610F\u306E\u5185\u90E8API\u30D1\u30C3\u30B1\u30FC\u30B8\u3082\u51FA\u529B\u3057\u307E\u3059\u3002\n                                \u3053\u306E\u30AA\u30D7\u30B7\u30E7\u30F3\u306F\u3001\u53C2\u7167\u3055\u308C\u3066\u3044\u308B\u5834\u5408\u3001\u30AF\u30E9\u30B9\u30D1\u30B9\u3068\n                                \u30E2\u30B8\u30E5\u30FC\u30EB\u30FB\u30D1\u30B9\u306E\u30E9\u30A4\u30D6\u30E9\u30EA\u3092\u63A8\u79FB\u7684\u306B\u5206\u6790\u3057\u307E\u3059\u3002\n                                \u975E\u63A8\u79FB\u7684\u306A\u4F9D\u5B58\u6027\u306E\u5206\u6790\u306B\u306F\u3001--no-recursive\u30AA\u30D7\u30B7\u30E7\u30F3\n                                \u3092\u4F7F\u7528\u3057\u3066\u304F\u3060\u3055\u3044\u3002
 
 main.opt.list-reduced-deps=\  --list-reduced-deps           --list-deps\u3068\u540C\u3058\u3067\u3059\u304C\u3001\u30E2\u30B8\u30E5\u30FC\u30EB\u30FB\u30B0\u30E9\u30D5\n                                \u304B\u3089\u542B\u610F\u3055\u308C\u305F\u8AAD\u53D6\u308A\u30A8\u30C3\u30B8\u3092\u30EA\u30B9\u30C8\u3057\u307E\u305B\u3093\u3002\n                                \u30E2\u30B8\u30E5\u30FC\u30EBM1\u304CM2\u3092\u8AAD\u307F\u53D6\u308A\u3001M2\u304CM3\u3067\u306E\u63A8\u79FB\u3092\n                                \u5FC5\u8981\u3068\u3059\u308B\u5834\u5408\u3001M3\u3092\u8AAD\u307F\u53D6\u308BM1\u306F\u542B\u610F\u3055\u308C\u3066\u304A\u308A\u3001\n                                \u30B0\u30E9\u30D5\u306B\u306F\u8868\u793A\u3055\u308C\u307E\u305B\u3093\u3002
 
@@ -86,6 +92,8 @@
 err.multirelease.option.notfound={0}\u306F\u30DE\u30EB\u30C1\u30EA\u30EA\u30FC\u30B9jar\u30D5\u30A1\u30A4\u30EB\u3067\u3059\u304C--multi-release\u30AA\u30D7\u30B7\u30E7\u30F3\u304C\u8A2D\u5B9A\u3055\u308C\u3066\u3044\u307E\u305B\u3093
 err.multirelease.version.associated=\u30AF\u30E9\u30B9{0}\u306F\u3059\u3067\u306B\u30D0\u30FC\u30B8\u30E7\u30F3{1}\u306B\u95A2\u9023\u4ED8\u3051\u3089\u308C\u3066\u3044\u307E\u3059\u3002\u30D0\u30FC\u30B8\u30E7\u30F3{2}\u306E\u8FFD\u52A0\u3092\u8A66\u307F\u307E\u3059
 err.multirelease.jar.malformed=\u4E0D\u6B63\u306A\u30DE\u30EB\u30C1\u30EA\u30EA\u30FC\u30B9jar\u3001{0}\u3001\u4E0D\u6B63\u306A\u30A8\u30F3\u30C8\u30EA: {1}
+err.cant.list.module.deps=\u30E2\u30B8\u30E5\u30FC\u30EB\u30FB\u30D1\u30B9\u3068\u30AF\u30E9\u30B9\u30D1\u30B9\u304B\u3089\u306E\u4F9D\u5B58\u6027\u304C\u6B20\u843D\u3057\u3066\u3044\u307E\u3059\u3002\n\u3053\u306E\u30A8\u30E9\u30FC\u3092\u6291\u6B62\u3059\u308B\u306B\u306F\u3001--ignore-missing-deps\u3092\u4F7F\u7528\u3057\u3066\u7D9A\u884C\u3057\u3066\u304F\u3060\u3055\u3044\u3002
+
 warn.invalid.arg=\u30D1\u30B9\u304C\u5B58\u5728\u3057\u307E\u305B\u3093: {0}
 warn.skipped.entry={0}
 warn.split.package=\u5206\u5272\u30D1\u30C3\u30B1\u30FC\u30B8: {0} {1}
--- a/src/jdk.jdeps/share/classes/com/sun/tools/jdeps/resources/jdeps_zh_CN.properties	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/jdk.jdeps/share/classes/com/sun/tools/jdeps/resources/jdeps_zh_CN.properties	Tue Jan 15 10:55:26 2019 -0800
@@ -20,6 +20,10 @@
 
 main.opt.require=\  --require <\u6A21\u5757\u540D\u79F0>          \u67E5\u627E\u4E0E\u7ED9\u5B9A\u6A21\u5757\u540D\u79F0\u5339\u914D\u7684\n                                \u88AB\u4F9D\u8D56\u5BF9\u8C61 (\u53EF\u591A\u6B21\u6307\u5B9A)\u3002--package,\n                                --regex, --requires \u662F\u4E92\u65A5\u7684\u3002
 
+main.opt.missing-deps=\  --missing-deps                \u67E5\u627E\u7F3A\u5C11\u7684\u88AB\u4F9D\u8D56\u5BF9\u8C61\u3002\u6B64\u9009\u9879\n                                \u4E0D\u80FD\u4E0E -p\u3001-e \u548C -s \u9009\u9879\u4E00\u8D77\u4F7F\u7528\u3002
+
+main.opt.ignore-missing-deps=\  --ignore-missing-deps         \u5FFD\u7565\u7F3A\u5C11\u7684\u88AB\u4F9D\u8D56\u5BF9\u8C61\u3002
+
 main.opt.include=\n\u7528\u4E8E\u7B5B\u9009\u8981\u5206\u6790\u7684\u7C7B\u7684\u9009\u9879:\n  -include <\u6B63\u5219\u8868\u8FBE\u5F0F>             \u5C06\u5206\u6790\u9650\u5236\u4E3A\u4E0E\u6A21\u5F0F\u5339\u914D\u7684\u7C7B\n                                    \u6B64\u9009\u9879\u7B5B\u9009\u8981\u5206\u6790\u7684\u7C7B\u7684\u5217\u8868\u3002\n                                    \u5B83\u53EF\u4EE5\u4E0E\u5411\u88AB\u4F9D\u8D56\u5BF9\u8C61\u5E94\u7528\u6A21\u5F0F\u7684\n                                -p \u548C -e \u7ED3\u5408\u4F7F\u7528
 
 main.opt.P=\  -P       -profile             \u663E\u793A\u5305\u542B\u7A0B\u5E8F\u5305\u7684\u914D\u7F6E\u6587\u4EF6
@@ -34,9 +38,11 @@
 
 main.opt.add-modules=\  --add-modules <\u6A21\u5757\u540D\u79F0>[,<\u6A21\u5757\u540D\u79F0>...]\n                                \u5C06\u6A21\u5757\u6DFB\u52A0\u5230\u6839\u96C6\u4EE5\u8FDB\u884C\u5206\u6790
 
-main.opt.R=\  -R       -recursive           \u9012\u5F52\u904D\u5386\u6240\u6709\u8FD0\u884C\u65F6\u88AB\u4F9D\u8D56\u5BF9\u8C61\u3002\n                                -R \u9009\u9879\u8868\u793A -filter:none\u3002\u5982\u679C\n                                \u6307\u5B9A\u4E86 -p, -e, -f \u9009\u9879, \u5219\u53EA\u5206\u6790\n                                \u5339\u914D\u7684\u88AB\u4F9D\u8D56\u5BF9\u8C61\u3002
+main.opt.R=\  -R\n  --recursive                   \u9012\u5F52\u904D\u5386\u6240\u6709\u8FD0\u884C\u65F6\u88AB\u4F9D\u8D56\u5BF9\u8C61\u3002\n                                -R \u9009\u9879\u8868\u793A -filter:none\u3002\u5982\u679C\u6307\u5B9A\u4E86 -p\u3001\n                                -e\u3001-f \u9009\u9879\uFF0C\u5219\u53EA\u5206\u6790\n                                \u5339\u914D\u7684\u88AB\u4F9D\u8D56\u5BF9\u8C61\u3002
 
-main.opt.I=\  -I       --inverse            \u6839\u636E\u5176\u4ED6\u6307\u5B9A\u9009\u9879\u5206\u6790\u88AB\u4F9D\u8D56\u5BF9\u8C61,\n                                \u7136\u540E\u67E5\u627E\u76F4\u63A5\u548C\u95F4\u63A5\u4F9D\u8D56\u4E8E\u5339\u914D\n                                \u8282\u70B9\u7684\u6240\u6709 Artifact\u3002\n                                \u8FD9\u76F8\u5F53\u4E8E\u7F16\u8BD1\u65F6\u89C6\u56FE\u5206\u6790\u7684\n                                \u9006\u5411, \u8F93\u51FA\u88AB\u4F9D\u8D56\u5BF9\u8C61\u6982\u8981\u3002\n                                \u6B64\u9009\u9879\u5FC5\u987B\u4E0E --require, \n                                --package \u6216 --regex \u9009\u9879\u4E00\u8D77\u4F7F\u7528\u3002
+main.opt.no-recursive=\  --no-recursive                \u4E0D\u9012\u5F52\u904D\u5386\u88AB\u4F9D\u8D56\u5BF9\u8C61\u3002
+
+main.opt.I=\  -I\n  --inverse                     \u6839\u636E\u5176\u4ED6\u6307\u5B9A\u9009\u9879\u5206\u6790\u88AB\u4F9D\u8D56\u5BF9\u8C61,\n                                \u7136\u540E\u67E5\u627E\u76F4\u63A5\u548C\u95F4\u63A5\u4F9D\u8D56\u4E8E\u5339\u914D\n                                \u8282\u70B9\u7684\u6240\u6709 Artifact\u3002\n                                \u8FD9\u76F8\u5F53\u4E8E\u7F16\u8BD1\u65F6\u89C6\u56FE\u5206\u6790\u7684\n                                \u9006\u5411, \u8F93\u51FA\u88AB\u4F9D\u8D56\u5BF9\u8C61\u6982\u8981\u3002\n                                \u6B64\u9009\u9879\u5FC5\u987B\u4E0E --require, \n                                --package \u6216 --regex \u9009\u9879\u4E00\u8D77\u4F7F\u7528\u3002
 
 main.opt.compile-time=\  --compile-time                \u8FC7\u6E21\u88AB\u4F9D\u8D56\u5BF9\u8C61\u7684\u7F16\u8BD1\u65F6\u89C6\u56FE,\n                                \u4F8B\u5982 -R \u9009\u9879\u7684\u7F16\u8BD1\u65F6\u89C6\u56FE\u3002\n                                \u6839\u636E\u5176\u4ED6\u6307\u5B9A\u9009\u9879\u5206\u6790\u88AB\u4F9D\u8D56\u5BF9\u8C61\n                                \u5982\u679C\u4ECE\u76EE\u5F55, JAR \u6587\u4EF6\u6216\u6A21\u5757\u4E2D\n                                \u627E\u5230\u88AB\u4F9D\u8D56\u5BF9\u8C61, \u5219\u5C06\u5206\u6790\n                                \u8BE5\u6240\u5728\u6863\u6848\u4E2D\u7684\u6240\u6709\u7C7B\u3002
 
@@ -54,7 +60,7 @@
 
 main.opt.jdkinternals=\  -jdkinternals\n  --jdk-internals               \u5728 JDK \u5185\u90E8 API \u4E0A\u67E5\u627E\u7C7B\u7EA7\u522B\u7684\u88AB\u4F9D\u8D56\u5BF9\u8C61\u3002\n                                \u9664\u975E\u6307\u5B9A\u4E86 -include \u9009\u9879, \u5426\u5219\u9ED8\u8BA4\u60C5\u51B5\u4E0B,\n                                \u5B83\u5206\u6790 --class-path \u4E0A\u7684\u6240\u6709\u7C7B\u548C\u8F93\u5165\u6587\u4EF6\u3002\n                                \u6B64\u9009\u9879\u4E0D\u80FD\u4E0E -p, -e \u548C -s \u9009\u9879\n                                \u4E00\u8D77\u4F7F\u7528\u3002\n                                \u8B66\u544A: \u65E0\u6CD5\u8BBF\u95EE JDK \u5185\u90E8 API\u3002
 
-main.opt.list-deps=\  --list-deps                   \u5217\u51FA\u6A21\u5757\u88AB\u4F9D\u8D56\u5BF9\u8C61\u3002\u5B83\u8FD8\u4F1A\u8F93\u51FA\n                                \u4EFB\u610F JDK \u5185\u90E8 API \u7A0B\u5E8F\u5305 (\u5982\u679C\u5F15\u7528)\u3002\n                                \u6B64\u9009\u9879\u4E0D\u663E\u793A\u7C7B\u8DEF\u5F84\u4E0A\u6216\u672A\u627E\u5230\u7684\n                                \u88AB\u4F9D\u8D56\u5BF9\u8C61\u3002
+main.opt.list-deps=\  --list-deps                   \u5217\u51FA\u6A21\u5757\u7684\u88AB\u4F9D\u8D56\u5BF9\u8C61\u3002\u5B83\u8FD8\u4F1A\n                                \u8F93\u51FA\u5185\u90E8 API \u7A0B\u5E8F\u5305\uFF08\u5982\u679C\u5F15\u7528\uFF09\u3002\n                                \u6B64\u9009\u9879\u4F20\u9012\u5206\u6790\u7C7B\u8DEF\u5F84\u548C\u6A21\u5757\u8DEF\u5F84\n                                \u4E0A\u7684\u5E93\uFF08\u5982\u679C\u5F15\u7528\uFF09\u3002\n                                \u5C06 --no-recursive \u9009\u9879\u7528\u4E8E\n                                \u88AB\u4F9D\u8D56\u5BF9\u8C61\u7684\u975E\u4F20\u9012\u5206\u6790\u3002
 
 main.opt.list-reduced-deps=\  --list-reduced-deps           \u4E0E --list-deps \u76F8\u540C, \u4E0D\u5217\u51FA\n                                \u6A21\u5757\u56FE\u4E2D\u7684\u9690\u5F0F\u8BFB\u53D6\u7EF4\u8FB9\u3002\n                                \u5982\u679C\u6A21\u5757 M1 \u8BFB\u53D6 M2, \u5E76\u4E14 M2 \u9700\u8981\n                                M3 \u4E0A\u7684\u8FC7\u6E21, \u5219 M1 \u9690\u5F0F\u8BFB\u53D6 M3\n                                \u5E76\u4E14\u4E0D\u5728\u56FE\u4E2D\u663E\u793A\u3002
 
@@ -86,6 +92,8 @@
 err.multirelease.option.notfound={0} \u662F\u591A\u53D1\u884C\u7248 jar \u6587\u4EF6, \u4F46\u672A\u8BBE\u7F6E --multi-release \u9009\u9879
 err.multirelease.version.associated=\u7C7B {0} \u5DF2\u4E0E\u7248\u672C {1} \u5173\u8054, \u6B63\u5728\u5C1D\u8BD5\u6DFB\u52A0\u7248\u672C {2}
 err.multirelease.jar.malformed=\u683C\u5F0F\u9519\u8BEF\u7684\u591A\u53D1\u884C\u7248 jar, {0}, \u9519\u8BEF\u6761\u76EE: {1}
+err.cant.list.module.deps=\u6A21\u5757\u8DEF\u5F84\u548C\u7C7B\u8DEF\u5F84\u4E2D\u7F3A\u5C11\u88AB\u4F9D\u8D56\u5BF9\u8C61\u3002\n\u8981\u9690\u85CF\u6B64\u9519\u8BEF\uFF0C\u8BF7\u4F7F\u7528 --ignore-missing-deps \u7EE7\u7EED\u3002
+
 warn.invalid.arg=\u8DEF\u5F84\u4E0D\u5B58\u5728: {0}
 warn.skipped.entry={0}
 warn.split.package=\u62C6\u5206\u7A0B\u5E8F\u5305: {0} {1}
--- a/src/jdk.jshell/share/classes/jdk/internal/jshell/tool/ConsoleIOContext.java	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/jdk.jshell/share/classes/jdk/internal/jshell/tool/ConsoleIOContext.java	Tue Jan 15 10:55:26 2019 -0800
@@ -59,6 +59,7 @@
 import jdk.internal.org.jline.keymap.KeyMap;
 import jdk.internal.org.jline.reader.Binding;
 import jdk.internal.org.jline.reader.EOFError;
+import jdk.internal.org.jline.reader.EndOfFileException;
 import jdk.internal.org.jline.reader.History;
 import jdk.internal.org.jline.reader.LineReader;
 import jdk.internal.org.jline.reader.LineReader.Option;
@@ -184,7 +185,7 @@
             it.set(current);
         }
 
-        historyLoad = Instant.now();
+        historyLoad = Instant.MIN;
         loadHistory.forEach(line -> reader.getHistory().add(historyLoad, line));
 
         in = reader;
@@ -200,6 +201,8 @@
             return in.readLine(firstLinePrompt);
         } catch (UserInterruptException ex) {
             throw (InputInterruptedException) new InputInterruptedException().initCause(ex);
+        } catch (EndOfFileException ex) {
+            return null;
         }
     }
 
@@ -1212,6 +1215,7 @@
                     while ((r = input.read()) != (-1)) {
                         processInputByte(r);
                     }
+                    slaveInput.close();
                 } catch (IOException ex) {
                     throw new IllegalStateException(ex);
                 }
--- a/src/jdk.jshell/share/classes/jdk/internal/jshell/tool/resources/l10n.properties	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/jdk.jshell/share/classes/jdk/internal/jshell/tool/resources/l10n.properties	Tue Jan 15 10:55:26 2019 -0800
@@ -187,12 +187,12 @@
 jshell.console.resolvable = \nThe identifier is resolvable in this context.
 jshell.console.no.candidate = \nNo candidate fully qualified names found to import.
 jshell.console.incomplete = \nResults may be incomplete; try again later for complete results.
-jshell.console.erroneous = \nIncomplete or erroneous. A single valid expression or statement must proceed Shift-<tab> m.
-jshell.console.exprstmt = \nA single valid expression or statement must proceed Shift-<tab> m.
-jshell.console.empty = \nEmpty entry. A single valid expression or statement must proceed Shift-<tab> m..
+jshell.console.erroneous = \nIncomplete or erroneous. A single valid expression or statement must precede Shift+Tab m.
+jshell.console.exprstmt = \nA single valid expression or statement must precede Shift+Tab m.
+jshell.console.empty = \nEmpty entry. A single valid expression or statement must precede Shift+Tab m.
 
 jshell.fix.wrong.shortcut =\
-Unexpected character after Shift-Tab.\n\
+Unexpected character after Shift+Tab.\n\
 Use "i" for auto-import, "v" for variable creation, or "m" for method creation.\n\
 For more information see:\n\
    /help shortcuts
@@ -579,92 +579,92 @@
 This support is similar to readline/editline with simple emacs-like bindings.\n\
 There are also jshell tool specific key sequences.\n\
 \n\
---- Line and history navigation ---\n\
-\n\
-Return\n\t\
-  Enters the current snippet\n\
-Left-arrow or Ctrl+B\n\t\
-  Moves backward one character\n\
-Right-arrow or Ctrl+F\n\t\
-  Moves forward one character\n\
-Up-arrow or Ctrl+P\n\t\
-  Moves up one line, backward through history\n\
-Down arrow or Ctrl+N\n\t\
-  Moves down one line, forward through history\n\
-Ctrl+A\n\t\
-  Moves to the beginning of the line\n\
-Ctrl+E\n\t\
-  Moves to the end of the line\n\
-Meta+B\n\t\
-  Moves backward one word\n\
-Meta+F\n\t\
-  Moves forward one word\n\
-Ctrl+R\n\t\
+Line and history navigation:\n\
+\n\t\
+Return\n\t\t\
+  Enters the current snippet\n\t\
+Left-arrow or Ctrl+B\n\t\t\
+  Moves backward one character\n\t\
+Right-arrow or Ctrl+F\n\t\t\
+  Moves forward one character\n\t\
+Up-arrow or Ctrl+P\n\t\t\
+  Moves up one line, backward through history\n\t\
+Down arrow or Ctrl+N\n\t\t\
+  Moves down one line, forward through history\n\t\
+Ctrl+A\n\t\t\
+  Moves to the beginning of the line\n\t\
+Ctrl+E\n\t\t\
+  Moves to the end of the line\n\t\
+Meta+B\n\t\t\
+  Moves backward one word\n\t\
+Meta+F\n\t\t\
+  Moves forward one word\n\t\
+Ctrl+R\n\t\t\
   Search backward through history\n\
 \n\
 \n\
---- Line and history basic editing ---\n\
-\n\
-Meta+Return or Ctrl+Return (depending on platform)\n\t\
-  Insert a new line in snippet\n\
-Ctrl+_ (underscore may require shift key) or Ctrl+X then Ctrl+U\n\t\
-  Undo edit - repeat to undo more edits\n\
-Delete\n\t\
-  Deletes the character at or after the cursor, depending on the operating system\n\
-Backspace\n\t\
-  Deletes the character before the cursor\n\
-Ctrl+K\n\t\
-  Deletes the text from the cursor to the end of the line\n\
-Meta+D\n\t\
-  Deletes the text from the cursor to the end of the word\n\
-Ctrl+W\n\t\
-  Deletes the text from the cursor to the previous white space\n\
-Ctrl+Y\n\t\
-  Pastes the most recently deleted text into the line\n\
-Meta+Y\n\t\
-  After Ctrl+Y, Meta+Y cycles through previously deleted text\n\
-Ctrl+X then Ctrl+K\n\t\
+Line and history basic editing:\n\
+\n\t\
+Meta+Return or Ctrl+Return (depending on platform)\n\t\t\
+  Insert a new line in snippet\n\t\
+Ctrl+_ (underscore may require the Shift key) or Ctrl+X then Ctrl+U\n\t\t\
+  Undo edit - repeat to undo more edits\n\t\
+Delete\n\t\t\
+  Deletes the character at or after the cursor, depending on the operating system\n\t\
+Backspace\n\t\t\
+  Deletes the character before the cursor\n\t\
+Ctrl+K\n\t\t\
+  Deletes the text from the cursor to the end of the line\n\t\
+Meta+D\n\t\t\
+  Deletes the text from the cursor to the end of the word\n\t\
+Ctrl+W\n\t\t\
+  Deletes the text from the cursor to the previous white space\n\t\
+Ctrl+Y\n\t\t\
+  Pastes the most recently deleted text into the line\n\t\
+Meta+Y\n\t\t\
+  After Ctrl+Y, Meta+Y cycles through previously deleted text\n\t\
+Ctrl+X then Ctrl+K\n\t\t\
   Delete whole snippet\n\
 \n\
 \n\
---- Shortcuts for jshell tool ---\n\
-\n\
+Shortcuts for jshell tool:\n\
+\n\t\
 For details, see: /help shortcuts\n\
-\n\
-Tab\n\t\
-  Complete Java identifier or jshell command\n\
-Shift+Tab then v\n\t\
-  Convert expression to variable declaration\n\
-Shift+Tab then m\n\t\
-  Convert statement to method declaration\n\
-Shift+Tab then i\n\t\
-  Add imports for this identifier\n\
+\n\t\
+Tab\n\t\t\
+  Complete Java identifier or jshell command\n\t\
+Shift+Tab then v\n\t\t\
+  Convert expression to variable declaration\n\t\
+Shift+Tab then m\n\t\t\
+  Convert statement to method declaration\n\t\
+Shift+Tab then i\n\t\t\
+  Add imports for this identifier\n\t\
 \n\
 \n\
---- More line and history editing ---\n\
-\n\
-Ctrl+L\n\t\
-  Clear screen and reprint snippet\n\
-Ctrl+U\n\t\
-  Kill whole line\n\
-Ctrl+T\n\t\
-  Transpose characters\n\
-Ctrl+X then Ctrl+B\n\t\
-  Navigate to matching bracket, parenthesis, ...\n\
-Ctrl+X then =\n\t\
-  Enter show current character position mode\n\
-Ctrl+X then Ctrl+O\n\t\
-  Toggle overwrite characters vs insert characters\n\
-Meta+C\n\t\
-  Capitalize word\n\
-Meta+U\n\t\
-  Convert word to uppercase\n\
-Meta+L\n\t\
-  Convert word to lowercase\n\
-Meta+0 through Meta+9 then key\n\t\
+More line and history editing:\n\
+\n\t\
+Ctrl+L\n\t\t\
+  Clear screen and reprint snippet\n\t\
+Ctrl+U\n\t\t\
+  Kill whole line\n\t\
+Ctrl+T\n\t\t\
+  Transpose characters\n\t\
+Ctrl+X then Ctrl+B\n\t\t\
+  Navigate to matching bracket, parenthesis, ...\n\t\
+Ctrl+X then =\n\t\t\
+  Enter show current character position mode\n\t\
+Ctrl+X then Ctrl+O\n\t\t\
+  Toggle overwrite characters vs insert characters\n\t\
+Meta+C\n\t\t\
+  Capitalize word\n\t\
+Meta+U\n\t\t\
+  Convert word to uppercase\n\t\
+Meta+L\n\t\t\
+  Convert word to lowercase\n\t\
+Meta+0 through Meta+9 then key\n\t\t\
   Repeat the specified number of times\n\
 \n\
-Where, for example, "Ctrl+A" means hold down the control key and press A.\n\
+Where, for example, "Ctrl+A" means hold down the Control key and press A.\n\
 Where "Meta" is "Alt" on many keyboards.\n\
 Line editing support is derived from JLine 3.
 
@@ -672,26 +672,34 @@
 information access, and automatic code generation
 help.shortcuts =\
 Supported shortcuts include:\n\
-\n\
-<tab>\n\t\t\
+\n\t\
+Tab\n\t\t\
         After entering the first few letters of a Java identifier,\n\t\t\
-        a jshell tool command, or, in some cases, a jshell tool command argument,\n\t\t\
-        press the <tab> key to complete the input.\n\t\t\
-        If there is more than one completion, then possible completions will be shown.\n\t\t\
-        Will show documentation if available and appropriate.\n\n\
-Shift-<tab> v\n\t\t\
-        After a complete expression, hold down <shift> while pressing <tab>,\n\t\t\
-        then release and press "v", the expression will be converted to\n\t\t\
-        a variable declaration whose type is based on the type of the expression.\n\n\
-Shift-<tab> m\n\t\t\
-        After a complete expression or statement, hold down <shift> while pressing <tab>,\n\t\t\
-        then release and press "m", the expression or statement will be converted to\n\t\t\
-        a method declaration. If an expression, the return type is based on the type\n\t\t\
-        of the expression.\n\n\
-Shift-<tab> i\n\t\t\
-        After an unresolvable identifier, hold down <shift> while pressing <tab>,\n\t\t\
-        then release and press "i", and the jshell tool will propose possible imports\n\t\t\
-        which will resolve the identifier based on the content of the specified classpath.
+        a jshell tool command, or, in some cases, a jshell tool\n\t\t\
+        command argument, press the Tab key to complete the input.\n\t\t\
+        If there is more than one completion, then possible completions\n\t\t\
+        will be shown.\n\t\t\
+        Another Tab will show documentation if available and appropriate.\n\n\t\
+Shift+Tab then v\n\t\t\
+        After a complete expression, hold down the Shift key while\n\t\t\
+        pressing the Tab key, then release and press the "v" key,\n\t\t\
+        the expression will be converted to a variable declaration \n\t\t\
+        whose type is based on the type of the expression.\n\n\t\
+Shift+Tab then m\n\t\t\
+        After a complete expression or statement, hold down the\n\t\t\
+        Shift key while pressing the Tab key, then release and press\n\t\t\
+        the "m" key, the expression or statement will be converted\n\t\t\
+        to a method declaration. If it is an expression, the method\n\t\t\
+        return type will be based on the type of the expression.\n\n\t\
+Shift+Tab then i\n\t\t\
+        After an unresolvable identifier, hold down the Shift key\n\t\t\
+        while pressing the Tab key, then release and press the "i" key,\n\t\t\
+        and the jshell tool will propose possible imports which will\n\t\t\
+        resolve the identifier based on the content of the specified\n\t\t\
+        classpath. Enter the digit corresponding to the desired import,\n\t\t\
+        or press the "0" key to add no imports.\n\
+\n\
+For information onother special keys see: /help keys
 
 help.context.summary = a description of the evaluation context options for /env /reload and /reset
 help.context =\
@@ -789,7 +797,7 @@
 Any number of IDs or ID ranges may be used, e.g.:  /3-7 s4 14-16 e2\n\
 See also '/help id'.\n\
 \n\
-Finally, you can search backwards through history by entering ctrl-R followed by the string to search for.
+Finally, you can search backwards through history by entering Ctrl+R followed by the string to search for.
 
 help.set._retain = \
 The '-retain' option saves a setting so that it is used in future sessions.\n\
--- a/src/jdk.jshell/share/classes/jdk/internal/jshell/tool/resources/l10n_ja.properties	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/jdk.jshell/share/classes/jdk/internal/jshell/tool/resources/l10n_ja.properties	Tue Jan 15 10:55:26 2019 -0800
@@ -171,11 +171,11 @@
 jshell.console.resolvable = \n\u8B58\u5225\u5B50\u306F\u3053\u306E\u30B3\u30F3\u30C6\u30AD\u30B9\u30C8\u3067\u89E3\u6C7A\u3067\u304D\u307E\u3059\u3002
 jshell.console.no.candidate = \n\u30A4\u30F3\u30DD\u30FC\u30C8\u3059\u308B\u5019\u88DC\u306E\u5B8C\u5168\u4FEE\u98FE\u3055\u308C\u305F\u540D\u524D\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093\u3002
 jshell.console.incomplete = \n\u7D50\u679C\u304C\u4E0D\u5B8C\u5168\u3067\u3042\u308B\u53EF\u80FD\u6027\u304C\u3042\u308A\u307E\u3059\u3002\u7D50\u679C\u3092\u5B8C\u5168\u306B\u3059\u308B\u306B\u306F\u3001\u5F8C\u3067\u518D\u8A66\u884C\u3057\u3066\u304F\u3060\u3055\u3044\u3002
-jshell.console.erroneous = \n\u4E0D\u5B8C\u5168\u307E\u305F\u306F\u30A8\u30E9\u30FC\u3002\u5358\u4E00\u306E\u6709\u52B9\u306A\u5F0F\u307E\u305F\u306F\u6587\u3067[Shift]-[Tab] m\u3092\u7D9A\u884C\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002
-jshell.console.exprstmt = \n\u5358\u4E00\u306E\u6709\u52B9\u306A\u5F0F\u307E\u305F\u306F\u6587\u3067[Shift]-[Tab] m\u3092\u7D9A\u884C\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002
-jshell.console.empty = \n\u7A7A\u306E\u30A8\u30F3\u30C8\u30EA\u3002\u5358\u4E00\u306E\u6709\u52B9\u306A\u5F0F\u307E\u305F\u306F\u6587\u3067[Shift]-[Tab] m\u3092\u7D9A\u884C\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002
+jshell.console.erroneous = \n\u4E0D\u5B8C\u5168\u307E\u305F\u306F\u30A8\u30E9\u30FC\u3002\u5358\u4E00\u306E\u6709\u52B9\u306A\u5F0F\u307E\u305F\u306F\u6587\u304C[Shift]+[Tab] m\u306B\u5148\u884C\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002
+jshell.console.exprstmt = \n\u5358\u4E00\u306E\u6709\u52B9\u306A\u5F0F\u307E\u305F\u306F\u6587\u304C[Shift]+[Tab] m\u306B\u5148\u884C\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002
+jshell.console.empty = \n\u7A7A\u306E\u30A8\u30F3\u30C8\u30EA\u3002\u5358\u4E00\u306E\u6709\u52B9\u306A\u5F0F\u307E\u305F\u306F\u6587\u304C[Shift]+[Tab] m\u306B\u5148\u884C\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002
 
-jshell.fix.wrong.shortcut =[Shift]-[Tab]\u306E\u5F8C\u306E\u6587\u5B57\u304C\u4E88\u671F\u3057\u306A\u3044\u6587\u5B57\u3067\u3059\u3002\n\u81EA\u52D5\u30A4\u30F3\u30DD\u30FC\u30C8\u306B\u306F"i"\u3001\u5909\u6570\u306E\u4F5C\u6210\u306B\u306F"v"\u3001\u30E1\u30BD\u30C3\u30C9\u306E\u4F5C\u6210\u306B\u306F"m"\u3092\u4F7F\u7528\u3057\u3066\u304F\u3060\u3055\u3044\u3002\n\u8A73\u7D30\u306F\u6B21\u3092\u53C2\u7167\u3057\u3066\u304F\u3060\u3055\u3044:\n/help shortcuts
+jshell.fix.wrong.shortcut =[Shift]+[Tab]\u306E\u5F8C\u306E\u6587\u5B57\u304C\u4E88\u671F\u3057\u306A\u3044\u6587\u5B57\u3067\u3059\u3002\n\u81EA\u52D5\u30A4\u30F3\u30DD\u30FC\u30C8\u306B\u306F"i"\u3001\u5909\u6570\u306E\u4F5C\u6210\u306B\u306F"v"\u3001\u30E1\u30BD\u30C3\u30C9\u306E\u4F5C\u6210\u306B\u306F"m"\u3092\u4F7F\u7528\u3057\u3066\u304F\u3060\u3055\u3044\u3002\n\u8A73\u7D30\u306F\u6B21\u3092\u53C2\u7167\u3057\u3066\u304F\u3060\u3055\u3044:\n/help shortcuts
 
 help.usage = \u4F7F\u7528\u65B9\u6CD5:   jshell <option>... <load-file>...\n\u4F7F\u7528\u53EF\u80FD\u306A\u30AA\u30D7\u30B7\u30E7\u30F3\u306B\u306F\u6B21\u306E\u3082\u306E\u304C\u3042\u308A\u307E\u3059:\n    --class-path <path>   \u30E6\u30FC\u30B6\u30FC\u30FB\u30AF\u30E9\u30B9\u30FB\u30D5\u30A1\u30A4\u30EB\u306E\u3042\u308B\u5834\u6240\u3092\u6307\u5B9A\u3057\u307E\u3059\n    --module-path <path>  \u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u30FB\u30E2\u30B8\u30E5\u30FC\u30EB\u306E\u3042\u308B\u5834\u6240\u3092\u6307\u5B9A\u3057\u307E\u3059\n    --add-modules <module>(,<module>)*\n                           \u89E3\u6C7A\u3059\u308B\u30E2\u30B8\u30E5\u30FC\u30EB\u3001\u307E\u305F\u306F<module>\u304CALL-MODULE-PATH\n                            \u3067\u3042\u308B\u5834\u5408\u306F\u30E2\u30B8\u30E5\u30FC\u30EB\u30FB\u30D1\u30B9\u306E\u3059\u3079\u3066\u306E\u30E2\u30B8\u30E5\u30FC\u30EB\u3092\u6307\u5B9A\u3057\u307E\u3059\n    --enable-preview      \u30B3\u30FC\u30C9\u3092\u3053\u306E\u30EA\u30EA\u30FC\u30B9\u306E\u30D7\u30EC\u30D3\u30E5\u30FC\u6A5F\u80FD\u306B\u4F9D\u5B58\u3055\u305B\u308B\u3053\u3068\u304C\u3067\u304D\u307E\u3059\n    --startup <file>      \u8D77\u52D5\u5B9A\u7FA9\u306E\u4EE3\u66FF\u3068\u3057\u3066\u5B9F\u884C\u3055\u308C\u307E\u3059\n    --no-startup          \u8D77\u52D5\u5B9A\u7FA9\u3092\u5B9F\u884C\u3057\u307E\u305B\u3093\n    --feedback <mode>     \u521D\u671F\u30D5\u30A3\u30FC\u30C9\u30D0\u30C3\u30AF\u30FB\u30E2\u30FC\u30C9\u3092\u6307\u5B9A\u3057\u307E\u3059\u3002\u30E2\u30FC\u30C9\u306F\n                            \u4E8B\u524D\u306B\u5B9A\u7FA9\u3055\u308C\u3066\u3044\u308B(silent\u3001concise\u3001normal\u307E\u305F\u306Fverbose)\u304B\u3001\n                            \u4E8B\u524D\u306B\u30E6\u30FC\u30B6\u30FC\u304C\u5B9A\u7FA9\u3067\u304D\u307E\u3059\n    -q                    \u7C21\u6F54\u306A\u30D5\u30A3\u30FC\u30C9\u30D0\u30C3\u30AF\u3002--feedback concise\u3068\u540C\u3058\n    -s                    \u975E\u5E38\u306B\u7C21\u6F54\u306A\u30D5\u30A3\u30FC\u30C9\u30D0\u30C3\u30AF\u3002--feedback silent\u3068\u540C\u3058\n    -v                    \u8A73\u7D30\u306A\u30D5\u30A3\u30FC\u30C9\u30D0\u30C3\u30AF\u3002--feedback verbose\u3068\u540C\u3058\n    -J<flag>              <flag>\u3092\u5B9F\u884C\u6642\u30B7\u30B9\u30C6\u30E0\u306B\u76F4\u63A5\u6E21\u3057\u307E\u3059\u3002\n                            \u5B9F\u884C\u6642\u30D5\u30E9\u30B0\u307E\u305F\u306F\u30D5\u30E9\u30B0\u5F15\u6570\u3054\u3068\u306B1\u3064\u306E-J\u3092\u4F7F\u7528\u3057\u307E\u3059\n    -R<flag>              <flag>\u3092\u30EA\u30E2\u30FC\u30C8\u5B9F\u884C\u6642\u30B7\u30B9\u30C6\u30E0\u306B\u6E21\u3057\u307E\u3059\u3002\n                            \u30EA\u30E2\u30FC\u30C8\u30FB\u30D5\u30E9\u30B0\u307E\u305F\u306F\u30D5\u30E9\u30B0\u5F15\u6570\u3054\u3068\u306B1\u3064\u306E-R\u3092\u4F7F\u7528\u3057\u307E\u3059\n    -C<flag>              <flag>\u3092\u30B3\u30F3\u30D1\u30A4\u30E9\u306B\u6E21\u3057\u307E\u3059\u3002\n                            \u30B3\u30F3\u30D1\u30A4\u30E9\u30FB\u30D5\u30E9\u30B0\u307E\u305F\u306F\u30D5\u30E9\u30B0\u5F15\u6570\u3054\u3068\u306B1\u3064\u306E-C\u3092\u4F7F\u7528\u3057\u307E\u3059\n    --version              \u30D0\u30FC\u30B8\u30E7\u30F3\u60C5\u5831\u3092\u51FA\u529B\u3057\u7D42\u4E86\u3057\u307E\u3059\n    --show-version        \u30D0\u30FC\u30B8\u30E7\u30F3\u60C5\u5831\u3092\u51FA\u529B\u3057\u7D9A\u884C\u3057\u307E\u3059\n    --help, -?, -h        \u6A19\u6E96\u30AA\u30D7\u30B7\u30E7\u30F3\u306E\u3053\u306E\u6982\u8981\u3092\u51FA\u529B\u3057\u7D42\u4E86\u3057\u307E\u3059\n    --help-extra, -X      \
 \u975E\u6A19\u6E96\u30AA\u30D7\u30B7\u30E7\u30F3\u306E\u30D8\u30EB\u30D7\u3092\u51FA\u529B\u3057\u7D42\u4E86\u3057\u307E\u3059\n\n\u30D5\u30A1\u30A4\u30EB\u5F15\u6570\u306B\u306F\u3001\u30D5\u30A1\u30A4\u30EB\u540D\u304B\u3001\u307E\u305F\u306F\u4E8B\u524D\u5B9A\u7FA9\u3055\u308C\u305F\u30D5\u30A1\u30A4\u30EB\u540D(DEFAULT\u3001\nPRINTING\u307E\u305F\u306FJAVASE)\u306E1\u3064\u3092\u6307\u5B9A\u3067\u304D\u307E\u3059\u3002\nload-file\u3067\u3082\u3001\u5BFE\u8A71\u578BI/O\u3092\u4F7F\u7528\u305B\u305A\u306B\u3001"-"\u3092\u6307\u5B9A\u3057\u3066\u6A19\u6E96\u5165\u529B\u3092\u793A\u3059\u3053\u3068\u304C\u3067\u304D\u307E\u3059\u3002\n\n\u8A55\u4FA1\u30B3\u30F3\u30C6\u30AD\u30B9\u30C8\u30FB\u30AA\u30D7\u30B7\u30E7\u30F3(--class-path\u3001--module-path\u3001--add-modules)\u306E\n\u8A73\u7D30\u306F\u3001\u6B21\u3092\u53C2\u7167\u3057\u3066\u304F\u3060\u3055\u3044:\n\t/help context\n\n\u30D1\u30B9\u306B\u306F\u3001\u691C\u7D22\u3059\u308B\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u3068\u30A2\u30FC\u30AB\u30A4\u30D6\u304C\u30EA\u30B9\u30C8\u3055\u308C\u307E\u3059\u3002Windows\u306E\u5834\u5408\u306F\u3001\n\u30BB\u30DF\u30B3\u30ED\u30F3(;)\u3092\u4F7F\u7528\u3057\u3066\u30D1\u30B9\u306E\u9805\u76EE\u3092\u533A\u5207\u308A\u307E\u3059\u3002\u305D\u306E\u4ED6\u306E\u30D7\u30E9\u30C3\u30C8\u30D5\u30A9\u30FC\u30E0\u3067\u306F\u3001\n\u30B3\u30ED\u30F3(:)\u3092\u4F7F\u7528\u3057\u3066\u9805\u76EE\u3092\u533A\u5207\u308A\u307E\u3059\u3002\n
@@ -268,8 +268,13 @@
 help.intro.summary = jshell\u30C4\u30FC\u30EB\u306E\u6982\u8981
 help.intro =jshell\u30C4\u30FC\u30EB\u3092\u4F7F\u7528\u3059\u308B\u3068\u3001Java\u30B3\u30FC\u30C9\u3092\u5B9F\u884C\u3057\u3066\u5373\u5EA7\u306B\u7D50\u679C\u3092\u53D6\u5F97\u3067\u304D\u307E\u3059\u3002\nint x = 8\u306A\u3069\u306EJava\u5B9A\u7FA9(\u5909\u6570\u3001\u30E1\u30BD\u30C3\u30C9\u3001\u30AF\u30E9\u30B9\u306A\u3069)\u3001\nx + x\u306A\u3069\u306EJava\u5F0F\u307E\u305F\u306FJava\u6587\u3092\u5165\u529B\u3057\u305F\u308A\u3001\n\u30A4\u30F3\u30DD\u30FC\u30C8\u3057\u305F\u308A\u3067\u304D\u307E\u3059\u3002\n\u3053\u308C\u3089\u306EJava\u30B3\u30FC\u30C9\u306E\u5C0F\u3055\u306A\u30C1\u30E3\u30F3\u30AF\u3092\u300C\u30B9\u30CB\u30DA\u30C3\u30C8\u300D\u3068\u547C\u3073\u307E\u3059\u3002\n\n\u307E\u305F\u3001/list\u306A\u3069\u306E\u5B9F\u884C\u3059\u308B\u5185\u5BB9\u3092\u7406\u89E3\u304A\u3088\u3073\u5236\u5FA1\u3067\u304D\u308Bjshell\u30C4\u30FC\u30EB\u30FB\u30B3\u30DE\u30F3\u30C9\u3082\n\u3042\u308A\u307E\u3059\n\n\u30B3\u30DE\u30F3\u30C9\u306E\u30EA\u30B9\u30C8\u3092\u53C2\u7167\u3059\u308B\u5834\u5408: /help
 
+help.keys.summary = readline\u306B\u4F3C\u305F\u5165\u529B\u7DE8\u96C6\u306E\u8AAC\u660E
+help.keys =jshell\u30C4\u30FC\u30EB\u3067\u306F\u884C\u7DE8\u96C6\u30B5\u30DD\u30FC\u30C8\u3092\u63D0\u4F9B\u3057\u3066\u304A\u308A\u3001\u30B9\u30CB\u30DA\u30C3\u30C8\u304A\u3088\u3073\u30B3\u30DE\u30F3\u30C9\n\u5185\u3092\u30CA\u30D3\u30B2\u30FC\u30C8\u3057\u3066\u7DE8\u96C6\u3067\u304D\u307E\u3059\u3002\u73FE\u5728\u306E\u30B3\u30DE\u30F3\u30C9/\u30B9\u30CB\u30DA\u30C3\u30C8\u3092\u7DE8\u96C6\u3057\u305F\u308A\u3001\n\u904E\u53BB\u306E\u30B3\u30DE\u30F3\u30C9/\u30B9\u30CB\u30DA\u30C3\u30C8\u3092\u5C65\u6B74\u304B\u3089\u53D6\u5F97\u3057\u3066\u7DE8\u96C6\u304A\u3088\u3073\u5B9F\u884C\u3067\u304D\u307E\u3059\u3002\n\u3053\u306E\u30B5\u30DD\u30FC\u30C8\u306F\u3001Emacs\u306E\u3088\u3046\u306A\u5358\u7D14\u306A\u30D0\u30A4\u30F3\u30C7\u30A3\u30F3\u30B0\u3092\u4F7F\u7528\u3057\u305Freadline/editline\u306B\u4F3C\u3066\u3044\u307E\u3059\u3002\njshell\u30C4\u30FC\u30EB\u56FA\u6709\u306E\u30AD\u30FC\u30FB\u30B7\u30FC\u30B1\u30F3\u30B9\u3082\u3042\u308A\u307E\u3059\u3002\n\n\u884C\u3068\u5C65\u6B74\u306E\u30CA\u30D3\u30B2\u30FC\u30B7\u30E7\u30F3:\n\n\t[Return]\n\t\t\u73FE\u5728\u306E\u30B9\u30CB\u30DA\u30C3\u30C8\u3092\u5165\u529B\u3057\u307E\u3059\n\t[\u2190]\u307E\u305F\u306F[Ctrl]+[B]\n\t\t1\u6587\u5B57\u524D\u306B\u623B\u308A\u307E\u3059\n\t[\u2192]\u307E\u305F\u306F[Ctrl]+[F]\n\t\t1\u6587\u5B57\u5148\u306B\u9032\u307F\u307E\u3059\n\t[\u2191]\u307E\u305F\u306F[Ctrl]+[P]\n\t\t\u5C65\u6B74\u30921\u884C\u524D(\u4E0A)\u306B\u623B\u308A\u307E\u3059\n\t[\u2193]\u307E\u305F\u306F[Ctrl]+[N]\n\t\t\u5C65\u6B74\u30921\u884C\u5148(\u4E0B)\u306B\u9032\u307F\u307E\u3059\n\t[Ctrl]+[A]\n\t\t\u884C\u306E\u5148\u982D\u306B\u79FB\u52D5\u3057\u307E\u3059\n\t[Ctrl]+[E]\n\t\t\u884C\u306E\u672B\u5C3E\u306B\u79FB\u52D5\u3057\u307E\u3059\n\t[Meta]+[B]\n\t\t1\u5358\u8A9E\u524D\u306B\u623B\u308A\u307E\u3059\n\t[Meta]+[F]\n\t\t1\u5358\u8A9E\u5148\u306B\u9032\u307F\u307E\u3059\n\t[Ctrl]+[R]\n\t\t\u5C65\u6B74\u3092\u524D\u306B\u623B\u3063\u3066\u691C\u7D22\u3057\u307E\u3059\n\n\n\u884C\u3068\u5C65\u6B74\u306E\u57FA\u672C\u7DE8\u96C6:\n\n\t[Meta]+[Return]\u307E\u305F\u306F[Ctrl]+[Return] (\u30D7\u30E9\u30C3\u30C8\u30D5\u30A9\u30FC\u30E0\u306B\u4F9D\u5B58\u3057\u307E\u3059)\n\t\t\u30B9\u30CB\u30DA\u30C3\u30C8\u306B\u65B0\u898F\u884C\u3092\u633F\u5165\u3057\u307E\u3059\n\t[Ctrl]+[_] \
+(\u30A2\u30F3\u30C0\u30FC\u30B9\u30B3\u30A2\u306F[Shift]\u30AD\u30FC\u3092\u4F7F\u7528\u3059\u308B\u3053\u3068\u304C\u3042\u308A\u307E\u3059)\u307E\u305F\u306F[Ctrl]+[X]\u3092\u62BC\u3057\u3066\u304B\u3089[Ctrl]+[U]\n\t\t\u7DE8\u96C6\u3092\u5143\u306B\u623B\u3057\u307E\u3059(\u7E70\u308A\u8FD4\u3059\u3068\u3055\u3089\u306B\u7DE8\u96C6\u3092\u5143\u306B\u623B\u3059\u3053\u3068\u304C\u3067\u304D\u307E\u3059)\n\t[Delete]\n\t\t\u30AB\u30FC\u30BD\u30EB\u306E\u4F4D\u7F6E\u307E\u305F\u306F\u305D\u306E\u5F8C\u306B\u3042\u308B\u6587\u5B57\u3092\u524A\u9664\u3057\u307E\u3059(\u30AA\u30DA\u30EC\u30FC\u30C6\u30A3\u30F3\u30B0\u30FB\u30B7\u30B9\u30C6\u30E0\u306B\u4F9D\u5B58\u3057\u307E\u3059)\n\t[Backspace]\n\t\t\u30AB\u30FC\u30BD\u30EB\u306E\u524D\u306B\u3042\u308B\u6587\u5B57\u3092\u524A\u9664\u3057\u307E\u3059\n\t[Ctrl]+[K]\n\t\t\u30AB\u30FC\u30BD\u30EB\u306E\u4F4D\u7F6E\u304B\u3089\u884C\u306E\u672B\u5C3E\u307E\u3067\u306E\u30C6\u30AD\u30B9\u30C8\u3092\u524A\u9664\u3057\u307E\u3059\n\t[Meta]+[D]\n\t\t\u30AB\u30FC\u30BD\u30EB\u306E\u4F4D\u7F6E\u304B\u3089\u5358\u8A9E\u306E\u672B\u5C3E\u307E\u3067\u306E\u30C6\u30AD\u30B9\u30C8\u3092\u524A\u9664\u3057\u307E\u3059\n\t[Ctrl]+[W]\n\t\t\u30AB\u30FC\u30BD\u30EB\u306E\u4F4D\u7F6E\u304B\u3089\u524D\u306E\u7A7A\u767D\u307E\u3067\u306E\u30C6\u30AD\u30B9\u30C8\u3092\u524A\u9664\u3057\u307E\u3059\n\t[Ctrl]+[Y]\n\t\t\u6700\u5F8C\u306B\u524A\u9664\u3057\u305F\u30C6\u30AD\u30B9\u30C8\u3092\u884C\u306B\u8CBC\u308A\u4ED8\u3051\u307E\u3059\n\t[Meta]+[Y]\n\t\t[Ctrl]+[Y]\u306E\u5F8C\u3067[Meta]+[Y]\u3092\u62BC\u3059\u3068\u3001\u904E\u53BB\u306B\u524A\u9664\u3057\u305F\u30C6\u30AD\u30B9\u30C8\u304C\u30B5\u30A4\u30AF\u30EB\u8868\u793A\u3055\u308C\u307E\u3059\n\t[Ctrl]+[X]\u3092\u62BC\u3057\u3066\u304B\u3089[Ctrl]+[K]\n\t\t\u30B9\u30CB\u30DA\u30C3\u30C8\u5168\u4F53\u3092\u524A\u9664\u3057\u307E\u3059\n\n\njshell\u30C4\u30FC\u30EB\u306E\u30B7\u30E7\u30FC\u30C8\u30AB\u30C3\u30C8:\n\n\t\u8A73\u7D30\u306F\u3001/help \
+shortcuts\u3092\u53C2\u7167\u3057\u3066\u304F\u3060\u3055\u3044\n\n\t[Tab]\n\t\tJava\u8B58\u5225\u5B50\u307E\u305F\u306Fjshell\u30B3\u30DE\u30F3\u30C9\u3092\u5B8C\u4E86\u3057\u307E\u3059\n\t[Shift]+[Tab]\u3092\u62BC\u3057\u3066\u304B\u3089[v]\n\t\t\u5F0F\u3092\u5909\u6570\u5BA3\u8A00\u306B\u5909\u63DB\u3057\u307E\u3059\n\t[Shift]+[Tab]\u3092\u62BC\u3057\u3066\u304B\u3089[m]\n\t\t\u6587\u3092\u30E1\u30BD\u30C3\u30C9\u5BA3\u8A00\u306B\u5909\u63DB\u3057\u307E\u3059\n\t[Shift]+[Tab]\u3092\u62BC\u3057\u3066\u304B\u3089[i]\n\t\t\u3053\u306E\u8B58\u5225\u5B50\u306B\u30A4\u30F3\u30DD\u30FC\u30C8\u3092\u8FFD\u52A0\u3057\u307E\u3059\n\t\n\n\u884C\u3068\u5C65\u6B74\u306E\u62E1\u5F35\u7DE8\u96C6:\n\n\t[Ctrl]+[L]\n\t\t\u753B\u9762\u3092\u30AF\u30EA\u30A2\u3057\u3066\u30B9\u30CB\u30DA\u30C3\u30C8\u3092\u518D\u51FA\u529B\u3057\u307E\u3059\n\t[Ctrl]+[U]\n\t\t\u884C\u5168\u4F53\u3092\u5F37\u5236\u7D42\u4E86\u3057\u307E\u3059\n\t[Ctrl]+[T]\n\t\t\u6587\u5B57\u3092\u7F6E\u63DB\u3057\u307E\u3059\n\t[Ctrl]+[X]\u3092\u62BC\u3057\u3066\u304B\u3089[Ctrl]+[B]\n\t\t\u4E00\u81F4\u3059\u308B\u5927\u30AB\u30C3\u30B3\u3001\u4E38\u30AB\u30C3\u30B3\u3001...\u306B\u79FB\u52D5\u3057\u307E\u3059\n\t[Ctrl]+[X]\u3092\u62BC\u3057\u3066\u304B\u3089[=]\n\t\t\u73FE\u884C\u6587\u5B57\u4F4D\u7F6E\u8868\u793A\u30E2\u30FC\u30C9\u306B\u5165\u308A\u307E\u3059\n\t[Ctrl]+[X]\u3092\u62BC\u3057\u3066\u304B\u3089[Ctrl]+[O]\n\t\t\u6587\u5B57\u306E\u4E0A\u66F8\u304D\u3068\u6587\u5B57\u306E\u633F\u5165\u3092\u5207\u308A\u66FF\u3048\u307E\u3059\n\t[Meta]+[C]\n\t\t\u5358\u8A9E\u306E\u5148\u982D\u3092\u5927\u6587\u5B57\u306B\u3057\u307E\u3059\n\t[Meta]+[U]\n\t\t\u5358\u8A9E\u3092\u5927\u6587\u5B57\u306B\u5909\u63DB\u3057\u307E\u3059\n\t[Meta]+[L]\n\t\t\u5358\u8A9E\u3092\u5C0F\u6587\u5B57\u306B\u5909\u63DB\u3057\u307E\u3059\n\t[Meta]+[0]\u304B\u3089[Meta]+[9]\u3092\u62BC\u3057\u3066\u304B\u3089\u30AD\u30FC\n\t\t\u6307\u5B9A\u3057\u305F\u56DE\u6570\u7E70\u308A\u8FD4\u3057\u307E\u3059\n\n\u305F\u3068\u3048\u3070\u3001[Ctrl]+[A]\u306F\u3001[Ctrl]\u30AD\u30FC\u3092\u62BC\u3057\u306A\u304C\u3089[A]\u3092\u62BC\u3059\u3068\u3044\u3046\u610F\u5473\u3067\u3059\u3002\n[Meta]\u306F\u3001\u591A\u304F\u306E\u30AD\u30FC\u30DC\u30FC\u30C9\u3067[Alt]\u3067\u3059\u3002\n\u884C\u7DE8\u96C6\u30B5\u30DD\u30FC\u30C8\u306F\u3001JLine 3\u304B\u3089\u6D3E\u751F\u3057\u3066\u3044\u307E\u3059\u3002
+
 help.shortcuts.summary = \u30B9\u30CB\u30DA\u30C3\u30C8\u304A\u3088\u3073\u30B3\u30DE\u30F3\u30C9\u306E\u88DC\u5B8C\u3001\u60C5\u5831\u30A2\u30AF\u30BB\u30B9\u3001\u304A\u3088\u3073\u81EA\u52D5\u30B3\u30FC\u30C9\u751F\u6210\n\u306E\u30AD\u30FC\u30B9\u30C8\u30ED\u30FC\u30AF\u306E\u8AAC\u660E
-help.shortcuts =\u30B5\u30DD\u30FC\u30C8\u3055\u308C\u3066\u3044\u308B\u30B7\u30E7\u30FC\u30C8\u30AB\u30C3\u30C8\u306F\u6B21\u306E\u3068\u304A\u308A\u3067\u3059:\n\n<tab>\n\t\tJava\u8B58\u5225\u5B50\u3001jshell\u30C4\u30FC\u30EB\u30FB\u30B3\u30DE\u30F3\u30C9\u3001\u5834\u5408\u306B\u3088\u3063\u3066\u306F\n\t\tjshell\u30C4\u30FC\u30EB\u30FB\u30B3\u30DE\u30F3\u30C9\u5F15\u6570\u306E\u6700\u521D\u306E\u6570\u6587\u5B57\u3092\u5165\u529B\u3057\u305F\u5F8C\u306B\u3001\n\t\t<tab>\u30AD\u30FC\u3092\u62BC\u3059\u3068\u3001\u5165\u529B\u304C\u88DC\u5B8C\u3055\u308C\u307E\u3059\u3002\n\t\t\u88DC\u5B8C\u7D50\u679C\u304C\u8907\u6570\u3042\u308B\u5834\u5408\u3001\u4F7F\u7528\u53EF\u80FD\u306A\u88DC\u5B8C\u7D50\u679C\u304C\u8868\u793A\u3055\u308C\u307E\u3059\u3002\n\t\t\u9069\u5207\u306A\u3082\u306E\u304C\u3042\u308B\u5834\u5408\u306F\u3001\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u304C\u8868\u793A\u3055\u308C\u307E\u3059\u3002\n\nShift-<tab> v\n\t\t\u5B8C\u5168\u306A\u5F0F\u306E\u5F8C\u306B\u3001<shift>\u3092\u62BC\u3057\u306A\u304C\u3089<tab>\u3092\u62BC\u3057\u3001\u6B21\u306B\u96E2\u3057\u3066\n\t\t[v]\u3092\u62BC\u3059\u3068\u3001\u5F0F\u304C\u3001\u305D\u306E\u5F0F\u306E\u30BF\u30A4\u30D7\u306B\u57FA\u3065\u304F\u30BF\u30A4\u30D7\u3092\u6301\u3064\u3001\u5909\u6570\u306E\u5BA3\u8A00\u306B\n\t\t\u5909\u63DB\u3055\u308C\u307E\u3059\u3002\n\nShift-<tab> m\n\t\t\u5B8C\u5168\u306A\u5F0F\u307E\u305F\u306F\u6587\u306E\u5F8C\u306B\u3001<shift>\u3092\u62BC\u3057\u306A\u304C\u3089<tab>\u3092\u62BC\u3057\u3001\n\t\t\u6B21\u306B\u96E2\u3057\u3066[m]\u3092\u62BC\u3059\u3068\u3001\u5F0F\u307E\u305F\u306F\u6587\u304C\u30E1\u30BD\u30C3\u30C9\u5BA3\u8A00\u306B\n\t\t\u5909\u63DB\u3055\u308C\u307E\u3059\u3002\u5F0F\u306E\u5834\u5408\u3001\u623B\u308A\u5024\u306E\u30BF\u30A4\u30D7\u306F\u3001\n\t\t\u5F0F\u306E\u30BF\u30A4\u30D7\u306B\u57FA\u3065\u304D\u307E\u3059\u3002\n\nShift-<tab> i\n\t\t\u89E3\u6C7A\u3067\u304D\u306A\u3044\u8B58\u5225\u5B50\u306E\u5F8C\u306B\u3001<shift>\u3092\u62BC\u3057\u306A\u304C\u3089<tab>\u3092\u62BC\u3057\u3001\u6B21\u306B\u96E2\u3057\u3066\n\t\t[i]\u3092\u62BC\u3059\u3068\u3001jshell\u30C4\u30FC\u30EB\u306B\u3088\u3063\u3066\u3001\u4F7F\u7528\u53EF\u80FD\u306A\u30A4\u30F3\u30DD\u30FC\u30C8\u304C\u63D0\u793A\u3055\u308C\u3001\n\t\t\u3053\u308C\u306B\u3088\u3063\u3066\u3001\u6307\u5B9A\u3055\u308C\u305F\u30AF\u30E9\u30B9\u30D1\u30B9\u306E\u5185\u5BB9\u306B\u57FA\u3065\u3044\u3066\u8B58\u5225\u5B50\u304C\u89E3\u6C7A\u3055\u308C\u307E\u3059\u3002
+help.shortcuts =\u30B5\u30DD\u30FC\u30C8\u3055\u308C\u3066\u3044\u308B\u30B7\u30E7\u30FC\u30C8\u30AB\u30C3\u30C8\u306F\u6B21\u306E\u3068\u304A\u308A\u3067\u3059:\n\n\t[Tab]\n\t\tJava\u8B58\u5225\u5B50\u3001jshell\u30C4\u30FC\u30EB\u30FB\u30B3\u30DE\u30F3\u30C9\u3001\u5834\u5408\u306B\u3088\u3063\u3066\u306F\n\t\tjshell\u30C4\u30FC\u30EB\u30FB\u30B3\u30DE\u30F3\u30C9\u5F15\u6570\u306E\u6700\u521D\u306E\u6570\u6587\u5B57\u3092\u5165\u529B\u3057\u305F\u5F8C\u306B\u3001\n\t\t[Tab]\u30AD\u30FC\u3092\u62BC\u3059\u3068\u3001\u5165\u529B\u304C\u88DC\u5B8C\u3055\u308C\u307E\u3059\u3002\n\t\t\u88DC\u5B8C\u7D50\u679C\u304C\u8907\u6570\u3042\u308B\u5834\u5408\u3001\u4F7F\u7528\u53EF\u80FD\u306A\u88DC\u5B8C\u7D50\u679C\u304C\n\t\t\u8868\u793A\u3055\u308C\u307E\u3059\u3002\n\t\t\u3082\u30461\u56DE[Tab]\u3092\u62BC\u3059\u3068\u3001\u9069\u5207\u306A\u3082\u306E\u304C\u3042\u308B\u5834\u5408\u306F\u3001\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u304C\u8868\u793A\u3055\u308C\u307E\u3059\u3002\n\n\t[Shift]+[Tab]\u3092\u62BC\u3057\u3066\u304B\u3089[v]\n\t\t\u5B8C\u5168\u306A\u5F0F\u306E\u5F8C\u306B\u3001[Shift]\u30AD\u30FC\u3092\u62BC\u3057\u306A\u304C\u3089[Tab]\u30AD\u30FC\u3092\u62BC\u3057\u3001\n\t\t\u6B21\u306B\u96E2\u3057\u3066[v]\u30AD\u30FC\u3092\u62BC\u3059\u3068\u3001\u5F0F\u304C\u3001\n\t\t\u305D\u306E\u5F0F\u306E\u30BF\u30A4\u30D7\u306B\u57FA\u3065\u304F\u30BF\u30A4\u30D7\u3092\u6301\u3064\n\t\t\u5909\u6570\u5BA3\u8A00\u306B\u5909\u63DB\u3055\u308C\u307E\u3059\u3002\n\n\t[Shift]+[Tab]\u3092\u62BC\u3057\u3066\u304B\u3089[m]\n\t\t\u5B8C\u5168\u306A\u5F0F\u307E\u305F\u306F\u6587\u306E\u5F8C\u306B\u3001[Shift]\u30AD\u30FC\u3092\u62BC\u3057\u306A\u304C\u3089\n\t\t[Tab]\u30AD\u30FC\u3092\u62BC\u3057\u3001\u6B21\u306B\u96E2\u3057\u3066[m]\u30AD\u30FC\u3092\u62BC\u3059\u3068\u3001\n\t\t\u5F0F\u307E\u305F\u306F\u6587\u304C\u30E1\u30BD\u30C3\u30C9\u5BA3\u8A00\u306B\u5909\u63DB\u3055\u308C\u307E\u3059\u3002\n\t\t\u5F0F\u306E\u5834\u5408\u3001\u30E1\u30BD\u30C3\u30C9\u306E\u623B\u308A\u5024\u306E\u30BF\u30A4\u30D7\u306F\u3001\u5F0F\u306E\u30BF\u30A4\u30D7\u306B\n\t\t\u57FA\u3065\u304D\u307E\u3059\u3002\n\n\t[Shift]+[Tab]\u3092\u62BC\u3057\u3066\u304B\u3089[i]\n\t\t\u89E3\u6C7A\u3067\u304D\u306A\u3044\u8B58\u5225\u5B50\u306E\u5F8C\u306B\u3001[Shift]\u30AD\u30FC\u3092\u62BC\u3057\u306A\u304C\u3089\n\t\t[Tab]\u30AD\u30FC\u3092\u62BC\u3057\u3001\u6B21\u306B\u96E2\u3057\u3066[i]\u30AD\u30FC\u3092\u62BC\u3059\u3068\u3001\n\t\tjshell\u30C4\u30FC\u30EB\u306B\u3088\u3063\u3066\u3001\u4F7F\u7528\u53EF\u80FD\u306A\u30A4\u30F3\u30DD\u30FC\u30C8\u304C\u63D0\u793A\u3055\u308C\u3001\n\t\t\u3053\u308C\u306B\u3088\u3063\u3066\u3001\u6307\u5B9A\u3055\u308C\u305F\u30AF\u30E9\u30B9\u30D1\u30B9\u306E\u5185\u5BB9\u306B\u57FA\u3065\u3044\u3066\n\t\t\u8B58\u5225\u5B50\u304C\u89E3\u6C7A\u3055\u308C\u307E\u3059\u3002\u9069\u5207\u306A\u30A4\u30F3\u30DD\u30FC\u30C8\u306B\u5BFE\u5FDC\u3059\u308B\u6570\u5B57\u3092\u5165\u529B\u3057\u307E\u3059\u3002\n\t\t\u307E\u305F\u306F\u3001[0]\u30AD\u30FC\u3092\u62BC\u3059\u3068\u30A4\u30F3\u30DD\u30FC\u30C8\u306F\u8FFD\u52A0\u3055\u308C\u307E\u305B\u3093\u3002\n\n\u4ED6\u306E\u7279\u6B8A\u30AD\u30FC\u306E\u8A73\u7D30\u306F\u3001/help keys\u3092\u53C2\u7167\u3057\u3066\u304F\u3060\u3055\u3044
 
 help.context.summary = /env /reload\u304A\u3088\u3073/reset\u306E\u8A55\u4FA1\u30B3\u30F3\u30C6\u30AD\u30B9\u30C8\u30FB\u30AA\u30D7\u30B7\u30E7\u30F3\u306E\u8AAC\u660E
 help.context =\u3053\u308C\u3089\u306E\u30AA\u30D7\u30B7\u30E7\u30F3\u306F\u3001\u8A55\u4FA1\u30B3\u30F3\u30C6\u30AD\u30B9\u30C8\u3092\u69CB\u6210\u3057\u307E\u3059\u3002\u3053\u308C\u3089\u306F\u3001jshell\u30C4\u30FC\u30EB\u306E\n\u8D77\u52D5\u6642\u306B\u30B3\u30DE\u30F3\u30C9\u30E9\u30A4\u30F3\u3067\u3001\u307E\u305F\u306Fjshell\u30C4\u30FC\u30EB\u304C\u30B3\u30DE\u30F3\u30C9/env\u3001/reload\u307E\u305F\u306F\n/reset\u3067\u518D\u8D77\u52D5\u3055\u308C\u308B\u3068\u304D\u306B\u30B3\u30DE\u30F3\u30C9\u30FB\u30AA\u30D7\u30B7\u30E7\u30F3\u3068\u3057\u3066\u6307\u5B9A\u3067\u304D\u307E\u3059\u3002\n\n\u30AA\u30D7\u30B7\u30E7\u30F3\u306F\u6B21\u306E\u3068\u304A\u308A\u3067\u3059:\n\t--class-path <path>\n\t\t<path>\u306F\u3001\u30AF\u30E9\u30B9\u30FB\u30D5\u30A1\u30A4\u30EB\u3092\u691C\u7D22\u3059\u308B\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u3001JAR\u30A2\u30FC\u30AB\u30A4\u30D6\u3001\n\t\tZIP\u30A2\u30FC\u30AB\u30A4\u30D6\u306E\u30EA\u30B9\u30C8\u3067\u3059\u3002\n\t\tWindows\u306E\u5834\u5408\u306F\u3001\u30BB\u30DF\u30B3\u30ED\u30F3(;)\u3092\u4F7F\u7528\u3057\u3066\u30D1\u30B9\u306E\u9805\u76EE\u3092\u533A\u5207\u308A\u307E\u3059\u3002\n\t\t\u305D\u306E\u4ED6\u306E\u30D7\u30E9\u30C3\u30C8\u30D5\u30A9\u30FC\u30E0\u3067\u306F\u3001\u30B3\u30ED\u30F3(:)\u3092\u4F7F\u7528\u3057\u3066\u9805\u76EE\u3092\u533A\u5207\u308A\u307E\u3059\u3002\n\t--module-path <path>...\n\t\t<path>\u306F\u3001\u30E2\u30B8\u30E5\u30FC\u30EB\u3092\u691C\u7D22\u3059\u308B\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u3001JAR\u30A2\u30FC\u30AB\u30A4\u30D6\u3001\n\t\tZIP\u30A2\u30FC\u30AB\u30A4\u30D6\u306E\u30EA\u30B9\u30C8\u3067\u3059\u3002\n\t\tWindows\u306E\u5834\u5408\u306F\u3001\u30BB\u30DF\u30B3\u30ED\u30F3(;)\u3092\u4F7F\u7528\u3057\u3066\u30D1\u30B9\u306E\u9805\u76EE\u3092\u533A\u5207\u308A\u307E\u3059\u3002\n\t\t\u305D\u306E\u4ED6\u306E\u30D7\u30E9\u30C3\u30C8\u30D5\u30A9\u30FC\u30E0\u3067\u306F\u3001\u30B3\u30ED\u30F3(:)\u3092\u4F7F\u7528\u3057\u3066\u9805\u76EE\u3092\u533A\u5207\u308A\u307E\u3059\u3002\n\t--add-modules <modulename>[,<modulename>...]\n\t\t\u521D\u671F\u30E2\u30B8\u30E5\u30FC\u30EB\u306B\u52A0\u3048\u3066\u89E3\u6C7A\u3059\u308B\u30EB\u30FC\u30C8\u30FB\u30E2\u30B8\u30E5\u30FC\u30EB\u3002\n\t\t<modulename>\u306B\u306FALL-DEFAULT\u3001ALL-SYSTEM\u3001\n\t\tALL-MODULE-PATH\u3092\u6307\u5B9A\u3059\u308B\u3053\u3068\u3082\u3067\u304D\u307E\u3059\u3002\n\t--add-exports <module>/<package>=<target-module>(,<target-module>)*\n\t\t<module>\u3092\u66F4\u65B0\u3057\u3066\u3001\u30E2\u30B8\u30E5\u30FC\u30EB\u5BA3\u8A00\u306B\u95A2\u4FC2\u306A\u304F<package>\u3092<target-module>\n\t\t\u306B\u30A8\u30AF\u30B9\u30DD\u30FC\u30C8\u3057\u307E\u3059\u3002\n\t\t<target-module>\u3092ALL-UNNAMED\u306B\u8A2D\u5B9A\u3059\u308B\u3068\u3001\u3059\u3079\u3066\u306E\u540D\u524D\u306E\u306A\u3044\u30E2\u30B8\u30E5\u30FC\u30EB\u3092\n\t\t\u30A8\u30AF\u30B9\u30DD\u30FC\u30C8\u3067\u304D\u307E\u3059\u3002jshell\u3067\u306F\u3001<target-module>\u304C\u6307\u5B9A\u3055\u308C\u3066\u3044\u306A\u3044\u5834\u5408(\u300C=\u300D\u306A\u3057)\n\t\tALL-UNNAMED\u304C\u4F7F\u7528\u3055\u308C\u307E\u3059\u3002\n\n\u30B3\u30DE\u30F3\u30C9\u30E9\u30A4\u30F3\u3067\u5165\u529B\u3055\u308C\u308B\u304B\u4EE5\u524D\u306E/reset\u3001/env\u307E\u305F\u306F/reload\u30B3\u30DE\u30F3\u30C9\u3067\n\u6307\u5B9A\u3055\u308C\u305F\u8A55\u4FA1\u30B3\u30F3\u30C6\u30AD\u30B9\u30C8\u30FB\u30AA\u30D7\u30B7\u30E7\u30F3\u306F\u3001\u8A2D\u5B9A\u3092\u4E0A\u66F8\u304D\u3059\u308B\u30AA\u30D7\u30B7\u30E7\u30F3\u304C\n\u5165\u529B\u3055\u308C\u306A\u3044\u304B\u304E\u308A\u7DAD\u6301\u3055\u308C\u307E\u3059\u3002\n\n\u30B3\u30DE\u30F3\u30C9\u30E9\u30A4\u30F3\u3067\u306F\u3001\u3053\u308C\u3089\u306E\u30AA\u30D7\u30B7\u30E7\u30F3\u306B\u306F2\u3064\u306E\u30C0\u30C3\u30B7\u30E5\u304C\u5FC5\u8981\u3067\u3059\u3002\u4F8B: \
@@ -279,7 +284,7 @@
 help.id =\u5165\u529B\u3057\u305F\u30B3\u30FC\u30C9\u306E\u3059\u3079\u3066\u306E\u30B9\u30CB\u30DA\u30C3\u30C8\u306B\u56FA\u6709\u306E\u30B9\u30CB\u30DA\u30C3\u30C8ID\u304C\u3042\u308A\u307E\u3059\u3002\n\u540C\u3058\u30B9\u30CB\u30DA\u30C3\u30C8\u3092\u518D\u5EA6\u5165\u529B\u3057\u305F\u5834\u5408\u3067\u3082\u3001\u305D\u306E\u30B9\u30CB\u30DA\u30C3\u30C8\u306F\u65B0\u3057\u3044ID\u3092\u6301\u3061\u307E\u3059\u3002\n\u901A\u5E38\u306E\u30B9\u30CB\u30DA\u30C3\u30C8\u306E\u5834\u5408\u3001ID\u306F\u5897\u52A0\u3059\u308B\u6570\u5024\u3067\u3059\u3002\u30A8\u30E9\u30FC\u3067\u5931\u6557\u3059\u308B\u30B9\u30CB\u30DA\u30C3\u30C8\u306E\n\u30B9\u30CB\u30DA\u30C3\u30C8ID\u306F'e'\u3067\u59CB\u307E\u308A\u307E\u3059\u3002\u8D77\u52D5\u306E\u30B9\u30CB\u30DA\u30C3\u30C8\u306EID\u306F's'\u3067\u59CB\u307E\u308A\u307E\u3059\u3002\n\n\u30B9\u30CB\u30DA\u30C3\u30C8ID\u306F\u3001\u30B3\u30DE\u30F3\u30C9\u5185\u306E\u30B9\u30CB\u30DA\u30C3\u30C8\u3092\u53C2\u7167\u3059\u308B1\u3064\u306E\u65B9\u6CD5\u3067\u3059\u3002\u305F\u3068\u3048\u3070\u3001\n\u6B21\u306E\u30B3\u30DE\u30F3\u30C9\u306FID '14'\u306E\u30B9\u30CB\u30DA\u30C3\u30C8\u3092\u524A\u9664\u3057\u307E\u3059\u3002\n\n\t/drop 14\n\n1\u3064\u307E\u305F\u306F\u8907\u6570\u306E\u30B9\u30CB\u30DA\u30C3\u30C8\u306EID\u3092\u8868\u793A\u3059\u308B\u306B\u306F\u3001'/list'\u30B3\u30DE\u30F3\u30C9\u3092\u4F7F\u7528\u3057\u307E\u3059\u3002\n\u5931\u6557\u3001\u8D77\u52D5\u3001\u4E0A\u66F8\u304D\u6E08\u30B9\u30CB\u30DA\u30C3\u30C8\u3092\u542B\u3080\u3059\u3079\u3066\u306E\u30B9\u30CB\u30DA\u30C3\u30C8\u306EID\u3092\u8868\u793A\u3059\u308B\u306B\u306F\u3001\n'/list -all'\u30B3\u30DE\u30F3\u30C9\u3092\u4F7F\u7528\u3057\u307E\u3059\u3002\n\n\u958B\u59CBID\u3068\u7D42\u4E86ID\u3092\u30CF\u30A4\u30D5\u30F3\u3067\u533A\u5207\u3063\u305FID\u306E\u7BC4\u56F2\u3082\u53C2\u7167\u3067\u304D\u307E\u3059\u3002\n\u305F\u3068\u3048\u3070\u3001'1-4'\u306F'1 2 3 4'\u3068\u540C\u3058\u3067\u3059\u3002\u30B9\u30CB\u30DA\u30C3\u30C8\u3092\u53C2\u7167\u3059\u308B\u3059\u3079\u3066\u306E\u30B3\u30DE\u30F3\u30C9\u306F\u3001\nID\u306E\u30EA\u30B9\u30C8\u3001ID\u7BC4\u56F2\u304A\u3088\u3073\u30B9\u30CB\u30DA\u30C3\u30C8\u540D\u3092\u5F15\u6570\u3068\u3057\u3066\u53D7\u3051\u53D6\u308A\u307E\u3059\u3002\n\u3053\u308C\u3089\u306E\u30B3\u30DE\u30F3\u30C9\u306F\u6B21\u306E\u3068\u304A\u308A\u3067\u3059: /list\u3001/edit\u3001/drop\u3001/save\u3001/vars\u3001/methods\u3001\n/types\u3001/<id>\u3002\u4F8B\u3092\u3044\u304F\u3064\u304B\u793A\u3057\u307E\u3059\u3002\n\n\t/edit 7-23\n\n\t/save s1-s4 3-8 foo 12 myfile\n\n\t/9-12 33\n\n\u305D\u308C\u305E\u308C'/help /edit'\u3001'/help /save'\u3001'/help rerun'\u3092\u53C2\u7167\u3057\u3066\u304F\u3060\u3055\u3044\u3002
 
 help.rerun.summary = \u524D\u306B\u5165\u529B\u3057\u305F\u30B9\u30CB\u30DA\u30C3\u30C8\u3092\u518D\u8A55\u4FA1\u3059\u308B\u65B9\u6CD5\u306E\u8AAC\u660E
-help.rerun =\u524D\u306B\u5165\u529B\u3057\u305F\u30B9\u30CB\u30DA\u30C3\u30C8\u3092\u518D\u8A55\u4FA1\u3059\u308B\u65B9\u6CD5\u306F4\u3064\u3042\u308A\u307E\u3059\u3002\n\u6700\u5F8C\u306E\u30B9\u30CB\u30DA\u30C3\u30C8\u306F\u3001/!\u3092\u4F7F\u7528\u3057\u3066\u518D\u8A55\u4FA1\u3067\u304D\u307E\u3059\nn\u56DE\u524D\u306E\u30B9\u30CB\u30DA\u30C3\u30C8\u306F\u3001\u30B9\u30E9\u30C3\u30B7\u30E5\u3068\u30DE\u30A4\u30CA\u30B9\u304A\u3088\u3073n\u306E\u6570\u5B57\u3067\u518D\u8A55\u4FA1\u3067\u304D\u307E\u3059(\u4F8B: /-4)\n\u6B21\u306B\u4F8B\u3092\u793A\u3057\u307E\u3059\u3002\n\n\tjshell> 2 + 2\n\t$1 ==> 4\n\n\tjshell> /!\n\t2 + 2\n\t$2 ==> 4\n\n\tjshell> int z\n\tz ==> 0\n\n\tjshell> /-1\n\tint z;\n\tz ==> 0\n\n\tjshell> /-4\n\t2 + 2\n\t$5 ==> 4\n\n\u518D\u8A55\u4FA1\u3059\u308B\u30B9\u30CB\u30DA\u30C3\u30C8\u306F\u3001\u30B9\u30CB\u30DA\u30C3\u30C8ID\u307E\u305F\u306FID\u7BC4\u56F2\u3067\u6307\u5B9A\u3067\u304D\u307E\u3059\u3002\nID\u7BC4\u56F2\u306F\u3001\u30CF\u30A4\u30D5\u30F3\u3067\u533A\u5207\u3089\u308C\u305F2\u3064\u306EID\u3067\u8868\u73FE\u3055\u308C\u307E\u3059(\u4F8B: 3-17)\n\u8D77\u52D5\u30B9\u30CB\u30DA\u30C3\u30C8\u304A\u3088\u3073\u30A8\u30E9\u30FC\u30FB\u30B9\u30CB\u30DA\u30C3\u30C8\u3092\u4F7F\u7528\u3067\u304D\u307E\u3059(\u4F8B: s3-s9\u307E\u305F\u306Fe1-e4)\n\u4EFB\u610F\u306E\u6570\u306EID\u307E\u305F\u306FID\u7BC4\u56F2\u3092\u4F7F\u7528\u3067\u304D\u307E\u3059(\u4F8B: /3-7 s4 14-16 e2)\n'/help id'\u3092\u53C2\u7167\u3057\u3066\u304F\u3060\u3055\u3044\u3002\n\n\u307E\u305F\u3001[Ctrl]-[R]\u3092\u62BC\u3057\u3066\u304B\u3089\u691C\u7D22\u6587\u5B57\u5217\u3092\u5165\u529B\u3059\u308B\u3068\u3001\u5C65\u6B74\u3092\u3055\u304B\u306E\u307C\u3063\u3066\u691C\u7D22\u3067\u304D\u307E\u3059\u3002
+help.rerun =\u524D\u306B\u5165\u529B\u3057\u305F\u30B9\u30CB\u30DA\u30C3\u30C8\u3092\u518D\u8A55\u4FA1\u3059\u308B\u65B9\u6CD5\u306F4\u3064\u3042\u308A\u307E\u3059\u3002\n\u6700\u5F8C\u306E\u30B9\u30CB\u30DA\u30C3\u30C8\u306F\u3001/!\u3092\u4F7F\u7528\u3057\u3066\u518D\u8A55\u4FA1\u3067\u304D\u307E\u3059\nn\u56DE\u524D\u306E\u30B9\u30CB\u30DA\u30C3\u30C8\u306F\u3001\u30B9\u30E9\u30C3\u30B7\u30E5\u3068\u30DE\u30A4\u30CA\u30B9\u304A\u3088\u3073n\u306E\u6570\u5B57\u3067\u518D\u8A55\u4FA1\u3067\u304D\u307E\u3059(\u4F8B: /-4)\n\u6B21\u306B\u4F8B\u3092\u793A\u3057\u307E\u3059\u3002\n\n\tjshell> 2 + 2\n\t$1 ==> 4\n\n\tjshell> /!\n\t2 + 2\n\t$2 ==> 4\n\n\tjshell> int z\n\tz ==> 0\n\n\tjshell> /-1\n\tint z;\n\tz ==> 0\n\n\tjshell> /-4\n\t2 + 2\n\t$5 ==> 4\n\n\u518D\u8A55\u4FA1\u3059\u308B\u30B9\u30CB\u30DA\u30C3\u30C8\u306F\u3001\u30B9\u30CB\u30DA\u30C3\u30C8ID\u307E\u305F\u306FID\u7BC4\u56F2\u3067\u6307\u5B9A\u3067\u304D\u307E\u3059\u3002\nID\u7BC4\u56F2\u306F\u3001\u30CF\u30A4\u30D5\u30F3\u3067\u533A\u5207\u3089\u308C\u305F2\u3064\u306EID\u3067\u8868\u73FE\u3055\u308C\u307E\u3059(\u4F8B: 3-17)\n\u8D77\u52D5\u30B9\u30CB\u30DA\u30C3\u30C8\u304A\u3088\u3073\u30A8\u30E9\u30FC\u30FB\u30B9\u30CB\u30DA\u30C3\u30C8\u3092\u4F7F\u7528\u3067\u304D\u307E\u3059(\u4F8B: s3-s9\u307E\u305F\u306Fe1-e4)\n\u4EFB\u610F\u306E\u6570\u306EID\u307E\u305F\u306FID\u7BC4\u56F2\u3092\u4F7F\u7528\u3067\u304D\u307E\u3059(\u4F8B: /3-7 s4 14-16 e2)\n'/help id'\u3092\u53C2\u7167\u3057\u3066\u304F\u3060\u3055\u3044\u3002\n\n\u307E\u305F\u3001[Ctrl]+[R]\u3092\u62BC\u3057\u3066\u304B\u3089\u691C\u7D22\u6587\u5B57\u5217\u3092\u5165\u529B\u3059\u308B\u3068\u3001\u5C65\u6B74\u3092\u3055\u304B\u306E\u307C\u3063\u3066\u691C\u7D22\u3067\u304D\u307E\u3059\u3002
 
 help.set._retain = '-retain'\u30AA\u30D7\u30B7\u30E7\u30F3\u306B\u3088\u308A\u3001\u5C06\u6765\u306E\u30BB\u30C3\u30B7\u30E7\u30F3\u3067\u4F7F\u7528\u3059\u308B\u305F\u3081\u306B\u8A2D\u5B9A\u3092\u4FDD\u5B58\u3057\u307E\u3059\u3002\n-retain\u30AA\u30D7\u30B7\u30E7\u30F3\u306F\u3001/set\u306E\u6B21\u306E\u5F62\u5F0F\u3067\u4F7F\u7528\u3067\u304D\u307E\u3059:\n\n\t/set editor -retain\n\t/set start -retain\n\t/set feedback -retain\n\t/set mode -retain\n\n\u8A73\u7D30\u306F\u3001\u3053\u308C\u3089\u306E\u30B3\u30DE\u30F3\u30C9\u3092\u53C2\u7167\u3057\u3066\u304F\u3060\u3055\u3044 -- \u4F8B: /help /set editor
 
--- a/src/jdk.jshell/share/classes/jdk/internal/jshell/tool/resources/l10n_zh_CN.properties	Thu Dec 13 11:51:06 2018 -0800
+++ b/src/jdk.jshell/share/classes/jdk/internal/jshell/tool/resources/l10n_zh_CN.properties	Tue Jan 15 10:55:26 2019 -0800
@@ -171,11 +171,11 @@
 jshell.console.resolvable = \n\u6807\u8BC6\u7B26\u53EF\u5728\u6B64\u4E0A\u4E0B\u6587\u4E2D\u89E3\u6790\u3002
 jshell.console.no.candidate = \n\u6CA1\u6709\u627E\u5230\u53EF\u5BFC\u5165\u7684\u5019\u9009\u5168\u9650\u5B9A\u540D\u79F0\u3002
 jshell.console.incomplete = \n\u7ED3\u679C\u53EF\u80FD\u4E0D\u5B8C\u6574; \u8BF7\u7A0D\u5019\u91CD\u8BD5\u4EE5\u83B7\u53D6\u5B8C\u6574\u7ED3\u679C\u3002
-jshell.console.erroneous = \n\u4E0D\u5B8C\u6574\u6216\u9519\u8BEF\u3002Shift-<tab> m \u540E\u5FC5\u987B\u4E3A\u5355\u4E2A\u6709\u6548\u7684\u8868\u8FBE\u5F0F\u6216\u8BED\u53E5\u3002
-jshell.console.exprstmt = \nShift-<tab> m \u540E\u5FC5\u987B\u4E3A\u5355\u4E2A\u6709\u6548\u7684\u8868\u8FBE\u5F0F\u6216\u8BED\u53E5\u3002
-jshell.console.empty = \n\u7A7A\u6761\u76EE\u3002Shift-<tab> m \u540E\u5FC5\u987B\u4E3A\u5355\u4E2A\u6709\u6548\u7684\u8868\u8FBE\u5F0F\u6216\u8BED\u53E5\u3002
+jshell.console.erroneous = \n\u4E0D\u5B8C\u6574\u6216\u9519\u8BEF\u3002Shift+Tab m \u524D\u5FC5\u987B\u4E3A\u5355\u4E2A\u6709\u6548\u7684\u8868\u8FBE\u5F0F\u6216\u8BED\u53E5\u3002
+jshell.console.exprstmt = \nShift+Tab m \u540E\u5FC5\u987B\u4E3A\u5355\u4E2A\u6709\u6548\u7684\u8868\u8FBE\u5F0F\u6216\u8BED\u53E5\u3002
+jshell.console.empty = \n\u7A7A\u6761\u76EE\u3002Shift+Tab m \u524D\u5FC5\u987B\u4E3A\u5355\u4E2A\u6709\u6548\u7684\u8868\u8FBE\u5F0F\u6216\u8BED\u53E5\u3002
 
-jshell.fix.wrong.shortcut =Shift-Tab \u540E\u51FA\u73B0\u610F\u5916\u7684\u5B57\u7B26\u3002\n\u4F7F\u7528 "i" \u8868\u793A\u81EA\u52A8\u5BFC\u5165, \u4F7F\u7528 "v" \u8868\u793A\u53D8\u91CF\u521B\u5EFA, \u4F7F\u7528 "i" \u8868\u793A\u65B9\u6CD5\u521B\u5EFA\u3002\n\u6709\u5173\u8BE6\u7EC6\u4FE1\u606F, \u8BF7\u53C2\u9605:\n /help \u5FEB\u6377\u65B9\u5F0F
+jshell.fix.wrong.shortcut =Shift+Tab \u540E\u51FA\u73B0\u610F\u5916\u7684\u5B57\u7B26\u3002\n\u4F7F\u7528 "i" \u8868\u793A\u81EA\u52A8\u5BFC\u5165\uFF0C\u4F7F\u7528 "v" \u8868\u793A\u53D8\u91CF\u521B\u5EFA\uFF0C\u4F7F\u7528 "i" \u8868\u793A\u65B9\u6CD5\u521B\u5EFA\u3002\n\u6709\u5173\u8BE6\u7EC6\u4FE1\u606F\uFF0C\u8BF7\u53C2\u9605\uFF1A\n/help \u5FEB\u6377\u65B9\u5F0F
 
 help.usage = \u7528\u6CD5\uFF1A   jshell <\u9009\u9879>... <\u52A0\u8F7D\u6587\u4EF6>...\n\u5176\u4E2D\uFF0C\u53EF\u80FD\u7684\u9009\u9879\u5305\u62EC\uFF1A\n    --class-path <\u8DEF\u5F84>   \u6307\u5B9A\u67E5\u627E\u7528\u6237\u7C7B\u6587\u4EF6\u7684\u4F4D\u7F6E\n    --module-path <\u8DEF\u5F84>  \u6307\u5B9A\u67E5\u627E\u5E94\u7528\u7A0B\u5E8F\u6A21\u5757\u7684\u4F4D\u7F6E\n    --add-modules <\u6A21\u5757>(,<\u6A21\u5757>)*\n                          \u6307\u5B9A\u8981\u89E3\u6790\u7684\u6A21\u5757\uFF1B\u5982\u679C <\u6A21\u5757> \n                          \u4E3A ALL-MODULE-PATH\uFF0C\u5219\u4E3A\u6A21\u5757\u8DEF\u5F84\u4E2D\u7684\u6240\u6709\u6A21\u5757\n    --enable-preview      \u5141\u8BB8\u4EE3\u7801\u4F9D\u8D56\u4E8E\u6B64\u53D1\u884C\u7248\u7684\u9884\u89C8\u529F\u80FD\n    --startup <\u6587\u4EF6>      \u5BF9\u542F\u52A8\u5B9A\u4E49\u6267\u884C\u5355\u6B21\u66FF\u6362\n    --no-startup          \u4E0D\u8FD0\u884C\u542F\u52A8\u5B9A\u4E49\n    --feedback <\u6A21\u5F0F>     \u6307\u5B9A\u521D\u59CB\u53CD\u9988\u6A21\u5F0F\u3002\u8BE5\u6A21\u5F0F\u53EF\u4EE5\u662F\n                            \u9884\u5B9A\u4E49\u7684\uFF08silent\u3001concise\u3001normal \u6216 verbose\uFF09\uFF0C\n                            \u4E5F\u53EF\u662F\u4EE5\u524D\u7528\u6237\u5B9A\u4E49\u7684\n    -q                    \u65E0\u63D0\u793A\u53CD\u9988\u3002\u7B49\u540C\u4E8E\uFF1A--feedback concise\n    -s                    \u771F\u6B63\u65E0\u63D0\u793A\u53CD\u9988\u3002\u7B49\u540C\u4E8E\uFF1A--feedback silent\n    -v                    \u8BE6\u7EC6\u53CD\u9988\u3002\u7B49\u540C\u4E8E\uFF1A--feedback verbose\n    -J<\u6807\u8BB0>              \u76F4\u63A5\u5C06 <\u6807\u8BB0> \u4F20\u9012\u5230\u8FD0\u884C\u65F6\u7CFB\u7EDF\u3002\n                            \u4E3A\u6BCF\u4E2A\u8FD0\u884C\u65F6\u6807\u8BB0\u6216\u6807\u8BB0\u53C2\u6570\u4F7F\u7528\u4E00\u4E2A -J\n    -R<\u6807\u8BB0>              \u5C06 <\u6807\u8BB0> \u4F20\u9012\u5230\u8FDC\u7A0B\u8FD0\u884C\u65F6\u7CFB\u7EDF\u3002\n                            \u4E3A\u6BCF\u4E2A\u8FDC\u7A0B\u6807\u8BB0\u6216\u6807\u8BB0\u53C2\u6570\u4F7F\u7528\u4E00\u4E2A -R\n    -C<\u6807\u8BB0>              \u5C06 <\u6807\u8BB0> \u4F20\u9012\u5230\u7F16\u8BD1\u5668\u3002\n                            \u4E3A\u6BCF\u4E2A\u7F16\u8BD1\u5668\u6807\u8BB0\u6216\u6807\u8BB0\u53C2\u6570\u4F7F\u7528\u4E00\u4E2A -C\n    --version             \u8F93\u51FA\u7248\u672C\u4FE1\u606F\u5E76\u9000\u51FA\n    --show-version        \u8F93\u51FA\u7248\u672C\u4FE1\u606F\u5E76\u7EE7\u7EED\n    --help, -?, -h        \u8F93\u51FA\u6807\u51C6\u9009\u9879\u7684\u6B64\u63D0\u8981\u5E76\u9000\u51FA\n    --help-extra, -X      \u8F93\u51FA\u975E\u6807\u51C6\u9009\u9879\u7684\u5E2E\u52A9\u5E76\u9000\u51FA\n\n\u6587\u4EF6\u53C2\u6570\u53EF\u4EE5\u662F\u6587\u4EF6\u540D\uFF0C\u6216\u8005\u662F\u9884\u5B9A\u4E49\u7684\u6587\u4EF6\u540D\u4E4B\u4E00\uFF1ADEFAULT\u3001\nPRINTING \u6216 JAVASE\u3002\n\u52A0\u8F7D\u6587\u4EF6\u4E5F\u53EF\u4EE5\u662F "-"\uFF0C\u7528\u4E8E\u6307\u660E\u6807\u51C6\u8F93\u5165\uFF0C\u6CA1\u6709\u4EA4\u4E92\u5F0F I/O\u3002\n\n\u6709\u5173\u8BC4\u4F30\u4E0A\u4E0B\u6587\u9009\u9879\uFF08--class-path\u3001\n--module-path \u548C --add-modules\uFF09\u7684\u8BE6\u7EC6\u4FE1\u606F\uFF0C\u8BF7\u53C2\u89C1\uFF1A\n\t/help context\n\n\u8DEF\u5F84\u5217\u51FA\u8981\u641C\u7D22\u7684\u76EE\u5F55\u548C\u6863\u6848\u3002\u5BF9\u4E8E Windows\uFF0C\u8BF7\u4F7F\u7528\n\u5206\u53F7 (;) \u6765\u5206\u9694\u8DEF\u5F84\u4E2D\u7684\u9879\u3002\u5728\u5176\u4ED6\u5E73\u53F0\u4E0A\uFF0C\u8BF7\u4F7F\u7528\n\u5192\u53F7 (:) \u6765\u5206\u9694\u5404\u9879\u3002\n
 help.usage.x = \    --add-exports <\u6A21\u5757>/<\u7A0B\u5E8F\u5305>      \u6307\u5B9A\u8981\u8003\u8651\u4ECE\u5176\u5B9A\u4E49\u6A21\u5757\u5BFC\u51FA\n                                         \u7684\u7A0B\u5E8F\u5305\n    --execution <\u89C4\u8303>                 \u6307\u5B9A\u66FF\u4EE3\u6267\u884C\u5F15\u64CE\u3002\n                                         \u5176\u4E2D <\u89C4\u8303> \u662F ExecutionControl \u89C4\u8303\u3002\n                                         \u6709\u5173\u89C4\u8303\u7684\u8BED\u6CD5\uFF0C\u8BF7\u53C2\u9605\u7A0B\u5E8F\u5305\n                                         jdk.jshell.spi \u7684\u6587\u6863\n    \n\u8FD9\u4E9B\u9009\u9879\u662F\u975E\u6807\u51C6\u9009\u9879\uFF0C\u5982\u6709\u66F4\u6539\uFF0C\u6055\u4E0D\u53E6\u884C\u901A\u77E5\u3002\n
@@ -267,8 +267,12 @@
 help.intro.summary = jshell \u5DE5\u5177\u7684\u7B80\u4ECB
 help.intro =\u4F7F\u7528 jshell \u5DE5\u5177\u53EF\u4EE5\u6267\u884C Java \u4EE3\u7801\uFF0C\u4ECE\u800C\u7ACB\u5373\u83B7\u53D6\u7ED3\u679C\u3002\n\u60A8\u53EF\u4EE5\u8F93\u5165 Java \u5B9A\u4E49\uFF08\u53D8\u91CF\u3001\u65B9\u6CD5\u3001\u7C7B\u7B49\u7B49\uFF09\uFF0C\u4F8B\u5982\uFF1Aint x = 8\n\u6216 Java \u8868\u8FBE\u5F0F\uFF0C\u4F8B\u5982\uFF1Ax + x\n\u6216 Java \u8BED\u53E5\u6216\u5BFC\u5165\u3002\n\u8FD9\u4E9B\u5C0F\u5757\u7684 Java \u4EE3\u7801\u79F0\u4E3A\u201C\u7247\u6BB5\u201D\u3002\n\n\u8FD9\u4E9B jshell \u5DE5\u5177\u547D\u4EE4\u8FD8\u53EF\u4EE5\u8BA9\u60A8\u4E86\u89E3\u548C\n\u63A7\u5236\u60A8\u6B63\u5728\u6267\u884C\u7684\u64CD\u4F5C\uFF0C\u4F8B\u5982\uFF1A/list\n\n\u6709\u5173\u547D\u4EE4\u7684\u5217\u8868\uFF0C\u8BF7\u6267\u884C\uFF1A/help
 
+help.keys.summary = \u7C7B\u4F3C readline \u7684\u8F93\u5165\u7F16\u8F91\u7684\u8BF4\u660E
+help.keys =jshell \u5DE5\u5177\u63D0\u4F9B\u884C\u7F16\u8F91\u652F\u6301\uFF0C\u5141\u8BB8\u60A8\u5728\u7247\u6BB5\u548C\u547D\u4EE4\u4E2D\n\u5BFC\u822A\u5E76\u8FDB\u884C\u7F16\u8F91\u3002\u60A8\u53EF\u4EE5\u7F16\u8F91\u5F53\u524D\u547D\u4EE4/\u7247\u6BB5\uFF0C\u4E5F\u53EF\u4EE5\n\u4ECE\u5386\u53F2\u8BB0\u5F55\u4E2D\u68C0\u7D22\u4EE5\u524D\u7684\u547D\u4EE4/\u7247\u6BB5\uFF0C\u8FDB\u884C\u7F16\u8F91\u5E76\u6267\u884C\u3002\n\u6B64\u652F\u6301\u7C7B\u4F3C\u4E8E readline/editline\uFF0C\u5177\u6709\u4E0E emacs \u76F8\u4F3C\u7684\n\u7B80\u5355\u7ED1\u5B9A\u3002\u8FD8\u6709\u7279\u5B9A\u4E8E jshell \u5DE5\u5177\u7684\u5173\u952E\u5B57\u5E8F\u5217\u3002\n\n\u884C\u548C\u5386\u53F2\u8BB0\u5F55\u5BFC\u822A\uFF1A\n\n\tReturn\n\t\t\u8F93\u5165\u5F53\u524D\u7247\u6BB5\n\t\u5DE6\u7BAD\u5934\u6216 Ctrl+B\n\t\t\u5411\u540E\u79FB\u52A8\u4E00\u4E2A\u5B57\u7B26\n\t\u53F3\u7BAD\u5934\u6216 Ctrl+F\n\t\t\u5411\u524D\u79FB\u52A8\u4E00\u4E2A\u5B57\u7B26\n\t\u4E0A\u7BAD\u5934\u6216 Ctrl+P\n\t\t\u5411\u4E0A\u79FB\u52A8\u4E00\u884C\uFF0C\u5411\u540E\u6D4F\u89C8\u5386\u53F2\u8BB0\u5F55\n\t\u4E0B\u7BAD\u5934\u6216 Ctrl+N\n\t\t\u5411\u4E0B\u79FB\u52A8\u4E00\u884C\uFF0C\u5411\u524D\u6D4F\u89C8\u5386\u53F2\u8BB0\u5F55\n\tCtrl+A\n\t\t\u79FB\u81F3\u884C\u7684\u5F00\u5934\n\tCtrl+E\n\t\t\u79FB\u81F3\u884C\u7684\u7ED3\u5C3E\n\tMeta+B\n\t\t\u5411\u540E\u79FB\u52A8\u4E00\u4E2A\u5355\u8BCD\n\tMeta+F\n\t\t\u5411\u524D\u79FB\u52A8\u4E00\u4E2A\u5355\u8BCD\n\tCtrl+R\n\t\t\u5411\u540E\u641C\u7D22\u5386\u53F2\u8BB0\u5F55\n\n\n\u884C\u548C\u5386\u53F2\u8BB0\u5F55\u57FA\u672C\u7F16\u8F91\uFF1A\n\n\tMeta+Return \u6216 Ctrl+Return\uFF08\u6839\u636E\u5E73\u53F0\uFF09\n\t\t\u5728\u7247\u6BB5\u4E2D\u63D2\u5165\u65B0\u884C\n\tCtrl+_\uFF08\u4E0B\u5212\u7EBF\u53EF\u80FD\u9700\u8981 Shift \u952E\uFF09\u6216 Ctrl+X \u7136\u540E Ctrl+U\n\t\t\u64A4\u6D88\u7F16\u8F91 - \u91CD\u590D\u64CD\u4F5C\u53EF\u64A4\u6D88\u591A\u9879\u7F16\u8F91\n\tDelete\n\t\t\u5220\u9664\u5149\u6807\u5904\u6216\u5176\u540E\u9762\u7684\u5B57\u7B26\uFF0C\u5177\u4F53\u53D6\u51B3\u4E8E\u64CD\u4F5C\u7CFB\u7EDF\n\tBackspace\n\t\t\u5220\u9664\u5149\u6807\u524D\u9762\u7684\u5B57\u7B26\n\tCtrl+K\n\t\t\u5220\u9664\u4ECE\u5149\u6807\u5230\u884C\u7ED3\u5C3E\u7684\u6587\u672C\n\tMeta+D\n\t\t\u5220\u9664\u4ECE\u5149\u6807\u5230\u5355\u8BCD\u7ED3\u5C3E\u7684\u6587\u672C\n\tCtrl+W\n\t\t\u5220\u9664\u4ECE\u5149\u6807\u5230\u524D\u4E00\u4E2A\u7A7A\u683C\u7684\u6587\u672C\n\tCtrl+Y\n\t\t\u5C06\u6700\u8FD1\u5220\u9664\u7684\u6587\u672C\u7C98\u8D34\u5230\u884C\u4E2D\n\tMeta+Y\n\t\t\u5728\u6309 Ctrl+Y \u4E4B\u540E\uFF0C\u6309 Meta+Y \u53EF\u5FAA\u73AF\u6D4F\u89C8\u5148\u524D\u5220\u9664\u7684\u6587\u672C\n\tCtrl+X \u7136\u540E Ctrl+K\n\t\t\u5220\u9664\u6574\u4E2A\u7247\u6BB5\n\n\njshell \u5DE5\u5177\u7684\u5FEB\u6377\u65B9\u5F0F\uFF1A\n\n\t\u6709\u5173\u8BE6\u7EC6\u4FE1\u606F\uFF0C\u8BF7\u53C2\u9605\uFF1A/help \u5FEB\u6377\u65B9\u5F0F\n\n\tTab\n\t\t\u5B8C\u6210 Java \u6807\u8BC6\u7B26\u6216 jshell \u547D\u4EE4\n\tShift+Tab \u7136\u540E v\n\t\t\u5C06\u8868\u8FBE\u5F0F\u8F6C\u6362\u4E3A\u53D8\u91CF\u58F0\u660E\n\tShift+Tab \u7136\u540E m\n\t\t\u5C06\u8BED\u53E5\u8F6C\u6362\u4E3A\u65B9\u6CD5\u58F0\u660E\n\tShift+Tab \u7136\u540E i\n\t\t\u4E3A\u6B64\u6807\u8BC6\u7B26\u6DFB\u52A0\u5BFC\u5165\n\t\n\n\u591A\u884C\u548C\u5386\u53F2\u8BB0\u5F55\u7F16\u8F91\uFF1A\n\n\tCtrl+L\n\t\t\u6E05\u9664\u5C4F\u5E55\u5E76\u91CD\u65B0\u8F93\u51FA\u7247\u6BB5\n\tCtrl+U\n\t\t\u7EC8\u6B62\u6574\u884C\n\tCtrl+T\n\t\t\u8F6C\u7F6E\u5B57\u7B26\n\tCtrl+X \u7136\u540E Ctrl+B\n\t\t\u5BFC\u822A\u5230\u5339\u914D\u7684\u65B9\u62EC\u53F7\u3001\u62EC\u53F7 ...\n\tCtrl+X \u7136\u540E =\n\t\t\u8FDB\u5165\u663E\u793A\u5F53\u524D\u5B57\u7B26\u4F4D\u7F6E\u7684\u6A21\u5F0F\n\tCtrl+X \u7136\u540E \
+Ctrl+O\n\t\t\u5728\u8986\u76D6\u5B57\u7B26\u4E0E\u63D2\u5165\u5B57\u7B26\u4E4B\u95F4\u5207\u6362\n\tMeta+C\n\t\t\u5355\u8BCD\u9996\u5B57\u6BCD\u5927\u5199\n\tMeta+U\n\t\t\u5C06\u5355\u8BCD\u8F6C\u6362\u4E3A\u5927\u5199\n\tMeta+L\n\t\t\u5C06\u5355\u8BCD\u8F6C\u6362\u4E3A\u5C0F\u5199\n\tMeta+0 \u81F3 Meta+9 \u7136\u540E\u952E\n\t\t\u91CD\u590D\u6307\u5B9A\u6B21\u6570\n\n\u4F8B\u5982 "Ctrl+A" \u8868\u793A\u6309\u4F4F Ctrl \u952E\u5E76\u6309 A\u3002\n\u5176\u4E2D "Meta" \u5728\u8BB8\u591A\u952E\u76D8\u4E0A\u662F "Alt"\u3002\n\u884C\u7F16\u8F91\u652F\u6301\u6E90\u81EA JLine 3\u3002
+
 help.shortcuts.summary = \u7247\u6BB5\u548C\u547D\u4EE4\u8F93\u5165\u63D0\u793A, \u4FE1\u606F\u8BBF\u95EE\u4EE5\u53CA\n\u81EA\u52A8\u4EE3\u7801\u751F\u6210\u7684\u6309\u952E\u8BF4\u660E
-help.shortcuts =\u652F\u6301\u7684\u5FEB\u6377\u65B9\u5F0F\u5305\u62EC\uFF1A\n\n<tab>\n\t\t\u5728\u8F93\u5165 Java \u6807\u8BC6\u7B26\u3001jshell \u5DE5\u5177\u547D\u4EE4\u6216 jshell\n\t\t\u5DE5\u5177\u547D\u4EE4\u53C2\u6570\uFF08\u5728\u67D0\u4E9B\u60C5\u51B5\u4E0B\uFF09\u7684\u524D\u51E0\u4E2A\u5B57\u6BCD\u540E\uFF0C\n\t\t\u6309 <tab> \u952E\u53EF\u4EE5\u5B8C\u6210\u8F93\u5165\u3002\n\t\t\u5982\u679C\u6709\u591A\u4E2A\u8F93\u5165\u63D0\u793A\uFF0C\u5219\u5C06\u663E\u793A\u53EF\u80FD\u7684\u8F93\u5165\u63D0\u793A\u3002\n\t\t\u5C06\u663E\u793A\u53EF\u7528\u7684\u9002\u7528\u6587\u6863\u3002\n\nShift-<tab> v\n\t\t\u5728\u5B8C\u6574\u7684\u8868\u8FBE\u5F0F\u540E\u9762\uFF0C\u6309\u4F4F <tab> \u7684\u540C\u65F6\u6309\u4E0B <shift>\uFF0C\n\t\t\u7136\u540E\u91CA\u653E\u5E76\u6309 "v"\uFF0C\u6B64\u65F6\u8868\u8FBE\u5F0F\u5C06\u8F6C\u6362\u4E3A\n\t\t\u5176\u7C7B\u578B\u57FA\u4E8E\u8868\u8FBE\u5F0F\u7C7B\u578B\u7684\u53D8\u91CF\u58F0\u660E\u3002\n\nShift-<tab> m\n\t\t\u5B8C\u6210\u8868\u8FBE\u5F0F\u6216\u8BED\u53E5\u4E4B\u540E\uFF0C\u6309\u4F4F <tab> \u7684\u540C\u65F6\u6309\u4F4F <shift>\uFF0C\n\t\t\u7136\u540E\u91CA\u653E\u5E76\u6309\u4F4F "m"\uFF0C\u5219\u8868\u8FBE\u5F0F\u6216\u8BED\u53E5\u5C06\u8F6C\u6362\u4E3A\n\t\t\u65B9\u6CD5\u58F0\u660E\u3002\u5982\u679C\u662F\u8868\u8FBE\u5F0F\uFF0C\u5219\u8FD4\u56DE\u7C7B\u578B\u57FA\u4E8E\u8868\u8FBE\u5F0F\u7684\n\t\t\u7C7B\u578B\u3002\n\nShift-<tab> i\n\t\t\u5728\u4E0D\u53EF\u89E3\u6790\u7684\u6807\u8BC6\u7B26\u540E\u9762\uFF0C\u6309\u4F4F <tab> \u7684\u540C\u65F6\u6309\u4E0B <shift>\uFF0C\n\t\t\u7136\u540E\u91CA\u653E\u5E76\u6309 "i"\uFF0C\u6B64\u65F6 jshell \u5DE5\u5177\u5C06\u4F1A\u5EFA\u8BAE\u53EF\u80FD\u7684\u5BFC\u5165\u9879\uFF0C\n\t\t\u8FD9\u5C06\u57FA\u4E8E\u6307\u5B9A\u7C7B\u8DEF\u5F84\u7684\u5185\u5BB9\u89E3\u6790\u6807\u8BC6\u7B26\u3002
+help.shortcuts =\u652F\u6301\u7684\u5FEB\u6377\u65B9\u5F0F\u5305\u62EC\uFF1A\n\n\tTab\n\t\t\u5728\u8F93\u5165 Java \u6807\u8BC6\u7B26\u3001jshell \u5DE5\u5177\u547D\u4EE4\u6216\n\t\t\u5728\u67D0\u4E9B\u60C5\u51B5\u4E0B\u8F93\u5165 jshell \u5DE5\u5177\u547D\u4EE4\u53C2\u6570\u7684\n\t\t\u524D\u51E0\u4E2A\u5B57\u6BCD\u540E\uFF0C\u6309 Tab \u952E\u53EF\u4EE5\u5B8C\u6210\u8F93\u5165\u3002\n\t\t\u5982\u679C\u6709\u591A\u4E2A\u8F93\u5165\u63D0\u793A\uFF0C\u5C06\u663E\u793A\u53EF\u80FD\u7684\u8F93\u5165\u63D0\u793A\u3002\n\t\t\u518D\u6309\u4E00\u6B21 Tab \u5C06\u663E\u793A\u53EF\u7528\u7684\u9002\u7528\u6587\u6863\u3002\n\n\tShift+Tab \u7136\u540E v\n\t\t\u5728\u5B8C\u6574\u7684\u8868\u8FBE\u5F0F\u540E\u9762\uFF0C\u6309\u4F4F Tab \u952E\u7684\u540C\u65F6\n\t\t\u6309\u4E0B Shift \u952E\uFF0C\u7136\u540E\u91CA\u653E\u5E76\u6309 "v" \u952E\uFF0C\u8868\u8FBE\u5F0F\n\t\t\u5C06\u8F6C\u6362\u4E3A\u7C7B\u578B\u57FA\u4E8E\u8868\u8FBE\u5F0F\u7C7B\u578B\u7684\u53D8\u91CF\u58F0\u660E\u3002\n\n\tShift+Tab \u7136\u540E m\n\t\t\u5B8C\u6210\u8868\u8FBE\u5F0F\u6216\u8BED\u53E5\u4E4B\u540E\uFF0C\u6309\u4F4F Tab \u952E\u7684\u540C\u65F6\n\t\t\u6309\u4E0B Shift \u952E\uFF0C\u7136\u540E\u91CA\u653E\u5E76\u6309\u4F4F "m" \u952E\uFF0C\u8868\u8FBE\u5F0F\u6216\n\t\t\u8BED\u53E5\u5C06\u8F6C\u6362\u4E3A\u65B9\u6CD5\u58F0\u660E\u3002\u5982\u679C\u662F\u8868\u8FBE\u5F0F\uFF0C\n\t\t\u5219\u65B9\u6CD5\u8FD4\u56DE\u7C7B\u578B\u57FA\u4E8E\u8868\u8FBE\u5F0F\u7684\u7C7B\u578B\u3002\n\n\tShift+Tab \u7136\u540E i\n\t\t\u5728\u4E0D\u53EF\u89E3\u6790\u7684\u6807\u8BC6\u7B26\u540E\u9762\uFF0C\u6309\u4F4F Tab \u952E\u7684\u540C\u65F6\n\t\t\u6309\u4E0B Shift \u952E\uFF0C\u7136\u540E\u91CA\u653E\u5E76\u6309 "i" \u952E\uFF0Cjshell \u5DE5\u5177\u4F1A\n\t\t\u63A8\u8350\u53EF\u80FD\u7684\u5BFC\u5165\u9879\uFF0C\u4EE5\u57FA\u4E8E\u6307\u5B9A\u7C7B\u8DEF\u5F84\u7684\u5185\u5BB9\u89E3\u6790\u6807\u8BC6\u7B26\u3002\n\t\t\u8F93\u5165\u4E0E\u6240\u9700\u5BFC\u5165\u5BF9\u5E94\u7684\u6570\u5B57\uFF0C\u6216\u6309 "0" \u952E\u4E0D\u6DFB\u52A0\u5BFC\u5165\u9879\u3002\n\n\u6709\u5173\u7279\u6B8A\u952E\u7684\u4FE1\u606F\uFF0C\u8BF7\u53C2\u9605\uFF1A/help \u952E
 
 help.context.summary = /env /reload \u548C /reset \u7684\u8BC4\u4F30\u4E0A\u4E0B\u6587\u9009\u9879\u7684\u8BF4\u660E
 help.context =\u8FD9\u4E9B\u9009\u9879\u7528\u4E8E\u914D\u7F6E\u8BC4\u4F30\u4E0A\u4E0B\u6587\u3002\u5B83\u4EEC\u53EF\u4EE5\u5728\u542F\u52A8 jshell \u5DE5\u5177\u65F6\n\u5728\u547D\u4EE4\u884C\u4E0A\u6307\u5B9A\uFF0C\u6216\u8005\u5728\u4F7F\u7528\u547D\u4EE4 /env\u3001/reload \u6216 /reset \n\u91CD\u65B0\u542F\u52A8 jshell \u5DE5\u5177\u65F6\u4F5C\u4E3A\u547D\u4EE4\u9009\u9879\u6307\u5B9A\u3002\n\n\u5B83\u4EEC\u662F\uFF1A\n\t--class-path <\u8DEF\u5F84>\n\t\t<\u8DEF\u5F84> \u662F\u7528\u4E8E\u641C\u7D22\u7C7B\u6587\u4EF6\u7684\u76EE\u5F55\u3001\n\t\tJAR \u6863\u6848\u548C ZIP \u6863\u6848\u7684\u5217\u8868\u3002\n\t\t\u5BF9\u4E8E Windows\uFF0C\u4F7F\u7528\u5206\u53F7 (;) \u5206\u9694\u8DEF\u5F84\u4E2D\u7684\u9879\u3002\n\t\t\u5728\u5176\u4ED6\u5E73\u53F0\u4E0A\uFF0C\u4F7F\u7528\u5192\u53F7 (:) \u5206\u9694\u5404\u9879\u3002\n\t--module-path <\u8DEF\u5F84>...\n\t\t<\u8DEF\u5F84> \u662F\u7528\u4E8E\u641C\u7D22\u6A21\u5757\u7684\u76EE\u5F55\u3001\n\t\tJAR \u6863\u6848\u548C ZIP \u6863\u6848\u7684\u5217\u8868\u3002\n\t\t\u5BF9\u4E8E Windows\uFF0C\u4F7F\u7528\u5206\u53F7 (;) \u5206\u9694\u8DEF\u5F84\u4E2D\u7684\u9879\u3002\n\t\t\u5728\u5176\u4ED6\u5E73\u53F0\u4E0A\uFF0C\u4F7F\u7528\u5192\u53F7 (:) \u5206\u9694\u5404\u9879\u3002\n\t--add-modules <\u6A21\u5757\u540D\u79F0>[,<\u6A21\u5757\u540D\u79F0>...]\n\t\t\u9664\u4E86\u521D\u59CB\u6A21\u5757\u4E4B\u5916\u8981\u89E3\u6790\u7684\u6839\u6A21\u5757\u3002\n\t\t<\u6A21\u5757\u540D\u79F0> \u8FD8\u53EF\u4EE5\u662F ALL-DEFAULT\u3001ALL-SYSTEM\u3001\n\t\tALL-MODULE-PATH\u3002\n\t--add-exports <\u6A21\u5757>/<\u7A0B\u5E8F\u5305>=<\u76EE\u6807\u6A21\u5757>(,<\u76EE\u6807\u6A21\u5757>)*\n\t\t\u66F4\u65B0 <\u6A21\u5757> \u4EE5\u5C06 <\u7A0B\u5E8F\u5305> \u5BFC\u51FA\u5230 <\u76EE\u6807\u6A21\u5757>\uFF0C\n\t\t\u800C\u65E0\u8BBA\u6A21\u5757\u58F0\u660E\u5982\u4F55\u3002\n\t\t<\u76EE\u6807\u6A21\u5757> \u53EF\u4EE5\u662F ALL-UNNAMED \u4EE5\u5BFC\u51FA\u5230\u5168\u90E8\n\t\t\u672A\u547D\u540D\u6A21\u5757\u3002\u5728 jshell \u4E2D\uFF0C\u5982\u679C\u672A\u6307\u5B9A \n\t\t<\u76EE\u6807\u6A21\u5757> (no =)\uFF0C\u5219\u4F7F\u7528 ALL-UNNAMED\u3002\n\n\u9664\u975E\u8F93\u5165\u7684\u9009\u9879\u8986\u76D6\u4E86\u8BBE\u7F6E\uFF0C\u5426\u5219\u5728\u547D\u4EE4\u884C\u4E0A\u8F93\u5165\u7684\n\u6216\u8005\u4F7F\u7528\u4EE5\u524D\u7684 /reset\u3001/env \u6216 /reload \u547D\u4EE4\u63D0\u4F9B\u7684\n\u8BC4\u4F30\u4E0A\u4E0B\u6587\u9009\u9879\u5C06\u4F1A\u4FDD\u7559\u3002\n\n\u5728\u547D\u4EE4\u884C\u4E0A\uFF0C\u8FD9\u4E9B\u9009\u9879\u5FC5\u987B\u5177\u6709\u4E24\u4E2A\u77ED\u5212\u7EBF\uFF0C\u4F8B\u5982\uFF1A--module-path\n\u5728 jshell \u5DE5\u5177\u547D\u4EE4\u4E0A\uFF0C\u5B83\u4EEC\u5FC5\u987B\u5177\u6709\u4E00\u4E2A\u6216\u4E24\u4E2A\u77ED\u5212\u7EBF\uFF0C\u4F8B\u5982\uFF1A-module-path
@@ -277,7 +281,7 @@
 help.id =\u8F93\u5165\u7684\u6BCF\u4E2A\u4EE3\u7801\u7247\u6BB5\u6709\u81EA\u5DF1\u7684\u552F\u4E00\u7247\u6BB5 ID\u3002\u5373\u4F7F\u518D\u6B21\n\u8F93\u5165\u76F8\u540C\u7684\u7247\u6BB5\uFF0C\u5B83\u90FD\u4F1A\u5177\u6709\u65B0 ID\u3002\u5BF9\u4E8E\u666E\u901A\u7247\u6BB5\uFF0CID\n\u662F\u4E00\u4E2A\u589E\u957F\u7684\u7F16\u53F7\u3002\u5BF9\u4E8E\u5931\u8D25\u4E14\u51FA\u9519\u7684\u7247\u6BB5\uFF0C\u5176\u7247\u6BB5 ID\n\u4EE5 "e" \u5F00\u5934\u3002\u5BF9\u4E8E\u542F\u52A8\u4E2D\u7684\u7247\u6BB5\uFF0C\u5176 ID \u4EE5 "s" \u5F00\u5934\u3002\n\n\u7247\u6BB5 ID \u662F\u5728\u547D\u4EE4\u4E2D\u5F15\u7528\u7247\u6BB5\u7684\u4E00\u79CD\u65B9\u6CD5\u3002\u4F8B\u5982\uFF0C\n\u6B64\u547D\u4EE4\u5220\u9664 ID \u4E3A '14' \u7684\u7247\u6BB5\uFF1A\n\n\t/drop 14\n\n\u8981\u67E5\u770B\u4E00\u4E2A\u6216\u591A\u4E2A\u7247\u6BB5\u7684 ID\uFF0C\u8BF7\u4F7F\u7528 '/list' \u547D\u4EE4\u3002\u8981\u67E5\u770B\u6240\u6709\n\u7247\u6BB5\u7684 ID\uFF0C\u5305\u62EC\u5931\u8D25\u7247\u6BB5\u3001\u542F\u52A8\u7247\u6BB5\u548C\u8986\u76D6\u7247\u6BB5\uFF0C\u8BF7\u4F7F\u7528\n'/list -all' \u547D\u4EE4\u3002\n\n\u60A8\u8FD8\u53EF\u4EE5\u4F7F\u7528\u8FDE\u5B57\u7B26\u5206\u9694\u5F00\u59CB ID \u548C\u7ED3\u675F ID\uFF0C\n\u4EE5\u6B64\u6765\u5F15\u7528 ID \u8303\u56F4\u3002\u4F8B\u5982\uFF0C'1-4' \u4E0E '1 2 3 4' \u76F8\u540C\u3002\n\u5F15\u7528\u7247\u6BB5\u7684\u6240\u6709\u547D\u4EE4\u5C06\u83B7\u53D6 ID\u3001ID \u8303\u56F4\u4EE5\u53CA\u7247\u6BB5\u540D\u79F0\u7684\n\u5217\u8868\u4F5C\u4E3A\u53C2\u6570\u3002\u8FD9\u4E9B\u547D\u4EE4\u5305\u62EC\uFF1A/list\u3001/edit\u3001/drop\u3001/save\u3001/vars\u3001/methods\u3001\n/types \u548C /<id>\u3002\u4E00\u4E9B\u793A\u4F8B\uFF1A\n\n\t/edit 7-23\n\n\t/save s1-s4 3-8 foo 12 myfile\n\n\t/9-12 33\n\n\u5206\u522B\u53C2\u89C1 '/help /edit'\u3001'/help /save' \u548C '/help rerun'\u3002
 
 help.rerun.summary = \u91CD\u65B0\u8BC4\u4F30\u4EE5\u524D\u8F93\u5165\u7247\u6BB5\u7684\u65B9\u6CD5\u7684\u8BF4\u660E
-help.rerun =\u91CD\u65B0\u8BC4\u4F30\u4EE5\u524D\u8F93\u5165\u7684\u7247\u6BB5\u6709\u56DB\u79CD\u65B9\u6CD5\u3002\n\u91CD\u65B0\u8BC4\u4F30\u4E0A\u4E00\u4E2A\u7247\u6BB5\u4F7F\u7528\u7684\u65B9\u6CD5\u4E3A\uFF1A/!\n\u53EF\u4EE5\u4F7F\u7528\u659C\u6760\u52A0\u51CF\u53F7\u52A0\u6570\u5B57 n \u7684\u65B9\u5F0F\u6765\u91CD\u65B0\u8BC4\u4F30\u4E4B\u524D\u7684\u7B2C n \u4E2A\u7247\u6BB5\uFF0C\u4F8B\u5982\uFF1A/-4\n\u4F8B\u5982\uFF1A\n\n\tjshell> 2 + 2\n\t$1 ==> 4\n\n\tjshell> /!\n\t2 + 2\n\t$2 ==> 4\n\n\tjshell> int z\n\tz ==> 0\n\n\tjshell> /-1\n\tint z;\n\tz ==> 0\n\n\tjshell> /-4\n\t2 + 2\n\t$5 ==> 4\n\n\u53EF\u4EE5\u4F7F\u7528\u7247\u6BB5 ID \u6216 ID \u8303\u56F4\u6307\u5B9A\u8981\u91CD\u65B0\u8BC4\u4F30\u7684\u7247\u6BB5\u3002\nID \u8303\u56F4\u4F7F\u7528\u901A\u8FC7\u8FDE\u5B57\u7B26\u5206\u9694\u7684\u4E24\u4E2A ID \u8868\u793A\uFF0C\u4F8B\u5982\uFF1A3-17\n\u53EF\u4EE5\u4F7F\u7528\u542F\u52A8\u548C\u9519\u8BEF\u7247\u6BB5\uFF0C\u4F8B\u5982\uFF1As3-s9 \u6216 e1-e4\n\u53EF\u4EE5\u4F7F\u7528\u4EFB\u610F\u6570\u91CF\u7684 ID \u6216 ID \u8303\u56F4\uFF0C\u4F8B\u5982\uFF1A/3-7 s4 14-16 e2\n\u53E6\u8BF7\u53C2\u89C1 '/help id'\u3002\n\n\u6700\u540E\uFF0C\u53EF\u4EE5\u901A\u8FC7\u8F93\u5165 ctrl-R \u540E\u8DDF\u8981\u641C\u7D22\u7684\u5B57\u7B26\u4E32\uFF0C\u5728\u5386\u53F2\u8BB0\u5F55\u4E2D\u5411\u540E\u641C\u7D22\u3002
+help.rerun =\u91CD\u65B0\u8BC4\u4F30\u4EE5\u524D\u8F93\u5165\u7684\u7247\u6BB5\u6709\u56DB\u79CD\u65B9\u6CD5\u3002\n\u53EF\u4F7F\u7528\u4EE5\u4E0B\u65B9\u6CD5\u91CD\u65B0\u8BC4\u4F30\u4E0A\u4E00\u4E2A\u7247\u6BB5\uFF1A/!\n\u53EF\u4EE5\u4F7F\u7528\u659C\u6760\u52A0\u51CF\u53F7\u52A0\u6570\u5B57 n \u7684\u65B9\u5F0F\u6765\u91CD\u65B0\u8BC4\u4F30\u4E4B\u524D\u7684\u7B2C n \u4E2A\u7247\u6BB5\uFF0C\u4F8B\u5982\uFF1A/-4\n\u4F8B\u5982\uFF1A\n\n\tjshell> 2 + 2\n\t$1 ==> 4\n\n\tjshell> /!\n\t2 + 2\n\t$2 ==> 4\n\n\tjshell> int z\n\tz ==> 0\n\n\tjshell> /-1\n\tint z;\n\tz ==> 0\n\n\tjshell> /-4\n\t2 + 2\n\t$5 ==> 4\n\n\u53EF\u4EE5\u4F7F\u7528\u7247\u6BB5 ID \u6216 ID \u8303\u56F4\u6307\u5B9A\u8981\u91CD\u65B0\u8BC4\u4F30\u7684\u7247\u6BB5\u3002\nID \u8303\u56F4\u4F7F\u7528\u8FDE\u5B57\u7B26\u5206\u9694\u7684\u4E24\u4E2A ID \u8868\u793A\uFF0C\u4F8B\u5982\uFF1A3-17\n\u53EF\u4EE5\u4F7F\u7528\u542F\u52A8\u548C\u9519\u8BEF\u7247\u6BB5\uFF0C\u4F8B\u5982\uFF1As3-s9 \u6216 e1-e4\n\u53EF\u4EE5\u4F7F\u7528\u4EFB\u610F\u6570\u91CF\u7684 ID \u6216 ID \u8303\u56F4\uFF0C\u4F8B\u5982\uFF1A/3-7 s4 14-16 e2\n\u53E6\u8BF7\u53C2\u89C1 '/help id'\u3002\n\n\u6700\u540E\uFF0C\u53EF\u4EE5\u901A\u8FC7\u8F93\u5165 Ctrl+R \u540E\u8DDF\u8981\u641C\u7D22\u7684\u5B57\u7B26\u4E32\uFF0C\u5728\u5386\u53F2\u8BB0\u5F55\u4E2D\u5411\u540E\u641C\u7D22\u3002
 
 help.set._retain = '-retain' \u9009\u9879\u4FDD\u5B58\u8BBE\u7F6E\u4EE5\u4FBF\u5728\u5C06\u6765\u4F1A\u8BDD\u4E2D\u4F7F\u7528\u3002\n\u53EF\u4EE5\u5728 /set \u7684\u4EE5\u4E0B\u683C\u5F0F\u4E2D\u4F7F\u7528 -retain \u9009\u9879:\n\n\t/set editor -retain\n\t/set start -retain\n\t/set feedback -retain\n\t/set mode -retain\n\n\u6709\u5173\u8BE6\u7EC6\u4FE1\u606F, \u8BF7\u53C2\u9605\u8FD9\u4E9B\u547D\u4EE4 -- \u4F8B\u5982, /help /set editor
 
--- a/test/hotspot/gtest/jfr/test_networkUtilization.cpp	Thu Dec 13 11:51:06 2018 -0800
+++ b/test/hotspot/gtest/jfr/test_networkUtilization.cpp	Tue Jan 15 10:55:26 2019 -0800
@@ -258,7 +258,7 @@
   JfrNetworkUtilization::send_events();
   ASSERT_EQ(1u, MockEventNetworkUtilization::committed.size());
   MockEventNetworkUtilization& e = MockEventNetworkUtilization::committed[0];
-  EXPECT_EQ(5, e.readRate);
+  EXPECT_EQ(40, e.readRate);
   EXPECT_EQ(0, e.writeRate);
   EXPECT_STREQ("eth0", e.iface.c_str());
 }
@@ -282,16 +282,16 @@
   const MockEventNetworkUtilization& eth1_event = MockEventNetworkUtilization::get_committed("eth1");
   const MockEventNetworkUtilization& ppp0_event = MockEventNetworkUtilization::get_committed("ppp0");
 
-  EXPECT_EQ(5, eth0_event.readRate);
+  EXPECT_EQ(40, eth0_event.readRate);
   EXPECT_EQ(0, eth0_event.writeRate);
   EXPECT_STREQ("eth0", eth0_event.iface.c_str());
 
-  EXPECT_EQ(50, eth1_event.readRate);
+  EXPECT_EQ(400, eth1_event.readRate);
   EXPECT_EQ(0, eth1_event.writeRate);
   EXPECT_STREQ("eth1", eth1_event.iface.c_str());
 
   EXPECT_EQ(0, ppp0_event.readRate);
-  EXPECT_EQ(25, ppp0_event.writeRate);
+  EXPECT_EQ(200, ppp0_event.writeRate);
   EXPECT_STREQ("ppp0", ppp0_event.iface.c_str());
 }
 
@@ -310,11 +310,11 @@
   const MockEventNetworkUtilization& eth0_event = MockEventNetworkUtilization::get_committed("eth0");
   const MockEventNetworkUtilization& eth1_event = MockEventNetworkUtilization::get_committed("eth1");
 
-  EXPECT_EQ(5, eth0_event.readRate);
+  EXPECT_EQ(40, eth0_event.readRate);
   EXPECT_EQ(0, eth0_event.writeRate);
   EXPECT_STREQ("eth0", eth0_event.iface.c_str());
 
-  EXPECT_EQ(10, eth1_event.readRate);
+  EXPECT_EQ(80, eth1_event.readRate);
   EXPECT_EQ(0, eth1_event.writeRate);
   EXPECT_STREQ("eth1", eth1_event.iface.c_str());
 
@@ -327,7 +327,7 @@
   ASSERT_EQ(1u, MockEventNetworkUtilization::committed.size());
   const MockEventNetworkUtilization& eth1_event_v2 = MockEventNetworkUtilization::get_committed("eth1");
 
-  EXPECT_EQ(5, eth1_event_v2.readRate);
+  EXPECT_EQ(40, eth1_event_v2.readRate);
   EXPECT_EQ(0, eth1_event_v2.writeRate);
   EXPECT_STREQ("eth1", eth1_event_v2.iface.c_str());
 }
@@ -343,7 +343,7 @@
   JfrNetworkUtilization::send_events();
   ASSERT_EQ(1u, MockEventNetworkUtilization::committed.size());
   const MockEventNetworkUtilization& event = MockEventNetworkUtilization::committed[0];
-  EXPECT_EQ(5, event.readRate);
+  EXPECT_EQ(40, event.readRate);
   EXPECT_EQ(0, event.writeRate);
   EXPECT_STREQ("eth0", event.iface.c_str());
 
@@ -360,7 +360,7 @@
   JfrNetworkUtilization::send_events();
   ASSERT_EQ(1u, MockEventNetworkUtilization::committed.size());
   const MockEventNetworkUtilization& event_v2 = MockEventNetworkUtilization::committed[0];
-  EXPECT_EQ(5, event_v2.readRate);
+  EXPECT_EQ(40, event_v2.readRate);
   EXPECT_EQ(0, event_v2.writeRate);
   EXPECT_STREQ("eth0", event_v2.iface.c_str());
 }
--- a/test/hotspot/jtreg/ProblemList.txt	Thu Dec 13 11:51:06 2018 -0800
+++ b/test/hotspot/jtreg/ProblemList.txt	Tue Jan 15 10:55:26 2019 -0800
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -83,8 +83,8 @@
 
 runtime/appcds/javaldr/GCSharedStringsDuringDump.java 8208778 macosx-x64
 runtime/appcds/javaldr/GCDuringDump.java 8208778 macosx-x64
-runtime/appcds/jigsaw/classpathtests/EmptyClassInBootClassPath.java 8213299 generic-all
 runtime/CompressedOops/UseCompressedOops.java 8079353 generic-all
+runtime/handshake/HandshakeWalkSuspendExitTest.java 8214174 generic-all
 runtime/RedefineTests/RedefineRunningMethods.java 8208778 macosx-x64
 runtime/SharedArchiveFile/SASymbolTableTest.java 8193639 solaris-all
 
--- a/test/hotspot/jtreg/TEST.groups	Thu Dec 13 11:51:06 2018 -0800
+++ b/test/hotspot/jtreg/TEST.groups	Tue Jan 15 10:55:26 2019 -0800
@@ -40,7 +40,8 @@
   -:tier1_compiler_not_cms
 
 hotspot_gc = \
-  gc
+  gc \
+  -gc/nvdimm
 
 hotspot_runtime = \
   runtime
@@ -190,7 +191,8 @@
   -gc/survivorAlignment/TestPromotionFromSurvivorToTenuredAfterMinorGC.java \
   -gc/cms/TestMBeanCMS.java \
   -gc/metaspace/CompressedClassSpaceSizeInJmapHeap.java \
-  -gc/shenandoah
+  -gc/shenandoah \
+  -gc/nvdimm
 
 gc_epsilon = \
   gc/epsilon/ \
--- a/test/hotspot/jtreg/applications/jcstress/JcstressRunner.java	Thu Dec 13 11:51:06 2018 -0800
+++ b/test/hotspot/jtreg/applications/jcstress/JcstressRunner.java	Tue Jan 15 10:55:26 2019 -0800
@@ -89,6 +89,11 @@
     private static String[] getCmd(String[] args) {
         List<String> extraFlags = new ArrayList<>();
 
+        // java.io.tmpdir is set for both harness and forked VM so temporary files
+        // created like this File.createTempFile("jcstress", "stdout");
+        // don't pollute temporary directories
+        extraFlags.add("-Djava.io.tmpdir=" + System.getProperty("user.dir"));
+
         // add jar with jcstress tests and harness to CP
         extraFlags.add("-cp");
         extraFlags.add(System.getProperty("java.class.path")
@@ -97,16 +102,11 @@
 
         extraFlags.add(MAIN_CLASS);
 
-        String[] javaOpts = Utils.getTestJavaOpts();
-        // disable flags auto-detection
-        if (0 == javaOpts.length) {
+        extraFlags.add("--jvmArgs");
+        extraFlags.add("-Djava.io.tmpdir=" + System.getProperty("user.dir"));
+        for (String jvmArg : Utils.getTestJavaOpts()) {
             extraFlags.add("--jvmArgs");
-            extraFlags.add("");
-        } else {
-            for (String jvmArg : Utils.getTestJavaOpts()) {
-                extraFlags.add("--jvmArgs");
-                extraFlags.add(jvmArg);
-            }
+            extraFlags.add(jvmArg);
         }
 
         String[] result = new String[extraFlags.size() + args.length];
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/hotspot/jtreg/compiler/aot/cli/jaotc/AtFileTest.java	Tue Jan 15 10:55:26 2019 -0800
@@ -0,0 +1,60 @@
+/*
+ * 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.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @summary check at-file jaotc support
+ * @comment based on CompileClassTest with arguments wrote in 'jaotc.cmd' file
+ * @requires vm.aot
+ * @bug 8215322
+ * @library / /test/lib /testlibrary
+ * @modules java.base/jdk.internal.misc
+ * @build compiler.aot.cli.jaotc.AtFileTest
+ * @run driver ClassFileInstaller compiler.aot.cli.jaotc.data.HelloWorldOne
+ * @run driver compiler.aot.cli.jaotc.AtFileTest
+ */
+
+package compiler.aot.cli.jaotc;
+
+import compiler.aot.cli.jaotc.data.HelloWorldOne;
+import java.io.File;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.nio.file.Files;
+import java.util.List;
+import jdk.test.lib.Asserts;
+import jdk.test.lib.process.OutputAnalyzer;
+
+public class AtFileTest {
+    public static void main(String[] args) throws Exception {
+        Path file = Paths.get("jatoc.cmd");
+        Files.write(file, List.of("--class-name",
+                JaotcTestHelper.getClassAotCompilationName(HelloWorldOne.class)));
+        OutputAnalyzer oa = JaotcTestHelper.compileLibrary("@" + file.toString());
+        oa.shouldHaveExitValue(0);
+        File compiledLibrary = new File(JaotcTestHelper.DEFAULT_LIB_PATH);
+        Asserts.assertTrue(compiledLibrary.exists(), "Compiled library file missing");
+        Asserts.assertGT(compiledLibrary.length(), 0L, "Unexpected compiled library size");
+        JaotcTestHelper.checkLibraryUsage(HelloWorldOne.class.getName());
+    }
+}
--- a/test/hotspot/jtreg/compiler/c2/cr6340864/TestByteVect.java	Thu Dec 13 11:51:06 2018 -0800
+++ b/test/hotspot/jtreg/compiler/c2/cr6340864/TestByteVect.java	Tue Jan 15 10:55:26 2019 -0800
@@ -27,6 +27,9 @@
  * @summary Implement vectorization optimizations in hotspot-server
  *
  * @run main/othervm/timeout=400 -Xbatch -Xmx128m compiler.c2.cr6340864.TestByteVect
+ * @run main/othervm/timeout=400 -Xbatch -Xmx128m -XX:MaxVectorSize=8 compiler.c2.cr6340864.TestByteVect
+ * @run main/othervm/timeout=400 -Xbatch -Xmx128m -XX:MaxVectorSize=16 compiler.c2.cr6340864.TestByteVect
+ * @run main/othervm/timeout=400 -Xbatch -Xmx128m -XX:MaxVectorSize=32 compiler.c2.cr6340864.TestByteVect
  */
 
 package compiler.c2.cr6340864;
--- a/test/hotspot/jtreg/compiler/c2/cr6340864/TestDoubleVect.java	Thu Dec 13 11:51:06 2018 -0800
+++ b/test/hotspot/jtreg/compiler/c2/cr6340864/TestDoubleVect.java	Tue Jan 15 10:55:26 2019 -0800
@@ -27,6 +27,9 @@
  * @summary Implement vectorization optimizations in hotspot-server
  *
  * @run main/othervm/timeout=400 -Xbatch -Xmx128m compiler.c2.cr6340864.TestDoubleVect
+ * @run main/othervm/timeout=400 -Xbatch -Xmx128m -XX:MaxVectorSize=8 compiler.c2.cr6340864.TestDoubleVect
+ * @run main/othervm/timeout=400 -Xbatch -Xmx128m -XX:MaxVectorSize=16 compiler.c2.cr6340864.TestDoubleVect
+ * @run main/othervm/timeout=400 -Xbatch -Xmx128m -XX:MaxVectorSize=32 compiler.c2.cr6340864.TestDoubleVect
  */
 
 package compiler.c2.cr6340864;
--- a/test/hotspot/jtreg/compiler/c2/cr6340864/TestFloatVect.java	Thu Dec 13 11:51:06 2018 -0800
+++ b/test/hotspot/jtreg/compiler/c2/cr6340864/TestFloatVect.java	Tue Jan 15 10:55:26 2019 -0800
@@ -27,6 +27,9 @@
  * @summary Implement vectorization optimizations in hotspot-server
  *
  * @run main/othervm/timeout=400 -Xbatch -Xmx128m compiler.c2.cr6340864.TestFloatVect
+ * @run main/othervm/timeout=400 -Xbatch -Xmx128m -XX:MaxVectorSize=8 compiler.c2.cr6340864.TestFloatVect
+ * @run main/othervm/timeout=400 -Xbatch -Xmx128m -XX:MaxVectorSize=16 compiler.c2.cr6340864.TestFloatVect
+ * @run main/othervm/timeout=400 -Xbatch -Xmx128m -XX:MaxVectorSize=32 compiler.c2.cr6340864.TestFloatVect
  */
 
 package compiler.c2.cr6340864;
--- a/test/hotspot/jtreg/compiler/c2/cr6340864/TestIntVect.java	Thu Dec 13 11:51:06 2018 -0800
+++ b/test/hotspot/jtreg/compiler/c2/cr6340864/TestIntVect.java	Tue Jan 15 10:55:26 2019 -0800
@@ -27,6 +27,9 @@
  * @summary Implement vectorization optimizations in hotspot-server
  *
  * @run main/othervm/timeout=400 -Xbatch -Xmx128m compiler.c2.cr6340864.TestIntVect
+ * @run main/othervm/timeout=400 -Xbatch -Xmx128m -XX:MaxVectorSize=8 compiler.c2.cr6340864.TestIntVect
+ * @run main/othervm/timeout=400 -Xbatch -Xmx128m -XX:MaxVectorSize=16 compiler.c2.cr6340864.TestIntVect
+ * @run main/othervm/timeout=400 -Xbatch -Xmx128m -XX:MaxVectorSize=32 compiler.c2.cr6340864.TestIntVect
  */
 
 package compiler.c2.cr6340864;
--- a/test/hotspot/jtreg/compiler/c2/cr6340864/TestLongVect.java	Thu Dec 13 11:51:06 2018 -0800
+++ b/test/hotspot/jtreg/compiler/c2/cr6340864/TestLongVect.java	Tue Jan 15 10:55:26 2019 -0800
@@ -27,6 +27,9 @@
  * @summary Implement vectorization optimizations in hotspot-server
  *
  * @run main/othervm/timeout=400 -Xbatch -Xmx128m compiler.c2.cr6340864.TestLongVect
+ * @run main/othervm/timeout=400 -Xbatch -Xmx128m -XX:MaxVectorSize=8 compiler.c2.cr6340864.TestLongVect
+ * @run main/othervm/timeout=400 -Xbatch -Xmx128m -XX:MaxVectorSize=16 compiler.c2.cr6340864.TestLongVect
+ * @run main/othervm/timeout=400 -Xbatch -Xmx128m -XX:MaxVectorSize=32 compiler.c2.cr6340864.TestLongVect
  */
 
 package compiler.c2.cr6340864;
--- a/test/hotspot/jtreg/compiler/c2/cr6340864/TestShortVect.java	Thu Dec 13 11:51:06 2018 -0800
+++ b/test/hotspot/jtreg/compiler/c2/cr6340864/TestShortVect.java	Tue Jan 15 10:55:26 2019 -0800
@@ -27,6 +27,9 @@
  * @summary Implement vectorization optimizations in hotspot-server
  *
  * @run main/othervm/timeout=400 -Xbatch -Xmx128m compiler.c2.cr6340864.TestShortVect
+ * @run main/othervm/timeout=400 -Xbatch -Xmx128m -XX:MaxVectorSize=8 compiler.c2.cr6340864.TestShortVect
+ * @run main/othervm/timeout=400 -Xbatch -Xmx128m -XX:MaxVectorSize=16 compiler.c2.cr6340864.TestShortVect
+ * @run main/othervm/timeout=400 -Xbatch -Xmx128m -XX:MaxVectorSize=32 compiler.c2.cr6340864.TestShortVect
  */
 
 package compiler.c2.cr6340864;
--- a/test/hotspot/jtreg/compiler/codegen/TestCharVect2.java	Thu Dec 13 11:51:06 2018 -0800
+++ b/test/hotspot/jtreg/compiler/codegen/TestCharVect2.java	Tue Jan 15 10:55:26 2019 -0800
@@ -27,6 +27,9 @@
  * @summary incorrect results of char vectors right shift operaiton
  *
  * @run main/othervm/timeout=400 -Xbatch -Xmx128m compiler.codegen.TestCharVect2
+ * @run main/othervm/timeout=400 -Xbatch -Xmx128m -XX:MaxVectorSize=8 compiler.codegen.TestCharVect2
+ * @run main/othervm/timeout=400 -Xbatch -Xmx128m -XX:MaxVectorSize=16 compiler.codegen.TestCharVect2
+ * @run main/othervm/timeout=400 -Xbatch -Xmx128m -XX:MaxVectorSize=32 compiler.codegen.TestCharVect2
  */
 
 package compiler.codegen;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/hotspot/jtreg/compiler/inlining/StringConcatInfiniteLoop.java	Tue Jan 15 10:55:26 2019 -0800
@@ -0,0 +1,54 @@
+/*
+ * Copyright (c) 2018, Red Hat, Inc. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test 8214862
+ * @summary Multiple passes of PhaseRemoveUseless causes infinite loop to be optimized out
+ *
+ * @run main/othervm -XX:-TieredCompilation -Xcomp -XX:CompileOnly=StringConcatInfiniteLoop::test -XX:CompileCommand=dontinline,*StringBuilder::* StringConcatInfiniteLoop
+ *
+ */
+
+public class StringConcatInfiniteLoop {
+    public static void main(String[] args) {
+        StringBuilder sb = new StringBuilder();
+        test(sb, "foo", "bar", true);
+    }
+
+    private static void test(Object v, String s1, String s2, boolean flag) {
+        if (flag) {
+            return;
+        }
+        int i = 0;
+        for (; i < 10; i++);
+        if (i == 10) {
+            v = null;
+        }
+        StringBuilder sb = new StringBuilder(s1);
+        sb.append(s2);
+        while (v == null);
+    }
+
+    private static class A {
+    }
+}
--- a/test/hotspot/jtreg/compiler/interpreter/TestVerifyStackAfterDeopt.java	Thu Dec 13 11:51:06 2018 -0800
+++ b/test/hotspot/jtreg/compiler/interpreter/TestVerifyStackAfterDeopt.java	Tue Jan 15 10:55:26 2019 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -28,6 +28,7 @@
  * @bug 8209825
  * @summary Checks VerifyStack after deoptimization of array allocation slow call
  * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:TieredStopAtLevel=1
+ *                   -XX:AllocatePrefetchLines=1 -XX:AllocateInstancePrefetchLines=1 -XX:AllocatePrefetchStepSize=16 -XX:AllocatePrefetchDistance=1
  *                   -XX:MinTLABSize=1k -XX:TLABSize=1k
  *                   -XX:+DeoptimizeALot -XX:+VerifyStack
  *                   compiler.interpreter.TestVerifyStackAfterDeopt
--- a/test/hotspot/jtreg/compiler/intrinsics/string/TestStringIntrinsics2.java	Thu Dec 13 11:51:06 2018 -0800
+++ b/test/hotspot/jtreg/compiler/intrinsics/string/TestStringIntrinsics2.java	Tue Jan 15 10:55:26 2019 -0800
@@ -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.
  * Copyright (c) 2016 SAP SE. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -642,6 +642,12 @@
             assertEquals(-3, asmStringCompareTo(a2, b2),
                          "TestOther.asmStringCompareTo(very_very_long_strings_2)");
         }
+
+        // See bug 8215100
+        {
+            assertEquals(-20, asmStringCompareTo("e.\u0259.", "y.e."));
+            assertEquals(20, asmStringCompareTo("y.e.", "e.\u0259."));
+        }
     }
 
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/hotspot/jtreg/compiler/loopopts/PeelingZeroTripCount.java	Tue Jan 15 10:55:26 2019 -0800
@@ -0,0 +1,56 @@
+/*
+ * Copyright (c) 2018, Red Hat, Inc. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 8215044
+ * @summary C2 crash in loopTransform.cpp with assert(cl->trip_count() > 0) failed: peeling a fully unrolled loop
+ *
+ * @run main/othervm -XX:CompileOnly=PeelingZeroTripCount.test PeelingZeroTripCount
+ *
+ */
+
+public class PeelingZeroTripCount {
+
+    public static void main(String[] args) {
+        PeelingZeroTripCount issue = new PeelingZeroTripCount();
+        for (int i = 0; i < 10000; i++) {
+            issue.test(new int[999]);
+        }
+    }
+
+    public void test(int[] iaarg) {
+        int[] iarr = new int[777];
+        for (int i = 4; i > 0; i--) {
+            for (int j = 0; j <= i - 1; j++) {
+                int istep = 2 * j - i + 1;
+                int iadj = 0;
+                if (istep < 0) {
+                    iadj = iarr[0-istep] + iaarg[i-1];
+                } else {
+                    iadj = iarr[istep] + iaarg[i-1];
+                }
+            }
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/hotspot/jtreg/compiler/loopopts/Test8210392.java	Tue Jan 15 10:55:26 2019 -0800
@@ -0,0 +1,65 @@
+/*
+ * Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * @test
+ * @bug 8210392
+ * @summary C2 Assert failure: Live node limit exceeded
+ *
+ * @run main/othervm compiler.loopopts.Test8210392
+ */
+
+package compiler.loopopts;
+
+public class Test8210392 {
+    public static int ival = 17;
+
+    public static int intFn() {
+        int v = 0, k = 0;
+        for (int i = 17; i < 311; i += 3) {
+            v = Test8210392.ival;
+            int j = 1;
+            do {
+                v *= i;
+                v += j * v;
+                while (++k < 1)
+                    ;
+            } while (++j < 13);
+        }
+        return v;
+    }
+
+    public void mainTest() {
+        for (int i = 0; i < 30000; i++) {
+            Test8210392.ival = intFn();
+        }
+    }
+
+    public static void main(String[] _args) {
+        Test8210392 tc = new Test8210392();
+        for (int i = 0; i < 10; i++) {
+            tc.mainTest();
+        }
+    }
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/hotspot/jtreg/compiler/loopopts/Test8211698.java	Tue Jan 15 10:55:26 2019 -0800
@@ -0,0 +1,57 @@
+/*
+ * 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.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 8211698
+ * @summary Crash in C2 compiled code during execution of double array heavy processing code
+ *
+ * @run main/othervm -XX:CompileOnly=Test8211698.test Test8211698
+ *
+ */
+
+public class Test8211698 {
+
+    public static void main(String[] args) {
+        Test8211698 issue = new Test8211698();
+        for (int i = 0; i < 10000; i++) {
+            issue.test();
+        }
+    }
+
+    public void test() {
+        int[] iarr1 = new int[888];
+        for (int i = 5; i > 0; i--) {
+            for (int j = 0; j <= i - 1; j++) {
+                int istep = 2 * j - i;
+                int iadj = 0;
+                if (istep < 0) {
+                    iadj = iarr1[-istep];
+                } else {
+                    iadj = iarr1[istep];
+                }
+            }
+        }
+    }
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/hotspot/jtreg/compiler/loopopts/TestSplitIfOpaque1.java	Tue Jan 15 10:55:26 2019 -0800
@@ -0,0 +1,97 @@
+/*
+ * 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.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * @test
+ * @bug 8214994
+ * @summary The split-if optimization fails because an unexpected Opaque1 is encountered.
+ * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:-UseOnStackReplacement -XX:-BackgroundCompilation
+ *                   compiler.loopopts.TestSplitIfOpaque1
+ */
+
+package compiler.loopopts;
+
+public class TestSplitIfOpaque1 {
+
+    static class MyClass {
+        int f;
+        MyClass(int f) {
+            this.f = f;
+        }
+    }
+
+    // The inner loop is found to be a counted loop and a loop limit check
+    // is added by updating the Opaque1 input of the predicate template.
+    // This Opaque1 node is then pushed upwards to before the predicates of
+    // the outer loop and ends up right after the second 'if (b)'.
+    // The split-if optimization kicks in and splits the first predicate of
+    // the outer loop (an "obj != NULL" check) through the 'if (b)' region.
+    // We fail because the region contains an unexpected Opaque1 node.
+    static int test1(boolean b, int limit, MyClass obj) {
+        int res = 0;
+        MyClass notNull = new MyClass(42);
+        if (b) {
+            limit = 100;
+        }
+        if (b) {
+            obj = notNull;
+        }
+        for (int i = 0; i < 1000; ++i) {
+            res += obj.f;
+            for (int j = 0; j <= limit; ++j) {
+                // Empty
+            }
+        }
+        return res;
+    }
+
+    // Same as test1 but triggers slightly different failure mode
+    static int test2(boolean b, int limit, MyClass obj, int[] array) {
+        int res = 0;
+        MyClass notNull = new MyClass(12);
+        if (b) {
+            limit = 100;
+        }
+        if (b) {
+            obj = notNull;
+        }
+        for (int i = 0; i < 1000; ++i) {
+            res += obj.f;
+            for (int j = 0; j <= limit; ++j) {
+                array[j] = j;
+            }
+        }
+        return res;
+    }
+
+    public static void main(String[] args) {
+        MyClass obj = new MyClass(42);
+        int[] array = new int[101];
+        for (int i = 0; i < 20_000; i++) {
+            test1(true, 50, obj);
+            test1(false, 100, obj);
+            test2(true, 50, obj, array);
+            test2(false, 100, obj, array);
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/hotspot/jtreg/compiler/rangechecks/RangeCheckEliminationScaleNotOne.java	Tue Jan 15 10:55:26 2019 -0800
@@ -0,0 +1,100 @@
+/*
+ * Copyright (c) 2018, Red Hat, Inc. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 8215265
+ * @summary C2: range check elimination may allow illegal out of bound access
+ *
+ * @run main/othervm -XX:-TieredCompilation -XX:-BackgroundCompilation -XX:-UseOnStackReplacement -XX:-UseLoopPredicate RangeCheckEliminationScaleNotOne
+ *
+ */
+
+import java.util.Arrays;
+
+public class RangeCheckEliminationScaleNotOne {
+    public static void main(String[] args) {
+        {
+            int[] array = new int[199];
+            boolean[] flags = new boolean[100];
+            Arrays.fill(flags, true);
+            flags[0] = false;
+            flags[1] = false;
+            for (int i = 0; i < 20_000; i++) {
+                test1(100, array, 0, flags);
+            }
+            boolean ex = false;
+            try {
+                test1(100, array, -5, flags);
+            } catch (ArrayIndexOutOfBoundsException aie) {
+                ex = true;
+            }
+            if (!ex) {
+                throw new RuntimeException("no AIOOB exception");
+            }
+        }
+
+        {
+            int[] array = new int[199];
+            boolean[] flags = new boolean[100];
+            Arrays.fill(flags, true);
+            flags[0] = false;
+            flags[1] = false;
+            for (int i = 0; i < 20_000; i++) {
+                test2(100, array, 198, flags);
+            }
+            boolean ex = false;
+            try {
+                test2(100, array, 203, flags);
+            } catch (ArrayIndexOutOfBoundsException aie) {
+                ex = true;
+            }
+            if (!ex) {
+                throw new RuntimeException("no AIOOB exception");
+            }
+        }
+    }
+
+    private static int test1(int stop, int[] array, int offset, boolean[] flags) {
+        if (array == null) {}
+        int res = 0;
+        for (int i = 0; i < stop; i++) {
+            if (flags[i]) {
+                res += array[2 * i + offset];
+            }
+        }
+        return res;
+    }
+
+
+    private static int test2(int stop, int[] array, int offset, boolean[] flags) {
+        if (array == null) {}
+        int res = 0;
+        for (int i = 0; i < stop; i++) {
+            if (flags[i]) {
+                res += array[-2 * i + offset];
+            }
+        }
+        return res;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/hotspot/jtreg/compiler/unsafe/MismatchedUnsafeLoadFromNewObject.java	Tue Jan 15 10:55:26 2019 -0800
@@ -0,0 +1,93 @@
+/*
+ * Copyright (c) 2019, Red Hat, Inc. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 8216549
+ * @summary Mismatched unsafe access to non escaping object fails
+ *
+ * @modules java.base/jdk.internal.misc
+ * @run main/othervm -XX:-UseOnStackReplacement -XX:-BackgroundCompilation MismatchedUnsafeLoadFromNewObject
+ */
+
+import java.lang.reflect.Field;
+import jdk.internal.misc.Unsafe;
+
+public class MismatchedUnsafeLoadFromNewObject {
+    public volatile int f_int = -1;
+    public volatile int f_int2 = -1;
+
+    public static Unsafe unsafe = Unsafe.getUnsafe();
+    public static final long f_int_off;
+    public static final long f_int2_off;
+
+    static {
+        Field f_int_field = null;
+        Field f_int2_field = null;
+        try {
+            f_int_field = MismatchedUnsafeLoadFromNewObject.class.getField("f_int");
+            f_int2_field = MismatchedUnsafeLoadFromNewObject.class.getField("f_int2");
+        } catch (Exception e) {
+            System.out.println("reflection failed " + e);
+            e.printStackTrace();
+        }
+        f_int_off = unsafe.objectFieldOffset(f_int_field);
+        f_int2_off = unsafe.objectFieldOffset(f_int2_field);
+    }
+
+    static public void main(String[] args) {
+        for (int i = 0; i < 20_000; i++) {
+            byte res = test1();
+            if (res != -1) {
+                throw new RuntimeException("Incorrect result: " + res);
+            }
+            res = test2();
+            if (res != -1) {
+                throw new RuntimeException("Incorrect result: " + res);
+            }
+            int res2 = test3();
+            if (res2 != -1) {
+                throw new RuntimeException("Incorrect result: " + res2);
+            }
+        }
+    }
+
+    static byte test1() {
+        MismatchedUnsafeLoadFromNewObject t = new MismatchedUnsafeLoadFromNewObject();
+        return unsafe.getByte(t, f_int_off);
+    }
+
+    static byte test2() {
+        MismatchedUnsafeLoadFromNewObject t = new MismatchedUnsafeLoadFromNewObject();
+        return unsafe.getByte(t, f_int_off+1);
+    }
+
+    static int test3() {
+        MismatchedUnsafeLoadFromNewObject t = new MismatchedUnsafeLoadFromNewObject();
+        if (f_int_off < f_int2_off) {
+            return unsafe.getIntUnaligned(t, f_int_off+1);
+        } else {
+            return unsafe.getIntUnaligned(t, f_int2_off+1);
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/hotspot/jtreg/gc/epsilon/TestArraycopyCheckcast.java	Tue Jan 15 10:55:26 2019 -0800
@@ -0,0 +1,89 @@
+/*
+ * Copyright (c) 2019, Red Hat, Inc. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * @test TestArraycopyCheckcast
+ * @key gc
+ * @requires vm.gc.Epsilon & !vm.graal.enabled
+ * @summary Epsilon is able to handle checkcasted array copies
+ * @library /test/lib
+ * @bug 8215724
+ *
+ * @run main/othervm -Xmx1g                                        -XX:+UnlockExperimentalVMOptions -XX:+UseEpsilonGC TestArraycopyCheckcast
+ * @run main/othervm -Xmx1g -Xint                                  -XX:+UnlockExperimentalVMOptions -XX:+UseEpsilonGC TestArraycopyCheckcast
+ * @run main/othervm -Xmx1g -Xbatch -Xcomp                         -XX:+UnlockExperimentalVMOptions -XX:+UseEpsilonGC TestArraycopyCheckcast
+ * @run main/othervm -Xmx1g -Xbatch -Xcomp -XX:TieredStopAtLevel=1 -XX:+UnlockExperimentalVMOptions -XX:+UseEpsilonGC TestArraycopyCheckcast
+ * @run main/othervm -Xmx1g -Xbatch -Xcomp -XX:-TieredCompilation  -XX:+UnlockExperimentalVMOptions -XX:+UseEpsilonGC TestArraycopyCheckcast
+ */
+
+import java.util.Random;
+
+public class TestArraycopyCheckcast {
+
+  static int COUNT = Integer.getInteger("count", 1000);
+
+  public static void main(String[] args) throws Exception {
+    Object[] src = new Object[COUNT];
+    Object[] dst = new B[COUNT];
+
+    // Test 1. Copy nulls, should succeed
+    try {
+      System.arraycopy(src, 0, dst, 0, COUNT);
+    } catch (ArrayStoreException e) {
+      throw new IllegalStateException("Should have completed");
+    }
+
+    // Test 2. Copying incompatible type, should fail
+    for (int c = 0; c < COUNT; c++) {
+      src[c] = new A();
+    }
+
+    try {
+      System.arraycopy(src, 0, dst, 0, COUNT);
+      throw new IllegalStateException("Should have failed with ArrayStoreException");
+    } catch (ArrayStoreException e) {
+      // Expected
+    }
+
+    // Test 3. Copying compatible type, should succeeded
+    for (int c = 0; c < COUNT; c++) {
+      src[c] = new C();
+    }
+
+    try {
+      System.arraycopy(src, 0, dst, 0, COUNT);
+    } catch (ArrayStoreException e) {
+      throw new IllegalStateException("Should have completed");
+    }
+
+    for (int c = 0; c < COUNT; c++) {
+      if (src[c] != dst[c]) {
+        throw new IllegalStateException("Copy failed at index " + c);
+      }
+    }
+  }
+
+  static class A {}
+  static class B extends A {}
+  static class C extends B {}
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/hotspot/jtreg/gc/nvdimm/TestAllocateOldGenAt.java	Tue Jan 15 10:55:26 2019 -0800
@@ -0,0 +1,79 @@
+/*
+ * Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/* @test TestAllocateOldGenAt.java
+ * @key gc
+ * @summary Test to check allocation of Java Heap with AllocateOldGenAt option
+ * @requires vm.gc=="null" & os.family != "aix"
+ * @library /test/lib
+ * @modules java.base/jdk.internal.misc
+ */
+
+import jdk.test.lib.JDKToolFinder;
+import jdk.test.lib.process.ProcessTools;
+import jdk.test.lib.process.OutputAnalyzer;
+import java.util.ArrayList;
+import java.util.Collections;
+
+public class TestAllocateOldGenAt {
+  private static ArrayList<String> commonOpts;
+
+  public static void main(String args[]) throws Exception {
+    commonOpts = new ArrayList();
+
+    String testVmOptsStr = System.getProperty("test.java.opts");
+    if (!testVmOptsStr.isEmpty()) {
+      String[] testVmOpts = testVmOptsStr.split(" ");
+      Collections.addAll(commonOpts, testVmOpts);
+    }
+    String test_dir = System.getProperty("test.dir", ".");
+    Collections.addAll(commonOpts, new String[] {"-XX:+UnlockExperimentalVMOptions",
+                                                 "-XX:AllocateOldGenAt=" + test_dir,
+                                                 "-Xmx32m",
+                                                 "-Xms32m",
+                                                 "-version"});
+
+    runTest("-XX:+UseG1GC");
+    runTest("-XX:+UseParallelOldGC -XX:-UseAdaptiveGCBoundary");
+    runTest("-XX:+UseParallelOldGC -XX:+UseAdaptiveGCBoundary");
+  }
+
+  private static void runTest(String... extraFlags) throws Exception {
+    ArrayList<String> testOpts = new ArrayList();
+    Collections.addAll(testOpts, commonOpts.toArray(new String[commonOpts.size()]));
+    Collections.addAll(testOpts, extraFlags);
+
+    System.out.print("Testing:\n" + JDKToolFinder.getJDKTool("java"));
+    for (int i = 0; i < testOpts.size(); i += 1) {
+      System.out.print(" " + testOpts.get(i));
+    }
+    System.out.println();
+
+    ProcessBuilder pb =
+      ProcessTools.createJavaProcessBuilder(testOpts.toArray(new String[testOpts.size()]));
+    OutputAnalyzer output = new OutputAnalyzer(pb.start());
+
+    output.shouldHaveExitValue(0);
+
+  }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/hotspot/jtreg/gc/nvdimm/TestAllocateOldGenAtError.java	Tue Jan 15 10:55:26 2019 -0800
@@ -0,0 +1,108 @@
+/*
+ * Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/* @test TestAllocateOldGenAtError.java
+ * @key gc
+ * @summary Test to check correct handling of non-existent directory passed to AllocateOldGenAt option
+ * @requires vm.gc=="null" & os.family != "aix"
+ * @library /test/lib
+ * @modules java.base/jdk.internal.misc
+ */
+
+import java.io.File;
+import jdk.test.lib.JDKToolFinder;
+import jdk.test.lib.process.ProcessTools;
+import jdk.test.lib.process.OutputAnalyzer;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.UUID;
+
+public class TestAllocateOldGenAtError {
+  private static ArrayList<String> commonOpts;
+
+  public static void main(String args[]) throws Exception {
+    commonOpts = new ArrayList();
+
+    String testVmOptsStr = System.getProperty("test.java.opts");
+    if (!testVmOptsStr.isEmpty()) {
+      String[] testVmOpts = testVmOptsStr.split(" ");
+      Collections.addAll(commonOpts, testVmOpts);
+    }
+    String test_dir = System.getProperty("test.dir", ".");
+
+    File f = null;
+    do {
+      f = new File(test_dir, UUID.randomUUID().toString());
+    } while(f.exists());
+
+    Collections.addAll(commonOpts, new String[] {"-XX:+UnlockExperimentalVMOptions",
+                                                 "-XX:AllocateOldGenAt=" + f.getName(),
+                                                 "-Xlog:gc+heap=info",
+                                                 "-Xmx32m",
+                                                 "-Xms32m",
+                                                 "-version"});
+
+    testG1();
+    testParallelOld();
+  }
+
+  private static void testG1() throws Exception {
+    System.out.println("Testing G1 GC");
+
+    OutputAnalyzer output = runTest("-XX:+UseG1GC");
+
+    output.shouldContain("Could not initialize G1 heap");
+    output.shouldContain("Error occurred during initialization of VM");
+    output.shouldNotHaveExitValue(0);
+
+  }
+
+  private static void testParallelOld() throws Exception {
+    System.out.println("Testing ParallelOld GC with UseAdaptiveGCBoundary disabled");
+    OutputAnalyzer output = runTest("-XX:+UseParallelOldGC -XX:-UseAdaptiveGCBoundary");
+    output.shouldContain("Error occurred during initialization of VM");
+    output.shouldNotHaveExitValue(0);
+
+    System.out.println("Testing ParallelOld GC with UseAdaptiveGCBoundary enabled");
+    output = runTest("-XX:+UseParallelOldGC -XX:+UseAdaptiveGCBoundary");
+    output.shouldContain("Error occurred during initialization of VM");
+    output.shouldNotHaveExitValue(0);
+  }
+
+  private static OutputAnalyzer runTest(String... extraFlags) throws Exception {
+    ArrayList<String> testOpts = new ArrayList();
+    Collections.addAll(testOpts, commonOpts.toArray(new String[commonOpts.size()]));
+    Collections.addAll(testOpts, extraFlags);
+
+    System.out.print("Testing:\n" + JDKToolFinder.getJDKTool("java"));
+    for (int i = 0; i < testOpts.size(); i += 1) {
+      System.out.print(" " + testOpts.get(i));
+    }
+    System.out.println();
+
+    ProcessBuilder pb =
+      ProcessTools.createJavaProcessBuilder(testOpts.toArray(new String[testOpts.size()]));
+    OutputAnalyzer output = new OutputAnalyzer(pb.start());
+    return output;
+  }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/hotspot/jtreg/gc/nvdimm/TestAllocateOldGenAtMultiple.java	Tue Jan 15 10:55:26 2019 -0800
@@ -0,0 +1,92 @@
+/*
+ * Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/* @test TestAllocateOldGenAtMultiple.java
+ * @key gc
+ * @summary Test to check allocation of Java Heap with AllocateOldGenAt option. Has multiple sub-tests to cover different code paths.
+ * @requires vm.gc=="null" & os.family != "aix"
+ * @library /test/lib
+ * @modules java.base/jdk.internal.misc
+ * @requires vm.bits == "64"
+ * @run main TestAllocateOldGenAtMultiple -XX:+UseG1GC
+ */
+
+import jdk.test.lib.JDKToolFinder;
+import jdk.test.lib.process.ProcessTools;
+import jdk.test.lib.process.OutputAnalyzer;
+import java.util.ArrayList;
+import java.util.Collections;
+
+public class TestAllocateOldGenAtMultiple {
+  public static void main(String args[]) throws Exception {
+    ArrayList<String> vmOpts = new ArrayList();
+    String[] testVmOpts = null;
+
+    String test_dir = System.getProperty("test.dir", ".");
+
+    String testVmOptsStr = System.getProperty("test.java.opts");
+    if (!testVmOptsStr.isEmpty()) {
+      testVmOpts = testVmOptsStr.split(" ");
+    }
+
+    // Extra options for each of the sub-tests
+    String[] extraOptsList = new String[] {
+      "-Xmx32m -Xms32m -XX:+UseCompressedOops",     // 1. With compressedoops enabled.
+      "-Xmx32m -Xms32m -XX:-UseCompressedOops",     // 2. With compressedoops disabled.
+      "-Xmx32m -Xms32m -XX:HeapBaseMinAddress=3g",  // 3. With user specified HeapBaseMinAddress.
+      "-Xmx4g -Xms4g",                              // 4. With larger heap size (UnscaledNarrowOop not possible).
+      "-Xmx4g -Xms4g -XX:+UseLargePages",           // 5. Set UseLargePages.
+      "-Xmx4g -Xms4g -XX:+UseNUMA"                  // 6. Set UseNUMA.
+    };
+
+    for(String extraOpts : extraOptsList) {
+      vmOpts.clear();
+      if(testVmOpts != null) {
+        Collections.addAll(vmOpts, testVmOpts);
+      }
+      // Add extra options specific to the sub-test.
+      String[] extraOptsArray = extraOpts.split(" ");
+      if(extraOptsArray != null) {
+        Collections.addAll(vmOpts, extraOptsArray);
+      }
+      // Add common options
+      Collections.addAll(vmOpts, new String[] {"-XX:+UnlockExperimentalVMOptions",
+                                               "-XX:AllocateOldGenAt=" + test_dir,
+                                               "-version"});
+
+      System.out.print("Testing:\n" + JDKToolFinder.getJDKTool("java"));
+      for (int i = 0; i < vmOpts.size(); i += 1) {
+        System.out.print(" " + vmOpts.get(i));
+      }
+      System.out.println();
+
+      ProcessBuilder pb =
+        ProcessTools.createJavaProcessBuilder(vmOpts.toArray(new String[vmOpts.size()]));
+      OutputAnalyzer output = new OutputAnalyzer(pb.start());
+
+      System.out.println("Output:\n" + output.getOutput());
+
+      output.shouldHaveExitValue(0);
+    }
+  }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/hotspot/jtreg/gc/nvdimm/TestHumongousObjectsOnNvdimm.java	Tue Jan 15 10:55:26 2019 -0800
@@ -0,0 +1,117 @@
+/*
+ * Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test TestHumongousObjectsOnNvdimm
+ * @summary Check that humongous objects reside in nv-dimm
+ * @library /test/lib /
+ * @requires vm.gc=="null" & os.family != "aix"
+ * @build sun.hotspot.WhiteBox
+ * @run driver ClassFileInstaller sun.hotspot.WhiteBox
+ * @run main TestHumongousObjectsOnNvdimm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
+ *                                  -XX:+WhiteBoxAPI
+ */
+
+import jdk.test.lib.process.OutputAnalyzer;
+import jdk.test.lib.process.ProcessTools;
+import jdk.test.lib.Asserts;
+import sun.hotspot.WhiteBox;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Collections;
+import gc.testlibrary.Helpers;
+
+/**
+ * Test spawns HumongousObjectTest in a separate VM and expects that it
+ * completes without a RuntimeException.
+ */
+public class TestHumongousObjectsOnNvdimm {
+
+    private static ArrayList<String> testOpts;
+
+    public static void main(String args[]) throws Exception {
+        testOpts = new ArrayList();
+
+        String[] common_options = new String[] {
+            "-Xbootclasspath/a:.",
+            "-XX:+UnlockExperimentalVMOptions",
+            "-XX:+UnlockDiagnosticVMOptions",
+            "-XX:+WhiteBoxAPI",
+            "-XX:AllocateOldGenAt="+System.getProperty("test.dir", "."),
+            "-Xms10M", "-Xmx10M",
+            "-XX:G1HeapRegionSize=1m"
+        };
+
+        String testVmOptsStr = System.getProperty("test.java.opts");
+        if (!testVmOptsStr.isEmpty()) {
+            String[] testVmOpts = testVmOptsStr.split(" ");
+            Collections.addAll(testOpts, testVmOpts);
+        }
+        Collections.addAll(testOpts, common_options);
+
+        // Test with G1 GC
+        runTest("-XX:+UseG1GC");
+    }
+
+    private static void runTest(String... extraFlags) throws Exception {
+        Collections.addAll(testOpts, extraFlags);
+        testOpts.add(HumongousObjectTest.class.getName());
+        System.out.println(testOpts);
+
+        ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(false,
+                testOpts.toArray(new String[testOpts.size()]));
+
+        OutputAnalyzer output = new OutputAnalyzer(pb.start());
+        output.shouldHaveExitValue(0);
+    }
+}
+
+/**
+ * This class tests that a humongous object resides in NVDIMM.
+ */
+class HumongousObjectTest {
+    private static final WhiteBox WB = WhiteBox.getWhiteBox();
+
+    private static void validateObject(Object o) {
+        Asserts.assertTrue(WB.isObjectInOldGen(o),
+                "Object is supposed to be in OldGen");
+
+        long obj_addr = WB.getObjectAddress(o);
+        long nvdimm_heap_start = WB.nvdimmReservedStart();
+        long nvdimm_heap_end = WB.nvdimmReservedEnd();
+
+        Asserts.assertTrue(WB.g1BelongsToHumongousRegion(obj_addr), "Object address should be in Humongous set");
+        Asserts.assertTrue(obj_addr >= nvdimm_heap_start && obj_addr < nvdimm_heap_end,
+                "Humongous object does not reside in NVDIMM");
+    }
+
+    public static void main(String args[]) throws Exception {
+        // allocate an humongous object
+        int byteArrayMemoryOverhead = Helpers.detectByteArrayAllocationOverhead();
+        int MinByteArrayHumongousSize = (WB.g1RegionSize() / 2) - byteArrayMemoryOverhead + 1;
+        byte[] obj = new byte[MinByteArrayHumongousSize];
+
+        validateObject(obj);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/hotspot/jtreg/gc/nvdimm/TestOldObjectsOnNvdimm.java	Tue Jan 15 10:55:26 2019 -0800
@@ -0,0 +1,121 @@
+/*
+ * Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test TestOldObjectsOnNvdimm
+ * @summary Check that objects in old generation reside in dram.
+ * @requires vm.gc=="null" & os.family != "aix"
+ * @library /test/lib
+ * @build sun.hotspot.WhiteBox
+ * @run driver ClassFileInstaller sun.hotspot.WhiteBox
+ * @run main TestOldObjectsOnNvdimm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
+ *                                  -XX:+WhiteBoxAPI
+ */
+
+import jdk.test.lib.process.OutputAnalyzer;
+import jdk.test.lib.process.ProcessTools;
+import jdk.test.lib.Asserts;
+import sun.hotspot.WhiteBox;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Collections;
+
+/*
+ * Test spawns OldObjectTest in a separate VM and expects that it
+ * completes without a RuntimeException.
+ */
+public class TestOldObjectsOnNvdimm {
+
+    public static final int ALLOCATION_SIZE = 100;
+    private static ArrayList<String> testOpts;
+
+    public static void main(String args[]) throws Exception {
+        testOpts = new ArrayList();
+
+        String[] common_options = new String[] {
+            "-Xbootclasspath/a:.",
+            "-XX:+UnlockExperimentalVMOptions",
+            "-XX:+UnlockDiagnosticVMOptions",
+            "-XX:+WhiteBoxAPI",
+            "-XX:AllocateOldGenAt="+System.getProperty("test.dir", "."),
+            "-Xms10M", "-Xmx10M",
+            "-XX:MaxTenuringThreshold=1" // Promote objects to Old Gen
+        };
+
+        String testVmOptsStr = System.getProperty("test.java.opts");
+        if (!testVmOptsStr.isEmpty()) {
+            String[] testVmOpts = testVmOptsStr.split(" ");
+            Collections.addAll(testOpts, testVmOpts);
+        }
+        Collections.addAll(testOpts, common_options);
+
+        // Test with G1 GC
+        runTest("-XX:+UseG1GC");
+        // Test with ParallelOld GC
+        runTest("-XX:+UseParallelOldGC -XX:-UseAdaptiveGCBoundary");
+        runTest("-XX:+UseParallelOldGC -XX:+UseAdaptiveGCBoundary");
+    }
+
+    private static void runTest(String... extraFlags) throws Exception {
+        Collections.addAll(testOpts, extraFlags);
+        testOpts.add(OldObjectTest.class.getName());
+        System.out.println(testOpts);
+
+        ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(false,
+                testOpts.toArray(new String[testOpts.size()]));
+
+        OutputAnalyzer output = new OutputAnalyzer(pb.start());
+        System.out.println(output.getStdout());
+        output.shouldHaveExitValue(0);
+    }
+}
+
+/*
+ * This class tests that object is in Old generation after tenuring and resides in NVDIMM.
+ * The necessary condition for this test is running in VM with the following flags:
+ * -XX:AllocateOldGenAt=, -XX:MaxTenuringThreshold=1
+ */
+class OldObjectTest {
+    private static final WhiteBox WB = WhiteBox.getWhiteBox();
+
+    private static void validateOldObject(Object o) {
+        Asserts.assertTrue(WB.isObjectInOldGen(o),
+                "Object is supposed to be in OldGen");
+
+        long oldObj_addr = WB.getObjectAddress(o);
+        long nvdimm_heap_start = WB.nvdimmReservedStart();
+        long nvdimm_heap_end = WB.nvdimmReservedEnd();
+
+        Asserts.assertTrue(oldObj_addr >= nvdimm_heap_start && oldObj_addr <= nvdimm_heap_end,
+                "Old object does not reside in NVDIMM");
+    }
+
+    public static void main(String args[]) throws Exception {
+        // allocate an object and perform Young GCs to promote it to Old
+        byte[] oldObj = new byte[TestOldObjectsOnNvdimm.ALLOCATION_SIZE];
+        WB.youngGC();
+        WB.youngGC();
+        validateOldObject(oldObj);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/hotspot/jtreg/gc/nvdimm/TestYoungObjectsOnDram.java	Tue Jan 15 10:55:26 2019 -0800
@@ -0,0 +1,125 @@
+/*
+ * Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test TestYoungObjectsOnDram
+ * @summary Check that objects in young generation reside in dram.
+ * @requires vm.gc=="null" & os.family != "aix"
+ * @library /test/lib
+ * @build sun.hotspot.WhiteBox
+ * @run driver ClassFileInstaller sun.hotspot.WhiteBox
+ * @run main TestYoungObjectsOnDram -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
+ *                                  -XX:+WhiteBoxAPI
+ */
+
+import jdk.test.lib.process.OutputAnalyzer;
+import jdk.test.lib.process.ProcessTools;
+import jdk.test.lib.Asserts;
+import sun.hotspot.WhiteBox;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Collections;
+
+/**
+ * Test spawns YoungObjectTest in a separate VM and expects that it
+ * completes without a RuntimeException.
+ */
+public class TestYoungObjectsOnDram {
+
+    public static final int ALLOCATION_SIZE = 100;
+    private static ArrayList<String> testOpts;
+
+    public static void main(String args[]) throws Exception {
+        testOpts = new ArrayList();
+
+        String[] common_options = new String[] {
+            "-Xbootclasspath/a:.",
+            "-XX:+UnlockExperimentalVMOptions",
+            "-XX:+UnlockDiagnosticVMOptions",
+            "-XX:+WhiteBoxAPI",
+            "-XX:AllocateOldGenAt="+System.getProperty("test.dir", "."),
+            "-XX:SurvivorRatio=1", // Survivor-to-eden ratio is 1:1
+            "-Xms10M", "-Xmx10M",
+            "-XX:InitialTenuringThreshold=15" // avoid promotion of objects to Old Gen
+        };
+
+        String testVmOptsStr = System.getProperty("test.java.opts");
+        if (!testVmOptsStr.isEmpty()) {
+            String[] testVmOpts = testVmOptsStr.split(" ");
+            Collections.addAll(testOpts, testVmOpts);
+        }
+        Collections.addAll(testOpts, common_options);
+
+        // Test with G1 GC
+        runTest("-XX:+UseG1GC");
+        // Test with ParallelOld GC
+        runTest("-XX:+UseParallelOldGC -XX:-UseAdaptiveGCBoundary");
+        runTest("-XX:+UseParallelOldGC -XX:+UseAdaptiveGCBoundary");
+    }
+
+    private static void runTest(String... extraFlags) throws Exception {
+        Collections.addAll(testOpts, extraFlags);
+        testOpts.add(YoungObjectTest.class.getName());
+        System.out.println(testOpts);
+
+        ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(false,
+                testOpts.toArray(new String[testOpts.size()]));
+
+        OutputAnalyzer output = new OutputAnalyzer(pb.start());
+        System.out.println(output.getStdout());
+        output.shouldHaveExitValue(0);
+    }
+}
+
+/**
+ * This class tests that newly created object is in Young generation and resides in DRAM.
+ * The necessary condition for this test is running in VM with the following flags:
+ * -XX:AllocateOldGenAt=, -XX:InitialTenuringThreshold=15, -XX:SurvivorRatio=1
+ */
+class YoungObjectTest {
+    private static final WhiteBox WB = WhiteBox.getWhiteBox();
+
+    private static void validateYoungObject(Object o) {
+        Asserts.assertTrue(!WB.isObjectInOldGen(o),
+                "Object is supposed to be in YoungGen");
+
+        long youngObj_addr = WB.getObjectAddress(o);
+        long dram_heap_start = WB.dramReservedStart();
+        long dram_heap_end = WB.dramReservedEnd();
+
+        Asserts.assertTrue(youngObj_addr >= dram_heap_start && youngObj_addr <= dram_heap_end,
+                "Young object does not reside in DRAM");
+    }
+
+    public static void main(String args[]) throws Exception {
+        // allocate an object
+        byte[] youngObj = new byte[TestYoungObjectsOnDram.ALLOCATION_SIZE];
+        validateYoungObject(youngObj);
+
+        // Start a Young GC and check that object is still in DRAM.
+        // We have used -XX:InitialTenuringThreshold=15 to invoke this test
+        WB.youngGC();
+        validateYoungObject(youngObj);
+    }
+}
--- a/test/hotspot/jtreg/runtime/SharedArchiveFile/SharedArchiveFile.java	Thu Dec 13 11:51:06 2018 -0800
+++ b/test/hotspot/jtreg/runtime/SharedArchiveFile/SharedArchiveFile.java	Tue Jan 15 10:55:26 2019 -0800
@@ -47,6 +47,13 @@
         OutputAnalyzer out = CDSTestUtils.executeAndLog(pb, "SharedArchiveFile");
         CDSTestUtils.checkDump(out);
 
+        // -XX:+DumpSharedSpaces should behave the same as -Xshare:dump
+        pb = ProcessTools.createJavaProcessBuilder(true,
+                                "-XX:SharedArchiveFile=./SharedArchiveFile.jsa",
+                                "-XX:+DumpSharedSpaces");
+        out = CDSTestUtils.executeAndLog(pb, "SharedArchiveFile");
+        CDSTestUtils.checkDump(out);
+
         pb = ProcessTools.createJavaProcessBuilder(true,
                               "-XX:SharedArchiveFile=./SharedArchiveFile.jsa",
                               "-Xshare:on", "-version");
--- a/test/hotspot/jtreg/runtime/appcds/ProtectionDomain.java	Thu Dec 13 11:51:06 2018 -0800
+++ b/test/hotspot/jtreg/runtime/appcds/ProtectionDomain.java	Tue Jan 15 10:55:26 2019 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -48,25 +48,24 @@
          TestCommon.list("ProtDomain",
                          "ProtDomainBOther",
                          "java/util/Dictionary",
-                         "sun/tools/javac/Main",
+                         "com/sun/tools/javac/Main",
                          "jdk/nio/zipfs/ZipInfo",
                          "java/net/URL",
                          "sun/rmi/rmic/Main",
                          "com/sun/jndi/dns/DnsName"));
 
-    OutputAnalyzer output;
-
     // First class is loaded from CDS, second class is loaded from JAR
-    output = TestCommon.exec(appJar, "ProtDomain");
-    TestCommon.checkExec(output, "Protection Domains match");
+    TestCommon.run("-cp", appJar, "ProtDomain")
+        .assertNormalExit("Protection Domains match");
 
     // First class is loaded from JAR, second class is loaded from CDS
-    output = TestCommon.exec(appJar, "ProtDomainB");
-    TestCommon.checkExec(output, "Protection Domains match");
+    TestCommon.run("-cp", appJar, "ProtDomainB")
+        .assertNormalExit("Protection Domains match");
 
     // Test ProtectionDomain for application and extension module classes from the
     // "modules" jimage
-    output = TestCommon.exec(appJar, "JimageClassProtDomain");
-    output.shouldNotContain("Failed: Protection Domains do not match");
+    TestCommon.run("-cp", appJar, "JimageClassProtDomain")
+        .assertNormalExit(output -> output.shouldNotContain(
+                          "Failed: Protection Domains do not match"));
   }
 }
--- a/test/hotspot/jtreg/runtime/appcds/test-classes/JimageClassProtDomain.java	Thu Dec 13 11:51:06 2018 -0800
+++ b/test/hotspot/jtreg/runtime/appcds/test-classes/JimageClassProtDomain.java	Tue Jan 15 10:55:26 2019 -0800
@@ -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
@@ -37,7 +37,7 @@
               "java.util.Dictionary", "java.util.ServiceConfigurationError"},
 
              {"Loading shared app module class first",
-              "sun.tools.javac.Main", "sun.tools.javac.BatchParser"},
+              "com.sun.tools.javac.Main", "com.sun.tools.javac.code.Symbol"},
 
              {"Loading shared ext module class first",
               "jdk.nio.zipfs.ZipInfo", "jdk.nio.zipfs.ZipPath"},
@@ -46,7 +46,7 @@
               "java.net.HttpCookie", "java.net.URL"},
 
              {"Loading non-shared app module class first",
-              "sun.rmi.rmic.RMIGenerator", "sun.rmi.rmic.Main"},
+              "com.sun.tools.sjavac.Util", "com.sun.tools.sjavac.Main"},
 
              {"Loading non-shared ext module class first",
               "com.sun.jndi.dns.Resolver", "com.sun.jndi.dns.DnsName"}};
@@ -61,13 +61,16 @@
         Class c1 = Class.forName(shared);
         Class c2 = Class.forName(nonShared);
         if (c1.getProtectionDomain() != c2.getProtectionDomain()) {
-            System.out.println("Failed: Protection Domains do not match!");
             System.out.println(c1.getProtectionDomain());
             System.out.println(c1.getProtectionDomain().getCodeSource());
             System.out.println(c2.getProtectionDomain());
             System.out.println(c2.getProtectionDomain().getCodeSource());
-            System.exit(1);
+            throw new RuntimeException("Failed: Protection Domains do not match!");
         } else {
+            System.out.println(c1.getProtectionDomain());
+            System.out.println(c1.getProtectionDomain().getCodeSource());
+            System.out.println(c2.getProtectionDomain());
+            System.out.println(c2.getProtectionDomain().getCodeSource());
             System.out.println("Passed: Protection Domains match.");
         }
     }
--- a/test/hotspot/jtreg/runtime/appcds/test-classes/ProtDomain.java	Thu Dec 13 11:51:06 2018 -0800
+++ b/test/hotspot/jtreg/runtime/appcds/test-classes/ProtDomain.java	Tue Jan 15 10:55:26 2019 -0800
@@ -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
@@ -42,8 +42,7 @@
     if (mine == his) {
       System.out.println("Protection Domains match");
     } else {
-      System.out.println("Protection Domains do not match!");
-      System.exit(1);
+      throw new RuntimeException("Protection Domains do not match!");
     }
   }
 }
--- a/test/hotspot/jtreg/runtime/appcds/test-classes/ProtDomainB.java	Thu Dec 13 11:51:06 2018 -0800
+++ b/test/hotspot/jtreg/runtime/appcds/test-classes/ProtDomainB.java	Tue Jan 15 10:55:26 2019 -0800
@@ -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
@@ -42,8 +42,7 @@
     if (mine == his) {
       System.out.println("Protection Domains match");
     } else {
-      System.out.println("Protection Domains do not match!");
-      System.exit(1);
+      throw new RuntimeException("Protection Domains do not match!");
     }
   }
 }
--- a/test/hotspot/jtreg/serviceability/jvmti/HeapMonitor/MyPackage/HeapMonitorThreadTest.java	Thu Dec 13 11:51:06 2018 -0800
+++ b/test/hotspot/jtreg/serviceability/jvmti/HeapMonitor/MyPackage/HeapMonitorThreadTest.java	Tue Jan 15 10:55:26 2019 -0800
@@ -30,7 +30,6 @@
  * @summary Verifies the JVMTI Heap Monitor Thread information sanity.
  * @compile HeapMonitorThreadTest.java
  * @run main/othervm/native -Xmx512m -agentlib:HeapMonitorTest MyPackage.HeapMonitorThreadTest
- * @requires !vm.gc.Z
  */
 
 import java.util.List;
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/AttachingConnector/attach/attach002.java	Thu Dec 13 11:51:06 2018 -0800
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/AttachingConnector/attach/attach002.java	Tue Jan 15 10:55:26 2019 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -203,6 +203,6 @@
                 return connector;
             }
         }
-        throw new Error("No appropriate connector");
+        throw new Error("No appropriate connector: " + connectorName);
     }
 }
--- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/Allocate/alloc001/TestDescription.java	Thu Dec 13 11:51:06 2018 -0800
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/Allocate/alloc001/TestDescription.java	Tue Jan 15 10:55:26 2019 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -21,6 +21,7 @@
  * questions.
  */
 
+// Not run on AIX as it does not support ulimit -v.
 
 /*
  * @test
@@ -40,6 +41,7 @@
  *
  * @library /vmTestbase
  *          /test/lib
+ * @requires os.family != "aix"
  * @run driver jdk.test.lib.FileInstaller . .
  * @build nsk.jvmti.Allocate.alloc001
  * @run shell alloc001.sh
--- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/Allocate/alloc001/alloc001.bash	Thu Dec 13 11:51:06 2018 -0800
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/Allocate/alloc001/alloc001.bash	Tue Jan 15 10:55:26 2019 -0800
@@ -1,5 +1,5 @@
 #!/bin/bash
-# Copyright (c) 2008, 2018, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2008, 2019, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -41,7 +41,8 @@
         max_ulimit=1048576
         max_heap=256m
     else
-        max_ulimit=4194304
+        # AIX requires a 32-bit value here.
+        max_ulimit=4194303
         max_heap=512m
     fi
 
@@ -74,6 +75,7 @@
 
 export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:$TESTNATIVEPATH
 export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$TESTNATIVEPATH
+export LIBPATH=$LIBPATH:$TESTNATIVEPATH
 export PATH=$PATH:$TESTNATIVEPATH
 
 echo $JAVA ${JAVA_OPTS} nsk.jvmti.Allocate.alloc001
--- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/RetransformClasses/retransform003/TestDriver.java	Thu Dec 13 11:51:06 2018 -0800
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/RetransformClasses/retransform003/TestDriver.java	Tue Jan 15 10:55:26 2019 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -76,8 +76,18 @@
                 "-agentlib:retransform003-03=id=3 can_retransform_classes=1",
                 nsk.jvmti.RetransformClasses.retransform003.class.getName()
         );
-        String envName = Platform.isWindows() ? "PATH" :
-                (Platform.isOSX() ? "DYLD_LIBRARY_PATH" : "LD_LIBRARY_PATH");
+
+        String envName;
+        if (Platform.isWindows()) {
+            envName = "PATH";
+        } else if (Platform.isOSX()) {
+            envName = "DYLD_LIBRARY_PATH";
+        } else if (Platform.isAix()) {
+            envName = "LIBPATH";
+        } else {
+            envName = "LD_LIBRARY_PATH";
+        }
+
         pb.environment()
           .merge(envName, ".", (x, y) -> y + File.pathSeparator + x);
 
--- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/SetNativeMethodPrefix/SetNativeMethodPrefix002/TestDriver.java	Thu Dec 13 11:51:06 2018 -0800
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/SetNativeMethodPrefix/SetNativeMethodPrefix002/TestDriver.java	Tue Jan 15 10:55:26 2019 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -66,8 +66,18 @@
                 "-agentlib:SetNativeMethodPrefix002-03=trace=all prefix=wc_",
                 nsk.jvmti.SetNativeMethodPrefix.SetNativeMethodPrefix002.class.getName()
         );
-        String envName = Platform.isWindows() ? "PATH" :
-                (Platform.isOSX() ? "DYLD_LIBRARY_PATH" : "LD_LIBRARY_PATH");
+
+        String envName;
+        if (Platform.isWindows()) {
+            envName = "PATH";
+        } else if (Platform.isOSX()) {
+            envName = "DYLD_LIBRARY_PATH";
+        } else if (Platform.isAix()) {
+            envName = "LIBPATH";
+        } else {
+            envName = "LD_LIBRARY_PATH";
+        }
+
         pb.environment()
           .merge(envName, ".", (x, y) -> y + File.pathSeparator + x);
 
--- a/test/hotspot/jtreg/vmTestbase/nsk/share/jdi/ArgumentHandler.java	Thu Dec 13 11:51:06 2018 -0800
+++ b/test/hotspot/jtreg/vmTestbase/nsk/share/jdi/ArgumentHandler.java	Tue Jan 15 10:55:26 2019 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -533,8 +533,12 @@
         {"linux-sparcv9",   "com.sun.jdi.SharedMemoryAttach"},
         {"linux-aarch64",   "com.sun.jdi.SharedMemoryAttach"},
         {"linux-arm",       "com.sun.jdi.SharedMemoryAttach"},
+        {"linux-ppc64",     "com.sun.jdi.SharedMemoryAttach"},
+        {"linux-ppc64le",   "com.sun.jdi.SharedMemoryAttach"},
+        {"linux-s390x",     "com.sun.jdi.SharedMemoryAttach"},
         {"macosx-amd64",    "com.sun.jdi.SharedMemoryAttach"},
         {"mac-x64",         "com.sun.jdi.SharedMemoryAttach"},
+        {"aix-ppc64",       "com.sun.jdi.SharedMemoryAttach"},
 
             // listening connectors
         /*
@@ -559,8 +563,12 @@
         {"linux-sparcv9",   "com.sun.jdi.SharedMemoryListen"},
         {"linux-aarch64",   "com.sun.jdi.SharedMemoryListen"},
         {"linux-arm",       "com.sun.jdi.SharedMemoryListen"},
+        {"linux-ppc64",     "com.sun.jdi.SharedMemoryListen"},
+        {"linux-ppc64le",   "com.sun.jdi.SharedMemoryListen"},
+        {"linux-s390x",     "com.sun.jdi.SharedMemoryListen"},
         {"macosx-amd64",    "com.sun.jdi.SharedMemoryListen"},
         {"mac-x64",         "com.sun.jdi.SharedMemoryListen"},
+        {"aix-ppc64",       "com.sun.jdi.SharedMemoryListen"},
 
             // launching connectors
         /*
@@ -615,6 +623,15 @@
         {"linux-arm",       "com.sun.jdi.CommandLineLaunch", "dt_shmem"},
         {"linux-arm",       "com.sun.jdi.RawCommandLineLaunch", "dt_shmem"},
 
+        {"linux-ppc64",     "com.sun.jdi.CommandLineLaunch", "dt_shmem"},
+        {"linux-ppc64",     "com.sun.jdi.RawCommandLineLaunch", "dt_shmem"},
+
+        {"linux-ppc64le",   "com.sun.jdi.CommandLineLaunch", "dt_shmem"},
+        {"linux-ppc64le",   "com.sun.jdi.RawCommandLineLaunch", "dt_shmem"},
+
+        {"linux-s390x",     "com.sun.jdi.CommandLineLaunch", "dt_shmem"},
+        {"linux-s390x",     "com.sun.jdi.RawCommandLineLaunch", "dt_shmem"},
+
         {"windows-i586",    "com.sun.jdi.CommandLineLaunch", "dt_socket"},
         {"windows-i586",    "com.sun.jdi.RawCommandLineLaunch", "dt_socket"},
 
@@ -633,6 +650,9 @@
         {"mac-x64",         "com.sun.jdi.CommandLineLaunch", "dt_shmem"},
         {"mac-x64",         "com.sun.jdi.RawCommandLineLaunch", "dt_shmem"},
 
+        {"aix-ppc64",       "com.sun.jdi.CommandLineLaunch", "dt_shmem"},
+        {"aix-ppc64",       "com.sun.jdi.RawCommandLineLaunch", "dt_shmem"},
+
         // shared memory transport is implemented only on windows platform
         {"solaris-sparc",   "dt_shmem"},
         {"solaris-sparcv9", "dt_shmem"},
@@ -647,7 +667,11 @@
         {"linux-sparcv9",   "dt_shmem"},
         {"linux-aarch64",   "dt_shmem"},
         {"linux-arm",       "dt_shmem"},
+        {"linux-ppc64",     "dt_shmem"},
+        {"linux-ppc64le",   "dt_shmem"},
+        {"linux-s390x",     "dt_shmem"},
         {"macosx-amd64",    "dt_shmem"},
         {"mac-x64",         "dt_shmem"},
+        {"aix-ppc64",       "dt_shmem"},
     };
 }
--- a/test/jdk/ProblemList.txt	Thu Dec 13 11:51:06 2018 -0800
+++ b/test/jdk/ProblemList.txt	Tue Jan 15 10:55:26 2019 -0800
@@ -583,7 +583,6 @@
 java/nio/file/WatchService/LotsOfCancels.java                   8188039 solaris-all Solaris 11
 java/nio/file/WatchService/LotsOfEvents.java                    7158947 solaris-all Solaris 11
 
-sun/nio/cs/OLD/TestIBMDB.java                                   8211841 aix-ppc64
 
 ############################################################################
 
--- a/test/jdk/java/lang/String/AlignIndent.java	Thu Dec 13 11:51:06 2018 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,214 +0,0 @@
-/*
- * 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.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * @test
- * @summary Unit tests for String#align and String#indent
- * @run main AlignIndent
- */
-
-import java.util.Arrays;
-import java.util.List;
-import java.util.stream.Collectors;
-import java.util.stream.Stream;
-
-public class AlignIndent {
-    static final List<String> ENDS = List.of("", "\n", "   \n", "\n\n", "\n\n\n");
-    static final List<String> MIDDLES = List.of(
-            "",
-            "xyz",
-            "   xyz",
-            "      xyz",
-            "xyz   ",
-            "   xyz   ",
-            "      xyz   ",
-            "xyz\u2022",
-            "   xyz\u2022",
-            "xyz\u2022   ",
-            "   xyz\u2022   ",
-            "   // comment"
-    );
-
-    public static void main(String[] args) {
-        test1();
-        test2();
-        test3();
-        test4();
-    }
-
-    /*
-     * Test String#align() functionality.
-     */
-    static void test1() {
-        for (String prefix : ENDS) {
-            for (String suffix : ENDS) {
-                for (String middle : MIDDLES) {
-                    {
-                        String input = prefix + "   abc   \n" + middle + "\n   def   \n" + suffix;
-                        String output = input.align();
-
-                        String[] inLines = input.split("\\R");
-                        String[] outLines = output.split("\\R");
-
-                        String[] inLinesBody = getBody(inLines);
-
-                        if (inLinesBody.length < outLines.length) {
-                            report("String::align()", "Result has more lines than expected", input, output);
-                        } else if (inLinesBody.length > outLines.length) {
-                            report("String::align()", "Result has fewer lines than expected", input, output);
-                        }
-
-                        int indent = -1;
-                        for (int i = 0; i < inLinesBody.length; i++) {
-                            String in = inLinesBody[i];
-                            String out = outLines[i];
-                            if (!out.isBlank()) {
-                                int offset = in.indexOf(out);
-                                if (offset == -1) {
-                                    report("String::align()", "Portions of line are missing", input, output);
-                                }
-                                if (indent == -1) {
-                                    indent = offset;
-                                } else if (offset != indent) {
-                                    report("String::align()",
-                                            "Inconsistent indentation in result", input, output);
-                                }
-                            }
-                        }
-                    }
-                }
-            }
-        }
-    }
-
-    /*
-     * Test String#align(int n) functionality.
-     */
-    static void test2() {
-        for (int adjust : new int[] {-8, -7, -4, -3, -2, -1, 0, 1, 2, 3, 4, 7, 8}) {
-            for (String prefix : ENDS) {
-                for (String suffix : ENDS) {
-                    for (String middle : MIDDLES) {
-                        {
-                            String input = prefix + "   abc   \n" + middle + "\n   def   \n" + suffix;
-                            String output = input.align(adjust);
-                            String expected = input.align().indent(adjust);
-
-                            if (!output.equals(expected)) {
-                                report("String::align(int n)",
-                                        "Result inconsistent with align().indent(n)", expected, output);
-                            }
-                        }
-                    }
-                }
-            }
-        }
-    }
-
-    /*
-     * Test String#indent(int n) functionality.
-     */
-    static void test3() {
-        for (int adjust : new int[] {-8, -7, -4, -3, -2, -1, 0, 1, 2, 3, 4, 7, 8}) {
-            for (String prefix : ENDS) {
-                for (String suffix : ENDS) {
-                    for (String middle : MIDDLES) {
-                        String input = prefix + "   abc   \n" + middle + "\n   def   \n" + suffix;
-                        String output = input.indent(adjust);
-
-                        Stream<String> stream = input.lines();
-                        if (adjust > 0) {
-                            final String spaces = " ".repeat(adjust);
-                            stream = stream.map(s -> s.isBlank() ? s : spaces + s);
-                        } else if (adjust < 0) {
-                            stream = stream.map(s -> s.substring(Math.min(-adjust, indexOfNonWhitespace(s))));
-                        }
-                        String expected = stream.collect(Collectors.joining("\n", "", "\n"));
-
-                        if (!output.equals(expected)) {
-                            report("String::indent(int n)",
-                                    "Result indentation not as expected", expected, output);
-                        }
-                    }
-                }
-            }
-        }
-    }
-
-    /*
-     * JDK-8212694: Using Raw String Literals with align() and Integer.MIN_VALUE causes out of memory error
-     */
-    static void test4() {
-        try {
-            String str = "\n    A\n".align(Integer.MIN_VALUE);
-        } catch (OutOfMemoryError ex) {
-            System.err.println("align(Integer.MIN_VALUE) not clipping indentation");
-            throw new RuntimeException();
-        }
-    }
-
-    public static int indexOfNonWhitespace(String s) {
-        int left = 0;
-        while (left < s.length()) {
-            char ch = s.charAt(left);
-            if (ch != ' ' && ch != '\t' && !Character.isWhitespace(ch)) {
-                break;
-            }
-            left++;
-        }
-        return left;
-    }
-
-
-    private static String[] getBody(String[] inLines) {
-        int from = -1, to = -1;
-        for (int i = 0; i < inLines.length; i++) {
-            String line = inLines[i];
-            if (!line.isBlank()) {
-                if (from == -1) {
-                    from = i;
-                }
-                to = i + 1;
-            }
-        }
-        return Arrays.copyOfRange(inLines, from, to);
-    }
-
-    /*
-     * Report difference in result.
-     */
-    static void report(String test, String message, String input, String output) {
-        System.err.println("Testing " + test + ": " + message);
-        System.err.println();
-        System.err.println("Input: length = " + input.length());
-        System.err.println("_".repeat(40));
-        System.err.print(input.replaceAll(" ", "."));
-        System.err.println("_".repeat(40));
-        System.err.println();
-        System.err.println("Output: length = " + output.length());
-        System.err.println("_".repeat(40));
-        System.err.print(output.replaceAll(" ", "."));
-        System.err.println("_".repeat(40));
-        throw new RuntimeException();
-    }
-}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/jdk/java/lang/String/Indent.java	Tue Jan 15 10:55:26 2019 -0800
@@ -0,0 +1,130 @@
+/*
+ * 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.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @summary Unit tests for String#indent
+ * @run main Indent
+ */
+
+import java.util.Arrays;
+import java.util.List;
+import java.util.stream.Collectors;
+import java.util.stream.Stream;
+
+public class Indent {
+    static final List<String> ENDS = List.of("", "\n", "   \n", "\n\n", "\n\n\n");
+    static final List<String> MIDDLES = List.of(
+            "",
+            "xyz",
+            "   xyz",
+            "      xyz",
+            "xyz   ",
+            "   xyz   ",
+            "      xyz   ",
+            "xyz\u2022",
+            "   xyz\u2022",
+            "xyz\u2022   ",
+            "   xyz\u2022   ",
+            "   // comment"
+    );
+
+    public static void main(String[] args) {
+        test1();
+    }
+
+    /*
+     * Test String#indent(int n) functionality.
+     */
+    static void test1() {
+        for (int adjust : new int[] {-8, -7, -4, -3, -2, -1, 0, 1, 2, 3, 4, 7, 8}) {
+            for (String prefix : ENDS) {
+                for (String suffix : ENDS) {
+                    for (String middle : MIDDLES) {
+                        String input = prefix + "   abc   \n" + middle + "\n   def   \n" + suffix;
+                        String output = input.indent(adjust);
+
+                        Stream<String> stream = input.lines();
+                        if (adjust > 0) {
+                            final String spaces = " ".repeat(adjust);
+                            stream = stream.map(s -> spaces + s);
+                        } else if (adjust < 0) {
+                            stream = stream.map(s -> s.substring(Math.min(-adjust, indexOfNonWhitespace(s))));
+                        }
+                        String expected = stream.collect(Collectors.joining("\n", "", "\n"));
+
+                        if (!output.equals(expected)) {
+                            report("String::indent(int n)",
+                                    "Result indentation not as expected", expected, output);
+                        }
+                    }
+                }
+            }
+        }
+    }
+
+    public static int indexOfNonWhitespace(String s) {
+        int left = 0;
+        while (left < s.length()) {
+            char ch = s.charAt(left);
+            if (ch != ' ' && ch != '\t' && !Character.isWhitespace(ch)) {
+                break;
+            }
+            left++;
+        }
+        return left;
+    }
+
+
+    private static String[] getBody(String[] inLines) {
+        int from = -1, to = -1;
+        for (int i = 0; i < inLines.length; i++) {
+            String line = inLines[i];
+            if (!line.isBlank()) {
+                if (from == -1) {
+                    from = i;
+                }
+                to = i + 1;
+            }
+        }
+        return Arrays.copyOfRange(inLines, from, to);
+    }
+
+    /*
+     * Report difference in result.
+     */
+    static void report(String test, String message, String input, String output) {
+        System.err.println("Testing " + test + ": " + message);
+        System.err.println();
+        System.err.println("Input: length = " + input.length());
+        System.err.println("_".repeat(40));
+        System.err.print(input.replaceAll(" ", "."));
+        System.err.println("_".repeat(40));
+        System.err.println();
+        System.err.println("Output: length = " + output.length());
+        System.err.println("_".repeat(40));
+        System.err.print(output.replaceAll(" ", "."));
+        System.err.println("_".repeat(40));
+        throw new RuntimeException();
+    }
+}
--- a/test/jdk/java/lang/constant/ClassDescTest.java	Thu Dec 13 11:51:06 2018 -0800
+++ b/test/jdk/java/lang/constant/ClassDescTest.java	Tue Jan 15 10:55:26 2019 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -42,6 +42,7 @@
 
 /**
  * @test
+ * @bug 8215510
  * @compile ClassDescTest.java
  * @run testng ClassDescTest
  * @summary unit tests for java.lang.constant.ClassDesc
@@ -215,7 +216,7 @@
     }
 
     public void testBadClassDescs() {
-        List<String> badDescriptors = List.of("II", "I;", "Q", "L",
+        List<String> badDescriptors = List.of("II", "I;", "Q", "L", "",
                                               "java.lang.String", "[]", "Ljava/lang/String",
                                               "Ljava.lang.String;", "java/lang/String");
 
--- a/test/jdk/java/lang/constant/CondyDescTest.java	Thu Dec 13 11:51:06 2018 -0800
+++ b/test/jdk/java/lang/constant/CondyDescTest.java	Tue Jan 15 10:55:26 2019 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -67,7 +67,6 @@
 
     private void testVarHandleDesc(DynamicConstantDesc<VarHandle> r, VarHandle vh) throws ReflectiveOperationException  {
         testSymbolicDesc(r);
-        assertEquals(r.resolveConstantDesc(LOOKUP), vh);
         assertEquals(vh.describeConstable().orElseThrow(), r);
     }
 
--- a/test/jdk/java/lang/constant/NameValidationTest.java	Thu Dec 13 11:51:06 2018 -0800
+++ b/test/jdk/java/lang/constant/NameValidationTest.java	Tue Jan 15 10:55:26 2019 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,6 +23,7 @@
 
 /**
  * @test
+ * @bug 8215510
  * @compile NameValidationTest.java
  * @run testng NameValidationTest
  * @summary unit tests for verifying member names
@@ -45,8 +46,8 @@
     private static final String[] badMemberNames = new String[] {"xx.xx", "zz;zz", "[l", "aa/aa", "<cinit>"};
     private static final String[] goodMemberNames = new String[] {"<clinit>", "<init>", "3", "~", "$", "qq"};
 
-    private static final String[] badClassNames = new String[] {"zz;zz", "[l", "aa/aa"};
-    private static final String[] goodClassNames = new String[] {"3", "~", "$", "qq", ".", "a.a"};
+    private static final String[] badClassNames = new String[] {"zz;zz", "[l", "aa/aa", ".", "a..b"};
+    private static final String[] goodClassNames = new String[] {"3", "~", "$", "qq", "a.a"};
 
     public void testMemberNames() {
         DirectMethodHandleDesc mh = MethodHandleDesc.of(Kind.VIRTUAL, CD_String, "isEmpty", "()Z");
--- a/test/jdk/java/lang/constant/boottest/java.base/java/lang/constant/ConstantUtilsTest.java	Thu Dec 13 11:51:06 2018 -0800
+++ b/test/jdk/java/lang/constant/boottest/java.base/java/lang/constant/ConstantUtilsTest.java	Tue Jan 15 10:55:26 2019 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -43,14 +43,14 @@
 
     public void testValidateMemberName() {
         try {
-            ConstantUtils.validateMemberName(null);
+            ConstantUtils.validateMemberName(null, false);
             fail("");
         } catch (NullPointerException e) {
             // good
         }
 
         try {
-            ConstantUtils.validateMemberName("");
+            ConstantUtils.validateMemberName("", false);
             fail("");
         } catch (IllegalArgumentException e) {
             // good
@@ -59,7 +59,7 @@
         List<String> badNames = List.of(".", ";", "[", "/", "<", ">");
         for (String n : badNames) {
             try {
-                ConstantUtils.validateMemberName(n);
+                ConstantUtils.validateMemberName(n, true);
                 fail(n);
             } catch (IllegalArgumentException e) {
                 // good
--- a/test/jdk/java/lang/invoke/VarHandles/VarHandleTestAccessBoolean.java	Thu Dec 13 11:51:06 2018 -0800
+++ b/test/jdk/java/lang/invoke/VarHandles/VarHandleTestAccessBoolean.java	Tue Jan 15 10:55:26 2019 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -141,8 +141,6 @@
             for (int j = 0; j < vhs1.length; j++) {
                 if (i == j) {
                     assertEquals(vhs1[i], vhs1[i]);
-                    assertEquals(vhs1[i], vhs2[i]);
-                    assertEquals(vhs1[i].hashCode(), vhs2[i].hashCode());
                 }
                 else {
                     assertNotEquals(vhs1[i], vhs1[j]);
--- a/test/jdk/java/lang/invoke/VarHandles/VarHandleTestAccessByte.java	Thu Dec 13 11:51:06 2018 -0800
+++ b/test/jdk/java/lang/invoke/VarHandles/VarHandleTestAccessByte.java	Tue Jan 15 10:55:26 2019 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -141,8 +141,6 @@
             for (int j = 0; j < vhs1.length; j++) {
                 if (i == j) {
                     assertEquals(vhs1[i], vhs1[i]);
-                    assertEquals(vhs1[i], vhs2[i]);
-                    assertEquals(vhs1[i].hashCode(), vhs2[i].hashCode());
                 }
                 else {
                     assertNotEquals(vhs1[i], vhs1[j]);
--- a/test/jdk/java/lang/invoke/VarHandles/VarHandleTestAccessChar.java	Thu Dec 13 11:51:06 2018 -0800
+++ b/test/jdk/java/lang/invoke/VarHandles/VarHandleTestAccessChar.java	Tue Jan 15 10:55:26 2019 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -141,8 +141,6 @@
             for (int j = 0; j < vhs1.length; j++) {
                 if (i == j) {
                     assertEquals(vhs1[i], vhs1[i]);
-                    assertEquals(vhs1[i], vhs2[i]);
-                    assertEquals(vhs1[i].hashCode(), vhs2[i].hashCode());
                 }
                 else {
                     assertNotEquals(vhs1[i], vhs1[j]);
--- a/test/jdk/java/lang/invoke/VarHandles/VarHandleTestAccessDouble.java	Thu Dec 13 11:51:06 2018 -0800
+++ b/test/jdk/java/lang/invoke/VarHandles/VarHandleTestAccessDouble.java	Tue Jan 15 10:55:26 2019 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -141,8 +141,6 @@
             for (int j = 0; j < vhs1.length; j++) {
                 if (i == j) {
                     assertEquals(vhs1[i], vhs1[i]);
-                    assertEquals(vhs1[i], vhs2[i]);
-                    assertEquals(vhs1[i].hashCode(), vhs2[i].hashCode());
                 }
                 else {
                     assertNotEquals(vhs1[i], vhs1[j]);
--- a/test/jdk/java/lang/invoke/VarHandles/VarHandleTestAccessFloat.java	Thu Dec 13 11:51:06 2018 -0800
+++ b/test/jdk/java/lang/invoke/VarHandles/VarHandleTestAccessFloat.java	Tue Jan 15 10:55:26 2019 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -141,8 +141,6 @@
             for (int j = 0; j < vhs1.length; j++) {
                 if (i == j) {
                     assertEquals(vhs1[i], vhs1[i]);
-                    assertEquals(vhs1[i], vhs2[i]);
-                    assertEquals(vhs1[i].hashCode(), vhs2[i].hashCode());
                 }
                 else {
                     assertNotEquals(vhs1[i], vhs1[j]);
--- a/test/jdk/java/lang/invoke/VarHandles/VarHandleTestAccessInt.java	Thu Dec 13 11:51:06 2018 -0800
+++ b/test/jdk/java/lang/invoke/VarHandles/VarHandleTestAccessInt.java	Tue Jan 15 10:55:26 2019 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -141,8 +141,6 @@
             for (int j = 0; j < vhs1.length; j++) {
                 if (i == j) {
                     assertEquals(vhs1[i], vhs1[i]);
-                    assertEquals(vhs1[i], vhs2[i]);
-                    assertEquals(vhs1[i].hashCode(), vhs2[i].hashCode());
                 }
                 else {
                     assertNotEquals(vhs1[i], vhs1[j]);
--- a/test/jdk/java/lang/invoke/VarHandles/VarHandleTestAccessLong.java	Thu Dec 13 11:51:06 2018 -0800
+++ b/test/jdk/java/lang/invoke/VarHandles/VarHandleTestAccessLong.java	Tue Jan 15 10:55:26 2019 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -141,8 +141,6 @@
             for (int j = 0; j < vhs1.length; j++) {
                 if (i == j) {
                     assertEquals(vhs1[i], vhs1[i]);
-                    assertEquals(vhs1[i], vhs2[i]);
-                    assertEquals(vhs1[i].hashCode(), vhs2[i].hashCode());
                 }
                 else {
                     assertNotEquals(vhs1[i], vhs1[j]);
--- a/test/jdk/java/lang/invoke/VarHandles/VarHandleTestAccessShort.java	Thu Dec 13 11:51:06 2018 -0800
+++ b/test/jdk/java/lang/invoke/VarHandles/VarHandleTestAccessShort.java	Tue Jan 15 10:55:26 2019 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -141,8 +141,6 @@
             for (int j = 0; j < vhs1.length; j++) {
                 if (i == j) {
                     assertEquals(vhs1[i], vhs1[i]);
-                    assertEquals(vhs1[i], vhs2[i]);
-                    assertEquals(vhs1[i].hashCode(), vhs2[i].hashCode());
                 }
                 else {
                     assertNotEquals(vhs1[i], vhs1[j]);
--- a/test/jdk/java/lang/invoke/VarHandles/VarHandleTestAccessString.java	Thu Dec 13 11:51:06 2018 -0800
+++ b/test/jdk/java/lang/invoke/VarHandles/VarHandleTestAccessString.java	Tue Jan 15 10:55:26 2019 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -143,8 +143,6 @@
             for (int j = 0; j < vhs1.length; j++) {
                 if (i == j) {
                     assertEquals(vhs1[i], vhs1[i]);
-                    assertEquals(vhs1[i], vhs2[i]);
-                    assertEquals(vhs1[i].hashCode(), vhs2[i].hashCode());
                 }
                 else {
                     assertNotEquals(vhs1[i], vhs1[j]);
--- a/test/jdk/java/lang/invoke/VarHandles/VarHandleTestByteArrayAsChar.java	Thu Dec 13 11:51:06 2018 -0800
+++ b/test/jdk/java/lang/invoke/VarHandles/VarHandleTestByteArrayAsChar.java	Tue Jan 15 10:55:26 2019 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -93,8 +93,6 @@
             for (int j = 0; j < vhs1.length; j++) {
                 if (i == j) {
                     assertEquals(vhs1[i], vhs1[i]);
-                    assertEquals(vhs1[i], vhs2[i]);
-                    assertEquals(vhs1[i].hashCode(), vhs2[i].hashCode());
                 }
                 else {
                     assertNotEquals(vhs1[i], vhs1[j]);
--- a/test/jdk/java/lang/invoke/VarHandles/VarHandleTestByteArrayAsDouble.java	Thu Dec 13 11:51:06 2018 -0800
+++ b/test/jdk/java/lang/invoke/VarHandles/VarHandleTestByteArrayAsDouble.java	Tue Jan 15 10:55:26 2019 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -93,8 +93,6 @@
             for (int j = 0; j < vhs1.length; j++) {
                 if (i == j) {
                     assertEquals(vhs1[i], vhs1[i]);
-                    assertEquals(vhs1[i], vhs2[i]);
-                    assertEquals(vhs1[i].hashCode(), vhs2[i].hashCode());
                 }
                 else {
                     assertNotEquals(vhs1[i], vhs1[j]);
--- a/test/jdk/java/lang/invoke/VarHandles/VarHandleTestByteArrayAsFloat.java	Thu Dec 13 11:51:06 2018 -0800
+++ b/test/jdk/java/lang/invoke/VarHandles/VarHandleTestByteArrayAsFloat.java	Tue Jan 15 10:55:26 2019 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -93,8 +93,6 @@
             for (int j = 0; j < vhs1.length; j++) {
                 if (i == j) {
                     assertEquals(vhs1[i], vhs1[i]);
-                    assertEquals(vhs1[i], vhs2[i]);
-                    assertEquals(vhs1[i].hashCode(), vhs2[i].hashCode());
                 }
                 else {
                     assertNotEquals(vhs1[i], vhs1[j]);
--- a/test/jdk/java/lang/invoke/VarHandles/VarHandleTestByteArrayAsInt.java	Thu Dec 13 11:51:06 2018 -0800
+++ b/test/jdk/java/lang/invoke/VarHandles/VarHandleTestByteArrayAsInt.java	Tue Jan 15 10:55:26 2019 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -93,8 +93,6 @@
             for (int j = 0; j < vhs1.length; j++) {
                 if (i == j) {
                     assertEquals(vhs1[i], vhs1[i]);
-                    assertEquals(vhs1[i], vhs2[i]);
-                    assertEquals(vhs1[i].hashCode(), vhs2[i].hashCode());
                 }
                 else {
                     assertNotEquals(vhs1[i], vhs1[j]);
--- a/test/jdk/java/lang/invoke/VarHandles/VarHandleTestByteArrayAsLong.java	Thu Dec 13 11:51:06 2018 -0800
+++ b/test/jdk/java/lang/invoke/VarHandles/VarHandleTestByteArrayAsLong.java	Tue Jan 15 10:55:26 2019 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -93,8 +93,6 @@
             for (int j = 0; j < vhs1.length; j++) {
                 if (i == j) {
                     assertEquals(vhs1[i], vhs1[i]);
-                    assertEquals(vhs1[i], vhs2[i]);
-                    assertEquals(vhs1[i].hashCode(), vhs2[i].hashCode());
                 }
                 else {
                     assertNotEquals(vhs1[i], vhs1[j]);
--- a/test/jdk/java/lang/invoke/VarHandles/VarHandleTestByteArrayAsShort.java	Thu Dec 13 11:51:06 2018 -0800
+++ b/test/jdk/java/lang/invoke/VarHandles/VarHandleTestByteArrayAsShort.java	Tue Jan 15 10:55:26 2019 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -93,8 +93,6 @@
             for (int j = 0; j < vhs1.length; j++) {
                 if (i == j) {
                     assertEquals(vhs1[i], vhs1[i]);
-                    assertEquals(vhs1[i], vhs2[i]);
-                    assertEquals(vhs1[i].hashCode(), vhs2[i].hashCode());
                 }
                 else {
                     assertNotEquals(vhs1[i], vhs1[j]);
--- a/test/jdk/java/net/MulticastSocket/PromiscuousIPv6.java	Thu Dec 13 11:51:06 2018 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,162 +0,0 @@
-/*
- * 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.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- *
-
-/*
- * @test
- * @bug 8210493
- * @requires os.family == "linux"
- * @library /test/lib
- * @build jdk.test.lib.NetworkConfiguration
- *        PromiscuousIPv6
- * @run main PromiscuousIPv6
- */
-import jdk.test.lib.NetworkConfiguration;
-import jtreg.SkippedException;
-
-import java.io.IOException;
-import java.net.DatagramPacket;
-import java.net.DatagramSocket;
-import java.net.InetAddress;
-import java.net.InetSocketAddress;
-import java.net.MulticastSocket;
-import java.net.SocketTimeoutException;
-
-import static java.lang.System.out;
-
-/*
- * This test was created as a copy of the Promiscuous test and adapted for
- * IPv6 node-local and link-local multicast addresses on Linux.
- */
-public class PromiscuousIPv6 {
-
-    static final int TIMEOUT =  5 * 1000; // 5 secs
-    static int id = 1000;
-
-    static void receive(DatagramSocket mc, boolean datagramExpected, int id)
-            throws IOException
-    {
-        byte[] ba = new byte[100];
-        DatagramPacket p = new DatagramPacket(ba, ba.length);
-        try {
-            mc.receive(p);
-            int recvId = Integer.parseInt(
-                    new String(p.getData(), 0, p.getLength(), "UTF-8"));
-            if (datagramExpected) {
-                if (recvId != id)
-                    throw new RuntimeException("Unexpected id, got " + recvId
-                                                       + ", expected: " + id);
-                out.printf("Received message as expected, %s\n", p.getAddress());
-            } else {
-                throw new RuntimeException("Unexpected message received, "
-                                                   + p.getAddress());
-            }
-        } catch (SocketTimeoutException e) {
-            if (datagramExpected)
-                throw new RuntimeException("Expected message not received, "
-                                                   + e.getMessage());
-            else
-                out.printf("Message not received, as expected\n");
-        }
-    }
-
-    static void test(InetAddress group1, InetAddress group2)
-            throws IOException
-    {
-        try (MulticastSocket mc1 = new MulticastSocket(new InetSocketAddress(group1, 0));
-             MulticastSocket mc2 = new MulticastSocket(new InetSocketAddress(group2, mc1.getLocalPort()));
-             DatagramSocket ds = new DatagramSocket()) {
-
-            final int port = mc1.getLocalPort();
-            out.printf("Using port: %d\n", port);
-
-            mc1.setSoTimeout(TIMEOUT);
-            mc2.setSoTimeout(TIMEOUT);
-            int nextId = id;
-            byte[] msg = Integer.toString(nextId).getBytes("UTF-8");
-            DatagramPacket p = new DatagramPacket(msg, msg.length);
-            p.setAddress(group1);
-            p.setPort(port);
-
-            mc1.joinGroup(group1);
-            out.printf("mc1 joined the MC group: %s\n", group1);
-            mc2.joinGroup(group2);
-            out.printf("mc2 joined the MC group: %s\n", group2);
-
-            out.printf("Sending datagram to: %s/%d\n", group1, port);
-            ds.send(p);
-
-            // the packet should be received by mc1 only
-            receive(mc1, true, nextId);
-            receive(mc2, false, 0);
-
-            nextId = ++id;
-            msg = Integer.toString(nextId).getBytes("UTF-8");
-            p = new DatagramPacket(msg, msg.length);
-            p.setAddress(group2);
-            p.setPort(port);
-
-            out.printf("Sending datagram to: %s/%d\n", group2, port);
-            ds.send(p);
-
-            // the packet should be received by mc2 only
-            receive(mc2, true, nextId);
-            receive(mc1, false, 0);
-
-            mc1.leaveGroup(group1);
-            mc2.leaveGroup(group2);
-        }
-    }
-
-    public static void main(String args[]) throws IOException {
-        String os = System.getProperty("os.name");
-
-        if (!os.equals("Linux")) {
-            throw new SkippedException("This test should be run only on Linux");
-        } else {
-            String osVersion = System.getProperty("os.version");
-            String prefix = "3.10.0";
-            if (osVersion.startsWith(prefix)) {
-                throw new SkippedException(
-                        String.format("The behavior under test is known NOT to work on '%s' kernels", prefix));
-            }
-        }
-
-        NetworkConfiguration.printSystemConfiguration(System.out);
-
-        if (NetworkConfiguration.probe()
-                                .ip6MulticastInterfaces()
-                                .findAny()
-                                .isEmpty()) {
-            throw new SkippedException(
-                    "No IPv6 interfaces that support multicast found");
-        }
-
-        InetAddress interfaceLocal1 = InetAddress.getByName("ff11::2.3.4.5");
-        InetAddress interfaceLocal2 = InetAddress.getByName("ff11::6.7.8.9");
-        test(interfaceLocal1, interfaceLocal2);
-
-        InetAddress linkLocal1 = InetAddress.getByName("ff12::2.3.4.5");
-        InetAddress linkLocal2 = InetAddress.getByName("ff12::6.7.8.9");
-        test(linkLocal1, linkLocal2);
-    }
-}
--- a/test/jdk/java/nio/channels/DatagramChannel/PromiscuousIPv6.java	Thu Dec 13 11:51:06 2018 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,230 +0,0 @@
-/*
- * 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.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- *
-
-/*
- * @test
- * @bug 8210493
- * @requires os.family == "linux"
- * @library /test/lib
- * @build jdk.test.lib.NetworkConfiguration
- *        PromiscuousIPv6
- * @run main PromiscuousIPv6
- * @key randomness
- */
-
-import java.nio.ByteBuffer;
-import java.nio.channels.*;
-import java.net.*;
-import static java.net.StandardProtocolFamily.*;
-import java.util.*;
-import java.io.IOException;
-import java.util.stream.Collectors;
-
-import jdk.test.lib.NetworkConfiguration;
-import jtreg.SkippedException;
-
-/*
- * This test was created as a copy of the Promiscuous test and adapted for
- * IPv6 node-local and link-local multicast addresses on Linux.
- */
-public class PromiscuousIPv6 {
-
-    static final Random rand = new Random();
-
-    static final ProtocolFamily UNSPEC = () -> "UNSPEC";
-
-    /**
-     * Sends a datagram to the given multicast group
-     */
-    static int sendDatagram(NetworkInterface nif,
-                            InetAddress group,
-                            int port)
-            throws IOException
-    {
-        ProtocolFamily family = (group instanceof Inet6Address) ?
-                StandardProtocolFamily.INET6 : StandardProtocolFamily.INET;
-        DatagramChannel dc = DatagramChannel.open(family)
-                .setOption(StandardSocketOptions.IP_MULTICAST_IF, nif);
-        int id = rand.nextInt();
-        byte[] msg = Integer.toString(id).getBytes("UTF-8");
-        ByteBuffer buf = ByteBuffer.wrap(msg);
-        System.out.format("Send message -> group %s (id=0x%x)\n",
-                          group.getHostAddress(), id);
-        dc.send(buf, new InetSocketAddress(group, port));
-        dc.close();
-        return id;
-    }
-
-    /**
-     * Wait (with timeout) for datagram. The {@code datagramExpected}
-     * parameter indicates whether a datagram is expected, and if
-     * {@code true} then {@code id} is the identifier in the payload.
-     */
-    static void receiveDatagram(DatagramChannel dc,
-                                String name,
-                                boolean datagramExpected,
-                                int id)
-            throws IOException
-    {
-        System.out.println("Checking if received by " + name);
-
-        Selector sel = Selector.open();
-        dc.configureBlocking(false);
-        dc.register(sel, SelectionKey.OP_READ);
-        ByteBuffer buf = ByteBuffer.allocateDirect(100);
-
-        try {
-            for (;;) {
-                System.out.println("Waiting to receive message");
-                sel.select(5*1000);
-                SocketAddress sa = dc.receive(buf);
-
-                // no datagram received
-                if (sa == null) {
-                    if (datagramExpected) {
-                        throw new RuntimeException("Expected message not received");
-                    }
-                    System.out.println("No message received (correct)");
-                    return;
-                }
-
-                // datagram received
-
-                InetAddress sender = ((InetSocketAddress)sa).getAddress();
-                buf.flip();
-                byte[] bytes = new byte[buf.remaining()];
-                buf.get(bytes);
-                String s = new String(bytes, "UTF-8");
-                int receivedId = -1;
-                try {
-                    receivedId = Integer.parseInt(s);
-                    System.out.format("Received message from %s (id=0x%x)\n",
-                                      sender, receivedId);
-                } catch (NumberFormatException x) {
-                    System.out.format("Received message from %s (msg=%s)\n", sender, s);
-                }
-
-                if (!datagramExpected) {
-                    if (receivedId == id)
-                        throw new RuntimeException("Message not expected");
-                    System.out.println("Message ignored (has wrong id)");
-                } else {
-                    if (receivedId == id) {
-                        System.out.println("Message expected");
-                        return;
-                    }
-                    System.out.println("Message ignored (wrong sender)");
-                }
-
-                sel.selectedKeys().clear();
-                buf.rewind();
-            }
-        } finally {
-            sel.close();
-        }
-    }
-
-    static void test(ProtocolFamily family,
-                     NetworkInterface nif,
-                     InetAddress group1,
-                     InetAddress group2)
-            throws IOException
-    {
-
-        System.out.format("%nTest family=%s%n", family.name());
-
-        DatagramChannel dc1 = (family == UNSPEC) ?
-                DatagramChannel.open() : DatagramChannel.open(family);
-        DatagramChannel dc2 = (family == UNSPEC) ?
-                DatagramChannel.open() : DatagramChannel.open(family);
-
-        try {
-            dc1.setOption(StandardSocketOptions.SO_REUSEADDR, true);
-            dc2.setOption(StandardSocketOptions.SO_REUSEADDR, true);
-
-            dc1.bind(new InetSocketAddress(group1, 0));
-            int port = dc1.socket().getLocalPort();
-            dc2.bind(new InetSocketAddress(group2, port));
-
-            System.out.format("dc1 joining [%s]:%d @ %s\n",
-                              group1.getHostAddress(), port, nif.getName());
-            System.out.format("dc2 joining [%s]:%d @ %s\n",
-                              group2.getHostAddress(), port, nif.getName());
-
-            dc1.join(group1, nif);
-            dc2.join(group2, nif);
-
-            int id = sendDatagram(nif, group1, port);
-
-            receiveDatagram(dc1, "dc1", true, id);
-            receiveDatagram(dc2, "dc2", false, id);
-
-            id = sendDatagram(nif, group2, port);
-
-            receiveDatagram(dc1, "dc1", false, id);
-            receiveDatagram(dc2, "dc2", true, id);
-
-        } finally {
-            dc1.close();
-            dc2.close();
-        }
-    }
-
-    public static void main(String[] args) throws IOException {
-
-        String os = System.getProperty("os.name");
-
-        if (!os.equals("Linux")) {
-            throw new SkippedException("This test should be run only on Linux");
-        } else {
-            String osVersion = System.getProperty("os.version");
-            String prefix = "3.10.0";
-            if (osVersion.startsWith(prefix)) {
-                throw new SkippedException(
-                        String.format("The behavior under test is known NOT to work on '%s' kernels", prefix));
-            }
-        }
-
-        NetworkConfiguration.printSystemConfiguration(System.out);
-
-        InetAddress interfaceLocal1 = InetAddress.getByName("ff11::2.3.4.5");
-        InetAddress interfaceLocal2 = InetAddress.getByName("ff11::6.7.8.9");
-
-        InetAddress linkLocal1 = InetAddress.getByName("ff12::2.3.4.5");
-        InetAddress linkLocal2 = InetAddress.getByName("ff12::6.7.8.9");
-
-        // get local network configuration to use
-        NetworkConfiguration config = NetworkConfiguration.probe();
-        boolean foundAtLeastOne = false;
-        for (NetworkInterface nif: config.ip6MulticastInterfaces()
-                .collect(Collectors.toList())) {
-            foundAtLeastOne = true;
-            test(INET6, nif, interfaceLocal1, interfaceLocal2);
-            test(INET6, nif, linkLocal1, linkLocal2);
-        }
-        if (!foundAtLeastOne) {
-            throw new SkippedException(
-                    "No IPv6 interfaces that support multicast found");
-        }
-    }
-}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/jdk/java/security/AccessController/DoPriv.java	Tue Jan 15 10:55:26 2019 -0800
@@ -0,0 +1,68 @@
+/*
+ * 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.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 8214583
+ * @summary Check that getContext works after JIT compiler escape analysis.
+ */
+import java.security.AccessControlContext;
+import java.security.AccessController;
+import java.security.DomainCombiner;
+import java.security.ProtectionDomain;
+import java.security.PrivilegedActionException;
+import java.security.PrivilegedExceptionAction;
+import java.net.URL;
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.Set;
+
+public class DoPriv {
+
+    static void go(final DomainCombiner dc0, final AccessControlContext co, final int index) throws Exception {
+        final AccessControlContext ci = new AccessControlContext(co, dc0);
+        AccessController.doPrivileged((PrivilegedExceptionAction<Integer>)() -> {
+            AccessControlContext c1 = AccessController.getContext();
+            DomainCombiner dc = c1.getDomainCombiner();
+            if (dc != dc0 || dc == null) {
+                throw new AssertionError("iteration " + index + " " + dc + " != " + dc0);
+            }
+            return 0;
+        }, ci);
+    }
+
+    public static void main(String[] args) throws Exception {
+        final DomainCombiner dc0 = new DomainCombiner() {
+            public ProtectionDomain[] combine(ProtectionDomain[] currentDomains,
+                                            ProtectionDomain[] assignedDomains) {
+                return null;
+            }
+        };
+
+        final AccessControlContext co = AccessController.getContext();
+
+        for (int i = 0; i < 500_000; ++i) {
+            go(dc0, co, i);
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/jdk/java/util/jar/Manifest/IncludeInExceptionsTest.java	Tue Jan 15 10:55:26 2019 -0800
@@ -0,0 +1,101 @@
+/*
+ * Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.io.File;
+import java.io.IOException;
+import java.io.OutputStream;
+import java.nio.file.Files;
+import java.nio.file.Paths;
+import java.util.concurrent.Callable;
+import java.util.jar.JarEntry;
+import java.util.jar.JarFile;
+import java.util.jar.JarOutputStream;
+
+import static java.nio.charset.StandardCharsets.UTF_8;
+
+/**
+ * @test
+ * @bug 8216362
+ * @run main/othervm -Djdk.includeInExceptions=jar IncludeInExceptionsTest yes
+ * @run main/othervm IncludeInExceptionsTest
+ * @summary Verify that the property jdk.net.includeInExceptions works as expected
+ * when an error occurs while reading an invalid Manifest file.
+ */
+/*
+ * @see Manifest#Manifest(JarVerifier,InputStream,String)
+ * @see Manifest#getErrorPosition
+ */
+public class IncludeInExceptionsTest {
+
+    static final String FILENAME = "Unique-Filename-Expected-In_Msg.jar";
+
+    static final byte[] INVALID_MANIFEST = (
+            "Manifest-Version: 1.0\r\n" +
+            "\r\n" +
+            "Illegal\r\n" +
+            "\r\n").getBytes(UTF_8);
+
+    static String createJarInvalidManifest(String jar) throws IOException {
+        try (OutputStream out = Files.newOutputStream(Paths.get(jar));
+            JarOutputStream jos = new JarOutputStream(out)) {
+            JarEntry je = new JarEntry(JarFile.MANIFEST_NAME);
+            jos.putNextEntry(je);
+            jos.write(INVALID_MANIFEST);
+            jos.closeEntry();
+        }
+        return jar;
+    }
+
+    static void test(Callable<?> attempt, boolean includeInExceptions) throws Exception {
+        try {
+            attempt.call();
+            throw new AssertionError("Excpected Exception not thrown");
+        } catch (IOException e) {
+            boolean foundFileName = e.getMessage().contains(FILENAME);
+            if(includeInExceptions && !foundFileName) {
+                throw new AssertionError("JAR file name expected but not found in error message");
+            } else if (foundFileName && !includeInExceptions) {
+                throw new AssertionError("JAR file name found but should not be in error message");
+            }
+        }
+    }
+
+    public static void main(String[] args) throws Exception {
+
+        boolean includeInExceptions;
+        if(args.length > 0) {
+            includeInExceptions = true;
+            System.out.println("**** Running test WITH -Djdk.includeInExceptions=jar");
+        } else {
+            includeInExceptions = false;
+            System.out.println("**** Running test WITHOUT -Djdk.includeInExceptions=jar");
+        }
+
+        test(() -> new JarFile(createJarInvalidManifest(FILENAME)).getManifest(),
+                includeInExceptions);
+        test(() -> new JarFile(createJarInvalidManifest("Verifying-" + FILENAME),
+                true).getManifest(), includeInExceptions);
+    }
+
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/jdk/javax/net/ssl/templates/SSLContextTemplate.java	Tue Jan 15 10:55:26 2019 -0800
@@ -0,0 +1,518 @@
+/*
+ * 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.
+ *
+ * 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.
+ */
+
+//
+// Please run in othervm mode.  SunJSSE does not support dynamic system
+// properties, no way to re-use system properties in samevm/agentvm mode.
+//
+
+import java.io.ByteArrayInputStream;
+import java.security.KeyFactory;
+import java.security.KeyStore;
+import java.security.PrivateKey;
+import java.security.cert.Certificate;
+import java.security.cert.CertificateFactory;
+import java.security.spec.PKCS8EncodedKeySpec;
+import java.util.Base64;
+import javax.net.ssl.KeyManagerFactory;
+import javax.net.ssl.SSLContext;
+import javax.net.ssl.TrustManagerFactory;
+
+/**
+ * SSLContext template to speed up JSSE tests.
+ */
+public interface SSLContextTemplate {
+    /*
+     * Create an instance of SSLContext for client use.
+     */
+    default SSLContext createClientSSLContext() throws Exception {
+        return createSSLContext(trustedCertStrs,
+                endEntityCertStrs, endEntityPrivateKeys,
+                endEntityPrivateKeyAlgs,
+                endEntityPrivateKeyNames,
+                getClientContextParameters());
+    }
+
+    /*
+     * Create an instance of SSLContext for server use.
+     */
+    default SSLContext createServerSSLContext() throws Exception {
+        return createSSLContext(trustedCertStrs,
+                endEntityCertStrs, endEntityPrivateKeys,
+                endEntityPrivateKeyAlgs,
+                endEntityPrivateKeyNames,
+                getServerContextParameters());
+    }
+
+    /*
+     * The parameters used to configure SSLContext.
+     */
+    static final class ContextParameters {
+        final String contextProtocol;
+        final String tmAlgorithm;
+        final String kmAlgorithm;
+
+        ContextParameters(String contextProtocol,
+                String tmAlgorithm, String kmAlgorithm) {
+
+            this.contextProtocol = contextProtocol;
+            this.tmAlgorithm = tmAlgorithm;
+            this.kmAlgorithm = kmAlgorithm;
+        }
+    }
+
+    /*
+     * Get the client side parameters of SSLContext.
+     */
+    default ContextParameters getClientContextParameters() {
+        return new ContextParameters("TLS", "PKIX", "NewSunX509");
+    }
+
+    /*
+     * Get the server side parameters of SSLContext.
+     */
+    default ContextParameters getServerContextParameters() {
+        return new ContextParameters("TLS", "PKIX", "NewSunX509");
+    }
+
+    /*
+     * =======================================
+     * Certificates and keys used in the test.
+     */
+    // Trusted certificates.
+    final static String[] trustedCertStrs = {
+        // SHA256withECDSA, curve prime256v1
+        // Validity
+        //     Not Before: May 22 07:18:16 2018 GMT
+        //     Not After : May 17 07:18:16 2038 GMT
+        // Subject Key Identifier:
+        //     60:CF:BD:73:FF:FA:1A:30:D2:A4:EC:D3:49:71:46:EF:1A:35:A0:86
+        "-----BEGIN CERTIFICATE-----\n" +
+        "MIIBvjCCAWOgAwIBAgIJAIvFG6GbTroCMAoGCCqGSM49BAMCMDsxCzAJBgNVBAYT\n" +
+        "AlVTMQ0wCwYDVQQKDARKYXZhMR0wGwYDVQQLDBRTdW5KU1NFIFRlc3QgU2VyaXZj\n" +
+        "ZTAeFw0xODA1MjIwNzE4MTZaFw0zODA1MTcwNzE4MTZaMDsxCzAJBgNVBAYTAlVT\n" +
+        "MQ0wCwYDVQQKDARKYXZhMR0wGwYDVQQLDBRTdW5KU1NFIFRlc3QgU2VyaXZjZTBZ\n" +
+        "MBMGByqGSM49AgEGCCqGSM49AwEHA0IABBz1WeVb6gM2mh85z3QlvaB/l11b5h0v\n" +
+        "LIzmkC3DKlVukZT+ltH2Eq1oEkpXuf7QmbM0ibrUgtjsWH3mULfmcWmjUDBOMB0G\n" +
+        "A1UdDgQWBBRgz71z//oaMNKk7NNJcUbvGjWghjAfBgNVHSMEGDAWgBRgz71z//oa\n" +
+        "MNKk7NNJcUbvGjWghjAMBgNVHRMEBTADAQH/MAoGCCqGSM49BAMCA0kAMEYCIQCG\n" +
+        "6wluh1r2/T6L31mZXRKf9JxeSf9pIzoLj+8xQeUChQIhAJ09wAi1kV8yePLh2FD9\n" +
+        "2YEHlSQUAbwwqCDEVB5KxaqP\n" +
+        "-----END CERTIFICATE-----",
+        // -----BEGIN PRIVATE KEY-----
+        // MIGHAgEAMBMGByqGSM49AgEGCCqGSM49AwEHBG0wawIBAQQg/HcHdoLJCdq3haVd
+        // XZTSKP00YzM3xX97l98vGL/RI1KhRANCAAQc9VnlW+oDNpofOc90Jb2gf5ddW+Yd
+        // LyyM5pAtwypVbpGU/pbR9hKtaBJKV7n+0JmzNIm61ILY7Fh95lC35nFp
+        // -----END PRIVATE KEY-----
+
+        // SHA256withRSA, 2048 bits
+        // Validity
+        //     Not Before: May 22 07:18:16 2018 GMT
+        //     Not After : May 17 07:18:16 2038 GMT
+        // Subject Key Identifier:
+        //     0D:DD:93:C9:FE:4B:BD:35:B7:E8:99:78:90:FB:DB:5A:3D:DB:15:4C
+        "-----BEGIN CERTIFICATE-----\n" +
+        "MIIDSTCCAjGgAwIBAgIJAI4ZF3iy8zG+MA0GCSqGSIb3DQEBCwUAMDsxCzAJBgNV\n" +
+        "BAYTAlVTMQ0wCwYDVQQKDARKYXZhMR0wGwYDVQQLDBRTdW5KU1NFIFRlc3QgU2Vy\n" +
+        "aXZjZTAeFw0xODA1MjIwNzE4MTZaFw0zODA1MTcwNzE4MTZaMDsxCzAJBgNVBAYT\n" +
+        "AlVTMQ0wCwYDVQQKDARKYXZhMR0wGwYDVQQLDBRTdW5KU1NFIFRlc3QgU2VyaXZj\n" +
+        "ZTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALpMcY7aWieXDEM1/YJf\n" +
+        "JW27b4nRIFZyEYhEloyGsKTuQiiQjc8cqRZFNXe2vwziDB4IyTEl0Hjl5QF6ZaQE\n" +
+        "huPzzwvQm1pv64KrRXrmj3FisQK8B5OWLty9xp6xDqsaMRoyObLK+oIb20T5fSlE\n" +
+        "evmo1vYjnh8CX0Yzx5Gr5ye6YSEHQvYOWEws8ad17OlyToR2KMeC8w4qo6rs59pW\n" +
+        "g7Mxn9vo22ImDzrtAbTbXbCias3xlE0Bp0h5luyf+5U4UgksoL9B9r2oP4GrLNEV\n" +
+        "oJk57t8lwaR0upiv3CnS8LcJELpegZub5ggqLY8ZPYFQPjlK6IzLOm6rXPgZiZ3m\n" +
+        "RL0CAwEAAaNQME4wHQYDVR0OBBYEFA3dk8n+S701t+iZeJD721o92xVMMB8GA1Ud\n" +
+        "IwQYMBaAFA3dk8n+S701t+iZeJD721o92xVMMAwGA1UdEwQFMAMBAf8wDQYJKoZI\n" +
+        "hvcNAQELBQADggEBAJTRC3rKUUhVH07/1+stUungSYgpM08dY4utJq0BDk36BbmO\n" +
+        "0AnLDMbkwFdHEoqF6hQIfpm7SQTmXk0Fss6Eejm8ynYr6+EXiRAsaXOGOBCzF918\n" +
+        "/RuKOzqABfgSU4UBKECLM5bMfQTL60qx+HdbdVIpnikHZOFfmjCDVxoHsGyXc1LW\n" +
+        "Jhkht8IGOgc4PMGvyzTtRFjz01kvrVQZ75aN2E0GQv6dCxaEY0i3ypSzjUWAKqDh\n" +
+        "3e2OLwUSvumcdaxyCdZAOUsN6pDBQ+8VRG7KxnlRlY1SMEk46QgQYLbPDe/+W/yH\n" +
+        "ca4PejicPeh+9xRAwoTpiE2gulfT7Lm+fVM7Ruc=\n" +
+        "-----END CERTIFICATE-----",
+
+        // -----BEGIN PRIVATE KEY-----
+        // MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQC6THGO2lonlwxD
+        // Nf2CXyVtu2+J0SBWchGIRJaMhrCk7kIokI3PHKkWRTV3tr8M4gweCMkxJdB45eUB
+        // emWkBIbj888L0Jtab+uCq0V65o9xYrECvAeTli7cvcaesQ6rGjEaMjmyyvqCG9tE
+        // +X0pRHr5qNb2I54fAl9GM8eRq+cnumEhB0L2DlhMLPGndezpck6EdijHgvMOKqOq
+        // 7OfaVoOzMZ/b6NtiJg867QG0212womrN8ZRNAadIeZbsn/uVOFIJLKC/Qfa9qD+B
+        // qyzRFaCZOe7fJcGkdLqYr9wp0vC3CRC6XoGbm+YIKi2PGT2BUD45SuiMyzpuq1z4
+        // GYmd5kS9AgMBAAECggEAFHSoU2MuWwJ+2jJnb5U66t2V1bAcuOE1g5zkWvG/G5z9
+        // rq6Qo5kmB8f5ovdx6tw3MGUOklLwnRXBG3RxDJ1iokz3AvkY1clMNsDPlDsUrQKF
+        // JSO4QUBQTPSZhnsyfR8XHSU+qJ8Y+ohMfzpVv95BEoCzebtXdVgxVegBlcEmVHo2
+        // kMmkRN+bYNsr8eb2r+b0EpyumS39ZgKYh09+cFb78y3T6IFMGcVJTP6nlGBFkmA/
+        // 25pYeCF2tSki08qtMJZQAvKfw0Kviibk7ZxRbJqmc7B1yfnOEHP6ftjuvKl2+RP/
+        // +5P5f8CfIP6gtA0LwSzAqQX/hfIKrGV5j0pCqrD0kQKBgQDeNR6Xi4sXVq79lihO
+        // a1bSeV7r8yoQrS8x951uO+ox+UIZ1MsAULadl7zB/P0er92p198I9M/0Jth3KBuS
+        // zj45mucvpiiGvmQlMKMEfNq4nN7WHOu55kufPswQB2mR4J3xmwI+4fM/nl1zc82h
+        // De8JSazRldJXNhfx0RGFPmgzbwKBgQDWoVXrXLbCAn41oVnWB8vwY9wjt92ztDqJ
+        // HMFA/SUohjePep9UDq6ooHyAf/Lz6oE5NgeVpPfTDkgvrCFVKnaWdwALbYoKXT2W
+        // 9FlyJox6eQzrtHAacj3HJooXWuXlphKSizntfxj3LtMR9BmrmRJOfK+SxNOVJzW2
+        // +MowT20EkwKBgHmpB8jdZBgxI7o//m2BI5Y1UZ1KE5vx1kc7VXzHXSBjYqeV9FeF
+        // 2ZZLP9POWh/1Fh4pzTmwIDODGT2UPhSQy0zq3O0fwkyT7WzXRknsuiwd53u/dejg
+        // iEL2NPAJvulZ2+AuiHo5Z99LK8tMeidV46xoJDDUIMgTG+UQHNGhK5gNAoGAZn/S
+        // Cn7SgMC0CWSvBHnguULXZO9wH1wZAFYNLL44OqwuaIUFBh2k578M9kkke7woTmwx
+        // HxQTjmWpr6qimIuY6q6WBN8hJ2Xz/d1fwhYKzIp20zHuv5KDUlJjbFfqpsuy3u1C
+        // kts5zwI7pr1ObRbDGVyOdKcu7HI3QtR5qqyjwaUCgYABo7Wq6oHva/9V34+G3Goh
+        // 63bYGUnRw2l5BD11yhQv8XzGGZFqZVincD8gltNThB0Dc/BI+qu3ky4YdgdZJZ7K
+        // z51GQGtaHEbrHS5caV79yQ8QGY5mUVH3E+VXSxuIqb6pZq2DH4sTAEFHyncddmOH
+        // zoXBInYwRG9KE/Bw5elhUw==
+        // -----END PRIVATE KEY-----
+
+
+        // SHA256withDSA, 2048 bits
+        // Validity
+        //     Not Before: May 22 07:18:18 2018 GMT
+        //     Not After : May 17 07:18:18 2038 GMT
+        // Subject Key Identifier:
+        //     76:66:9E:F7:3B:DD:45:E5:3B:D9:72:3C:3F:F0:54:39:86:31:26:53
+        "-----BEGIN CERTIFICATE-----\n" +
+        "MIIErjCCBFSgAwIBAgIJAOktYLNCbr02MAsGCWCGSAFlAwQDAjA7MQswCQYDVQQG\n" +
+        "EwJVUzENMAsGA1UECgwESmF2YTEdMBsGA1UECwwUU3VuSlNTRSBUZXN0IFNlcml2\n" +
+        "Y2UwHhcNMTgwNTIyMDcxODE4WhcNMzgwNTE3MDcxODE4WjA7MQswCQYDVQQGEwJV\n" +
+        "UzENMAsGA1UECgwESmF2YTEdMBsGA1UECwwUU3VuSlNTRSBUZXN0IFNlcml2Y2Uw\n" +
+        "ggNHMIICOQYHKoZIzjgEATCCAiwCggEBAO5GyPhSm0ze3LSu+gicdULLj05iOfTL\n" +
+        "UvZQ29sYz41zmqrLBQbdKiHqgJu2Re9sgTb5suLNjF047TOLPnU3jhPtWm2X8Xzi\n" +
+        "VGIcHym/Q/MeZxStt/88seqroI3WOKzIML2GcrishT+lcGrtH36Tf1+ue2Snn3PS\n" +
+        "WyxygNqPjllP5uUjYmFLvAf4QLMldkd/D2VxcwsHjB8y5iUZsXezc/LEhRZS/02m\n" +
+        "ivqlRw3AMkq/OVe/ZtxFWsP0nsfxEGdZuaUFpppGfixxFvymrB3+J51cTt+pZBDq\n" +
+        "D2y0DYfc+88iCs4jwHTfcDIpLb538HBjBj2rEgtQESQmB0ooD/+wsPsCIQC1bYch\n" +
+        "gElNtDYL3FgpLgNSUYp7gIWv9ehaC7LO2z7biQKCAQBitvFOnDkUja8NAF7lDpOV\n" +
+        "b5ipQ8SicBLW3kQamxhyuyxgZyy/PojZ/oPorkqW/T/A0rhnG6MssEpAtdiwVB+c\n" +
+        "rBYGo3bcwmExJhdOJ6dYuKFppPWhCwKMHs9npK+lqBMl8l5j58xlcFeC7ZfGf8GY\n" +
+        "GkhFW0c44vEQhMMbac6ZTTP4mw+1t7xJfmDMlLEyIpTXaAAk8uoVLWzQWnR40sHi\n" +
+        "ybvS0u3JxQkb7/y8tOOZu8qlz/YOS7lQ6UxUGX27Ce1E0+agfPphetoRAlS1cezq\n" +
+        "Wa7r64Ga0nkj1kwkcRqjgTiJx0NwnUXr78VAXFhVF95+O3lfqhvdtEGtkhDGPg7N\n" +
+        "A4IBBgACggEBAMmSHQK0w2i+iqUjOPzn0yNEZrzepLlLeQ1tqtn0xnlv5vBAeefD\n" +
+        "Pm9dd3tZOjufVWP7hhEz8xPobb1CS4e3vuQiv5UBfhdPL3f3l9T7JMAKPH6C9Vve\n" +
+        "OQXE5eGqbjsySbcmseHoYUt1WCSnSda1opX8zchX04e7DhGfE2/L9flpYEoSt8lI\n" +
+        "vMNjgOwvKdW3yvPt1/eBBHYNFG5gWPv/Q5KoyCtHS03uqGm4rNc/wZTIEEfd66C+\n" +
+        "QRaUltjOaHmtwOdDHaNqwhYZSVOip+Mo+TfyzHFREcdHLapo7ZXqbdYkRGxRR3d+\n" +
+        "3DfHaraJO0OKoYlPkr3JMvM/MSGR9AnZOcejUDBOMB0GA1UdDgQWBBR2Zp73O91F\n" +
+        "5TvZcjw/8FQ5hjEmUzAfBgNVHSMEGDAWgBR2Zp73O91F5TvZcjw/8FQ5hjEmUzAM\n" +
+        "BgNVHRMEBTADAQH/MAsGCWCGSAFlAwQDAgNHADBEAiBzriYE41M2y9Hy5ppkL0Qn\n" +
+        "dIlNc8JhXT/PHW7GDtViagIgMko8Qoj9gDGPK3+O9E8DC3wGiiF9CObM4LN387ok\n" +
+        "J+g=\n" +
+        "-----END CERTIFICATE-----"
+        // -----BEGIN PRIVATE KEY-----
+        // MIICZQIBADCCAjkGByqGSM44BAEwggIsAoIBAQDuRsj4UptM3ty0rvoInHVCy49O
+        // Yjn0y1L2UNvbGM+Nc5qqywUG3Soh6oCbtkXvbIE2+bLizYxdOO0ziz51N44T7Vpt
+        // l/F84lRiHB8pv0PzHmcUrbf/PLHqq6CN1jisyDC9hnK4rIU/pXBq7R9+k39frntk
+        // p59z0lsscoDaj45ZT+blI2JhS7wH+ECzJXZHfw9lcXMLB4wfMuYlGbF3s3PyxIUW
+        // Uv9Npor6pUcNwDJKvzlXv2bcRVrD9J7H8RBnWbmlBaaaRn4scRb8pqwd/iedXE7f
+        // qWQQ6g9stA2H3PvPIgrOI8B033AyKS2+d/BwYwY9qxILUBEkJgdKKA//sLD7AiEA
+        // tW2HIYBJTbQ2C9xYKS4DUlGKe4CFr/XoWguyzts+24kCggEAYrbxTpw5FI2vDQBe
+        // 5Q6TlW+YqUPEonAS1t5EGpsYcrssYGcsvz6I2f6D6K5Klv0/wNK4ZxujLLBKQLXY
+        // sFQfnKwWBqN23MJhMSYXTienWLihaaT1oQsCjB7PZ6SvpagTJfJeY+fMZXBXgu2X
+        // xn/BmBpIRVtHOOLxEITDG2nOmU0z+JsPtbe8SX5gzJSxMiKU12gAJPLqFS1s0Fp0
+        // eNLB4sm70tLtycUJG+/8vLTjmbvKpc/2Dku5UOlMVBl9uwntRNPmoHz6YXraEQJU
+        // tXHs6lmu6+uBmtJ5I9ZMJHEao4E4icdDcJ1F6+/FQFxYVRfefjt5X6ob3bRBrZIQ
+        // xj4OzQQjAiEAsceWOM8do4etxp2zgnoNXV8PUUyqWhz1+0srcKV7FR4=
+        // -----END PRIVATE KEY-----
+    };
+
+    // End entity certificate.
+    final static String[] endEntityCertStrs = {
+        // SHA256withECDSA, curve prime256v1
+        // Validity
+        //     Not Before: May 22 07:18:16 2018 GMT
+        //     Not After : May 17 07:18:16 2038 GMT
+        // Authority Key Identifier:
+        //     60:CF:BD:73:FF:FA:1A:30:D2:A4:EC:D3:49:71:46:EF:1A:35:A0:86
+        "-----BEGIN CERTIFICATE-----\n" +
+        "MIIBqjCCAVCgAwIBAgIJAPLY8qZjgNRAMAoGCCqGSM49BAMCMDsxCzAJBgNVBAYT\n" +
+        "AlVTMQ0wCwYDVQQKDARKYXZhMR0wGwYDVQQLDBRTdW5KU1NFIFRlc3QgU2VyaXZj\n" +
+        "ZTAeFw0xODA1MjIwNzE4MTZaFw0zODA1MTcwNzE4MTZaMFUxCzAJBgNVBAYTAlVT\n" +
+        "MQ0wCwYDVQQKDARKYXZhMR0wGwYDVQQLDBRTdW5KU1NFIFRlc3QgU2VyaXZjZTEY\n" +
+        "MBYGA1UEAwwPUmVncmVzc2lvbiBUZXN0MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcD\n" +
+        "QgAEb+9n05qfXnfHUb0xtQJNS4JeSi6IjOfW5NqchvKnfJey9VkJzR7QHLuOESdf\n" +
+        "xlR7q8YIWgih3iWLGfB+wxHiOqMjMCEwHwYDVR0jBBgwFoAUYM+9c//6GjDSpOzT\n" +
+        "SXFG7xo1oIYwCgYIKoZIzj0EAwIDSAAwRQIgWpRegWXMheiD3qFdd8kMdrkLxRbq\n" +
+        "1zj8nQMEwFTUjjQCIQDRIrAjZX+YXHN9b0SoWWLPUq0HmiFIi8RwMnO//wJIGQ==\n" +
+        "-----END CERTIFICATE-----",
+
+        // SHA256withRSA, 2048 bits
+        // Validity
+        //     Not Before: May 22 07:18:16 2018 GMT
+        //     Not After : May 17 07:18:16 2038 GMT
+        // Authority Key Identifier:
+        //     0D:DD:93:C9:FE:4B:BD:35:B7:E8:99:78:90:FB:DB:5A:3D:DB:15:4C
+        "-----BEGIN CERTIFICATE-----\n" +
+        "MIIDNjCCAh6gAwIBAgIJAO2+yPcFryUTMA0GCSqGSIb3DQEBCwUAMDsxCzAJBgNV\n" +
+        "BAYTAlVTMQ0wCwYDVQQKDARKYXZhMR0wGwYDVQQLDBRTdW5KU1NFIFRlc3QgU2Vy\n" +
+        "aXZjZTAeFw0xODA1MjIwNzE4MTZaFw0zODA1MTcwNzE4MTZaMFUxCzAJBgNVBAYT\n" +
+        "AlVTMQ0wCwYDVQQKDARKYXZhMR0wGwYDVQQLDBRTdW5KU1NFIFRlc3QgU2VyaXZj\n" +
+        "ZTEYMBYGA1UEAwwPUmVncmVzc2lvbiBUZXN0MIIBIjANBgkqhkiG9w0BAQEFAAOC\n" +
+        "AQ8AMIIBCgKCAQEAszfBobWfZIp8AgC6PiWDDavP65mSvgCXUGxACbxVNAfkLhNR\n" +
+        "QOsHriRB3X1Q3nvO9PetC6wKlvE9jlnDDj7D+1j1r1CHO7ms1fq8rfcQYdkanDtu\n" +
+        "4AlHo8v+SSWX16MIXFRYDj2VVHmyPtgbltcg4zGAuwT746FdLI94uXjJjq1IOr/v\n" +
+        "0VIlwE5ORWH5Xc+5Tj+oFWK0E4a4GHDgtKKhn2m72hN56/GkPKGkguP5NRS1qYYV\n" +
+        "/EFkdyQMOV8J1M7HaicSft4OL6eKjTrgo93+kHk+tv0Dc6cpVBnalX3TorG8QI6B\n" +
+        "cHj1XQd78oAlAC+/jF4pc0mwi0un49kdK9gRfQIDAQABoyMwITAfBgNVHSMEGDAW\n" +
+        "gBQN3ZPJ/ku9NbfomXiQ+9taPdsVTDANBgkqhkiG9w0BAQsFAAOCAQEApXS0nKwm\n" +
+        "Kp8gpmO2yG1rpd1+2wBABiMU4JZaTqmma24DQ3RzyS+V2TeRb29dl5oTUEm98uc0\n" +
+        "GPZvhK8z5RFr4YE17dc04nI/VaNDCw4y1NALXGs+AHkjoPjLyGbWpi1S+gfq2sNB\n" +
+        "Ekkjp6COb/cb9yiFXOGVls7UOIjnVZVd0r7KaPFjZhYh82/f4PA/A1SnIKd1+nfH\n" +
+        "2yk7mSJNC7Z3qIVDL8MM/jBVwiC3uNe5GPB2uwhd7k5LGAVN3j4HQQGB0Sz+VC1h\n" +
+        "92oi6xDa+YBva2fvHuCd8P50DDjxmp9CemC7rnZ5j8egj88w14X44Xjb/Fd/ApG9\n" +
+        "e57NnbT7KM+Grw==\n" +
+        "-----END CERTIFICATE-----",
+
+        // SHA256withRSA, curv prime256v1
+        // Validity
+        //     Not Before: May 22 07:18:16 2018 GMT
+        //     Not After : May 21 07:18:16 2028 GMT
+        // Authority Key Identifier:
+        //     0D:DD:93:C9:FE:4B:BD:35:B7:E8:99:78:90:FB:DB:5A:3D:DB:15:4C
+        "-----BEGIN CERTIFICATE-----\n" +
+        "MIICazCCAVOgAwIBAgIJAO2+yPcFryUUMA0GCSqGSIb3DQEBCwUAMDsxCzAJBgNV\n" +
+        "BAYTAlVTMQ0wCwYDVQQKDARKYXZhMR0wGwYDVQQLDBRTdW5KU1NFIFRlc3QgU2Vy\n" +
+        "aXZjZTAeFw0xODA1MjIwNzE4MTZaFw0yODA1MjEwNzE4MTZaMFUxCzAJBgNVBAYT\n" +
+        "AlVTMQ0wCwYDVQQKDARKYXZhMR0wGwYDVQQLDBRTdW5KU1NFIFRlc3QgU2VyaXZj\n" +
+        "ZTEYMBYGA1UEAwwPUmVncmVzc2lvbiBUZXN0MFkwEwYHKoZIzj0CAQYIKoZIzj0D\n" +
+        "AQcDQgAE59MERNTlVZ1eeps8Z3Oue5ZkgQdPtD+WIE6tj3PbIKpxGPDxvfNP959A\n" +
+        "yQjEK/ehWQVrCMmNoEkIzY+IIBgB06MjMCEwHwYDVR0jBBgwFoAUDd2Tyf5LvTW3\n" +
+        "6Jl4kPvbWj3bFUwwDQYJKoZIhvcNAQELBQADggEBAFOTVEqs70ykhZiIdrEsF1Ra\n" +
+        "I3B2rLvwXZk52uSltk2/bzVvewA577ZCoxQ1pL7ynkisPfBN1uVYtHjM1VA3RC+4\n" +
+        "+TAK78dnI7otYjWoHp5rvs4l6c/IbOspS290IlNuDUxMErEm5wxIwj+Aukx/1y68\n" +
+        "hOyCvHBLMY2c1LskH1MMBbDuS1aI+lnGpToi+MoYObxGcV458vxuT8+wwV8Fkpvd\n" +
+        "ll8IIFmeNPRv+1E+lXbES6CSNCVaZ/lFhPgdgYKleN7sfspiz50DG4dqafuEAaX5\n" +
+        "xaK1NWXJxTRz0ROH/IUziyuDW6jphrlgit4+3NCzp6vP9hAJQ8Vhcj0n15BKHIQ=\n" +
+        "-----END CERTIFICATE-----",
+
+        // SHA256withDSA, 2048 bits
+        // Validity
+        //     Not Before: May 22 07:18:20 2018 GMT
+        //     Not After : May 17 07:18:20 2038 GMT
+        // Authority Key Identifier:
+        //     76:66:9E:F7:3B:DD:45:E5:3B:D9:72:3C:3F:F0:54:39:86:31:26:53
+        "-----BEGIN CERTIFICATE-----\n" +
+        "MIIEnDCCBEGgAwIBAgIJAP/jh1qVhNVjMAsGCWCGSAFlAwQDAjA7MQswCQYDVQQG\n" +
+        "EwJVUzENMAsGA1UECgwESmF2YTEdMBsGA1UECwwUU3VuSlNTRSBUZXN0IFNlcml2\n" +
+        "Y2UwHhcNMTgwNTIyMDcxODIwWhcNMzgwNTE3MDcxODIwWjBVMQswCQYDVQQGEwJV\n" +
+        "UzENMAsGA1UECgwESmF2YTEdMBsGA1UECwwUU3VuSlNTRSBUZXN0IFNlcml2Y2Ux\n" +
+        "GDAWBgNVBAMMD1JlZ3Jlc3Npb24gVGVzdDCCA0cwggI6BgcqhkjOOAQBMIICLQKC\n" +
+        "AQEAmlavgoJrMcjqWRVcDE2dmWAPREgnzQvneEDef68cprDzjSwvOs5QeFyx75ib\n" +
+        "ado1e6jO/rW1prCGWHDD1oA/Tn4Pk3vu0nUxzvl1qATc+aJbpUU5Op0bvp6LbCsQ\n" +
+        "QslV9FeRh7Eb7bP6gpc/kHCBzEgC1VCK7prccXWy+t6SMOHbND3h+UbckfSaUuaV\n" +
+        "sVJNTD1D6GElfRj4Nmz1BGPfSYvKorwNZEU3gXwFgtDoAcGx7tcyClLpDHfqRfw/\n" +
+        "7yiqLyeiP7D4hl5lMNouJWDlAdMFp0FMgS3s9VDFinIcr6VtBWMTG7+4+czHAB+3\n" +
+        "fvrwlqNzhBn3uFHrekN/w8fNxwIhAJo7Sae1za7IMW0Q6hE5B4b+s2B/FaKPoA4E\n" +
+        "jtZu13B9AoIBAQCOZqLMKfvqZWUgT0PQ3QjR7dAFdd06I9Y3+TOQzZk1+j+vw/6E\n" +
+        "X4vFItX4gihb/u5Q9CdmpwhVGi7bvo+7+/IKeTgoQ6f5+PSug7SrWWUQ5sPwaZui\n" +
+        "zXZJ5nTeZDucFc2yFx0wgnjbPwiUxZklOT7xGiOMtzOTa2koCz5KuIBL+/wPKKxm\n" +
+        "ypo9VoY9xfbdU6LMXZv/lpD5XTM9rYHr/vUTNkukvV6Hpm0YMEWhVZKUJiqCqTqG\n" +
+        "XHaleOxSw6uQWB/+TznifcC7gB48UOQjCqOKf5VuwQneJLhlhU/jhRV3xtr+hLZa\n" +
+        "hW1wYhVi8cjLDrZFKlgEQqhB4crnJU0mJY+tA4IBBQACggEAID0ezl00/X8mv7eb\n" +
+        "bzovum1+DEEP7FM57k6HZEG2N3ve4CW+0m9Cd+cWPz8wkZ+M0j/Eqa6F0IdbkXEc\n" +
+        "Q7CuzvUyJ57xQ3L/WCgXsiS+Bh8O4Mz7GwW22CGmHqafbVv+hKBfr8MkskO6GJUt\n" +
+        "SUF/CVLzB4gMIvZMH26tBP2xK+i7FeEK9kT+nGdzQSZBAhFYpEVCBplHZO24/OYq\n" +
+        "1DNoU327nUuXIhmsfA8N0PjiWbIZIjTPwBGr9H0LpATI7DIDNcvRRvtROP+pBU9y\n" +
+        "fuykPkptg9C0rCM9t06bukpOSaEz/2VIQdLE8fHYFA6pHZ6CIc2+5cfvMgTPhcjz\n" +
+        "W2jCt6MjMCEwHwYDVR0jBBgwFoAUdmae9zvdReU72XI8P/BUOYYxJlMwCwYJYIZI\n" +
+        "AWUDBAMCA0gAMEUCIQCeI5fN08b9BpOaHdc3zQNGjp24FOL/RxlBLeBAorswJgIg\n" +
+        "JEZ8DhYxQy1O7mmZ2UIT7op6epWMB4dENjs0qWPmcKo=\n" +
+        "-----END CERTIFICATE-----"
+    };
+
+    // Private key in the format of PKCS#8.
+    final static String[] endEntityPrivateKeys = {
+        //
+        // EC private key related to cert endEntityCertStrs[0].
+        //
+        "MIGHAgEAMBMGByqGSM49AgEGCCqGSM49AwEHBG0wawIBAQQgn5K03bpTLjEtFQRa\n" +
+        "JUtx22gtmGEvvSUSQdimhGthdtihRANCAARv72fTmp9ed8dRvTG1Ak1Lgl5KLoiM\n" +
+        "59bk2pyG8qd8l7L1WQnNHtAcu44RJ1/GVHurxghaCKHeJYsZ8H7DEeI6",
+
+        //
+        // RSA private key related to cert endEntityCertStrs[1].
+        //
+        "MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCzN8GhtZ9kinwC\n" +
+        "ALo+JYMNq8/rmZK+AJdQbEAJvFU0B+QuE1FA6weuJEHdfVDee870960LrAqW8T2O\n" +
+        "WcMOPsP7WPWvUIc7uazV+ryt9xBh2RqcO27gCUejy/5JJZfXowhcVFgOPZVUebI+\n" +
+        "2BuW1yDjMYC7BPvjoV0sj3i5eMmOrUg6v+/RUiXATk5FYfldz7lOP6gVYrQThrgY\n" +
+        "cOC0oqGfabvaE3nr8aQ8oaSC4/k1FLWphhX8QWR3JAw5XwnUzsdqJxJ+3g4vp4qN\n" +
+        "OuCj3f6QeT62/QNzpylUGdqVfdOisbxAjoFwePVdB3vygCUAL7+MXilzSbCLS6fj\n" +
+        "2R0r2BF9AgMBAAECggEASIkPkMCuw4WdTT44IwERus3IOIYOs2IP3BgEDyyvm4B6\n" +
+        "JP/iihDWKfA4zEl1Gqcni1RXMHswSglXra682J4kui02Ov+vzEeJIY37Ibn2YnP5\n" +
+        "ZjRT2s9GtI/S2o4hl8A/mQb2IMViFC+xKehTukhV4j5d6NPKk0XzLR7gcMjnYxwn\n" +
+        "l21fS6D2oM1xRG/di7sL+uLF8EXLRzfiWDNi12uQv4nwtxPKvuKhH6yzHt7YqMH0\n" +
+        "46pmDKDaxV4w1JdycjCb6NrCJOYZygoQobuZqOQ30UZoZsPJrtovkncFr1e+lNcO\n" +
+        "+aWDfOLCtTH046dEQh5oCShyXMybNlry/QHsOtHOwQKBgQDh2iIjs+FPpQy7Z3EX\n" +
+        "DGEvHYqPjrYO9an2KSRr1m9gzRlWYxKY46WmPKwjMerYtra0GP+TBHrgxsfO8tD2\n" +
+        "wUAII6sd1qup0a/Sutgf2JxVilLykd0+Ge4/Cs51tCdJ8EqDV2B6WhTewOY2EGvg\n" +
+        "JiKYkeNwgRX/9M9CFSAMAk0hUQKBgQDLJAartL3DoGUPjYtpJnfgGM23yAGl6G5r\n" +
+        "NSXDn80BiYIC1p0bG3N0xm3yAjqOtJAUj9jZbvDNbCe3GJfLARMr23legX4tRrgZ\n" +
+        "nEdKnAFKAKL01oM+A5/lHdkwaZI9yyv+hgSVdYzUjB8rDmzeVQzo1BT7vXypt2yV\n" +
+        "6O1OnUpCbQKBgA/0rzDChopv6KRcvHqaX0tK1P0rYeVQqb9ATNhpf9jg5Idb3HZ8\n" +
+        "rrk91BNwdVz2G5ZBpdynFl9G69rNAMJOCM4KZw5mmh4XOEq09Ivba8AHU7DbaTv3\n" +
+        "7QL7KnbaUWRB26HHzIMYVh0el6T+KADf8NXCiMTr+bfpfbL3dxoiF3zhAoGAbCJD\n" +
+        "Qse1dBs/cKYCHfkSOsI5T6kx52Tw0jS6Y4X/FOBjyqr/elyEexbdk8PH9Ar931Qr\n" +
+        "NKMvn8oA4iA/PRrXX7M2yi3YQrWwbkGYWYjtzrzEAdzmg+5eARKAeJrZ8/bg9l3U\n" +
+        "ttKaItJsDPlizn8rngy3FsJpR9aSAMK6/+wOiYkCgYEA1tZkI1rD1W9NYZtbI9BE\n" +
+        "qlJVFi2PBOJMKNuWdouPX3HLQ72GJSQff2BFzLTELjweVVJ0SvY4IipzpQOHQOBy\n" +
+        "5qh/p6izXJZh3IHtvwVBjHoEVplg1b2+I5e3jDCfqnwcQw82dW5SxOJMg1h/BD0I\n" +
+        "qAL3go42DYeYhu/WnECMeis=",
+
+        //
+        // EC private key related to cert endEntityCertStrs[2].
+        //
+        "MIGHAgEAMBMGByqGSM49AgEGCCqGSM49AwEHBG0wawIBAQQgGVc7hICpmp91jbYe\n" +
+        "nrr8nYHD37RZP3VENY+szuA7WjuhRANCAATn0wRE1OVVnV56mzxnc657lmSBB0+0\n" +
+        "P5YgTq2Pc9sgqnEY8PG980/3n0DJCMQr96FZBWsIyY2gSQjNj4ggGAHT",
+
+        //
+        // DSA private key related to cert endEntityCertStrs[3].
+        //
+        "MIICZQIBADCCAjoGByqGSM44BAEwggItAoIBAQCaVq+CgmsxyOpZFVwMTZ2ZYA9E\n" +
+        "SCfNC+d4QN5/rxymsPONLC86zlB4XLHvmJtp2jV7qM7+tbWmsIZYcMPWgD9Ofg+T\n" +
+        "e+7SdTHO+XWoBNz5olulRTk6nRu+notsKxBCyVX0V5GHsRvts/qClz+QcIHMSALV\n" +
+        "UIrumtxxdbL63pIw4ds0PeH5RtyR9JpS5pWxUk1MPUPoYSV9GPg2bPUEY99Ji8qi\n" +
+        "vA1kRTeBfAWC0OgBwbHu1zIKUukMd+pF/D/vKKovJ6I/sPiGXmUw2i4lYOUB0wWn\n" +
+        "QUyBLez1UMWKchyvpW0FYxMbv7j5zMcAH7d++vCWo3OEGfe4Uet6Q3/Dx83HAiEA\n" +
+        "mjtJp7XNrsgxbRDqETkHhv6zYH8Voo+gDgSO1m7XcH0CggEBAI5moswp++plZSBP\n" +
+        "Q9DdCNHt0AV13Toj1jf5M5DNmTX6P6/D/oRfi8Ui1fiCKFv+7lD0J2anCFUaLtu+\n" +
+        "j7v78gp5OChDp/n49K6DtKtZZRDmw/Bpm6LNdknmdN5kO5wVzbIXHTCCeNs/CJTF\n" +
+        "mSU5PvEaI4y3M5NraSgLPkq4gEv7/A8orGbKmj1Whj3F9t1Tosxdm/+WkPldMz2t\n" +
+        "gev+9RM2S6S9XoembRgwRaFVkpQmKoKpOoZcdqV47FLDq5BYH/5POeJ9wLuAHjxQ\n" +
+        "5CMKo4p/lW7BCd4kuGWFT+OFFXfG2v6EtlqFbXBiFWLxyMsOtkUqWARCqEHhyucl\n" +
+        "TSYlj60EIgIgLfA75+8KcKxdN8mr6gzGjQe7jPFGG42Ejhd7Q2F4wuw="
+        };
+
+    // Private key algorithm of endEntityPrivateKeys.
+    final static String[] endEntityPrivateKeyAlgs = {
+        "EC",
+        "RSA",
+        "EC",
+        "DSA",
+    };
+
+    // Private key names of endEntityPrivateKeys.
+    static final String[] endEntityPrivateKeyNames = {
+        "ecdsa",
+        "rsa",
+        "ec-rsa",
+        "dsa",
+    };
+
+    /*
+     * Create an instance of SSLContext with the specified trust/key materials.
+     */
+    private SSLContext createSSLContext(
+            String[] trustedMaterials,
+            String[] keyMaterialCerts,
+            String[] keyMaterialKeys,
+            String[] keyMaterialKeyAlgs,
+            String[] keyMaterialKeyNames,
+            ContextParameters params) throws Exception {
+
+        KeyStore ts = null;     // trust store
+        KeyStore ks = null;     // key store
+        char passphrase[] = "passphrase".toCharArray();
+
+        // Generate certificate from cert string.
+        CertificateFactory cf = CertificateFactory.getInstance("X.509");
+
+        // Import the trused certs.
+        ByteArrayInputStream is;
+        if (trustedMaterials != null && trustedMaterials.length != 0) {
+            ts = KeyStore.getInstance("JKS");
+            ts.load(null, null);
+
+            Certificate[] trustedCert =
+                    new Certificate[trustedMaterials.length];
+            for (int i = 0; i < trustedMaterials.length; i++) {
+                String trustedCertStr = trustedMaterials[i];
+
+                is = new ByteArrayInputStream(trustedCertStr.getBytes());
+                try {
+                    trustedCert[i] = cf.generateCertificate(is);
+                } finally {
+                    is.close();
+                }
+
+                ts.setCertificateEntry("trusted-cert-" + i, trustedCert[i]);
+            }
+        }
+
+        // Import the key materials.
+        //
+        // Note that certification pathes bigger than one are not supported yet.
+        boolean hasKeyMaterials =
+            (keyMaterialCerts != null) && (keyMaterialCerts.length != 0) &&
+            (keyMaterialKeys != null) && (keyMaterialKeys.length != 0) &&
+            (keyMaterialKeyAlgs != null) && (keyMaterialKeyAlgs.length != 0) &&
+            (keyMaterialCerts.length == keyMaterialKeys.length) &&
+            (keyMaterialCerts.length == keyMaterialKeyAlgs.length);
+        if (hasKeyMaterials) {
+            ks = KeyStore.getInstance("JKS");
+            ks.load(null, null);
+
+            for (int i = 0; i < keyMaterialCerts.length; i++) {
+                String keyCertStr = keyMaterialCerts[i];
+
+                // generate the private key.
+                PKCS8EncodedKeySpec priKeySpec = new PKCS8EncodedKeySpec(
+                    Base64.getMimeDecoder().decode(keyMaterialKeys[i]));
+                KeyFactory kf =
+                    KeyFactory.getInstance(keyMaterialKeyAlgs[i]);
+                PrivateKey priKey = kf.generatePrivate(priKeySpec);
+
+                // generate certificate chain
+                is = new ByteArrayInputStream(keyCertStr.getBytes());
+                Certificate keyCert = null;
+                try {
+                    keyCert = cf.generateCertificate(is);
+                } finally {
+                    is.close();
+                }
+
+                Certificate[] chain = new Certificate[] { keyCert };
+
+                // import the key entry.
+                ks.setKeyEntry("cert-" + keyMaterialKeyNames[i],
+                        priKey, passphrase, chain);
+            }
+        }
+
+        // Create an SSLContext object.
+        TrustManagerFactory tmf =
+                TrustManagerFactory.getInstance(params.tmAlgorithm);
+        tmf.init(ts);
+
+        SSLContext context = SSLContext.getInstance(params.contextProtocol);
+        if (hasKeyMaterials && ks != null) {
+            KeyManagerFactory kmf =
+                    KeyManagerFactory.getInstance(params.kmAlgorithm);
+            kmf.init(ks, passphrase);
+
+            context.init(kmf.getKeyManagers(), tmf.getTrustManagers(), null);
+        } else {
+            context.init(null, tmf.getTrustManagers(), null);
+        }
+
+        return context;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/jdk/javax/security/auth/Subject/DoAs.java	Tue Jan 15 10:55:26 2019 -0800
@@ -0,0 +1,57 @@
+/*
+ * 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.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 8214583
+ * @summary Check that getSubject works after JIT compiler escape analysis.
+ */
+import java.security.AccessControlContext;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
+import java.security.PrivilegedExceptionAction;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.Set;
+import javax.security.auth.Subject;
+
+public class DoAs {
+
+    public static void main(String[] args) throws Exception {
+        final Set<String> outer = new HashSet<>(Arrays.asList("Outer"));
+        final Subject subject = new Subject(true, Collections.EMPTY_SET, outer, Collections.EMPTY_SET);
+
+        for (int i = 0; i < 100_000; ++i) {
+            final int index = i;
+            Subject.doAs(subject, (PrivilegedExceptionAction<Integer>)() -> {
+                AccessControlContext c1 = AccessController.getContext();
+                Subject s = Subject.getSubject(c1);
+                if (s != subject) {
+                    throw new AssertionError("outer Oops! " + "iteration " + index + " " + s + " != " + subject);
+                }
+                return 0;
+            });
+        }
+    }
+}
--- a/test/jdk/jdk/jfr/event/gc/detailed/TestPromotionEventWithG1.java	Thu Dec 13 11:51:06 2018 -0800
+++ b/test/jdk/jdk/jfr/event/gc/detailed/TestPromotionEventWithG1.java	Tue Jan 15 10:55:26 2019 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -35,7 +35,8 @@
  *           & vm.opt.ExplicitGCInvokesConcurrent != true
  * @library /test/lib /test/jdk
  * @run main/othervm -Xmx32m -Xms32m -Xmn12m -XX:+UseG1GC -XX:-UseStringDeduplication -XX:MaxTenuringThreshold=5 -XX:InitialTenuringThreshold=5 jdk.jfr.event.gc.detailed.TestPromotionEventWithG1
- * @run main/othervm -Xmx32m -Xms32m -Xmn12m -XX:+UseG1GC -XX:-UseStringDeduplication -XX:MaxTenuringThreshold=5 -XX:InitialTenuringThreshold=5 -XX:MinTLABSize=576 -XX:TLABSize=576 jdk.jfr.event.gc.detailed.TestPromotionEventWithG1
+ * @run main/othervm -Xmx32m -Xms32m -Xmn12m -XX:AllocatePrefetchLines=1 -XX:AllocateInstancePrefetchLines=1 -XX:AllocatePrefetchStepSize=16 -XX:AllocatePrefetchDistance=1 -XX:+UseG1GC
+  *                  -XX:-UseStringDeduplication -Xlog:os+cpu=info -XX:MaxTenuringThreshold=5 -XX:InitialTenuringThreshold=5 -XX:MinTLABSize=768 -XX:TLABSize=768 jdk.jfr.event.gc.detailed.TestPromotionEventWithG1
  */
 public class TestPromotionEventWithG1 {
 
--- a/test/jdk/jdk/jfr/event/runtime/TestNetworkUtilizationEvent.java	Thu Dec 13 11:51:06 2018 -0800
+++ b/test/jdk/jdk/jfr/event/runtime/TestNetworkUtilizationEvent.java	Tue Jan 15 10:55:26 2019 -0800
@@ -25,6 +25,13 @@
 
 package jdk.jfr.event.runtime;
 
+import java.net.DatagramPacket;
+import java.net.DatagramSocket;
+import java.net.InetAddress;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
 import jdk.jfr.Recording;
 import jdk.jfr.consumer.RecordedEvent;
 import jdk.test.lib.Asserts;
@@ -32,17 +39,6 @@
 import jdk.test.lib.jfr.EventNames;
 import jdk.test.lib.jfr.Events;
 
-import java.net.DatagramPacket;
-import java.net.DatagramSocket;
-import java.net.InetAddress;
-import java.time.Duration;
-import java.time.Instant;
-import java.util.List;
-import java.util.Map;
-
-import static java.util.stream.Collectors.averagingLong;
-import static java.util.stream.Collectors.groupingBy;
-
 /**
  * @test
  * @key jfr
@@ -56,21 +52,17 @@
     private static final long packetSendCount = 100;
 
     public static void main(String[] args) throws Throwable {
-        testSimple();
-    }
 
-    static void testSimple() throws Throwable {
-
-        Instant start = Instant.now();
         Recording recording = new Recording();
-        recording.enable(EventNames.NetworkUtilization);
+        recording.enable(EventNames.NetworkUtilization).with("period", "endChunk");
         recording.start();
 
         DatagramSocket socket = new DatagramSocket();
         String msg = "hello!";
         byte[] buf = msg.getBytes();
-
-        // Send a few packets both to the loopback address as well to an external
+        forceEndChunk();
+        // Send a few packets both to the loopback address as well to an
+        // external
         DatagramPacket packet = new DatagramPacket(buf, buf.length, InetAddress.getLoopbackAddress(), 12345);
         for (int i = 0; i < packetSendCount; ++i) {
             socket.send(packet);
@@ -79,32 +71,38 @@
         for (int i = 0; i < packetSendCount; ++i) {
             socket.send(packet);
         }
-
-        // Now there should have been traffic on at least two different interfaces
+        forceEndChunk();
+        socket.close();
+        // Now there should have been traffic on at least two different
+        // interfaces
         recording.stop();
-        Duration runtime = Duration.between(start, Instant.now());
-        List<RecordedEvent> events = Events.fromRecording(recording);
 
-        // Calculate the average write rate for each interface
-        Map<String, Double> writeRates = events.stream()
-                .collect(groupingBy(e -> Events.assertField(e, "networkInterface").getValue(),
-                         averagingLong(e -> Events.assertField(e, "writeRate").getValue())));
-
-        // Our test packets should have generated at least this much traffic per second
-        long expectedTraffic = (buf.length * packetSendCount) / Math.max(1, runtime.toSeconds());
-
-        // Count the number of interfaces that have seen at least our test traffic
-        long interfacesWithTraffic = writeRates.values().stream()
-                .filter(d -> d >= expectedTraffic)
-                .count();
+        Set<String> networkInterfaces = new HashSet<>();
+        List<RecordedEvent> events = Events.fromRecording(recording);
+        Events.hasEvents(events);
+        for (RecordedEvent event : events) {
+            System.out.println(event);
+            Events.assertField(event, "writeRate").atLeast(0L).atMost(1000L * Integer.MAX_VALUE);
+            Events.assertField(event, "readRate").atLeast(0L).atMost(1000L * Integer.MAX_VALUE);
+            Events.assertField(event, "networkInterface").notNull();
+            if (event.getLong("writeRate") > 0) {
+                networkInterfaces.add(event.getString("networkInterface"));
+            }
+        }
 
         if (Platform.isWindows() || Platform.isSolaris()) {
-            // Windows and Solaris do not track statistics for the loopback interface
-            Asserts.assertGreaterThanOrEqual(writeRates.size(), 1);
-            Asserts.assertGreaterThanOrEqual(interfacesWithTraffic, Long.valueOf(1));
+            // Windows and Solaris do not track statistics for the loopback
+            // interface
+            Asserts.assertGreaterThanOrEqual(networkInterfaces.size(), 1);
         } else {
-            Asserts.assertGreaterThanOrEqual(writeRates.size(), 2);
-            Asserts.assertGreaterThanOrEqual(interfacesWithTraffic, Long.valueOf(2));
+            Asserts.assertGreaterThanOrEqual(networkInterfaces.size(), 2);
         }
     }
+
+    private static void forceEndChunk() {
+       try(Recording r = new Recording()) {
+           r.start();
+           r.stop();
+       }
+    }
 }
--- a/test/jdk/sun/nio/cs/FindEncoderBugs.java	Thu Dec 13 11:51:06 2018 -0800
+++ b/test/jdk/sun/nio/cs/FindEncoderBugs.java	Tue Jan 15 10:55:26 2019 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2008, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 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
@@ -180,7 +180,7 @@
         private final long failed0 = failed;
 
         // legend: r=regular d=direct In=Input Ou=Output
-        static final int maxBufSize = 20;
+        static final int maxBufSize = 40;
         static final CharBuffer[] rInBuffers = new CharBuffer[maxBufSize];
         static final CharBuffer[] dInBuffers = new CharBuffer[maxBufSize];
 
@@ -444,6 +444,28 @@
             }
         }
 
+        void testISO88591InvalidChar() {
+            // Several architectures implement the ISO-8859-1 encoder as an
+            // intrinsic where the vectorised assembly has separate cases
+            // for different input sizes, so exhaustively test all sizes
+            // from 0 to maxBufSize to ensure we get coverage
+
+            for (int i = 0; i < CharsetTester.maxBufSize; i++) {
+                char[] ia = new char[i];
+                for (int j = 0; j < i; j++)
+                    ia[j] = randomChar();
+
+                test(ia);
+
+                // Test break on unrepresentable character
+                for (int j = 0; j < i; j++) {
+                    char[] iaInvalid = ia.clone();
+                    iaInvalid[j] = (char)(randomChar() | 0x100);
+                    test(iaInvalid);
+                }
+            }
+        }
+
         void testPrefix(char[] prefix) {
             if (prefix.length > 0)
                 System.out.printf("Testing prefix %s%n", string(prefix));
@@ -492,6 +514,9 @@
             System.out.println("More ISCII testing...");
             new CharsetTester(cs).testPrefix(new char[]{'\u094d'}); // Halant
             new CharsetTester(cs).testPrefix(new char[]{'\u093c'}); // Nukta
+        } else if (csn.equals("ISO-8859-1")) {
+            System.out.println("More ISO-8859-1 testing...");
+            new CharsetTester(cs).testISO88591InvalidChar();
         }
     }
 
--- a/test/jdk/sun/nio/cs/OLD/IBM1383_OLD.java	Thu Dec 13 11:51:06 2018 -0800
+++ b/test/jdk/sun/nio/cs/OLD/IBM1383_OLD.java	Tue Jan 15 10:55:26 2019 -0800
@@ -31,7 +31,7 @@
 import java.nio.charset.CharsetDecoder;
 import java.nio.charset.CharsetEncoder;
 import java.nio.charset.CharacterCodingException;
-import sun.nio.cs.HistoricallyNamedCharset;
+import sun.nio.cs.*;
 import sun.nio.cs.ext.*;
 
 
--- a/test/jdk/sun/nio/cs/OLD/IBM942_OLD.java	Thu Dec 13 11:51:06 2018 -0800
+++ b/test/jdk/sun/nio/cs/OLD/IBM942_OLD.java	Tue Jan 15 10:55:26 2019 -0800
@@ -31,7 +31,7 @@
 import java.nio.charset.CharsetDecoder;
 import java.nio.charset.CharsetEncoder;
 import java.nio.charset.CharacterCodingException;
-import sun.nio.cs.HistoricallyNamedCharset;
+import sun.nio.cs.*;
 import sun.nio.cs.ext.*;
 
 
--- a/test/jdk/sun/nio/cs/OLD/IBM943_OLD.java	Thu Dec 13 11:51:06 2018 -0800
+++ b/test/jdk/sun/nio/cs/OLD/IBM943_OLD.java	Tue Jan 15 10:55:26 2019 -0800
@@ -30,7 +30,7 @@
 import java.nio.charset.CharsetDecoder;
 import java.nio.charset.CharsetEncoder;
 import java.nio.charset.CharacterCodingException;
-import sun.nio.cs.HistoricallyNamedCharset;
+import sun.nio.cs.*;
 import sun.nio.cs.ext.*;
 
 
--- a/test/jdk/sun/nio/cs/OLD/IBM950_OLD.java	Thu Dec 13 11:51:06 2018 -0800
+++ b/test/jdk/sun/nio/cs/OLD/IBM950_OLD.java	Tue Jan 15 10:55:26 2019 -0800
@@ -30,7 +30,7 @@
 import java.nio.charset.CharsetDecoder;
 import java.nio.charset.CharsetEncoder;
 import java.nio.charset.CharacterCodingException;
-import sun.nio.cs.HistoricallyNamedCharset;
+import sun.nio.cs.*;
 import sun.nio.cs.ext.*;
 
 
--- a/test/jdk/sun/nio/cs/OLD/IBM970_OLD.java	Thu Dec 13 11:51:06 2018 -0800
+++ b/test/jdk/sun/nio/cs/OLD/IBM970_OLD.java	Tue Jan 15 10:55:26 2019 -0800
@@ -33,8 +33,7 @@
 import java.nio.charset.CharsetDecoder;
 import java.nio.charset.CharsetEncoder;
 import java.nio.charset.CoderResult;
-import sun.nio.cs.HistoricallyNamedCharset;
-import sun.nio.cs.Surrogate;
+import sun.nio.cs.*;
 import sun.nio.cs.ext.*;
 
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/jdk/sun/security/ssl/SSLSocketImpl/SSLExceptionForIOIssue.java	Tue Jan 15 10:55:26 2019 -0800
@@ -0,0 +1,162 @@
+/*
+ * 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.
+ *
+ * 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.
+ */
+
+//
+// Please run in othervm mode.  SunJSSE does not support dynamic system
+// properties, no way to re-use system properties in samevm/agentvm mode.
+//
+
+/*
+ * @test
+ * @bug 8214339
+ * @summary SSLSocketImpl erroneously wraps SocketException
+ * @library /javax/net/ssl/templates
+ * @run main/othervm SSLExceptionForIOIssue
+ */
+
+import javax.net.ssl.*;
+import java.io.*;
+import java.net.InetAddress;
+
+public class SSLExceptionForIOIssue implements SSLContextTemplate {
+
+    public static void main(String[] args) throws Exception {
+        System.err.println("===================================");
+        new SSLExceptionForIOIssue().test();
+    }
+
+    private void test() throws Exception {
+        SSLServerSocket listenSocket = null;
+        SSLSocket serverSocket = null;
+        ClientSocket clientSocket = null;
+        try {
+            SSLServerSocketFactory serversocketfactory =
+                    createServerSSLContext().getServerSocketFactory();
+            listenSocket =
+                    (SSLServerSocket)serversocketfactory.createServerSocket(0);
+            listenSocket.setNeedClientAuth(false);
+            listenSocket.setEnableSessionCreation(true);
+            listenSocket.setUseClientMode(false);
+
+            System.err.println("Starting client");
+            clientSocket = new ClientSocket(listenSocket.getLocalPort());
+            clientSocket.start();
+
+            System.err.println("Accepting client requests");
+            serverSocket = (SSLSocket)listenSocket.accept();
+
+            if (!clientSocket.isDone) {
+                System.err.println("Waiting 3 seconds for client ");
+                Thread.sleep(3000);
+            }
+
+            System.err.println("Sending data to client ...");
+            String serverData = "Hi, I am server";
+            BufferedWriter os = new BufferedWriter(
+                    new OutputStreamWriter(serverSocket.getOutputStream()));
+            os.write(serverData, 0, serverData.length());
+            os.newLine();
+            os.flush();
+        } catch (SSLProtocolException | SSLHandshakeException sslhe) {
+            throw sslhe;
+        } catch (SSLException ssle) {
+            // the expected exception, ignore it
+            System.err.println("server exception: " + ssle);
+        } finally {
+            if (listenSocket != null) {
+                listenSocket.close();
+            }
+
+            if (serverSocket != null) {
+                serverSocket.close();
+            }
+        }
+
+        if (clientSocket != null && clientSocket.clientException != null) {
+            throw clientSocket.clientException;
+        }
+    }
+
+
+
+    private class ClientSocket extends Thread{
+        boolean isDone = false;
+        int serverPort = 0;
+        Exception clientException;
+
+        public ClientSocket(int serverPort) {
+            this.serverPort = serverPort;
+        }
+
+        @Override
+        public void run() {
+            SSLSocket clientSocket = null;
+            String clientData = "Hi, I am client";
+            try {
+                System.err.println(
+                        "Connecting to server at port " + serverPort);
+                SSLSocketFactory sslSocketFactory =
+                        createClientSSLContext().getSocketFactory();
+                clientSocket = (SSLSocket)sslSocketFactory.createSocket(
+                        InetAddress.getLocalHost(), serverPort);
+                clientSocket.setSoLinger(true, 3);
+                clientSocket.setSoTimeout(100);
+
+
+                System.err.println("Sending data to server ...");
+
+                BufferedWriter os = new BufferedWriter(
+                        new OutputStreamWriter(clientSocket.getOutputStream()));
+                os.write(clientData, 0, clientData.length());
+                os.newLine();
+                os.flush();
+
+                System.err.println("Reading data from server");
+                BufferedReader is = new BufferedReader(
+                        new InputStreamReader(clientSocket.getInputStream()));
+                String data = is.readLine();
+                System.err.println("Received Data from server: " + data);
+            } catch (SSLProtocolException | SSLHandshakeException sslhe) {
+                clientException = sslhe;
+                System.err.println("unexpected client exception: " + sslhe);
+            } catch (SSLException ssle) {
+                // the expected exception, ignore it
+                System.err.println("expected client exception: " + ssle);
+            } catch (Exception e) {
+                clientException = e;
+                System.err.println("unexpected client exception: " + e);
+            } finally {
+                if (clientSocket != null) {
+                    try {
+                        clientSocket.close();
+                        System.err.println("client socket closed");
+                    } catch (IOException ioe) {
+                        clientException = ioe;
+                    }
+                }
+
+                isDone = true;
+            }
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/jdk/sun/security/ssl/SSLSocketImpl/SSLSocketBruceForceClose.java	Tue Jan 15 10:55:26 2019 -0800
@@ -0,0 +1,147 @@
+/*
+ * 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.
+ *
+ * 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.
+ */
+
+//
+// Please run in othervm mode.  SunJSSE does not support dynamic system
+// properties, no way to re-use system properties in samevm/agentvm mode.
+//
+
+/*
+ * @test
+ * @bug 8209333
+ * @summary Socket reset issue for TLS 1.3 socket close
+ * @library /javax/net/ssl/templates
+ * @run main/othervm SSLSocketBruceForceClose
+ */
+
+import javax.net.ssl.*;
+import java.io.*;
+import java.net.InetAddress;
+
+public class SSLSocketBruceForceClose implements SSLContextTemplate {
+
+    public static void main(String[] args) throws Exception {
+        for (int i = 0; i<= 10; i++) {
+            System.err.println("===================================");
+            System.err.println("loop " + i);
+            System.err.println("===================================");
+            new SSLSocketBruceForceClose().test();
+        }
+    }
+
+    private void test() throws Exception {
+        SSLServerSocket listenSocket = null;
+        SSLSocket serverSocket = null;
+        ClientSocket clientSocket = null;
+        try {
+            SSLServerSocketFactory serversocketfactory =
+                    createServerSSLContext().getServerSocketFactory();
+            listenSocket =
+                    (SSLServerSocket)serversocketfactory.createServerSocket(0);
+            listenSocket.setNeedClientAuth(false);
+            listenSocket.setEnableSessionCreation(true);
+            listenSocket.setUseClientMode(false);
+
+
+            System.err.println("Starting client");
+            clientSocket = new ClientSocket(listenSocket.getLocalPort());
+            clientSocket.start();
+
+            System.err.println("Accepting client requests");
+            serverSocket = (SSLSocket) listenSocket.accept();
+
+            System.err.println("Reading data from client");
+            BufferedReader serverReader = new BufferedReader(
+                    new InputStreamReader(serverSocket.getInputStream()));
+            String data = serverReader.readLine();
+            System.err.println("Received data from client: " + data);
+
+            System.err.println("Reading more data from client");
+            data = serverReader.readLine();
+            System.err.println("Received data from client: " + data);
+        } finally {
+            if (listenSocket != null) {
+                listenSocket.close();
+            }
+
+            if (serverSocket != null) {
+                serverSocket.close();
+            }
+        }
+
+        if (clientSocket != null && clientSocket.clientException != null) {
+            throw clientSocket.clientException;
+        }
+    }
+
+    private class ClientSocket extends Thread{
+        int serverPort = 0;
+        Exception clientException;
+
+        public ClientSocket(int serverPort) {
+            this.serverPort = serverPort;
+        }
+
+        @Override
+        public void run() {
+            SSLSocket clientSocket = null;
+            String clientData = "Hi, I am client";
+            try {
+                System.err.println(
+                        "Connecting to server at port " + serverPort);
+                SSLSocketFactory sslSocketFactory =
+                        createClientSSLContext().getSocketFactory();
+                clientSocket = (SSLSocket)sslSocketFactory.createSocket(
+                        InetAddress.getLocalHost(), serverPort);
+                clientSocket.setSoLinger(true, 3);
+                clientSocket.setSoTimeout(1000);
+
+
+                System.err.println("Sending data to server ...");
+
+                BufferedWriter os = new BufferedWriter(
+                        new OutputStreamWriter(clientSocket.getOutputStream()));
+                os.write(clientData, 0, clientData.length());
+                os.newLine();
+                os.flush();
+
+                System.err.println("Sending more data to server ...");
+                os.write(clientData, 0, clientData.length());
+                os.newLine();
+                os.flush();
+            } catch (Exception e) {
+                clientException = e;
+            } finally {
+                if (clientSocket != null) {
+                    try{
+                        clientSocket.close();
+                        System.err.println("client socket closed");
+                    } catch (IOException ioe) {
+                        clientException = ioe;
+                    }
+                }
+            }
+        }
+    }
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/jdk/sun/security/ssl/SSLSocketImpl/SSLSocketClose.java	Tue Jan 15 10:55:26 2019 -0800
@@ -0,0 +1,159 @@
+/*
+ * 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.
+ *
+ * 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.
+ */
+
+//
+// Please run in othervm mode.  SunJSSE does not support dynamic system
+// properties, no way to re-use system properties in samevm/agentvm mode.
+//
+
+/*
+ * @test
+ * @bug 8209333
+ * @summary Socket reset issue for TLS 1.3 socket close
+ * @library /javax/net/ssl/templates
+ * @run main/othervm SSLSocketClose
+ */
+
+import javax.net.ssl.*;
+import java.io.*;
+import java.net.InetAddress;
+
+public class SSLSocketClose implements SSLContextTemplate {
+
+    public static void main(String[] args) throws Exception {
+        for (int i = 0; i<= 10; i++) {
+            System.err.println("===================================");
+            System.err.println("loop " + i);
+            System.err.println("===================================");
+            new SSLSocketClose().test();
+        }
+    }
+
+    private void test() throws Exception {
+        SSLServerSocket listenSocket = null;
+        SSLSocket serverSocket = null;
+        ClientSocket clientSocket = null;
+        try {
+            SSLServerSocketFactory serversocketfactory =
+                    createServerSSLContext().getServerSocketFactory();
+            listenSocket =
+                    (SSLServerSocket)serversocketfactory.createServerSocket(0);
+            listenSocket.setNeedClientAuth(false);
+            listenSocket.setEnableSessionCreation(true);
+            listenSocket.setUseClientMode(false);
+
+
+            System.err.println("Starting client");
+            clientSocket = new ClientSocket(listenSocket.getLocalPort());
+            clientSocket.start();
+
+            System.err.println("Accepting client requests");
+            serverSocket = (SSLSocket) listenSocket.accept();
+
+            System.err.println("Reading data from client");
+            BufferedReader serverReader = new BufferedReader(
+                    new InputStreamReader(serverSocket.getInputStream()));
+            String data = serverReader.readLine();
+            System.err.println("Received data from client: " + data);
+
+            System.err.println("Sending data to client ...");
+            String serverData = "Hi, I am server";
+            BufferedWriter os = new BufferedWriter(
+                    new OutputStreamWriter(serverSocket.getOutputStream()));
+            os.write(serverData, 0, serverData.length());
+            os.newLine();
+            os.flush();
+
+            System.err.println("Reading more data from client");
+            data = serverReader.readLine();
+            System.err.println("Received data from client: " + data);
+        } finally {
+            if (listenSocket != null) {
+                listenSocket.close();
+            }
+
+            if (serverSocket != null) {
+                serverSocket.close();
+            }
+        }
+
+        if (clientSocket != null && clientSocket.clientException != null) {
+            throw clientSocket.clientException;
+        }
+    }
+
+    private class ClientSocket extends Thread{
+        int serverPort = 0;
+        Exception clientException;
+
+        public ClientSocket(int serverPort) {
+            this.serverPort = serverPort;
+        }
+
+        @Override
+        public void run() {
+            SSLSocket clientSocket = null;
+            String clientData = "Hi, I am client";
+            try {
+                System.err.println(
+                        "Connecting to server at port " + serverPort);
+                SSLSocketFactory sslSocketFactory =
+                        createClientSSLContext().getSocketFactory();
+                clientSocket = (SSLSocket)sslSocketFactory.createSocket(
+                        InetAddress.getLocalHost(), serverPort);
+                clientSocket.setSoLinger(true, 3);
+
+                System.err.println("Sending data to server ...");
+
+                BufferedWriter os = new BufferedWriter(
+                        new OutputStreamWriter(clientSocket.getOutputStream()));
+                os.write(clientData, 0, clientData.length());
+                os.newLine();
+                os.flush();
+
+                System.err.println("Reading data from server");
+                BufferedReader is = new BufferedReader(
+                        new InputStreamReader(clientSocket.getInputStream()));
+                String data = is.readLine();
+                System.err.println("Received Data from server: " + data);
+
+                System.err.println("Sending more data to server ...");
+                os.write(clientData, 0, clientData.length());
+                os.newLine();
+                os.flush();
+            } catch (Exception e) {
+                clientException = e;
+            } finally {
+                if (clientSocket != null) {
+                    try{
+                        clientSocket.close();
+                        System.err.println("client socket closed");
+                    } catch (IOException ioe) {
+                        clientException = ioe;
+                    }
+                }
+            }
+        }
+    }
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/jdk/sun/security/util/misc/SetNullSigParams.java	Tue Jan 15 10:55:26 2019 -0800
@@ -0,0 +1,78 @@
+/*
+ * 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.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 8214096
+ * @summary Make sure SignatureUtil can accept null algorithm parameters
+ * @modules java.base/sun.security.util
+ */
+import java.security.*;
+import java.security.spec.AlgorithmParameterSpec;
+import sun.security.util.SignatureUtil;
+
+public class SetNullSigParams {
+
+    public static void main(String[] args) throws Exception {
+        Signature sig = new SpecialSigImpl();
+        SignatureUtil.specialSetParameter(sig, (byte[]) null);
+        SignatureUtil.specialSetParameter(sig, (AlgorithmParameters) null);
+    }
+
+    // Sample Signature impl class which simulates 3rd party provider behavior
+    // and throws NPE when given null algorithm parameters
+    // For max backward-compatibility, sun.security.util.SignatureUtil class
+    // now calls setParameter() only when algorithm parameters is non-null
+    private static class SpecialSigImpl extends Signature {
+        SpecialSigImpl() {
+            super("ANY");
+        }
+        @Override
+        protected void engineInitVerify(PublicKey publicKey)
+                throws InvalidKeyException {}
+        @Override
+        protected void engineInitSign(PrivateKey privateKey)
+                throws InvalidKeyException {}
+        @Override
+        protected void engineUpdate(byte b) throws SignatureException {}
+        @Override
+        protected void engineUpdate(byte[] b, int off, int len)
+                throws SignatureException {}
+        @Override
+        protected byte[] engineSign() throws SignatureException { return null; }
+        @Override
+        protected boolean engineVerify(byte[] sigBytes)
+                throws SignatureException { return false; }
+        @Override
+        protected void engineSetParameter(String param, Object value)
+                throws InvalidParameterException {}
+        @Override
+        protected void engineSetParameter(AlgorithmParameterSpec params)
+                throws InvalidAlgorithmParameterException {
+            if (params == null) throw new NullPointerException("Test Failed");
+        }
+        @Override
+        protected Object engineGetParameter(String param)
+                throws InvalidParameterException { return null; }
+    }
+}
--- a/test/jdk/tools/launcher/ExecutionEnvironment.java	Thu Dec 13 11:51:06 2018 -0800
+++ b/test/jdk/tools/launcher/ExecutionEnvironment.java	Tue Jan 15 10:55:26 2019 -0800
@@ -241,17 +241,26 @@
      */
     @Test
     void testVmSelection() {
+        boolean haveSomeVM = false;
         if (haveClientVM) {
-            TestResult tr = doExec(javaCmd, "-client", "-version");
-            if (!tr.matches(".*Client VM.*")) {
-                flagError(tr, "the expected vm -client did not launch");
-            }
+            tryVmOption("-client", ".*Client VM.*");
+            haveSomeVM = true;
         }
         if (haveServerVM) {
-            TestResult tr = doExec(javaCmd, "-server", "-version");
-            if (!tr.matches(".*Server VM.*")) {
-                flagError(tr, "the expected vm -server did not launch");
-            }
+            tryVmOption("-server", ".*Server VM.*");
+            haveSomeVM = true;
+        }
+        if (!haveSomeVM) {
+            String msg = "Don't have a known VM";
+            System.err.println(msg);
+            throw new RuntimeException(msg);
+        }
+    }
+
+    private void tryVmOption(String opt, String expected) {
+        TestResult tr = doExec(javaCmd, opt, "-version");
+        if (!tr.matches(expected)) {
+            flagError(tr, "the expected vm " + opt + " did not launch");
         }
     }
 
--- a/test/jdk/tools/launcher/Test7029048.java	Thu Dec 13 11:51:06 2018 -0800
+++ b/test/jdk/tools/launcher/Test7029048.java	Tue Jan 15 10:55:26 2019 -0800
@@ -59,13 +59,10 @@
     private static final File srcLibjvmSo = new File(srcServerDir, LIBJVM);
 
     private static final File dstLibDir = new File("lib");
-    private static final File dstLibArchDir =
-            new File(dstLibDir, getJreArch());
-
-    private static final File dstServerDir = new File(dstLibArchDir, "server");
+    private static final File dstServerDir = new File(dstLibDir, "server");
     private static final File dstServerLibjvm = new File(dstServerDir, LIBJVM);
 
-    private static final File dstClientDir = new File(dstLibArchDir, "client");
+    private static final File dstClientDir = new File(dstLibDir, "client");
     private static final File dstClientLibjvm = new File(dstClientDir, LIBJVM);
 
     private static final Map<String, String> env = new HashMap<>();
--- a/test/jdk/tools/launcher/TestHelper.java	Thu Dec 13 11:51:06 2018 -0800
+++ b/test/jdk/tools/launcher/TestHelper.java	Tue Jan 15 10:55:26 2019 -0800
@@ -184,8 +184,7 @@
             return jvmFile.exists();
         } else {
             File vmDir = new File(JAVA_LIB, type);
-            File vmArchDir = new File(vmDir, getJreArch());
-            File jvmFile = new File(vmArchDir, LIBJVM);
+            File jvmFile = new File(vmDir, LIBJVM);
             return jvmFile.exists();
         }
     }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/langtools/jdk/javadoc/doclet/testLinkOption/TestLinkOptionWithAutomaticModule.java	Tue Jan 15 10:55:26 2019 -0800
@@ -0,0 +1,155 @@
+/*
+ * Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 8212233
+ * @summary The code being documented uses modules but the packages defined in $URL are in the unnamed module.
+ * @library /tools/lib ../lib
+ * @modules
+ *      jdk.javadoc/jdk.javadoc.internal.tool
+ *      jdk.compiler/com.sun.tools.javac.api
+ *      jdk.compiler/com.sun.tools.javac.main
+ * @build JavadocTester toolbox.JarTask toolbox.JavacTask toolbox.ModuleBuilder toolbox.ToolBox
+ * @run main TestLinkOptionWithAutomaticModule
+ */
+
+import java.io.IOException;
+import java.nio.file.Files;
+import java.nio.file.Path;
+
+import toolbox.JarTask;
+import toolbox.JavacTask;
+import toolbox.ModuleBuilder;
+import toolbox.ToolBox;
+
+public class TestLinkOptionWithAutomaticModule extends JavadocTester {
+
+    public static void main(String... args) throws Exception {
+        TestLinkOptionWithAutomaticModule tester = new TestLinkOptionWithAutomaticModule();
+        tester.runTests(m -> new Object[]{ Path.of(m.getName()) });
+    }
+
+    final ToolBox tb = new ToolBox();
+    private Path libJar;
+    private Path libAPI;
+
+    TestLinkOptionWithAutomaticModule() throws IOException {
+        initLib();
+    }
+
+    private void initLib() throws IOException {
+        // create library: write source, compile it, jar it
+        Path lib = Path.of("lib");
+        Path libSrc = lib.resolve("src");
+        tb.writeJavaFiles(libSrc, "package lib; public class LibClass { }");
+        Path libClasses = Files.createDirectories(lib.resolve("classes"));
+
+        new JavacTask(tb)
+                .outdir(libClasses)
+                .files(tb.findJavaFiles(libSrc))
+                .run()
+                .writeAll();
+
+        libJar = lib.resolve("MyLib.jar");
+        new JarTask(tb, libJar)
+                .baseDir(libClasses)
+                .files(".")
+                .run();
+
+        libAPI = lib.resolve("api");
+        javadoc("-d", libAPI.toString(),
+                "-sourcepath", libSrc.toString(),
+                "lib");
+        checkExit(Exit.OK);
+    }
+
+    @Test
+    public void testLinkUnnamedToAutomaticModule(Path base) throws IOException {
+
+        // create API referring to library
+        Path src = base.resolve("src");
+        tb.writeJavaFiles(src, "package p; public class MyClass extends lib.LibClass { }");
+
+        // run javadoc with library as automatic module
+        Path api = base.resolve("api");
+        javadoc("-d", api.toString(),
+                "-sourcepath", src.toString(),
+                "--add-modules", "MyLib",
+                "--module-path", libJar.toString(),
+                "-linkoffline", "http://myWebsite", libAPI.toAbsolutePath().toString(),
+                "p");
+        checkExit(Exit.OK);
+        checkOutput("p/MyClass.html", true,
+                "extends <a href=\"http://myWebsite/lib/LibClass.html?is-external=true\" "
+                + "title=\"class or interface in lib\" class=\"externalLink\">LibClass</a>");
+    }
+
+    @Test
+    public void testLinkNamedToAutomaticModule(Path base) throws IOException {
+
+        // create API referring to library
+        Path src = base.resolve("src");
+        new ModuleBuilder(tb, "my.module")
+                .exports("p")
+                .requires("MyLib")
+                .classes("package p; public class MyClass extends lib.LibClass { }")
+                .write(src);
+
+        // run javadoc with library as automatic module
+        Path api = base.resolve("api");
+        javadoc("-d", api.toString(),
+                "--module-source-path", src.toString(),
+                "--module-path", libJar.toString(),
+                "-linkoffline", "http://myWebsite", libAPI.toAbsolutePath().toString(),
+                "--module", "my.module");
+        checkExit(Exit.OK);
+        checkOutput("my.module/p/MyClass.html", true,
+                "extends <a href=\"http://myWebsite/lib/LibClass.html?is-external=true\" "
+                + "title=\"class or interface in lib\" class=\"externalLink\">LibClass</a>");
+    }
+
+    @Test
+    public void testLinkNamedToUnnamedModule(Path base) throws IOException {
+
+        // create API referring to library
+        Path src = base.resolve("src");
+        new ModuleBuilder(tb, "my.module")
+                .exports("p")
+                .classes("package p; public class MyClass extends lib.LibClass { }")
+                .write(src);
+
+        // run javadoc with library as unnamed module
+        Path api = base.resolve("api");
+        javadoc("-d", api.toString(),
+                "--module-source-path", src.toString(),
+                "--add-reads", "my.module=ALL-UNNAMED",
+                "--class-path", libJar.toString(),
+                "-linkoffline", "http://myWebsite", libAPI.toAbsolutePath().toString(),
+                "--module", "my.module");
+        checkExit(Exit.OK);
+        checkOutput("my.module/p/MyClass.html", true,
+                "extends <a href=\"http://myWebsite/lib/LibClass.html?is-external=true\" "
+                + "title=\"class or interface in lib\" class=\"externalLink\">LibClass</a>");
+    }
+}
--- a/test/langtools/jdk/javadoc/doclet/testSearch/TestSearch.java	Thu Dec 13 11:51:06 2018 -0800
+++ b/test/langtools/jdk/javadoc/doclet/testSearch/TestSearch.java	Tue Jan 15 10:55:26 2019 -0800
@@ -686,7 +686,7 @@
                 + "            return ui.item.m + slash;\n"
                 + "        } else if ((ui.item.category === catTypes && ui.item.p) || ui.item.category === catMembers) {\n"
                 + "            $.each(packageSearchIndex, function(index, item) {\n"
-                + "                if (ui.item.p == item.l) {\n"
+                + "                if (item.m && ui.item.p == item.l) {\n"
                 + "                    urlPrefix = item.m + slash;\n"
                 + "                }\n"
                 + "            });\n"
--- a/test/langtools/jdk/jshell/ReplToolTesting.java	Thu Dec 13 11:51:06 2018 -0800
+++ b/test/langtools/jdk/jshell/ReplToolTesting.java	Tue Jan 15 10:55:26 2019 -0800
@@ -22,6 +22,7 @@
  */
 
 import java.io.ByteArrayOutputStream;
+import java.io.IOException;
 import java.io.OutputStream;
 import java.io.PrintStream;
 import java.util.ArrayList;
@@ -126,6 +127,14 @@
         cmdin.setInput(s);
     }
 
+    public void closeCommandInput() {
+        try {
+            cmdin.close();
+        } catch (IOException ex) {
+            throw new IllegalStateException(ex);
+        }
+    }
+
     public final static Pattern idPattern = Pattern.compile("^\\s+(\\d+)");
     public Consumer<String> assertList() {
         return s -> {
@@ -755,6 +764,8 @@
 
     class WaitingTestingInputStream extends TestingInputStream {
 
+        private boolean closed;
+
         @Override
         synchronized void setInput(String s) {
             super.setInput(s);
@@ -764,7 +775,7 @@
         synchronized void waitForInput() {
             boolean interrupted = false;
             try {
-                while (available() == 0) {
+                while (available() == 0 && !closed) {
                     try {
                         wait();
                     } catch (InterruptedException e) {
@@ -790,6 +801,12 @@
             waitForInput();
             return super.read(b, off, len);
         }
+
+        @Override
+        public synchronized void close() throws IOException {
+            closed = true;
+            notify();
+        }
     }
 
     class PromptedCommandOutputStream extends OutputStream {
--- a/test/langtools/jdk/jshell/ToolBasicTest.java	Thu Dec 13 11:51:06 2018 -0800
+++ b/test/langtools/jdk/jshell/ToolBasicTest.java	Tue Jan 15 10:55:26 2019 -0800
@@ -130,6 +130,18 @@
         }
     }
 
+    public void testCtrlD() {
+        test(false, new String[]{"--no-startup"},
+                a -> {
+                    if (!a) {
+                        closeCommandInput();
+                    } else {
+                        throw new IllegalStateException();
+                    }
+                }
+        );
+    }
+
     private final Object lock = new Object();
     private PrintWriter out;
     private boolean isStopped;
--- a/test/langtools/jdk/jshell/ToolShiftTabTest.java	Thu Dec 13 11:51:06 2018 -0800
+++ b/test/langtools/jdk/jshell/ToolShiftTabTest.java	Tue Jan 15 10:55:26 2019 -0800
@@ -126,7 +126,7 @@
         doRunTest((inputSink, out) -> {
             inputSink.write("123");
             inputSink.write(FIX + "z");
-            waitOutput(out, "Unexpected character after Shift-Tab");
+            waitOutput(out, "Unexpected character after Shift\\+Tab");
         });
     }
 }
--- a/test/langtools/jdk/jshell/ToolSimpleTest.java	Thu Dec 13 11:51:06 2018 -0800
+++ b/test/langtools/jdk/jshell/ToolSimpleTest.java	Tue Jan 15 10:55:26 2019 -0800
@@ -23,7 +23,7 @@
 
 /*
  * @test
- * @bug 8153716 8143955 8151754 8150382 8153920 8156910 8131024 8160089 8153897 8167128 8154513 8170015 8170368 8172102 8172103  8165405 8173073 8173848 8174041 8173916 8174028 8174262 8174797 8177079 8180508 8177466 8172154 8192979 8191842 8198573 8198801 8210596 8210959
+ * @bug 8153716 8143955 8151754 8150382 8153920 8156910 8131024 8160089 8153897 8167128 8154513 8170015 8170368 8172102 8172103  8165405 8173073 8173848 8174041 8173916 8174028 8174262 8174797 8177079 8180508 8177466 8172154 8192979 8191842 8198573 8198801 8210596 8210959 8215099
  * @summary Simple jshell tool tests
  * @modules jdk.compiler/com.sun.tools.javac.api
  *          jdk.compiler/com.sun.tools.javac.main
@@ -76,22 +76,6 @@
     }
 
     @Test
-    public void testRawString() {
-        test(false, new String[]{"--enable-preview", "--no-startup"},
-                (a) -> assertCommand(a, "String s = `abc`", "s ==> \"abc\""),
-                (a) -> assertCommand(a, "String a = `abc", ""),
-                (a) -> assertCommand(a, "def`", "a ==> \"abc\\ndef\""),
-                (a) -> assertCommand(a, "String bj = ``Hi, `Bob` and ```Jim```.``", "bj ==> \"Hi, `Bob` and ```Jim```.\""),
-                (a) -> assertCommand(a, "String hw = ````````````", ""),
-                (a) -> assertCommand(a, "Hello, world", ""),
-                (a) -> assertCommand(a, "````````````;", "hw ==> \"\\nHello, world\\n\""),
-                (a) -> assertCommand(a, "String uc = `\\u000d\\u000a`", "uc ==> \"\\\\u000d\\\\u000a\""),
-                (a) -> assertCommand(a, "String es = `\\(.\\)\\1`", "es ==> \"\\\\(.\\\\)\\\\1\""),
-                (a) -> assertCommand(a, "String end = `abc`+`def`+`ghi`", "end ==> \"abcdefghi\"")
-        );
-    }
-
-    @Test
     public void testSwitchExpression() {
         test(false, new String[]{"--enable-preview", "--no-startup"},
                 (a) -> assertCommand(a, "enum Day {MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY, SATURDAY, SUNDAY }", "|  created enum Day"),
@@ -448,7 +432,8 @@
         test(
                 (a) -> assertHelp(a, "/?", "/list", "/help", "/exit", "intro"),
                 (a) -> assertHelp(a, "/help", "/list", "/help", "/exit", "intro"),
-                (a) -> assertHelp(a, "/help short", "shortcuts", "<tab>"),
+                (a) -> assertHelp(a, "/help short", "shortcuts", "Tab"),
+                (a) -> assertHelp(a, "/help keys", "line", "Shift", "imports", "history"),
                 (a) -> assertHelp(a, "/? /li", "/list -all", "snippets"),
                 (a) -> assertHelp(a, "/help /set prompt", "optionally contain '%s'", "quoted"),
                 (a) -> assertHelp(a, "/help /help", "/help <command>"),
--- a/test/langtools/tools/javac/RawStringLiteralLang.java	Thu Dec 13 11:51:06 2018 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,101 +0,0 @@
-/*
- * 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.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * @test
- * @summary Unit tests for Raw String Literal language changes
- * @compile --enable-preview -source 12 -encoding utf8 RawStringLiteralLang.java
- * @run main/othervm --enable-preview RawStringLiteralLang
- */
-
-public class RawStringLiteralLang {
-    public static void main(String... args) {
-        test1();
-        test2();
-    }
-
-    /*
-     * Test raw string functionality.
-     */
-    static void test1() {
-        EQ(`abc`, "abc");
-        EQ(`can't`, "can\'t");
-        EQ(``can`t``, "can`t");
-        EQ(`can\\'t`, "can\\\\'t");
-        EQ(``can\\`t``, "can\\\\`t");
-        EQ(`\t`, "\\t");
-        EQ(`•`, "\u2022");
-
-        LENGTH("abc``def", 8);
-        EQ("abc`\u0020`def", "abc` `def");
-    }
-
-    /*
-     * Test multi-line string functionality.
-     */
-    static void test2() {
-        EQ(`abc
-def
-ghi`, "abc\ndef\nghi");
-        EQ(`abc
-def
-ghi
-`, "abc\ndef\nghi\n");
-        EQ(`
-abc
-def
-ghi`, "\nabc\ndef\nghi");
-        EQ(`
-abc
-def
-ghi
-`, "\nabc\ndef\nghi\n");
-    }
-
-    /*
-     * Raise an exception if the string is not the expected length.
-     */
-    static void LENGTH(String rawString, int length) {
-        if (rawString == null || rawString.length() != length) {
-            System.err.println("Failed LENGTH");
-            System.err.println(rawString + " " + length);
-            throw new RuntimeException("Failed LENGTH");
-        }
-    }
-
-    /*
-     * Raise an exception if the two input strings are not equal.
-     */
-    static void EQ(String input, String expected) {
-        if (input == null || expected == null || !expected.equals(input)) {
-            System.err.println("Failed EQ");
-            System.err.println();
-            System.err.println("Input:");
-            System.err.println(input.replaceAll(" ", "."));
-            System.err.println();
-            System.err.println("Expected:");
-            System.err.println(expected.replaceAll(" ", "."));
-            throw new RuntimeException();
-        }
-    }
-}
--- a/test/langtools/tools/javac/RawStringLiteralLangAPI.java	Thu Dec 13 11:51:06 2018 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,182 +0,0 @@
-/*
- * 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.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * @test
- * @summary Unit tests for Raw String Literal language changes
- * @library /tools/lib
- * @modules jdk.compiler/com.sun.tools.javac.api
- *          jdk.compiler/com.sun.tools.javac.main
- * @build toolbox.ToolBox toolbox.JavacTask
- * @run main RawStringLiteralLangAPI
- */
-
-import toolbox.JavacTask;
-import toolbox.JavaTask;
-import toolbox.Task;
-import toolbox.ToolBox;
-
-public class RawStringLiteralLangAPI {
-    private static ToolBox TOOLBOX = new ToolBox();
-
-    public static void main(String... args) {
-        test1();
-        test2();
-        test3();
-        test4();
-    }
-
-    /*
-     * Check that correct/incorrect syntax is properly detected
-     */
-    enum Test {
-        t0(false, "`*`*`"),
-        t1(false, "`\\u2022`\\u2022`"),
-        t2(false, "``*`*`"),
-        t3(false, "``\\u2022`\\u2022`"),
-        t4(false, "`*`*``"),
-        t5(false, "`\\u2022`\\u2022``"),
-        t6(true, "``*`*``"),
-        t7(true, "``\\u2022`\\u2022``"),
-        t8(true, "`*``*`"),
-        t9(true, "`\\u2022``\\u2022`"),
-        ;
-
-        Test(boolean pass, String string) {
-            this.pass = pass;
-            this.string = string;
-        }
-
-        boolean pass;
-        String string;
-    }
-    static void test1() {
-        for (Test t : Test.values()) {
-            String code =
-                    "public class RawStringLiteralTest {\n" +
-                            "    public static void main(String... args) {\n" +
-                            "        String xxx = " + t.string + ";\n" +
-                            "    }\n" +
-                            "}\n";
-            if (t.pass) {
-                compPass(code);
-            } else {
-                compFail(code);
-            }
-        }
-    }
-
-    /*
-     * Check that misuse of \u0060 is properly detected
-     */
-    static void test2() {
-        compFail("public class BadDelimiter {\n" +
-                "    public static void main(String... args) {\n" +
-                "        String xxx = \\u0060`abc`;\n" +
-                "    }\n" +
-                "}\n");
-    }
-
-    /*
-     * Check edge cases of raw string literal as last token
-     */
-    static void test3() {
-        compFail("public class RawStringLiteralTest {\n" +
-                "    public static void main(String... args) {\n" +
-                "        String xxx = `abc`");
-        compFail("public class RawStringLiteralTest {\n" +
-                "    public static void main(String... args) {\n" +
-                "        String xxx = `abc");
-        compFail("public class RawStringLiteralTest {\n" +
-                "    public static void main(String... args) {\n" +
-                "        String xxx = `abc\u0000");
-    }
-
-    /*
-     * Check line terminator translation
-     */
-    static void test4() {
-        String[] terminators = new String[] { "\n", "\r\n", "\r" };
-        for (String terminator : terminators) {
-            String code = "public class LineTerminatorTest {" + terminator +
-                          "    public static void main(String... args) {" + terminator +
-                          "        String s =" + terminator +
-                          "`" + terminator +
-                          "abc" + terminator +
-                          "`;" + terminator +
-                          "        System.out.println(s.equals(\"\\nabc\\n\"));" + terminator +
-                          "    }" + terminator +
-                          "}" + terminator;
-            new JavacTask(TOOLBOX)
-                    .sources(code)
-                    .classpath(".")
-                    .options("--enable-preview", "-source", "12")
-                    .run();
-            String output = new JavaTask(TOOLBOX)
-                    .vmOptions("--enable-preview")
-                    .classpath(".")
-                    .classArgs("LineTerminatorTest")
-                    .run()
-                    .writeAll()
-                    .getOutput(Task.OutputKind.STDOUT);
-
-            if (!output.contains("true")) {
-                throw new RuntimeException("Error detected");
-            }
-        }
-    }
-
-    /*
-     * Test source for successful compile.
-     */
-    static void compPass(String source) {
-        String output = new JavacTask(TOOLBOX)
-                .sources(source)
-                .classpath(".")
-                .options("--enable-preview", "-source", "12", "-encoding", "utf8")
-                .run()
-                .writeAll()
-                .getOutput(Task.OutputKind.DIRECT);
-
-        if (output.contains("compiler.err")) {
-            throw new RuntimeException("Error detected");
-        }
-    }
-
-    /*
-     * Test source for unsuccessful compile and specific error.
-     */
-    static void compFail(String source)  {
-        String errors = new JavacTask(TOOLBOX)
-                .sources(source)
-                .classpath(".")
-                .options("-XDrawDiagnostics", "--enable-preview", "-source", "12", "-encoding", "utf8")
-                .run(Task.Expect.FAIL)
-                .writeAll()
-                .getOutput(Task.OutputKind.DIRECT);
-
-        if (!errors.contains("compiler.err")) {
-            throw new RuntimeException("No error detected");
-        }
-    }
-}
--- a/test/langtools/tools/javac/diags/examples/RawStringLiteral.java	Thu Dec 13 11:51:06 2018 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,35 +0,0 @@
-/*
- * 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.
- *
- * 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.
- */
-
-// key: compiler.err.unicode.backtick
-// key: compiler.misc.feature.raw.string.literals
-// key: compiler.warn.preview.feature.use.plural
-// options: --enable-preview -source 12 -Xlint:preview
-
-class RawStringLiteral {
-    String m() {
-        return `abc` + \u0060`def`;
-    }
-}
-
-
--- a/test/langtools/tools/javac/modules/QueryBeforeEnter.java	Thu Dec 13 11:51:06 2018 -0800
+++ b/test/langtools/tools/javac/modules/QueryBeforeEnter.java	Tue Jan 15 10:55:26 2019 -0800
@@ -23,6 +23,7 @@
 
 /**
  * @test
+ * @bug 8208184
  * @summary tests for module resolution
  * @library /tools/lib
  * @modules
@@ -33,19 +34,33 @@
  */
 
 import java.io.File;
+import java.io.IOException;
 import java.io.OutputStream;
+import java.net.URI;
+import java.net.URISyntaxException;
 import java.nio.file.*;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Map.Entry;
 import java.util.Arrays;
 import java.util.Set;
 
 import javax.annotation.processing.AbstractProcessor;
 import javax.annotation.processing.RoundEnvironment;
 import javax.annotation.processing.SupportedAnnotationTypes;
-import javax.annotation.processing.SupportedSourceVersion;
 import javax.lang.model.SourceVersion;
 import javax.lang.model.element.TypeElement;
+import javax.tools.FileObject;
+import javax.tools.ForwardingJavaFileManager;
 import javax.tools.JavaCompiler;
+import javax.tools.JavaFileManager;
+import javax.tools.JavaFileObject;
+import javax.tools.JavaFileObject.Kind;
+import javax.tools.SimpleJavaFileObject;
 import javax.tools.StandardJavaFileManager;
+import javax.tools.StandardLocation;
 import javax.tools.ToolProvider;
 
 // import com.sun.source.util.JavacTask;
@@ -427,6 +442,125 @@
 
     }
 
+    @Test
+    public void testBrokenModule(Path base) throws Exception {
+        Map<String, String> sourceFileName2Content = new HashMap<>();
+
+        sourceFileName2Content.put("module-info.java", "module test { requires unknown.; } ");
+        sourceFileName2Content.put("test/Test.java", "package test; public class Test {}");
+
+        Path out = base.resolve("out");
+
+        Files.createDirectories(out);
+
+        JavaCompiler javaCompiler = ToolProvider.getSystemJavaCompiler();
+        try (StandardJavaFileManager fm = javaCompiler.getStandardFileManager(null, null, null)) {
+            com.sun.source.util.JavacTask task =
+                (com.sun.source.util.JavacTask) javaCompiler.getTask(null,
+                                                              new TestMemoryFileManager(fm, sourceFileName2Content),
+                                                              null,
+                                                              Arrays.asList("-d", out.toString()),
+                                                              null,
+                                                              null);
+            task.getElements().getTypeElement("test.Test");
+        }
+    }
+
+    private static final class TestMemoryFileManager extends ForwardingJavaFileManager<JavaFileManager> {
+
+        private final Map<String, String> sourceFileName2Content;
+
+        public TestMemoryFileManager(JavaFileManager fileManager, Map<String, String> sourceFileName2Content) {
+            super(fileManager);
+            this.sourceFileName2Content = sourceFileName2Content;
+        }
+
+        @Override
+        public Iterable<JavaFileObject> list(Location location, String packageName, Set<Kind> kinds, boolean recurse) throws IOException {
+            if (location == StandardLocation.SOURCE_PATH) {
+                List<JavaFileObject> result = new ArrayList<>();
+                String dir = packageName.replace('.', '/') + "/";
+
+                for (Entry<String, String> e : sourceFileName2Content.entrySet()) {
+                    if (e.getKey().startsWith(dir) &&
+                        !e.getKey().substring(dir.length()).contains("/")) {
+                        try {
+                            result.add(new SourceFileObject(e.getKey(), e.getValue()));
+                        } catch (URISyntaxException ex) {
+                            throw new IOException(ex);
+                        }
+                    }
+                }
+
+                return result;
+            }
+            return super.list(location, packageName, kinds, recurse);
+        }
+
+        @Override
+        public JavaFileObject getJavaFileForInput(Location location, String className, Kind kind) throws IOException {
+            if (location == StandardLocation.SOURCE_PATH) {
+                String path = className.replace('.', '/') + ".java";
+                String code = sourceFileName2Content.get(path);
+
+                if (code == null) return null;
+
+                try {
+                    return new SourceFileObject(path, code);
+                } catch (URISyntaxException ex) {
+                    throw new IOException(ex);
+                }
+            }
+            return super.getJavaFileForInput(location, className, kind);
+        }
+
+        @Override
+        public boolean hasLocation(Location location) {
+            return super.hasLocation(location) || location == StandardLocation.SOURCE_PATH;
+        }
+
+        @Override
+        public boolean contains(Location location, FileObject fo) throws IOException {
+            if (location == StandardLocation.SOURCE_PATH) {
+                return fo instanceof SourceFileObject;
+            }
+            return super.contains(location, fo);
+        }
+
+        @Override
+        public String inferBinaryName(Location location, JavaFileObject file) {
+            if (location == StandardLocation.SOURCE_PATH) {
+                String path = ((SourceFileObject) file).path;
+                String fileName = path.substring(path.lastIndexOf('/'));
+                return fileName.substring(0, fileName.length() - ".java".length());
+            }
+            return super.inferBinaryName(location, file);
+        }
+
+    }
+
+    private static final class SourceFileObject extends SimpleJavaFileObject {
+        private final String path;
+        private final String code;
+
+        public SourceFileObject(String path, String code) throws URISyntaxException {
+            super(new URI("mem://" + path), Kind.SOURCE);
+            this.path = path;
+            this.code = code;
+        }
+
+        @Override
+        public CharSequence getCharContent(boolean ignoreEncodingErrors) throws IOException {
+            return code;
+        }
+
+        @Override
+        public boolean isNameCompatible(String simpleName, Kind kind) {
+            return path.endsWith(simpleName + kind.extension);
+        }
+
+    }
+
     private static void assertNotNull(Object actual) {
         if (actual == null) {
             throw new AssertionError("unexpected null!");
--- a/test/lib/sun/hotspot/WhiteBox.java	Thu Dec 13 11:51:06 2018 -0800
+++ b/test/lib/sun/hotspot/WhiteBox.java	Tue Jan 15 10:55:26 2019 -0800
@@ -182,6 +182,10 @@
   public native long    g1NumMaxRegions();
   public native long    g1NumFreeRegions();
   public native int     g1RegionSize();
+  public native long    dramReservedStart();
+  public native long    dramReservedEnd();
+  public native long    nvdimmReservedStart();
+  public native long    nvdimmReservedEnd();
   public native MemoryUsage g1AuxiliaryMemoryUsage();
   private  native Object[]    parseCommandLine0(String commandline, char delim, DiagnosticCommand[] args);
   public          Object[]    parseCommandLine(String commandline, char delim, DiagnosticCommand[] args) {