changeset 2883:97c468298911

Bump to icedtea-3.11.0. Upstream changes: - S6424123, PR3696: JVM crashes on failed 'strdup' call - S8027781: New jarsigner timestamp warning is grammatically incorrect - S8059847, PR3696: complement JDK-8055286 and JDK-8056964 changes - S8076475, PR3696: Misuses of strncpy/strncat - S8141491: Unaligned memory access in Bits.c - S8159805: sun/security/tools/jarsigner/warnings/NoTimestampTest.java fails after JDK-8027781 - S8171049: Era.getDisplayName doesn't work with non-IsoChronology - S8191438: jarsigner should print when a timestamp will expire - S8194546: Choosier FileManagers - S8195095: Images are not scaled correctly in JEditorPane - S8196902: Better HTTP redirection support - S8199156: Better route routing - S8199161: Better interface enumeration - S8199166: Better interface lists - S8199552: Update to build scripts - S8200659: Improve BigDecimal support - S8201818: [macosx] Printing attributes break page size set via "java.awt.print.Book" object - S8202696: Remove exclusion range for phonetic chars in windows fontconfig.properties - S8203955: Improve robot support - S8204895: Better icon support - S8205330: InitialDirContext ctor sometimes throws NPE if the server has sent a disconnection - S8205356: Choose printer defaults - S8205709: Proper allocation handling - S8205714: Initial class initialization - S8206290: Better FileChannel transfer performance - S8206295: More reliable p11 transactions - S8206301: Improve NIO stability - S8207336: Build failure in JDK8u on Windows after fix 8207260 - S8207775: Better management of CipherCore buffers - S8208350: Disable all DES cipher suites - S8208353: Upgrade JDK 8u to libpng 1.6.35 - S8208583: Better management of internal KeyStore buffers - S8208585: Make crypto code more robust - S8208660: JDK 8u191 l10n resource file update - S8208754: The fix for JDK-8194534 needs updates - S8209094: Improve web server connections - S8209129: Further improvements to cipher buffer management - S8209862: CipherCore performance improvement - S8210094: Better loading of classloader classes - S8210431: Complete backport of libpng 1.6.35 TPRM - S8210598: Strengthen Windows Access Bridge Support - S8210606: Improved data set handling - S8210610: Improved LSA authentication - S8210695: Create test to cover JDK-8205330 InitialDirContext ctor sometimes throws NPE if the server has sent a disconnection - S8210866: Improve JPEG processing - S8210870: Libsunmscapi improved interactions - S8211107: LDAPS communication failure with jdk 1.8.0_181 - S8211731: Reconsider default option for ClassPathURLCheck change done in JDK-8195874 - S8211883: Disable anon and NULL cipher suites - S8213085: (tz) Upgrade time-zone data to tzdata2018g - S8213368: JDK 8u201 l10n resource file update - S8213792: Update THIRD_PARTY_README for LCMS to 2.9 - S8213949: OpenJDK 8 CCharToGlyphMapper.m missing the Classpath exception license text - S8214059, PR3693: Undefined behaviour in ADLC - S8214357: JDK 8u201 l10n resource file update md20 - S8215257: OpenJDK 8 mozilla_compat.js, parser.js missing the Classpath exception license text - S8215377: JDK-8171049 Breaks JCK signature tests - Era.getDisplayName doesn't work with non-IsoChronology - S8217753, PR3685: Enable HotSpot builds on 5.x Linux kernels ChangeLog: 2019-02-17 Andrew John Hughes <gnu_andrew@member.fsf.org> Bump to icedtea-3.11.0. * Makefile.am, (CORBA_CHANGESET): Update to icedtea-3.11.0 tag. (JAXP_CHANGESET): Likewise. (JAXWS_CHANGESET): Likewise. (JDK_CHANGESET): Likewise. (LANGTOOLS_CHANGESET): Likewise. (OPENJDK_CHANGESET): Likewise. (NASHORN_CHANGESET): Likewise. (CORBA_SHA256SUM): Likewise. (JAXP_SHA256SUM): Likewise. (JAXWS_SHA256SUM): Likewise. (JDK_SHA256SUM): Likewise. (LANGTOOLS_SHA256SUM): Likewise. (OPENJDK_SHA256SUM): Likewise. (NASHORN_SHA256SUM): Likewise. (ICEDTEA_PATCHES): Add new HotSpot patches for AArch32 and Shenandoah builds. * NEWS: Updated. * acinclude.m4: (IT_DETERMINE_VERSION): Update JDK_UPDATE_VERSION to 201 and set BUILD_VERSION to b08. * configure.ac: Bump to 3.11.0. * hotspot.map.in: Update to icedtea-3.11.0 tag. * patches/hotspot/aarch32/6424123-pr3696.patch, * patches/hotspot/aarch32/8059847-pr3696.patch, * patches/hotspot/aarch32/8076475-pr3696.patch, * patches/hotspot/aarch32/8214059-pr3693.patch, * patches/hotspot/aarch32/8217753-pr3685.patch, Symlinked to Shenandoah versions. * patches/hotspot/shenandoah/6424123-pr3696.patch, * patches/hotspot/shenandoah/8059847-pr3696.patch, * patches/hotspot/shenandoah/8076475-pr3696.patch, * patches/hotspot/shenandoah/8214059-pr3693.patch, * patches/hotspot/shenandoah/8217753-pr3685.patch: Add Shenandoah patches for latest HotSpot updates.
author Andrew John Hughes <gnu_andrew@member.fsf.org>
date Mon, 18 Feb 2019 05:39:38 +0000
parents 449b25581834
children 6cefe7d8e165
files ChangeLog Makefile.am NEWS acinclude.m4 configure.ac hotspot.map.in patches/hotspot/aarch32/6424123-pr3696.patch patches/hotspot/aarch32/8059847-pr3696.patch patches/hotspot/aarch32/8076475-pr3696.patch patches/hotspot/aarch32/8214059-pr3693.patch patches/hotspot/aarch32/8217753-pr3685.patch patches/hotspot/shenandoah/6424123-pr3696.patch patches/hotspot/shenandoah/8059847-pr3696.patch patches/hotspot/shenandoah/8076475-pr3696.patch patches/hotspot/shenandoah/8214059-pr3693.patch patches/hotspot/shenandoah/8217753-pr3685.patch
diffstat 16 files changed, 1313 insertions(+), 23 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Mon Feb 11 03:36:11 2019 +0000
+++ b/ChangeLog	Mon Feb 18 05:39:38 2019 +0000
@@ -1,3 +1,42 @@
+2019-02-17  Andrew John Hughes  <gnu_andrew@member.fsf.org>
+
+	Bump to icedtea-3.11.0.
+	* Makefile.am,
+	(CORBA_CHANGESET): Update to icedtea-3.11.0 tag.
+	(JAXP_CHANGESET): Likewise.
+	(JAXWS_CHANGESET): Likewise.
+	(JDK_CHANGESET): Likewise.
+	(LANGTOOLS_CHANGESET): Likewise.
+	(OPENJDK_CHANGESET): Likewise.
+	(NASHORN_CHANGESET): Likewise.
+	(CORBA_SHA256SUM): Likewise.
+	(JAXP_SHA256SUM): Likewise.
+	(JAXWS_SHA256SUM): Likewise.
+	(JDK_SHA256SUM): Likewise.
+	(LANGTOOLS_SHA256SUM): Likewise.
+	(OPENJDK_SHA256SUM): Likewise.
+	(NASHORN_SHA256SUM): Likewise.
+	(ICEDTEA_PATCHES): Add new HotSpot patches for AArch32
+	and Shenandoah builds.
+	* NEWS: Updated.
+	* acinclude.m4:
+	(IT_DETERMINE_VERSION): Update JDK_UPDATE_VERSION to 201
+	and set BUILD_VERSION to b08.
+	* configure.ac: Bump to 3.11.0.
+	* hotspot.map.in: Update to icedtea-3.11.0 tag.
+	* patches/hotspot/aarch32/6424123-pr3696.patch,
+	* patches/hotspot/aarch32/8059847-pr3696.patch,
+	* patches/hotspot/aarch32/8076475-pr3696.patch,
+	* patches/hotspot/aarch32/8214059-pr3693.patch,
+	* patches/hotspot/aarch32/8217753-pr3685.patch,
+	Symlinked to Shenandoah versions.
+	* patches/hotspot/shenandoah/6424123-pr3696.patch,
+	* patches/hotspot/shenandoah/8059847-pr3696.patch,
+	* patches/hotspot/shenandoah/8076475-pr3696.patch,
+	* patches/hotspot/shenandoah/8214059-pr3693.patch,
+	* patches/hotspot/shenandoah/8217753-pr3685.patch:
+	Add Shenandoah patches for latest HotSpot updates.
+
 2019-02-10  Andrew John Hughes  <gnu_andrew@member.fsf.org>
 
 	PR3341: jstack.stp should support ppc64[le,be]
--- a/Makefile.am	Mon Feb 11 03:36:11 2019 +0000
+++ b/Makefile.am	Mon Feb 18 05:39:38 2019 +0000
@@ -1,20 +1,20 @@
 # Dependencies
 
-CORBA_CHANGESET = 1eec5dda7c4a
-JAXP_CHANGESET = 239ab71ac8c7
-JAXWS_CHANGESET = 81aabfc0a80b
-JDK_CHANGESET = 7e316a64ae8c
-LANGTOOLS_CHANGESET = abbb38dafbc8
-OPENJDK_CHANGESET = c995f80cfe5b
-NASHORN_CHANGESET = 88ceae600dc8
-
-CORBA_SHA256SUM = 7e4775e2aa2efac63d3c8d9adcc255925341adc04bf568c150197f266505d462
-JAXP_SHA256SUM = a37d9fe80edfacf0d697f14091e5f53d11377d8ba0b06bb972fba75e54affd80
-JAXWS_SHA256SUM = d73ffacd19eb1ee89b8435d133e778b1955620869778a2f130d32a6be2016fea
-JDK_SHA256SUM = 13feccc50ea4ab8ce708a5cb31d185a6796b049aa11d0233400e9aa6237fcfb2
-LANGTOOLS_SHA256SUM = 9bdf9c04d069ab2a46e281f65f8e36101dceab79789afbea0af2746ff76e86cc
-OPENJDK_SHA256SUM = 73ba181f2fd57f8f941a03015975675e98ecc7ac80a023746707b333de020f64
-NASHORN_SHA256SUM = 4e05fece996f5e42a089a12bb31b6b02cfc9b13aa2fb56a32fddec659a777f1d
+CORBA_CHANGESET = cfc35c4598d9
+JAXP_CHANGESET = 1c01fbb460ba
+JAXWS_CHANGESET = cf4d2b27895c
+JDK_CHANGESET = 34ade0cd2dd5
+LANGTOOLS_CHANGESET = 78414f4f0172
+OPENJDK_CHANGESET = 9edccdd36f81
+NASHORN_CHANGESET = 3cb2fe2b1b7d
+
+CORBA_SHA256SUM = a360315b2a5fc1e6d786a046051d39cb8c06756dedb2f70d9f5572132ed6e30e
+JAXP_SHA256SUM = 7b9fc4178403d36fc9d15223ad25aa524976ca134a83544b3c7d1355b0be08ad
+JAXWS_SHA256SUM = b009c14bd56e30319ffb4929bef07853a7cf6a38d20e394d8b9a9f94706d2ebd
+JDK_SHA256SUM = 0e20c73bd59536d9148008c64e1de562408b4e2bdfe72e5d20b08b3bdab5b132
+LANGTOOLS_SHA256SUM = 34bba6c97b4cc02fbd514a2a435224a025b175d5b34bf0f6eb85f0cc6295ab79
+OPENJDK_SHA256SUM = b7f34d2bc2bc35c45971e57e900e1558a9d8ac1a17a0be730cb1c9e9c504817c
+NASHORN_SHA256SUM = cd0ced75640eb6bb650f2a549d6f0a1f3fe3bad4e9d11d6705693e1a15813f83
 
 HS_TYPE = "`$(AWK) 'version==$$1 {print $$2}' version=$(HSBUILD) $(abs_top_builddir)/hotspot.map`"
 HS_URL = "`$(AWK) 'version==$$1 {print $$3}' version=$(HSBUILD) $(abs_top_builddir)/hotspot.map`"
@@ -389,7 +389,12 @@
 	patches/hotspot/$(HSBUILD)/8164920-pr3574-rh1498936.patch \
 	patches/hotspot/$(HSBUILD)/8172850-pr3643-rh1640127.patch \
 	patches/hotspot/$(HSBUILD)/8209639-pr3643-rh1640127.patch \
-	patches/hotspot/$(HSBUILD)/8078504-pr3094.patch
+	patches/hotspot/$(HSBUILD)/8078504-pr3094.patch \
+	patches/hotspot/$(HSBUILD)/6424123-pr3696.patch \
+	patches/hotspot/$(HSBUILD)/8059847-pr3696.patch \
+	patches/hotspot/$(HSBUILD)/8076475-pr3696.patch \
+	patches/hotspot/$(HSBUILD)/8214059-pr3693.patch \
+	patches/hotspot/$(HSBUILD)/8217753-pr3685.patch
 endif
 
 # Shenandoah has the AArch64 port so should get the return value & debug build fixes
--- a/NEWS	Mon Feb 11 03:36:11 2019 +0000
+++ b/NEWS	Mon Feb 18 05:39:38 2019 +0000
@@ -12,6 +12,28 @@
 
 New in release 3.11.0 (2019-01-XX):
 
+* Security fixes
+  - S8199156: Better route routing
+  - S8199161: Better interface enumeration
+  - S8199166: Better interface lists
+  - S8199552: Update to build scripts
+  - S8200659: Improve BigDecimal support
+  - S8203955: Improve robot support
+  - S8204895: Better icon support
+  - S8205356: Choose printer defaults
+  - S8205709: Proper allocation handling
+  - S8205714: Initial class initialization
+  - S8206290, CVE-2019-2422: Better FileChannel transfer performance
+  - S8206295: More reliable p11 transactions
+  - S8206301: Improve NIO stability
+  - S8208585: Make crypto code more robust
+  - S8209094, CVE-2019-2426: Improve web server connections
+  - S8210094: Better loading of classloader classes
+  - S8210598: Strengthen Windows Access Bridge Support
+  - S8210606: Improved data set handling
+  - S8210610: Improved LSA authentication
+  - S8210866, CVE-2018-11212: Improve JPEG processing
+  - S8210870: Libsunmscapi improved interactions
 * New features
   - PR3667: Use the internal copy of the SunEC library rather than statically linking against NSS
 * Import of OpenJDK 8 u192 build 12
@@ -106,9 +128,34 @@
   - S8210423: Backport of 8034788 breaks GCC version detection
   - S8210658: Remove and retag jdk8u192-b10 tag in source repository
   - S8210951: Test sun/security/ssl/SSLContextImpl/CustomizedCipherSuites.java fails
+* Import of OpenJDK 8 u201 build 8
+  - S8027781: New jarsigner timestamp warning is grammatically incorrect
+  - S8159805: sun/security/tools/jarsigner/warnings/NoTimestampTest.java fails after JDK-8027781
+  - S8171049: Era.getDisplayName doesn't work with non-IsoChronology
+  - S8191438: jarsigner should print when a timestamp will expire
+  - S8201818: [macosx] Printing attributes break page size set via "java.awt.print.Book" object
+  - S8205330: InitialDirContext ctor sometimes throws NPE if the server has sent a disconnection
+  - S8207775: Better management of CipherCore buffers
+  - S8208583: Better management of internal KeyStore buffers
+  - S8209129: Further improvements to cipher buffer management
+  - S8209862: CipherCore performance improvement
+  - S8210695: Create test to cover JDK-8205330 InitialDirContext ctor sometimes throws NPE if the server has sent a disconnection
+  - S8211883: Disable anon and NULL cipher suites
+  - S8213085: (tz) Upgrade time-zone data to tzdata2018g
+  - S8213368: JDK 8u201 l10n resource file update
+  - S8213792: Update THIRD_PARTY_README for LCMS to 2.9
+  - S8213949: OpenJDK 8 CCharToGlyphMapper.m missing the Classpath exception license text
+  - S8214357: JDK 8u201 l10n resource file update md20
+  - S8215257: OpenJDK 8 mozilla_compat.js, parser.js missing the Classpath exception license text
+  - S8215377: JDK-8171049 Breaks JCK signature tests - Era.getDisplayName doesn't work with non-IsoChronology
 * Backports
+  - S6424123, PR3696: JVM crashes on failed 'strdup' call
+  - S8059847, PR3696: complement JDK-8055286 and JDK-8056964 changes
   - S8074859, PR1937: Re-apply warnings as error switch removed by 8034788 in 8u192
+  - S8076475, PR3696: Misuses of strncpy/strncat
   - S8145188, PR2945: Re-apply --with-java-debug-symbols option removed by 8034788 in 8u192
+  - S8214059, PR3693: Undefined behaviour in ADLC
+  - S8217753, PR3685: Enable HotSpot builds on 5.x Linux kernels
 * Bug fixes
   - PR3667, PR1983: Backed out changeset 48c15869ecd5
   - PR3667, PR1983: Backed out changeset f0635543beb3
@@ -127,10 +174,7 @@
   - S8189170, PR3682: [AArch64] Add option to disable stack overflow checking in primordial thread for use with JNI_CreateJavaJVM
   - S8209414, PR3682: [AArch64] method handle invocation does not respect JVMTI interp_only mode
 * Shenandoah
-  - S8199552: Update to build scripts
   - S8203349: 8u hotspot should recognise later Windows compilers
-  - S8205714: Initial class initialization
-  - S8210094: Better loading of classloader classes
 
 New in release 3.10.0 (2018-12-25):
 
--- a/acinclude.m4	Mon Feb 11 03:36:11 2019 +0000
+++ b/acinclude.m4	Mon Feb 18 05:39:38 2019 +0000
@@ -2089,8 +2089,8 @@
   AC_MSG_CHECKING([which branch and release of IcedTea is being built])
   JAVA_VER=1.8.0
   JAVA_VENDOR=openjdk
-  JDK_UPDATE_VERSION=192
-  BUILD_VERSION=b12
+  JDK_UPDATE_VERSION=201
+  BUILD_VERSION=b08
   COMBINED_VERSION=${JDK_UPDATE_VERSION}-${BUILD_VERSION}
   OPENJDK_VER=${JAVA_VER}_${COMBINED_VERSION}
   ICEDTEA_RELEASE=$(echo ${PACKAGE_VERSION} | sed 's#pre.*##')
--- a/configure.ac	Mon Feb 11 03:36:11 2019 +0000
+++ b/configure.ac	Mon Feb 18 05:39:38 2019 +0000
@@ -1,4 +1,4 @@
-AC_INIT([icedtea], [3.11.0pre02], [distro-pkg-dev@openjdk.java.net])
+AC_INIT([icedtea], [3.11.0], [distro-pkg-dev@openjdk.java.net])
 AC_CANONICAL_HOST
 AC_CANONICAL_TARGET
 AM_INIT_AUTOMAKE([1.9 tar-pax foreign])
--- a/hotspot.map.in	Mon Feb 11 03:36:11 2019 +0000
+++ b/hotspot.map.in	Mon Feb 18 05:39:38 2019 +0000
@@ -1,4 +1,4 @@
 # version type(drop/hg) url changeset sha256sum
-default drop http://icedtea.classpath.org/download/drops/icedtea8/@ICEDTEA_RELEASE@ b99dbcd228f6 a60a5d717be518db643d1637e3d2946a41df9166824e720dfc0fbd3e91a46cf9
+default drop http://icedtea.classpath.org/download/drops/icedtea8/@ICEDTEA_RELEASE@ 36d303abca2b e4a8c33e1f7a49bf3ea62eec6b25f9c4cfb110f7fea8a243a3ce6ddc0f6655cc
 shenandoah drop http://icedtea.classpath.org/download/drops/icedtea8/@ICEDTEA_RELEASE@ 106435e9e204 bb55e33d53cb5438fa9e16a1ef5f82ebb793a1248f75c0518e861b8dd60bbaba
 aarch32 drop http://icedtea.classpath.org/download/drops/icedtea8/@ICEDTEA_RELEASE@ 8b4e37a274de ce43ce10106cfc06f6b234d917d53765ed7a94168818a468ccf45bedc3683de0
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/hotspot/aarch32/6424123-pr3696.patch	Mon Feb 18 05:39:38 2019 +0000
@@ -0,0 +1,1 @@
+../shenandoah/6424123-pr3696.patch
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/hotspot/aarch32/8059847-pr3696.patch	Mon Feb 18 05:39:38 2019 +0000
@@ -0,0 +1,1 @@
+../shenandoah/8059847-pr3696.patch
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/hotspot/aarch32/8076475-pr3696.patch	Mon Feb 18 05:39:38 2019 +0000
@@ -0,0 +1,1 @@
+../shenandoah/8076475-pr3696.patch
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/hotspot/aarch32/8214059-pr3693.patch	Mon Feb 18 05:39:38 2019 +0000
@@ -0,0 +1,1 @@
+../shenandoah/8214059-pr3693.patch
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/hotspot/aarch32/8217753-pr3685.patch	Mon Feb 18 05:39:38 2019 +0000
@@ -0,0 +1,1 @@
+../shenandoah/8217753-pr3685.patch
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/hotspot/shenandoah/6424123-pr3696.patch	Mon Feb 18 05:39:38 2019 +0000
@@ -0,0 +1,446 @@
+# HG changeset patch
+# User zgu
+# Date 1549941040 0
+#      Tue Feb 12 03:10:40 2019 +0000
+# Node ID cfb34db6589e222d34e5b736b99ed4f69c261c4f
+# Parent  f8beb13aec9f8c291282ee8ec4473c8627aa7e07
+6424123, PR3696: JVM crashes on failed 'strdup' call
+Summary: Calling os::malloc()/os::strdup() and new os::strdup_check_oom() instead of ::malloc()/::strdup() for native memory tracking purpose
+Reviewed-by: coleenp, ctornqvi, kvn
+
+diff --git openjdk.orig/hotspot/src/cpu/ppc/vm/vm_version_ppc.cpp openjdk/hotspot/src/cpu/ppc/vm/vm_version_ppc.cpp
+--- openjdk.orig/hotspot/src/cpu/ppc/vm/vm_version_ppc.cpp
++++ openjdk/hotspot/src/cpu/ppc/vm/vm_version_ppc.cpp
+@@ -29,6 +29,7 @@
+ #include "compiler/disassembler.hpp"
+ #include "memory/resourceArea.hpp"
+ #include "runtime/java.hpp"
++#include "runtime/os.hpp"
+ #include "runtime/stubCodeGenerator.hpp"
+ #include "utilities/defaultStream.hpp"
+ #include "vm_version_ppc.hpp"
+@@ -116,7 +117,7 @@
+                (has_vpmsumb() ? " vpmsumb" : "")
+                // Make sure number of %s matches num_features!
+               );
+-  _features_str = strdup(buf);
++  _features_str = os::strdup(buf);
+   NOT_PRODUCT(if (Verbose) print_features(););
+ 
+   // PPC64 supports 8-byte compare-exchange operations (see
+diff --git openjdk.orig/hotspot/src/cpu/sparc/vm/vm_version_sparc.cpp openjdk/hotspot/src/cpu/sparc/vm/vm_version_sparc.cpp
+--- openjdk.orig/hotspot/src/cpu/sparc/vm/vm_version_sparc.cpp
++++ openjdk/hotspot/src/cpu/sparc/vm/vm_version_sparc.cpp
+@@ -26,6 +26,7 @@
+ #include "asm/macroAssembler.inline.hpp"
+ #include "memory/resourceArea.hpp"
+ #include "runtime/java.hpp"
++#include "runtime/os.hpp"
+ #include "runtime/stubCodeGenerator.hpp"
+ #include "vm_version_sparc.hpp"
+ #ifdef TARGET_OS_FAMILY_linux
+@@ -270,7 +271,7 @@
+                (!has_hardware_fsmuld() ? ", no-fsmuld" : ""));
+ 
+   // buf is started with ", " or is empty
+-  _features_str = strdup(strlen(buf) > 2 ? buf + 2 : buf);
++  _features_str = os::strdup(strlen(buf) > 2 ? buf + 2 : buf);
+ 
+   // UseVIS is set to the smallest of what hardware supports and what
+   // the command line requires.  I.e., you cannot set UseVIS to 3 on
+@@ -485,7 +486,7 @@
+ int VM_Version::parse_features(const char* implementation) {
+   int features = unknown_m;
+   // Convert to UPPER case before compare.
+-  char* impl = os::strdup(implementation);
++  char* impl = os::strdup_check_oom(implementation);
+ 
+   for (int i = 0; impl[i] != 0; i++)
+     impl[i] = (char)toupper((uint)impl[i]);
+diff --git openjdk.orig/hotspot/src/cpu/x86/vm/vm_version_x86.cpp openjdk/hotspot/src/cpu/x86/vm/vm_version_x86.cpp
+--- openjdk.orig/hotspot/src/cpu/x86/vm/vm_version_x86.cpp
++++ openjdk/hotspot/src/cpu/x86/vm/vm_version_x86.cpp
+@@ -27,6 +27,7 @@
+ #include "asm/macroAssembler.inline.hpp"
+ #include "memory/resourceArea.hpp"
+ #include "runtime/java.hpp"
++#include "runtime/os.hpp"
+ #include "runtime/stubCodeGenerator.hpp"
+ #include "vm_version_x86.hpp"
+ #ifdef TARGET_OS_FAMILY_linux
+@@ -527,7 +528,7 @@
+                (supports_bmi1() ? ", bmi1" : ""),
+                (supports_bmi2() ? ", bmi2" : ""),
+                (supports_adx() ? ", adx" : ""));
+-  _features_str = strdup(buf);
++  _features_str = os::strdup(buf);
+ 
+   // UseSSE is set to the smaller of what hardware supports and what
+   // the command line requires.  I.e., you cannot set UseSSE to 2 on
+diff --git openjdk.orig/hotspot/src/os/aix/vm/os_aix.cpp openjdk/hotspot/src/os/aix/vm/os_aix.cpp
+--- openjdk.orig/hotspot/src/os/aix/vm/os_aix.cpp
++++ openjdk/hotspot/src/os/aix/vm/os_aix.cpp
+@@ -56,6 +56,7 @@
+ #include "runtime/mutexLocker.hpp"
+ #include "runtime/objectMonitor.hpp"
+ #include "runtime/orderAccess.inline.hpp"
++#include "runtime/os.hpp"
+ #include "runtime/osThread.hpp"
+ #include "runtime/perfMemory.hpp"
+ #include "runtime/sharedRuntime.hpp"
+@@ -389,10 +390,10 @@
+   // default should be 4K.
+   size_t data_page_size = SIZE_4K;
+   {
+-    void* p = ::malloc(SIZE_16M);
++    void* p = os::malloc(SIZE_16M, mtInternal);
+     guarantee(p != NULL, "malloc failed");
+     data_page_size = os::Aix::query_pagesize(p);
+-    ::free(p);
++    os::free(p);
+   }
+ 
+   // query default shm page size (LDR_CNTRL SHMPSIZE)
+diff --git openjdk.orig/hotspot/src/os/aix/vm/porting_aix.cpp openjdk/hotspot/src/os/aix/vm/porting_aix.cpp
+--- openjdk.orig/hotspot/src/os/aix/vm/porting_aix.cpp
++++ openjdk/hotspot/src/os/aix/vm/porting_aix.cpp
+@@ -23,6 +23,8 @@
+  */
+ 
+ #include "asm/assembler.hpp"
++#include "memory/allocation.inline.hpp"
++#include "runtime/os.hpp"
+ #include "loadlib_aix.hpp"
+ #include "porting_aix.hpp"
+ #include "utilities/debug.hpp"
+@@ -82,7 +84,7 @@
+     while (n) {
+       node* p = n;
+       n = n->next;
+-      free(p->v);
++      os::free(p->v);
+       delete p;
+     }
+   }
+@@ -94,7 +96,7 @@
+       }
+     }
+     node* p = new node;
+-    p->v = strdup(s);
++    p->v = os::strdup_check_oom(s);
+     p->next = first;
+     first = p;
+     return p->v;
+diff --git openjdk.orig/hotspot/src/os/windows/vm/perfMemory_windows.cpp openjdk/hotspot/src/os/windows/vm/perfMemory_windows.cpp
+--- openjdk.orig/hotspot/src/os/windows/vm/perfMemory_windows.cpp
++++ openjdk/hotspot/src/os/windows/vm/perfMemory_windows.cpp
+@@ -29,6 +29,7 @@
+ #include "oops/oop.inline.hpp"
+ #include "os_windows.inline.hpp"
+ #include "runtime/handles.inline.hpp"
++#include "runtime/os.hpp"
+ #include "runtime/perfMemory.hpp"
+ #include "services/memTracker.hpp"
+ #include "utilities/exceptions.hpp"
+@@ -1388,7 +1389,7 @@
+   // the file has been successfully created and the file mapping
+   // object has been created.
+   sharedmem_fileHandle = fh;
+-  sharedmem_fileName = strdup(filename);
++  sharedmem_fileName = os::strdup(filename);
+ 
+   return fmh;
+ }
+diff --git openjdk.orig/hotspot/src/share/vm/c1/c1_LIRAssembler.cpp openjdk/hotspot/src/share/vm/c1/c1_LIRAssembler.cpp
+--- openjdk.orig/hotspot/src/share/vm/c1/c1_LIRAssembler.cpp
++++ openjdk/hotspot/src/share/vm/c1/c1_LIRAssembler.cpp
+@@ -30,6 +30,7 @@
+ #include "c1/c1_MacroAssembler.hpp"
+ #include "c1/c1_ValueStack.hpp"
+ #include "ci/ciInstance.hpp"
++#include "runtime/os.hpp"
+ #ifdef TARGET_ARCH_x86
+ # include "nativeInst_x86.hpp"
+ # include "vmreg_x86.inline.hpp"
+@@ -880,7 +881,7 @@
+           stringStream st;
+           st.print("bad oop %s at %d", r->as_Register()->name(), _masm->offset());
+ #ifdef SPARC
+-          _masm->_verify_oop(r->as_Register(), strdup(st.as_string()), __FILE__, __LINE__);
++          _masm->_verify_oop(r->as_Register(), os::strdup(st.as_string(), mtCompiler), __FILE__, __LINE__);
+ #else
+           _masm->verify_oop(r->as_Register());
+ #endif
+diff --git openjdk.orig/hotspot/src/share/vm/classfile/classLoader.cpp openjdk/hotspot/src/share/vm/classfile/classLoader.cpp
+--- openjdk.orig/hotspot/src/share/vm/classfile/classLoader.cpp
++++ openjdk/hotspot/src/share/vm/classfile/classLoader.cpp
+@@ -324,7 +324,7 @@
+ }
+ 
+ LazyClassPathEntry::LazyClassPathEntry(const char* path, const struct stat* st, bool throw_exception) : ClassPathEntry() {
+-  _path = strdup(path);
++  _path = os::strdup_check_oom(path);
+   _st = *st;
+   _meta_index = NULL;
+   _resolved_entry = NULL;
+@@ -332,6 +332,10 @@
+   _throw_exception = throw_exception;
+ }
+ 
++LazyClassPathEntry::~LazyClassPathEntry() {
++  os::free((void*) _path);
++}
++
+ bool LazyClassPathEntry::is_jar_file() {
+   return ((_st.st_mode & S_IFREG) == S_IFREG);
+ }
+@@ -538,7 +542,7 @@
+         default:
+         {
+           if (!skipCurrentJar && cur_entry != NULL) {
+-            char* new_name = strdup(package_name);
++            char* new_name = os::strdup_check_oom(package_name);
+             boot_class_path_packages.append(new_name);
+           }
+         }
+diff --git openjdk.orig/hotspot/src/share/vm/classfile/classLoader.hpp openjdk/hotspot/src/share/vm/classfile/classLoader.hpp
+--- openjdk.orig/hotspot/src/share/vm/classfile/classLoader.hpp
++++ openjdk/hotspot/src/share/vm/classfile/classLoader.hpp
+@@ -134,6 +134,8 @@
+   bool is_jar_file();
+   const char* name()  { return _path; }
+   LazyClassPathEntry(const char* path, const struct stat* st, bool throw_exception);
++  virtual ~LazyClassPathEntry();
++
+   u1* open_entry(const char* name, jint* filesize, bool nul_terminate, TRAPS);
+   ClassFileStream* open_stream(const char* name, TRAPS);
+   void set_meta_index(MetaIndex* meta_index) { _meta_index = meta_index; }
+diff --git openjdk.orig/hotspot/src/share/vm/compiler/compilerOracle.cpp openjdk/hotspot/src/share/vm/compiler/compilerOracle.cpp
+--- openjdk.orig/hotspot/src/share/vm/compiler/compilerOracle.cpp
++++ openjdk/hotspot/src/share/vm/compiler/compilerOracle.cpp
+@@ -33,6 +33,7 @@
+ #include "oops/symbol.hpp"
+ #include "runtime/handles.inline.hpp"
+ #include "runtime/jniHandles.hpp"
++#include "runtime/os.hpp"
+ 
+ class MethodMatcher : public CHeapObj<mtCompiler> {
+  public:
+@@ -224,7 +225,7 @@
+                            const T value,  MethodMatcher* next) :
+     MethodMatcher(class_name, class_mode, method_name, method_mode, signature, next),
+                   _type(get_type_for<T>()), _value(copy_value<T>(value)) {
+-    _option = strdup(opt);
++    _option = os::strdup_check_oom(opt);
+   }
+ 
+   ~TypedMethodOptionMatcher() {
+diff --git openjdk.orig/hotspot/src/share/vm/opto/runtime.cpp openjdk/hotspot/src/share/vm/opto/runtime.cpp
+--- openjdk.orig/hotspot/src/share/vm/opto/runtime.cpp
++++ openjdk/hotspot/src/share/vm/opto/runtime.cpp
+@@ -1541,11 +1541,11 @@
+   }
+   NamedCounter* c;
+   if (tag == NamedCounter::BiasedLockingCounter) {
+-    c = new BiasedLockingNamedCounter(strdup(st.as_string()));
++    c = new BiasedLockingNamedCounter(st.as_string());
+   } else if (tag == NamedCounter::RTMLockingCounter) {
+-    c = new RTMLockingNamedCounter(strdup(st.as_string()));
++    c = new RTMLockingNamedCounter(st.as_string());
+   } else {
+-    c = new NamedCounter(strdup(st.as_string()), tag);
++    c = new NamedCounter(st.as_string(), tag);
+   }
+ 
+   // atomically add the new counter to the head of the list.  We only
+diff --git openjdk.orig/hotspot/src/share/vm/opto/runtime.hpp openjdk/hotspot/src/share/vm/opto/runtime.hpp
+--- openjdk.orig/hotspot/src/share/vm/opto/runtime.hpp
++++ openjdk/hotspot/src/share/vm/opto/runtime.hpp
+@@ -74,11 +74,17 @@
+ 
+  public:
+   NamedCounter(const char *n, CounterTag tag = NoTag):
+-    _name(n),
++    _name(n == NULL ? NULL : os::strdup(n)),
+     _count(0),
+     _next(NULL),
+     _tag(tag) {}
+ 
++  ~NamedCounter() {
++    if (_name != NULL) {
++      os::free((void*)_name);
++    }
++  }
++
+   const char * name() const     { return _name; }
+   int count() const             { return _count; }
+   address addr()                { return (address)&_count; }
+diff --git openjdk.orig/hotspot/src/share/vm/runtime/arguments.cpp openjdk/hotspot/src/share/vm/runtime/arguments.cpp
+--- openjdk.orig/hotspot/src/share/vm/runtime/arguments.cpp
++++ openjdk/hotspot/src/share/vm/runtime/arguments.cpp
+@@ -796,7 +796,7 @@
+   } else {
+     *bldarray = REALLOC_C_HEAP_ARRAY(char*, *bldarray, new_count, mtInternal);
+   }
+-  (*bldarray)[*count] = strdup(arg);
++  (*bldarray)[*count] = os::strdup_check_oom(arg);
+   *count = new_count;
+ }
+ 
+@@ -2055,7 +2055,7 @@
+ }
+ 
+ void Arguments::process_java_launcher_argument(const char* launcher, void* extra_info) {
+-  _sun_java_launcher = strdup(launcher);
++  _sun_java_launcher = os::strdup_check_oom(launcher);
+   if (strcmp("gamma", _sun_java_launcher) == 0) {
+     _created_by_gamma_launcher = true;
+   }
+@@ -3200,7 +3200,7 @@
+       // Redirect GC output to the file. -Xloggc:<filename>
+       // ostream_init_log(), when called will use this filename
+       // to initialize a fileStream.
+-      _gc_log_filename = strdup(tail);
++      _gc_log_filename = os::strdup_check_oom(tail);
+      if (!is_filename_valid(_gc_log_filename)) {
+        jio_fprintf(defaultStream::output_stream(),
+                   "Invalid file name for use with -Xloggc: Filename can only contain the "
+diff --git openjdk.orig/hotspot/src/share/vm/runtime/fprofiler.cpp openjdk/hotspot/src/share/vm/runtime/fprofiler.cpp
+--- openjdk.orig/hotspot/src/share/vm/runtime/fprofiler.cpp
++++ openjdk/hotspot/src/share/vm/runtime/fprofiler.cpp
+@@ -628,10 +628,16 @@
+   }
+ 
+   vmNode(const char* name, const TickPosition where) : ProfilerNode() {
+-    _name = name;
++    _name = os::strdup(name);
+     update(where);
+   }
+ 
++  ~vmNode() {
++    if (_name != NULL) {
++      os::free((void*)_name);
++    }
++  }
++
+   const char *name()    const { return _name; }
+   bool is_compiled()    const { return true; }
+ 
+@@ -783,7 +789,7 @@
+   assert(index >= 0, "Must be positive");
+   // Note that we call strdup below since the symbol may be resource allocated
+   if (!table[index]) {
+-    table[index] = new (this) vmNode(os::strdup(name), where);
++    table[index] = new (this) vmNode(name, where);
+   } else {
+     ProfilerNode* prev = table[index];
+     for(ProfilerNode* node = prev; node; node = node->next()) {
+@@ -793,7 +799,7 @@
+       }
+       prev = node;
+     }
+-    prev->set_next(new (this) vmNode(os::strdup(name), where));
++    prev->set_next(new (this) vmNode(name, where));
+   }
+ }
+ 
+diff --git openjdk.orig/hotspot/src/share/vm/runtime/os.cpp openjdk/hotspot/src/share/vm/runtime/os.cpp
+--- openjdk.orig/hotspot/src/share/vm/runtime/os.cpp
++++ openjdk/hotspot/src/share/vm/runtime/os.cpp
+@@ -542,6 +542,14 @@
+ }
+ 
+ 
++char* os::strdup_check_oom(const char* str, MEMFLAGS flags) {
++  char* p = os::strdup(str, flags);
++  if (p == NULL) {
++    vm_exit_out_of_memory(strlen(str) + 1, OOM_MALLOC_ERROR, "os::strdup_check_oom");
++  }
++  return p;
++}
++
+ 
+ #define paranoid                 0  /* only set to 1 if you suspect checking code has bug */
+ 
+diff --git openjdk.orig/hotspot/src/share/vm/runtime/os.hpp openjdk/hotspot/src/share/vm/runtime/os.hpp
+--- openjdk.orig/hotspot/src/share/vm/runtime/os.hpp
++++ openjdk/hotspot/src/share/vm/runtime/os.hpp
+@@ -717,6 +717,8 @@
+   static void  free    (void *memblock, MEMFLAGS flags = mtNone);
+   static bool  check_heap(bool force = false);      // verify C heap integrity
+   static char* strdup(const char *, MEMFLAGS flags = mtInternal);  // Like strdup
++  // Like strdup, but exit VM when strdup() returns NULL
++  static char* strdup_check_oom(const char*, MEMFLAGS flags = mtInternal);
+ 
+ #ifndef PRODUCT
+   static julong num_mallocs;         // # of calls to malloc/realloc
+diff --git openjdk.orig/hotspot/src/share/vm/runtime/vmStructs.cpp openjdk/hotspot/src/share/vm/runtime/vmStructs.cpp
+--- openjdk.orig/hotspot/src/share/vm/runtime/vmStructs.cpp
++++ openjdk/hotspot/src/share/vm/runtime/vmStructs.cpp
+@@ -51,6 +51,7 @@
+ #include "interpreter/bytecodes.hpp"
+ #include "interpreter/interpreter.hpp"
+ #include "memory/allocation.hpp"
++#include "memory/allocation.inline.hpp"
+ #include "memory/cardTableRS.hpp"
+ #include "memory/defNewGeneration.hpp"
+ #include "memory/freeBlockDictionary.hpp"
+@@ -92,6 +93,7 @@
+ #include "runtime/globals.hpp"
+ #include "runtime/java.hpp"
+ #include "runtime/javaCalls.hpp"
++#include "runtime/os.hpp"
+ #include "runtime/perfMemory.hpp"
+ #include "runtime/serviceThread.hpp"
+ #include "runtime/sharedRuntime.hpp"
+@@ -3301,14 +3303,14 @@
+     }
+   }
+   if (strstr(typeName, " const") == typeName + len - 6) {
+-    char * s = strdup(typeName);
++    char * s = os::strdup_check_oom(typeName);
+     s[len - 6] = '\0';
+     // tty->print_cr("checking \"%s\" for \"%s\"", s, typeName);
+     if (recursiveFindType(origtypes, s, true) == 1) {
+-      free(s);
++      os::free(s);
+       return 1;
+     }
+-    free(s);
++    os::free(s);
+   }
+   if (!isRecurse) {
+     tty->print_cr("type \"%s\" not found", typeName);
+diff --git openjdk.orig/hotspot/src/share/vm/services/management.cpp openjdk/hotspot/src/share/vm/services/management.cpp
+--- openjdk.orig/hotspot/src/share/vm/services/management.cpp
++++ openjdk/hotspot/src/share/vm/services/management.cpp
+@@ -1793,7 +1793,7 @@
+   ResourceMark rm(THREAD); // thread->name() uses ResourceArea
+ 
+   assert(thread->name() != NULL, "All threads should have a name");
+-  _names_chars[_count] = strdup(thread->name());
++  _names_chars[_count] = os::strdup(thread->name());
+   _times->long_at_put(_count, os::is_thread_cpu_time_supported() ?
+                         os::thread_cpu_time(thread) : -1);
+   _count++;
+@@ -1811,7 +1811,7 @@
+ 
+ ThreadTimesClosure::~ThreadTimesClosure() {
+   for (int i = 0; i < _count; i++) {
+-    free(_names_chars[i]);
++    os::free(_names_chars[i]);
+   }
+   FREE_C_HEAP_ARRAY(char *, _names_chars, mtInternal);
+ }
+diff --git openjdk.orig/hotspot/src/share/vm/shark/sharkBuilder.cpp openjdk/hotspot/src/share/vm/shark/sharkBuilder.cpp
+--- openjdk.orig/hotspot/src/share/vm/shark/sharkBuilder.cpp
++++ openjdk/hotspot/src/share/vm/shark/sharkBuilder.cpp
+@@ -413,7 +413,7 @@
+   const char *name;
+   if (value->hasName())
+     // XXX this leaks, but it's only debug code
+-    name = strdup(value->getName().str().c_str());
++    name = os::strdup(value->getName().str().c_str());
+   else
+     name = "unnamed_value";
+ 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/hotspot/shenandoah/8059847-pr3696.patch	Mon Feb 18 05:39:38 2019 +0000
@@ -0,0 +1,343 @@
+# HG changeset patch
+# User anoll
+# Date 1412945310 -7200
+#      Fri Oct 10 14:48:30 2014 +0200
+# Node ID f8beb13aec9f8c291282ee8ec4473c8627aa7e07
+# Parent  4a1c2eb583ae102da922f204efd6dab1f8073c41
+8059847, PR3696: complement JDK-8055286 and JDK-8056964 changes
+Summary: Extend scan_flag_and_value() to process flag of type double. Add regression test compiler/oracle/CheckCompileCommandOption.java.
+Reviewed-by: kvn, anoll
+
+diff --git openjdk.orig/hotspot/src/share/vm/ci/ciMethod.cpp openjdk/hotspot/src/share/vm/ci/ciMethod.cpp
+--- openjdk.orig/hotspot/src/share/vm/ci/ciMethod.cpp
++++ openjdk/hotspot/src/share/vm/ci/ciMethod.cpp
+@@ -1130,6 +1130,7 @@
+ template bool ciMethod::has_option_value<uintx>(const char* option, uintx& value);
+ template bool ciMethod::has_option_value<bool>(const char* option, bool& value);
+ template bool ciMethod::has_option_value<ccstr>(const char* option, ccstr& value);
++template bool ciMethod::has_option_value<double>(const char* option, double& value);
+ 
+ // ------------------------------------------------------------------
+ // ciMethod::can_be_compiled
+diff --git openjdk.orig/hotspot/src/share/vm/compiler/compilerOracle.cpp openjdk/hotspot/src/share/vm/compiler/compilerOracle.cpp
+--- openjdk.orig/hotspot/src/share/vm/compiler/compilerOracle.cpp
++++ openjdk/hotspot/src/share/vm/compiler/compilerOracle.cpp
+@@ -172,6 +172,7 @@
+   UintxType,
+   BoolType,
+   CcstrType,
++  DoubleType,
+   UnknownType
+ };
+ 
+@@ -197,6 +198,10 @@
+   return CcstrType;
+ }
+ 
++template<> OptionType get_type_for<double>() {
++  return DoubleType;
++}
++
+ template<typename T>
+ static const T copy_value(const T value) {
+   return value;
+@@ -296,6 +301,15 @@
+   tty->cr();
+ };
+ 
++template<>
++void TypedMethodOptionMatcher<double>::print() {
++  ttyLocker ttyl;
++  print_base();
++  tty->print(" double %s", _option);
++  tty->print(" = %f", _value);
++  tty->cr();
++};
++
+ // this must parallel the command_names below
+ enum OracleCommand {
+   UnknownCommand = -1,
+@@ -389,6 +403,7 @@
+ template bool CompilerOracle::has_option_value<uintx>(methodHandle method, const char* option, uintx& value);
+ template bool CompilerOracle::has_option_value<bool>(methodHandle method, const char* option, bool& value);
+ template bool CompilerOracle::has_option_value<ccstr>(methodHandle method, const char* option, ccstr& value);
++template bool CompilerOracle::has_option_value<double>(methodHandle method, const char* option, double& value);
+ 
+ bool CompilerOracle::should_exclude(methodHandle method, bool& quietly) {
+   quietly = true;
+@@ -625,6 +640,20 @@
+       } else {
+         jio_snprintf(errorbuf, sizeof(errorbuf), "  Value cannot be read for flag %s of type %s", flag, type);
+       }
++    } else if (strcmp(type, "double") == 0) {
++      char buffer[2][256];
++      // Decimal separator '.' has been replaced with ' ' or '/' earlier,
++      // so read integer and fraction part of double value separately.
++      if (sscanf(line, "%*[ \t]%255[0-9]%*[ /\t]%255[0-9]%n", buffer[0], buffer[1], &bytes_read) == 2) {
++        char value[512] = "";
++        strncat(value, buffer[0], 255);
++        strcat(value, ".");
++        strncat(value, buffer[1], 255);
++        total_bytes_read += bytes_read;
++        return add_option_string(c_name, c_match, m_name, m_match, signature, flag, atof(value));
++      } else {
++        jio_snprintf(errorbuf, buf_size, "  Value cannot be read for flag %s of type %s", flag, type);
++      }
+     } else {
+       jio_snprintf(errorbuf, sizeof(errorbuf), "  Type %s not supported ", type);
+     }
+@@ -715,11 +744,10 @@
+       // (1) CompileCommand=option,Klass::method,flag
+       // (2) CompileCommand=option,Klass::method,type,flag,value
+       //
+-      // Type (1) is used to support ciMethod::has_option("someflag")
+-      // (i.e., to check if a flag "someflag" is enabled for a method).
++      // Type (1) is used to enable a boolean flag for a method.
+       //
+       // Type (2) is used to support options with a value. Values can have the
+-      // the following types: intx, uintx, bool, ccstr, and ccstrlist.
++      // the following types: intx, uintx, bool, ccstr, ccstrlist, and double.
+       //
+       // For future extensions: extend scan_flag_and_value()
+       char option[256]; // stores flag for Type (1) and type of Type (2)
+@@ -737,6 +765,7 @@
+             || strcmp(option, "bool") == 0
+             || strcmp(option, "ccstr") == 0
+             || strcmp(option, "ccstrlist") == 0
++            || strcmp(option, "double") == 0
+             ) {
+ 
+           // Type (2) option: parse flag name and value.
+diff --git openjdk.orig/hotspot/src/share/vm/runtime/globals.hpp openjdk/hotspot/src/share/vm/runtime/globals.hpp
+--- openjdk.orig/hotspot/src/share/vm/runtime/globals.hpp
++++ openjdk/hotspot/src/share/vm/runtime/globals.hpp
+@@ -449,7 +449,7 @@
+ // notproduct flags are settable / visible only during development and are not declared in the PRODUCT version
+ 
+ // A flag must be declared with one of the following types:
+-// bool, intx, uintx, ccstr.
++// bool, intx, uintx, ccstr, double, or uint64_t.
+ // The type "ccstr" is an alias for "const char*" and is used
+ // only in this file, because the macrology requires single-token type names.
+ 
+diff --git openjdk.orig/hotspot/test/compiler/oracle/CheckCompileCommandOption.java openjdk/hotspot/test/compiler/oracle/CheckCompileCommandOption.java
+new file mode 100644
+--- /dev/null
++++ openjdk/hotspot/test/compiler/oracle/CheckCompileCommandOption.java
+@@ -0,0 +1,216 @@
++/*
++ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
++ *
++ * This code is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 only, as
++ * published by the Free Software Foundation.
++ *
++ * 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 com.oracle.java.testlibrary.*;
++
++/*
++ * @test CheckCompileCommandOption
++ * @bug 8055286 8056964 8059847
++ * @summary "Checks parsing of -XX:+CompileCommand=option"
++ * @library /testlibrary
++ * @run main CheckCompileCommandOption
++ */
++
++public class CheckCompileCommandOption {
++
++    // Currently, two types of trailing options can be used with
++    // -XX:CompileCommand=option
++    //
++    // (1) CompileCommand=option,Klass::method,flag
++    // (2) CompileCommand=option,Klass::method,type,flag,value
++    //
++    // Type (1) is used to enable a boolean flag for a method.
++    //
++    // Type (2) is used to support flags with a value. Values can
++    // have the the following types: intx, uintx, bool, ccstr,
++    // ccstrlist, and double.
++
++    private static final String[][] TYPE_1_ARGUMENTS = {
++        {
++            "-XX:CompileCommand=option,com/oracle/Test.test,MyBoolOption1",
++            "-XX:CompileCommand=option,com/oracle/Test,test,MyBoolOption2",
++            "-XX:CompileCommand=option,com.oracle.Test::test,MyBoolOption3",
++            "-XX:CompileCommand=option,com/oracle/Test::test,MyBoolOption4",
++            "-version"
++        },
++        {
++            "-XX:CompileCommand=option,com/oracle/Test.test,MyBoolOption1,MyBoolOption2",
++            "-version"
++        },
++        {
++            "-XX:CompileCommand=option,com/oracle/Test,test,MyBoolOption1,MyBoolOption2",
++            "-version"
++        }
++    };
++
++    private static final String[][] TYPE_1_EXPECTED_OUTPUTS = {
++        {
++            "CompilerOracle: option com/oracle/Test.test bool MyBoolOption1 = true",
++            "CompilerOracle: option com/oracle/Test.test bool MyBoolOption2 = true",
++            "CompilerOracle: option com/oracle/Test.test bool MyBoolOption3 = true",
++            "CompilerOracle: option com/oracle/Test.test bool MyBoolOption4 = true"
++        },
++        {
++            "CompilerOracle: option com/oracle/Test.test bool MyBoolOption1 = true",
++            "CompilerOracle: option com/oracle/Test.test bool MyBoolOption2 = true",
++        },
++        {
++            "CompilerOracle: option com/oracle/Test.test bool MyBoolOption1 = true",
++            "CompilerOracle: option com/oracle/Test.test bool MyBoolOption2 = true",
++        }
++    };
++
++    private static final String[][] TYPE_2_ARGUMENTS = {
++        {
++            "-XX:CompileCommand=option,Test::test,ccstrlist,MyListOption,_foo,_bar",
++            "-XX:CompileCommand=option,Test::test,ccstr,MyStrOption,_foo",
++            "-XX:CompileCommand=option,Test::test,bool,MyBoolOption,false",
++            "-XX:CompileCommand=option,Test::test,intx,MyIntxOption,-1",
++            "-XX:CompileCommand=option,Test::test,uintx,MyUintxOption,1",
++            "-XX:CompileCommand=option,Test::test,MyFlag",
++            "-XX:CompileCommand=option,Test::test,double,MyDoubleOption,1.123",
++            "-version"
++        },
++        {
++            "-XX:CompileCommand=option,Test.test,double,MyDoubleOption,1.123",
++            "-version"
++        },
++        {
++            "-XX:CompileCommand=option,Test::test,bool,MyBoolOption,false,intx,MyIntxOption,-1,uintx,MyUintxOption,1,MyFlag,double,MyDoubleOption,1.123",
++            "-version"
++        }
++    };
++
++    private static final String[][] TYPE_2_EXPECTED_OUTPUTS = {
++        {
++            "CompilerOracle: option Test.test const char* MyListOption = '_foo _bar'",
++            "CompilerOracle: option Test.test const char* MyStrOption = '_foo'",
++            "CompilerOracle: option Test.test bool MyBoolOption = false",
++            "CompilerOracle: option Test.test intx MyIntxOption = -1",
++            "CompilerOracle: option Test.test uintx MyUintxOption = 1",
++            "CompilerOracle: option Test.test bool MyFlag = true",
++            "CompilerOracle: option Test.test double MyDoubleOption = 1.123000"
++        },
++        {
++            "CompilerOracle: option Test.test double MyDoubleOption = 1.123000"
++        },
++        {
++            "CompilerOracle: option Test.test bool MyBoolOption = false",
++            "CompilerOracle: option Test.test intx MyIntxOption = -1",
++            "CompilerOracle: option Test.test uintx MyUintxOption = 1",
++            "CompilerOracle: option Test.test bool MyFlag = true",
++            "CompilerOracle: option Test.test double MyDoubleOption = 1.123000",
++        }
++    };
++
++    private static final String[][] TYPE_2_INVALID_ARGUMENTS = {
++        {
++            // bool flag name missing
++            "-XX:CompileCommand=option,Test::test,bool",
++            "-version"
++        },
++        {
++            // bool flag value missing
++            "-XX:CompileCommand=option,Test::test,bool,MyBoolOption",
++            "-version"
++        },
++        {
++            // wrong value for bool flag
++            "-XX:CompileCommand=option,Test::test,bool,MyBoolOption,100",
++            "-version"
++        },
++        {
++            // intx flag name missing
++            "-XX:CompileCommand=option,Test::test,bool,MyBoolOption,false,intx",
++            "-version"
++        },
++        {
++            // intx flag value missing
++            "-XX:CompileCommand=option,Test::test,bool,MyBoolOption,false,intx,MyIntOption",
++            "-version"
++        },
++        {
++            // wrong value for intx flag
++            "-XX:CompileCommand=option,Test::test,bool,MyBoolOption,false,intx,MyIntOption,true",
++            "-version"
++        },
++        {
++            // wrong value for flag double flag
++            "-XX:CompileCommand=option,Test::test,double,MyDoubleOption,1",
++            "-version"
++        }
++    };
++
++    private static void verifyValidOption(String[] arguments, String[] expected_outputs) throws Exception {
++        ProcessBuilder pb;
++        OutputAnalyzer out;
++
++        pb = ProcessTools.createJavaProcessBuilder(arguments);
++        out = new OutputAnalyzer(pb.start());
++
++        for (String expected_output : expected_outputs) {
++            out.shouldContain(expected_output);
++        }
++
++        out.shouldNotContain("CompilerOracle: unrecognized line");
++        out.shouldHaveExitValue(0);
++    }
++
++    private static void verifyInvalidOption(String[] arguments) throws Exception {
++        ProcessBuilder pb;
++        OutputAnalyzer out;
++
++        pb = ProcessTools.createJavaProcessBuilder(arguments);
++        out = new OutputAnalyzer(pb.start());
++
++        out.shouldContain("CompilerOracle: unrecognized line");
++        out.shouldHaveExitValue(0);
++    }
++
++    public static void main(String[] args) throws Exception {
++
++        if (TYPE_1_ARGUMENTS.length != TYPE_1_EXPECTED_OUTPUTS.length) {
++            throw new RuntimeException("Test is set up incorrectly: length of arguments and expected outputs for type (1) options does not match.");
++        }
++
++        if (TYPE_2_ARGUMENTS.length != TYPE_2_EXPECTED_OUTPUTS.length) {
++            throw new RuntimeException("Test is set up incorrectly: length of arguments and expected outputs for type (2) options does not match.");
++        }
++
++        // Check if type (1) options are parsed correctly
++        for (int i = 0; i < TYPE_1_ARGUMENTS.length; i++) {
++            verifyValidOption(TYPE_1_ARGUMENTS[i], TYPE_1_EXPECTED_OUTPUTS[i]);
++        }
++
++        // Check if type (2) options are parsed correctly
++        for (int i = 0; i < TYPE_2_ARGUMENTS.length; i++) {
++            verifyValidOption(TYPE_2_ARGUMENTS[i], TYPE_2_EXPECTED_OUTPUTS[i]);
++        }
++
++        // Check if error is reported for invalid type (2) options
++        // (flags with type information specified)
++        for (String[] arguments: TYPE_2_INVALID_ARGUMENTS) {
++            verifyInvalidOption(arguments);
++        }
++    }
++}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/hotspot/shenandoah/8076475-pr3696.patch	Mon Feb 18 05:39:38 2019 +0000
@@ -0,0 +1,270 @@
+# HG changeset patch
+# User stuefe
+# Date 1549941248 0
+#      Tue Feb 12 03:14:08 2019 +0000
+# Node ID 9bbf02572dc114e85829673a7cdaffa482115f42
+# Parent  cfb34db6589e222d34e5b736b99ed4f69c261c4f
+8076475, PR3696: Misuses of strncpy/strncat
+Summary: Various small fixes around strncpy and strncat
+Reviewed-by: dsamersoff, coleenp
+
+diff --git openjdk.orig/hotspot/agent/src/os/bsd/libproc_impl.c openjdk/hotspot/agent/src/os/bsd/libproc_impl.c
+--- openjdk.orig/hotspot/agent/src/os/bsd/libproc_impl.c
++++ openjdk/hotspot/agent/src/os/bsd/libproc_impl.c
+@@ -215,7 +215,12 @@
+     return NULL;
+   }
+ 
+-  strncpy(newlib->name, libname, sizeof(newlib->name));
++  if (strlen(libname) >= sizeof(newlib->name)) {
++    print_debug("libname %s too long\n", libname);
++    return NULL;
++  }
++  strcpy(newlib->name, libname);
++
+   newlib->base = base;
+ 
+   if (fd == -1) {
+diff --git openjdk.orig/hotspot/agent/src/os/linux/libproc_impl.c openjdk/hotspot/agent/src/os/linux/libproc_impl.c
+--- openjdk.orig/hotspot/agent/src/os/linux/libproc_impl.c
++++ openjdk/hotspot/agent/src/os/linux/libproc_impl.c
+@@ -162,7 +162,12 @@
+       return NULL;
+    }
+ 
+-   strncpy(newlib->name, libname, sizeof(newlib->name));
++   if (strlen(libname) >= sizeof(newlib->name)) {
++     print_debug("libname %s too long\n", libname);
++     return NULL;
++   }
++   strcpy(newlib->name, libname);
++
+    newlib->base = base;
+ 
+    if (fd == -1) {
+diff --git openjdk.orig/hotspot/src/os/bsd/dtrace/libjvm_db.c openjdk/hotspot/src/os/bsd/dtrace/libjvm_db.c
+--- openjdk.orig/hotspot/src/os/bsd/dtrace/libjvm_db.c
++++ openjdk/hotspot/src/os/bsd/dtrace/libjvm_db.c
+@@ -543,13 +543,14 @@
+   CHECK_FAIL(err);
+ 
+   result[0] = '\0';
+-  strncat(result, klassString, size);
+-  size -= strlen(klassString);
+-  strncat(result, ".", size);
+-  size -= 1;
+-  strncat(result, nameString, size);
+-  size -= strlen(nameString);
+-  strncat(result, signatureString, size);
++  if (snprintf(result, size,
++    "%s.%s%s",
++    klassString,
++    nameString,
++    signatureString) >= size) {
++    // truncation
++    goto fail;
++  }
+ 
+   if (nameString != NULL) free(nameString);
+   if (klassString != NULL) free(klassString);
+@@ -1056,9 +1057,9 @@
+       CHECK_FAIL(err);
+   }
+   if (deoptimized) {
+-    strncat(result + 1, " [deoptimized frame]; ", size-1);
++    strncat(result, " [deoptimized frame]; ", size - strlen(result) - 1);
+   } else {
+-    strncat(result + 1, " [compiled] ", size-1);
++    strncat(result, " [compiled] ", size - strlen(result) - 1);
+   }
+   if (debug)
+       fprintf(stderr, "name_for_nmethod: END: method name: %s, vf_cnt: %d\n\n",
+diff --git openjdk.orig/hotspot/src/os/bsd/vm/decoder_machO.cpp openjdk/hotspot/src/os/bsd/vm/decoder_machO.cpp
+--- openjdk.orig/hotspot/src/os/bsd/vm/decoder_machO.cpp
++++ openjdk/hotspot/src/os/bsd/vm/decoder_machO.cpp
+@@ -97,6 +97,7 @@
+   char * symname = mach_find_in_stringtable((char*) ((uintptr_t)mach_base + stroff), strsize, found_strx);
+   if (symname) {
+       strncpy(buf, symname, buflen);
++      buf[buflen - 1] = '\0';
+       return true;
+   }
+   DEBUG_ONLY(tty->print_cr("no string or null string found."));
+diff --git openjdk.orig/hotspot/src/os/solaris/dtrace/libjvm_db.c openjdk/hotspot/src/os/solaris/dtrace/libjvm_db.c
+--- openjdk.orig/hotspot/src/os/solaris/dtrace/libjvm_db.c
++++ openjdk/hotspot/src/os/solaris/dtrace/libjvm_db.c
+@@ -543,13 +543,14 @@
+   CHECK_FAIL(err);
+ 
+   result[0] = '\0';
+-  strncat(result, klassString, size);
+-  size -= strlen(klassString);
+-  strncat(result, ".", size);
+-  size -= 1;
+-  strncat(result, nameString, size);
+-  size -= strlen(nameString);
+-  strncat(result, signatureString, size);
++  if (snprintf(result, size,
++    "%s.%s%s",
++    klassString,
++    nameString,
++    signatureString) >= size) {
++    // truncation
++    goto fail;
++  }
+ 
+   if (nameString != NULL) free(nameString);
+   if (klassString != NULL) free(klassString);
+@@ -1056,9 +1057,9 @@
+       CHECK_FAIL(err);
+   }
+   if (deoptimized) {
+-    strncat(result + 1, " [deoptimized frame]; ", size-1);
++    strncat(result, " [deoptimized frame]; ", size - strlen(result) - 1);
+   } else {
+-    strncat(result + 1, " [compiled] ", size-1);
++    strncat(result, " [compiled] ", size - strlen(result) - 1);
+   }
+   if (debug)
+       fprintf(stderr, "name_for_nmethod: END: method name: %s, vf_cnt: %d\n\n",
+diff --git openjdk.orig/hotspot/src/share/tools/hsdis/hsdis.c openjdk/hotspot/src/share/tools/hsdis/hsdis.c
+--- openjdk.orig/hotspot/src/share/tools/hsdis/hsdis.c
++++ openjdk/hotspot/src/share/tools/hsdis/hsdis.c
+@@ -410,6 +410,7 @@
+     }
+     p = q;
+   }
++  *iop = '\0';
+ }
+ 
+ static void print_help(struct hsdis_app_data* app_data,
+diff --git openjdk.orig/hotspot/src/share/vm/compiler/compileBroker.hpp openjdk/hotspot/src/share/vm/compiler/compileBroker.hpp
+--- openjdk.orig/hotspot/src/share/vm/compiler/compileBroker.hpp
++++ openjdk/hotspot/src/share/vm/compiler/compileBroker.hpp
+@@ -173,7 +173,8 @@
+     // these methods should be called in a thread safe context
+ 
+     void set_current_method(const char* method) {
+-      strncpy(_current_method, method, (size_t)cmname_buffer_length);
++      strncpy(_current_method, method, (size_t)cmname_buffer_length-1);
++      _current_method[cmname_buffer_length-1] = '\0';
+       if (UsePerfData) _perf_current_method->set_value(method);
+     }
+ 
+diff --git openjdk.orig/hotspot/src/share/vm/compiler/compilerOracle.cpp openjdk/hotspot/src/share/vm/compiler/compilerOracle.cpp
+--- openjdk.orig/hotspot/src/share/vm/compiler/compilerOracle.cpp
++++ openjdk/hotspot/src/share/vm/compiler/compilerOracle.cpp
+@@ -647,9 +647,7 @@
+       // so read integer and fraction part of double value separately.
+       if (sscanf(line, "%*[ \t]%255[0-9]%*[ /\t]%255[0-9]%n", buffer[0], buffer[1], &bytes_read) == 2) {
+         char value[512] = "";
+-        strncat(value, buffer[0], 255);
+-        strcat(value, ".");
+-        strncat(value, buffer[1], 255);
++        jio_snprintf(value, sizeof(value), "%s.%s", buffer[0], buffer[1]);
+         total_bytes_read += bytes_read;
+         return add_option_string(c_name, c_match, m_name, m_match, signature, flag, atof(value));
+       } else {
+diff --git openjdk.orig/hotspot/src/share/vm/compiler/disassembler.cpp openjdk/hotspot/src/share/vm/compiler/disassembler.cpp
+--- openjdk.orig/hotspot/src/share/vm/compiler/disassembler.cpp
++++ openjdk/hotspot/src/share/vm/compiler/disassembler.cpp
+@@ -298,6 +298,7 @@
+         strlen((const char*)arg) > sizeof(buffer) - 1) {
+       // Only print this when the mach changes
+       strncpy(buffer, (const char*)arg, sizeof(buffer) - 1);
++      buffer[sizeof(buffer) - 1] = '\0';
+       output()->print_cr("[Disassembling for mach='%s']", arg);
+     }
+   } else if (match(event, "format bytes-per-line")) {
+diff --git openjdk.orig/hotspot/src/share/vm/runtime/arguments.cpp openjdk/hotspot/src/share/vm/runtime/arguments.cpp
+--- openjdk.orig/hotspot/src/share/vm/runtime/arguments.cpp
++++ openjdk/hotspot/src/share/vm/runtime/arguments.cpp
+@@ -3452,8 +3452,7 @@
+       src ++;
+     }
+ 
+-    char* copy = AllocateHeap(strlen(src) + 1, mtInternal);
+-    strncpy(copy, src, strlen(src) + 1);
++    char* copy = os::strdup_check_oom(src, mtInternal);
+ 
+     // trim all trailing empty paths
+     for (char* tail = copy + strlen(copy) - 1; tail >= copy && *tail == separator; tail--) {
+@@ -3836,18 +3835,14 @@
+     if (end != NULL) *end = '\0';
+     size_t jvm_path_len = strlen(jvm_path);
+     size_t file_sep_len = strlen(os::file_separator());
+-    shared_archive_path = NEW_C_HEAP_ARRAY(char, jvm_path_len +
+-        file_sep_len + 20, mtInternal);
++    const size_t len = jvm_path_len + file_sep_len + 20;
++    shared_archive_path = NEW_C_HEAP_ARRAY(char, len, mtInternal);
+     if (shared_archive_path != NULL) {
+-      strncpy(shared_archive_path, jvm_path, jvm_path_len + 1);
+-      strncat(shared_archive_path, os::file_separator(), file_sep_len);
+-      strncat(shared_archive_path, "classes.jsa", 11);
++      jio_snprintf(shared_archive_path, len, "%s%sclasses.jsa",
++        jvm_path, os::file_separator());
+     }
+   } else {
+-    shared_archive_path = NEW_C_HEAP_ARRAY(char, strlen(SharedArchiveFile) + 1, mtInternal);
+-    if (shared_archive_path != NULL) {
+-      strncpy(shared_archive_path, SharedArchiveFile, strlen(SharedArchiveFile) + 1);
+-    }
++    shared_archive_path = os::strdup_check_oom(SharedArchiveFile, mtInternal);
+   }
+   return shared_archive_path;
+ }
+diff --git openjdk.orig/hotspot/src/share/vm/utilities/ostream.cpp openjdk/hotspot/src/share/vm/utilities/ostream.cpp
+--- openjdk.orig/hotspot/src/share/vm/utilities/ostream.cpp
++++ openjdk/hotspot/src/share/vm/utilities/ostream.cpp
+@@ -112,7 +112,7 @@
+   }
+   if (add_cr) {
+     if (result != buffer) {
+-      strncpy(buffer, result, buflen);
++      memcpy(buffer, result, result_len);
+       result = buffer;
+     }
+     buffer[result_len++] = '\n';
+@@ -337,15 +337,19 @@
+       assert(rm == NULL || Thread::current()->current_resource_mark() == rm,
+              "stringStream is re-allocated with a different ResourceMark");
+       buffer = NEW_RESOURCE_ARRAY(char, end);
+-      strncpy(buffer, oldbuf, buffer_pos);
++      if (buffer_pos > 0) {
++        memcpy(buffer, oldbuf, buffer_pos);
++      }
+       buffer_length = end;
+     }
+   }
+   // invariant: buffer is always null-terminated
+   guarantee(buffer_pos + write_len + 1 <= buffer_length, "stringStream oob");
+-  buffer[buffer_pos + write_len] = 0;
+-  strncpy(buffer + buffer_pos, s, write_len);
+-  buffer_pos += write_len;
++  if (write_len > 0) {
++    buffer[buffer_pos + write_len] = 0;
++    memcpy(buffer + buffer_pos, s, write_len);
++    buffer_pos += write_len;
++  }
+ 
+   // Note that the following does not depend on write_len.
+   // This means that position and count get updated
+diff --git openjdk.orig/hotspot/src/share/vm/utilities/vmError.cpp openjdk/hotspot/src/share/vm/utilities/vmError.cpp
+--- openjdk.orig/hotspot/src/share/vm/utilities/vmError.cpp
++++ openjdk/hotspot/src/share/vm/utilities/vmError.cpp
+@@ -451,14 +451,7 @@
+ #else
+          const char *file = _filename;
+ #endif
+-         size_t len = strlen(file);
+-         size_t buflen = sizeof(buf);
+-
+-         strncpy(buf, file, buflen);
+-         if (len + 10 < buflen) {
+-           sprintf(buf + len, ":%d", _lineno);
+-         }
+-         st->print(" (%s)", buf);
++         st->print(" (%s:%d)", file, _lineno);
+        } else {
+          st->print(" (0x%x)", _id);
+        }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/hotspot/shenandoah/8214059-pr3693.patch	Mon Feb 18 05:39:38 2019 +0000
@@ -0,0 +1,104 @@
+# HG changeset patch
+# User sgehwolf
+# Date 1549899806 0
+#      Mon Feb 11 15:43:26 2019 +0000
+# Node ID 4a1c2eb583ae102da922f204efd6dab1f8073c41
+# Parent  9087f96c9d956e0141741639445ebcb8bb20e3e6
+8214059, PR3693: Undefined behaviour in ADLC
+Reviewed-by: shade, kbarrett
+Contributed-by: Simon Tooke <stooke@redhat.com>
+
+diff --git openjdk.orig/hotspot/src/share/vm/adlc/adlparse.cpp openjdk/hotspot/src/share/vm/adlc/adlparse.cpp
+--- openjdk.orig/hotspot/src/share/vm/adlc/adlparse.cpp
++++ openjdk/hotspot/src/share/vm/adlc/adlparse.cpp
+@@ -2868,7 +2868,8 @@
+   const char* param = NULL;
+   inst._parameters.reset();
+   while ((param = inst._parameters.iter()) != NULL) {
+-    OperandForm* opForm = (OperandForm*) inst._localNames[param];
++    OpClassForm* opForm = inst._localNames[param]->is_opclass();
++    assert(opForm != NULL, "sanity");
+     encoding->add_parameter(opForm->_ident, param);
+   }
+ 
+@@ -3338,7 +3339,8 @@
+   const char* param = NULL;
+   inst._parameters.reset();
+   while ((param = inst._parameters.iter()) != NULL) {
+-    OperandForm* opForm = (OperandForm*) inst._localNames[param];
++    OpClassForm* opForm = inst._localNames[param]->is_opclass();
++    assert(opForm != NULL, "sanity");
+     encoding->add_parameter(opForm->_ident, param);
+   }
+ 
+diff --git openjdk.orig/hotspot/src/share/vm/adlc/dfa.cpp openjdk/hotspot/src/share/vm/adlc/dfa.cpp
+--- openjdk.orig/hotspot/src/share/vm/adlc/dfa.cpp
++++ openjdk/hotspot/src/share/vm/adlc/dfa.cpp
+@@ -757,19 +757,27 @@
+ }
+ 
+ int Expr::compute_min(const Expr *c1, const Expr *c2) {
+-  int result = c1->_min_value + c2->_min_value;
+-  assert( result >= 0, "Invalid cost computation");
++  int v1 = c1->_min_value;
++  int v2 = c2->_min_value;
++  assert(0 <= v2 && v2 <= Expr::Max, "sanity");
++  assert(v1 <= Expr::Max - v2, "Invalid cost computation");
+ 
+-  return result;
++  return v1 + v2;
+ }
+ 
++
+ int Expr::compute_max(const Expr *c1, const Expr *c2) {
+-  int result = c1->_max_value + c2->_max_value;
+-  if( result < 0 ) {  // check for overflow
+-    result = Expr::Max;
++  int v1 = c1->_max_value;
++  int v2 = c2->_max_value;
++
++  // Check for overflow without producing UB. If v2 is positive
++  // and not larger than Max, the subtraction cannot underflow.
++  assert(0 <= v2 && v2 <= Expr::Max, "sanity");
++  if (v1 > Expr::Max - v2) {
++    return Expr::Max;
+   }
+ 
+-  return result;
++  return v1 + v2;
+ }
+ 
+ void Expr::print() const {
+diff --git openjdk.orig/hotspot/src/share/vm/adlc/formssel.cpp openjdk/hotspot/src/share/vm/adlc/formssel.cpp
+--- openjdk.orig/hotspot/src/share/vm/adlc/formssel.cpp
++++ openjdk/hotspot/src/share/vm/adlc/formssel.cpp
+@@ -921,7 +921,8 @@
+   const char *name;
+   const char *kill_name = NULL;
+   for (_parameters.reset(); (name = _parameters.iter()) != NULL;) {
+-    OperandForm *opForm = (OperandForm*)_localNames[name];
++    OpClassForm *opForm = _localNames[name]->is_opclass();
++    assert(opForm != NULL, "sanity");
+ 
+     Effect* e = NULL;
+     {
+@@ -938,7 +939,8 @@
+       // complex so simply enforce the restriction during parse.
+       if (kill_name != NULL &&
+           e->isa(Component::TEMP) && !e->isa(Component::DEF)) {
+-        OperandForm* kill = (OperandForm*)_localNames[kill_name];
++        OpClassForm* kill = _localNames[kill_name]->is_opclass();
++        assert(kill != NULL, "sanity");
+         globalAD->syntax_err(_linenum, "%s: %s %s must be at the end of the argument list\n",
+                              _ident, kill->_ident, kill_name);
+       } else if (e->isa(Component::KILL) && !e->isa(Component::USE)) {
+@@ -2340,7 +2342,8 @@
+   // Add parameters that "do not appear in match rule".
+   const char *name;
+   for (_parameters.reset(); (name = _parameters.iter()) != NULL;) {
+-    OperandForm *opForm = (OperandForm*)_localNames[name];
++    OpClassForm *opForm = _localNames[name]->is_opclass();
++    assert(opForm != NULL, "sanity");
+ 
+     if ( _components.operand_position(name) == -1 ) {
+       _components.insert(name, opForm->_ident, Component::INVALID, false);
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/hotspot/shenandoah/8217753-pr3685.patch	Mon Feb 18 05:39:38 2019 +0000
@@ -0,0 +1,34 @@
+# HG changeset patch
+# User andrew
+# Date 1549859737 0
+#      Mon Feb 11 04:35:37 2019 +0000
+# Node ID 9087f96c9d956e0141741639445ebcb8bb20e3e6
+# Parent  9ecf75ce7c7056614f22ae32745c1f06fa312482
+8217753, PR3685: Enable HotSpot builds on 5.x Linux kernels
+Summary: Remove OS version check on Linux as very unlikely a 2.2.x kernel is still in use
+
+diff --git openjdk.orig/hotspot/make/linux/Makefile openjdk/hotspot/make/linux/Makefile
+--- openjdk.orig/hotspot/make/linux/Makefile
++++ openjdk/hotspot/make/linux/Makefile
+@@ -227,20 +227,7 @@
+ 	@echo "  $(TARGETS_SHARK)"
+ 	@echo "  $(TARGETS_MINIMAL1)"
+ 
+-checks: check_os_version check_j2se_version
+-
+-# We do not want people accidentally building on old systems (e.g. Linux 2.2.x,
+-# Solaris 2.5.1, 2.6).
+-# Disable this check by setting DISABLE_HOTSPOT_OS_VERSION_CHECK=ok.
+-
+-SUPPORTED_OS_VERSION = 2.4% 2.5% 2.6% 3% 4%
+-OS_VERSION := $(shell uname -r)
+-EMPTY_IF_NOT_SUPPORTED = $(filter $(SUPPORTED_OS_VERSION),$(OS_VERSION))
+-
+-check_os_version:
+-ifeq ($(DISABLE_HOTSPOT_OS_VERSION_CHECK)$(EMPTY_IF_NOT_SUPPORTED),)
+-	$(QUIETLY) >&2 echo "*** This OS is not supported:" `uname -a`; exit 1;
+-endif
++checks: check_j2se_version
+ 
+ # jvmti.make requires XSLT (J2SE 1.4.x or newer):
+ XSLT_CHECK	= $(REMOTE) $(RUN.JAVAP) javax.xml.transform.TransformerFactory