diff -Nru openjdk-17-17.0.4+8/debian/changelog openjdk-17-17.0.5+8/debian/changelog
--- openjdk-17-17.0.4+8/debian/changelog 2022-07-22 08:57:45.000000000 +0000
+++ openjdk-17-17.0.5+8/debian/changelog 2022-10-24 16:44:41.000000000 +0000
@@ -1,14 +1,55 @@
-openjdk-17 (17.0.4+8-1~20.04) focal-security; urgency=medium
+openjdk-17 (17.0.5+8-2ubuntu1~20.04) focal-security; urgency=medium
- * OpenJDK 17.0.4 release, build 8.
- * Addresses security issues: CVE-2022-34169, CVE-2022-21541,
- CVE-2022-21540, CVE-2022-21549.
+ * Build 17.0.5+8 for Ubuntu 20.04 LTS.
- -- Matthias Klose Fri, 22 Jul 2022 10:57:45 +0200
+ -- Matthias Klose Mon, 24 Oct 2022 18:44:41 +0200
+
+openjdk-17 (17.0.5+8-2ubuntu1) kinetic-security; urgency=medium
+
+ * Handle jtreg package name for backports.
+
+ -- Matthias Klose Mon, 24 Oct 2022 18:33:55 +0200
+
+openjdk-17 (17.0.5+8-2) unstable; urgency=medium
+
+ * Fix the binary-indep only build.
+
+ -- Matthias Klose Wed, 19 Oct 2022 16:23:50 +0200
+
+openjdk-17 (17.0.5+8-1) unstable; urgency=high
+
+ * OpenJDK 17.0.5+8 (release).
+ * Security fixes
+ - JDK-8289366: Improve HTTP/2 client usage.
+ - JDK-8288508: Enhance ECDSA usage.
+ - JDK-8286918: Better HttpServer service.
+ - JDK-8287446: Enhance icon presentations.
+ - JDK-8286910: Improve JNDI lookups.
+ - JDK-8286511: Improve macro allocation.
+ - JDK-8286526: Improve NTLM support.
+ - JDK-8286533: Key X509 usages.
+ - JDK-8286077: Wider MultiByte conversions.
+ - JDK-8286519: Better memory handling.
+ - JDK-8285662: Better permission resolution.
+ - JDK-8282252: Improve BigInteger/Decimal validation.
+ * Build using GCC 12 in recent development distros.
+
+ -- Matthias Klose Wed, 19 Oct 2022 06:59:58 +0200
openjdk-17 (17.0.4+8-1) unstable; urgency=high
* OpenJDK 17.0.4+8 (release).
+ * Security fixes
+ - JDK-8272243: Improve DER parsing.
+ - JDK-8272249: Better properties of loaded Properties.
+ - JDK-8273056, JDK-8283875, CVE-2022-21549: java.util.random does not
+ correctly sample exponential or Gaussian distributions.
+ - JDK-8277608: Address IP Addressing.
+ - JDK-8281859, CVE-2022-21540: Improve class compilation.
+ - JDK-8281866, CVE-2022-21541: Enhance MethodHandle invocations.
+ - JDK-8283190: Improve MIDI processing.
+ - JDK-8284370: Improve zlib usage.
+ - JDK-8285407, CVE-2022-34169: Improve Xalan supports.
* Disable the reproducible-copyright-headers patch.
* Only try to re-run failed tests once instead of three times.
diff -Nru openjdk-17-17.0.4+8/debian/rules openjdk-17-17.0.5+8/debian/rules
--- openjdk-17-17.0.4+8/debian/rules 2022-07-22 08:57:45.000000000 +0000
+++ openjdk-17-17.0.5+8/debian/rules 2022-10-24 16:44:41.000000000 +0000
@@ -157,7 +157,13 @@
NJOBS = $(subst parallel=,,$(filter parallel=%,$(subst $(COMMA), ,$(DEB_BUILD_OPTIONS))))
endif
-jtreg_pkg = jtreg6
+ifneq (,$(filter $(distrel), sid bookworm bullseye focal jammy kinetic))
+ jtreg_pkg = jtreg6
+else ifneq (,$(filter $(distrel), sid bookworm bullseye))
+ jtreg_pkg = jtreg
+else
+ jtreg_pkg =
+endif
with_check = $(if $(findstring nocheck, $(DEB_BUILD_OPTIONS)),,yes)
ifneq (,$(filter $(DEB_HOST_ARCH), alpha armel mipsel mips64el riscv64))
@@ -264,14 +270,18 @@
export CC = $(DEB_HOST_GNU_TYPE)-gcc-10
export CXX = $(DEB_HOST_GNU_TYPE)-g++-10
bd_gcc = g++-10 ,
-else
+else ifneq (,$(filter $(distrel),jammy))
export CC = $(DEB_HOST_GNU_TYPE)-gcc-11
export CXX = $(DEB_HOST_GNU_TYPE)-g++-11
bd_gcc = g++-11 ,
+else
+ export CC = $(DEB_HOST_GNU_TYPE)-gcc-12
+ export CXX = $(DEB_HOST_GNU_TYPE)-g++-12
+ bd_gcc = g++-12 ,
endif
-# GCC 11 only
-ifeq (,$(findstring 11, $(bd_gcc)))
+# GCC 11 and up
+ifeq (,$(findstring 11 12, $(bd_gcc)))
DEB_BUILD_MAINT_OPTIONS = optimize=-lto
endif
@@ -900,6 +910,7 @@
debian/tests/control: debian/tests/control.in debian/rules
sed \
+ -e 's/@jtreg_pkg@/$(jtreg_pkg)/g' \
-e 's/@min_jtreg_version@/$(min_jtreg_version)/g' \
$< > $@;
@@ -1045,8 +1056,8 @@
ifeq ($(with_check),yes)
jtreg_version="$$(dpkg-query -f '$${Version}\n' -W $(jtreg_pkg))"; \
if ! dpkg --compare-versions $(min_jtreg_version) le $$jtreg_version; then \
- echo "Error: testsuite requires jtreg $(min_jtreg_version) but $$jtreg_version is installed"; \
- echo "Please update the jtreg dependency and regenerate debian/control"; \
+ echo "Error: testsuite requires $(jtreg_pkg) $(min_jtreg_version) but $$jtreg_version is installed"; \
+ echo "Please update the $(jtreg_pkg) dependency and regenerate debian/control"; \
false; \
fi
endif
@@ -1756,10 +1767,10 @@
cp -a $$i $(d_doc)/usr/share/doc/$(p_jrehl)/; \
ln -sf ../$(p_jrehl)/$$b $(d_doc)/usr/share/doc/$(p_doc)/$$b; \
done
- rm -v $(d_doc)/usr/share/doc/$(p_jrehl)/api/script-dir/{jquery-3.5.1.min.js,jquery-ui.min.css,jquery-ui.min.js}
+ rm -v $(d_doc)/usr/share/doc/$(p_jrehl)/api/script-dir/{jquery-3.6.0.min.js,jquery-ui.min.css,jquery-ui.min.js}
dh_link -p$(p_doc) \
/usr/share/javascript/jquery-ui/jquery-ui.min.js \
- /usr/share/doc/$(p_jrehl)/api/script-dir/jquery-3.5.1.min.js \
+ /usr/share/doc/$(p_jrehl)/api/script-dir/jquery-3.6.0.min.js \
/usr/share/javascript/jquery-ui/themes/base/jquery-ui.min.css \
/usr/share/doc/$(p_jrehl)/api/script-dir/jquery-ui.min.css \
/usr/share/javascript/jquery-ui/jquery-ui.min.js \
@@ -1871,7 +1882,7 @@
is_release = yes
#is_release =
git_project = jdk17u
-git_tag = jdk-17.0.4+8
+git_tag = jdk-17.0.5+8
package_version = $(subst jdk-,,$(git_tag))
package_version = $(shell echo $(PKGVERSION) | sed 's/-[^-][^-]*$$//')
ifneq ($(is_release),yes)
diff -Nru openjdk-17-17.0.4+8/debian/tests/control openjdk-17-17.0.5+8/debian/tests/control
--- openjdk-17-17.0.4+8/debian/tests/control 2022-07-22 08:57:45.000000000 +0000
+++ openjdk-17-17.0.5+8/debian/tests/control 2022-10-24 16:44:41.000000000 +0000
@@ -7,9 +7,9 @@
Restrictions: superficial
#Tests: hotspot, jaxp, langtools
-#Depends: @, default-jre-headless, jtreg:native (>= 6+1-0~), testng:native, build-essential
+#Depends: @, default-jre-headless, jtreg6:native (>= 6+1-0~), testng:native, build-essential
#Restrictions: allow-stderr, skippable, flaky
#Tests: jdk
-#Depends: @, default-jre-headless, jtreg:native (>= 6+1-0~), testng:native, build-essential, xfwm4:native, xvfb, dbus-x11
+#Depends: @, default-jre-headless, jtreg6:native (>= 6+1-0~), testng:native, build-essential, xfwm4:native, xvfb, dbus-x11
#Restrictions: allow-stderr, skippable, flaky
diff -Nru openjdk-17-17.0.4+8/debian/tests/control.in openjdk-17-17.0.5+8/debian/tests/control.in
--- openjdk-17-17.0.4+8/debian/tests/control.in 2022-07-20 17:10:26.000000000 +0000
+++ openjdk-17-17.0.5+8/debian/tests/control.in 2022-10-24 16:44:41.000000000 +0000
@@ -7,9 +7,9 @@
Restrictions: superficial
#Tests: hotspot, jaxp, langtools
-#Depends: @, default-jre-headless, jtreg:native (>= @min_jtreg_version@), testng:native, build-essential
+#Depends: @, default-jre-headless, @jtreg_pkg@:native (>= @min_jtreg_version@), testng:native, build-essential
#Restrictions: allow-stderr, skippable, flaky
#Tests: jdk
-#Depends: @, default-jre-headless, jtreg:native (>= @min_jtreg_version@), testng:native, build-essential, xfwm4:native, xvfb, dbus-x11
+#Depends: @, default-jre-headless, @jtreg_pkg@:native (>= @min_jtreg_version@), testng:native, build-essential, xfwm4:native, xvfb, dbus-x11
#Restrictions: allow-stderr, skippable, flaky
diff -Nru openjdk-17-17.0.4+8/doc/building.html openjdk-17-17.0.5+8/doc/building.html
--- openjdk-17-17.0.4+8/doc/building.html 2022-07-14 08:05:38.000000000 +0000
+++ openjdk-17-17.0.5+8/doc/building.html 2022-10-10 13:07:22.000000000 +0000
@@ -195,7 +195,7 @@
Windows
Windows XP is not a supported platform, but all newer Windows should be able to build the JDK.
On Windows, it is important that you pay attention to the instructions in the Special Considerations.
-Windows is the only non-POSIX OS supported by the JDK, and as such, requires some extra care. A POSIX support layer is required to build on Windows. Currently, the only supported such layers are Cygwin and Windows Subsystem for Linux (WSL). (Msys is no longer supported due to a too old bash; msys2 would likely be possible to support in a future version but that would require effort to implement.)
+Windows is the only non-POSIX OS supported by the JDK, and as such, requires some extra care. A POSIX support layer is required to build on Windows. Currently, the only supported such layers are Cygwin, Windows Subsystem for Linux (WSL), and MSYS2. (MSYS is no longer supported due to an outdated bash; While OpenJDK can be built with MSYS2, support for it is still experimental, so build failures and unusual errors are not uncommon.)
Internally in the build system, all paths are represented as Unix-style paths, e.g. /cygdrive/c/git/jdk/Makefile
rather than C:\git\jdk\Makefile
. This rule also applies to input to the build system, e.g. in arguments to configure
. So, use --with-msvcr-dll=/cygdrive/c/msvcr100.dll
rather than --with-msvcr-dll=c:\msvcr100.dll
. For details on this conversion, see the section on Fixpath.
Cygwin
A functioning Cygwin environment is required for building the JDK on Windows. If you have a 64-bit OS, we strongly recommend using the 64-bit version of Cygwin.
@@ -278,7 +278,7 @@
Windows |
-Microsoft Visual Studio 2019 update 16.7.2 |
+Microsoft Visual Studio 2022 update 17.1.0 |
@@ -297,7 +297,7 @@
It is advisable to keep an older version of Xcode for building the JDK when updating Xcode. This blog page has good suggestions on managing multiple Xcode versions. To use a specific version of Xcode, use xcode-select -s
before running configure
, or use --with-toolchain-path
to point to the version of Xcode to use, e.g. configure --with-toolchain-path=/Applications/Xcode8.app/Contents/Developer/usr/bin
If you have recently (inadvertently) updated your OS and/or Xcode version, and the JDK can no longer be built, please see the section on Problems with the Build Environment, and Getting Help to find out if there are any recent, non-merged patches available for this update.
Microsoft Visual Studio
-The minimum accepted version of Visual Studio is 2017. Older versions will not be accepted by configure
and will not work. The maximum accepted version of Visual Studio is 2019.
+For aarch64 machines running Windows the minimum accepted version is Visual Studio 2019 (16.8 or higher). For all other platforms the minimum accepted version of Visual Studio is 2017. Older versions will not be accepted by configure
and will not work. For all platforms the maximum accepted version of Visual Studio is 2019.
If you have multiple versions of Visual Studio installed, configure
will by default pick the latest. You can request a specific version to be used by setting --with-toolchain-version
, e.g. --with-toolchain-version=2017
.
If you have Visual Studio installed but configure
fails to detect it, it may be because of spaces in path.
IBM XL C/C++
diff -Nru openjdk-17-17.0.4+8/doc/building.md openjdk-17-17.0.5+8/doc/building.md
--- openjdk-17-17.0.4+8/doc/building.md 2022-07-14 08:05:38.000000000 +0000
+++ openjdk-17-17.0.5+8/doc/building.md 2022-10-10 13:07:22.000000000 +0000
@@ -179,10 +179,10 @@
Windows is the only non-POSIX OS supported by the JDK, and as such, requires
some extra care. A POSIX support layer is required to build on Windows.
-Currently, the only supported such layers are Cygwin and Windows Subsystem for
-Linux (WSL). (Msys is no longer supported due to a too old bash; msys2 would
-likely be possible to support in a future version but that would require effort
-to implement.)
+Currently, the only supported such layers are Cygwin, Windows Subsystem for
+Linux (WSL), and MSYS2. (MSYS is no longer supported due to an outdated bash;
+While OpenJDK can be built with MSYS2, support for it is still experimental, so
+build failures and unusual errors are not uncommon.)
Internally in the build system, all paths are represented as Unix-style paths,
e.g. `/cygdrive/c/git/jdk/Makefile` rather than `C:\git\jdk\Makefile`. This
@@ -323,7 +323,7 @@
------------------ -------------------------------------------------------
Linux gcc 10.2.0
macOS Apple Xcode 10.1 (using clang 10.0.0)
- Windows Microsoft Visual Studio 2019 update 16.7.2
+ Windows Microsoft Visual Studio 2022 update 17.1.0
All compilers are expected to be able to compile to the C99 language standard,
as some C99 features are used in the source code. Microsoft Visual Studio
diff -Nru openjdk-17-17.0.4+8/.jcheck/conf openjdk-17-17.0.5+8/.jcheck/conf
--- openjdk-17-17.0.4+8/.jcheck/conf 2022-07-14 08:05:38.000000000 +0000
+++ openjdk-17-17.0.5+8/.jcheck/conf 2022-10-10 13:07:22.000000000 +0000
@@ -1,7 +1,7 @@
[general]
project=jdk-updates
jbs=JDK
-version=17.0.4
+version=17.0.5
[checks]
error=author,committer,reviewers,merge,issues,executable,symlink,message,hg-tag,whitespace,problemlists
diff -Nru openjdk-17-17.0.4+8/make/autoconf/boot-jdk.m4 openjdk-17-17.0.5+8/make/autoconf/boot-jdk.m4
--- openjdk-17-17.0.4+8/make/autoconf/boot-jdk.m4 2022-07-14 08:05:38.000000000 +0000
+++ openjdk-17-17.0.5+8/make/autoconf/boot-jdk.m4 2022-10-10 13:07:22.000000000 +0000
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2011, 2021, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2011, 2022, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
@@ -126,16 +126,18 @@
AC_DEFUN([BOOTJDK_CHECK_ARGUMENTS],
[
if test "x$with_boot_jdk" != x; then
- if test -d "$with_boot_jdk"; then
- BOOT_JDK=$with_boot_jdk
+ BOOT_JDK_ARG="$with_boot_jdk"
+ UTIL_FIXUP_PATH(BOOT_JDK_ARG)
+ if test -d "$BOOT_JDK_ARG"; then
+ BOOT_JDK=$BOOT_JDK_ARG
BOOT_JDK_FOUND=maybe
- elif test -f "$with_boot_jdk"; then
- case "$with_boot_jdk" in
+ elif test -f "$BOOT_JDK_ARG"; then
+ case "$BOOT_JDK_ARG" in
*.tar.gz )
BOOT_JDK_SUPPORT_DIR=$CONFIGURESUPPORT_OUTPUTDIR/boot-jdk
$RM -rf $BOOT_JDK_SUPPORT_DIR
$MKDIR -p $BOOT_JDK_SUPPORT_DIR
- $GUNZIP -c $with_boot_jdk | $TAR xf - -C $BOOT_JDK_SUPPORT_DIR
+ $GUNZIP -c $BOOT_JDK_ARG | $TAR xf - -C $BOOT_JDK_SUPPORT_DIR
# Try to find javac to determine BOOT_JDK path
BOOT_JDK_JAVAC_PATH=`$FIND $BOOT_JDK_SUPPORT_DIR | $GREP "/bin/javac"`
diff -Nru openjdk-17-17.0.4+8/make/autoconf/flags-cflags.m4 openjdk-17-17.0.5+8/make/autoconf/flags-cflags.m4
--- openjdk-17-17.0.4+8/make/autoconf/flags-cflags.m4 2022-07-14 08:05:38.000000000 +0000
+++ openjdk-17-17.0.5+8/make/autoconf/flags-cflags.m4 2022-10-10 13:07:22.000000000 +0000
@@ -116,6 +116,18 @@
CFLAGS_DEBUG_SYMBOLS="-g"
ASFLAGS_DEBUG_SYMBOLS="-g"
elif test "x$TOOLCHAIN_TYPE" = xclang; then
+ if test "x$ALLOW_ABSOLUTE_PATHS_IN_OUTPUT" = "xfalse"; then
+ # Check if compiler supports -fdebug-prefix-map. If so, use that to make
+ # the debug symbol paths resolve to paths relative to the workspace root.
+ workspace_root_trailing_slash="${WORKSPACE_ROOT%/}/"
+ DEBUG_PREFIX_CFLAGS="-fdebug-prefix-map=${workspace_root_trailing_slash}="
+ FLAGS_COMPILER_CHECK_ARGUMENTS(ARGUMENT: [${DEBUG_PREFIX_CFLAGS}],
+ IF_FALSE: [
+ DEBUG_PREFIX_CFLAGS=
+ ]
+ )
+ fi
+
CFLAGS_DEBUG_SYMBOLS="-g"
ASFLAGS_DEBUG_SYMBOLS="-g"
elif test "x$TOOLCHAIN_TYPE" = xxlc; then
@@ -458,9 +470,11 @@
ALWAYS_DEFINES_JVM="-D_REENTRANT"
ALWAYS_DEFINES_JDK="-D_GNU_SOURCE -D_REENTRANT -D_LARGEFILE64_SOURCE -DSTDC"
elif test "x$TOOLCHAIN_TYPE" = xmicrosoft; then
- ALWAYS_DEFINES_JDK="-DWIN32_LEAN_AND_MEAN -D_CRT_SECURE_NO_DEPRECATE \
+ # Access APIs for Windows 8 and above
+ # see https://docs.microsoft.com/en-us/cpp/porting/modifying-winver-and-win32-winnt?view=msvc-170
+ ALWAYS_DEFINES_JDK="-DWIN32_LEAN_AND_MEAN -D_WIN32_WINNT=0x0602 -D_CRT_SECURE_NO_DEPRECATE \
-D_CRT_NONSTDC_NO_DEPRECATE -DWIN32 -DIAL"
- ALWAYS_DEFINES_JVM="-DNOMINMAX -DWIN32_LEAN_AND_MEAN"
+ ALWAYS_DEFINES_JVM="-DNOMINMAX -DWIN32_LEAN_AND_MEAN -D_WIN32_WINNT=0x0602"
fi
###############################################################################
diff -Nru openjdk-17-17.0.4+8/make/autoconf/lib-bundled.m4 openjdk-17-17.0.5+8/make/autoconf/lib-bundled.m4
--- openjdk-17-17.0.4+8/make/autoconf/lib-bundled.m4 2022-07-14 08:05:38.000000000 +0000
+++ openjdk-17-17.0.5+8/make/autoconf/lib-bundled.m4 2022-10-10 13:07:22.000000000 +0000
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2011, 2019, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2011, 2022, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
@@ -217,6 +217,9 @@
LIBZ_LIBS=""
if test "x$USE_EXTERNAL_LIBZ" = "xfalse"; then
LIBZ_CFLAGS="$LIBZ_CFLAGS -I$TOPDIR/src/java.base/share/native/libzip/zlib"
+ if test "x$OPENJDK_TARGET_OS" = xmacosx; then
+ LIBZ_CFLAGS="$LIBZ_CFLAGS -DHAVE_UNISTD_H"
+ fi
else
LIBZ_LIBS="-lz"
fi
diff -Nru openjdk-17-17.0.4+8/make/autoconf/platform.m4 openjdk-17-17.0.5+8/make/autoconf/platform.m4
--- openjdk-17-17.0.4+8/make/autoconf/platform.m4 2022-07-14 08:05:38.000000000 +0000
+++ openjdk-17-17.0.5+8/make/autoconf/platform.m4 2022-10-10 13:07:22.000000000 +0000
@@ -212,7 +212,7 @@
VAR_OS=windows
VAR_OS_ENV=windows.wsl
;;
- *msys*)
+ *msys* | *mingw*)
VAR_OS=windows
VAR_OS_ENV=windows.msys2
;;
diff -Nru openjdk-17-17.0.4+8/make/common/modules/LauncherCommon.gmk openjdk-17-17.0.5+8/make/common/modules/LauncherCommon.gmk
--- openjdk-17-17.0.4+8/make/common/modules/LauncherCommon.gmk 2022-07-14 08:05:38.000000000 +0000
+++ openjdk-17-17.0.5+8/make/common/modules/LauncherCommon.gmk 2022-10-10 13:07:22.000000000 +0000
@@ -44,6 +44,7 @@
LAUNCHER_SRC := $(TOPDIR)/src/java.base/share/native/launcher
LAUNCHER_CFLAGS += -I$(TOPDIR)/src/java.base/share/native/launcher \
+ -I$(TOPDIR)/src/java.desktop/share/native/include \
-I$(TOPDIR)/src/java.base/share/native/libjli \
-I$(TOPDIR)/src/java.base/$(OPENJDK_TARGET_OS_TYPE)/native/libjli \
-I$(TOPDIR)/src/java.base/$(OPENJDK_TARGET_OS)/native/libjli \
@@ -196,9 +197,11 @@
################################################################################
# Create man pages for jmod to pick up. There should be a one-to-one
# relationship between executables and man pages (even if this is not always
-# the case), so piggyback man page generation on the launcher compilation.
+# the case), so piggyback man page generation on the launcher compilation. This
+# file may be included from other places as well, so only process man pages
+# when called from /Launcher.gmk.
-ifeq ($(call isTargetOsType, unix), true)
+ifeq ($(call isTargetOsType, unix)+$(MAKEFILE_PREFIX), true+Launcher)
# Only build manpages on unix systems.
# We assume all our man pages should reside in section 1.
@@ -242,9 +245,9 @@
FILTER := $(PANDOC_TROFF_MANPAGE_FILTER), \
POST_PROCESS := $(MAN_POST_PROCESS), \
REPLACEMENTS := \
- @@COPYRIGHT_YEAR@@ => $(COPYRIGHT_YEAR) ; \
- @@VERSION_SHORT@@ => $(VERSION_SHORT) ; \
- @@VERSION_SPECIFICATION@@ => $(VERSION_SPECIFICATION), \
+ @@COPYRIGHT_YEAR@@ => $(COPYRIGHT_YEAR) ; \
+ @@VERSION_SHORT@@ => $(VERSION_SHORT) ; \
+ @@VERSION_SPECIFICATION@@ => $(VERSION_SPECIFICATION), \
EXTRA_DEPS := $(PANDOC_TROFF_MANPAGE_FILTER) \
$(PANDOC_TROFF_MANPAGE_FILTER_SOURCE), \
))
diff -Nru openjdk-17-17.0.4+8/make/common/NativeCompilation.gmk openjdk-17-17.0.5+8/make/common/NativeCompilation.gmk
--- openjdk-17-17.0.4+8/make/common/NativeCompilation.gmk 2022-07-14 08:05:38.000000000 +0000
+++ openjdk-17-17.0.5+8/make/common/NativeCompilation.gmk 2022-10-10 13:07:22.000000000 +0000
@@ -359,9 +359,9 @@
$1_FLAGS := $(BASIC_ASFLAGS) $$($1_BASE_ASFLAGS)
$1_COMPILER := $(AS)
- # gcc assembly files must contain an appropriate relative .file
+ # gcc or clang assembly files must contain an appropriate relative .file
# path for reproducible builds.
- ifeq ($(TOOLCHAIN_TYPE), gcc)
+ ifneq ($(findstring $(TOOLCHAIN_TYPE), gcc clang), )
# If no absolute paths allowed, work out relative source file path
# for assembly .file substitution, otherwise use full file path
ifeq ($(ALLOW_ABSOLUTE_PATHS_IN_OUTPUT), false)
@@ -403,8 +403,9 @@
$1_OBJ_DEPS := $$($1_SRC_FILE) $$($$($1_BASE)_COMPILE_VARDEPS_FILE) \
$$($$($1_BASE)_EXTRA_DEPS) $$($1_VARDEPS_FILE)
$1_COMPILE_OPTIONS := $$($1_FLAGS) $(CC_OUT_OPTION)$$($1_OBJ) $$($1_SRC_FILE)
- # For reproducible builds with gcc ensure random symbol generation is seeded deterministically
- ifeq ($(TOOLCHAIN_TYPE), gcc)
+ # For reproducible builds with gcc and clang ensure random symbol generation is
+ # seeded deterministically
+ ifneq ($(findstring $(TOOLCHAIN_TYPE), gcc clang), )
ifeq ($$(ENABLE_REPRODUCIBLE_BUILD), true)
$1_COMPILE_OPTIONS += -frandom-seed="$$($1_FILENAME)"
endif
diff -Nru openjdk-17-17.0.4+8/make/conf/github-actions.conf openjdk-17-17.0.5+8/make/conf/github-actions.conf
--- openjdk-17-17.0.4+8/make/conf/github-actions.conf 1970-01-01 00:00:00.000000000 +0000
+++ openjdk-17-17.0.5+8/make/conf/github-actions.conf 2022-10-10 13:07:22.000000000 +0000
@@ -0,0 +1,41 @@
+#
+# Copyright (c) 2020, 2022, Oracle and/or its affiliates. All rights reserved.
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# This code is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License version 2 only, as
+# published by the Free Software Foundation. Oracle designates this
+# particular file as subject to the "Classpath" exception as provided
+# by Oracle in the LICENSE file that accompanied this code.
+#
+# This code is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+# version 2 for more details (a copy is included in the LICENSE file that
+# accompanied this code).
+#
+# You should have received a copy of the GNU General Public License version
+# 2 along with this work; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+# or visit www.oracle.com if you need additional information or have any
+# questions.
+#
+
+# Versions and download locations for dependencies used by GitHub Actions (GHA)
+
+GTEST_VERSION=1.8.1
+JTREG_VERSION=6.1+2
+
+LINUX_X64_BOOT_JDK_EXT=tar.gz
+LINUX_X64_BOOT_JDK_URL=https://github.com/adoptium/temurin17-binaries/releases/download/jdk-17.0.2%2B8/OpenJDK17U-jdk_x64_linux_hotspot_17.0.2_8.tar.gz
+LINUX_X64_BOOT_JDK_SHA256=288f34e3ba8a4838605636485d0365ce23e57d5f2f68997ac4c2e4c01967cd48
+
+WINDOWS_X64_BOOT_JDK_EXT=zip
+WINDOWS_X64_BOOT_JDK_URL=https://github.com/adoptium/temurin17-binaries/releases/download/jdk-17.0.2%2B8/OpenJDK17U-jdk_x64_windows_hotspot_17.0.2_8.zip
+WINDOWS_X64_BOOT_JDK_SHA256=d083479ca927dce2f586f779373d895e8bf668c632505740279390384edf03fa
+
+MACOS_X64_BOOT_JDK_EXT=tar.gz
+MACOS_X64_BOOT_JDK_URL=https://github.com/adoptium/temurin17-binaries/releases/download/jdk-17.0.2%2B8/OpenJDK17U-jdk_x64_mac_hotspot_17.0.2_8.tar.gz
+MACOS_X64_BOOT_JDK_SHA256=3630e21a571b7180876bf08f85d0aac0bdbb3267b2ae9bd242f4933b21f9be32
diff -Nru openjdk-17-17.0.4+8/make/conf/jib-profiles.js openjdk-17-17.0.5+8/make/conf/jib-profiles.js
--- openjdk-17-17.0.4+8/make/conf/jib-profiles.js 2022-07-14 08:05:38.000000000 +0000
+++ openjdk-17-17.0.5+8/make/conf/jib-profiles.js 2022-10-10 13:07:22.000000000 +0000
@@ -1049,7 +1049,7 @@
var devkit_platform_revisions = {
linux_x64: "gcc10.3.0-OL6.4+1.0",
macosx: "Xcode12.4+1.0",
- windows_x64: "VS2019-16.9.3+1.0",
+ windows_x64: "VS2022-17.1.0+1.0",
linux_aarch64: "gcc10.3.0-OL7.6+1.0",
linux_arm: "gcc8.2.0-Fedora27+1.0",
linux_ppc64le: "gcc8.2.0-Fedora27+1.0",
diff -Nru openjdk-17-17.0.4+8/make/conf/test-dependencies openjdk-17-17.0.5+8/make/conf/test-dependencies
--- openjdk-17-17.0.4+8/make/conf/test-dependencies 2022-07-14 08:05:38.000000000 +0000
+++ openjdk-17-17.0.5+8/make/conf/test-dependencies 1970-01-01 00:00:00.000000000 +0000
@@ -1,43 +0,0 @@
-#
-# Copyright (c) 2020, 2022, Oracle and/or its affiliates. All rights reserved.
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# This code is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License version 2 only, as
-# published by the Free Software Foundation. Oracle designates this
-# particular file as subject to the "Classpath" exception as provided
-# by Oracle in the LICENSE file that accompanied this code.
-#
-# This code is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-# version 2 for more details (a copy is included in the LICENSE file that
-# accompanied this code).
-#
-# You should have received a copy of the GNU General Public License version
-# 2 along with this work; if not, write to the Free Software Foundation,
-# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-#
-# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
-# or visit www.oracle.com if you need additional information or have any
-# questions.
-#
-
-# Versions and download locations for dependencies used by pre-submit testing.
-
-BOOT_JDK_VERSION=17
-JTREG_VERSION=6
-JTREG_BUILD=1
-GTEST_VERSION=1.8.1
-
-LINUX_X64_BOOT_JDK_FILENAME=openjdk-17.0.2_linux-x64_bin.tar.gz
-LINUX_X64_BOOT_JDK_URL=https://github.com/adoptium/temurin17-binaries/releases/download/jdk-17.0.2%2B8/OpenJDK17U-jdk_x64_linux_hotspot_17.0.2_8.tar.gz
-LINUX_X64_BOOT_JDK_SHA256=288f34e3ba8a4838605636485d0365ce23e57d5f2f68997ac4c2e4c01967cd48
-
-WINDOWS_X64_BOOT_JDK_FILENAME=openjdk-17.0.2_windows-x64_bin.zip
-WINDOWS_X64_BOOT_JDK_URL=https://github.com/adoptium/temurin17-binaries/releases/download/jdk-17.0.2%2B8/OpenJDK17U-jdk_x64_windows_hotspot_17.0.2_8.zip
-WINDOWS_X64_BOOT_JDK_SHA256=d083479ca927dce2f586f779373d895e8bf668c632505740279390384edf03fa
-
-MACOS_X64_BOOT_JDK_FILENAME=openjdk-17.0.2_macos-x64_bin.tar.gz
-MACOS_X64_BOOT_JDK_URL=https://github.com/adoptium/temurin17-binaries/releases/download/jdk-17.0.2%2B8/OpenJDK17U-jdk_x64_mac_hotspot_17.0.2_8.tar.gz
-MACOS_X64_BOOT_JDK_SHA256=3630e21a571b7180876bf08f85d0aac0bdbb3267b2ae9bd242f4933b21f9be32
diff -Nru openjdk-17-17.0.4+8/make/conf/version-numbers.conf openjdk-17-17.0.5+8/make/conf/version-numbers.conf
--- openjdk-17-17.0.4+8/make/conf/version-numbers.conf 2022-07-14 08:05:38.000000000 +0000
+++ openjdk-17-17.0.5+8/make/conf/version-numbers.conf 2022-10-10 13:07:22.000000000 +0000
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2011, 2020, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2011, 2022, Oracle and/or its affiliates. All rights reserved.
# 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,12 +28,12 @@
DEFAULT_VERSION_FEATURE=17
DEFAULT_VERSION_INTERIM=0
-DEFAULT_VERSION_UPDATE=4
+DEFAULT_VERSION_UPDATE=5
DEFAULT_VERSION_PATCH=0
DEFAULT_VERSION_EXTRA1=0
DEFAULT_VERSION_EXTRA2=0
DEFAULT_VERSION_EXTRA3=0
-DEFAULT_VERSION_DATE=2022-07-19
+DEFAULT_VERSION_DATE=2022-10-18
DEFAULT_VERSION_CLASSFILE_MAJOR=61 # "`$EXPR $DEFAULT_VERSION_FEATURE + 44`"
DEFAULT_VERSION_CLASSFILE_MINOR=0
DEFAULT_VERSION_DOCS_API_SINCE=11
diff -Nru openjdk-17-17.0.4+8/make/data/currency/CurrencyData.properties openjdk-17-17.0.5+8/make/data/currency/CurrencyData.properties
--- openjdk-17-17.0.4+8/make/data/currency/CurrencyData.properties 2022-07-14 08:05:38.000000000 +0000
+++ openjdk-17-17.0.5+8/make/data/currency/CurrencyData.properties 2022-10-10 13:07:22.000000000 +0000
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2000, 2020, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2000, 2022, Oracle and/or its affiliates. All rights reserved.
# 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,7 @@
# Version of the currency code information in this class.
# It is a serial number that accompanies with each amendment.
-dataVersion=170
+dataVersion=172
# List of all valid ISO 4217 currency codes.
# To ensure compatibility, do not remove codes.
@@ -51,7 +51,7 @@
MTL470-MUR480-MVR462-MWK454-MXN484-MXV979-MYR458-MZM508-MZN943-NAD516-NGN566-\
NIO558-NLG528-NOK578-NPR524-NZD554-OMR512-PAB590-PEN604-PGK598-PHP608-\
PKR586-PLN985-PTE620-PYG600-QAR634-ROL642-RON946-RSD941-RUB643-RUR810-RWF646-SAR682-\
- SBD090-SCR690-SDD736-SDG938-SEK752-SGD702-SHP654-SIT705-SKK703-SLL694-SOS706-\
+ SBD090-SCR690-SDD736-SDG938-SEK752-SGD702-SHP654-SIT705-SKK703-SLE925-SLL694-SOS706-\
SRD968-SRG740-SSP728-STD678-STN930-SVC222-SYP760-SZL748-THB764-TJS972-TMM795-TMT934-TND788-TOP776-\
TPE626-TRL792-TRY949-TTD780-TWD901-TZS834-UAH980-UGX800-USD840-USN997-USS998-UYI940-\
UYU858-UZS860-VEB862-VED926-VEF937-VES928-VND704-VUV548-WST882-XAF950-XAG961-XAU959-XBA955-\
@@ -317,6 +317,8 @@
KP=KPW
# KOREA (THE REPUBLIC OF)
KR=KRW
+# KOSOVO - Not in ISO 3166/4217
+XK=EUR
# KUWAIT
KW=KWD
# KYRGYZSTAN
@@ -482,7 +484,7 @@
# SEYCHELLES
SC=SCR
# SIERRA LEONE
-SL=SLL
+SL=SLE
# SINGAPORE
SG=SGD
# SLOVAKIA
diff -Nru openjdk-17-17.0.4+8/make/data/tzdata/africa openjdk-17-17.0.5+8/make/data/tzdata/africa
--- openjdk-17-17.0.4+8/make/data/tzdata/africa 2022-07-14 08:05:38.000000000 +0000
+++ openjdk-17-17.0.5+8/make/data/tzdata/africa 2022-10-10 13:07:22.000000000 +0000
@@ -182,6 +182,7 @@
Link Africa/Abidjan Africa/Lome # Togo
Link Africa/Abidjan Africa/Nouakchott # Mauritania
Link Africa/Abidjan Africa/Ouagadougou # Burkina Faso
+Link Africa/Abidjan Atlantic/Reykjavik # Iceland
Link Africa/Abidjan Atlantic/St_Helena # St Helena
# Djibouti
@@ -192,7 +193,7 @@
# Egypt
# Milne says Cairo used 2:05:08.9, the local mean time of the Abbasizeh
-# observatory; round to nearest. Milne also says that the official time for
+# observatory. Milne also says that the official time for
# Egypt was mean noon at the Great Pyramid, 2:04:30.5, but apparently this
# did not apply to Cairo, Alexandria, or Port Said.
@@ -377,6 +378,7 @@
Rule Egypt 2014 only - Sep lastThu 24:00 0 -
# Zone NAME STDOFF RULES FORMAT [UNTIL]
+ #STDOFF 2:05:08.9
Zone Africa/Cairo 2:05:09 - LMT 1900 Oct
2:00 Egypt EE%sT
@@ -430,7 +432,7 @@
# At midnight on 30 June 1928 the clocks throughout Kenya was put forward
# half an hour by the Alteration of Time Ordinance, 1928.
# https://gazettes.africa/archive/ke/1928/ke-government-gazette-dated-1928-05-11-no-28.pdf
-# [Ordinance No. 11 of 1928, The Offical Gazette, 1928-06-26, p 813]
+# [Ordinance No. 11 of 1928, The Official Gazette, 1928-06-26, p 813]
# https://books.google.com/books?id=2S0S6os32ZUC&pg=PA813
#
# The 1928 ordinance was repealed by the Alteration of Time (repeal) Ordinance,
@@ -1333,21 +1335,9 @@
Link Africa/Lagos Africa/Porto-Novo # Benin
# Réunion
-# Zone NAME STDOFF RULES FORMAT [UNTIL]
-Zone Indian/Reunion 3:41:52 - LMT 1911 Jun # Saint-Denis
- 4:00 - +04
+# See Asia/Dubai.
#
-# Scattered Islands (Îles Éparses) administered from Réunion are as follows.
-# The following information about them is taken from
-# Îles Éparses (, 1997-07-22,
-# in French; no longer available as of 1999-08-17).
-# We have no info about their time zone histories.
-#
-# Bassas da India - uninhabited
-# Europa Island - inhabited from 1905 to 1910 by two families
-# Glorioso Is - inhabited until at least 1958
-# Juan de Nova - uninhabited
-# Tromelin - inhabited until at least 1958
+# The Crozet Islands also observe Réunion time; see the 'antarctica' file.
# Rwanda
# See Africa/Maputo.
@@ -1379,9 +1369,10 @@
# From Michael Deckers (2018-12-30):
# https://www.legis-palop.org/download.jsp?idFile=102818
# ... [The legal time of the country, which coincides with universal
-# coordinated time, will be restituted at 2 o'clock on day 1 of January, 2019.]
+# coordinated time, will be reinstituted at 2 o'clock on day 1 of January, 2019.]
Zone Africa/Sao_Tome 0:26:56 - LMT 1884
+ #STDOFF -0:36:44.68
-0:36:45 - LMT 1912 Jan 1 00:00u # Lisbon MT
0:00 - GMT 2018 Jan 1 01:00
1:00 - WAT 2019 Jan 1 02:00
@@ -1391,28 +1382,7 @@
# See Africa/Abidjan.
# Seychelles
-
-# From P Chan (2020-11-27):
-# Standard Time was adopted on 1907-01-01.
-#
-# Standard Time Ordinance (Chapter 237)
-# The Laws of Seychelles in Force on the 31st December, 1971, Vol. 6, p 571
-# https://books.google.com/books?id=efE-AQAAIAAJ&pg=PA571
-#
-# From Tim Parenti (2020-12-05):
-# A footnote on https://books.google.com/books?id=DYdDAQAAMAAJ&pg=PA1689
-# confirms that Ordinance No. 9 of 1906 "was brought into force on the 1st
-# January, 1907."
-
-# Zone NAME STDOFF RULES FORMAT [UNTIL]
-Zone Indian/Mahe 3:41:48 - LMT 1907 Jan 1 # Victoria
- 4:00 - +04
-# From Paul Eggert (2001-05-30):
-# Aldabra, Farquhar, and Desroches, originally dependencies of the
-# Seychelles, were transferred to the British Indian Ocean Territory
-# in 1965 and returned to Seychelles control in 1976. We don't know
-# whether this affected their time zone, so omit this for now.
-# Possibly the islands were uninhabited.
+# See Asia/Dubai.
# Sierra Leone
# See Africa/Abidjan.
diff -Nru openjdk-17-17.0.4+8/make/data/tzdata/antarctica openjdk-17-17.0.5+8/make/data/tzdata/antarctica
--- openjdk-17-17.0.4+8/make/data/tzdata/antarctica 2022-07-14 08:05:38.000000000 +0000
+++ openjdk-17-17.0.5+8/make/data/tzdata/antarctica 2022-10-10 13:07:22.000000000 +0000
@@ -180,9 +180,7 @@
# St Paul Island - near Amsterdam, uninhabited
# fishing stations operated variously 1819/1931
#
-# Zone NAME STDOFF RULES FORMAT [UNTIL]
-Zone Indian/Kerguelen 0 - -00 1950 # Port-aux-Français
- 5:00 - +05
+# Kerguelen - see Indian/Maldives.
#
# year-round base in the main continent
# Dumont d'Urville - see Pacific/Port_Moresby.
@@ -265,31 +263,7 @@
# year-round from 1960/61 to 1992
# Vostok, since 1957-12-16, temporarily closed 1994-02/1994-11
-# From Craig Mundell (1994-12-15):
-# http://quest.arc.nasa.gov/antarctica/QA/computers/Directions,Time,ZIP
-# Vostok, which is one of the Russian stations, is set on the same
-# time as Moscow, Russia.
-#
-# From Lee Hotz (2001-03-08):
-# I queried the folks at Columbia who spent the summer at Vostok and this is
-# what they had to say about time there:
-# "in the US Camp (East Camp) we have been on New Zealand (McMurdo)
-# time, which is 12 hours ahead of GMT. The Russian Station Vostok was
-# 6 hours behind that (although only 2 miles away, i.e. 6 hours ahead
-# of GMT). This is a time zone I think two hours east of Moscow. The
-# natural time zone is in between the two: 8 hours ahead of GMT."
-#
-# From Paul Eggert (2001-05-04):
-# This seems to be hopelessly confusing, so I asked Lee Hotz about it
-# in person. He said that some Antarctic locations set their local
-# time so that noon is the warmest part of the day, and that this
-# changes during the year and does not necessarily correspond to mean
-# solar noon. So the Vostok time might have been whatever the clocks
-# happened to be during their visit. So we still don't really know what time
-# it is at Vostok. But we'll guess +06.
-#
-Zone Antarctica/Vostok 0 - -00 1957 Dec 16
- 6:00 - +06
+# See Asia/Urumqi.
# S Africa - year-round bases
# Marion Island, -4653+03752
diff -Nru openjdk-17-17.0.4+8/make/data/tzdata/asia openjdk-17-17.0.5+8/make/data/tzdata/asia
--- openjdk-17-17.0.4+8/make/data/tzdata/asia 2022-07-14 08:05:38.000000000 +0000
+++ openjdk-17-17.0.5+8/make/data/tzdata/asia 2022-10-10 13:07:22.000000000 +0000
@@ -278,10 +278,7 @@
6:00 - +06
# Brunei
-# Zone NAME STDOFF RULES FORMAT [UNTIL]
-Zone Asia/Brunei 7:39:40 - LMT 1926 Mar # Bandar Seri Begawan
- 7:30 - +0730 1933
- 8:00 - +08
+# See Asia/Kuching.
# Burma / Myanmar
@@ -299,6 +296,7 @@
6:30 - +0630 1942 May
9:00 - +09 1945 May 3
6:30 - +0630
+Link Asia/Yangon Indian/Cocos
# Cambodia
# See Asia/Bangkok.
@@ -367,12 +365,9 @@
# in the city at the time for people who use different time standard to adjust
# their clock to their preferred time.
#
-# a. For the 1940 May 31 spring forward, the essay claim that it was
-# coordinared between the international settlement authority and the French
-# concession authority and have gathered support from Hong Kong and Xiamen,
-# that it would spring forward an hour from May 31 "midnight", and the essay
-# claim "Hong Kong government implemented the spring forward in the same time
-# on the same date as Shanghai".
+# a. For the 1940 May 31 spring forward, the essay [says] ... "Hong
+# Kong government implemented the spring forward in the same time on
+# the same date as Shanghai".
#
# b. For the 1940 fall back, it was said that they initially intended to do
# so on September 30 00:59 at night, however they postponed it to October 12
@@ -568,7 +563,7 @@
# Zhongyuan Time ("Central plain Time") UT +08
# Now part of Asia/Shanghai.
# most of China
-# Milne gives 8:05:43.2 for Xujiahui Observatory time; round to nearest.
+# Milne gives 8:05:43.2 for Xujiahui Observatory time....
# Guo says Shanghai switched to UT +08 "from the end of the 19th century".
#
# Long-shu Time (probably as Long and Shu were two names of the area) UT +07
@@ -687,6 +682,7 @@
# Zone NAME STDOFF RULES FORMAT [UNTIL]
# Beijing time, used throughout China; represented by Shanghai.
+ #STDOFF 8:05:43.2
Zone Asia/Shanghai 8:05:43 - LMT 1901
8:00 Shang C%sT 1949 May 28
8:00 PRC C%sT
@@ -694,11 +690,12 @@
# / Wulumuqi. (Please use Asia/Shanghai if you prefer Beijing time.)
Zone Asia/Urumqi 5:50:20 - LMT 1928
6:00 - +06
+Link Asia/Urumqi Antarctica/Vostok
# Hong Kong
-# Milne gives 7:36:41.7; round this.
+# Milne gives 7:36:41.7.
# From Lee Yiu Chung (2009-10-24):
# I found there are some mistakes for the...DST rule for Hong
@@ -882,7 +879,8 @@
Rule HK 1979 only - May 13 3:30 1:00 S
Rule HK 1979 only - Oct 21 3:30 0 -
# Zone NAME STDOFF RULES FORMAT [UNTIL]
-Zone Asia/Hong_Kong 7:36:42 - LMT 1904 Oct 30 0:36:42
+ #STDOFF 7:36:41.7
+Zone Asia/Hong_Kong 7:36:42 - LMT 1904 Oct 29 17:00u
8:00 - HKT 1941 Jun 15 3:00
8:00 1:00 HKST 1941 Oct 1 4:00
8:00 0:30 HKWT 1941 Dec 25
@@ -1357,7 +1355,7 @@
#
# From Paul Eggert (2014-09-06):
# The 1876 Report of the Secretary of the [US] Navy, p 306 says that Batavia
-# civil time was 7:07:12.5; round to even for Jakarta.
+# civil time was 7:07:12.5.
#
# From Gwillim Law (2001-05-28), overriding Shanks & Pottenger:
# http://www.sumatera-inc.com/go_to_invest/about_indonesia.asp#standtime
@@ -1393,10 +1391,11 @@
#
# Zone NAME STDOFF RULES FORMAT [UNTIL]
# Java, Sumatra
+ #STDOFF 7:07:12.5
Zone Asia/Jakarta 7:07:12 - LMT 1867 Aug 10
# Shanks & Pottenger say the next transition was at 1924 Jan 1 0:13,
# but this must be a typo.
- 7:07:12 - BMT 1923 Dec 31 23:47:12 # Batavia
+ 7:07:12 - BMT 1923 Dec 31 16:40u # Batavia
7:20 - +0720 1932 Nov
7:30 - +0730 1942 Mar 23
9:00 - +09 1945 Sep 23
@@ -1428,6 +1427,111 @@
# Iran
+# From Roozbeh Pournader (2022-05-30):
+# Here's an order from the Cabinet to the rest of the government to switch to
+# Tehran time, which is mentioned to be already at +03:30:
+# https://qavanin.ir/Law/TreeText/180138
+# Just in case that goes away, I also saved a copy at archive.org:
+# https://web.archive.org/web/20220530111940/https://qavanin.ir/Law/TreeText/180138
+# Here's my translation:
+#
+# "Circular on Matching the Hours of Governmental and Official Circles
+# in Provinces
+# Approved 1314/03/22 [=1935-06-13]
+# According to the ruling of the Honorable Cabinet, it is ordered that from
+# now on in all internal provinces of the country, governmental and official
+# circles set their time to match Tehran time (three hours and half before
+# Greenwich)....
+#
+# I still haven't found out when Tehran itself switched to +03:30....
+#
+# From Paul Eggert (2022-06-05):
+# Although the above says Tehran was at +03:30 before 1935-06-13, we don't
+# know when it switched to +03:30. For now, use 1935-06-13 as the switch date.
+# Although most likely wrong, we have no better info.
+
+# From Roozbeh Pournader (2022-06-01):
+# This is from Kayhan newspaper, one of the major Iranian newspapers, from
+# March 20, 1978, page 2:
+#
+# "Pull the clocks 60 minutes forward
+# As we informed before, from the fourth day of the month Farvardin of the
+# new year [=1978-03-24], clocks will be pulled forward, and people's daily
+# work and life program will start one hour earlier than the current program.
+# On the 1st day of the month Farvardin of this year [=1977-03-21], they had
+# pulled the clocks forward by one hour, but in the month of Mehr
+# [=1977-09-23], the clocks were pulled back by 30 minutes.
+# In this way, from the 4th day of the month Farvardin, clocks will be ahead
+# of the previous years by one hour and a half.
+# According to the new program, during the night of 4th of Farvardin, when
+# the midnight, meaning 24 o'clock is announced, the hands of the clock must
+# be pulled forward by one hour and thus consider midnight 1 o'clock in the
+# forenoon."
+#
+# This implies that in September 1977, when the daylight savings time was
+# done with, Iran didn't go back to +03:30, but immediately to +04:00.
+#
+#
+# This is from the major Iranian newspaper Ettela'at, dated [1978-08-03]...,
+# page 32. It looks like they decided to get the clocks back to +4:00
+# just in time for Ramadan that year:
+#
+# "Tomorrow Night, Pull the Clocks Back by One Hour
+# At 1 o'clock in the forenoon of Saturday 14 Mordad [=1978-08-05], the
+# clocks will be pulled one hour back and instead of 1 o'clock in the
+# forenoon, Radio Iran will announce 24 o'clock.
+# This decision was made in the Cabinet of Ministers meeting of 25 Tir
+# [=1978-07-16], [...]
+# At the beginning of the year 2537 [=March 1978: Iran was using a different
+# year number for a few years then, based on the Coronation of Cyrus the
+# Great], the country's official time was pulled forward by one hour and now
+# the official time is one hour and a half ahead compared to last year,
+# because in Farvardin of last year [=March 1977], the official time was
+# pulled forward one hour and this continued until the second half of last
+# year [=September 1977] until in the second half of last year the official
+# time was pulled back half an hour and that half hour still remains."
+#
+# This matches the time of the true noon published in the newspapers, as they
+# clearly go from +05:00 to +04:00 after that date (which happened during a
+# long weekend in Iran).
+
+# From Roozbeh Pournader (2022-05-31):
+# [Movahedi S. Cultural preconceptions of time: Can we use operational time
+# to meddle in God's Time? Comp Stud Soc Hist. 1985;27(3):385-400]
+# https://www.jstor.org/stable/178704
+# Here's the quotes from the paper:
+# 1. '"Iran's official time keeper moved the clock one hour forward as from
+# March 22, 1977 (Farvardin 2, 2536) to make maximum use of daylight and save
+# in energy consumption. Thus Iran joined such other countries as Britain in
+# observing what is known as 'daylight saving.' The proposal was originally
+# put forward by the Ministry of Energy, in no way having any influence on
+# observing religious ceremonies. Moving time one hour forward in summer
+# means that at 11:00 o'clock on March 21, the official time was set as
+# midnight March 22. Then September 24 will actually begin one hour later
+# than the end of September 23 [...]." Iran's time base thus continued to be
+# Greenwich Mean Time plus three and one-half hours (plus four and one-half
+# hours in summer).'
+#
+# The article sources this from Iran Almanac and Book of Facts, 1977, Tehran:
+# Echo of Iran, which is on Google Books at
+# https://www.google.com/books/edition/Iran_Almanac_and_Book_of_Facts/9ybVAAAAMAAJ.
+# (I confirmed it by searching for snippets.)
+#
+# 2. "After the fall of the shah, the revolutionary government returned to
+# daylight-saving time (DST) on 26 May 1979."
+#
+# This seems to have been announced just one day in advance, on 25 May 1979.
+#
+# The change in 1977 clearly seems to be the first daylight savings effort in
+# Iran. But the article doesn't mention what happened in 1978 (which was
+# still during the shah's government), or how things continued in 1979
+# onwards (which was during the Islamic Republic).
+
+# From Francis Santoni (2022-06-01):
+# for Iran and 1977 the effective change is only 20 October
+# (UIT No. 143 17.XI.1977) and not 23 September (UIT No. 141 13.IX.1977).
+# UIT is the Operational Bulletin of International Telecommunication Union.
+
# From Roozbeh Pournader (2003-03-15):
# This is an English translation of what I just found (originally in Persian).
# The Gregorian dates in brackets are mine:
@@ -1462,65 +1566,12 @@
# leap year calculation involved. There has never been any serious
# plan to change that law....
#
-# From Paul Eggert (2018-11-30):
-# Go with Shanks & Pottenger before Sept. 1991, and with Pournader thereafter.
-# I used the following code in GNU Emacs 26.1 to generate the "Rule Iran"
-# lines from 2008 through 2087. Emacs 26.1 uses Ed Reingold's
-# cal-persia implementation of Birashk's approximation, which in the
-# 2008-2087 range disagrees with the astronomical Persian calendar
-# for Persian years 1404 (Gregorian 2025) and 1437 (Gregorian 2058), so
-# the following code special-cases those years. See Table 15.1, page 264, of:
-# Edward M. Reingold and Nachum Dershowitz, Calendrical Calculations:
-# The Ultimate Edition, Cambridge University Press (2018).
-# https://www.cambridge.org/fr/academic/subjects/computer-science/computing-general-interest/calendrical-calculations-ultimate-edition-4th-edition
-# Page 258, footnote 2, of this book says there is some dispute over what will
-# happen in 2091 (and some other years after that), so this code
-# stops in 2087, as 2088 and 2089 agree with the "max" rule below.
-# (cl-loop
-# initially (require 'cal-persia)
-# with first-persian-year = 1387
-# with last-persian-year = 1466
-# ;; Exceptional years in the above range,
-# ;; from Reingold & Dershowitz Table 15.1, page 264:
-# with exceptional-persian-years = '(1404 1437)
-# with range-start = nil
-# for persian-year from first-persian-year to last-persian-year
-# do
-# (let*
-# ((exceptional-year-offset
-# (if (member persian-year exceptional-persian-years) 1 0))
-# (beg-dst-absolute
-# (+ (calendar-persian-to-absolute (list 1 1 persian-year))
-# exceptional-year-offset))
-# (end-dst-absolute
-# (+ (calendar-persian-to-absolute (list 6 30 persian-year))
-# exceptional-year-offset))
-# (next-year-beg-dst-absolute
-# (+ (calendar-persian-to-absolute (list 1 1 (1+ persian-year)))
-# (if (member (1+ persian-year) exceptional-persian-years) 1 0)))
-# (beg-dst (calendar-gregorian-from-absolute beg-dst-absolute))
-# (end-dst (calendar-gregorian-from-absolute end-dst-absolute))
-# (next-year-beg-dst (calendar-gregorian-from-absolute
-# next-year-beg-dst-absolute))
-# (year (calendar-extract-year beg-dst))
-# (range-end (if range-start year "only")))
-# (setq range-start (or range-start year))
-# (when (or (/= (calendar-extract-day beg-dst)
-# (calendar-extract-day next-year-beg-dst))
-# (= persian-year last-persian-year))
-# (insert
-# (format
-# "Rule\tIran\t%d\t%s\t-\t%s\t%2d\t24:00\t1:00\t-\n"
-# range-start range-end
-# (calendar-month-name (calendar-extract-month beg-dst) t)
-# (calendar-extract-day beg-dst)))
-# (insert
-# (format
-# "Rule\tIran\t%d\t%s\t-\t%s\t%2d\t24:00\t0\t-\n"
-# range-start range-end
-# (calendar-month-name (calendar-extract-month end-dst) t)
-# (calendar-extract-day end-dst)))
-# (setq range-start nil))))
+# From Paul Eggert (2022-06-30):
+# Go with Pournader for 1935 through spring 1979, and for timestamps
+# after August 1991; go with with Shanks & Pottenger for other timestamps.
+# Go with Santoni's citation of the UIT for fall 1977, as 20 October 1977
+# is 28 Mehr 1356, consistent with the "Mehr" in Pournader's source.
+# Assume that the UIT's "1930" is UTC, i.e., 24:00 local time.
#
# From Oscar van Vlijmen (2005-03-30), writing about future
# discrepancies between cal-persia and the Iranian calendar:
@@ -1554,10 +1605,23 @@
# be changed back to its previous state on the 24 hours of the
# thirtieth day of Shahrivar.
#
+# From Ali Mirjamali (2022-05-10):
+# Official IR News Agency announcement: irna.ir/xjJ3TT
+# ...
+# Highlights: DST will be cancelled for the next Iranian year 1402
+# (i.e 2023-March-21) and forthcoming years.
+#
# Rule NAME FROM TO - IN ON AT SAVE LETTER/S
-Rule Iran 1978 1980 - Mar 20 24:00 1:00 -
-Rule Iran 1978 only - Oct 20 24:00 0 -
+# Work around a bug in zic 2022a and earlier.
+Rule Iran 1910 only - Jan 1 00:00 0 -
+#
+Rule Iran 1977 only - Mar 21 23:00 1:00 -
+Rule Iran 1977 only - Oct 20 24:00 0 -
+Rule Iran 1978 only - Mar 24 24:00 1:00 -
+Rule Iran 1978 only - Aug 5 01:00 0 -
+Rule Iran 1979 only - May 26 24:00 1:00 -
Rule Iran 1979 only - Sep 18 24:00 0 -
+Rule Iran 1980 only - Mar 20 24:00 1:00 -
Rule Iran 1980 only - Sep 22 24:00 0 -
Rule Iran 1991 only - May 2 24:00 1:00 -
Rule Iran 1992 1995 - Mar 21 24:00 1:00 -
@@ -1588,85 +1652,13 @@
Rule Iran 2017 2019 - Sep 21 24:00 0 -
Rule Iran 2020 only - Mar 20 24:00 1:00 -
Rule Iran 2020 only - Sep 20 24:00 0 -
-Rule Iran 2021 2023 - Mar 21 24:00 1:00 -
-Rule Iran 2021 2023 - Sep 21 24:00 0 -
-Rule Iran 2024 only - Mar 20 24:00 1:00 -
-Rule Iran 2024 only - Sep 20 24:00 0 -
-Rule Iran 2025 2027 - Mar 21 24:00 1:00 -
-Rule Iran 2025 2027 - Sep 21 24:00 0 -
-Rule Iran 2028 2029 - Mar 20 24:00 1:00 -
-Rule Iran 2028 2029 - Sep 20 24:00 0 -
-Rule Iran 2030 2031 - Mar 21 24:00 1:00 -
-Rule Iran 2030 2031 - Sep 21 24:00 0 -
-Rule Iran 2032 2033 - Mar 20 24:00 1:00 -
-Rule Iran 2032 2033 - Sep 20 24:00 0 -
-Rule Iran 2034 2035 - Mar 21 24:00 1:00 -
-Rule Iran 2034 2035 - Sep 21 24:00 0 -
-Rule Iran 2036 2037 - Mar 20 24:00 1:00 -
-Rule Iran 2036 2037 - Sep 20 24:00 0 -
-Rule Iran 2038 2039 - Mar 21 24:00 1:00 -
-Rule Iran 2038 2039 - Sep 21 24:00 0 -
-Rule Iran 2040 2041 - Mar 20 24:00 1:00 -
-Rule Iran 2040 2041 - Sep 20 24:00 0 -
-Rule Iran 2042 2043 - Mar 21 24:00 1:00 -
-Rule Iran 2042 2043 - Sep 21 24:00 0 -
-Rule Iran 2044 2045 - Mar 20 24:00 1:00 -
-Rule Iran 2044 2045 - Sep 20 24:00 0 -
-Rule Iran 2046 2047 - Mar 21 24:00 1:00 -
-Rule Iran 2046 2047 - Sep 21 24:00 0 -
-Rule Iran 2048 2049 - Mar 20 24:00 1:00 -
-Rule Iran 2048 2049 - Sep 20 24:00 0 -
-Rule Iran 2050 2051 - Mar 21 24:00 1:00 -
-Rule Iran 2050 2051 - Sep 21 24:00 0 -
-Rule Iran 2052 2053 - Mar 20 24:00 1:00 -
-Rule Iran 2052 2053 - Sep 20 24:00 0 -
-Rule Iran 2054 2055 - Mar 21 24:00 1:00 -
-Rule Iran 2054 2055 - Sep 21 24:00 0 -
-Rule Iran 2056 2057 - Mar 20 24:00 1:00 -
-Rule Iran 2056 2057 - Sep 20 24:00 0 -
-Rule Iran 2058 2059 - Mar 21 24:00 1:00 -
-Rule Iran 2058 2059 - Sep 21 24:00 0 -
-Rule Iran 2060 2062 - Mar 20 24:00 1:00 -
-Rule Iran 2060 2062 - Sep 20 24:00 0 -
-Rule Iran 2063 only - Mar 21 24:00 1:00 -
-Rule Iran 2063 only - Sep 21 24:00 0 -
-Rule Iran 2064 2066 - Mar 20 24:00 1:00 -
-Rule Iran 2064 2066 - Sep 20 24:00 0 -
-Rule Iran 2067 only - Mar 21 24:00 1:00 -
-Rule Iran 2067 only - Sep 21 24:00 0 -
-Rule Iran 2068 2070 - Mar 20 24:00 1:00 -
-Rule Iran 2068 2070 - Sep 20 24:00 0 -
-Rule Iran 2071 only - Mar 21 24:00 1:00 -
-Rule Iran 2071 only - Sep 21 24:00 0 -
-Rule Iran 2072 2074 - Mar 20 24:00 1:00 -
-Rule Iran 2072 2074 - Sep 20 24:00 0 -
-Rule Iran 2075 only - Mar 21 24:00 1:00 -
-Rule Iran 2075 only - Sep 21 24:00 0 -
-Rule Iran 2076 2078 - Mar 20 24:00 1:00 -
-Rule Iran 2076 2078 - Sep 20 24:00 0 -
-Rule Iran 2079 only - Mar 21 24:00 1:00 -
-Rule Iran 2079 only - Sep 21 24:00 0 -
-Rule Iran 2080 2082 - Mar 20 24:00 1:00 -
-Rule Iran 2080 2082 - Sep 20 24:00 0 -
-Rule Iran 2083 only - Mar 21 24:00 1:00 -
-Rule Iran 2083 only - Sep 21 24:00 0 -
-Rule Iran 2084 2086 - Mar 20 24:00 1:00 -
-Rule Iran 2084 2086 - Sep 20 24:00 0 -
-Rule Iran 2087 only - Mar 21 24:00 1:00 -
-Rule Iran 2087 only - Sep 21 24:00 0 -
-#
-# The following rules are approximations starting in the year 2088.
-# These are the best post-2088 approximations available, given the
-# restrictions of a single rule using ordinary Gregorian dates.
-# At some point this table will need to be extended, though quite
-# possibly Iran will change the rules first.
-Rule Iran 2088 max - Mar 20 24:00 1:00 -
-Rule Iran 2088 max - Sep 20 24:00 0 -
+Rule Iran 2021 2022 - Mar 21 24:00 1:00 -
+Rule Iran 2021 2022 - Sep 21 24:00 0 -
# Zone NAME STDOFF RULES FORMAT [UNTIL]
Zone Asia/Tehran 3:25:44 - LMT 1916
- 3:25:44 - TMT 1946 # Tehran Mean Time
- 3:30 - +0330 1977 Nov
+ 3:25:44 - TMT 1935 Jun 13 # Tehran Mean Time
+ 3:30 Iran +0330/+0430 1977 Oct 20 24:00
4:00 Iran +04/+05 1979
3:30 Iran +0330/+0430
@@ -2488,9 +2480,9 @@
# the third time belt (before 1930 this means +03).
# From Alexander Konzurovski (2018-12-20):
-# Qyzyolrda Region (Asia/Qyzylorda) is changing its time zone from
-# UTC+6 to UTC+5 effective December 21st, 2018. The legal document is
-# located here: http://adilet.zan.kz/rus/docs/P1800000817 (russian language).
+# (Asia/Qyzylorda) is changing its time zone from UTC+6 to UTC+5
+# effective December 21st, 2018....
+# http://adilet.zan.kz/rus/docs/P1800000817 (russian language).
# Zone NAME STDOFF RULES FORMAT [UNTIL]
#
@@ -2767,20 +2759,8 @@
Rule NBorneo 1935 1941 - Sep 14 0:00 0:20 -
Rule NBorneo 1935 1941 - Dec 14 0:00 0 -
#
-# peninsular Malaysia
-# taken from Mok Ly Yng (2003-10-30)
-# https://web.archive.org/web/20190822231045/http://www.math.nus.edu.sg/~mathelmr/teaching/timezone.html
-# This agrees with Singapore since 1905-06-01.
-# Zone NAME STDOFF RULES FORMAT [UNTIL]
-Zone Asia/Kuala_Lumpur 6:46:46 - LMT 1901 Jan 1
- 6:55:25 - SMT 1905 Jun 1 # Singapore M.T.
- 7:00 - +07 1933 Jan 1
- 7:00 0:20 +0720 1936 Jan 1
- 7:20 - +0720 1941 Sep 1
- 7:30 - +0730 1942 Feb 16
- 9:00 - +09 1945 Sep 12
- 7:30 - +0730 1982 Jan 1
- 8:00 - +08
+# For peninsular Malaysia see Asia/Singapore.
+#
# Sabah & Sarawak
# From Paul Eggert (2014-08-12):
# The data entries here are mostly from Shanks & Pottenger, but the 1942, 1945
@@ -2791,12 +2771,14 @@
8:00 NBorneo +08/+0820 1942 Feb 16
9:00 - +09 1945 Sep 12
8:00 - +08
+Link Asia/Kuching Asia/Brunei
# Maldives
# Zone NAME STDOFF RULES FORMAT [UNTIL]
Zone Indian/Maldives 4:54:00 - LMT 1880 # Malé
4:54:00 - MMT 1960 # Malé Mean Time
5:00 - +05
+Link Indian/Maldives Indian/Kerguelen
# Mongolia
@@ -3631,6 +3613,7 @@
9:00 - +09 1945 Sep 12
7:30 - +0730 1982 Jan 1
8:00 - +08
+Link Asia/Singapore Asia/Kuala_Lumpur
# Spratly Is
# no information
@@ -3865,7 +3848,7 @@
Zone Asia/Dushanbe 4:35:12 - LMT 1924 May 2
5:00 - +05 1930 Jun 21
6:00 RussiaAsia +06/+07 1991 Mar 31 2:00s
- 5:00 1:00 +05/+06 1991 Sep 9 2:00s
+ 5:00 1:00 +06 1991 Sep 9 2:00s
5:00 - +05
# Thailand
@@ -3875,6 +3858,7 @@
7:00 - +07
Link Asia/Bangkok Asia/Phnom_Penh # Cambodia
Link Asia/Bangkok Asia/Vientiane # Laos
+Link Asia/Bangkok Indian/Christmas
# Turkmenistan
# From Shanks & Pottenger.
@@ -3890,6 +3874,8 @@
Zone Asia/Dubai 3:41:12 - LMT 1920
4:00 - +04
Link Asia/Dubai Asia/Muscat # Oman
+Link Asia/Dubai Indian/Mahe
+Link Asia/Dubai Indian/Reunion
# Uzbekistan
# Byalokoz 1919 says Uzbekistan was 4:27:53.
@@ -3901,7 +3887,8 @@
6:00 - +06 1982 Apr 1
5:00 RussiaAsia +05/+06 1992
5:00 - +05
-# Milne says Tashkent was 4:37:10.8; round to nearest.
+# Milne says Tashkent was 4:37:10.8.
+ #STDOFF 4:37:10.8
Zone Asia/Tashkent 4:37:11 - LMT 1924 May 2
5:00 - +05 1930 Jun 21
6:00 RussiaAsia +06/+07 1991 Mar 31 2:00
@@ -3920,7 +3907,7 @@
# The English-language name of Vietnam's most populous city is "Ho Chi Minh
# City"; use Ho_Chi_Minh below to avoid a name of more than 14 characters.
-# From Paul Eggert (2014-10-21) after a heads-up from Trần Ngọc Quân:
+# From Paul Eggert (2022-07-27) after a 2014 heads-up from Trần Ngọc Quân:
# Trần Tiến Bình's authoritative book "Lịch Việt Nam: thế kỷ XX-XXI (1901-2100)"
# (Nhà xuất bản Văn Hoá - Thông Tin, Hanoi, 2005), pp 49-50,
# is quoted verbatim in:
@@ -3932,8 +3919,8 @@
# The 1906 transition was effective July 1 and standardized Indochina to
# Phù Liễn Observatory, legally 104° 17' 17" east of Paris.
# It's unclear whether this meant legal Paris Mean Time (00:09:21) or
-# the Paris Meridian (2° 20' 14.03" E); the former yields 07:06:30.1333...
-# and the latter 07:06:29.333... so either way it rounds to 07:06:30,
+# the Paris Meridian; for now guess the former and round the exact
+# 07:06:30.1333... to 07:06:30.13 as the legal spec used 66 2/3 ms precision.
# which is used below even though the modern-day Phù Liễn Observatory
# is closer to 07:06:31. Abbreviate Phù Liễn Mean Time as PLMT.
#
@@ -3960,7 +3947,8 @@
# NXB Thuận Hoá, Huế, 1995.
# Zone NAME STDOFF RULES FORMAT [UNTIL]
-Zone Asia/Ho_Chi_Minh 7:06:40 - LMT 1906 Jul 1
+ #STDOFF 7:06:30.13
+Zone Asia/Ho_Chi_Minh 7:06:30 - LMT 1906 Jul 1
7:06:30 - PLMT 1911 May 1 # Phù Liễn MT
7:00 - +07 1942 Dec 31 23:00
8:00 - +08 1945 Mar 14 23:00
diff -Nru openjdk-17-17.0.4+8/make/data/tzdata/australasia openjdk-17-17.0.5+8/make/data/tzdata/australasia
--- openjdk-17-17.0.4+8/make/data/tzdata/australasia 2022-07-14 08:05:38.000000000 +0000
+++ openjdk-17-17.0.5+8/make/data/tzdata/australasia 2022-10-10 13:07:22.000000000 +0000
@@ -275,16 +275,10 @@
10:00 AT AE%sT
# Christmas
-# Zone NAME STDOFF RULES FORMAT [UNTIL]
-Zone Indian/Christmas 7:02:52 - LMT 1895 Feb
- 7:00 - +07
+# See Asia/Bangkok.
# Cocos (Keeling) Is
-# These islands were ruled by the Ross family from about 1830 to 1978.
-# We don't know when standard time was introduced; for now, we guess 1900.
-# Zone NAME STDOFF RULES FORMAT [UNTIL]
-Zone Indian/Cocos 6:27:40 - LMT 1900
- 6:30 - +0630
+# See Asia/Yangon.
# Fiji
@@ -501,6 +495,11 @@
# Zone NAME STDOFF RULES FORMAT [UNTIL]
Zone Pacific/Tarawa 11:32:04 - LMT 1901 # Bairiki
12:00 - +12
+Link Pacific/Tarawa Pacific/Funafuti
+Link Pacific/Tarawa Pacific/Majuro
+Link Pacific/Tarawa Pacific/Wake
+Link Pacific/Tarawa Pacific/Wallis
+
Zone Pacific/Kanton 0 - -00 1937 Aug 31
-12:00 - -12 1979 Oct
-11:00 - -11 1994 Dec 31
@@ -514,15 +513,8 @@
# See Pacific/Guam.
# Marshall Is
+# See Pacific/Tarawa for most locations.
# Zone NAME STDOFF RULES FORMAT [UNTIL]
-Zone Pacific/Majuro 11:24:48 - LMT 1901
- 11:00 - +11 1914 Oct
- 9:00 - +09 1919 Feb 1
- 11:00 - +11 1937
- 10:00 - +10 1941 Apr 1
- 9:00 - +09 1944 Jan 30
- 11:00 - +11 1969 Oct
- 12:00 - +12
Zone Pacific/Kwajalein 11:09:20 - LMT 1901
11:00 - +11 1937
10:00 - +10 1941 Apr 1
@@ -532,22 +524,9 @@
12:00 - +12
# Micronesia
+# For Chuuk and Yap see Pacific/Port_Moresby.
+# For Pohnpei see Pacific/Guadalcanal.
# Zone NAME STDOFF RULES FORMAT [UNTIL]
-Zone Pacific/Chuuk -13:52:52 - LMT 1844 Dec 31
- 10:07:08 - LMT 1901
- 10:00 - +10 1914 Oct
- 9:00 - +09 1919 Feb 1
- 10:00 - +10 1941 Apr 1
- 9:00 - +09 1945 Aug
- 10:00 - +10
-Zone Pacific/Pohnpei -13:27:08 - LMT 1844 Dec 31 # Kolonia
- 10:32:52 - LMT 1901
- 11:00 - +11 1914 Oct
- 9:00 - +09 1919 Feb 1
- 11:00 - +11 1937
- 10:00 - +10 1941 Apr 1
- 9:00 - +09 1945 Aug
- 11:00 - +11
Zone Pacific/Kosrae -13:08:04 - LMT 1844 Dec 31
10:51:56 - LMT 1901
11:00 - +11 1914 Oct
@@ -617,12 +596,12 @@
Zone Pacific/Auckland 11:39:04 - LMT 1868 Nov 2
11:30 NZ NZ%sT 1946 Jan 1
12:00 NZ NZ%sT
+Link Pacific/Auckland Antarctica/McMurdo
+
Zone Pacific/Chatham 12:13:48 - LMT 1868 Nov 2
12:15 - +1215 1946 Jan 1
12:45 Chatham +1245/+1345
-Link Pacific/Auckland Antarctica/McMurdo
-
# Auckland Is
# uninhabited; Māori and Moriori, colonial settlers, pastoralists, sealers,
# and scientific personnel have wintered
@@ -681,7 +660,7 @@
# Niue
-# See Pacific/Raratonga comments for 1952 transition.
+# See Pacific/Rarotonga comments for 1952 transition.
#
# From Tim Parenti (2021-09-13):
# Consecutive contemporaneous editions of The Air Almanac listed -11:20 for
@@ -717,6 +696,7 @@
9:48:32 - PMMT 1895 # Port Moresby Mean Time
10:00 - +10
Link Pacific/Port_Moresby Antarctica/DumontDUrville
+Link Pacific/Port_Moresby Pacific/Chuuk
#
# From Paul Eggert (2014-10-13):
# Base the Bougainville entry on the Arawa-Kieta region, which appears to have
@@ -844,6 +824,7 @@
# Zone NAME STDOFF RULES FORMAT [UNTIL]
Zone Pacific/Guadalcanal 10:39:48 - LMT 1912 Oct # Honiara
11:00 - +11
+Link Pacific/Guadalcanal Pacific/Pohnpei
# Tokelau
#
@@ -884,9 +865,7 @@
13:00 Tonga +13/+14
# Tuvalu
-# Zone NAME STDOFF RULES FORMAT [UNTIL]
-Zone Pacific/Funafuti 11:56:52 - LMT 1901
- 12:00 - +12
+# See Pacific/Tarawa.
# US minor outlying islands
@@ -945,9 +924,7 @@
# uninhabited since World War II; was probably like Pacific/Kiritimati
# Wake
-# Zone NAME STDOFF RULES FORMAT [UNTIL]
-Zone Pacific/Wake 11:06:28 - LMT 1901
- 12:00 - +12
+# See Pacific/Tarawa.
# Vanuatu
@@ -986,9 +963,7 @@
11:00 Vanuatu +11/+12
# Wallis and Futuna
-# Zone NAME STDOFF RULES FORMAT [UNTIL]
-Zone Pacific/Wallis 12:15:20 - LMT 1901
- 12:00 - +12
+# See Pacific/Tarawa.
###############################################################################
@@ -1306,6 +1281,7 @@
# to have the extra hour of sunshine removed from their area." See:
# Daylight saving coming to WA in 2019. Guardian Express. 2018-04-01.
# https://www.communitynews.com.au/guardian-express/news/exclusive-daylight-savings-coming-wa-summer-2018/
+# [The article ends with "Today's date is April 1."]
# Queensland
@@ -1849,16 +1825,12 @@
# "In Marshall Islands, Friday is followed by Sunday", NY Times. 1993-08-22.
# https://www.nytimes.com/1993/08/22/world/in-marshall-islands-friday-is-followed-by-sunday.html
-# From Phake Nick (2018-10-27):
-# ... pointed out that
-# currently tzdata say Pacific/Kwajalein switched from GMT+11 to GMT-12 in
-# 1969 October without explanation, however an 1993 article from NYT say it
-# synchorized its day with US mainland about 40 years ago and thus the switch
-# should occur at around 1950s instead.
-#
-# From Paul Eggert (2018-11-18):
-# The NYT (actually, AP) article is vague and possibly wrong about this.
-# The article says the earlier switch was "40 years ago when the United States
+# From Paul Eggert (2022-03-31):
+# Phake Nick (2018-10-27) noted 's
+# citation of a 1993 AP article published in the New York Times saying
+# Kwajalein synchronized its day with the US mainland about 40 years earlier.
+# However the AP article is vague and possibly wrong about this. The article
+# says the earlier switch was "about 40 years ago when the United States
# Army established a missile test range here". However, the Kwajalein Test
# Center was established on 1960-10-01 and was run by the US Navy. It was
# transferred to the US Army on 1964-07-01. See "Seize the High Ground"
@@ -1905,13 +1877,6 @@
# Like the Ladrones (see Guam commentary), assume the Spanish East Indies
# kept American time until the Philippines switched at the end of 1844.
-# Alan Eugene Davis writes (1996-03-16),
-# "I am certain, having lived there for the past decade, that 'Truk'
-# (now properly known as Chuuk) ... is in the time zone GMT+10."
-#
-# Shanks & Pottenger write that Truk switched from UT +10 to +11
-# on 1978-10-01; ignore this for now.
-
# From Paul Eggert (1999-10-29):
# The Federated States of Micronesia Visitors Board writes in
# The Federated States of Micronesia - Visitor Information (1999-01-26)
@@ -2242,7 +2207,7 @@
# through the third Sunday in January at 03:00, like Fiji, for now.
# From David Wade (2017-10-18):
-# In August government was disolved by the King. The current prime minister
+# In August government was dissolved by the King. The current prime minister
# continued in office in care taker mode. It is easy to see that few
# decisions will be made until elections 16th November.
#
@@ -2250,26 +2215,6 @@
# For now, guess that DST is discontinued. That's what the IATA is guessing.
-# Wake
-
-# From Vernice Anderson, Personal Secretary to Philip Jessup,
-# US Ambassador At Large (oral history interview, 1971-02-02):
-#
-# Saturday, the 14th [of October, 1950] - ... The time was all the
-# more confusing at that point, because we had crossed the
-# International Date Line, thus getting two Sundays. Furthermore, we
-# discovered that Wake Island had two hours of daylight saving time
-# making calculation of time in Washington difficult if not almost
-# impossible.
-#
-# https://www.trumanlibrary.org/oralhist/andrsonv.htm
-
-# From Paul Eggert (2003-03-23):
-# We have no other report of DST in Wake Island, so omit this info for now.
-
-# See also the commentary for Micronesia.
-
-
###############################################################################
# The International Date Line
diff -Nru openjdk-17-17.0.4+8/make/data/tzdata/backward openjdk-17-17.0.5+8/make/data/tzdata/backward
--- openjdk-17-17.0.4+8/make/data/tzdata/backward 2022-07-14 08:05:38.000000000 +0000
+++ openjdk-17-17.0.5+8/make/data/tzdata/backward 2022-10-10 13:07:22.000000000 +0000
@@ -27,10 +27,15 @@
# 2009-05-17 by Arthur David Olson.
# This file provides links from old or merged timezone names to current ones.
-# Many names changed in late 1993. Several of these names are
+# Many names changed in late 1993, and many merged names moved here
+# in the period from 2013 through 2022. Several of these names are
# also present in the file 'backzone', which has data important only
# for pre-1970 timestamps and so is out of scope for tzdb proper.
+# Although this file is optional and tzdb will work if you omit it by
+# building with 'make BACKWARD=', in practice downstream users
+# typically use this file for backward compatibility.
+
# Link TARGET LINK-NAME
Link Africa/Nairobi Africa/Asmera
Link Africa/Abidjan Africa/Timbuktu
@@ -71,7 +76,7 @@
Link Asia/Makassar Asia/Ujung_Pandang
Link Asia/Ulaanbaatar Asia/Ulan_Bator
Link Atlantic/Faroe Atlantic/Faeroe
-Link Europe/Oslo Atlantic/Jan_Mayen
+Link Europe/Berlin Atlantic/Jan_Mayen
Link Australia/Sydney Australia/ACT
Link Australia/Sydney Australia/Canberra
Link Australia/Hobart Australia/Currie
@@ -106,6 +111,7 @@
Link Europe/Dublin Eire
Link Etc/UTC Etc/UCT
Link Europe/London Europe/Belfast
+Link Europe/Kyiv Europe/Kiev
Link Europe/Chisinau Europe/Tiraspol
Link Europe/London GB
Link Europe/London GB-Eire
@@ -114,7 +120,7 @@
Link Etc/GMT GMT0
Link Etc/GMT Greenwich
Link Asia/Hong_Kong Hongkong
-Link Atlantic/Reykjavik Iceland
+Link Africa/Abidjan Iceland
Link Asia/Tehran Iran
Link Asia/Jerusalem Israel
Link America/Jamaica Jamaica
@@ -130,10 +136,10 @@
Link Asia/Shanghai PRC
Link Pacific/Kanton Pacific/Enderbury
Link Pacific/Honolulu Pacific/Johnston
-Link Pacific/Pohnpei Pacific/Ponape
+Link Pacific/Guadalcanal Pacific/Ponape
Link Pacific/Pago_Pago Pacific/Samoa
-Link Pacific/Chuuk Pacific/Truk
-Link Pacific/Chuuk Pacific/Yap
+Link Pacific/Port_Moresby Pacific/Truk
+Link Pacific/Port_Moresby Pacific/Yap
Link Europe/Warsaw Poland
Link Europe/Lisbon Portugal
Link Asia/Taipei ROC
diff -Nru openjdk-17-17.0.4+8/make/data/tzdata/etcetera openjdk-17-17.0.5+8/make/data/tzdata/etcetera
--- openjdk-17-17.0.4+8/make/data/tzdata/etcetera 2022-07-14 08:05:38.000000000 +0000
+++ openjdk-17-17.0.5+8/make/data/tzdata/etcetera 2022-10-10 13:07:22.000000000 +0000
@@ -40,12 +40,16 @@
# behind GMT but uses the completely misleading abbreviation "GMT".
Zone Etc/GMT 0 - GMT
+
+# The following zone is used by tzcode functions like gmtime,
+# which load the "UTC" file to handle seconds properly.
Zone Etc/UTC 0 - UTC
# The following link uses older naming conventions,
# but it belongs here, not in the file 'backward',
-# as functions like gmtime load the "GMT" file to handle leap seconds properly.
-# We want this to work even on installations that omit the other older names.
+# as it is needed for tzcode releases through 2022a,
+# where functions like gmtime load "GMT" instead of the "Etc/UTC".
+# We want this to work even on installations that omit 'backward'.
Link Etc/GMT GMT
Link Etc/UTC Etc/Universal
diff -Nru openjdk-17-17.0.4+8/make/data/tzdata/europe openjdk-17-17.0.5+8/make/data/tzdata/europe
--- openjdk-17-17.0.4+8/make/data/tzdata/europe 2022-07-14 08:05:38.000000000 +0000
+++ openjdk-17-17.0.5+8/make/data/tzdata/europe 2022-10-10 13:07:22.000000000 +0000
@@ -326,8 +326,7 @@
# UT-00:25:22 and cites the International Telegraph Bureau. As it is
# not clear that there was any practical significance to the change
# from UT-00:25:22 to UT-00:25:21.1 in civil timekeeping, omit this
-# transition for now and just use the latter value, omitting its
-# fraction since our format cannot represent fractions.
+# transition for now and just use the latter value.
# "Countess Markievicz ... claimed that the [1916] abolition of Dublin Mean Time
# was among various actions undertaken by the 'English' government that
@@ -523,7 +522,7 @@
# Use Europe/London for Jersey, Guernsey, and the Isle of Man.
# Zone NAME STDOFF RULES FORMAT [UNTIL]
-Zone Europe/London -0:01:15 - LMT 1847 Dec 1 0:00s
+Zone Europe/London -0:01:15 - LMT 1847 Dec 1
0:00 GB-Eire %s 1968 Oct 27
1:00 - BST 1971 Oct 31 2:00u
0:00 GB-Eire %s 1996
@@ -561,7 +560,8 @@
Rule Eire 1996 max - Oct lastSun 1:00u -1:00 -
# Zone NAME STDOFF RULES FORMAT [UNTIL]
-Zone Europe/Dublin -0:25:00 - LMT 1880 Aug 2
+ #STDOFF -0:25:21.1
+Zone Europe/Dublin -0:25:21 - LMT 1880 Aug 2
-0:25:21 - DMT 1916 May 21 2:00s
-0:25:21 1:00 IST 1916 Oct 1 2:00s
0:00 GB-Eire %s 1921 Dec 6 # independence
@@ -984,6 +984,8 @@
1:00 C-Eur CE%sT 1944 Sep 3
1:00 Belgium CE%sT 1977
1:00 EU CE%sT
+Link Europe/Brussels Europe/Amsterdam
+Link Europe/Brussels Europe/Luxembourg
# Bosnia and Herzegovina
# See Europe/Belgrade.
@@ -1046,62 +1048,12 @@
# End of rearguard section.
1:00 Czech CE%sT 1979
1:00 EU CE%sT
-# Use Europe/Prague also for Slovakia.
+Link Europe/Prague Europe/Bratislava
+
# Denmark, Faroe Islands, and Greenland
+# For Denmark see Europe/Berlin.
-# From Jesper Nørgaard Welen (2005-04-26):
-# the law [introducing standard time] was in effect from 1894-01-01....
-# The page https://www.retsinformation.dk/eli/lta/1893/83
-# confirms this, and states that the law was put forth 1893-03-29.
-#
-# The EU [actually, EEC and Euratom] treaty with effect from 1973:
-# https://www.retsinformation.dk/eli/lta/1972/21100
-#
-# This provoked a new law from 1974 to make possible summer time changes
-# in subsequent decrees with the law
-# https://www.retsinformation.dk/eli/lta/1974/223
-#
-# It seems however that no decree was set forward until 1980. I have
-# not found any decree, but in another related law, the effecting DST
-# changes are stated explicitly to be from 1980-04-06 at 02:00 to
-# 1980-09-28 at 02:00. If this is true, this differs slightly from
-# the EU rule in that DST runs to 02:00, not 03:00. We don't know
-# when Denmark began using the EU rule correctly, but we have only
-# confirmation of the 1980-time, so I presume it was correct in 1981:
-# The law is about the management of the extra hour, concerning
-# working hours reported and effect on obligatory-rest rules (which
-# was suspended on that night):
-# https://web.archive.org/web/20140104053304/https://www.retsinformation.dk/Forms/R0710.aspx?id=60267
-
-# From Jesper Nørgaard Welen (2005-06-11):
-# The Herning Folkeblad (1980-09-26) reported that the night between
-# Saturday and Sunday the clock is set back from three to two.
-
-# From Paul Eggert (2005-06-11):
-# Hence the "02:00" of the 1980 law refers to standard time, not
-# wall-clock time, and so the EU rules were in effect in 1980.
-
-# Rule NAME FROM TO - IN ON AT SAVE LETTER/S
-Rule Denmark 1916 only - May 14 23:00 1:00 S
-Rule Denmark 1916 only - Sep 30 23:00 0 -
-Rule Denmark 1940 only - May 15 0:00 1:00 S
-Rule Denmark 1945 only - Apr 2 2:00s 1:00 S
-Rule Denmark 1945 only - Aug 15 2:00s 0 -
-Rule Denmark 1946 only - May 1 2:00s 1:00 S
-Rule Denmark 1946 only - Sep 1 2:00s 0 -
-Rule Denmark 1947 only - May 4 2:00s 1:00 S
-Rule Denmark 1947 only - Aug 10 2:00s 0 -
-Rule Denmark 1948 only - May 9 2:00s 1:00 S
-Rule Denmark 1948 only - Aug 8 2:00s 0 -
-#
-# Zone NAME STDOFF RULES FORMAT [UNTIL]
-Zone Europe/Copenhagen 0:50:20 - LMT 1890
- 0:50:20 - CMT 1894 Jan 1 # Copenhagen MT
- 1:00 Denmark CE%sT 1942 Nov 2 2:00s
- 1:00 C-Eur CE%sT 1945 Apr 2 2:00
- 1:00 Denmark CE%sT 1980
- 1:00 EU CE%sT
Zone Atlantic/Faroe -0:27:04 - LMT 1908 Jan 11 # Tórshavn
0:00 - WET 1981
0:00 EU WE%sT
@@ -1321,10 +1273,10 @@
Rule Finland 1981 1982 - Mar lastSun 2:00 1:00 S
Rule Finland 1981 1982 - Sep lastSun 3:00 0 -
-# Milne says Helsinki (Helsingfors) time was 1:39:49.2 (official document);
-# round to nearest.
+# Milne says Helsinki (Helsingfors) time was 1:39:49.2 (official document).
# Zone NAME STDOFF RULES FORMAT [UNTIL]
+ #STDOFF 1:39:49.2
Zone Europe/Helsinki 1:39:49 - LMT 1878 May 31
1:39:49 - HMT 1921 May # Helsinki Mean Time
2:00 Finland EE%sT 1983
@@ -1471,6 +1423,7 @@
0:00 France WE%sT 1945 Sep 16 3:00
1:00 France CE%sT 1977
1:00 EU CE%sT
+Link Europe/Paris Europe/Monaco
# Germany
@@ -1514,21 +1467,11 @@
1:00 SovietZone CE%sT 1946
1:00 Germany CE%sT 1980
1:00 EU CE%sT
+Link Europe/Berlin Arctic/Longyearbyen
+Link Europe/Berlin Europe/Copenhagen
+Link Europe/Berlin Europe/Oslo
+Link Europe/Berlin Europe/Stockholm
-# From Tobias Conradi (2011-09-12):
-# Büsingen , surrounded by the Swiss canton
-# Schaffhausen, did not start observing DST in 1980 as the rest of DE
-# (West Germany at that time) and DD (East Germany at that time) did.
-# DD merged into DE, the area is currently covered by code DE in ISO 3166-1,
-# which in turn is covered by the zone Europe/Berlin.
-#
-# Source for the time in Büsingen 1980:
-# http://www.srf.ch/player/video?id=c012c029-03b7-4c2b-9164-aa5902cd58d3
-
-# From Arthur David Olson (2012-03-03):
-# Büsingen and Zurich have shared clocks since 1970.
-
-Link Europe/Zurich Europe/Busingen
# Georgia
# Please see the "asia" file for Asia/Tbilisi.
@@ -1537,7 +1480,7 @@
# Gibraltar
# Zone NAME STDOFF RULES FORMAT [UNTIL]
-Zone Europe/Gibraltar -0:21:24 - LMT 1880 Aug 2 0:00s
+Zone Europe/Gibraltar -0:21:24 - LMT 1880 Aug 2
0:00 GB-Eire %s 1957 Apr 14 2:00
1:00 - CET 1982
1:00 EU CE%sT
@@ -1648,62 +1591,7 @@
1:00 EU CE%sT
# Iceland
-#
-# From Adam David (1993-11-06):
-# The name of the timezone in Iceland for system / mail / news purposes is GMT.
-#
-# (1993-12-05):
-# This material is paraphrased from the 1988 edition of the University of
-# Iceland Almanak.
-#
-# From January 1st, 1908 the whole of Iceland was standardised at 1 hour
-# behind GMT. Previously, local mean solar time was used in different parts
-# of Iceland, the almanak had been based on Reykjavík mean solar time which
-# was 1 hour and 28 minutes behind GMT.
-#
-# "first day of winter" referred to [below] means the first day of the 26 weeks
-# of winter, according to the old icelandic calendar that dates back to the
-# time the norsemen first settled Iceland. The first day of winter is always
-# Saturday, but is not dependent on the Julian or Gregorian calendars.
-#
-# (1993-12-10):
-# I have a reference from the Oxford Icelandic-English dictionary for the
-# beginning of winter, which ties it to the ecclesiastical calendar (and thus
-# to the julian/gregorian calendar) over the period in question.
-# the winter begins on the Saturday next before St. Luke's day
-# (old style), or on St. Luke's day, if a Saturday.
-# St. Luke's day ought to be traceable from ecclesiastical sources. "old style"
-# might be a reference to the Julian calendar as opposed to Gregorian, or it
-# might mean something else (???).
-#
-# From Paul Eggert (2014-11-22):
-# The information below is taken from the 1988 Almanak; see
-# http://www.almanak.hi.is/klukkan.html
-#
-# Rule NAME FROM TO - IN ON AT SAVE LETTER/S
-Rule Iceland 1917 1919 - Feb 19 23:00 1:00 -
-Rule Iceland 1917 only - Oct 21 1:00 0 -
-Rule Iceland 1918 1919 - Nov 16 1:00 0 -
-Rule Iceland 1921 only - Mar 19 23:00 1:00 -
-Rule Iceland 1921 only - Jun 23 1:00 0 -
-Rule Iceland 1939 only - Apr 29 23:00 1:00 -
-Rule Iceland 1939 only - Oct 29 2:00 0 -
-Rule Iceland 1940 only - Feb 25 2:00 1:00 -
-Rule Iceland 1940 1941 - Nov Sun>=2 1:00s 0 -
-Rule Iceland 1941 1942 - Mar Sun>=2 1:00s 1:00 -
-# 1943-1946 - first Sunday in March until first Sunday in winter
-Rule Iceland 1943 1946 - Mar Sun>=1 1:00s 1:00 -
-Rule Iceland 1942 1948 - Oct Sun>=22 1:00s 0 -
-# 1947-1967 - first Sunday in April until first Sunday in winter
-Rule Iceland 1947 1967 - Apr Sun>=1 1:00s 1:00 -
-# 1949 and 1967 Oct transitions delayed by 1 week
-Rule Iceland 1949 only - Oct 30 1:00s 0 -
-Rule Iceland 1950 1966 - Oct Sun>=22 1:00s 0 -
-Rule Iceland 1967 only - Oct 29 1:00s 0 -
-# Zone NAME STDOFF RULES FORMAT [UNTIL]
-Zone Atlantic/Reykjavik -1:28 - LMT 1908
- -1:00 Iceland -01/+00 1968 Apr 7 1:00s
- 0:00 - GMT
+# See Africa/Abidjan.
# Italy
#
@@ -1819,19 +1707,19 @@
Rule Italy 1979 only - Sep 30 0:00s 0 -
# Zone NAME STDOFF RULES FORMAT [UNTIL]
Zone Europe/Rome 0:49:56 - LMT 1866 Dec 12
- 0:49:56 - RMT 1893 Oct 31 23:49:56 # Rome Mean
+ 0:49:56 - RMT 1893 Oct 31 23:00u # Rome Mean
1:00 Italy CE%sT 1943 Sep 10
1:00 C-Eur CE%sT 1944 Jun 4
1:00 Italy CE%sT 1980
1:00 EU CE%sT
+Link Europe/Rome Europe/Vatican
+Link Europe/Rome Europe/San_Marino
+
# Kosovo
# See Europe/Belgrade.
-Link Europe/Rome Europe/Vatican
-Link Europe/Rome Europe/San_Marino
-
# Latvia
# From Liene Kanepe (1998-09-17):
@@ -1915,16 +1803,7 @@
2:00 EU EE%sT
# Liechtenstein
-
-# From Paul Eggert (2013-09-09):
-# Shanks & Pottenger say Vaduz is like Zurich.
-
-# From Alois Treindl (2019-07-04):
-# I was able to access the online archive of the Vaduz paper Vaterland ...
-# I could confirm from the paper that Liechtenstein did in fact follow
-# the same DST in 1941 and 1942 as Switzerland did.
-
-Link Europe/Zurich Europe/Vaduz
+# See Europe/Zurich.
# Lithuania
@@ -1980,40 +1859,7 @@
2:00 EU EE%sT
# Luxembourg
-# Whitman disagrees with most of these dates in minor ways;
-# go with Shanks & Pottenger.
-# Rule NAME FROM TO - IN ON AT SAVE LETTER/S
-Rule Lux 1916 only - May 14 23:00 1:00 S
-Rule Lux 1916 only - Oct 1 1:00 0 -
-Rule Lux 1917 only - Apr 28 23:00 1:00 S
-Rule Lux 1917 only - Sep 17 1:00 0 -
-Rule Lux 1918 only - Apr Mon>=15 2:00s 1:00 S
-Rule Lux 1918 only - Sep Mon>=15 2:00s 0 -
-Rule Lux 1919 only - Mar 1 23:00 1:00 S
-Rule Lux 1919 only - Oct 5 3:00 0 -
-Rule Lux 1920 only - Feb 14 23:00 1:00 S
-Rule Lux 1920 only - Oct 24 2:00 0 -
-Rule Lux 1921 only - Mar 14 23:00 1:00 S
-Rule Lux 1921 only - Oct 26 2:00 0 -
-Rule Lux 1922 only - Mar 25 23:00 1:00 S
-Rule Lux 1922 only - Oct Sun>=2 1:00 0 -
-Rule Lux 1923 only - Apr 21 23:00 1:00 S
-Rule Lux 1923 only - Oct Sun>=2 2:00 0 -
-Rule Lux 1924 only - Mar 29 23:00 1:00 S
-Rule Lux 1924 1928 - Oct Sun>=2 1:00 0 -
-Rule Lux 1925 only - Apr 5 23:00 1:00 S
-Rule Lux 1926 only - Apr 17 23:00 1:00 S
-Rule Lux 1927 only - Apr 9 23:00 1:00 S
-Rule Lux 1928 only - Apr 14 23:00 1:00 S
-Rule Lux 1929 only - Apr 20 23:00 1:00 S
-# Zone NAME STDOFF RULES FORMAT [UNTIL]
-Zone Europe/Luxembourg 0:24:36 - LMT 1904 Jun
- 1:00 Lux CE%sT 1918 Nov 25
- 0:00 Lux WE%sT 1929 Oct 6 2:00s
- 0:00 Belgium WE%sT 1940 May 14 3:00
- 1:00 C-Eur WE%sT 1944 Sep 18 3:00
- 1:00 Belgium CE%sT 1977
- 1:00 EU CE%sT
+# See Europe/Brussels.
# North Macedonia
# See Europe/Belgrade.
@@ -2032,7 +1878,7 @@
Rule Malta 1975 1980 - Sep Sun>=15 2:00 0 -
Rule Malta 1980 only - Mar 31 2:00 1:00 S
# Zone NAME STDOFF RULES FORMAT [UNTIL]
-Zone Europe/Malta 0:58:04 - LMT 1893 Nov 2 0:00s # Valletta
+Zone Europe/Malta 0:58:04 - LMT 1893 Nov 2 # Valletta
1:00 Italy CE%sT 1973 Mar 31
1:00 Malta CE%sT 1981
1:00 EU CE%sT
@@ -2114,126 +1960,16 @@
2:00 Moldova EE%sT
# Monaco
-#
-# From Michael Deckers (2020-06-12):
-# In the "Journal de Monaco" of 1892-05-24, online at
-# https://journaldemonaco.gouv.mc/var/jdm/storage/original/application/b1c67c12c5af11b41ea888fb048e4fe8.pdf
-# we read: ...
-# [In virtue of a Sovereign Ordinance of the May 13 of the current [year],
-# legal time in the Principality will be set to, from the date of June 1,
-# 1892 onwards, to the meridian of Paris, as in France.]
-# In the "Journal de Monaco" of 1911-03-28, online at
-# https://journaldemonaco.gouv.mc/var/jdm/storage/original/application/de74ffb7db53d4f599059fe8f0ed482a.pdf
-# we read an ordinance of 1911-03-16: ...
-# [Legal time in the Principality will be set, from the date of promulgation
-# of the present ordinance, to legal time in France.... Consequently, legal
-# time will be retarded by 9 minutes and 21 seconds.]
-#
-# Zone NAME STDOFF RULES FORMAT [UNTIL]
-Zone Europe/Monaco 0:29:32 - LMT 1892 Jun 1
- 0:09:21 - PMT 1911 Mar 29 # Paris Mean Time
- 0:00 France WE%sT 1945 Sep 16 3:00
- 1:00 France CE%sT 1977
- 1:00 EU CE%sT
+# See Europe/Paris.
# Montenegro
# See Europe/Belgrade.
# Netherlands
-
-# Howse writes that the Netherlands' railways used GMT between 1892 and 1940,
-# but for other purposes the Netherlands used Amsterdam mean time.
-
-# However, Robert H. van Gent writes (2001-04-01):
-# Howse's statement is only correct up to 1909. From 1909-05-01 (00:00:00
-# Amsterdam mean time) onwards, the whole of the Netherlands (including
-# the Dutch railways) was required by law to observe Amsterdam mean time
-# (19 minutes 32.13 seconds ahead of GMT). This had already been the
-# common practice (except for the railways) for many decades but it was
-# not until 1909 when the Dutch government finally defined this by law.
-# On 1937-07-01 this was changed to 20 minutes (exactly) ahead of GMT and
-# was generally known as Dutch Time ("Nederlandse Tijd").
-#
-# (2001-04-08):
-# 1892-05-01 was the date when the Dutch railways were by law required to
-# observe GMT while the remainder of the Netherlands adhered to the common
-# practice of following Amsterdam mean time.
-#
-# (2001-04-09):
-# In 1835 the authorities of the province of North Holland requested the
-# municipal authorities of the towns and cities in the province to observe
-# Amsterdam mean time but I do not know in how many cases this request was
-# actually followed.
-#
-# From 1852 onwards the Dutch telegraph offices were by law required to
-# observe Amsterdam mean time. As the time signals from the observatory of
-# Leiden were also distributed by the telegraph system, I assume that most
-# places linked up with the telegraph (and railway) system automatically
-# adopted Amsterdam mean time.
-#
-# Although the early Dutch railway companies initially observed a variety
-# of times, most of them had adopted Amsterdam mean time by 1858 but it
-# was not until 1866 when they were all required by law to observe
-# Amsterdam mean time.
-
-# The data entries before 1945 are taken from
-# https://www.staff.science.uu.nl/~gent0113/wettijd/wettijd.htm
-
-# From Paul Eggert (2021-05-09):
-# I invented the abbreviations AMT for Amsterdam Mean Time and NST for
-# Netherlands Summer Time, used in the Netherlands from 1835 to 1937.
-
-# Rule NAME FROM TO - IN ON AT SAVE LETTER/S
-Rule Neth 1916 only - May 1 0:00 1:00 NST # Netherlands Summer Time
-Rule Neth 1916 only - Oct 1 0:00 0 AMT # Amsterdam Mean Time
-Rule Neth 1917 only - Apr 16 2:00s 1:00 NST
-Rule Neth 1917 only - Sep 17 2:00s 0 AMT
-Rule Neth 1918 1921 - Apr Mon>=1 2:00s 1:00 NST
-Rule Neth 1918 1921 - Sep lastMon 2:00s 0 AMT
-Rule Neth 1922 only - Mar lastSun 2:00s 1:00 NST
-Rule Neth 1922 1936 - Oct Sun>=2 2:00s 0 AMT
-Rule Neth 1923 only - Jun Fri>=1 2:00s 1:00 NST
-Rule Neth 1924 only - Mar lastSun 2:00s 1:00 NST
-Rule Neth 1925 only - Jun Fri>=1 2:00s 1:00 NST
-# From 1926 through 1939 DST began 05-15, except that it was delayed by a week
-# in years when 05-15 fell in the Pentecost weekend.
-Rule Neth 1926 1931 - May 15 2:00s 1:00 NST
-Rule Neth 1932 only - May 22 2:00s 1:00 NST
-Rule Neth 1933 1936 - May 15 2:00s 1:00 NST
-Rule Neth 1937 only - May 22 2:00s 1:00 NST
-Rule Neth 1937 only - Jul 1 0:00 1:00 S
-Rule Neth 1937 1939 - Oct Sun>=2 2:00s 0 -
-Rule Neth 1938 1939 - May 15 2:00s 1:00 S
-Rule Neth 1945 only - Apr 2 2:00s 1:00 S
-Rule Neth 1945 only - Sep 16 2:00s 0 -
-#
-# Amsterdam Mean Time was +00:19:32.13, but the .13 is omitted
-# below because the current format requires STDOFF to be an integer.
-# Zone NAME STDOFF RULES FORMAT [UNTIL]
-Zone Europe/Amsterdam 0:19:32 - LMT 1835
- 0:19:32 Neth %s 1937 Jul 1
- 0:20 Neth +0020/+0120 1940 May 16 0:00
- 1:00 C-Eur CE%sT 1945 Apr 2 2:00
- 1:00 Neth CE%sT 1977
- 1:00 EU CE%sT
+# See Europe/Brussels.
# Norway
-# http://met.no/met/met_lex/q_u/sommertid.html (2004-01) agrees with Shanks &
-# Pottenger.
-# Rule NAME FROM TO - IN ON AT SAVE LETTER/S
-Rule Norway 1916 only - May 22 1:00 1:00 S
-Rule Norway 1916 only - Sep 30 0:00 0 -
-Rule Norway 1945 only - Apr 2 2:00s 1:00 S
-Rule Norway 1945 only - Oct 1 2:00s 0 -
-Rule Norway 1959 1964 - Mar Sun>=15 2:00s 1:00 S
-Rule Norway 1959 1965 - Sep Sun>=15 2:00s 0 -
-Rule Norway 1965 only - Apr 25 2:00s 1:00 S
-# Zone NAME STDOFF RULES FORMAT [UNTIL]
-Zone Europe/Oslo 0:43:00 - LMT 1895 Jan 1
- 1:00 Norway CE%sT 1940 Aug 10 23:00
- 1:00 C-Eur CE%sT 1945 Apr 2 2:00
- 1:00 Norway CE%sT 1980
- 1:00 EU CE%sT
+# See Europe/Berlin.
# Svalbard & Jan Mayen
@@ -2280,9 +2016,9 @@
# the German armed forces at the Svalbard weather station code-named
# Haudegen did not surrender to the Allies until September 1945.
#
-# All these events predate our cutoff date of 1970, so use Europe/Oslo
+# All these events predate our cutoff date of 1970, so use Europe/Berlin
# for these regions.
-Link Europe/Oslo Arctic/Longyearbyen
+
# Poland
@@ -2336,7 +2072,6 @@
# According to a Portuguese decree (1911-05-26)
# https://dre.pt/application/dir/pdf1sdip/1911/05/12500/23132313.pdf
# Lisbon was at -0:36:44.68, but switched to GMT on 1912-01-01 at 00:00.
-# Round the old offset to -0:36:45. This agrees with Willett....
#
# From Michael Deckers (2018-02-15):
# article 5 [of the 1911 decree; Deckers's translation] ...:
@@ -2423,6 +2158,7 @@
Rule Port 1983 only - Mar lastSun 2:00s 1:00 S
#
# Zone NAME STDOFF RULES FORMAT [UNTIL]
+ #STDOFF -0:36:44.68
Zone Europe/Lisbon -0:36:45 - LMT 1884
-0:36:45 - LMT 1912 Jan 1 0:00u # Lisbon MT
0:00 Port WE%sT 1966 Apr 3 2:00
@@ -2431,9 +2167,13 @@
0:00 W-Eur WE%sT 1992 Sep 27 1:00s
1:00 EU CE%sT 1996 Mar 31 1:00u
0:00 EU WE%sT
-# This Zone can be simplified once we assume zic %z.
Zone Atlantic/Azores -1:42:40 - LMT 1884 # Ponta Delgada
-1:54:32 - HMT 1912 Jan 1 2:00u # Horta MT
+# Vanguard section, for zic and other parsers that support %z.
+# -2:00 Port %z 1966 Apr 3 2:00
+# -1:00 Port %z 1983 Sep 25 1:00s
+# -1:00 W-Eur %z 1992 Sep 27 1:00s
+# Rearguard section, for parsers lacking %z; see ziguard.awk.
-2:00 Port -02/-01 1942 Apr 25 22:00s
-2:00 Port +00 1942 Aug 15 22:00s
-2:00 Port -02/-01 1943 Apr 17 22:00s
@@ -2445,11 +2185,14 @@
-2:00 Port -02/-01 1966 Apr 3 2:00
-1:00 Port -01/+00 1983 Sep 25 1:00s
-1:00 W-Eur -01/+00 1992 Sep 27 1:00s
+# End of rearguard section.
0:00 EU WE%sT 1993 Mar 28 1:00u
-1:00 EU -01/+00
-# This Zone can be simplified once we assume zic %z.
Zone Atlantic/Madeira -1:07:36 - LMT 1884 # Funchal
-1:07:36 - FMT 1912 Jan 1 1:00u # Funchal MT
+# Vanguard section, for zic and other parsers that support %z.
+# -1:00 Port %z 1966 Apr 3 2:00
+# Rearguard section, for parsers lacking %z; see ziguard.awk.
-1:00 Port -01/+00 1942 Apr 25 22:00s
-1:00 Port +01 1942 Aug 15 22:00s
-1:00 Port -01/+00 1943 Apr 17 22:00s
@@ -2459,6 +2202,7 @@
-1:00 Port -01/+00 1945 Apr 21 22:00s
-1:00 Port +01 1945 Aug 25 22:00s
-1:00 Port -01/+00 1966 Apr 3 2:00
+# End of rearguard section.
0:00 Port WE%sT 1983 Sep 25 1:00s
0:00 EU WE%sT
@@ -2877,20 +2621,19 @@
2:00 - EET 1992 Mar 20
# Central Crimea used Moscow time 1994/1997.
#
-# From Paul Eggert (2006-03-22):
-# The _Economist_ (1994-05-28, p 45) reports that central Crimea switched
-# from Kiev to Moscow time sometime after the January 1994 elections.
+# From Paul Eggert (2022-07-21):
+# The _Economist_ (1994-05-28, p 45) reported that central Crimea switched
+# from Kyiv to Moscow time sometime after the January 1994 elections.
# Shanks (1999) says "date of change uncertain", but implies that it happened
# sometime between the 1994 DST switches. Shanks & Pottenger simply say
# 1994-09-25 03:00, but that can't be right. For now, guess it
-# changed in May.
+# changed in May. This change evidently didn't last long; see below.
2:00 C-Eur EE%sT 1994 May
-# From IATA SSIM (1994/1997), which also says that Kerch is still like Kiev.
- 3:00 E-Eur MSK/MSD 1996 Mar 31 0:00s
+# From IATA SSIM (1994/1997), which also said that Kerch is still like Kyiv.
+ 3:00 C-Eur MSK/MSD 1996 Mar 31 0:00s
3:00 1:00 MSD 1996 Oct 27 3:00s
-# IATA SSIM (1997-09) says Crimea switched to EET/EEST.
+# IATA SSIM (1997-09) said Crimea switched to EET/EEST.
# Assume it happened in March by not changing the clocks.
- 3:00 Russia MSK/MSD 1997
3:00 - MSK 1997 Mar lastSun 1:00u
# From Alexander Krivenyshev (2014-03-17):
# time change at 2:00 (2am) on March 30, 2014
@@ -3059,11 +2802,12 @@
# Note: Effective 2005-12-01, (59) Perm Oblast and (81) Komi-Permyak
# Autonomous Okrug merged to form (90, RU-PER) Perm Krai.
-# Milne says Yekaterinburg was 4:02:32.9; round to nearest.
+# Milne says Yekaterinburg was 4:02:32.9.
# Byalokoz 1919 says its provincial time was based on Perm, at 3:45:05.
# Assume it switched on 1916-07-03, the time of the new standard.
# The 1919 and 1930 transitions are from Shanks.
+ #STDOFF 4:02:32.9
Zone Asia/Yekaterinburg 4:02:33 - LMT 1916 Jul 3
3:45:05 - PMT 1919 Jul 15 4:00
4:00 - +04 1930 Jun 21
@@ -3375,8 +3119,8 @@
# 14-28 **** Tomponsky District
# 14-30 **** Ust-Maysky District
-# From Arthur David Olson (2012-05-09):
-# Tomponskij and Ust'-Majskij switched from Vladivostok time to Yakutsk time
+# From Arthur David Olson (2022-03-21):
+# Tomponsky and Ust-Maysky switched from Vladivostok time to Yakutsk time
# in 2011.
# From Paul Eggert (2012-11-25):
@@ -3501,8 +3245,8 @@
# Asia/Ust-Nera covers parts of (14, RU-SA) Sakha (Yakutia) Republic:
# 14-22 **** Oymyakonsky District
-# From Arthur David Olson (2012-05-09):
-# Ojmyakonskij [and the Kuril Islands] switched from
+# From Arthur David Olson (2022-03-21):
+# Oymyakonsky and the Kuril Islands switched from
# Magadan time to Vladivostok time in 2011.
#
# From Tim Parenti (2014-07-06), per Alexander Krivenyshev (2014-07-02):
@@ -3576,7 +3320,7 @@
Link Europe/Belgrade Europe/Zagreb # Croatia
# Slovakia
-Link Europe/Prague Europe/Bratislava
+# See Europe/Prague.
# Slovenia
# See Europe/Belgrade.
@@ -3665,7 +3409,7 @@
Rule SpainAfrica 1978 only - Jun 1 0:00 1:00 S
Rule SpainAfrica 1978 only - Aug 4 0:00 0 -
# Zone NAME STDOFF RULES FORMAT [UNTIL]
-Zone Europe/Madrid -0:14:44 - LMT 1900 Dec 31 23:45:16
+Zone Europe/Madrid -0:14:44 - LMT 1901 Jan 1 0:00u
0:00 Spain WE%sT 1940 Mar 16 23:00
1:00 Spain CE%sT 1979
1:00 EU CE%sT
@@ -3687,61 +3431,7 @@
# Ignore this for now, as the Canaries are part of the EU.
# Sweden
-
-# From Ivan Nilsson (2001-04-13), superseding Shanks & Pottenger:
-#
-# The law "Svensk författningssamling 1878, no 14" about standard time in 1879:
-# From the beginning of 1879 (that is 01-01 00:00) the time for all
-# places in the country is "the mean solar time for the meridian at
-# three degrees, or twelve minutes of time, to the west of the
-# meridian of the Observatory of Stockholm". The law is dated 1878-05-31.
-#
-# The observatory at that time had the meridian 18° 03' 30"
-# eastern longitude = 01:12:14 in time. Less 12 minutes gives the
-# national standard time as 01:00:14 ahead of GMT....
-#
-# About the beginning of CET in Sweden. The lawtext ("Svensk
-# författningssamling 1899, no 44") states, that "from the beginning
-# of 1900... ... the same as the mean solar time for the meridian at
-# the distance of one hour of time from the meridian of the English
-# observatory at Greenwich, or at 12 minutes 14 seconds to the west
-# from the meridian of the Observatory of Stockholm". The law is dated
-# 1899-06-16. In short: At 1900-01-01 00:00:00 the new standard time
-# in Sweden is 01:00:00 ahead of GMT.
-#
-# 1916: The lawtext ("Svensk författningssamling 1916, no 124") states
-# that "1916-05-15 is considered to begin one hour earlier". It is
-# pretty obvious that at 05-14 23:00 the clocks are set to 05-15 00:00....
-# Further the law says, that "1916-09-30 is considered to end one hour later".
-#
-# The laws regulating [DST] are available on the site of the Swedish
-# Parliament beginning with 1985 - the laws regulating 1980/1984 are
-# not available on the site (to my knowledge they are only available
-# in Swedish): (type
-# "sommartid" without the quotes in the field "Fritext" and then click
-# the Sök-button).
-#
-# (2001-05-13):
-#
-# I have now found a newspaper stating that at 1916-10-01 01:00
-# summertime the church-clocks etc were set back one hour to show
-# 1916-10-01 00:00 standard time. The article also reports that some
-# people thought the switch to standard time would take place already
-# at 1916-10-01 00:00 summer time, but they had to wait for another
-# hour before the event took place.
-#
-# Source: The newspaper "Dagens Nyheter", 1916-10-01, page 7 upper left.
-
-# An extra-special abbreviation style is SET for Swedish Time (svensk
-# normaltid) 1879-1899, 3° west of the Stockholm Observatory.
-
-# Zone NAME STDOFF RULES FORMAT [UNTIL]
-Zone Europe/Stockholm 1:12:12 - LMT 1879 Jan 1
- 1:00:14 - SET 1900 Jan 1 # Swedish Time
- 1:00 - CET 1916 May 14 23:00
- 1:00 1:00 CEST 1916 Oct 1 1:00
- 1:00 - CET 1980
- 1:00 EU CE%sT
+# See Europe/Berlin.
# Switzerland
# From Howse:
@@ -3835,6 +3525,19 @@
# 1853-07-16, though it probably occurred at some other date in Zurich, and
# legal civil time probably changed at still some other transition date.
+# From Tobias Conradi (2011-09-12):
+# Büsingen , surrounded by the Swiss canton
+# Schaffhausen, did not start observing DST in 1980 as the rest of DE
+# (West Germany at that time) and DD (East Germany at that time) did.
+# DD merged into DE, the area is currently covered by code DE in ISO 3166-1,
+# which in turn is covered by the zone Europe/Berlin.
+#
+# Source for the time in Büsingen 1980:
+# http://www.srf.ch/player/video?id=c012c029-03b7-4c2b-9164-aa5902cd58d3
+#
+# From Arthur David Olson (2012-03-03):
+# Büsingen and Zurich have shared clocks since 1970.
+
# Rule NAME FROM TO - IN ON AT SAVE LETTER/S
Rule Swiss 1941 1942 - May Mon>=1 1:00 1:00 S
Rule Swiss 1941 1942 - Oct Mon>=1 2:00 0 -
@@ -3843,6 +3546,9 @@
0:29:46 - BMT 1894 Jun # Bern Mean Time
1:00 Swiss CE%sT 1981
1:00 EU CE%sT
+Link Europe/Zurich Europe/Busingen
+Link Europe/Zurich Europe/Vaduz
+
# Turkey
@@ -4051,7 +3757,7 @@
# Ukraine
#
-# From Alois Triendl (2014-03-01):
+# From Alois Treindl (2014-03-01):
# REGULATION A N O V A on March 20, 1992 N 139 ... means that from
# 1992 on, Ukraine had DST with begin time at 02:00 am, on last Sunday
# in March, and end time 03:00 am, last Sunday in September....
@@ -4111,7 +3817,7 @@
# The law documents themselves are at
# http://w1.c1.rada.gov.ua/pls/zweb_n/webproc4_1?id=&pf3511=41484
-# From Vladimir in Moscow via Alois Treindl re Kiev time 1991/2 (2014-02-28):
+# From Vladimir in Moscow via Alois Treindl re Kyiv time 1991/2 (2014-02-28):
# First in Ukraine they changed Time zone from UTC+3 to UTC+2 with DST:
# 03 25 1990 02:00 -03.00 1 Time Zone 3 with DST
# 07 01 1990 02:00 -02.00 1 Time Zone 2 with DST
@@ -4139,23 +3845,23 @@
# * Ukrainian Government's Resolution of 20.03.1992, No. 139.
# http://www.uazakon.com/documents/date_8u/pg_grcasa.htm
-# From Paul Eggert (2018-10-03):
+# From Paul Eggert (2022-04-12):
# As is usual in tzdb, Ukrainian zones use the most common English spellings.
-# For example, tzdb uses Europe/Kiev, as "Kiev" is the most common spelling in
-# English for Ukraine's capital, even though it is certainly wrong as a
-# transliteration of the Ukrainian "Київ". This is similar to tzdb's use of
-# Europe/Prague, which is certainly wrong as a transliteration of the Czech
-# "Praha". ("Kiev" came from old Slavic via Russian to English, and "Prague"
-# came from old Slavic via French to English, so the two cases have something
-# in common.) Admittedly English-language spelling of Ukrainian names is
-# controversial, and some day "Kyiv" may become substantially more popular in
-# English; in the meantime, stick with the traditional English "Kiev" as that
-# means less disruption for our users.
+# In particular, tzdb's name Europe/Kyiv uses the most common spelling in
+# English for Ukraine's capital. Although tzdb's former name was Europe/Kiev,
+# "Kyiv" is now more common due to widespread reporting of the current conflict.
+# Conversely, tzdb continues to use the names Europe/Uzhgorod and
+# Europe/Zaporozhye; this is similar to tzdb's use of Europe/Prague, which is
+# certainly wrong as a transliteration of the Czech "Praha".
+# English-language spelling of Ukrainian names is in flux, and
+# some day "Uzhhorod" or "Zaporizhzhia" may become substantially more
+# common in English; in the meantime, do not change these
+# English spellings as that means less disruption for our users.
# Zone NAME STDOFF RULES FORMAT [UNTIL]
-# This represents most of Ukraine. See above for the spelling of "Kiev".
-Zone Europe/Kiev 2:02:04 - LMT 1880
- 2:02:04 - KMT 1924 May 2 # Kiev Mean Time
+# This represents most of Ukraine. See above for the spelling of "Kyiv".
+Zone Europe/Kyiv 2:02:04 - LMT 1880
+ 2:02:04 - KMT 1924 May 2 # Kyiv Mean Time
2:00 - EET 1930 Jun 21
3:00 - MSK 1941 Sep 20
1:00 C-Eur CE%sT 1943 Nov 6
@@ -4178,7 +3884,7 @@
2:00 C-Eur EE%sT 1996 May 13
2:00 EU EE%sT
# Zaporozh'ye and eastern Lugansk oblasts observed DST 1990/1991.
-# "Zaporizhia" is the transliteration of the Ukrainian name, but
+# "Zaporizhzhia" is the transliteration of the Ukrainian name, but
# "Zaporozh'ye" is more common in English. Use the common English
# spelling, except omit the apostrophe as it is not allowed in
# portable Posix file names.
diff -Nru openjdk-17-17.0.4+8/make/data/tzdata/leapseconds openjdk-17-17.0.5+8/make/data/tzdata/leapseconds
--- openjdk-17-17.0.4+8/make/data/tzdata/leapseconds 2022-07-14 08:05:38.000000000 +0000
+++ openjdk-17-17.0.5+8/make/data/tzdata/leapseconds 2022-10-10 13:07:22.000000000 +0000
@@ -95,11 +95,11 @@
# Any additional leap seconds will come after this.
# This Expires line is commented out for now,
# so that pre-2020a zic implementations do not reject this file.
-#Expires 2022 Dec 28 00:00:00
+#Expires 2023 Jun 28 00:00:00
# POSIX timestamps for the data in this file:
#updated 1467936000 (2016-07-08 00:00:00 UTC)
-#expires 1672185600 (2022-12-28 00:00:00 UTC)
+#expires 1687910400 (2023-06-28 00:00:00 UTC)
-# Updated through IERS Bulletin C63
-# File expires on: 28 December 2022
+# Updated through IERS Bulletin C64
+# File expires on: 28 June 2023
diff -Nru openjdk-17-17.0.4+8/make/data/tzdata/northamerica openjdk-17-17.0.5+8/make/data/tzdata/northamerica
--- openjdk-17-17.0.4+8/make/data/tzdata/northamerica 2022-07-14 08:05:38.000000000 +0000
+++ openjdk-17-17.0.5+8/make/data/tzdata/northamerica 2022-10-10 13:07:22.000000000 +0000
@@ -367,8 +367,7 @@
# From Paul Eggert (2014-09-06):
# Monthly Notices of the Royal Astronomical Society 44, 4 (1884-02-08), 208
# says that New York City Hall time was 3 minutes 58.4 seconds fast of
-# Eastern time (i.e., -4:56:01.6) just before the 1883 switch. Round to the
-# nearest second.
+# Eastern time (i.e., -4:56:01.6) just before the 1883 switch.
# Rule NAME FROM TO - IN ON AT SAVE LETTER
Rule NYC 1920 only - Mar lastSun 2:00 1:00 D
@@ -377,7 +376,8 @@
Rule NYC 1921 1954 - Sep lastSun 2:00 0 S
Rule NYC 1955 1966 - Oct lastSun 2:00 0 S
# Zone NAME STDOFF RULES FORMAT [UNTIL]
-Zone America/New_York -4:56:02 - LMT 1883 Nov 18 12:03:58
+ #STDOFF -4:56:01.6
+Zone America/New_York -4:56:02 - LMT 1883 Nov 18 17:00u
-5:00 US E%sT 1920
-5:00 NYC E%sT 1942
-5:00 US E%sT 1946
@@ -2841,7 +2841,7 @@
# Barbados
-# For 1899 Milne gives -3:58:29.2; round that.
+# For 1899 Milne gives -3:58:29.2.
# From P Chan (2020-12-09 and 2020-12-11):
# Standard time of GMT-4 was adopted in 1911.
@@ -2885,6 +2885,7 @@
Rule Barb 1979 only - Sep 30 2:00 0 S
Rule Barb 1980 only - Sep 25 2:00 0 S
# Zone NAME STDOFF RULES FORMAT [UNTIL]
+ #STDOFF -3:58:29.2
Zone America/Barbados -3:58:29 - LMT 1911 Aug 28 # Bridgetown
-4:00 Barb A%sT 1944
-4:00 Barb AST/-0330 1945
@@ -2945,10 +2946,10 @@
# Bermuda
-# From Paul Eggert (2020-11-24):
+# From Paul Eggert (2022-07-27):
# For 1899 Milne gives -4:19:18.3 as the meridian of the clock tower,
# Bermuda dockyard, Ireland I. This agrees with standard offset given in the
-# Daylight Saving Act, 1917 cited below. Round that to the nearest second.
+# Daylight Saving Act, 1917 cited below.
# It is not known when this time became standard for Bermuda; guess 1890.
# The transition to -04 was specified by:
# 1930: The Time Zone Act, 1929 (1929: No. 39) [1929-11-08]
@@ -3043,6 +3044,7 @@
Rule Bermuda 1956 only - Oct lastSun 2:00 0 S
# Zone NAME STDOFF RULES FORMAT [UNTIL]
+ #STDOFF -4:19:18.3
Zone Atlantic/Bermuda -4:19:18 - LMT 1890 # Hamilton
-4:19:18 Bermuda BMT/BST 1930 Jan 1 2:00
-4:00 Bermuda A%sT 1974 Apr 28 2:00
@@ -3057,7 +3059,7 @@
# Costa Rica
-# Milne gives -5:36:13.3 as San José mean time; round to nearest.
+# Milne gives -5:36:13.3 as San José mean time.
# Rule NAME FROM TO - IN ON AT SAVE LETTER/S
Rule CR 1979 1980 - Feb lastSun 0:00 1:00 D
@@ -3069,6 +3071,7 @@
Rule CR 1992 only - Mar 15 0:00 0 S
# There are too many San Josés elsewhere, so we'll use 'Costa Rica'.
# Zone NAME STDOFF RULES FORMAT [UNTIL]
+ #STDOFF -5:36:13.3
Zone America/Costa_Rica -5:36:13 - LMT 1890 # San José
-5:36:13 - SJMT 1921 Jan 15 # San José Mean Time
-6:00 CR C%sT
@@ -3491,7 +3494,7 @@
# Jamaica
# Shanks & Pottenger give -5:07:12, but Milne records -5:07:10.41 from an
# unspecified official document, and says "This time is used throughout the
-# island". Go with Milne. Round to the nearest second as required by zic.
+# island". Go with Milne.
#
# Shanks & Pottenger give April 28 for the 1974 spring-forward transition, but
# Lance Neita writes that Prime Minister Michael Manley decreed it January 5.
@@ -3504,6 +3507,7 @@
# http://www.jamaicaobserver.com/columns/The-politician-in-all-of-us_17573647
#
# Zone NAME STDOFF RULES FORMAT [UNTIL]
+ #STDOFF -5:07:10.41
Zone America/Jamaica -5:07:10 - LMT 1890 # Kingston
-5:07:10 - KMT 1912 Feb # Kingston Mean Time
-5:00 - EST 1974
@@ -3701,6 +3705,7 @@
# Zone NAME STDOFF RULES FORMAT [UNTIL]
Zone America/Grand_Turk -4:44:32 - LMT 1890
+ #STDOFF -5:07:10.41
-5:07:10 - KMT 1912 Feb # Kingston Mean Time
-5:00 - EST 1979
-5:00 US E%sT 2015 Mar 8 2:00
diff -Nru openjdk-17-17.0.4+8/make/data/tzdata/southamerica openjdk-17-17.0.5+8/make/data/tzdata/southamerica
--- openjdk-17-17.0.4+8/make/data/tzdata/southamerica 2022-07-14 08:05:38.000000000 +0000
+++ openjdk-17-17.0.5+8/make/data/tzdata/southamerica 2022-10-10 13:07:22.000000000 +0000
@@ -423,6 +423,7 @@
#
# Buenos Aires (BA), Capital Federal (CF),
Zone America/Argentina/Buenos_Aires -3:53:48 - LMT 1894 Oct 31
+ #STDOFF -4:16:48.25
-4:16:48 - CMT 1920 May # Córdoba Mean Time
-4:00 - -04 1930 Dec
-4:00 Arg -04/-03 1969 Oct 5
@@ -440,6 +441,7 @@
# - Santiago del Estero switched to -4:00 on 1991-04-01,
# then to -3:00 on 1991-04-26.
#
+ #STDOFF -4:16:48.25
Zone America/Argentina/Cordoba -4:16:48 - LMT 1894 Oct 31
-4:16:48 - CMT 1920 May
-4:00 - -04 1930 Dec
@@ -452,6 +454,7 @@
#
# Salta (SA), La Pampa (LP), Neuquén (NQ), Rio Negro (RN)
Zone America/Argentina/Salta -4:21:40 - LMT 1894 Oct 31
+ #STDOFF -4:16:48.25
-4:16:48 - CMT 1920 May
-4:00 - -04 1930 Dec
-4:00 Arg -04/-03 1969 Oct 5
@@ -464,6 +467,7 @@
#
# Tucumán (TM)
Zone America/Argentina/Tucuman -4:20:52 - LMT 1894 Oct 31
+ #STDOFF -4:16:48.25
-4:16:48 - CMT 1920 May
-4:00 - -04 1930 Dec
-4:00 Arg -04/-03 1969 Oct 5
@@ -477,6 +481,7 @@
#
# La Rioja (LR)
Zone America/Argentina/La_Rioja -4:27:24 - LMT 1894 Oct 31
+ #STDOFF -4:16:48.25
-4:16:48 - CMT 1920 May
-4:00 - -04 1930 Dec
-4:00 Arg -04/-03 1969 Oct 5
@@ -491,6 +496,7 @@
#
# San Juan (SJ)
Zone America/Argentina/San_Juan -4:34:04 - LMT 1894 Oct 31
+ #STDOFF -4:16:48.25
-4:16:48 - CMT 1920 May
-4:00 - -04 1930 Dec
-4:00 Arg -04/-03 1969 Oct 5
@@ -505,6 +511,7 @@
#
# Jujuy (JY)
Zone America/Argentina/Jujuy -4:21:12 - LMT 1894 Oct 31
+ #STDOFF -4:16:48.25
-4:16:48 - CMT 1920 May
-4:00 - -04 1930 Dec
-4:00 Arg -04/-03 1969 Oct 5
@@ -520,6 +527,7 @@
#
# Catamarca (CT), Chubut (CH)
Zone America/Argentina/Catamarca -4:23:08 - LMT 1894 Oct 31
+ #STDOFF -4:16:48.25
-4:16:48 - CMT 1920 May
-4:00 - -04 1930 Dec
-4:00 Arg -04/-03 1969 Oct 5
@@ -534,6 +542,7 @@
#
# Mendoza (MZ)
Zone America/Argentina/Mendoza -4:35:16 - LMT 1894 Oct 31
+ #STDOFF -4:16:48.25
-4:16:48 - CMT 1920 May
-4:00 - -04 1930 Dec
-4:00 Arg -04/-03 1969 Oct 5
@@ -556,6 +565,7 @@
Rule SanLuis 2007 2008 - Oct Sun>=8 0:00 1:00 -
Zone America/Argentina/San_Luis -4:25:24 - LMT 1894 Oct 31
+ #STDOFF -4:16:48.25
-4:16:48 - CMT 1920 May
-4:00 - -04 1930 Dec
-4:00 Arg -04/-03 1969 Oct 5
@@ -574,6 +584,7 @@
#
# Santa Cruz (SC)
Zone America/Argentina/Rio_Gallegos -4:36:52 - LMT 1894 Oct 31
+ #STDOFF -4:16:48.25
-4:16:48 - CMT 1920 May
-4:00 - -04 1930 Dec
-4:00 Arg -04/-03 1969 Oct 5
@@ -586,6 +597,7 @@
#
# Tierra del Fuego, Antártida e Islas del Atlántico Sur (TF)
Zone America/Argentina/Ushuaia -4:33:12 - LMT 1894 Oct 31
+ #STDOFF -4:16:48.25
-4:16:48 - CMT 1920 May
-4:00 - -04 1930 Dec
-4:00 Arg -04/-03 1969 Oct 5
@@ -668,7 +680,7 @@
# From Rodrigo Severo (2004-10-04):
# It's just the biannual change made necessary by the much hyped, supposedly
-# modern Brazilian eletronic voting machines which, apparently, can't deal
+# modern Brazilian ... voting machines which, apparently, can't deal
# with a time change between the first and the second rounds of the elections.
# From Steffen Thorsen (2007-09-20):
@@ -1164,7 +1176,7 @@
# this is known to work for DST transitions starting in 2008 and
# may well be true for earlier transitions.
-# From Tim Parenti (2022-03-15):
+# From Tim Parenti (2022-07-06):
# For a brief period of roughly six weeks in 1946, DST was only observed on an
# emergency basis in specific regions of central Chile; namely, "the national
# territory between the provinces of Coquimbo and Concepción, inclusive".
@@ -1182,7 +1194,14 @@
# Law Number 8,522, promulgated 1946-08-27, reunified Chilean clocks at their
# new "Summer Time" of -04, reckoned as that of "the meridian of the
# Astronomical Observatory of Lo Espejo, advanced by 42 minutes and 45
-# seconds".
+# seconds". Although this law specified the new Summer Time to start on 1
+# September each year, a special "transitional article" started it a few days
+# early, as soon as the law took effect. As the law was to take force "from
+# the date of its publication in the 'Diario Oficial', which happened the
+# following day, presume the change took place in Santiago and its environs
+# from 24:00 -03 to 23:00 -04 on Wednesday 1946-08-28. Although this was a
+# no-op for wall clocks in the north and south of the country, put their formal
+# start to DST an hour later when they reached 24:00 -04.
# https://www.diariooficial.interior.gob.cl/versiones-anteriores/do-h/19460828/#page/1
# After a brief "Winter Time" stint at -05 beginning 1947-04-01, Law Number
# 8,777, promulgated 1947-05-17, established year-round -04 "from 23:00 on the
@@ -1302,11 +1321,19 @@
# So we extend the new rules on Saturdays at 24:00 mainland time indefinitely.
# From Juan Correa (2019-02-04):
# http://www.diariooficial.interior.gob.cl/publicaciones/2018/11/23/42212/01/1498738.pdf
-# From Paul Eggert (2019-09-01):
-# The above says the Magallanes exception expires 2022-04-02 at 24:00,
-# so in theory, they will revert to -04/-03 after that.
-# For now, assume that they will not revert,
-# since they have extended the expiration date once already.
+
+# From Juan Correa (2022-04-02):
+# I found there was a decree published last Thursday that will keep
+# Magallanes region to UTC -3 "indefinitely". The decree is available at
+# https://www.diariooficial.interior.gob.cl/publicaciones/2022/03/31/43217-B/01/2108910.pdf
+
+# From Juan Correa (2022-08-09):
+# the Internal Affairs Ministry (Ministerio del Interior) informed DST
+# for America/Santiago will start on midnight of September 11th;
+# and will end on April 1st, 2023. Magallanes region (America/Punta_Arenas)
+# will keep UTC -3 "indefinitely"... This is because on September 4th
+# we will have a voting whether to approve a new Constitution....
+# https://www.interior.gob.cl/noticias/2022/08/09/comunicado-el-proximo-sabado-10-de-septiembre-los-relojes-se-deben-adelantar-una-hora/
# Rule NAME FROM TO - IN ON AT SAVE LETTER/S
Rule Chile 1927 1931 - Sep 1 0:00 1:00 -
@@ -1344,7 +1371,9 @@
Rule Chile 2016 2018 - May Sun>=9 3:00u 0 -
Rule Chile 2016 2018 - Aug Sun>=9 4:00u 1:00 -
Rule Chile 2019 max - Apr Sun>=2 3:00u 0 -
-Rule Chile 2019 max - Sep Sun>=2 4:00u 1:00 -
+Rule Chile 2019 2021 - Sep Sun>=2 4:00u 1:00 -
+Rule Chile 2022 only - Sep Sun>=9 4:00u 1:00 -
+Rule Chile 2023 max - Sep Sun>=2 4:00u 1:00 -
# IATA SSIM anomalies: (1992-02) says 1992-03-14;
# (1996-09) says 1998-03-08. Ignore these.
# Zone NAME STDOFF RULES FORMAT [UNTIL]
@@ -1357,9 +1386,9 @@
-5:00 Chile -05/-04 1932 Sep 1
-4:00 - -04 1942 Jun 1
-5:00 - -05 1942 Aug 1
- -4:00 - -04 1946 Jul 15
- -4:00 1:00 -03 1946 Sep 1 # central Chile
- -4:00 - -04 1947 Apr 1
+ -4:00 - -04 1946 Jul 14 24:00
+ -4:00 1:00 -03 1946 Aug 28 24:00 # central CL
+ -5:00 1:00 -04 1947 Mar 31 24:00
-5:00 - -05 1947 May 21 23:00
-4:00 Chile -04/-03
Zone America/Punta_Arenas -4:43:40 - LMT 1890
@@ -1371,7 +1400,8 @@
-5:00 Chile -05/-04 1932 Sep 1
-4:00 - -04 1942 Jun 1
-5:00 - -05 1942 Aug 1
- -4:00 - -04 1947 Apr 1
+ -4:00 - -04 1946 Aug 28 24:00
+ -5:00 1:00 -04 1947 Mar 31 24:00
-5:00 - -05 1947 May 21 23:00
-4:00 Chile -04/-03 2016 Dec 4
-3:00 - -03
@@ -1405,13 +1435,14 @@
# Colombia
-# Milne gives 4:56:16.4 for Bogotá time in 1899; round to nearest. He writes,
+# Milne gives 4:56:16.4 for Bogotá time in 1899. He writes,
# "A variation of fifteen minutes in the public clocks of Bogota is not rare."
# Rule NAME FROM TO - IN ON AT SAVE LETTER/S
Rule CO 1992 only - May 3 0:00 1:00 -
Rule CO 1993 only - Apr 4 0:00 0 -
# Zone NAME STDOFF RULES FORMAT [UNTIL]
+ #STDOFF -4:56:16.4
Zone America/Bogota -4:56:16 - LMT 1884 Mar 13
-4:56:16 - BMT 1914 Nov 23 # Bogotá Mean Time
-5:00 CO -05/-04
diff -Nru openjdk-17-17.0.4+8/make/data/tzdata/VERSION openjdk-17-17.0.5+8/make/data/tzdata/VERSION
--- openjdk-17-17.0.4+8/make/data/tzdata/VERSION 2022-07-14 08:05:38.000000000 +0000
+++ openjdk-17-17.0.5+8/make/data/tzdata/VERSION 2022-10-10 13:07:22.000000000 +0000
@@ -21,4 +21,4 @@
# or visit www.oracle.com if you need additional information or have any
# questions.
#
-tzdata2022a
+tzdata2022c
diff -Nru openjdk-17-17.0.4+8/make/data/tzdata/zone.tab openjdk-17-17.0.5+8/make/data/tzdata/zone.tab
--- openjdk-17-17.0.4+8/make/data/tzdata/zone.tab 2022-07-14 08:05:38.000000000 +0000
+++ openjdk-17-17.0.5+8/make/data/tzdata/zone.tab 2022-10-10 13:07:22.000000000 +0000
@@ -153,7 +153,7 @@
CA +6227-11421 America/Yellowknife Mountain - NT (central)
CA +682059-1334300 America/Inuvik Mountain - NT (west)
CA +4906-11631 America/Creston MST - BC (Creston)
-CA +5946-12014 America/Dawson_Creek MST - BC (Dawson Cr, Ft St John)
+CA +5546-12014 America/Dawson_Creek MST - BC (Dawson Cr, Ft St John)
CA +5848-12242 America/Fort_Nelson MST - BC (Ft Nelson)
CA +6043-13503 America/Whitehorse MST - Yukon (east)
CA +6404-13925 America/Dawson MST - Yukon (west)
@@ -423,7 +423,7 @@
TV -0831+17913 Pacific/Funafuti
TW +2503+12130 Asia/Taipei
TZ -0648+03917 Africa/Dar_es_Salaam
-UA +5026+03031 Europe/Kiev Ukraine (most areas)
+UA +5026+03031 Europe/Kyiv Ukraine (most areas)
UA +4837+02218 Europe/Uzhgorod Transcarpathia
UA +4750+03510 Europe/Zaporozhye Zaporozhye and east Lugansk
UG +0019+03225 Africa/Kampala
diff -Nru openjdk-17-17.0.4+8/make/devkit/createWindowsDevkit2019.sh openjdk-17-17.0.5+8/make/devkit/createWindowsDevkit2019.sh
--- openjdk-17-17.0.4+8/make/devkit/createWindowsDevkit2019.sh 2022-07-14 08:05:38.000000000 +0000
+++ openjdk-17-17.0.5+8/make/devkit/createWindowsDevkit2019.sh 1970-01-01 00:00:00.000000000 +0000
@@ -1,227 +0,0 @@
-#!/bin/bash
-#
-# Copyright (c) 2019, 2020, Oracle and/or its affiliates. All rights reserved.
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# This code is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License version 2 only, as
-# published by the Free Software Foundation. Oracle designates this
-# particular file as subject to the "Classpath" exception as provided
-# by Oracle in the LICENSE file that accompanied this code.
-#
-# This code is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-# version 2 for more details (a copy is included in the LICENSE file that
-# accompanied this code).
-#
-# You should have received a copy of the GNU General Public License version
-# 2 along with this work; if not, write to the Free Software Foundation,
-# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-#
-# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
-# or visit www.oracle.com if you need additional information or have any
-# questions.
-#
-
-# This script copies parts of a Visual Studio installation into a devkit
-# suitable for building OpenJDK and OracleJDK. Needs to run in Cygwin or WSL.
-# erik.joelsson@oracle.com
-
-VS_VERSION="2019"
-VS_VERSION_NUM_NODOT="160"
-VS_DLL_VERSION="140"
-SDK_VERSION="10"
-SDK_FULL_VERSION="10.0.17763.0"
-MSVC_DIR="Microsoft.VC142.CRT"
-MSVC_FULL_VERSION="14.12.27508"
-REDIST_FULL_VERSION="14.20.27508"
-
-SCRIPT_DIR="$(cd "$(dirname $0)" > /dev/null && pwd)"
-BUILD_DIR="${SCRIPT_DIR}/../../build/devkit"
-
-################################################################################
-# Prepare settings
-
-UNAME_SYSTEM=`uname -s`
-UNAME_RELEASE=`uname -r`
-
-# Detect cygwin or WSL
-IS_CYGWIN=`echo $UNAME_SYSTEM | grep -i CYGWIN`
-IS_WSL=`echo $UNAME_RELEASE | grep Microsoft`
-if test "x$IS_CYGWIN" != "x"; then
- BUILD_ENV="cygwin"
-elif test "x$IS_WSL" != "x"; then
- BUILD_ENV="wsl"
-else
- echo "Unknown environment; only Cygwin and WSL are supported."
- exit 1
-fi
-
-if test "x$BUILD_ENV" = "xcygwin"; then
- WINDOWS_PATH_TO_UNIX_PATH="cygpath -u"
-elif test "x$BUILD_ENV" = "xwsl"; then
- WINDOWS_PATH_TO_UNIX_PATH="wslpath -u"
-fi
-
-# Work around the insanely named ProgramFiles(x86) env variable
-PROGRAMFILES_X86="$($WINDOWS_PATH_TO_UNIX_PATH "$(cmd.exe /c set | sed -n 's/^ProgramFiles(x86)=//p' | tr -d '\r')")"
-
-# Find Visual Studio installation dir
-VSNNNCOMNTOOLS=`cmd.exe /c echo %VS${VS_VERSION_NUM_NODOT}COMNTOOLS% | tr -d '\r'`
-if [ -d "$VSNNNCOMNTOOLS" ]; then
- VS_INSTALL_DIR="$($WINDOWS_PATH_TO_UNIX_PATH "$VSNNNCOMNTOOLS/../..")"
-else
- VS_INSTALL_DIR="${PROGRAMFILES_X86}/Microsoft Visual Studio/2019"
- VS_INSTALL_DIR="$(ls -d "${VS_INSTALL_DIR}/"{Community,Professional,Enterprise} 2>/dev/null | head -n1)"
-fi
-echo "VS_INSTALL_DIR: $VS_INSTALL_DIR"
-
-# Extract semantic version
-POTENTIAL_INI_FILES="Common7/IDE/wdexpress.isolation.ini Common7/IDE/devenv.isolation.ini"
-for f in $POTENTIAL_INI_FILES; do
- if [ -f "$VS_INSTALL_DIR/$f" ]; then
- VS_VERSION_SP="$(grep ^SemanticVersion= "$VS_INSTALL_DIR/$f")"
- # Remove SemnaticVersion=
- VS_VERSION_SP="${VS_VERSION_SP#*=}"
- # Remove suffix of too detailed numbering starting with +
- VS_VERSION_SP="${VS_VERSION_SP%+*}"
- break
- fi
-done
-if [ -z "$VS_VERSION_SP" ]; then
- echo "Failed to find SP version"
- exit 1
-fi
-echo "Found Version SP: $VS_VERSION_SP"
-
-# Setup output dirs
-DEVKIT_ROOT="${BUILD_DIR}/VS${VS_VERSION}-${VS_VERSION_SP}-devkit"
-DEVKIT_BUNDLE="${DEVKIT_ROOT}.tar.gz"
-
-echo "Creating devkit in $DEVKIT_ROOT"
-
-MSVCR_DLL=${MSVC_DIR}/vcruntime${VS_DLL_VERSION}.dll
-VCRUNTIME_1_DLL=${MSVC_DIR}/vcruntime${VS_DLL_VERSION}_1.dll
-MSVCP_DLL=${MSVC_DIR}/msvcp${VS_DLL_VERSION}.dll
-
-################################################################################
-# Copy Visual Studio files
-
-TOOLS_VERSION="$(ls "$VS_INSTALL_DIR/VC/Tools/MSVC" | sort -r -n | head -n1)"
-echo "Found Tools version: $TOOLS_VERSION"
-VC_SUBDIR="VC/Tools/MSVC/$TOOLS_VERSION"
-REDIST_VERSION="$(ls "$VS_INSTALL_DIR/VC/Redist/MSVC" | sort -r -n | head -n1)"
-echo "Found Redist version: $REDIST_VERSION"
-REDIST_SUBDIR="VC/Redist/MSVC/$REDIST_VERSION"
-echo "Copying VC..."
-rm -rf $DEVKIT_ROOT/VC
-mkdir -p $DEVKIT_ROOT/VC/bin
-cp -r "$VS_INSTALL_DIR/${VC_SUBDIR}/bin/Hostx64/arm64" $DEVKIT_ROOT/VC/bin/
-cp -r "$VS_INSTALL_DIR/${VC_SUBDIR}/bin/Hostx64/x64" $DEVKIT_ROOT/VC/bin/
-cp -r "$VS_INSTALL_DIR/${VC_SUBDIR}/bin/Hostx86/x86" $DEVKIT_ROOT/VC/bin/
-mkdir -p $DEVKIT_ROOT/VC/lib
-cp -r "$VS_INSTALL_DIR/${VC_SUBDIR}/lib/arm64" $DEVKIT_ROOT/VC/lib/
-cp -r "$VS_INSTALL_DIR/${VC_SUBDIR}/lib/x64" $DEVKIT_ROOT/VC/lib/
-cp -r "$VS_INSTALL_DIR/${VC_SUBDIR}/lib/x86" $DEVKIT_ROOT/VC/lib/
-cp -r "$VS_INSTALL_DIR/${VC_SUBDIR}/include" $DEVKIT_ROOT/VC/
-mkdir -p $DEVKIT_ROOT/VC/atlmfc/lib
-cp -r "$VS_INSTALL_DIR/${VC_SUBDIR}/atlmfc/lib/arm64" $DEVKIT_ROOT/VC/atlmfc/lib/
-cp -r "$VS_INSTALL_DIR/${VC_SUBDIR}/atlmfc/lib/x64" $DEVKIT_ROOT/VC/atlmfc/lib/
-cp -r "$VS_INSTALL_DIR/${VC_SUBDIR}/atlmfc/lib/x86" $DEVKIT_ROOT/VC/atlmfc/lib/
-cp -r "$VS_INSTALL_DIR/${VC_SUBDIR}/atlmfc/include" $DEVKIT_ROOT/VC/atlmfc/
-mkdir -p $DEVKIT_ROOT/VC/Auxiliary
-cp -r "$VS_INSTALL_DIR/VC/Auxiliary/Build" $DEVKIT_ROOT/VC/Auxiliary/
-mkdir -p $DEVKIT_ROOT/VC/redist
-cp -r "$VS_INSTALL_DIR/$REDIST_SUBDIR/arm64" $DEVKIT_ROOT/VC/redist/
-cp -r "$VS_INSTALL_DIR/$REDIST_SUBDIR/x64" $DEVKIT_ROOT/VC/redist/
-cp -r "$VS_INSTALL_DIR/$REDIST_SUBDIR/x86" $DEVKIT_ROOT/VC/redist/
-
-# The redist runtime libs are needed to run the compiler but may not be
-# installed on the machine where the devkit will be used.
-cp $DEVKIT_ROOT/VC/redist/x86/$MSVCR_DLL $DEVKIT_ROOT/VC/bin/x86
-cp $DEVKIT_ROOT/VC/redist/x86/$MSVCP_DLL $DEVKIT_ROOT/VC/bin/x86
-cp $DEVKIT_ROOT/VC/redist/x64/$MSVCR_DLL $DEVKIT_ROOT/VC/bin/x64
-cp $DEVKIT_ROOT/VC/redist/x64/$MSVCP_DLL $DEVKIT_ROOT/VC/bin/x64
-cp $DEVKIT_ROOT/VC/redist/arm64/$MSVCR_DLL $DEVKIT_ROOT/VC/bin/arm64
-cp $DEVKIT_ROOT/VC/redist/arm64/$MSVCP_DLL $DEVKIT_ROOT/VC/bin/arm64
-
-################################################################################
-# Copy SDK files
-
-SDK_INSTALL_DIR="$PROGRAMFILES_X86/Windows Kits/$SDK_VERSION"
-echo "SDK_INSTALL_DIR: $SDK_INSTALL_DIR"
-
-SDK_FULL_VERSION="$(ls "$SDK_INSTALL_DIR/bin" | sort -r -n | head -n1)"
-echo "Found SDK version: $SDK_FULL_VERSION"
-UCRT_VERSION="$(ls "$SDK_INSTALL_DIR/Redist" | grep $SDK_VERSION | sort -r -n | head -n1)"
-echo "Found UCRT version: $UCRT_VERSION"
-echo "Copying SDK..."
-rm -rf $DEVKIT_ROOT/$SDK_VERSION
-mkdir -p $DEVKIT_ROOT/$SDK_VERSION/bin
-cp -r "$SDK_INSTALL_DIR/bin/$SDK_FULL_VERSION/x64" $DEVKIT_ROOT/$SDK_VERSION/bin/
-cp -r "$SDK_INSTALL_DIR/bin/$SDK_FULL_VERSION/x86" $DEVKIT_ROOT/$SDK_VERSION/bin/
-mkdir -p $DEVKIT_ROOT/$SDK_VERSION/lib
-cp -r "$SDK_INSTALL_DIR/lib/$SDK_FULL_VERSION/um/arm64" $DEVKIT_ROOT/$SDK_VERSION/lib/
-cp -r "$SDK_INSTALL_DIR/lib/$SDK_FULL_VERSION/um/x64" $DEVKIT_ROOT/$SDK_VERSION/lib/
-cp -r "$SDK_INSTALL_DIR/lib/$SDK_FULL_VERSION/um/x86" $DEVKIT_ROOT/$SDK_VERSION/lib/
-cp -r "$SDK_INSTALL_DIR/lib/$SDK_FULL_VERSION/ucrt/arm64" $DEVKIT_ROOT/$SDK_VERSION/lib/
-cp -r "$SDK_INSTALL_DIR/lib/$SDK_FULL_VERSION/ucrt/x64" $DEVKIT_ROOT/$SDK_VERSION/lib/
-cp -r "$SDK_INSTALL_DIR/lib/$SDK_FULL_VERSION/ucrt/x86" $DEVKIT_ROOT/$SDK_VERSION/lib/
-mkdir -p $DEVKIT_ROOT/$SDK_VERSION/Redist
-cp -r "$SDK_INSTALL_DIR/Redist/$UCRT_VERSION/ucrt" $DEVKIT_ROOT/$SDK_VERSION/Redist/
-mkdir -p $DEVKIT_ROOT/$SDK_VERSION/include
-cp -r "$SDK_INSTALL_DIR/include/$SDK_FULL_VERSION/"* $DEVKIT_ROOT/$SDK_VERSION/include/
-
-################################################################################
-# Generate devkit.info
-
-echo-info() {
- echo "$1" >> $DEVKIT_ROOT/devkit.info
-}
-
-echo "Generating devkit.info..."
-rm -f $DEVKIT_ROOT/devkit.info
-echo-info "# This file describes to configure how to interpret the contents of this devkit"
-echo-info "DEVKIT_NAME=\"Microsoft Visual Studio $VS_VERSION $VS_VERSION_SP (devkit)\""
-echo-info "DEVKIT_VS_VERSION=\"$VS_VERSION\""
-echo-info ""
-echo-info "DEVKIT_TOOLCHAIN_PATH_x86=\"\$DEVKIT_ROOT/VC/bin/x86:\$DEVKIT_ROOT/$SDK_VERSION/bin/x86\""
-echo-info "DEVKIT_VS_INCLUDE_x86=\"\$DEVKIT_ROOT/VC/include;\$DEVKIT_ROOT/VC/atlmfc/include;\$DEVKIT_ROOT/$SDK_VERSION/include/shared;\$DEVKIT_ROOT/$SDK_VERSION/include/ucrt;\$DEVKIT_ROOT/$SDK_VERSION/include/um;\$DEVKIT_ROOT/$SDK_VERSION/include/winrt\""
-echo-info "DEVKIT_VS_LIB_x86=\"\$DEVKIT_ROOT/VC/lib/x86;\$DEVKIT_ROOT/VC/atlmfc/lib/x86;\$DEVKIT_ROOT/$SDK_VERSION/lib/x86\""
-echo-info "DEVKIT_MSVCR_DLL_x86=\"\$DEVKIT_ROOT/VC/redist/x86/$MSVCR_DLL\""
-echo-info "DEVKIT_MSVCP_DLL_x86=\"\$DEVKIT_ROOT/VC/redist/x86/$MSVCP_DLL\""
-echo-info "DEVKIT_UCRT_DLL_DIR_x86=\"\$DEVKIT_ROOT/10/Redist/ucrt/DLLs/x86\""
-echo-info ""
-echo-info "DEVKIT_TOOLCHAIN_PATH_x86_64=\"\$DEVKIT_ROOT/VC/bin/x64:\$DEVKIT_ROOT/$SDK_VERSION/bin/x64:\$DEVKIT_ROOT/$SDK_VERSION/bin/x86\""
-echo-info "DEVKIT_VS_INCLUDE_x86_64=\"\$DEVKIT_ROOT/VC/include;\$DEVKIT_ROOT/VC/atlmfc/include;\$DEVKIT_ROOT/$SDK_VERSION/include/shared;\$DEVKIT_ROOT/$SDK_VERSION/include/ucrt;\$DEVKIT_ROOT/$SDK_VERSION/include/um;\$DEVKIT_ROOT/$SDK_VERSION/include/winrt\""
-echo-info "DEVKIT_VS_LIB_x86_64=\"\$DEVKIT_ROOT/VC/lib/x64;\$DEVKIT_ROOT/VC/atlmfc/lib/x64;\$DEVKIT_ROOT/$SDK_VERSION/lib/x64\""
-echo-info "DEVKIT_MSVCR_DLL_x86_64=\"\$DEVKIT_ROOT/VC/redist/x64/$MSVCR_DLL\""
-echo-info "DEVKIT_VCRUNTIME_1_DLL_x86_64=\"\$DEVKIT_ROOT/VC/redist/x64/$VCRUNTIME_1_DLL\""
-echo-info "DEVKIT_MSVCP_DLL_x86_64=\"\$DEVKIT_ROOT/VC/redist/x64/$MSVCP_DLL\""
-echo-info "DEVKIT_UCRT_DLL_DIR_x86_64=\"\$DEVKIT_ROOT/10/Redist/ucrt/DLLs/x64\""
-echo-info ""
-echo-info "DEVKIT_TOOLCHAIN_PATH_aarch64=\"\$DEVKIT_ROOT/VC/bin/arm64:\$DEVKIT_ROOT/$SDK_VERSION/bin/x64:\$DEVKIT_ROOT/$SDK_VERSION/bin/x86\""
-echo-info "DEVKIT_VS_INCLUDE_aarch64=\"\$DEVKIT_ROOT/VC/include;\$DEVKIT_ROOT/VC/atlmfc/include;\$DEVKIT_ROOT/$SDK_VERSION/include/shared;\$DEVKIT_ROOT/$SDK_VERSION/include/ucrt;\$DEVKIT_ROOT/$SDK_VERSION/include/um;\$DEVKIT_ROOT/$SDK_VERSION/include/winrt\""
-echo-info "DEVKIT_VS_LIB_aarch64=\"\$DEVKIT_ROOT/VC/lib/arm64;\$DEVKIT_ROOT/VC/atlmfc/lib/arm64;\$DEVKIT_ROOT/$SDK_VERSION/lib/arm64\""
-echo-info "DEVKIT_MSVCR_DLL_aarch64=\"\$DEVKIT_ROOT/VC/redist/arm64/$MSVCR_DLL\""
-echo-info "DEVKIT_VCRUNTIME_1_DLL_aarch64=\"\$DEVKIT_ROOT/VC/redist/arm64/$VCRUNTIME_1_DLL\""
-echo-info "DEVKIT_MSVCP_DLL_aarch64=\"\$DEVKIT_ROOT/VC/redist/arm64/$MSVCP_DLL\""
-echo-info "DEVKIT_UCRT_DLL_DIR_aarch64=\"\$DEVKIT_ROOT/10/Redist/ucrt/DLLs/arm64\""
-echo-info ""
-echo-info "DEVKIT_TOOLS_VERSION=\"$TOOLS_VERSION\""
-echo-info "DEVKIT_REDIST_VERSION=\"$REDIST_VERSION\""
-echo-info "DEVKIT_SDK_VERSION=\"$SDK_FULL_VERSION\""
-echo-info "DEVKIT_UCRT_VERSION=\"$UCRT_VERSION\""
-
-################################################################################
-# Copy this script
-
-echo "Copying this script..."
-cp $0 $DEVKIT_ROOT/
-
-################################################################################
-# Create bundle
-
-echo "Creating bundle: $DEVKIT_BUNDLE"
-(cd "$DEVKIT_ROOT" && tar zcf "$DEVKIT_BUNDLE" .)
diff -Nru openjdk-17-17.0.4+8/make/devkit/createWindowsDevkit.sh openjdk-17-17.0.5+8/make/devkit/createWindowsDevkit.sh
--- openjdk-17-17.0.4+8/make/devkit/createWindowsDevkit.sh 1970-01-01 00:00:00.000000000 +0000
+++ openjdk-17-17.0.5+8/make/devkit/createWindowsDevkit.sh 2022-10-10 13:07:22.000000000 +0000
@@ -0,0 +1,252 @@
+#!/bin/bash
+#
+# Copyright (c) 2015, 2022, Oracle and/or its affiliates. All rights reserved.
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# This code is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License version 2 only, as
+# published by the Free Software Foundation. Oracle designates this
+# particular file as subject to the "Classpath" exception as provided
+# by Oracle in the LICENSE file that accompanied this code.
+#
+# This code is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+# version 2 for more details (a copy is included in the LICENSE file that
+# accompanied this code).
+#
+# You should have received a copy of the GNU General Public License version
+# 2 along with this work; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+# or visit www.oracle.com if you need additional information or have any
+# questions.
+#
+
+# This script copies parts of a Visual Studio installation into a devkit
+# suitable for building OpenJDK and OracleJDK. Needs to run in Cygwin or WSL.
+# erik.joelsson@oracle.com
+
+usage_and_exit() {
+ echo "Usage: createWindowsDevkit.sh <2019 | 2022>"
+ exit 1
+}
+
+if [ ! $# = 1 ]; then
+ usage_and_exit
+fi
+
+VS_VERSION="$1"
+
+VS_DLL_VERSION="140"
+SDK_VERSION="10"
+
+SCRIPT_DIR="$(cd "$(dirname $0)" > /dev/null && pwd)"
+BUILD_DIR="${SCRIPT_DIR}/../../build/devkit"
+
+################################################################################
+# Prepare settings
+
+UNAME_SYSTEM=`uname -s`
+UNAME_RELEASE=`uname -r`
+
+# Detect cygwin or WSL
+IS_CYGWIN=`echo $UNAME_SYSTEM | grep -i CYGWIN`
+IS_WSL=`echo $UNAME_RELEASE | grep Microsoft`
+if test "x$IS_CYGWIN" != "x"; then
+ BUILD_ENV="cygwin"
+elif test "x$IS_WSL" != "x"; then
+ BUILD_ENV="wsl"
+else
+ echo "Unknown environment; only Cygwin and WSL are supported."
+ exit 1
+fi
+
+if test "x$BUILD_ENV" = "xcygwin"; then
+ WINDOWS_PATH_TO_UNIX_PATH="cygpath -u"
+elif test "x$BUILD_ENV" = "xwsl"; then
+ WINDOWS_PATH_TO_UNIX_PATH="wslpath -u"
+fi
+
+# Work around the insanely named ProgramFiles(x86) env variable
+PROGRAMFILES_X86="$($WINDOWS_PATH_TO_UNIX_PATH "$(cmd.exe /c set | sed -n 's/^ProgramFiles(x86)=//p' | tr -d '\r')")"
+PROGRAMFILES="$($WINDOWS_PATH_TO_UNIX_PATH "$PROGRAMFILES")"
+
+case $VS_VERSION in
+ 2019)
+ MSVC_PROGRAMFILES_DIR="${PROGRAMFILES_X86}"
+ MSVC_CRT_DIR="Microsoft.VC142.CRT"
+ VS_VERSION_NUM_NODOT="160"
+ ;;
+
+ 2022)
+ MSVC_PROGRAMFILES_DIR="${PROGRAMFILES}"
+ MSVC_CRT_DIR="Microsoft.VC143.CRT"
+ VS_VERSION_NUM_NODOT="170"
+ ;;
+ *)
+ echo "Unexpected VS version: $VS_VERSION"
+ usage_and_exit
+ ;;
+esac
+
+
+# Find Visual Studio installation dir
+VSNNNCOMNTOOLS=`cmd.exe /c echo %VS${VS_VERSION_NUM_NODOT}COMNTOOLS% | tr -d '\r'`
+if [ -d "$VSNNNCOMNTOOLS" ]; then
+ VS_INSTALL_DIR="$($WINDOWS_PATH_TO_UNIX_PATH "$VSNNNCOMNTOOLS/../..")"
+else
+ VS_INSTALL_DIR="${MSVC_PROGRAMFILES_DIR}/Microsoft Visual Studio/$VS_VERSION"
+ VS_INSTALL_DIR="$(ls -d "${VS_INSTALL_DIR}/"{Community,Professional,Enterprise} 2>/dev/null | head -n1)"
+fi
+echo "VS_INSTALL_DIR: $VS_INSTALL_DIR"
+
+# Extract semantic version
+POTENTIAL_INI_FILES="Common7/IDE/wdexpress.isolation.ini Common7/IDE/devenv.isolation.ini"
+for f in $POTENTIAL_INI_FILES; do
+ if [ -f "$VS_INSTALL_DIR/$f" ]; then
+ VS_VERSION_SP="$(grep ^SemanticVersion= "$VS_INSTALL_DIR/$f")"
+ # Remove SemnaticVersion=
+ VS_VERSION_SP="${VS_VERSION_SP#*=}"
+ # Remove suffix of too detailed numbering starting with +
+ VS_VERSION_SP="${VS_VERSION_SP%+*}"
+ break
+ fi
+done
+if [ -z "$VS_VERSION_SP" ]; then
+ echo "Failed to find SP version"
+ exit 1
+fi
+echo "Found Version SP: $VS_VERSION_SP"
+
+# Setup output dirs
+DEVKIT_ROOT="${BUILD_DIR}/VS${VS_VERSION}-${VS_VERSION_SP}-devkit"
+DEVKIT_BUNDLE="${DEVKIT_ROOT}.tar.gz"
+
+echo "Creating devkit in $DEVKIT_ROOT"
+
+MSVCR_DLL=${MSVC_CRT_DIR}/vcruntime${VS_DLL_VERSION}.dll
+VCRUNTIME_1_DLL=${MSVC_CRT_DIR}/vcruntime${VS_DLL_VERSION}_1.dll
+MSVCP_DLL=${MSVC_CRT_DIR}/msvcp${VS_DLL_VERSION}.dll
+
+################################################################################
+# Copy Visual Studio files
+
+TOOLS_VERSION="$(ls "$VS_INSTALL_DIR/VC/Tools/MSVC" | sort -r -n | head -n1)"
+echo "Found Tools version: $TOOLS_VERSION"
+VC_SUBDIR="VC/Tools/MSVC/$TOOLS_VERSION"
+REDIST_VERSION="$(ls "$VS_INSTALL_DIR/VC/Redist/MSVC" | sort -r -n | head -n1)"
+echo "Found Redist version: $REDIST_VERSION"
+REDIST_SUBDIR="VC/Redist/MSVC/$REDIST_VERSION"
+echo "Copying VC..."
+rm -rf $DEVKIT_ROOT/VC
+mkdir -p $DEVKIT_ROOT/VC/bin
+cp -r "$VS_INSTALL_DIR/${VC_SUBDIR}/bin/Hostx64/arm64" $DEVKIT_ROOT/VC/bin/
+cp -r "$VS_INSTALL_DIR/${VC_SUBDIR}/bin/Hostx64/x64" $DEVKIT_ROOT/VC/bin/
+cp -r "$VS_INSTALL_DIR/${VC_SUBDIR}/bin/Hostx86/x86" $DEVKIT_ROOT/VC/bin/
+mkdir -p $DEVKIT_ROOT/VC/lib
+cp -r "$VS_INSTALL_DIR/${VC_SUBDIR}/lib/arm64" $DEVKIT_ROOT/VC/lib/
+cp -r "$VS_INSTALL_DIR/${VC_SUBDIR}/lib/x64" $DEVKIT_ROOT/VC/lib/
+cp -r "$VS_INSTALL_DIR/${VC_SUBDIR}/lib/x86" $DEVKIT_ROOT/VC/lib/
+cp -r "$VS_INSTALL_DIR/${VC_SUBDIR}/include" $DEVKIT_ROOT/VC/
+mkdir -p $DEVKIT_ROOT/VC/atlmfc/lib
+cp -r "$VS_INSTALL_DIR/${VC_SUBDIR}/atlmfc/lib/arm64" $DEVKIT_ROOT/VC/atlmfc/lib/
+cp -r "$VS_INSTALL_DIR/${VC_SUBDIR}/atlmfc/lib/x64" $DEVKIT_ROOT/VC/atlmfc/lib/
+cp -r "$VS_INSTALL_DIR/${VC_SUBDIR}/atlmfc/lib/x86" $DEVKIT_ROOT/VC/atlmfc/lib/
+cp -r "$VS_INSTALL_DIR/${VC_SUBDIR}/atlmfc/include" $DEVKIT_ROOT/VC/atlmfc/
+mkdir -p $DEVKIT_ROOT/VC/Auxiliary
+cp -r "$VS_INSTALL_DIR/VC/Auxiliary/Build" $DEVKIT_ROOT/VC/Auxiliary/
+mkdir -p $DEVKIT_ROOT/VC/redist
+cp -r "$VS_INSTALL_DIR/$REDIST_SUBDIR/arm64" $DEVKIT_ROOT/VC/redist/
+cp -r "$VS_INSTALL_DIR/$REDIST_SUBDIR/x64" $DEVKIT_ROOT/VC/redist/
+cp -r "$VS_INSTALL_DIR/$REDIST_SUBDIR/x86" $DEVKIT_ROOT/VC/redist/
+
+# The redist runtime libs are needed to run the compiler but may not be
+# installed on the machine where the devkit will be used.
+cp $DEVKIT_ROOT/VC/redist/x86/$MSVCR_DLL $DEVKIT_ROOT/VC/bin/x86
+cp $DEVKIT_ROOT/VC/redist/x86/$MSVCP_DLL $DEVKIT_ROOT/VC/bin/x86
+cp $DEVKIT_ROOT/VC/redist/x64/$MSVCR_DLL $DEVKIT_ROOT/VC/bin/x64
+cp $DEVKIT_ROOT/VC/redist/x64/$MSVCP_DLL $DEVKIT_ROOT/VC/bin/x64
+cp $DEVKIT_ROOT/VC/redist/arm64/$MSVCR_DLL $DEVKIT_ROOT/VC/bin/arm64
+cp $DEVKIT_ROOT/VC/redist/arm64/$MSVCP_DLL $DEVKIT_ROOT/VC/bin/arm64
+
+################################################################################
+# Copy SDK files
+
+SDK_INSTALL_DIR="$PROGRAMFILES_X86/Windows Kits/$SDK_VERSION"
+echo "SDK_INSTALL_DIR: $SDK_INSTALL_DIR"
+
+SDK_FULL_VERSION="$(ls "$SDK_INSTALL_DIR/bin" | sort -r -n | head -n1)"
+echo "Found SDK version: $SDK_FULL_VERSION"
+UCRT_VERSION="$(ls "$SDK_INSTALL_DIR/Redist" | grep $SDK_VERSION | sort -r -n | head -n1)"
+echo "Found UCRT version: $UCRT_VERSION"
+echo "Copying SDK..."
+rm -rf $DEVKIT_ROOT/$SDK_VERSION
+mkdir -p $DEVKIT_ROOT/$SDK_VERSION/bin
+cp -r "$SDK_INSTALL_DIR/bin/$SDK_FULL_VERSION/x64" $DEVKIT_ROOT/$SDK_VERSION/bin/
+cp -r "$SDK_INSTALL_DIR/bin/$SDK_FULL_VERSION/x86" $DEVKIT_ROOT/$SDK_VERSION/bin/
+mkdir -p $DEVKIT_ROOT/$SDK_VERSION/lib
+cp -r "$SDK_INSTALL_DIR/lib/$SDK_FULL_VERSION/um/arm64" $DEVKIT_ROOT/$SDK_VERSION/lib/
+cp -r "$SDK_INSTALL_DIR/lib/$SDK_FULL_VERSION/um/x64" $DEVKIT_ROOT/$SDK_VERSION/lib/
+cp -r "$SDK_INSTALL_DIR/lib/$SDK_FULL_VERSION/um/x86" $DEVKIT_ROOT/$SDK_VERSION/lib/
+cp -r "$SDK_INSTALL_DIR/lib/$SDK_FULL_VERSION/ucrt/arm64" $DEVKIT_ROOT/$SDK_VERSION/lib/
+cp -r "$SDK_INSTALL_DIR/lib/$SDK_FULL_VERSION/ucrt/x64" $DEVKIT_ROOT/$SDK_VERSION/lib/
+cp -r "$SDK_INSTALL_DIR/lib/$SDK_FULL_VERSION/ucrt/x86" $DEVKIT_ROOT/$SDK_VERSION/lib/
+mkdir -p $DEVKIT_ROOT/$SDK_VERSION/Redist
+cp -r "$SDK_INSTALL_DIR/Redist/$UCRT_VERSION/ucrt" $DEVKIT_ROOT/$SDK_VERSION/Redist/
+mkdir -p $DEVKIT_ROOT/$SDK_VERSION/include
+cp -r "$SDK_INSTALL_DIR/include/$SDK_FULL_VERSION/"* $DEVKIT_ROOT/$SDK_VERSION/include/
+
+################################################################################
+# Generate devkit.info
+
+echo-info() {
+ echo "$1" >> $DEVKIT_ROOT/devkit.info
+}
+
+echo "Generating devkit.info..."
+rm -f $DEVKIT_ROOT/devkit.info
+echo-info "# This file describes to configure how to interpret the contents of this devkit"
+echo-info "DEVKIT_NAME=\"Microsoft Visual Studio $VS_VERSION $VS_VERSION_SP (devkit)\""
+echo-info "DEVKIT_VS_VERSION=\"$VS_VERSION\""
+echo-info ""
+echo-info "DEVKIT_TOOLCHAIN_PATH_x86=\"\$DEVKIT_ROOT/VC/bin/x86:\$DEVKIT_ROOT/$SDK_VERSION/bin/x86\""
+echo-info "DEVKIT_VS_INCLUDE_x86=\"\$DEVKIT_ROOT/VC/include;\$DEVKIT_ROOT/VC/atlmfc/include;\$DEVKIT_ROOT/$SDK_VERSION/include/shared;\$DEVKIT_ROOT/$SDK_VERSION/include/ucrt;\$DEVKIT_ROOT/$SDK_VERSION/include/um;\$DEVKIT_ROOT/$SDK_VERSION/include/winrt\""
+echo-info "DEVKIT_VS_LIB_x86=\"\$DEVKIT_ROOT/VC/lib/x86;\$DEVKIT_ROOT/VC/atlmfc/lib/x86;\$DEVKIT_ROOT/$SDK_VERSION/lib/x86\""
+echo-info "DEVKIT_MSVCR_DLL_x86=\"\$DEVKIT_ROOT/VC/redist/x86/$MSVCR_DLL\""
+echo-info "DEVKIT_MSVCP_DLL_x86=\"\$DEVKIT_ROOT/VC/redist/x86/$MSVCP_DLL\""
+echo-info "DEVKIT_UCRT_DLL_DIR_x86=\"\$DEVKIT_ROOT/10/Redist/ucrt/DLLs/x86\""
+echo-info ""
+echo-info "DEVKIT_TOOLCHAIN_PATH_x86_64=\"\$DEVKIT_ROOT/VC/bin/x64:\$DEVKIT_ROOT/$SDK_VERSION/bin/x64:\$DEVKIT_ROOT/$SDK_VERSION/bin/x86\""
+echo-info "DEVKIT_VS_INCLUDE_x86_64=\"\$DEVKIT_ROOT/VC/include;\$DEVKIT_ROOT/VC/atlmfc/include;\$DEVKIT_ROOT/$SDK_VERSION/include/shared;\$DEVKIT_ROOT/$SDK_VERSION/include/ucrt;\$DEVKIT_ROOT/$SDK_VERSION/include/um;\$DEVKIT_ROOT/$SDK_VERSION/include/winrt\""
+echo-info "DEVKIT_VS_LIB_x86_64=\"\$DEVKIT_ROOT/VC/lib/x64;\$DEVKIT_ROOT/VC/atlmfc/lib/x64;\$DEVKIT_ROOT/$SDK_VERSION/lib/x64\""
+echo-info "DEVKIT_MSVCR_DLL_x86_64=\"\$DEVKIT_ROOT/VC/redist/x64/$MSVCR_DLL\""
+echo-info "DEVKIT_VCRUNTIME_1_DLL_x86_64=\"\$DEVKIT_ROOT/VC/redist/x64/$VCRUNTIME_1_DLL\""
+echo-info "DEVKIT_MSVCP_DLL_x86_64=\"\$DEVKIT_ROOT/VC/redist/x64/$MSVCP_DLL\""
+echo-info "DEVKIT_UCRT_DLL_DIR_x86_64=\"\$DEVKIT_ROOT/10/Redist/ucrt/DLLs/x64\""
+echo-info ""
+echo-info "DEVKIT_TOOLCHAIN_PATH_aarch64=\"\$DEVKIT_ROOT/VC/bin/arm64:\$DEVKIT_ROOT/$SDK_VERSION/bin/x64:\$DEVKIT_ROOT/$SDK_VERSION/bin/x86\""
+echo-info "DEVKIT_VS_INCLUDE_aarch64=\"\$DEVKIT_ROOT/VC/include;\$DEVKIT_ROOT/VC/atlmfc/include;\$DEVKIT_ROOT/$SDK_VERSION/include/shared;\$DEVKIT_ROOT/$SDK_VERSION/include/ucrt;\$DEVKIT_ROOT/$SDK_VERSION/include/um;\$DEVKIT_ROOT/$SDK_VERSION/include/winrt\""
+echo-info "DEVKIT_VS_LIB_aarch64=\"\$DEVKIT_ROOT/VC/lib/arm64;\$DEVKIT_ROOT/VC/atlmfc/lib/arm64;\$DEVKIT_ROOT/$SDK_VERSION/lib/arm64\""
+echo-info "DEVKIT_MSVCR_DLL_aarch64=\"\$DEVKIT_ROOT/VC/redist/arm64/$MSVCR_DLL\""
+echo-info "DEVKIT_VCRUNTIME_1_DLL_aarch64=\"\$DEVKIT_ROOT/VC/redist/arm64/$VCRUNTIME_1_DLL\""
+echo-info "DEVKIT_MSVCP_DLL_aarch64=\"\$DEVKIT_ROOT/VC/redist/arm64/$MSVCP_DLL\""
+echo-info "DEVKIT_UCRT_DLL_DIR_aarch64=\"\$DEVKIT_ROOT/10/Redist/ucrt/DLLs/arm64\""
+echo-info ""
+echo-info "DEVKIT_TOOLS_VERSION=\"$TOOLS_VERSION\""
+echo-info "DEVKIT_REDIST_VERSION=\"$REDIST_VERSION\""
+echo-info "DEVKIT_SDK_VERSION=\"$SDK_FULL_VERSION\""
+echo-info "DEVKIT_UCRT_VERSION=\"$UCRT_VERSION\""
+
+################################################################################
+# Copy this script
+
+echo "Copying this script..."
+cp $0 $DEVKIT_ROOT/
+
+################################################################################
+# Create bundle
+
+echo "Creating bundle: $DEVKIT_BUNDLE"
+(cd "$DEVKIT_ROOT" && tar zcf "$DEVKIT_BUNDLE" .)
diff -Nru openjdk-17-17.0.4+8/make/modules/java.base/lib/CoreLibraries.gmk openjdk-17-17.0.5+8/make/modules/java.base/lib/CoreLibraries.gmk
--- openjdk-17-17.0.4+8/make/modules/java.base/lib/CoreLibraries.gmk 2022-07-14 08:05:38.000000000 +0000
+++ openjdk-17-17.0.5+8/make/modules/java.base/lib/CoreLibraries.gmk 2022-10-10 13:07:22.000000000 +0000
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2011, 2020, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2011, 2022, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
@@ -135,6 +135,7 @@
$(LIBZ_CFLAGS), \
CFLAGS_unix := $(BUILD_LIBZIP_MMAP) -UDEBUG, \
DISABLED_WARNINGS_gcc := unused-function implicit-fallthrough, \
+ DISABLED_WARNINGS_clang := format-nonliteral, \
LDFLAGS := $(LDFLAGS_JDKLIB) \
$(call SET_SHARED_LIBRARY_ORIGIN), \
LIBS_unix := -ljvm -ljava $(LIBZ_LIBS), \
diff -Nru openjdk-17-17.0.4+8/make/modules/java.desktop/lib/Awt2dLibraries.gmk openjdk-17-17.0.5+8/make/modules/java.desktop/lib/Awt2dLibraries.gmk
--- openjdk-17-17.0.4+8/make/modules/java.desktop/lib/Awt2dLibraries.gmk 2022-07-14 08:05:38.000000000 +0000
+++ openjdk-17-17.0.5+8/make/modules/java.desktop/lib/Awt2dLibraries.gmk 2022-10-10 13:07:22.000000000 +0000
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2011, 2021, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2011, 2022, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
@@ -368,6 +368,7 @@
common/awt/debug \
common/font \
common/java2d/opengl \
+ include \
#
LIBAWT_HEADLESS_CFLAGS := $(CUPS_CFLAGS) $(FONTCONFIG_CFLAGS) $(X_CFLAGS) \
@@ -477,6 +478,7 @@
libawt/java2d \
libawt/java2d/pipe \
libawt/java2d/loops \
+ include \
#
LIBFONTMANAGER_CFLAGS += $(LIBFREETYPE_CFLAGS)
@@ -656,6 +658,8 @@
common/awt/systemscale \
#
+ LIBSPLASHSCREEN_HEADER_DIRS += include
+
ifeq ($(USE_EXTERNAL_LIBGIF), false)
LIBSPLASHSCREEN_HEADER_DIRS += libsplashscreen/giflib
else
@@ -680,6 +684,7 @@
ifeq ($(USE_EXTERNAL_LIBZ), false)
LIBSPLASHSCREEN_EXTRA_SRC += java.base:libzip/zlib
+ LIBZ_DISABLED_WARNINGS_CLANG := format-nonliteral
endif
ifeq ($(call isTargetOs, macosx), true)
@@ -749,7 +754,7 @@
maybe-uninitialized shift-negative-value implicit-fallthrough \
unused-function, \
DISABLED_WARNINGS_clang := incompatible-pointer-types sign-compare \
- deprecated-declarations, \
+ deprecated-declarations null-pointer-subtraction $(LIBZ_DISABLED_WARNINGS_CLANG), \
DISABLED_WARNINGS_microsoft := 4018 4244 4267, \
LDFLAGS := $(LDFLAGS_JDKLIB) \
$(call SET_SHARED_LIBRARY_ORIGIN), \
diff -Nru openjdk-17-17.0.4+8/make/modules/jdk.jpackage/Lib.gmk openjdk-17-17.0.5+8/make/modules/jdk.jpackage/Lib.gmk
--- openjdk-17-17.0.4+8/make/modules/jdk.jpackage/Lib.gmk 2022-07-14 08:05:38.000000000 +0000
+++ openjdk-17-17.0.5+8/make/modules/jdk.jpackage/Lib.gmk 2022-10-10 13:07:22.000000000 +0000
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2018, 2020, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2018, 2022, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
@@ -24,6 +24,7 @@
#
include LibCommon.gmk
+include LauncherCommon.gmk
################################################################################
@@ -75,6 +76,8 @@
LIBS_macosx := $(LIBCXX) -framework Cocoa, \
LIBS_windows := $(LIBCXX), \
LIBS_linux := -ldl, \
+ MANIFEST := $(JAVA_MANIFEST), \
+ MANIFEST_VERSION := $(VERSION_NUMBER_FOUR_POSITIONS) \
))
JPACKAGE_TARGETS += $(BUILD_JPACKAGE_APPLAUNCHEREXE)
@@ -92,9 +95,9 @@
JPACKAGE_LIBAPPLAUNCHER_INCLUDES := $(addprefix -I, $(JPACKAGE_LIBAPPLAUNCHER_SRC))
$(eval $(call SetupJdkLibrary, BUILD_JPACKAGE_LIBAPPLAUNCHER, \
- NAME := jpackageapplauncher, \
+ NAME := jpackageapplauncheraux, \
OUTPUT_DIR := $(JPACKAGE_OUTPUT_DIR), \
- SYMBOLS_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libjpackageapplauncher, \
+ SYMBOLS_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libjpackageapplauncheraux, \
SRC := $(JPACKAGE_LIBAPPLAUNCHER_SRC), \
EXCLUDE_FILES := LinuxLauncher.c LinuxPackage.c, \
TOOLCHAIN := TOOLCHAIN_LINK_CXX, \
@@ -175,6 +178,8 @@
LDFLAGS := $(BUILD_JPACKAGE_APPLAUNCHEREXE_LDFLAGS), \
LIBS := $(BUILD_JPACKAGE_APPLAUNCHEREXE_LIBS), \
LIBS_windows := $(BUILD_JPACKAGE_APPLAUNCHEREXE_LIBS_windows), \
+ MANIFEST := $(JAVA_MANIFEST), \
+ MANIFEST_VERSION := $(VERSION_NUMBER_FOUR_POSITIONS) \
))
JPACKAGE_TARGETS += $(BUILD_JPACKAGE_APPLAUNCHERWEXE)
diff -Nru openjdk-17-17.0.4+8/make/scripts/fixpath.sh openjdk-17-17.0.5+8/make/scripts/fixpath.sh
--- openjdk-17-17.0.4+8/make/scripts/fixpath.sh 2022-07-14 08:05:38.000000000 +0000
+++ openjdk-17-17.0.5+8/make/scripts/fixpath.sh 2022-10-10 13:07:22.000000000 +0000
@@ -1,6 +1,6 @@
#!/bin/bash
#
-# Copyright (c) 2020, 2021, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2020, 2022, Oracle and/or its affiliates. All rights reserved.
# 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,14 @@
# available, or extract values automatically from the environment if missing.
# This is robust, but slower.
function setup() {
+
+ # Make regexp tests case insensitive
+ shopt -s nocasematch
+ # Prohibit msys2 from meddling with paths
+ export MSYS2_ARG_CONV_EXCL="*"
+ # Make sure WSL gets a copy of the path
+ export WSLENV=PATH/l
+
while getopts "e:p:r:t:c:qmi" opt; do
case "$opt" in
e) PATHTOOL="$OPTARG" ;;
@@ -87,13 +95,6 @@
wintemp_win="$($CMD /q /c echo %TEMP% 2>/dev/null | tr -d \\n\\r)"
WINTEMP="$($PATHTOOL -u "$wintemp_win")"
fi
-
- # Make regexp tests case insensitive
- shopt -s nocasematch
- # Prohibit msys2 from meddling with paths
- export MSYS2_ARG_CONV_EXCL="*"
- # Make sure WSL gets a copy of the path
- export WSLENV=PATH/l
}
# Cleanup handling
@@ -299,6 +300,19 @@
if [[ $arg =~ ^([^/]*|-[^:=]*[:=]|.*file://|/[a-zA-Z:]{1,3}:?)($DRIVEPREFIX/)([a-z])(/[^/]+.*$) ]] ; then
prefix="${BASH_REMATCH[1]}"
winpath="${BASH_REMATCH[3]}:${BASH_REMATCH[4]}"
+
+ # If the thing in its entirety points to an existing path, use that instead of thinking
+ # we have a prefix. This can only happen if the top-level directory has a single-letter name.
+ if [[ ${#prefix} -eq 2 && "${prefix:0:1}" == "/" ]]; then
+ possiblepath="${BASH_REMATCH[1]}/${BASH_REMATCH[3]}${BASH_REMATCH[4]}"
+ if [[ -e "$possiblepath" || -e "$(dirname $possiblepath)" || -e "$(echo $possiblepath | cut -d / -f 1-5)" ]] ; then
+ prefix=
+ drivepart="${possiblepath:1:1}"
+ pathpart="${possiblepath:2}"
+ winpath="$drivepart:$pathpart"
+ fi
+ fi
+
# Change slash to backslash (or vice versa if mixed mode)
if [[ $MIXEDMODE != true ]]; then
winpath="${winpath//'/'/'\'}"
diff -Nru openjdk-17-17.0.4+8/src/hotspot/cpu/aarch64/aarch64.ad openjdk-17-17.0.5+8/src/hotspot/cpu/aarch64/aarch64.ad
--- openjdk-17-17.0.4+8/src/hotspot/cpu/aarch64/aarch64.ad 2022-07-14 08:05:38.000000000 +0000
+++ openjdk-17-17.0.5+8/src/hotspot/cpu/aarch64/aarch64.ad 2022-10-10 13:07:22.000000000 +0000
@@ -15060,10 +15060,10 @@
%{
match(Set cr (OverflowAddL op1 op2));
- format %{ "cmn $op1, $op2\t# overflow check long" %}
+ format %{ "adds zr, $op1, $op2\t# overflow check long" %}
ins_cost(INSN_COST);
ins_encode %{
- __ cmn($op1$$Register, $op2$$constant);
+ __ adds(zr, $op1$$Register, $op2$$constant);
%}
ins_pipe(icmp_reg_imm);
diff -Nru openjdk-17-17.0.4+8/src/hotspot/cpu/aarch64/frame_aarch64.cpp openjdk-17-17.0.5+8/src/hotspot/cpu/aarch64/frame_aarch64.cpp
--- openjdk-17-17.0.4+8/src/hotspot/cpu/aarch64/frame_aarch64.cpp 2022-07-14 08:05:38.000000000 +0000
+++ openjdk-17-17.0.5+8/src/hotspot/cpu/aarch64/frame_aarch64.cpp 2022-10-10 13:07:22.000000000 +0000
@@ -350,13 +350,9 @@
assert(jfa->last_Java_sp() > sp(), "must be above this frame on stack");
// Since we are walking the stack now this nested anchor is obviously walkable
// even if it wasn't when it was stacked.
- if (!jfa->walkable()) {
- // Capture _last_Java_pc (if needed) and mark anchor walkable.
- jfa->capture_last_Java_pc();
- }
+ jfa->make_walkable();
map->clear();
assert(map->include_argument_oops(), "should be set by clear");
- vmassert(jfa->last_Java_pc() != NULL, "not walkable");
frame fr(jfa->last_Java_sp(), jfa->last_Java_fp(), jfa->last_Java_pc());
return fr;
@@ -817,20 +813,14 @@
void frame::pd_ps() {}
#endif
-void JavaFrameAnchor::make_walkable(JavaThread* thread) {
+void JavaFrameAnchor::make_walkable() {
// last frame set?
if (last_Java_sp() == NULL) return;
// already walkable?
if (walkable()) return;
- vmassert(Thread::current() == (Thread*)thread, "not current thread");
vmassert(last_Java_sp() != NULL, "not called from Java code?");
vmassert(last_Java_pc() == NULL, "already walkable");
- capture_last_Java_pc();
+ _last_Java_pc = (address)_last_Java_sp[-1];
vmassert(walkable(), "something went wrong");
}
-void JavaFrameAnchor::capture_last_Java_pc() {
- vmassert(_last_Java_sp != NULL, "no last frame set");
- vmassert(_last_Java_pc == NULL, "already walkable");
- _last_Java_pc = (address)_last_Java_sp[-1];
-}
diff -Nru openjdk-17-17.0.4+8/src/hotspot/cpu/aarch64/frame_aarch64.inline.hpp openjdk-17-17.0.5+8/src/hotspot/cpu/aarch64/frame_aarch64.inline.hpp
--- openjdk-17-17.0.4+8/src/hotspot/cpu/aarch64/frame_aarch64.inline.hpp 2022-07-14 08:05:38.000000000 +0000
+++ openjdk-17-17.0.5+8/src/hotspot/cpu/aarch64/frame_aarch64.inline.hpp 2022-10-10 13:07:22.000000000 +0000
@@ -144,10 +144,12 @@
inline bool frame::is_older(intptr_t* id) const { assert(this->id() != NULL && id != NULL, "NULL frame id");
return this->id() > id ; }
-
-
inline intptr_t* frame::link() const { return (intptr_t*) *(intptr_t **)addr_at(link_offset); }
+inline intptr_t* frame::link_or_null() const {
+ intptr_t** ptr = (intptr_t **)addr_at(link_offset);
+ return os::is_readable_pointer(ptr) ? *ptr : NULL;
+}
inline intptr_t* frame::unextended_sp() const { return _unextended_sp; }
diff -Nru openjdk-17-17.0.4+8/src/hotspot/cpu/aarch64/javaFrameAnchor_aarch64.hpp openjdk-17-17.0.5+8/src/hotspot/cpu/aarch64/javaFrameAnchor_aarch64.hpp
--- openjdk-17-17.0.4+8/src/hotspot/cpu/aarch64/javaFrameAnchor_aarch64.hpp 2022-07-14 08:05:38.000000000 +0000
+++ openjdk-17-17.0.5+8/src/hotspot/cpu/aarch64/javaFrameAnchor_aarch64.hpp 2022-10-10 13:07:22.000000000 +0000
@@ -65,8 +65,8 @@
}
bool walkable(void) { return _last_Java_sp != NULL && _last_Java_pc != NULL; }
- void make_walkable(JavaThread* thread);
- void capture_last_Java_pc(void);
+
+ void make_walkable();
intptr_t* last_Java_sp(void) const { return _last_Java_sp; }
diff -Nru openjdk-17-17.0.4+8/src/hotspot/cpu/aarch64/macroAssembler_aarch64.cpp openjdk-17-17.0.5+8/src/hotspot/cpu/aarch64/macroAssembler_aarch64.cpp
--- openjdk-17-17.0.4+8/src/hotspot/cpu/aarch64/macroAssembler_aarch64.cpp 2022-07-14 08:05:38.000000000 +0000
+++ openjdk-17-17.0.5+8/src/hotspot/cpu/aarch64/macroAssembler_aarch64.cpp 2022-10-10 13:07:22.000000000 +0000
@@ -721,8 +721,23 @@
|| entry.rspec().type() == relocInfo::static_call_type
|| entry.rspec().type() == relocInfo::virtual_call_type, "wrong reloc type");
+ bool need_trampoline = far_branches();
+ if (!need_trampoline && entry.rspec().type() == relocInfo::runtime_call_type && !CodeCache::contains(entry.target())) {
+ // If it is a runtime call of an address outside small CodeCache,
+ // we need to check whether it is in range.
+ address target = entry.target();
+ assert(target < CodeCache::low_bound() || target >= CodeCache::high_bound(), "target is inside CodeCache");
+ // Case 1: -------T-------L====CodeCache====H-------
+ // ^-------longest branch---|
+ // Case 2: -------L====CodeCache====H-------T-------
+ // |-------longest branch ---^
+ address longest_branch_start = (target < CodeCache::low_bound()) ? CodeCache::high_bound() - NativeInstruction::instruction_size
+ : CodeCache::low_bound();
+ need_trampoline = !reachable_from_branch_at(longest_branch_start, target);
+ }
+
// We need a trampoline if branches are far.
- if (far_branches()) {
+ if (need_trampoline) {
bool in_scratch_emit_size = false;
#ifdef COMPILER2
// We don't want to emit a trampoline if C2 is generating dummy
@@ -743,7 +758,7 @@
if (cbuf) cbuf->set_insts_mark();
relocate(entry.rspec());
- if (!far_branches()) {
+ if (!need_trampoline) {
bl(entry.target());
} else {
bl(pc());
@@ -2270,11 +2285,13 @@
// If a constant does not fit in an immediate field, generate some
// number of MOV instructions and then perform the operation.
-void MacroAssembler::wrap_add_sub_imm_insn(Register Rd, Register Rn, unsigned imm,
+void MacroAssembler::wrap_add_sub_imm_insn(Register Rd, Register Rn, uint64_t imm,
add_sub_imm_insn insn1,
- add_sub_reg_insn insn2) {
+ add_sub_reg_insn insn2,
+ bool is32) {
assert(Rd != zr, "Rd = zr and not setting flags?");
- if (operand_valid_for_add_sub_immediate((int)imm)) {
+ bool fits = operand_valid_for_add_sub_immediate(is32 ? (int32_t)imm : imm);
+ if (fits) {
(this->*insn1)(Rd, Rn, imm);
} else {
if (uabs(imm) < (1 << 24)) {
@@ -2282,7 +2299,7 @@
(this->*insn1)(Rd, Rd, imm & ((1 << 12)-1));
} else {
assert_different_registers(Rd, Rn);
- mov(Rd, (uint64_t)imm);
+ mov(Rd, imm);
(this->*insn2)(Rd, Rn, Rd, LSL, 0);
}
}
@@ -2290,15 +2307,17 @@
// Seperate vsn which sets the flags. Optimisations are more restricted
// because we must set the flags correctly.
-void MacroAssembler::wrap_adds_subs_imm_insn(Register Rd, Register Rn, unsigned imm,
- add_sub_imm_insn insn1,
- add_sub_reg_insn insn2) {
- if (operand_valid_for_add_sub_immediate((int)imm)) {
+void MacroAssembler::wrap_adds_subs_imm_insn(Register Rd, Register Rn, uint64_t imm,
+ add_sub_imm_insn insn1,
+ add_sub_reg_insn insn2,
+ bool is32) {
+ bool fits = operand_valid_for_add_sub_immediate(is32 ? (int32_t)imm : imm);
+ if (fits) {
(this->*insn1)(Rd, Rn, imm);
} else {
assert_different_registers(Rd, Rn);
assert(Rd != zr, "overflow in immediate operand");
- mov(Rd, (uint64_t)imm);
+ mov(Rd, imm);
(this->*insn2)(Rd, Rn, Rd, LSL, 0);
}
}
@@ -3342,7 +3361,7 @@
crc32x(crc, crc, tmp2);
crc32x(crc, crc, tmp3);
br(Assembler::GE, CRC_by32_loop);
- cmn(len, 32);
+ cmn(len, (u1)32);
br(Assembler::NE, CRC_less32);
b(L_exit);
@@ -3405,7 +3424,7 @@
sub(len, len, 64);
add(buf, buf, 8);
- cmn(len, 128);
+ cmn(len, (u1)128);
br(Assembler::NE, CRC_less64);
BIND(L_exit);
mvnw(crc, crc);
@@ -3639,7 +3658,7 @@
crc32cx(crc, crc, tmp2);
crc32cx(crc, crc, tmp3);
br(Assembler::GE, CRC_by32_loop);
- cmn(len, 32);
+ cmn(len, (u1)32);
br(Assembler::NE, CRC_less32);
b(L_exit);
@@ -3702,7 +3721,7 @@
sub(len, len, 64);
add(buf, buf, 8);
- cmn(len, 128);
+ cmn(len, (u1)128);
br(Assembler::NE, CRC_less64);
BIND(L_exit);
}
diff -Nru openjdk-17-17.0.4+8/src/hotspot/cpu/aarch64/macroAssembler_aarch64.hpp openjdk-17-17.0.5+8/src/hotspot/cpu/aarch64/macroAssembler_aarch64.hpp
--- openjdk-17-17.0.4+8/src/hotspot/cpu/aarch64/macroAssembler_aarch64.hpp 2022-07-14 08:05:38.000000000 +0000
+++ openjdk-17-17.0.5+8/src/hotspot/cpu/aarch64/macroAssembler_aarch64.hpp 2022-10-10 13:07:22.000000000 +0000
@@ -206,8 +206,11 @@
inline void cmp(Register Rd, unsigned char imm8) { subs(zr, Rd, imm8); }
inline void cmp(Register Rd, unsigned imm) = delete;
- inline void cmnw(Register Rd, unsigned imm) { addsw(zr, Rd, imm); }
- inline void cmn(Register Rd, unsigned imm) { adds(zr, Rd, imm); }
+ template
+ inline void cmnw(Register Rd, T imm) { addsw(zr, Rd, imm); }
+
+ inline void cmn(Register Rd, unsigned char imm8) { adds(zr, Rd, imm8); }
+ inline void cmn(Register Rd, unsigned imm) = delete;
void cset(Register Rd, Assembler::Condition cond) {
csinc(Rd, zr, zr, ~cond);
@@ -225,7 +228,7 @@
inline void movw(Register Rd, Register Rn) {
if (Rd == sp || Rn == sp) {
- addw(Rd, Rn, 0U);
+ Assembler::addw(Rd, Rn, 0U);
} else {
orrw(Rd, zr, Rn);
}
@@ -234,7 +237,7 @@
assert(Rd != r31_sp && Rn != r31_sp, "should be");
if (Rd == Rn) {
} else if (Rd == sp || Rn == sp) {
- add(Rd, Rn, 0U);
+ Assembler::add(Rd, Rn, 0U);
} else {
orr(Rd, zr, Rn);
}
@@ -1133,17 +1136,17 @@
// If a constant does not fit in an immediate field, generate some
// number of MOV instructions and then perform the operation
- void wrap_add_sub_imm_insn(Register Rd, Register Rn, unsigned imm,
+ void wrap_add_sub_imm_insn(Register Rd, Register Rn, uint64_t imm,
add_sub_imm_insn insn1,
- add_sub_reg_insn insn2);
+ add_sub_reg_insn insn2, bool is32);
// Seperate vsn which sets the flags
- void wrap_adds_subs_imm_insn(Register Rd, Register Rn, unsigned imm,
- add_sub_imm_insn insn1,
- add_sub_reg_insn insn2);
-
-#define WRAP(INSN) \
- void INSN(Register Rd, Register Rn, unsigned imm) { \
- wrap_add_sub_imm_insn(Rd, Rn, imm, &Assembler::INSN, &Assembler::INSN); \
+ void wrap_adds_subs_imm_insn(Register Rd, Register Rn, uint64_t imm,
+ add_sub_imm_insn insn1,
+ add_sub_reg_insn insn2, bool is32);
+
+#define WRAP(INSN, is32) \
+ void INSN(Register Rd, Register Rn, uint64_t imm) { \
+ wrap_add_sub_imm_insn(Rd, Rn, imm, &Assembler::INSN, &Assembler::INSN, is32); \
} \
\
void INSN(Register Rd, Register Rn, Register Rm, \
@@ -1160,12 +1163,12 @@
Assembler::INSN(Rd, Rn, Rm, option, amount); \
}
- WRAP(add) WRAP(addw) WRAP(sub) WRAP(subw)
+ WRAP(add, false) WRAP(addw, true) WRAP(sub, false) WRAP(subw, true)
#undef WRAP
-#define WRAP(INSN) \
- void INSN(Register Rd, Register Rn, unsigned imm) { \
- wrap_adds_subs_imm_insn(Rd, Rn, imm, &Assembler::INSN, &Assembler::INSN); \
+#define WRAP(INSN, is32) \
+ void INSN(Register Rd, Register Rn, uint64_t imm) { \
+ wrap_adds_subs_imm_insn(Rd, Rn, imm, &Assembler::INSN, &Assembler::INSN, is32); \
} \
\
void INSN(Register Rd, Register Rn, Register Rm, \
@@ -1182,7 +1185,7 @@
Assembler::INSN(Rd, Rn, Rm, option, amount); \
}
- WRAP(adds) WRAP(addsw) WRAP(subs) WRAP(subsw)
+ WRAP(adds, false) WRAP(addsw, true) WRAP(subs, false) WRAP(subsw, true)
void add(Register Rd, Register Rn, RegisterOrConstant increment);
void addw(Register Rd, Register Rn, RegisterOrConstant increment);
diff -Nru openjdk-17-17.0.4+8/src/hotspot/cpu/aarch64/stubGenerator_aarch64.cpp openjdk-17-17.0.5+8/src/hotspot/cpu/aarch64/stubGenerator_aarch64.cpp
--- openjdk-17-17.0.4+8/src/hotspot/cpu/aarch64/stubGenerator_aarch64.cpp 2022-07-14 08:05:38.000000000 +0000
+++ openjdk-17-17.0.5+8/src/hotspot/cpu/aarch64/stubGenerator_aarch64.cpp 2022-10-10 13:07:22.000000000 +0000
@@ -6619,7 +6619,7 @@
assert(is_even(framesize/2), "sp not 16-byte aligned");
// lr and fp are already in place
- __ sub(sp, rfp, ((unsigned)framesize-4) << LogBytesPerInt); // prolog
+ __ sub(sp, rfp, ((uint64_t)framesize-4) << LogBytesPerInt); // prolog
int frame_complete = __ pc() - start;
diff -Nru openjdk-17-17.0.4+8/src/hotspot/cpu/arm/frame_arm.inline.hpp openjdk-17-17.0.5+8/src/hotspot/cpu/arm/frame_arm.inline.hpp
--- openjdk-17-17.0.4+8/src/hotspot/cpu/arm/frame_arm.inline.hpp 2022-07-14 08:05:38.000000000 +0000
+++ openjdk-17-17.0.5+8/src/hotspot/cpu/arm/frame_arm.inline.hpp 2022-10-10 13:07:22.000000000 +0000
@@ -124,9 +124,13 @@
inline bool frame::is_older(intptr_t* id) const { assert(this->id() != NULL && id != NULL, "NULL frame id");
return this->id() > id ; }
-
inline intptr_t* frame::link() const { return (intptr_t*) *(intptr_t **)addr_at(link_offset); }
+inline intptr_t* frame::link_or_null() const {
+ intptr_t** ptr = (intptr_t **)addr_at(link_offset);
+ return os::is_readable_pointer(ptr) ? *ptr : NULL;
+}
+
inline intptr_t* frame::unextended_sp() const { return _unextended_sp; }
// Return address:
diff -Nru openjdk-17-17.0.4+8/src/hotspot/cpu/arm/javaFrameAnchor_arm.hpp openjdk-17-17.0.5+8/src/hotspot/cpu/arm/javaFrameAnchor_arm.hpp
--- openjdk-17-17.0.4+8/src/hotspot/cpu/arm/javaFrameAnchor_arm.hpp 2022-07-14 08:05:38.000000000 +0000
+++ openjdk-17-17.0.5+8/src/hotspot/cpu/arm/javaFrameAnchor_arm.hpp 2022-10-10 13:07:22.000000000 +0000
@@ -65,7 +65,7 @@
// Always walkable
bool walkable(void) { return true; }
// Never any thing to do since we are always walkable and can find address of return addresses
- void make_walkable(JavaThread* thread) { }
+ void make_walkable() { }
intptr_t* last_Java_sp(void) const { return _last_Java_sp; }
diff -Nru openjdk-17-17.0.4+8/src/hotspot/cpu/ppc/frame_ppc.inline.hpp openjdk-17-17.0.5+8/src/hotspot/cpu/ppc/frame_ppc.inline.hpp
--- openjdk-17-17.0.4+8/src/hotspot/cpu/ppc/frame_ppc.inline.hpp 2022-07-14 08:05:38.000000000 +0000
+++ openjdk-17-17.0.5+8/src/hotspot/cpu/ppc/frame_ppc.inline.hpp 2022-10-10 13:07:22.000000000 +0000
@@ -117,6 +117,10 @@
return (intptr_t*)callers_abi()->callers_sp;
}
+inline intptr_t* frame::link_or_null() const {
+ return link();
+}
+
inline intptr_t* frame::real_fp() const {
return fp();
}
diff -Nru openjdk-17-17.0.4+8/src/hotspot/cpu/ppc/gc/z/zBarrierSetAssembler_ppc.cpp openjdk-17-17.0.5+8/src/hotspot/cpu/ppc/gc/z/zBarrierSetAssembler_ppc.cpp
--- openjdk-17-17.0.4+8/src/hotspot/cpu/ppc/gc/z/zBarrierSetAssembler_ppc.cpp 2022-07-14 08:05:38.000000000 +0000
+++ openjdk-17-17.0.5+8/src/hotspot/cpu/ppc/gc/z/zBarrierSetAssembler_ppc.cpp 2022-10-10 13:07:22.000000000 +0000
@@ -1,6 +1,6 @@
/*
* Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved.
- * Copyright (c) 2021 SAP SE. All rights reserved.
+ * Copyright (c) 2021, 2022 SAP SE. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -400,36 +400,40 @@
#define __ _masm->
class ZSaveLiveRegisters {
-
- private:
MacroAssembler* _masm;
RegMask _reg_mask;
Register _result_reg;
+ int _frame_size;
public:
ZSaveLiveRegisters(MacroAssembler *masm, ZLoadBarrierStubC2 *stub)
: _masm(masm), _reg_mask(stub->live()), _result_reg(stub->ref()) {
- const int total_regs_amount = iterate_over_register_mask(ACTION_SAVE);
+ const int register_save_size = iterate_over_register_mask(ACTION_COUNT_ONLY) * BytesPerWord;
+ _frame_size = align_up(register_save_size, frame::alignment_in_bytes)
+ + frame::abi_reg_args_size;
__ save_LR_CR(R0);
- __ push_frame_reg_args(total_regs_amount * BytesPerWord, R0);
+ __ push_frame(_frame_size, R0);
+
+ iterate_over_register_mask(ACTION_SAVE, _frame_size);
}
~ZSaveLiveRegisters() {
- __ pop_frame();
- __ restore_LR_CR(R0);
+ iterate_over_register_mask(ACTION_RESTORE, _frame_size);
- iterate_over_register_mask(ACTION_RESTORE);
+ __ addi(R1_SP, R1_SP, _frame_size);
+ __ restore_LR_CR(R0);
}
private:
enum IterationAction : int {
- ACTION_SAVE = 0,
- ACTION_RESTORE = 1
+ ACTION_SAVE,
+ ACTION_RESTORE,
+ ACTION_COUNT_ONLY
};
- int iterate_over_register_mask(IterationAction action) {
+ int iterate_over_register_mask(IterationAction action, int offset = 0) {
int reg_save_index = 0;
RegMaskIterator live_regs_iterator(_reg_mask);
@@ -454,11 +458,11 @@
reg_save_index++;
if (action == ACTION_SAVE) {
- _masm->std(std_reg, (intptr_t) -reg_save_index * BytesPerWord, R1_SP);
+ _masm->std(std_reg, offset - reg_save_index * BytesPerWord, R1_SP);
} else if (action == ACTION_RESTORE) {
- _masm->ld(std_reg, (intptr_t) -reg_save_index * BytesPerWord, R1_SP);
+ _masm->ld(std_reg, offset - reg_save_index * BytesPerWord, R1_SP);
} else {
- fatal("Sanity");
+ assert(action == ACTION_COUNT_ONLY, "Sanity");
}
}
} else if (vm_reg->is_FloatRegister()) {
@@ -467,19 +471,34 @@
reg_save_index++;
if (action == ACTION_SAVE) {
- _masm->stfd(fp_reg, (intptr_t) -reg_save_index * BytesPerWord, R1_SP);
+ _masm->stfd(fp_reg, offset - reg_save_index * BytesPerWord, R1_SP);
} else if (action == ACTION_RESTORE) {
- _masm->lfd(fp_reg, (intptr_t) -reg_save_index * BytesPerWord, R1_SP);
+ _masm->lfd(fp_reg, offset - reg_save_index * BytesPerWord, R1_SP);
} else {
- fatal("Sanity");
+ assert(action == ACTION_COUNT_ONLY, "Sanity");
}
}
} else if (vm_reg->is_ConditionRegister()) {
// NOP. Conditions registers are covered by save_LR_CR
+ } else if (vm_reg->is_VectorSRegister()) {
+ assert(SuperwordUseVSX, "or should not reach here");
+ VectorSRegister vs_reg = vm_reg->as_VectorSRegister();
+ if (vs_reg->encoding() >= VSR32->encoding() && vs_reg->encoding() <= VSR51->encoding()) {
+ reg_save_index += 2;
+
+ Register spill_addr = R0;
+ if (action == ACTION_SAVE) {
+ _masm->addi(spill_addr, R1_SP, offset - reg_save_index * BytesPerWord);
+ _masm->stxvd2x(vs_reg, spill_addr);
+ } else if (action == ACTION_RESTORE) {
+ _masm->addi(spill_addr, R1_SP, offset - reg_save_index * BytesPerWord);
+ _masm->lxvd2x(vs_reg, spill_addr);
+ } else {
+ assert(action == ACTION_COUNT_ONLY, "Sanity");
+ }
+ }
} else {
- if (vm_reg->is_VectorRegister()) {
- fatal("Vector registers are unsupported. Found register %s", vm_reg->name());
- } else if (vm_reg->is_SpecialRegister()) {
+ if (vm_reg->is_SpecialRegister()) {
fatal("Special registers are unsupported. Found register %s", vm_reg->name());
} else {
fatal("Register type is not known");
@@ -495,7 +514,6 @@
#define __ _masm->
class ZSetupArguments {
- private:
MacroAssembler* const _masm;
const Register _ref;
const Address _ref_addr;
diff -Nru openjdk-17-17.0.4+8/src/hotspot/cpu/ppc/javaFrameAnchor_ppc.hpp openjdk-17-17.0.5+8/src/hotspot/cpu/ppc/javaFrameAnchor_ppc.hpp
--- openjdk-17-17.0.4+8/src/hotspot/cpu/ppc/javaFrameAnchor_ppc.hpp 2022-07-14 08:05:38.000000000 +0000
+++ openjdk-17-17.0.5+8/src/hotspot/cpu/ppc/javaFrameAnchor_ppc.hpp 2022-10-10 13:07:22.000000000 +0000
@@ -67,7 +67,7 @@
// Always walkable.
bool walkable(void) { return true; }
// Never any thing to do since we are always walkable and can find address of return addresses.
- void make_walkable(JavaThread* thread) { }
+ void make_walkable() { }
intptr_t* last_Java_sp(void) const { return _last_Java_sp; }
diff -Nru openjdk-17-17.0.4+8/src/hotspot/cpu/ppc/ppc.ad openjdk-17-17.0.5+8/src/hotspot/cpu/ppc/ppc.ad
--- openjdk-17-17.0.4+8/src/hotspot/cpu/ppc/ppc.ad 2022-07-14 08:05:38.000000000 +0000
+++ openjdk-17-17.0.5+8/src/hotspot/cpu/ppc/ppc.ad 2022-10-10 13:07:22.000000000 +0000
@@ -1,6 +1,6 @@
//
// Copyright (c) 2011, 2021, Oracle and/or its affiliates. All rights reserved.
-// Copyright (c) 2012, 2021 SAP SE. All rights reserved.
+// Copyright (c) 2012, 2022 SAP SE. All rights reserved.
// DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
//
// This code is free software; you can redistribute it and/or modify it
@@ -257,70 +257,72 @@
// ----------------------------
// Vector-Scalar Registers
// ----------------------------
- reg_def VSR0 ( SOC, SOC, Op_VecX, 0, NULL);
- reg_def VSR1 ( SOC, SOC, Op_VecX, 1, NULL);
- reg_def VSR2 ( SOC, SOC, Op_VecX, 2, NULL);
- reg_def VSR3 ( SOC, SOC, Op_VecX, 3, NULL);
- reg_def VSR4 ( SOC, SOC, Op_VecX, 4, NULL);
- reg_def VSR5 ( SOC, SOC, Op_VecX, 5, NULL);
- reg_def VSR6 ( SOC, SOC, Op_VecX, 6, NULL);
- reg_def VSR7 ( SOC, SOC, Op_VecX, 7, NULL);
- reg_def VSR8 ( SOC, SOC, Op_VecX, 8, NULL);
- reg_def VSR9 ( SOC, SOC, Op_VecX, 9, NULL);
- reg_def VSR10 ( SOC, SOC, Op_VecX, 10, NULL);
- reg_def VSR11 ( SOC, SOC, Op_VecX, 11, NULL);
- reg_def VSR12 ( SOC, SOC, Op_VecX, 12, NULL);
- reg_def VSR13 ( SOC, SOC, Op_VecX, 13, NULL);
- reg_def VSR14 ( SOC, SOC, Op_VecX, 14, NULL);
- reg_def VSR15 ( SOC, SOC, Op_VecX, 15, NULL);
- reg_def VSR16 ( SOC, SOC, Op_VecX, 16, NULL);
- reg_def VSR17 ( SOC, SOC, Op_VecX, 17, NULL);
- reg_def VSR18 ( SOC, SOC, Op_VecX, 18, NULL);
- reg_def VSR19 ( SOC, SOC, Op_VecX, 19, NULL);
- reg_def VSR20 ( SOC, SOC, Op_VecX, 20, NULL);
- reg_def VSR21 ( SOC, SOC, Op_VecX, 21, NULL);
- reg_def VSR22 ( SOC, SOC, Op_VecX, 22, NULL);
- reg_def VSR23 ( SOC, SOC, Op_VecX, 23, NULL);
- reg_def VSR24 ( SOC, SOC, Op_VecX, 24, NULL);
- reg_def VSR25 ( SOC, SOC, Op_VecX, 25, NULL);
- reg_def VSR26 ( SOC, SOC, Op_VecX, 26, NULL);
- reg_def VSR27 ( SOC, SOC, Op_VecX, 27, NULL);
- reg_def VSR28 ( SOC, SOC, Op_VecX, 28, NULL);
- reg_def VSR29 ( SOC, SOC, Op_VecX, 29, NULL);
- reg_def VSR30 ( SOC, SOC, Op_VecX, 30, NULL);
- reg_def VSR31 ( SOC, SOC, Op_VecX, 31, NULL);
- reg_def VSR32 ( SOC, SOC, Op_VecX, 32, NULL);
- reg_def VSR33 ( SOC, SOC, Op_VecX, 33, NULL);
- reg_def VSR34 ( SOC, SOC, Op_VecX, 34, NULL);
- reg_def VSR35 ( SOC, SOC, Op_VecX, 35, NULL);
- reg_def VSR36 ( SOC, SOC, Op_VecX, 36, NULL);
- reg_def VSR37 ( SOC, SOC, Op_VecX, 37, NULL);
- reg_def VSR38 ( SOC, SOC, Op_VecX, 38, NULL);
- reg_def VSR39 ( SOC, SOC, Op_VecX, 39, NULL);
- reg_def VSR40 ( SOC, SOC, Op_VecX, 40, NULL);
- reg_def VSR41 ( SOC, SOC, Op_VecX, 41, NULL);
- reg_def VSR42 ( SOC, SOC, Op_VecX, 42, NULL);
- reg_def VSR43 ( SOC, SOC, Op_VecX, 43, NULL);
- reg_def VSR44 ( SOC, SOC, Op_VecX, 44, NULL);
- reg_def VSR45 ( SOC, SOC, Op_VecX, 45, NULL);
- reg_def VSR46 ( SOC, SOC, Op_VecX, 46, NULL);
- reg_def VSR47 ( SOC, SOC, Op_VecX, 47, NULL);
- reg_def VSR48 ( SOC, SOC, Op_VecX, 48, NULL);
- reg_def VSR49 ( SOC, SOC, Op_VecX, 49, NULL);
- reg_def VSR50 ( SOC, SOC, Op_VecX, 50, NULL);
- reg_def VSR51 ( SOC, SOC, Op_VecX, 51, NULL);
- reg_def VSR52 ( SOC, SOC, Op_VecX, 52, NULL);
- reg_def VSR53 ( SOC, SOC, Op_VecX, 53, NULL);
- reg_def VSR54 ( SOC, SOC, Op_VecX, 54, NULL);
- reg_def VSR55 ( SOC, SOC, Op_VecX, 55, NULL);
- reg_def VSR56 ( SOC, SOC, Op_VecX, 56, NULL);
- reg_def VSR57 ( SOC, SOC, Op_VecX, 57, NULL);
- reg_def VSR58 ( SOC, SOC, Op_VecX, 58, NULL);
- reg_def VSR59 ( SOC, SOC, Op_VecX, 59, NULL);
- reg_def VSR60 ( SOC, SOC, Op_VecX, 60, NULL);
- reg_def VSR61 ( SOC, SOC, Op_VecX, 61, NULL);
- reg_def VSR62 ( SOC, SOC, Op_VecX, 62, NULL);
- reg_def VSR63 ( SOC, SOC, Op_VecX, 63, NULL);
+ // 1st 32 VSRs are aliases for the FPRs which are already defined above.
+ reg_def VSR0 ( SOC, SOC, Op_VecX, 0, VMRegImpl::Bad());
+ reg_def VSR1 ( SOC, SOC, Op_VecX, 1, VMRegImpl::Bad());
+ reg_def VSR2 ( SOC, SOC, Op_VecX, 2, VMRegImpl::Bad());
+ reg_def VSR3 ( SOC, SOC, Op_VecX, 3, VMRegImpl::Bad());
+ reg_def VSR4 ( SOC, SOC, Op_VecX, 4, VMRegImpl::Bad());
+ reg_def VSR5 ( SOC, SOC, Op_VecX, 5, VMRegImpl::Bad());
+ reg_def VSR6 ( SOC, SOC, Op_VecX, 6, VMRegImpl::Bad());
+ reg_def VSR7 ( SOC, SOC, Op_VecX, 7, VMRegImpl::Bad());
+ reg_def VSR8 ( SOC, SOC, Op_VecX, 8, VMRegImpl::Bad());
+ reg_def VSR9 ( SOC, SOC, Op_VecX, 9, VMRegImpl::Bad());
+ reg_def VSR10 ( SOC, SOC, Op_VecX, 10, VMRegImpl::Bad());
+ reg_def VSR11 ( SOC, SOC, Op_VecX, 11, VMRegImpl::Bad());
+ reg_def VSR12 ( SOC, SOC, Op_VecX, 12, VMRegImpl::Bad());
+ reg_def VSR13 ( SOC, SOC, Op_VecX, 13, VMRegImpl::Bad());
+ reg_def VSR14 ( SOC, SOE, Op_VecX, 14, VMRegImpl::Bad());
+ reg_def VSR15 ( SOC, SOE, Op_VecX, 15, VMRegImpl::Bad());
+ reg_def VSR16 ( SOC, SOE, Op_VecX, 16, VMRegImpl::Bad());
+ reg_def VSR17 ( SOC, SOE, Op_VecX, 17, VMRegImpl::Bad());
+ reg_def VSR18 ( SOC, SOE, Op_VecX, 18, VMRegImpl::Bad());
+ reg_def VSR19 ( SOC, SOE, Op_VecX, 19, VMRegImpl::Bad());
+ reg_def VSR20 ( SOC, SOE, Op_VecX, 20, VMRegImpl::Bad());
+ reg_def VSR21 ( SOC, SOE, Op_VecX, 21, VMRegImpl::Bad());
+ reg_def VSR22 ( SOC, SOE, Op_VecX, 22, VMRegImpl::Bad());
+ reg_def VSR23 ( SOC, SOE, Op_VecX, 23, VMRegImpl::Bad());
+ reg_def VSR24 ( SOC, SOE, Op_VecX, 24, VMRegImpl::Bad());
+ reg_def VSR25 ( SOC, SOE, Op_VecX, 25, VMRegImpl::Bad());
+ reg_def VSR26 ( SOC, SOE, Op_VecX, 26, VMRegImpl::Bad());
+ reg_def VSR27 ( SOC, SOE, Op_VecX, 27, VMRegImpl::Bad());
+ reg_def VSR28 ( SOC, SOE, Op_VecX, 28, VMRegImpl::Bad());
+ reg_def VSR29 ( SOC, SOE, Op_VecX, 29, VMRegImpl::Bad());
+ reg_def VSR30 ( SOC, SOE, Op_VecX, 30, VMRegImpl::Bad());
+ reg_def VSR31 ( SOC, SOE, Op_VecX, 31, VMRegImpl::Bad());
+ // 2nd 32 VSRs are aliases for the VRs which are only defined here.
+ reg_def VSR32 ( SOC, SOC, Op_VecX, 32, VSR32->as_VMReg());
+ reg_def VSR33 ( SOC, SOC, Op_VecX, 33, VSR33->as_VMReg());
+ reg_def VSR34 ( SOC, SOC, Op_VecX, 34, VSR34->as_VMReg());
+ reg_def VSR35 ( SOC, SOC, Op_VecX, 35, VSR35->as_VMReg());
+ reg_def VSR36 ( SOC, SOC, Op_VecX, 36, VSR36->as_VMReg());
+ reg_def VSR37 ( SOC, SOC, Op_VecX, 37, VSR37->as_VMReg());
+ reg_def VSR38 ( SOC, SOC, Op_VecX, 38, VSR38->as_VMReg());
+ reg_def VSR39 ( SOC, SOC, Op_VecX, 39, VSR39->as_VMReg());
+ reg_def VSR40 ( SOC, SOC, Op_VecX, 40, VSR40->as_VMReg());
+ reg_def VSR41 ( SOC, SOC, Op_VecX, 41, VSR41->as_VMReg());
+ reg_def VSR42 ( SOC, SOC, Op_VecX, 42, VSR42->as_VMReg());
+ reg_def VSR43 ( SOC, SOC, Op_VecX, 43, VSR43->as_VMReg());
+ reg_def VSR44 ( SOC, SOC, Op_VecX, 44, VSR44->as_VMReg());
+ reg_def VSR45 ( SOC, SOC, Op_VecX, 45, VSR45->as_VMReg());
+ reg_def VSR46 ( SOC, SOC, Op_VecX, 46, VSR46->as_VMReg());
+ reg_def VSR47 ( SOC, SOC, Op_VecX, 47, VSR47->as_VMReg());
+ reg_def VSR48 ( SOC, SOC, Op_VecX, 48, VSR48->as_VMReg());
+ reg_def VSR49 ( SOC, SOC, Op_VecX, 49, VSR49->as_VMReg());
+ reg_def VSR50 ( SOC, SOC, Op_VecX, 50, VSR50->as_VMReg());
+ reg_def VSR51 ( SOC, SOC, Op_VecX, 51, VSR51->as_VMReg());
+ reg_def VSR52 ( SOC, SOE, Op_VecX, 52, VSR52->as_VMReg());
+ reg_def VSR53 ( SOC, SOE, Op_VecX, 53, VSR53->as_VMReg());
+ reg_def VSR54 ( SOC, SOE, Op_VecX, 54, VSR54->as_VMReg());
+ reg_def VSR55 ( SOC, SOE, Op_VecX, 55, VSR55->as_VMReg());
+ reg_def VSR56 ( SOC, SOE, Op_VecX, 56, VSR56->as_VMReg());
+ reg_def VSR57 ( SOC, SOE, Op_VecX, 57, VSR57->as_VMReg());
+ reg_def VSR58 ( SOC, SOE, Op_VecX, 58, VSR58->as_VMReg());
+ reg_def VSR59 ( SOC, SOE, Op_VecX, 59, VSR59->as_VMReg());
+ reg_def VSR60 ( SOC, SOE, Op_VecX, 60, VSR60->as_VMReg());
+ reg_def VSR61 ( SOC, SOE, Op_VecX, 61, VSR61->as_VMReg());
+ reg_def VSR62 ( SOC, SOE, Op_VecX, 62, VSR62->as_VMReg());
+ reg_def VSR63 ( SOC, SOE, Op_VecX, 63, VSR63->as_VMReg());
// ----------------------------
// Specify priority of register selection within phases of register
diff -Nru openjdk-17-17.0.4+8/src/hotspot/cpu/ppc/register_ppc.hpp openjdk-17-17.0.5+8/src/hotspot/cpu/ppc/register_ppc.hpp
--- openjdk-17-17.0.4+8/src/hotspot/cpu/ppc/register_ppc.hpp 2022-07-14 08:05:38.000000000 +0000
+++ openjdk-17-17.0.5+8/src/hotspot/cpu/ppc/register_ppc.hpp 2022-10-10 13:07:22.000000000 +0000
@@ -1,6 +1,6 @@
/*
- * Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.
- * Copyright (c) 2012, 2018 SAP SE. All rights reserved.
+ * Copyright (c) 2000, 2022, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2022 SAP SE. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -69,7 +69,11 @@
// v14-v19 Volatile scratch registers
// v20-v31 Non-volatile registers
// vrsave Non-volatile 32-bit register
-
+//
+// ----------------------------------------------
+// On processors with VSX feature:
+// vs0-31 Alias for f0-f31 (64 bit, see above)
+// vs32-63 Alias for v0-31 (128 bit, see above)
// Use Register as shortcut
class RegisterImpl;
diff -Nru openjdk-17-17.0.4+8/src/hotspot/cpu/ppc/vmreg_ppc.cpp openjdk-17-17.0.5+8/src/hotspot/cpu/ppc/vmreg_ppc.cpp
--- openjdk-17-17.0.4+8/src/hotspot/cpu/ppc/vmreg_ppc.cpp 2022-07-14 08:05:38.000000000 +0000
+++ openjdk-17-17.0.5+8/src/hotspot/cpu/ppc/vmreg_ppc.cpp 2022-10-10 13:07:22.000000000 +0000
@@ -1,6 +1,6 @@
/*
* Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved.
- * Copyright (c) 2012, 2020 SAP SE. All rights reserved.
+ * Copyright (c) 2012, 2022 SAP SE. All rights reserved.
* 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,8 +44,14 @@
if (reg->encoding() < FloatRegisterImpl::number_of_registers-1)
freg = freg->successor();
}
- for ( ; i < ConcreteRegisterImpl::number_of_registers; i++) {
- regName[i] = "NON-GPR-FPR";
+
+ VectorSRegister vsreg = ::as_VectorSRegister(0);
+ for ( ; i < ConcreteRegisterImpl::max_vsr; ) {
+ regName[i++] = vsreg->name();
+ }
+
+ for ( ; i < ConcreteRegisterImpl::number_of_registers; ) {
+ regName[i++] = "NON-GPR-FPR-VSR";
}
}
diff -Nru openjdk-17-17.0.4+8/src/hotspot/cpu/ppc/vmreg_ppc.hpp openjdk-17-17.0.5+8/src/hotspot/cpu/ppc/vmreg_ppc.hpp
--- openjdk-17-17.0.4+8/src/hotspot/cpu/ppc/vmreg_ppc.hpp 2022-07-14 08:05:38.000000000 +0000
+++ openjdk-17-17.0.5+8/src/hotspot/cpu/ppc/vmreg_ppc.hpp 2022-10-10 13:07:22.000000000 +0000
@@ -1,6 +1,6 @@
/*
- * Copyright (c) 2001, 2021, Oracle and/or its affiliates. All rights reserved.
- * Copyright (c) 2012, 2021 SAP SE. All rights reserved.
+ * Copyright (c) 2001, 2022, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2022 SAP SE. All rights reserved.
* 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,7 @@
value() < ConcreteRegisterImpl::max_fpr;
}
-inline bool is_VectorRegister() {
+inline bool is_VectorSRegister() {
return value() >= ConcreteRegisterImpl::max_fpr &&
value() < ConcreteRegisterImpl::max_vsr;
}
@@ -60,6 +60,11 @@
return ::as_FloatRegister((value() - ConcreteRegisterImpl::max_gpr) >> 1);
}
+inline VectorSRegister as_VectorSRegister() {
+ assert(is_VectorSRegister(), "must be");
+ return ::as_VectorSRegister(value() - ConcreteRegisterImpl::max_fpr);
+}
+
inline bool is_concrete() {
assert(is_reg(), "must be");
return is_even(value());
diff -Nru openjdk-17-17.0.4+8/src/hotspot/cpu/s390/frame_s390.inline.hpp openjdk-17-17.0.5+8/src/hotspot/cpu/s390/frame_s390.inline.hpp
--- openjdk-17-17.0.4+8/src/hotspot/cpu/s390/frame_s390.inline.hpp 2022-07-14 08:05:38.000000000 +0000
+++ openjdk-17-17.0.5+8/src/hotspot/cpu/s390/frame_s390.inline.hpp 2022-10-10 13:07:22.000000000 +0000
@@ -155,6 +155,10 @@
return (intptr_t*) callers_abi()->callers_sp;
}
+inline intptr_t* frame::link_or_null() const {
+ return link();
+}
+
inline intptr_t** frame::interpreter_frame_locals_addr() const {
return (intptr_t**) &(ijava_state()->locals);
}
diff -Nru openjdk-17-17.0.4+8/src/hotspot/cpu/s390/javaFrameAnchor_s390.hpp openjdk-17-17.0.5+8/src/hotspot/cpu/s390/javaFrameAnchor_s390.hpp
--- openjdk-17-17.0.4+8/src/hotspot/cpu/s390/javaFrameAnchor_s390.hpp 2022-07-14 08:05:38.000000000 +0000
+++ openjdk-17-17.0.5+8/src/hotspot/cpu/s390/javaFrameAnchor_s390.hpp 2022-10-10 13:07:22.000000000 +0000
@@ -72,7 +72,7 @@
// We don't have to flush registers, so the stack is always walkable.
inline bool walkable(void) { return true; }
- inline void make_walkable(JavaThread* thread) { }
+ inline void make_walkable() { }
public:
diff -Nru openjdk-17-17.0.4+8/src/hotspot/cpu/x86/frame_x86.cpp openjdk-17-17.0.5+8/src/hotspot/cpu/x86/frame_x86.cpp
--- openjdk-17-17.0.4+8/src/hotspot/cpu/x86/frame_x86.cpp 2022-07-14 08:05:38.000000000 +0000
+++ openjdk-17-17.0.5+8/src/hotspot/cpu/x86/frame_x86.cpp 2022-10-10 13:07:22.000000000 +0000
@@ -341,13 +341,9 @@
assert(jfa->last_Java_sp() > sp(), "must be above this frame on stack");
// Since we are walking the stack now this nested anchor is obviously walkable
// even if it wasn't when it was stacked.
- if (!jfa->walkable()) {
- // Capture _last_Java_pc (if needed) and mark anchor walkable.
- jfa->capture_last_Java_pc();
- }
+ jfa->make_walkable();
map->clear();
assert(map->include_argument_oops(), "should be set by clear");
- vmassert(jfa->last_Java_pc() != NULL, "not walkable");
frame fr(jfa->last_Java_sp(), jfa->last_Java_fp(), jfa->last_Java_pc());
return fr;
@@ -377,13 +373,9 @@
assert(jfa->last_Java_sp() > sp(), "must be above this frame on stack");
// Since we are walking the stack now this nested anchor is obviously walkable
// even if it wasn't when it was stacked.
- if (!jfa->walkable()) {
- // Capture _last_Java_pc (if needed) and mark anchor walkable.
- jfa->capture_last_Java_pc();
- }
+ jfa->make_walkable();
map->clear();
assert(map->include_argument_oops(), "should be set by clear");
- vmassert(jfa->last_Java_pc() != NULL, "not walkable");
frame fr(jfa->last_Java_sp(), jfa->last_Java_fp(), jfa->last_Java_pc());
return fr;
@@ -721,20 +713,12 @@
void frame::pd_ps() {}
#endif
-void JavaFrameAnchor::make_walkable(JavaThread* thread) {
+void JavaFrameAnchor::make_walkable() {
// last frame set?
if (last_Java_sp() == NULL) return;
// already walkable?
if (walkable()) return;
- vmassert(Thread::current() == (Thread*)thread, "not current thread");
- vmassert(last_Java_sp() != NULL, "not called from Java code?");
vmassert(last_Java_pc() == NULL, "already walkable");
- capture_last_Java_pc();
- vmassert(walkable(), "something went wrong");
-}
-
-void JavaFrameAnchor::capture_last_Java_pc() {
- vmassert(_last_Java_sp != NULL, "no last frame set");
- vmassert(_last_Java_pc == NULL, "already walkable");
_last_Java_pc = (address)_last_Java_sp[-1];
+ vmassert(walkable(), "something went wrong");
}
diff -Nru openjdk-17-17.0.4+8/src/hotspot/cpu/x86/frame_x86.inline.hpp openjdk-17-17.0.5+8/src/hotspot/cpu/x86/frame_x86.inline.hpp
--- openjdk-17-17.0.4+8/src/hotspot/cpu/x86/frame_x86.inline.hpp 2022-07-14 08:05:38.000000000 +0000
+++ openjdk-17-17.0.5+8/src/hotspot/cpu/x86/frame_x86.inline.hpp 2022-10-10 13:07:22.000000000 +0000
@@ -138,10 +138,13 @@
inline bool frame::is_older(intptr_t* id) const { assert(this->id() != NULL && id != NULL, "NULL frame id");
return this->id() > id ; }
-
-
inline intptr_t* frame::link() const { return (intptr_t*) *(intptr_t **)addr_at(link_offset); }
+inline intptr_t* frame::link_or_null() const {
+ intptr_t** ptr = (intptr_t **)addr_at(link_offset);
+ return os::is_readable_pointer(ptr) ? *ptr : NULL;
+}
+
inline intptr_t* frame::unextended_sp() const { return _unextended_sp; }
// Return address:
diff -Nru openjdk-17-17.0.4+8/src/hotspot/cpu/x86/interp_masm_x86.cpp openjdk-17-17.0.5+8/src/hotspot/cpu/x86/interp_masm_x86.cpp
--- openjdk-17-17.0.4+8/src/hotspot/cpu/x86/interp_masm_x86.cpp 2022-07-14 08:05:38.000000000 +0000
+++ openjdk-17-17.0.5+8/src/hotspot/cpu/x86/interp_masm_x86.cpp 2022-10-10 13:07:22.000000000 +0000
@@ -1123,7 +1123,7 @@
bind(loop);
// check if current entry is used
- cmpptr(Address(rmon, BasicObjectLock::obj_offset_in_bytes()), (int32_t) NULL);
+ cmpptr(Address(rmon, BasicObjectLock::obj_offset_in_bytes()), (int32_t) NULL_WORD);
jcc(Assembler::notEqual, exception);
addptr(rmon, entry_size); // otherwise advance to next entry
diff -Nru openjdk-17-17.0.4+8/src/hotspot/cpu/x86/interpreterRT_x86_64.cpp openjdk-17-17.0.5+8/src/hotspot/cpu/x86/interpreterRT_x86_64.cpp
--- openjdk-17-17.0.4+8/src/hotspot/cpu/x86/interpreterRT_x86_64.cpp 2022-07-14 08:05:38.000000000 +0000
+++ openjdk-17-17.0.5+8/src/hotspot/cpu/x86/interpreterRT_x86_64.cpp 2022-10-10 13:07:22.000000000 +0000
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2019, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -348,10 +348,10 @@
intptr_t *from_addr = (intptr_t*)(_from + Interpreter::local_offset_in_bytes(0));
_from -= Interpreter::stackElementSize;
if (_num_args < Argument::n_int_register_parameters_c-1) {
- *_reg_args++ = (*from_addr == 0) ? NULL : (intptr_t) from_addr;
+ *_reg_args++ = (*from_addr == 0) ? NULL_WORD : (intptr_t) from_addr;
_num_args++;
} else {
- *_to++ = (*from_addr == 0) ? NULL : (intptr_t) from_addr;
+ *_to++ = (*from_addr == 0) ? NULL_WORD : (intptr_t) from_addr;
}
}
@@ -443,10 +443,10 @@
_from -= Interpreter::stackElementSize;
if (_num_int_args < Argument::n_int_register_parameters_c-1) {
- *_int_args++ = (*from_addr == 0) ? NULL : (intptr_t)from_addr;
+ *_int_args++ = (*from_addr == 0) ? NULL_WORD : (intptr_t)from_addr;
_num_int_args++;
} else {
- *_to++ = (*from_addr == 0) ? NULL : (intptr_t) from_addr;
+ *_to++ = (*from_addr == 0) ? NULL_WORD : (intptr_t) from_addr;
}
}
diff -Nru openjdk-17-17.0.4+8/src/hotspot/cpu/x86/javaFrameAnchor_x86.hpp openjdk-17-17.0.5+8/src/hotspot/cpu/x86/javaFrameAnchor_x86.hpp
--- openjdk-17-17.0.4+8/src/hotspot/cpu/x86/javaFrameAnchor_x86.hpp 2022-07-14 08:05:38.000000000 +0000
+++ openjdk-17-17.0.5+8/src/hotspot/cpu/x86/javaFrameAnchor_x86.hpp 2022-10-10 13:07:22.000000000 +0000
@@ -63,8 +63,7 @@
}
bool walkable(void) { return _last_Java_sp != NULL && _last_Java_pc != NULL; }
- void make_walkable(JavaThread* thread);
- void capture_last_Java_pc(void);
+ void make_walkable();
intptr_t* last_Java_sp(void) const { return _last_Java_sp; }
diff -Nru openjdk-17-17.0.4+8/src/hotspot/cpu/x86/macroAssembler_x86.cpp openjdk-17-17.0.5+8/src/hotspot/cpu/x86/macroAssembler_x86.cpp
--- openjdk-17-17.0.4+8/src/hotspot/cpu/x86/macroAssembler_x86.cpp 2022-07-14 08:05:38.000000000 +0000
+++ openjdk-17-17.0.5+8/src/hotspot/cpu/x86/macroAssembler_x86.cpp 2022-10-10 13:07:22.000000000 +0000
@@ -5269,10 +5269,28 @@
int vector64_count = (cnt & (~0x7)) >> 3;
cnt = cnt & 0x7;
+ const int fill64_per_loop = 4;
+ const int max_unrolled_fill64 = 8;
// 64 byte initialization loop.
vpxor(xtmp, xtmp, xtmp, use64byteVector ? AVX_512bit : AVX_256bit);
- for (int i = 0; i < vector64_count; i++) {
+ int start64 = 0;
+ if (vector64_count > max_unrolled_fill64) {
+ Label LOOP;
+ Register index = rtmp;
+
+ start64 = vector64_count - (vector64_count % fill64_per_loop);
+
+ movl(index, 0);
+ BIND(LOOP);
+ for (int i = 0; i < fill64_per_loop; i++) {
+ fill64(Address(base, index, Address::times_1, i * 64), xtmp, use64byteVector);
+ }
+ addl(index, fill64_per_loop * 64);
+ cmpl(index, start64 * 64);
+ jccb(Assembler::less, LOOP);
+ }
+ for (int i = start64; i < vector64_count; i++) {
fill64_avx(base, i * 64, xtmp, use64byteVector);
}
@@ -8459,23 +8477,29 @@
evmovdqu(type[shift], mask, Address(dst, disp), xmm, Assembler::AVX_256bit);
}
+void MacroAssembler::fill32(Address dst, XMMRegister xmm) {
+ assert(MaxVectorSize >= 32, "vector length should be >= 32");
+ vmovdqu(dst, xmm);
+}
void MacroAssembler::fill32_avx(Register dst, int disp, XMMRegister xmm) {
- assert(MaxVectorSize >= 32, "vector length should be >= 32");
- vmovdqu(Address(dst, disp), xmm);
+ fill32(Address(dst, disp), xmm);
}
-void MacroAssembler::fill64_avx(Register dst, int disp, XMMRegister xmm, bool use64byteVector) {
+void MacroAssembler::fill64(Address dst, XMMRegister xmm, bool use64byteVector) {
assert(MaxVectorSize >= 32, "vector length should be >= 32");
- BasicType type[] = {T_BYTE, T_SHORT, T_INT, T_LONG};
if (!use64byteVector) {
- fill32_avx(dst, disp, xmm);
- fill32_avx(dst, disp + 32, xmm);
+ fill32(dst, xmm);
+ fill32(dst.plus_disp(32), xmm);
} else {
- evmovdquq(Address(dst, disp), xmm, Assembler::AVX_512bit);
+ evmovdquq(dst, xmm, Assembler::AVX_512bit);
}
}
+void MacroAssembler::fill64_avx(Register dst, int disp, XMMRegister xmm, bool use64byteVector) {
+ fill64(Address(dst, disp), xmm, use64byteVector);
+}
+
#endif //COMPILER2_OR_JVMCI
diff -Nru openjdk-17-17.0.4+8/src/hotspot/cpu/x86/macroAssembler_x86.hpp openjdk-17-17.0.5+8/src/hotspot/cpu/x86/macroAssembler_x86.hpp
--- openjdk-17-17.0.4+8/src/hotspot/cpu/x86/macroAssembler_x86.hpp 2022-07-14 08:05:38.000000000 +0000
+++ openjdk-17-17.0.5+8/src/hotspot/cpu/x86/macroAssembler_x86.hpp 2022-10-10 13:07:22.000000000 +0000
@@ -1860,8 +1860,12 @@
XMMRegister xmm, KRegister mask, Register length,
Register temp);
+ void fill32(Address dst, XMMRegister xmm);
+
void fill32_avx(Register dst, int disp, XMMRegister xmm);
+ void fill64(Address dst, XMMRegister xmm, bool use64byteVector = false);
+
void fill64_avx(Register dst, int dis, XMMRegister xmm, bool use64byteVector = false);
#ifdef _LP64
diff -Nru openjdk-17-17.0.4+8/src/hotspot/cpu/x86/sharedRuntime_x86_64.cpp openjdk-17-17.0.5+8/src/hotspot/cpu/x86/sharedRuntime_x86_64.cpp
--- openjdk-17-17.0.4+8/src/hotspot/cpu/x86/sharedRuntime_x86_64.cpp 2022-07-14 08:05:38.000000000 +0000
+++ openjdk-17-17.0.5+8/src/hotspot/cpu/x86/sharedRuntime_x86_64.cpp 2022-10-10 13:07:22.000000000 +0000
@@ -150,8 +150,8 @@
};
public:
- static OopMap* save_live_registers(MacroAssembler* masm, int additional_frame_words, int* total_frame_words, bool save_vectors);
- static void restore_live_registers(MacroAssembler* masm, bool restore_vectors = false);
+ static OopMap* save_live_registers(MacroAssembler* masm, int additional_frame_words, int* total_frame_words, bool save_wide_vectors);
+ static void restore_live_registers(MacroAssembler* masm, bool restore_wide_vectors = false);
// Offsets into the register save area
// Used by deoptimization when it is managing result register
@@ -168,19 +168,19 @@
static void restore_result_registers(MacroAssembler* masm);
};
-OopMap* RegisterSaver::save_live_registers(MacroAssembler* masm, int additional_frame_words, int* total_frame_words, bool save_vectors) {
+OopMap* RegisterSaver::save_live_registers(MacroAssembler* masm, int additional_frame_words, int* total_frame_words, bool save_wide_vectors) {
int off = 0;
int num_xmm_regs = XMMRegisterImpl::number_of_registers;
if (UseAVX < 3) {
num_xmm_regs = num_xmm_regs/2;
}
#if COMPILER2_OR_JVMCI
- if (save_vectors && UseAVX == 0) {
- save_vectors = false; // vectors larger than 16 byte long are supported only with AVX
+ if (save_wide_vectors && UseAVX == 0) {
+ save_wide_vectors = false; // vectors larger than 16 byte long are supported only with AVX
}
- assert(!save_vectors || MaxVectorSize <= 64, "Only up to 64 byte long vectors are supported");
+ assert(!save_wide_vectors || MaxVectorSize <= 64, "Only up to 64 byte long vectors are supported");
#else
- save_vectors = false; // vectors are generated only by C2 and JVMCI
+ save_wide_vectors = false; // vectors are generated only by C2 and JVMCI
#endif
// Always make the frame size 16-byte aligned, both vector and non vector stacks are always allocated
@@ -201,7 +201,7 @@
__ push_CPU_state(); // Push a multiple of 16 bytes
// push cpu state handles this on EVEX enabled targets
- if (save_vectors) {
+ if (save_wide_vectors) {
// Save upper half of YMM registers(0..15)
int base_addr = XSAVE_AREA_YMM_BEGIN;
for (int n = 0; n < 16; n++) {
@@ -230,11 +230,12 @@
}
} else {
if (VM_Version::supports_evex()) {
- // Save upper bank of ZMM registers(16..31) for double/float usage
+ // Save upper bank of XMM registers(16..31) for scalar or 16-byte vector usage
int base_addr = XSAVE_AREA_UPPERBANK;
off = 0;
+ int vector_len = VM_Version::supports_avx512vl() ? Assembler::AVX_128bit : Assembler::AVX_512bit;
for (int n = 16; n < num_xmm_regs; n++) {
- __ movsd(Address(rsp, base_addr+(off++*64)), as_XMMRegister(n));
+ __ evmovdqul(Address(rsp, base_addr+(off++*64)), as_XMMRegister(n), vector_len);
}
#if COMPILER2_OR_JVMCI
base_addr = XSAVE_AREA_OPMASK_BEGIN;
@@ -298,7 +299,7 @@
}
#if COMPILER2_OR_JVMCI
- if (save_vectors) {
+ if (save_wide_vectors) {
// Save upper half of YMM registers(0..15)
off = ymm0_off;
delta = ymm1_off - ymm0_off;
@@ -361,7 +362,7 @@
return map;
}
-void RegisterSaver::restore_live_registers(MacroAssembler* masm, bool restore_vectors) {
+void RegisterSaver::restore_live_registers(MacroAssembler* masm, bool restore_wide_vectors) {
int num_xmm_regs = XMMRegisterImpl::number_of_registers;
if (UseAVX < 3) {
num_xmm_regs = num_xmm_regs/2;
@@ -372,18 +373,18 @@
}
#if COMPILER2_OR_JVMCI
- if (restore_vectors) {
+ if (restore_wide_vectors) {
assert(UseAVX > 0, "Vectors larger than 16 byte long are supported only with AVX");
assert(MaxVectorSize <= 64, "Only up to 64 byte long vectors are supported");
}
#else
- assert(!restore_vectors, "vectors are generated only by C2");
+ assert(!restore_wide_vectors, "vectors are generated only by C2");
#endif
__ vzeroupper();
// On EVEX enabled targets everything is handled in pop fpu state
- if (restore_vectors) {
+ if (restore_wide_vectors) {
// Restore upper half of YMM registers (0..15)
int base_addr = XSAVE_AREA_YMM_BEGIN;
for (int n = 0; n < 16; n++) {
@@ -412,11 +413,12 @@
}
} else {
if (VM_Version::supports_evex()) {
- // Restore upper bank of ZMM registers(16..31) for double/float usage
+ // Restore upper bank of XMM registers(16..31) for scalar or 16-byte vector usage
int base_addr = XSAVE_AREA_UPPERBANK;
int off = 0;
+ int vector_len = VM_Version::supports_avx512vl() ? Assembler::AVX_128bit : Assembler::AVX_512bit;
for (int n = 16; n < num_xmm_regs; n++) {
- __ movsd(as_XMMRegister(n), Address(rsp, base_addr+(off++*64)));
+ __ evmovdqul(as_XMMRegister(n), Address(rsp, base_addr+(off++*64)), vector_len);
}
#if COMPILER2_OR_JVMCI
base_addr = XSAVE_AREA_OPMASK_BEGIN;
@@ -2501,7 +2503,7 @@
// Prolog for non exception case!
// Save everything in sight.
- map = RegisterSaver::save_live_registers(masm, 0, &frame_size_in_words, /*save_vectors*/ true);
+ map = RegisterSaver::save_live_registers(masm, 0, &frame_size_in_words, /*save_wide_vectors*/ true);
// Normal deoptimization. Save exec mode for unpack_frames.
__ movl(r14, Deoptimization::Unpack_deopt); // callee-saved
@@ -2519,7 +2521,7 @@
// return address is the pc describes what bci to do re-execute at
// No need to update map as each call to save_live_registers will produce identical oopmap
- (void) RegisterSaver::save_live_registers(masm, 0, &frame_size_in_words, /*save_vectors*/ true);
+ (void) RegisterSaver::save_live_registers(masm, 0, &frame_size_in_words, /*save_wide_vectors*/ true);
__ movl(r14, Deoptimization::Unpack_reexecute); // callee-saved
__ jmp(cont);
@@ -2538,7 +2540,7 @@
uncommon_trap_offset = __ pc() - start;
// Save everything in sight.
- RegisterSaver::save_live_registers(masm, 0, &frame_size_in_words, /*save_vectors*/ true);
+ RegisterSaver::save_live_registers(masm, 0, &frame_size_in_words, /*save_wide_vectors*/ true);
// fetch_unroll_info needs to call last_java_frame()
__ set_last_Java_frame(noreg, noreg, NULL);
@@ -2585,7 +2587,7 @@
__ push(0);
// Save everything in sight.
- map = RegisterSaver::save_live_registers(masm, 0, &frame_size_in_words, /*save_vectors*/ true);
+ map = RegisterSaver::save_live_registers(masm, 0, &frame_size_in_words, /*save_wide_vectors*/ true);
// Now it is safe to overwrite any register
@@ -3016,7 +3018,7 @@
address call_pc = NULL;
int frame_size_in_words;
bool cause_return = (poll_type == POLL_AT_RETURN);
- bool save_vectors = (poll_type == POLL_AT_VECTOR_LOOP);
+ bool save_wide_vectors = (poll_type == POLL_AT_VECTOR_LOOP);
if (UseRTMLocking) {
// Abort RTM transaction before calling runtime
@@ -3031,7 +3033,7 @@
}
// Save registers, fpu state, and flags
- map = RegisterSaver::save_live_registers(masm, 0, &frame_size_in_words, save_vectors);
+ map = RegisterSaver::save_live_registers(masm, 0, &frame_size_in_words, save_wide_vectors);
// The following is basically a call_VM. However, we need the precise
// address of the call in order to generate an oopmap. Hence, we do all the
@@ -3070,7 +3072,7 @@
// Exception pending
- RegisterSaver::restore_live_registers(masm, save_vectors);
+ RegisterSaver::restore_live_registers(masm, save_wide_vectors);
__ jump(RuntimeAddress(StubRoutines::forward_exception_entry()));
@@ -3143,7 +3145,7 @@
__ bind(no_adjust);
// Normal exit, restore registers and exit.
- RegisterSaver::restore_live_registers(masm, save_vectors);
+ RegisterSaver::restore_live_registers(masm, save_wide_vectors);
__ ret(0);
#ifdef ASSERT
@@ -3183,7 +3185,7 @@
int start = __ offset();
// No need to save vector registers since they are caller-saved anyway.
- map = RegisterSaver::save_live_registers(masm, 0, &frame_size_in_words, /*save_vectors*/ false);
+ map = RegisterSaver::save_live_registers(masm, 0, &frame_size_in_words, /*save_wide_vectors*/ false);
int frame_complete = __ offset();
diff -Nru openjdk-17-17.0.4+8/src/hotspot/cpu/x86/stubGenerator_x86_64.cpp openjdk-17-17.0.5+8/src/hotspot/cpu/x86/stubGenerator_x86_64.cpp
--- openjdk-17-17.0.4+8/src/hotspot/cpu/x86/stubGenerator_x86_64.cpp 2022-07-14 08:05:38.000000000 +0000
+++ openjdk-17-17.0.5+8/src/hotspot/cpu/x86/stubGenerator_x86_64.cpp 2022-10-10 13:07:22.000000000 +0000
@@ -517,7 +517,7 @@
// make sure this code is only executed if there is a pending exception
{
Label L;
- __ cmpptr(Address(r15_thread, Thread::pending_exception_offset()), (int32_t) NULL);
+ __ cmpptr(Address(r15_thread, Thread::pending_exception_offset()), (int32_t) NULL_WORD);
__ jcc(Assembler::notEqual, L);
__ stop("StubRoutines::forward exception: no pending exception (1)");
__ bind(L);
diff -Nru openjdk-17-17.0.4+8/src/hotspot/cpu/zero/frame_zero.inline.hpp openjdk-17-17.0.5+8/src/hotspot/cpu/zero/frame_zero.inline.hpp
--- openjdk-17-17.0.4+8/src/hotspot/cpu/zero/frame_zero.inline.hpp 2022-07-14 08:05:38.000000000 +0000
+++ openjdk-17-17.0.5+8/src/hotspot/cpu/zero/frame_zero.inline.hpp 2022-10-10 13:07:22.000000000 +0000
@@ -82,6 +82,11 @@
return NULL;
}
+inline intptr_t* frame::link_or_null() const {
+ ShouldNotCallThis();
+ return NULL;
+}
+
inline interpreterState frame::get_interpreterState() const {
return zero_interpreterframe()->interpreter_state();
}
diff -Nru openjdk-17-17.0.4+8/src/hotspot/cpu/zero/javaFrameAnchor_zero.hpp openjdk-17-17.0.5+8/src/hotspot/cpu/zero/javaFrameAnchor_zero.hpp
--- openjdk-17-17.0.4+8/src/hotspot/cpu/zero/javaFrameAnchor_zero.hpp 2022-07-14 08:05:38.000000000 +0000
+++ openjdk-17-17.0.5+8/src/hotspot/cpu/zero/javaFrameAnchor_zero.hpp 2022-10-10 13:07:22.000000000 +0000
@@ -73,7 +73,7 @@
return true;
}
- void make_walkable(JavaThread* thread) {
+ void make_walkable() {
// nothing to do
}
diff -Nru openjdk-17-17.0.4+8/src/hotspot/os/aix/os_aix.cpp openjdk-17-17.0.5+8/src/hotspot/os/aix/os_aix.cpp
--- openjdk-17-17.0.4+8/src/hotspot/os/aix/os_aix.cpp 2022-07-14 08:05:38.000000000 +0000
+++ openjdk-17-17.0.5+8/src/hotspot/os/aix/os_aix.cpp 2022-10-10 13:07:22.000000000 +0000
@@ -1161,7 +1161,7 @@
// RTLD_LAZY is currently not implemented. The dl is loaded immediately with all its dependants.
void * result= ::dlopen(filename, RTLD_LAZY);
if (result != NULL) {
- Events::log(NULL, "Loaded shared library %s", filename);
+ Events::log_dll_message(NULL, "Loaded shared library %s", filename);
// Reload dll cache. Don't do this in signal handling.
LoadedLibraries::reload();
log_info(os)("shared library load of %s was successful", filename);
@@ -1176,21 +1176,12 @@
snprintf(ebuf, ebuflen - 1, "%s, LIBPATH=%s, LD_LIBRARY_PATH=%s : %s",
filename, ::getenv("LIBPATH"), ::getenv("LD_LIBRARY_PATH"), error_report);
}
- Events::log(NULL, "Loading shared library %s failed, %s", filename, error_report);
+ Events::log_dll_message(NULL, "Loading shared library %s failed, %s", filename, error_report);
log_info(os)("shared library load of %s failed, %s", filename, error_report);
}
return NULL;
}
-void* os::dll_lookup(void* handle, const char* name) {
- void* res = dlsym(handle, name);
- return res;
-}
-
-void* os::get_default_process_handle() {
- return (void*)::dlopen(NULL, RTLD_LAZY);
-}
-
void os::print_dll_info(outputStream *st) {
st->print_cr("Dynamic libraries:");
LoadedLibraries::print(st);
@@ -2209,13 +2200,6 @@
return addr;
}
-// Sleep forever; naked call to OS-specific sleep; use with CAUTION
-void os::infinite_sleep() {
- while (true) { // sleep forever ...
- ::sleep(100); // ... 100 seconds at a time
- }
-}
-
// Used to convert frequent JVM_Yield() to nops
bool os::dont_yield() {
return DontYieldALot;
@@ -2551,47 +2535,6 @@
f(value, method, args, thread);
}
-void os::print_statistics() {
-}
-
-bool os::message_box(const char* title, const char* message) {
- int i;
- fdStream err(defaultStream::error_fd());
- for (i = 0; i < 78; i++) err.print_raw("=");
- err.cr();
- err.print_raw_cr(title);
- for (i = 0; i < 78; i++) err.print_raw("-");
- err.cr();
- err.print_raw_cr(message);
- for (i = 0; i < 78; i++) err.print_raw("=");
- err.cr();
-
- char buf[16];
- // Prevent process from exiting upon "read error" without consuming all CPU
- while (::read(0, buf, sizeof(buf)) <= 0) { ::sleep(100); }
-
- return buf[0] == 'y' || buf[0] == 'Y';
-}
-
-// Is a (classpath) directory empty?
-bool os::dir_is_empty(const char* path) {
- DIR *dir = NULL;
- struct dirent *ptr;
-
- dir = opendir(path);
- if (dir == NULL) return true;
-
- /* Scan the directory */
- bool result = true;
- while (result && (ptr = readdir(dir)) != NULL) {
- if (strcmp(ptr->d_name, ".") != 0 && strcmp(ptr->d_name, "..") != 0) {
- result = false;
- }
- }
- closedir(dir);
- return result;
-}
-
// This code originates from JDK's sysOpen and open64_w
// from src/solaris/hpi/src/system_md.c
diff -Nru openjdk-17-17.0.4+8/src/hotspot/os/bsd/os_bsd.cpp openjdk-17-17.0.5+8/src/hotspot/os/bsd/os_bsd.cpp
--- openjdk-17-17.0.4+8/src/hotspot/os/bsd/os_bsd.cpp 2022-07-14 08:05:38.000000000 +0000
+++ openjdk-17-17.0.5+8/src/hotspot/os/bsd/os_bsd.cpp 2022-10-10 13:07:22.000000000 +0000
@@ -1050,7 +1050,7 @@
void * result= ::dlopen(filename, RTLD_LAZY);
if (result != NULL) {
- Events::log(NULL, "Loaded shared library %s", filename);
+ Events::log_dll_message(NULL, "Loaded shared library %s", filename);
// Successful loading
log_info(os)("shared library load of %s was successful", filename);
return result;
@@ -1065,7 +1065,7 @@
::strncpy(ebuf, error_report, ebuflen-1);
ebuf[ebuflen-1]='\0';
}
- Events::log(NULL, "Loading shared library %s failed, %s", filename, error_report);
+ Events::log_dll_message(NULL, "Loading shared library %s failed, %s", filename, error_report);
log_info(os)("shared library load of %s failed, %s", filename, error_report);
return NULL;
@@ -1079,7 +1079,7 @@
log_info(os)("attempting shared library load of %s", filename);
void * result= ::dlopen(filename, RTLD_LAZY);
if (result != NULL) {
- Events::log(NULL, "Loaded shared library %s", filename);
+ Events::log_dll_message(NULL, "Loaded shared library %s", filename);
// Successful loading
log_info(os)("shared library load of %s was successful", filename);
return result;
@@ -1096,7 +1096,7 @@
::strncpy(ebuf, error_report, ebuflen-1);
ebuf[ebuflen-1]='\0';
}
- Events::log(NULL, "Loading shared library %s failed, %s", filename, error_report);
+ Events::log_dll_message(NULL, "Loading shared library %s failed, %s", filename, error_report);
log_info(os)("shared library load of %s failed, %s", filename, error_report);
int diag_msg_max_length=ebuflen-strlen(ebuf);
@@ -1256,22 +1256,6 @@
}
#endif // !__APPLE__
-void* os::get_default_process_handle() {
-#ifdef __APPLE__
- // MacOS X needs to use RTLD_FIRST instead of RTLD_LAZY
- // to avoid finding unexpected symbols on second (or later)
- // loads of a library.
- return (void*)::dlopen(NULL, RTLD_FIRST);
-#else
- return (void*)::dlopen(NULL, RTLD_LAZY);
-#endif
-}
-
-// XXX: Do we need a lock around this as per Linux?
-void* os::dll_lookup(void* handle, const char* name) {
- return dlsym(handle, name);
-}
-
int _print_dll_info_cb(const char * name, address base_address, address top_address, void * param) {
outputStream * out = (outputStream *) param;
out->print_cr(INTPTR_FORMAT " \t%s", (intptr_t)base_address, name);
@@ -1874,13 +1858,6 @@
return NULL;
}
-// Sleep forever; naked call to OS-specific sleep; use with CAUTION
-void os::infinite_sleep() {
- while (true) { // sleep forever ...
- ::sleep(100); // ... 100 seconds at a time
- }
-}
-
// Used to convert frequent JVM_Yield() to nops
bool os::dont_yield() {
return DontYieldALot;
@@ -2259,28 +2236,6 @@
f(value, method, args, thread);
}
-void os::print_statistics() {
-}
-
-bool os::message_box(const char* title, const char* message) {
- int i;
- fdStream err(defaultStream::error_fd());
- for (i = 0; i < 78; i++) err.print_raw("=");
- err.cr();
- err.print_raw_cr(title);
- for (i = 0; i < 78; i++) err.print_raw("-");
- err.cr();
- err.print_raw_cr(message);
- for (i = 0; i < 78; i++) err.print_raw("=");
- err.cr();
-
- char buf[16];
- // Prevent process from exiting upon "read error" without consuming all CPU
- while (::read(0, buf, sizeof(buf)) <= 0) { ::sleep(100); }
-
- return buf[0] == 'y' || buf[0] == 'Y';
-}
-
static inline struct timespec get_mtime(const char* filename) {
struct stat st;
int ret = os::stat(filename, &st);
@@ -2302,25 +2257,6 @@
return diff;
}
-// Is a (classpath) directory empty?
-bool os::dir_is_empty(const char* path) {
- DIR *dir = NULL;
- struct dirent *ptr;
-
- dir = opendir(path);
- if (dir == NULL) return true;
-
- // Scan the directory
- bool result = true;
- while (result && (ptr = readdir(dir)) != NULL) {
- if (strcmp(ptr->d_name, ".") != 0 && strcmp(ptr->d_name, "..") != 0) {
- result = false;
- }
- }
- closedir(dir);
- return result;
-}
-
// This code originates from JDK's sysOpen and open64_w
// from src/solaris/hpi/src/system_md.c
diff -Nru openjdk-17-17.0.4+8/src/hotspot/os/linux/cgroupSubsystem_linux.cpp openjdk-17-17.0.5+8/src/hotspot/os/linux/cgroupSubsystem_linux.cpp
--- openjdk-17-17.0.4+8/src/hotspot/os/linux/cgroupSubsystem_linux.cpp 2022-07-14 08:05:38.000000000 +0000
+++ openjdk-17-17.0.5+8/src/hotspot/os/linux/cgroupSubsystem_linux.cpp 2022-10-10 13:07:22.000000000 +0000
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2019, 2021, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2019, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -260,7 +260,13 @@
}
}
if (is_cgroupsV2) {
+ // On some systems we have mixed cgroups v1 and cgroups v2 controllers (e.g. freezer on cg1 and
+ // all relevant controllers on cg2). Only set the cgroup path when we see a hierarchy id of 0.
+ if (hierarchy_id != 0) {
+ continue;
+ }
for (int i = 0; i < CG_INFO_LENGTH; i++) {
+ assert(cg_infos[i]._cgroup_path == NULL, "cgroup path must only be set once");
cg_infos[i]._cgroup_path = os::strdup(cgroup_path);
}
}
@@ -495,7 +501,10 @@
cpu_count = limit_count = os::Linux::active_processor_count();
int quota = cpu_quota();
int period = cpu_period();
- int share = cpu_shares();
+
+ // It's not a good idea to use cpu_shares() to limit the number
+ // of CPUs used by the JVM. See JDK-8281181.
+ int share = UseContainerCpuShares ? cpu_shares() : -1;
if (quota > -1 && period > 0) {
quota_count = ceilf((float)quota / (float)period);
diff -Nru openjdk-17-17.0.4+8/src/hotspot/os/linux/cgroupV1Subsystem_linux.cpp openjdk-17-17.0.5+8/src/hotspot/os/linux/cgroupV1Subsystem_linux.cpp
--- openjdk-17-17.0.4+8/src/hotspot/os/linux/cgroupV1Subsystem_linux.cpp 2022-07-14 08:05:38.000000000 +0000
+++ openjdk-17-17.0.5+8/src/hotspot/os/linux/cgroupV1Subsystem_linux.cpp 2022-10-10 13:07:22.000000000 +0000
@@ -136,19 +136,39 @@
const char* matchline = "hierarchical_memsw_limit";
const char* format = "%s " JULONG_FORMAT;
GET_CONTAINER_INFO_LINE(julong, _memory->controller(), "/memory.stat", matchline,
- "Hierarchical Memory and Swap Limit is : " JULONG_FORMAT, format, hier_memlimit)
- if (hier_memlimit >= _unlimited_memory) {
+ "Hierarchical Memory and Swap Limit is : " JULONG_FORMAT, format, hier_memswlimit)
+ if (hier_memswlimit >= _unlimited_memory) {
log_trace(os, container)("Hierarchical Memory and Swap Limit is: Unlimited");
} else {
- return (jlong)hier_memlimit;
+ jlong swappiness = read_mem_swappiness();
+ if (swappiness == 0) {
+ const char* matchmemline = "hierarchical_memory_limit";
+ GET_CONTAINER_INFO_LINE(julong, _memory->controller(), "/memory.stat", matchmemline,
+ "Hierarchical Memory Limit is : " JULONG_FORMAT, format, hier_memlimit)
+ log_trace(os, container)("Memory and Swap Limit has been reset to " JULONG_FORMAT " because swappiness is 0", hier_memlimit);
+ return (jlong)hier_memlimit;
+ }
+ return (jlong)hier_memswlimit;
}
}
return (jlong)-1;
} else {
+ jlong swappiness = read_mem_swappiness();
+ if (swappiness == 0) {
+ jlong memlimit = read_memory_limit_in_bytes();
+ log_trace(os, container)("Memory and Swap Limit has been reset to " JULONG_FORMAT " because swappiness is 0", memlimit);
+ return memlimit;
+ }
return (jlong)memswlimit;
}
}
+jlong CgroupV1Subsystem::read_mem_swappiness() {
+ GET_CONTAINER_INFO(julong, _memory->controller(), "/memory.swappiness",
+ "Swappiness is: " JULONG_FORMAT, JULONG_FORMAT, swappiness);
+ return swappiness;
+}
+
jlong CgroupV1Subsystem::memory_soft_limit_in_bytes() {
GET_CONTAINER_INFO(julong, _memory->controller(), "/memory.soft_limit_in_bytes",
"Memory Soft Limit is: " JULONG_FORMAT, JULONG_FORMAT, memsoftlimit);
diff -Nru openjdk-17-17.0.4+8/src/hotspot/os/linux/cgroupV1Subsystem_linux.hpp openjdk-17-17.0.5+8/src/hotspot/os/linux/cgroupV1Subsystem_linux.hpp
--- openjdk-17-17.0.4+8/src/hotspot/os/linux/cgroupV1Subsystem_linux.hpp 2022-07-14 08:05:38.000000000 +0000
+++ openjdk-17-17.0.5+8/src/hotspot/os/linux/cgroupV1Subsystem_linux.hpp 2022-10-10 13:07:22.000000000 +0000
@@ -108,6 +108,8 @@
char * pids_max_val();
+ jlong read_mem_swappiness();
+
public:
CgroupV1Subsystem(CgroupV1Controller* cpuset,
CgroupV1Controller* cpu,
diff -Nru openjdk-17-17.0.4+8/src/hotspot/os/linux/globals_linux.hpp openjdk-17-17.0.5+8/src/hotspot/os/linux/globals_linux.hpp
--- openjdk-17-17.0.4+8/src/hotspot/os/linux/globals_linux.hpp 2022-07-14 08:05:38.000000000 +0000
+++ openjdk-17-17.0.5+8/src/hotspot/os/linux/globals_linux.hpp 2022-10-10 13:07:22.000000000 +0000
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2020, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2022, Oracle and/or its affiliates. All rights reserved.
* 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,6 +59,10 @@
product(bool, UseContainerSupport, true, \
"Enable detection and runtime container configuration support") \
\
+ product(bool, UseContainerCpuShares, false, \
+ "Include CPU shares in the CPU availability" \
+ " calculation.") \
+ \
product(bool, PreferContainerQuotaForCPUCount, true, \
"Calculate the container CPU availability based on the value" \
" of quotas (if set), when true. Otherwise, use the CPU" \
diff -Nru openjdk-17-17.0.4+8/src/hotspot/os/linux/os_linux.cpp openjdk-17-17.0.5+8/src/hotspot/os/linux/os_linux.cpp
--- openjdk-17-17.0.4+8/src/hotspot/os/linux/os_linux.cpp 2022-07-14 08:05:38.000000000 +0000
+++ openjdk-17-17.0.5+8/src/hotspot/os/linux/os_linux.cpp 2022-10-10 13:07:22.000000000 +0000
@@ -1818,10 +1818,10 @@
::strncpy(ebuf, error_report, ebuflen-1);
ebuf[ebuflen-1]='\0';
}
- Events::log(NULL, "Loading shared library %s failed, %s", filename, error_report);
+ Events::log_dll_message(NULL, "Loading shared library %s failed, %s", filename, error_report);
log_info(os)("shared library load of %s failed, %s", filename, error_report);
} else {
- Events::log(NULL, "Loaded shared library %s", filename);
+ Events::log_dll_message(NULL, "Loaded shared library %s", filename);
log_info(os)("shared library load of %s was successful", filename);
}
return result;
@@ -1857,13 +1857,16 @@
return result;
}
-void* os::dll_lookup(void* handle, const char* name) {
- void* res = dlsym(handle, name);
- return res;
-}
-
-void* os::get_default_process_handle() {
- return (void*)::dlopen(NULL, RTLD_LAZY);
+const char* os::Linux::dll_path(void* lib) {
+ struct link_map *lmap;
+ const char* l_path = NULL;
+ assert(lib != NULL, "dll_path parameter must not be NULL");
+
+ int res_dli = ::dlinfo(lib, RTLD_DI_LINKMAP, &lmap);
+ if (res_dli == 0) {
+ l_path = lmap->l_name;
+ }
+ return l_path;
}
static bool _print_ascii_file(const char* filename, outputStream* st, const char* hdr = NULL) {
@@ -4251,13 +4254,6 @@
return NULL;
}
-// Sleep forever; naked call to OS-specific sleep; use with CAUTION
-void os::infinite_sleep() {
- while (true) { // sleep forever ...
- ::sleep(100); // ... 100 seconds at a time
- }
-}
-
// Used to convert frequent JVM_Yield() to nops
bool os::dont_yield() {
return DontYieldALot;
@@ -4685,7 +4681,8 @@
// dynamic check - see 6515172 for details.
// If anything goes wrong we fallback to returning the number of online
// processors - which can be greater than the number available to the process.
-int os::Linux::active_processor_count() {
+static int get_active_processor_count() {
+ // Note: keep this function, with its CPU_xx macros, *outside* the os namespace (see JDK-8289477).
cpu_set_t cpus; // can represent at most 1024 (CPU_SETSIZE) processors
cpu_set_t* cpus_p = &cpus;
int cpus_size = sizeof(cpu_set_t);
@@ -4757,6 +4754,10 @@
return cpu_count;
}
+int os::Linux::active_processor_count() {
+ return get_active_processor_count();
+}
+
// Determine the active processor count from one of
// three different sources:
//
@@ -4904,47 +4905,6 @@
f(value, method, args, thread);
}
-void os::print_statistics() {
-}
-
-bool os::message_box(const char* title, const char* message) {
- int i;
- fdStream err(defaultStream::error_fd());
- for (i = 0; i < 78; i++) err.print_raw("=");
- err.cr();
- err.print_raw_cr(title);
- for (i = 0; i < 78; i++) err.print_raw("-");
- err.cr();
- err.print_raw_cr(message);
- for (i = 0; i < 78; i++) err.print_raw("=");
- err.cr();
-
- char buf[16];
- // Prevent process from exiting upon "read error" without consuming all CPU
- while (::read(0, buf, sizeof(buf)) <= 0) { ::sleep(100); }
-
- return buf[0] == 'y' || buf[0] == 'Y';
-}
-
-// Is a (classpath) directory empty?
-bool os::dir_is_empty(const char* path) {
- DIR *dir = NULL;
- struct dirent *ptr;
-
- dir = opendir(path);
- if (dir == NULL) return true;
-
- // Scan the directory
- bool result = true;
- while (result && (ptr = readdir(dir)) != NULL) {
- if (strcmp(ptr->d_name, ".") != 0 && strcmp(ptr->d_name, "..") != 0) {
- result = false;
- }
- }
- closedir(dir);
- return result;
-}
-
// This code originates from JDK's sysOpen and open64_w
// from src/solaris/hpi/src/system_md.c
diff -Nru openjdk-17-17.0.4+8/src/hotspot/os/linux/os_linux.hpp openjdk-17-17.0.5+8/src/hotspot/os/linux/os_linux.hpp
--- openjdk-17-17.0.4+8/src/hotspot/os/linux/os_linux.hpp 2022-07-14 08:05:38.000000000 +0000
+++ openjdk-17-17.0.5+8/src/hotspot/os/linux/os_linux.hpp 2022-10-10 13:07:22.000000000 +0000
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2021, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -120,6 +120,7 @@
static bool _stack_is_executable;
static void *dlopen_helper(const char *name, char *ebuf, int ebuflen);
static void *dll_load_in_vmthread(const char *name, char *ebuf, int ebuflen);
+ static const char *dll_path(void* lib);
static void init_thread_fpu_state();
static int get_fpu_control_word();
diff -Nru openjdk-17-17.0.4+8/src/hotspot/os/posix/os_posix.cpp openjdk-17-17.0.5+8/src/hotspot/os/posix/os_posix.cpp
--- openjdk-17-17.0.4+8/src/hotspot/os/posix/os_posix.cpp 2022-07-14 08:05:38.000000000 +0000
+++ openjdk-17-17.0.5+8/src/hotspot/os/posix/os_posix.cpp 2022-10-10 13:07:22.000000000 +0000
@@ -45,6 +45,7 @@
#include "runtime/orderAccess.hpp"
#include "runtime/perfMemory.hpp"
#include "utilities/align.hpp"
+#include "utilities/defaultStream.hpp"
#include "utilities/events.hpp"
#include "utilities/formatBuffer.hpp"
#include "utilities/macros.hpp"
@@ -236,6 +237,25 @@
return fd;
}
+// Is a (classpath) directory empty?
+bool os::dir_is_empty(const char* path) {
+ DIR *dir = NULL;
+ struct dirent *ptr;
+
+ dir = ::opendir(path);
+ if (dir == NULL) return true;
+
+ // Scan the directory
+ bool result = true;
+ while (result && (ptr = ::readdir(dir)) != NULL) {
+ if (strcmp(ptr->d_name, ".") != 0 && strcmp(ptr->d_name, "..") != 0) {
+ result = false;
+ }
+ }
+ ::closedir(dir);
+ return result;
+}
+
static char* reserve_mmapped_memory(size_t bytes, char* requested_addr) {
char * addr;
int flags = MAP_PRIVATE NOT_AIX( | MAP_NORESERVE ) | MAP_ANONYMOUS;
@@ -633,8 +653,42 @@
#endif
}
+void* os::get_default_process_handle() {
+#ifdef __APPLE__
+ // MacOS X needs to use RTLD_FIRST instead of RTLD_LAZY
+ // to avoid finding unexpected symbols on second (or later)
+ // loads of a library.
+ return (void*)::dlopen(NULL, RTLD_FIRST);
+#else
+ return (void*)::dlopen(NULL, RTLD_LAZY);
+#endif
+}
+
+void* os::dll_lookup(void* handle, const char* name) {
+ return dlsym(handle, name);
+}
+
void os::dll_unload(void *lib) {
- ::dlclose(lib);
+ const char* l_path = LINUX_ONLY(os::Linux::dll_path(lib))
+ NOT_LINUX("");
+ if (l_path == NULL) l_path = "";
+ int res = ::dlclose(lib);
+
+ if (res == 0) {
+ Events::log_dll_message(NULL, "Unloaded shared library \"%s\" [" INTPTR_FORMAT "]",
+ l_path, p2i(lib));
+ log_info(os)("Unloaded shared library \"%s\" [" INTPTR_FORMAT "]", l_path, p2i(lib));
+ } else {
+ const char* error_report = ::dlerror();
+ if (error_report == NULL) {
+ error_report = "dlerror returned no error description";
+ }
+
+ Events::log_dll_message(NULL, "Attempt to unload shared library \"%s\" [" INTPTR_FORMAT "] failed, %s",
+ l_path, p2i(lib), error_report);
+ log_info(os)("Attempt to unload shared library \"%s\" [" INTPTR_FORMAT "] failed, %s",
+ l_path, p2i(lib), error_report);
+ }
}
jlong os::lseek(int fd, jlong offset, int whence) {
@@ -771,6 +825,12 @@
return agent_entry_name;
}
+// Sleep forever; naked call to OS-specific sleep; use with CAUTION
+void os::infinite_sleep() {
+ while (true) { // sleep forever ...
+ ::sleep(100); // ... 100 seconds at a time
+ }
+}
void os::naked_short_nanosleep(jlong ns) {
struct timespec req;
@@ -1936,6 +1996,25 @@
}
}
+bool os::message_box(const char* title, const char* message) {
+ int i;
+ fdStream err(defaultStream::error_fd());
+ for (i = 0; i < 78; i++) err.print_raw("=");
+ err.cr();
+ err.print_raw_cr(title);
+ for (i = 0; i < 78; i++) err.print_raw("-");
+ err.cr();
+ err.print_raw_cr(message);
+ for (i = 0; i < 78; i++) err.print_raw("=");
+ err.cr();
+
+ char buf[16];
+ // Prevent process from exiting upon "read error" without consuming all CPU
+ while (::read(0, buf, sizeof(buf)) <= 0) { ::sleep(100); }
+
+ return buf[0] == 'y' || buf[0] == 'Y';
+}
+
////////////////////////////////////////////////////////////////////////////////
// runtime exit support
diff -Nru openjdk-17-17.0.4+8/src/hotspot/os/windows/os_windows.cpp openjdk-17-17.0.5+8/src/hotspot/os/windows/os_windows.cpp
--- openjdk-17-17.0.4+8/src/hotspot/os/windows/os_windows.cpp 2022-07-14 08:05:38.000000000 +0000
+++ openjdk-17-17.0.5+8/src/hotspot/os/windows/os_windows.cpp 2022-10-10 13:07:22.000000000 +0000
@@ -22,8 +22,7 @@
*
*/
-// Must be at least Windows Vista or Server 2008 to use InitOnceExecuteOnce
-#define _WIN32_WINNT 0x0600
+// API level must be at least Windows Vista or Server 2008 to use InitOnceExecuteOnce
// no precompiled headers
#include "jvm.h"
@@ -1255,7 +1254,18 @@
const char* os::dll_file_extension() { return ".dll"; }
void os::dll_unload(void *lib) {
- ::FreeLibrary((HMODULE)lib);
+ char name[MAX_PATH];
+ if (::GetModuleFileName((HMODULE)lib, name, sizeof(name)) == 0) {
+ snprintf(name, MAX_PATH, "");
+ }
+ if (::FreeLibrary((HMODULE)lib)) {
+ Events::log_dll_message(NULL, "Unloaded dll \"%s\" [" INTPTR_FORMAT "]", name, p2i(lib));
+ log_info(os)("Unloaded dll \"%s\" [" INTPTR_FORMAT "]", name, p2i(lib));
+ } else {
+ const DWORD errcode = ::GetLastError();
+ Events::log_dll_message(NULL, "Attempt to unload dll \"%s\" [" INTPTR_FORMAT "] failed (error code %d)", name, p2i(lib), errcode);
+ log_info(os)("Attempt to unload dll \"%s\" [" INTPTR_FORMAT "] failed (error code %d)", name, p2i(lib), errcode);
+ }
}
void* os::dll_lookup(void *lib, const char *name) {
@@ -1526,7 +1536,7 @@
void * result = LoadLibrary(name);
if (result != NULL) {
- Events::log(NULL, "Loaded shared library %s", name);
+ Events::log_dll_message(NULL, "Loaded shared library %s", name);
// Recalculate pdb search path if a DLL was loaded successfully.
SymbolEngine::recalc_search_path();
log_info(os)("shared library load of %s was successful", name);
@@ -1537,7 +1547,7 @@
// It may or may not be overwritten below (in the for loop and just above)
lasterror(ebuf, (size_t) ebuflen);
ebuf[ebuflen - 1] = '\0';
- Events::log(NULL, "Loading shared library %s failed, error code %lu", name, errcode);
+ Events::log_dll_message(NULL, "Loading shared library %s failed, error code %lu", name, errcode);
log_info(os)("shared library load of %s failed, error code %lu", name, errcode);
if (errcode == ERROR_MOD_NOT_FOUND) {
@@ -3453,9 +3463,6 @@
return pd_release_memory(base, bytes);
}
-void os::print_statistics() {
-}
-
static void warn_fail_commit_memory(char* addr, size_t bytes, bool exec) {
int err = os::get_last_error();
char buf[256];
diff -Nru openjdk-17-17.0.4+8/src/hotspot/os_cpu/aix_ppc/thread_aix_ppc.cpp openjdk-17-17.0.5+8/src/hotspot/os_cpu/aix_ppc/thread_aix_ppc.cpp
--- openjdk-17-17.0.4+8/src/hotspot/os_cpu/aix_ppc/thread_aix_ppc.cpp 2022-07-14 08:05:38.000000000 +0000
+++ openjdk-17-17.0.5+8/src/hotspot/os_cpu/aix_ppc/thread_aix_ppc.cpp 2022-10-10 13:07:22.000000000 +0000
@@ -30,7 +30,7 @@
frame JavaThread::pd_last_frame() {
assert(has_last_Java_frame(), "must have last_Java_sp() when suspended");
- intptr_t* sp = last_Java_sp();
+ intptr_t* sp = Atomic::load_acquire(&_anchor._last_Java_sp);
address pc = _anchor.last_Java_pc();
// Last_Java_pc ist not set, if we come here from compiled code.
diff -Nru openjdk-17-17.0.4+8/src/hotspot/os_cpu/linux_ppc/thread_linux_ppc.cpp openjdk-17-17.0.5+8/src/hotspot/os_cpu/linux_ppc/thread_linux_ppc.cpp
--- openjdk-17-17.0.4+8/src/hotspot/os_cpu/linux_ppc/thread_linux_ppc.cpp 2022-07-14 08:05:38.000000000 +0000
+++ openjdk-17-17.0.5+8/src/hotspot/os_cpu/linux_ppc/thread_linux_ppc.cpp 2022-10-10 13:07:22.000000000 +0000
@@ -31,7 +31,7 @@
frame JavaThread::pd_last_frame() {
assert(has_last_Java_frame(), "must have last_Java_sp() when suspended");
- intptr_t* sp = last_Java_sp();
+ intptr_t* sp = Atomic::load_acquire(&_anchor._last_Java_sp);
address pc = _anchor.last_Java_pc();
// Last_Java_pc ist not set, if we come here from compiled code.
diff -Nru openjdk-17-17.0.4+8/src/hotspot/share/c1/c1_GraphBuilder.cpp openjdk-17-17.0.5+8/src/hotspot/share/c1/c1_GraphBuilder.cpp
--- openjdk-17-17.0.4+8/src/hotspot/share/c1/c1_GraphBuilder.cpp 2022-07-14 08:05:38.000000000 +0000
+++ openjdk-17-17.0.5+8/src/hotspot/share/c1/c1_GraphBuilder.cpp 2022-10-10 13:07:22.000000000 +0000
@@ -213,8 +213,10 @@
}
void BlockListBuilder::handle_jsr(BlockBegin* current, int sr_bci, int next_bci) {
- // start a new block after jsr-bytecode and link this block into cfg
- make_block_at(next_bci, current);
+ if (next_bci < method()->code_size()) {
+ // start a new block after jsr-bytecode and link this block into cfg
+ make_block_at(next_bci, current);
+ }
// start a new block at the subroutine entry at mark it with special flag
BlockBegin* sr_block = make_block_at(sr_bci, current);
@@ -234,6 +236,8 @@
// branch target and a modification of the successor lists.
const BitMap& bci_block_start = method()->bci_block_start();
+ int end_bci = method()->code_size();
+
ciBytecodeStream s(method());
while (s.next() != ciBytecodeStream::EOBC()) {
int cur_bci = s.cur_bci();
@@ -304,7 +308,9 @@
case Bytecodes::_if_acmpne: // fall through
case Bytecodes::_ifnull: // fall through
case Bytecodes::_ifnonnull:
- make_block_at(s.next_bci(), current);
+ if (s.next_bci() < end_bci) {
+ make_block_at(s.next_bci(), current);
+ }
make_block_at(s.get_dest(), current);
current = NULL;
break;
@@ -4045,20 +4051,28 @@
const int args_base = state()->stack_size() - callee->arg_size();
ValueType* type = state()->stack_at(args_base)->type();
if (type->is_constant()) {
- ciMethod* target = type->as_ObjectType()->constant_value()->as_method_handle()->get_vmtarget();
- // We don't do CHA here so only inline static and statically bindable methods.
- if (target->is_static() || target->can_be_statically_bound()) {
- if (ciMethod::is_consistent_info(callee, target)) {
- Bytecodes::Code bc = target->is_static() ? Bytecodes::_invokestatic : Bytecodes::_invokevirtual;
- ignore_return = ignore_return || (callee->return_type()->is_void() && !target->return_type()->is_void());
- if (try_inline(target, /*holder_known*/ !callee->is_static(), ignore_return, bc)) {
- return true;
+ ciObject* mh = type->as_ObjectType()->constant_value();
+ if (mh->is_method_handle()) {
+ ciMethod* target = mh->as_method_handle()->get_vmtarget();
+
+ // We don't do CHA here so only inline static and statically bindable methods.
+ if (target->is_static() || target->can_be_statically_bound()) {
+ if (ciMethod::is_consistent_info(callee, target)) {
+ Bytecodes::Code bc = target->is_static() ? Bytecodes::_invokestatic : Bytecodes::_invokevirtual;
+ ignore_return = ignore_return || (callee->return_type()->is_void() && !target->return_type()->is_void());
+ if (try_inline(target, /*holder_known*/ !callee->is_static(), ignore_return, bc)) {
+ return true;
+ }
+ } else {
+ print_inlining(target, "signatures mismatch", /*success*/ false);
}
} else {
- print_inlining(target, "signatures mismatch", /*success*/ false);
+ assert(false, "no inlining through MH::invokeBasic"); // missing optimization opportunity due to suboptimal LF shape
+ print_inlining(target, "not static or statically bindable", /*success*/ false);
}
} else {
- print_inlining(target, "not static or statically bindable", /*success*/ false);
+ assert(mh->is_null_object(), "not a null");
+ print_inlining(callee, "receiver is always null", /*success*/ false);
}
} else {
print_inlining(callee, "receiver not constant", /*success*/ false);
diff -Nru openjdk-17-17.0.4+8/src/hotspot/share/c1/c1_LIRGenerator.cpp openjdk-17-17.0.5+8/src/hotspot/share/c1/c1_LIRGenerator.cpp
--- openjdk-17-17.0.4+8/src/hotspot/share/c1/c1_LIRGenerator.cpp 2022-07-14 08:05:38.000000000 +0000
+++ openjdk-17-17.0.5+8/src/hotspot/share/c1/c1_LIRGenerator.cpp 2022-10-10 13:07:22.000000000 +0000
@@ -1311,20 +1311,27 @@
info = state_for(x);
}
- LabelObj* L_not_prim = new LabelObj();
- LabelObj* L_done = new LabelObj();
+ // While reading off the universal constant mirror is less efficient than doing
+ // another branch and returning the constant answer, this branchless code runs into
+ // much less risk of confusion for C1 register allocator. The choice of the universe
+ // object here is correct as long as it returns the same modifiers we would expect
+ // from the primitive class itself. See spec for Class.getModifiers that provides
+ // the typed array klasses with similar modifiers as their component types.
+ Klass* univ_klass_obj = Universe::byteArrayKlassObj();
+ assert(univ_klass_obj->modifier_flags() == (JVM_ACC_ABSTRACT | JVM_ACC_FINAL | JVM_ACC_PUBLIC), "Sanity");
+ LIR_Opr prim_klass = LIR_OprFact::metadataConst(univ_klass_obj);
+
+ LIR_Opr recv_klass = new_register(T_METADATA);
+ __ move(new LIR_Address(receiver.result(), java_lang_Class::klass_offset(), T_ADDRESS), recv_klass, info);
+
+ // Check if this is a Java mirror of primitive type, and select the appropriate klass.
LIR_Opr klass = new_register(T_METADATA);
- // Checking if it's a java mirror of primitive type
- __ move(new LIR_Address(receiver.result(), java_lang_Class::klass_offset(), T_ADDRESS), klass, info);
- __ cmp(lir_cond_notEqual, klass, LIR_OprFact::metadataConst(0));
- __ branch(lir_cond_notEqual, L_not_prim->label());
- __ move(LIR_OprFact::intConst(JVM_ACC_ABSTRACT | JVM_ACC_FINAL | JVM_ACC_PUBLIC), result);
- __ branch(lir_cond_always, L_done->label());
+ __ cmp(lir_cond_equal, recv_klass, LIR_OprFact::metadataConst(0));
+ __ cmove(lir_cond_equal, prim_klass, recv_klass, klass, T_ADDRESS);
- __ branch_destination(L_not_prim->label());
+ // Get the answer.
__ move(new LIR_Address(klass, in_bytes(Klass::modifier_flags_offset()), T_INT), result);
- __ branch_destination(L_done->label());
}
// Example: Thread.currentThread()
diff -Nru openjdk-17-17.0.4+8/src/hotspot/share/c1/c1_LIR.hpp openjdk-17-17.0.5+8/src/hotspot/share/c1/c1_LIR.hpp
--- openjdk-17-17.0.4+8/src/hotspot/share/c1/c1_LIR.hpp 2022-07-14 08:05:38.000000000 +0000
+++ openjdk-17-17.0.5+8/src/hotspot/share/c1/c1_LIR.hpp 2022-10-10 13:07:22.000000000 +0000
@@ -231,13 +231,13 @@
, is_xmm_bits = 1
, last_use_bits = 1
, is_fpu_stack_offset_bits = 1 // used in assertion checking on x86 for FPU stack slot allocation
- , non_data_bits = pointer_bits + kind_bits + type_bits + size_bits + destroys_bits + virtual_bits
+ , non_data_bits = kind_bits + type_bits + size_bits + destroys_bits + virtual_bits
+ is_xmm_bits + last_use_bits + is_fpu_stack_offset_bits
, data_bits = BitsPerInt - non_data_bits
, reg_bits = data_bits / 2 // for two registers in one value encoding
};
- enum OprShift {
+ enum OprShift : uintptr_t {
kind_shift = 0
, type_shift = kind_shift + kind_bits
, size_shift = type_shift + type_bits
@@ -270,7 +270,7 @@
, no_type_mask = (int)(~(type_mask | last_use_mask | is_fpu_stack_offset_mask))
};
- uintptr_t data() const { return value() >> data_shift; }
+ uint32_t data() const { return (uint32_t)value() >> data_shift; }
int lo_reg_half() const { return data() & lower_reg_mask; }
int hi_reg_half() const { return (data() >> reg_bits) & lower_reg_mask; }
OprKind kind_field() const { return (OprKind)(value() & kind_mask); }
@@ -281,7 +281,9 @@
public:
enum {
vreg_base = ConcreteRegisterImpl::number_of_registers,
- vreg_max = (1 << data_bits) - 1
+ data_max = (1 << data_bits) - 1, // max unsigned value for data bit field
+ vreg_limit = 10000, // choose a reasonable limit,
+ vreg_max = MIN2(vreg_limit, data_max) // and make sure if fits in the bit field
};
static inline LIR_Opr illegalOpr();
@@ -736,7 +738,6 @@
res->validate_type();
assert(res->vreg_number() == index, "conversion check");
assert(index >= LIR_OprDesc::vreg_base, "must start at vreg_base");
- assert(index <= (max_jint >> LIR_OprDesc::data_shift), "index is too big");
// old-style calculation; check if old and new method are equal
LIR_OprDesc::OprType t = as_OprType(type);
@@ -815,7 +816,7 @@
#ifdef ASSERT
assert(index >= 0, "index must be positive");
- assert(index <= (max_jint >> LIR_OprDesc::data_shift), "index is too big");
+ assert(index == (int)res->data(), "conversion check");
LIR_Opr old_res = (LIR_Opr)(intptr_t)((index << LIR_OprDesc::data_shift) |
LIR_OprDesc::stack_value |
@@ -2314,7 +2315,7 @@
typedef enum { inputMode, firstMode = inputMode, tempMode, outputMode, numModes, invalidMode = -1 } OprMode;
enum {
- maxNumberOfOperands = 20,
+ maxNumberOfOperands = 21,
maxNumberOfInfos = 4
};
diff -Nru openjdk-17-17.0.4+8/src/hotspot/share/ci/ciInstanceKlass.cpp openjdk-17-17.0.5+8/src/hotspot/share/ci/ciInstanceKlass.cpp
--- openjdk-17-17.0.4+8/src/hotspot/share/ci/ciInstanceKlass.cpp 2022-07-14 08:05:38.000000000 +0000
+++ openjdk-17-17.0.5+8/src/hotspot/share/ci/ciInstanceKlass.cpp 2022-10-10 13:07:22.000000000 +0000
@@ -638,8 +638,10 @@
ciInstanceKlass* ciInstanceKlass::implementor() {
ciInstanceKlass* impl = _implementor;
if (impl == NULL) {
- // Go into the VM to fetch the implementor.
- {
+ if (is_shared()) {
+ impl = this; // assume a well-known interface never has a unique implementor
+ } else {
+ // Go into the VM to fetch the implementor.
VM_ENTRY_MARK;
MutexLocker ml(Compile_lock);
Klass* k = get_instanceKlass()->implementor();
@@ -653,9 +655,7 @@
}
}
// Memoize this result.
- if (!is_shared()) {
- _implementor = impl;
- }
+ _implementor = impl;
}
return impl;
}
diff -Nru openjdk-17-17.0.4+8/src/hotspot/share/ci/ciMethodBlocks.cpp openjdk-17-17.0.5+8/src/hotspot/share/ci/ciMethodBlocks.cpp
--- openjdk-17-17.0.4+8/src/hotspot/share/ci/ciMethodBlocks.cpp 2022-07-14 08:05:38.000000000 +0000
+++ openjdk-17-17.0.5+8/src/hotspot/share/ci/ciMethodBlocks.cpp 2022-10-10 13:07:22.000000000 +0000
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2006, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2006, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -33,12 +33,13 @@
ciBlock *ciMethodBlocks::block_containing(int bci) {
+ assert(bci >= 0 && bci < _code_size, "valid bytecode range");
ciBlock *blk = _bci_to_block[bci];
return blk;
}
bool ciMethodBlocks::is_block_start(int bci) {
- assert(bci >=0 && bci < _code_size, "valid bytecode range");
+ assert(bci >= 0 && bci < _code_size, "valid bytecode range");
ciBlock *b = _bci_to_block[bci];
assert(b != NULL, "must have block for bytecode");
return b->start_bci() == bci;
@@ -146,7 +147,9 @@
case Bytecodes::_ifnonnull :
{
cur_block->set_control_bci(bci);
- ciBlock *fall_through = make_block_at(s.next_bci());
+ if (s.next_bci() < limit_bci) {
+ ciBlock *fall_through = make_block_at(s.next_bci());
+ }
int dest_bci = s.get_dest();
ciBlock *dest = make_block_at(dest_bci);
break;
@@ -166,7 +169,9 @@
case Bytecodes::_jsr :
{
cur_block->set_control_bci(bci);
- ciBlock *ret = make_block_at(s.next_bci());
+ if (s.next_bci() < limit_bci) {
+ ciBlock *ret = make_block_at(s.next_bci());
+ }
int dest_bci = s.get_dest();
ciBlock *dest = make_block_at(dest_bci);
break;
@@ -224,7 +229,9 @@
case Bytecodes::_jsr_w :
{
cur_block->set_control_bci(bci);
- ciBlock *ret = make_block_at(s.next_bci());
+ if (s.next_bci() < limit_bci) {
+ ciBlock *ret = make_block_at(s.next_bci());
+ }
int dest_bci = s.get_far_dest();
ciBlock *dest = make_block_at(dest_bci);
break;
diff -Nru openjdk-17-17.0.4+8/src/hotspot/share/classfile/classLoaderData.cpp openjdk-17-17.0.5+8/src/hotspot/share/classfile/classLoaderData.cpp
--- openjdk-17-17.0.4+8/src/hotspot/share/classfile/classLoaderData.cpp 2022-07-14 08:05:38.000000000 +0000
+++ openjdk-17-17.0.5+8/src/hotspot/share/classfile/classLoaderData.cpp 2022-10-10 13:07:22.000000000 +0000
@@ -968,11 +968,13 @@
out->print_cr(" - keep alive %d", _keep_alive);
out->print (" - claim ");
switch(_claim) {
- case _claim_none: out->print_cr("none"); break;
- case _claim_finalizable:out->print_cr("finalizable"); break;
- case _claim_strong: out->print_cr("strong"); break;
- case _claim_other: out->print_cr("other"); break;
- default: ShouldNotReachHere();
+ case _claim_none: out->print_cr("none"); break;
+ case _claim_finalizable: out->print_cr("finalizable"); break;
+ case _claim_strong: out->print_cr("strong"); break;
+ case _claim_other: out->print_cr("other"); break;
+ case _claim_other | _claim_finalizable: out->print_cr("other and finalizable"); break;
+ case _claim_other | _claim_strong: out->print_cr("other and strong"); break;
+ default: ShouldNotReachHere();
}
out->print_cr(" - handles %d", _handles.count());
out->print_cr(" - dependency count %d", _dependency_count);
diff -Nru openjdk-17-17.0.4+8/src/hotspot/share/classfile/verifier.cpp openjdk-17-17.0.5+8/src/hotspot/share/classfile/verifier.cpp
--- openjdk-17-17.0.4+8/src/hotspot/share/classfile/verifier.cpp 2022-07-14 08:05:38.000000000 +0000
+++ openjdk-17-17.0.5+8/src/hotspot/share/classfile/verifier.cpp 2022-10-10 13:07:22.000000000 +0000
@@ -2947,15 +2947,15 @@
_klass, ref_class, method_name, method_sig, true)) {
// It's protected access, check if stack object is
// assignable to current class.
- bool is_assignable = current_type().is_assignable_from(
- stack_object_type, this, true, CHECK_VERIFY(this));
- if (!is_assignable) {
- if (ref_class_type.name() == vmSymbols::java_lang_Object()
- && stack_object_type.is_array()
- && method_name == vmSymbols::clone_name()) {
- // Special case: arrays pretend to implement public Object
- // clone().
- } else {
+ if (ref_class_type.name() == vmSymbols::java_lang_Object()
+ && stack_object_type.is_array()
+ && method_name == vmSymbols::clone_name()) {
+ // Special case: arrays pretend to implement public Object
+ // clone().
+ } else {
+ bool is_assignable = current_type().is_assignable_from(
+ stack_object_type, this, true, CHECK_VERIFY(this));
+ if (!is_assignable) {
verify_error(ErrorContext::bad_type(bci,
current_frame->stack_top_ctx(),
TypeOrigin::implicit(current_type())),
diff -Nru openjdk-17-17.0.4+8/src/hotspot/share/code/codeCache.cpp openjdk-17-17.0.5+8/src/hotspot/share/code/codeCache.cpp
--- openjdk-17-17.0.4+8/src/hotspot/share/code/codeCache.cpp 2022-07-14 08:05:38.000000000 +0000
+++ openjdk-17-17.0.5+8/src/hotspot/share/code/codeCache.cpp 2022-10-10 13:07:22.000000000 +0000
@@ -630,14 +630,23 @@
return contains((void *)nm);
}
+static bool is_in_asgct() {
+ Thread* current_thread = Thread::current_or_null_safe();
+ return current_thread != NULL && current_thread->is_Java_thread() && current_thread->as_Java_thread()->in_asgct();
+}
+
// This method is safe to call without holding the CodeCache_lock, as long as a dead CodeBlob is not
// looked up (i.e., one that has been marked for deletion). It only depends on the _segmap to contain
// valid indices, which it will always do, as long as the CodeBlob is not in the process of being recycled.
CodeBlob* CodeCache::find_blob(void* start) {
CodeBlob* result = find_blob_unsafe(start);
// We could potentially look up non_entrant methods
- guarantee(result == NULL || !result->is_zombie() || result->is_locked_by_vm() || VMError::is_error_reported(), "unsafe access to zombie method");
- return result;
+ bool is_zombie = result != NULL && result->is_zombie();
+ bool is_result_safe = !is_zombie || result->is_locked_by_vm() || VMError::is_error_reported();
+ guarantee(is_result_safe || is_in_asgct(), "unsafe access to zombie method");
+ // When in ASGCT the previous gurantee will pass for a zombie method but we still don't want that code blob returned in order
+ // to minimize the chance of accessing dead memory
+ return is_result_safe ? result : NULL;
}
// Lookup that does not fail if you lookup a zombie method (if you call this, be sure to know
diff -Nru openjdk-17-17.0.4+8/src/hotspot/share/compiler/compilationPolicy.cpp openjdk-17-17.0.5+8/src/hotspot/share/compiler/compilationPolicy.cpp
--- openjdk-17-17.0.4+8/src/hotspot/share/compiler/compilationPolicy.cpp 2022-07-14 08:05:38.000000000 +0000
+++ openjdk-17-17.0.5+8/src/hotspot/share/compiler/compilationPolicy.cpp 2022-10-10 13:07:22.000000000 +0000
@@ -191,7 +191,7 @@
// Simple methods are as good being compiled with C1 as C2.
// Determine if a given method is such a case.
-bool CompilationPolicy::is_trivial(Method* method) {
+bool CompilationPolicy::is_trivial(const methodHandle& method) {
if (method->is_accessor() ||
method->is_constant_getter()) {
return true;
@@ -245,7 +245,7 @@
}
}
- static bool apply(int i, int b, CompLevel cur_level, const methodHandle& method) {
+ static bool apply(const methodHandle& method, CompLevel cur_level, int i, int b) {
double k = 1;
switch(cur_level) {
case CompLevel_none:
@@ -285,7 +285,7 @@
}
}
- static bool apply(int i, int b, CompLevel cur_level, const methodHandle& method) {
+ static bool apply(const methodHandle& method, CompLevel cur_level, int i, int b) {
double k = 1;
switch(cur_level) {
case CompLevel_none:
@@ -596,7 +596,7 @@
}
// Set carry flags on the counters if necessary
-void CompilationPolicy::handle_counter_overflow(Method* method) {
+void CompilationPolicy::handle_counter_overflow(const methodHandle& method) {
MethodCounters *mcs = method->method_counters();
if (mcs != NULL) {
mcs->invocation_counter()->set_carry_on_overflow();
@@ -619,21 +619,25 @@
// Iterate through the queue and find a method with a maximum rate.
for (CompileTask* task = compile_queue->first(); task != NULL;) {
CompileTask* next_task = task->next();
- Method* method = task->method();
// If a method was unloaded or has been stale for some time, remove it from the queue.
// Blocking tasks and tasks submitted from whitebox API don't become stale
- if (task->is_unloaded() || (task->can_become_stale() && is_stale(t, TieredCompileTaskTimeout, method) && !is_old(method))) {
- if (!task->is_unloaded()) {
- if (PrintTieredEvents) {
- print_event(REMOVE_FROM_QUEUE, method, method, task->osr_bci(), (CompLevel) task->comp_level());
- }
- method->clear_queued_for_compilation();
+ if (task->is_unloaded()) {
+ compile_queue->remove_and_mark_stale(task);
+ task = next_task;
+ continue;
+ }
+ Method* method = task->method();
+ methodHandle mh(Thread::current(), method);
+ if (task->can_become_stale() && is_stale(t, TieredCompileTaskTimeout, mh) && !is_old(mh)) {
+ if (PrintTieredEvents) {
+ print_event(REMOVE_FROM_QUEUE, method, method, task->osr_bci(), (CompLevel) task->comp_level());
}
+ method->clear_queued_for_compilation();
compile_queue->remove_and_mark_stale(task);
task = next_task;
continue;
}
- update_rate(t, method);
+ update_rate(t, mh);
if (max_task == NULL || compare_methods(method, max_method)) {
// Select a method with the highest rate
max_task = task;
@@ -711,9 +715,9 @@
return NULL;
}
- handle_counter_overflow(method());
+ handle_counter_overflow(method);
if (method() != inlinee()) {
- handle_counter_overflow(inlinee());
+ handle_counter_overflow(inlinee);
}
if (bci == InvocationEntryBci) {
@@ -792,43 +796,43 @@
print_event(COMPILE, mh(), mh(), bci, level);
}
int hot_count = (bci == InvocationEntryBci) ? mh->invocation_count() : mh->backedge_count();
- update_rate(nanos_to_millis(os::javaTimeNanos()), mh());
+ update_rate(nanos_to_millis(os::javaTimeNanos()), mh);
CompileBroker::compile_method(mh, bci, level, mh, hot_count, CompileTask::Reason_Tiered, THREAD);
}
}
// update_rate() is called from select_task() while holding a compile queue lock.
-void CompilationPolicy::update_rate(jlong t, Method* m) {
+void CompilationPolicy::update_rate(jlong t, const methodHandle& method) {
// Skip update if counters are absent.
// Can't allocate them since we are holding compile queue lock.
- if (m->method_counters() == NULL) return;
+ if (method->method_counters() == NULL) return;
- if (is_old(m)) {
+ if (is_old(method)) {
// We don't remove old methods from the queue,
// so we can just zero the rate.
- m->set_rate(0);
+ method->set_rate(0);
return;
}
// We don't update the rate if we've just came out of a safepoint.
// delta_s is the time since last safepoint in milliseconds.
jlong delta_s = t - SafepointTracing::end_of_last_safepoint_ms();
- jlong delta_t = t - (m->prev_time() != 0 ? m->prev_time() : start_time()); // milliseconds since the last measurement
+ jlong delta_t = t - (method->prev_time() != 0 ? method->prev_time() : start_time()); // milliseconds since the last measurement
// How many events were there since the last time?
- int event_count = m->invocation_count() + m->backedge_count();
- int delta_e = event_count - m->prev_event_count();
+ int event_count = method->invocation_count() + method->backedge_count();
+ int delta_e = event_count - method->prev_event_count();
// We should be running for at least 1ms.
if (delta_s >= TieredRateUpdateMinTime) {
// And we must've taken the previous point at least 1ms before.
if (delta_t >= TieredRateUpdateMinTime && delta_e > 0) {
- m->set_prev_time(t);
- m->set_prev_event_count(event_count);
- m->set_rate((float)delta_e / (float)delta_t); // Rate is events per millisecond
+ method->set_prev_time(t);
+ method->set_prev_event_count(event_count);
+ method->set_rate((float)delta_e / (float)delta_t); // Rate is events per millisecond
} else {
if (delta_t > TieredRateUpdateMaxTime && delta_e == 0) {
// If nothing happened for 25ms, zero the rate. Don't modify prev values.
- m->set_rate(0);
+ method->set_rate(0);
}
}
}
@@ -836,12 +840,12 @@
// Check if this method has been stale for a given number of milliseconds.
// See select_task().
-bool CompilationPolicy::is_stale(jlong t, jlong timeout, Method* m) {
+bool CompilationPolicy::is_stale(jlong t, jlong timeout, const methodHandle& method) {
jlong delta_s = t - SafepointTracing::end_of_last_safepoint_ms();
- jlong delta_t = t - m->prev_time();
+ jlong delta_t = t - method->prev_time();
if (delta_t > timeout && delta_s > timeout) {
- int event_count = m->invocation_count() + m->backedge_count();
- int delta_e = event_count - m->prev_event_count();
+ int event_count = method->invocation_count() + method->backedge_count();
+ int delta_e = event_count - method->prev_event_count();
// Return true if there were no events.
return delta_e == 0;
}
@@ -850,13 +854,16 @@
// We don't remove old methods from the compile queue even if they have
// very low activity. See select_task().
-bool CompilationPolicy::is_old(Method* method) {
- return method->invocation_count() > 50000 || method->backedge_count() > 500000;
+bool CompilationPolicy::is_old(const methodHandle& method) {
+ int i = method->invocation_count();
+ int b = method->backedge_count();
+ double k = TieredOldPercentage / 100.0;
+
+ return CallPredicate::apply_scaled(method, CompLevel_none, i, b, k) || LoopPredicate::apply_scaled(method, CompLevel_none, i, b, k);
}
double CompilationPolicy::weight(Method* method) {
- return (double)(method->rate() + 1) *
- (method->invocation_count() + 1) * (method->backedge_count() + 1);
+ return (double)(method->rate() + 1) * (method->invocation_count() + 1) * (method->backedge_count() + 1);
}
// Apply heuristics and return true if x should be compiled before y
@@ -905,13 +912,16 @@
if (cur_level != CompLevel_none || force_comp_at_level_simple(method) || CompilationModeFlag::quick_only() || !ProfileInterpreter) {
return false;
}
+ if (is_old(method)) {
+ return true;
+ }
int i = method->invocation_count();
int b = method->backedge_count();
double k = Tier0ProfilingStartPercentage / 100.0;
// If the top level compiler is not keeping up, delay profiling.
if (CompileBroker::queue_size(CompLevel_full_optimization) <= Tier0Delay * compiler_count(CompLevel_full_optimization)) {
- return CallPredicate::apply_scaled(method, CompLevel_full_profile, i, b, k) || LoopPredicate::apply_scaled(method, CompLevel_full_profile, i, b, k);
+ return CallPredicate::apply_scaled(method, CompLevel_none, i, b, k) || LoopPredicate::apply_scaled(method, CompLevel_none, i, b, k);
}
return false;
}
@@ -1001,7 +1011,7 @@
if (force_comp_at_level_simple(method)) {
next_level = CompLevel_simple;
} else {
- if (is_trivial(method())) {
+ if (is_trivial(method)) {
next_level = CompilationModeFlag::disable_intermediate() ? CompLevel_full_optimization : CompLevel_simple;
} else {
switch(cur_level) {
@@ -1010,7 +1020,7 @@
// If we were at full profile level, would we switch to full opt?
if (common(method, CompLevel_full_profile, disable_feedback) == CompLevel_full_optimization) {
next_level = CompLevel_full_optimization;
- } else if (!CompilationModeFlag::disable_intermediate() && Predicate::apply(i, b, cur_level, method)) {
+ } else if (!CompilationModeFlag::disable_intermediate() && Predicate::apply(method, cur_level, i, b)) {
// C1-generated fully profiled code is about 30% slower than the limited profile
// code that has only invocation and backedge counters. The observation is that
// if C2 queue is large enough we can spend too much time in the fully profiled code
@@ -1036,7 +1046,7 @@
if (mdo->would_profile()) {
if (disable_feedback || (CompileBroker::queue_size(CompLevel_full_optimization) <=
Tier3DelayOff * compiler_count(CompLevel_full_optimization) &&
- Predicate::apply(i, b, cur_level, method))) {
+ Predicate::apply(method, cur_level, i, b))) {
next_level = CompLevel_full_profile;
}
} else {
@@ -1046,7 +1056,7 @@
// If there is no MDO we need to profile
if (disable_feedback || (CompileBroker::queue_size(CompLevel_full_optimization) <=
Tier3DelayOff * compiler_count(CompLevel_full_optimization) &&
- Predicate::apply(i, b, cur_level, method))) {
+ Predicate::apply(method, cur_level, i, b))) {
next_level = CompLevel_full_profile;
}
}
@@ -1059,7 +1069,7 @@
if (mdo->would_profile() || CompilationModeFlag::disable_intermediate()) {
int mdo_i = mdo->invocation_count_delta();
int mdo_b = mdo->backedge_count_delta();
- if (Predicate::apply(mdo_i, mdo_b, cur_level, method)) {
+ if (Predicate::apply(method, cur_level, mdo_i, mdo_b)) {
next_level = CompLevel_full_optimization;
}
} else {
@@ -1079,7 +1089,7 @@
// Determine if a method should be compiled with a normal entry point at a different level.
CompLevel CompilationPolicy::call_event(const methodHandle& method, CompLevel cur_level, Thread* thread) {
CompLevel osr_level = MIN2((CompLevel) method->highest_osr_comp_level(), common(method, cur_level, true));
- CompLevel next_level = common(method, cur_level);
+ CompLevel next_level = common(method, cur_level, is_old(method));
// If OSR method level is greater than the regular method level, the levels should be
// equalized by raising the regular method level in order to avoid OSRs during each
diff -Nru openjdk-17-17.0.4+8/src/hotspot/share/compiler/compilationPolicy.hpp openjdk-17-17.0.5+8/src/hotspot/share/compiler/compilationPolicy.hpp
--- openjdk-17-17.0.4+8/src/hotspot/share/compiler/compilationPolicy.hpp 2022-07-14 08:05:38.000000000 +0000
+++ openjdk-17-17.0.5+8/src/hotspot/share/compiler/compilationPolicy.hpp 2022-10-10 13:07:22.000000000 +0000
@@ -169,7 +169,7 @@
static double _increase_threshold_at_ratio;
// Set carry flags in the counters (in Method* and MDO).
- inline static void handle_counter_overflow(Method* method);
+ inline static void handle_counter_overflow(const methodHandle& method);
// Verify that a level is consistent with the compilation mode
static bool verify_level(CompLevel level);
// Clamp the request level according to various constraints.
@@ -188,17 +188,17 @@
// Has a method been long around?
// We don't remove old methods from the compile queue even if they have
// very low activity (see select_task()).
- inline static bool is_old(Method* method);
+ inline static bool is_old(const methodHandle& method);
// Was a given method inactive for a given number of milliseconds.
// If it is, we would remove it from the queue (see select_task()).
- inline static bool is_stale(jlong t, jlong timeout, Method* m);
+ inline static bool is_stale(jlong t, jlong timeout, const methodHandle& method);
// Compute the weight of the method for the compilation scheduling
inline static double weight(Method* method);
// Apply heuristics and return true if x should be compiled before y
inline static bool compare_methods(Method* x, Method* y);
// Compute event rate for a given method. The rate is the number of event (invocations + backedges)
// per millisecond.
- inline static void update_rate(jlong t, Method* m);
+ inline static void update_rate(jlong t, const methodHandle& method);
// Compute threshold scaling coefficient
inline static double threshold_scale(CompLevel level, int feedback_k);
// If a method is old enough and is still in the interpreter we would want to
@@ -219,7 +219,7 @@
static void compile(const methodHandle& mh, int bci, CompLevel level, TRAPS);
// Simple methods are as good being compiled with C1 as C2.
// This function tells if it's such a function.
- inline static bool is_trivial(Method* method);
+ inline static bool is_trivial(const methodHandle& method);
// Force method to be compiled at CompLevel_simple?
inline static bool force_comp_at_level_simple(const methodHandle& method);
diff -Nru openjdk-17-17.0.4+8/src/hotspot/share/compiler/compileBroker.cpp openjdk-17-17.0.5+8/src/hotspot/share/compiler/compileBroker.cpp
--- openjdk-17-17.0.4+8/src/hotspot/share/compiler/compileBroker.cpp 2022-07-14 08:05:38.000000000 +0000
+++ openjdk-17-17.0.5+8/src/hotspot/share/compiler/compileBroker.cpp 2022-10-10 13:07:22.000000000 +0000
@@ -2319,8 +2319,9 @@
/* Repeat compilation without installing code for profiling purposes */
int repeat_compilation_count = directive->RepeatCompilationOption;
while (repeat_compilation_count > 0) {
+ ResourceMark rm(thread);
task->print_ul("NO CODE INSTALLED");
- comp->compile_method(&ci_env, target, osr_bci, false , directive);
+ comp->compile_method(&ci_env, target, osr_bci, false, directive);
repeat_compilation_count--;
}
}
diff -Nru openjdk-17-17.0.4+8/src/hotspot/share/compiler/compilerDefinitions.cpp openjdk-17-17.0.5+8/src/hotspot/share/compiler/compilerDefinitions.cpp
--- openjdk-17-17.0.4+8/src/hotspot/share/compiler/compilerDefinitions.cpp 2022-07-14 08:05:38.000000000 +0000
+++ openjdk-17-17.0.5+8/src/hotspot/share/compiler/compilerDefinitions.cpp 2022-10-10 13:07:22.000000000 +0000
@@ -267,12 +267,11 @@
FLAG_SET_ERGO(Tier0BackedgeNotifyFreqLog, MAX2(10, osr_threshold_log));
}
// Adjust the tiered policy flags to approximate the legacy behavior.
- if (CompilerConfig::is_c1_only()) {
- FLAG_SET_ERGO(Tier3InvocationThreshold, threshold);
- FLAG_SET_ERGO(Tier3MinInvocationThreshold, threshold);
- FLAG_SET_ERGO(Tier3CompileThreshold, threshold);
- FLAG_SET_ERGO(Tier3BackEdgeThreshold, osr_threshold);
- } else {
+ FLAG_SET_ERGO(Tier3InvocationThreshold, threshold);
+ FLAG_SET_ERGO(Tier3MinInvocationThreshold, threshold);
+ FLAG_SET_ERGO(Tier3CompileThreshold, threshold);
+ FLAG_SET_ERGO(Tier3BackEdgeThreshold, osr_threshold);
+ if (CompilerConfig::is_c2_or_jvmci_compiler_only()) {
FLAG_SET_ERGO(Tier4InvocationThreshold, threshold);
FLAG_SET_ERGO(Tier4MinInvocationThreshold, threshold);
FLAG_SET_ERGO(Tier4CompileThreshold, threshold);
@@ -339,6 +338,20 @@
if (FLAG_IS_DEFAULT(Tier4BackEdgeThreshold)) {
FLAG_SET_DEFAULT(Tier4BackEdgeThreshold, 15000);
}
+
+ if (FLAG_IS_DEFAULT(Tier3InvocationThreshold)) {
+ FLAG_SET_DEFAULT(Tier3InvocationThreshold, Tier4InvocationThreshold);
+ }
+ if (FLAG_IS_DEFAULT(Tier3MinInvocationThreshold)) {
+ FLAG_SET_DEFAULT(Tier3MinInvocationThreshold, Tier4MinInvocationThreshold);
+ }
+ if (FLAG_IS_DEFAULT(Tier3CompileThreshold)) {
+ FLAG_SET_DEFAULT(Tier3CompileThreshold, Tier4CompileThreshold);
+ }
+ if (FLAG_IS_DEFAULT(Tier3BackEdgeThreshold)) {
+ FLAG_SET_DEFAULT(Tier3BackEdgeThreshold, Tier4BackEdgeThreshold);
+ }
+
}
// Scale tiered compilation thresholds.
diff -Nru openjdk-17-17.0.4+8/src/hotspot/share/compiler/compiler_globals.hpp openjdk-17-17.0.5+8/src/hotspot/share/compiler/compiler_globals.hpp
--- openjdk-17-17.0.4+8/src/hotspot/share/compiler/compiler_globals.hpp 2022-07-14 08:05:38.000000000 +0000
+++ openjdk-17-17.0.5+8/src/hotspot/share/compiler/compiler_globals.hpp 2022-10-10 13:07:22.000000000 +0000
@@ -213,6 +213,12 @@
"do not start profiling in the interpreter") \
range(0, max_jint) \
\
+ product(intx, TieredOldPercentage, 1000, DIAGNOSTIC, \
+ "Percentage over tier 3 thresholds after which a method is " \
+ "considered old (turns off parts of prioritization based on " \
+ "compile queue length)") \
+ range(0, max_jint) \
+ \
product(intx, Tier3DelayOn, 5, \
"If C2 queue size grows over this amount per compiler thread " \
"stop compiling at tier 3 and start compiling at tier 2") \
@@ -244,8 +250,7 @@
\
product(intx, Tier0ProfilingStartPercentage, 200, \
"Start profiling in interpreter if the counters exceed the " \
- "specified percentage of tier 3 thresholds (tier 4 thresholds " \
- "with CompilationMode=high-only|high-only-quick-internal)") \
+ "specified percentage of tier 3 thresholds") \
range(0, max_jint) \
\
product(uintx, IncreaseFirstTierCompileThresholdAt, 50, \
diff -Nru openjdk-17-17.0.4+8/src/hotspot/share/compiler/methodLiveness.cpp openjdk-17-17.0.5+8/src/hotspot/share/compiler/methodLiveness.cpp
--- openjdk-17-17.0.4+8/src/hotspot/share/compiler/methodLiveness.cpp 2022-07-14 08:05:38.000000000 +0000
+++ openjdk-17-17.0.5+8/src/hotspot/share/compiler/methodLiveness.cpp 2022-10-10 13:07:22.000000000 +0000
@@ -164,10 +164,11 @@
case Bytecodes::_ifnull:
case Bytecodes::_ifnonnull:
// Two way branch. Set predecessors at each destination.
- dest = _block_map->at(bytes.next_bci());
- assert(dest != NULL, "must be a block immediately following this one.");
- dest->add_normal_predecessor(current_block);
-
+ if (bytes.next_bci() < method_len) {
+ dest = _block_map->at(bytes.next_bci());
+ assert(dest != NULL, "must be a block immediately following this one.");
+ dest->add_normal_predecessor(current_block);
+ }
dest = _block_map->at(bytes.get_dest());
assert(dest != NULL, "branch desination must start a block.");
dest->add_normal_predecessor(current_block);
diff -Nru openjdk-17-17.0.4+8/src/hotspot/share/gc/shared/c2/barrierSetC2.cpp openjdk-17-17.0.5+8/src/hotspot/share/gc/shared/c2/barrierSetC2.cpp
--- openjdk-17-17.0.4+8/src/hotspot/share/gc/shared/c2/barrierSetC2.cpp 2022-07-14 08:05:38.000000000 +0000
+++ openjdk-17-17.0.5+8/src/hotspot/share/gc/shared/c2/barrierSetC2.cpp 2022-10-10 13:07:22.000000000 +0000
@@ -91,19 +91,19 @@
MemNode::MemOrd mo = access.mem_node_mo();
Node* store;
+ BasicType bt = access.type();
if (access.is_parse_access()) {
C2ParseAccess& parse_access = static_cast(access);
GraphKit* kit = parse_access.kit();
- if (access.type() == T_DOUBLE) {
+ if (bt == T_DOUBLE) {
Node* new_val = kit->dstore_rounding(val.node());
val.set_node(new_val);
}
- store = kit->store_to_memory(kit->control(), access.addr().node(), val.node(), access.type(),
- access.addr().type(), mo, requires_atomic_access, unaligned, mismatched, unsafe);
+ store = kit->store_to_memory(kit->control(), access.addr().node(), val.node(), bt,
+ access.addr().type(), mo, requires_atomic_access, unaligned, mismatched, unsafe);
} else {
- assert(!requires_atomic_access, "not yet supported");
assert(access.is_opt_access(), "either parse or opt access");
C2OptAccess& opt_access = static_cast(access);
Node* ctl = opt_access.ctl();
@@ -113,7 +113,7 @@
int alias = gvn.C->get_alias_index(adr_type);
Node* mem = mm->memory_at(alias);
- StoreNode* st = StoreNode::make(gvn, ctl, mem, access.addr().node(), adr_type, val.node(), access.type(), mo);
+ StoreNode* st = StoreNode::make(gvn, ctl, mem, access.addr().node(), adr_type, val.node(), bt, mo, requires_atomic_access);
if (unaligned) {
st->set_unaligned_access();
}
@@ -156,12 +156,11 @@
Node* control = control_dependent ? kit->control() : NULL;
if (immutable) {
- assert(!requires_atomic_access, "can't ensure atomicity");
Compile* C = Compile::current();
Node* mem = kit->immutable_memory();
load = LoadNode::make(kit->gvn(), control, mem, adr,
- adr_type, val_type, access.type(), mo, dep, unaligned,
- mismatched, unsafe, access.barrier_data());
+ adr_type, val_type, access.type(), mo, dep, requires_atomic_access,
+ unaligned, mismatched, unsafe, access.barrier_data());
load = kit->gvn().transform(load);
} else {
load = kit->make_load(control, adr, val_type, access.type(), adr_type, mo,
@@ -169,15 +168,14 @@
access.barrier_data());
}
} else {
- assert(!requires_atomic_access, "not yet supported");
assert(access.is_opt_access(), "either parse or opt access");
C2OptAccess& opt_access = static_cast(access);
Node* control = control_dependent ? opt_access.ctl() : NULL;
MergeMemNode* mm = opt_access.mem();
PhaseGVN& gvn = opt_access.gvn();
Node* mem = mm->memory_at(gvn.C->get_alias_index(adr_type));
- load = LoadNode::make(gvn, control, mem, adr, adr_type, val_type, access.type(), mo,
- dep, unaligned, mismatched, unsafe, access.barrier_data());
+ load = LoadNode::make(gvn, control, mem, adr, adr_type, val_type, access.type(), mo, dep,
+ requires_atomic_access, unaligned, mismatched, unsafe, access.barrier_data());
load = gvn.transform(load);
}
access.set_raw_access(load);
diff -Nru openjdk-17-17.0.4+8/src/hotspot/share/gc/shenandoah/shenandoahBarrierSet.inline.hpp openjdk-17-17.0.5+8/src/hotspot/share/gc/shenandoah/shenandoahBarrierSet.inline.hpp
--- openjdk-17-17.0.4+8/src/hotspot/share/gc/shenandoah/shenandoahBarrierSet.inline.hpp 2022-07-14 08:05:38.000000000 +0000
+++ openjdk-17-17.0.5+8/src/hotspot/share/gc/shenandoah/shenandoahBarrierSet.inline.hpp 2022-10-10 13:07:22.000000000 +0000
@@ -205,7 +205,7 @@
// Note: We don't need a keep-alive-barrier here. We already enqueue any loaded reference for SATB anyway,
// because it must be the previous value.
- res = load_reference_barrier(decorators, res, reinterpret_cast(NULL));
+ res = load_reference_barrier(decorators, res, static_cast(nullptr));
satb_enqueue(res);
return res;
}
@@ -216,7 +216,7 @@
oop previous = RawAccess<>::oop_atomic_xchg(addr, new_value);
// Note: We don't need a keep-alive-barrier here. We already enqueue any loaded reference for SATB anyway,
// because it must be the previous value.
- previous = load_reference_barrier(decorators, previous, reinterpret_cast(NULL));
+ previous = load_reference_barrier(decorators, previous, static_cast(nullptr));
satb_enqueue(previous);
return previous;
}
diff -Nru openjdk-17-17.0.4+8/src/hotspot/share/gc/z/zReferenceProcessor.cpp openjdk-17-17.0.5+8/src/hotspot/share/gc/z/zReferenceProcessor.cpp
--- openjdk-17-17.0.4+8/src/hotspot/share/gc/z/zReferenceProcessor.cpp 2022-07-14 08:05:38.000000000 +0000
+++ openjdk-17-17.0.5+8/src/hotspot/share/gc/z/zReferenceProcessor.cpp 2022-10-10 13:07:22.000000000 +0000
@@ -59,7 +59,7 @@
default:
ShouldNotReachHere();
- return NULL;
+ return "Unknown";
}
}
diff -Nru openjdk-17-17.0.4+8/src/hotspot/share/jfr/jfr.cpp openjdk-17-17.0.5+8/src/hotspot/share/jfr/jfr.cpp
--- openjdk-17-17.0.4+8/src/hotspot/share/jfr/jfr.cpp 2022-07-14 08:05:38.000000000 +0000
+++ openjdk-17-17.0.5+8/src/hotspot/share/jfr/jfr.cpp 2022-10-10 13:07:22.000000000 +0000
@@ -92,8 +92,8 @@
return t != NULL && t->jfr_thread_local()->is_excluded();
}
-void Jfr::on_vm_shutdown(bool exception_handler) {
- if (JfrRecorder::is_recording()) {
+void Jfr::on_vm_shutdown(bool exception_handler, bool halt) {
+ if (!halt && JfrRecorder::is_recording()) {
JfrEmergencyDump::on_vm_shutdown(exception_handler);
}
}
diff -Nru openjdk-17-17.0.4+8/src/hotspot/share/jfr/jfr.hpp openjdk-17-17.0.5+8/src/hotspot/share/jfr/jfr.hpp
--- openjdk-17-17.0.4+8/src/hotspot/share/jfr/jfr.hpp 2022-07-14 08:05:38.000000000 +0000
+++ openjdk-17-17.0.5+8/src/hotspot/share/jfr/jfr.hpp 2022-10-10 13:07:22.000000000 +0000
@@ -48,7 +48,7 @@
static void on_unloading_classes();
static void on_thread_start(Thread* thread);
static void on_thread_exit(Thread* thread);
- static void on_vm_shutdown(bool exception_handler = false);
+ static void on_vm_shutdown(bool exception_handler = false, bool halt = false);
static bool on_flight_recorder_option(const JavaVMOption** option, char* delimiter);
static bool on_start_flight_recording_option(const JavaVMOption** option, char* delimiter);
static void on_vm_error_report(outputStream* st);
diff -Nru openjdk-17-17.0.4+8/src/hotspot/share/jvmci/jvmciCompilerToVM.cpp openjdk-17-17.0.5+8/src/hotspot/share/jvmci/jvmciCompilerToVM.cpp
--- openjdk-17-17.0.4+8/src/hotspot/share/jvmci/jvmciCompilerToVM.cpp 2022-07-14 08:05:38.000000000 +0000
+++ openjdk-17-17.0.5+8/src/hotspot/share/jvmci/jvmciCompilerToVM.cpp 2022-10-10 13:07:22.000000000 +0000
@@ -2590,6 +2590,49 @@
}
}
+C2V_VMENTRY(void, setThreadLocalObject, (JNIEnv* env, jobject, jint id, jobject value))
+ requireInHotSpot("setThreadLocalObject", JVMCI_CHECK);
+ if (id == 0) {
+ thread->set_jvmci_reserved_oop0(JNIHandles::resolve(value));
+ return;
+ }
+ THROW_MSG(vmSymbols::java_lang_IllegalArgumentException(),
+ err_msg("%d is not a valid thread local id", id));
+}
+
+C2V_VMENTRY_NULL(jobject, getThreadLocalObject, (JNIEnv* env, jobject, jint id))
+ requireInHotSpot("getThreadLocalObject", JVMCI_CHECK_NULL);
+ if (id == 0) {
+ return JNIHandles::make_local(thread->get_jvmci_reserved_oop0());
+ }
+ THROW_MSG_0(vmSymbols::java_lang_IllegalArgumentException(),
+ err_msg("%d is not a valid thread local id", id));
+}
+
+C2V_VMENTRY(void, setThreadLocalLong, (JNIEnv* env, jobject, jint id, jlong value))
+ requireInHotSpot("setThreadLocalLong", JVMCI_CHECK);
+ if (id == 0) {
+ thread->set_jvmci_reserved0(value);
+ } else if (id == 1) {
+ thread->set_jvmci_reserved1(value);
+ } else {
+ THROW_MSG(vmSymbols::java_lang_IllegalArgumentException(),
+ err_msg("%d is not a valid thread local id", id));
+ }
+}
+
+C2V_VMENTRY_0(jlong, getThreadLocalLong, (JNIEnv* env, jobject, jint id))
+ requireInHotSpot("getThreadLocalLong", JVMCI_CHECK_0);
+ if (id == 0) {
+ return thread->get_jvmci_reserved0();
+ } else if (id == 1) {
+ return thread->get_jvmci_reserved1();
+ } else {
+ THROW_MSG_0(vmSymbols::java_lang_IllegalArgumentException(),
+ err_msg("%d is not a valid thread local id", id));
+ }
+}
+
#define CC (char*) /*cast a literal from (const char*)*/
#define FN_PTR(f) CAST_FROM_FN_PTR(void*, &(c2v_ ## f))
@@ -2731,6 +2774,10 @@
{CC "addFailedSpeculation", CC "(J[B)Z", FN_PTR(addFailedSpeculation)},
{CC "callSystemExit", CC "(I)V", FN_PTR(callSystemExit)},
{CC "ticksNow", CC "()J", FN_PTR(ticksNow)},
+ {CC "getThreadLocalObject", CC "(I)" OBJECT, FN_PTR(getThreadLocalObject)},
+ {CC "setThreadLocalObject", CC "(I" OBJECT ")V", FN_PTR(setThreadLocalObject)},
+ {CC "getThreadLocalLong", CC "(I)J", FN_PTR(getThreadLocalLong)},
+ {CC "setThreadLocalLong", CC "(IJ)V", FN_PTR(setThreadLocalLong)},
{CC "registerCompilerPhase", CC "(" STRING ")I", FN_PTR(registerCompilerPhase)},
{CC "notifyCompilerPhaseEvent", CC "(JIII)V", FN_PTR(notifyCompilerPhaseEvent)},
{CC "notifyCompilerInliningEvent", CC "(I" HS_RESOLVED_METHOD HS_RESOLVED_METHOD "ZLjava/lang/String;I)V", FN_PTR(notifyCompilerInliningEvent)},
diff -Nru openjdk-17-17.0.4+8/src/hotspot/share/jvmci/vmStructs_jvmci.cpp openjdk-17-17.0.5+8/src/hotspot/share/jvmci/vmStructs_jvmci.cpp
--- openjdk-17-17.0.4+8/src/hotspot/share/jvmci/vmStructs_jvmci.cpp 2022-07-14 08:05:38.000000000 +0000
+++ openjdk-17-17.0.5+8/src/hotspot/share/jvmci/vmStructs_jvmci.cpp 2022-10-10 13:07:22.000000000 +0000
@@ -183,8 +183,8 @@
nonstatic_field(JavaThread, _pending_failed_speculation, jlong) \
nonstatic_field(JavaThread, _pending_transfer_to_interpreter, bool) \
nonstatic_field(JavaThread, _jvmci_counters, jlong*) \
- nonstatic_field(JavaThread, _jvmci_reserved0, intptr_t*) \
- nonstatic_field(JavaThread, _jvmci_reserved1, intptr_t*) \
+ nonstatic_field(JavaThread, _jvmci_reserved0, jlong) \
+ nonstatic_field(JavaThread, _jvmci_reserved1, jlong) \
nonstatic_field(JavaThread, _jvmci_reserved_oop0, oop) \
nonstatic_field(JavaThread, _should_post_on_exceptions_flag, int) \
nonstatic_field(JavaThread, _jni_environment, JNIEnv) \
diff -Nru openjdk-17-17.0.4+8/src/hotspot/share/oops/access.hpp openjdk-17-17.0.5+8/src/hotspot/share/oops/access.hpp
--- openjdk-17-17.0.4+8/src/hotspot/share/oops/access.hpp 2022-07-14 08:05:38.000000000 +0000
+++ openjdk-17-17.0.5+8/src/hotspot/share/oops/access.hpp 2022-10-10 13:07:22.000000000 +0000
@@ -295,8 +295,8 @@
static inline void arraycopy(arrayOop src_obj, size_t src_offset_in_bytes,
arrayOop dst_obj, size_t dst_offset_in_bytes,
size_t length) {
- AccessT::arraycopy(src_obj, src_offset_in_bytes, reinterpret_cast(NULL),
- dst_obj, dst_offset_in_bytes, reinterpret_cast(NULL),
+ AccessT::arraycopy(src_obj, src_offset_in_bytes, static_cast(nullptr),
+ dst_obj, dst_offset_in_bytes, static_cast(nullptr),
length);
}
@@ -304,7 +304,7 @@
static inline void arraycopy_to_native(arrayOop src_obj, size_t src_offset_in_bytes,
T* dst,
size_t length) {
- AccessT::arraycopy(src_obj, src_offset_in_bytes, reinterpret_cast(NULL),
+ AccessT::arraycopy(src_obj, src_offset_in_bytes, static_cast(nullptr),
NULL, 0, dst,
length);
}
@@ -314,15 +314,15 @@
arrayOop dst_obj, size_t dst_offset_in_bytes,
size_t length) {
AccessT::arraycopy(NULL, 0, src,
- dst_obj, dst_offset_in_bytes, reinterpret_cast(NULL),
+ dst_obj, dst_offset_in_bytes, static_cast(nullptr),
length);
}
static inline bool oop_arraycopy(arrayOop src_obj, size_t src_offset_in_bytes,
arrayOop dst_obj, size_t dst_offset_in_bytes,
size_t length) {
- return AccessT::oop_arraycopy(src_obj, src_offset_in_bytes, reinterpret_cast(NULL),
- dst_obj, dst_offset_in_bytes, reinterpret_cast(NULL),
+ return AccessT::oop_arraycopy(src_obj, src_offset_in_bytes, static_cast(nullptr),
+ dst_obj, dst_offset_in_bytes, static_cast(nullptr),
length);
}
diff -Nru openjdk-17-17.0.4+8/src/hotspot/share/oops/methodData.cpp openjdk-17-17.0.5+8/src/hotspot/share/oops/methodData.cpp
--- openjdk-17-17.0.4+8/src/hotspot/share/oops/methodData.cpp 2022-07-14 08:05:38.000000000 +0000
+++ openjdk-17-17.0.5+8/src/hotspot/share/oops/methodData.cpp 2022-10-10 13:07:22.000000000 +0000
@@ -1242,7 +1242,9 @@
int extra_size = extra_data_count * DataLayout::compute_size_in_bytes(0);
// Let's zero the space for the extra data
- Copy::zero_to_bytes(((address)_data) + data_size, extra_size);
+ if (extra_size > 0) {
+ Copy::zero_to_bytes(((address)_data) + data_size, extra_size);
+ }
// Add a cell to record information about modified arguments.
// Set up _args_modified array after traps cells so that
diff -Nru openjdk-17-17.0.4+8/src/hotspot/share/opto/callGenerator.cpp openjdk-17-17.0.5+8/src/hotspot/share/opto/callGenerator.cpp
--- openjdk-17-17.0.4+8/src/hotspot/share/opto/callGenerator.cpp 2022-07-14 08:05:38.000000000 +0000
+++ openjdk-17-17.0.5+8/src/hotspot/share/opto/callGenerator.cpp 2022-10-10 13:07:22.000000000 +0000
@@ -1115,22 +1115,29 @@
Node* receiver = kit.argument(0);
if (receiver->Opcode() == Op_ConP) {
input_not_const = false;
- const TypeOopPtr* oop_ptr = receiver->bottom_type()->is_oopptr();
- ciMethod* target = oop_ptr->const_oop()->as_method_handle()->get_vmtarget();
- const int vtable_index = Method::invalid_vtable_index;
+ const TypeOopPtr* recv_toop = receiver->bottom_type()->isa_oopptr();
+ if (recv_toop != NULL) {
+ ciMethod* target = recv_toop->const_oop()->as_method_handle()->get_vmtarget();
+ const int vtable_index = Method::invalid_vtable_index;
- if (!ciMethod::is_consistent_info(callee, target)) {
+ if (!ciMethod::is_consistent_info(callee, target)) {
+ print_inlining_failure(C, callee, jvms->depth() - 1, jvms->bci(),
+ "signatures mismatch");
+ return NULL;
+ }
+
+ CallGenerator *cg = C->call_generator(target, vtable_index,
+ false /* call_does_dispatch */,
+ jvms,
+ allow_inline,
+ PROB_ALWAYS);
+ return cg;
+ } else {
+ assert(receiver->bottom_type() == TypePtr::NULL_PTR, "not a null: %s",
+ Type::str(receiver->bottom_type()));
print_inlining_failure(C, callee, jvms->depth() - 1, jvms->bci(),
- "signatures mismatch");
- return NULL;
+ "receiver is always null");
}
-
- CallGenerator* cg = C->call_generator(target, vtable_index,
- false /* call_does_dispatch */,
- jvms,
- allow_inline,
- PROB_ALWAYS);
- return cg;
} else {
print_inlining_failure(C, callee, jvms->depth() - 1, jvms->bci(),
"receiver not constant");
diff -Nru openjdk-17-17.0.4+8/src/hotspot/share/opto/callnode.cpp openjdk-17-17.0.5+8/src/hotspot/share/opto/callnode.cpp
--- openjdk-17-17.0.4+8/src/hotspot/share/opto/callnode.cpp 2022-07-14 08:05:38.000000000 +0000
+++ openjdk-17-17.0.5+8/src/hotspot/share/opto/callnode.cpp 2022-10-10 13:07:22.000000000 +0000
@@ -1654,7 +1654,6 @@
init_req( KlassNode , klass_node);
init_req( InitialTest , initial_test);
init_req( ALength , topnode);
- init_req( ValidLengthTest , topnode);
C->add_macro_node(this);
}
@@ -1687,6 +1686,54 @@
return mark_node;
}
+//=============================================================================
+Node* AllocateArrayNode::Ideal(PhaseGVN *phase, bool can_reshape) {
+ if (remove_dead_region(phase, can_reshape)) return this;
+ // Don't bother trying to transform a dead node
+ if (in(0) && in(0)->is_top()) return NULL;
+
+ const Type* type = phase->type(Ideal_length());
+ if (type->isa_int() && type->is_int()->_hi < 0) {
+ if (can_reshape) {
+ PhaseIterGVN *igvn = phase->is_IterGVN();
+ // Unreachable fall through path (negative array length),
+ // the allocation can only throw so disconnect it.
+ Node* proj = proj_out_or_null(TypeFunc::Control);
+ Node* catchproj = NULL;
+ if (proj != NULL) {
+ for (DUIterator_Fast imax, i = proj->fast_outs(imax); i < imax; i++) {
+ Node *cn = proj->fast_out(i);
+ if (cn->is_Catch()) {
+ catchproj = cn->as_Multi()->proj_out_or_null(CatchProjNode::fall_through_index);
+ break;
+ }
+ }
+ }
+ if (catchproj != NULL && catchproj->outcnt() > 0 &&
+ (catchproj->outcnt() > 1 ||
+ catchproj->unique_out()->Opcode() != Op_Halt)) {
+ assert(catchproj->is_CatchProj(), "must be a CatchProjNode");
+ Node* nproj = catchproj->clone();
+ igvn->register_new_node_with_optimizer(nproj);
+
+ Node *frame = new ParmNode( phase->C->start(), TypeFunc::FramePtr );
+ frame = phase->transform(frame);
+ // Halt & Catch Fire
+ Node* halt = new HaltNode(nproj, frame, "unexpected negative array length");
+ phase->C->root()->add_req(halt);
+ phase->transform(halt);
+
+ igvn->replace_node(catchproj, phase->C->top());
+ return this;
+ }
+ } else {
+ // Can't correct it during regular GVN so register for IGVN
+ phase->C->record_for_igvn(this);
+ }
+ }
+ return NULL;
+}
+
// Retrieve the length from the AllocateArrayNode. Narrow the type with a
// CastII, if appropriate. If we are not allowed to create new nodes, and
// a CastII is appropriate, return NULL.
@@ -1711,13 +1758,16 @@
"narrow type must be narrower than length type");
// Return NULL if new nodes are not allowed
- if (!allow_new_nodes) return NULL;
+ if (!allow_new_nodes) {
+ return NULL;
+ }
// Create a cast which is control dependent on the initialization to
// propagate the fact that the array length must be positive.
InitializeNode* init = initialization();
- assert(init != NULL, "initialization not found");
- length = new CastIINode(length, narrow_length_type);
- length->set_req(TypeFunc::Control, init->proj_out_or_null(TypeFunc::Control));
+ if (init != NULL) {
+ length = new CastIINode(length, narrow_length_type);
+ length->set_req(TypeFunc::Control, init->proj_out_or_null(TypeFunc::Control));
+ }
}
}
diff -Nru openjdk-17-17.0.4+8/src/hotspot/share/opto/callnode.hpp openjdk-17-17.0.5+8/src/hotspot/share/opto/callnode.hpp
--- openjdk-17-17.0.4+8/src/hotspot/share/opto/callnode.hpp 2022-07-14 08:05:38.000000000 +0000
+++ openjdk-17-17.0.5+8/src/hotspot/share/opto/callnode.hpp 2022-10-10 13:07:22.000000000 +0000
@@ -913,7 +913,6 @@
KlassNode, // type (maybe dynamic) of the obj.
InitialTest, // slow-path test (may be constant)
ALength, // array length (or TOP if none)
- ValidLengthTest,
ParmLimit
};
@@ -923,7 +922,6 @@
fields[KlassNode] = TypeInstPtr::NOTNULL;
fields[InitialTest] = TypeInt::BOOL;
fields[ALength] = t; // length (can be a bad length)
- fields[ValidLengthTest] = TypeInt::BOOL;
const TypeTuple *domain = TypeTuple::make(ParmLimit, fields);
@@ -1018,16 +1016,18 @@
//
class AllocateArrayNode : public AllocateNode {
public:
- AllocateArrayNode(Compile* C, const TypeFunc* atype, Node* ctrl, Node* mem, Node* abio, Node* size, Node* klass_node,
- Node* initial_test, Node* count_val, Node* valid_length_test)
+ AllocateArrayNode(Compile* C, const TypeFunc *atype, Node *ctrl, Node *mem, Node *abio,
+ Node* size, Node* klass_node, Node* initial_test,
+ Node* count_val
+ )
: AllocateNode(C, atype, ctrl, mem, abio, size, klass_node,
initial_test)
{
init_class_id(Class_AllocateArray);
set_req(AllocateNode::ALength, count_val);
- set_req(AllocateNode::ValidLengthTest, valid_length_test);
}
virtual int Opcode() const;
+ virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);
// Dig the length operand out of a array allocation site.
Node* Ideal_length() {
diff -Nru openjdk-17-17.0.4+8/src/hotspot/share/opto/cfgnode.cpp openjdk-17-17.0.5+8/src/hotspot/share/opto/cfgnode.cpp
--- openjdk-17-17.0.4+8/src/hotspot/share/opto/cfgnode.cpp 2022-07-14 08:05:38.000000000 +0000
+++ openjdk-17-17.0.5+8/src/hotspot/share/opto/cfgnode.cpp 2022-10-10 13:07:22.000000000 +0000
@@ -314,7 +314,7 @@
}
//------------------------------is_unreachable_region--------------------------
-// Find if the Region node is reachable from the root.
+// Check if the RegionNode is part of an unsafe loop and unreachable from root.
bool RegionNode::is_unreachable_region(const PhaseGVN* phase) {
Node* top = phase->C->top();
assert(req() == 2 || (req() == 3 && in(1) != NULL && in(2) == top), "sanity check arguments");
@@ -373,7 +373,7 @@
VectorSet visited;
// Mark all control nodes reachable from root outputs
- Node *n = (Node*)phase->C->root();
+ Node* n = (Node*)phase->C->root();
nstack.push(n);
visited.set(n->_idx);
while (nstack.size() != 0) {
@@ -475,7 +475,7 @@
// Remove TOP or NULL input paths. If only 1 input path remains, this Region
// degrades to a copy.
- bool add_to_worklist = false;
+ bool add_to_worklist = true;
bool modified = false;
int cnt = 0; // Count of values merging
DEBUG_ONLY( int cnt_orig = req(); ) // Save original inputs count
@@ -501,7 +501,7 @@
}
}
if( phase->type(n) == Type::TOP ) {
- set_req(i, NULL); // Ignore TOP inputs
+ set_req_X(i, NULL, phase); // Ignore TOP inputs
modified = true;
i--;
continue;
@@ -532,7 +532,8 @@
}
}
}
- add_to_worklist = true;
+ add_to_worklist = false;
+ phase->is_IterGVN()->add_users_to_worklist(this);
i--;
}
}
@@ -547,45 +548,51 @@
if ((this->is_Loop() && (del_it == LoopNode::EntryControl ||
(del_it == 0 && is_unreachable_region(phase)))) ||
(!this->is_Loop() && has_phis && is_unreachable_region(phase))) {
- // Yes, the region will be removed during the next step below.
- // Cut the backedge input and remove phis since no data paths left.
- // We don't cut outputs to other nodes here since we need to put them
- // on the worklist.
- PhaseIterGVN *igvn = phase->is_IterGVN();
- if (in(1)->outcnt() == 1) {
- igvn->_worklist.push(in(1));
- }
- del_req(1);
- cnt = 0;
- assert( req() == 1, "no more inputs expected" );
- uint max = outcnt();
- bool progress = true;
- Node *top = phase->C->top();
- DUIterator j;
- while(progress) {
- progress = false;
- for (j = outs(); has_out(j); j++) {
- Node *n = out(j);
- if( n->is_Phi() ) {
- assert(n->in(0) == this, "");
- assert( n->req() == 2 && n->in(1) != NULL, "Only one data input expected" );
- // Break dead loop data path.
- // Eagerly replace phis with top to avoid regionless phis.
- igvn->replace_node(n, top);
- if( max != outcnt() ) {
- progress = true;
- j = refresh_out_pos(j);
- max = outcnt();
+ // This region and therefore all nodes on the input control path(s) are unreachable
+ // from root. To avoid incomplete removal of unreachable subgraphs, walk up the CFG
+ // and aggressively replace all nodes by top.
+ PhaseIterGVN* igvn = phase->is_IterGVN();
+ Node* top = phase->C->top();
+ ResourceMark rm;
+ Node_List nstack;
+ VectorSet visited;
+ nstack.push(this);
+ visited.set(_idx);
+ while (nstack.size() != 0) {
+ Node* n = nstack.pop();
+ for (uint i = 0; i < n->req(); ++i) {
+ Node* m = n->in(i);
+ assert(m != (Node*)phase->C->root(), "Should be unreachable from root");
+ if (m != NULL && m->is_CFG() && !visited.test_set(m->_idx)) {
+ nstack.push(m);
+ }
+ }
+ if (n->is_Region()) {
+ // Eagerly replace phis with top to avoid regionless phis.
+ n->set_req(0, NULL);
+ bool progress = true;
+ uint max = n->outcnt();
+ DUIterator j;
+ while (progress) {
+ progress = false;
+ for (j = n->outs(); n->has_out(j); j++) {
+ Node* u = n->out(j);
+ if (u->is_Phi()) {
+ igvn->replace_node(u, top);
+ if (max != n->outcnt()) {
+ progress = true;
+ j = n->refresh_out_pos(j);
+ max = n->outcnt();
+ }
+ }
}
}
}
+ igvn->replace_node(n, top);
}
- add_to_worklist = true;
+ return NULL;
}
}
- if (add_to_worklist) {
- phase->is_IterGVN()->add_users_to_worklist(this); // Revisit collapsed Phis
- }
if( cnt <= 1 ) { // Only 1 path in?
set_req(0, NULL); // Null control input for region copy
@@ -629,8 +636,9 @@
assert(parent_ctrl != NULL, "Region is a copy of some non-null control");
assert(parent_ctrl != this, "Close dead loop");
}
- if (!add_to_worklist)
+ if (add_to_worklist) {
igvn->add_users_to_worklist(this); // Check for further allowed opts
+ }
for (DUIterator_Last imin, i = last_outs(imin); i >= imin; --i) {
Node* n = last_out(i);
igvn->hash_delete(n); // Remove from worklist before modifying edges
@@ -2131,7 +2139,7 @@
doit = false;
break;
}
- if (in(i)->in(AddPNode::Offset) != base) {
+ if (in(i)->in(AddPNode::Base) != base) {
base = NULL;
}
if (in(i)->in(AddPNode::Offset) != offset) {
@@ -2631,17 +2639,6 @@
// Rethrows always throw exceptions, never return
if (call->entry_point() == OptoRuntime::rethrow_stub()) {
f[CatchProjNode::fall_through_index] = Type::TOP;
- } else if (call->is_AllocateArray()) {
- Node* klass_node = call->in(AllocateNode::KlassNode);
- Node* length = call->in(AllocateNode::ALength);
- const Type* length_type = phase->type(length);
- const Type* klass_type = phase->type(klass_node);
- Node* valid_length_test = call->in(AllocateNode::ValidLengthTest);
- const Type* valid_length_test_t = phase->type(valid_length_test);
- if (length_type == Type::TOP || klass_type == Type::TOP || valid_length_test_t == Type::TOP ||
- valid_length_test_t->is_int()->is_con(0)) {
- f[CatchProjNode::fall_through_index] = Type::TOP;
- }
} else if( call->req() > TypeFunc::Parms ) {
const Type *arg0 = phase->type( call->in(TypeFunc::Parms) );
// Check for null receiver to virtual or interface calls
diff -Nru openjdk-17-17.0.4+8/src/hotspot/share/opto/chaitin.cpp openjdk-17-17.0.5+8/src/hotspot/share/opto/chaitin.cpp
--- openjdk-17-17.0.4+8/src/hotspot/share/opto/chaitin.cpp 2022-07-14 08:05:38.000000000 +0000
+++ openjdk-17-17.0.5+8/src/hotspot/share/opto/chaitin.cpp 2022-10-10 13:07:22.000000000 +0000
@@ -1700,6 +1700,19 @@
if( cisc->oper_input_base() > 1 && mach->oper_input_base() <= 1 ) {
assert( cisc->oper_input_base() == 2, "Only adding one edge");
cisc->ins_req(1,src); // Requires a memory edge
+ } else {
+ // There is no space reserved for a memory edge before the inputs for
+ // instructions which have "stackSlotX" parameter instead of "memory".
+ // For example, "MoveF2I_stack_reg". We always need a memory edge from
+ // src to cisc, else we might schedule cisc before src, loading from a
+ // spill location before storing the spill. On some platforms, we land
+ // in this else case because mach->oper_input_base() > 1, i.e. we have
+ // multiple inputs. In some rare cases there are even multiple memory
+ // operands, before and after spilling.
+ // (e.g. spilling "addFPR24_reg_mem" to "addFPR24_mem_cisc")
+ // In either case, there is no space in the inputs for the memory edge
+ // so we add an additional precedence / memory edge.
+ cisc->add_prec(src);
}
block->map_node(cisc, j); // Insert into basic block
n->subsume_by(cisc, C); // Correct graph
diff -Nru openjdk-17-17.0.4+8/src/hotspot/share/opto/compile.cpp openjdk-17-17.0.5+8/src/hotspot/share/opto/compile.cpp
--- openjdk-17-17.0.4+8/src/hotspot/share/opto/compile.cpp 2022-07-14 08:05:38.000000000 +0000
+++ openjdk-17-17.0.5+8/src/hotspot/share/opto/compile.cpp 2022-10-10 13:07:22.000000000 +0000
@@ -2015,10 +2015,8 @@
bool Compile::optimize_loops(PhaseIterGVN& igvn, LoopOptsMode mode) {
if (_loop_opts_cnt > 0) {
- debug_only( int cnt = 0; );
while (major_progress() && (_loop_opts_cnt > 0)) {
TracePhase tp("idealLoop", &timers[_t_idealLoop]);
- assert( cnt++ < 40, "infinite cycle in loop optimization" );
PhaseIdealLoop::optimize(igvn, mode);
_loop_opts_cnt--;
if (failing()) return false;
@@ -3519,7 +3517,7 @@
n->set_req(MemBarNode::Precedent, top());
while (wq.size() > 0) {
Node* m = wq.pop();
- if (m->outcnt() == 0) {
+ if (m->outcnt() == 0 && m != top()) {
for (uint j = 0; j < m->req(); j++) {
Node* in = m->in(j);
if (in != NULL) {
@@ -3740,7 +3738,7 @@
// 'fall-thru' path, so expected kids is 1 less.
if (n->is_PCTable() && n->in(0) && n->in(0)->in(0)) {
if (n->in(0)->in(0)->is_Call()) {
- CallNode* call = n->in(0)->in(0)->as_Call();
+ CallNode *call = n->in(0)->in(0)->as_Call();
if (call->entry_point() == OptoRuntime::rethrow_stub()) {
required_outcnt--; // Rethrow always has 1 less kid
} else if (call->req() > TypeFunc::Parms &&
@@ -3749,25 +3747,22 @@
// detected that the virtual call will always result in a null
// pointer exception. The fall-through projection of this CatchNode
// will not be populated.
- Node* arg0 = call->in(TypeFunc::Parms);
+ Node *arg0 = call->in(TypeFunc::Parms);
if (arg0->is_Type() &&
arg0->as_Type()->type()->higher_equal(TypePtr::NULL_PTR)) {
required_outcnt--;
}
- } else if (call->entry_point() == OptoRuntime::new_array_Java() ||
- call->entry_point() == OptoRuntime::new_array_nozero_Java()) {
- // Check for illegal array length. In such case, the optimizer has
+ } else if (call->entry_point() == OptoRuntime::new_array_Java() &&
+ call->req() > TypeFunc::Parms+1 &&
+ call->is_CallStaticJava()) {
+ // Check for negative array length. In such case, the optimizer has
// detected that the allocation attempt will always result in an
// exception. There is no fall-through projection of this CatchNode .
- assert(call->is_CallStaticJava(), "static call expected");
- assert(call->req() == call->jvms()->endoff() + 1, "missing extra input");
- Node* valid_length_test = call->in(call->req()-1);
- call->del_req(call->req()-1);
- if (valid_length_test->find_int_con(1) == 0) {
+ Node *arg1 = call->in(TypeFunc::Parms+1);
+ if (arg1->is_Type() &&
+ arg1->as_Type()->type()->join(TypeInt::POS)->empty()) {
required_outcnt--;
}
- assert(n->outcnt() == required_outcnt, "malformed control flow");
- continue;
}
}
}
@@ -3776,14 +3771,6 @@
record_method_not_compilable("malformed control flow");
return true; // Not all targets reachable!
}
- } else if (n->is_PCTable() && n->in(0) && n->in(0)->in(0) && n->in(0)->in(0)->is_Call()) {
- CallNode* call = n->in(0)->in(0)->as_Call();
- if (call->entry_point() == OptoRuntime::new_array_Java() ||
- call->entry_point() == OptoRuntime::new_array_nozero_Java()) {
- assert(call->is_CallStaticJava(), "static call expected");
- assert(call->req() == call->jvms()->endoff() + 1, "missing extra input");
- call->del_req(call->req()-1); // valid length test useless now
- }
}
// Check that I actually visited all kids. Unreached kids
// must be infinite loops.
diff -Nru openjdk-17-17.0.4+8/src/hotspot/share/opto/graphKit.cpp openjdk-17-17.0.5+8/src/hotspot/share/opto/graphKit.cpp
--- openjdk-17-17.0.4+8/src/hotspot/share/opto/graphKit.cpp 2022-07-14 08:05:38.000000000 +0000
+++ openjdk-17-17.0.5+8/src/hotspot/share/opto/graphKit.cpp 2022-10-10 13:07:22.000000000 +0000
@@ -1537,14 +1537,7 @@
const TypePtr* adr_type = NULL; // debug-mode-only argument
debug_only(adr_type = C->get_adr_type(adr_idx));
Node* mem = memory(adr_idx);
- Node* ld;
- if (require_atomic_access && bt == T_LONG) {
- ld = LoadLNode::make_atomic(ctl, mem, adr, adr_type, t, mo, control_dependency, unaligned, mismatched, unsafe, barrier_data);
- } else if (require_atomic_access && bt == T_DOUBLE) {
- ld = LoadDNode::make_atomic(ctl, mem, adr, adr_type, t, mo, control_dependency, unaligned, mismatched, unsafe, barrier_data);
- } else {
- ld = LoadNode::make(_gvn, ctl, mem, adr, adr_type, t, bt, mo, control_dependency, unaligned, mismatched, unsafe, barrier_data);
- }
+ Node* ld = LoadNode::make(_gvn, ctl, mem, adr, adr_type, t, bt, mo, control_dependency, require_atomic_access, unaligned, mismatched, unsafe, barrier_data);
ld = _gvn.transform(ld);
if (((bt == T_OBJECT) && C->do_escape_analysis()) || C->eliminate_boxing()) {
// Improve graph before escape analysis and boxing elimination.
@@ -1564,14 +1557,7 @@
const TypePtr* adr_type = NULL;
debug_only(adr_type = C->get_adr_type(adr_idx));
Node *mem = memory(adr_idx);
- Node* st;
- if (require_atomic_access && bt == T_LONG) {
- st = StoreLNode::make_atomic(ctl, mem, adr, adr_type, val, mo);
- } else if (require_atomic_access && bt == T_DOUBLE) {
- st = StoreDNode::make_atomic(ctl, mem, adr, adr_type, val, mo);
- } else {
- st = StoreNode::make(_gvn, ctl, mem, adr, adr_type, val, bt, mo);
- }
+ Node* st = StoreNode::make(_gvn, ctl, mem, adr, adr_type, val, bt, mo, require_atomic_access);
if (unaligned) {
st->as_Store()->set_unaligned_access();
}
@@ -2744,9 +2730,7 @@
// Make a catch node with just two handlers: fall-through and catch-all
Node* i_o = _gvn.transform( new ProjNode(call, TypeFunc::I_O, separate_io_proj) );
Node* catc = _gvn.transform( new CatchNode(control(), i_o, 2) );
- Node* norm = new CatchProjNode(catc, CatchProjNode::fall_through_index, CatchProjNode::no_handler_bci);
- _gvn.set_type_bottom(norm);
- C->record_for_igvn(norm);
+ Node* norm = _gvn.transform( new CatchProjNode(catc, CatchProjNode::fall_through_index, CatchProjNode::no_handler_bci) );
Node* excp = _gvn.transform( new CatchProjNode(catc, CatchProjNode::catch_all_index, CatchProjNode::no_handler_bci) );
{ PreserveJVMState pjvms(this);
@@ -3985,28 +3969,20 @@
initial_slow_test = initial_slow_test->as_Bool()->as_int_value(&_gvn);
}
- const TypeOopPtr* ary_type = _gvn.type(klass_node)->is_klassptr()->as_instance_type();
- Node* valid_length_test = _gvn.intcon(1);
- if (ary_type->klass()->is_array_klass()) {
- BasicType bt = ary_type->klass()->as_array_klass()->element_type()->basic_type();
- jint max = TypeAryPtr::max_array_length(bt);
- Node* valid_length_cmp = _gvn.transform(new CmpUNode(length, intcon(max)));
- valid_length_test = _gvn.transform(new BoolNode(valid_length_cmp, BoolTest::le));
- }
-
// Create the AllocateArrayNode and its result projections
AllocateArrayNode* alloc
= new AllocateArrayNode(C, AllocateArrayNode::alloc_type(TypeInt::INT),
control(), mem, i_o(),
size, klass_node,
initial_slow_test,
- length, valid_length_test);
+ length);
// Cast to correct type. Note that the klass_node may be constant or not,
// and in the latter case the actual array type will be inexact also.
// (This happens via a non-constant argument to inline_native_newArray.)
// In any case, the value of klass_node provides the desired array type.
const TypeInt* length_type = _gvn.find_int_type(length);
+ const TypeOopPtr* ary_type = _gvn.type(klass_node)->is_klassptr()->as_instance_type();
if (ary_type->isa_aryptr() && length_type != NULL) {
// Try to get a better type than POS for the size
ary_type = ary_type->is_aryptr()->cast_to_size(length_type);
diff -Nru openjdk-17-17.0.4+8/src/hotspot/share/opto/idealKit.cpp openjdk-17-17.0.5+8/src/hotspot/share/opto/idealKit.cpp
--- openjdk-17-17.0.4+8/src/hotspot/share/opto/idealKit.cpp 2022-07-14 08:05:38.000000000 +0000
+++ openjdk-17-17.0.5+8/src/hotspot/share/opto/idealKit.cpp 2022-10-10 13:07:22.000000000 +0000
@@ -358,12 +358,7 @@
const TypePtr* adr_type = NULL; // debug-mode-only argument
debug_only(adr_type = C->get_adr_type(adr_idx));
Node* mem = memory(adr_idx);
- Node* ld;
- if (require_atomic_access && bt == T_LONG) {
- ld = LoadLNode::make_atomic(ctl, mem, adr, adr_type, t, mo);
- } else {
- ld = LoadNode::make(_gvn, ctl, mem, adr, adr_type, t, bt, mo);
- }
+ Node* ld = LoadNode::make(_gvn, ctl, mem, adr, adr_type, t, bt, mo, LoadNode::DependsOnlyOnTest, require_atomic_access);
return transform(ld);
}
@@ -375,12 +370,7 @@
const TypePtr* adr_type = NULL;
debug_only(adr_type = C->get_adr_type(adr_idx));
Node *mem = memory(adr_idx);
- Node* st;
- if (require_atomic_access && bt == T_LONG) {
- st = StoreLNode::make_atomic(ctl, mem, adr, adr_type, val, mo);
- } else {
- st = StoreNode::make(_gvn, ctl, mem, adr, adr_type, val, bt, mo);
- }
+ Node* st = StoreNode::make(_gvn, ctl, mem, adr, adr_type, val, bt, mo, require_atomic_access);
if (mismatched) {
st->as_Store()->set_mismatched_access();
}
diff -Nru openjdk-17-17.0.4+8/src/hotspot/share/opto/ifg.cpp openjdk-17-17.0.5+8/src/hotspot/share/opto/ifg.cpp
--- openjdk-17-17.0.4+8/src/hotspot/share/opto/ifg.cpp 2022-07-14 08:05:38.000000000 +0000
+++ openjdk-17-17.0.5+8/src/hotspot/share/opto/ifg.cpp 2022-10-10 13:07:22.000000000 +0000
@@ -37,6 +37,8 @@
#include "opto/memnode.hpp"
#include "opto/opcodes.hpp"
+#include
+
PhaseIFG::PhaseIFG( Arena *arena ) : Phase(Interference_Graph), _arena(arena) {
}
@@ -784,7 +786,7 @@
assert(int_pressure.current_pressure() == count_int_pressure(liveout), "the int pressure is incorrect");
assert(float_pressure.current_pressure() == count_float_pressure(liveout), "the float pressure is incorrect");
}
- assert(lrg._area >= 0.0, "negative spill area" );
+ assert(lrg._area >= 0.0, "unexpected spill area value %g (rounding mode %x)", lrg._area, fegetround());
}
}
@@ -895,7 +897,7 @@
if (g_isfinite(cost)) {
lrg._area -= cost;
}
- assert(lrg._area >= 0.0, "negative spill area" );
+ assert(lrg._area >= 0.0, "unexpected spill area value %g (rounding mode %x)", lrg._area, fegetround());
assign_high_score_to_immediate_copies(block, n, lrg, location + 1, last_inst);
diff -Nru openjdk-17-17.0.4+8/src/hotspot/share/opto/lcm.cpp openjdk-17-17.0.5+8/src/hotspot/share/opto/lcm.cpp
--- openjdk-17-17.0.4+8/src/hotspot/share/opto/lcm.cpp 2022-07-14 08:05:38.000000000 +0000
+++ openjdk-17-17.0.5+8/src/hotspot/share/opto/lcm.cpp 2022-10-10 13:07:22.000000000 +0000
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2021, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -488,9 +488,12 @@
//------------------------------select-----------------------------------------
-// Select a nice fellow from the worklist to schedule next. If there is only
-// one choice, then use it. Projections take top priority for correctness
-// reasons - if I see a projection, then it is next. There are a number of
+// Select a nice fellow from the worklist to schedule next. If there is only one
+// choice, then use it. CreateEx nodes that are initially ready must start their
+// blocks and are given the highest priority, by being placed at the beginning
+// of the worklist. Next after initially-ready CreateEx nodes are projections,
+// which must follow their parents, and CreateEx nodes with local input
+// dependencies. Next are constants and CheckCastPP nodes. There are a number of
// other special cases, for instructions that consume condition codes, et al.
// These are chosen immediately. Some instructions are required to immediately
// precede the last instruction in the block, and these are taken last. Of the
@@ -528,15 +531,28 @@
Node *n = worklist[i]; // Get Node on worklist
int iop = n->is_Mach() ? n->as_Mach()->ideal_Opcode() : 0;
- if( n->is_Proj() || // Projections always win
- n->Opcode()== Op_Con || // So does constant 'Top'
- iop == Op_CreateEx || // Create-exception must start block
- iop == Op_CheckCastPP
- ) {
+ if (iop == Op_CreateEx || n->is_Proj()) {
+ // CreateEx nodes that are initially ready must start the block (after Phi
+ // and Parm nodes which are pre-scheduled) and get top priority. This is
+ // currently enforced by placing them at the beginning of the initial
+ // worklist and selecting them eagerly here. After these, projections and
+ // other CreateEx nodes are selected with equal priority.
worklist.map(i,worklist.pop());
return n;
}
+ if (n->Opcode() == Op_Con || iop == Op_CheckCastPP) {
+ // Constants and CheckCastPP nodes have higher priority than the rest of
+ // the nodes tested below. Record as current winner, but keep looking for
+ // higher-priority nodes in the worklist.
+ choice = 4;
+ // Latency and score are only used to break ties among low-priority nodes.
+ latency = 0;
+ score = 0;
+ idx = i;
+ continue;
+ }
+
// Final call in a block must be adjacent to 'catch'
Node *e = block->end();
if( e->is_Catch() && e->in(0)->in(0) == n )
@@ -555,7 +571,7 @@
}
}
- uint n_choice = 2;
+ uint n_choice = 2;
// See if this instruction is consumed by a branch. If so, then (as the
// branch is the last instruction in the basic block) force it to the
@@ -1060,8 +1076,8 @@
// ties in scheduling by worklist order.
delay.push(m);
} else if (m->is_Mach() && m->as_Mach()->ideal_Opcode() == Op_CreateEx) {
- // Force the CreateEx to the top of the list so it's processed
- // first and ends up at the start of the block.
+ // Place CreateEx nodes that are initially ready at the beginning of the
+ // worklist so they are selected first and scheduled at the block start.
worklist.insert(0, m);
} else {
worklist.push(m); // Then on to worklist!
diff -Nru openjdk-17-17.0.4+8/src/hotspot/share/opto/loopnode.cpp openjdk-17-17.0.5+8/src/hotspot/share/opto/loopnode.cpp
--- openjdk-17-17.0.4+8/src/hotspot/share/opto/loopnode.cpp 2022-07-14 08:05:38.000000000 +0000
+++ openjdk-17-17.0.5+8/src/hotspot/share/opto/loopnode.cpp 2022-10-10 13:07:22.000000000 +0000
@@ -3409,6 +3409,17 @@
return 0;
}
+#ifdef ASSERT
+bool IdealLoopTree::has_reduction_nodes() const {
+ for (uint i = 0; i < _body.size(); i++) {
+ if (_body[i]->is_reduction()) {
+ return true;
+ }
+ }
+ return false;
+}
+#endif // ASSERT
+
#ifndef PRODUCT
//------------------------------dump_head--------------------------------------
// Dump 1 liner for loop header info
diff -Nru openjdk-17-17.0.4+8/src/hotspot/share/opto/loopnode.hpp openjdk-17-17.0.5+8/src/hotspot/share/opto/loopnode.hpp
--- openjdk-17-17.0.4+8/src/hotspot/share/opto/loopnode.hpp 2022-07-14 08:05:38.000000000 +0000
+++ openjdk-17-17.0.5+8/src/hotspot/share/opto/loopnode.hpp 2022-10-10 13:07:22.000000000 +0000
@@ -777,6 +777,11 @@
void remove_main_post_loops(CountedLoopNode *cl, PhaseIdealLoop *phase);
+#ifdef ASSERT
+ // Tell whether the body contains nodes marked as reductions.
+ bool has_reduction_nodes() const;
+#endif // ASSERT
+
#ifndef PRODUCT
void dump_head() const; // Dump loop head only
void dump() const; // Dump this loop recursively
diff -Nru openjdk-17-17.0.4+8/src/hotspot/share/opto/loopopts.cpp openjdk-17-17.0.5+8/src/hotspot/share/opto/loopopts.cpp
--- openjdk-17-17.0.4+8/src/hotspot/share/opto/loopopts.cpp 2022-07-14 08:05:38.000000000 +0000
+++ openjdk-17-17.0.5+8/src/hotspot/share/opto/loopopts.cpp 2022-10-10 13:07:22.000000000 +0000
@@ -334,9 +334,11 @@
// We allow the special case of AddP's with no local inputs.
// This allows us to split-up address expressions.
if (m->is_AddP() &&
- get_ctrl(m->in(2)) != n_ctrl &&
- get_ctrl(m->in(3)) != n_ctrl) {
- // Move the AddP up to dominating point
+ get_ctrl(m->in(AddPNode::Base)) != n_ctrl &&
+ get_ctrl(m->in(AddPNode::Address)) != n_ctrl &&
+ get_ctrl(m->in(AddPNode::Offset)) != n_ctrl) {
+ // Move the AddP up to the dominating point. That's fine because control of m's inputs
+ // must dominate get_ctrl(m) == n_ctrl and we just checked that the input controls are != n_ctrl.
Node* c = find_non_split_ctrl(idom(n_ctrl));
if (c->is_OuterStripMinedLoop()) {
c->as_Loop()->verify_strip_mined(1);
@@ -1603,6 +1605,8 @@
}
}
+// Compute the early control of a node by following its inputs until we reach
+// nodes that are pinned. Then compute the LCA of the control of all pinned nodes.
Node* PhaseIdealLoop::compute_early_ctrl(Node* n, Node* n_ctrl) {
Node* early_ctrl = NULL;
ResourceMark rm;
@@ -1618,17 +1622,14 @@
} else {
for (uint j = 0; j < m->req(); j++) {
Node* in = m->in(j);
- if (in == NULL) {
- continue;
+ if (in != NULL) {
+ wq.push(in);
}
- wq.push(in);
}
}
if (c != NULL) {
- assert(is_dominator(c, n_ctrl), "");
- if (early_ctrl == NULL) {
- early_ctrl = c;
- } else if (is_dominator(early_ctrl, c)) {
+ assert(is_dominator(c, n_ctrl), "control input must dominate current control");
+ if (early_ctrl == NULL || is_dominator(early_ctrl, c)) {
early_ctrl = c;
}
}
diff -Nru openjdk-17-17.0.4+8/src/hotspot/share/opto/loopPredicate.cpp openjdk-17-17.0.5+8/src/hotspot/share/opto/loopPredicate.cpp
--- openjdk-17-17.0.4+8/src/hotspot/share/opto/loopPredicate.cpp 2022-07-14 08:05:38.000000000 +0000
+++ openjdk-17-17.0.5+8/src/hotspot/share/opto/loopPredicate.cpp 2022-10-10 13:07:22.000000000 +0000
@@ -26,6 +26,7 @@
#include "opto/loopnode.hpp"
#include "opto/addnode.hpp"
#include "opto/callnode.hpp"
+#include "opto/castnode.hpp"
#include "opto/connode.hpp"
#include "opto/convertnode.hpp"
#include "opto/loopnode.hpp"
@@ -1392,6 +1393,10 @@
register_new_node(max_value, new_proj);
max_value = new AddINode(opaque_init, max_value);
register_new_node(max_value, new_proj);
+ // init + (current stride - initial stride) is within the loop so narrow its type by leveraging the type of the iv Phi
+ max_value = new CastIINode(max_value, loop->_head->as_CountedLoop()->phi()->bottom_type());
+ register_new_node(max_value, predicate_proj);
+
bol = rc_predicate(loop, new_proj, scale, offset, max_value, limit, stride, rng, (stride > 0) != (scale > 0), overflow, negate);
opaque_bol = new Opaque4Node(C, bol, _igvn.intcon(1));
C->add_skeleton_predicate_opaq(opaque_bol);
@@ -1399,6 +1404,7 @@
new_proj = create_new_if_for_predicate(predicate_proj, NULL, reason, overflow ? Op_If : iff->Opcode());
_igvn.replace_input_of(new_proj->in(0), 1, opaque_bol);
assert(max_value->outcnt() > 0, "should be used");
+ assert(skeleton_predicate_has_opaque(new_proj->in(0)->as_If()), "unexpected");
return new_proj;
}
diff -Nru openjdk-17-17.0.4+8/src/hotspot/share/opto/loopTransform.cpp openjdk-17-17.0.5+8/src/hotspot/share/opto/loopTransform.cpp
--- openjdk-17-17.0.4+8/src/hotspot/share/opto/loopTransform.cpp 2022-07-14 08:05:38.000000000 +0000
+++ openjdk-17-17.0.5+8/src/hotspot/share/opto/loopTransform.cpp 2022-10-10 13:07:22.000000000 +0000
@@ -1311,19 +1311,23 @@
op == Op_OrL ||
op == Op_RShiftL ||
op == Op_LShiftL ||
+ op == Op_LShiftI ||
op == Op_AddL ||
op == Op_AddI ||
op == Op_MulL ||
op == Op_MulI ||
op == Op_SubL ||
op == Op_SubI ||
- op == Op_ConvI2L);
+ op == Op_ConvI2L ||
+ op == Op_CastII);
}
bool PhaseIdealLoop::skeleton_predicate_has_opaque(IfNode* iff) {
ResourceMark rm;
Unique_Node_List wq;
wq.push(iff->in(1)->in(1));
+ uint init = 0;
+ uint stride = 0;
for (uint i = 0; i < wq.size(); i++) {
Node* n = wq.at(i);
int op = n->Opcode();
@@ -1336,11 +1340,39 @@
}
continue;
}
- if (n->is_Opaque1()) {
- return true;
+ if (n->Opcode() == Op_OpaqueLoopInit) {
+ init++;
+ } else if (n->Opcode() == Op_OpaqueLoopStride) {
+ stride++;
}
}
- return false;
+#ifdef ASSERT
+ wq.clear();
+ wq.push(iff->in(1)->in(1));
+ uint verif_init = 0;
+ uint verif_stride = 0;
+ for (uint i = 0; i < wq.size(); i++) {
+ Node* n = wq.at(i);
+ int op = n->Opcode();
+ if (!n->is_CFG()) {
+ if (n->Opcode() == Op_OpaqueLoopInit) {
+ verif_init++;
+ } else if (n->Opcode() == Op_OpaqueLoopStride) {
+ verif_stride++;
+ } else {
+ for (uint j = 1; j < n->req(); j++) {
+ Node* m = n->in(j);
+ if (m != NULL) {
+ wq.push(m);
+ }
+ }
+ }
+ }
+ }
+ assert(init == verif_init && stride == verif_stride, "missed opaque node");
+#endif
+ assert(stride == 0 || init != 0, "init should be there every time stride is");
+ return init != 0;
}
// Clone the skeleton predicate bool for a main or unswitched loop:
@@ -1557,6 +1589,15 @@
set_idom(new_pre_exit, pre_end, dd_main_head);
set_loop(new_pre_exit, outer_loop->_parent);
+ if (peel_only) {
+ // Nodes in the peeled iteration that were marked as reductions within the
+ // original loop might not be reductions within their new outer loop.
+ for (uint i = 0; i < loop->_body.size(); i++) {
+ Node* n = old_new[loop->_body[i]->_idx];
+ n->remove_flag(Node::Flag_is_reduction);
+ }
+ }
+
// Step B2: Build a zero-trip guard for the main-loop. After leaving the
// pre-loop, the main-loop may not execute at all. Later in life this
// zero-trip guard will become the minimum-trip guard when we unroll
@@ -2156,6 +2197,20 @@
new_limit = new CMoveINode(adj_bool, adj_limit, adj_max, TypeInt::INT);
}
register_new_node(new_limit, ctrl);
+ if (loop_head->unrolled_count() == 1) {
+ // The Opaque2 node created above (in the case of the first unrolling) hides the type of the loop limit.
+ // As a result, if the iv Phi constant folds (because it captured the iteration range), the exit test won't
+ // constant fold and the graph contains a broken counted loop.
+ const Type* new_limit_t;
+ if (stride_con > 0) {
+ new_limit_t = TypeInt::make(min_jint, limit_type->_hi, limit_type->_widen);
+ } else {
+ assert(stride_con < 0, "stride can't be 0");
+ new_limit_t = TypeInt::make(limit_type->_lo, max_jint, limit_type->_widen);
+ }
+ new_limit = new CastIINode(new_limit, new_limit_t);
+ register_new_node(new_limit, ctrl);
+ }
}
assert(new_limit != NULL, "");
@@ -2816,6 +2871,9 @@
register_new_node(max_value, predicate_proj);
max_value = new AddINode(opaque_init, max_value);
register_new_node(max_value, predicate_proj);
+ // init + (current stride - initial stride) is within the loop so narrow its type by leveraging the type of the iv Phi
+ max_value = new CastIINode(max_value, loop->_head->as_CountedLoop()->phi()->bottom_type());
+ register_new_node(max_value, predicate_proj);
predicate_proj = add_range_check_predicate(loop, cl, predicate_proj, scale_con, int_offset, int_limit, stride_con, max_value);
assert(skeleton_predicate_has_opaque(predicate_proj->in(0)->as_If()), "unexpected");
diff -Nru openjdk-17-17.0.4+8/src/hotspot/share/opto/macroArrayCopy.cpp openjdk-17-17.0.5+8/src/hotspot/share/opto/macroArrayCopy.cpp
--- openjdk-17-17.0.4+8/src/hotspot/share/opto/macroArrayCopy.cpp 2022-07-14 08:05:38.000000000 +0000
+++ openjdk-17-17.0.5+8/src/hotspot/share/opto/macroArrayCopy.cpp 2022-10-10 13:07:22.000000000 +0000
@@ -1017,7 +1017,7 @@
Node* sval = transform_later(
LoadNode::make(_igvn, *ctrl, (*mem)->memory_at(s_alias_idx), sptr, s_adr_type,
TypeInt::INT, T_INT, MemNode::unordered, LoadNode::DependsOnlyOnTest,
- false /*unaligned*/, is_mismatched));
+ false /*require_atomic_access*/, false /*unaligned*/, is_mismatched));
Node* st = transform_later(
StoreNode::make(_igvn, *ctrl, (*mem)->memory_at(d_alias_idx), dptr, adr_type,
sval, T_INT, MemNode::unordered));
diff -Nru openjdk-17-17.0.4+8/src/hotspot/share/opto/macro.cpp openjdk-17-17.0.5+8/src/hotspot/share/opto/macro.cpp
--- openjdk-17-17.0.4+8/src/hotspot/share/opto/macro.cpp 2022-07-14 08:05:38.000000000 +0000
+++ openjdk-17-17.0.5+8/src/hotspot/share/opto/macro.cpp 2022-10-10 13:07:22.000000000 +0000
@@ -1208,8 +1208,7 @@
AllocateNode* alloc, // allocation node to be expanded
Node* length, // array length for an array allocation
const TypeFunc* slow_call_type, // Type of slow call
- address slow_call_address, // Address of slow call
- Node* valid_length_test // whether length is valid or not
+ address slow_call_address // Address of slow call
)
{
Node* ctrl = alloc->in(TypeFunc::Control);
@@ -1395,12 +1394,6 @@
// Copy debug information and adjust JVMState information, then replace
// allocate node with the call
call->copy_call_debug_info(&_igvn, alloc);
- // For array allocations, copy the valid length check to the call node so Compile::final_graph_reshaping() can verify
- // that the call has the expected number of CatchProj nodes (in case the allocation always fails and the fallthrough
- // path dies).
- if (valid_length_test != NULL) {
- call->add_req(valid_length_test);
- }
if (expand_fast_path) {
call->set_cnt(PROB_UNLIKELY_MAG(4)); // Same effect as RC_UNCOMMON.
} else {
@@ -1882,12 +1875,11 @@
void PhaseMacroExpand::expand_allocate(AllocateNode *alloc) {
expand_allocate_common(alloc, NULL,
OptoRuntime::new_instance_Type(),
- OptoRuntime::new_instance_Java(), NULL);
+ OptoRuntime::new_instance_Java());
}
void PhaseMacroExpand::expand_allocate_array(AllocateArrayNode *alloc) {
Node* length = alloc->in(AllocateNode::ALength);
- Node* valid_length_test = alloc->in(AllocateNode::ValidLengthTest);
InitializeNode* init = alloc->initialization();
Node* klass_node = alloc->in(AllocateNode::KlassNode);
ciKlass* k = _igvn.type(klass_node)->is_klassptr()->klass();
@@ -1902,7 +1894,7 @@
}
expand_allocate_common(alloc, length,
OptoRuntime::new_array_Type(),
- slow_call_address, valid_length_test);
+ slow_call_address);
}
//-------------------mark_eliminated_box----------------------------------
diff -Nru openjdk-17-17.0.4+8/src/hotspot/share/opto/macro.hpp openjdk-17-17.0.5+8/src/hotspot/share/opto/macro.hpp
--- openjdk-17-17.0.4+8/src/hotspot/share/opto/macro.hpp 2022-07-14 08:05:38.000000000 +0000
+++ openjdk-17-17.0.5+8/src/hotspot/share/opto/macro.hpp 2022-10-10 13:07:22.000000000 +0000
@@ -92,8 +92,8 @@
void expand_allocate_common(AllocateNode* alloc,
Node* length,
const TypeFunc* slow_call_type,
- address slow_call_address,
- Node* valid_length_test);
+ address slow_call_address);
+ void yank_initalize_node(InitializeNode* node);
void yank_alloc_node(AllocateNode* alloc);
Node *value_from_mem(Node *mem, Node *ctl, BasicType ft, const Type *ftype, const TypeOopPtr *adr_t, AllocateNode *alloc);
Node *value_from_mem_phi(Node *mem, BasicType ft, const Type *ftype, const TypeOopPtr *adr_t, AllocateNode *alloc, Node_Stack *value_phis, int level);
diff -Nru openjdk-17-17.0.4+8/src/hotspot/share/opto/memnode.cpp openjdk-17-17.0.5+8/src/hotspot/share/opto/memnode.cpp
--- openjdk-17-17.0.4+8/src/hotspot/share/opto/memnode.cpp 2022-07-14 08:05:38.000000000 +0000
+++ openjdk-17-17.0.5+8/src/hotspot/share/opto/memnode.cpp 2022-10-10 13:07:22.000000000 +0000
@@ -861,8 +861,8 @@
//----------------------------LoadNode::make-----------------------------------
// Polymorphic factory method:
-Node *LoadNode::make(PhaseGVN& gvn, Node *ctl, Node *mem, Node *adr, const TypePtr* adr_type, const Type *rt, BasicType bt, MemOrd mo,
- ControlDependency control_dependency, bool unaligned, bool mismatched, bool unsafe, uint8_t barrier_data) {
+Node* LoadNode::make(PhaseGVN& gvn, Node* ctl, Node* mem, Node* adr, const TypePtr* adr_type, const Type* rt, BasicType bt, MemOrd mo,
+ ControlDependency control_dependency, bool require_atomic_access, bool unaligned, bool mismatched, bool unsafe, uint8_t barrier_data) {
Compile* C = gvn.C;
// sanity check the alias category against the created node type
@@ -884,9 +884,9 @@
case T_INT: load = new LoadINode (ctl, mem, adr, adr_type, rt->is_int(), mo, control_dependency); break;
case T_CHAR: load = new LoadUSNode(ctl, mem, adr, adr_type, rt->is_int(), mo, control_dependency); break;
case T_SHORT: load = new LoadSNode (ctl, mem, adr, adr_type, rt->is_int(), mo, control_dependency); break;
- case T_LONG: load = new LoadLNode (ctl, mem, adr, adr_type, rt->is_long(), mo, control_dependency); break;
+ case T_LONG: load = new LoadLNode (ctl, mem, adr, adr_type, rt->is_long(), mo, control_dependency, require_atomic_access); break;
case T_FLOAT: load = new LoadFNode (ctl, mem, adr, adr_type, rt, mo, control_dependency); break;
- case T_DOUBLE: load = new LoadDNode (ctl, mem, adr, adr_type, rt, mo, control_dependency); break;
+ case T_DOUBLE: load = new LoadDNode (ctl, mem, adr, adr_type, rt, mo, control_dependency, require_atomic_access); break;
case T_ADDRESS: load = new LoadPNode (ctl, mem, adr, adr_type, rt->is_ptr(), mo, control_dependency); break;
case T_OBJECT:
#ifdef _LP64
@@ -922,42 +922,6 @@
return load;
}
-LoadLNode* LoadLNode::make_atomic(Node* ctl, Node* mem, Node* adr, const TypePtr* adr_type, const Type* rt, MemOrd mo,
- ControlDependency control_dependency, bool unaligned, bool mismatched, bool unsafe, uint8_t barrier_data) {
- bool require_atomic = true;
- LoadLNode* load = new LoadLNode(ctl, mem, adr, adr_type, rt->is_long(), mo, control_dependency, require_atomic);
- if (unaligned) {
- load->set_unaligned_access();
- }
- if (mismatched) {
- load->set_mismatched_access();
- }
- if (unsafe) {
- load->set_unsafe_access();
- }
- load->set_barrier_data(barrier_data);
- return load;
-}
-
-LoadDNode* LoadDNode::make_atomic(Node* ctl, Node* mem, Node* adr, const TypePtr* adr_type, const Type* rt, MemOrd mo,
- ControlDependency control_dependency, bool unaligned, bool mismatched, bool unsafe, uint8_t barrier_data) {
- bool require_atomic = true;
- LoadDNode* load = new LoadDNode(ctl, mem, adr, adr_type, rt, mo, control_dependency, require_atomic);
- if (unaligned) {
- load->set_unaligned_access();
- }
- if (mismatched) {
- load->set_mismatched_access();
- }
- if (unsafe) {
- load->set_unsafe_access();
- }
- load->set_barrier_data(barrier_data);
- return load;
-}
-
-
-
//------------------------------hash-------------------------------------------
uint LoadNode::hash() const {
// unroll addition of interesting fields
@@ -1288,7 +1252,7 @@
}
return LoadNode::make(gvn, in(MemNode::Control), in(MemNode::Memory), in(MemNode::Address),
raw_adr_type(), rt, bt, _mo, _control_dependency,
- is_unaligned_access(), is_mismatched_access());
+ false /*require_atomic_access*/, is_unaligned_access(), is_mismatched_access());
}
// Construct an equivalent signed load.
@@ -1308,7 +1272,7 @@
}
return LoadNode::make(gvn, in(MemNode::Control), in(MemNode::Memory), in(MemNode::Address),
raw_adr_type(), rt, bt, _mo, _control_dependency,
- is_unaligned_access(), is_mismatched_access());
+ false /*require_atomic_access*/, is_unaligned_access(), is_mismatched_access());
}
bool LoadNode::has_reinterpret_variant(const Type* rt) {
@@ -1331,9 +1295,12 @@
if (raw_type == NULL) {
is_mismatched = true; // conservatively match all non-raw accesses as mismatched
}
+ const int op = Opcode();
+ bool require_atomic_access = (op == Op_LoadL && ((LoadLNode*)this)->require_atomic_access()) ||
+ (op == Op_LoadD && ((LoadDNode*)this)->require_atomic_access());
return LoadNode::make(gvn, in(MemNode::Control), in(MemNode::Memory), in(MemNode::Address),
raw_adr_type(), rt, bt, _mo, _control_dependency,
- is_unaligned_access(), is_mismatched);
+ require_atomic_access, is_unaligned_access(), is_mismatched);
}
bool StoreNode::has_reinterpret_variant(const Type* vt) {
@@ -1351,7 +1318,11 @@
Node* StoreNode::convert_to_reinterpret_store(PhaseGVN& gvn, Node* val, const Type* vt) {
BasicType bt = vt->basic_type();
assert(has_reinterpret_variant(vt), "no reinterpret variant: %s %s", Name(), type2name(bt));
- StoreNode* st = StoreNode::make(gvn, in(MemNode::Control), in(MemNode::Memory), in(MemNode::Address), raw_adr_type(), val, bt, _mo);
+ const int op = Opcode();
+ bool require_atomic_access = (op == Op_StoreL && ((StoreLNode*)this)->require_atomic_access()) ||
+ (op == Op_StoreD && ((StoreDNode*)this)->require_atomic_access());
+ StoreNode* st = StoreNode::make(gvn, in(MemNode::Control), in(MemNode::Memory), in(MemNode::Address),
+ raw_adr_type(), val, bt, _mo, require_atomic_access);
bool is_mismatched = is_mismatched_access();
const TypeRawPtr* raw_type = gvn.type(in(MemNode::Memory))->isa_rawptr();
@@ -2588,7 +2559,7 @@
//=============================================================================
//---------------------------StoreNode::make-----------------------------------
// Polymorphic factory method:
-StoreNode* StoreNode::make(PhaseGVN& gvn, Node* ctl, Node* mem, Node* adr, const TypePtr* adr_type, Node* val, BasicType bt, MemOrd mo) {
+StoreNode* StoreNode::make(PhaseGVN& gvn, Node* ctl, Node* mem, Node* adr, const TypePtr* adr_type, Node* val, BasicType bt, MemOrd mo, bool require_atomic_access) {
assert((mo == unordered || mo == release), "unexpected");
Compile* C = gvn.C;
assert(C->get_alias_index(adr_type) != Compile::AliasIdxRaw ||
@@ -2600,9 +2571,9 @@
case T_INT: return new StoreINode(ctl, mem, adr, adr_type, val, mo);
case T_CHAR:
case T_SHORT: return new StoreCNode(ctl, mem, adr, adr_type, val, mo);
- case T_LONG: return new StoreLNode(ctl, mem, adr, adr_type, val, mo);
+ case T_LONG: return new StoreLNode(ctl, mem, adr, adr_type, val, mo, require_atomic_access);
case T_FLOAT: return new StoreFNode(ctl, mem, adr, adr_type, val, mo);
- case T_DOUBLE: return new StoreDNode(ctl, mem, adr, adr_type, val, mo);
+ case T_DOUBLE: return new StoreDNode(ctl, mem, adr, adr_type, val, mo, require_atomic_access);
case T_METADATA:
case T_ADDRESS:
case T_OBJECT:
@@ -2626,17 +2597,6 @@
}
}
-StoreLNode* StoreLNode::make_atomic(Node* ctl, Node* mem, Node* adr, const TypePtr* adr_type, Node* val, MemOrd mo) {
- bool require_atomic = true;
- return new StoreLNode(ctl, mem, adr, adr_type, val, mo, require_atomic);
-}
-
-StoreDNode* StoreDNode::make_atomic(Node* ctl, Node* mem, Node* adr, const TypePtr* adr_type, Node* val, MemOrd mo) {
- bool require_atomic = true;
- return new StoreDNode(ctl, mem, adr, adr_type, val, mo, require_atomic);
-}
-
-
//--------------------------bottom_type----------------------------------------
const Type *StoreNode::bottom_type() const {
return Type::MEMORY;
@@ -3118,7 +3078,7 @@
// Clearing a short array is faster with stores
Node *ClearArrayNode::Ideal(PhaseGVN *phase, bool can_reshape) {
// Already know this is a large node, do not try to ideal it
- if (!IdealizeClearArrayNode || _is_large) return NULL;
+ if (_is_large) return NULL;
const int unit = BytesPerLong;
const TypeX* t = phase->type(in(2))->isa_intptr_t();
@@ -3139,6 +3099,7 @@
} else if (size > 2 && Matcher::match_rule_supported_vector(Op_ClearArray, 4, T_LONG)) {
return NULL;
}
+ if (!IdealizeClearArrayNode) return NULL;
Node *mem = in(1);
if( phase->type(mem)==Type::TOP ) return NULL;
Node *adr = in(3);
diff -Nru openjdk-17-17.0.4+8/src/hotspot/share/opto/memnode.hpp openjdk-17-17.0.5+8/src/hotspot/share/opto/memnode.hpp
--- openjdk-17-17.0.4+8/src/hotspot/share/opto/memnode.hpp 2022-07-14 08:05:38.000000000 +0000
+++ openjdk-17-17.0.5+8/src/hotspot/share/opto/memnode.hpp 2022-10-10 13:07:22.000000000 +0000
@@ -226,10 +226,10 @@
}
// Polymorphic factory method:
- static Node* make(PhaseGVN& gvn, Node *c, Node *mem, Node *adr,
- const TypePtr* at, const Type *rt, BasicType bt,
+ static Node* make(PhaseGVN& gvn, Node* c, Node* mem, Node* adr,
+ const TypePtr* at, const Type* rt, BasicType bt,
MemOrd mo, ControlDependency control_dependency = DependsOnlyOnTest,
- bool unaligned = false, bool mismatched = false, bool unsafe = false,
+ bool require_atomic_access = false, bool unaligned = false, bool mismatched = false, bool unsafe = false,
uint8_t barrier_data = 0);
virtual uint hash() const; // Check the type
@@ -415,9 +415,7 @@
virtual int store_Opcode() const { return Op_StoreL; }
virtual BasicType memory_type() const { return T_LONG; }
bool require_atomic_access() const { return _require_atomic_access; }
- static LoadLNode* make_atomic(Node* ctl, Node* mem, Node* adr, const TypePtr* adr_type,
- const Type* rt, MemOrd mo, ControlDependency control_dependency = DependsOnlyOnTest,
- bool unaligned = false, bool mismatched = false, bool unsafe = false, uint8_t barrier_data = 0);
+
#ifndef PRODUCT
virtual void dump_spec(outputStream *st) const {
LoadNode::dump_spec(st);
@@ -467,9 +465,7 @@
virtual int store_Opcode() const { return Op_StoreD; }
virtual BasicType memory_type() const { return T_DOUBLE; }
bool require_atomic_access() const { return _require_atomic_access; }
- static LoadDNode* make_atomic(Node* ctl, Node* mem, Node* adr, const TypePtr* adr_type,
- const Type* rt, MemOrd mo, ControlDependency control_dependency = DependsOnlyOnTest,
- bool unaligned = false, bool mismatched = false, bool unsafe = false, uint8_t barrier_data = 0);
+
#ifndef PRODUCT
virtual void dump_spec(outputStream *st) const {
LoadNode::dump_spec(st);
@@ -610,8 +606,9 @@
// procedure must indicate that the store requires `release'
// semantics, if the stored value is an object reference that might
// point to a new object and may become externally visible.
- static StoreNode* make(PhaseGVN& gvn, Node *c, Node *mem, Node *adr,
- const TypePtr* at, Node *val, BasicType bt, MemOrd mo);
+ static StoreNode* make(PhaseGVN& gvn, Node* c, Node* mem, Node* adr,
+ const TypePtr* at, Node* val, BasicType bt,
+ MemOrd mo, bool require_atomic_access = false);
virtual uint hash() const; // Check the type
@@ -692,7 +689,7 @@
virtual int Opcode() const;
virtual BasicType memory_type() const { return T_LONG; }
bool require_atomic_access() const { return _require_atomic_access; }
- static StoreLNode* make_atomic(Node* ctl, Node* mem, Node* adr, const TypePtr* adr_type, Node* val, MemOrd mo);
+
#ifndef PRODUCT
virtual void dump_spec(outputStream *st) const {
StoreNode::dump_spec(st);
@@ -728,7 +725,7 @@
virtual int Opcode() const;
virtual BasicType memory_type() const { return T_DOUBLE; }
bool require_atomic_access() const { return _require_atomic_access; }
- static StoreDNode* make_atomic(Node* ctl, Node* mem, Node* adr, const TypePtr* adr_type, Node* val, MemOrd mo);
+
#ifndef PRODUCT
virtual void dump_spec(outputStream *st) const {
StoreNode::dump_spec(st);
diff -Nru openjdk-17-17.0.4+8/src/hotspot/share/opto/split_if.cpp openjdk-17-17.0.5+8/src/hotspot/share/opto/split_if.cpp
--- openjdk-17-17.0.4+8/src/hotspot/share/opto/split_if.cpp 2022-07-14 08:05:38.000000000 +0000
+++ openjdk-17-17.0.5+8/src/hotspot/share/opto/split_if.cpp 2022-10-10 13:07:22.000000000 +0000
@@ -128,8 +128,8 @@
}
} else {
// We might see an Opaque1 from a loop limit check here
- assert(use->is_If() || use->is_CMove() || use->Opcode() == Op_Opaque1 || use->is_AllocateArray(), "unexpected node type");
- Node *use_c = (use->is_If() || use->is_AllocateArray()) ? use->in(0) : get_ctrl(use);
+ assert(use->is_If() || use->is_CMove() || use->Opcode() == Op_Opaque1, "unexpected node type");
+ Node *use_c = use->is_If() ? use->in(0) : get_ctrl(use);
if (use_c == blk1 || use_c == blk2) {
assert(use->is_CMove(), "unexpected node type");
continue;
@@ -166,15 +166,14 @@
--j;
} else {
// We might see an Opaque1 from a loop limit check here
- assert(u->is_If() || u->is_CMove() || u->Opcode() == Op_Opaque1 || u->is_AllocateArray(), "unexpected node type");
- assert(u->is_AllocateArray() || u->in(1) == bol, "");
- assert(!u->is_AllocateArray() || u->in(AllocateNode::ValidLengthTest) == bol, "wrong input to AllocateArray");
+ assert(u->is_If() || u->is_CMove() || u->Opcode() == Op_Opaque1, "unexpected node type");
+ assert(u->in(1) == bol, "");
// Get control block of either the CMove or the If input
- Node *u_ctrl = (u->is_If() || u->is_AllocateArray()) ? u->in(0) : get_ctrl(u);
+ Node *u_ctrl = u->is_If() ? u->in(0) : get_ctrl(u);
assert((u_ctrl != blk1 && u_ctrl != blk2) || u->is_CMove(), "won't converge");
Node *x = bol->clone();
register_new_node(x, u_ctrl);
- _igvn.replace_input_of(u, u->is_AllocateArray() ? AllocateNode::ValidLengthTest : 1, x);
+ _igvn.replace_input_of(u, 1, x);
--j;
}
}
diff -Nru openjdk-17-17.0.4+8/src/hotspot/share/opto/subnode.cpp openjdk-17-17.0.5+8/src/hotspot/share/opto/subnode.cpp
--- openjdk-17-17.0.4+8/src/hotspot/share/opto/subnode.cpp 2022-07-14 08:05:38.000000000 +0000
+++ openjdk-17-17.0.5+8/src/hotspot/share/opto/subnode.cpp 2022-10-10 13:07:22.000000000 +0000
@@ -733,11 +733,10 @@
int w = MAX2(r0->_widen, r1->_widen); // _widen does not matter here
const TypeInt* tr1 = TypeInt::make(lo_tr1, hi_tr1, w);
const TypeInt* tr2 = TypeInt::make(lo_tr2, hi_tr2, w);
- const Type* cmp1 = sub(tr1, t2);
- const Type* cmp2 = sub(tr2, t2);
- if (cmp1 == cmp2) {
- return cmp1; // Hit!
- }
+ const TypeInt* cmp1 = sub(tr1, t2)->is_int();
+ const TypeInt* cmp2 = sub(tr2, t2)->is_int();
+ // compute union, so that cmp handles all possible results from the two cases
+ return cmp1->meet(cmp2);
}
}
}
diff -Nru openjdk-17-17.0.4+8/src/hotspot/share/opto/superword.cpp openjdk-17-17.0.5+8/src/hotspot/share/opto/superword.cpp
--- openjdk-17-17.0.4+8/src/hotspot/share/opto/superword.cpp 2022-07-14 08:05:38.000000000 +0000
+++ openjdk-17-17.0.5+8/src/hotspot/share/opto/superword.cpp 2022-10-10 13:07:22.000000000 +0000
@@ -2408,6 +2408,11 @@
return false;
}
+ // Check that the loop to be vectorized does not have inconsistent reduction
+ // information, which would likely lead to a miscompilation.
+ assert(!lpt()->has_reduction_nodes() || cl->is_reduction_loop(),
+ "non-reduction loop contains reduction nodes");
+
#ifndef PRODUCT
if (TraceLoopOpts) {
tty->print("SuperWord::output ");
diff -Nru openjdk-17-17.0.4+8/src/hotspot/share/prims/forte.cpp openjdk-17-17.0.5+8/src/hotspot/share/prims/forte.cpp
--- openjdk-17-17.0.4+8/src/hotspot/share/prims/forte.cpp 2022-07-14 08:05:38.000000000 +0000
+++ openjdk-17-17.0.5+8/src/hotspot/share/prims/forte.cpp 2022-10-10 13:07:22.000000000 +0000
@@ -552,6 +552,9 @@
return;
}
+ // !important! make sure all to call thread->set_in_asgct(false) before every return
+ thread->set_in_asgct(true);
+
switch (thread->thread_state()) {
case _thread_new:
case _thread_uninitialized:
@@ -609,6 +612,7 @@
trace->num_frames = ticks_unknown_state; // -7
break;
}
+ thread->set_in_asgct(false);
}
diff -Nru openjdk-17-17.0.4+8/src/hotspot/share/prims/jvm.cpp openjdk-17-17.0.5+8/src/hotspot/share/prims/jvm.cpp
--- openjdk-17-17.0.4+8/src/hotspot/share/prims/jvm.cpp 2022-07-14 08:05:38.000000000 +0000
+++ openjdk-17-17.0.5+8/src/hotspot/share/prims/jvm.cpp 2022-10-10 13:07:22.000000000 +0000
@@ -436,7 +436,7 @@
JVM_ENTRY_NO_ENV(void, JVM_Halt(jint code))
- before_exit(thread);
+ before_exit(thread, true);
vm_exit(code);
JVM_END
diff -Nru openjdk-17-17.0.4+8/src/hotspot/share/prims/jvmtiExport.cpp openjdk-17-17.0.5+8/src/hotspot/share/prims/jvmtiExport.cpp
--- openjdk-17-17.0.4+8/src/hotspot/share/prims/jvmtiExport.cpp 2022-07-14 08:05:38.000000000 +0000
+++ openjdk-17-17.0.5+8/src/hotspot/share/prims/jvmtiExport.cpp 2022-10-10 13:07:22.000000000 +0000
@@ -169,7 +169,7 @@
thread->set_active_handles(new_handles);
#endif
assert(thread == JavaThread::current(), "thread must be current!");
- thread->frame_anchor()->make_walkable(thread);
+ thread->frame_anchor()->make_walkable();
};
~JvmtiEventMark() {
diff -Nru openjdk-17-17.0.4+8/src/hotspot/share/prims/jvmtiRedefineClasses.cpp openjdk-17-17.0.5+8/src/hotspot/share/prims/jvmtiRedefineClasses.cpp
--- openjdk-17-17.0.4+8/src/hotspot/share/prims/jvmtiRedefineClasses.cpp 2022-07-14 08:05:38.000000000 +0000
+++ openjdk-17-17.0.5+8/src/hotspot/share/prims/jvmtiRedefineClasses.cpp 2022-10-10 13:07:22.000000000 +0000
@@ -1856,14 +1856,15 @@
if (old_cp->has_dynamic_constant()) {
scratch_cp->set_has_dynamic_constant();
}
- // Copy attributes from scratch_cp to merge_cp
- merge_cp->copy_fields(scratch_cp());
log_info(redefine, class, constantpool)("merge_cp_len=%d, index_map_len=%d", merge_cp_length, _index_map_count);
if (_index_map_count == 0) {
// there is nothing to map between the new and merged constant pools
+ // Copy attributes from scratch_cp to merge_cp
+ merge_cp->copy_fields(scratch_cp());
+
if (old_cp->length() == scratch_cp->length()) {
// The old and new constant pools are the same length and the
// index map is empty. This means that the three constant pools
@@ -1917,6 +1918,9 @@
return JVMTI_ERROR_INTERNAL;
}
+ // Copy attributes from scratch_cp to merge_cp (should be done after rewrite_cp_refs())
+ merge_cp->copy_fields(scratch_cp());
+
// Replace the new constant pool with a shrunken copy of the
// merged constant pool so now the rewritten bytecodes have
// valid references; the previous new constant pool will get
@@ -3507,10 +3511,9 @@
} // end rewrite_cp_refs_in_verification_type_info()
-// Change the constant pool associated with klass scratch_class to
-// scratch_cp. If shrink is true, then scratch_cp_length elements
-// are copied from scratch_cp to a smaller constant pool and the
-// smaller constant pool is associated with scratch_class.
+// Change the constant pool associated with klass scratch_class to scratch_cp.
+// scratch_cp_length elements are copied from scratch_cp to a smaller constant pool
+// and the smaller constant pool is associated with scratch_class.
void VM_RedefineClasses::set_new_constant_pool(
ClassLoaderData* loader_data,
InstanceKlass* scratch_class, constantPoolHandle scratch_cp,
@@ -4374,10 +4377,6 @@
// Leave arrays of jmethodIDs and itable index cache unchanged
- // Copy the "source file name" attribute from new class version
- the_class->set_source_file_name_index(
- scratch_class->source_file_name_index());
-
// Copy the "source debug extension" attribute from new class version
the_class->set_source_debug_extension(
scratch_class->source_debug_extension(),
diff -Nru openjdk-17-17.0.4+8/src/hotspot/share/runtime/arguments.cpp openjdk-17-17.0.5+8/src/hotspot/share/runtime/arguments.cpp
--- openjdk-17-17.0.4+8/src/hotspot/share/runtime/arguments.cpp 2022-07-14 08:05:38.000000000 +0000
+++ openjdk-17-17.0.5+8/src/hotspot/share/runtime/arguments.cpp 2022-10-10 13:07:22.000000000 +0000
@@ -53,7 +53,7 @@
#include "runtime/safepointMechanism.hpp"
#include "runtime/vm_version.hpp"
#include "services/management.hpp"
-#include "services/memTracker.hpp"
+#include "services/nmtCommon.hpp"
#include "utilities/align.hpp"
#include "utilities/defaultStream.hpp"
#include "utilities/macros.hpp"
@@ -1985,17 +1985,6 @@
status = false;
}
- if (PrintNMTStatistics) {
-#if INCLUDE_NMT
- if (MemTracker::tracking_level() == NMT_off) {
-#endif // INCLUDE_NMT
- warning("PrintNMTStatistics is disabled, because native memory tracking is not enabled");
- PrintNMTStatistics = false;
-#if INCLUDE_NMT
- }
-#endif
- }
-
status = CompilerConfig::check_args_consistency(status);
#if INCLUDE_JVMCI
if (status && EnableJVMCI) {
@@ -3718,29 +3707,6 @@
JVMFlag::printFlags(tty, false);
vm_exit(0);
}
- if (match_option(option, "-XX:NativeMemoryTracking", &tail)) {
-#if INCLUDE_NMT
- // The launcher did not setup nmt environment variable properly.
- if (!MemTracker::check_launcher_nmt_support(tail)) {
- warning("Native Memory Tracking did not setup properly, using wrong launcher?");
- }
-
- // Verify if nmt option is valid.
- if (MemTracker::verify_nmt_option()) {
- // Late initialization, still in single-threaded mode.
- if (MemTracker::tracking_level() >= NMT_summary) {
- MemTracker::init();
- }
- } else {
- vm_exit_during_initialization("Syntax error, expecting -XX:NativeMemoryTracking=[off|summary|detail]", NULL);
- }
- continue;
-#else
- jio_fprintf(defaultStream::error_stream(),
- "Native Memory Tracking is not supported in this VM\n");
- return JNI_ERR;
-#endif
- }
#ifndef PRODUCT
if (match_option(option, "-XX:+PrintFlagsWithComments")) {
@@ -3992,6 +3958,26 @@
no_shared_spaces("CDS Disabled");
#endif // INCLUDE_CDS
+#if INCLUDE_NMT
+ // Verify NMT arguments
+ const NMT_TrackingLevel lvl = NMTUtil::parse_tracking_level(NativeMemoryTracking);
+ if (lvl == NMT_unknown) {
+ jio_fprintf(defaultStream::error_stream(),
+ "Syntax error, expecting -XX:NativeMemoryTracking=[off|summary|detail]", NULL);
+ return JNI_ERR;
+ }
+ if (PrintNMTStatistics && lvl == NMT_off) {
+ warning("PrintNMTStatistics is disabled, because native memory tracking is not enabled");
+ FLAG_SET_DEFAULT(PrintNMTStatistics, false);
+ }
+#else
+ if (!FLAG_IS_DEFAULT(NativeMemoryTracking) || PrintNMTStatistics) {
+ warning("Native Memory Tracking is not supported in this VM");
+ FLAG_SET_DEFAULT(NativeMemoryTracking, "off");
+ FLAG_SET_DEFAULT(PrintNMTStatistics, false);
+ }
+#endif // INCLUDE_NMT
+
if (TraceDependencies && VerifyDependencies) {
if (!FLAG_IS_DEFAULT(TraceDependencies)) {
warning("TraceDependencies results may be inflated by VerifyDependencies");
diff -Nru openjdk-17-17.0.4+8/src/hotspot/share/runtime/frame.hpp openjdk-17-17.0.5+8/src/hotspot/share/runtime/frame.hpp
--- openjdk-17-17.0.4+8/src/hotspot/share/runtime/frame.hpp 2022-07-14 08:05:38.000000000 +0000
+++ openjdk-17-17.0.5+8/src/hotspot/share/runtime/frame.hpp 2022-10-10 13:07:22.000000000 +0000
@@ -202,8 +202,12 @@
public:
// Link (i.e., the pointer to the previous frame)
+ // might crash if the frame has no parent
intptr_t* link() const;
+ // Link (i.e., the pointer to the previous frame) or null if the link cannot be accessed
+ intptr_t* link_or_null() const;
+
// Return address
address sender_pc() const;
diff -Nru openjdk-17-17.0.4+8/src/hotspot/share/runtime/interfaceSupport.inline.hpp openjdk-17-17.0.5+8/src/hotspot/share/runtime/interfaceSupport.inline.hpp
--- openjdk-17-17.0.4+8/src/hotspot/share/runtime/interfaceSupport.inline.hpp 2022-07-14 08:05:38.000000000 +0000
+++ openjdk-17-17.0.5+8/src/hotspot/share/runtime/interfaceSupport.inline.hpp 2022-10-10 13:07:22.000000000 +0000
@@ -138,7 +138,7 @@
_original_state(thread->thread_state()) {
if (thread->has_last_Java_frame()) {
- thread->frame_anchor()->make_walkable(thread);
+ thread->frame_anchor()->make_walkable();
}
thread->set_thread_state(_thread_in_vm);
@@ -209,7 +209,7 @@
// we call known native code using this wrapper holding locks.
_thread->check_possible_safepoint();
// Once we are in native vm expects stack to be walkable
- _thread->frame_anchor()->make_walkable(_thread);
+ _thread->frame_anchor()->make_walkable();
OrderAccess::storestore(); // Keep thread_state change and make_walkable() separate.
_thread->set_thread_state(_thread_in_native);
}
@@ -222,7 +222,7 @@
// We are leaving the VM at this point and going directly to native code.
// Block, if we are in the middle of a safepoint synchronization.
assert(!thread->owns_locks(), "must release all locks when leaving VM");
- thread->frame_anchor()->make_walkable(thread);
+ thread->frame_anchor()->make_walkable();
trans(_thread_in_vm, _thread_in_native);
// Check for pending. async. exceptions or suspends.
if (_thread->has_special_runtime_exit_condition()) _thread->handle_special_runtime_exit_condition(false);
@@ -250,7 +250,7 @@
assert(thread->thread_state() == _thread_in_vm, "coming from wrong thread state");
thread->check_possible_safepoint();
// Once we are blocked vm expects stack to be walkable
- thread->frame_anchor()->make_walkable(thread);
+ thread->frame_anchor()->make_walkable();
OrderAccess::storestore(); // Keep thread_state change and make_walkable() separate.
thread->set_thread_state(_thread_blocked);
}
diff -Nru openjdk-17-17.0.4+8/src/hotspot/share/runtime/java.cpp openjdk-17-17.0.5+8/src/hotspot/share/runtime/java.cpp
--- openjdk-17-17.0.4+8/src/hotspot/share/runtime/java.cpp 2022-07-14 08:05:38.000000000 +0000
+++ openjdk-17-17.0.5+8/src/hotspot/share/runtime/java.cpp 2022-10-10 13:07:22.000000000 +0000
@@ -244,7 +244,6 @@
Deoptimization::print_statistics();
SharedRuntime::print_statistics();
#endif //COMPILER1
- os::print_statistics();
}
if (PrintLockStatistics || PrintPreciseBiasedLockingStatistics || PrintPreciseRTMLockingStatistics) {
@@ -404,7 +403,7 @@
// Note: before_exit() can be executed only once, if more than one threads
// are trying to shutdown the VM at the same time, only one thread
// can run before_exit() and all other threads must wait.
-void before_exit(JavaThread* thread) {
+void before_exit(JavaThread* thread, bool halt) {
#define BEFORE_EXIT_NOT_RUN 0
#define BEFORE_EXIT_RUNNING 1
#define BEFORE_EXIT_DONE 2
@@ -451,7 +450,7 @@
event.commit();
}
- JFR_ONLY(Jfr::on_vm_shutdown();)
+ JFR_ONLY(Jfr::on_vm_shutdown(false, halt);)
// Stop the WatcherThread. We do this before disenrolling various
// PeriodicTasks to reduce the likelihood of races.
@@ -612,7 +611,7 @@
JavaThread* jt = thread->as_Java_thread();
// Must always be walkable or have no last_Java_frame when in
// thread_in_native
- jt->frame_anchor()->make_walkable(jt);
+ jt->frame_anchor()->make_walkable();
jt->set_thread_state(_thread_in_native);
}
}
diff -Nru openjdk-17-17.0.4+8/src/hotspot/share/runtime/java.hpp openjdk-17-17.0.5+8/src/hotspot/share/runtime/java.hpp
--- openjdk-17-17.0.4+8/src/hotspot/share/runtime/java.hpp 2022-07-14 08:05:38.000000000 +0000
+++ openjdk-17-17.0.5+8/src/hotspot/share/runtime/java.hpp 2022-10-10 13:07:22.000000000 +0000
@@ -33,7 +33,7 @@
class Symbol;
// Execute code before all handles are released and thread is killed; prologue to vm_exit
-extern void before_exit(JavaThread * thread);
+extern void before_exit(JavaThread * thread, bool halt = false);
// Forced VM exit (i.e, internal error or JVM_Exit)
extern void vm_exit(int code);
diff -Nru openjdk-17-17.0.4+8/src/hotspot/share/runtime/objectMonitor.cpp openjdk-17-17.0.5+8/src/hotspot/share/runtime/objectMonitor.cpp
--- openjdk-17-17.0.4+8/src/hotspot/share/runtime/objectMonitor.cpp 2022-07-14 08:05:38.000000000 +0000
+++ openjdk-17-17.0.5+8/src/hotspot/share/runtime/objectMonitor.cpp 2022-10-10 13:07:22.000000000 +0000
@@ -668,7 +668,7 @@
} else {
// We report NULL instead of DEFLATER_MARKER here because is_busy()
// ignores DEFLATER_MARKER values.
- ss->print("owner=" INTPTR_FORMAT, NULL);
+ ss->print("owner=" INTPTR_FORMAT, NULL_WORD);
}
ss->print(", cxq=" INTPTR_FORMAT ", EntryList=" INTPTR_FORMAT, p2i(_cxq),
p2i(_EntryList));
diff -Nru openjdk-17-17.0.4+8/src/hotspot/share/runtime/os.cpp openjdk-17-17.0.5+8/src/hotspot/share/runtime/os.cpp
--- openjdk-17-17.0.4+8/src/hotspot/share/runtime/os.cpp 2022-07-14 08:05:38.000000000 +0000
+++ openjdk-17-17.0.5+8/src/hotspot/share/runtime/os.cpp 2022-10-10 13:07:22.000000000 +0000
@@ -64,6 +64,7 @@
#include "services/attachListener.hpp"
#include "services/mallocTracker.hpp"
#include "services/memTracker.hpp"
+#include "services/nmtPreInit.hpp"
#include "services/nmtCommon.hpp"
#include "services/threadService.hpp"
#include "utilities/align.hpp"
@@ -681,6 +682,15 @@
NOT_PRODUCT(inc_stat_counter(&num_mallocs, 1));
NOT_PRODUCT(inc_stat_counter(&alloc_bytes, size));
+#if INCLUDE_NMT
+ {
+ void* rc = NULL;
+ if (NMTPreInit::handle_malloc(&rc, size)) {
+ return rc;
+ }
+ }
+#endif
+
// Since os::malloc can be called when the libjvm.{dll,so} is
// first loaded and we don't have a thread yet we must accept NULL also here.
assert(!os::ThreadCrashProtection::is_crash_protected(Thread::current_or_null()),
@@ -696,6 +706,11 @@
NMT_TrackingLevel level = MemTracker::tracking_level();
size_t nmt_header_size = MemTracker::malloc_header_size(level);
+ // Check for overflow.
+ if (size + nmt_header_size < size) {
+ return NULL;
+ }
+
#ifndef ASSERT
const size_t alloc_size = size + nmt_header_size;
#else
@@ -740,6 +755,15 @@
void* os::realloc(void *memblock, size_t size, MEMFLAGS memflags, const NativeCallStack& stack) {
+#if INCLUDE_NMT
+ {
+ void* rc = NULL;
+ if (NMTPreInit::handle_realloc(&rc, memblock, size)) {
+ return rc;
+ }
+ }
+#endif
+
// For the test flag -XX:MallocMaxTestWords
if (has_reached_max_malloc_test_peak(size)) {
return NULL;
@@ -790,6 +814,13 @@
// handles NULL pointers
void os::free(void *memblock) {
+
+#if INCLUDE_NMT
+ if (NMTPreInit::handle_free(memblock)) {
+ return;
+ }
+#endif
+
NOT_PRODUCT(inc_stat_counter(&num_frees, 1));
#ifdef ASSERT
if (memblock == NULL) return;
@@ -1255,34 +1286,34 @@
st->print_cr(INTPTR_FORMAT " is an unknown value", p2i(addr));
}
+bool is_pointer_bad(intptr_t* ptr) {
+ return !is_aligned(ptr, sizeof(uintptr_t)) || !os::is_readable_pointer(ptr);
+}
+
// Looks like all platforms can use the same function to check if C
// stack is walkable beyond current frame.
+// Returns true if this is not the case, i.e. the frame is possibly
+// the first C frame on the stack.
bool os::is_first_C_frame(frame* fr) {
#ifdef _WINDOWS
return true; // native stack isn't walkable on windows this way.
#endif
-
// Load up sp, fp, sender sp and sender fp, check for reasonable values.
// Check usp first, because if that's bad the other accessors may fault
// on some architectures. Ditto ufp second, etc.
- uintptr_t fp_align_mask = (uintptr_t)(sizeof(address)-1);
- // sp on amd can be 32 bit aligned.
- uintptr_t sp_align_mask = (uintptr_t)(sizeof(int)-1);
- uintptr_t usp = (uintptr_t)fr->sp();
- if ((usp & sp_align_mask) != 0) return true;
+ if (is_pointer_bad(fr->sp())) return true;
uintptr_t ufp = (uintptr_t)fr->fp();
- if ((ufp & fp_align_mask) != 0) return true;
+ if (is_pointer_bad(fr->fp())) return true;
uintptr_t old_sp = (uintptr_t)fr->sender_sp();
- if ((old_sp & sp_align_mask) != 0) return true;
- if (old_sp == 0 || old_sp == (uintptr_t)-1) return true;
+ if ((uintptr_t)fr->sender_sp() == (uintptr_t)-1 || is_pointer_bad(fr->sender_sp())) return true;
- uintptr_t old_fp = (uintptr_t)fr->link();
- if ((old_fp & fp_align_mask) != 0) return true;
- if (old_fp == 0 || old_fp == (uintptr_t)-1 || old_fp == ufp) return true;
+ uintptr_t old_fp = (uintptr_t)fr->link_or_null();
+ if (old_fp == 0 || old_fp == (uintptr_t)-1 || old_fp == ufp ||
+ is_pointer_bad(fr->link_or_null())) return true;
// stack grows downwards; if old_fp is below current fp or if the stack
// frame is too large, either the stack is corrupted or fp is not saved
@@ -1294,7 +1325,6 @@
return false;
}
-
// Set up the boot classpath.
char* os::format_boot_path(const char* format_string,
diff -Nru openjdk-17-17.0.4+8/src/hotspot/share/runtime/safefetch.inline.hpp openjdk-17-17.0.5+8/src/hotspot/share/runtime/safefetch.inline.hpp
--- openjdk-17-17.0.4+8/src/hotspot/share/runtime/safefetch.inline.hpp 2022-07-14 08:05:38.000000000 +0000
+++ openjdk-17-17.0.5+8/src/hotspot/share/runtime/safefetch.inline.hpp 2022-10-10 13:07:22.000000000 +0000
@@ -54,10 +54,20 @@
// returns true if SafeFetch32 and SafeFetchN can be used safely (stubroutines are already generated)
inline bool CanUseSafeFetch32() {
+#if defined (__APPLE__) && defined(AARCH64)
+ if (Thread::current_or_null_safe() == NULL) { // workaround for JDK-8282475
+ return false;
+ }
+#endif // __APPLE__ && AARCH64
return StubRoutines::SafeFetch32_stub() ? true : false;
}
inline bool CanUseSafeFetchN() {
+#if defined (__APPLE__) && defined(AARCH64)
+ if (Thread::current_or_null_safe() == NULL) {
+ return false;
+ }
+#endif // __APPLE__ && AARCH64
return StubRoutines::SafeFetchN_stub() ? true : false;
}
diff -Nru openjdk-17-17.0.4+8/src/hotspot/share/runtime/safepoint.cpp openjdk-17-17.0.5+8/src/hotspot/share/runtime/safepoint.cpp
--- openjdk-17-17.0.4+8/src/hotspot/share/runtime/safepoint.cpp 2022-07-14 08:05:38.000000000 +0000
+++ openjdk-17-17.0.5+8/src/hotspot/share/runtime/safepoint.cpp 2022-10-10 13:07:22.000000000 +0000
@@ -705,7 +705,7 @@
}
JavaThreadState state = thread->thread_state();
- thread->frame_anchor()->make_walkable(thread);
+ thread->frame_anchor()->make_walkable();
uint64_t safepoint_id = SafepointSynchronize::safepoint_counter();
// Check that we have a valid thread_state at this point
diff -Nru openjdk-17-17.0.4+8/src/hotspot/share/runtime/thread.cpp openjdk-17-17.0.5+8/src/hotspot/share/runtime/thread.cpp
--- openjdk-17-17.0.4+8/src/hotspot/share/runtime/thread.cpp 2022-07-14 08:05:38.000000000 +0000
+++ openjdk-17-17.0.5+8/src/hotspot/share/runtime/thread.cpp 2022-10-10 13:07:22.000000000 +0000
@@ -374,10 +374,10 @@
// Perform common initialization actions
- register_thread_stack_with_NMT();
-
MACOS_AARCH64_ONLY(this->init_wx());
+ register_thread_stack_with_NMT();
+
JFR_ONLY(Jfr::on_thread_start(this);)
log_debug(os, thread)("Thread " UINTX_FORMAT " stack dimensions: "
@@ -1014,6 +1014,7 @@
JavaThread::JavaThread() :
// Initialize fields
+ _in_asgct(false),
_on_thread_list(false),
DEBUG_ONLY(_java_call_counter(0) COMMA)
_entry_point(nullptr),
@@ -1057,8 +1058,8 @@
_pending_failed_speculation(0),
_jvmci{nullptr},
_jvmci_counters(nullptr),
- _jvmci_reserved0(nullptr),
- _jvmci_reserved1(nullptr),
+ _jvmci_reserved0(0),
+ _jvmci_reserved1(0),
_jvmci_reserved_oop0(nullptr),
#endif // INCLUDE_JVMCI
@@ -1701,7 +1702,7 @@
void JavaThread::handle_special_runtime_exit_condition(bool check_asyncs) {
if (is_obj_deopt_suspend()) {
- frame_anchor()->make_walkable(this);
+ frame_anchor()->make_walkable();
wait_for_object_deoptimization();
}
@@ -2768,6 +2769,11 @@
jint parse_result = Arguments::parse(args);
if (parse_result != JNI_OK) return parse_result;
+#if INCLUDE_NMT
+ // Initialize NMT right after argument parsing to keep the pre-NMT-init window small.
+ MemTracker::initialize();
+#endif // INCLUDE_NMT
+
os::init_before_ergo();
jint ergo_result = Arguments::apply_ergo();
diff -Nru openjdk-17-17.0.4+8/src/hotspot/share/runtime/thread.hpp openjdk-17-17.0.5+8/src/hotspot/share/runtime/thread.hpp
--- openjdk-17-17.0.4+8/src/hotspot/share/runtime/thread.hpp 2022-07-14 08:05:38.000000000 +0000
+++ openjdk-17-17.0.5+8/src/hotspot/share/runtime/thread.hpp 2022-10-10 13:07:22.000000000 +0000
@@ -692,6 +692,7 @@
friend class ThreadsSMRSupport; // to access _threadObj for exiting_threads_oops_do
friend class HandshakeState;
private:
+ bool _in_asgct; // Is set when this JavaThread is handling ASGCT call
bool _on_thread_list; // Is set when this JavaThread is added to the Threads list
OopHandle _threadObj; // The Java level thread object
@@ -957,8 +958,8 @@
jlong* _jvmci_counters;
// Fast thread locals for use by JVMCI
- intptr_t* _jvmci_reserved0;
- intptr_t* _jvmci_reserved1;
+ jlong _jvmci_reserved0;
+ jlong _jvmci_reserved1;
oop _jvmci_reserved_oop0;
public:
@@ -969,6 +970,30 @@
static bool resize_all_jvmci_counters(int new_size);
+ void set_jvmci_reserved_oop0(oop value) {
+ _jvmci_reserved_oop0 = value;
+ }
+
+ oop get_jvmci_reserved_oop0() {
+ return _jvmci_reserved_oop0;
+ }
+
+ void set_jvmci_reserved0(jlong value) {
+ _jvmci_reserved0 = value;
+ }
+
+ jlong get_jvmci_reserved0() {
+ return _jvmci_reserved0;
+ }
+
+ void set_jvmci_reserved1(jlong value) {
+ _jvmci_reserved1 = value;
+ }
+
+ jlong get_jvmci_reserved1() {
+ return _jvmci_reserved1;
+ }
+
private:
#endif // INCLUDE_JVMCI
@@ -1391,7 +1416,7 @@
public:
// Accessing frames
frame last_frame() {
- _anchor.make_walkable(this);
+ _anchor.make_walkable();
return pd_last_frame();
}
javaVFrame* last_java_vframe(RegisterMap* reg_map);
@@ -1589,6 +1614,10 @@
static OopStorage* thread_oop_storage();
static void verify_cross_modify_fence_failure(JavaThread *thread) PRODUCT_RETURN;
+
+ // AsyncGetCallTrace support
+ inline bool in_asgct(void) {return _in_asgct;}
+ inline void set_in_asgct(bool value) {_in_asgct = value;}
};
// Inline implementation of JavaThread::current
diff -Nru openjdk-17-17.0.4+8/src/hotspot/share/services/memTracker.cpp openjdk-17-17.0.5+8/src/hotspot/share/services/memTracker.cpp
--- openjdk-17-17.0.4+8/src/hotspot/share/services/memTracker.cpp 2022-07-14 08:05:38.000000000 +0000
+++ openjdk-17-17.0.5+8/src/hotspot/share/services/memTracker.cpp 2022-10-10 13:07:22.000000000 +0000
@@ -23,8 +23,11 @@
*/
#include "precompiled.hpp"
#include "jvm.h"
+#include "logging/log.hpp"
+#include "logging/logStream.hpp"
#include "memory/metaspaceUtils.hpp"
#include "runtime/atomic.hpp"
+#include "runtime/globals.hpp"
#include "runtime/orderAccess.hpp"
#include "runtime/vmThread.hpp"
#include "runtime/vmOperations.hpp"
@@ -32,6 +35,8 @@
#include "services/memReporter.hpp"
#include "services/mallocTracker.inline.hpp"
#include "services/memTracker.hpp"
+#include "services/nmtCommon.hpp"
+#include "services/nmtPreInit.hpp"
#include "services/threadStackTracker.hpp"
#include "utilities/debug.hpp"
#include "utilities/defaultStream.hpp"
@@ -45,79 +50,44 @@
NMT_TrackingLevel MemTracker::_cmdline_tracking_level = NMT_unknown;
MemBaseline MemTracker::_baseline;
-bool MemTracker::_is_nmt_env_valid = true;
-static const size_t buffer_size = 64;
+void MemTracker::initialize() {
+ bool rc = true;
+ assert(_tracking_level == NMT_unknown, "only call once");
+
+ NMT_TrackingLevel level = NMTUtil::parse_tracking_level(NativeMemoryTracking);
+ // Should have been validated before in arguments.cpp
+ assert(level == NMT_off || level == NMT_summary || level == NMT_detail,
+ "Invalid setting for NativeMemoryTracking (%s)", NativeMemoryTracking);
-NMT_TrackingLevel MemTracker::init_tracking_level() {
// Memory type is encoded into tracking header as a byte field,
// make sure that we don't overflow it.
STATIC_ASSERT(mt_number_of_types <= max_jubyte);
- char nmt_env_variable[buffer_size];
- jio_snprintf(nmt_env_variable, sizeof(nmt_env_variable), "NMT_LEVEL_%d", os::current_process_id());
- const char* nmt_env_value;
-#ifdef _WINDOWS
- // Read the NMT environment variable from the PEB instead of the CRT
- char value[buffer_size];
- nmt_env_value = GetEnvironmentVariable(nmt_env_variable, value, (DWORD)sizeof(value)) != 0 ? value : NULL;
-#else
- nmt_env_value = ::getenv(nmt_env_variable);
-#endif
- NMT_TrackingLevel level = NMT_off;
- if (nmt_env_value != NULL) {
- if (strcmp(nmt_env_value, "summary") == 0) {
- level = NMT_summary;
- } else if (strcmp(nmt_env_value, "detail") == 0) {
- level = NMT_detail;
- } else if (strcmp(nmt_env_value, "off") != 0) {
- // The value of the environment variable is invalid
- _is_nmt_env_valid = false;
- }
- // Remove the environment variable to avoid leaking to child processes
- os::unsetenv(nmt_env_variable);
- }
-
- if (!MallocTracker::initialize(level) ||
- !VirtualMemoryTracker::initialize(level)) {
- level = NMT_off;
- }
- return level;
-}
-
-void MemTracker::init() {
- NMT_TrackingLevel level = tracking_level();
- if (level >= NMT_summary) {
- if (!VirtualMemoryTracker::late_initialize(level) ||
- !ThreadStackTracker::late_initialize(level)) {
- shutdown();
+ if (level > NMT_off) {
+ if (!MallocTracker::initialize(level) ||
+ !VirtualMemoryTracker::initialize(level) ||
+ !ThreadStackTracker::initialize(level)) {
+ assert(false, "NMT initialization failed");
+ level = NMT_off;
+ log_warning(nmt)("NMT initialization failed. NMT disabled.");
return;
}
}
-}
-bool MemTracker::check_launcher_nmt_support(const char* value) {
- if (strcmp(value, "=detail") == 0) {
- if (MemTracker::tracking_level() != NMT_detail) {
- return false;
- }
- } else if (strcmp(value, "=summary") == 0) {
- if (MemTracker::tracking_level() != NMT_summary) {
- return false;
- }
- } else if (strcmp(value, "=off") == 0) {
- if (MemTracker::tracking_level() != NMT_off) {
- return false;
- }
- } else {
- _is_nmt_env_valid = false;
- }
+ NMTPreInit::pre_to_post();
- return true;
-}
+ _tracking_level = _cmdline_tracking_level = level;
-bool MemTracker::verify_nmt_option() {
- return _is_nmt_env_valid;
+ // Log state right after NMT initialization
+ if (log_is_enabled(Info, nmt)) {
+ LogTarget(Info, nmt) lt;
+ LogStream ls(lt);
+ ls.print_cr("NMT initialized: %s", NMTUtil::tracking_level_to_string(_tracking_level));
+ ls.print_cr("Preinit state: ");
+ NMTPreInit::print_state(&ls);
+ ls.cr();
+ }
}
void* MemTracker::malloc_base(void* memblock) {
@@ -174,6 +144,8 @@
void MemTracker::error_report(outputStream* output) {
if (tracking_level() >= NMT_summary) {
report(true, output, MemReporterBase::default_scale); // just print summary for error case.
+ output->print("Preinit state:");
+ NMTPreInit::print_state(output);
}
}
@@ -214,9 +186,14 @@
void MemTracker::tuning_statistics(outputStream* out) {
// NMT statistics
out->print_cr("Native Memory Tracking Statistics:");
+ out->print_cr("State: %s", NMTUtil::tracking_level_to_string(_tracking_level));
out->print_cr("Malloc allocation site table size: %d", MallocSiteTable::hash_buckets());
out->print_cr(" Tracking stack depth: %d", NMT_TrackingStackDepth);
NOT_PRODUCT(out->print_cr("Peak concurrent access: %d", MallocSiteTable::access_peak_count());)
out->cr();
MallocSiteTable::print_tuning_statistics(out);
+ out->cr();
+ out->print_cr("Preinit state:");
+ NMTPreInit::print_state(out);
+ out->cr();
}
diff -Nru openjdk-17-17.0.4+8/src/hotspot/share/services/memTracker.hpp openjdk-17-17.0.5+8/src/hotspot/share/services/memTracker.hpp
--- openjdk-17-17.0.4+8/src/hotspot/share/services/memTracker.hpp 2022-07-14 08:05:38.000000000 +0000
+++ openjdk-17-17.0.5+8/src/hotspot/share/services/memTracker.hpp 2022-10-10 13:07:22.000000000 +0000
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2020, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2021, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -115,42 +115,33 @@
class MemTracker : AllStatic {
friend class VirtualMemoryTrackerTest;
+ // Helper; asserts that we are in post-NMT-init phase
+ static void assert_post_init() {
+ assert(is_initialized(), "NMT not yet initialized.");
+ }
+
public:
+
+ // Initializes NMT to whatever -XX:NativeMemoryTracking says.
+ // - Can only be called once.
+ // - NativeMemoryTracking must be validated beforehand.
+ static void initialize();
+
+ // Returns true if NMT had been initialized.
+ static bool is_initialized() {
+ return _tracking_level != NMT_unknown;
+ }
+
static inline NMT_TrackingLevel tracking_level() {
- if (_tracking_level == NMT_unknown) {
- // No fencing is needed here, since JVM is in single-threaded
- // mode.
- _tracking_level = init_tracking_level();
- _cmdline_tracking_level = _tracking_level;
- }
return _tracking_level;
}
- // A late initialization, for the stuff(s) can not be
- // done in init_tracking_level(), which can NOT malloc
- // any memory.
- static void init();
-
- // Shutdown native memory tracking
+ // Shutdown native memory tracking.
+ // This transitions the tracking level:
+ // summary -> minimal
+ // detail -> minimal
static void shutdown();
- // Verify native memory tracking command line option.
- // This check allows JVM to detect if compatible launcher
- // is used.
- // If an incompatible launcher is used, NMT may not be
- // able to start, even it is enabled by command line option.
- // A warning message should be given if it is encountered.
- static bool check_launcher_nmt_support(const char* value);
-
- // This method checks native memory tracking environment
- // variable value passed by launcher.
- // Launcher only obligated to pass native memory tracking
- // option value, but not obligated to validate the value,
- // and launcher has option to discard native memory tracking
- // option from the command line once it sets up the environment
- // variable, so NMT has to catch the bad value here.
- static bool verify_nmt_option();
-
// Transition the tracking level to specified level
static bool transition_to(NMT_TrackingLevel level);
@@ -207,8 +198,12 @@
MallocTracker::record_arena_size_change(diff, flag);
}
+ // Note: virtual memory operations should only ever be called after NMT initialization
+ // (we do not do any reservations before that).
+
static inline void record_virtual_memory_reserve(void* addr, size_t size, const NativeCallStack& stack,
MEMFLAGS flag = mtNone) {
+ assert_post_init();
if (tracking_level() < NMT_summary) return;
if (addr != NULL) {
ThreadCritical tc;
@@ -220,6 +215,7 @@
static inline void record_virtual_memory_reserve_and_commit(void* addr, size_t size,
const NativeCallStack& stack, MEMFLAGS flag = mtNone) {
+ assert_post_init();
if (tracking_level() < NMT_summary) return;
if (addr != NULL) {
ThreadCritical tc;
@@ -231,6 +227,7 @@
static inline void record_virtual_memory_commit(void* addr, size_t size,
const NativeCallStack& stack) {
+ assert_post_init();
if (tracking_level() < NMT_summary) return;
if (addr != NULL) {
ThreadCritical tc;
@@ -246,6 +243,7 @@
// The two new memory regions will be both registered under stack and
// memory flags of the original region.
static inline void record_virtual_memory_split_reserved(void* addr, size_t size, size_t split) {
+ assert_post_init();
if (tracking_level() < NMT_summary) return;
if (addr != NULL) {
ThreadCritical tc;
@@ -256,6 +254,7 @@
}
static inline void record_virtual_memory_type(void* addr, MEMFLAGS flag) {
+ assert_post_init();
if (tracking_level() < NMT_summary) return;
if (addr != NULL) {
ThreadCritical tc;
@@ -265,6 +264,7 @@
}
static void record_thread_stack(void* addr, size_t size) {
+ assert_post_init();
if (tracking_level() < NMT_summary) return;
if (addr != NULL) {
ThreadStackTracker::new_thread_stack((address)addr, size, CALLER_PC);
@@ -272,6 +272,7 @@
}
static inline void release_thread_stack(void* addr, size_t size) {
+ assert_post_init();
if (tracking_level() < NMT_summary) return;
if (addr != NULL) {
ThreadStackTracker::delete_thread_stack((address)addr, size);
diff -Nru openjdk-17-17.0.4+8/src/hotspot/share/services/nmtCommon.cpp openjdk-17-17.0.5+8/src/hotspot/share/services/nmtCommon.cpp
--- openjdk-17-17.0.4+8/src/hotspot/share/services/nmtCommon.cpp 2022-07-14 08:05:38.000000000 +0000
+++ openjdk-17-17.0.5+8/src/hotspot/share/services/nmtCommon.cpp 2022-10-10 13:07:22.000000000 +0000
@@ -60,3 +60,27 @@
return K;
}
+const char* NMTUtil::tracking_level_to_string(NMT_TrackingLevel lvl) {
+ switch(lvl) {
+ case NMT_unknown: return "unknown"; break;
+ case NMT_off: return "off"; break;
+ case NMT_minimal: return "minimal"; break;
+ case NMT_summary: return "summary"; break;
+ case NMT_detail: return "detail"; break;
+ default: return "invalid"; break;
+ }
+}
+
+// Returns the parsed level; NMT_unknown if string is invalid
+NMT_TrackingLevel NMTUtil::parse_tracking_level(const char* s) {
+ if (s != NULL) {
+ if (strcmp(s, "summary") == 0) {
+ return NMT_summary;
+ } else if (strcmp(s, "detail") == 0) {
+ return NMT_detail;
+ } else if (strcmp(s, "off") == 0) {
+ return NMT_off;
+ }
+ }
+ return NMT_unknown;
+}
diff -Nru openjdk-17-17.0.4+8/src/hotspot/share/services/nmtCommon.hpp openjdk-17-17.0.5+8/src/hotspot/share/services/nmtCommon.hpp
--- openjdk-17-17.0.4+8/src/hotspot/share/services/nmtCommon.hpp 2022-07-14 08:05:38.000000000 +0000
+++ openjdk-17-17.0.5+8/src/hotspot/share/services/nmtCommon.hpp 2022-10-10 13:07:22.000000000 +0000
@@ -32,12 +32,52 @@
#define CALC_OBJ_SIZE_IN_TYPE(obj, type) (align_up(sizeof(obj), sizeof(type))/sizeof(type))
// Native memory tracking level
+//
+// The meaning of the different states:
+//
+// "unknown": pre-init phase (before parsing NMT arguments)
+//
+// "off": after initialization - NMT confirmed off.
+// - nothing is tracked
+// - no malloc headers are used
+//
+// "minimal": after shutdown - NMT had been on at some point but has been switched off
+// - nothing is tracked
+// - malloc headers are allocated but not initialized not used
+//
+// "summary": after initialization with NativeMemoryTracking=summary - NMT in summary mode
+// - category summaries per tag are tracked
+// - thread stacks are tracked
+// - malloc headers are used
+// - malloc call site table is allocated and used
+//
+// "detail": after initialization with NativeMemoryTracking=detail - NMT in detail mode
+// - category summaries per tag are tracked
+// - malloc details per call site are tracked
+// - virtual memory mapping info is tracked
+// - thread stacks are tracked
+// - malloc headers are used
+// - malloc call site table is allocated and used
+//
+// Valid state transitions:
+//
+// unknown ----> off
+// |
+// |--> summary --
+// | |
+// |--> detail --+--> minimal
+//
+
+
+// Please keep relation of numerical values!
+// unknown < off < minimal < summary < detail
+//
enum NMT_TrackingLevel {
- NMT_unknown = 0xFF,
- NMT_off = 0x00,
- NMT_minimal = 0x01,
- NMT_summary = 0x02,
- NMT_detail = 0x03
+ NMT_unknown = 0,
+ NMT_off = 1,
+ NMT_minimal = 2,
+ NMT_summary = 3,
+ NMT_detail = 4
};
// Number of stack frames to capture. This is a
@@ -83,6 +123,14 @@
static size_t amount_in_scale(size_t amount, size_t scale) {
return (amount + scale / 2) / scale;
}
+
+ // Parses the tracking level from a string. Returns NMT_unknown if
+ // string is not a valid level.
+ static NMT_TrackingLevel parse_tracking_level(const char* s);
+
+ // Returns textual representation of a tracking level.
+ static const char* tracking_level_to_string(NMT_TrackingLevel level);
+
private:
static const char* _memory_type_names[mt_number_of_types];
};
diff -Nru openjdk-17-17.0.4+8/src/hotspot/share/services/nmtPreInit.cpp openjdk-17-17.0.5+8/src/hotspot/share/services/nmtPreInit.cpp
--- openjdk-17-17.0.4+8/src/hotspot/share/services/nmtPreInit.cpp 1970-01-01 00:00:00.000000000 +0000
+++ openjdk-17-17.0.5+8/src/hotspot/share/services/nmtPreInit.cpp 2022-10-10 13:07:22.000000000 +0000
@@ -0,0 +1,194 @@
+/*
+ * Copyright (c) 2021 SAP SE. All rights reserved.
+ * Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved.
+ * 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 "runtime/os.hpp"
+#include "services/nmtPreInit.hpp"
+#include "utilities/align.hpp"
+#include "utilities/debug.hpp"
+#include "utilities/ostream.hpp"
+#include "utilities/globalDefinitions.hpp"
+
+#if INCLUDE_NMT
+
+// Obviously we cannot use os::malloc for any dynamic allocation during pre-NMT-init, so we must use
+// raw malloc; to make this very clear, wrap them.
+static void* raw_malloc(size_t s) { return ::malloc(s); }
+static void* raw_realloc(void* old, size_t s) { return ::realloc(old, s); }
+static void raw_free(void* p) { ::free(p); }
+
+// We must ensure that the start of the payload area of the nmt lookup table nodes is malloc-aligned
+static const size_t malloc_alignment = 2 * sizeof(void*); // could we use max_align_t?
+STATIC_ASSERT(is_aligned(sizeof(NMTPreInitAllocation), malloc_alignment));
+
+// --------- NMTPreInitAllocation --------------
+
+NMTPreInitAllocation* NMTPreInitAllocation::do_alloc(size_t payload_size) {
+ const size_t outer_size = sizeof(NMTPreInitAllocation) + payload_size;
+ void* p = raw_malloc(outer_size);
+ NMTPreInitAllocation* a = new(p) NMTPreInitAllocation(payload_size);
+ return a;
+}
+
+NMTPreInitAllocation* NMTPreInitAllocation::do_reallocate(NMTPreInitAllocation* old, size_t new_payload_size) {
+ assert(old->next == NULL, "unhang from map first");
+ // We just reallocate the old block, header and all.
+ const size_t new_outer_size = sizeof(NMTPreInitAllocation) + new_payload_size;
+ void* p = raw_realloc(old, new_outer_size);
+ // re-stamp header with new size
+ NMTPreInitAllocation* a = new(p) NMTPreInitAllocation(new_payload_size);
+ return a;
+}
+
+void NMTPreInitAllocation::do_free(NMTPreInitAllocation* p) {
+ assert(p->next == NULL, "unhang from map first");
+ raw_free(p);
+}
+
+// --------- NMTPreInitAllocationTable --------------
+
+NMTPreInitAllocationTable::NMTPreInitAllocationTable() {
+ ::memset(_entries, 0, sizeof(_entries));
+}
+
+// print a string describing the current state
+void NMTPreInitAllocationTable::print_state(outputStream* st) const {
+ // Collect some statistics and print them
+ int num_entries = 0;
+ int num_primary_entries = 0;
+ int longest_chain = 0;
+ size_t sum_bytes = 0;
+ for (int i = 0; i < table_size; i++) {
+ int chain_len = 0;
+ for (NMTPreInitAllocation* a = _entries[i]; a != NULL; a = a->next) {
+ chain_len++;
+ sum_bytes += a->size;
+ }
+ if (chain_len > 0) {
+ num_primary_entries++;
+ }
+ num_entries += chain_len;
+ longest_chain = MAX2(chain_len, longest_chain);
+ }
+ st->print("entries: %d (primary: %d, empties: %d), sum bytes: " SIZE_FORMAT
+ ", longest chain length: %d",
+ num_entries, num_primary_entries, table_size - num_primary_entries,
+ sum_bytes, longest_chain);
+}
+
+#ifdef ASSERT
+void NMTPreInitAllocationTable::print_map(outputStream* st) const {
+ for (int i = 0; i < table_size; i++) {
+ st->print("[%d]: ", i);
+ for (NMTPreInitAllocation* a = _entries[i]; a != NULL; a = a->next) {
+ st->print( PTR_FORMAT "(" SIZE_FORMAT ") ", p2i(a->payload()), a->size);
+ }
+ st->cr();
+ }
+}
+
+void NMTPreInitAllocationTable::verify() const {
+ // This verifies the buildup of the lookup table, including the load and the chain lengths.
+ // We should see chain lens of 0-1 under normal conditions. Under artificial conditions
+ // (20000 VM args) we should see maybe 6-7. From a certain length on we can be sure something
+ // is broken.
+ const int longest_acceptable_chain_len = 30;
+ int num_chains_too_long = 0;
+ for (index_t i = 0; i < table_size; i++) {
+ int len = 0;
+ for (const NMTPreInitAllocation* a = _entries[i]; a != NULL; a = a->next) {
+ index_t i2 = index_for_key(a->payload());
+ assert(i2 == i, "wrong hash");
+ assert(a->size > 0, "wrong size");
+ len++;
+ // very paranoid: search for dups
+ bool found = false;
+ for (const NMTPreInitAllocation* a2 = _entries[i]; a2 != NULL; a2 = a2->next) {
+ if (a == a2) {
+ assert(!found, "dup!");
+ found = true;
+ }
+ }
+ }
+ if (len > longest_acceptable_chain_len) {
+ num_chains_too_long++;
+ }
+ }
+ if (num_chains_too_long > 0) {
+ assert(false, "NMT preinit lookup table degenerated (%d/%d chains longer than %d)",
+ num_chains_too_long, table_size, longest_acceptable_chain_len);
+ }
+}
+#endif // ASSERT
+
+// --------- NMTPreinit --------------
+
+NMTPreInitAllocationTable* NMTPreInit::_table = NULL;
+bool NMTPreInit::_nmt_was_initialized = false;
+
+// Some statistics
+unsigned NMTPreInit::_num_mallocs_pre = 0;
+unsigned NMTPreInit::_num_reallocs_pre = 0;
+unsigned NMTPreInit::_num_frees_pre = 0;
+
+void NMTPreInit::create_table() {
+ assert(_table == NULL, "just once");
+ void* p = raw_malloc(sizeof(NMTPreInitAllocationTable));
+ _table = new(p) NMTPreInitAllocationTable();
+}
+
+// Allocate with os::malloc (hidden to prevent having to include os.hpp)
+void* NMTPreInit::do_os_malloc(size_t size) {
+ return os::malloc(size, mtNMT);
+}
+
+// Switches from NMT pre-init state to NMT post-init state;
+// in post-init, no modifications to the lookup table are possible.
+void NMTPreInit::pre_to_post() {
+ assert(_nmt_was_initialized == false, "just once");
+ _nmt_was_initialized = true;
+ DEBUG_ONLY(verify();)
+}
+
+#ifdef ASSERT
+void NMTPreInit::verify() {
+ if (_table != NULL) {
+ _table->verify();
+ }
+ assert(_num_reallocs_pre <= _num_mallocs_pre &&
+ _num_frees_pre <= _num_mallocs_pre, "stats are off");
+}
+#endif // ASSERT
+
+void NMTPreInit::print_state(outputStream* st) {
+ if (_table != NULL) {
+ _table->print_state(st);
+ st->cr();
+ }
+ st->print_cr("pre-init mallocs: %u, pre-init reallocs: %u, pre-init frees: %u",
+ _num_mallocs_pre, _num_reallocs_pre, _num_frees_pre);
+}
+
+#endif // INCLUDE_NMT
diff -Nru openjdk-17-17.0.4+8/src/hotspot/share/services/nmtPreInit.hpp openjdk-17-17.0.5+8/src/hotspot/share/services/nmtPreInit.hpp
--- openjdk-17-17.0.4+8/src/hotspot/share/services/nmtPreInit.hpp 1970-01-01 00:00:00.000000000 +0000
+++ openjdk-17-17.0.5+8/src/hotspot/share/services/nmtPreInit.hpp 2022-10-10 13:07:22.000000000 +0000
@@ -0,0 +1,359 @@
+/*
+ * Copyright (c) 2021 SAP SE. All rights reserved.
+ * Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved.
+ * 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_SERVICES_NMT_PREINIT_HPP
+#define SHARE_SERVICES_NMT_PREINIT_HPP
+
+#include "memory/allStatic.hpp"
+#ifdef ASSERT
+#include "runtime/atomic.hpp"
+#endif
+#include "utilities/debug.hpp"
+#include "utilities/globalDefinitions.hpp"
+#include "utilities/macros.hpp"
+
+#if INCLUDE_NMT
+
+class outputStream;
+
+// NMTPreInit is the solution to a specific problem:
+//
+// NMT tracks C-heap allocations (os::malloc and friends). Those can happen at all VM life stages,
+// including very early during the dynamic C++ initialization of the hotspot, and in CreateJavaVM
+// before argument parsing.
+//
+// However, before the VM parses NMT arguments, we do not know whether NMT is enabled or not. Can we
+// just ignore early allocations? If the only problem were statistical correctness, sure: footprint-wise
+// they are not really relevant.
+//
+// But there is one big problem: NMT uses malloc headers to keep meta information of malloced blocks.
+// We have to consider those in os::free() when calling free(3).
+//
+// So:
+// 1) NMT off:
+// a) pre-NMT-init allocations have no header
+// b) post-NMT-init allocations have no header
+// 2) NMT on:
+// a) pre-NMT-init allocations have no header
+// b) post-NMT-init allocations do have a header
+//
+// The problem is that inside os::free(p), we only get an opaque void* p; we do not know if p had been
+// allocated in (a) or (b) phase. Therefore, we do not know if p is preceded by an NMT header which we
+// would need to subtract from the pointer before calling free(3). There is no safe way to "guess" here
+// without risking C-heap corruption.
+//
+// To solve this, we need a way to quickly determine, at os::free(p), whether p was a pre-NMT-init
+// allocation. There are several ways to do this, see discussion under JDK-8256844.
+//
+// One of the easiest and most elegant ways is to store early allocation pointers in a lookup table.
+// This is what NMTPreInit does.
+//
+//////////////////////////////////////////////////////////////////////////
+//
+// VM initialization wrt NMT:
+//
+//---------------------------------------------------------------
+//-> launcher dlopen's libjvm ^
+// -> dynamic C++ initialization |
+// of libjvm |
+// |
+//-> launcher starts new thread (maybe) NMT pre-init phase : store allocated pointers in lookup table
+// |
+//-> launcher invokes CreateJavaVM |
+// -> VM initialization before arg parsing |
+// -> VM argument parsing v
+// -> NMT initialization -------------------------------------
+// ^
+// ... |
+// -> VM life... NMT post-init phase : lookup table is read-only; use it in os::free() and os::realloc().
+// ... |
+// v
+//----------------------------------------------------------------
+//
+//////////////////////////////////////////////////////////////////////////
+//
+// Notes:
+// - The VM will malloc() and realloc() several thousand times before NMT initialization.
+// Starting with a lot of arguments increases this number since argument parsing strdups
+// around a lot.
+// - However, *surviving* allocations (allocations not freed immediately) are much rarer:
+// typically only about 300-500. Again, mainly depending on the number of VM args.
+// - There are a few cases of pre-to-post-init reallocs where pre-init allocations get
+// reallocated after NMT initialization. Those we need to handle with special care (see
+// NMTPreInit::handle_realloc()). Because of them we need to store allocation size with
+// every pre-init allocation.
+
+// For the lookup table, design considerations are:
+// - lookup speed is paramount since lookup is done for every os::free() call.
+// - insert/delete speed only matters for VM startup - after NMT initialization the lookup
+// table is readonly
+// - memory consumption of the lookup table matters since we always pay for it, NMT on or off.
+// - Obviously, nothing here can use *os::malloc*. Any dynamic allocations - if they cannot
+// be avoided - should use raw malloc(3).
+//
+// We use a basic open hashmap, dimensioned generously - hash collisions should be very rare.
+// The table is customized for holding malloced pointers. One main point of this map is that we do
+// not allocate memory for the nodes themselves. Instead we piggy-back on the user allocation:
+// the hashmap entry structure precedes, as a header, the malloced block. That way we avoid extra
+// allocations just to hold the map nodes. This keeps runtime/memory overhead as small as possible.
+
+struct NMTPreInitAllocation {
+ NMTPreInitAllocation* next;
+ const size_t size; // (inner) payload size without header
+ // <-- USER ALLOCATION (PAYLOAD) STARTS HERE -->
+
+ NMTPreInitAllocation(size_t size) : next(NULL), size(size) {};
+
+ // Returns start of the user data area
+ void* payload() { return this + 1; }
+ const void* payload() const { return this + 1; }
+
+ // These functions do raw-malloc/realloc/free a C-heap block of given payload size,
+ // preceded with a NMTPreInitAllocation header.
+ static NMTPreInitAllocation* do_alloc(size_t payload_size);
+ static NMTPreInitAllocation* do_reallocate(NMTPreInitAllocation* old, size_t new_payload_size);
+ static void do_free(NMTPreInitAllocation* p);
+};
+
+class NMTPreInitAllocationTable {
+
+ // Table_size: keep table size a prime and the hash function simple; this
+ // seems to give a good distribution for malloced pointers on all our libc variants.
+ // 8000ish is really plenty: normal VM runs have ~500 pre-init allocations to hold,
+ // VMs with insanely long command lines maybe ~700-1000. Which gives us an expected
+ // load factor of ~.1. Hash collisions should be very rare.
+ // ~8000 entries cost us ~64K for this table (64-bit), which is acceptable.
+ static const int table_size = 7919;
+
+ NMTPreInitAllocation* _entries[table_size];
+
+ typedef int index_t;
+ const index_t invalid_index = -1;
+
+ static unsigned calculate_hash(const void* p) {
+ uintptr_t tmp = p2i(p);
+ unsigned hash = (unsigned)tmp
+ LP64_ONLY( ^ (unsigned)(tmp >> 32));
+ return hash;
+ }
+
+ static index_t index_for_key(const void* p) {
+ const unsigned hash = calculate_hash(p);
+ return hash % table_size;
+ }
+
+ const NMTPreInitAllocation* const * find_entry(const void* p) const {
+ return const_cast(this)->find_entry(p);
+ }
+
+ NMTPreInitAllocation** find_entry(const void* p) {
+ const unsigned index = index_for_key(p);
+ NMTPreInitAllocation** aa = (&(_entries[index]));
+ while ((*aa) != NULL && (*aa)->payload() != p) {
+ aa = &((*aa)->next);
+ }
+ assert((*aa) == NULL || p == (*aa)->payload(),
+ "retrieve mismatch " PTR_FORMAT " vs " PTR_FORMAT ".",
+ p2i(p), p2i((*aa)->payload()));
+ return aa;
+ }
+
+public:
+
+ NMTPreInitAllocationTable();
+
+ // Adds an entry to the table
+ void add(NMTPreInitAllocation* a) {
+ void* payload = a->payload();
+ const unsigned index = index_for_key(payload);
+ assert(a->next == NULL, "entry already in table?");
+ a->next = _entries[index]; // add to front
+ _entries[index] = a; // of list
+ assert(find(payload) == a, "add: reverse lookup error?");
+ }
+
+ // Find - but does not remove - an entry in this map.
+ // Returns NULL if not found.
+ const NMTPreInitAllocation* find(const void* p) const {
+ return *(find_entry(p));
+ }
+
+ // Find and removes an entry from the table. Asserts if not found.
+ NMTPreInitAllocation* find_and_remove(void* p) {
+ NMTPreInitAllocation** aa = find_entry(p);
+ assert((*aa) != NULL, "Entry not found: " PTR_FORMAT, p2i(p));
+ NMTPreInitAllocation* a = (*aa);
+ (*aa) = (*aa)->next; // remove from its list
+ DEBUG_ONLY(a->next = NULL;) // mark as removed
+ return a;
+ }
+
+ void print_state(outputStream* st) const;
+ DEBUG_ONLY(void print_map(outputStream* st) const;)
+ DEBUG_ONLY(void verify() const;)
+};
+
+// NMTPreInit is the outside interface to all of NMT preinit handling.
+class NMTPreInit : public AllStatic {
+
+ static NMTPreInitAllocationTable* _table;
+ static bool _nmt_was_initialized;
+
+ // Some statistics
+ static unsigned _num_mallocs_pre; // Number of pre-init mallocs
+ static unsigned _num_reallocs_pre; // Number of pre-init reallocs
+ static unsigned _num_frees_pre; // Number of pre-init frees
+
+ static void create_table();
+
+ static void add_to_map(NMTPreInitAllocation* a) {
+ assert(!_nmt_was_initialized, "lookup map cannot be modified after NMT initialization");
+ // Only on add, we create the table on demand. Only needed on add, since everything should start
+ // with a call to os::malloc().
+ if (_table == NULL) {
+ create_table();
+ }
+ return _table->add(a);
+ }
+
+ static const NMTPreInitAllocation* find_in_map(void* p) {
+ assert(_table != NULL, "stray allocation?");
+ return _table->find(p);
+ }
+
+ static NMTPreInitAllocation* find_and_remove_in_map(void* p) {
+ assert(!_nmt_was_initialized, "lookup map cannot be modified after NMT initialization");
+ assert(_table != NULL, "stray allocation?");
+ return _table->find_and_remove(p);
+ }
+
+ // Just a wrapper for os::malloc to avoid including os.hpp here.
+ static void* do_os_malloc(size_t size);
+
+public:
+
+ // Switches from NMT pre-init state to NMT post-init state;
+ // in post-init, no modifications to the lookup table are possible.
+ static void pre_to_post();
+
+ // Returns true if we are still in pre-init phase, false if post-init
+ static bool in_preinit_phase() { return _nmt_was_initialized == false; }
+
+ // Called from os::malloc.
+ // Returns true if allocation was handled here; in that case,
+ // *rc contains the return address.
+ static bool handle_malloc(void** rc, size_t size) {
+ size = MAX2((size_t)1, size); // malloc(0)
+ if (!_nmt_was_initialized) {
+ // pre-NMT-init:
+ // Allocate entry and add address to lookup table
+ NMTPreInitAllocation* a = NMTPreInitAllocation::do_alloc(size);
+ add_to_map(a);
+ (*rc) = a->payload();
+ _num_mallocs_pre++;
+ return true;
+ }
+ return false;
+ }
+
+ // Called from os::realloc.
+ // Returns true if reallocation was handled here; in that case,
+ // *rc contains the return address.
+ static bool handle_realloc(void** rc, void* old_p, size_t new_size) {
+ if (old_p == NULL) { // realloc(NULL, n)
+ return handle_malloc(rc, new_size);
+ }
+ new_size = MAX2((size_t)1, new_size); // realloc(.., 0)
+ if (!_nmt_was_initialized) {
+ // pre-NMT-init:
+ // - the address must already be in the lookup table
+ // - find the old entry, remove from table, reallocate, add to table
+ NMTPreInitAllocation* a = find_and_remove_in_map(old_p);
+ a = NMTPreInitAllocation::do_reallocate(a, new_size);
+ add_to_map(a);
+ (*rc) = a->payload();
+ _num_reallocs_pre++;
+ return true;
+ } else {
+ // post-NMT-init:
+ // If the old block was allocated during pre-NMT-init, we must relocate it: the
+ // new block must be allocated with "normal" os::malloc.
+ // We do this by:
+ // - look up (but not remove! lu table is read-only here.) the old entry
+ // - allocate new memory via os::malloc()
+ // - manually copy the old content over
+ // - return the new memory
+ // - The lu table is readonly so we keep the old address in the table. And we leave
+ // the old block allocated too, to prevent the libc from returning the same address
+ // and confusing us.
+ const NMTPreInitAllocation* a = find_in_map(old_p);
+ if (a != NULL) { // this was originally a pre-init allocation
+ void* p_new = do_os_malloc(new_size);
+ ::memcpy(p_new, a->payload(), MIN2(a->size, new_size));
+ (*rc) = p_new;
+ return true;
+ }
+ }
+ return false;
+ }
+
+ // Called from os::free.
+ // Returns true if free was handled here.
+ static bool handle_free(void* p) {
+ if (p == NULL) { // free(NULL)
+ return true;
+ }
+ if (!_nmt_was_initialized) {
+ // pre-NMT-init:
+ // - the allocation must be in the hash map, since all allocations went through
+ // NMTPreInit::handle_malloc()
+ // - find the old entry, unhang from map, free it
+ NMTPreInitAllocation* a = find_and_remove_in_map(p);
+ NMTPreInitAllocation::do_free(a);
+ _num_frees_pre++;
+ return true;
+ } else {
+ // post-NMT-init:
+ // - look up (but not remove! lu table is read-only here.) the entry
+ // - if found, we do nothing: the lu table is readonly, so we keep the old address
+ // in the table. We leave the block allocated to prevent the libc from returning
+ // the same address and confusing us.
+ // - if not found, we let regular os::free() handle this pointer
+ if (find_in_map(p) != NULL) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ static void print_state(outputStream* st);
+ static void print_map(outputStream* st);
+ DEBUG_ONLY(static void verify();)
+};
+
+#endif // INCLUDE_NMT
+
+#endif // SHARE_SERVICES_NMT_PREINIT_HPP
+
diff -Nru openjdk-17-17.0.4+8/src/hotspot/share/services/threadStackTracker.cpp openjdk-17-17.0.5+8/src/hotspot/share/services/threadStackTracker.cpp
--- openjdk-17-17.0.4+8/src/hotspot/share/services/threadStackTracker.cpp 2022-07-14 08:05:38.000000000 +0000
+++ openjdk-17-17.0.5+8/src/hotspot/share/services/threadStackTracker.cpp 2022-10-10 13:07:22.000000000 +0000
@@ -33,7 +33,7 @@
volatile size_t ThreadStackTracker::_thread_count = 0;
SortedLinkedList* ThreadStackTracker::_simple_thread_stacks = NULL;
-bool ThreadStackTracker::late_initialize(NMT_TrackingLevel level) {
+bool ThreadStackTracker::initialize(NMT_TrackingLevel level) {
if (level == NMT_detail && !track_as_vm()) {
_simple_thread_stacks = new (std::nothrow, ResourceObj::C_HEAP, mtNMT)
SortedLinkedList();
diff -Nru openjdk-17-17.0.4+8/src/hotspot/share/services/threadStackTracker.hpp openjdk-17-17.0.5+8/src/hotspot/share/services/threadStackTracker.hpp
--- openjdk-17-17.0.4+8/src/hotspot/share/services/threadStackTracker.hpp 2022-07-14 08:05:38.000000000 +0000
+++ openjdk-17-17.0.5+8/src/hotspot/share/services/threadStackTracker.hpp 2022-10-10 13:07:22.000000000 +0000
@@ -71,8 +71,7 @@
static int compare_thread_stack_base(const SimpleThreadStackSite& s1, const SimpleThreadStackSite& s2);
static SortedLinkedList* _simple_thread_stacks;
public:
- // Late phase initialization
- static bool late_initialize(NMT_TrackingLevel level);
+ static bool initialize(NMT_TrackingLevel level);
static bool transition(NMT_TrackingLevel from, NMT_TrackingLevel to);
static void new_thread_stack(void* base, size_t size, const NativeCallStack& stack);
diff -Nru openjdk-17-17.0.4+8/src/hotspot/share/services/virtualMemoryTracker.cpp openjdk-17-17.0.5+8/src/hotspot/share/services/virtualMemoryTracker.cpp
--- openjdk-17-17.0.4+8/src/hotspot/share/services/virtualMemoryTracker.cpp 2022-07-14 08:05:38.000000000 +0000
+++ openjdk-17-17.0.5+8/src/hotspot/share/services/virtualMemoryTracker.cpp 2022-10-10 13:07:22.000000000 +0000
@@ -320,14 +320,9 @@
}
bool VirtualMemoryTracker::initialize(NMT_TrackingLevel level) {
+ assert(_reserved_regions == NULL, "only call once");
if (level >= NMT_summary) {
VirtualMemorySummary::initialize();
- }
- return true;
-}
-
-bool VirtualMemoryTracker::late_initialize(NMT_TrackingLevel level) {
- if (level >= NMT_summary) {
_reserved_regions = new (std::nothrow, ResourceObj::C_HEAP, mtNMT)
SortedLinkedList();
return (_reserved_regions != NULL);
diff -Nru openjdk-17-17.0.4+8/src/hotspot/share/services/virtualMemoryTracker.hpp openjdk-17-17.0.5+8/src/hotspot/share/services/virtualMemoryTracker.hpp
--- openjdk-17-17.0.4+8/src/hotspot/share/services/virtualMemoryTracker.hpp 2022-07-14 08:05:38.000000000 +0000
+++ openjdk-17-17.0.5+8/src/hotspot/share/services/virtualMemoryTracker.hpp 2022-10-10 13:07:22.000000000 +0000
@@ -371,9 +371,6 @@
public:
static bool initialize(NMT_TrackingLevel level);
- // Late phase initialization
- static bool late_initialize(NMT_TrackingLevel level);
-
static bool add_reserved_region (address base_addr, size_t size, const NativeCallStack& stack, MEMFLAGS flag = mtNone);
static bool add_committed_region (address base_addr, size_t size, const NativeCallStack& stack);
diff -Nru openjdk-17-17.0.4+8/src/hotspot/share/utilities/bitMap.cpp openjdk-17-17.0.5+8/src/hotspot/share/utilities/bitMap.cpp
--- openjdk-17-17.0.4+8/src/hotspot/share/utilities/bitMap.cpp 2022-07-14 08:05:38.000000000 +0000
+++ openjdk-17-17.0.5+8/src/hotspot/share/utilities/bitMap.cpp 2022-10-10 13:07:22.000000000 +0000
@@ -232,10 +232,10 @@
// With a valid range (beg <= end), this test ensures that end != 0, as
// required by inverted_bit_mask_for_range. Also avoids an unnecessary write.
if (beg != end) {
- bm_word_t* pw = word_addr(beg);
- bm_word_t w = *pw;
- bm_word_t mr = inverted_bit_mask_for_range(beg, end);
- bm_word_t nw = value ? (w | ~mr) : (w & mr);
+ volatile bm_word_t* pw = word_addr(beg);
+ bm_word_t w = Atomic::load(pw);
+ bm_word_t mr = inverted_bit_mask_for_range(beg, end);
+ bm_word_t nw = value ? (w | ~mr) : (w & mr);
while (true) {
bm_word_t res = Atomic::cmpxchg(pw, w, nw);
if (res == w) break;
diff -Nru openjdk-17-17.0.4+8/src/hotspot/share/utilities/events.cpp openjdk-17-17.0.5+8/src/hotspot/share/utilities/events.cpp
--- openjdk-17-17.0.4+8/src/hotspot/share/utilities/events.cpp 2022-07-14 08:05:38.000000000 +0000
+++ openjdk-17-17.0.5+8/src/hotspot/share/utilities/events.cpp 2022-10-10 13:07:22.000000000 +0000
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2021, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2022, Oracle and/or its affiliates. All rights reserved.
* 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,7 @@
StringEventLog* Events::_redefinitions = NULL;
UnloadingEventLog* Events::_class_unloading = NULL;
StringEventLog* Events::_deopt_messages = NULL;
+StringEventLog* Events::_dll_messages = NULL;
EventLog::EventLog() {
// This normally done during bootstrap when we're only single
@@ -97,6 +98,7 @@
_redefinitions = new StringEventLog("Classes redefined", "redef");
_class_unloading = new UnloadingEventLog("Classes unloaded", "unload");
_deopt_messages = new StringEventLog("Deoptimization events", "deopt");
+ _dll_messages = new StringEventLog("Dll operation events", "dll");
}
}
diff -Nru openjdk-17-17.0.4+8/src/hotspot/share/utilities/events.hpp openjdk-17-17.0.5+8/src/hotspot/share/utilities/events.hpp
--- openjdk-17-17.0.4+8/src/hotspot/share/utilities/events.hpp 2022-07-14 08:05:38.000000000 +0000
+++ openjdk-17-17.0.5+8/src/hotspot/share/utilities/events.hpp 2022-10-10 13:07:22.000000000 +0000
@@ -230,6 +230,9 @@
// Deoptization related messages
static StringEventLog* _deopt_messages;
+ // dynamic lib related messages
+ static StringEventLog* _dll_messages;
+
// Redefinition related messages
static StringEventLog* _redefinitions;
@@ -262,6 +265,8 @@
static void log_deopt_message(Thread* thread, const char* format, ...) ATTRIBUTE_PRINTF(2, 3);
+ static void log_dll_message(Thread* thread, const char* format, ...) ATTRIBUTE_PRINTF(2, 3);
+
// Register default loggers
static void init();
};
@@ -322,6 +327,15 @@
va_end(ap);
}
}
+
+inline void Events::log_dll_message(Thread* thread, const char* format, ...) {
+ if (LogEvents && _dll_messages != NULL) {
+ va_list ap;
+ va_start(ap, format);
+ _dll_messages->logv(thread, format, ap);
+ va_end(ap);
+ }
+}
template
inline void EventLogBase::print_log_on(outputStream* out, int max) {
diff -Nru openjdk-17-17.0.4+8/src/java.base/linux/classes/jdk/internal/platform/CgroupSubsystemFactory.java openjdk-17-17.0.5+8/src/java.base/linux/classes/jdk/internal/platform/CgroupSubsystemFactory.java
--- openjdk-17-17.0.4+8/src/java.base/linux/classes/jdk/internal/platform/CgroupSubsystemFactory.java 2022-07-14 08:05:38.000000000 +0000
+++ openjdk-17-17.0.5+8/src/java.base/linux/classes/jdk/internal/platform/CgroupSubsystemFactory.java 2022-10-10 13:07:22.000000000 +0000
@@ -36,6 +36,7 @@
import java.util.List;
import java.util.Map;
import java.util.Optional;
+import java.util.Objects;
import java.util.function.Consumer;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
@@ -87,7 +88,10 @@
} catch (UncheckedIOException e) {
return null;
}
+ return create(optResult);
+ }
+ public static CgroupMetrics create(Optional optResult) {
if (optResult.isEmpty()) {
return null;
}
@@ -110,9 +114,9 @@
Map infos = result.getInfos();
if (result.isCgroupV2()) {
// For unified it doesn't matter which controller we pick.
- CgroupInfo anyController = infos.get(MEMORY_CTRL);
- CgroupSubsystem subsystem = CgroupV2Subsystem.getInstance(anyController);
- return subsystem != null ? new CgroupMetrics(subsystem) : null;
+ CgroupInfo anyController = infos.values().iterator().next();
+ CgroupSubsystem subsystem = CgroupV2Subsystem.getInstance(Objects.requireNonNull(anyController));
+ return new CgroupMetrics(subsystem);
} else {
CgroupV1Subsystem subsystem = CgroupV1Subsystem.getInstance(infos);
return subsystem != null ? new CgroupV1MetricsImpl(subsystem) : null;
@@ -145,6 +149,10 @@
}
CgroupInfo info = CgroupInfo.fromCgroupsLine(line);
switch (info.getName()) {
+ // Only the following controllers are important to Java. All
+ // other controllers (such as freezer) are ignored and
+ // are not considered in the checks below for
+ // anyCgroupsV1Controller/anyCgroupsV2Controller.
case CPU_CTRL: infos.put(CPU_CTRL, info); break;
case CPUACCT_CTRL: infos.put(CPUACCT_CTRL, info); break;
case CPUSET_CTRL: infos.put(CPUSET_CTRL, info); break;
@@ -222,6 +230,12 @@
*/
private static void setCgroupV2Path(Map infos,
String[] tokens) {
+ String name = tokens[1];
+ if (!name.equals("")) {
+ // This must be a v1 controller that we have ignored (e.g., freezer)
+ assert infos.get(name) == null;
+ return;
+ }
int hierarchyId = Integer.parseInt(tokens[0]);
String cgroupPath = tokens[2];
for (CgroupInfo info: infos.values()) {
diff -Nru openjdk-17-17.0.4+8/src/java.base/linux/classes/jdk/internal/platform/cgroupv1/CgroupV1Subsystem.java openjdk-17-17.0.5+8/src/java.base/linux/classes/jdk/internal/platform/cgroupv1/CgroupV1Subsystem.java
--- openjdk-17-17.0.4+8/src/java.base/linux/classes/jdk/internal/platform/cgroupv1/CgroupV1Subsystem.java 2022-07-14 08:05:38.000000000 +0000
+++ openjdk-17-17.0.5+8/src/java.base/linux/classes/jdk/internal/platform/cgroupv1/CgroupV1Subsystem.java 2022-10-10 13:07:22.000000000 +0000
@@ -150,8 +150,9 @@
}
private static boolean getSwapEnabled(CgroupV1MemorySubSystemController controller) {
- long retval = getLongValue(controller, "memory.memsw.limit_in_bytes");
- return retval > 0;
+ long memswBytes = getLongValue(controller, "memory.memsw.limit_in_bytes");
+ long swappiness = getLongValue(controller, "memory.swappiness");
+ return (memswBytes > 0 && swappiness > 0);
}
diff -Nru openjdk-17-17.0.4+8/src/java.base/macosx/classes/jdk/internal/loader/ClassLoaderHelper.java openjdk-17-17.0.5+8/src/java.base/macosx/classes/jdk/internal/loader/ClassLoaderHelper.java
--- openjdk-17-17.0.4+8/src/java.base/macosx/classes/jdk/internal/loader/ClassLoaderHelper.java 2022-07-14 08:05:38.000000000 +0000
+++ openjdk-17-17.0.5+8/src/java.base/macosx/classes/jdk/internal/loader/ClassLoaderHelper.java 2022-10-10 13:07:22.000000000 +0000
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2021, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -39,7 +39,8 @@
try {
major = Integer.parseInt(i < 0 ? osVersion : osVersion.substring(0, i));
} catch (NumberFormatException e) {}
- hasDynamicLoaderCache = major >= 11;
+ // SDK 10.15 and earlier always reports 10.16 instead of 11.x.x
+ hasDynamicLoaderCache = major >= 11 || osVersion.equals("10.16");
}
private ClassLoaderHelper() {}
diff -Nru openjdk-17-17.0.4+8/src/java.base/share/classes/com/sun/crypto/provider/DHKeyAgreement.java openjdk-17-17.0.5+8/src/java.base/share/classes/com/sun/crypto/provider/DHKeyAgreement.java
--- openjdk-17-17.0.4+8/src/java.base/share/classes/com/sun/crypto/provider/DHKeyAgreement.java 2022-07-14 08:05:38.000000000 +0000
+++ openjdk-17-17.0.5+8/src/java.base/share/classes/com/sun/crypto/provider/DHKeyAgreement.java 2022-10-10 13:07:22.000000000 +0000
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2021, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -344,6 +344,8 @@
} else {
// Array too short, pad it w/ leading 0s
if (secret.length < expectedLen) {
+ Arrays.fill(sharedSecret, offset,
+ offset + (expectedLen - secret.length), (byte)0);
System.arraycopy(secret, 0, sharedSecret,
offset + (expectedLen - secret.length),
secret.length);
diff -Nru openjdk-17-17.0.4+8/src/java.base/share/classes/com/sun/security/ntlm/Client.java openjdk-17-17.0.5+8/src/java.base/share/classes/com/sun/security/ntlm/Client.java
--- openjdk-17-17.0.4+8/src/java.base/share/classes/com/sun/security/ntlm/Client.java 2022-07-14 08:05:38.000000000 +0000
+++ openjdk-17-17.0.5+8/src/java.base/share/classes/com/sun/security/ntlm/Client.java 2022-10-10 13:07:22.000000000 +0000
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -117,9 +117,10 @@
* {@code nonce} is null for NTLM v1.
*/
public byte[] type3(byte[] type2, byte[] nonce) throws NTLMException {
- if (type2 == null || (v != Version.NTLM && nonce == null)) {
+ if (type2 == null || (v != Version.NTLM && nonce == null) ||
+ (nonce != null && nonce.length != 8)) {
throw new NTLMException(NTLMException.PROTOCOL,
- "type2 and nonce cannot be null");
+ "type2 cannot be null, and nonce must be 8-byte long");
}
debug("NTLM Client: Type 2 received\n");
debug(type2);
diff -Nru openjdk-17-17.0.4+8/src/java.base/share/classes/com/sun/security/ntlm/NTLMException.java openjdk-17-17.0.5+8/src/java.base/share/classes/com/sun/security/ntlm/NTLMException.java
--- openjdk-17-17.0.4+8/src/java.base/share/classes/com/sun/security/ntlm/NTLMException.java 2022-07-14 08:05:38.000000000 +0000
+++ openjdk-17-17.0.5+8/src/java.base/share/classes/com/sun/security/ntlm/NTLMException.java 2022-10-10 13:07:22.000000000 +0000
@@ -65,6 +65,11 @@
*/
public static final int PROTOCOL = 6;
+ /**
+ * If an invalid input is provided.
+ */
+ public static final int INVALID_INPUT = 7;
+
private int errorCode;
/**
diff -Nru openjdk-17-17.0.4+8/src/java.base/share/classes/com/sun/security/ntlm/NTLM.java openjdk-17-17.0.5+8/src/java.base/share/classes/com/sun/security/ntlm/NTLM.java
--- openjdk-17-17.0.4+8/src/java.base/share/classes/com/sun/security/ntlm/NTLM.java 2022-07-14 08:05:38.000000000 +0000
+++ openjdk-17-17.0.5+8/src/java.base/share/classes/com/sun/security/ntlm/NTLM.java 2022-10-10 13:07:22.000000000 +0000
@@ -226,23 +226,27 @@
System.arraycopy(data, 0, internal, offset, data.length);
}
- void writeSecurityBuffer(int offset, byte[] data) {
+ void writeSecurityBuffer(int offset, byte[] data) throws NTLMException {
if (data == null) {
- writeShort(offset+4, current);
+ writeInt(offset+4, current);
} else {
int len = data.length;
+ if (len > 65535) {
+ throw new NTLMException(NTLMException.INVALID_INPUT,
+ "Invalid data length " + len);
+ }
if (current + len > internal.length) {
internal = Arrays.copyOf(internal, current + len + 256);
}
writeShort(offset, len);
writeShort(offset+2, len);
- writeShort(offset+4, current);
+ writeInt(offset+4, current);
System.arraycopy(data, 0, internal, current, len);
current += len;
}
}
- void writeSecurityBuffer(int offset, String str, boolean unicode) {
+ void writeSecurityBuffer(int offset, String str, boolean unicode) throws NTLMException {
writeSecurityBuffer(offset, str == null ? null : str.getBytes(
unicode ? StandardCharsets.UTF_16LE
: StandardCharsets.ISO_8859_1));
diff -Nru openjdk-17-17.0.4+8/src/java.base/share/classes/com/sun/security/ntlm/Server.java openjdk-17-17.0.5+8/src/java.base/share/classes/com/sun/security/ntlm/Server.java
--- openjdk-17-17.0.4+8/src/java.base/share/classes/com/sun/security/ntlm/Server.java 2022-07-14 08:05:38.000000000 +0000
+++ openjdk-17-17.0.5+8/src/java.base/share/classes/com/sun/security/ntlm/Server.java 2022-10-10 13:07:22.000000000 +0000
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2022, Oracle and/or its affiliates. All rights reserved.
* 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,9 +85,9 @@
* {@code nonce} is null.
*/
public byte[] type2(byte[] type1, byte[] nonce) throws NTLMException {
- if (nonce == null) {
+ if (nonce == null || nonce.length != 8) {
throw new NTLMException(NTLMException.PROTOCOL,
- "nonce cannot be null");
+ "nonce must be 8-byte long");
}
debug("NTLM Server: Type 1 received\n");
if (type1 != null) debug(type1);
diff -Nru openjdk-17-17.0.4+8/src/java.base/share/classes/java/lang/invoke/InnerClassLambdaMetafactory.java openjdk-17-17.0.5+8/src/java.base/share/classes/java/lang/invoke/InnerClassLambdaMetafactory.java
--- openjdk-17-17.0.4+8/src/java.base/share/classes/java/lang/invoke/InnerClassLambdaMetafactory.java 2022-07-14 08:05:38.000000000 +0000
+++ openjdk-17-17.0.5+8/src/java.base/share/classes/java/lang/invoke/InnerClassLambdaMetafactory.java 2022-10-10 13:07:22.000000000 +0000
@@ -282,8 +282,8 @@
* registers the lambda proxy class for including into the CDS archive.
*/
private Class> spinInnerClass() throws LambdaConversionException {
- // CDS does not handle disableEagerInitialization.
- if (!disableEagerInitialization) {
+ // CDS does not handle disableEagerInitialization or useImplMethodHandle
+ if (!disableEagerInitialization && !useImplMethodHandle) {
// include lambda proxy class in CDS archive at dump time
if (CDS.isDumpingArchive()) {
Class> innerClass = generateInnerClass();
diff -Nru openjdk-17-17.0.4+8/src/java.base/share/classes/java/math/BigDecimal.java openjdk-17-17.0.5+8/src/java.base/share/classes/java/math/BigDecimal.java
--- openjdk-17-17.0.4+8/src/java.base/share/classes/java/math/BigDecimal.java 2022-07-14 08:05:38.000000000 +0000
+++ openjdk-17-17.0.5+8/src/java.base/share/classes/java/math/BigDecimal.java 2022-10-10 13:07:22.000000000 +0000
@@ -31,6 +31,10 @@
import static java.math.BigInteger.LONG_MASK;
import java.io.IOException;
+import java.io.InvalidObjectException;
+import java.io.ObjectInputStream;
+import java.io.ObjectStreamException;
+import java.io.StreamCorruptedException;
import java.util.Arrays;
import java.util.Objects;
@@ -1059,6 +1063,15 @@
}
/**
+ * Accept no subclasses.
+ */
+ private static BigInteger toStrictBigInteger(BigInteger val) {
+ return (val.getClass() == BigInteger.class) ?
+ val :
+ new BigInteger(val.toByteArray().clone());
+ }
+
+ /**
* Translates a {@code BigInteger} into a {@code BigDecimal}.
* The scale of the {@code BigDecimal} is zero.
*
@@ -1067,8 +1080,8 @@
*/
public BigDecimal(BigInteger val) {
scale = 0;
- intVal = val;
- intCompact = compactValFor(val);
+ intVal = toStrictBigInteger(val);
+ intCompact = compactValFor(intVal);
}
/**
@@ -1082,7 +1095,7 @@
* @since 1.5
*/
public BigDecimal(BigInteger val, MathContext mc) {
- this(val,0,mc);
+ this(toStrictBigInteger(val), 0, mc);
}
/**
@@ -1096,8 +1109,8 @@
*/
public BigDecimal(BigInteger unscaledVal, int scale) {
// Negative scales are now allowed
- this.intVal = unscaledVal;
- this.intCompact = compactValFor(unscaledVal);
+ this.intVal = toStrictBigInteger(unscaledVal);
+ this.intCompact = compactValFor(this.intVal);
this.scale = scale;
}
@@ -1115,6 +1128,7 @@
* @since 1.5
*/
public BigDecimal(BigInteger unscaledVal, int scale, MathContext mc) {
+ unscaledVal = toStrictBigInteger(unscaledVal);
long compactVal = compactValFor(unscaledVal);
int mcp = mc.precision;
int prec = 0;
@@ -4257,9 +4271,13 @@
= unsafe.objectFieldOffset(BigDecimal.class, "intCompact");
private static final long intValOffset
= unsafe.objectFieldOffset(BigDecimal.class, "intVal");
+ private static final long scaleOffset
+ = unsafe.objectFieldOffset(BigDecimal.class, "scale");
- static void setIntCompact(BigDecimal bd, long val) {
- unsafe.putLong(bd, intCompactOffset, val);
+ static void setIntValAndScale(BigDecimal bd, BigInteger intVal, int scale) {
+ unsafe.putReference(bd, intValOffset, intVal);
+ unsafe.putInt(bd, scaleOffset, scale);
+ unsafe.putLong(bd, intCompactOffset, compactValFor(intVal));
}
static void setIntValVolatile(BigDecimal bd, BigInteger val) {
@@ -4278,15 +4296,30 @@
@java.io.Serial
private void readObject(java.io.ObjectInputStream s)
throws IOException, ClassNotFoundException {
- // Read in all fields
- s.defaultReadObject();
- // validate possibly bad fields
- if (intVal == null) {
- String message = "BigDecimal: null intVal in stream";
- throw new java.io.StreamCorruptedException(message);
- // [all values of scale are now allowed]
+ // prepare to read the fields
+ ObjectInputStream.GetField fields = s.readFields();
+ BigInteger serialIntVal = (BigInteger) fields.get("intVal", null);
+
+ // Validate field data
+ if (serialIntVal == null) {
+ throw new StreamCorruptedException("Null or missing intVal in BigDecimal stream");
}
- UnsafeHolder.setIntCompact(this, compactValFor(intVal));
+ // Validate provenance of serialIntVal object
+ serialIntVal = toStrictBigInteger(serialIntVal);
+
+ // Any integer value is valid for scale
+ int serialScale = fields.get("scale", 0);
+
+ UnsafeHolder.setIntValAndScale(this, serialIntVal, serialScale);
+ }
+
+ /**
+ * Serialization without data not supported for this class.
+ */
+ @java.io.Serial
+ private void readObjectNoData()
+ throws ObjectStreamException {
+ throw new InvalidObjectException("Deserialized BigDecimal objects need data");
}
/**
diff -Nru openjdk-17-17.0.4+8/src/java.base/share/classes/java/math/BigInteger.java openjdk-17-17.0.5+8/src/java.base/share/classes/java/math/BigInteger.java
--- openjdk-17-17.0.4+8/src/java.base/share/classes/java/math/BigInteger.java 2022-07-14 08:05:38.000000000 +0000
+++ openjdk-17-17.0.5+8/src/java.base/share/classes/java/math/BigInteger.java 2022-10-10 13:07:22.000000000 +0000
@@ -30,9 +30,11 @@
package java.math;
import java.io.IOException;
+import java.io.InvalidObjectException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.io.ObjectStreamField;
+import java.io.ObjectStreamException;
import java.util.Arrays;
import java.util.Objects;
import java.util.Random;
@@ -4706,17 +4708,21 @@
// prepare to read the alternate persistent fields
ObjectInputStream.GetField fields = s.readFields();
- // Read the alternate persistent fields that we care about
- int sign = fields.get("signum", -2);
- byte[] magnitude = (byte[])fields.get("magnitude", null);
+ // Read and validate the alternate persistent fields that we
+ // care about, signum and magnitude
- // Validate signum
+ // Read and validate signum
+ int sign = fields.get("signum", -2);
if (sign < -1 || sign > 1) {
String message = "BigInteger: Invalid signum value";
if (fields.defaulted("signum"))
message = "BigInteger: Signum not present in stream";
throw new java.io.StreamCorruptedException(message);
}
+
+ // Read and validate magnitude
+ byte[] magnitude = (byte[])fields.get("magnitude", null);
+ magnitude = magnitude.clone(); // defensive copy
int[] mag = stripLeadingZeroBytes(magnitude, 0, magnitude.length);
if ((mag.length == 0) != (sign == 0)) {
String message = "BigInteger: signum-magnitude mismatch";
@@ -4725,18 +4731,24 @@
throw new java.io.StreamCorruptedException(message);
}
+ // Equivalent to checkRange() on mag local without assigning
+ // this.mag field
+ if (mag.length > MAX_MAG_LENGTH ||
+ (mag.length == MAX_MAG_LENGTH && mag[0] < 0)) {
+ throw new java.io.StreamCorruptedException("BigInteger: Out of the supported range");
+ }
+
// Commit final fields via Unsafe
- UnsafeHolder.putSign(this, sign);
+ UnsafeHolder.putSignAndMag(this, sign, mag);
+ }
- // Calculate mag field from magnitude and discard magnitude
- UnsafeHolder.putMag(this, mag);
- if (mag.length >= MAX_MAG_LENGTH) {
- try {
- checkRange();
- } catch (ArithmeticException e) {
- throw new java.io.StreamCorruptedException("BigInteger: Out of the supported range");
- }
- }
+ /**
+ * Serialization without data not supported for this class.
+ */
+ @java.io.Serial
+ private void readObjectNoData()
+ throws ObjectStreamException {
+ throw new InvalidObjectException("Deserialized BigInteger objects need data");
}
// Support for resetting final fields while deserializing
@@ -4748,11 +4760,8 @@
private static final long magOffset
= unsafe.objectFieldOffset(BigInteger.class, "mag");
- static void putSign(BigInteger bi, int sign) {
+ static void putSignAndMag(BigInteger bi, int sign, int[] magnitude) {
unsafe.putInt(bi, signumOffset, sign);
- }
-
- static void putMag(BigInteger bi, int[] magnitude) {
unsafe.putReference(bi, magOffset, magnitude);
}
}
diff -Nru openjdk-17-17.0.4+8/src/java.base/share/classes/java/net/doc-files/net-properties.html openjdk-17-17.0.5+8/src/java.base/share/classes/java/net/doc-files/net-properties.html
--- openjdk-17-17.0.4+8/src/java.base/share/classes/java/net/doc-files/net-properties.html 2022-07-14 08:05:38.000000000 +0000
+++ openjdk-17-17.0.5+8/src/java.base/share/classes/java/net/doc-files/net-properties.html 2022-10-10 13:07:22.000000000 +0000
@@ -176,6 +176,16 @@
If HTTP keepalive is enabled (see above) this value determines the
maximum number of idle connections that will be simultaneously kept
alive, per destination.
+ {@systemProperty http.keepAlive.time.server} and
+ {@systemProperty http.keepAlive.time.proxy}
+ These properties modify the behavior of the HTTP keepalive cache in the case
+ where the server (or proxy) has not specified a keepalive time. If the
+ property is set in this case, then idle connections will be closed after the
+ specified number of seconds. If the property is set, and the server does
+ specify a keepalive time in a "Keep-Alive" response header, then the time specified
+ by the server is used. If the property is not set and also the server
+ does not specify a keepalive time, then connections are kept alive for an
+ implementation defined time, assuming {@code http.keepAlive} is {@code true}.
{@systemProperty http.maxRedirects} (default: {@code 20})
This integer value determines the maximum number, for a given request,
of HTTP redirects that will be automatically followed by the
diff -Nru openjdk-17-17.0.4+8/src/java.base/share/classes/java/security/UnresolvedPermission.java openjdk-17-17.0.5+8/src/java.base/share/classes/java/security/UnresolvedPermission.java
--- openjdk-17-17.0.4+8/src/java.base/share/classes/java/security/UnresolvedPermission.java 2022-07-14 08:05:38.000000000 +0000
+++ openjdk-17-17.0.5+8/src/java.base/share/classes/java/security/UnresolvedPermission.java 2022-10-10 13:07:22.000000000 +0000
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2021, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -153,7 +153,7 @@
* Each chain is ordered bottom-to-top (i.e., with the signer certificate
* first and the (root) certificate authority last). The signer
* certificates are copied from the array. Subsequent changes to
- * the array will not affect this UnsolvedPermission.
+ * the array will not affect this UnresolvedPermission.
*/
public UnresolvedPermission(String type,
String name,
@@ -165,59 +165,63 @@
if (type == null)
throw new NullPointerException("type can't be null");
+ // Perform a defensive copy and reassign certs if we have a non-null
+ // reference
+ if (certs != null) {
+ certs = certs.clone();
+ }
+
this.type = type;
this.name = name;
this.actions = actions;
+
if (certs != null) {
// Extract the signer certs from the list of certificates.
- for (int i=0; i signerCerts =
- new ArrayList<>();
- i = 0;
- while (i < certs.length) {
- signerCerts.add(certs[i]);
- while (((i+1) < certs.length) &&
- ((X509Certificate)certs[i]).getIssuerX500Principal().equals(
- ((X509Certificate)certs[i+1]).getSubjectX500Principal())) {
- i++;
- }
- i++;
- }
- this.certs =
- new java.security.cert.Certificate[signerCerts.size()];
- signerCerts.toArray(this.certs);
+ i++;
+ }
+ if (count == certs.length) {
+ // All the certs are signer certs, so we store the entire
+ // array. No further processing is needed.
+ this.certs = certs;
+ return;
+ }
+
+ // extract the signer certs
+ ArrayList signerCerts =
+ new ArrayList<>();
+ i = 0;
+ while (i < certs.length) {
+ signerCerts.add(certs[i]);
+ while (((i + 1) < certs.length) &&
+ ((X509Certificate)certs[i]).getIssuerX500Principal().equals(
+ ((X509Certificate)certs[i + 1]).getSubjectX500Principal())) {
+ i++;
}
+ i++;
}
+ this.certs =
+ new java.security.cert.Certificate[signerCerts.size()];
+ signerCerts.toArray(this.certs);
}
}
@@ -310,6 +314,7 @@
*
* @return false.
*/
+ @Override
public boolean implies(Permission p) {
return false;
}
@@ -330,6 +335,7 @@
* type (class) name, permission name, actions, and
* certificates as this object.
*/
+ @Override
public boolean equals(Object obj) {
if (obj == this)
return true;
@@ -402,7 +408,7 @@
*
* @return a hash code value for this object.
*/
-
+ @Override
public int hashCode() {
int hash = type.hashCode();
if (name != null)
@@ -422,6 +428,7 @@
*
* @return the empty string "".
*/
+ @Override
public String getActions()
{
return "";
@@ -489,6 +496,7 @@
*
* @return information about this UnresolvedPermission.
*/
+ @Override
public String toString() {
return "(unresolved " + type + " " + name + " " + actions + ")";
}
@@ -500,7 +508,7 @@
* @return a new PermissionCollection object suitable for
* storing UnresolvedPermissions.
*/
-
+ @Override
public PermissionCollection newPermissionCollection() {
return new UnresolvedPermissionCollection();
}
diff -Nru openjdk-17-17.0.4+8/src/java.base/share/classes/jdk/internal/util/random/RandomSupport.java openjdk-17-17.0.5+8/src/java.base/share/classes/jdk/internal/util/random/RandomSupport.java
--- openjdk-17-17.0.4+8/src/java.base/share/classes/jdk/internal/util/random/RandomSupport.java 2022-07-14 08:05:38.000000000 +0000
+++ openjdk-17-17.0.5+8/src/java.base/share/classes/jdk/internal/util/random/RandomSupport.java 2022-10-10 13:07:22.000000000 +0000
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2020, 2021, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2020, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -645,7 +645,7 @@
if (origin < bound) {
r = r * (bound - origin) + origin;
if (r >= bound) // may need to correct a rounding problem
- r = Double.longBitsToDouble(Double.doubleToLongBits(bound) - 1);
+ r = Math.nextAfter(bound, origin);
}
return r;
}
@@ -677,7 +677,7 @@
double r = rng.nextDouble();
r = r * bound;
if (r >= bound) // may need to correct a rounding problem
- r = Double.longBitsToDouble(Double.doubleToLongBits(bound) - 1);
+ r = Math.nextDown(bound);
return r;
}
diff -Nru openjdk-17-17.0.4+8/src/java.base/share/classes/module-info.java openjdk-17-17.0.5+8/src/java.base/share/classes/module-info.java
--- openjdk-17-17.0.4+8/src/java.base/share/classes/module-info.java 2022-07-14 08:05:38.000000000 +0000
+++ openjdk-17-17.0.5+8/src/java.base/share/classes/module-info.java 2022-10-10 13:07:22.000000000 +0000
@@ -319,7 +319,8 @@
jdk.crypto.ec,
jdk.security.auth;
exports sun.security.provider.certpath to
- java.naming;
+ java.naming,
+ jdk.jartool;
exports sun.security.rsa to
jdk.crypto.cryptoki;
exports sun.security.timestamp to
diff -Nru openjdk-17-17.0.4+8/src/java.base/share/classes/sun/net/www/http/HttpClient.java openjdk-17-17.0.5+8/src/java.base/share/classes/sun/net/www/http/HttpClient.java
--- openjdk-17-17.0.4+8/src/java.base/share/classes/sun/net/www/http/HttpClient.java 2022-07-14 08:05:38.000000000 +0000
+++ openjdk-17-17.0.5+8/src/java.base/share/classes/sun/net/www/http/HttpClient.java 2022-10-10 13:07:22.000000000 +0000
@@ -122,13 +122,13 @@
recomputing the value of keepingAlive */
int keepAliveConnections = -1; /* number of keep-alives left */
- /**Idle timeout value, in milliseconds. Zero means infinity,
- * iff keepingAlive=true.
- * Unfortunately, we can't always believe this one. If I'm connected
- * through a Netscape proxy to a server that sent me a keep-alive
- * time of 15 sec, the proxy unilaterally terminates my connection
- * after 5 sec. So we have to hard code our effective timeout to
- * 4 sec for the case where we're using a proxy. *SIGH*
+ /*
+ * The timeout if specified by the server. Following values possible
+ * 0: the server specified no keep alive headers
+ * -1: the server provided "Connection: keep-alive" but did not specify a
+ * a particular time in a "Keep-Alive:" headers
+ * Positive values are the number of seconds specified by the server
+ * in a "Keep-Alive" header
*/
int keepAliveTimeout = 0;
@@ -235,7 +235,6 @@
return keepAliveProp;
}
-
public String getSpnegoCBT() {
return spnegoCBT;
}
@@ -898,7 +897,7 @@
responses.findValue("Keep-Alive"));
/* default should be larger in case of proxy */
keepAliveConnections = p.findInt("max", usingProxy?50:5);
- keepAliveTimeout = p.findInt("timeout", usingProxy?60:5);
+ keepAliveTimeout = p.findInt("timeout", -1);
}
} else if (b[7] != '0') {
/*
@@ -1151,6 +1150,10 @@
}
}
+ public boolean getUsingProxy() {
+ return usingProxy;
+ }
+
/**
* @return the proxy port being used for this client. Meaningless
* if getProxyHostUsed() gives null.
diff -Nru openjdk-17-17.0.4+8/src/java.base/share/classes/sun/net/www/http/KeepAliveCache.java openjdk-17-17.0.5+8/src/java.base/share/classes/sun/net/www/http/KeepAliveCache.java
--- openjdk-17-17.0.4+8/src/java.base/share/classes/sun/net/www/http/KeepAliveCache.java 2022-07-14 08:05:38.000000000 +0000
+++ openjdk-17-17.0.5+8/src/java.base/share/classes/sun/net/www/http/KeepAliveCache.java 2022-10-10 13:07:22.000000000 +0000
@@ -41,6 +41,8 @@
import jdk.internal.misc.InnocuousThread;
import sun.security.action.GetIntegerAction;
+import sun.net.www.protocol.http.HttpURLConnection;
+import sun.util.logging.PlatformLogger;
/**
* A class that implements a cache of idle Http connections for keep-alive
@@ -54,6 +56,32 @@
@java.io.Serial
private static final long serialVersionUID = -2937172892064557949L;
+ // Keep alive time set according to priority specified here:
+ // 1. If server specifies a time with a Keep-Alive header
+ // 2. If user specifies a time with system property below
+ // 3. Default values which depend on proxy vs server and whether
+ // a Connection: keep-alive header was sent by server
+
+ // name suffixed with "server" or "proxy"
+ private static final String keepAliveProp = "http.keepAlive.time.";
+
+ private static final int userKeepAliveServer;
+ private static final int userKeepAliveProxy;
+
+ static final PlatformLogger logger = HttpURLConnection.getHttpLogger();
+
+ @SuppressWarnings("removal")
+ static int getUserKeepAliveSeconds(String type) {
+ int v = AccessController.doPrivileged(
+ new GetIntegerAction(keepAliveProp+type, -1)).intValue();
+ return v < -1 ? -1 : v;
+ }
+
+ static {
+ userKeepAliveServer = getUserKeepAliveSeconds("server");
+ userKeepAliveProxy = getUserKeepAliveSeconds("proxy");
+ }
+
/* maximum # keep-alive connections to maintain at once
* This should be 2 by the HTTP spec, but because we don't support pipe-lining
* a larger value is more appropriate. So we now set a default of 5, and the value
@@ -126,10 +154,29 @@
if (v == null) {
int keepAliveTimeout = http.getKeepAliveTimeout();
- v = new ClientVector(keepAliveTimeout > 0 ?
- keepAliveTimeout * 1000 : LIFETIME);
- v.put(http);
- super.put(key, v);
+ if (keepAliveTimeout == 0) {
+ keepAliveTimeout = getUserKeepAlive(http.getUsingProxy());
+ if (keepAliveTimeout == -1) {
+ // same default for server and proxy
+ keepAliveTimeout = 5;
+ }
+ } else if (keepAliveTimeout == -1) {
+ keepAliveTimeout = getUserKeepAlive(http.getUsingProxy());
+ if (keepAliveTimeout == -1) {
+ // different default for server and proxy
+ keepAliveTimeout = http.getUsingProxy() ? 60 : 5;
+ }
+ }
+ // at this point keepAliveTimeout is the number of seconds to keep
+ // alive, which could be 0, if the user specified 0 for the property
+ assert keepAliveTimeout >= 0;
+ if (keepAliveTimeout == 0) {
+ http.closeServer();
+ } else {
+ v = new ClientVector(keepAliveTimeout * 1000);
+ v.put(http);
+ super.put(key, v);
+ }
} else {
v.put(http);
}
@@ -138,6 +185,11 @@
}
}
+ // returns the keep alive set by user in system property or -1 if not set
+ private static int getUserKeepAlive(boolean isProxy) {
+ return isProxy ? userKeepAliveProxy : userKeepAliveServer;
+ }
+
/* remove an obsolete HttpClient from its VectorCache */
public void remove(HttpClient h, Object obj) {
cacheLock.lock();
@@ -276,6 +328,11 @@
e.hc.closeServer();
} else {
hc = e.hc;
+ if (KeepAliveCache.logger.isLoggable(PlatformLogger.Level.FINEST)) {
+ String msg = "cached HttpClient was idle for "
+ + Long.toString(currentTime - e.idleStartTime);
+ KeepAliveCache.logger.finest(msg);
+ }
}
} while ((hc == null) && (!isEmpty()));
return hc;
diff -Nru openjdk-17-17.0.4+8/src/java.base/share/classes/sun/security/pkcs/SignerInfo.java openjdk-17-17.0.5+8/src/java.base/share/classes/sun/security/pkcs/SignerInfo.java
--- openjdk-17-17.0.4+8/src/java.base/share/classes/sun/security/pkcs/SignerInfo.java 2022-07-14 08:05:38.000000000 +0000
+++ openjdk-17-17.0.5+8/src/java.base/share/classes/sun/security/pkcs/SignerInfo.java 2022-10-10 13:07:22.000000000 +0000
@@ -76,10 +76,12 @@
/**
* A map containing the algorithms in this SignerInfo. This is used to
* avoid checking algorithms to see if they are disabled more than once.
- * The key is the AlgorithmId of the algorithm, and the value is the name of
- * the field or attribute.
+ * The key is the AlgorithmId of the algorithm, and the value is a record
+ * containing the name of the field or attribute and whether the key
+ * should also be checked (ex: if it is a signature algorithm).
*/
- private Map algorithms = new HashMap<>();
+ private record AlgorithmInfo(String field, boolean checkKey) {}
+ private Map algorithms = new HashMap<>();
public SignerInfo(X500Name issuerName,
BigInteger serial,
@@ -350,7 +352,8 @@
}
String digestAlgName = digestAlgorithmId.getName();
- algorithms.put(digestAlgorithmId, "SignerInfo digestAlgorithm field");
+ algorithms.put(digestAlgorithmId,
+ new AlgorithmInfo("SignerInfo digestAlgorithm field", false));
byte[] dataSigned;
@@ -428,7 +431,8 @@
new AlgorithmId(ObjectIdentifier.of(oid),
digestEncryptionAlgorithmId.getParameters());
algorithms.put(sigAlgId,
- "SignerInfo digestEncryptionAlgorithm field");
+ new AlgorithmInfo(
+ "SignerInfo digestEncryptionAlgorithm field", true));
}
X509Certificate cert = getCertificate(block);
@@ -685,7 +689,8 @@
throws NoSuchAlgorithmException, SignatureException {
AlgorithmId digestAlgId = token.getHashAlgorithm();
- algorithms.put(digestAlgId, "TimestampToken digestAlgorithm field");
+ algorithms.put(digestAlgId,
+ new AlgorithmInfo("TimestampToken digestAlgorithm field", false));
MessageDigest md = MessageDigest.getInstance(digestAlgId.getName());
@@ -742,18 +747,19 @@
*/
public static Set verifyAlgorithms(SignerInfo[] infos,
JarConstraintsParameters params, String name) throws SignatureException {
- Map algorithms = new HashMap<>();
+ Map algorithms = new HashMap<>();
for (SignerInfo info : infos) {
algorithms.putAll(info.algorithms);
}
Set enabledAlgorithms = new HashSet<>();
try {
- for (Map.Entry algorithm : algorithms.entrySet()) {
- params.setExtendedExceptionMsg(name, algorithm.getValue());
- AlgorithmId algId = algorithm.getKey();
+ for (var algEntry : algorithms.entrySet()) {
+ AlgorithmInfo info = algEntry.getValue();
+ params.setExtendedExceptionMsg(name, info.field());
+ AlgorithmId algId = algEntry.getKey();
JAR_DISABLED_CHECK.permits(algId.getName(),
- algId.getParameters(), params);
+ algId.getParameters(), params, info.checkKey());
enabledAlgorithms.add(algId.getName());
}
} catch (CertPathValidatorException e) {
diff -Nru openjdk-17-17.0.4+8/src/java.base/share/classes/sun/security/provider/certpath/AlgorithmChecker.java openjdk-17-17.0.5+8/src/java.base/share/classes/sun/security/provider/certpath/AlgorithmChecker.java
--- openjdk-17-17.0.4+8/src/java.base/share/classes/sun/security/provider/certpath/AlgorithmChecker.java 2022-07-14 08:05:38.000000000 +0000
+++ openjdk-17-17.0.5+8/src/java.base/share/classes/sun/security/provider/certpath/AlgorithmChecker.java 2022-10-10 13:07:22.000000000 +0000
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2009, 2020, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 2021, Oracle and/or its affiliates. All rights reserved.
* 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,7 +38,6 @@
import java.security.AlgorithmParameters;
import java.security.GeneralSecurityException;
import java.security.cert.Certificate;
-import java.security.cert.X509CRL;
import java.security.cert.X509Certificate;
import java.security.cert.PKIXCertPathChecker;
import java.security.cert.TrustAnchor;
@@ -57,7 +56,6 @@
import sun.security.validator.Validator;
import sun.security.x509.AlgorithmId;
import sun.security.x509.X509CertImpl;
-import sun.security.x509.X509CRLImpl;
/**
* A {@code PKIXCertPathChecker} implementation to check whether a
@@ -131,7 +129,7 @@
* certificate
* @param constraints the algorithm constraints (or null)
* @param date the date specified by the PKIXParameters date, or the
- * JAR timestamp if jar files are being validated and the
+ * timestamp if JAR files are being validated and the
* JAR is timestamped. May be null if no timestamp or
* PKIXParameter date is set.
* @param variant the Validator variant of the operation. A null value
@@ -160,17 +158,19 @@
/**
* Create a new {@code AlgorithmChecker} with the given {@code TrustAnchor},
- * {@code PKIXParameter} date, and {@code varient}
+ * {@code PKIXParameter} date, and {@code variant}.
*
* @param anchor the trust anchor selected to validate the target
* certificate
- * @param pkixdate Date the constraints are checked against. The value is
- * either the PKIXParameters date or null for the current date.
+ * @param date the date specified by the PKIXParameters date, or the
+ * timestamp if JAR files are being validated and the
+ * JAR is timestamped. May be null if no timestamp or
+ * PKIXParameter date is set.
* @param variant the Validator variant of the operation. A null value
* passed will set it to Validator.GENERIC.
*/
- public AlgorithmChecker(TrustAnchor anchor, Date pkixdate, String variant) {
- this(anchor, certPathDefaultConstraints, pkixdate, variant);
+ public AlgorithmChecker(TrustAnchor anchor, Date date, String variant) {
+ this(anchor, certPathDefaultConstraints, date, variant);
}
@Override
@@ -283,13 +283,13 @@
// Check against local constraints if it is DisabledAlgorithmConstraints
if (constraints instanceof DisabledAlgorithmConstraints) {
((DisabledAlgorithmConstraints)constraints).permits(currSigAlg,
- currSigAlgParams, cp);
+ currSigAlgParams, cp, true);
// DisabledAlgorithmsConstraints does not check primitives, so key
// additional key check.
} else {
// Perform the default constraints checking anyway.
- certPathDefaultConstraints.permits(currSigAlg, currSigAlgParams, cp);
+ certPathDefaultConstraints.permits(currSigAlg, currSigAlgParams, cp, true);
// Call locally set constraints to check key with primitives.
if (!constraints.permits(primitives, currPubKey)) {
throw new CertPathValidatorException(
@@ -379,29 +379,6 @@
* Check the signature algorithm with the specified public key.
*
* @param key the public key to verify the CRL signature
- * @param crl the target CRL
- * @param variant the Validator variant of the operation. A null value
- * passed will set it to Validator.GENERIC.
- * @param anchor the trust anchor selected to validate the CRL issuer
- */
- static void check(PublicKey key, X509CRL crl, String variant,
- TrustAnchor anchor) throws CertPathValidatorException {
-
- X509CRLImpl x509CRLImpl = null;
- try {
- x509CRLImpl = X509CRLImpl.toImpl(crl);
- } catch (CRLException ce) {
- throw new CertPathValidatorException(ce);
- }
-
- AlgorithmId algorithmId = x509CRLImpl.getSigAlgId();
- check(key, algorithmId, variant, anchor);
- }
-
- /**
- * Check the signature algorithm with the specified public key.
- *
- * @param key the public key to verify the CRL signature
* @param algorithmId signature algorithm Algorithm ID
* @param variant the Validator variant of the operation. A null
* value passed will set it to Validator.GENERIC.
@@ -412,7 +389,7 @@
certPathDefaultConstraints.permits(algorithmId.getName(),
algorithmId.getParameters(),
- new CertPathConstraintsParameters(key, variant, anchor));
+ new CertPathConstraintsParameters(key, variant, anchor), true);
}
}
diff -Nru openjdk-17-17.0.4+8/src/java.base/share/classes/sun/security/provider/certpath/CertPathConstraintsParameters.java openjdk-17-17.0.5+8/src/java.base/share/classes/sun/security/provider/certpath/CertPathConstraintsParameters.java
--- openjdk-17-17.0.4+8/src/java.base/share/classes/sun/security/provider/certpath/CertPathConstraintsParameters.java 2022-07-14 08:05:38.000000000 +0000
+++ openjdk-17-17.0.5+8/src/java.base/share/classes/sun/security/provider/certpath/CertPathConstraintsParameters.java 2022-10-10 13:07:22.000000000 +0000
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2020, 2021, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -39,7 +39,7 @@
* constraints specified in the jdk.certpath.disabledAlgorithms security
* property.
*/
-class CertPathConstraintsParameters implements ConstraintsParameters {
+public class CertPathConstraintsParameters implements ConstraintsParameters {
// The public key of the certificate
private final Key key;
// The certificate's trust anchor which will be checked against the
@@ -103,7 +103,7 @@
@Override
public String toString() {
StringBuilder sb = new StringBuilder("[\n");
- sb.append("\n Variant: ").append(variant);
+ sb.append(" Variant: ").append(variant);
if (anchor != null) {
sb.append("\n Anchor: ").append(anchor);
}
diff -Nru openjdk-17-17.0.4+8/src/java.base/share/classes/sun/security/provider/certpath/DistributionPointFetcher.java openjdk-17-17.0.5+8/src/java.base/share/classes/sun/security/provider/certpath/DistributionPointFetcher.java
--- openjdk-17-17.0.4+8/src/java.base/share/classes/sun/security/provider/certpath/DistributionPointFetcher.java 2022-07-14 08:05:38.000000000 +0000
+++ openjdk-17-17.0.5+8/src/java.base/share/classes/sun/security/provider/certpath/DistributionPointFetcher.java 2022-10-10 13:07:22.000000000 +0000
@@ -691,7 +691,8 @@
// check the crl signature algorithm
try {
- AlgorithmChecker.check(prevKey, crl, variant, anchor);
+ AlgorithmChecker.check(prevKey, crlImpl.getSigAlgId(),
+ variant, anchor);
} catch (CertPathValidatorException cpve) {
if (debug != null) {
debug.println("CRL signature algorithm check failed: " + cpve);
diff -Nru openjdk-17-17.0.4+8/src/java.base/share/classes/sun/security/provider/certpath/PKIXCertPathValidator.java openjdk-17-17.0.5+8/src/java.base/share/classes/sun/security/provider/certpath/PKIXCertPathValidator.java
--- openjdk-17-17.0.4+8/src/java.base/share/classes/sun/security/provider/certpath/PKIXCertPathValidator.java 2022-07-14 08:05:38.000000000 +0000
+++ openjdk-17-17.0.5+8/src/java.base/share/classes/sun/security/provider/certpath/PKIXCertPathValidator.java 2022-10-10 13:07:22.000000000 +0000
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2020, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2021, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -176,8 +176,8 @@
List certPathCheckers = new ArrayList<>();
// add standard checkers that we will be using
certPathCheckers.add(untrustedChecker);
- certPathCheckers.add(new AlgorithmChecker(anchor, null, params.date(),
- params.variant()));
+ certPathCheckers.add(new AlgorithmChecker(anchor, null,
+ params.timestamp(), params.variant()));
certPathCheckers.add(new KeyChecker(certPathLen,
params.targetCertConstraints()));
certPathCheckers.add(new ConstraintsChecker(certPathLen));
diff -Nru openjdk-17-17.0.4+8/src/java.base/share/classes/sun/security/provider/certpath/PKIX.java openjdk-17-17.0.5+8/src/java.base/share/classes/sun/security/provider/certpath/PKIX.java
--- openjdk-17-17.0.4+8/src/java.base/share/classes/sun/security/provider/certpath/PKIX.java 2022-07-14 08:05:38.000000000 +0000
+++ openjdk-17-17.0.5+8/src/java.base/share/classes/sun/security/provider/certpath/PKIX.java 2022-10-10 13:07:22.000000000 +0000
@@ -88,6 +88,7 @@
private Set anchors;
private List certs;
private Timestamp timestamp;
+ private Date timestampDate;
private String variant = Validator.VAR_GENERIC;
ValidatorParams(CertPath cp, PKIXParameters params)
@@ -154,10 +155,20 @@
stores = params.getCertStores();
return stores;
}
+ // The date() param is used when enforcing the validity period
+ // of certificates and when checking the time period of revocation data.
+ // The main difference between the date() and timestamp() method is
+ // that the date() method only uses the timestamp (if specified)
+ // for certificates in a code signer's chain.
Date date() {
if (!gotDate) {
- // use timestamp if checking signed code that is
- // timestamped, otherwise use date parameter
+ // Use timestamp if checking signed code that is
+ // timestamped, otherwise use date parameter.
+ // Note that TSA server certificates do not use the
+ // timestamp, which means that an expired TSA certificate
+ // is considered a validation failure. This policy means
+ // that signed and timestamped code is valid until the TSA
+ // certificate expires (assuming all other checks are valid).
if (timestamp != null &&
(variant.equals(Validator.VAR_CODE_SIGNING) ||
variant.equals(Validator.VAR_PLUGIN_CODE_SIGNING))) {
@@ -210,6 +221,17 @@
String variant() {
return variant;
}
+ // The timestamp() param is passed as the date param when creating an
+ // AlgorithmChecker. An AlgorithmChecker always uses the timestamp
+ // if specified in order to enforce the denyAfter constraint.
+ Date timestamp() {
+ // return timestamp date if set, otherwise use date parameter
+ if (timestampDate == null) {
+ timestampDate = (timestamp != null)
+ ? timestamp.getTimestamp() : date();
+ }
+ return timestampDate;
+ }
}
static class BuilderParams extends ValidatorParams {
diff -Nru openjdk-17-17.0.4+8/src/java.base/share/classes/sun/security/provider/certpath/SunCertPathBuilder.java openjdk-17-17.0.5+8/src/java.base/share/classes/sun/security/provider/certpath/SunCertPathBuilder.java
--- openjdk-17-17.0.4+8/src/java.base/share/classes/sun/security/provider/certpath/SunCertPathBuilder.java 2022-07-14 08:05:38.000000000 +0000
+++ openjdk-17-17.0.5+8/src/java.base/share/classes/sun/security/provider/certpath/SunCertPathBuilder.java 2022-10-10 13:07:22.000000000 +0000
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2021, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -344,7 +344,7 @@
// add the algorithm checker
checkers.add(new AlgorithmChecker(builder.trustAnchor,
- buildParams.date(), buildParams.variant()));
+ buildParams.timestamp(), buildParams.variant()));
BasicChecker basicChecker = null;
if (nextState.keyParamsNeeded()) {
diff -Nru openjdk-17-17.0.4+8/src/java.base/share/classes/sun/security/ssl/HandshakeContext.java openjdk-17-17.0.5+8/src/java.base/share/classes/sun/security/ssl/HandshakeContext.java
--- openjdk-17-17.0.4+8/src/java.base/share/classes/sun/security/ssl/HandshakeContext.java 2022-07-14 08:05:38.000000000 +0000
+++ openjdk-17-17.0.5+8/src/java.base/share/classes/sun/security/ssl/HandshakeContext.java 2022-10-10 13:07:22.000000000 +0000
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018, 2021, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2018, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -164,7 +164,7 @@
this.conContext = conContext;
this.sslConfig = (SSLConfiguration)conContext.sslConfig.clone();
- this.algorithmConstraints = new SSLAlgorithmConstraints(
+ this.algorithmConstraints = SSLAlgorithmConstraints.wrap(
sslConfig.userSpecifiedAlgorithmConstraints);
this.activeProtocols = getActiveProtocols(sslConfig.enabledProtocols,
sslConfig.enabledCipherSuites, algorithmConstraints);
diff -Nru openjdk-17-17.0.4+8/src/java.base/share/classes/sun/security/ssl/SSLAlgorithmConstraints.java openjdk-17-17.0.5+8/src/java.base/share/classes/sun/security/ssl/SSLAlgorithmConstraints.java
--- openjdk-17-17.0.4+8/src/java.base/share/classes/sun/security/ssl/SSLAlgorithmConstraints.java 2022-07-14 08:05:38.000000000 +0000
+++ openjdk-17-17.0.5+8/src/java.base/share/classes/sun/security/ssl/SSLAlgorithmConstraints.java 2022-10-10 13:07:22.000000000 +0000
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -57,46 +57,98 @@
// the default algorithm constraints
static final AlgorithmConstraints DEFAULT =
- new SSLAlgorithmConstraints(null);
+ new SSLAlgorithmConstraints(null, true);
// the default SSL only algorithm constraints
static final AlgorithmConstraints DEFAULT_SSL_ONLY =
- new SSLAlgorithmConstraints((SSLSocket)null, false);
+ new SSLAlgorithmConstraints(null, false);
- SSLAlgorithmConstraints(AlgorithmConstraints userSpecifiedConstraints) {
- this.userSpecifiedConstraints = userSpecifiedConstraints;
- this.peerSpecifiedConstraints = null;
- this.enabledX509DisabledAlgConstraints = true;
+ private SSLAlgorithmConstraints(AlgorithmConstraints userSpecifiedConstraints,
+ boolean enabledX509DisabledAlgConstraints) {
+ this(userSpecifiedConstraints, null, enabledX509DisabledAlgConstraints);
}
- SSLAlgorithmConstraints(SSLSocket socket,
+ private SSLAlgorithmConstraints(
+ AlgorithmConstraints userSpecifiedConstraints,
+ SupportedSignatureAlgorithmConstraints peerSpecifiedConstraints,
boolean withDefaultCertPathConstraints) {
- this.userSpecifiedConstraints = getUserSpecifiedConstraints(socket);
- this.peerSpecifiedConstraints = null;
+ this.userSpecifiedConstraints = userSpecifiedConstraints;
+ this.peerSpecifiedConstraints = peerSpecifiedConstraints;
this.enabledX509DisabledAlgConstraints = withDefaultCertPathConstraints;
}
- SSLAlgorithmConstraints(SSLEngine engine,
+ /**
+ * Returns a SSLAlgorithmConstraints instance that checks the provided
+ * {@code userSpecifiedConstraints} in addition to standard checks.
+ * Returns a singleton instance if parameter is null or DEFAULT.
+ * @param userSpecifiedConstraints additional constraints to check
+ * @return a SSLAlgorithmConstraints instance
+ */
+ static AlgorithmConstraints wrap(AlgorithmConstraints userSpecifiedConstraints) {
+ return wrap(userSpecifiedConstraints, true);
+ }
+
+ private static AlgorithmConstraints wrap(
+ AlgorithmConstraints userSpecifiedConstraints,
boolean withDefaultCertPathConstraints) {
- this.userSpecifiedConstraints = getUserSpecifiedConstraints(engine);
- this.peerSpecifiedConstraints = null;
- this.enabledX509DisabledAlgConstraints = withDefaultCertPathConstraints;
+ if (nullIfDefault(userSpecifiedConstraints) == null) {
+ return withDefaultCertPathConstraints ? DEFAULT : DEFAULT_SSL_ONLY;
+ }
+ return new SSLAlgorithmConstraints(userSpecifiedConstraints,
+ withDefaultCertPathConstraints);
+ }
+
+ /**
+ * Returns a SSLAlgorithmConstraints instance that checks the constraints
+ * configured for the given {@code socket} in addition to standard checks.
+ * Returns a singleton instance if the constraints are null or DEFAULT.
+ * @param socket socket with configured constraints
+ * @return a SSLAlgorithmConstraints instance
+ */
+ static AlgorithmConstraints forSocket(SSLSocket socket,
+ boolean withDefaultCertPathConstraints) {
+ AlgorithmConstraints userSpecifiedConstraints =
+ getUserSpecifiedConstraints(socket);
+ return wrap(userSpecifiedConstraints, withDefaultCertPathConstraints);
}
- SSLAlgorithmConstraints(SSLSocket socket, String[] supportedAlgorithms,
+ static SSLAlgorithmConstraints forSocket(
+ SSLSocket socket,
+ String[] supportedAlgorithms,
boolean withDefaultCertPathConstraints) {
- this.userSpecifiedConstraints = getUserSpecifiedConstraints(socket);
- this.peerSpecifiedConstraints =
- new SupportedSignatureAlgorithmConstraints(supportedAlgorithms);
- this.enabledX509DisabledAlgConstraints = withDefaultCertPathConstraints;
+ return new SSLAlgorithmConstraints(
+ nullIfDefault(getUserSpecifiedConstraints(socket)),
+ new SupportedSignatureAlgorithmConstraints(supportedAlgorithms),
+ withDefaultCertPathConstraints);
+ }
+
+ /**
+ * Returns a SSLAlgorithmConstraints instance that checks the constraints
+ * configured for the given {@code engine} in addition to standard checks.
+ * Returns a singleton instance if the constraints are null or DEFAULT.
+ * @param engine engine with configured constraints
+ * @return a SSLAlgorithmConstraints instance
+ */
+ static AlgorithmConstraints forEngine(SSLEngine engine,
+ boolean withDefaultCertPathConstraints) {
+ AlgorithmConstraints userSpecifiedConstraints =
+ getUserSpecifiedConstraints(engine);
+ return wrap(userSpecifiedConstraints, withDefaultCertPathConstraints);
}
- SSLAlgorithmConstraints(SSLEngine engine, String[] supportedAlgorithms,
+ static SSLAlgorithmConstraints forEngine(
+ SSLEngine engine,
+ String[] supportedAlgorithms,
boolean withDefaultCertPathConstraints) {
- this.userSpecifiedConstraints = getUserSpecifiedConstraints(engine);
- this.peerSpecifiedConstraints =
- new SupportedSignatureAlgorithmConstraints(supportedAlgorithms);
- this.enabledX509DisabledAlgConstraints = withDefaultCertPathConstraints;
+ return new SSLAlgorithmConstraints(
+ nullIfDefault(getUserSpecifiedConstraints(engine)),
+ new SupportedSignatureAlgorithmConstraints(supportedAlgorithms),
+ withDefaultCertPathConstraints);
+ }
+
+ private static AlgorithmConstraints nullIfDefault(
+ AlgorithmConstraints constraints) {
+ return constraints == DEFAULT ? null : constraints;
}
private static AlgorithmConstraints getUserSpecifiedConstraints(
diff -Nru openjdk-17-17.0.4+8/src/java.base/share/classes/sun/security/ssl/SSLContextImpl.java openjdk-17-17.0.5+8/src/java.base/share/classes/sun/security/ssl/SSLContextImpl.java
--- openjdk-17-17.0.4+8/src/java.base/share/classes/sun/security/ssl/SSLContextImpl.java 2022-07-14 08:05:38.000000000 +0000
+++ openjdk-17-17.0.5+8/src/java.base/share/classes/sun/security/ssl/SSLContextImpl.java 2022-10-10 13:07:22.000000000 +0000
@@ -1485,14 +1485,14 @@
String[] peerSupportedSignAlgs =
extSession.getLocalSupportedSignatureAlgorithms();
- constraints = new SSLAlgorithmConstraints(
+ constraints = SSLAlgorithmConstraints.forSocket(
sslSocket, peerSupportedSignAlgs, true);
} else {
constraints =
- new SSLAlgorithmConstraints(sslSocket, true);
+ SSLAlgorithmConstraints.forSocket(sslSocket, true);
}
} else {
- constraints = new SSLAlgorithmConstraints(sslSocket, true);
+ constraints = SSLAlgorithmConstraints.forSocket(sslSocket, true);
}
checkAlgorithmConstraints(chain, constraints, checkClientTrusted);
@@ -1525,14 +1525,14 @@
String[] peerSupportedSignAlgs =
extSession.getLocalSupportedSignatureAlgorithms();
- constraints = new SSLAlgorithmConstraints(
+ constraints = SSLAlgorithmConstraints.forEngine(
engine, peerSupportedSignAlgs, true);
} else {
constraints =
- new SSLAlgorithmConstraints(engine, true);
+ SSLAlgorithmConstraints.forEngine(engine, true);
}
} else {
- constraints = new SSLAlgorithmConstraints(engine, true);
+ constraints = SSLAlgorithmConstraints.forEngine(engine, true);
}
checkAlgorithmConstraints(chain, constraints, checkClientTrusted);
diff -Nru openjdk-17-17.0.4+8/src/java.base/share/classes/sun/security/ssl/X509KeyManagerImpl.java openjdk-17-17.0.5+8/src/java.base/share/classes/sun/security/ssl/X509KeyManagerImpl.java
--- openjdk-17-17.0.4+8/src/java.base/share/classes/sun/security/ssl/X509KeyManagerImpl.java 2022-07-14 08:05:38.000000000 +0000
+++ openjdk-17-17.0.5+8/src/java.base/share/classes/sun/security/ssl/X509KeyManagerImpl.java 2022-10-10 13:07:22.000000000 +0000
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2004, 2021, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2004, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -199,15 +199,15 @@
extSession.getPeerSupportedSignatureAlgorithms();
}
- return new SSLAlgorithmConstraints(
+ return SSLAlgorithmConstraints.forSocket(
sslSocket, peerSupportedSignAlgs, true);
}
}
- return new SSLAlgorithmConstraints(sslSocket, true);
+ return SSLAlgorithmConstraints.forSocket(sslSocket, true);
}
- return new SSLAlgorithmConstraints((SSLSocket)null, true);
+ return SSLAlgorithmConstraints.DEFAULT;
}
// Gets algorithm constraints of the engine.
@@ -225,13 +225,13 @@
extSession.getPeerSupportedSignatureAlgorithms();
}
- return new SSLAlgorithmConstraints(
+ return SSLAlgorithmConstraints.forEngine(
engine, peerSupportedSignAlgs, true);
}
}
}
- return new SSLAlgorithmConstraints(engine, true);
+ return SSLAlgorithmConstraints.forEngine(engine, true);
}
// we construct the alias we return to JSSE as seen in the code below
diff -Nru openjdk-17-17.0.4+8/src/java.base/share/classes/sun/security/ssl/X509TrustManagerImpl.java openjdk-17-17.0.5+8/src/java.base/share/classes/sun/security/ssl/X509TrustManagerImpl.java
--- openjdk-17-17.0.4+8/src/java.base/share/classes/sun/security/ssl/X509TrustManagerImpl.java 2022-07-14 08:05:38.000000000 +0000
+++ openjdk-17-17.0.5+8/src/java.base/share/classes/sun/security/ssl/X509TrustManagerImpl.java 2022-10-10 13:07:22.000000000 +0000
@@ -216,10 +216,10 @@
String[] localSupportedSignAlgs =
extSession.getLocalSupportedSignatureAlgorithms();
- constraints = new SSLAlgorithmConstraints(
+ constraints = SSLAlgorithmConstraints.forSocket(
sslSocket, localSupportedSignAlgs, false);
} else {
- constraints = new SSLAlgorithmConstraints(sslSocket, false);
+ constraints = SSLAlgorithmConstraints.forSocket(sslSocket, false);
}
// Grab any stapled OCSP responses for use in validation
@@ -270,10 +270,10 @@
String[] localSupportedSignAlgs =
extSession.getLocalSupportedSignatureAlgorithms();
- constraints = new SSLAlgorithmConstraints(
+ constraints = SSLAlgorithmConstraints.forEngine(
engine, localSupportedSignAlgs, false);
} else {
- constraints = new SSLAlgorithmConstraints(engine, false);
+ constraints = SSLAlgorithmConstraints.forEngine(engine, false);
}
// Grab any stapled OCSP responses for use in validation
diff -Nru openjdk-17-17.0.4+8/src/java.base/share/classes/sun/security/tools/KeyStoreUtil.java openjdk-17-17.0.5+8/src/java.base/share/classes/sun/security/tools/KeyStoreUtil.java
--- openjdk-17-17.0.4+8/src/java.base/share/classes/sun/security/tools/KeyStoreUtil.java 2022-07-14 08:05:38.000000000 +0000
+++ openjdk-17-17.0.5+8/src/java.base/share/classes/sun/security/tools/KeyStoreUtil.java 2022-10-10 13:07:22.000000000 +0000
@@ -91,7 +91,11 @@
public static boolean isWindowsKeyStore(String storetype) {
return storetype != null
&& (storetype.equalsIgnoreCase("Windows-MY")
- || storetype.equalsIgnoreCase("Windows-ROOT"));
+ || storetype.equalsIgnoreCase("Windows-ROOT")
+ || storetype.equalsIgnoreCase("Windows-MY-CURRENTUSER")
+ || storetype.equalsIgnoreCase("Windows-ROOT-CURRENTUSER")
+ || storetype.equalsIgnoreCase("Windows-MY-LOCALMACHINE")
+ || storetype.equalsIgnoreCase("Windows-ROOT-LOCALMACHINE"));
}
/**
@@ -102,6 +106,14 @@
return "Windows-MY";
} else if(storetype.equalsIgnoreCase("Windows-ROOT")) {
return "Windows-ROOT";
+ } else if(storetype.equalsIgnoreCase("Windows-MY-CURRENTUSER")) {
+ return "Windows-MY-CURRENTUSER";
+ } else if(storetype.equalsIgnoreCase("Windows-ROOT-CURRENTUSER")) {
+ return "Windows-ROOT-CURRENTUSER";
+ } else if(storetype.equalsIgnoreCase("Windows-MY-LOCALMACHINE")) {
+ return "Windows-MY-LOCALMACHINE";
+ } else if(storetype.equalsIgnoreCase("Windows-ROOT-LOCALMACHINE")) {
+ return "Windows-ROOT-LOCALMACHINE";
} else {
return storetype.toUpperCase(Locale.ENGLISH);
}
diff -Nru openjdk-17-17.0.4+8/src/java.base/share/classes/sun/security/util/DisabledAlgorithmConstraints.java openjdk-17-17.0.5+8/src/java.base/share/classes/sun/security/util/DisabledAlgorithmConstraints.java
--- openjdk-17-17.0.4+8/src/java.base/share/classes/sun/security/util/DisabledAlgorithmConstraints.java 2022-07-14 08:05:38.000000000 +0000
+++ openjdk-17-17.0.5+8/src/java.base/share/classes/sun/security/util/DisabledAlgorithmConstraints.java 2022-10-10 13:07:22.000000000 +0000
@@ -27,6 +27,7 @@
import sun.security.validator.Validator;
+import java.lang.ref.SoftReference;
import java.security.AlgorithmParameters;
import java.security.CryptoPrimitive;
import java.security.Key;
@@ -39,7 +40,6 @@
import java.security.spec.MGF1ParameterSpec;
import java.security.spec.NamedParameterSpec;
import java.security.spec.PSSParameterSpec;
-import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Calendar;
@@ -53,6 +53,7 @@
import java.util.Collection;
import java.util.StringTokenizer;
import java.util.TimeZone;
+import java.util.concurrent.ConcurrentHashMap;
import java.util.regex.Pattern;
import java.util.regex.Matcher;
@@ -100,6 +101,8 @@
private final Set disabledAlgorithms;
private final Constraints algorithmConstraints;
+ private volatile SoftReference